" vim: foldmethod=marker:foldlevel=0 set t_Co=16 syntax on filetype on filetype plugin on 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 viewdir=~/secure/vim/view set history=128 set directory=~/secure/vim/tmp set undodir=~/secure/vim/undo set undofile set autoindent set tabstop=4 set shiftwidth=4 set smarttab set expandtab set nojoinspaces set scrolloff=2 set backspace=indent,eol set shortmess=aoOtI set highlight-=v:Visual set highlight+=vr set cpoptions+=$ set showcmd set showmatch set listchars=trail:·,tab:→→,nbsp:% ",eol:¶ set list set cursorline set cursorcolumn set colorcolumn=80 highlight ExtraWhitespace ctermbg=green ctermfg=blue match ExtraWhitespace /^\s*$/ set relativenumber set numberwidth=3 set ignorecase set smartcase set hlsearch set incsearch set gdefault set wildmode=longest:list set tags=tags;,./; set wildignore=**/_build/*,**/tags,**/.git,**/.hypothesis map :nohlsearch:MarkClear " Folding {{{ set foldmethod=indent set foldnestmax=9 set foldenable set foldcolumn=1 set foldlevel=0 autocmd BufWinEnter * normal zR highlight FoldColumn ctermfg=cyan ctermbg=black 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 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+=%*\ %P function! LintStatus() " it is overrided in ftplugin/python/pylint.vim return "" endfunction " }}} " View saving {{{ autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview " }}} " Windows related {{{ noremap j noremap k noremap l noremap h nmap - \|_ nmap = = nmap :close autocmd VimResized * wincmd = " }}} " Tmux window naming {{{ set titleold = "" set title " }}} " Fugitive {{{ let g:fugitive_git_executable = "LANG=en.UTF-8 git" nmap "cyiw:execute "Gvsplit " . @czR nmap :diffupdate:syntax off:syntax on " }}} " *-lists indentation and formatting {{{ set comments-=mb:* set formatlistpat=^\\s*\\*\ \\s* set formatoptions+=n " }}} autocmd BufEnter * let &titlestring = expand("%:t") autocmd BufRead /tmp/mutt-* setlocal textwidth=72 autocmd BufRead,BufNewFile *.pyi setlocal filetype=python autocmd BufRead,BufNewFile *.conf setlocal noexpandtab autocmd BufRead,BufNewFile *.go setlocal noexpandtab autocmd BufRead,BufNewFile *.go let g:defsplit_shift=" " autocmd BufNewFile,BufRead *.tex abbreviate framedo \begin{frame}\frametitle{TODO}\end{frame}k>>wwlcw autocmd BufNewFile,BufRead *.tex abbreviate itemdo \begin{itemize}\item \end{itemize}k>>$a autocmd BufNewFile,BufRead *.tex abbreviate cnter \begin{center}\end{center}k$o autocmd Filetype texinfo abbreviate \t @tab autocmd Filetype gitcommit setlocal textwidth=72 autocmd BufRead /tmp/psql.edit* setlocal filetype=sql autocmd Filetype yaml setlocal shiftwidth=2 set keywordprg= let g:netrw_banner = 0 let g:netrw_bufsettings = "noma nomod nowrap ro nobl" " Often typos map q: : command! W w 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 cmap ][ '[,'] nmap :buffers:buffer nmap :registers nmap ' yiwciw""" nmap h1 yypVr=o nmap 72 :set textwidth=72 nmap sc 024i-a >8 24a- nmap :vertical wincmd ] nnoremap nmap :help! imap :help! nmap sp :setlocal spell spelllang=ru,en_gb highlight SpellBad cterm=inverse ctermfg=red ctermbg=black iabbrev итд и т.д. iabbrev итп и т.п. command! E Explore command! Ch cd %:p:h command! -bar -nargs=? -bang Tmp :silent vnew|setlocal buftype=nofile bufhidden=hide noswapfile buflisted filetype= modifiable