dotfiles

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

commit 98d12b3a76d788daccef3517fa4e7655a6f71633
parent 55dc877e172501c9a2bee9ee47c8384499e57d29
Author: Paco Esteban <paco@onna.be>
Date:   Thu, 13 Dec 2018 17:04:41 +0100

some vim tweaking

Diffstat:
vim/.vim/after/ftplugin/c.vim | 3++-
vim/.vim/after/ftplugin/go.vim | 3++-
vim/.vim/after/ftplugin/mail.vim | 2++
vim/.vim/after/ftplugin/make.vim | 2++
vim/.vim/after/ftplugin/openscad.vim | 2++
vim/.vim/after/ftplugin/perl.vim | 3++-
vim/.vim/after/ftplugin/python.vim | 3++-
vim/.vim/after/ftplugin/text.vim | 2++
vim/.vim/after/ftplugin/vimwiki.vim | 10++++++++++
vim/.vim/after/ftplugin/yaml.vim | 2++
vim/.vim/vimrc | 14++------------
11 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/vim/.vim/after/ftplugin/c.vim b/vim/.vim/after/ftplugin/c.vim @@ -1,7 +1,6 @@ " (astyle) if executable('astyle') setlocal equalprg=astyle - nnoremap g= :mark t <bar> execute 'normal! gg=G' <bar> execute 'normal! `t' <bar> delmarks t<CR> endif setlocal colorcolumn=80 @@ -20,3 +19,5 @@ endif " manual to section 3 setlocal keywordprg=man\ -s\ 3 + +let b:undo_ftplugin .= '|setl equalprg< colorcolumn< complete< include< path< keywordprg<' diff --git a/vim/.vim/after/ftplugin/go.vim b/vim/.vim/after/ftplugin/go.vim @@ -1,5 +1,6 @@ setlocal noexpandtab if executable('gofmt') setlocal equalprg=gofmt - nnoremap g= :mark t <bar> execute 'normal! gg=G' <bar> execute 'normal! `t' <bar> delmarks t<CR> endif + +let b:undo_ftplugin .= '|setlocal noexpandtab< equalprg<' diff --git a/vim/.vim/after/ftplugin/mail.vim b/vim/.vim/after/ftplugin/mail.vim @@ -10,3 +10,5 @@ setlocal spelllang=en_gb nmap <LocalLeader>ca :setlocal spelllang=ca_es<CR> nmap <LocalLeader>es :setlocal spelllang=es_es<CR> nmap <LocalLeader>en :setlocal spelllang=en_gb<CR> + +let b:undo_ftplugin .= '|setlocal tw< wrap< lbr< formatprg< spell< spelllang<' diff --git a/vim/.vim/after/ftplugin/make.vim b/vim/.vim/after/ftplugin/make.vim @@ -3,3 +3,5 @@ setlocal softtabstop=8 setlocal shiftwidth=8 setlocal noexpandtab setlocal colorcolumn=80 + +let b:undo_ftplugin .= '|setlocal tabstop< softtabstop< shiftwidth< noexpandtab< colorcolumn<' diff --git a/vim/.vim/after/ftplugin/openscad.vim b/vim/.vim/after/ftplugin/openscad.vim @@ -1,3 +1,5 @@ setlocal tabstop=2 setlocal softtabstop=2 setlocal shiftwidth=2 + +let b:undo_ftplugin .= '|setlocal tabstop< softtabstop< shiftwidth<' diff --git a/vim/.vim/after/ftplugin/perl.vim b/vim/.vim/after/ftplugin/perl.vim @@ -1,6 +1,7 @@ " perltidy if executable('perltidy') setlocal equalprg=perltidy - nnoremap g= :mark t <bar> execute 'normal! gg=G' <bar> execute 'normal! `t' <bar> delmarks t<CR> endif setlocal colorcolumn=80 + +let b:undo_ftplugin .= '|setlocal equalprg< colorcolumn<' diff --git a/vim/.vim/after/ftplugin/python.vim b/vim/.vim/after/ftplugin/python.vim @@ -7,8 +7,9 @@ if executable('isort-3') endif if executable('yapf') setlocal equalprg=yapf - nnoremap g= :mark t <bar> execute 'normal! gg=G' <bar> execute 'normal! `t' <bar> delmarks t<CR> endif setlocal textwidth=79 setlocal shiftround setlocal colorcolumn=80 + +let b:undo_ftplugin .= '|setlocal equalprg< textwidth< shiftround< colorcolumn<' diff --git a/vim/.vim/after/ftplugin/text.vim b/vim/.vim/after/ftplugin/text.vim @@ -5,3 +5,5 @@ setlocal formatprg=fmt\ -72 setlocal colorcolumn=73 setlocal spell setlocal spelllang=en_gb + +let b:undo_ftplugin .= '|setlocal textwidth< wrap< linebreak< formatprg< colorcolumn< spell< spelllang<' diff --git a/vim/.vim/after/ftplugin/vimwiki.vim b/vim/.vim/after/ftplugin/vimwiki.vim @@ -0,0 +1,10 @@ +if ! exists("g:loaded_vimwiki") + finish +endif + +" \d inserts the local date (POSIX date) +nnoremap <LocalLeader>d :read !date<CR> +" \D inserts the UTC date (POSIX date) +nnoremap <LocalLeader>D :read !date -u<CR> + +let b:undo_ftplugin = 'setlocal colorcolumn< | nunmap <LocalLeader>D| nunmap <LocalLeader>d' diff --git a/vim/.vim/after/ftplugin/yaml.vim b/vim/.vim/after/ftplugin/yaml.vim @@ -1,3 +1,5 @@ setlocal tabstop=2 setlocal softtabstop=2 setlocal shiftwidth=2 + +let b:undo_ftplugin .= '|setlocal tabstop< softtabstop< shiftwidth<' diff --git a/vim/.vim/vimrc b/vim/.vim/vimrc @@ -70,6 +70,8 @@ augroup END " }}} " Mappings {{{ +" g= is like gg=G but returns to where you invoked it +nnoremap g= :mark t <bar> execute 'normal! gg=G' <bar> execute 'normal! `t' <bar> delmarks t<CR> " space bar un-highlights search noremap <silent> <Space> :silent noh<Bar>echo<CR> " better behaviour of > in visual mode @@ -134,18 +136,6 @@ let g:NERDCompactSexyComs = 0 let g:NERDAltDelims_c = 1 imap <C-c> <plug>NERDCommenterInsert " }}} -" vim-go {{{ -let g:go_highlight_functions = 1 -let g:go_highlight_methods = 1 -let g:go_highlight_fields = 1 -let g:go_highlight_types = 1 -let g:go_highlight_operators = 1 -let g:go_highlight_build_constraints = 1 -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' -" }}} " UltiSnips {{{ let g:UltiSnipsEnableSnipMate = 0 let g:snips_author = "paco"