Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
home_server:home_server_setup:other_services:vim [2024-03-24 Sun wk12 10:37] – [Moving around in the file] baumkp | home_server:home_server_setup:other_services:vim [2024-03-24 Sun wk12 14:04] (current) – [nocompatible] baumkp | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
+ | ======VIM Editor====== | ||
+ | When using '' | ||
=====VIM Customisation===== | =====VIM Customisation===== | ||
+ | ++++~/ | ||
+ | <code bash> | ||
+ | set nocompatible | ||
+ | syntax on | ||
+ | set number relativenumber | ||
+ | set autoindent expandtab tabstop=2 shiftwidth=2 | ||
+ | filetype plugin on | ||
+ | filetype indent on | ||
+ | set cursorline | ||
+ | set cursorcolumn | ||
+ | set shiftwidth=2 | ||
+ | set tabstop=2 | ||
+ | set expandtab</ | ||
+ | ++++ | ||
====vim color scheme==== | ====vim color scheme==== | ||
I use the VI (or VIM) editor. It comes standard on most Linux and UNIX distributions, | I use the VI (or VIM) editor. It comes standard on most Linux and UNIX distributions, | ||
The different VIM colour scheme definition files are located at ''/ | The different VIM colour scheme definition files are located at ''/ | ||
+ | ====nocompatible==== | ||
+ | Original vi had some strange key bindings, e.g. the cursor keys did not function. the '' | ||
====vim syntax color==== | ====vim syntax color==== | ||
If syntax color is not working in the file '' | If syntax color is not working in the file '' | ||
====vim line numbers==== | ====vim line numbers==== | ||
+ | In .vimrc, add '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | In visual mode '': | ||
+ | |||
====VIM Text Editor==== | ====VIM Text Editor==== | ||
Line 67: | Line 90: | ||
| Ctrl + o | Move backward through the jump history | | Ctrl + o | Move backward through the jump history | ||
| Ctrl + i | Move forward through the jump history | | Ctrl + i | Move forward through the jump history | ||
- | | gg | Move to top of file | | + | | gg | Move to top of file | |
- | | shift_g | + | | Shift + g |
| w | Move to next word | | | w | Move to next word | | ||
| W | Move to next blank delimited word | | | W | Move to next blank delimited word | |