Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed indentation including issues with "=" normal mode command. #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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<"