From f4edba4fac7b943fd8661dc877fc68667536839f Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sat, 25 Jun 2022 11:40:05 +0200 Subject: [PATCH] (Grav GitSync) Automatic Commit from RealStickman --- pages/04.other/11.vim/default.en.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/04.other/11.vim/default.en.md diff --git a/pages/04.other/11.vim/default.en.md b/pages/04.other/11.vim/default.en.md new file mode 100644 index 0000000..76aaac8 --- /dev/null +++ b/pages/04.other/11.vim/default.en.md @@ -0,0 +1,20 @@ +--- +title: Vim +--- + +[toc] +## Get output from command +`:r!(command)` + +*Example to get UUID for a disk* +`:r!blkid /dev/(partition) -sUUID -ovalue` + +## Write as sudo user +`:w !sudo tee %` + +## Replace strings +Globally replace strings +`:%s/foo/bar/g` + +Replace strings in line 6 to 10 +`:6,10s/foo/bar/g` \ No newline at end of file