Clone
5
Home
Martin Winkler edited this page 2022-02-06 15:03:28 +01:00

Vim indentation

~/.vimrc

filetype plugin indent on
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
syntax on

Further improvements of bash like source code can be achived with this script

Place it in ~/.vim/indent/ and restart vim or execute the following line:

mkdir -p ~/.vim/indent && cd ~/.vim/indent && wget --content-disposition https://www.vim.org/scripts/download_script.php?src_id=4371

Auto indent all lines

=, the indent command can take motions. So, gg to get the start of the file, = to indent, G to go to the end of the file:

gg=G