[[linux_og_unix:start|Tilbage til Linux og Unix]]
===== VIM =====
* [[https://sanctum.geek.nz/arabesque/vim-koans|VIM Koans]]
Indent en masse filer
for file in *.c; do
nvim -u /tmp/minimal.vim -c "normal gg=G" -c "wq" "$file"
done
med /tmp/minimal.vim
set nocompatible
filetype plugin indent on
syntax on
Min .vimrc siger p.t. sådan her ud:
syntax enable
map! ¤ ansible.builtin.
filetype plugin indent on
set tabstop=2
set shiftwidth=2
set autoindent
set expandtab
set hlsearch
set incsearch
set mouse=a
set nobackup
set nocompatible
set noerrorbells
set noswapfile
set number
set showcmd
set title
set wildignore=*.class
set wildmode=longest,list,full
map
map
nnoremap :let @/=""
nnoremap :nohlsearch
colo candy
candy farver kan hentes på: http://www.vim.org/scripts/script.php?script_id=282
rainbow farver kan hentes på: http://www.vim.org/scripts/script.php?script_id=463