Vim
Vim is a powerful text editor, you can install it with some plugins
Installation
sh
sudo apt install -y vimConfiguration
Edit system configuration
sh
sudo vim /etc/vim/vimrcsh
sudo tee -a /etc/vim/vimrc > /dev/null <<EOT
set nocompatible
set number
set background=dark
set tabstop=4
set smartindent
set autoindent
set backspace=indent,eol,start
set ignorecase
set ruler
set showcmd
set mouse=a
EOTnocompatibleto use Vim instead of Vinumberto display line numbersbackground=darkto use dark themetabstop=4to use 4 spaces for tabsmartindentto use smart indentationautoindentto use auto indentationbackspace=indent,eol,startto use backspaceignorecaseto ignore caserulerto display cursor positionshowcmdto display command in bottommouse=ato enable mouse
sh
set nocompatible
set number
set background=dark
set tabstop=4
set smartindent
set autoindent
set backspace=indent,eol,start
set ignorecase
set ruler
set showcmd
set mouse=a/etc/vim/vimrc
Commands
Vim has two modes.
You can find a cheatsheet on https://vim.rtorr.com
- Insert mode (Where you can just type like normal text editor. Press
ifor insert mode) - Command mode (Where you give commands to the editor to get things done . Press
ESCfor command mode)
Insert mode
You can write text in this mode.
Command mode
x: to delete the unwanted characteru: to undo the last the command and U to undo the whole line CTRL-R to redoA: to append text at the end:x: to save and exit:q!: to trash all changesdw: move the cursor to the beginning of the word to delete that word2w: to move the cursor two words forward.3e: to move the cursor to the end of the third word forward.0(zero): to move to the start of the line.d2w: which deletes 2 words .. number can be changed for deleting the number of consecutive words liked3wdd: to delete the line and2ddto delete to line .number can be changed for deleting the number of consecutive words:1,$d: to delete all lines from the current line to the end
INFO
If copy/paste don't work in vim, check this link: https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode