User Tools

Site Tools


linux_og_unix:vim

Tilbage til Linux og Unix

VIM

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 <F3> <C-]>
map <F4> <C-t>

nnoremap <CR> :let @/=""<CR><CR>
nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>

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

linux_og_unix/vim.txt · Last modified: 2024/09/11 20:37 by martin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki