From 1c5c4b400ad8f0437e0f230cf059a1890e8a6143 Mon Sep 17 00:00:00 2001 From: Pavel Lutskov Date: Wed, 2 Jan 2019 16:49:47 +0300 Subject: [PATCH] incremental changes --- .vimrc_template | 5 ++++- ftplugin/go.vim | 1 + ftplugin/plaintex.vim | 13 +++++++++++++ ftplugin/python.vim | 2 +- ftplugin/tex.vim | 2 +- plugin/comment.vim | 3 +++ plugin/settings.vim | 28 +++++++++++++++++++++------- 7 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 ftplugin/go.vim create mode 100644 ftplugin/plaintex.vim diff --git a/.vimrc_template b/.vimrc_template index 6f70e66..64bbb6e 100644 --- a/.vimrc_template +++ b/.vimrc_template @@ -13,13 +13,16 @@ call vundle#begin() "call vundle#begin($HOME/vimfiles/bundle/) Plugin 'VundleVim/Vundle.vim' -Plugin 'tmhedberg/SimpylFold' "Plugin 'Valloric/YouCompleteMe' +Plugin 'tmhedberg/SimpylFold' Plugin 'scrooloose/syntastic' Plugin 'vim-scripts/indentpython.vim' Plugin 'scrooloose/nerdtree' Plugin 'tpope/vim-fugitive' +Plugin 'tpope/vim-eunuch' Plugin 'majutsushi/tagbar' +" Plugin 'mattn/emmet-vim' +" Plugin 'lepture/vim-jinja' call vundle#end() "}}} diff --git a/ftplugin/go.vim b/ftplugin/go.vim new file mode 100644 index 0000000..8e3134f --- /dev/null +++ b/ftplugin/go.vim @@ -0,0 +1 @@ +nnoremap x :term go run % diff --git a/ftplugin/plaintex.vim b/ftplugin/plaintex.vim new file mode 100644 index 0000000..1650c65 --- /dev/null +++ b/ftplugin/plaintex.vim @@ -0,0 +1,13 @@ +setlocal foldmethod=syntax tabstop=2 shiftwidth=2 + +iabbrev tit \textit +iabbrev pg \paragraph +iabbrev sc \section +iabbrev sb \subsection +iabbrev ssb \subsubsection +iabbrev td \todo +iabbrev mb \mathbf + +nnoremap x :Latexmk +nnoremap lv :LatexView +nnoremap T :LatexTOC diff --git a/ftplugin/python.vim b/ftplugin/python.vim index 5ad155e..7808751 100644 --- a/ftplugin/python.vim +++ b/ftplugin/python.vim @@ -3,4 +3,4 @@ iabbrev ipl import matplotlib.pyplot as plt iabbrev ipd import pandas as pd iabbrev inm if __name__ == '__main__' -nnoremap x :term python3 % +nnoremap x :term python % diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim index beeb76a..1650c65 100644 --- a/ftplugin/tex.vim +++ b/ftplugin/tex.vim @@ -8,6 +8,6 @@ iabbrev ssb \subsubsection iabbrev td \todo iabbrev mb \mathbf -nnoremap lm :Latexmk +nnoremap x :Latexmk nnoremap lv :LatexView nnoremap T :LatexTOC diff --git a/plugin/comment.vim b/plugin/comment.vim index 3666820..bc2905a 100644 --- a/plugin/comment.vim +++ b/plugin/comment.vim @@ -1,6 +1,7 @@ let s:comment_map = { \ 'c': '\/\/', \ 'cpp': '\/\/', + \ 'go': '\/\/', \ 'java': '\/\/', \ 'javascript': '\/\/', \ 'vhdl': '--', @@ -15,11 +16,13 @@ let s:comment_map = { let s:block_map = { \ 'c': ['\/\*', '\*\/'], \ 'java': ['\/\*', '\*\/'], + \ 'go': ['\/\*', '\*\/'], \ 'cpp': ['\/\*', '\*\/'], \ 'python': ['"""', '"""'], \ 'vim': ['" {{{', '" }}}'], \ 'css': ['\/\*', '\*\/'], \ 'html': [''], + \ 'jinja': ['{#', '#}'], \ 'javascript': ['\/\*', '\*\/'] \ } diff --git a/plugin/settings.vim b/plugin/settings.vim index 564f792..7873703 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -56,12 +56,14 @@ let g:tagbar_map_close = "qT" " Webdev stuff " {{{ let g:user_emmet_install_global = 0 +let g:user_emmet_leader_key = '' augroup webdev autocmd! - autocmd FileType html,css EmmetInstall - autocmd FileType html setlocal omnifunc=htmlcomplete#CompleteTags + autocmd FileType html,jinja,css EmmetInstall + autocmd FileType html,jinja setlocal omnifunc=htmlcomplete#CompleteTags sw=2 tabstop=2 autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS augroup END +runtime macros/matchit.vim " }}} " LatexBox stuff @@ -69,7 +71,7 @@ augroup END let g:LatexBox_no_mappings = 1 let g:LatexBox_quickfix = 2 let g:LatexBox_build_dir = 'build' -let g:LatexBox_latexmk_options = '-xelatex -outdir=build -shell-escape' +let g:LatexBox_latexmk_options = '-outdir=build -shell-escape' " }}} " YouCompleteMe stuff @@ -78,12 +80,15 @@ set completeopt-=preview let g:ycm_autoclose_preview_window_after_completion = 0 let g:ycm_filetype_blacklist = { \ 'tex': 1, + \ 'plaintex': 1, \ 'markdown': 1, \ 'text': 1, \ 'rst': 1, + \ 'html': 1, \ } if has('patch-8.0') - set shortmess+=c " This fixed some bug a while ago + " This is supposed to hide User defined completion ^U^X^P + set shortmess+=c endif " }}} @@ -91,9 +96,10 @@ endif " {{{ let g:syntastic_mode_map = { \ 'mode': 'passive', - \ 'active_filetypes': ['python'] + \ 'active_filetypes': ['python', 'go'] \} let g:syntastic_python_checkers = ['python', 'pyflakes'] +let g:syntastic_go_checkers = ['go'] " }}} " Coding style @@ -116,11 +122,19 @@ augroup END augroup prose autocmd! - autocmd FileType tex,text,markdown,rst + autocmd FileType tex,text,plaintex,markdown,rst \ setlocal spell spelllang=en_us textwidth=79 augroup END " }}} +" For Terminal +" {{{ +augroup terminalsettings + autocmd! + autocmd TerminalOpen * setlocal nonu +augroup END +" }}} + " Mappings " {{{ let mapleader = "," @@ -196,5 +210,5 @@ iabbrev rr return iabbrev itt import cabbrev w!! w !sudo tee > /dev/null % cabbrev ddf %:p:h -cabbrev Pydoc term ++close pydoc +cabbrev Pydoc term ++close python -m pydoc " }}}