diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-02 10:40:03 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-02 10:40:03 +0100 |
commit | efd23300b89998835a2fc1960178fe0fa1546737 (patch) | |
tree | 6848417d4e021b025473ef475141fdf41d43d7fc | |
parent | 369a0b4930728067e8ad383432162e3588c6bfb2 (diff) | |
download | configs-efd23300b89998835a2fc1960178fe0fa1546737.tar.gz configs-efd23300b89998835a2fc1960178fe0fa1546737.zip |
Discovered a sad truth about vim's handling of keyboard input.
-rw-r--r-- | files/vim/.vimrc | 42 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/css/css_mappings.vim | 4 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/html/html.vim | 2 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/html/html_mappings.vim | 4 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/javascript/javascript.vim | 2 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/javascript/javascript_BufEnter.vim | 24 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/python/python.vim | 2 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/sh/sh.vim | 12 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/sh/snippets/if.txt | 3 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/tex/tex.vim | 2 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/text/text.vim | 2 | ||||
-rw-r--r-- | files/vim/ftplugin/ftplugin/vimwiki/vimwiki.vim | 5 |
12 files changed, 65 insertions, 39 deletions
diff --git a/files/vim/.vimrc b/files/vim/.vimrc index 65b41fa..59ceccd 100644 --- a/files/vim/.vimrc +++ b/files/vim/.vimrc @@ -14,11 +14,11 @@ Plug 'junegunn/fzf.vim' Plug 'tpope/vim-surround' Plug 'tpope/vim-repeat' Plug 'vimwiki/vimwiki' -Plug 'suan/vim-instant-markdown', {'for': 'markdown'} Plug 'vim-airline/vim-airline' Plug 'vim-syntastic/syntastic' Plug 'Valloric/YouCompleteMe' Plug 'OmniSharp/omnisharp-vim' +Plug 'dylanaraps/wal.vim' call plug#end() set nocompatible @@ -70,7 +70,6 @@ nnoremap <leader>l :set list!<CR> " For YouCompleteMe let g:ycm_auto_trigger = 0 let g:ycm_autoclose_preview_window_after_insertion = 1 -let g:ycm_key_list_stop_completion = ['<C-y>', '<C-Space>'] " For syntastic set statusline+=%#warningmsg# @@ -129,31 +128,19 @@ let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown' let g:vimwiki_list = [{'path': '~/vimwiki/', \ 'syntax': 'markdown', 'ext': '.md'}] -" For vim-instant-markdown -" Dependencies: xdg-utils, curl, nodejs -" Install miniserver with: npm -g install instant-markdown-d -let g:instant_markdown_autostart = 0 -let g:instant_markdown_allow_unsafe_content = 1 -let g:instant_markdown_allow_external_content = 1 -let g:instant_markdown_open_to_the_world = 1 -let g:instant_markdown_mathjax = 1 -let g:instant_markdown_logfile = '/tmp/instant_markdown.log' -let g:instant_markdown_python = 1 -map <leader>md :InstantMarkdownPreview<CR> -map <leader>mD :InstantMarkdownStop<CR> - " Shortcuts for split navigation map <C-h> <C-w>h map <C-j> <C-w>j map <C-k> <C-w>k map <C-l> <C-w>l -"map <C-H> <C-w>H +"map <C-H> <C-w>H "<C-H> can't be different from <C-h> "map <C-J> <C-w>J "map <C-K> <C-w>K "map <C-L> <C-w>L -nnoremap <Tab> gt -nnoremap <S-Tab> gT +nnoremap <C-n> :tabnew<CR> +"nnoremap <Tab> gt "Can't be set without also remapping <C-i> +"nnoremap <S-Tab> gT nnoremap <leader>S :!tmux split-window -p 40<CR><CR> @@ -197,13 +184,12 @@ nnoremap <leader>gp :!git push<CR> nnoremap <leader>gc :!git commit -m " "" c++ -nnoremap <leader>ct <Esc>:r ~/.config/custom/vim/c/template.txt<CR>/<+++><CR>cf> -nnoremap <leader>ce <Esc>:r ~/.config/custom/vim/c/enum.txt<CR>/<+++><CR>cf> -nnoremap <leader>cf <Esc>:r ~/.config/custom/vim/c/for.txt<CR>/<+++><CR>cf> -nnoremap <leader>cif <Esc>:r ~/.config/custom/vim/c/if.txt<CR>/<+++><CR>cf> -nnoremap <leader>celse <Esc>:r ~/.config/custom/vim/c/else.txt<CR>/<+++><CR>cf> -nnoremap <leader>celif <Esc>:r ~/.config/custom/vim/c/elif.txt<CR>/<+++><CR>cf> -nnoremap <leader>cs <Esc>:r ~/.config/custom/vim/c/switch.txt<CR>/<+++><CR>cf> -nnoremap <leader>cw <Esc>:r ~/.config/custom/vim/c/while.txt<CR>/<+++><CR>cf> -nnoremap <leader>cd <Esc>:r ~/.config/custom/vim/c/do.txt<CR>/<+++><CR>cf> - +"nnoremap <leader>ct <Esc>:r ~/.config/custom/vim/c/template.txt<CR>/<+++><CR>cf> +"nnoremap <leader>ce <Esc>:r ~/.config/custom/vim/c/enum.txt<CR>/<+++><CR>cf> +"nnoremap <leader>cf <Esc>:r ~/.config/custom/vim/c/for.txt<CR>/<+++><CR>cf> +"nnoremap <leader>cif <Esc>:r ~/.config/custom/vim/c/if.txt<CR>/<+++><CR>cf> +"nnoremap <leader>celse <Esc>:r ~/.config/custom/vim/c/else.txt<CR>/<+++><CR>cf> +"nnoremap <leader>celif <Esc>:r ~/.config/custom/vim/c/elif.txt<CR>/<+++><CR>cf> +"nnoremap <leader>cs <Esc>:r ~/.config/custom/vim/c/switch.txt<CR>/<+++><CR>cf> +"nnoremap <leader>cw <Esc>:r ~/.config/custom/vim/c/while.txt<CR>/<+++><CR>cf> +"nnoremap <leader>cd <Esc>:r ~/.config/custom/vim/c/do.txt<CR>/<+++><CR>cf> diff --git a/files/vim/ftplugin/ftplugin/css/css_mappings.vim b/files/vim/ftplugin/ftplugin/css/css_mappings.vim index 161f850..c8c8ceb 100644 --- a/files/vim/ftplugin/ftplugin/css/css_mappings.vim +++ b/files/vim/ftplugin/ftplugin/css/css_mappings.vim @@ -9,7 +9,7 @@ set nolist set textwidth=80 " Mappings -nnoremap <leader>cc :sp ~/.vim/ftplugin/css/css.vim<CR> -nnoremap <leader>cm :sp ~/.vim/ftplugin/css/css_mappings.vim<CR> +nnoremap <leader>Cc :sp ~/.vim/ftplugin/css/css.vim<CR> +nnoremap <leader>Cm :sp ~/.vim/ftplugin/css/css_mappings.vim<CR> nnoremap <leader>e :Errors<CR> nnoremap <leader>s vi{!sort<CR> diff --git a/files/vim/ftplugin/ftplugin/html/html.vim b/files/vim/ftplugin/ftplugin/html/html.vim index e4e0ab5..fb1c4bd 100644 --- a/files/vim/ftplugin/ftplugin/html/html.vim +++ b/files/vim/ftplugin/ftplugin/html/html.vim @@ -5,4 +5,4 @@ call matchadd('ColorColumn', '\%101v', 100) -autocmd BufEnter *.html source ~/.vim/ftplugin/html_mappings.vim +autocmd BufEnter *.html source ~/.vim/ftplugin/html/html_mappings.vim diff --git a/files/vim/ftplugin/ftplugin/html/html_mappings.vim b/files/vim/ftplugin/ftplugin/html/html_mappings.vim index b798408..2acd4fe 100644 --- a/files/vim/ftplugin/ftplugin/html/html_mappings.vim +++ b/files/vim/ftplugin/ftplugin/html/html_mappings.vim @@ -3,8 +3,8 @@ nnoremap <leader>o :!$BROWSER % &<CR><CR> nnoremap <leader>f :!firefox --new-window % &<CR><CR> -nnoremap <leader>cc :sp ~/.vim/ftplugin/html.vim<CR> -nnoremap <leader>cm :sp ~/.vim/ftplugin/html_mappings.vim<CR> +nnoremap <leader>Cc :sp ~/.vim/ftplugin/html/html.vim<CR> +nnoremap <leader>Cm :sp ~/.vim/ftplugin/html/html_mappings.vim<CR> nnoremap <leader>e :Errors<CR> " Layout elements diff --git a/files/vim/ftplugin/ftplugin/javascript/javascript.vim b/files/vim/ftplugin/ftplugin/javascript/javascript.vim index 470287d..71c66ba 100644 --- a/files/vim/ftplugin/ftplugin/javascript/javascript.vim +++ b/files/vim/ftplugin/ftplugin/javascript/javascript.vim @@ -9,4 +9,4 @@ call matchadd('ColorColumn', '\%81v', 100) " JSLint arguments let g:syntastic_javascript_jslint_args = "--browser --indent" -autocmd BufEnter *.js source ~/.vim/ftplugin/javasctipt/javascript_BufEnter.vim +autocmd BufEnter *.js source ~/.vim/ftplugin/javascript/javascript_BufEnter.vim diff --git a/files/vim/ftplugin/ftplugin/javascript/javascript_BufEnter.vim b/files/vim/ftplugin/ftplugin/javascript/javascript_BufEnter.vim new file mode 100644 index 0000000..6b8d852 --- /dev/null +++ b/files/vim/ftplugin/ftplugin/javascript/javascript_BufEnter.vim @@ -0,0 +1,24 @@ +" ~/.vim/ftplugin/javascript/javascript_BufEnter.vim +" JavaScript-specific vim configuration (reloaded when entering buffer) + +" Tabs are expanded to 4 spaces +set tabstop=4 shiftwidth=4 expandtab +" Show existing tabs (they can be deleted with :retab) +set list + +set textwidth=80 + +" Mappings +nnoremap <leader>Cc :sp ~/.vim/ftplugin/javascript/javascript.vim<CR> +nnoremap <leader>Cm :sp ~/.vim/ftplugin/javascript/javascript_BufEnter.vim<CR> + +inoremap <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf> +inoremap <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf> + +nnoremap <leader>gt :YcmCompleter GoTo<CR> +nnoremap <leader>gr :YcmCompleter GoToReferences<CR> +nnoremap <leader>fi :YcmCompleter FixIt<CR> +nnoremap <leader>r :YcmCompleter RefactorRename<Space> +nnoremap <leader>e :YcmDiags<CR> + +nnoremap <leader>E :Errors<CR> diff --git a/files/vim/ftplugin/ftplugin/python/python.vim b/files/vim/ftplugin/ftplugin/python/python.vim index 74c7e2c..bb0e6f9 100644 --- a/files/vim/ftplugin/ftplugin/python/python.vim +++ b/files/vim/ftplugin/ftplugin/python/python.vim @@ -5,7 +5,7 @@ call matchadd('ColorColumn', '\%81v', 100) let b:syntastic_mode="passive" -nnoremap <leader>c :sp ~/.vim/ftplugin/python/python.vim<CR> +nnoremap <leader>C :sp ~/.vim/ftplugin/python/python.vim<CR> nnoremap <leader>E :Errors<CR> nnoremap <leader>gt :YcmCompleter GoTo<CR> diff --git a/files/vim/ftplugin/ftplugin/sh/sh.vim b/files/vim/ftplugin/ftplugin/sh/sh.vim index bebdcba..41a5327 100644 --- a/files/vim/ftplugin/ftplugin/sh/sh.vim +++ b/files/vim/ftplugin/ftplugin/sh/sh.vim @@ -1,5 +1,15 @@ " ~/.vim/ftplugin/sh.vim " Bourne shell scripts specific vim configuration +" +" Linters: sh, shellcheck -nnoremap <leader>e :Errors<CR> call matchadd('ColorColumn', '\%101v', 100) + +nnoremap <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR> +nnoremap <leader>+x :!chmod 744 %<CR><CR> +nnoremap <leader>x :!./%<Space> +nnoremap <leader>e :Errors<CR> + +inoremap <leader>sh #!/bin/sh +inoremap <leader>if if <+++>; then<CR><++><CR>fi<++><Esc>?<+++><CR>cf> +"inoremap <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf> diff --git a/files/vim/ftplugin/ftplugin/sh/snippets/if.txt b/files/vim/ftplugin/ftplugin/sh/snippets/if.txt new file mode 100644 index 0000000..9f6bb88 --- /dev/null +++ b/files/vim/ftplugin/ftplugin/sh/snippets/if.txt @@ -0,0 +1,3 @@ +if <+++>; then + <++> +fi<++> diff --git a/files/vim/ftplugin/ftplugin/tex/tex.vim b/files/vim/ftplugin/ftplugin/tex/tex.vim index 43492e5..2215190 100644 --- a/files/vim/ftplugin/ftplugin/tex/tex.vim +++ b/files/vim/ftplugin/ftplugin/tex/tex.vim @@ -5,7 +5,7 @@ call matchadd('ColorColumn', '\%91v', 100) -nnoremap <leader>c :sp ~/.vim/ftplugin/tex.vim<CR> +nnoremap <leader>C :sp ~/.vim/ftplugin/tex.vim<CR> nnoremap <leader>e :Errors<CR> " proselint not enabled by default (and better not be) nnoremap <leader>sp :SyntasticCheck proselint<CR> diff --git a/files/vim/ftplugin/ftplugin/text/text.vim b/files/vim/ftplugin/ftplugin/text/text.vim index 3252e54..bf6b9ab 100644 --- a/files/vim/ftplugin/ftplugin/text/text.vim +++ b/files/vim/ftplugin/ftplugin/text/text.vim @@ -3,7 +3,7 @@ " " Syntastic linter: proselint -nnoremap <leader>c :sp ~/.vim/ftplugin/text.vim<CR> +nnoremap <leader>C :sp ~/.vim/ftplugin/text/text.vim<CR> nnoremap <leader>e :Errors<CR> call matchadd('ColorColumn', '\%101v', 100) diff --git a/files/vim/ftplugin/ftplugin/vimwiki/vimwiki.vim b/files/vim/ftplugin/ftplugin/vimwiki/vimwiki.vim index 92eea91..7164c1c 100644 --- a/files/vim/ftplugin/ftplugin/vimwiki/vimwiki.vim +++ b/files/vim/ftplugin/ftplugin/vimwiki/vimwiki.vim @@ -14,5 +14,8 @@ set textwidth=80 let g:syntastic_vimwiki_checkers = ['markdown/mdl'] -nnoremap <leader>c :sp ~/.vim/ftplugin/vimwiki.vim<CR> +nnoremap <leader>C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim<CR> nnoremap <leader>e :Errors<CR> + +nnoremap <leader>c :w<CR>:!toPDF.sh %<CR><CR> +nnoremap <leader>o :w<CR>:!toPDF.sh -o %<CR><CR> |