2.1 KiB
2.1 KiB
My neovim workflow
All configs are in my dotfiles.
Use both \
and ;
as leader key.
Search multiple words:
:/\vword1|word2|word3
Replace word:
:%s/word1/word2/g
Jump basic:
gg
: first lineG
: last line0
: first character of line$
: last character of linew
,b
: word forward/backward
Jump advance:
CTRL-O
,CTRL-I
: cursor position backward/forward- : jump forward cursor position
(
,)
: sentence backward/forward{
,}
: paragraph backward/forwardH
: top of screenM
: middle of screenL
: bottom of screenCTRL-]
,CTRL-T
: jump to tag/jump back from tag- Support jump to golang definition with fatih/vim-go.
Keymap for plugin (sync with dotfiles):
vim.keymap.set("n", "<leader>f", ":FZF<CR>")
vim.keymap.set("n", "<leader>rg", ":Rg<CR>")
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>")
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>")
vim.keymap.set("n", "<leader>z", ":ZenMode<CR>")
vim.keymap.set("n", "<leader>tr", ":lua MiniTrailspace.trim()<CR>")
vim.keymap.set("n", "<F2>", ":GoRename<CR>")
vim.keymap.set("n", "<leader>gf", ":GoFillStruct<CR>:w<CR>")
vim.keymap.set("n", "<leader>gat", ":GoAlternate<CR>")
vim.keymap.set("n", "<leader>gt", ":GoTest<CR>")
vim.keymap.set("n", "<leader>gr", ":GoReferrers<CR>")
vim.keymap.set("n", "<leader>gcv", ":GoCoverage<CR>")
vim.keymap.set("n", "<leader>gdd", ":GoDeclsDir<CR>")
- With echasnovski/mini.nvim mini-comment
gcc
: comment/uncomment current linegc
: comment/uncomment selected lines
- With echasnovski/mini.nvim mini-bracketed
[b
,]b
: buffer backward/forward[T
,]T
,[t
,]t
: tree-sitter backward/forward- Support more languages with nvim-treesitter/nvim-treesitter