From af870100716f20ee4daef9cc527a9ecf41b54114 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 17 May 2017 11:07:28 +0200 Subject: Update --- ftplugin/eelixir.vim | 4 ++-- ftplugin/elixir.vim | 39 +++++++++------------------------------ ftplugin/plantuml.vim | 15 +++++---------- ftplugin/ps1.vim | 2 ++ ftplugin/ps1xml.vim | 2 ++ ftplugin/ruby.vim | 45 +++++++++++++++++++++++---------------------- ftplugin/vue.vim | 7 +++++++ 7 files changed, 50 insertions(+), 64 deletions(-) (limited to 'ftplugin') diff --git a/ftplugin/eelixir.vim b/ftplugin/eelixir.vim index eb6f6559..a4721f99 100644 --- a/ftplugin/eelixir.vim +++ b/ftplugin/eelixir.vim @@ -16,7 +16,7 @@ if !exists("g:eelixir_default_subtype") endif if !exists("b:eelixir_subtype") - let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") + let s:lines = join(getline(1, 5) + [getline('$')], "\n") let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+') if b:eelixir_subtype == '' let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+') @@ -100,7 +100,7 @@ endif setlocal comments=:<%# setlocal commentstring=<%#\ %s\ %> -let b:undo_ftplugin = "setl cms< " +let b:undo_ftplugin = "setl cms< " . \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin let &cpo = s:save_cpo diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim index 807d0665..651cfba6 100644 --- a/ftplugin/elixir.vim +++ b/ftplugin/elixir.vim @@ -17,45 +17,24 @@ if exists("loaded_matchit") && !exists("b:match_words") \ ',{:},\[:\],(:)' endif +setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,? setlocal comments=:# setlocal commentstring=#\ %s -function! GetElixirFilename(word) - let word = a:word - - " get first thing that starts uppercase, until the first space or end of line - let word = substitute(word,'^\s*\(\u[^ ]\+\).*$','\1','g') - - " remove any trailing characters that don't look like a nested module - let word = substitute(word,'\.\U.*$','','g') - - " replace module dots with slash - let word = substitute(word,'\.','/','g') - - " remove any special chars - let word = substitute(word,'[^A-z0-9-_/]','','g') - - " convert to snake_case - let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g') - let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g') - let word = substitute(word,'\(\l\|\d\)\(\u\)','\1_\2','g') - let word = substitute(word,'-','_','g') - let word = tolower(word) - - return word -endfunction - let &l:path = \ join([ - \ getcwd().'/lib', - \ getcwd().'/src', - \ getcwd().'/deps/**/lib', - \ getcwd().'/deps/**/src', + \ 'lib', + \ 'src', + \ 'deps/**/lib', + \ 'deps/**/src', \ &g:path \ ], ',') -setlocal includeexpr=GetElixirFilename(v:fname) +setlocal includeexpr=elixir#util#get_filename(v:fname) setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl silent! setlocal formatoptions-=t formatoptions+=croqlj +let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< '. + \ '| unlet! b:match_ignorecase b:match_words' + endif diff --git a/ftplugin/plantuml.vim b/ftplugin/plantuml.vim index fe5496fc..4d55d809 100644 --- a/ftplugin/plantuml.vim +++ b/ftplugin/plantuml.vim @@ -1,22 +1,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1 -" Vim plugin file -" Language: PlantUML -" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com> -" Version: 0.1 - -if exists("b:loaded_plantuml_plugin") +if exists('b:loaded_plantuml_plugin') finish endif let b:loaded_plantuml_plugin = 1 let s:cpo_save = &cpo set cpo&vim -if !exists("g:plantuml_executable_script") - let g:plantuml_executable_script="plantuml" +if !exists('g:plantuml_executable_script') + let g:plantuml_executable_script='plantuml' endif -if exists("loaded_matchit") +if exists('loaded_matchit') let b:match_ignorecase = 0 let b:match_words = \ '\(\\|\\|\\|\\|\\|\\|\\|\\):\:\' . @@ -27,7 +22,7 @@ if exists("loaded_matchit") \ ',\<\while\>:\' endif -let &l:makeprg=g:plantuml_executable_script . " " . fnameescape(expand("%")) +let &l:makeprg=g:plantuml_executable_script . ' ' . fnameescape(expand('%')) setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql diff --git a/ftplugin/ps1.vim b/ftplugin/ps1.vim index a88fe019..9a980834 100644 --- a/ftplugin/ps1.vim +++ b/ftplugin/ps1.vim @@ -19,6 +19,8 @@ setlocal formatoptions=tcqro " Enable autocompletion of hyphenated PowerShell commands, " e.g. Get-Content or Get-ADUser setlocal iskeyword+=- +" MS applications (including PowerShell) require a Byte Order Mark (BOM) for UTF-8. +setlocal bomb " Change the browse dialog on Win32 to show mainly PowerShell-related files if has("gui_win32") diff --git a/ftplugin/ps1xml.vim b/ftplugin/ps1xml.vim index 11815d2d..e2616a00 100644 --- a/ftplugin/ps1xml.vim +++ b/ftplugin/ps1xml.vim @@ -16,6 +16,8 @@ let b:did_ftplugin = 1 setlocal tw=0 setlocal commentstring=#%s setlocal formatoptions=tcqro +" MS applications (including PowerShell) require a Byte Order Mark (BOM) for UTF-8. +setlocal bomb " Change the browse dialog on Win32 to show mainly PowerShell-related files if has("gui_win32") diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 806b21cb..24576de0 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -71,7 +71,7 @@ endif function! s:query_path(root) abort let code = "print $:.join %q{,}" - if &shell =~# 'sh' + if &shell =~# 'sh' && empty(&shellxquote) let prefix = 'env PATH='.shellescape($PATH).' ' else let prefix = '' @@ -164,23 +164,23 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") nmap