diff --git a/.gitignore b/.gitignore index f75c8c3..0b3ea3f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ wal-colors.vim wal_example-dark.vim wal_example-light.vim vim/autoload/plug.vim +.is-dev diff --git a/vim/coc-settings.json b/vim/coc-settings.json index 347951c..3e3810d 100644 --- a/vim/coc-settings.json +++ b/vim/coc-settings.json @@ -2,6 +2,7 @@ "coc.preferences.triggerAfterInsertEnter": false, "coc.preferences.autoTrigger": "none", "coc.preferences.triggerSignatureHelp": true, + "coc.preferences.diagnostic.enable": false, "coc.preferences.diagnostic.warningSign": "λ", "coc.preferences.diagnostic.errorSign": "Λ", "coc.preferences.diagnostic.infoSign": "λ", diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim index 37d086b..2d7750d 100644 --- a/vim/ftplugin/python.vim +++ b/vim/ftplugin/python.vim @@ -4,9 +4,8 @@ set shiftwidth=4 set textwidth=79 -nnoremap :call SaveAndExecute('python') -" vnoremap :call SaveAndExecutePython() - set foldmethod=indent set foldnestmax=1 +nnoremap :call SaveAndExecute('python') +command! CTagsPython !ctags -R --fields=+l --languages=python --python-kinds=-iv -f ./.tags-py $(python -c "import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))") diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim index 4001052..385d996 100644 --- a/vim/ftplugin/vim.vim +++ b/vim/ftplugin/vim.vim @@ -1,3 +1,4 @@ setlocal keywordprg=:help +setlocal iskeyword+=: nnoremap :w \| source % diff --git a/vimrc b/vimrc index 201215d..5a76078 100644 --- a/vimrc +++ b/vimrc @@ -1,5 +1,6 @@ -" #plugins {{{ +" ● +" #plugins {{{ if empty(glob('~/.vim/autoload/plug.vim'))"{{{ silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim @@ -12,6 +13,133 @@ if !has('nvim') Plug '~/.config/vim/vim/bundle/vim-learnxiny' + +" #Ctrlp {{{ + Plug 'ctrlpvim/ctrlp.vim' + " :h ctrlp-commands + " :h ctrlp-extensions + + let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo'] + + if executable('ag') + " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore + let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' + " ag is fast enough that CtrlP doesn't need to cache + let g:ctrlp_use_caching = 0 + endif + " Use ag over grep + if executable('ag') + set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules + endif + + "}}} +" #Netrw {{{ + + let g:netrw_liststyle=3 + let g:netrw_list_hide='^\..*' + let g:netrw_preview = 0 + + "}}} +" #MatchTagAlways{{{ + " https://github.com/Valloric/MatchTagAlways + Plug 'Valloric/MatchTagAlways' +let g:mta_filetypes = { + \ 'jinja' : 1, + \ 'html' : 1, + \ 'vue' : 1, + \ 'xhtml' : 1, + \ 'xml' : 1, + \} + "}}} +" #Obsession{{{ + Plug 'tpope/vim-obsession' + + "}}} +" #switch {{{ + "https://github.com/AndrewRadev/switch.vim + Plug 'AndrewRadev/switch.vim' + + let g:switch_mapping = '-' + let g:switch_custom_definitions = [ + \ ['0', '1'], + \ ['ease-in', 'ease-out', 'ease-in-out', 'linear'], + \ ['auto', 'none'], + \ ['left', 'right'], + \ ['top', 'bottom'], + \ ['row', 'column'], + \ ['relative', 'absolute', 'fixed'] + \ ] + + "}}} +" #switch {{{ + "https://github.com/AndrewRadev/switch.vim + Plug 'AndrewRadev/switch.vim' + + let g:switch_mapping = '-' + let g:switch_custom_definitions = [ + \ ['0', '1'], + \ ['ease-in', 'ease-out', 'ease-in-out', 'linear'], + \ ['auto', 'none'], + \ ['left', 'right'], + \ ['top', 'bottom'], + \ ['row', 'column'], + \ ['relative', 'absolute', 'fixed'] + \ ] + + "}}} +" #undotree {{{ + Plug 'mbbill/undotree' + nnoremap ut :UndotreeToggle + + "}}} +" #tcomment_vim{{{ + " https://github.com/tomtom/tcomment_vim + Plug 'tomtom/tcomment_vim' + +"}}} +" #vim-easy-align {{{ + " https://github.com/junegunn/vim-easy-align + Plug 'junegunn/vim-easy-align' + + xmap ga (EasyAlign) + nmap ga (EasyAlign) + + "}}} +" #vim-qlist {{{ +" Original: https://github.com/romainl/vim-qlist +Plug 'studio-vx/vim-qlist' +"}}} +" #vim-repeat{{{ + " https://github.com/tpope/vim-repeat + Plug 'tpope/vim-repeat' + + "}}} +" #vim-rsi{{{ + "https://github.com/tpope/vim-rsi + Plug 'tpope/vim-rsi' + + "}}} +" #vim-surround{{{ + Plug 'tpope/vim-surround' + + "}}} +" #vim-fugitive{{{ + " https://github.com/tpope/vim-fugitive/blob/master/README.markdown + Plug 'tpope/vim-fugitive' + nnoremap gs :Gstatus + nnoremap gd :tabedit %:Gdiff + nnoremap gc :Gcommit + nnoremap gl :Glog + nnoremap gp :Gpush:copen + + "}}} +" #wakatime{{{ + " https://wakatime.com/vim + Plug 'wakatime/vim-wakatime' + + "}}} + +if filereadable(expand('.is-dev')) " #ALE {{{ " https://github.com/w0rp/ale Plug 'w0rp/ale' @@ -92,25 +220,6 @@ if !has('nvim') " #css3-syntax{{{ Plug 'hail2u/vim-css3-syntax' - "}}} -" #Ctrlp {{{ - Plug 'ctrlpvim/ctrlp.vim' - " :h ctrlp-commands - " :h ctrlp-extensions - - let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo'] - - if executable('ag') - " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore - let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' - " ag is fast enough that CtrlP doesn't need to cache - let g:ctrlp_use_caching = 0 - endif - " Use ag over grep - if executable('ag') - set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules - endif - "}}} " #emmet-vim {{{ " https://github.com/mattn/emmet-vim @@ -167,28 +276,6 @@ if !has('nvim') nnoremap ie :InlineEdit - "}}} -" #MatchTagAlways{{{ - " https://github.com/Valloric/MatchTagAlways - Plug 'Valloric/MatchTagAlways' -let g:mta_filetypes = { - \ 'jinja' : 1, - \ 'html' : 1, - \ 'vue' : 1, - \ 'xhtml' : 1, - \ 'xml' : 1, - \} - "}}} -" #Netrw {{{ - - let g:netrw_liststyle=3 - let g:netrw_list_hide='^\..*' - let g:netrw_preview = 0 - - "}}} -" #Obsession{{{ - Plug 'tpope/vim-obsession' - "}}} " #php.vim{{{ " https://github.com/StanAngeloff/php.vim @@ -211,22 +298,6 @@ let g:mta_filetypes = { " #scss-syntax{{{ Plug 'cakebaker/scss-syntax.vim' - "}}} -" #switch {{{ - "https://github.com/AndrewRadev/switch.vim - Plug 'AndrewRadev/switch.vim' - - let g:switch_mapping = '-' - let g:switch_custom_definitions = [ - \ ['0', '1'], - \ ['ease-in', 'ease-out', 'ease-in-out', 'linear'], - \ ['auto', 'none'], - \ ['left', 'right'], - \ ['top', 'bottom'], - \ ['row', 'column'], - \ ['relative', 'absolute', 'fixed'] - \ ] - "}}} " #tagbar {{{ Plug 'majutsushi/tagbar' @@ -329,28 +400,10 @@ let g:mta_filetypes = { set completefunc=CompleteSnippets "}}} -" #undotree {{{ - Plug 'mbbill/undotree' - nnoremap ut :UndotreeToggle - - "}}} -" #tcomment_vim{{{ - " https://github.com/tomtom/tcomment_vim - Plug 'tomtom/tcomment_vim' - -"}}} " #vim-dispatch{{{ " https://github.com/tpope/vim-dispatch Plug 'tpope/vim-dispatch' - "}}} -" #vim-easy-align {{{ - " https://github.com/junegunn/vim-easy-align - Plug 'junegunn/vim-easy-align' - - xmap ga (EasyAlign) - nmap ga (EasyAlign) - "}}} " #vim-gutentags {{{ " https://github.com/ludovicchabant/vim-gutentags @@ -426,20 +479,6 @@ let g:mta_filetypes = { " augroup END ""}}} -" #vim-repeat{{{ - " https://github.com/tpope/vim-repeat - Plug 'tpope/vim-repeat' - - "}}} -" #vim-rsi{{{ - "https://github.com/tpope/vim-rsi - Plug 'tpope/vim-rsi' - - "}}} -" #vim-surround{{{ - Plug 'tpope/vim-surround' - - "}}} " #vim-SyntaxRange{{{ " https://github.com/inkarkat/vim-SyntaxRange " Plug 'inkarkat/vim-SyntaxRange' @@ -483,27 +522,13 @@ let g:mta_filetypes = { " Using studio-vx fork Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' } - "}}} -" #vim-fugitive{{{ - " https://github.com/tpope/vim-fugitive/blob/master/README.markdown - Plug 'tpope/vim-fugitive' - nnoremap gs :Gstatus - nnoremap gd :tabedit %:Gdiff - nnoremap gc :Gcommit - nnoremap gl :Glog - nnoremap gp :Gpush:copen - "}}} " #vim-git{{{ " https://github.com/tpope/vim-git Plug 'tpope/vim-git' "}}} -" #wakatime{{{ - " https://wakatime.com/vim - Plug 'wakatime/vim-wakatime' - - "}}} +endif call plug#end() endif @@ -969,7 +994,8 @@ set lazyredraw set backupdir=~/.vimtmp set directory=~/.vimtmp -set tags+=./.tags,.tags;/home/ray/ +" the ;/home/ray tells vim to stop searching at /home/ray +set tags+=./.tags,.tags,./tags-py,.tags-py;/home/ray/ " persisitent undo file set undodir=/home/ray/.vim/undodir @@ -997,7 +1023,7 @@ set hlsearch " set previewheight=24 " set splitbelow -set completeopt=longest,menuone,preview +set completeopt=longest,menuone set nospell set spelllang=en_gb @@ -1110,7 +1136,7 @@ nnoremap :bprevious nnoremap :bnext " alias for :tjump nnoremap tj g -" alias for @ptjump +" alias for :ptjump nnoremap tp g} "}}} @@ -1450,7 +1476,9 @@ function! GetStatus(isactive) abort "{{{ let l:statusline .= ' ' . l:separator - let l:statusline .= '%#StatusLineWarning#%{gutentags#statusline("", "", "☢")}' + if exists('gutentags#statusline') + let l:statusline .= '%#StatusLineWarning#%{gutentags#statusline("", "", "☢")}' + endif return l:statusline