From 8c68a09b1596448dc9da3bc9d43e7c2eccee4e12 Mon Sep 17 00:00:00 2001 From: Vasili Svirydau Date: Thu, 28 Apr 2022 17:05:59 +0000 Subject: [PATCH] . --- after/ftplugin/fsharp.vim | 1 + after/plugin/fzf.vim | 4 ++++ after/plugin/grep.vim | 9 +++++++++ coc-settings.json | 8 ++++++-- config/01-plugins.vim | 14 +++++++++++++- ftplugin/bash.vim | 2 ++ ftplugin/dockerfile.vim | 2 ++ ftplugin/elixir.vim | 2 ++ ftplugin/javascript.vim | 2 ++ ftplugin/ruby.vim | 1 + ftplugin/sh.vim | 2 ++ ftplugin/typescript.vim | 2 ++ plugin/grep.vim | 24 ++++++++++++------------ plugin/langmap.vim | 1 + 14 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 after/ftplugin/fsharp.vim create mode 100644 after/plugin/fzf.vim create mode 100644 after/plugin/grep.vim create mode 100644 ftplugin/bash.vim create mode 100644 ftplugin/dockerfile.vim create mode 100644 ftplugin/elixir.vim create mode 100644 ftplugin/javascript.vim create mode 100644 ftplugin/ruby.vim create mode 100644 ftplugin/sh.vim create mode 100644 ftplugin/typescript.vim create mode 100644 plugin/langmap.vim diff --git a/after/ftplugin/fsharp.vim b/after/ftplugin/fsharp.vim new file mode 100644 index 0000000..cebf4aa --- /dev/null +++ b/after/ftplugin/fsharp.vim @@ -0,0 +1 @@ +set commentstring=//%s diff --git a/after/plugin/fzf.vim b/after/plugin/fzf.vim new file mode 100644 index 0000000..7a927c2 --- /dev/null +++ b/after/plugin/fzf.vim @@ -0,0 +1,4 @@ +" fzf file fuzzy search that respects .gitignore +" If in git directory, show only files that are committed, staged, or unstaged +" else use regular :Files +nnoremap (len(system('git rev-parse')) ? ':Files' : ':GFiles --exclude-standard --others --cached')."\" diff --git a/after/plugin/grep.vim b/after/plugin/grep.vim new file mode 100644 index 0000000..222a0f5 --- /dev/null +++ b/after/plugin/grep.vim @@ -0,0 +1,9 @@ +" Remap ctrl+p to fzf +if exists('g:loaded_fzf') + " nmap :FZF + " fzf file fuzzy search that respects .gitignore + " If in git directory, show only files that are committed, staged, or unstaged + " else use regular :Files + nnoremap (len(system('git rev-parse')) ? ':Files' : ':GFiles --exclude-standard --others --cached')."\" +endif + diff --git a/coc-settings.json b/coc-settings.json index 199efac..7aff786 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -1,6 +1,10 @@ { "coc.preferences.previewAutoClose": false, - "coc.preferences.hoverTarget": "echo", + // "coc.preferences.hoverTarget": "echo", "tsserver.log": "off", - "tsserver.trace.server":"off" + "fsharp.log": "off", + "tsserver.trace.server":"off", + "elixirLS.dialyzerEnabled": false, + "coc.preferences.extensionUpdateCheck": "daily", + "diagnostic.displayByAle": true, } diff --git a/config/01-plugins.vim b/config/01-plugins.vim index ee70163..865fba2 100644 --- a/config/01-plugins.vim +++ b/config/01-plugins.vim @@ -17,6 +17,9 @@ if(s:have_plug) Plug 'tpope/vim-sensible' " Sensible defaults for vim + Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + Plug 'junegunn/fzf.vim' + Plug 'ctrlpvim/ctrlp.vim' " Fuzzy search Plug 'editorconfig/editorconfig-vim' " EditorConfig.org support if executable('ag') @@ -45,7 +48,7 @@ if(s:have_plug) " Plug 'sotte/presenting.vim' " Slides if v:version >= 800 - Plug 'w0rp/ale' " Asynchronous Linting + Plug 'dense-analysis/ale' " Asynchronous Linting Plug 'sbdchd/neoformat' " Automatic code formatting Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'Shougo/deoplete.nvim' " Autocomplete Support @@ -72,10 +75,17 @@ let g:loaded_netrwPlugin = 1 " Disable netrw let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#ale#enabled = 1 let g:ale_sign_column_always = 1 let g:ale_sign_error = '' let g:ale_sign_warning = '' +let g:ale_linters_explicit = 1 +let g:ale_javascript_eslint_executable = 'eslint_d' +let g:ale_javascript_eslint_use_global = 1 +let g:ale_disable_lsp = 1 +let g:ale_lint_on_text_changed = 'never' +let g:ale_lint_on_insert_leave = 0 let g:coverage_json_report_path = 'coverage/coverage-final.json' let g:coverage_sign_covered = '' @@ -85,3 +95,5 @@ let g:signify_vcs_list = [ 'git' ] let g:neoformat_enabled_html = ['prettier'] let g:neoformat_enabled_nginx = ['nginxbeautifier'] + +" let g:coc_node_path = '/usr/bin/node' diff --git a/ftplugin/bash.vim b/ftplugin/bash.vim new file mode 100644 index 0000000..ff4f741 --- /dev/null +++ b/ftplugin/bash.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['shellcheck'] + diff --git a/ftplugin/dockerfile.vim b/ftplugin/dockerfile.vim new file mode 100644 index 0000000..a1d811b --- /dev/null +++ b/ftplugin/dockerfile.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['hadolint'] + diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim new file mode 100644 index 0000000..69088ff --- /dev/null +++ b/ftplugin/elixir.vim @@ -0,0 +1,2 @@ +" let b:ale_linters = ['credo', 'dialyxir'] +let b:ale_linters = ['dialyxir'] diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim new file mode 100644 index 0000000..4ff6607 --- /dev/null +++ b/ftplugin/javascript.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['eslint'] + diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim new file mode 100644 index 0000000..c7079f1 --- /dev/null +++ b/ftplugin/ruby.vim @@ -0,0 +1 @@ +let b:ale_linters = ['rubocop', 'reek'] diff --git a/ftplugin/sh.vim b/ftplugin/sh.vim new file mode 100644 index 0000000..ff4f741 --- /dev/null +++ b/ftplugin/sh.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['shellcheck'] + diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim new file mode 100644 index 0000000..4ff6607 --- /dev/null +++ b/ftplugin/typescript.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['eslint'] + diff --git a/plugin/grep.vim b/plugin/grep.vim index 6692a2b..80157c1 100644 --- a/plugin/grep.vim +++ b/plugin/grep.vim @@ -1,13 +1,6 @@ - " Set up CtrlP with faster alternative, if possible -if executable('ag') - " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher - set grepprg=ag\ --nogroup\ --nocolor - " Use ag in CtrlP for listing files. Lightning fast, respects .gitignore - " and .agignore. Ignores hidden files by default. - let g:ctrlp_user_command = 'ag %s -l --nocolor -f -g ""' - let g:ctrlp_use_caching = 0 - finish -endif +" Set up CtrlP with faster alternative, if possible +"ctrl+p ignore files in .gitignore +let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f'] if executable('rg') set grepprg=rg\ --color=never @@ -17,5 +10,12 @@ if executable('rg') finish endif -"ctrl+p ignore files in .gitignore -let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f'] +if executable('ag') + " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher + set grepprg=ag\ --nogroup\ --nocolor + " Use ag in CtrlP for listing files. Lightning fast, respects .gitignore + " and .agignore. Ignores hidden files by default. + let g:ctrlp_user_command = 'ag %s -l --nocolor -f -g ""' + let g:ctrlp_use_caching = 0 + finish +endif diff --git a/plugin/langmap.vim b/plugin/langmap.vim new file mode 100644 index 0000000..7358d81 --- /dev/null +++ b/plugin/langmap.vim @@ -0,0 +1 @@ +" set langmap=йЙцЦуУкКеЕнНгГшШщЩзЗхХъЪфФыЫвВаАпПрРоОлЛдДжЖэЭяЯчЧсСмМиИтТьЬбБюЮ.\\,;qQwWeErRtTyYuUiIoOpP[{]}aAsSdDfFgGhHjJkKlL;:'\"zZxXcCvVbBnNmM\\,<.>/?