diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-02-15 16:31:56 +0100 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-02-15 16:47:43 +0100 | 
| commit | 3b2a78935fd6550521f719a10e5b0fceb1ddb350 (patch) | |
| tree | 7c50801d6bb5b7abba3df6352ed43df454a4dbcb /config/old/vim/indent | |
Not really but, First commit!
Diffstat (limited to 'config/old/vim/indent')
| -rw-r--r-- | config/old/vim/indent/z80.vim | 35 | 
1 files changed, 35 insertions, 0 deletions
diff --git a/config/old/vim/indent/z80.vim b/config/old/vim/indent/z80.vim new file mode 100644 index 0000000..d06824d --- /dev/null +++ b/config/old/vim/indent/z80.vim @@ -0,0 +1,35 @@ +" borrowed from https://github.com/philj56/vim-asm-indent/blob/master/indent/asm.vim +if exists("b:did_indent") +    finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetAsmIndent() +setlocal indentkeys=<:>,!^F,o,O + +let s:cpo_save = &cpo +set cpo&vim + +function s:buffer_shiftwidth() +    return shiftwidth() +endfunction + +function! GetAsmIndent() +    let line = getline(v:lnum) +    let ind = s:buffer_shiftwidth() +    let line_num = v:lnum + +    if line_num == 0 +      let ind = 0 +    endif +    " If the line is a label (starts with ':' terminated keyword),  +    " then don't indent +    if line =~ '^\s*\k\+:'  +        let ind = 0 +    endif +    return ind +endfunction + +let &cpo = s:cpo_save +unlet s:cpo_save +  | 
