From 7500d752f77ecca5e41f43f48da2a036aa916e76 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sun, 31 May 2020 14:18:00 +0200 Subject: Add new vim tricks --- vim.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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, makes them block-wise. :co # copies range to location (can be ., +n, 'a) :mv # same but moves + :s/pattern/thing/c # replace, prompting at each replacement + ## Visual mode gv - selects the previous visual @@ -82,3 +88,30 @@ g - 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 -- cgit v1.2.3