Add statusline
Configure autowrap and ignore whitespace for markdown. Install flake8 plugin.
This commit is contained in:
23
.vimrc
23
.vimrc
@@ -25,6 +25,7 @@ if filereadable(expand(vundle_dir) . "/README.md")
|
|||||||
Plugin 'easymotion/vim-easymotion'
|
Plugin 'easymotion/vim-easymotion'
|
||||||
Plugin 'cpiger/NeoDebug'
|
Plugin 'cpiger/NeoDebug'
|
||||||
Plugin 'ivan-krukov/vim-snakemake'
|
Plugin 'ivan-krukov/vim-snakemake'
|
||||||
|
Plugin 'nvie/vim-flake8'
|
||||||
|
|
||||||
call vundle#end() " required
|
call vundle#end() " required
|
||||||
else
|
else
|
||||||
@@ -57,6 +58,9 @@ set scrolloff=5 " Don't let cursor be within 5 lines from top or bottom
|
|||||||
|
|
||||||
" Warn for trailing whitespace. Search with wrap (w) do not move cursor (n)
|
" Warn for trailing whitespace. Search with wrap (w) do not move cursor (n)
|
||||||
function! WhitespaceWarn()
|
function! WhitespaceWarn()
|
||||||
|
if &ft =~ 'markdown'
|
||||||
|
return
|
||||||
|
endif
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echo 'Found whitespace.'
|
echo 'Found whitespace.'
|
||||||
echohl None
|
echohl None
|
||||||
@@ -71,6 +75,7 @@ function! StripTrailingWhitespace()
|
|||||||
call winrestview(l:save)
|
call winrestview(l:save)
|
||||||
echo "Stripped trailing whitespace"
|
echo "Stripped trailing whitespace"
|
||||||
endfunction
|
endfunction
|
||||||
|
au BufRead,BufNewFile *.md setlocal textwidth=80
|
||||||
autocmd BufWritePost * if search('\s\+$', 'wn') | call WhitespaceWarn() | endif
|
autocmd BufWritePost * if search('\s\+$', 'wn') | call WhitespaceWarn() | endif
|
||||||
command TrailWhitespace call StripTrailingWhitespace()
|
command TrailWhitespace call StripTrailingWhitespace()
|
||||||
|
|
||||||
@@ -97,6 +102,22 @@ command! -bang Q quit<bang>
|
|||||||
" fugitive.vim looks for tags in .git
|
" fugitive.vim looks for tags in .git
|
||||||
" set tags +=~/tags " Recursively move upwards in tree, searching in subfolders for tags file
|
" set tags +=~/tags " Recursively move upwards in tree, searching in subfolders for tags file
|
||||||
|
|
||||||
|
" Status line
|
||||||
|
set laststatus=2
|
||||||
|
set statusline=
|
||||||
|
set statusline+=%#StatusLineTerm#
|
||||||
|
set statusline+=%{FugitiveStatusline()}
|
||||||
|
set statusline+=%#MoreMsg#
|
||||||
|
set statusline+=\ %f
|
||||||
|
set statusline+=%m\ "
|
||||||
|
set statusline+=%=
|
||||||
|
set statusline+=%#WildMenu#
|
||||||
|
set statusline+=%y
|
||||||
|
set statusline+=\ %p%%
|
||||||
|
set statusline+=\ %l:%c"
|
||||||
|
set statusline+=%#MoreMsg#
|
||||||
|
set statusline+=\ "
|
||||||
|
|
||||||
if exists(":NERDTree")
|
if exists(":NERDTree")
|
||||||
" Open NERDTree if no file specified
|
" Open NERDTree if no file specified
|
||||||
autocmd StdinReadPre * let s:std_in=1
|
autocmd StdinReadPre * let s:std_in=1
|
||||||
@@ -169,8 +190,8 @@ nmap <Leader>v :e $MYVIMRC <CR>
|
|||||||
nmap <Leader>/g /[<=>]\{7,}.*$<CR>
|
nmap <Leader>/g /[<=>]\{7,}.*$<CR>
|
||||||
" Git-Gutter status, commit, grep, blame
|
" Git-Gutter status, commit, grep, blame
|
||||||
nmap <Leader>gs :Gstatus<CR>
|
nmap <Leader>gs :Gstatus<CR>
|
||||||
|
nmap <Leader>gS :!git add %<CR>
|
||||||
nmap <Leader>gc :Gcommit<CR>
|
nmap <Leader>gc :Gcommit<CR>
|
||||||
nmap <Leader>gS :Gstatus<CR> :Gcommit<CR>
|
|
||||||
nmap <Leader>gg :Ggrep<space>
|
nmap <Leader>gg :Ggrep<space>
|
||||||
nmap <Leader>gb :Gblame<CR>
|
nmap <Leader>gb :Gblame<CR>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user