From 86af122e2215df9c61f4ea5d2bfb63dab06411d5 Mon Sep 17 00:00:00 2001 From: Ryan Kes <> Date: Fri, 12 Jun 2020 11:57:13 +0200 Subject: [PATCH] Added ale to vim --- README.org | 1 + neovim/.config/coc/extensions/package.json | 2 -- neovim/.config/nvim/coc-settings.json | 28 +++++++++++----------- neovim/.config/nvim/init.vim | 18 ++++++++++++-- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/README.org b/README.org index 583e81e..5190ff8 100644 --- a/README.org +++ b/README.org @@ -161,6 +161,7 @@ A repository of my personal configuration files. - [[https://github.com/vim-airline/vim-airline][vim-airline/vim-airline]] *** Programming - [[https://github.com/airblade/vim-gitgutter][airblade/vim-gitgutter]] +- [[https://github.com/dense-analysis/ale][dense-analysis/ale]] - [[https://github.com/godlygeek/tabular][godlygeek/tabular]] - [[https://github.com/neoclide/coc.nvim][neoclice/coc.nvim]] - [[https://github.com/preservim/nerdcommenter][preservim/nerdcommenter]] diff --git a/neovim/.config/coc/extensions/package.json b/neovim/.config/coc/extensions/package.json index 40b3bc2..461faee 100644 --- a/neovim/.config/coc/extensions/package.json +++ b/neovim/.config/coc/extensions/package.json @@ -1,12 +1,10 @@ { "dependencies": { "coc-css": ">=1.2.3", - "coc-eslint": "^1.2.7", "coc-html": ">=1.2.4", "coc-jest": ">=1.0.3", "coc-json": ">=1.2.6", "coc-pairs": ">=1.2.21", - "coc-prettier": ">=1.1.14", "coc-python": ">=1.2.12", "coc-rls": ">=1.1.6", "coc-tsserver": ">=1.5.1", diff --git a/neovim/.config/nvim/coc-settings.json b/neovim/.config/nvim/coc-settings.json index b4a0bab..c09b3a9 100644 --- a/neovim/.config/nvim/coc-settings.json +++ b/neovim/.config/nvim/coc-settings.json @@ -1,16 +1,16 @@ { - "coc.preferences.formatOnSaveFiletypes": [ - "css", - "markdown", - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "json", - "yaml", - "html", - "graphql", - "mdx", - "rust" - ] + "coc.preferences.formatOnSaveFiletypes": [ + "css", + "markdown", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "json", + "yaml", + "html", + "graphql", + "mdx", + "rust" + ] } diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index bbb5eee..c07d237 100644 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -34,6 +34,7 @@ " Programming { Plug 'airblade/vim-gitgutter' + Plug 'dense-analysis/ale' Plug 'godlygeek/tabular' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'preservim/nerdcommenter' @@ -163,8 +164,6 @@ " } " coc { - command! -nargs=0 Prettier :CocCommand prettier.formatFile - vmap f (coc-format-selected) nmap f (coc-format-selected) @@ -184,4 +183,19 @@ inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " } + + " ale { + " Shortcuts jump between linting errors + map [c (ale_previous_wrap) + nmap ]c (ale_next_wrap) + + let g:ale_sign_error = '❌' + let g:ale_sign_warning = '⚠️' + + " Fix files + let g:ale_fixers = {'javascript': ['prettier', 'eslint']} + + " Fix files automatically on save + let g:ale_fix_on_save = 1 + " } " }