diff options
Diffstat (limited to 'ftplugin')
| -rw-r--r-- | ftplugin/ansible.vim | 1 | ||||
| -rw-r--r-- | ftplugin/eelixir.vim | 17 | ||||
| -rw-r--r-- | ftplugin/rust.vim | 26 | 
3 files changed, 32 insertions, 12 deletions
| diff --git a/ftplugin/ansible.vim b/ftplugin/ansible.vim index df766194..bbfd05df 100644 --- a/ftplugin/ansible.vim +++ b/ftplugin/ansible.vim @@ -4,5 +4,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1  if exists('+regexpengine') && ('®expengine' == 0)    setlocal regexpengine=1  endif +set path+=./../templates,./../files  endif diff --git a/ftplugin/eelixir.vim b/ftplugin/eelixir.vim index b0f3284f..eb6f6559 100644 --- a/ftplugin/eelixir.vim +++ b/ftplugin/eelixir.vim @@ -80,6 +80,23 @@ if exists("loaded_matchit")    let b:match_words = s:match_words  endif +if !exists('b:surround_45') +  " When using surround `-` (ASCII 45) would provide `<% selection %>` +  let b:surround_45 = "<% \r %>" +endif +if !exists('b:surround_61') +  " When using surround `=` (ASCII 61) would provide `<%= selection %>` +  let b:surround_61 = "<%= \r %>" +endif +if !exists('b:surround_35') +  " When using surround `#` (ASCII 35) would provide `<%# selection %>` +  let b:surround_35 = "<%# \r %>" +endif +if !exists('b:surround_5') +  " When using surround `<C-e>` (ASCII 5 `ENQ`) would provide `<% selection %>\n<% end %>` +  let b:surround_5 = "<% \r %>\n<% end %>" +endif +  setlocal comments=:<%#  setlocal commentstring=<%#\ %s\ %> diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index 3faa9dfb..b945fab7 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -112,16 +112,6 @@ xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>  onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>  onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR> -" %-matching. <:> is handy for generics. -set matchpairs+=<:> -" There are two minor issues with it; (a) comparison operators in expressions, -" where a less-than may match a greater-than later on—this is deemed a trivial -" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the -" highlighting perspective (built into Vim), but the actual % functionality -" can be fixed by this use of matchit.vim. -let b:match_skip = 's:comment\|string\|rustArrow' -source $VIMRUNTIME/macros/matchit.vim -  " Commands {{{1  " See |:RustRun| for docs @@ -142,6 +132,9 @@ command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)  " See |:RustFmt| for docs  command! -buffer RustFmt call rustfmt#Format() +" See |:RustFmtRange| for docs +command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>) +  " Mappings {{{1  " Bind ⌘R in MacVim to :RustRun @@ -189,18 +182,27 @@ let b:undo_ftplugin = "  		\|ounmap <buffer> ]]  		\|set matchpairs-=<:>  		\|unlet b:match_skip -		\|augroup! rust.vim  		\"  " }}}1  " Code formatting on save  if get(g:, "rustfmt_autosave", 0) -	autocmd BufWritePre *.rs call rustfmt#Format() +	autocmd BufWritePre *.rs silent! call rustfmt#Format()  endif  augroup END +" %-matching. <:> is handy for generics. +set matchpairs+=<:> +" There are two minor issues with it; (a) comparison operators in expressions, +" where a less-than may match a greater-than later on—this is deemed a trivial +" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the +" highlighting perspective (built into Vim), but the actual % functionality +" can be fixed by this use of matchit.vim. +let b:match_skip = 's:comment\|string\|rustArrow' +source $VIMRUNTIME/macros/matchit.vim +  let &cpo = s:save_cpo  unlet s:save_cpo | 
