diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2020-03-02 00:34:02 +0100 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-03-02 00:34:02 +0100 | 
| commit | 6b540d7db030e4110aa3a31dd06c6c41387444db (patch) | |
| tree | 1cd1da5b35cf1c34b38d7506ff93aabf861747bf /ftplugin | |
| parent | 35ea4d2b9072594b6c0ccf87bde7978ed9f94755 (diff) | |
| download | vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.tar.gz vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.zip | |
Update
Diffstat (limited to '')
| -rw-r--r-- | ftplugin/crystal.vim | 32 | ||||
| -rw-r--r-- | ftplugin/dune.vim (renamed from ftplugin/jbuild.vim) | 2 | ||||
| -rw-r--r-- | ftplugin/ruby.vim | 2 | ||||
| -rw-r--r-- | ftplugin/vala.vim | 22 | 
4 files changed, 39 insertions, 19 deletions
| diff --git a/ftplugin/crystal.vim b/ftplugin/crystal.vim index c82c3b74..c23d93f6 100644 --- a/ftplugin/crystal.vim +++ b/ftplugin/crystal.vim @@ -43,30 +43,30 @@ setlocal errorformat=  let g:crystal_compiler_command = get(g:, 'crystal_compiler_command', 'crystal')  let g:crystal_auto_format = get(g:, 'crystal_auto_format', 0) -command! -buffer -nargs=* CrystalImpl echo crystal_lang#impl(expand('%'), getpos('.'), <q-args>).output -command! -buffer -nargs=0 CrystalDef call crystal_lang#jump_to_definition(expand('%'), getpos('.')) -command! -buffer -nargs=* CrystalContext echo crystal_lang#context(expand('%'), getpos('.'), <q-args>).output -command! -buffer -nargs=* CrystalHierarchy echo crystal_lang#type_hierarchy(expand('%'), <q-args>) -command! -buffer -nargs=? CrystalSpecSwitch call crystal_lang#switch_spec_file(<f-args>) -command! -buffer -nargs=? CrystalSpecRunAll call crystal_lang#run_all_spec(<f-args>) +command! -buffer -nargs=* CrystalImpl           echo crystal_lang#impl(expand('%'), getpos('.'), <q-args>).output +command! -buffer -nargs=0 CrystalDef            call crystal_lang#jump_to_definition(expand('%'), getpos('.')) +command! -buffer -nargs=* CrystalContext        echo crystal_lang#context(expand('%'), getpos('.'), <q-args>).output +command! -buffer -nargs=* CrystalHierarchy      echo crystal_lang#type_hierarchy(expand('%'), <q-args>) +command! -buffer -nargs=? CrystalSpecSwitch     call crystal_lang#switch_spec_file(<f-args>) +command! -buffer -nargs=? CrystalSpecRunAll     call crystal_lang#run_all_spec(<f-args>)  command! -buffer -nargs=? CrystalSpecRunCurrent call crystal_lang#run_current_spec(<f-args>) -command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(<q-args>, 0) -command! -buffer -nargs=* CrystalExpand echo crystal_lang#expand(expand('%'), getpos('.'), <q-args>).output +command! -buffer -nargs=* -bar CrystalFormat    call crystal_lang#format(<q-args>, 0) +command! -buffer -nargs=* CrystalExpand         echo crystal_lang#expand(expand('%'), getpos('.'), <q-args>).output  nnoremap <buffer><Plug>(crystal-jump-to-definition) :<C-u>CrystalDef<CR> -nnoremap <buffer><Plug>(crystal-show-context) :<C-u>CrystalContext<CR> -nnoremap <buffer><Plug>(crystal-spec-switch) :<C-u>CrystalSpecSwitch<CR> -nnoremap <buffer><Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR> -nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR> -nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR> +nnoremap <buffer><Plug>(crystal-show-context)       :<C-u>CrystalContext<CR> +nnoremap <buffer><Plug>(crystal-spec-switch)        :<C-u>CrystalSpecSwitch<CR> +nnoremap <buffer><Plug>(crystal-spec-run-all)       :<C-u>CrystalSpecRunAll<CR> +nnoremap <buffer><Plug>(crystal-spec-run-current)   :<C-u>CrystalSpecRunCurrent<CR> +nnoremap <buffer><Plug>(crystal-format)             :<C-u>CrystalFormat<CR>  augroup plugin-ft-crystal -    autocmd BufWritePre <buffer> if g:crystal_auto_format | call crystal_lang#format('', 1) | endif +  autocmd BufWritePre <buffer> if g:crystal_auto_format | call crystal_lang#format('', 1) | endif  augroup END  if get(g:, 'crystal_define_mappings', 1) -  nmap <buffer>gd <Plug>(crystal-jump-to-definition) -  nmap <buffer>gc <Plug>(crystal-show-context) +  nmap <buffer>gd  <Plug>(crystal-jump-to-definition) +  nmap <buffer>gc  <Plug>(crystal-show-context)    nmap <buffer>gss <Plug>(crystal-spec-switch)    nmap <buffer>gsa <Plug>(crystal-spec-run-all)    nmap <buffer>gsc <Plug>(crystal-spec-run-current) diff --git a/ftplugin/jbuild.vim b/ftplugin/dune.vim index 2ed1b9cc..cce58e5e 100644 --- a/ftplugin/jbuild.vim +++ b/ftplugin/dune.vim @@ -11,6 +11,4 @@ set lisp  setl commentstring=;\ %s  setl comments=:; -setl iskeyword+=#,?,.,/ -  endif diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 9c9289b1..edca30dd 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -113,7 +113,7 @@ else    if !exists('g:ruby_default_path')      if has("ruby") && has("win32")        ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) -    elseif executable('ruby') +    elseif executable('ruby') && !empty($HOME)        let g:ruby_default_path = s:query_path($HOME)      else        let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') diff --git a/ftplugin/vala.vim b/ftplugin/vala.vim index e243d674..ef433a26 100644 --- a/ftplugin/vala.vim +++ b/ftplugin/vala.vim @@ -5,8 +5,23 @@ if exists('b:did_ftplugin')  endif  let b:did_ftplugin = 1 +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting <CR> or using "o". +setlocal formatoptions=t formatoptions+=croql +" j was only added in 7.3.541, so stop complaints about its nonexistence +" Where it makes sense, remove a comment leader when joining lines. +silent! setlocal formatoptions+=j +  setlocal efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:O// +setlocal commentstring=//%s + +" When the matchit plugin is loaded, this makes the % command skip parens and +" braces in comments. +let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' +let b:match_skip = 's:comment\|string\|character\|special' +  " Insert a CCode attribute for the symbol below the cursor  " https://wiki.gnome.org/Projects/Vala/LegacyBindings  function! CCode() abort @@ -26,4 +41,11 @@ if get(g:, 'vala_syntax_folding_enabled', 1)    setlocal foldmethod=syntax  endif +" filter files in the browse dialog +if (has("browsefilter")) && !exists("b:browsefilter") +  let b:browsefilter = "Vala Source Files (*.vala)\t*.vala\n" . +        \ "Vala Vapi Files (*.vapi)\t*.vapi\n" . +        \ "All Files (*.*)\t*.*\n" +endif +  endif | 
