diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-04 15:44:43 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-04 15:44:43 +0200 |
commit | 664aa988f6d9cdb7b75218666fbe348c85ef8b29 (patch) | |
tree | 306173199576430e6133a1ed137bd80bbc2fb01b /ftplugin | |
parent | 3ddca5da461ebfaa82104f82e3cbf19d1c326ade (diff) | |
download | vim-polyglot-664aa988f6d9cdb7b75218666fbe348c85ef8b29.tar.gz vim-polyglot-664aa988f6d9cdb7b75218666fbe348c85ef8b29.zip |
Update
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/Dockerfile.vim | 6 | ||||
-rw-r--r-- | ftplugin/docker-compose.vim | 9 | ||||
-rw-r--r-- | ftplugin/mustache.vim | 3 | ||||
-rw-r--r-- | ftplugin/plantuml.vim | 4 | ||||
-rw-r--r-- | ftplugin/rust.vim | 4 | ||||
-rw-r--r-- | ftplugin/rust/tagbar.vim | 2 | ||||
-rw-r--r-- | ftplugin/terraform.vim | 17 |
7 files changed, 27 insertions, 18 deletions
diff --git a/ftplugin/Dockerfile.vim b/ftplugin/Dockerfile.vim index 909739aa..977be845 100644 --- a/ftplugin/Dockerfile.vim +++ b/ftplugin/Dockerfile.vim @@ -2,6 +2,12 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dockerfile') != finish endif +" Define comment string +setlocal commentstring=#\ %s + +" Enable automatic comment insertion +setlocal formatoptions+=cro + function! DockerfileReplaceInstruction(original, replacement) let syn = synIDtrans(synID(line("."), col(".") - 1, 0)) if syn != hlID("Comment") && syn != hlID("Constant") && strlen(getline(".")) == 0 diff --git a/ftplugin/docker-compose.vim b/ftplugin/docker-compose.vim new file mode 100644 index 00000000..45a103fc --- /dev/null +++ b/ftplugin/docker-compose.vim @@ -0,0 +1,9 @@ +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dockerfile') != -1 + finish +endif + +" Define comment string +setlocal commentstring=#\ %s + +" Enable automatic comment insertion +setlocal formatoptions+=cro diff --git a/ftplugin/mustache.vim b/ftplugin/mustache.vim index d8a351b7..c0eb6221 100644 --- a/ftplugin/mustache.vim +++ b/ftplugin/mustache.vim @@ -25,6 +25,9 @@ if exists("loaded_matchit") && exists("b:match_words") \ . '\%({{\)\@<=/\s*\1\s*}}' endif +" Set template for comment +setlocal commentstring={{!--\ %s\ --}} + if exists("g:mustache_abbreviations") inoremap <buffer> {{{ {{{}}}<left><left><left> inoremap <buffer> {{ {{}}<left><left> diff --git a/ftplugin/plantuml.vim b/ftplugin/plantuml.vim index 535fd0b9..46d26dac 100644 --- a/ftplugin/plantuml.vim +++ b/ftplugin/plantuml.vim @@ -28,7 +28,9 @@ if exists('loaded_matchit') \ ',\<hnote\>:\<endhnote\>' . \ ',\<title\>:\<endtitle\>' . \ ',\<\while\>:\<endwhile\>' . - \ ',@startuml:@enduml' + \ ',@startuml:@enduml' . + \ ',@startwbs:@endwbs' . + \ ',@startmindmap:@endmindmap' endif if get(g:, 'plantuml_set_makeprg', 1) diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index ad325e67..7f29cf38 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -39,7 +39,7 @@ if get(g:, 'rust_bang_comment_leader', 0) " leaders. I'm fairly sure that's a Vim bug. setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,:// else - setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// + setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// endif setlocal commentstring=//%s setlocal formatoptions-=t formatoptions+=croqnl @@ -195,7 +195,7 @@ augroup END setlocal matchpairs+=<:> " For matchit.vim (rustArrow stops `Fn() -> X` messing things up) -let b:match_skip = 's:comment\|string\|rustArrow' +let b:match_skip = 's:comment\|string\|rustCharacter\|rustArrow' " vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo diff --git a/ftplugin/rust/tagbar.vim b/ftplugin/rust/tagbar.vim index 91bd3c31..3de5d8a9 100644 --- a/ftplugin/rust/tagbar.vim +++ b/ftplugin/rust/tagbar.vim @@ -5,7 +5,7 @@ endif " " Support for Tagbar -- https://github.com/majutsushi/tagbar " -if !exists(':Tagbar') +if !exists(':Tagbar') || rust#tags#IsUCtags() finish endif diff --git a/ftplugin/terraform.vim b/ftplugin/terraform.vim index e8ed9fb3..9b4cc2bd 100644 --- a/ftplugin/terraform.vim +++ b/ftplugin/terraform.vim @@ -26,25 +26,14 @@ if !has('patch-7.4.1142') endif if get(g:, 'terraform_fold_sections', 0) - setlocal foldmethod=expr - setlocal foldexpr=terraform#folds() - setlocal foldlevel=1 - setlocal foldtext=terraform#foldText() - let b:undo_ftplugin .= ' foldmethod< foldexpr< foldlevel< foldtext<' + setlocal foldmethod=syntax + let b:undo_ftplugin .= ' foldmethod<' endif " Set the commentstring -let &l:commentstring = get(g:, 'terraform_commentstring', '#%s') +setlocal commentstring=#%s let b:undo_ftplugin .= ' commentstring<' -" Re-map the space bar to fold and unfold -if get(g:, 'terraform_remap_spacebar', 0) - nnoremap <buffer> <space> za - onoremap <buffer> <space> <C-C>za - vnoremap <buffer> <space> zf - let b:undo_ftplugin .= '|unmap <buffer> <space>' -endif - if get(g:, 'terraform_align', 0) && exists(':Tabularize') inoremap <buffer> <silent> = =<Esc>:call terraform#align()<CR>a let b:undo_ftplugin .= '|iunmap <buffer> =' |