Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

improved coloring/wrapping/folding for sls files #1

Merged
merged 1 commit into from
Aug 20, 2012
Merged
Changes from all commits
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
29 changes: 29 additions & 0 deletions ftplugin/sls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,32 @@
set expandtab
set softtabstop=2
set shiftwidth=2
" do not display right side colorcolumn
set colorcolumn=

" do not wrap YAML, but autowrap long comment lines!
set wrap
set fo-=tor
" t -> don't wrap text
" o -> don't add comment leader on o/O
" r -> don't add comment leader after an Enter


" folding
set foldmethod=indent
set foldlevel=6 " by default do not fold anything


" Visual warning about UTF8 characters in SLS file.
" salt does not like them much, so they should be red
augroup utfsls
autocmd!
highlight UTFsls ctermbg=red guibg=red
match UTFsls /[\x7F-\xFF]/
autocmd BufWinEnter * match UTFsls /[\x7F-\xFF]/
autocmd InsertEnter * match UTFsls /[\x7F-\xFF]/
autocmd InsertLeave * match UTFsls /[\x7F-\xFF]/
autocmd BufWinLeave * call clearmatches()
augroup END