Skip to content

Commit

Permalink
Fixed indentation including issues with "=" normal mode command.
Browse files Browse the repository at this point in the history
  • Loading branch information
bak-t committed Jan 7, 2024
1 parent be5dce9 commit 7ad3d81
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions indent/ps1.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ if exists("b:did_indent")
endif
let b:did_indent = 1

" smartindent is good enough for powershell
setlocal smartindent
" disable the indent removal for # marks
inoremap <buffer> # X#
let b:undo_indent = "setl si<"
setlocal cindent
" Disable zero indentation of lines started with "#" in insert mode, which are comments
setlocal cinkeys-=0#
" Enable detection of Shell/Perl style comments
setlocal cinoptions+=#1
" Disable additonal indentation for "continuation lines", which are all the lines missing ";"
setlocal cinoptions+=+0
" Make indentation single for unclosed parentheses (multiline argument lists and array literals).
" By default it's shiftwidth * 2
execute "setlocal cinoptions+=(" . &shiftwidth

let b:undo_indent = "setl cindent< cinkeys< cinoptions<"

0 comments on commit 7ad3d81

Please sign in to comment.