Working on Nvim Config
Read on GitHub
Notes #
- I wanted something that felt comfortable, easy to set up on a new machine, generally good for any day to day text editing, light, and very importantly stable. If everything goes well, this entire set up should feel like an extremely basic IDE (really only for python), only take fifteen or so minutes, and all be fairly readable if you know basic lua.
- Tab complete for python (CoC)
- Linting for python (CoC)
- Formatting for python (Black)
- Buffer tabs (Barbar)
- Git decorators (Gitsigns)
- Nice vscode inspired dark theme (VScode)
- Syntax highlighting (native)
- Cleaned up netrw (native)
- Check out
lua/keys.lua
for any preset keymappings. Mostly setting better buffer and window navigation. - Very Lua inspired. All of my personal configuration is in Lua, and besides Coc and Black for fairly obvious reasons, all plugins are written almost completely in Lua.
- If you're looking for something more, I recommend checking out -
- Check Issues for what I'd like to improve and known bugs. My preference for reporting issues would be Issues. For questions, ideas, etc I would prefer Discussions.
Setting up #
- Install neovim if you haven't already. I recommend the appimage, makes updating really easy.
- You may need to run
sudo add-apt-repository universe sudo apt install libfuse2
- You may need to run
- Clone repo into
~/.config
- Get a Patch Font from NerdFonts set up, this is for the barbar plugin as it uses icons in its tabs.
- You can watch the video below for more detailed instructions, but a quick walkthrough here -
- A patch font is basically a wide variety of glyphs all set to a certain font. If you're not picky download "Hack Nerd Font" here. It's a popular and what I used. NOTE: There is a way to install a smaller file here, but I could NOT get this to work following the instructions. If you'd like the file to be smaller and more specific, try that.
- Unzip the file and move it to a spot your system can see it. For Ubuntu, you can make a directory called "fonts" under
~/.local/share
, somkdir ~/.local/share/fonts
, and put the unzipped folder there. - Set your terminal to use the custom font. For the GNOME terminal I found it under preferences/profiles/text. Select "custom font" and choose whatever patch font you downloaded. You may need to restart your terminal to find it if you had it open while you moved the unzipped folder.
- This video was what I used
- You can watch the video below for more detailed instructions, but a quick walkthrough here -
- Get Black set up
- Should just be
pip install black
- Full guide
- Should just be
- With nvim open run
:PackerSync
- Get coc-pyright set up
- For python - With neovim open, run
:CocInstall coc-pyright
- Full guide
- For python - With neovim open, run
- Assuming you're using nvim appimage, and it's in
~/.local/share/applications/
, here's a couple nice bash aliases. With this you can run nvim with "v". Then with "V", you can run nvim, open your file explorer, and terminal all at once. Add the below to your .bashrc. If you're unfamiliar with .bashrc read more here, but it's just the bash configuration file, like how the init.lua file is the nvim configuration file to nvim.
alias v='~/.local/share/applications/nvim.appimage'
alias V='~/.local/share/applications/nvim.appimage -c ":Lexplore|wincmd l|10split|terminal"'
Sources used (very non-exhaustive) #
- https://mattermost.com/blog/how-to-install-and-set-up-neovim-for-code-editing/
- https://gist.github.com/danidiaz/37a69305e2ed3319bfff9631175c5d0f
- http://www.akhatib.com/making-netrw-clean-and-minimally-disruptive-then-stop-using-it/
- https://github.com/rockerBOO/awesome-neovim#terminal-integration
- https://www.youtube.com/watch?v=435-amtVYJ8
- https://github.com/LunarVim/nvim-basic-ide/blob/master/lua/user/keymaps.lua