summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/eruby.vim4
-rw-r--r--ftplugin/gitrebase.vim11
-rw-r--r--ftplugin/graphql.vim2
-rw-r--r--ftplugin/ps1.vim2
-rw-r--r--ftplugin/ps1xml.vim2
-rw-r--r--ftplugin/purescript.vim37
-rw-r--r--ftplugin/ruby.vim1
-rw-r--r--ftplugin/rust.vim13
8 files changed, 51 insertions, 21 deletions
diff --git a/ftplugin/eruby.vim b/ftplugin/eruby.vim
index 21e22696..bf380e8a 100644
--- a/ftplugin/eruby.vim
+++ b/ftplugin/eruby.vim
@@ -29,7 +29,7 @@ elseif !exists("b:eruby_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == ''
- let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
+ let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\|\.example\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
endif
if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html'
@@ -47,7 +47,7 @@ elseif !exists("b:eruby_subtype")
endif
endif
-if exists("b:eruby_subtype") && b:eruby_subtype != ''
+if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim"
else
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
diff --git a/ftplugin/gitrebase.vim b/ftplugin/gitrebase.vim
index e3e015bb..032aba31 100644
--- a/ftplugin/gitrebase.vim
+++ b/ftplugin/gitrebase.vim
@@ -28,11 +28,12 @@ function! s:cycle()
call s:choose(get({'s':'edit','p':'squash','e':'reword','r':'fixup'},getline('.')[0],'pick'))
endfunction
-command! -buffer -bar Pick :call s:choose('pick')
-command! -buffer -bar Squash :call s:choose('squash')
-command! -buffer -bar Edit :call s:choose('edit')
-command! -buffer -bar Reword :call s:choose('reword')
-command! -buffer -bar Fixup :call s:choose('fixup')
+command! -buffer -bar -range Pick :<line1>,<line2>call s:choose('pick')
+command! -buffer -bar -range Squash :<line1>,<line2>call s:choose('squash')
+command! -buffer -bar -range Edit :<line1>,<line2>call s:choose('edit')
+command! -buffer -bar -range Reword :<line1>,<line2>call s:choose('reword')
+command! -buffer -bar -range Fixup :<line1>,<line2>call s:choose('fixup')
+command! -buffer -bar -range Drop :<line1>,<line2>call s:choose('drop')
command! -buffer -bar Cycle :call s:cycle()
" The above are more useful when they are mapped; for example:
"nnoremap <buffer> <silent> S :Cycle<CR>
diff --git a/ftplugin/graphql.vim b/ftplugin/graphql.vim
index d82d9abb..42d96e6c 100644
--- a/ftplugin/graphql.vim
+++ b/ftplugin/graphql.vim
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
-if (exists("b:did_ftplugin"))
+if (exists('b:did_ftplugin'))
finish
endif
let b:did_ftplugin = 1
diff --git a/ftplugin/ps1.vim b/ftplugin/ps1.vim
index 9a980834..a88fe019 100644
--- a/ftplugin/ps1.vim
+++ b/ftplugin/ps1.vim
@@ -19,8 +19,6 @@ 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 e2616a00..11815d2d 100644
--- a/ftplugin/ps1xml.vim
+++ b/ftplugin/ps1xml.vim
@@ -16,8 +16,6 @@ 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/purescript.vim b/ftplugin/purescript.vim
index 4e40143f..695a4108 100644
--- a/ftplugin/purescript.vim
+++ b/ftplugin/purescript.vim
@@ -1,5 +1,42 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
+setlocal include=^import
+setlocal includeexpr=printf('%s.purs',substitute(v:fname,'\\.','/','g'))
+
+let s:PS = []
+fun! InitPureScript()
+ let dirs = map(
+ \ findfile("psc-package.json", expand("%:p:h") . ";/", -1),
+ \ { idx, val -> fnamemodify(val, ":p:h") }
+ \ )
+ if empty(dirs)
+ let dirs = map(
+ \ findfile("bower.json", expand("%:p:h") . ";/", -1),
+ \ { idx, val -> fnamemodify(val, ":p:h") }
+ \ )
+ if empty(dirs)
+ return
+ endif
+ endif
+
+ let path = expand("%:p")
+ for p in s:PS
+ if stridx(path, p[0], 0) == 0
+ let &l:path=p[1]
+ return
+ endif
+ endfor
+
+ let dir = dirs[len(dirs) - 1]
+ let gp = globpath(dir, "src/**/*.purs", v:true, v:true)
+ if empty(gp)
+ return
+ endif
+
+ let &l:path=join([dir, dir . "/bower_components/**", dir . "/src/**"], ",")
+ call add(s:PS, [dir, &l:path])
+endfun
+call InitPureScript()
endif
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim
index 24576de0..9189730b 100644
--- a/ftplugin/ruby.vim
+++ b/ftplugin/ruby.vim
@@ -365,6 +365,7 @@ function! RubyCursorFile() abort
let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
if s:synid() ==# hlID('rubyConstant')
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
+ let cfile = substitute(cfile,'^::','','')
let cfile = substitute(cfile,'::','/','g')
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index b945fab7..d1765d07 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -1,10 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Language: Rust
-" Description: Vim syntax file for Rust
+" Description: Vim ftplugin for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: June 08, 2016
+" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("b:did_ftplugin")
finish
@@ -193,19 +194,13 @@ 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.
+" For matchit.vim (rustArrow stops `Fn() -> X` messing things up)
let b:match_skip = 's:comment\|string\|rustArrow'
-source $VIMRUNTIME/macros/matchit.vim
let &cpo = s:save_cpo
unlet s:save_cpo
-" vim: set noet sw=4 ts=4:
+" vim: set noet sw=8 ts=8:
endif