Map keys

Perbedaan antara vim map dan noremap

:inoremap jj <esc>
" or
:ino jj <esc>

Syntax highlight

:syntax on  " turn on syntax highlighting
:syntax off " turn off syntax highlighting

Show line numbers

:set number
" or
:set nu

Show relative line numbers

:set relativenumber
" or
:set rnu


Make the cursor always in the middle

:set scrolloff=999
" or
:set so=999

Change tab size

" Set tab size when you hit tab button
:set tabstop=4
" or
:set ts=4

" Set indent size when you indent with >, =, <
" When you set shiftwidth=0 it will follow the value of tabstop
:set shiftwidth=0
" or
:set sw=0

" Tab to spaces
:set expandtab
" or
:set et

Show/hide whitespaces

" Show whitespaces
:set list

" Hide whitespaces
:set nolist

" Toggle whitespaces
:set list!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *