summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
committerBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
commitc236c16d0884c7d6cdc4dbaddb8cb3992085f83e (patch)
tree7d87344cdf07b6b9234abe26ccef39fbbee54f63 /runtime/ftplugin
parentb316376b4893ac3ae62f7f33c483b28b7fc147c0 (diff)
updated for version 7.2b-000v7.2b.000
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/ada.vim30
-rw-r--r--runtime/ftplugin/debchangelog.vim79
-rw-r--r--runtime/ftplugin/eruby.vim2
-rw-r--r--runtime/ftplugin/git.vim4
-rw-r--r--runtime/ftplugin/haml.vim66
-rw-r--r--runtime/ftplugin/logtalk.dict164
-rw-r--r--runtime/ftplugin/logtalk.vim18
-rw-r--r--runtime/ftplugin/sass.vim18
8 files changed, 356 insertions, 25 deletions
diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim
index 688cf97f70..045645ddaf 100644
--- a/runtime/ftplugin/ada.vim
+++ b/runtime/ftplugin/ada.vim
@@ -2,13 +2,14 @@
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id$
-" Maintainer: Martin Krischik
+" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
+" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" $Author$
" $Date$
-" Version: 4.2
+" Version: 4.6
" $Revision$
-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
+" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
@@ -17,6 +18,7 @@
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
+" 08.07.2007 TV fix default compiler problems.
" Help Page: ft-ada-plugin
"------------------------------------------------------------------------------
" Provides mapping overrides for tag jumping that figure out the current
@@ -30,7 +32,7 @@ if exists ("b:did_ftplugin") || version < 700
endif
" Don't load another plugin for this buffer
-let b:did_ftplugin = 38
+let b:did_ftplugin = 45
"
" Temporarily set cpoptions to ensure the script loads OK
@@ -38,12 +40,21 @@ let b:did_ftplugin = 38
let s:cpoptions = &cpoptions
set cpoptions-=C
-" Section: Comments {{{1
+" Section: Comments {{{1
"
setlocal comments=O:--,:--\ \
setlocal commentstring=--\ \ %s
setlocal complete=.,w,b,u,t,i
+" Section: case {{{1
+"
+setlocal nosmartcase
+setlocal ignorecase
+
+" Section: formatoptions {{{1
+"
+setlocal formatoptions+=ron
+
" Section: Tagging {{{1
"
if exists ("g:ada_extended_tagging")
@@ -104,8 +115,17 @@ if !exists ("b:match_words") &&
\ s:notend . '\<record\>:\<end\>\s\+\<record\>'
endif
+
" Section: Compiler {{{1
"
+if ! exists("g:ada_default_compiler")
+ if has("vms")
+ let g:ada_default_compiler = 'decada'
+ else
+ let g:ada_default_compiler = 'gnat'
+ endif
+endif
+
if ! exists("current_compiler") ||
\ current_compiler != g:ada_default_compiler
execute "compiler " . g:ada_default_compiler
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim
index cd5b07162e..00a025b47c 100644
--- a/runtime/ftplugin/debchangelog.vim
+++ b/runtime/ftplugin/debchangelog.vim
@@ -7,6 +7,9 @@
" License: GNU GPL, version 2.0 or later
" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/ftplugin/debchangelog.vim;hb=debian
+" Bug completion requires apt-listbugs installed for Debian packages or
+" python-launchpad-bugs installed for Ubuntu packages
+
if exists("b:did_ftplugin")
finish
endif
@@ -116,7 +119,9 @@ function NewVersion()
normal h
normal 
call setline(1, substitute(getline(1), '-\$\$', '-', ''))
- normal zo
+ if exists("g:debchangelog_fold_enable")
+ foldopen
+ endif
call AddEntry()
endfunction
@@ -279,7 +284,9 @@ function! DebGetChangelogFold(lnum)
return '='
endfunction
-silent! foldopen! " unfold the entry the cursor is on (usually the first one)
+if exists("g:debchangelog_fold_enable")
+ silent! foldopen! " unfold the entry the cursor is on (usually the first one)
+endif
" }}}
@@ -291,27 +298,65 @@ endif
fun! DebCompleteBugs(findstart, base)
if a:findstart
- " it we are just after an '#', the completion should start at the '#',
- " otherwise no completion is possible
let line = getline('.')
- let colidx = col('.')
- if colidx > 1 && line[colidx - 2] =~ '#'
- let colidx = colidx - 2
- else
- let colidx = -1
- endif
+
+ " try to detect whether this is closes: or lp:
+ let g:debchangelog_complete_mode = 'debbugs'
+ let try_colidx = col('.') - 1
+ let colidx = -1 " default to no-completion-possible
+
+ while try_colidx > 0 && line[try_colidx - 1] =~ '\s\|\d\|#\|,\|:'
+ let try_colidx = try_colidx - 1
+ if line[try_colidx] == '#' && colidx == -1
+ " found hash, where we complete from:
+ let colidx = try_colidx
+ elseif line[try_colidx] == ':'
+ if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~ '\clp:'
+ let g:debchangelog_complete_mode = 'lp'
+ endif
+ break
+ endif
+ endwhile
return colidx
- else
- if ! filereadable('/usr/sbin/apt-listbugs')
- echoerr 'apt-listbugs not found, you should install it to use Closes bug completion'
- return
+ else " return matches:
+ let bug_lines = []
+ if g:debchangelog_complete_mode == 'lp'
+ if ! has('python')
+ echoerr 'vim must be built with Python support to use LP bug completion'
+ return
+ endif
+ let pkgsrc = DebGetPkgSrcName(line('.'))
+ python << EOF
+import vim
+try:
+ from launchpadbugs import connector
+ buglist = connector.ConnectBugList()
+ bl = list(buglist('https://bugs.launchpad.net/ubuntu/+source/%s' % vim.eval('pkgsrc')))
+ bl.sort(None, int)
+ liststr = '['
+ for bug in bl:
+ liststr += "'#%d - %s'," % (int(bug), bug.summary.replace('\'', '\'\''))
+ liststr += ']'
+ vim.command('silent let bug_lines = %s' % liststr)
+except ImportError:
+ vim.command('echoerr \'python-launchpad-bugs needs to be installed to use Launchpad bug completion\'')
+EOF
+ else
+ if ! filereadable('/usr/sbin/apt-listbugs')
+ echoerr 'apt-listbugs not found, you should install it to use Closes bug completion'
+ return
+ endif
+ let pkgsrc = DebGetPkgSrcName(line('.'))
+ let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
+ let bug_lines = split(listbugs_output, '\n')
endif
- let pkgsrc = DebGetPkgSrcName(line('.'))
- let listbugs_output = system('apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
- let bug_lines = split(listbugs_output, '\n')
let completions = []
for line in bug_lines
let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$')
+ " filter only those which match a:base:
+ if parts[1] !~ "^" . a:base
+ continue
+ endif
let completion = {}
let completion['word'] = parts[1]
let completion['menu'] = parts[2]
diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim
index 8b189df521..802f596e3d 100644
--- a/runtime/ftplugin/eruby.vim
+++ b/runtime/ftplugin/eruby.vim
@@ -27,7 +27,7 @@ if !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\)\+$','',''),'\.\zs\w\+$')
+ let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html'
diff --git a/runtime/ftplugin/git.vim b/runtime/ftplugin/git.vim
index 37888b15b4..f8d331faf5 100644
--- a/runtime/ftplugin/git.vim
+++ b/runtime/ftplugin/git.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: generic git output
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
-" Last Change: 2008 Feb 27
+" Last Change: 2008 Jun 20
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -15,7 +15,7 @@ if !exists('b:git_dir')
elseif $GIT_DIR != ''
let b:git_dir = $GIT_DIR
endif
- if has('win32') || has('win64')
+ if (has('win32') || has('win64')) && exists('b:git_dir')
let b:git_dir = substitute(b:git_dir,'\\','/','g')
endif
endif
diff --git a/runtime/ftplugin/haml.vim b/runtime/ftplugin/haml.vim
new file mode 100644
index 0000000000..0a39d5ef3a
--- /dev/null
+++ b/runtime/ftplugin/haml.vim
@@ -0,0 +1,66 @@
+" Vim filetype plugin
+" Language: Haml
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+unlet! b:did_ftplugin
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+ unlet b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+ unlet b:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words
+ unlet b:match_words
+endif
+
+runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
+let b:did_ftplugin = 1
+
+" Combine the new set of values with those previously included.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+endif
+if exists ("b:browsefilter")
+ let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words . ',' . s:match_words
+endif
+
+" Change the browse dialog on Win32 to show mainly Haml-related files
+if has("gui_win32")
+ let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
+endif
+
+" Load the combined list of match_words for matchit.vim
+if exists("loaded_matchit")
+ let b:match_words = s:match_words
+endif
+
+setlocal commentstring=-#\ %s
+
+let b:undo_ftplugin = "setl cms< com< "
+ \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
+
+let &cpo = s:save_cpo
+
+" vim:set sw=2:
diff --git a/runtime/ftplugin/logtalk.dict b/runtime/ftplugin/logtalk.dict
new file mode 100644
index 0000000000..e3b9e6f2a4
--- /dev/null
+++ b/runtime/ftplugin/logtalk.dict
@@ -0,0 +1,164 @@
+encoding
+calls
+category
+dynamic
+end_category
+end_object
+end_protocol
+info
+initialization
+object
+protocol
+synchronized
+threaded
+uses
+alias
+discontiguous
+meta_predicate
+mode
+op
+private
+protected
+public
+current_object
+current_protocol
+current_category
+object_property
+protocol_property
+category_property
+create_object
+create_protocol
+create_category
+abolish_object
+abolish_protocol
+abolish_category
+complements
+complements_object
+extends
+extends_object
+extends_protocol
+extends_category
+implements
+implements_protocol
+imports
+imports_category
+instantiates
+instantiates_class
+specializes
+specializes_class
+abolish_events
+current_event
+define_events
+logtalk_load
+logtalk_compile
+logtalk_library_path
+current_logtalk_flag
+set_logtalk_flag
+threaded_call
+threaded_once
+threaded_ignore
+threaded_exit
+threaded_peek
+threaded_wait
+threaded_notify
+self
+this
+sender
+parameter
+before
+after
+phrase
+expand_term
+goal_expansion
+term_expansion
+true
+fail
+call
+catch
+throw
+unify_with_occurs_check
+var
+atom
+integer
+float
+atomic
+compound
+nonvar
+number
+arg
+copy_term
+functor
+current_predicate
+predicate_property
+abolish
+assertz
+asserta
+clause
+retract
+retractall
+bagof
+findall
+forall
+setof
+current_input
+current_output
+set_input
+set_output
+open
+close
+flush_output
+stream_property
+at_end_of_stream
+set_stream_position
+get_char
+get_code
+peek_char
+peek_code
+put_char
+put_code
+nl
+get_byte
+peek_byte
+put_byte
+read
+read_term
+write
+writeq
+write_canonical
+atom_chars
+atom_codes
+atom_concat
+number_chars
+number_codes
+current_op
+char_conversion
+current_char_conversion
+once
+repeat
+atom_length
+atom_concat
+sub_atom
+atom_chars
+atom_codes
+char_code
+number_chars
+number_codes
+set_prolog_flag
+current_prolog_flag
+halt
+abs
+atan
+ceiling
+cos
+exp
+float_fractional_part
+float_integer_part
+floor
+log
+mod
+rem
+round
+sign
+sin
+sqrt
+truncate
diff --git a/runtime/ftplugin/logtalk.vim b/runtime/ftplugin/logtalk.vim
new file mode 100644
index 0000000000..e71307a399
--- /dev/null
+++ b/runtime/ftplugin/logtalk.vim
@@ -0,0 +1,18 @@
+" Logtalk filetype plugin file
+" Language: Logtalk
+" Maintainer: Paulo Moura <pmoura@logtalk.org>
+" Latest Revision: 2007-07-06
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl ts< sw< fdm< fdc< ai< dict<"
+
+"setlocal ts=4
+setlocal sw=4
+setlocal fdm=syntax
+setlocal fdc=2
+setlocal autoindent
+setlocal dict=$VIMRUNTIME/ftplugin/logtalk.dict
diff --git a/runtime/ftplugin/sass.vim b/runtime/ftplugin/sass.vim
new file mode 100644
index 0000000000..ad039772ad
--- /dev/null
+++ b/runtime/ftplugin/sass.vim
@@ -0,0 +1,18 @@
+" Vim filetype plugin
+" Language: Sass
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< inc< ofu<"
+
+setlocal commentstring=//\ %s
+setlocal omnifunc=csscomplete#CompleteCSS
+
+let &l:include = '^\s*@import\s\+\%(url(\)\='
+
+" vim:set sw=2: