This commit is contained in:
Malin Freeborn 2023-04-16 14:49:47 +02:00
parent 7e4ac7c7b1
commit 317dbb6a5a
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
3 changed files with 20 additions and 8 deletions

View File

@ -1,15 +1,12 @@
--- ---
title: "vim basics" title: "vim basics"
tags: [ "Documentation", "vim" ] tags: [ "Documentation", "vim", "basic" ]
--- ---
Insert text by pressing `i`. 1. Insert text by pressing `i`.
1. Stop inserting text by pressing `Ctrl+[`.
Stop inserting text by pressing `Ctrl+[`. 1. Exit with `ZZ`.
1. Congratulations, you now know `vim`.
Exit with `ZZ`.
Congratulations, you now know `vim`.
## Extras ## Extras

View File

@ -30,6 +30,11 @@ Go to the last and previous places you've changed:
> g, > g,
Go to a filename, and type `gf` (Go-to-File).
For example, if you put your cursor over the `~/.vimrc` in this line, you can edit your vim configuration file.
`source ~/.vimrc`
# Project Structure # Project Structure
Make a 20 character 'visual split' in the current working directory ('`.`'). Make a 20 character 'visual split' in the current working directory ('`.`').

View File

@ -2,6 +2,8 @@
title: "vim search" title: "vim search"
tags: [ "Documentation", "vim" ] tags: [ "Documentation", "vim" ]
--- ---
Search for the next and or previous occurrence of the word under your cursor with `*` and `#`.
Search and replace the first 'one' found with 'two': Search and replace the first 'one' found with 'two':
> :%s/one/two/ > :%s/one/two/
@ -10,3 +12,11 @@ Same, but replace 'one' globally:
> :%s/one/two/g > :%s/one/two/g
Put quotes around every occurrence of `$HOME`:
> :%s/$HOME/"&"
Same, but add curly brackets around `$HOSTNAME`:
> :%s/$HOSTNAME/{&}