diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2020-07-09 01:10:36 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2020-07-09 01:10:36 +0200 |
commit | faeb7cab78f10b8359b2fa86a96e6861e2b86e3f (patch) | |
tree | 6925703f1977533e92f621a61ef929fd3f36be7e /files/vim/ftplugin | |
parent | bac1cf42d0ae8c0afdaf843b6dbff494b30354d9 (diff) | |
download | configs-faeb7cab78f10b8359b2fa86a96e6861e2b86e3f.tar.gz configs-faeb7cab78f10b8359b2fa86a96e6861e2b86e3f.zip |
Trying space as leader for vim ftplugins.
Diffstat (limited to 'files/vim/ftplugin')
-rw-r--r-- | files/vim/ftplugin/cpp/cpp.vim | 20 | ||||
-rw-r--r-- | files/vim/ftplugin/html/html.vim | 13 | ||||
-rw-r--r-- | files/vim/ftplugin/html/snips/template.txt | 12 | ||||
-rw-r--r-- | files/vim/ftplugin/javascript/javascript.vim | 21 | ||||
-rw-r--r-- | files/vim/ftplugin/plantuml/plantuml.vim | 4 | ||||
-rw-r--r-- | files/vim/ftplugin/plantuml/snips/template.txt | 9 | ||||
-rw-r--r-- | files/vim/ftplugin/sh/sh.vim | 4 | ||||
-rw-r--r-- | files/vim/ftplugin/typescript/typescript.vim | 21 | ||||
-rw-r--r-- | files/vim/ftplugin/vimwiki/snips/plantUml.txt | 5 | ||||
-rw-r--r-- | files/vim/ftplugin/vimwiki/snips/template.txt | 3 | ||||
-rw-r--r-- | files/vim/ftplugin/vimwiki/vimwiki.vim | 24 |
11 files changed, 101 insertions, 35 deletions
diff --git a/files/vim/ftplugin/cpp/cpp.vim b/files/vim/ftplugin/cpp/cpp.vim index 6b4807d..e2072c1 100644 --- a/files/vim/ftplugin/cpp/cpp.vim +++ b/files/vim/ftplugin/cpp/cpp.vim @@ -1,24 +1,28 @@ " ~/.vim/ftplugin/cpp/cpp.vim " C++-specific vim configuration -highlight Comment ctermfg=darkgreen +let mapleader = " " " Column marker: 80 characters -call matchadd('ColorColumn', '\%81v', 100) +match ColorColumn /\%81v/ +setlocal textwidth=80 nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/cpp/cpp.vim<CR> nnoremap <buffer> <leader>E :Errors<CR> nnoremap <buffer> <leader>c :w<CR>:!g++ "%"; ./a.out<Space> -nnoremap <buffer> <leader>E :Errors<CR> -nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR> -nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR> -nnoremap <buffer> <leader>gd :YcmCompleter GetDoc<CR> -nnoremap <buffer> <leader>gT :YcmCompleter GetType<CR> +nnoremap <buffer> gd :YcmCompleter GoTo<CR> +nnoremap <buffer> gr :YcmCompleter GoToReferences<CR> +nnoremap <buffer> gh :YcmCompleter GetType<CR> +nnoremap <buffer> gD :YcmCompleter GetDoc<CR> +nnoremap <buffer> gR :YcmCompleter RefactorRename<Space> nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR> nnoremap <buffer> <leader>e :YcmDiags<CR> +nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/cpp/snips/template.txt<CR>Gdd?<+++><CR>cf> + +let mapleader = "," + inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>}?<+++><CR>cf> inoremap <buffer> <leader>for for (<+++>; <++>; <++>) {<CR><++><CR>}?<+++><CR>cf> -nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/cpp/snips/template.txt<CR>Gdd?<+++><CR>cf> diff --git a/files/vim/ftplugin/html/html.vim b/files/vim/ftplugin/html/html.vim index a2d0fdd..30e4484 100644 --- a/files/vim/ftplugin/html/html.vim +++ b/files/vim/ftplugin/html/html.vim @@ -3,13 +3,25 @@ " " Syntastic linter: tidy +" Tabs are expanded to 2 spaces +setlocal tabstop=2 shiftwidth=2 expandtab +" Show existing tabs (they can be deleted with :retab) +setlocal list + +" Column marker: 110 characters call matchadd('ColorColumn', '\%101v', 100) +let mapleader = " " + nnoremap <buffer> <leader>o :!$BROWSER % &<CR><CR> nnoremap <buffer> <leader>f :!firefox --new-window % &<CR><CR> nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/html/html.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> +nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/html/snips/template.txt<CR>Gdd?<+++><CR>cf> + +let mapleader = "," + " Layout elements inoremap <buffer> <leader>hheader <header><Enter><Enter></header><Enter><++><Esc>kki inoremap <buffer> <leader>hnav <nav><Enter><Enter></nav><Enter><++><Esc>kki @@ -63,4 +75,3 @@ inoremap <buffer> <leader>himg <img src="" alt="<++>"><Enter><++><Esc>?""<Enter> nnoremap <buffer> <leader>hc I<!-- <Esc>A --><Esc>0 " Uncomment a line nnoremap <buffer> <leader>hC 05x/--><Enter>3x0 - diff --git a/files/vim/ftplugin/html/snips/template.txt b/files/vim/ftplugin/html/snips/template.txt new file mode 100644 index 0000000..38d9f26 --- /dev/null +++ b/files/vim/ftplugin/html/snips/template.txt @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> + <title><+++></title> +</head> + +<body> + + <++> + +</body> +</html> diff --git a/files/vim/ftplugin/javascript/javascript.vim b/files/vim/ftplugin/javascript/javascript.vim index dde35c6..4935410 100644 --- a/files/vim/ftplugin/javascript/javascript.vim +++ b/files/vim/ftplugin/javascript/javascript.vim @@ -10,7 +10,7 @@ let b:ale_linters = ['eslint'] " Tabs are expanded to 4 spaces -setlocal tabstop=2 shiftwidth=2 expandtab +setlocal tabstop=4 shiftwidth=4 expandtab " Show existing tabs (they can be deleted with :retab) setlocal list @@ -19,15 +19,20 @@ call matchadd('ColorColumn', '\%111v', 100) setlocal textwidth=110 " Mappings + +let mapleader = " " + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/javascript/javascript.vim<CR> -"nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR> -"nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR> -"nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR> -"nnoremap <buffer> <leader>r :YcmCompleter RefactorRename<Space> -"nnoremap <buffer> <leader>e :YcmDiags<CR> -"nnoremap <buffer> <leader>E :Errors<CR> +nnoremap <buffer> gd :YcmCompleter GoTo<CR> +nnoremap <buffer> gr :YcmCompleter GoToReferences<CR> +nnoremap <buffer> gh :YcmCompleter GetType<CR> +nnoremap <buffer> gD :YcmCompleter GetDoc<CR> +nnoremap <buffer> gR :YcmCompleter RefactorRename<Space> +nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR> +nnoremap <buffer> <leader>e :YcmDiags<CR> + +let mapleader = "," inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf> inoremap <buffer> <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf> - diff --git a/files/vim/ftplugin/plantuml/plantuml.vim b/files/vim/ftplugin/plantuml/plantuml.vim index eaa8911..e493e5b 100644 --- a/files/vim/ftplugin/plantuml/plantuml.vim +++ b/files/vim/ftplugin/plantuml/plantuml.vim @@ -10,6 +10,10 @@ setlocal list call matchadd('ColorColumn', '\%81v', 100) setlocal textwidth=80 +let mapleader = " " + +nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/plantuml/snips/template.txt<CR>Gdd?<+++><CR>cf> + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/plantuml/plantuml.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> diff --git a/files/vim/ftplugin/plantuml/snips/template.txt b/files/vim/ftplugin/plantuml/snips/template.txt new file mode 100644 index 0000000..f649539 --- /dev/null +++ b/files/vim/ftplugin/plantuml/snips/template.txt @@ -0,0 +1,9 @@ +@startuml + +class <+++> { + <++> +} + +<++> + +@enduml diff --git a/files/vim/ftplugin/sh/sh.vim b/files/vim/ftplugin/sh/sh.vim index ccea418..3eb4da5 100644 --- a/files/vim/ftplugin/sh/sh.vim +++ b/files/vim/ftplugin/sh/sh.vim @@ -3,8 +3,8 @@ " " Linters: sh, shellcheck -call matchadd('ColorColumn', '\%81v', 100) -setlocal textwidth=80 +call matchadd('ColorColumn', '\%111v', 100) +setlocal textwidth=110 nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR> nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR> diff --git a/files/vim/ftplugin/typescript/typescript.vim b/files/vim/ftplugin/typescript/typescript.vim index d80dde4..7c91032 100644 --- a/files/vim/ftplugin/typescript/typescript.vim +++ b/files/vim/ftplugin/typescript/typescript.vim @@ -2,10 +2,10 @@ " TypeScript-specific vim configuration " ALE -"let b:ale_linters = ['eslint'] +let b:ale_linters = ['eslint'] " Tabs are expanded to 4 spaces -setlocal tabstop=2 shiftwidth=2 expandtab +setlocal tabstop=4 shiftwidth=4 expandtab " Show existing tabs (they can be deleted with :retab) setlocal list @@ -14,13 +14,20 @@ call matchadd('ColorColumn', '\%111v', 100) setlocal textwidth=110 " Mappings + +let mapleader = " " + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/typescript/typescript.vim<CR> -nnoremap <buffer> gd :ALEGoToDefinition<CR> -nnoremap <buffer> <Space>h :ALEHover<CR> -nnoremap <buffer> <Space>r :ALERename<CR> -nnoremap <buffer> <Space>fr :ALEFindReferences<CR> +nnoremap <buffer> gd :YcmCompleter GoTo<CR> +nnoremap <buffer> gr :YcmCompleter GoToReferences<CR> +nnoremap <buffer> gh :YcmCompleter GetType<CR> +nnoremap <buffer> gD :YcmCompleter GetDoc<CR> +nnoremap <buffer> gR :YcmCompleter RefactorRename<Space> +nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR> +nnoremap <buffer> <leader>e :YcmDiags<CR> + +let mapleader = "," inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf> inoremap <buffer> <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf> - diff --git a/files/vim/ftplugin/vimwiki/snips/plantUml.txt b/files/vim/ftplugin/vimwiki/snips/plantUml.txt new file mode 100644 index 0000000..4a016eb --- /dev/null +++ b/files/vim/ftplugin/vimwiki/snips/plantUml.txt @@ -0,0 +1,5 @@ +```{.plantuml caption="<+++>"} +@startuml +<++> +@enduml +``` diff --git a/files/vim/ftplugin/vimwiki/snips/template.txt b/files/vim/ftplugin/vimwiki/snips/template.txt index 18280d3..f6b16a8 100644 --- a/files/vim/ftplugin/vimwiki/snips/template.txt +++ b/files/vim/ftplugin/vimwiki/snips/template.txt @@ -1,4 +1,7 @@ --- +header-includes: + - \usepackage[margin=1.5in]{geometry} + title: "Title" author: - Íñigo Gutiérrez Fernández diff --git a/files/vim/ftplugin/vimwiki/vimwiki.vim b/files/vim/ftplugin/vimwiki/vimwiki.vim index f0e6cd5..e8f7a18 100644 --- a/files/vim/ftplugin/vimwiki/vimwiki.vim +++ b/files/vim/ftplugin/vimwiki/vimwiki.vim @@ -3,25 +3,31 @@ " " Syntastic linter: mdl, proselint, textlint -let g:syntastic_vimwiki_checkers = ['markdown/mdl'] +"let g:syntastic_vimwiki_checkers = ['markdown/mdl'] " Tabs hate: tabs are expanded to 2 spaces setlocal tabstop=2 shiftwidth=2 expandtab " Show existing tabs (they can be deleted with :retab) setlocal list -" Column marker: 80 characters -call matchadd('ColorColumn', '\%101v', 100) -setlocal textwidth=100 +" Text width +match ColorColumn /\%81v/ +setlocal textwidth=80 +setlocal linebreak + +" Syntax highlighting colors +highlight Title ctermfg=blue +highlight TitleHash ctermfg=cyan +match TitleHash /^##*/ nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> -nnoremap <buffer> <leader>t :-1r ~/.vim/ftplugin/vimwiki/snips/template.txt<CR> +nnoremap <buffer> <leader>tt :r ~/.vim/ftplugin/vimwiki/snips/template.txt<CR> +nnoremap <buffer> <leader>tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt<CR>/<+++><CR>cf> nnoremap <buffer> <leader>c :w<CR>:!toPDF.sh "%"<CR><CR> -nnoremap <buffer> <leader>o :w<CR>:!toPDF.sh -o "%"<CR> - -" Syntax highlighting colors -highlight Title ctermfg=darkblue +nnoremap <buffer> <leader>o :w<CR>:!toPDF.sh -o "%"<CR><CR> +inoremap <buffer> <leader>h <Esc><<A +inoremap <buffer> <leader>l <Esc>>>A |