X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vimrc;h=a76c813ab70448816b9c0174fc21750ca58a55ab;hp=97f506d8ee02f5e107b3d955bbca9e9477a64abc;hb=HEAD;hpb=bb89ba6b30836733f4454d5b398ed2f41f936167 diff --git a/vim/.vimrc b/vim/.vimrc index 97f506d..433a95c 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -8,11 +8,10 @@ set nocompatible set encoding=utf-8 "set t_kD= set mouse="" " if Vim is compiled with mouse support -set nomodeline -set viminfo='100,<50,s10,f1,%,n~/secure/vim/info +set viminfo-=h +set viminfo+=f1,%,n~/secure/vim/info set viewdir=~/secure/vim/view -set history=128 set directory=~/secure/vim/tmp set undodir=~/secure/vim/undo set undofile @@ -28,15 +27,19 @@ set backspace=indent,eol set shortmess=aoOtI set highlight-=v:Visual set highlight+=vr +set highlight+=sr set cpoptions+=$ set showcmd set showmatch -set listchars=trail:·,tab:→→,nbsp:% ",eol:¶ -set list +set completeopt-=preview +set diffopt+=indent-heuristic,algorithm:histogram set cursorline set cursorcolumn set colorcolumn=80 + +set listchars=trail:·,tab:>→,nbsp:% ",eol:¶ +set list highlight ExtraWhitespace ctermbg=green ctermfg=blue match ExtraWhitespace /\s\+$/ @@ -48,11 +51,14 @@ set smartcase set hlsearch set incsearch set gdefault -set wildmode=longest:list -set tags=tags;,./; -set wildignore=**/_build/*,**/tags,**/.git,**/.hypothesis +map :nohlsearch:call mark#Toggle() + +set wildmode=list:longest +set tags=.tags/**/tags; +set wildignore=**/.git,**/.tags -map :nohlsearch:MarkClear +set exrc +set secure " Folding {{{ set foldmethod=indent @@ -67,29 +73,28 @@ highlight CursorColumn ctermfg=cyan ctermbg=red " }}} " Statusline {{{ -highlight User1 ctermbg=blue ctermfg=black -highlight User2 ctermbg=green ctermfg=black -highlight User3 ctermbg=yellow ctermfg=black -highlight User4 ctermbg=red ctermfg=black +let MeinStatus = {-> exists("b:mein_status_func") ? b:mein_status_func() : ""} set laststatus=2 -set statusline=%n\|%F%m%r%h%w%q\ %= -set statusline+=%1*%Y[%{strlen(&fenc)?&fenc:&enc},%{&ff}] -set statusline+=%2*[%l/%L] -set statusline+=%3*[%c%V:0x%B] -set statusline+=%4*%{LintStatus()} +set statusline=%F\ %m%r%h%w%k +set statusline+=%{len(getqflist())?'[Q]':''} +set statusline+=%{len(getloclist(0))?'[L]':''} +set statusline+=\ %= +set statusline+=%n\ %#Question#%Y +set statusline+=%#DiffChange#%{strlen(&fenc)?&fenc:&enc}%{&bomb?'-bom':''}\ %{&ff} +set statusline+=%#DiffAdd#%l/%L +set statusline+=%#Todo#%c%V:0x%B +set statusline+=%#Comment#%o +set statusline+=%#Error#%{MeinStatus()} set statusline+=%*\ %P - -function! LintStatus() " it is overrided in ftplugin/python/pylint.vim - return "" -endfunction " }}} " View saving {{{ -autocmd BufWinLeave *.* mkview -autocmd BufWinEnter *.* silent loadview +autocmd BufWinLeave ?* silent! if &ft !=# "gitcommit" | mkview | endif +autocmd BufWinEnter ?* silent! loadview " }}} " Windows related {{{ +nnoremap noremap j noremap k noremap l @@ -103,68 +108,76 @@ autocmd VimResized * wincmd = " Tmux window naming {{{ set titleold = "" set title +autocmd BufEnter * let &titlestring = expand("%:t") " }}} " Fugitive {{{ -let g:fugitive_git_executable = "LANG=en.UTF-8 git" -nmap "cyiw:execute "Gvsplit " . @czR +nmap :Gvsplit zR nmap :diffupdate:syntax off:syntax on " }}} " *-lists indentation and formatting {{{ set comments-=mb:* set formatlistpat=^\\s*\\*\ \\s* -set formatoptions+=n +set formatoptions+=onj " }}} -autocmd BufEnter * let &titlestring = expand("%:t") - -set keywordprg= +" Spelling {{{ +set spelllang=ru,en_gb +highlight SpellBad cterm=inverse ctermfg=red ctermbg=black +highlight SpellLocal term=reverse ctermfg=red ctermbg=cyan +" }}} -let g:netrw_banner = 0 -let g:netrw_bufsettings = "noma nomod nowrap ro nobl" +" Unimpaired-like textwidth switching {{{ +nmap [ob :set textwidth=72 +nmap ]ob :set textwidth=0 +" }}} -" Often typos +" Often typos {{{ map q: : command! W w +nmap :help! +imap :help! +iabbrev итд и т.д. +iabbrev итп и т.п. +" }}} + +let g:tex_flavor = "latex" +set keywordprg=:LspHover +let g:sh_no_error = 1 +set termwinkey= nmap f -vmap Igv nmap _ f_l nmap ] "*yiw nmap p "_diwP -nmap ]q :cnext -nmap [q :cprev - nnoremap d "_d vnoremap d "_d -cmap -cmap - map Q gq -map Y y$ cmap ][ '[,'] -nmap :buffers:buffer +imap +imap +nmap :buffers:b nmap :registers nmap ' yiwciw""" nmap h1 yypVr=o -nmap 72 :set textwidth=72 nmap sc 024i-a >8 24a- nmap :vertical wincmd ] +nmap [oc :copen +nmap ]oc :cclose nnoremap -nmap :help! -imap :help! - -nmap sp :setlocal spell spelllang=ru,en_gb -highlight SpellBad cterm=inverse ctermfg=red ctermbg=black - -iabbrev итд и т.д. -iabbrev итп и т.п. +nmap ZQ :qall +nmap ZZ :wall:mksession!:qall command! E Explore command! Ch cd %:p:h command! -bar -nargs=? -bang Tmp :silent vnew|setlocal buftype=nofile bufhidden=hide noswapfile buflisted filetype= modifiable + +execute "digraphs Ru" .. 0x20BD + +runtime ftplugin/man.vim +packadd cfilter