www.neotek.ch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computer:software:cheatsheets:vim [2026/09/06 17:27] – [complex editing] neotekcomputer:software:cheatsheets:vim [2026/09/06 17:43] (current) – [Line Numbers] neotek
Line 56: Line 56:
  
 ==== complex editing ==== ==== complex editing ====
-=== commenting 1 ===+=== Commenting 1 ===
 <code> <code>
 CTRL-q       Cursor turns gray as soon you move the cursor keys (or hjkl). Mark everything you want comment CTRL-q       Cursor turns gray as soon you move the cursor keys (or hjkl). Mark everything you want comment
Line 64: Line 64:
 </code> </code>
  
-=== commenting 2 ===+=== Commenting 2 ===
 Add '# ' in the beginning of line 5 to 12 Add '# ' in the beginning of line 5 to 12
 <code> <code>
Line 70: Line 70:
 </code> </code>
  
-=== uncomment 1 ===+=== Uncomment 1 ===
 <code> <code>
 CTRL-q       Mark everything you want to remove CTRL-q       Mark everything you want to remove
Line 76: Line 76:
 </code> </code>
  
-=== uncomment 2 ===+=== Uncomment 2 ===
 remove '# ' from the beginning of line 5 to 12 remove '# ' from the beginning of line 5 to 12
 <code> <code>
Line 83: Line 83:
  
 ==== Split window ==== ==== Split window ====
 +<code>
 +$ vi file1.txt
 +:split file2.txt     # file2.txt is display in the same terminal window on top of file1.txt
 +:q                   # close file2.txt
 +:vsplit file2.txt    # file2.txt is displayed in the same terminal window to the right of file1.txt
 +:CTRL-w l            # change to the right window
 +:CTRL-w h            # change to the left window
 +:CTRL-w j            # change to the bottom window
 +:CTRL-w k            # change to the top window
 +</code>
 +
 +==== Line Numbers ====
 +<code>
 +: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
 +</code>
 +
 +==== .vimrc example file ====
 +<code>
 +set hidden
 +set ruler
 +set tabstop=4
 +set mouse=r
 +set number                  (set nu)        # Zeilennummern einschalten
 +set relativenumber          (set rnu)       # relative Zeilennummern!!!!)
 +set relativenumber number   (set rnu nu)    # beides
 +set ruler
 +set nocp
 +filetype plugin on
 +set background=dark
 +hi Comment cterm=italic ctermfg=69 gui=italic guifg=#5d6eff
 +hi Constant ctermfg=172
 +hi Function ctermfg=9
 +</code>
 +
  
  
  
-===== TBC... ===== 
computer/software/cheatsheets/vim.1788715626.txt.gz · Last modified: 2026/09/06 17:27 by neotek