1 " vim: foldmethod=marker:foldlevel=0
10 set mouse="" " if Vim is compiled with mouse support
12 set viminfo='100,<50,s10,f1,%,n~/secure/vim/info
13 set viewdir=~/secure/vim/view
15 set directory=~/secure/vim/tmp
16 set undodir=~/secure/vim/undo
26 set backspace=indent,eol
28 set highlight-=v:Visual
34 set listchars=trail:·,tab:>→,nbsp:% ",eol:¶
36 set completeopt-=preview
41 highlight ExtraWhitespace ctermbg=green ctermfg=blue
42 match ExtraWhitespace /\s\+$/
52 set wildmode=longest:list
54 set wildignore=**/_build/*,**/tags,**/.git,**/.hypothesis
56 map <F4> :nohlsearch<CR>:MarkClear<CR>
65 autocmd BufWinEnter * normal zR
66 highlight FoldColumn ctermfg=cyan ctermbg=black
67 highlight CursorColumn ctermfg=cyan ctermbg=red
72 set statusline=%F\ %m%r%h%w%q%k\ %=
73 set statusline+=%n\ %#Question#%Y
74 set statusline+=%#DiffChange#%{strlen(&fenc)?&fenc:&enc}%{&bomb?'-bom':''}\ %{&ff}
75 set statusline+=%#DiffAdd#%l/%L
76 set statusline+=%#Todo#%c%V:0x%B
77 set statusline+=%#Comment#%o
78 set statusline+=%#Error#%{LintStatus()}
79 set statusline+=%*\ %P
81 function! LintStatus() " it is overrided in ftplugins
87 autocmd BufWinLeave *.* mkview
88 autocmd BufWinEnter *.* silent loadview
96 nmap <leader>- <C-w>\|<C-w>_
99 autocmd VimResized * wincmd =
102 " Tmux window naming {{{
105 autocmd BufEnter * let &titlestring = expand("%:t")
109 nmap <F7> :Gvsplit <C-R><C-W><CR>zR
110 nmap <F9> :diffupdate<CR>:syntax off<CR>:syntax on<CR>
113 " *-lists indentation and formatting {{{
115 set formatlistpat=^\\s*\\*\ \\s*
116 set formatoptions+=onj
120 set spelllang=ru,en_gb
121 highlight SpellBad cterm=inverse ctermfg=red ctermbg=black
124 " Unimpaired-like textwidth switching {{{
125 nmap [ob :set textwidth=72<CR>
126 nmap ]ob :set textwidth=0<CR>
133 imap <F1> <C-O>:help!<CR>
139 let g:sh_no_error = 1
141 nmap <space> f<space>
142 vmap <space> I<space><ESC>gv
146 nmap <leader>p "_diwP
148 nnoremap <leader>d "_d
149 vnoremap <leader>d "_d
157 imap <C-b> <C-x><C-o>
158 nmap <F2> :set wrap!<CR>:set wrap?<CR>
159 nmap <Tab> :buffers<CR>:b<Space>
160 nmap <silent> <Home> :registers<CR>
161 nmap <leader>' yiwciw"<C-r>""<ESC>
162 nmap <leader>h1 yypVr=o
163 nmap <leader>sc 024i-<ESC>a >8 <ESC>24a-<ESC>
164 nmap <leader><C-]> :vertical wincmd ]<CR>
169 command! -bar -nargs=? -bang Tmp :silent vnew<bang>|setlocal buftype=nofile bufhidden=hide noswapfile buflisted filetype=<args> modifiable