From de864ea195efc883675a2e91834d3f9f39659389 Mon Sep 17 00:00:00 2001 From: Alexound Date: Fri, 25 Oct 2019 01:37:20 +0400 Subject: [PATCH 1/2] Updated VIM cheatsheet a bit. Ignore case while searching: on and off command. Run command in multiple buffers with 'bufdo'. --- tools/vim.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/vim.txt b/tools/vim.txt index 5efe85e..5832df3 100644 --- a/tools/vim.txt +++ b/tools/vim.txt @@ -232,6 +232,8 @@ n repeat search in same direction N repeat search in opposite direction * search forward, word under cursor # search backward, word under cursor +set ic ignore case: turn on +set noic ignore case: turn off :%s/old/new/g replace all old with new throughout file :%s/old/new/gc replace all old with new throughout file with confirmation :argdo %s/old/new/gc | wq open multiple files and run this command to replace old @@ -251,6 +253,7 @@ N repeat search in opposite direction :bd delete a buffer (close a file) :b1 show buffer 1 :b vimrc show buffer whose filename begins with "vimrc" +:bufdo run 'command(s)' in all buffers ############################################################################## From c3ad4a15ab9d24ad72534d9eacf940bb8ee71a94 Mon Sep 17 00:00:00 2001 From: Alexound Date: Fri, 25 Oct 2019 01:41:59 +0400 Subject: [PATCH 2/2] Minor additions. --- tools/vim.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/vim.txt b/tools/vim.txt index 5832df3..2a55240 100644 --- a/tools/vim.txt +++ b/tools/vim.txt @@ -254,6 +254,7 @@ set noic ignore case: turn off :b1 show buffer 1 :b vimrc show buffer whose filename begins with "vimrc" :bufdo run 'command(s)' in all buffers +:[range]bufdo run 'command(s)' for buffers in 'range' ##############################################################################