Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
linux:vim-editor [2019/05/07 11:38] – michael | linux:vim-editor [2019/05/21 11:20] (current) – michael | ||
---|---|---|---|
Line 51: | Line 51: | ||
On the bottom left of the screen, we can see we are in insert mode. Now we can type in our configuration. You will want the following lines in the file: | On the bottom left of the screen, we can see we are in insert mode. Now we can type in our configuration. You will want the following lines in the file: | ||
- | * <wrap em>syntax on</ | + | * '' |
- | * <wrap em>set wrapmargin=8</ | + | * '' |
- | * <wrap em>set number</ | + | * '' |
{{linux: | {{linux: | ||
Line 88: | Line 88: | ||
__Some additional movement keys:__ | __Some additional movement keys:__ | ||
- | * **e** will move you forward to the end of a word | + | * '' |
- | * **w** will move you forward to the beginning of a word | + | * '' |
- | * **b** will move you backward to the beginning of a word | + | * '' |
- | * **$** will move you to the end of a line | + | * '' |
- | * **0** (zero) will move you the beginning of a line | + | * '' |
- | * **G** will move you to the end of a file | + | * '' |
- | * **gg** will move you to the start of a file | + | * '' |
</ | </ | ||
Line 109: | Line 109: | ||
In order to search and replace, we use the **: | In order to search and replace, we use the **: | ||
- | * <wrap em>: | + | * '' |
- | * <wrap em>: | + | * '' |
Vim also supports regular expressions in the same way that [[https:// | Vim also supports regular expressions in the same way that [[https:// | ||
Line 119: | Line 119: | ||
Exiting Vim is always a problem for people just starting out. In order to exit, use these commands: | Exiting Vim is always a problem for people just starting out. In order to exit, use these commands: | ||
- | * **:w** will write the file | + | * '' |
- | * **:wq** will write the file and quit | + | * '' |
- | * <wrap em>:q!</ | + | * '' |
- | * **:w** someFileName will write the changes to a file called someFileName | + | * '' |
In some cases, we might want to escape to a shell to browse directory trees or look at other files. In order to execute a system command in Vim, we use the command: | In some cases, we might want to escape to a shell to browse directory trees or look at other files. In order to execute a system command in Vim, we use the command: | ||
- | * **:!command** | + | * '' |
- | This will execute whatever command we put after the bang. This can be a shell '' | + | This will execute whatever command we put after the bang. This can be a shell '' |