- Packer - for Vim Plugin management
- Treesitter
- Telescope
- LSP and completion support
- Toggleterm
- LazyGit
- Alpha Greeter Menu
- Bufferline - Buffers displayed as a Tab line
- NvimTree File Explorer
- Lua Snip - Snippet support
- Project Management Plugin - keeps track of your projects so you quickjump / Telescope cd to them
- WhichKey
Things I've added:
- Go LSP and debugger support. (You'll need to install gopls and delve)
- gopls with or without Bazel If you open a non Bazel Go project, Gopls should still work as we detect if there is a GOPACKAGESDRIVER Bazel shell script to use in the repo and if not we don't set the environment variable to use it..
- Nvim Dap Debugger + Dap Go Adapter + Nvim Dap UI + nvim-dap-virtual-text + telescope-dap
- Debugger options can be accessed via
<leader + d>
- Debugger options can be accessed via
- Git add ons:
- vim-fugitive
- vim-rhubarb -- Opens Github in a browser
- gv.vim -- Git history
- critiq.vm -- Pull requests in Git
- ripgrep
- Vimwiki
- Taskwiki
brew install --HEAD nvim
# this installs latest dev version - can use stable instead, but should be on nvim 8- (if nvim stable is already installed):
brew unlink nvim
- (if nvim stable is already installed):
git clone https://github.com/muxinc/Neovim-from-scratch.git ~/.config/nvim
- go should be at 1.17.6+
LspInstallInfo
showed gopls was available but not installed - installed it withi
Pick and choose the ones you want - gopls is needed and delve debugger is recommended
go install golang.org/x/tools/gopls@latest
-- go LSP supportgo install github.com/go-delve/delve/cmd/dlv@latest
-- delve debuggergo install golang.org/x/tools/cmd/goimports@latest
-- updates your Go import lines, adding missing ones and removing unreferenced onesgo install github.com/kyoh86/richgo@latest
-- enrich go test outputs with text decorationsgo install github.com/cweill/gotests/gotests@latest
-- generates table driven tests based on its target source files' function and method signaturesgo install github.com/onsi/ginkgo/ginko@latest
-- testing framework for Go designed to help you write expressive specs.go install golang.org/x/tools/cmd/gorename@latest
-- performs precise type-safe renaming of identifiers in Go source codego install github.com/segmentio/golines@v0.9.0
-- shortens long line - 0.9.0 <-> go 1.17 - when we upgrade to 1.18+, bump to latestgo install mvdan.cc/gofumpt@latest
-- stricter and backwards compatible gofmtgo install golang.org/x/tools/cmd/callgraph@latest
-- defines the call graph and various algorithms and utilities to operate on itgo install github.com/koron/iferr@latest
-- Generate if err != nil { block for current function.go install github.com/davidrjenni/reftools/cmd/fillstruct@latest
-- refactoring : fills a struct literal with default valuesgo install golang.org/x/tools/cmd/guru@latest
-- a tool for answering questions about Go source code.go install github.com/fatih/gomodifytags@latest
-- makes it easy to update, add or delete the tags in a struct fieldgo install github.com/davidrjenni/reftools/cmd/fillswitch@latest
-- fills (type) switches with case statements
You can type \
in normal mode to trigger ripgrep search - you also need silversearcher (ag) or else you'll see the error:
E488: Trailing characters: /dev/null: redraw! /dev/null
brew install ag
brew install rg
brew install prettier
brew install black
brew install sytlua
- Open nvim and run
:checkhealth
to verify everything is working and configured properly
Overview Video : https://www.youtube.com/watch?v=ctH-a-1eUME&list=PLhoH5vyxr6Qq41NFL4GvhFp-WLd5xzIzZ
Leader key is mapped to <space>
. If you just want to see the keymaps available to you, just hit space in normal mode and you should get a menu popup. There is also a nice default menu if you just open nvim without editing a file.
Many users may be switching over from Vim, so things like Lua, Treesitter and things like native LSP may be different. There is also a plugin manager called Packer that's different than vim-plug. This section aims to call out some of the most important tricks and commands that are useful in troubleshooting a setup.
:PackerStatus
: List all the installed plugins and expand them to find out the url of where they came from, where they are installed locally (basically a git pull at what ever revision was specified).
~/.cache/nvim/lsp.log
~/.cache/nvim/dap.log
: Debugger Adapter Protocol plugin - See below on info on how to increase the log level.
lua require('dap').set_log_level('TRACE')
: If you are trying to troubleshoot why the Debugger might not be attaching properly, perhaps to a remote server, you can set the log level to trace. Logs show up at:~/.cache/nvim/dap.log
When I initially created this repo I didn't anticipate the amount of breaking changes introduced by the rapidly developing plugin ecosystem. All packages are pinned in master
so it will remain stable and you can always follow the videos
there if you're getting errors in other branches.
🔍 If you see an error that you can fix here's how 🎉.
Update For a simple IDE that builds on these principles and is under active development, I recommend my newer repo: nvim-basic-ide as well as lunarvim which is mature and fully-featured.
General support is available on our Matrix channels.
This config requires >= Neovim v0.8.0. Please upgrade if you're on an earlier version of the editor.
Clone the repository into the correct location (make a backup your current nvim
directory if you want to keep it).
git clone https://github.com/LunarVim/Neovim-from-scratch.git ~/.config/nvim
Run nvim
in your terminal and wait for the plugins to be installed. You will notice treesitter pulling in a bunch of language parsers the next time you open Neovim.
NOTE Mason is used to install and manage LSP servers, DAP servers, linters, and formatters via the :Mason
command.
This config assumes that you have Nerd Fonts v3.0.0 or higher. If you are using an older version then please update your Nerd Fonts otherwise there will be missing or wrong glyphs
Open nvim
and enter the following:
:checkhealth
You'll probably notice you don't have support for copy/paste also that python and node haven't been setup
So let's fix that
First we'll fix copy/paste
-
On mac
pbcopy
should be builtin -
On Ubuntu
sudo apt install xsel
-
On Arch Linux
sudo pacman -S xsel
-
Wayland users
Next we need to install python support (node is optional)
-
Neovim python support
pip install pynvim
-
Neovim node support
npm i -g neovim
NOTE make sure you have node installed, I recommend a node manager like fnm.
Assuming you built from source, cd
into the folder where you cloned neovim
and run the following commands.
git pull
git checkout release-0.9
make distclean && make CMAKE_BUILD_TYPE=Release
sudo make install
nvim -v
The computing scientist's main challenge is not to get confused by the complexities of his own making.
- Edsger W. Dijkstra