]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vimrc
Explicitly tell pylint not to show the scoring
[dotfiles.git] / vim / .vimrc
1 " vim: foldmethod=marker:foldlevel=0
2
3 set t_Co=16
4 syntax on
5 filetype on
6 filetype plugin on
7 set nocompatible
8 set encoding=utf-8
9 "set t_kD=\7f
10 set mouse="" " if Vim is compiled with mouse support
11 set nomodeline
12
13 set viminfo='100,<50,s10,f1,%,n~/secure/vim/info
14 set viewdir=~/secure/vim/view
15 set history=128
16 set directory=~/secure/vim/tmp
17 set undodir=~/secure/vim/undo
18 set undofile
19
20 set autoindent
21 set tabstop=4
22 set shiftwidth=4
23 set smarttab
24 set expandtab
25 set nojoinspaces
26 set scrolloff=2
27 set backspace=indent,eol
28 set shortmess=aoOtI
29 set highlight-=v:Visual
30 set highlight+=vr
31 set cpoptions+=$
32 set showcmd
33 set showmatch
34 set listchars=trail:·,tab:→→,nbsp:% ",eol:¶
35 set list
36
37 set cursorline
38 set cursorcolumn
39 set colorcolumn=80
40 highlight ExtraWhitespace ctermbg=green ctermfg=blue
41 match ExtraWhitespace /\s\+$/
42
43 set relativenumber
44 set numberwidth=3
45
46 set ignorecase
47 set smartcase
48 set hlsearch
49 set incsearch
50 set gdefault
51 set wildmode=longest:list
52 set tags=tags;,./;
53 set wildignore=**/_build/*,**/tags,**/.git,**/.hypothesis
54
55 map <F4> :nohlsearch<CR>:MarkClear<CR>
56
57 " Folding {{{
58 set foldmethod=indent
59 set foldnestmax=9
60 set foldenable
61 set foldcolumn=1
62 set foldlevel=0
63
64 autocmd BufWinEnter * normal zR
65 highlight FoldColumn ctermfg=cyan ctermbg=black
66 highlight CursorColumn ctermfg=cyan ctermbg=red
67 " }}}
68
69 " Statusline {{{
70 highlight User1 ctermbg=blue ctermfg=black
71 highlight User2 ctermbg=green ctermfg=black
72 highlight User3 ctermbg=yellow ctermfg=black
73 highlight User4 ctermbg=red ctermfg=black
74 set laststatus=2
75 set statusline=%n\|%F%m%r%h%w%q\ %=
76 set statusline+=%1*%Y[%{strlen(&fenc)?&fenc:&enc},%{&ff}]
77 set statusline+=%2*[%l/%L]
78 set statusline+=%3*[%c%V:0x%B]
79 set statusline+=%4*%{LintStatus()}
80 set statusline+=%*\ %P
81
82 function! LintStatus() " it is overrided in ftplugin/python/pylint.vim
83     return ""
84 endfunction
85 " }}}
86
87 " View saving {{{
88 autocmd BufWinLeave *.* mkview
89 autocmd BufWinEnter *.* silent loadview
90 " }}}
91
92 " Windows related {{{
93 noremap <C-j> <C-w>j
94 noremap <C-k> <C-w>k
95 noremap <C-l> <C-w>l
96 noremap <C-h> <C-w>h
97 nmap <leader>- <C-w>\|<C-w>_
98 nmap <leader>= <C-w>=
99 nmap <Del> :close<CR>
100 autocmd VimResized * wincmd =
101 " }}}
102
103 " Tmux window naming {{{
104 set titleold = ""
105 set title
106 " }}}
107
108 " Fugitive {{{
109 let g:fugitive_git_executable = "LANG=en.UTF-8 git"
110 nmap <F7> "cyiw:execute "Gvsplit " . @c<CR>zR
111 nmap <F9> :diffupdate<CR>:syntax off<CR>:syntax on<CR>
112 " }}}
113
114 " *-lists indentation and formatting {{{
115 set comments-=mb:*
116 set formatlistpat=^\\s*\\*\ \\s*
117 set formatoptions+=n
118 " }}}
119
120 autocmd BufEnter * let &titlestring = expand("%:t")
121
122 set keywordprg=
123
124 let g:netrw_banner = 0
125 let g:netrw_bufsettings = "noma nomod nowrap ro nobl"
126
127 " Often typos
128 map q: :
129 command! W w
130
131 nmap <space> f<space>
132 vmap <space> I<space><ESC>gv
133 nmap _ f_l
134
135 nmap <leader>] "*yiw
136 nmap <leader>p "_diwP
137
138 nmap ]q :cnext<CR>
139 nmap [q :cprev<CR>
140
141 nnoremap <leader>d "_d
142 vnoremap <leader>d "_d
143
144 cmap <C-O> <S-Left>
145 cmap <C-P> <S-Right>
146
147 map Q gq
148 map Y y$
149 cmap ][ '[,']
150 nmap <F2> :set wrap!<CR>:set wrap?<CR>
151 nmap <Tab> :buffers<CR>:buffer<Space>
152 nmap <silent> <Home> :registers<CR>
153 nmap <leader>' yiwciw"<C-r>""<ESC>
154 nmap <leader>h1 yypVr=o
155 nmap <leader>72 :set textwidth=72
156 nmap <leader>sc 024i-<ESC>a >8 <ESC>24a-<ESC>
157 nmap <leader><C-]> :vertical wincmd ]<CR>
158 nnoremap <C-P> <C-I>
159
160 nmap <F1> :help!<CR>
161 imap <F1> <C-O>:help!<CR>
162
163 nmap <leader>sp :setlocal spell spelllang=ru,en_gb
164 highlight SpellBad cterm=inverse ctermfg=red ctermbg=black
165
166 iabbrev итд и т.д.
167 iabbrev итп и т.п.
168
169 command! E Explore
170 command! Ch cd %:p:h
171 command! -bar -nargs=? -bang Tmp :silent vnew<bang>|setlocal buftype=nofile bufhidden=hide noswapfile buflisted filetype=<args> modifiable