summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/cabal.vim69
-rw-r--r--ftplugin/haskell.vim25
-rw-r--r--ftplugin/less.vim2
-rw-r--r--ftplugin/perl6.vim2
-rw-r--r--ftplugin/ruby.vim22
5 files changed, 13 insertions, 107 deletions
diff --git a/ftplugin/cabal.vim b/ftplugin/cabal.vim
deleted file mode 100644
index 0942397c..00000000
--- a/ftplugin/cabal.vim
+++ /dev/null
@@ -1,69 +0,0 @@
-if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
-
-if exists("g:loaded_haskellvim_cabal")
- finish
-endif
-
-let g:loaded_haskellvim_cabal = 1
-
-function! s:makeSection(content)
- return "\n" . join(a:content, "\n")
-endfunction
-
-function! s:exeTmpl(name, src)
- let l:exetmpl = [ 'executable ' . a:name,
- \ '-- ghc-options:',
- \ 'main-is: ' . a:src,
- \ '-- other-modules:',
- \ '-- other-extensions:',
- \ 'build-depends: base',
- \ '-- hs-source-dirs:',
- \ 'default-language: Haskell2010'
- \ ]
-
- return s:makeSection(l:exetmpl)
-endfunction
-
-function! s:libTmpl()
- let l:libtmpl = [ 'library',
- \ '-- ghc-options:',
- \ '-- other-modules:',
- \ '-- other-extensions:',
- \ 'build-depends: base',
- \ '-- hs-source-dirs:',
- \ 'default-language: Haskell2010'
- \ ]
-
- return s:makeSection(l:libtmpl)
-endfunction
-
-function! s:flagTmpl(name)
- let l:flagtmpl = [ 'flag ' . a:name,
- \ 'description:',
- \ 'default: False',
- \ 'manual: True',
- \ ]
-
- return s:makeSection(l:flagtmpl)
-endfunction
-
-function! cabal#addExecutable()
- let l:name = input("Enter executable name: ")
- let l:src = input("Enter source file: ")
- exe "normal Go" . s:exeTmpl(l:name, l:src)
-endfunction
-
-function! cabal#addLibrary()
- exe "normal Go" . s:libTmpl()
-endfunction
-
-function! cabal#addFlag()
- let l:name = input("Enter flag name: ")
- exe "normal Go" . s:flagTmpl(l:name)
-endfunction
-
-command! -buffer CabalAddExecutable call cabal#addExecutable()
-command! -buffer CabalAddLibrary call cabal#addLibrary()
-command! -buffer CabalAddFlag call cabal#addFlag()
-
-endif
diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim
deleted file mode 100644
index 3e9c43f8..00000000
--- a/ftplugin/haskell.vim
+++ /dev/null
@@ -1,25 +0,0 @@
-if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
-
-if exists("g:loaded_haskellvim_haskell")
- finish
-endif
-
-let g:loaded_haskellvim_haskell = 1
-
-function! haskell#makeModuleCommentBlock()
- let l:commenttmpl = [ '{-|',
- \ 'Module : ',
- \ 'Description : ',
- \ 'Copyright : ',
- \ 'License : ',
- \ 'Maintainer : ',
- \ 'Stability : ',
- \ 'Portability : ',
- \ '-}']
-
- exe "normal ggO" . join(l:commenttmpl, "\n")
-endfunction
-
-command! -buffer -nargs=0 HaskellAddModuleComment call haskell#makeModuleCommentBlock()
-
-endif
diff --git a/ftplugin/less.vim b/ftplugin/less.vim
index c89ea2de..69b2b391 100644
--- a/ftplugin/less.vim
+++ b/ftplugin/less.vim
@@ -21,7 +21,7 @@ setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
setlocal omnifunc=csscomplete#CompleteCSS
setlocal suffixesadd=.less
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
-setlocal fo=jcroql
+setlocal fo=croql
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
diff --git a/ftplugin/perl6.vim b/ftplugin/perl6.vim
index 4d0446af..969eca96 100644
--- a/ftplugin/perl6.vim
+++ b/ftplugin/perl6.vim
@@ -45,7 +45,7 @@ setlocal define=[^A-Za-z_]
" after/ftplugin/perl6.vim file that contains
" set isfname-=:
set isfname+=:
-setlocal iskeyword=@,48-57,_,192-255,:,-,'
+setlocal iskeyword=@,48-57,_,192-255,-
" Set this once, globally.
if !exists("perlpath")
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim
index 8d014d76..e5c984fc 100644
--- a/ftplugin/ruby.vim
+++ b/ftplugin/ruby.vim
@@ -104,7 +104,7 @@ endfunction
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
let s:version_file = findfile('.ruby-version', '.;')
- if !empty(s:version_file)
+ if !empty(s:version_file) && filereadable(s:version_file)
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
if !has_key(g:ruby_version_paths, b:ruby_version)
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
@@ -209,16 +209,16 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
- nmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? 'zv' : ''
- call s:map('n', '<silent>', '<C-]> <SID>c:tag <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', 'g<C-]> <SID>:tjump <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', 'g] <SID>:tselect <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', '<C-W>] <SID>c:stag <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', '<C-W><C-]> <SID>c:stag <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:stjump <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', '<C-W>g] <SID>:stselect <Plug><cword><CR><SID>tagzv')
- call s:map('n', '<silent>', '<C-W>} <SID>c:ptag <Plug><cword><CR>')
- call s:map('n', '<silent>', '<C-W>g} <SID>:ptjump <Plug><cword><CR>')
+ cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
+ call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
+ call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
+ call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><cword>"<CR>')
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')