git clone https://github.com/rurumimic/nvim ~/.config/nvimalias vi='nvim'vi:MasonInstallAll- neovim
- node.js
- nerd font
- ripgrep
- gcc
- make
- luarocks
- python3-venv
rm -rf ~/.config/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim- Cheatsheets:
<leader>ch
- Save file without formatting:
<C-s> - Opens the current filepath or URL:
gx - goto file:
gf
- New horizontal:
<leader>h - New vertical:
<leader>v - Toggle horizontal:
<M-h> - Toggle vertical:
<M-v> - Toggle floating:
<M-i>
- Toggle:
<C-n> - Focus:
<leader>e
- Format file:
<leader>fm
- Diagnostic under the cursor:
<C-W><C-D>,<C-W>d,<leader>gl,gl - Diagnostic loclist:
<leader> + ds - To the previous diagnostic:
[d - To the next diagnostic:
]d
- Fugitive:
<leader>gf
- Live grep:
<leader>fw - Find files:
<leader>ff - Find in current buffer:
<leader>fz - Find buffers:
<leader>fb - Find oldfiles:
<leader>fo - Find help:
<leader>fh - Pick a terminal:
<leader>pt - Git status:
<leader>gt - Git commits:
<leader>cm
- Send items to quicfixlist with Trouble:
<C-q>
- Toggle diagnostics:
<leader>tl - Toggle diagnostics (current buffer):
<leader>tL - Toggle symbols:
<leader>ts - Toggle LSP references:
<leader>tr - Toggle quickfix:
<leader>tq(like:vim /pattern/ %) - Toggle loclist:
<leader>tc(like:lv /pattern/ %)
- Next suggestion:
<M-]> - Previous suggestion:
<M-[> - Accept word:
<M-Right> - Accept line:
<M-C-Right> - Accept suggestion:
<M-C-Enter> - Dismiss suggestion:
<C-]>
src: lua/configs/lspconfig.lua, lua/configs/conform.lua
- c, cpp, cuda: clangd, clang-format
- rust: rust-analyzer, rustfmt
apt install python3-venvuv python install 3.12
uv venv --python 3.12source ~/.config/nvim/.venv/bin/activate
uv pip install pynvim:checkhealth
provider.python: require("provider.python.health").check()
Python 3 provider (optional) ~
- Using: g:python3_host_prog = "/home/user/.config/nvim/.venv/bin/python"
- Executable: /home/user/.config/nvim/.venv/bin/python
- Python version: 3.12.9
- pynvim version: 0.6.0
- OK Latest pynvim is installed.- nvchad: lsp
~/.config/nvim/lua/configs/lspconfig.lua:
local servers = {
"html",
"cssls",
}~/.config/nvim/lua/configs/lsp/rust.lua:
local nvlsp = require "nvchad.configs.lspconfig"
local M = {
on_attach = nvlsp.on_attach,
capabilities = nvlsp.capabilities,
settings = {
-- ...
},
}
return M~/.config/nvim/lua/configs/lspconfig.lua:
lspconfig.rust_analyzer.setup(require "configs.lsp.rust")~/.config/nvim/lua/configs/conform.lua:
local options = {
formatters_by_ft = {
rust = { "rustfmt" },
},
}
return options:MasonInstallAll