Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computer:software:cheatsheets:vim [2026/09/06 17:36] – neotek | computer:software:cheatsheets:vim [2026/09/06 17:43] (current) – [Line Numbers] neotek | ||
|---|---|---|---|
| Line 85: | Line 85: | ||
| < | < | ||
| $ vi file1.txt | $ vi file1.txt | ||
| - | :split file2.txt | + | :split file2.txt |
| - | :q # close file2.txt | + | :q |
| - | :vsplit file2.txt | + | :vsplit file2.txt |
| :CTRL-w l # change to the right window | :CTRL-w l # change to the right window | ||
| - | :CTRL-w h | + | :CTRL-w h # change to the left window |
| - | :CTRL-w j | + | :CTRL-w j # change to the bottom window |
| - | :CTRL-w k | + | :CTRL-w k # change to the top window |
| </ | </ | ||
| + | ==== Line Numbers ==== | ||
| + | < | ||
| + | :set nu # show line numbers | ||
| + | :set nonu # hide line numbers | ||
| + | :set ruler # show horizontal and vertical cursor position at the bottom right of the terminal | ||
| + | :set rnu # show relative line numbers | ||
| + | :set nornu # hide relative line numbers | ||
| + | </ | ||
| + | |||
| + | ==== .vimrc example file ==== | ||
| + | < | ||
| + | set hidden | ||
| + | set ruler | ||
| + | set tabstop=4 | ||
| + | set mouse=r | ||
| + | set number | ||
| + | set relativenumber | ||
| + | set relativenumber number | ||
| + | set ruler | ||
| + | set nocp | ||
| + | filetype plugin on | ||
| + | set background=dark | ||
| + | hi Comment cterm=italic ctermfg=69 gui=italic guifg=# | ||
| + | hi Constant ctermfg=172 | ||
| + | hi Function ctermfg=9 | ||
| + | </ | ||
| - | ===== TBC... ===== | ||