wiki-grav/pages/04.other/10.vim/default.en.md
2022-07-07 08:32:44 +02:00

20 lines
313 B
Markdown

---
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`