Neovim
This is my Neovim config README.md file.
It takes a lot of time to configure Neovim from scratch, I am currently enjoying using AstronNvim LazyVim which
comes with a lot of functionality.
LazyVim
Fundamentals
Learn how to:
- Change Configuration
- Disable plugins
- Add plugins and other things listed in the documentation.
Programming in LazyVim
LSP key bindings
K
: Keyword documentation under cursorgK
: Signature helpgd
: Go to definitiongD
: Go to declaration<leader>ca
: Code action
Configuration
Too much stuff in the left columns. Signcolumn, Statuscolumn. mini.indentscope creates distracting animations.
Getting rid of things to the left of the text
- Disable gitsigns
- Disable statuscolumn:
:set stc=
- Disable signscolumn:
:set signscolumn=no
Installing (Windows)
In Powershell, install packer with:
git clone https://github.com/wbthomason/packer.nvim "$env:LOCALAPPDATA\nvim-data\site\pack\packer\start\packer.nvim"
Clone the repo into ~\AppData\Local\nvim:
gh repo clone jmn/nvim-config nvim
Open the file nvim\lua\plug.lua and execute it with:
:luafile %
Then run PackerSync:
:PackerSync
Partially baked from:
Then restart nvim.
Installing extras
Fonts
Install nerdfont: Hack-NF and configure terminal to use it.
In Terminal, Right click tab, choose:
- Settings -> Profiles -> Command Prompt -> Appearance -> Text -> Font Face
Other good fonts include, jetbrainsmono-nf.
Configure Windows Terminal to open tabs in the same directory
Ripgrep
Telescope grep uses rg
(ripgrep). Install it using:
scoop install ripgrep
Comment.nvim
- important keystrokes:
gcc
in normal mode,gc
in visual mode.
🔥 Usage
When you call setup()
method, Comment.nvim
sets up some basic mapping which can used in NORMAL and VISUAL mode to get you started with the pleasure of commenting stuff out.
Basic mappings
These mappings are enabled by default. (config: mappings.basic
)
- NORMAL mode
- VISUAL mode
#### Extra mappings
These mappings are enabled by default. (config: mappings.extra
)
- NORMAL mode
Examples
Folding
- Important Key:
z
. - Examples:
z-o
(open fold),z-c
(close fold)
Folding Markdown
- Folding via tree-sitter sexp can work to some extent in markdown mode.
Links
- https://essais.co/better-folding-in-neovim/
- https://alpha2phi.medium.com/neovim-for-beginners-code-folding-7574925412
Moving in windows
C-w +,
- o - only
- j - navigate to window below
- k - navigate to window above.
- s - split
Yank (Copy) the entire buffer to system clipboard
use ggVGY
to yank the entire buffer to the system clipboard.
Afterwards you can use C-o
to get back to where you were.
Another idea could be to use :%y
to yank the buffer.
Running shell commands from Neovim
:map <F5> :!odin run . <enter>