-
Clone this directory to
~/.config/nvim, i.e. you should have~/.config/nvim/init.vimand all the other files at~/.config/nvim -
Install Neovim with
brew install neovimNOTES:
- Run Neovim with
nvimrather thanvim. Alias it if you want to. - Neovim config is at
~/.config/nvim - Neovim uses
~/.config/nvim/init.vimrather than~/.vimrc - Neovim config can be a mix of Vimscript (
.vim) and Lua (.lua) config files. Use what you prefer, but many LSP examples are written in Lua, so that's what I've used here - Neovim plugins are at
~/.local/share/nvim
- Run Neovim with
-
Install 'Plug' for Neovim with
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
-
Start
nvimand then:PlugInstall, and then restart
If you are still using Vim8, this will not clash with it, so you can run both side-by-side.
Install whichever language servers you need. Usually you install these globally, since they are not part of the project itself.
You must do this for each Language you have configured in lua/lsp/init.lua. At minimum install:
npm install -g typescript-language-server
npm install -g vscode-langservers-extractedIf you are using nodenv or nvm, then you need to do this for each Node version installed that you want to use LSP with.
The actual Typescript version will be as per whatever is installed in the project package.json
eslint and prettier are usually installed as part of the project, i.e. in package.json. I've opted to use prettierd rather than regular prettier, so just install that
npm install -g @fsouza/prettierdThe following shortcuts are configured. You can change them if you like in lua/lsp/init.lua
- Goto definition
<C-]>. Suggest you leave this one as-is, as that is the standard for Vim, i.e. works in vim-help etc - Rename symbol under the cursor
<Space>rn - Show definition under cursor
K - Show possible code actions (fixes)
<Space>ca - Show signature help
<Space>sh - Find all references to symbol under cursor
<Space>*
There are even more listed in there if you want to check. There are heaps of things you can do with LSP!