dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit bb6d103682bea87ceac7b8b1f21584e1f7475dc5
parent f24d7f69967d06ba43d4ef6197899d5e2423f485
Author: Paco Esteban <paco@onna.be>
Date:   Wed,  4 Jul 2018 15:18:06 +0200

Major changes to vimrc

Some plugins ditched. personal (and simpler) statusline and tabline.
Folding and autogroups.

Diffstat:
nvim/.config/nvim/init.vim | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
1 file changed, 82 insertions(+), 40 deletions(-)

diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim @@ -1,4 +1,5 @@ -" Basic config +" my silly vimrc +" Basic config {{{ set shiftwidth=4 " Number of spaces to use for each step of (auto)indent set tabstop=4 " Number of spaces that a <Tab> in the file counts for set softtabstop=4 " Number of spaces that a <Tab> counts for while performing editing @@ -16,47 +17,66 @@ set list " mark non-printable chars as per above instructions set listchars=tab:▸\ ,trail:·,precedes:«,extends:»,nbsp:+ set wildmode=longest,list:longest " command completion works as I want set foldmethod=syntax +set foldlevelstart=10 " open most folds by default +set foldnestmax=10 " 10 nested fold max set updatetime=1000 - +set lazyredraw " redraw less, let's see how it goes set path+=** +" }}} -" appearance +" Color {{{ color lucius LuciusBlackLowContrast +" }}} + +" Buffer/Filetype configs {{{ +augroup buffft + autocmd! + autocmd BufNewFile,BufRead Rexfile setfiletYPe perl + autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab + autocmd FileType yaml setlocal ts=2 sts=2 sw=2 + autocmd FileType openscad setlocal ts=2 sts=2 sw=2 + autocmd BufNewFile,BufRead *.txt set tw=79 wrap lbr formatprg=par\ -w79req + autocmd BufReadPost *mutt-* set syntax=mail tw=72 wrap lbr formatprg=par\ -w72req +augroup END +" }}} -" per buffer/filetype configs -autocmd BufNewFile,BufRead Rexfile setfiletype perl -autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab -autocmd FileType yaml setlocal ts=2 sts=2 sw=2 -autocmd FileType openscad setlocal ts=2 sts=2 sw=2 -autocmd BufNewFile,BufRead *.txt set tw=79 wrap lbr formatprg=par\ -w79req -autocmd BufReadPost *mutt-* set syntax=mail tw=72 wrap lbr formatprg=par\ -w72req -autocmd BufNewFile *.sh 0r $HOME/.config/nvim/templates/template.sh -" perltidy and template -autocmd Filetype perl nnoremap <silent> <Leader>t :mark t <bar> execute'%!perltidy' <bar> execute 'normal! `t' <bar> delmarks t<CR> -autocmd Filetype perl vnoremap <silent> <Leader>t :!perltidy<CR> -autocmd BufNewFile *.pl 0r $HOME/.config/nvim/templates/template.pl -" same for c -autocmd Filetype c,cpp,arduino nnoremap <silent> <Leader>t :mark t <bar> execute'%!astyle' <bar> execute 'normal! `t' <bar> delmarks t<CR> -autocmd Filetype c,cpp,arduino vnoremap <buffer> <Leader>t :!astyle<CR> -autocmd BufNewFile *.c 0r $HOME/.config/nvim/templates/template.c -" and for go ... -autocmd Filetype go nnoremap <buffer> <Leader>t :GoFmt<CR> -autocmd Filetype go vnoremap <buffer> <Leader>t :GoFmt<CR> -autocmd FileType go nmap <leader>b <Plug>(go-build) -autocmd FileType go nmap <leader>r <Plug>(go-run) -autocmd FileType go nmap <leader>i <Plug>(go-info) -autocmd BufNewFile *.go 0r $HOME/.config/nvim/templates/template.go -" and for python -autocmd FileType python nnoremap <silent> <Leader>i :!isort %<CR><CR> -autocmd FileType python nnoremap <silent> <Leader>t :mark t <bar> execute'%!yapf' <bar> execute 'normal! `t' <bar> delmarks t<CR> -autocmd Filetype python vnoremap <silent> <Leader>t :!yapf<CR> -autocmd FileType python setlocal textwidth=79 shiftround -autocmd BufNewFile *.py 0r $HOME/.config/nvim/templates/template.py +" Templates {{{ +augroup templates + autocmd! + autocmd BufNewFile *.sh 0r $HOME/.config/nvim/templates/template.sh + autocmd BufNewFile *.pl 0r $HOME/.config/nvim/templates/template.pl + autocmd BufNewFile *.c 0r $HOME/.config/nvim/templates/template.c + autocmd BufNewFile *.go 0r $HOME/.config/nvim/templates/template.go + autocmd BufNewFile *.py 0r $HOME/.config/nvim/templates/template.py +augroup END +" }}} -" some useful mappings +" Mappings {{{ +augroup perftmappings + autocmd! + " perltidy + autocmd Filetype perl nnoremap <silent> <Leader>t :mark t <bar> execute'%!perltidy' <bar> execute 'normal! `t' <bar> delmarks t<CR> + autocmd Filetype perl vnoremap <silent> <Leader>t :!perltidy<CR> + " same for c (astyle) + autocmd Filetype c,cpp,arduino nnoremap <silent> <Leader>t :mark t <bar> execute'%!astyle' <bar> execute 'normal! `t' <bar> delmarks t<CR> + autocmd Filetype c,cpp,arduino vnoremap <buffer> <Leader>t :!astyle<CR> + " and for python + autocmd FileType python nnoremap <silent> <Leader>i :!isort %<CR><CR> + autocmd FileType python nnoremap <silent> <Leader>t :mark t <bar> execute'%!yapf' <bar> execute 'normal! `t' <bar> delmarks t<CR> + autocmd Filetype python vnoremap <silent> <Leader>t :!yapf<CR> + autocmd FileType python setlocal textwidth=79 shiftround + " and for go ... + autocmd Filetype go nnoremap <buffer> <Leader>t :GoFmt<CR> + autocmd Filetype go vnoremap <buffer> <Leader>t :GoFmt<CR> + autocmd FileType go nmap <leader>b <Plug>(go-build) + autocmd FileType go nmap <leader>r <Plug>(go-run) + autocmd FileType go nmap <leader>i <Plug>(go-info) +augroup END " space bar un-highlights search noremap <silent> <Space> :silent noh<Bar>echo<CR> +" \space open/closes folds +nnoremap <Leader><space> za " better behaviour of > in visual mode vnoremap > >gv vnoremap < <gv @@ -90,15 +110,17 @@ nnoremap <leader>b :make<CR> " sanity in terminal mode tnoremap <Esc> <C-\><C-n> tnoremap <C-v><Esc> <Esc> +" }}} -" plugins config -" Nerdcommenter +" Plugins {{{ +" Nerdcommenter {{{ let g:NERDSpaceDelims = 1 let g:NERDDefaultAlign = 'left' let g:NERDCommentEmptyLines = 1 let g:NERDTrimTrailingWhitespace = 1 let g:NERDCompactSexyComs = 1 -" vim-go +" }}} +" vim-go {{{ let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_fields = 1 @@ -109,18 +131,23 @@ let g:go_highlight_extra_types = 1 let g:go_fmt_command = "goimports" let g:go_template_autocreate = 0 let g:go_info_mode = 'guru' -" vim -grepper +" }}} +" vim-grepper {{{ let g:grepper = {} let g:grepper.tools = ['rg', 'git', 'grep'] nnoremap <Leader>* :Grepper -cword -noprompt nmap gs <plug>(GrepperOperator) xmap gs <plug>(GrepperOperator) -" UltiSnips -" Disabling snipmate +" }}} +" UltiSnips {{{ let g:UltiSnipsEnableSnipMate = 0 -" vim-slackcat +" }}} +" vim-slackcat {{{ let g:slackcat_default_channel = "festeban" +" }}} +" }}} +" Tabline {{{ " tabline with numbers " shamelessly taken form " https://github.com/mkitt/tabline.vim/blob/master/plugin/tabline.vim @@ -157,3 +184,18 @@ function! Tabline() return s endfunction set tabline=%!Tabline() +" }}} + +" Statusline {{{ +set laststatus=2 +set statusline=\[%n] +set statusline+=\ >>\ %f +set statusline+=\ %m%r%h +set statusline+=\ %y +set statusline+=\ \[%{(&fenc!=''?&fenc:&enc)}/%{&ff}] +set statusline+=\ %= +set statusline+=\ L:%4l/C:%3c +set statusline+=\ [%3p%%] +" }}} + +" vim:foldmethod=marker:foldlevel=0