m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/vim.md
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2020-05-31 14:18:00 +0200
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2020-05-31 14:18:00 +0200
commit7500d752f77ecca5e41f43f48da2a036aa916e76 (patch)
treec751ebc0c5d7abec4f740602f0b332e9be9233a9 /vim.md
parent7a97a7c53238bb957366798930e0b3c3dea6f312 (diff)
Add new vim tricks
Diffstat (limited to 'vim.md')
-rw-r--r--vim.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/vim.md b/vim.md
index 9dda8a7..dff311a 100644
--- a/vim.md
+++ b/vim.md
@@ -10,6 +10,10 @@ Open window with all instances:
:copen
+## Settings
+
+ ic - ignore case in searches
+
## readline
vi keybindings in various `readline` and similar CLIs:
@@ -63,6 +67,8 @@ character-wise, <c-v> makes them block-wise.
:co <location> # copies range to location (can be ., +n, 'a)
:mv <location> # same but moves
+ :s/pattern/thing/c # replace, prompting at each replacement
+
## Visual mode
gv - selects the previous visual
@@ -82,3 +88,30 @@ g<c-a/x> - increment/decrement by 1 more on each selected line
:setlocal spell spelllang=en_us
[/]s - previous/next marked word
[/]S - previous/next bad word
+ z= - replacement suggestions
+
+## Splits
+
+* number before split shortcut - height of old window
+
+Set window height/width (defaults to max):
+
+ [n]^W _
+ [n]^W |
+
+Equalize window heights/widths:
+
+ ^W =
+
+Close window:
+
+ ^W c
+
+## Movements
+
+ % - goes to matching bracket
+
+## Time travel
+
+ :earlier 5m
+ :later 10m