Friday, August 5, 2022

vim 9.0 dont recognise stuff from 8.2

i had vim 8.2 , and system wide settings in /etc/vim , where  vimrc is located, but now, vim 9.0 doesn't recognise it, it installed itself in /usr/share/vim  , tried creating symbolic link there, to my /etc/vim, but it doesn't recognise it, it shows something like that it can't load default settings.

also, my plugins which are located in home directory are broken, it can't load them, i don't know how much of vimscript has changed, but, nothing works.

my plugins are: plugged , undo_dir , lightline, fzf-master

And this is my vimrc file, i don't know how much and what is supported by new version (and how to convert to make it usable) :


" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below.  If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
:set number
:set showmatch
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.
" let g:skip_defaults_vim = 1

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on

set hidden

"jos neka
filetype plugin indent on


set path+=/mnt/2642BC0642BBD92F/Users/igor/Documents/Fakultet

" moja podesavanja
:set background=dark

" moja podesavanja
:set encoding=utf-8
:set fileencodings=ucs-bom,utf8,latin1
:set showmatch
:set number
:syntax enable
:colorscheme atom-dark
"da bi koristio font, treba da ga imas instaliran u OS koji koristis

set guifont=Consolas\ 10
"this one does the trick (below) , but upper is okay to stay. but only if you
"install vim-gtk3.
 "
set guifont=Consolas:h10:cANSI
set nocompatible
set autoindent

execute pathogen#infect()
filetype plugin indent on

set foldmethod=indent
setlocal foldlevelstart=99

let g:airline#extensions#tabline#enabled = 1
"filetype off

if &diff
    highlight! link DiffText MatchParen
endif



inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
inoremap jk <ESC>
let mapleader = ","
"remap to copy to system clipboard"

"this all yanking/deleting in system clipboard, if you one day want to use
"other registry , this will use only system clipboard, registry"
:set clipboard=unnamed

" In insert or command mode, move normally by using Ctrl. ovo je da mozes se
" kretati, u insert mode i command mode, a da ne moras uopste da koristis
" strelice , nice
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>

""noremap <Leader>y "*y
""noremap <Leader>p "*p
"
noremap <Leader>y "+y
noremap <Leader>p "+p



:colorscheme atom-dark-256
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd        " Show (partial) command in status line.
"set showmatch        " Show matching brackets.
"set ignorecase        " Do case insensitive matching
"set smartcase        " Do smart case matching
"set incsearch        " Incremental search
"set autowrite        " Automatically save before commands like :next and :make
"set hidden        " Hide buffers when they are abandoned
"set mouse=a        " Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif


"move between tabs with ctrl and left/right keys
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>

"show tab number, and number of modified buffers in that tab
set tabline=%!MyTabLine()  " custom tab pages line
function MyTabLine()
        let s = '' " complete tabline goes here
        " loop through each tab page
        for t in range(tabpagenr('$'))
                " set highlight
                if t + 1 == tabpagenr()
                        let s .= '%#TabLineSel#'
                else
                        let s .= '%#TabLine#'
                endif
                " set the tab page number (for mouse clicks)
                let s .= '%' . (t + 1) . 'T'
                let s .= ' '
                " set page number string
                let s .= t + 1 . ' '
                " get buffer names and statuses
                let n = ''      "temp string for buffer names while we loop and check buftype
                let m = 0       " &modified counter
                let bc = len(tabpagebuflist(t + 1))     "counter to avoid last ' '
                " loop through each buffer in a tab
                for b in tabpagebuflist(t + 1)
                        " buffer types: quickfix gets a [Q], help gets [H]{base fname}
                        " others get 1dir/2dir/3dir/fname shortened to 1/2/3/fname
                        if getbufvar( b, "&buftype" ) == 'help'
                                let n .= '[H]' . fnamemodify( bufname(b), ':t:s/.txt$//' )
                        elseif getbufvar( b, "&buftype" ) == 'quickfix'
                                let n .= '[Q]'
                        else
                                let n .= pathshorten(bufname(b))
                        endif
                        " check and ++ tab's &modified count
                        if getbufvar( b, "&modified" )
                                let m += 1
                        endif
                        " no final ' ' added...formatting looks better done later
                        if bc > 1
                                let n .= ' '
                        endif
                        let bc -= 1
                endfor
                " add modified label [n+] where n pages in tab are modified
                if m > 0
                        let s .= '[' . m . '+]'
                endif
                " select the highlighting for the buffer names
                " my default highlighting only underlines the active tab
                " buffer names.
                if t + 1 == tabpagenr()
                        let s .= '%#TabLineSel#'
                else
                        let s .= '%#TabLine#'
                endif
                " add buffer names
                if n == ''
                        let s.= '[New]'
                else
                        let s .= n
                endif
                " switch to no underlining and add final space to buffer list
                let s .= ' '
        endfor
        " after the last tab fill with TabLineFill and reset tab page nr
        let s .= '%#TabLineFill#%T'
        " right-align the label to close the current tab page
        if tabpagenr('$') > 1
                let s .= '%=%#TabLineFill#%999Xclose'
        endif
        return s
endfunction


"fzf plugin
call plug#begin()
Plug 'junegunn/fzf.vim'
Plug 'MattesGroeger/vim-bookmarks'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'simnalamburt/vim-mundo'
Plug 'junegunn/vim-peekaboo'
call plug

No comments: