dotfiles

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

commit d22245d858812de885be84288557638932e75d73
parent 98d12b3a76d788daccef3517fa4e7655a6f71633
Author: Paco Esteban <paco@onna.be>
Date:   Fri, 14 Dec 2018 19:32:26 +0100

various changes to vim and gitconfig

Diffstat:
git/.gitconfig | 2+-
vim/.vim/after/ftplugin/mail.vim | 9+--------
vim/.vim/after/ftplugin/markdown.vim | 4++++
vim/.vim/after/ftplugin/text.vim | 4+---
vim/.vim/autoload/spell.vim | 34++++++++++++++++++++++++++++++++++
vim/.vim/vimrc | 4++++
6 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/git/.gitconfig b/git/.gitconfig @@ -40,7 +40,7 @@ unstage = "reset HEAD --" sl = "stash list --pretty=format:'%gd: %Cred%h%Creset %Cgreen[%ar]%Creset %s'" ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cgreen\\ [%cn]\\ %Creset%ad" --decorate --numstat - l = log --pretty=format:"%C(yellow)%h\\ %C(cyan)%ad%Cred%d\\ %Creset%s%Cgreen\\ [%an]" --decorate --date=short --graph --branches=* --remotes=* -20 + l = log --pretty=format:"%C(yellow)%h\\ %C(cyan)%ad%Cred%d\\ %Creset%s%Cgreen\\ [%an]" --decorate --date=short --graph --branches=* --remotes=* last=log --pretty=format:"%C(yellow)%h %C(red)%d%Creset%nAuthor: %an <%ae>%nWhen: %C(cyan)%ar%Creset%n%n%s" -1 HEAD ds = "diff --staged" latestbranches = "for-each-ref --sort=-committerdate --format='%(refname:short) %(committerdate:short)'" diff --git a/vim/.vim/after/ftplugin/mail.vim b/vim/.vim/after/ftplugin/mail.vim @@ -3,12 +3,5 @@ setlocal tw=72 setlocal wrap setlocal lbr setlocal formatprg=fmt\ -72 -" default spell -setlocal spell -setlocal spelllang=en_gb -" and some optionals -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<' +let b:undo_ftplugin .= '|setlocal tw< wrap< lbr< formatprg<' diff --git a/vim/.vim/after/ftplugin/markdown.vim b/vim/.vim/after/ftplugin/markdown.vim @@ -0,0 +1,4 @@ +setlocal textwidth=79 +setlocal colorcolumn=+1 + +let b:undo_ftplugin .= '|setl textwidth<' diff --git a/vim/.vim/after/ftplugin/text.vim b/vim/.vim/after/ftplugin/text.vim @@ -3,7 +3,5 @@ setlocal wrap setlocal linebreak 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<' +let b:undo_ftplugin .= '|setlocal textwidth< wrap< linebreak< formatprg< colorcolumn<' diff --git a/vim/.vim/autoload/spell.vim b/vim/.vim/autoload/spell.vim @@ -0,0 +1,34 @@ +if exists('g:loaded_setlang') + finish +endif +let g:loaded_setlang = 1 + +function! spell#setspell() + let optlang = confirm("Choose spell lang: ", "&English\n&Catalan\n&Spanish", 1) + + if optlang == 1 + setlocal spelllang=en_gb + elseif optlang == 2 + setlocal spelllang=ca + elseif optlang == 3 + setlocal spelllang=es_es + else + echo "Don't know that lang !" + finish + endif + + setlocal spell +endfunction + +function! spell#clearspell() + setlocal nospell + setlocal spelllang= +endfunction + +function! spell#togglespell() + if &spell == "nospell" + call spell#setspell() + else + call spell#clearspell() + endif +endfunction diff --git a/vim/.vim/vimrc b/vim/.vim/vimrc @@ -26,6 +26,7 @@ set foldmethod=syntax set foldlevelstart=10 " open most folds by default set foldnestmax=10 " 10 nested fold max set updatetime=1000 +set timeoutlen=2000 " timeout for mappings and keycodes set lazyredraw " redraw less, let's see how it goes set path-=/usr/include " do not assume C by default set path+=** " search current directory whole tree @@ -110,6 +111,9 @@ nnoremap <silent> <Leader>b :make<CR> " internal {{{ " better behaviour of % packadd! matchit +" my little spell toggler +nnoremap <silent> <Leader>s :call spell#togglespell()<CR> +nnoremap <silent> <Leader>S :call spell#setspell()<CR> " }}} internal " ALE {{{ nmap <silent> <Leader>k <Plug>(ale_previous_wrap)