diff --git a/vim/ftplugin/go.vim b/vim/ftplugin/go.vim index 9df729d..ee54894 100644 --- a/vim/ftplugin/go.vim +++ b/vim/ftplugin/go.vim @@ -1,4 +1,8 @@ -let g:syntastic_go_checkers = ['go', 'golint', 'govet'] +if has("nvim") +else + let g:syntastic_go_checkers = ['go', 'golint', 'govet'] +endif + let g:go_fmt_command = "goimports" au FileType go nmap (go-run) diff --git a/vim/ftplugin/javascript.vim b/vim/ftplugin/javascript.vim index 52a9b52..49fe656 100644 --- a/vim/ftplugin/javascript.vim +++ b/vim/ftplugin/javascript.vim @@ -1,12 +1,19 @@ -"let g:syntastic_javascript_checkers = ['standard'] -let g:syntastic_javascript_checkers = ['eslint'] -let g:syntastic_javascript_eslint_exe = '$(npm bin)/eslint' -let g:syntastic_javascript_eslint_args = ['--fix'] - -" And also for vue -let g:syntastic_vue_checkers = ['eslint'] -let g:syntastic_vue_eslint_exe = '$(npm bin)/eslint' -let g:syntastic_vue_eslint_args = ['--fix'] +if has("nvim") + +else + " Syntastic {{{ + "let g:syntastic_javascript_checkers = ['standard'] + let g:syntastic_javascript_checkers = ['eslint'] + let g:syntastic_javascript_eslint_exe = '$(npm bin)/eslint' + let g:syntastic_javascript_eslint_args = ['--fix'] + + " And also for vue + let g:syntastic_vue_checkers = ['eslint'] + let g:syntastic_vue_eslint_exe = '$(npm bin)/eslint' + let g:syntastic_vue_eslint_args = ['--fix'] + "}}} +endif + "autocmd bufwritepost *.js silent !standard --fix % set wildignore+=node_modules diff --git a/vim/ftplugin/php.vim b/vim/ftplugin/php.vim index b372bd7..a74bd6e 100644 --- a/vim/ftplugin/php.vim +++ b/vim/ftplugin/php.vim @@ -5,4 +5,4 @@ let g:gutentags_ctags_exclude = ['*.css', '*.html', '*.js', '*.json', '*.xml', \ '*vendor/*/fixture*', '*vendor/*/Fixture*', \ '*var/cache*', '*var/log*'] let g:gutentags_ctags_executable = '/home/schneider/bin/phpctags' -let g:gutentags_project_root = '.phpcd.vim' +let g:gutentags_project_root = [ '.phpcd.vim', '.git' ] diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim index 38efc0e..c1436ea 100644 --- a/vim/ftplugin/python.vim +++ b/vim/ftplugin/python.vim @@ -1,4 +1,7 @@ " use python3 as linter if getline(1) =~# '^#!.*python3\>' - let syntastic_python_python_exec="python3" + if has("nvim") + else + let syntastic_python_python_exec="python3" + endif endif diff --git a/vimrc.symlink b/vimrc.symlink index 5c904b1..f7de816 100644 --- a/vimrc.symlink +++ b/vimrc.symlink @@ -3,8 +3,14 @@ filetype off " required " Section Plugins {{{ " Load vim-plug -if empty(glob("~/.vim/autoload/plug.vim")) - execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim' +if has("nvim") + if empty(glob("~/.config/nvim/autoload/plug.vim")) + execute '!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + endif +else + if empty(glob("~/.vim/autoload/plug.vim")) + execute '!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.github.com/junegunn/vim-plug/master/plug.vim' + endif endif call plug#begin() " alternatively, pass a path where Vundle should install plugins @@ -30,7 +36,11 @@ Plug 'bling/vim-airline' Plug 'tpope/vim-ragtag' Plug 'tpope/vim-surround' " better handling of surrounding markers Plug 'tpope/vim-repeat' " repeat last command with . -Plug 'vim-syntastic/syntastic' " automatic linters +if has("nvim") + Plug 'w0rp/ale' " asynchronous linting engine +else + Plug 'vim-syntastic/syntastic' " automatic linters +endif Plug 'altercation/vim-colors-solarized' " solarized theme Plug 'godlygeek/tabular' " Align text on symbols Plug 'ludovicchabant/vim-gutentags', { 'for': ['php', 'c', 'cpp'] } @@ -182,15 +192,22 @@ let NERDTreeShowHidden=1 let g:airline_powerline_fonts = 1 -" Syntastic -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 -let g:syntastic_aggregate_errors = 1 -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* +" Syntastic{{{ +if !has("nvim") + let g:syntastic_always_populate_loc_list = 1 + let g:syntastic_auto_loc_list = 1 + let g:syntastic_check_on_open = 1 + let g:syntastic_check_on_wq = 0 + let g:syntastic_aggregate_errors = 1 + set statusline+=%#warningmsg# + set statusline+=%{SyntasticStatuslineFlag()} + set statusline+=%* +endif +"}}} + +" ALE {{{ +let g:airline#extensions#ale#enabled = 1 +"}}} let vim_tags_ctags_binary='~/bin/phpctags'"