From 54f8ab0b31ae7907fa413677210cb84bc012c51d Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Fri, 4 Jun 2021 19:07:42 -0700 Subject: [PATCH] neovim: coc-rust-analyzer --- neovim/coc-settings.json | 9 ++++++++- neovim/coc/.gitignore | 1 + neovim/coc/extensions/package.json | 2 ++ neovim/coc/memos.json | 6 +++++- neovim/init.vim | 14 ++++---------- 5 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 neovim/coc/.gitignore diff --git a/neovim/coc-settings.json b/neovim/coc-settings.json index 0967ef4..617187a 100644 --- a/neovim/coc-settings.json +++ b/neovim/coc-settings.json @@ -1 +1,8 @@ -{} +{ + "coc.preferences.formatOnSaveFiletypes": ["rust"], + "rust-analyzer.enable": false, + "rust-analyzer.diagnostics.enableExperimental": false, + "rust-analyzer.inlayHints.enable": false, + "rust-analyzer.procMacro.enable": true, + "rust-analyzer.updates.channel": "nightly" +} diff --git a/neovim/coc/.gitignore b/neovim/coc/.gitignore new file mode 100644 index 0000000..54056aa --- /dev/null +++ b/neovim/coc/.gitignore @@ -0,0 +1 @@ +/list-extensions-history.json diff --git a/neovim/coc/extensions/package.json b/neovim/coc/extensions/package.json index b9a923d..ffc3d6a 100644 --- a/neovim/coc/extensions/package.json +++ b/neovim/coc/extensions/package.json @@ -1,5 +1,7 @@ { "dependencies": { + "coc-json": ">=1.3.4", + "coc-rls": ">=1.1.6", "coc-rust-analyzer": ">=0.46.0" } } \ No newline at end of file diff --git a/neovim/coc/memos.json b/neovim/coc/memos.json index 9e26dfe..17051c6 100644 --- a/neovim/coc/memos.json +++ b/neovim/coc/memos.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "coc-rust-analyzer|global": { + "release": "nightly 2021-06-05" + } +} \ No newline at end of file diff --git a/neovim/init.vim b/neovim/init.vim index 458eb74..b0a64e9 100644 --- a/neovim/init.vim +++ b/neovim/init.vim @@ -30,7 +30,6 @@ Plug 'keith/swift.vim' Plug 'leafgarland/typescript-vim' Plug 'ledger/vim-ledger' Plug 'LnL7/vim-nix' -Plug 'ludovicchabant/vim-gutentags' Plug 'MarcWeber/vim-addon-local-vimrc' Plug 'mxw/vim-jsx' Plug 'neoclide/coc.nvim', {'branch': 'release'} @@ -145,7 +144,6 @@ map ;* :call fzf#run({ \ 'sink': function('RgHandler'), \ 'options': '--multi', \}) -map ;t :execute 'Tags '. expand('') command ALEOff :let b:ale_fix_on_save = 0 let g:ale_sign_error = '!' @@ -182,9 +180,6 @@ let g:ale_linters = { \ 'rubocop', \ 'sorbet', \ ], -\ 'rust': [ -\ 'cargo', -\ ], \ 'sh': [ \ 'shellcheck', \ ], @@ -216,9 +211,6 @@ let g:ale_fixers = { \ 'ruby': [ \ 'rubocop', \ ], -\ 'rust': [ -\ 'rustfmt', -\ ], \ 'scss': [ \ 'prettier', \ ], @@ -328,8 +320,6 @@ imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_expand_target) -let g:gutentags_ctags_executable_rust = 'rusty-gutentags' - " CTRL-L usually clears and redraws the screen. Might as well use it to reset " the colorscheme too! fun s:ResetScreen() @@ -338,3 +328,7 @@ fun s:ResetScreen() endfun command ResetScreen call s:ResetScreen() nnoremap :ResetScreen + +nmap j (coc-diagnostic-next) +nmap k (coc-diagnostic-prev) +nmap d (coc-definition)