linux:vim

VIM

USAGE:

vim /folder/location/file.txt

We strongly advise you to play this game to learn how to use vim: Vim Adventures http://vim-adventures.com/

h,j,k,l - move cursor
i - insert - This allows you to edit the page, must hit Esc to exit insert mode

example

:command

quit

:q

quit without saving (forced)

:q!

save and quit

:wq

save and quit

:wq

When you want to paste code and have it keep it's spacing correctly:

:set paste

Then to revert back to normal:

:set nopaste
# http://emmet.io/
sudo yum install -y vim
sudo git clone http://github.com/mattn/emmet-vim.git
cd emmet-vim
sudo mkdir -p ~/.vim/plugin
sudo mkdir -p ~/.vim/autoload
sudo cp plugin/emmet.vim ~/.vim/plugin/
sudo cp autoload/emmet.vim ~/.vim/autoload/
sudo cp -a autoload/emmet ~/.vim/autoload/

visual mode in VIM:

shift + v

dd - delete a line

3dd - delete 3 lines

undo:
esc
u - cando multiple times
ctrl + r - redo

searching
esc
enter
/[searchterm]
Shift + M will search backwards

:%s/oldthing/newthing/g

  • linux/vim.txt
  • Last modified: 2019/01/22 02:18
  • by 108.225.197.92