Neovim
Tips
Pretty Print
Use vim.pretty_print()
to print things in human-readable format.
:lua vim.pretty_print(vim.loop.cpu_info())
Neovim#22562: pretty_print has been renamed to print .
|
Use =
shorthand version for brevity.
:lua =vim.loop.cpu_info()
Simplify keymaps
-- Modes
-- normal_mode = "n",
-- insert_mode = "i",
-- visual_mode = "v",
-- visual_block_mode = "x",
-- term_mode = "t",
-- Keymaps
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_set_keymap
-- Insert --
-- Make Control+Backspace delete whole words
keymap("i", "<C-H>", "<C-W>", opts)
Keymaps
Movement
Key | Description |
---|---|
Ctrl+y |
move up one line without moving the cursor |
Ctrl+e |
move down one line without moving the cursor |
5G |
go to line 5 (instead of :5) |
W H |
jump to {start, end} of next Word |
B |
jump to start of previous Word |
tx |
jump to before next occurrence of character x |
g_ |
jump to last non-blank char of line |
^ |
start of first word on current line |
- |
start of previous line |
Enter |
start of next line |
Text Modification
Key | Description |
---|---|
gwip |
reflow paragraph |
gJ |
join current line with the next without space |
I |
insert at the beginning of the line |
D |
delete (cut) to the end of the line |
cl |
delete character and substitute text |
cc |
change (replace) entire line |
c$ |
change (replace) to the end of the line |
cw |
change (replace) to the end of word |
ciw |
change (replace) entire word |
"xy |
yank into register x |
z= |
suggest corrections (normal mode) |