nasm-indent
NASM indent script for vim. Vim doesn't provide a default indent script for NASM. So here is one which follow the below rules:
- If a line is a label (contains
:
), reset its indentation.
label: ; indent level = 0
- If previous non-empty and not comment line is a label, increase the indenting level
label: ; indent level = 0
mov rax, 0 ; indent level = 1
- Otherwise, copy the indenting level of the previous non-empty and not comment line
mov rax, 0 ; indent level = 1
mov rbx, 0 ; indent level = 1
Installation
With Plugin manager (recommended):
dein.vim (my favorite)
call dein#add('DanSnow/nasm-indent.vim')
Vundle
Plugin 'DanSnow/nasm-indent.vim'
vim-plug
Plug 'DanSnow/nasm-indent.vim'
Install from Source (not recommended)
Download the indent/nasm.vim
and put it to the indent
under your vim runtime directory.
License
MIT