diff options
Diffstat (limited to 'stow/vim/.vim/ftplugin')
-rw-r--r-- | stow/vim/.vim/ftplugin/python/python.vim | 15 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/sh/sh.vim | 3 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/sh/snippets/template.txt | 18 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/tex/tex.vim | 5 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim | 2 |
5 files changed, 25 insertions, 18 deletions
diff --git a/stow/vim/.vim/ftplugin/python/python.vim b/stow/vim/.vim/ftplugin/python/python.vim index 0aeff8c..dab8c22 100644 --- a/stow/vim/.vim/ftplugin/python/python.vim +++ b/stow/vim/.vim/ftplugin/python/python.vim @@ -10,21 +10,20 @@ setlocal list call matchadd('ColorColumn', '\%91v', 100) setlocal textwidth=90 -let b:ale_python_pylint_options = '-d invalid-name' -let b:ale_fixers = ['yapf'] +"let b:ale_python_pylint_options = '-d invalid-name' +"let b:ale_fixers = ['yapf'] " Mappings let mapleader = " " nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/python/python.vim<CR> -nnoremap <buffer> <leader>x :! ./% -nnoremap <buffer> <leader>X :! ./%<CR> +nnoremap <buffer> <leader>x :w<CR>:!./%<Space> +nnoremap <buffer> <leader>X :w<CR>:!./%<CR> -nnoremap <buffer> gd <Plug>(coc-definition) -nnoremap <buffer> gy <Plug>(coc-type-definition) -nnoremap <buffer> gi <Plug>(coc-implementation) -nnoremap <buffer> gr <Plug>(coc-references) +"nnoremap <buffer> gd <Plug>(coc-definition) +"nnoremap <buffer> gy <Plug>(coc-type-definition) +"nnoremap <buffer> gr <Plug>(coc-references) nnoremap <buffer> <leader>s oimport pdb<Enter>pdb.set_trace()<Esc>2k nnoremap <buffer> <leader>db :!tmux split-window -l '40\%' 'python -m̀ pdb %' diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim index cc52e08..58d39fe 100644 --- a/stow/vim/.vim/ftplugin/sh/sh.vim +++ b/stow/vim/.vim/ftplugin/sh/sh.vim @@ -11,13 +11,12 @@ setlocal textwidth=110 let mapleader = " " nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR><CR> -nnoremap <buffer> <leader>sh :read ~/.vim/ftplugin/sh/snippets/template.txt<CR><CR> nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR> nnoremap <buffer> <leader>x :w<CR>:!./%<Space> nnoremap <buffer> <leader>X :w<CR>:!./%<CR><CR> -nnoremap <buffer> <leader>e :Errors<CR> let mapleader = "," +inoremap <buffer> <leader>sh <Esc>:read ~/.vim/ftplugin/sh/snippets/template.txt<CR><CR> inoremap <buffer> <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf> inoremap <buffer> <leader>case <Esc>:read ~/.vim/ftplugin/sh/snippets/case.txt<CR>kdd/<+++><CR>cf> diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt index 64d3a2e..171dcf8 100644 --- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt +++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt @@ -4,7 +4,15 @@ # # Usage: template.sh [-ac] [-b OPTARG] FILE... -usageMessage="Usage: template.sh [-ac] [-b OPTARG] FILE..." +usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..." + +error() { + printf '%s error: %s\n' "$0" "$*" >&2 +} + +errorAndUsage() { + printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2 +} # Process options while getopts ':ab:c' opt; do @@ -15,7 +23,7 @@ while getopts ':ab:c' opt; do ;; 'b' ) - echo b $OPTARG + echo b "$OPTARG" ;; 'c' ) @@ -23,11 +31,9 @@ while getopts ':ab:c' opt; do ;; '?' ) - printf "${usageMessage}\n" + printf '%s\n' "$usageMessage" exit 1 esac done -shift $(($OPTIND - 1)) - -<++> +shift $((OPTIND - 1)) diff --git a/stow/vim/.vim/ftplugin/tex/tex.vim b/stow/vim/.vim/ftplugin/tex/tex.vim index 87f3c88..f84f73e 100644 --- a/stow/vim/.vim/ftplugin/tex/tex.vim +++ b/stow/vim/.vim/ftplugin/tex/tex.vim @@ -6,10 +6,15 @@ call matchadd('ColorColumn', '\%91v', 100) setlocal textwidth=80 +setlocal omnifunc=v:lua.vim.lsp.omnifunc +setlocal formatexpr=v:lua.vim.lsp.formatexpr() + let mapleader = " " nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/tex/tex.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> +nnoremap <buffer> K :lua vim.lsp.buf.hover()<CR> +nnoremap <buffer> gd :lua vim.lsp.buf.definition()<CR> " proselint not enabled by default (it's slow) "nnoremap <buffer> <leader>sp :SyntasticCheck proselint<CR> diff --git a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim index d51844b..3a6a661 100644 --- a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim +++ b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim @@ -20,8 +20,6 @@ highlight Title ctermfg=blue highlight TitleHash ctermfg=cyan match TitleHash /^##*/ -setlocal conceallevel=0 - let mapleader = " " nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim<CR> |