blob: 7f848c7b5f15c6ca65eed4722fa1987e1822b9cd [file] [log] [blame]
Wu, Zhenyu27f17a62024-04-10 22:48:57 +02001" Vim indent file
2" Language: asm
3" Maintainer: Philip Jones <philj56@gmail.com>
4" Upstream: https://github.com/philj56/vim-asm-indent
5" Latest Revision: 2017-07-01
6
7if exists("b:did_indent")
8 finish
9endif
10let b:did_indent = 1
11
12setlocal indentexpr=s:getAsmIndent()
13setlocal indentkeys=<:>,!^F,o,O
14
15let b:undo_ftplugin .= "indentexpr< indentkeys<"
16
17function! s:getAsmIndent()
18 let line = getline(v:lnum)
19 let ind = shiftwidth()
20
21 " If the line is a label (starts with ':' terminated keyword),
22 " then don't indent
23 if line =~ '^\s*\k\+:'
24 let ind = 0
25 endif
26
27 return ind
28endfunction