forked from andonome/lk
		
	edit vim
This commit is contained in:
		| @@ -1,15 +1,12 @@ | ||||
| --- | ||||
| title: "vim basics" | ||||
| tags: [ "Documentation", "vim" ] | ||||
| tags: [ "Documentation", "vim", "basic" ] | ||||
| --- | ||||
|  | ||||
| Insert text by pressing `i`. | ||||
|  | ||||
| Stop inserting text by pressing `Ctrl+[`. | ||||
|  | ||||
| Exit with `ZZ`. | ||||
|  | ||||
| Congratulations, you now know `vim`. | ||||
| 1. Insert text by pressing `i`. | ||||
| 1. Stop inserting text by pressing `Ctrl+[`. | ||||
| 1. Exit with `ZZ`. | ||||
| 1. Congratulations, you now know `vim`. | ||||
|  | ||||
| ## Extras | ||||
|  | ||||
|   | ||||
| @@ -30,6 +30,11 @@ Go to the last and previous places you've changed: | ||||
|  | ||||
| > 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 | ||||
|  | ||||
| Make a 20 character 'visual split' in the current working directory ('`.`'). | ||||
|   | ||||
| @@ -2,6 +2,8 @@ | ||||
| title: "vim search" | ||||
| 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': | ||||
|  | ||||
| > :%s/one/two/ | ||||
| @@ -10,3 +12,11 @@ Same, but replace 'one' globally: | ||||
|  | ||||
| > :%s/one/two/g | ||||
|  | ||||
| Put quotes around every occurrence of `$HOME`: | ||||
|  | ||||
| > :%s/$HOME/"&" | ||||
|  | ||||
| Same, but add curly brackets around `$HOSTNAME`: | ||||
|  | ||||
| > :%s/$HOSTNAME/{&} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user