My Terminal-Only Development Setup (3)
2024-02-11
In this post I’m just listing some (maybe, based on my use habits) useful commands that I find myself Googling all the time. Some are based on my custom config.lua
so it’s not recommended to take the following as your random online reference.
Description | Command | Source |
---|---|---|
Select all content | ggVG |
default keybinding |
Paste the last yanked that’s not from delete/cut | ctrl p |
custom keybinding |
Toggle upper/lower case | ~ |
default keybinding |
Toggle wrap mode | :toggleWrapMode or yow |
wrapping.nvim |
Split vertically/horizontally | | and - |
custom keybinding |
Align markdown tables | ctrl [ and ctrl ] |
vim-simple-align , custom keybinding |
Shuffle tabs | tab and shift tab |
custom keybinding |
Close current buffer1 | space c |
default keybinding |
Close current window | :q |
default keybinding |
Open a new empty buffer | space b |
custom keybinding |
Save the changes of current buffer | :w or ctrl s |
default and custom keybinding |
Toggle file explorer | space e or ctrl e |
neo-tree.nvim , custom keybinding |
Multi-cursor select | ctrl n |
vim-visual-multi |
Surround current word with brackets | ysiw) |
nvim-surround |
Surround current sentence with qutes | ys$" |
nvim-surround |
Surround current selection with quotes | S" |
nvim-surround |
Delete the square brackets around cursor | ds] |
nvim-surround |
Delete the HTML tag around cursor | dst |
nvim-surround |
Change the single quotes to double quotes | cs'" |
nvim-surround |
Change the HTML tab around cursor to <h1> |
csh1<CR> |
nvim-surround |
Enter line-wise visual mode | shift v |
default keybinding |
Select multiple lines | ma (from), v'a (to) |
default keybinding |
Delete multiple lines | ma (from), d'a (to) |
default keybinding |
Select Virtual Environment | vs |
venv-selector.nvim , custom keybinding |
LSP telescope diagnostics | space lw |
default keybinding |
LSP next diagnostic | space lj |
default keybinding |
LSP prev diagnostic | space lk |
default keybinding |
LSP code action | space la |
default keybinding |
Show side-by-side git diff | :DiffViewOpen |
diffview.nvim |
Delete and substitute current character | cl or s |
default keybindng |
Delete and substitute current word | ciw |
default keybindng |
Delete and substitute util the end of the line | c$ or C |
default keybindng |
Delete and substitute current line | cc or S |
default keybindng |
-
Very different concepts: buffers vs windows. For example, when a vertical split view is turned on, you can shuffle through all opened buffers in both left and right views. Now, in order to quit this split view, you’re gonna close a window by
:q
. In order to close a buffer (can be seen as an opened file) across both views, we needspace
c
. ↩︎