diff --git a/.gitignore b/.gitignore index 4ce1074dd..03eeb4e65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store *.pyc *._* +.vim/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ca512ba29..000000000 --- a/.gitmodules +++ /dev/null @@ -1,66 +0,0 @@ -[submodule ".vim/bundle/snipmate"] - path = .vim/bundle/snipmate - url = git://github.com/spf13/snipmate.vim.git -[submodule ".vim/bundle/nerdcommenter"] - path = .vim/bundle/nerdcommenter - url = git://github.com/scrooloose/nerdcommenter.git -[submodule ".vim/bundle/spf13-vim-colors"] - path = .vim/bundle/spf13-vim-colors - url = git://github.com/spf13/vim-colors.git -[submodule ".vim/bundle/snipmate-snippets"] - path = .vim/bundle/snipmate-snippets - url = git://github.com/spf13/snipmate-snippets.git -[submodule ".vim/bundle/snipmate-snippets/snippets"] - path = .vim/bundle/snipmate-snippets/snippets - url = git://github.com/spf13/snipmate-snippets.git -[submodule ".vim/bundle/supertab"] - path = .vim/bundle/supertab - url = git://github.com/ervandew/supertab.git -[submodule ".vim/bundle/fugitive"] - path = .vim/bundle/fugitive - url = http://github.com/tpope/vim-fugitive.git -[submodule ".vim/bundle/delimitMate"] - path = .vim/bundle/delimitMate - url = http://github.com/Raimondi/delimitMate.git -[submodule ".vim/bundle/checksyntax"] - path = .vim/bundle/checksyntax - url = http://github.com/tomtom/checksyntax_vim.git -[submodule ".vim/bundle/command-t"] - path = .vim/bundle/command-t - url = git://github.com/wincent/Command-T.git -[submodule ".vim/bundle/vim-markdown"] - path = .vim/bundle/vim-markdown - url = git://github.com/spf13/vim-markdown.git -[submodule ".vim/bundle/easytags"] - path = .vim/bundle/easytags - url = http://github.com/spf13/vim-easytags.git -[submodule ".vim/bundle/surround"] - path = .vim/bundle/surround - url = git://github.com/spf13/vim-surround.git -[submodule ".vim/bundle/piv"] - path = .vim/bundle/piv - url = git://github.com/spf13/PIV.git -[submodule ".vim/bundle/VimDebugger"] - path = .vim/bundle/VimDebugger - url = git://github.com/taxilian/VimDebugger.git -[submodule ".vim/bundle/nerdtree"] - path = .vim/bundle/nerdtree - url = git://github.com/spf13/nerdtree.git -[submodule ".vim/bundle/jslint"] - path = .vim/bundle/jslint - url = git://github.com/bloveridge/jslint.vim.git -[submodule ".vim/bundle/pyflakes"] - path = .vim/bundle/pyflakes - url = git://github.com/bloveridge/pyflakes-vim.git -[submodule ".vim/bundle/ack"] - path = .vim/bundle/ack - url = git://github.com/mileszs/ack.vim.git -[submodule ".vim/bundle/vim-json"] - path = .vim/bundle/vim-json - url = git://github.com/leshill/vim-json.git -[submodule ".vim/bundle/vim-colors-solarized"] - path = .vim/bundle/vim-colors-solarized - url = https://github.com/altercation/vim-colors-solarized.git -[submodule ".vim/bundle/pydoc.vim"] - path = .vim/bundle/pydoc.vim - url = https://github.com/fs111/pydoc.vim.git diff --git a/.vim/autoload/pathogen.vim b/.vim/autoload/pathogen.vim deleted file mode 100644 index 6f0a4e3e9..000000000 --- a/.vim/autoload/pathogen.vim +++ /dev/null @@ -1,142 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope -" Version: 1.2 - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" API is documented below. - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 1 - -" Split a path into a list. -function! pathogen#split(path) abort " {{{1 - if type(a:path) == type([]) | return a:path | endif - let split = split(a:path,'\\\@ - -if exists('b:mapped_auto_closetag') || &cp | finish | endif -let b:mapped_auto_closetag = 1 - -ino < <> -ino > =CloseTag() -ino Return() - -if exists('s:did_auto_closetag') | finish | endif -let s:did_auto_closetag = 1 - -" Gets the current HTML tag by the cursor. -fun s:GetCurrentTag() - return matchstr(matchstr(getline('.'), - \ '<\zs\(\w\|=\| \|''\|"\)*>\%'.col('.').'c'), '^\a*') -endf - -" Cleanly return after autocompleting an html/xml tag. -fun s:Return() - let tag = s:GetCurrentTag() - return tag != '' && match(getline('.'), '') > -1 ? - \ "\\\" : "\" -endf - -fun s:InComment() - return stridx(synIDattr(synID(line('.'), col('.')-1, 0), 'name'), 'omment') != -1 -endf - -" Counts occurance of needle in page, when not in a comment. -fun s:CountInPage(needle) - let pos = [line('.'), col('.')] - call cursor(1, 1) - let counter = search(a:needle, 'Wc') - while search(a:needle, 'W') - if !s:InComment() | let counter += 1 | endif - endw - call cursor(pos) - return counter -endf - -" Returns whether a closing tag has already been inserted. -fun s:ClosingTag(tag) - return s:CountInPage('\c<'.a:tag.'.\{-}>') <= s:CountInPage('\c') -endf - -" Automatically inserts closing tag after starting tag is typed -fun s:CloseTag() - let line = getline('.') - let col = col('.') - if line[col-1] != '>' | return '>' | endif - let col += 1 - call cursor(0, col) - " Don't autocomplete next to a word or another tag or if inside comment - if line[col] !~ '\w\|<\|>' && !s:InComment() - let tag = s:GetCurrentTag() - " Insert closing tag if tag is not self-closing and has not already - " been closed - if tag != '' && tag !~ '\vimg|input|link|meta|br|hr|area|base|param|dd|dt' - \ && !s:ClosingTag(tag) - let line = substitute(line, '\%'.col.'c', '', '') - call setline('.', line) - call cursor(0, col) - endif - endif - return '' -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/bundle/checksyntax b/.vim/bundle/checksyntax deleted file mode 160000 index f9d9265f9..000000000 --- a/.vim/bundle/checksyntax +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f9d9265f978b056233f721872a59647fba3ec259 diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t deleted file mode 160000 index 85fd8b0ce..000000000 --- a/.vim/bundle/command-t +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85fd8b0ce657f772ad9c1c50fe502e08ca2bf04c diff --git a/.vim/bundle/delimitMate b/.vim/bundle/delimitMate deleted file mode 160000 index 9efb01da6..000000000 --- a/.vim/bundle/delimitMate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9efb01da683721927589e7e340e8f2374d7dd3ea diff --git a/.vim/bundle/easytags b/.vim/bundle/easytags deleted file mode 160000 index 6db62ef85..000000000 --- a/.vim/bundle/easytags +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6db62ef85cdf82451a1e6137ed5edd8e38935b22 diff --git a/.vim/bundle/fugitive b/.vim/bundle/fugitive deleted file mode 160000 index af9d44f91..000000000 --- a/.vim/bundle/fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit af9d44f91bedddb3a60fb7df5f4841143e33ed40 diff --git a/.vim/bundle/jslint b/.vim/bundle/jslint deleted file mode 160000 index 72d34cc3f..000000000 --- a/.vim/bundle/jslint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 72d34cc3f1d6f0b95ad935edfc38b40c9be0d88c diff --git a/.vim/bundle/matchit/doc/matchit.txt b/.vim/bundle/matchit/doc/matchit.txt deleted file mode 100644 index 8a3a96e26..000000000 --- a/.vim/bundle/matchit/doc/matchit.txt +++ /dev/null @@ -1,406 +0,0 @@ -*matchit.txt* Extended "%" matching - -For instructions on installing this file, type - :help matchit-install -inside Vim. - -For Vim version 6.3. Last change: 2007 Aug 29 - - - VIM REFERENCE MANUAL by Benji Fisher - -*matchit* *matchit.vim* - -1. Extended matching with "%" |matchit-intro| -2. Activation |matchit-activate| -3. Configuration |matchit-configure| -4. Supporting a New Language |matchit-newlang| -5. Known Bugs and Limitations |matchit-bugs| - -The functionality mentioned here is a plugin, see |add-plugin|. -This plugin is only available if 'compatible' is not set. -You can avoid loading this plugin by setting the "loaded_matchit" variable -in your |vimrc| file: > - :let loaded_matchit = 1 - -{Vi does not have any of this} - -============================================================================== -1. Extended matching with "%" *matchit-intro* - - *matchit-%* -% Cycle forward through matching groups, such as "if", "else", "endif", - as specified by |b:match_words|. - - *g%* *v_g%* *o_g%* -g% Cycle backwards through matching groups, as specified by - |b:match_words|. For example, go from "if" to "endif" to "else". - - *[%* *v_[%* *o_[%* -[% Go to [count] previous unmatched group, as specified by - |b:match_words|. Similar to |[{|. - - *]%* *v_]%* *o_]%* -]% Go to [count] next unmatched group, as specified by - |b:match_words|. Similar to |]}|. - - *v_a%* -a% In Visual mode, select the matching group, as specified by - |b:match_words|, containing the cursor. Similar to |v_a[|. - A [count] is ignored, and only the first character of the closing - pattern is selected. - -In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace, -bracket, or paren to its match. This can be configured with the 'matchpairs' -option. The matchit plugin extends this in several ways: - - You can match whole words, such as "if" and "endif", not just - single characters. You can also specify a |regular-expression|. - You can define groups with more than two words, such as "if", - "else", "endif". Banging on the "%" key will cycle from the "if" to - the first "else", the next "else", ..., the closing "endif", and back - to the opening "if". Nested structures are skipped. Using |g%| goes - in the reverse direction. - By default, words inside comments and strings are ignored, unless - the cursor is inside a comment or string when you type "%". If the - only thing you want to do is modify the behavior of "%" so that it - behaves this way, you do not have to define |b:match_words|, since the - script uses the 'matchpairs' option as well as this variable. - -See |matchit-details| for details on what the script does, and |b:match_words| -for how to specify matching patterns. - -MODES: *matchit-modes* *matchit-v_%* *matchit-o_%* - -Mostly, % and related motions (|g%| and |[%| and |]%|) work just like built-in -|motion| commands in |Operator-pending| and |Visual| modes. However, you -cannot make these motions |linewise| or |characterwise|, since the |:omap|s -that define them start with "v" in order to make the default behavior -inclusive. (See |o_v|.) In other words, "dV%" will not work. The -work-around is to go through Visual mode: "V%d" will work. - -LANGUAGES: *matchit-languages* - -Currently, the following languages are supported: Ada, ASP with VBS, Csh, -DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal, -SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via -the default |filetype-plugin|s in the standard vim distribution. - -To support a new language, see |matchit-newlang| below. - -DETAILS: *matchit-details* *matchit-parse* - -Here is an outline of what matchit.vim does each time you hit the "%" key. If -there are |backref|s in |b:match_words| then the first step is to produce a -version in which these back references have been eliminated; if there are no -|backref|s then this step is skipped. This step is called parsing. For -example, "\(foo\|bar\):end\1" is parsed to yield -"\(foo\|bar\):end\(foo\|bar\)". This can get tricky, especially if there are -nested groups. If debugging is turned on, the parsed version is saved as -|b:match_pat|. - - *matchit-choose* -Next, the script looks for a word on the current line that matches the pattern -just constructed. It includes the patterns from the 'matchpairs' option. -The goal is to do what you expect, which turns out to be a little complicated. -The script follows these rules: - - Insist on a match that ends on or after the cursor. - Prefer a match that includes the cursor position (that is, one that - starts on or before the cursor). - Prefer a match that starts as close to the cursor as possible. - If more than one pattern in |b:match_words| matches, choose the one - that is listed first. - -Examples: - - Suppose you > - :let b:match_words = '<:>,:' -< and hit "%" with the cursor on or before the "<" in "a is born". - The pattern '<' comes first, so it is preferred over '', which - also matches. If the cursor is on the "t", however, then '' is - preferred, because this matches a bit of text containing the cursor. - If the two groups of patterns were reversed then '<' would never be - preferred. - - Suppose you > - :let b:match_words = 'if:end if' -< (Note the space!) and hit "%" with the cursor at the end of "end if". - Then "if" matches, which is probably not what you want, but if the - cursor starts on the "end " then "end if" is chosen. (You can avoid - this problem by using a more complicated pattern.) - -If there is no match, the cursor does not move. (Before version 1.13 of the -script, it would fall back on the usual behavior of |%|). If debugging is -turned on, the matched bit of text is saved as |b:match_match| and the cursor -column of the start of the match is saved as |b:match_col|. - -Next, the script looks through |b:match_words| (original and parsed versions) -for the group and pattern that match. If debugging is turned on, the group is -saved as |b:match_ini| (the first pattern) and |b:match_tail| (the rest). If -there are |backref|s then, in addition, the matching pattern is saved as -|b:match_word| and a table of translations is saved as |b:match_table|. If -there are |backref|s, these are determined from the matching pattern and -|b:match_match| and substituted into each pattern in the matching group. - -The script decides whether to search forwards or backwards and chooses -arguments for the |searchpair()| function. Then, the cursor is moved to the -start of the match, and |searchpair()| is called. By default, matching -structures inside strings and comments are ignored. This can be changed by -setting |b:match_skip|. - -============================================================================== -2. Activation *matchit-activate* - -You can use this script as a plugin, by copying it to your plugin directory. -See |add-global-plugin| for instructions. You can also add a line to your -|vimrc| file, such as > - :source $VIMRUNTIME/macros/matchit.vim -or > - :runtime macros/matchit.vim -Either way, the script should start working the next time you start up Vim. - -(Earlier versions of the script did nothing unless a |buffer-variable| named -|b:match_words| was defined. Even earlier versions contained autocommands -that set this variable for various file types. Now, |b:match_words| is -defined in many of the default |filetype-plugin|s instead.) - -For a new language, you can add autocommands to the script or to your vimrc -file, but the recommended method is to add a line such as > - let b:match_words = '\:\' -to the |filetype-plugin| for your language. See |b:match_words| below for how -this variable is interpreted. - -TROUBLESHOOTING *matchit-troubleshoot* - -The script should work in most installations of Vim. It may not work if Vim -was compiled with a minimal feature set, for example if the |+syntax| option -was not enabled. If your Vim has support for syntax compiled in, but you do -not have |syntax| highlighting turned on, matchit.vim should work, but it may -fail to skip matching groups in comments and strings. If the |filetype| -mechanism is turned off, the |b:match_words| variable will probably not be -defined automatically. - -============================================================================== -3. Configuration *matchit-configure* - -There are several variables that govern the behavior of matchit.vim. Note -that these are variables local to the buffer, not options, so use |:let| to -define them, not |:set|. Some of these variables have values that matter; for -others, it only matters whether the variable has been defined. All of these -can be defined in the |filetype-plugin| or autocommand that defines -|b:match_words| or "on the fly." - -The main variable is |b:match_words|. It is described in the section below on -supporting a new language. - - *MatchError* *matchit-hl* *matchit-highlight* -MatchError is the highlight group for error messages from the script. By -default, it is linked to WarningMsg. If you do not want to be bothered by -error messages, you can define this to be something invisible. For example, -if you use the GUI version of Vim and your command line is normally white, you -can do > - :hi MatchError guifg=white guibg=white -< - *b:match_ignorecase* -If you > - :let b:match_ignorecase = 1 -then matchit.vim acts as if 'ignorecase' is set: for example, "end" and "END" -are equivalent. If you > - :let b:match_ignorecase = 0 -then matchit.vim treats "end" and "END" differently. (There will be no -b:match_infercase option unless someone requests it.) - - *b:match_debug* -Define b:match_debug if you want debugging information to be saved. See -|matchit-debug|, below. - - *b:match_skip* -If b:match_skip is defined, it is passed as the skip argument to -|searchpair()|. This controls when matching structures are skipped, or -ignored. By default, they are ignored inside comments and strings, as -determined by the |syntax| mechanism. (If syntax highlighting is turned off, -nothing is skipped.) You can set b:match_skip to a string, which evaluates to -a non-zero, numerical value if the match is to be skipped or zero if the match -should not be skipped. In addition, the following special values are -supported by matchit.vim: - s:foo becomes (current syntax item) =~ foo - S:foo becomes (current syntax item) !~ foo - r:foo becomes (line before cursor) =~ foo - R:foo becomes (line before cursor) !~ foo -(The "s" is meant to suggest "syntax", and the "r" is meant to suggest -"regular expression".) - -Examples: - - You can get the default behavior with > - :let b:match_skip = 's:comment\|string' -< - If you want to skip matching structures unless they are at the start - of the line (ignoring whitespace) then you can > - :let b:match_skip = 'R:^\s*' -< Do not do this if strings or comments can span several lines, since - the normal syntax checking will not be done if you set b:match_skip. - - In LaTeX, since "%" is used as the comment character, you can > - :let b:match_skip = 'r:%' -< Unfortunately, this will skip anything after "\%", an escaped "%". To - allow for this, and also "\\%" (an excaped backslash followed by the - comment character) you can > - :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%' -< - See the $VIMRUNTIME/ftplugin/vim.vim for an example that uses both - syntax and a regular expression. - -============================================================================== -4. Supporting a New Language *matchit-newlang* - *b:match_words* -In order for matchit.vim to support a new language, you must define a suitable -pattern for |b:match_words|. You may also want to set some of the -|matchit-configure| variables, as described above. If your language has a -complicated syntax, or many keywords, you will need to know something about -Vim's |regular-expression|s. - -The format for |b:match_words| is similar to that of the 'matchpairs' option: -it is a comma (,)-separated list of groups; each group is a colon(:)-separated -list of patterns (regular expressions). Commas and backslashes that are part -of a pattern should be escaped with backslashes ('\:' and '\,'). It is OK to -have only one group; the effect is undefined if a group has only one pattern. -A simple example is > - :let b:match_words = '\:\,' - \ . '\:\:\:\' -(In Vim regular expressions, |\<| and |\>| denote word boundaries. Thus "if" -matches the end of "endif" but "\" does not.) Then banging on the "%" -key will bounce the cursor between "if" and the matching "endif"; and from -"while" to any matching "continue" or "break", then to the matching "endwhile" -and back to the "while". It is almost always easier to use |literal-string|s -(single quotes) as above: '\' rather than "\\" and so on. - -Exception: If the ":" character does not appear in b:match_words, then it is -treated as an expression to be evaluated. For example, > - :let b:match_words = 'GetMatchWords()' -allows you to define a function. This can return a different string depending -on the current syntax, for example. - -Once you have defined the appropriate value of |b:match_words|, you will -probably want to have this set automatically each time you edit the -appropriate file type. The recommended way to do this is by adding the -definition to a |filetype-plugin| file. - -Tips: Be careful that your initial pattern does not match your final pattern. -See the example above for the use of word-boundary expressions. It is usually -better to use ".\{-}" (as many as necessary) instead of ".*" (as many as -possible). See |\{-|. For example, in the string "label", "<.*>" -matches the whole string whereas "<.\{-}>" and "<[^>]*>" match "" and -"". - - *matchit-spaces* *matchit-s:notend* -If "if" is to be paired with "end if" (Note the space!) then word boundaries -are not enough. Instead, define a regular expression s:notend that will match -anything but "end" and use it as follows: > - :let s:notend = '\%(\:\' -< *matchit-s:sol* -This is a simplified version of what is done for Ada. The s:notend is a -|script-variable|. Similarly, you may want to define a start-of-line regular -expression > - :let s:sol = '\%(^\|;\)\s*' -if keywords are only recognized after the start of a line or after a -semicolon (;), with optional white space. - - *matchit-backref* *matchit-\1* -In any group, the expressions |\1|, |\2|, ..., |\9| refer to parts of the -INITIAL pattern enclosed in |\(|escaped parentheses|\)|. These are referred -to as back references, or backrefs. For example, > - :let b:match_words = '\:\(h\)\1\>' -means that "bo" pairs with "ho" and "boo" pairs with "hoo" and so on. Note -that "\1" does not refer to the "\(h\)" in this example. If you have -"\(nested \(parentheses\)\) then "\d" refers to the d-th "\(" and everything -up to and including the matching "\)": in "\(nested\(parentheses\)\)", "\1" -refers to everything and "\2" refers to "\(parentheses\)". If you use a -variable such as |s:notend| or |s:sol| in the previous paragraph then remember -to count any "\(" patterns in this variable. You do not have to count groups -defined by |\%(\)|. - -It should be possible to resolve back references from any pattern in the -group. For example, > - :let b:match_words = '\(foo\)\(bar\):more\1:and\2:end\1\2' -would not work because "\2" cannot be determined from "morefoo" and "\1" -cannot be determined from "andbar". On the other hand, > - :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' -should work (and have the same effect as "foobar:barfoo:endfoobar"), although -this has not been thoroughly tested. - -You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has -not been thouroughly tested in matchit.vim.) For example, if the keyword "if" -must occur at the start of the line, with optional white space, you might use -the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of -at the start of the line. For another example, if HTML had only one tag then -one could > - :let b:match_words = '<:>,<\@<=tag>:<\@<=/tag>' -so that "%" can bounce between matching "<" and ">" pairs or (starting on -"tag" or "/tag") between matching tags. Without the |\@<=|, the script would -bounce from "tag" to the "<" in "", and another "%" would not take you -back to where you started. - -DEBUGGING *matchit-debug* *:MatchDebug* - -If you are having trouble figuring out the appropriate definition of -|b:match_words| then you can take advantage of the same information I use when -debugging the script. This is especially true if you are not sure whether -your patterns or my script are at fault! To make this more convenient, I have -made the command :MatchDebug, which defines the variable |b:match_debug| and -creates a Matchit menu. This menu makes it convenient to check the values of -the variables described below. You will probably also want to read -|matchit-details| above. - -Defining the variable |b:match_debug| causes the script to set the following -variables, each time you hit the "%" key. Several of these are only defined -if |b:match_words| includes |backref|s. - - *b:match_pat* -The b:match_pat variable is set to |b:match_words| with |backref|s parsed. - *b:match_match* -The b:match_match variable is set to the bit of text that is recognized as a -match. - *b:match_col* -The b:match_col variable is set to the cursor column of the start of the -matching text. - *b:match_wholeBR* -The b:match_wholeBR variable is set to the comma-separated group of patterns -that matches, with |backref|s unparsed. - *b:match_iniBR* -The b:match_iniBR variable is set to the first pattern in |b:match_wholeBR|. - *b:match_ini* -The b:match_ini variable is set to the first pattern in |b:match_wholeBR|, -with |backref|s resolved from |b:match_match|. - *b:match_tail* -The b:match_tail variable is set to the remaining patterns in -|b:match_wholeBR|, with |backref|s resolved from |b:match_match|. - *b:match_word* -The b:match_word variable is set to the pattern from |b:match_wholeBR| that -matches |b:match_match|. - *b:match_table* -The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in -|b:match_word|. - -============================================================================== -5. Known Bugs and Limitations *matchit-bugs* - -Just because I know about a bug does not mean that it is on my todo list. I -try to respond to reports of bugs that cause real problems. If it does not -cause serious problems, or if there is a work-around, a bug may sit there for -a while. Moral: if a bug (known or not) bothers you, let me know. - -The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may -have undesired effects in Select mode |Select-mode-mapping|. At least, if you -want to replace the selection with any character in "ag%[]" there will be a -pause of |'updatetime'| first. - -It would be nice if "\0" were recognized as the entire pattern. That is, it -would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may -try to implement this in a future version. (This is not so easy to arrange as -you might think!) - -============================================================================== -vim:tw=78:fo=tcq2: diff --git a/.vim/bundle/matchit/plugin/matchit.vim b/.vim/bundle/matchit/plugin/matchit.vim deleted file mode 100755 index e41cda9e1..000000000 --- a/.vim/bundle/matchit/plugin/matchit.vim +++ /dev/null @@ -1,812 +0,0 @@ -" matchit.vim: (global plugin) Extended "%" matching -" Last Change: Fri Jan 25 10:00 AM 2008 EST -" Maintainer: Benji Fisher PhD -" Version: 1.13.2, for Vim 6.3+ -" URL: http://www.vim.org/script.php?script_id=39 - -" Documentation: -" The documentation is in a separate file, matchit.txt . - -" Credits: -" Vim editor by Bram Moolenaar (Thanks, Bram!) -" Original script and design by Raul Segura Acevedo -" Support for comments by Douglas Potts -" Support for back references and other improvements by Benji Fisher -" Support for many languages by Johannes Zellner -" Suggestions for improvement, bug reports, and support for additional -" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark -" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner. - -" Debugging: -" If you'd like to try the built-in debugging commands... -" :MatchDebug to activate debugging for the current buffer -" This saves the values of several key script variables as buffer-local -" variables. See the MatchDebug() function, below, for details. - -" TODO: I should think about multi-line patterns for b:match_words. -" This would require an option: how many lines to scan (default 1). -" This would be useful for Python, maybe also for *ML. -" TODO: Maybe I should add a menu so that people will actually use some of -" the features that I have implemented. -" TODO: Eliminate the MultiMatch function. Add yet another argument to -" Match_wrapper() instead. -" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' -" TODO: Make backrefs safer by using '\V' (very no-magic). -" TODO: Add a level of indirection, so that custom % scripts can use my -" work but extend it. - -" allow user to prevent loading -" and prevent duplicate loading -if exists("loaded_matchit") || &cp - finish -endif -let loaded_matchit = 1 -let s:last_mps = "" -let s:last_words = ":" - -let s:save_cpo = &cpo -set cpo&vim - -nnoremap % :call Match_wrapper('',1,'n') -nnoremap g% :call Match_wrapper('',0,'n') -vnoremap % :call Match_wrapper('',1,'v') m'gv`` -vnoremap g% :call Match_wrapper('',0,'v') m'gv`` -onoremap % v:call Match_wrapper('',1,'o') -onoremap g% v:call Match_wrapper('',0,'o') - -" Analogues of [{ and ]} using matching patterns: -nnoremap [% :call MultiMatch("bW", "n") -nnoremap ]% :call MultiMatch("W", "n") -vmap [% [%m'gv`` -vmap ]% ]%m'gv`` -" vnoremap [% :call MultiMatch("bW", "v") m'gv`` -" vnoremap ]% :call MultiMatch("W", "v") m'gv`` -onoremap [% v:call MultiMatch("bW", "o") -onoremap ]% v:call MultiMatch("W", "o") - -" text object: -vmap a% [%v]% - -" Auto-complete mappings: (not yet "ready for prime time") -" TODO Read :help write-plugin for the "right" way to let the user -" specify a key binding. -" let g:match_auto = '' -" let g:match_autoCR = '' -" if exists("g:match_auto") -" execute "inoremap " . g:match_auto . ' x"=Autocomplete()Pls' -" endif -" if exists("g:match_autoCR") -" execute "inoremap " . g:match_autoCR . ' =Autocomplete()' -" endif -" if exists("g:match_gthhoh") -" execute "inoremap " . g:match_gthhoh . ' :call Gthhoh()' -" endif " gthhoh = "Get the heck out of here!" - -let s:notslash = '\\\@" - endif - " In s:CleanUp(), we may need to check whether the cursor moved forward. - let startline = line(".") - let startcol = col(".") - " Use default behavior if called with a count. - if v:count - exe "normal! " . v:count . "%" - return s:CleanUp(restore_options, a:mode, startline, startcol) - end - - " First step: if not already done, set the script variables - " s:do_BR flag for whether there are backrefs - " s:pat parsed version of b:match_words - " s:all regexp based on s:pat and the default groups - " - if !exists("b:match_words") || b:match_words == "" - let match_words = "" - " Allow b:match_words = "GetVimMatchWords()" . - elseif b:match_words =~ ":" - let match_words = b:match_words - else - execute "let match_words =" b:match_words - endif -" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") - let s:last_words = match_words - let s:last_mps = &mps - " The next several lines were here before - " BF started messing with this script. - " quote the special chars in 'matchpairs', replace [,:] with \| and then - " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif) - " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+', - " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>' - let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . - \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' - " s:all = pattern with all the keywords - let match_words = match_words . (strlen(match_words) ? "," : "") . default - if match_words !~ s:notslash . '\\\d' - let s:do_BR = 0 - let s:pat = match_words - else - let s:do_BR = 1 - let s:pat = s:ParseWords(match_words) - endif - let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g') - let s:all = '\%(' . s:all . '\)' - " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)' - if exists("b:match_debug") - let b:match_pat = s:pat - endif - endif - - " Second step: set the following local variables: - " matchline = line on which the cursor started - " curcol = number of characters before match - " prefix = regexp for start of line to start of match - " suffix = regexp for end of match to end of line - " Require match to end on or after the cursor and prefer it to - " start on or before the cursor. - let matchline = getline(startline) - if a:word != '' - " word given - if a:word !~ s:all - echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE - return s:CleanUp(restore_options, a:mode, startline, startcol) - endif - let matchline = a:word - let curcol = 0 - let prefix = '^\%(' - let suffix = '\)$' - " Now the case when "word" is not given - else " Find the match that ends on or after the cursor and set curcol. - let regexp = s:Wholematch(matchline, s:all, startcol-1) - let curcol = match(matchline, regexp) - " If there is no match, give up. - if curcol == -1 - return s:CleanUp(restore_options, a:mode, startline, startcol) - endif - let endcol = matchend(matchline, regexp) - let suf = strlen(matchline) - endcol - let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(') - let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$') - endif - if exists("b:match_debug") - let b:match_match = matchstr(matchline, regexp) - let b:match_col = curcol+1 - endif - - " Third step: Find the group and single word that match, and the original - " (backref) versions of these. Then, resolve the backrefs. - " Set the following local variable: - " group = colon-separated list of patterns, one of which matches - " = ini:mid:fin or ini:fin - " - " Reconstruct the version with unresolved backrefs. - let patBR = substitute(match_words.',', - \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') - let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g') - " Now, set group and groupBR to the matching group: 'if:endif' or - " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns - " group . "," . groupBR, and we pick it apart. - let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) - let i = matchend(group, s:notslash . ",") - let groupBR = strpart(group, i) - let group = strpart(group, 0, i-1) - " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix - if s:do_BR " Do the hard part: resolve those backrefs! - let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) - endif - if exists("b:match_debug") - let b:match_wholeBR = groupBR - let i = matchend(groupBR, s:notslash . ":") - let b:match_iniBR = strpart(groupBR, 0, i-1) - endif - - " Fourth step: Set the arguments for searchpair(). - let i = matchend(group, s:notslash . ":") - let j = matchend(group, '.*' . s:notslash . ":") - let ini = strpart(group, 0, i-1) - let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g') - let fin = strpart(group, j) - "Un-escape the remaining , and : characters. - let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - " searchpair() requires that these patterns avoid \(\) groups. - let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g') - let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g') - let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g') - " Set mid. This is optimized for readability, not micro-efficiency! - if a:forward && matchline =~ prefix . fin . suffix - \ || !a:forward && matchline =~ prefix . ini . suffix - let mid = "" - endif - " Set flag. This is optimized for readability, not micro-efficiency! - if a:forward && matchline =~ prefix . fin . suffix - \ || !a:forward && matchline !~ prefix . ini . suffix - let flag = "bW" - else - let flag = "W" - endif - " Set skip. - if exists("b:match_skip") - let skip = b:match_skip - elseif exists("b:match_comment") " backwards compatibility and testing! - let skip = "r:" . b:match_comment - else - let skip = 's:comment\|string' - endif - let skip = s:ParseSkip(skip) - if exists("b:match_debug") - let b:match_ini = ini - let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin - endif - - " Fifth step: actually start moving the cursor and call searchpair(). - " Later, :execute restore_cursor to get to the original screen. - let restore_cursor = virtcol(".") . "|" - normal! g0 - let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor - normal! H - let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - execute restore_cursor - call cursor(0, curcol + 1) - " normal! 0 - " if curcol - " execute "normal!" . curcol . "l" - " endif - if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) - let skip = "0" - else - execute "if " . skip . "| let skip = '0' | endif" - endif - let sp_return = searchpair(ini, mid, fin, flag, skip) - let final_position = "call cursor(" . line(".") . "," . col(".") . ")" - " Restore cursor position and original screen. - execute restore_cursor - normal! m' - if sp_return > 0 - execute final_position - endif - return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin) -endfun - -" Restore options and do some special handling for Operator-pending mode. -" The optional argument is the tail of the matching group. -fun! s:CleanUp(options, mode, startline, startcol, ...) - execute "set" a:options - " Open folds, if appropriate. - if a:mode != "o" - if &foldopen =~ "percent" - normal! zv - endif - " In Operator-pending mode, we want to include the whole match - " (for example, d%). - " This is only a problem if we end up moving in the forward direction. - elseif (a:startline < line(".")) || - \ (a:startline == line(".") && a:startcol < col(".")) - if a:0 - " Check whether the match is a single character. If not, move to the - " end of the match. - let matchline = getline(".") - let currcol = col(".") - let regexp = s:Wholematch(matchline, a:1, currcol-1) - let endcol = matchend(matchline, regexp) - if endcol > currcol " This is NOT off by one! - execute "normal!" . (endcol - currcol) . "l" - endif - endif " a:0 - endif " a:mode != "o" && etc. - return 0 -endfun - -" Example (simplified HTML patterns): if -" a:groupBR = '<\(\k\+\)>:' -" a:prefix = '^.\{3}\(' -" a:group = '<\(\k\+\)>:' -" a:suffix = '\).\{2}$' -" a:matchline = "12312" or "12312" -" then extract "tag" from a:matchline and return ":" . -fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline) - if a:matchline !~ a:prefix . - \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix - return a:group - endif - let i = matchend(a:groupBR, s:notslash . ':') - let ini = strpart(a:groupBR, 0, i-1) - let tailBR = strpart(a:groupBR, i) - let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix, - \ a:groupBR) - let i = matchend(word, s:notslash . ":") - let wordBR = strpart(word, i) - let word = strpart(word, 0, i-1) - " Now, a:matchline =~ a:prefix . word . a:suffix - if wordBR != ini - let table = s:Resolve(ini, wordBR, "table") - else - " let table = "----------" - let table = "" - let d = 0 - while d < 10 - if tailBR =~ s:notslash . '\\' . d - " let table[d] = d - let table = table . d - else - let table = table . "-" - endif - let d = d + 1 - endwhile - endif - let d = 9 - while d - if table[d] != "-" - let backref = substitute(a:matchline, a:prefix.word.a:suffix, - \ '\'.table[d], "") - " Are there any other characters that should be escaped? - let backref = escape(backref, '*,:') - execute s:Ref(ini, d, "start", "len") - let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len) - let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d, - \ escape(backref, '\\'), 'g') - endif - let d = d-1 - endwhile - if exists("b:match_debug") - if s:do_BR - let b:match_table = table - let b:match_word = word - else - let b:match_table = "" - let b:match_word = "" - endif - endif - return ini . ":" . tailBR -endfun - -" Input a comma-separated list of groups with backrefs, such as -" a:groups = '\(foo\):end\1,\(bar\):end\1' -" and return a comma-separated list of groups with backrefs replaced: -" return '\(foo\):end\(foo\),\(bar\):end\(bar\)' -fun! s:ParseWords(groups) - let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g') - let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g') - let parsed = "" - while groups =~ '[^,:]' - let i = matchend(groups, s:notslash . ':') - let j = matchend(groups, s:notslash . ',') - let ini = strpart(groups, 0, i-1) - let tail = strpart(groups, i, j-i-1) . ":" - let groups = strpart(groups, j) - let parsed = parsed . ini - let i = matchend(tail, s:notslash . ':') - while i != -1 - " In 'if:else:endif', ini='if' and word='else' and then word='endif'. - let word = strpart(tail, 0, i-1) - let tail = strpart(tail, i) - let i = matchend(tail, s:notslash . ':') - let parsed = parsed . ":" . s:Resolve(ini, word, "word") - endwhile " Now, tail has been used up. - let parsed = parsed . "," - endwhile " groups =~ '[^,:]' - let parsed = substitute(parsed, ',$', '', '') - return parsed -endfun - -" TODO I think this can be simplified and/or made more efficient. -" TODO What should I do if a:start is out of range? -" Return a regexp that matches all of a:string, such that -" matchstr(a:string, regexp) represents the match for a:pat that starts -" as close to a:start as possible, before being preferred to after, and -" ends after a:start . -" Usage: -" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1) -" let i = match(getline("."), regexp) -" let j = matchend(getline("."), regexp) -" let match = matchstr(getline("."), regexp) -fun! s:Wholematch(string, pat, start) - let group = '\%(' . a:pat . '\)' - let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^') - let len = strlen(a:string) - let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$') - if a:string !~ prefix . group . suffix - let prefix = '' - endif - return prefix . group . suffix -endfun - -" No extra arguments: s:Ref(string, d) will -" find the d'th occurrence of '\(' and return it, along with everything up -" to and including the matching '\)'. -" One argument: s:Ref(string, d, "start") returns the index of the start -" of the d'th '\(' and any other argument returns the length of the group. -" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be -" executed, having the effect of -" :let foo = s:Ref(string, d, "start") -" :let bar = s:Ref(string, d, "len") -fun! s:Ref(string, d, ...) - let len = strlen(a:string) - if a:d == 0 - let start = 0 - else - let cnt = a:d - let match = a:string - while cnt - let cnt = cnt - 1 - let index = matchend(match, s:notslash . '\\(') - if index == -1 - return "" - endif - let match = strpart(match, index) - endwhile - let start = len - strlen(match) - if a:0 == 1 && a:1 == "start" - return start - 2 - endif - let cnt = 1 - while cnt - let index = matchend(match, s:notslash . '\\(\|\\)') - 1 - if index == -2 - return "" - endif - " Increment if an open, decrement if a ')': - let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')' - " let cnt = stridx('0(', match[index]) + cnt - let match = strpart(match, index+1) - endwhile - let start = start - 2 - let len = len - start - strlen(match) - endif - if a:0 == 1 - return len - elseif a:0 == 2 - return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len - else - return strpart(a:string, start, len) - endif -endfun - -" Count the number of disjoint copies of pattern in string. -" If the pattern is a literal string and contains no '0' or '1' characters -" then s:Count(string, pattern, '0', '1') should be faster than -" s:Count(string, pattern). -fun! s:Count(string, pattern, ...) - let pat = escape(a:pattern, '\\') - if a:0 > 1 - let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g") - let foo = substitute(a:string, pat, a:2, "g") - let foo = substitute(foo, '[^' . a:2 . ']', "", "g") - return strlen(foo) - endif - let result = 0 - let foo = a:string - let index = matchend(foo, pat) - while index != -1 - let result = result + 1 - let foo = strpart(foo, index) - let index = matchend(foo, pat) - endwhile - return result -endfun - -" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where -" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first -" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this -" indicates that all other instances of '\1' in target are to be replaced -" by '\3'. The hard part is dealing with nesting... -" Note that ":" is an illegal character for source and target, -" unless it is preceded by "\". -fun! s:Resolve(source, target, output) - let word = a:target - let i = matchend(word, s:notslash . '\\\d') - 1 - let table = "----------" - while i != -2 " There are back references to be replaced. - let d = word[i] - let backref = s:Ref(a:source, d) - " The idea is to replace '\d' with backref. Before we do this, - " replace any \(\) groups in backref with :1, :2, ... if they - " correspond to the first, second, ... group already inserted - " into backref. Later, replace :1 with \1 and so on. The group - " number w+b within backref corresponds to the group number - " s within a:source. - " w = number of '\(' in word before the current one - let w = s:Count( - \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1') - let b = 1 " number of the current '\(' in backref - let s = d " number of the current '\(' in a:source - while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1') - \ && s < 10 - if table[s] == "-" - if w + b < 10 - " let table[s] = w + b - let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1) - endif - let b = b + 1 - let s = s + 1 - else - execute s:Ref(backref, b, "start", "len") - let ref = strpart(backref, start, len) - let backref = strpart(backref, 0, start) . ":". table[s] - \ . strpart(backref, start+len) - let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1') - endif - endwhile - let word = strpart(word, 0, i-1) . backref . strpart(word, i+1) - let i = matchend(word, s:notslash . '\\\d') - 1 - endwhile - let word = substitute(word, s:notslash . '\zs:', '\\', 'g') - if a:output == "table" - return table - elseif a:output == "word" - return word - else - return table . word - endif -endfun - -" Assume a:comma = ",". Then the format for a:patterns and a:1 is -" a:patterns = ",,..." -" a:1 = ",,..." -" If is the first pattern that matches a:string then return -" if no optional arguments are given; return , if a:1 is given. -fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...) - let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma) - let i = matchend(tail, s:notslash . a:comma) - if a:0 - let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma) - let j = matchend(alttail, s:notslash . a:comma) - endif - let current = strpart(tail, 0, i-1) - if a:branch == "" - let currpat = current - else - let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') - endif - while a:string !~ a:prefix . currpat . a:suffix - let tail = strpart(tail, i) - let i = matchend(tail, s:notslash . a:comma) - if i == -1 - return -1 - endif - let current = strpart(tail, 0, i-1) - if a:branch == "" - let currpat = current - else - let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') - endif - if a:0 - let alttail = strpart(alttail, j) - let j = matchend(alttail, s:notslash . a:comma) - endif - endwhile - if a:0 - let current = current . a:comma . strpart(alttail, 0, j-1) - endif - return current -endfun - -" Call this function to turn on debugging information. Every time the main -" script is run, buffer variables will be saved. These can be used directly -" or viewed using the menu items below. -if !exists(":MatchDebug") - command! -nargs=0 MatchDebug call s:Match_debug() -endif - -fun! s:Match_debug() - let b:match_debug = 1 " Save debugging information. - " pat = all of b:match_words with backrefs parsed - amenu &Matchit.&pat :echo b:match_pat - " match = bit of text that is recognized as a match - amenu &Matchit.&match :echo b:match_match - " curcol = cursor column of the start of the matching text - amenu &Matchit.&curcol :echo b:match_col - " wholeBR = matching group, original version - amenu &Matchit.wh&oleBR :echo b:match_wholeBR - " iniBR = 'if' piece, original version - amenu &Matchit.ini&BR :echo b:match_iniBR - " ini = 'if' piece, with all backrefs resolved from match - amenu &Matchit.&ini :echo b:match_ini - " tail = 'else\|endif' piece, with all backrefs resolved from match - amenu &Matchit.&tail :echo b:match_tail - " fin = 'endif' piece, with all backrefs resolved from match - amenu &Matchit.&word :echo b:match_word - " '\'.d in ini refers to the same thing as '\'.table[d] in word. - amenu &Matchit.t&able :echo '0:' . b:match_table . ':9' -endfun - -" Jump to the nearest unmatched "(" or "if" or "" if a:spflag == "bW" -" or the nearest unmatched "" or "endif" or ")" if a:spflag == "W". -" Return a "mark" for the original position, so that -" let m = MultiMatch("bW", "n") ... execute m -" will return to the original position. If there is a problem, do not -" move the cursor and return "", unless a count is given, in which case -" go up or down as many levels as possible and again return "". -" TODO This relies on the same patterns as % matching. It might be a good -" idea to give it its own matching patterns. -fun! s:MultiMatch(spflag, mode) - if !exists("b:match_words") || b:match_words == "" - return "" - end - let restore_options = (&ic ? "" : "no") . "ignorecase" - if exists("b:match_ignorecase") - let &ignorecase = b:match_ignorecase - endif - let startline = line(".") - let startcol = col(".") - - " First step: if not already done, set the script variables - " s:do_BR flag for whether there are backrefs - " s:pat parsed version of b:match_words - " s:all regexp based on s:pat and the default groups - " This part is copied and slightly modified from s:Match_wrapper(). - let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . - \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' - " Allow b:match_words = "GetVimMatchWords()" . - if b:match_words =~ ":" - let match_words = b:match_words - else - execute "let match_words =" b:match_words - endif - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") - let s:last_words = match_words - let s:last_mps = &mps - if match_words !~ s:notslash . '\\\d' - let s:do_BR = 0 - let s:pat = match_words - else - let s:do_BR = 1 - let s:pat = s:ParseWords(match_words) - endif - let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default, - \ '[,:]\+','\\|','g') . '\)' - if exists("b:match_debug") - let b:match_pat = s:pat - endif - endif - - " Second step: figure out the patterns for searchpair() - " and save the screen, cursor position, and 'ignorecase'. - " - TODO: A lot of this is copied from s:Match_wrapper(). - " - maybe even more functionality should be split off - " - into separate functions! - let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default - let open = substitute(s:pat . cdefault, - \ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g') - let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '') - let close = substitute(s:pat . cdefault, - \ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g') - let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)' - if exists("b:match_skip") - let skip = b:match_skip - elseif exists("b:match_comment") " backwards compatibility and testing! - let skip = "r:" . b:match_comment - else - let skip = 's:comment\|string' - endif - let skip = s:ParseSkip(skip) - " let restore_cursor = line(".") . "G" . virtcol(".") . "|" - " normal! H - " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - let restore_cursor = virtcol(".") . "|" - normal! g0 - let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor - normal! H - let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - execute restore_cursor - - " Third step: call searchpair(). - " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'. - let openpat = substitute(open, '\(\\\@" or ... -" and return "endif" or "endwhile" or "" or ... . -" For now, this uses b:match_words and the same script variables -" as s:Match_wrapper() . Later, it may get its own patterns, -" either from a buffer variable or passed as arguments. -" fun! s:Autocomplete() -" echo "autocomplete not yet implemented :-(" -" if !exists("b:match_words") || b:match_words == "" -" return "" -" end -" let startpos = s:MultiMatch("bW") -" -" if startpos == "" -" return "" -" endif -" " - TODO: figure out whether 'if' or '' matched, and construct -" " - the appropriate closing. -" let matchline = getline(".") -" let curcol = col(".") - 1 -" " - TODO: Change the s:all argument if there is a new set of match pats. -" let regexp = s:Wholematch(matchline, s:all, curcol) -" let suf = strlen(matchline) - matchend(matchline, regexp) -" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(') -" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$') -" " Reconstruct the version with unresolved backrefs. -" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g') -" let patBR = substitute(patBR, ':\{2,}', ':', "g") -" " Now, set group and groupBR to the matching group: 'if:endif' or -" " 'while:endwhile' or whatever. -" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) -" let i = matchend(group, s:notslash . ",") -" let groupBR = strpart(group, i) -" let group = strpart(group, 0, i-1) -" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix -" if s:do_BR -" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) -" endif -" " let g:group = group -" -" " - TODO: Construct the closing from group. -" let fake = "end" . expand("") -" execute startpos -" return fake -" endfun - -" Close all open structures. "Get the heck out of here!" -" fun! s:Gthhoh() -" let close = s:Autocomplete() -" while strlen(close) -" put=close -" let close = s:Autocomplete() -" endwhile -" endfun - -" Parse special strings as typical skip arguments for searchpair(): -" s:foo becomes (current syntax item) =~ foo -" S:foo becomes (current syntax item) !~ foo -" r:foo becomes (line before cursor) =~ foo -" R:foo becomes (line before cursor) !~ foo -fun! s:ParseSkip(str) - let skip = a:str - if skip[1] == ":" - if skip[0] == "s" - let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . - \ strpart(skip,2) . "'" - elseif skip[0] == "S" - let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" . - \ strpart(skip,2) . "'" - elseif skip[0] == "r" - let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'" - elseif skip[0] == "R" - let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'" - endif - endif - return skip -endfun - -let &cpo = s:save_cpo - -" vim:sts=2:sw=2: diff --git a/.vim/bundle/nerdcommenter b/.vim/bundle/nerdcommenter deleted file mode 160000 index 2b60d872b..000000000 --- a/.vim/bundle/nerdcommenter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b60d872ba8d61d9130e9386e234f65570403423 diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree deleted file mode 160000 index c2e3bbe76..000000000 --- a/.vim/bundle/nerdtree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c2e3bbe762bd1a64f7f949cf07acdd4e480d1519 diff --git a/.vim/bundle/piv b/.vim/bundle/piv deleted file mode 160000 index 6e2fbff8c..000000000 --- a/.vim/bundle/piv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6e2fbff8c3c7d21fb2d8a6f8b4bbcfbbc1642f48 diff --git a/.vim/bundle/pydoc.vim b/.vim/bundle/pydoc.vim deleted file mode 160000 index 56c23972a..000000000 --- a/.vim/bundle/pydoc.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 56c23972ad6de20e558ec7806371042529f0a41e diff --git a/.vim/bundle/pyflakes b/.vim/bundle/pyflakes deleted file mode 160000 index 8140709d8..000000000 --- a/.vim/bundle/pyflakes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8140709d8cef70dd441c0a0fe25db2fa218cd010 diff --git a/.vim/bundle/rbtweaks/colors/blackboard.vim b/.vim/bundle/rbtweaks/colors/blackboard.vim deleted file mode 100644 index 06f983a71..000000000 --- a/.vim/bundle/rbtweaks/colors/blackboard.vim +++ /dev/null @@ -1,59 +0,0 @@ -" Vim color scheme -" -" Name: blackboard.vim -" Maintainer: Ben Wyrosdick -" Last Change: 20 August 2009 -" License: public domain -" Version: 1.4 - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif - -let g:colors_name = "blackboard" - -if has("gui_running") - "GUI Colors - highlight Normal guifg=White guibg=#0B1022 - highlight Cursor guifg=Black guibg=Yellow - highlight CursorLine guibg=#191E2F - highlight LineNr guibg=#323232 guifg=#888888 - highlight Folded guifg=#f1f3e8 guibg=#444444 - highlight Pmenu guibg=#84A7C1 - - "Visual mode - highlight VisualNOS guibg=#1C3B79 - highlight Visual guibg=#1C3B79 - - "General Colors - highlight Comment guifg=#AEAEAE - highlight Constant guifg=#CAFE1E - highlight Keyword guifg=#FFDE00 - highlight String guifg=#00D42D - highlight Type guifg=#84A7C1 - highlight Identifier guifg=#00D42D gui=NONE - highlight Function guifg=#FF5600 gui=NONE - highlight clear Search - highlight Search guibg=#1C3B79 - highlight PreProc guifg=#FF5600 - - "HTML Colors - highlight link htmlTag Type - highlight link htmlEndTag htmlTag - highlight link htmlTagName htmlTag - - "Ruby Colors - highlight link rubyClass Keyword - highlight link rubyDefine Keyword - highlight link rubyConstant Type - highlight link rubySymbol Constant - highlight link rubyStringDelimiter rubyString - highlight link rubyInclude Keyword - highlight link rubyAttribute Keyword - highlight link rubyInstanceVariable Normal - - "Rails Colors - highlight link railsMethod Type -end diff --git a/.vim/bundle/rbtweaks/colors/herald.vim b/.vim/bundle/rbtweaks/colors/herald.vim deleted file mode 100644 index 6ba361210..000000000 --- a/.vim/bundle/rbtweaks/colors/herald.vim +++ /dev/null @@ -1,385 +0,0 @@ -" Vim color file -" Name: herald.vim -" Author: Fabio Cevasco -" Version: 0.2.0 -" Notes: Supports 8, 16, 256 and 16,777,216 (RGB) color modes - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "herald" - -set background=dark - -" Set some syntax-related variables -let ruby_operators = 1 - -if has("gui_running") - - " -> Text; Miscellaneous - hi Normal guibg=#1F1F1F guifg=#D0D0D0 gui=none - hi SpecialKey guibg=#1F1F1F guifg=#E783E9 gui=none - hi VertSplit guibg=#1F1F1F guifg=#FFEE68 gui=none - hi SignColumn guibg=#1F1F1F guifg=#B8AFF9 gui=none - hi NonText guibg=#1F1F1F guifg=#FC6984 gui=none - hi Directory guibg=#1F1F1F guifg=#FFEE68 gui=none - hi Title guibg=#1F1F1F guifg=#6DF584 gui=bold - - " -> Cursor - hi Cursor guibg=#FFEE68 guifg=#1F1F1F gui=none - hi CursorIM guibg=#FFEE68 guifg=#1F1F1F gui=none - hi CursorColumn guibg=#2d2d2d gui=none - hi CursorLine guibg=#2d2d2d gui=none - - " -> Folding - hi FoldColumn guibg=#001336 guifg=#003DAD gui=none - hi Folded guibg=#001336 guifg=#003DAD gui=none - - " -> Line info - hi LineNr guifg=#857b6f guibg=#101010 gui=none - hi StatusLine guibg=#2d2d2d guifg=#696567 gui=none - hi StatusLineNC guibg=#25365a guifg=#696567 gui=none - - " -> Messages - hi ErrorMsg guibg=#A32024 guifg=#D0D0D0 gui=none - hi Question guibg=#1F1F1F guifg=#FFA500 gui=none - hi WarningMsg guibg=#FFA500 guifg=#000000 gui=none - hi MoreMsg guibg=#1F1F1F guifg=#FFA500 gui=none - hi ModeMsg guibg=#1F1F1F guifg=#FFA500 gui=none - - " -> Search - hi Search guibg=#696567 guifg=#FFEE68 gui=none - hi IncSearch guibg=#696567 guifg=#FFEE68 gui=none - - " -> Diff - hi DiffAdd guibg=#006124 guifg=#ED9000 gui=none - hi DiffChange guibg=#0B294A guifg=#A36000 gui=none - hi DiffDelete guibg=#081F38 guifg=#ED9000 gui=none - hi DiffText guibg=#12457D guifg=#ED9000 gui=underline - - " -> Menu - hi Pmenu guibg=#140100 guifg=#660300 gui=none - hi PmenuSel guibg=#F17A00 guifg=#4C0200 gui=none - hi PmenuSbar guibg=#430300 gui=none - hi PmenuThumb guibg=#720300 gui=none - hi PmenuSel guibg=#F17A00 guifg=#4C0200 gui=none - - " -> Tabs - hi TabLine guibg=#141414 guifg=#1F1F1F gui=none - hi TabLineFill guibg=#000000 gui=none - hi TabLineSel guibg=#1F1F1F guifg=#D0D0D0 gui=bold - - " -> Visual Mode - hi Visual guibg=#17425B guifg=#FFFFFF gui=none - hi VisualNOS guibg=#000000 guifg=#696567 gui=none - - " -> Code - hi Comment guibg=#1F1F1F guifg=#99968b gui=italic - hi Constant guibg=#1F1F1F guifg=#6DF584 gui=none - hi String guibg=#1F1F1F guifg=#FFB539 gui=italic - hi Error guibg=#A32024 guifg=#D0D0D0 gui=none - hi Identifier guibg=#1F1F1F guifg=#70BDF1 gui=none - hi Function guibg=#1F1F1F guifg=#90CBF1 gui=none - hi Ignore guibg=#1F1F1F guifg=#1F1F1F gui=none - hi MatchParen guibg=#FFA500 guifg=#1F1F1F gui=none - hi PreProc guibg=#1F1F1F guifg=#B8AFF9 gui=none - hi Special guibg=#1F1F1F guifg=#FFEE68 gui=none - hi Todo guibg=#1F1F1F guifg=#FC4234 gui=bold,italic - hi Underlined guibg=#1F1F1F guifg=#FC4234 gui=underline - hi Statement guibg=#1F1F1F guifg=#E783E9 gui=none - hi Operator guibg=#1F1F1F guifg=#FC6984 gui=none - hi Delimiter guibg=#1F1F1F guifg=#FC6984 gui=none - hi Type guibg=#1F1F1F guifg=#FFEE68 gui=none - hi Exception guibg=#1F1F1F guifg=#FC4234 gui=none - - " -> HTML-specific - hi htmlBold guibg=#1F1F1F guifg=#D0D0D0 gui=bold - hi htmlBoldItalic guibg=#1F1F1F guifg=#D0D0D0 gui=bold,italic - hi htmlBoldUnderline guibg=#1F1F1F guifg=#D0D0D0 gui=bold,underline - hi htmlBoldUnderlineItalic guibg=#1F1F1F guifg=#D0D0D0 gui=bold,underline,italic - hi htmlItalic guibg=#1F1F1F guifg=#D0D0D0 gui=italic - hi htmlUnderline guibg=#1F1F1F guifg=#D0D0D0 gui=underline - hi htmlUnderlineItalic guibg=#1F1F1F guifg=#D0D0D0 gui=underline,italic - -elseif &t_Co == 256 - - " -> Text; Miscellaneous - hi Normal ctermbg=234 ctermfg=252 cterm=none - hi SpecialKey ctermbg=234 ctermfg=176 cterm=none - hi VertSplit ctermbg=234 ctermfg=227 cterm=none - hi SignColumn ctermbg=234 ctermfg=141 cterm=none - hi NonText ctermbg=234 ctermfg=204 cterm=none - hi Directory ctermbg=234 ctermfg=227 cterm=none - hi Title ctermbg=234 ctermfg=84 cterm=bold - - " -> Cursor - hi Cursor ctermbg=227 ctermfg=234 cterm=none - hi CursorIM ctermbg=227 ctermfg=234 cterm=none - hi CursorColumn ctermbg=0 cterm=none - hi CursorLine ctermbg=0 cterm=none - - " -> Folding - hi FoldColumn ctermbg=234 ctermfg=25 cterm=none - hi Folded ctermbg=234 ctermfg=25 cterm=none - - " -> Line info - hi LineNr ctermbg=0 ctermfg=241 cterm=none - hi StatusLine ctermbg=0 ctermfg=241 cterm=none - hi StatusLineNC ctermbg=237 ctermfg=241 cterm=none - - " -> Messages - hi ErrorMsg ctermbg=124 ctermfg=252 cterm=none - hi Question ctermbg=234 ctermfg=214 cterm=none - hi WarningMsg ctermbg=214 ctermfg=0 cterm=none - hi MoreMsg ctermbg=234 ctermfg=214 cterm=none - hi ModeMsg ctermbg=234 ctermfg=214 cterm=none - - " -> Search - hi Search ctermbg=241 ctermfg=227 cterm=none - hi IncSearch ctermbg=241 ctermfg=227 cterm=none - - " -> Diff - hi DiffAdd ctermbg=22 ctermfg=208 cterm=none - hi DiffChange ctermbg=235 ctermfg=130 cterm=none - hi DiffDelete ctermbg=234 ctermfg=208 cterm=none - hi DiffText ctermbg=24 ctermfg=208 cterm=underline - - " -> Menu - hi Pmenu ctermbg=0 ctermfg=52 cterm=none - hi PmenuSel ctermbg=208 ctermfg=52 cterm=none - hi PmenuSbar ctermbg=52 cterm=none - hi PmenuThumb ctermbg=52 cterm=none - hi PmenuSel ctermbg=208 ctermfg=52 cterm=none - - " -> Tabs - hi TabLine ctermbg=233 ctermfg=234 cterm=none - hi TabLineFill ctermbg=0 cterm=none - hi TabLineSel ctermbg=234 ctermfg=252 cterm=bold - " - " -> Visual Mode - hi Visual ctermbg=0 ctermfg=215 cterm=none - hi VisualNOS ctermbg=0 ctermfg=241 cterm=none - - " -> Code - hi Comment ctermbg=234 ctermfg=241 cterm=none - hi Constant ctermbg=234 ctermfg=84 cterm=none - hi String ctermbg=234 ctermfg=215 cterm=none - hi Error ctermbg=234 ctermfg=203 cterm=none - hi Identifier ctermbg=234 ctermfg=75 cterm=none - hi Function ctermbg=234 ctermfg=117 cterm=none - hi Ignore ctermbg=234 ctermfg=234 cterm=none - hi MatchParen ctermbg=214 ctermfg=234 cterm=none - hi PreProc ctermbg=234 ctermfg=141 cterm=none - hi Special ctermbg=234 ctermfg=227 cterm=none - hi Todo ctermbg=234 ctermfg=203 cterm=bold - hi Underlined ctermbg=234 ctermfg=203 cterm=underline - hi Statement ctermbg=234 ctermfg=176 cterm=none - hi Operator ctermbg=234 ctermfg=204 cterm=none - hi Delimiter ctermbg=234 ctermfg=204 cterm=none - hi Type ctermbg=234 ctermfg=227 cterm=none - hi Exception ctermbg=234 ctermfg=203 cterm=none - - " -> HTML-specific - hi htmlBold ctermbg=234 ctermfg=252 cterm=bold - hi htmlBoldItalic ctermbg=234 ctermfg=252 cterm=bold,italic - hi htmlBoldUnderline ctermbg=234 ctermfg=252 cterm=bold,underline - hi htmlBoldUnderlineItalic ctermbg=234 ctermfg=252 cterm=bold,underline,italic - hi htmlItalic ctermbg=234 ctermfg=252 cterm=italic - hi htmlUnderline ctermbg=234 ctermfg=252 cterm=underline - hi htmlUnderlineItalic ctermbg=234 ctermfg=252 cterm=underline,italic - -elseif &t_Co == 16 - - " -> Text; Miscellaneous - hi Normal ctermbg=8 ctermfg=15 cterm=none - hi SpecialKey ctermbg=8 ctermfg=5 cterm=none - hi VertSplit ctermbg=8 ctermfg=14 cterm=none - hi SignColumn ctermbg=8 ctermfg=5 cterm=none - hi NonText ctermbg=8 ctermfg=4 cterm=none - hi Directory ctermbg=8 ctermfg=14 cterm=none - hi Title ctermbg=8 ctermfg=10 cterm=bold - - " -> Cursor - hi Cursor ctermbg=14 ctermfg=8 cterm=none - hi CursorIM ctermbg=14 ctermfg=8 cterm=none - hi CursorColumn ctermbg=0 cterm=none - hi CursorLine ctermbg=0 cterm=none - - " -> Folding - hi FoldColumn ctermbg=0 ctermfg=1 cterm=none - hi Folded ctermbg=0 ctermfg=1 cterm=none - - " -> Line info - hi LineNr ctermbg=0 ctermfg=7 cterm=none - hi StatusLine ctermbg=0 ctermfg=7 cterm=none - hi StatusLineNC ctermbg=0 ctermfg=7 cterm=none - - " -> Messages - hi ErrorMsg ctermbg=4 ctermfg=7 cterm=none - hi Question ctermbg=8 ctermfg=14 cterm=none - hi WarningMsg ctermbg=14 ctermfg=0 cterm=none - hi MoreMsg ctermbg=8 ctermfg=14 cterm=none - hi ModeMsg ctermbg=8 ctermfg=14 cterm=none - - " -> Search - hi Search ctermbg=7 ctermfg=14 cterm=none - hi IncSearch ctermbg=7 ctermfg=14 cterm=none - - " -> Diff - hi DiffAdd ctermbg=0 ctermfg=10 cterm=none - hi DiffChange ctermbg=0 ctermfg=14 cterm=none - hi DiffDelete ctermbg=0 ctermfg=12 cterm=none - hi DiffText ctermbg=1 ctermfg=14 cterm=underline - - " -> Menu - hi Pmenu ctermbg=0 ctermfg=4 cterm=none - hi PmenuSel ctermbg=14 ctermfg=4 cterm=none - hi PmenuSbar ctermbg=0 cterm=none - hi PmenuThumb ctermbg=4 cterm=none - hi PmenuSel ctermbg=14 ctermfg=4 cterm=none - - " -> Tabs - hi TabLine ctermbg=7 ctermfg=8 cterm=none - hi TabLineFill ctermbg=0 cterm=none - hi TabLineSel ctermbg=8 ctermfg=7 cterm=bold - " - " -> Visual Mode - hi Visual ctermbg=0 ctermfg=14 cterm=none - hi VisualNOS ctermbg=0 ctermfg=7 cterm=none - - " -> Code - hi Comment ctermbg=8 ctermfg=7 cterm=none - hi Constant ctermbg=8 ctermfg=10 cterm=none - hi String ctermbg=8 ctermfg=6 cterm=none - hi Error ctermbg=8 ctermfg=4 cterm=none - hi Identifier ctermbg=8 ctermfg=11 cterm=none - hi Function ctermbg=8 ctermfg=11 cterm=none - hi Ignore ctermbg=8 ctermfg=8 cterm=none - hi MatchParen ctermbg=14 ctermfg=8 cterm=none - hi PreProc ctermbg=8 ctermfg=5 cterm=none - hi Special ctermbg=8 ctermfg=14 cterm=none - hi Todo ctermbg=8 ctermfg=12 cterm=bold - hi Underlined ctermbg=8 ctermfg=12 cterm=underline - hi Statement ctermbg=8 ctermfg=13 cterm=none - hi Operator ctermbg=8 ctermfg=4 cterm=none - hi Delimiter ctermbg=8 ctermfg=4 cterm=none - hi Type ctermbg=8 ctermfg=14 cterm=none - hi Exception ctermbg=8 ctermfg=12 cterm=none - - " -> HTML-specific - hi htmlBold ctermbg=8 ctermfg=7 cterm=bold - hi htmlBoldItalic ctermbg=8 ctermfg=7 cterm=bold,italic - hi htmlBoldUnderline ctermbg=8 ctermfg=7 cterm=bold,underline - hi htmlBoldUnderlineItalic ctermbg=8 ctermfg=7 cterm=bold,underline,italic - hi htmlItalic ctermbg=8 ctermfg=7 cterm=italic - hi htmlUnderline ctermbg=8 ctermfg=7 cterm=underline - hi htmlUnderlineItalic ctermbg=8 ctermfg=7 cterm=underline,italic - - -elseif &t_Co == 8 - - " -> Text; Miscellaneous - hi Normal ctermbg=8 ctermfg=7 cterm=none - hi SpecialKey ctermbg=8 ctermfg=5 cterm=none - hi VertSplit ctermbg=8 ctermfg=6 cterm=none - hi SignColumn ctermbg=8 ctermfg=5 cterm=none - hi NonText ctermbg=8 ctermfg=4 cterm=none - hi Directory ctermbg=8 ctermfg=6 cterm=none - hi Title ctermbg=8 ctermfg=2 cterm=bold - - " -> Cursor - hi Cursor ctermbg=6 ctermfg=8 cterm=none - hi CursorIM ctermbg=6 ctermfg=8 cterm=none - hi CursorColumn ctermbg=0 cterm=none - hi CursorLine ctermbg=0 cterm=none - - " -> Folding - hi FoldColumn ctermbg=0 ctermfg=1 cterm=none - hi Folded ctermbg=0 ctermfg=1 cterm=none - - " -> Line info - hi LineNr ctermbg=0 ctermfg=7 cterm=none - hi StatusLine ctermbg=0 ctermfg=7 cterm=none - hi StatusLineNC ctermbg=0 ctermfg=7 cterm=none - - " -> Messages - hi ErrorMsg ctermbg=4 ctermfg=7 cterm=none - hi Question ctermbg=8 ctermfg=6 cterm=none - hi WarningMsg ctermbg=6 ctermfg=0 cterm=none - hi MoreMsg ctermbg=8 ctermfg=6 cterm=none - hi ModeMsg ctermbg=8 ctermfg=6 cterm=none - - " -> Search - hi Search ctermbg=7 ctermfg=6 cterm=none - hi IncSearch ctermbg=7 ctermfg=6 cterm=none - - " -> Diff - hi DiffAdd ctermbg=0 ctermfg=2 cterm=none - hi DiffChange ctermbg=0 ctermfg=6 cterm=none - hi DiffDelete ctermbg=0 ctermfg=4 cterm=none - hi DiffText ctermbg=1 ctermfg=6 cterm=underline - - " -> Menu - hi Pmenu ctermbg=0 ctermfg=4 cterm=none - hi PmenuSel ctermbg=6 ctermfg=4 cterm=none - hi PmenuSbar ctermbg=0 cterm=none - hi PmenuThumb ctermbg=4 cterm=none - hi PmenuSel ctermbg=6 ctermfg=4 cterm=none - - " -> Tabs - hi TabLine ctermbg=7 ctermfg=8 cterm=none - hi TabLineFill ctermbg=0 cterm=none - hi TabLineSel ctermbg=8 ctermfg=7 cterm=bold - " - " -> Visual Mode - hi Visual ctermbg=0 ctermfg=6 cterm=none - hi VisualNOS ctermbg=0 ctermfg=7 cterm=none - - " -> Code - hi Comment ctermbg=8 ctermfg=7 cterm=none - hi Constant ctermbg=8 ctermfg=2 cterm=none - hi String ctermbg=8 ctermfg=6 cterm=none - hi Error ctermbg=8 ctermfg=4 cterm=none - hi Identifier ctermbg=8 ctermfg=3 cterm=none - hi Function ctermbg=8 ctermfg=3 cterm=none - hi Ignore ctermbg=8 ctermfg=8 cterm=none - hi MatchParen ctermbg=6 ctermfg=8 cterm=none - hi PreProc ctermbg=8 ctermfg=5 cterm=none - hi Special ctermbg=8 ctermfg=6 cterm=none - hi Todo ctermbg=8 ctermfg=4 cterm=bold - hi Underlined ctermbg=8 ctermfg=4 cterm=underline - hi Statement ctermbg=8 ctermfg=5 cterm=none - hi Operator ctermbg=8 ctermfg=4 cterm=none - hi Delimiter ctermbg=8 ctermfg=4 cterm=none - hi Type ctermbg=8 ctermfg=6 cterm=none - hi Exception ctermbg=8 ctermfg=4 cterm=none - - " -> HTML-specific - hi htmlBold ctermbg=8 ctermfg=7 cterm=bold - hi htmlBoldItalic ctermbg=8 ctermfg=7 cterm=bold,italic - hi htmlBoldUnderline ctermbg=8 ctermfg=7 cterm=bold,underline - hi htmlBoldUnderlineItalic ctermbg=8 ctermfg=7 cterm=bold,underline,italic - hi htmlItalic ctermbg=8 ctermfg=7 cterm=italic - hi htmlUnderline ctermbg=8 ctermfg=7 cterm=underline - hi htmlUnderlineItalic ctermbg=8 ctermfg=7 cterm=underline,italic - -endif - -hi! default link bbcodeBold htmlBold -hi! default link bbcodeBoldItalic htmlBoldItalic -hi! default link bbcodeBoldItalicUnderline htmlBoldUnderlineItalic -hi! default link bbcodeBoldUnderline htmlBoldUnderline -hi! default link bbcodeItalic htmlItalic -hi! default link bbcodeItalicUnderline htmlUnderlineItalic -hi! default link bbcodeUnderline htmlUnderline - -" Spellcheck formatting -if has("spell") - hi SpellBad guisp=#FC4234 gui=undercurl - hi SpellCap guisp=#70BDF1 gui=undercurl - hi SpellLocal guisp=#FFEE68 gui=undercurl - hi SpellRare guisp=#6DF584 gui=undercurl -endif diff --git a/.vim/bundle/rbtweaks/colors/molokai.vim b/.vim/bundle/rbtweaks/colors/molokai.vim deleted file mode 100644 index aae94208d..000000000 --- a/.vim/bundle/rbtweaks/colors/molokai.vim +++ /dev/null @@ -1,211 +0,0 @@ -" Vim color file -" -" Author: Tomas Restrepo -" -" Note: Based on the monokai theme for textmate -" by Wimer Hazenberg and its darker variant -" by Hamish Stuart Macpherson -" - -hi clear - -set background=dark -if version > 580 - " no guarantees for version 5.8 and below, but this makes it stop - " complaining - hi clear - if exists("syntax_on") - syntax reset - endif -endif -let g:colors_name="molokai" - -if exists("g:molokai_original") - let s:molokai_original = g:molokai_original -else - let s:molokai_original = 0 -endif - - -hi Boolean guifg=#AE81FF -hi Character guifg=#E6DB74 -hi Number guifg=#AE81FF -hi String guifg=#E6DB74 -hi Conditional guifg=#F92672 gui=bold -hi Constant guifg=#AE81FF gui=bold -hi Cursor guifg=#000000 guibg=#F8F8F0 -hi Debug guifg=#BCA3A3 gui=bold -hi Define guifg=#66D9EF -hi Delimiter guifg=#8F8F8F -hi DiffAdd guibg=#13354A -hi DiffChange guifg=#89807D guibg=#4C4745 -hi DiffDelete guifg=#960050 guibg=#1E0010 -hi DiffText guibg=#4C4745 gui=italic,bold - -hi Directory guifg=#A6E22E gui=bold -hi Error guifg=#960050 guibg=#1E0010 -hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold -hi Exception guifg=#A6E22E gui=bold -hi Float guifg=#AE81FF -hi FoldColumn guifg=#465457 guibg=#000000 -hi Folded guifg=#465457 guibg=#000000 -hi Function guifg=#A6E22E -hi Identifier guifg=#FD971F -hi Ignore guifg=#808080 guibg=bg -hi IncSearch guifg=#C4BE89 guibg=#000000 - -hi Keyword guifg=#F92672 gui=bold -hi Label guifg=#E6DB74 gui=none -hi Macro guifg=#C4BE89 gui=italic -hi SpecialKey guifg=#66D9EF gui=italic - -hi MatchParen guifg=#000000 guibg=#FD971F gui=bold -hi ModeMsg guifg=#E6DB74 -hi MoreMsg guifg=#E6DB74 -hi Operator guifg=#F92672 - -" complete menu -hi Pmenu guifg=#66D9EF guibg=#000000 -hi PmenuSel guibg=#808080 -hi PmenuSbar guibg=#080808 -hi PmenuThumb guifg=#66D9EF - -hi PreCondit guifg=#A6E22E gui=bold -hi PreProc guifg=#A6E22E -hi Question guifg=#66D9EF -hi Repeat guifg=#F92672 gui=bold -hi Search guifg=#FFFFFF guibg=#455354 -" marks column -hi SignColumn guifg=#A6E22E guibg=#232526 -hi SpecialChar guifg=#F92672 gui=bold -hi SpecialComment guifg=#465457 gui=bold -hi Special guifg=#66D9EF guibg=bg gui=italic -hi SpecialKey guifg=#888A85 gui=italic -if has("spell") - hi SpellBad guisp=#FF0000 gui=undercurl - hi SpellCap guisp=#7070F0 gui=undercurl - hi SpellLocal guisp=#70F0F0 gui=undercurl - hi SpellRare guisp=#FFFFFF gui=undercurl -endif -hi Statement guifg=#F92672 gui=bold -hi StatusLine guifg=#455354 guibg=fg -hi StatusLineNC guifg=#808080 guibg=#080808 -hi StorageClass guifg=#FD971F gui=italic -hi Structure guifg=#66D9EF -hi Tag guifg=#F92672 gui=italic -hi Title guifg=#ef5939 -hi Todo guifg=#FFFFFF guibg=bg gui=bold - -hi Typedef guifg=#66D9EF -hi Type guifg=#66D9EF gui=none -hi Underlined guifg=#808080 gui=underline - -hi VertSplit guifg=#808080 guibg=#080808 gui=bold -hi VisualNOS guibg=#403D3D -hi Visual guibg=#403D3D -hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold -hi WildMenu guifg=#66D9EF guibg=#000000 - -if s:molokai_original == 1 - hi Normal guifg=#F8F8F2 guibg=#272822 - hi Comment guifg=#75715E - hi CursorLine guibg=#3E3D32 - hi CursorColumn guibg=#3E3D32 - hi LineNr guifg=#BCBCBC guibg=#3B3A32 - hi NonText guifg=#BCBCBC guibg=#3B3A32 -else - hi Normal guifg=#F8F8F2 guibg=#1B1D1E - hi Comment guifg=#465457 - hi CursorLine guibg=#293739 - hi CursorColumn guibg=#293739 - hi LineNr guifg=#BCBCBC guibg=#232526 - hi NonText guifg=#BCBCBC guibg=#232526 -end - -" -" Support for 256-color terminal -" -if &t_Co > 255 - hi Boolean ctermfg=135 - hi Character ctermfg=144 - hi Number ctermfg=135 - hi String ctermfg=144 - hi Conditional ctermfg=161 cterm=bold - hi Constant ctermfg=135 cterm=bold - hi Cursor ctermfg=16 ctermbg=253 - hi Debug ctermfg=225 cterm=bold - hi Define ctermfg=81 - hi Delimiter ctermfg=241 - - hi DiffAdd ctermbg=24 - hi DiffChange ctermfg=181 ctermbg=239 - hi DiffDelete ctermfg=162 ctermbg=53 - hi DiffText ctermbg=102 cterm=bold - - hi Directory ctermfg=118 cterm=bold - hi Error ctermfg=219 ctermbg=89 - hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold - hi Exception ctermfg=118 cterm=bold - hi Float ctermfg=135 - hi FoldColumn ctermfg=67 ctermbg=16 - hi Folded ctermfg=67 ctermbg=16 - hi Function ctermfg=118 - hi Identifier ctermfg=208 - hi Ignore ctermfg=244 ctermbg=232 - hi IncSearch ctermfg=193 ctermbg=16 - - hi Keyword ctermfg=161 cterm=bold - hi Label ctermfg=229 cterm=none - hi Macro ctermfg=193 - hi SpecialKey ctermfg=81 - - hi MatchParen ctermfg=16 ctermbg=208 cterm=bold - hi ModeMsg ctermfg=229 - hi MoreMsg ctermfg=229 - hi Operator ctermfg=161 - - " complete menu - hi Pmenu ctermfg=81 ctermbg=16 - hi PmenuSel ctermbg=244 - hi PmenuSbar ctermbg=232 - hi PmenuThumb ctermfg=81 - - hi PreCondit ctermfg=118 cterm=bold - hi PreProc ctermfg=118 - hi Question ctermfg=81 - hi Repeat ctermfg=161 cterm=bold - hi Search ctermfg=253 ctermbg=66 - - " marks column - hi SignColumn ctermfg=118 ctermbg=235 - hi SpecialChar ctermfg=161 cterm=bold - hi SpecialComment ctermfg=245 cterm=bold - hi Special ctermfg=81 ctermbg=232 - hi SpecialKey ctermfg=245 - - hi Statement ctermfg=161 cterm=bold - hi StatusLine ctermfg=238 ctermbg=253 - hi StatusLineNC ctermfg=244 ctermbg=232 - hi StorageClass ctermfg=208 - hi Structure ctermfg=81 - hi Tag ctermfg=161 - hi Title ctermfg=166 - hi Todo ctermfg=231 ctermbg=232 cterm=bold - - hi Typedef ctermfg=81 - hi Type ctermfg=81 cterm=none - hi Underlined ctermfg=244 cterm=underline - - hi VertSplit ctermfg=244 ctermbg=232 cterm=bold - hi VisualNOS ctermbg=238 - hi Visual ctermbg=235 - hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold - hi WildMenu ctermfg=81 ctermbg=16 - - hi Normal ctermfg=252 ctermbg=233 - hi Comment ctermfg=59 - hi CursorLine ctermbg=234 cterm=none - hi CursorColumn ctermbg=234 - hi LineNr ctermfg=250 ctermbg=234 - hi NonText ctermfg=250 ctermbg=234 -end diff --git a/.vim/bundle/rbtweaks/colors/wombat.vim b/.vim/bundle/rbtweaks/colors/wombat.vim deleted file mode 100644 index 6881688c3..000000000 --- a/.vim/bundle/rbtweaks/colors/wombat.vim +++ /dev/null @@ -1,53 +0,0 @@ -" Maintainer: Lars H. Nielsen (dengmao@gmail.com) -" Last Change: January 22 2007 - -set background=dark - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "wombat" - - -" Vim >= 7.0 specific colors -if version >= 700 - hi CursorLine guibg=#2d2d2d - hi CursorColumn guibg=#2d2d2d - hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold - hi Pmenu guifg=#f6f3e8 guibg=#444444 - hi PmenuSel guifg=#000000 guibg=#cae682 -endif - -" General colors -hi Cursor guifg=NONE guibg=#656565 gui=none -hi Normal guifg=#f6f3e8 guibg=#242424 gui=none -hi NonText guifg=#f6f3e8 guibg=#242424 gui=none -"hi NonText guifg=#808080 guibg=#303030 gui=none -hi LineNr guifg=#857b6f guibg=#101010 gui=none -hi StatusLine guifg=#f6f3e8 guibg=#444444 gui=italic -hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none -hi VertSplit guifg=#444444 guibg=#444444 gui=none -hi Folded guibg=#384048 guifg=#a0a8b0 gui=none -hi Title guifg=#f6f3e8 guibg=NONE gui=bold -hi Visual guifg=#f6f3e8 guibg=#444444 gui=none -hi SpecialKey guifg=#808080 guibg=#343434 gui=none - -" Syntax highlighting -hi Comment guifg=#99968b gui=italic -hi Todo guibg=#242424 guifg=#F1D017 gui=italic,bold -"hi Todo guifg=#8f8f8f gui=italic -hi Constant guifg=#e5786d gui=none -hi String guifg=#46D020 gui=italic -hi Identifier guifg=#cae682 gui=none -hi Function guifg=#cae682 gui=none -hi Type guifg=#cae682 gui=none -hi Statement guifg=#8ac6f2 gui=none -hi Keyword guifg=#8ac6f2 gui=none -hi PreProc guifg=#e5786d gui=none -hi Number guifg=#e5786d gui=none -hi Special guifg=#e7f6da gui=none - - diff --git a/.vim/bundle/rbtweaks/doc/bufexplorer.txt b/.vim/bundle/rbtweaks/doc/bufexplorer.txt deleted file mode 100644 index b87f329cc..000000000 --- a/.vim/bundle/rbtweaks/doc/bufexplorer.txt +++ /dev/null @@ -1,502 +0,0 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 16 Feb 2010 - -Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.2.7 - -Plugin for easily exploring (or browsing) Vim |:buffers|. - -|bufexplorer-installation| Installation -|bufexplorer-usage| Usage -|bufexplorer-windowlayout| Window Layout -|bufexplorer-customization| Customization -|bufexplorer-changelog| Change Log -|bufexplorer-todo| Todo -|bufexplorer-credits| Credits - -For Vim version 7.0 and above. -This plugin is only available if 'compatible' is not set. - -{Vi does not have any of this} - -============================================================================== -INSTALLATION *bufexplorer-installation* - -To install: - - Download the bufexplorer.zip. - - Extract the zip archive into your runtime directory. - The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. - - Start Vim or goto an existing instance of Vim. - - Execute the following command: -> - :helptag /doc -< - This will generate all the help tags for any file located in the doc - directory. - -============================================================================== -USAGE *bufexplorer-usage* - -To start exploring in the current window, use: > - \be or :BufExplorer -To start exploring in a newly split horizontal window, use: > - \bs or :BufExplorerHorizontalSplit -To start exploring in a newly split vertical window, use: > - \bv or :BufExplorerVerticalSplit - -If you would like to use something other than '\', you may simply change the -leader (see |mapleader|). - -Note: If the current buffer is modified when bufexplorer started, the current - window is always split and the new bufexplorer is displayed in that new - window. - -Commands to use once exploring: - - Toggle help information. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor in another tab. - d |:delete|the buffer under the cursor from the list. The - buffer's 'buflisted' is cleared. This allows for the buffer to - be displayed again using the 'show unlisted' command. - R Toggles relative path/absolute path. - T Toggles to show only buffers for this tab or not. - D |:wipeout|the buffer under the cursor from the list. When a - buffers is wiped, it will not be shown when unlisted buffer are - displayed. - f Toggles whether you are taken to the active window when - selecting a buffer or not. - o Opens the buffer that is under the cursor into the current - window. - p Toggles the showing of a split filename/pathname. - q Quit exploring. - r Reverses the order the buffers are listed in. - s Selects the order the buffers are listed in. Either by buffer - number, file name, file extension, most recently used (MRU), or - full path. - t Opens the buffer that is under the cursor in another tab. - u Toggles the showing of "unlisted" buffers. - -Once invoked, Buffer Explorer displays a sorted list (MRU is the default -sort method) of all the buffers that are currently opened. You are then -able to move the cursor to the line containing the buffer's name you are -wanting to act upon. Once you have selected the buffer you would like, -you can then either open it, close it(delete), resort the list, reverse -the sort, quit exploring and so on... - -=============================================================================== -WINDOW LAYOUT *bufexplorer-windowlayout* - -------------------------------------------------------------------------------- -" Press for Help -" Sorted by mru | Locate buffer | Absolute Split path -"= - 01 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87 - 02 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1 -------------------------------------------------------------------------------- - | | | | | - | | | | +-- Current Line #. - | | | +-- Relative/Full Path - | | +-- Buffer Name. - | +-- Buffer Attributes. See|:buffers|for more information. - +-- Buffer Number. See|:buffers|for more information. - -=============================================================================== -CUSTOMIZATION *bufexplorer-customization* - - *g:bufExplorerDefaultHelp* -To control whether the default help is displayed or not, use: > - let g:bufExplorerDefaultHelp=0 " Do not show default help. - let g:bufExplorerDefaultHelp=1 " Show default help. -The default is to show the default help. - - *g:bufExplorerDetailedHelp* -To control whether detailed help is display by, use: > - let g:bufExplorerDetailedHelp=0 " Do not show detailed help. - let g:bufExplorerDetailedHelp=1 " Show detailed help. -The default is NOT to show detailed help. - - *g:bufExplorerFindActive* -To control whether you are taken to the active window when selecting a buffer, -use: > - let g:bufExplorerFindActive=0 " Do not go to active window. - let g:bufExplorerFindActive=1 " Go to active window. -The default is to be taken to the active window. - - *g:bufExplorerReverseSort* -To control whether to sort the buffer in reverse order or not, use: > - let g:bufExplorerReverseSort=0 " Do not sort in reverse order. - let g:bufExplorerReverseSort=1 " Sort in reverse order. -The default is NOT to sort in reverse order. - - *g:bufExplorerShowDirectories* -Directories usually show up in the list from using a command like ":e .". -To control whether to show directories in the buffer list or not, use: > - let g:bufExplorerShowDirectories=1 " Show directories. - let g:bufExplorerShowDirectories=0 " Don't show directories. -The default is to show directories. - - *g:bufExplorerShowRelativePath* -To control whether to show absolute paths or relative to the current -directory, use: > - let g:bufExplorerShowRelativePath=0 " Show absolute paths. - let g:bufExplorerShowRelativePath=1 " Show relative paths. -The default is to show absolute paths. - - *g:bufExplorerShowUnlisted* -To control whether to show unlisted buffer or not, use: > - let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. - let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. -The default is to NOT show unlisted buffers. - - *g:bufExplorerSortBy* -To control what field the buffers are sorted by, use: > - let g:bufExplorerSortBy='extension' " Sort by file extension. - let g:bufExplorerSortBy='fullpath' " Sort by full file path name. - let g:bufExplorerSortBy='mru' " Sort by most recently used. - let g:bufExplorerSortBy='name' " Sort by the buffer's name. - let g:bufExplorerSortBy='number' " Sort by the buffer's number. -The default is to sort by mru. - - *g:bufExplorerSplitBelow* -To control where the new split window will be placed above or below the -current window, use: > - let g:bufExplorerSplitBelow=1 " Split new window below current. - let g:bufExplorerSplitBelow=0 " Split new window above current. -The default is to use what ever is set by the global &splitbelow -variable. - - *g:bufExplorerSplitOutPathName* -To control whether to split out the path and file name or not, use: > - let g:bufExplorerSplitOutPathName=1 " Split the path and file name. - let g:bufExplorerSplitOutPathName=0 " Don't split the path and file - " name. -The default is to split the path and file name. - - *g:bufExplorerSplitRight* -To control where the new vsplit window will be placed to the left or right of -current window, use: > - let g:bufExplorerSplitRight=0 " Split left. - let g:bufExplorerSplitRight=1 " Split right. -The default is to use the global &splitright. - - *g:bufExplorerShowTabBuffer* -To control weither or not to show buffers on for the specific tab or not, use: > - let g:bufExplorerShowTabBuffer=0 " No. - let g:bufExplorerShowTabBuffer=1 " Yes. -The default is not to show. - -=============================================================================== -CHANGE LOG *bufexplorer-changelog* - -7.2.7 - Fix: - * My 1st attempt to fix the "cache" issue where buffers information - has changed but the cache/display does not reflect those changes. - More work still needs to be done. -7.2.6 - Fix: - * Thanks to Michael Henry for pointing out that I totally forgot to - update the inline help to reflect the previous change to the 'd' - and 'D' keys. Opps! -7.2.5 - Fix: - * Philip Morant suggested switching the command (bwipe) associated - with the 'd' key with the command (bdelete) associated with the 'D' - key. This made sense since the 'd' key is more likely to be used - compared to the 'D' key. -7.2.4 - Fix: - * I did not implement the patch provided by Godefroid Chapelle - correctly. I missed one line which happened to be the most - important one :) -7.2.3 - Enhancements: - * Thanks to David Fishburn for helping me out with a much needed - code overhaul as well as some awesome performance enhancements. - He also reworked the handling of tabs. - * Thanks to Vladimir Dobriakov for making the suggestions on - enhancing the documentation to include a better explaination of - what is contained in the main bufexplorer window. - * Thanks to Yuriy Ershov for added code that when the bufexplorer - window is opened, the cursor is now positioned at the line with the - active buffer (useful in non-MRU sort modes). - * Yuriy also added the abiltiy to cycle through the sort fields in - reverse order. - Fixes: - * Thanks to Michael Henry for supplying a patch that allows - bufexplorer to be opened even when there is one buffer or less. - * Thanks to Godefroid Chapelle for supplying a patch that fixed - MRU sort order after loading a session. -7.2.2 - Fixes: - * Thanks to David L. Dight for spotting and fixing an issue when - using ctrl^. bufexplorer would incorrectly handle the previous - buffer so that when ctrl^ was pressed the incorrect file was opened. -7.2.1 - Fixes: - * Thanks to Dimitar for spotting and fixing a feature that was - inadvertently left out of the previous version. The feature was - when bufexplorer was used together with WinManager, you could use - the tab key to open a buffer in a split window. -7.2.0 - Enhancements: - * For all those missing the \bs and \bv commands, these have now - returned. Thanks to Phil O'Connell for asking for the return of - these missing features and helping test out this version. - Fixes: - * Fixed problem with the bufExplorerFindActive code not working - correctly. - * Fixed an incompatibility between bufexplorer and netrw that caused - buffers to be incorrectly removed from the MRU list. -7.1.7 - Fixes: - * TaCahiroy fixed several issues related to opening a buffer in a - tab. -7.1.6 - Fixes: - * Removed ff=unix from modeline in bufexplorer.txt. Found by Bill - McCarthy. -7.1.5 - Fixes: - * Could not open unnamed buffers. Fixed by TaCahiroy. -7.1.4 - Fixes: - * Sometimes when a file's path has 'white space' in it, extra buffers - would be created containing each piece of the path. i.e: - opening c:\document and settings\test.txt would create a buffer - named "and" and a buffer named "Documents". This was reported and - fixed by TaCa Yoss. -7.1.3 - Fixes: - * Added code to allow only one instance of the plugin to run at a - time. Thanks Dennis Hostetler. -7.1.2 - Fixes: - * Fixed a jumplist issue spotted by JiangJun. I overlooked the - 'jumplist' and with a couple calls to 'keepjumps', everything is - fine again. - * Went back to just having a plugin file, no autoload file. By having - the autoload, WinManager was no longer working and without really - digging into the cause, it was easier to go back to using just a - plugin file. -7.1.1 - Fixes: - * A problem spotted by Thomas Arendsen Hein. - When running Vim (7.1.94), error E493 was being thrown. - Enhancements: - * Added 'D' for 'delete' buffer as the 'd' command was a 'wipe' - buffer. -7.1.0 - Another 'major' update, some by Dave Larson, some by me. - * Making use of 'autoload' now to make the plugin load quicker. - * Removed '\bs' and '\bv'. These are now controlled by the user. The - user can issue a ':sp' or ':vs' to create a horizontal or vertical - split window and then issue a '\be' - * Added handling of tabs. -7.0.17 - Fixed issue with 'drop' command. - Various enhancements and improvements. -7.0.16 - Fixed issue reported by Liu Jiaping on non Windows systems, which was - ... - Open file1, open file2, modify file1, open bufexplorer, you get the - following error: - - --------8<-------- - Error detected while processing function - 14_StartBufExplorer..14_SplitOpen: - line 4: - E37: No write since last change (add ! to override) - - But the worse thing is, when I want to save the current buffer and - type ':w', I get another error message: - E382: Cannot write, 'buftype' option is set - --------8<-------- - -7.0.15 - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle - the ':args' command. -7.0.14 - Thanks to Randall Hansen for removing the requirement of terminal - versions to be recompiled with 'gui' support so the 'drop' command - would work. The 'drop' command is really not needed in terminal - versions. -7.0.13 - Fixed integration with WinManager. - Thanks to Dave Eggum for another update. - - Fix: The detailed help didn't display the mapping for toggling - the split type, even though the split type is displayed. - - Fixed incorrect description in the detailed help for toggling - relative or full paths. - - Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same - thing. - - Created a s:Set() function that sets a variable only if it hasn't - already been defined. It's useful for initializing all those - default settings. - - Removed checks for repetitive command definitions. They were - unnecessary. - - Made the help highlighting a little more fancy. - - Minor reverse compatibility issue: Changed ambiguous setting - names to be more descriptive of what they do (also makes the code - easier to follow): - Changed bufExplorerSortDirection to bufExplorerReverseSort - Changed bufExplorerSplitType to bufExplorerSplitVertical - Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow - - When the BufExplorer window closes, all the file-local marks are - now deleted. This may have the benefit of cleaning up some of the - jumplist. - - Changed the name of the parameter for StartBufExplorer from - "split" to "open". The parameter is a string which specifies how - the buffer will be open, not if it is split or not. - - Deprecated DoAnyMoreBuffersExist() - it is a one line function - only used in one spot. - - Created four functions (SplitOpen(), RebuildBufferList(), - UpdateHelpStatus() and ReSortListing()) all with one purpose - to - reduce repeated code. - - Changed the name of AddHeader() to CreateHelp() to be more - descriptive of what it does. It now returns an array instead of - updating the window directly. This has the benefit of making the - code more efficient since the text the function returns is used a - little differently in the two places the function is called. - - Other minor simplifications. -7.0.12 - MAJOR Update. - This version will ONLY run with Vim version 7.0 or greater. - Dave Eggum has made some 'significant' updates to this latest - version: - - Added BufExplorerGetAltBuf() global function to be used in the - user’s rulerformat. - - Added g:bufExplorerSplitRight option. - - Added g:bufExplorerShowRelativePath option with mapping. - - Added current line highlighting. - - The split type can now be changed whether bufexplorer is opened - in split mode or not. - - Various major and minor bug fixes and speed improvements. - - Sort by extension. - Other improvements/changes: - - Changed the help key from '?' to to be more 'standard'. - - Fixed splitting of vertical bufexplorer window. - Hopefully I have not forgot something :) -7.0.11 - Fixed a couple of highlighting bugs, reported by David Eggum. He also - changed passive voice to active on a couple of warning messages. -7.0.10 - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set, - the slash character used when displaying the path was incorrect. -7.0.9 - Martin Grenfell found and eliminated an annoying bug in the - bufexplorer/winmanager integration. The bug was were an - annoying message would be displayed when a window was split or - a new file was opened in a new window. Thanks Martin! -7.0.8 - Thanks to Mike Li for catching a bug in the WinManager integration. - The bug was related to the incorrect displaying of the buffer - explorer's window title. -7.0.7 - Thanks to Jeremy Cowgar for adding a new enhancement. This - enhancement allows the user to press 'S', that is capital S, which - will open the buffer under the cursor in a newly created split - window. -7.0.6 - Thanks to Larry Zhang for finding a bug in the "split" buffer code. - If you force set g:bufExplorerSplitType='v' in your vimrc, and if you - tried to do a \bs to split the bufexplorer window, it would always - split horizontal, not vertical. He also found that I had a typeo in - that the variable g:bufExplorerSplitVertSize was all lower case in - the documentation which was incorrect. -7.0.5 - Thanks to Mun Johl for pointing out a bug that if a buffer was - modified, the '+' was not showing up correctly. -7.0.4 - Fixed a problem discovered first by Xiangjiang Ma. Well since I've - been using vim 7.0 and not 6.3, I started using a function (getftype) - that is not in 6.3. So for backward compatibility, I conditionaly use - this function now. Thus, the g:bufExplorerShowDirectories feature is - only available when using vim 7.0 and above. -7.0.3 - Thanks to Erwin Waterlander for finding a problem when the last - buffer was deleted. This issue got me to rewrite the buffer display - logic (which I've wanted to do for sometime now). - Also great thanks to Dave Eggum for coming up with idea for - g:bufExplorerShowDirectories. Read the above information about this - feature. -7.0.2 - Thanks to Thomas Arendsen Hein for finding a problem when a user - has the default help turned off and then brought up the explorer. An - E493 would be displayed. -7.0.1 - Thanks to Erwin Waterlander for finding a couple problems. - The first problem allowed a modified buffer to be deleted. Opps! The - second problem occurred when several files were opened, BufExplorer - was started, the current buffer was deleted using the 'd' option, and - then BufExplorer was exited. The deleted buffer was still visible - while it is not in the buffers list. Opps again! -7.0.0 - Thanks to Shankar R. for suggesting to add the ability to set - the fixed width (g:bufExplorerSplitVertSize) of a new window - when opening bufexplorer vertically and fixed height - (g:bufExplorerSplitHorzSize) of a new window when opening - bufexplorer horizontally. By default, the windows are normally - split to use half the existing width or height. -6.3.0 - Added keepjumps so that the jumps list would not get cluttered with - bufexplorer related stuff. -6.2.3 - Thanks to Jay Logan for finding a bug in the vertical split position - of the code. When selecting that the window was to be split - vertically by doing a '\bv', from then on, all splits, i.e. '\bs', - were split vertically, even though g:bufExplorerSplitType was not set - to 'v'. -6.2.2 - Thanks to Patrik Modesto for adding a small improvement. For some - reason his bufexplorer window was always showing up folded. He added - 'setlocal nofoldenable' and it was fixed. -6.2.1 - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting - logic and option. -6.2.0 - Thanks goes out to Simon Johann-Ganter for spotting and fixing a - problem in that the last search pattern is overridden by the search - pattern for blank lines. -6.1.6 - Thanks to Artem Chuprina for finding a pesky bug that has been around - for sometime now. The key mapping was causing the buffer - explored to close prematurely when vim was run in an xterm. The - key mapping is now removed. -6.1.5 - Thanks to Khorev Sergey. Added option to show default help or not. -6.1.4 - Thanks goes out to Valery Kondakoff for suggesting the addition of - setlocal nonumber and foldcolumn=0. This allows for line numbering - and folding to be turned off temporarily while in the explorer. -6.1.3 - Added folding. Did some code cleanup. Added the ability to force the - newly split window to be temporarily vertical, which was suggested by - Thomas Glanzmann. -6.1.2 - Now pressing the key will quit, just like 'q'. - Added folds to hide winmanager configuration. - If anyone had the 'C' option in their cpoptions they would receive - a E10 error on startup of BufExplorer. cpo is now saved, updated and - restored. Thanks to Charles E Campbell, Jr. - Attempted to make sure there can only be one BufExplorer window open - at a time. -6.1.1 - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This - way buffers sorted by name will be in the correct order regardless of - case. -6.0.16 - Thanks to Andre Pang for the original patch/idea to get bufexplorer - to work in insertmode/modeless mode (evim). Added Initialize - and Cleanup autocommands to handle commands that need to be - performed when starting or leaving bufexplorer. -6.0.15 - Srinath Avadhanulax added a patch for winmanager.vim. -6.0.14 - Fix a few more bug that I thought I already had fixed. Thanks - to Eric Bloodworth for adding 'Open Mode/Edit in Place'. Added - vertical splitting. -6.0.13 - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing - typos that I had in the documentation. I guess I need to run - the spell checker more :o) -6.0.12 - Thanks to Madoka Machitani, for the tip on adding the augroup command - around the MRUList autocommands. -6.0.11 - Fixed bug report by Xiangjiang Ma. '"=' was being added to the - search history which messed up hlsearch. -6.0.10 - Added the necessary hooks so that the Srinath Avadhanula's - winmanager.vim script could more easily integrate with this script. - Tried to improve performance. -6.0.9 - Added MRU (Most Recently Used) sort ordering. -6.0.8 - Was not resetting the showcmd command correctly. - Added nifty help file. -6.0.7 - Thanks to Brett Carlane for some great enhancements. Some are added, - some are not, yet. Added highlighting of current and alternate - filenames. Added splitting of path/filename toggle. Reworked - ShowBuffers(). - Changed my email address. -6.0.6 - Copyright notice added. Needed this so that it could be distributed - with Debian Linux. Fixed problem with the SortListing() function - failing when there was only one buffer to display. -6.0.5 - Fixed problems reported by David Pascoe, in that you where unable to - hit 'd' on a buffer that belonged to a files that no longer existed - and that the 'yank' buffer was being overridden by the help text when - the bufexplorer was opened. -6.0.4 - Thanks to Charles Campbell, Jr. for making this plugin more plugin - *compliant*, adding default keymappings of be and bs - as well as fixing the 'w:sortDirLabel not being defined' bug. -6.0.3 - Added sorting capabilities. Sort taken from explorer.vim. -6.0.2 - Can't remember. (2001-07-25) -6.0.1 - Initial release. - -=============================================================================== -TODO *bufexplorer-todo* - -- Nothing as of now, buf if you have any suggestions, drop me an email. - -=============================================================================== -CREDITS *bufexplorer-credits* - -Author: Jeff Lanzarotta - -Credit must go out to Bram Moolenaar and all the Vim developers for -making the world's best editor (IMHO). I also want to thank everyone who -helped and gave me suggestions. I wouldn't want to leave anyone out so I -won't list names. - -=============================================================================== -vim:tw=78:noet:wrap:ts=8:ft=help:norl: diff --git a/.vim/bundle/rbtweaks/doc/csupport.txt b/.vim/bundle/rbtweaks/doc/csupport.txt deleted file mode 100644 index 615279ebc..000000000 --- a/.vim/bundle/rbtweaks/doc/csupport.txt +++ /dev/null @@ -1,2152 +0,0 @@ -*csupport.txt* C/C++ Support February 05 2010 - -C/C++ Support *c-support* *csupport* - Plugin version 5.10 - for Vim version 7.0 and above - Fritz Mehner - -C/C++-IDE for Vim/gVim. It is written to considerably speed up writing code in -a consistent style. This is done by inserting complete statements,idioms, -code snippets, templates, and comments. Syntax checking, compiling, running -a program, running a code checker or a reformatter can be done with a -keystroke. - - 1. Usage |csupport-usage-gvim| - 1.1 Menu 'Comments' |csupport-comm| - 1.1.1 Append aligned comments |csupport-comm-aligned| - 1.1.2 Adjust end-of-line comments |csupport-comm-realign| - 1.1.3 Code to comment |csupport-code-to-comm| - 1.1.4 Comment to code |csupport-comm-to-code| - 1.1.5 Frame comments, file header, ... |csupport-comm-frame| - 1.1.6 File section comments .. |csupport-comm-sections| - 1.1.7 Keyword comment, special comment |csupport-comm-keyword| - 1.1.8 Tags (plugin) |csupport-comm-tags| - 1.1.9 Date and date+time |csupport-comm-date| - 1.1.10 C to C++ comments and vice versa |csupport-comm-c-cpp| - 1.2 Menu 'Statements' |csupport-stat| - 1.2.1 Normal mode, insert mode. |csupport-stat-normal-mode| - 1.2.2 Visual mode. |csupport-stat-visual-mode| - 1.3 Menu 'Preprocessor' |csupport-prep| - 1.3.1 Normal mode, insert mode. |csupport-prep-normal-mode| - 1.3.2 Visual mode. |csupport-prep-visual-mode| - 1.3.3 Block out code with #if 0 .. #endif |csupport-prep-if0| - 1.3.4 Ex-commands |csupport-prep-ex| - 1.4 Menu 'Idioms' |csupport-idioms| - 1.4.1 Item 'function' |csupport-idioms-function| - 1.4.2 for-loop control |csupport-idioms-for-loop| - 1.4.3 Item 'open input file' |csupport-idioms-input| - 1.4.4 Item 'open output file' |csupport-idioms-output| - 1.5 Menu 'Snippets' |csupport-snippets| - 1.5.1 Code snippets |csupport-snippets| - 1.5.2 Picking up prototypes |csupport-proto| - 1.5.3 Code templates |csupport-templates-menu| - 1.6 Menu 'C++' |csupport-c++| - 1.6.1 Normal mode, insert mode. |csupport-c++-normal-mode| - 1.6.2 Visual mode. |csupport-c++-visual-mode| - 1.6.3 Method implementation |csupport-c++-method-impl| - 1.6.4 Ex commands |csupport-c++-ex| - 1.7 Menu 'Run' |csupport-run| - 1.7.1 Minimal make functionality |csupport-run-buffer| - 1.7.2 Command line arguments |csupport-run-cmdline-args| - 1.7.3 Run make |csupport-run-make| - 1.7.4 Command line arguments for make |csupport-run-make-args| - 1.7.5 Splint |csupport-run-splint| - 1.7.6 CodeCheck |csupport-run-codecheck| - 1.7.7 Indent |csupport-run-indent| - 1.7.8 Hardcopy |csupport-run-hardcopy| - 1.7.9 Rebuild templates |csupport-run-templates| - 1.7.10 Xterm size |csupport-run-xterm| - 1.7.11 Output redirection |csupport-run-output| - 1.8 Help |csupport-help| - - 2. Usage without GUI |csupport-usage-vim| - 3. Hotkeys |csupport-hotkeys| - 4. Customization and configuration |csupport-custom| - 4.1 Global variables |csupport-custom-glob-vars| - 4.2 The root menu |csupport-custom-root-menu| - 4.3 System-wide installation |csupport-system-wide| - 5. Template files and tags |csupport-templates| - 5.1 Template files |csupport-templates-files| - 5.2 Macros |csupport-templates-macros| - 5.2.1 User defined formats for date and time |csupport-templates-date| - 5.3 Templates |csupport-templates-names| - 5.3.1 Template names |csupport-templates-names| - 5.3.2 Template definition |csupport-templates-definition| - 5.3.3 Template expansion |csupport-templates-expansion| - 5.3.4 The macros <+text+> etc. |csupport-templates-jump| - 5.3.5 Command Ctrl-j |csupport-Ctrl-j| - 5.4 Switching between template sets |csupport-templates-sets| - 5.5 Binding a style to a file extension |csupport-templates-bind| - 6. C/C++ Dictionaries |csupport-dictionary| - 7. Extend ctags |csupport-ctags| - 7.1 Make and qmake |csupport-ctags-make| - 7.2 Templates |csupport-ctags-templates| - 8. Folding |csupport-folding| - 9 Additional Mappings |csupport-ad-mappings| - 10. Windows particularities |csupport-windows| - 11. Additional tips |csupport-tips| - 12. Troubleshooting |csupport-troubleshooting| - 13. Release Notes /Change Log |csupport-release-notes| - - How to add this help file to Vim's help |add-local-help| - - -============================================================================== -1. USAGE WITH GUI (gVim) *csupport-usage-gvim* -============================================================================== - -If the root menu 'C/C++' is not visible call it with the item "Load C Support" -from the standard Tools-menu. -The item "Load C Support" can also be used to unload the C/C++-root menu. - -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements (see|csupport-templates|). - ------------------------------------------------------------------------------- -1.1 MENU 'Comments' *csupport-comm* ------------------------------------------------------------------------------- - -1.1.1 APPEND ALIGNED COMMENTS TO CONSECUTIVE LINES *csupport-comm-aligned* - -In NORMAL MODE the menu items 'end-of-line comment' will append an comment to -the current line. -In VISUAL MODE these item will append aligned comments to all marked lines. -Marking the first 4 lines - - print_double_array ( double array[], - int n, - int columns, - char* arrayname - ) - -and choosing 'end-of-line com. /**/' will yield. - - print_double_array ( double array[], /* */ - int n, /* */ - int columns, /* */ - char* arrayname /* */ - ) /* */ - -If one ore more lines go beyond the starting column (s.below) the comments -will start at the 2. column after the longest line. The cursor will be -positioned inside the first comment. - -The default starting column is 49 ( = (multiple of 2,4, or 8) + 1 ). This can -be changed by setting a global variable in the file ~/.vimrc , e.g. : - - let g:C_LineEndCommColDefault = 45 - -The starting column can also be set by the menu item -'Comments->set end-of-line com. col' . Just position the cursor in an -arbitrary column (column number is shown in the Vim status line) and choose -this menu item. This setting is buffer related. - -If the cursor was at the end of a line you will be asked for a column number -because this position is most likely not the desired starting column. -Your choice will be confirmed. - ------------------------------------------------------------------------------- - -1.1.2 ADJUST END-OF-LINE COMMENTS *csupport-comm-realign* - -After some changes end-of-line comments may be no longer aligned: - - print_double_array ( double array[], /* */ - long int n, /* */ - unsigned int columns, /* */ - char* a_name /* */ - ) /* */ - -Realignment can be achieved with the menu item 'adjust end-of-line com.' In -normal mode the comment (if any) in the current line will be aligned to the -end-of-line comment column (see above) if possible. In visual mode the -comments in the marked block will be aligned: - - print_double_array ( double array[], /* */ - long int n, /* */ - unsigned int columns, /* */ - char* a_name /* */ - ) /* */ - -The realignment will not be done for comments with nothing else than leading -whitespaces. These comments are usually captions: - - max = other.max; /* the maximum value */ - len = other.len; /* the length */ - /* ===== the next section ===== */ - pos = (x+y+z)/3.0; /* the next position */ - -After the alignment we have: - - max = other.max; /* the maximum value */ - len = other.len; /* the length */ - /* ===== the next section ===== */ - pos = (x+y+z)/3.0; /* the next position */ - ------------------------------------------------------------------------------- - -1.1.3 CODE TO COMMENT *csupport-code-to-comm* - -The marked block - -xxxxxxxx -xxxxxxxx -xxxxxxxx - -will be changed by the menu item 'code->comment /**/' into the multiline -comment (all (partially) marked lines): - -/* xxxxxxxx - * xxxxxxxx - * xxxxxxxx - */ - -The marked block will be changed by the menu item 'code->comment //' into the -multiline comment - -//xxxxxxxx -//xxxxxxxx -//xxxxxxxx - -The menu items works also for a single line. A single line needs not to be -marked. - ------------------------------------------------------------------------------- - -1.1.4 COMMENT TO CODE *csupport-comm-to-code* - -If one (or more) complete comment (i.e. all lines belonging to the comment) is -marked the item 'comment->code' will uncomment it. If the following lines -are marked - - * printf ("\n"); - */ - - printf ("\n"); - - // printf ("\n"); - // - - /* - * printf ("\n"); - */ - -uncommenting will yield - - * printf ("\n"); - */ - - printf ("\n"); - - printf ("\n"); - - - - printf ("\n"); - -The first 2 lines are only a part of a C-comment and remain unchanged. -A C-comment can start with /* , /** or /*! . - -The menu item works also for a single line with a leading // . A single line -needs not to be marked. - ------------------------------------------------------------------------------- - -1.1.5 FRAME COMMENTS, FILE HEADER, ... *csupport-comm-frame* - -Frame comments, file header comments and function, methods, class descriptions -are read as templates from the appropriate files (see |csupport-templates|). - -There are to file description templates (menu items 'file description (impl.)' -and 'file description (header)', see also |csupport-templates|): - - comment.file-description : files *.c *.cc *.cp *.cxx *.cpp *.CPP *.c++ - *.C *.i *.ii - - comment.file-description-header : everything else with filetype 'c' or 'cpp' - -The appropriate template will also be included into a new file. The plugin -decides on the basis of the file extension. The default is shown above. You -can change the list by setting a global variable in '~/.vimrc': - - au BufRead,BufNewFile *.XYZ set filetype=c - - let g:C_SourceCodeExtensions = 'XYZ c cc cp cxx cpp CPP c++ C i ii' - -A new file named 'test.XYZ' will now be considered a C implementation file. - ------------------------------------------------------------------------------- - -1.1.6 FILE SECTION COMMENTS *csupport-comm-sections* - -File section comments can be uses to separate typical C- and H-file sections -with comments of similar appearance, e.g. - -/* ##### HEADER FILE INCLUDES ################################################### */ - -/* ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### */ - -/* ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### */ - -These section comments can also be inserted using the hotkey \ccs for C/C++ -files, or \chs for H-files. These hotkeys will start the command -'CFileSection' or 'HFileSection' on the command line: - - :CFileSection - :HFileSection - -Now type a to start the selection menu to choose from. - ------------------------------------------------------------------------------- - -1.1.7 KEYWORD COMMENT, SPECIAL COMMENT *csupport-comm-keyword* - -Keword comments are end-of-line comments: - - /* :::: */ - -Keywords are - - BUG COMPILER TODO TRICKY WARNING WORKAROUND user-defined-keyword - -These are preliminary comments to document places where works will be resumed -shortly. They are usually not meant for the final documentation. These -comments are easily found by searching for the keyword. -The keyword comments can also be inserted using the hotkey \ckc . This hotkey -starts the command 'KeywordComment' on the command line: - - :KeywordComment - -Now type a to start the selection menu to choose from. - -Special comments are occasionally used to mark special features of a code -construct (e.g. a fall through cases in a switch statement, an empty loop): - - /* EMPTY */ - /* NOT REACHED */ - /* REMAINS TO BE IMPLEMENTED */ - .... - -The special comments can also be inserted using the hotkey \csc . This hotkey -starts the command 'SpecialComment' on the command line: - - :SpecialComment - -Now type a to start the selection menu to choose from. - ------------------------------------------------------------------------------- - -1.1.8 TAGS (PLUGIN) *csupport-comm-tags* - -The submenu 'tags (plugin)' let you insert the predefined macros from the -template system (see|csupport-templates-macros|). In visual mode the marked -string will be replaced by the macro. - ------------------------------------------------------------------------------- - -1.1.9 DATE AND DATE+TIME *csupport-comm-date* - -The format for 'date' and 'date time' can be defined by the user (see -|csupport-templates-date|). In visual mode the marked string will be replaced -by the macro (e.g. to update date and time). - ------------------------------------------------------------------------------- - -1.1.10 C TO C++ COMMENTS AND VICE VERSA *csupport-comm-c-cpp* - -The menu item '// xxx -> /* xxx */' changes a C++ comment into an C comment. -This is done for the current line in normal or insert mode and for a marked -area of lines in visual mode. -If there are multiple C comments only the first one will be changed: - printf ("\n"); /* one */ /* two */ /* three */ -will be changed into - printf ("\n"); // one /* two */ /* three */ - -The menu item '/* xxx */ -> // xxx' changes a C comment into an C++ comment. - ------------------------------------------------------------------------------- -1.2 MENU 'Statements' *csupport-stat* ------------------------------------------------------------------------------- - -1.2.1 NORMAL MODE, INSERT MODE. *csupport-stat-normal-mode* - -An empty statement will be inserted and properly indented. The item 'if{}' -will insert an if-statement: - -if ( ) -{ -} - - -1.2.2 VISUAL MODE. *csupport-stat-visual-mode* - -STATEMENTS WITH BLOCKS AND CASE LABEL. --------------------------------------- -The highlighted area - -xxxxx -xxxxx - -can be surrounded by one of the following statements: - - +----------------------------+-----------------------------+ - | if ( ) | if ( ) | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - | | else | - | | { | - | | } | - +----------------------------+-----------------------------+ - | for ( ; ; ) | while ( ) | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - +----------------------------+-----------------------------+ - | do | | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - | while ( ); | | - +----------------------------+-----------------------------+ - | switch ( ) { | - | case : | - | break; | - | | - | case : | - | break; | - | | - | case : | - | break; | - | | - | case : | - | break; | - | | - | default: | - | break; | - | } | - +----------------------------+-----------------------------+ - -The whole statement will be indented after insertion. - - -STATEMENTS WITHOUT BLOCKS. --------------------------- -One of the following statements can be inserted: - - +-------------------------------+--------------------------+ - | if ( ) | for ( ; ; ) | - +-------------------------------+--------------------------+ - | if ( ) | while ( ) | - | else | | - +-------------------------------+--------------------------+ - | case : | | - | break; | | - +-------------------------------+--------------------------+ - - ------------------------------------------------------------------------------- -1.3 MENU 'Preprocessor' *csupport-prep* ------------------------------------------------------------------------------- - -1.3.1 NORMAL MODE, INSERT MODE. *csupport-prep-normal-mode* - -The preprocessor statements will be inserted and properly indented. - -1.3.2 VISUAL MODE. *csupport-prep-visual-mode* - -STATEMENTS WITH BLOCKS ----------------------- -The highlighted area - -xxxxx -xxxxx - -can be surrounded by one of the following statements: - - +----------------------------+-----------------------------+ - | #if CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #if CONDITION ----- */ | - | | - | #endif /* ----- #if CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifdef CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #ifdef CONDITION ----- */ | - | | - | #endif /* ----- #ifdef CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifndef CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #ifndef CONDITION ----- */ | - | | - | #endif /* ----- #ifndef CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifndef INC_TEST | - | #define INC_TEST | - | xxxxx | - | xxxxx | - | #endif /* ----- #ifndef INC_TEST ----- */ | - +----------------------------------------------------------+ - | #if 0 /* ----- #if 0 : If0Label_1 ----- */ | - | | - | #endif /* ----- #if 0 : If0Label_1 ----- */ | - +----------------------------------------------------------+ - -The macro name for an include guard (e.g. INC_TEST above) will be derived as a -suggestion from the file name. - -1.3.3 BLOCK OUT CODE WITH #if 0 ... #endif *csupport-prep-if0* - -The menu item #if 0 #endif inserts the lines - - #if 0 /* ----- #if 0 : If0Label_1 ----- */ - - #endif /* ----- #if 0 : If0Label_1 ----- */ - -In visual mode the marked block of lines will be surrounded by these lines. - -This is usually done to temporarily block out some code. The label names like -If0Label_1 are automatically inserted into the comments. The trailing numbers -are automatically incremented. These numbers can be changed by the user. The -next number will be one above the highest number found in the current buffer. - -A corresponding label can be found by searching with the vim star command (*). -All labels can be found with a global search like :g/If0Label_/ or -:g/If0Label_\d\+/. All corresponding lines can be deleted with :g/If0Label_/d . - - -REMOVE THE ENCLOSING #if 0 ... #endif -CONSTRUCT. - -The menu item 'remove #if #endif' removes such a construct if the cursor is -in the middle of such a section or on one of the two enclosing lines. Nested -constructs will be untouched. - -1.3.4 EX-COMMANDS *csupport-prep-ex* - -There are 4 additional Ex command which can be used to insert include -statements: - - Ex command hotkey includes - ------------------------------------------------------------------------- - :IncludeStdLibrary \ps C standard library - :IncludeC99Library \pc C99 library - :IncludeCppLibrary \+ps C++ standard library - :IncludeCppCLibrary \+pc C standard library ( #include ) - -Type :Inc and choose one of the commands. Now type an additional space -and a to show the whole list list or type a space and a few leading -characters to reduce this list. - ------------------------------------------------------------------------------- -1.4 MENU 'Idioms' *csupport-idioms* ------------------------------------------------------------------------------- - -1.4.1 Item 'function' *csupport-idioms-function* - -NORMAL MODE, INSERT MODE: -The name of the function is asked for and the following lines (for function -name "f") will be inserted: - - void - f ( ) - { - return ; - } /* ---------- end of function f ---------- */ - -VISUAL MODE: -Main or [static] function: the highlighted lines will go inside the new -function or main. -for-loops: the highlighted lines will be set in braces. - -1.4.2 for-loop control *csupport-idioms-for-loop* - -The menu items 'for( x=0; ... )' and 'for( x=n-1; ... )' can be used to write -the control statement for a for-loop counting upward or downward. These items -start an input dialog - - [TYPE (expand)] VARIABLE [START [END [INCR.]]] : - -asking for at least the name of the loop variable. The other parameters are -optional. The type is restricted to the following integral data types: - - char - int - long int - long - short int - short - size_t - unsigned char - unsigned int - unsigned long int - unsigned long - unsigned short int - unsigned short - unsigned - -One of these types can be specified by typing it completely or by typing zero -or more characters of its name and completing them to the full name by using -the tab key (tab completion). If the start of the type name is ambiguous (e.g. -'uns') a list of completion candidates is provided to choose from. - -1.4.3 Item 'open input file' *csupport-idioms-input* - -The item 'open input file' will create the statements to open and close an -input file (e.g. with the file pointer 'infile'). - -1.4.4 Item 'open output file' *csupport-idioms-output* - -The item 'open output file' will create the statements to open and close an -output file (e.g. with the file pointer 'outfile'). - ------------------------------------------------------------------------------- -1.5 MENU 'Snippets' *csupport-snippets* ------------------------------------------------------------------------------- - -1.5.1 CODE SNIPPETS - -Code snippets are pieces of code which are kept in separate files in a special -directory (e.g. a few lines of code or a complete template for a Makefile). -File names are used to identify the snippets. The snippet directory will be -created during the installation ( $HOME/.vim/codesnippets-c is the default). -Snippets are managed with the 3 items - - C/C++ -> Snippets -> read code snippet - C/C++ -> Snippets -> write code snippet - C/C++ -> Snippets -> edit code snippet - -from the Snippets submenu. - -CREATING A NEW SNIPPET -When nothing is marked, "write code snippet" will write the whole buffer -to a snippet file, otherwise the marked area will be written to a file. - -INSERT A SNIPPET -Select the appropriate file from the snippet directory ("read code snippet"). -The inserted lines will be indented. - -EDIT A SNIPPET -This is a normal edit. - -INDENTATION / NO INDENTATION -Code snippets are normally indented after insertion. To suppress indentation -add the file extension "ni" or "noindent" to the snippet file name, e.g. - - parameter_handling.c.noindent - -Snippet browser ---------------- -Under a GUI a file requester will be put up. Without GUI the filename will be -read from the command line. You can change this behavior by setting a global -variable in your ~/.vimrc : - - let g:C_GuiSnippetBrowser = 'commandline' - -The default value is 'gui'. - - -1.5.2 PICKING UP PROTOTYPES *csupport-proto* - -PICK UP PROTOTYPES. -To make a prototype from a function head mark the function head and choose -'Snippets -> pick up prototype'. From the first six lines of - - void - print_double_array ( double array[], /* array to print */ - int n, /* number of elements to print */ - int columns, /* number of elements per column */ - char* arrayname /* array name */ - ) - { - ... - } /* ---------- end of function print_double_array ---------- */ - -the prototype - - void print_double_array ( double array[], int n, int columns, char* arrayname ); - -is produced and put in an internal buffer. -- Leading and trailing whitespaces are removed. -- All inner whitespaces are squeezed. -- All comments will be discarded. -- Trailing parts of the function body (e.g a '{' ) will also be removed. -- The class name and the scope resolution operator will be removed (C++ method - implementations). -Further prototypes can be picked up and gathered in the buffer. - -For C++ methods namespace names and class names will be removed -(exception: 'std::' ). The first two lines of - - std::string - ROBOT::Robot::get_name ( void ) - { - return type_name; - } /* ----- end of method Robot::get_name ----- */ - -result in the prototype - - std::string get_name ( void ); - -Folding may help picking up prototypes (see |csupport-folding|). - - -INSERT PROTOTYPES -With 'Snippets -> insert prototype(s)' all picked up prototypes currently in -the buffer will be inserted below the cursor. -The prototype buffer will be cleared after insertion. - - -DISCARD PROTOTYPES -The prototype buffer can be cleared with 'Snippets -> clear prototype(s)' . - - -SHOW PROTOTYPES -The list of gathered prototypes can be shown with -'Snippets -> show prototype(s)'. The number and the filename are shown, e.g. - - (1) matrix.c # double** calloc_double_matrix ( int rows, int columns ); - (2) matrix.c # void free_double_matrix ( double **m ); - (3) foomain.c # void foo ( ); - - -REMARK. Generating prototypes this way is nice in a small project. You may -want to use an extractor like cextract or something else. - - -1.5.3 Code Templates *csupport-templates-menu* ---------------------- -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements (see|csupport-templates|on how to use the template system). - -The menu item 'edit local templates' opens the main template file in a local -plugin installation. This is usually the file -'~/.vim/c-support/templates/Templates'. There may be dependent files -loaded from the main file. Now change whatever file you want, save it, and -click on the menu item 'reread templates' to read in the file(s) and to -rebuild the internal representation of the templates. - -The menu item 'edit global templates' opens the main template file in a -system-wide plugin installation (see |csupport-system-wide|). This is -usually the file '$VIM./vimfiles/c-support/templates/Templates'. - -Template browser ----------------- -Under a GUI a file requester will be put up. Without GUI the filename will be -read from the command line. You can change this behavior by setting a global -variable in your ~/.vimrc : - - let g:C_GuiTemplateBrowser = 'explorer' - -The default value is 'gui'. 'explorer' will start the file explorer -(see help|:Explore|). To use the commandline asign 'commandline'. - ------------------------------------------------------------------------------- -1.6 MENU 'C++' *csupport-c++* ------------------------------------------------------------------------------- - -1.6.1 NORMAL MODE, INSERT MODE. *csupport-c++-normal-mode* - -An empty statement will be inserted and in some cases properly indented. The -item 'try .. catch' will insert the following lines: - - try { - } - catch ( const &ExceptObj ) { // handle exception: - } - catch (...) { // handle exception: unspecified - } - -The cursor will go into the try block. - -1.6.2 VISUAL MODE. *csupport-c++-visual-mode* - -The highlighted area can be surrounded by one of the following statements: - - try - catch - catch - catch(...) - namespace { } - extern "C" { } - -The whole statement will be indented after insertion. - -1.6.3 METHOD IMPLEMENTATION *csupport-c++-method-impl* - -The menu item 'method implement.' asks for a method name. If this item is -called the first time you will see just an scope resolution operator. If you -specify the scope this is used the next time you call this item. If you use -one of the menu items to generate a class (see |csupport-templates|) the -scope will be extracted and used for the next method. - -1.6.4 EX COMMANDS *csupport-c++-ex* - -There are 4 additional Ex command which can be used to insert include -statements. Please see |csupport-prep-ex|. - ------------------------------------------------------------------------------- -1.7 MENU 'Run' *csupport-run* ------------------------------------------------------------------------------- - -1.7.1 MINIMAL MAKE FUNCTIONALITY *csupport-run-buffer* - -The 'Run' menu provides a minimal make functionality for single file projects -(e.g. in education) : - -SAVE AND COMPILE -'save and compile' saves the buffer and run the compiler with the given -options (see |csupport-custom-glob-vars|). - -An error window will be opened if the compiler reports errors and/or warnings. -Quickfix commands can now be used to jump to an error location. - -Consider using maps like - map :cprevious - map :cnext -in your ~/.vimrc file to jump over the error locations and make navigation -easier. The error list and the error locations in your source buffer will be -synchronized. - - -LINK -'link' makes an executable from the current buffer. If the buffer is not -saved, or no object is available or the object is older then the source step -'save and compile' is executed first. - -The behavior of the compiler / linker is determined by the options assigned to -the variables described in |csupport-custom-glob-vars| (4.group). - -RUN -'run' runs the executable with the same name (extension .e) as the current -buffer. If the buffer is not saved, or no executable is available or the -executable is older then the source steps 'save and compile' and 'link' are -executed first. - - -1.7.2 COMMAND LINE ARGUMENTS *csupport-run-cmdline-args* - -The item 'command line arguments' calls an input dialog which asks for command -line arguments. These arguments are forwarded to the program which is run by -the 'run' item. The arguments are kept until you change them. -For the first and only the first argument file name expansion will work (use -the Tab-key). Only the first string of the input can be expanded due to a -restriction of the Vim input function. To expand two or more filenames -specify them in reverse order: type the first characters of the last filename -and expand them. Go to the start of the input and type the beginning of the -last but one filename and expand it. - -The arguments belong to the current buffer (that is, each buffer can have its -own arguments). -If the buffer gets a new name with "save as" the arguments will now belong to -the buffer with the new name. - -The command line arguments can be followed by pipes and redirections: - - 11 22 | sort -rn | head -10 > out - -Caveat: If you look for the current arguments by calling this menu item again -be sure to leave it with a CR (not Esc !). Due to a limitation of an internal -Vim function CR will keep the arguments, Esc will discard them. - - -1.7.3 RUN make *csupport-run-make* - -The item 'make' runs the external make program. - - -1.7.4 COMMAND LINE ARGUMENTS FOR make *csupport-run-make-args* - -The item 'command line arguments for make' calls an input dialog which asks -for command line arguments for make. These arguments are forwarded to make -when called by the item 'make'. - - -1.7.5 SPLINT *csupport-run-splint* - -Splint is a tool for statically checking C programs (see http://www.splint.org). -Of course it has to be installed in order to be used within Vim. The menu -item 'Run->splint' will run the current buffer through splint. - -An error window will be opened if splint has something to complain about. -Quickfix commands can now be used to jump to an error location. For easier -navigation see tip under 'SAVE AND COMPILE' |csupport-run-buffer|. - -Splint has many options. Presumably the best way is to keep the options in an -option file (~/.splintrc). For a quick try you can use the menu item -'Run->cmd. line arg. for splint' to specify some buffer related options. - -When vim is started this plugin will check whether splint is executable. If -not, the menu item will *NOT' be visible. - - -1.7.6 CODECHECK *csupport-run-codecheck* - -CodeCheck (TM) is a commercial code analyzing tool produced by Abraxas -Software, Inc. (www.abraxas-software.com). -Of course it has to be installed in order to be used within Vim. The menu -item 'Run->CodeCheck' will run the current buffer through CodeCheck. - -An error window will be opened if CodeCheck has something to complain about. -Quickfix commands can now be used to jump to an error location. For easier -navigation see tip under 'SAVE AND COMPILE' |csupport-run-buffer|. - -CodeCheck has many options. For a quick try you can use the menu item -'Run->cmd. line arg. for CodeCheck' to specify some buffer related options. - -CodeCheck will be run with default options (see |csupport-custom-glob-vars|). -The default options can be overwritten by placing a global variable in -~/.vimrc , e.g. - - let g:C_CodeCheckOptions = "-K13 -Rmeyers" - -The default name for the executable is 'check'. There are other names in use -on different platforms. The name can be changed by placing a global variable -in ~/.vimrc , e.g. - - let g:C_CodeCheckExeName = "chknt.exe" - -When vim is started this plugin will check whether CodeCheck is executable. If -not, the menu item will *NOT' be visible. - - -1.7.7 INDENT *csupport-run-indent* - -The formatter 'indent' can be run over the whole buffer. Before formatting a -buffer this buffer will be saved to disk and you will be asked for a -confirmation. - -Indent has many options. These are kept in the file '.indent.pro' in your home -directory. See the indent manual for more information. - - -1.7.8 HARDCOPY *csupport-run-hardcopy* - -Generates a PostScript file from the whole buffer or from a marked region. -On a Windows system a printer dialog is displayed. -The hardcopy goes to the current working directory. If the buffer contains -documentation or other material from non-writable directories the hardcopy -goes to the HOME directory. The output destination will be shown in a message. - -The print header contains date and time for the current locale. The definition -used is - - let s:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" - -The current locale can be overwritten by changing the language, e.g. - - :language C - -or by setting a global variable in the file ~/.vimrc , e.g. : - - let g:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} SEITE %N" - -See :h printheader and :h strftime() for more details. - - -1.7.9 REBUILD TEMPLATES *csupport-run-templates* - -After editing one or more template files a click on this item rereads the -template files and rebuilds all templates. - - -1.7.10 XTERM SIZE *csupport-run-xterm* - -The size of the xterm used for running a program (below) can be set by this -menu item. The default is 80 columns with 24 lines. -This feature is not available under Windows. - - -1.7.11 OUTPUT REDIRECTION *csupport-run-output* - -Running a program can be done in one of three ways: -(1) Run the program from the gVim command line. - This is for interactive programs with little input and output. -(2) Run the program and direct the output into a window with name "C-Output". - The buffer and its content will disappear when the window is closed and - reused otherwise. - This is for non-interactive programs with little to very much output. - You have unlimited line length, regex search, navigation, ... - The tabstop value will be set to 8 for "C-Output". -(3) Run the program in an xterm. - -The output method can be chosen from the menu item 'Run->output: ...'. -This menu has three states: - - output: VIM->buffer->xterm - output: BUFFER->xterm->vim - output: XTERM->vim->buffer - -The first (uppercase) item shows the current method. The default is 'vim'. -This can be changed by setting the variable g:C_OutputGvim to another value. -Possible values are 'vim', 'buffer' and 'xterm' . - -The xterm defaults can be set in ~/.vimrc by the variable g:C_XtermDefaults . -The default is "-fa courier -fs 12 -geometry 80x24" : - font name : -fa courier - font size : -fs 12 - terminal size : -geometry 80x24 -See 'xterm -help' for more options. Xterms are not available under Windows. - ------------------------------------------------------------------------------- -1.8 'help' *csupport-help* ------------------------------------------------------------------------------- -Plugin help ------------ -The root menu item 'help (plugin)' shows this plugin help in a help window. -The help tags must have been generated with - :helptags ~/.vim/doc -The hotkey is \hp (for "help plugin"). - -Displaying a manual -------------------- -The root menu item 'show manual' shows the manual for the word under the -cursor. If there is more than one manual a selection list will be presented. -If there is no word under the cursor you can type in a name. An interface to -the on-line reference manuals must be installed (usually man(1) for -Linux/Unix, see|csupport-custom-glob-vars|). -The hotkey is \hm (for "help manual"). - -============================================================================== -2. USAGE WITHOUT GUI (Vim) *csupport-usage-vim* -============================================================================== - -The frequently used constructs can be inserted with key mappings. The -mappings are also described in the document c-hot-keys.pdf (reference card, -part of this package). -Hint: Typing speed matters. The combination of a leader ('\') and the -following character(s) will only be recognized for a short time. -The insert mode mappings start with ` (backtick). - -Legend: (i) insert mode, (n) normal mode, (v) visual mode - - -- Help --------------------------------------------------------------- - - \hm show manual for word under the cursor (n,i) - \hp show plugin help (n,i) - - -- Comments ----------------------------------------------------------- - - \cl end-of-line comment (n,v,i) - \cj adjust end-of-line comment(s) (n,v,i) - \cs set end-of-line comment column (n) - \c* code -> comment /* */ (n,v) - \cc code -> comment // (n,v) - \co comment -> code (n,v) - \cfr frame comment (n,i) - \cfu function comment (n,i) - \cme method description (n,i) - \ccl class description (n,i) - \cfdi file description (implementation) (n,i) - \cfdh file description (header) (n,i) - \ccs C/C++-file section (tab. compl.) (n,i) - \chs H-file section (tab. compl.) (n,i) - \ckc keyword comment (tab. compl.) (n,i) - \csc special comment (tab. compl.) (n,i) - \cd date (n,v,i) - \ct date \& time (n,v,i) - - -- Statements --------------------------------------------------------- - - \sd do { } while (n,v,i) - \sf for (n,i) - \sfo for { } (n,v,i) - \si if (n,i) - \sif if { } (n,v,i) - \sie if else (n,v,i) - \sife if { } else { } (n,v,i) - \se else { } (n,v,i) - \sw while (n,i) - \swh while { } (n,v,i) - \ss switch (n,v,i) - \sc case (n,i) - \s{ \sb { } (n,v,i) - - -- Preprocessor ------------------------------------------------------- - - \ps choose a standard library include (n,i) - \pc choose a C99 include (n,i) - \p< #include <> (n,i) - \p" #include "" (n,i) - \pd #define (n,i) - \pu #undef (n,i) - \pie #if #else #endif (n,v,i) - \pid #ifdef #else #endif (n,v,i) - \pin #ifndef #else #endif (n,v,i) - \pind #ifndef #def #endif (n,v,i) - \pi0 #if 0 #endif (n,v,i) - \pr0 remove #if 0 #endif (n,i) - \pe #error (n,i) - \pl #line (n,i) - \pp #pragma (n,i) - - -- Idioms ------------------------------------------------------------- - - \if function (n,v,i) - \isf static function (n,v,i) - \im main() (n,v,i) - \i0 for( x=0; x=0; x-=1 ) (n,v,i) - \ie enum + typedef (n,i) - \is struct + typedef (n,i) - \iu union + typedef (n,i) - \ip printf() (n,i) - \isc scanf() (n,i) - \ica p=calloc() (n,i) - \ima p=malloc() (n,i) - \isi sizeof() (n,v,i) - \ias assert() (n,v) - \ii open input file (n,i) - \io open output file (n,i) - - -- Snippets ----------------------------------------------------------- - - \nr read code snippet (n,i) - \nw write code snippet (n,v,i) - \ne edit code snippet (n,i) - \np pick up prototype (n,v,i) - \ni insert prototype(s) (n,i) - \nc clear prototype(s) (n,i) - \ns show prototype(s) (n,i) - \ntl edit local templates (n,i) - \ntg edit global templates (n,i) - \ntr rebuild templates (n,i) - - -- C++ ---------------------------------------------------------------- - - \+co cout << << endl; (n,i) - \+c class (n,i) - \+ps #include <...> STL (n,i) - \+pc #include C (n,i) - \+cn class (using new) (n,i) - \+ci class implementation (n,i) - \+cni class (using new) implementation (n,i) - \+mi method implementation (n,i) - \+ai accessor implementation (n,i) - - \+tc template class (n,i) - \+tcn template class (using new) (n,i) - \+tci template class implementation (n,i) - \+tcni template class (using new) impl. (n,i) - \+tmi template method implementation (n,i) - \+tai template accessor implementation (n,i) - - \+tf template function (n,i) - \+ec error class (n,i) - \+tr try ... catch (n,v,i) - \+ca catch (n,v,i) - \+c. catch(...) (n,v,i) - - -- Run ---------------------------------------------------------------- - - \rc save and compile (n,i) - \rl link (n,i) - \rr run (n,i) - \ra set comand line arguments (n,i) - \rm run make (n,i) - \rg cmd. line arg. for make (n,i) - \rp run splint (n,i) - \ri cmd. line arg. for splint (n,i) - \rk run CodeCheck (TM) (n,i) - \re cmd. line arg. for CodeCheck (TM) (n,i) - \rd run indent (n,v,i) - \rh hardcopy buffer (n,v,i) - \rs show plugin settings (n,i) - \rx set xterm size (n, only Linux/UNIX & GUI) - \ro change output destination (n,i) - - -- Load / Unload C/C++ Support ---------------------------------------- - - \lcs Load C/C++ Support Menus (n, GUI only) - \ucs Unload C/C++ Support Menus (n, GUI only) - -The hotkeys are defined in the file type plugin c.vim (part of this csupport -plugin package) and described in the document c-hot-keys.pdf - -Changing the default map leader '\' ------------------------------------ -The map leader can be changed by the user by setting a global variable in the -file .vimrc - - let g:C_MapLeader = ',' - -The map leader is now a comma. The 'line end comment' command is now defined -as ',cl'. This setting will be used as a so called local leader and influences -only files with filetype 'c' and 'cpp'. - -============================================================================== -3. HOTKEYS *csupport-hotkeys* -============================================================================== - -The following hotkeys are defined in normal, visual and insert mode: - - F9 compile and link - Alt-F9 write buffer and compile - Ctrl-F9 run executable - Shift-F9 set command line arguments - - Shift-F2 switch between source files and header files - -The hotkeys are defined in the file type plugin c.vim. All hotkeys from the -non-GUI mode also work for gVim (see |csupport-usage-vim|). - -Shift-F2 can be used to switch between source files and header files if the -plugin a.vim (http://vim.sourceforge.net/scripts/script.php?script_id=31) is -present. To suppress the creation of a new header file when switching from a -source file the file ~/.vimrc should contain a line - - let g:alternateNoDefaultAlternate = 1 - -A header file will only be opened if it already exists. - -The Shift-key is dead when you are working with Vim in a console terminal -(non-Gui). You could add - - noremap \a :A - inoremap \a :A - -to get a hot key for this case. - -============================================================================== -4. CUSTOMIZATION *csupport-custom* -============================================================================== - ------------------------------------------------------------------------------- -4.1 GLOBAL VARIABLES *csupport-custom-glob-vars* ------------------------------------------------------------------------------- - -Several global variables are checked by the script to customize it: - - ---------------------------------------------------------------------------- - GLOBAL VARIABLE DEFAULT VALUE TAG (see below) - ---------------------------------------------------------------------------- - g:C_GlobalTemplateFile plugin_dir.'c-support/templates/Templates' - g:C_LocalTemplateFile $HOME.'/.vim/c-support/templates/Templates' - g:C_TemplateOverwrittenMsg 'yes' - g:C_Ctrl_j 'on' - - g:C_CodeSnippets plugin_dir."/c-support/codesnippets/" - g:C_Dictionary_File "" - g:C_LoadMenus "yes" - g:C_MenuHeader "yes" - g:C_OutputGvim "vim" - g:C_XtermDefaults "-fa courier -fs 12 -geometry 80x24" - g:C_Printheader "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" - g:C_MapLeader '\' - g:C_GuiSnippetBrowser 'gui' - g:C_GuiTemplateBrowser 'gui' - - Linux/UNIX: - g:C_ObjExtension ".o" - g:C_ExeExtension "" - g:C_CCompiler "gcc" - g:C_CplusCompiler "g++" - g:C_Man "man" - Windows: - g:C_ObjExtension ".obj" - g:C_ExeExtension ".exe" - g:C_CCompiler "gcc.exe" - g:C_CplusCompiler "g++.exe" - g:C_Man "man.exe" - g:C_CFlags "-Wall -g -O0 -c" - g:C_LFlags "-Wall -g -O0" - g:C_Libs "-lm" - g:C_LineEndCommColDefault 49 - g:C_CExtension "c" - g:C_TypeOfH "cpp" - g:C_SourceCodeExtensions "c cc cp cxx cpp CPP c++ C i ii" - - g:C_CodeCheckExeName "check" - g:C_CodeCheckOptions "-K13" - -The variable plugin_dir will automatically be set to one of the following values: - $HOME.'/.vim/' for Linux/Unix - $VIM.'/vimfiles/' for Windows - - ---------------------------------------------------------------------------- - - 1. group: g:C_GlobalTemplateFile : Sets the master template file (see|csupport-templates|) - g:C_LocalTemplateFile : Sets the local template file (see|csupport-templates|) - g:C_TemplateOverwrittenMsg : message if template is overwritten - g:C_Ctrl_j : hotkey Ctrl-j 'on'/'off' (see|csupport-Ctrl-j|) - - 2. group: g:C_CodeSnippets : The name of the code snippet directory - (see |csupport-snippets|). - g:C_Dictionary_File : The name(s) of the dictionary file(s) used for - word completion (see also |csupport-dictionary|) - g:C_Root : the name of the root menu of this plugin - g:C_LoadMenus : Load menus and mappings ("yes", "no") at startup. - g:C_MenuHeader : Switch the submenu header on/off. - g:C_OutputGvim : when program is running output goes to the vim - command line ("vim"), to a buffer ("buffer") or to - an xterm ("xterm"). - g:C_XtermDefaults : the xterm defaults - g:C_Printheader : hardcopy: definition of the page header - g:C_MapLeader : the map leader for hotkeys (see|csupport-usage-vim|) - g:C_GuiSnippetBrowser : code snippet browser: 'gui', 'commandline' - g:C_GuiTemplateBrowser : code template browser: 'gui', 'explorer', 'commandline' - - 3. group: g:C_CExtension : Extension of C files. Everything else is C++. - g:C_TypeOfH : filetype of header files with extension 'h' (c,cpp) - g:C_SourceCodeExtensions : filename extensions for C/C++ - implementation files - g:C_CCompiler : The name of the C compiler. - g:C_CplusCompiler : The name of the C++ compiler. - g:C_Man : The name of the man utility. - g:C_CFlags : Compiler flags used for a compilation. - g:C_LFlags : Compiler flags used for linkage. - g:C_Libs : Libraries to link with. - g:C_ObjExtension : C/C+ file extension for objects - (leading point required if not empty) - g:C_ExeExtension : C/C+ file extension for executables - (leading point required if not empty) - g:C_LineEndCommColDefault : Default starting column for end-of-line comments. - g:C_CodeCheckExeName : The name of the CodeCheck (TM) executable - (the default is 'check') - g:C_CodeCheckOptions : Default options for CodeCheck (TM) - (see |csupport-run-codecheck|). - -To override the default add appropriate assignments to ~/.vimrc . - ------------------------------------------------------------------------------- -4.2 THE ROOT MENU *csupport-custom-root-menu* ------------------------------------------------------------------------------- - -The variable g:C_Root, if set (in ~/.vimrc or in ~/.gvimrc), gives the name of -the single Vim root menu item in which the C/C++ submenus will be put. The -default is - '&C\/C\+\+.' -Note the terminating dot. A single root menu can be used if the screen is -limited or several plugins are used in parallel. - -If set to "", this single root menu item will not appear. Now all submenus -are put into the Vim root menu. This is nice for beginners in a lab -installation or for C-only programmers. - ------------------------------------------------------------------------------- -4.3 SYSTEM-WIDE INSTALLATION *csupport-system-wide* ------------------------------------------------------------------------------- - -A system-wide installation (one installation for all users) is done as -follows. - -As *** SUPERUSER *** : - -(1) Find the Vim installation directory. -The Vim Ex command ':echo $VIM' gives '/usr/local/share/vim' or something like -that. Beyond this directory you will find the Vim installation, e.g. in -'/usr/local/share/vim/vim71' if Vim version 7.1 has been installed. - -(2) Create a new subdirectory 'vimfiles', e.g. '/usr/local/share/vim/vimfiles'. - -(3) Install C/C++ Support -Copy the archive cvim.zip to this new directory and unpack it: - unzip cvim.zip - -(4) Generate the help tags: - :helptags $VIM/vimfiles/doc - - -As *** USER *** : - -Create your private snippet directory: - - mkdir --parents ~/.vim/c-support/codesnippets - -You may want to copy the snippets coming with this plugin (in -$VIM/vimfiles/c-support/codesnippets) into the new directory or to set a -link to the global directory. - -Create your private template directory: - - mkdir --parents ~/.vim/c-support/template - -Create a private template file 'Templates' in this directory to overwrite some -macros, e.g. - - *|AUTHOR|* = your name - *|AUTHORREF|* = ... - *|EMAIL|* = ... - *|COMPANY|* = ... - *|COPYRIGHT|* = ... - -You can also have local templates which overwrite the global ones. To suppress -the messages in this case set a global variable in '~/.vimrc' : - - let g:C_TemplateOverwrittenMsg= 'no' - -The default is 'yes'. - -============================================================================== -5. TEMPLATE FILES AND TAGS *csupport-templates* -============================================================================== - ------------------------------------------------------------------------------- -5.1 TEMPLATE FILES *csupport-templates-files* ------------------------------------------------------------------------------- - -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements. - -The master template file is '$HOME/.vim/c-support/templates/Templates' for a -user installation and '$VIM/vimfiles/c-support/templates/Templates' for a -system-wide installation (see|csupport-system-wide|). - -The master template file starts with a macro section followed by templates for -single menu items or better by including other template files grouping the -templates according to the menu structure of this plugin. The master file -could look like this: - - $ - $ ============================================================= - $ ========== USER MACROS ====================================== - $ ============================================================= - $ - *|AUTHOR|* = Dr. Fritz Mehner - *|AUTHORREF|* = mn - *|EMAIL|* = mehner@fh-swf.de - *|COMPANY|* = FH Südwestfalen, Iserlohn - *|COPYRIGHT|* = Copyright (c)*|YEAR|,|AUTHOR|* - $ - $ ============================================================= - $ ========== FILE INCLUDES ==================================== - $ ============================================================= - $ - *|includefile|* = c.comments.template - *|includefile|* = c.cpp.template - *|includefile|* = c.idioms.template - *|includefile|* = c.preprocessor.template - *|includefile|* = c.statements.template - -Lines starting with a dollar sign are comments. The section starting -with *|AUTHOR|* assigns values to predefined tags -(see|csupport-templates-macros|) to personalize some templates. Other -predefined tags with given default values can be used (e.g. *|YEAR|* ). - -User defined tags are possible. They have the following syntax: - - *|macroname|* = replacement - -A macroname starts with a letter (uppercase or lowercase) followed by zero or -more letters, digits or underscores. - ------------------------------------------------------------------------------- -5.2 MACROS *csupport-templates-macros* ------------------------------------------------------------------------------- - -The following macro names are predefined. The first group is used to -personalize templates. - - ---------------------------------------------------------------------------- - PREDEFINED MACROS DEFAULT VALUE - ---------------------------------------------------------------------------- -*|AUTHOR|* "" -*|AUTHORREF|* "" -*|EMAIL|* "" -*|COMPANY|* "" -*|PROJECT|* "" -*|COPYRIGHTHOLDER|* "" -*|STYLE|* "" -*|includefile|* "" - -*|BASENAME|* filename without path and suffix -*|DATE|* the preferred date representation for the current locale - without the time -*|FILENAME|* filename without path -*|PATH|* path without filename -*|SUFFIX|* filename suffix -*|TIME|* the preferred time representation for the current locale - without the date and the time zone or name or abbreviation -*|YEAR|* the year as a decimal number including the century - -The macro *|includefile|* can be used to include an additional template file. -A file will be included only once. Commenting and uncommenting include macros -is a simple way to switch between several sets of templates (see also -|csupport-run-templates|). Overwriting existing macros and templates is -possible. - - ---------------------------------------------------------------------------- - PREDEFINED TAGS - ---------------------------------------------------------------------------- - The cursor position after insertion of a template - <+text+>,<-text->, Jump targets in templates. Jump with Ctrl-j. - {+text+},{-text-} See |csupport-templates-jump|. - - The split point when inserting in visual mode - (see|csupport-templates-definition|) - -A dependent template file can start with its own macro section. There is no -need to have all user defined macros in the master file. -When the first template definition is found (see below) macro definitions are -no longer recognized. - ------------------------------------------------------------------------------- -5.2.1 USER DEFINED FORMATS FOR DATE AND TIME *csupport-templates-date* ------------------------------------------------------------------------------- -The format for *|DATE|* ,*|TIME|* , and*|YEAR|* can be set by the user. The -defaults are - *|DATE|* '%x' - *|TIME|* '%X' - *|YEAR|* '%Y' -See the manual page of the C function strftime() for the format. The accepted -format depends on your system, thus this is not portable! The maximum length -of the result is 80 characters. - -User defined formats can be set using the following global variables in -~/.vimrc , e.g. - let g:C_FormatDate = '%D' - let g:C_FormatTime = '%H:%M' - let g:C_FormatYear = 'year %Y' - ------------------------------------------------------------------------------- -5.3 TEMPLATES *csupport-templates-names* ------------------------------------------------------------------------------- - -5.3.1 Template names - -The template behind a menu entry is identified by a given name. The first part -of the name identifies the menu, the second part identifies the item. The -modes are also hard coded (see|csupport-templates-definition|for the use of -). - - TEMPLATE NAME MODES - -------------------------------------------------------------------------- - - comment.class normal - comment.end-of-line-comment normal - comment.file-description normal - comment.file-description-header normal - comment.file-section-cpp-class-defs normal - comment.file-section-cpp-class-implementations-exported normal - comment.file-section-cpp-class-implementations-local normal - comment.file-section-cpp-data-types normal - comment.file-section-cpp-function-defs-exported normal - comment.file-section-cpp-function-defs-local normal - comment.file-section-cpp-header-includes normal - comment.file-section-cpp-local-variables normal - comment.file-section-cpp-macros normal - comment.file-section-cpp-prototypes normal - comment.file-section-cpp-typedefs normal - comment.file-section-hpp-exported-class-defs normal - comment.file-section-hpp-exported-data-types normal - comment.file-section-hpp-exported-function-declarations normal - comment.file-section-hpp-exported-typedefs normal - comment.file-section-hpp-exported-variables normal - comment.file-section-hpp-header-includes normal - comment.file-section-hpp-macros normal - comment.frame normal - comment.function normal - comment.keyword-bug normal - comment.keyword-compiler normal - comment.keyword-keyword normal - comment.keyword-todo normal - comment.keyword-tricky normal - comment.keyword-warning normal - comment.keyword-workaround normal - comment.method normal - comment.special-constant-type-is-long normal - comment.special-constant-type-is-unsigned-long normal - comment.special-constant-type-is-unsigned normal - comment.special-empty normal - comment.special-fall-through normal - comment.special-implicit-type-conversion normal - comment.special-no-return normal - comment.special-not-reached normal - comment.special-remains-to-be-implemented normal - - cpp.accessor-implementation normal - cpp.catch normal, visual - cpp.catch-points normal, visual - cpp.cin normal - cpp.class-definition normal - cpp.class-implementation normal - cpp.class-using-new-definition normal - cpp.class-using-new-implementation normal - cpp.cout-operator normal - cpp.cout normal - cpp.error-class normal - cpp.extern normal, visual - cpp.method-implementation normal - cpp.namespace-block normal, visual - cpp.namespace normal - cpp.namespace-std normal - cpp.open-input-file normal - cpp.open-output-file normal - cpp.operator-in normal - cpp.operator-out normal - cpp.output-manipulator-boolalpha normal - cpp.output-manipulator-dec normal - cpp.output-manipulator-endl normal - cpp.output-manipulator-fixed normal - cpp.output-manipulator-flush normal - cpp.output-manipulator-hex normal - cpp.output-manipulator-internal normal - cpp.output-manipulator-left normal - cpp.output-manipulator-oct normal - cpp.output-manipulator-right normal - cpp.output-manipulator-scientific normal - cpp.output-manipulator-setbase normal - cpp.output-manipulator-setfill normal - cpp.output-manipulator-setiosflag normal - cpp.output-manipulator-setprecision normal - cpp.output-manipulator-setw normal - cpp.output-manipulator-showbase normal - cpp.output-manipulator-showpoint normal - cpp.output-manipulator-showpos normal - cpp.output-manipulator-uppercase normal - cpp.rtti-const-cast normal - cpp.rtti-dynamic-cast normal - cpp.rtti-reinterpret-cast normal - cpp.rtti-static-cast normal - cpp.rtti-typeid normal - cpp.template-accessor-implementation normal - cpp.template-class-definition normal - cpp.template-class-implementation normal - cpp.template-class-using-new-definition normal - cpp.template-class-using-new-implementation normal - cpp.template-function normal - cpp.template-method-implementation normal - cpp.try-catch normal, visual - - idioms.assert normal - idioms.calloc normal - idioms.enum normal, visual - idioms.fprintf normal - idioms.fscanf normal - idioms.function normal, visual - idioms.function-static normal, visual - idioms.main normal, visual - idioms.malloc normal - idioms.open-input-file normal - idioms.open-output-file normal - idioms.printf normal - idioms.scanf normal - idioms.sizeof normal - idioms.struct normal, visual - idioms.union normal, visual - - preprocessor.define normal - preprocessor.ifdef-else-endif normal, visual - preprocessor.if-else-endif normal, visual - preprocessor.ifndef-def-endif normal, visual - preprocessor.ifndef-else-endif normal, visual - preprocessor.include-global normal - preprocessor.include-local normal - preprocessor.undefine normal - - statements.block normal, visual - statements.case normal - statements.do-while normal, visual - statements.for-block normal - statements.for normal - statements.if-block-else normal, visual - statements.if-block normal, visual - statements.if-else normal, visual - statements.if normal - statements.switch normal, visual - statements.while-block normal, visual - statements.while normal - - -5.3.2 Template definition *csupport-templates-definition* - -A template definition starts with a template head line with the following -syntax: - - == templatename == [ position == ] - -The templatename is one of the above template identifiers. The position -attribute is optional. Possible attribute values are: - - above insert the template before the current line - append append the template to the current line - below insert the template below the current line - insert insert the template at the cursor position - start insert the template before the first line of the buffer - -An example: - - == comment.function == - /* - * === FUNCTION ======================================================= - * Name: - * Description: - * ====================================================================== - */ - -The definition of a template ends at the next head line or at the end of the -file. - -Templates for the visual mode can use . The text before will -than be inserted above the marked area, the text after will be -inserted behind the marked area. An example: - - == statements.if-block-else == - if ( ) { - } else { - } - -If applied to the marked block - - xxxxxxxxxxx - xxxxxxxxxxx - -this template yields - - if ( ) { - xxxxxxxxxxx - xxxxxxxxxxx - } else { - } - -The templates with a visual mode are shown in the table under -|csupport-templates-names|. - -5.3.3 Template expansion *csupport-templates-expansion* - -There are additional ways to control the expansion of a template. - -USER INPUT ----------- -If the usage of a yet undefined user macro starts with a question mark the -user will be asked for the replacement first, e.g. with the following template - - == idioms.function == - void - *|?FUNCTION_NAME|* ( ) - { - return ; - } /* ----- end of function*|FUNCTION_NAME|* ----- */ - -The user can specify the function name which then will be applied twice. If -the macro was already in use the old value will be suggested as default. - -MACRO MANIPULATION ------------------- - -A macro expansion can be controlled by the following attributes - - :l change macro text to lowercase - :u change macro text to uppercase - :c capitalize macro text - :L legalize name - -The include guard template is an example for the use of ':L' : - - == preprocessor.ifndef-def-endif == - #ifndef *|?BASENAME:L|_INC* - #define *|BASENAME|_INC* - - #endif // ----- #ifndef*|BASENAME|_INC* ----- - -The base name of the file shall be used as part of the include guard name. -The predefined macro*|BASENAME|* is used to ask for this part because this -macro has already a defined value. That value can accepted or replaced by the -user. For the filename 'test test++test.h' the legalized base name -'TEST_TEST_TEST' will be suggested. - -Legalization means: - - replace all whitespaces by underscores - - replace all non-word characters by underscores - - replace '+' and '-' by underscore - -5.3.4 The macros <+text+> etc. *csupport-templates-jump* - -There are four macro types which can be used as jump targets in templates: - - <+text+> Can be jumped to by hitting Ctrl-j. - {+text+} Same as <+text+>. Used in cases where indentation gives unwanted - results with the first one. - - <-text-> Same as the two above. Will be removed if the template is used - {-text-} in visual mode. - -The text inside the brackets is userdefined and can be empty. The text -can be composed from letters (uppercase and lowercase), digits, underscores -and blanks. After the insertion of an template these jump targets will be -highlighted. - -5.3.5 Command Ctrl-j *csupport-Ctrl-j* - -Use the command Ctrl-j to jump to the next target. The target will be removed -and the mode will switched to insertion. Ctrl-j works in normal and in insert -mode. - -The template for a function can be written as follows: - - == idioms.function == - void - |?FUNCTION_NAME| ( <+argument list+> ) - { - return <+return value+>; - } /* ----- end of function |FUNCTION_NAME| ----- */ - -The cursor will be set behind 'void'. You can remove 'void' easily with -Ctrl-w (delete word before cursor) and insert a new type. A Ctrl-j leads you -to the argument list. The target disappears and you can type on. When the -function body is written a final Ctrl-j brings you to the return statement. - -The following example shows the usage of the type {-text-}. The idiom for the -opening of a file marks the line before the file is closed. This is also the -line where the template will be split to surround a marked area. In this case -(visual mode) the target is not needed and therefore removed (minus signs as -mnemonic). In normal and insert mode the target is meaningful and will be -therefore be present. The form <-...-> would result in a wrong indentation of -the file close statement. The brace type will be handled as a block and the -indentation will be correct. - - == cpp.open-input-file == - char *ifs_file_name = ""; /* input file name */ - ifstream ifs; /* create ifstream object */ - - ifs.open (ifs_file_name); /* open ifstream */ - if (!ifs) { - cerr << "\nERROR : failed to open input file " << ifs_file_name << endl; - exit (EXIT_FAILURE); - } - {-continue here-} - ifs.close (); /* close ifstream */ - -Extra feature of Ctrl-j ------------------------ -If none of the above described targets is left Ctrl-j can be used to jump -behind closing brackets, parenthesis, braces, or string terminators ('"`). -This feature is limited to the current line. Ctrl-j does not jump behind the -last character in a line. - - -How to switch the mapping for Ctrl-j off ----------------------------------------- -The original meaning of Ctrl-j is 'move [n] lines downward' (see |CTRL-j|). -If you are accustomed to use the deafult and don't like these jump targets you -can switch them off. Put the following line in the file .vimrc : - - let g:C_Ctrl_j = 'off' - -The default value of g:C_Ctrl_j is 'on'. You do not have to change the -template files. All jump targets will be removed before a template will be -inserted. - -============================================================================== -5.4 SWITCHING BETWEEN TEMPLATE SETS *csupport-templates-sets* -============================================================================== - -This plugin comes with two sets of templates. These are suggestions. You may -want to have additional sets for different projects or occasionally want to -use doxygen style comments. To facilitate switching use the macro*|STYLE|* -(|csupport-templates-files|) to define a unique name and the -IF-ENDIF-construct to choose a particular set of files for example: - - ... - - *|STYLE|* = C - $ - $ ============================================================= - $ ========== FILE INCLUDES ==================================== - $ ============================================================= - $ - == IF *|STYLE|* IS C == - $ - |includefile| = c.comments.template - |includefile| = c.cpp.template - |includefile| = c.idioms.template - |includefile| = c.preprocessor.template - |includefile| = c.statements.template - $ - == ENDIF == - - ... - -The syntax is as follows: - - == IF macro_name IS macro_value == - - == ENDIF == - -Includes outside an IF-ENDIF construct are associated with the default style -'default'. A style set does not have to a complete set of templates. For an -incomplete set the other templates are taken from the default style. - -IF, IS, and ENDIF are keywords. - -HINT. Use these constructs to avoid overwriting your templates when updating -csupport. Copy and rename the set of files you want to change and surround the -includes with an appropriate IF-construct: - - *|STYLE|* = MY_C - $ - ... - $ - == IF *|STYLE|* IS MY_C == - |includefile| = my_c.comments.template - |includefile| = my_c.cpp.template - |includefile| = my_c.idioms.template - |includefile| = my_c.preprocessor.template - |includefile| = my_c.statements.template - == ENDIF == - -Keep a copy of the main template file 'Templates' because this file will be -overwritten if you do not update manually. - -============================================================================== -5.5 BINDING A STYLE TO A FILE EXTENSION *csupport-templates-bind* -============================================================================== - -You can bind the existing styles to one or more filename extensions. To do so -assign a Dictionary to the global variable g:C_Styles in '~/.vimrc' : - -let g:C_Styles = { '*.c,*.h' : 'default', '*.cc,*.cpp,*.hh' : 'CPP' } - -A Dictionary is created with a comma separated list of entries in curly -braces. Each entry has a key and a value, separated by a colon. Each key can -only appear once. The keys are themselves a comma separated list of filename -pattern. The values are existing styles defined in the template files. -The given style will be set automatically when switching to a buffer or -opening a new buffer with the associated filename pattern and supersedes the -macro *|STYLE|* . - -============================================================================== -6. C/C++ DICTIONARY *csupport-dictionary* -============================================================================== - -The files - - c-c++-keywords.list - k+r.list - stl_index.list - -are a part of this plugin and can be used (together with your own lists) as -dictionaries for automatic word completion. This feature is enabled by -default. The default word lists are - - plugin_dir/c-support/wordlists/c-c++-keywords.list - plugin_dir/c-support/wordlists/k+r.list - plugin_dir/c-support/wordlists/stl_index.list - -The variable plugin_dir will automatically be set by the plugin to one of the -following values: - $HOME.'/.vim/' for Linux/Unix - $VIM.'/vimfiles/' for Windows -If you want to use an additional list MyC.list put the following lines into - ~/.vimrc : - - let g:C_Dictionary_File = PLUGIN_DIR.'/c-support/wordlists/c-c++-keywords.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/k+r.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/stl_index.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/MyC.list' - -When in file ~/.vimrc the name PLUGIN_DIR has to be replaced by $HOME or -$VIM (see above). Whitespaces in the pathnames have to be escaped with a -backslash. -The right side is a comma separated list of files. Note the point at the end -of the first line (string concatenation) and the backslash in front of the -second line (continuation line). -You can use Vim's dictionary feature CTRL-X, CTRL-K (and CTRL-P, CTRL-N). - -============================================================================== -7. EXTENDING ctags *csupport-ctags* -============================================================================== - ------------------------------------------------------------------------------- -7.1 make AND qmake *csupport-ctags-make* ------------------------------------------------------------------------------- - -The use of the Vim plugin taglist.vim (Author: Yegappan Lakshmanan) is highly -recommended. It uses the program ctags which generates tag files for 3 dozen -languages (Exuberant Ctags, Darren Hiebert, http://ctags.sourceforge.net). -With the following extensions the list of targets in a makefile can be shown -in the taglist window. - - 1) Append the file customization.ctags to the file $HOME/.ctags . - - 2) Add the following lines (from customization.vimrc) to $HOME/.vimrc : - - " - "------------------------------------------------------------------- - " taglist.vim : toggle the taglist window - " taglist.vim : define the title texts for make - " taglist.vim : define the title texts for qmake - "------------------------------------------------------------------- - noremap :Tlist - inoremap :Tlist - - let tlist_make_settings = 'make;m:makros;t:targets;i:includes' - let tlist_qmake_settings = 'qmake;t:SystemVariables' - - if has("autocmd") - " ---------- qmake : set file type for *.pro ---------- - autocmd BufNewFile,BufRead *.pro set filetype=qmake - endif " has("autocmd") - - 3) restart vim/gvim - -The two maps will toggle the taglist window (hotkey F11) in all editing modes. -The two assignments define the headings for the (q)make sections in the -taglist window. The autocmd set the file type 'qmake' for the filename -extension 'pro' (ctags needs this). - ------------------------------------------------------------------------------- -7.2 TEMPLATES *csupport-ctags-templates* ------------------------------------------------------------------------------- - -If you frequently change the plugin templates and you are using the taglist -plugin (section above) you may want to use this plugin for navigation. This is -achieved in two steps. First add a new language definition to the file -$HOME/.ctags : - - --langdef=template - --langmap=template:.template,TEMPLATE - --regex-template=/^==\s+([^=]+)\s+==\s*(\s+==\s+([^=]+)\s+==)?/\1/t,template/ - -Now add the following lines to the file $HOME/.vimrc : - - let tlist_template_settings = 'template;t:template' - "--------------------------------------------------------------- - " plugin templates : set filetype for *.template - "--------------------------------------------------------------- - if has("autocmd") - autocmd BufNewFile,BufRead Templates set filetype=template - autocmd BufNewFile,BufRead *.template set filetype=template - endif " has("autocmd") - -The assignment defines the heading for the template section in the taglist -window. The autocmds set the file type 'template' for the main template file -'Templates' and the includefiles '*.template' (if any). - -============================================================================== -8. FOLDING *csupport-folding* -============================================================================== - -This plugin can be used together with folding. - -There are a few peculiarities when the cursor is on a closed fold before -inserting a template: - -Normal mode ------------ -Inserting blocks of complete lines below and above a fold (e.g. frame -comments) and inserting at the top of a buffer (e.g. file description) works -as usual. -Insertions which go to the end of a line (e.g. end-of-line comments) and -insertions which go to the cursor position (e.g. 'sizeof()') will be suppressed -and a warning will be shown. - -Visual mode ------------ -A range of lines containing closed folds can be surrounded by constructs which -have a visual mode, e.g. a for-loop: - - for ( ; ; ) { - +--- 4 lines: {------------------------------------------------------------ - } - -See |folding| for more information on folding. - -============================================================================== -9. Additional Mappings *csupport-ad-mappings* -============================================================================== - -There are a few additional filetype specific key mappings defined in -'~/.vim/ftplugin/c.vim'. - -Complete a classical C comment: '/*' => '/* | */' (modes: i,v). - -Complete a classical C multi-line comment (mode: i): - '/*' => /* - * | - */ - -Open a block (modes: i,v): - '{' => { - | - } -In visual mode the content of the new block will be indented. - -============================================================================== -10. WINDOWS PARTICULARITIES *csupport-windows* -============================================================================== - -The plugin should go into the directory structure below the local -installation directory $HOME/.vim/ for LINUX/UNIX and $VIM/vimfiles/ for -Windows. -The values of the two variables can be found from inside Vim: - :echo $VIM -or - :echo $HOME - -Configuration files: - - LINUX/UNIX : $HOME/.vimrc and $HOME/.gvimrc - Windows : $VIM/_vimrc and $VIM/_gvimrc - -Compiler settings: - -It could be necessary to add further settings for your compiler. To compile -C++-programs using a Dev-C++ installation (http://www.bloodshed.net) the -following item in $VIM/_vimrc is needed (depends on the Dev-C++ install -directory): - - let g:C_CFlags = '-Wall -g -o0 -c -I c:\programs\dev-c++\include\g++' - -============================================================================== -11. ADDITIONAL TIPS *csupport-tips* -============================================================================== - -(1) gVim. Toggle 'insert mode' <--> 'normal mode' with the right mouse button - (see mapping in file costumization.gvimrc). - -(2) gVim. Use tear off menus. - -(3) Try 'Focus under mouse' as window behavior (No mouse click when the mouse - pointer is back from the menu item). - -(4) Use Emulate3Buttons "on" (X11) even for a 3-button mouse. Pressing left - and right button at the same time without moving your fingers is faster - then moving a finger to the middle button (often a wheel). - -============================================================================== -12. TROUBLESHOOTING *csupport-troubleshooting* -============================================================================== - -* I do not see any new main menu item. - - Was the archive extracted into the right directory? - -* How can I see what was loaded? - - Use ':scriptnames' from the Vim command line. - -* No main menu item. - - Loading of plugin files must be enabled. If not use - :filetype plugin on - This is the minimal content of the file '$HOME/.vimrc'. Create one if there - is none, or better use customization.vimrc. - -* Most key mappings do not work. - - They are defined in a filetype plugin in '$HOME/.vim/ftplugin/'. Use - ':filetype' to check if filetype plugins are enabled. If not, add the line - filetype plugin on - to the file '~/.vimrc'. - -* Some hotkeys do not work. - - The hotkeys might be in use by your graphical desktop environment. Under - KDE Ctrl-F9 is the hotkey which let you switch to the 9. desktop. The key - settings can usually be redefined. - -* Splint and/or CodeCheck menu item not visible. - - The program is not installed or not found (path not set) or not executable. - -============================================================================== -13. RELEASE NOTES *csupport-release-notes* -============================================================================== -See file c-support/doc/ChangeLog . - -============================================================================== -vim:tw=78:noet:ts=2:ft=help:norl: diff --git a/.vim/bundle/rbtweaks/doc/showmarks.txt b/.vim/bundle/rbtweaks/doc/showmarks.txt deleted file mode 100644 index 96dc1e1dc..000000000 --- a/.vim/bundle/rbtweaks/doc/showmarks.txt +++ /dev/null @@ -1,264 +0,0 @@ -*showmarks.txt* Visually show the location of marks - - By Anthony Kruize - Michael Geddes - - -ShowMarks provides a visual representation of |marks| local to a buffer. -Marks are useful for jumping back and forth between interesting points in a -buffer, but can be hard to keep track of without any way to see where you have -placed them. - -ShowMarks hopefully makes life easier by placing a |sign| in the -leftmost column of the buffer. The sign indicates the label of the mark and -its location. - -ShowMarks is activated by the |CursorHold| |autocommand| which is triggered -every |updatetime| milliseconds. This is set to 4000(4 seconds) by default. -If this is too slow, setting it to a lower value will make it more responsive. - -Note: This plugin requires Vim 6.x compiled with the |+signs| feature. - -=============================================================================== -1. Contents *showmarks* *showmarks-contents* - - 1. Contents |showmarks-contents| - 2. Configuration |showmarks-configuration| - 3. Highlighting |showmarks-highlighting| - 4. Key mappings |showmarks-mappings| - 5. Commands |showmarks-commands| - 6. ChangeLog |showmarks-changelog| - - Appendix - A. Using marks |marks| - B. Using signs |sign| - C. Defining updatetime |updatetime| - D. Defining a mapleader |mapleader| - E. Defining highlighting |highlight| - -=============================================================================== -2. Configuration *showmarks-configuration* - -ShowMarks can be configured to suit your needs. -The following options can be added to your |vimrc| to change how ShowMarks -behaves: - - *'showmarks_enable'* -'showmarks_enable' boolean (default: 1) - global - This option enables or disables ShowMarks on startup. Normally ShowMarks - will be enabled when Vim starts, setting this to 0 will disable ShowMarks - by default. - ShowMarks can be turned back on using the |ShowMarksToggle| command. - - *'showmarks_include'* -'showmarks_include' string (default: -"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\"") - global or local to buffer - This option specifies which marks will be shown and in which order if - placed on the same line. Marks earlier in the list take precedence over - marks later in the list. - This option can also be specified as a buffer option which will override - the global version. - - NOTE: When including the " mark, it must be escaped with a \. - - For example to only include marks 'abcdefzxABHJio', in that order: -> - let g:showmarks_include="abcdefzxABJio" -< - To override this for a particular buffer with 'ABCDhj.'^': -> - let b:showmarks_include="abcdefzxABJio" -< - *'showmarks_ignore_type'* -'showmarks_ignore_type' string (default: "hq") - global - This option defines which types of buffers should be ignored. - Each type is represented by a letter. This option is not case-sensitive. - Valid buffer types are: - - h : Help - - m : Non-modifiable - - p : Preview - - q : Quickfix - - r : Readonly - - For example to ignore help, preview and readonly files: -> - let g:showmarks_ignore_type="hpr" -< - *'showmarks_ignore_name'* -'showmarks_textlower' string (default: ">" ) - global - This option defines how the marks a-z will be displayed. - A maximum of two characters can be defined. - To include the mark in the text use a tab(\t) character. A single - character will display as the mark with the character suffixed (same as - "\t"). Specifying two characters will simply display those two - characters. - - Some examples: - To display the mark with a > suffixed: > - let g:showmarks_textlower="\t>" -< or > - let g:showmarks_textlower=">" -< - To display the mark with a ( prefixed: > - let g:showmarks_textlower="(\t" -< - To display two > characters: > - let g:showmarks_textlower=">>" -< - *'showmarks_textupper'* -'showmarks_textupper' string (default: ">") - global - This option defines how the marks A-Z will be displayed. It behaves the same - as the |'showmarks_textlower'| option. - - *'showmarks_textother'* -'showmarks_textother' string (default: ">") - global - This option defines how all other marks will be displayed. It behaves the - same as the |'showmarks_textlower'| option. - -'showmarks_hlline_lower' boolean (default: 0) *'showmarks_hlline_lower'* - global - This option defines whether the entire line a lowercase mark is on will - be highlighted. - -'showmarks_hlline_upper' boolean (default: 0) *'showmarks_hlline_upper'* - global - This option defines whether the entire line an uppercase mark is on will - be highlighted. - -'showmarks_hlline_other' boolean (default: 0) *'showmarks_hlline_other'* - global - This option defines whether the entire line other marks are on will be - highlighted. - -=============================================================================== -3. Highlighting *showmarks-highlighting* - -Four highlighting groups are used by ShowMarks to define the colours used to -highlight each of the marks. - - - ShowMarksHLl : This group is used to highlight all the lowercase marks. - - ShowMarksHLu : This group is used to highlight all the uppercase marks. - - ShowMarksHLo : This group is used to highlight all other marks. - - ShowMarksHLm : This group is used when multiple marks are on the same line. - -You can define your own highlighting by overriding these groups in your |vimrc|. -For example: > - - highlight ShowMarksHLl guifg=red guibg=green -< -Will set all lowercase marks to be red on green when running in GVim. -See |highlight| for more information. - -=============================================================================== -4. Mappings *showmarks-mappings* - -The following mappings are setup by default: - - mt - Toggles ShowMarks on and off. - mo - Forces ShowMarks on. - mh - Clears the mark at the current line. - ma - Clears all marks in the current buffer. - mm - Places the next available mark on the current line. - -(see |mapleader| for how to setup the mapleader variable.) - -=============================================================================== -5. Commands *showmarks-commands* - - *ShowMarksToggle* -:ShowMarksToggle - This command will toggle the display of marks on or off. - - -:ShowMarksOn *ShowMarksOn* - This command will force the display of marks on. - - *ShowMarksClearMark* -:ShowMarksClearMark - This command will clear the mark on the current line. - It doesn't actually remove the mark, it simply moves it to line 1 and - removes the sign. - - *ShowMarksClearAll* -:ShowMarksClearAll - This command will clear all marks in the current buffer. - It doesn't actually remove the marks, it simply moves them to line 1 and - removes the signs. - - *ShowMarksPlaceMark* -:ShowMarksPlaceMark - This command will place the next available mark on the current line. This - effectively automates mark placement so you don't have to remember which - marks are placed or not. Hidden marks are considered to be available. - NOTE: Only marks a-z are supported by this function. - -=============================================================================== -6. ChangeLog *showmarks-changelog* - -2.2 - 2004-08-17 - Fixed highlighting of the A-Z marks when ignorecase is on. (Mike Kelly) - Fixed the delay with ShowMarks triggering when entering a buffer for the - first time. (Mikolaj Machowski) - Added support for highlighting the entire line where a mark is placed. - Now uses HelpExtractor by Charles E. Campbell to install the help file. - -2.1 - 2004-03-04 - Added ShowMarksOn. It forces ShowMarks to be enabled whether it's on or not. - (Gary Holloway) - Marks now have a definable order of precedence for when mulitple alpha marks - have been placed on the same line. A new highlight group, ShowMarksHLm is - used to identify this situation. (Gary Holloway) - - showmarks_include has changed accordingly. - - ShowMarksHL is now ShowMarksHLl. - ShowMarksPlaceMark now places marks in the order specified by - showmarks_include. (Gary Holloway) - showmarks_include can now be specified per buffer. (Gary Holloway) - -2.0 - 2003-08-11 - Added ability to ignore buffers by type. - Fixed toggling ShowMarks off when switching buffers. - ShowMarksHideMark and ShowMarksHideAll have been renamed to - ShowMarksClearMark and ShowMarksClearAll. - Marks a-z, A-Z and others now have different highlighting from each other. - Added support for all other marks. (Gary Holloway) - Enhanced customization of how marks are displayed by allowing a prefix to - be specified.(Gary Holloway & Anthony Kruize) - Fixed CursorHold autocmd triggering even when ShowMarks is disabled. - (Charles E. Campbell) - -1.5 - 2002-07-16 - Added ability to customize how the marks are displayed. - -1.4 - 2002-05-29 - Added support for placing the next available mark. - (Thanks to Shishir Ramam for the idea) - Added support for hiding all marks. - Marks on line 1 are no longer shown. This stops hidden marks from - reappearing when the file is opened again. - Added a help file. - -1.3 - 2002-05-20 - Fixed toggling ShowMarks not responding immediately. - Added user commands for toggling/hiding marks. - Added ability to disable ShowMarks by default. - -1.2 - 2002-03-06 - Added a check that Vim was compiled with +signs support. - Added the ability to define which marks are shown. - Removed debugging code that was accidently left in. - -1.1 - 2002-02-05 - Added support for the A-Z marks. - Fixed sign staying placed if the line it was on is deleted. - Clear autocommands before making new ones. - -1.0 - 2001-11-20 - First release. - -vim:tw=78:ts=8:ft=help diff --git a/.vim/bundle/rbtweaks/doc/taglist.txt b/.vim/bundle/rbtweaks/doc/taglist.txt deleted file mode 100755 index 6a62b3963..000000000 --- a/.vim/bundle/rbtweaks/doc/taglist.txt +++ /dev/null @@ -1,1501 +0,0 @@ -*taglist.txt* Plugin for browsing source code - -Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) -For Vim version 6.0 and above -Last change: 2007 May 24 - -1. Overview |taglist-intro| -2. Taglist on the internet |taglist-internet| -3. Requirements |taglist-requirements| -4. Installation |taglist-install| -5. Usage |taglist-using| -6. Options |taglist-options| -7. Commands |taglist-commands| -8. Global functions |taglist-functions| -9. Extending |taglist-extend| -10. FAQ |taglist-faq| -11. License |taglist-license| -12. Todo |taglist-todo| - -============================================================================== - *taglist-intro* -1. Overview~ - -The "Tag List" plugin is a source code browser plugin for Vim. This plugin -allows you to efficiently browse through source code files for different -programming languages. The "Tag List" plugin provides the following features: - - * Displays the tags (functions, classes, structures, variables, etc.) - defined in a file in a vertically or horizontally split Vim window. - * In GUI Vim, optionally displays the tags in the Tags drop-down menu and - in the popup menu. - * Automatically updates the taglist window as you switch between - files/buffers. As you open new files, the tags defined in the new files - are added to the existing file list and the tags defined in all the - files are displayed grouped by the filename. - * When a tag name is selected from the taglist window, positions the - cursor at the definition of the tag in the source file. - * Automatically highlights the current tag name. - * Groups the tags by their type and displays them in a foldable tree. - * Can display the prototype and scope of a tag. - * Can optionally display the tag prototype instead of the tag name in the - taglist window. - * The tag list can be sorted either by name or by chronological order. - * Supports the following language files: Assembly, ASP, Awk, Beta, C, - C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, - Lua, Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, - SML, Sql, TCL, Verilog, Vim and Yacc. - * Can be easily extended to support new languages. Support for - existing languages can be modified easily. - * Provides functions to display the current tag name in the Vim status - line or the window title bar. - * The list of tags and files in the taglist can be saved and - restored across Vim sessions. - * Provides commands to get the name and prototype of the current tag. - * Runs in both console/terminal and GUI versions of Vim. - * Works with the winmanager plugin. Using the winmanager plugin, you - can use Vim plugins like the file explorer, buffer explorer and the - taglist plugin at the same time like an IDE. - * Can be used in both Unix and MS-Windows systems. - -============================================================================== - *taglist-internet* -2. Taglist on the internet~ - -The home page of the taglist plugin is at: -> - http://vim-taglist.sourceforge.net/ -< -You can subscribe to the taglist mailing list to post your questions or -suggestions for improvement or to send bug reports. Visit the following page -for subscribing to the mailing list: -> - http://groups.yahoo.com/group/taglist -< -============================================================================== - *taglist-requirements* -3. Requirements~ - -The taglist plugin requires the following: - - * Vim version 6.0 and above - * Exuberant ctags 5.0 and above - -The taglist plugin will work on all the platforms where the exuberant ctags -utility and Vim are supported (this includes MS-Windows and Unix based -systems). - -The taglist plugin relies on the exuberant ctags utility to dynamically -generate the tag listing. The exuberant ctags utility must be installed in -your system to use this plugin. The exuberant ctags utility is shipped with -most of the Linux distributions. You can download the exuberant ctags utility -from -> - http://ctags.sourceforge.net -< -The taglist plugin doesn't use or create a tags file and there is no need to -create a tags file to use this plugin. The taglist plugin will not work with -the GNU ctags or the Unix ctags utility. - -This plugin relies on the Vim "filetype" detection mechanism to determine the -type of the current file. You have to turn on the Vim filetype detection by -adding the following line to your .vimrc file: -> - filetype on -< -The taglist plugin will not work if you run Vim in the restricted mode (using -the -Z command-line argument). - -The taglist plugin uses the Vim system() function to invoke the exuberant -ctags utility. If Vim is compiled without the system() function then you -cannot use the taglist plugin. Some of the Linux distributions (Suse) compile -Vim without the system() function for security reasons. - -============================================================================== - *taglist-install* -4. Installation~ - -1. Download the taglist.zip file and unzip the files to the $HOME/.vim or the - $HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should - have the following two files (the directory structure should be preserved): - - plugin/taglist.vim - main taglist plugin file - doc/taglist.txt - documentation (help) file - - Refer to the |add-plugin|and |'runtimepath'| Vim help pages for more - details about installing Vim plugins. -2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc - directory, start Vim and run the ":helptags ." command to process the - taglist help file. Without this step, you cannot jump to the taglist help - topics. -3. If the exuberant ctags utility is not present in one of the directories in - the PATH environment variable, then set the 'Tlist_Ctags_Cmd' variable to - point to the location of the exuberant ctags utility (not to the directory) - in the .vimrc file. -4. If you are running a terminal/console version of Vim and the terminal - doesn't support changing the window width then set the - 'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file. -5. Restart Vim. -6. You can now use the ":TlistToggle" command to open/close the taglist - window. You can use the ":help taglist" command to get more information - about using the taglist plugin. - -To uninstall the taglist plugin, remove the plugin/taglist.vim and -doc/taglist.txt files from the $HOME/.vim or $HOME/vimfiles directory. - -============================================================================== - *taglist-using* -5. Usage~ - -The taglist plugin can be used in several different ways. - -1. You can keep the taglist window open during the entire editing session. On - opening the taglist window, the tags defined in all the files in the Vim - buffer list will be displayed in the taglist window. As you edit files, the - tags defined in them will be added to the taglist window. You can select a - tag from the taglist window and jump to it. The current tag will be - highlighted in the taglist window. You can close the taglist window when - you no longer need the window. -2. You can configure the taglist plugin to process the tags defined in all the - edited files always. In this configuration, even if the taglist window is - closed and the taglist menu is not displayed, the taglist plugin will - processes the tags defined in newly edited files. You can then open the - taglist window only when you need to select a tag and then automatically - close the taglist window after selecting the tag. -3. You can configure the taglist plugin to display only the tags defined in - the current file in the taglist window. By default, the taglist plugin - displays the tags defined in all the files in the Vim buffer list. As you - switch between files, the taglist window will be refreshed to display only - the tags defined in the current file. -4. In GUI Vim, you can use the Tags pull-down and popup menu created by the - taglist plugin to display the tags defined in the current file and select a - tag to jump to it. You can use the menu without opening the taglist window. - By default, the Tags menu is disabled. -5. You can configure the taglist plugin to display the name of the current tag - in the Vim window status line or in the Vim window title bar. For this to - work without the taglist window or menu, you need to configure the taglist - plugin to process the tags defined in a file always. -6. You can save the tags defined in multiple files to a taglist session file - and load it when needed. You can also configure the taglist plugin to not - update the taglist window when editing new files. You can then manually add - files to the taglist window. - -Opening the taglist window~ -You can open the taglist window using the ":TlistOpen" or the ":TlistToggle" -commands. The ":TlistOpen" command opens the taglist window and jumps to it. -The ":TlistToggle" command opens or closes (toggle) the taglist window and the -cursor remains in the current window. If the 'Tlist_GainFocus_On_ToggleOpen' -variable is set to 1, then the ":TlistToggle" command opens the taglist window -and moves the cursor to the taglist window. - -You can map a key to invoke these commands. For example, the following command -creates a normal mode mapping for the key to toggle the taglist window. -> - nnoremap :TlistToggle -< -Add the above mapping to your ~/.vimrc or $HOME/_vimrc file. - -To automatically open the taglist window on Vim startup, set the -'Tlist_Auto_Open' variable to 1. - -You can also open the taglist window on startup using the following command -line: -> - $ vim +TlistOpen -< -Closing the taglist window~ -You can close the taglist window from the taglist window by pressing 'q' or -using the Vim ":q" command. You can also use any of the Vim window commands to -close the taglist window. Invoking the ":TlistToggle" command when the taglist -window is opened, closes the taglist window. You can also use the -":TlistClose" command to close the taglist window. - -To automatically close the taglist window when a tag or file is selected, you -can set the 'Tlist_Close_On_Select' variable to 1. To exit Vim when only the -taglist window is present, set the 'Tlist_Exit_OnlyWindow' variable to 1. - -Jumping to a tag or a file~ -You can select a tag in the taglist window either by pressing the key -or by double clicking the tag name using the mouse. To jump to a tag on a -single mouse click set the 'Tlist_Use_SingleClick' variable to 1. - -If the selected file is already opened in a window, then the cursor is moved -to that window. If the file is not currently opened in a window then the file -is opened in the window used by the taglist plugin to show the previously -selected file. If there are no usable windows, then the file is opened in a -new window. The file is not opened in special windows like the quickfix -window, preview window and windows containing buffer with the 'buftype' option -set. - -To jump to the tag in a new window, press the 'o' key. To open the file in the -previous window (Ctrl-W_p) use the 'P' key. You can press the 'p' key to jump -to the tag but still keep the cursor in the taglist window (preview). - -To open the selected file in a tab, use the 't' key. If the file is already -present in a tab then the cursor is moved to that tab otherwise the file is -opened in a new tab. To jump to a tag in a new tab press Ctrl-t. The taglist -window is automatically opened in the newly created tab. - -Instead of jumping to a tag, you can open a file by pressing the key -or by double clicking the file name using the mouse. - -In the taglist window, you can use the [[ or key to jump to the -beginning of the previous file. You can use the ]] or key to jump to the -beginning of the next file. When you reach the first or last file, the search -wraps around and the jumps to the next/previous file. - -Highlighting the current tag~ -The taglist plugin automatically highlights the name of the current tag in the -taglist window. The Vim |CursorHold| autocmd event is used for this. If the -current tag name is not visible in the taglist window, then the taglist window -contents are scrolled to make that tag name visible. You can also use the -":TlistHighlightTag" command to force the highlighting of the current tag. - -The tag name is highlighted if no activity is performed for |'updatetime'| -milliseconds. The default value for this Vim option is 4 seconds. To avoid -unexpected problems, you should not set the |'updatetime'| option to a very -low value. - -To disable the automatic highlighting of the current tag name in the taglist -window, set the 'Tlist_Auto_Highlight_Tag' variable to zero. - -When entering a Vim buffer/window, the taglist plugin automatically highlights -the current tag in that buffer/window. If you like to disable the automatic -highlighting of the current tag when entering a buffer, set the -'Tlist_Highlight_Tag_On_BufEnter' variable to zero. - -Adding files to the taglist~ -When the taglist window is opened, all the files in the Vim buffer list are -processed and the supported files are added to the taglist. When you edit a -file in Vim, the taglist plugin automatically processes this file and adds it -to the taglist. If you close the taglist window, the tag information in the -taglist is retained. - -To process files even when the taglist window is not open, set the -'Tlist_Process_File_Always' variable to 1. - -You can manually add multiple files to the taglist without opening them using -the ":TlistAddFiles" and the ":TlistAddFilesRecursive" commands. - -For example, to add all the C files in the /my/project/dir directory to the -taglist, you can use the following command: -> - :TlistAddFiles /my/project/dir/*.c -< -Note that when adding several files with a large number of tags or a large -number of files, it will take several seconds to several minutes for the -taglist plugin to process all the files. You should not interrupt the taglist -plugin by pressing . - -You can recursively add multiple files from a directory tree using the -":TlistAddFilesRecursive" command: -> - :TlistAddFilesRecursive /my/project/dir *.c -< -This command takes two arguments. The first argument specifies the directory -from which to recursively add the files. The second optional argument -specifies the wildcard matching pattern for selecting the files to add. The -default pattern is * and all the files are added. - -Displaying tags for only one file~ -The taglist window displays the tags for all the files in the Vim buffer list -and all the manually added files. To display the tags for only the current -active buffer, set the 'Tlist_Show_One_File' variable to 1. - -Removing files from the taglist~ -You can remove a file from the taglist window, by pressing the 'd' key when the -cursor is on one of the tags listed for the file in the taglist window. The -removed file will no longer be displayed in the taglist window in the current -Vim session. To again display the tags for the file, open the file in a Vim -window and then use the ":TlistUpdate" command or use ":TlistAddFiles" command -to add the file to the taglist. - -When a buffer is removed from the Vim buffer list using the ":bdelete" or the -":bwipeout" command, the taglist is updated to remove the stored information -for this buffer. - -Updating the tags displayed for a file~ -The taglist plugin keeps track of the modification time of a file. When the -modification time changes (the file is modified), the taglist plugin -automatically updates the tags listed for that file. The modification time of -a file is checked when you enter a window containing that file or when you -load that file. - -You can also update or refresh the tags displayed for a file by pressing the -"u" key in the taglist window. If an existing file is modified, after the file -is saved, the taglist plugin automatically updates the tags displayed for the -file. - -You can also use the ":TlistUpdate" command to update the tags for the current -buffer after you made some changes to it. You should save the modified buffer -before you update the taglist window. Otherwise the listed tags will not -include the new tags created in the buffer. - -If you have deleted the tags displayed for a file in the taglist window using -the 'd' key, you can again display the tags for that file using the -":TlistUpdate" command. - -Controlling the taglist updates~ -To disable the automatic processing of new files or modified files, you can -set the 'Tlist_Auto_Update' variable to zero. When this variable is set to -zero, the taglist is updated only when you use the ":TlistUpdate" command or -the ":TlistAddFiles" or the ":TlistAddFilesRecursive" commands. You can use -this option to control which files are added to the taglist. - -You can use the ":TlistLock" command to lock the taglist contents. After this -command is executed, new files are not automatically added to the taglist. -When the taglist is locked, you can use the ":TlistUpdate" command to add the -current file or the ":TlistAddFiles" or ":TlistAddFilesRecursive" commands to -add new files to the taglist. To unlock the taglist, use the ":TlistUnlock" -command. - -Displaying the tag prototype~ -To display the prototype of the tag under the cursor in the taglist window, -press the space bar. If you place the cursor on a tag name in the taglist -window, then the tag prototype is displayed at the Vim status line after -|'updatetime'| milliseconds. The default value for the |'updatetime'| Vim -option is 4 seconds. - -You can get the name and prototype of a tag without opening the taglist window -and the taglist menu using the ":TlistShowTag" and the ":TlistShowPrototype" -commands. These commands will work only if the current file is already present -in the taglist. To use these commands without opening the taglist window, set -the 'Tlist_Process_File_Always' variable to 1. - -You can use the ":TlistShowTag" command to display the name of the tag at or -before the specified line number in the specified file. If the file name and -line number are not supplied, then this command will display the name of the -current tag. For example, -> - :TlistShowTag - :TlistShowTag myfile.java 100 -< -You can use the ":TlistShowPrototype" command to display the prototype of the -tag at or before the specified line number in the specified file. If the file -name and the line number are not supplied, then this command will display the -prototype of the current tag. For example, -> - :TlistShowPrototype - :TlistShowPrototype myfile.c 50 -< -In the taglist window, when the mouse is moved over a tag name, the tag -prototype is displayed in a balloon. This works only in GUI versions where -balloon evaluation is supported. - -Taglist window contents~ -The taglist window contains the tags defined in various files in the taglist -grouped by the filename and by the tag type (variable, function, class, etc.). -For tags with scope information (like class members, structures inside -structures, etc.), the scope information is displayed in square brackets "[]" -after the tag name. - -The contents of the taglist buffer/window are managed by the taglist plugin. -The |'filetype'| for the taglist buffer is set to 'taglist'. The Vim -|'modifiable'| option is turned off for the taglist buffer. You should not -manually edit the taglist buffer, by setting the |'modifiable'| flag. If you -manually edit the taglist buffer contents, then the taglist plugin will be out -of sync with the taglist buffer contents and the plugin will no longer work -correctly. To redisplay the taglist buffer contents again, close the taglist -window and reopen it. - -Opening and closing the tag and file tree~ -In the taglist window, the tag names are displayed as a foldable tree using -the Vim folding support. You can collapse the tree using the '-' key or using -the Vim |zc| fold command. You can open the tree using the '+' key or using -the Vim |zo| fold command. You can open all the folds using the '*' key or -using the Vim |zR| fold command. You can also use the mouse to open/close the -folds. You can close all the folds using the '=' key. You should not manually -create or delete the folds in the taglist window. - -To automatically close the fold for the inactive files/buffers and open only -the fold for the current buffer in the taglist window, set the -'Tlist_File_Fold_Auto_Close' variable to 1. - -Sorting the tags for a file~ -The tags displayed in the taglist window can be sorted either by their name or -by their chronological order. The default sorting method is by the order in -which the tags appear in a file. You can change the default sort method by -setting the 'Tlist_Sort_Type' variable to either "name" or "order". You can -sort the tags by their name by pressing the "s" key in the taglist window. You -can again sort the tags by their chronological order using the "s" key. Each -file in the taglist window can be sorted using different order. - -Zooming in and out of the taglist window~ -You can press the 'x' key in the taglist window to maximize the taglist -window width/height. The window will be maximized to the maximum possible -width/height without closing the other existing windows. You can again press -'x' to restore the taglist window to the default width/height. - - *taglist-session* -Taglist Session~ -A taglist session refers to the group of files and their tags stored in the -taglist in a Vim session. - -You can save and restore a taglist session (and all the displayed tags) using -the ":TlistSessionSave" and ":TlistSessionLoad" commands. - -To save the information about the tags and files in the taglist to a file, use -the ":TlistSessionSave" command and specify the filename: -> - :TlistSessionSave -< -To load a saved taglist session, use the ":TlistSessionLoad" command: > - - :TlistSessionLoad -< -When you load a taglist session file, the tags stored in the file will be -added to the tags already stored in the taglist. - -The taglist session feature can be used to save the tags for large files or a -group of frequently used files (like a project). By using the taglist session -file, you can minimize the amount to time it takes to load/refresh the taglist -for multiple files. - -You can create more than one taglist session file for multiple groups of -files. - -Displaying the tag name in the Vim status line or the window title bar~ -You can use the Tlist_Get_Tagname_By_Line() function provided by the taglist -plugin to display the current tag name in the Vim status line or the window -title bar. Similarly, you can use the Tlist_Get_Tag_Prototype_By_Line() -function to display the current tag prototype in the Vim status line or the -window title bar. - -For example, the following command can be used to display the current tag name -in the status line: -> - :set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%) -< -The following command can be used to display the current tag name in the -window title bar: -> - :set title titlestring=%<%f\ %([%{Tlist_Get_Tagname_By_Line()}]%) -< -Note that the current tag name can be displayed only after the file is -processed by the taglist plugin. For this, you have to either set the -'Tlist_Process_File_Always' variable to 1 or open the taglist window or use -the taglist menu. For more information about configuring the Vim status line, -refer to the documentation for the Vim |'statusline'| option. - -Changing the taglist window highlighting~ -The following Vim highlight groups are defined and used to highlight the -various entities in the taglist window: - - TagListTagName - Used for tag names - TagListTagScope - Used for tag scope - TagListTitle - Used for tag titles - TagListComment - Used for comments - TagListFileName - Used for filenames - -By default, these highlight groups are linked to the standard Vim highlight -groups. If you want to change the colors used for these highlight groups, -prefix the highlight group name with 'My' and define it in your .vimrc or -.gvimrc file: MyTagListTagName, MyTagListTagScope, MyTagListTitle, -MyTagListComment and MyTagListFileName. For example, to change the colors -used for tag names, you can use the following command: -> - :highlight MyTagListTagName guifg=blue ctermfg=blue -< -Controlling the taglist window~ -To use a horizontally split taglist window, instead of a vertically split -window, set the 'Tlist_Use_Horiz_Window' variable to 1. - -To use a vertically split taglist window on the rightmost side of the Vim -window, set the 'Tlist_Use_Right_Window' variable to 1. - -You can specify the width of the vertically split taglist window, by setting -the 'Tlist_WinWidth' variable. You can specify the height of the horizontally -split taglist window, by setting the 'Tlist_WinHeight' variable. - -When opening a vertically split taglist window, the Vim window width is -increased to accommodate the new taglist window. When the taglist window is -closed, the Vim window is reduced. To disable this, set the -'Tlist_Inc_Winwidth' variable to zero. - -To reduce the number of empty lines in the taglist window, set the -'Tlist_Compact_Format' variable to 1. - -To not display the Vim fold column in the taglist window, set the -'Tlist_Enable_Fold_Column' variable to zero. - -To display the tag prototypes instead of the tag names in the taglist window, -set the 'Tlist_Display_Prototype' variable to 1. - -To not display the scope of the tags next to the tag names, set the -'Tlist_Display_Tag_Scope' variable to zero. - - *taglist-keys* -Taglist window key list~ -The following table lists the description of the keys that can be used -in the taglist window. - - Key Description~ - - Jump to the location where the tag under cursor is - defined. - o Jump to the location where the tag under cursor is - defined in a new window. - P Jump to the tag in the previous (Ctrl-W_p) window. - p Display the tag definition in the file window and - keep the cursor in the taglist window itself. - t Jump to the tag in a new tab. If the file is already - opened in a tab, move to that tab. - Ctrl-t Jump to the tag in a new tab. - Display the prototype of the tag under the cursor. - For file names, display the full path to the file, - file type and the number of tags. For tag types, display the - tag type and the number of tags. - u Update the tags listed in the taglist window - s Change the sort order of the tags (by name or by order) - d Remove the tags for the file under the cursor - x Zoom-in or Zoom-out the taglist window - + Open a fold - - Close a fold - * Open all folds - = Close all folds - [[ Jump to the beginning of the previous file - Jump to the beginning of the previous file - ]] Jump to the beginning of the next file - Jump to the beginning of the next file - q Close the taglist window - Display help - -The above keys will work in both the normal mode and the insert mode. - - *taglist-menu* -Taglist menu~ -When using GUI Vim, the taglist plugin can display the tags defined in the -current file in the drop-down menu and the popup menu. By default, this -feature is turned off. To turn on this feature, set the 'Tlist_Show_Menu' -variable to 1. - -You can jump to a tag by selecting the tag name from the menu. You can use the -taglist menu independent of the taglist window i.e. you don't need to open the -taglist window to get the taglist menu. - -When you switch between files/buffers, the taglist menu is automatically -updated to display the tags defined in the current file/buffer. - -The tags are grouped by their type (variables, functions, classes, methods, -etc.) and displayed as a separate sub-menu for each type. If all the tags -defined in a file are of the same type (e.g. functions), then the sub-menu is -not used. - -If the number of items in a tag type submenu exceeds the value specified by -the 'Tlist_Max_Submenu_Items' variable, then the submenu will be split into -multiple submenus. The default setting for 'Tlist_Max_Submenu_Items' is 25. -The first and last tag names in the submenu are used to form the submenu name. -The menu items are prefixed by alpha-numeric characters for easy selection by -keyboard. - -If the popup menu support is enabled (the |'mousemodel'| option contains -"popup"), then the tags menu is added to the popup menu. You can access -the popup menu by right clicking on the GUI window. - -You can regenerate the tags menu by selecting the 'Tags->Refresh menu' entry. -You can sort the tags listed in the menu either by name or by order by -selecting the 'Tags->Sort menu by->Name/Order' menu entry. - -You can tear-off the Tags menu and keep it on the side of the Vim window -for quickly locating the tags. - -Using the taglist plugin with the winmanager plugin~ -You can use the taglist plugin with the winmanager plugin. This will allow you -to use the file explorer, buffer explorer and the taglist plugin at the same -time in different windows. To use the taglist plugin with the winmanager -plugin, set 'TagList' in the 'winManagerWindowLayout' variable. For example, -to use the file explorer plugin and the taglist plugin at the same time, use -the following setting: > - - let winManagerWindowLayout = 'FileExplorer|TagList' -< -Getting help~ -If you have installed the taglist help file (this file), then you can use the -Vim ":help taglist-" command to get help on the various taglist -topics. - -You can press the key in the taglist window to display the help -information about using the taglist window. If you again press the key, -the help information is removed from the taglist window. - - *taglist-debug* -Debugging the taglist plugin~ -You can use the ":TlistDebug" command to enable logging of the debug messages -from the taglist plugin. To display the logged debug messages, you can use the -":TlistMessages" command. To disable the logging of the debug messages, use -the ":TlistUndebug" command. - -You can specify a file name to the ":TlistDebug" command to log the debug -messages to a file. Otherwise, the debug messages are stored in a script-local -variable. In the later case, to minimize memory usage, only the last 3000 -characters from the debug messages are stored. - -============================================================================== - *taglist-options* -6. Options~ - -A number of Vim variables control the behavior of the taglist plugin. These -variables are initialized to a default value. By changing these variables you -can change the behavior of the taglist plugin. You need to change these -settings only if you want to change the behavior of the taglist plugin. You -should use the |:let| command in your .vimrc file to change the setting of any -of these variables. - -The configurable taglist variables are listed below. For a detailed -description of these variables refer to the text below this table. - -|'Tlist_Auto_Highlight_Tag'| Automatically highlight the current tag in the - taglist. -|'Tlist_Auto_Open'| Open the taglist window when Vim starts. -|'Tlist_Auto_Update'| Automatically update the taglist to include - newly edited files. -|'Tlist_Close_On_Select'| Close the taglist window when a file or tag is - selected. -|'Tlist_Compact_Format'| Remove extra information and blank lines from - the taglist window. -|'Tlist_Ctags_Cmd'| Specifies the path to the ctags utility. -|'Tlist_Display_Prototype'| Show prototypes and not tags in the taglist - window. -|'Tlist_Display_Tag_Scope'| Show tag scope next to the tag name. -|'Tlist_Enable_Fold_Column'| Show the fold indicator column in the taglist - window. -|'Tlist_Exit_OnlyWindow'| Close Vim if the taglist is the only window. -|'Tlist_File_Fold_Auto_Close'| Close tag folds for inactive buffers. -|'Tlist_GainFocus_On_ToggleOpen'| - Jump to taglist window on open. -|'Tlist_Highlight_Tag_On_BufEnter'| - On entering a buffer, automatically highlight - the current tag. -|'Tlist_Inc_Winwidth'| Increase the Vim window width to accommodate - the taglist window. -|'Tlist_Max_Submenu_Items'| Maximum number of items in a tags sub-menu. -|'Tlist_Max_Tag_Length'| Maximum tag length used in a tag menu entry. -|'Tlist_Process_File_Always'| Process files even when the taglist window is - closed. -|'Tlist_Show_Menu'| Display the tags menu. -|'Tlist_Show_One_File'| Show tags for the current buffer only. -|'Tlist_Sort_Type'| Sort method used for arranging the tags. -|'Tlist_Use_Horiz_Window'| Use a horizontally split window for the - taglist window. -|'Tlist_Use_Right_Window'| Place the taglist window on the right side. -|'Tlist_Use_SingleClick'| Single click on a tag jumps to it. -|'Tlist_WinHeight'| Horizontally split taglist window height. -|'Tlist_WinWidth'| Vertically split taglist window width. - - *'Tlist_Auto_Highlight_Tag'* -Tlist_Auto_Highlight_Tag~ -The taglist plugin will automatically highlight the current tag in the taglist -window. If you want to disable this, then you can set the -'Tlist_Auto_Highlight_Tag' variable to zero. Note that even though the current -tag highlighting is disabled, the tags for a new file will still be added to -the taglist window. -> - let Tlist_Auto_Highlight_Tag = 0 -< -With the above variable set to 1, you can use the ":TlistHighlightTag" command -to highlight the current tag. - - *'Tlist_Auto_Open'* -Tlist_Auto_Open~ -To automatically open the taglist window, when you start Vim, you can set the -'Tlist_Auto_Open' variable to 1. By default, this variable is set to zero and -the taglist window will not be opened automatically on Vim startup. -> - let Tlist_Auto_Open = 1 -< -The taglist window is opened only when a supported type of file is opened on -Vim startup. For example, if you open text files, then the taglist window will -not be opened. - - *'Tlist_Auto_Update'* -Tlist_Auto_Update~ -When a new file is edited, the tags defined in the file are automatically -processed and added to the taglist. To stop adding new files to the taglist, -set the 'Tlist_Auto_Update' variable to zero. By default, this variable is set -to 1. -> - let Tlist_Auto_Update = 0 -< -With the above variable set to 1, you can use the ":TlistUpdate" command to -add the tags defined in the current file to the taglist. - - *'Tlist_Close_On_Select'* -Tlist_Close_On_Select~ -If you want to close the taglist window when a file or tag is selected, then -set the 'Tlist_Close_On_Select' variable to 1. By default, this variable is -set zero and when you select a tag or file from the taglist window, the window -is not closed. -> - let Tlist_Close_On_Select = 1 -< - *'Tlist_Compact_Format'* -Tlist_Compact_Format~ -By default, empty lines are used to separate different tag types displayed for -a file and the tags displayed for different files in the taglist window. If -you want to display as many tags as possible in the taglist window, you can -set the 'Tlist_Compact_Format' variable to 1 to get a compact display. -> - let Tlist_Compact_Format = 1 -< - *'Tlist_Ctags_Cmd'* -Tlist_Ctags_Cmd~ -The 'Tlist_Ctags_Cmd' variable specifies the location (path) of the exuberant -ctags utility. If exuberant ctags is present in any one of the directories in -the PATH environment variable, then there is no need to set this variable. - -The exuberant ctags tool can be installed under different names. When the -taglist plugin starts up, if the 'Tlist_Ctags_Cmd' variable is not set, it -checks for the names exuberant-ctags, exctags, ctags, ctags.exe and tags in -the PATH environment variable. If any one of the named executable is found, -then the Tlist_Ctags_Cmd variable is set to that name. - -If exuberant ctags is not present in one of the directories specified in the -PATH environment variable, then set this variable to point to the location of -the ctags utility in your system. Note that this variable should point to the -fully qualified exuberant ctags location and NOT to the directory in which -exuberant ctags is installed. If the exuberant ctags tool is not found in -either PATH or in the specified location, then the taglist plugin will not be -loaded. Examples: -> - let Tlist_Ctags_Cmd = 'd:\tools\ctags.exe' - let Tlist_Ctags_Cmd = '/usr/local/bin/ctags' -< - *'Tlist_Display_Prototype'* -Tlist_Display_Prototype~ -By default, only the tag name will be displayed in the taglist window. If you -like to see tag prototypes instead of names, set the 'Tlist_Display_Prototype' -variable to 1. By default, this variable is set to zero and only tag names -will be displayed. -> - let Tlist_Display_Prototype = 1 -< - *'Tlist_Display_Tag_Scope'* -Tlist_Display_Tag_Scope~ -By default, the scope of a tag (like a C++ class) will be displayed in -square brackets next to the tag name. If you don't want the tag scopes -to be displayed, then set the 'Tlist_Display_Tag_Scope' to zero. By default, -this variable is set to 1 and the tag scopes will be displayed. -> - let Tlist_Display_Tag_Scope = 0 -< - *'Tlist_Enable_Fold_Column'* -Tlist_Enable_Fold_Column~ -By default, the Vim fold column is enabled and displayed in the taglist -window. If you wish to disable this (for example, when you are working with a -narrow Vim window or terminal), you can set the 'Tlist_Enable_Fold_Column' -variable to zero. -> - let Tlist_Enable_Fold_Column = 1 -< - *'Tlist_Exit_OnlyWindow'* -Tlist_Exit_OnlyWindow~ -If you want to exit Vim if only the taglist window is currently opened, then -set the 'Tlist_Exit_OnlyWindow' variable to 1. By default, this variable is -set to zero and the Vim instance will not be closed if only the taglist window -is present. -> - let Tlist_Exit_OnlyWindow = 1 -< - *'Tlist_File_Fold_Auto_Close'* -Tlist_File_Fold_Auto_Close~ -By default, the tags tree displayed in the taglist window for all the files is -opened. You can close/fold the tags tree for the files manually. To -automatically close the tags tree for inactive files, you can set the -'Tlist_File_Fold_Auto_Close' variable to 1. When this variable is set to 1, -the tags tree for the current buffer is automatically opened and for all the -other buffers is closed. -> - let Tlist_File_Fold_Auto_Close = 1 -< - *'Tlist_GainFocus_On_ToggleOpen'* -Tlist_GainFocus_On_ToggleOpen~ -When the taglist window is opened using the ':TlistToggle' command, this -option controls whether the cursor is moved to the taglist window or remains -in the current window. By default, this option is set to 0 and the cursor -remains in the current window. When this variable is set to 1, the cursor -moves to the taglist window after opening the taglist window. -> - let Tlist_GainFocus_On_ToggleOpen = 1 -< - *'Tlist_Highlight_Tag_On_BufEnter'* -Tlist_Highlight_Tag_On_BufEnter~ -When you enter a Vim buffer/window, the current tag in that buffer/window is -automatically highlighted in the taglist window. If the current tag name is -not visible in the taglist window, then the taglist window contents are -scrolled to make that tag name visible. If you like to disable the automatic -highlighting of the current tag when entering a buffer, you can set the -'Tlist_Highlight_Tag_On_BufEnter' variable to zero. The default setting for -this variable is 1. -> - let Tlist_Highlight_Tag_On_BufEnter = 0 -< - *'Tlist_Inc_Winwidth'* -Tlist_Inc_Winwidth~ -By default, when the width of the window is less than 100 and a new taglist -window is opened vertically, then the window width is increased by the value -set in the 'Tlist_WinWidth' variable to accommodate the new window. The value -of this variable is used only if you are using a vertically split taglist -window. - -If your terminal doesn't support changing the window width from Vim (older -version of xterm running in a Unix system) or if you see any weird problems in -the screen due to the change in the window width or if you prefer not to -adjust the window width then set the 'Tlist_Inc_Winwidth' variable to zero. -CAUTION: If you are using the MS-Windows version of Vim in a MS-DOS command -window then you must set this variable to zero, otherwise the system may hang -due to a Vim limitation (explained in :help win32-problems) -> - let Tlist_Inc_Winwidth = 0 -< - *'Tlist_Max_Submenu_Items'* -Tlist_Max_Submenu_Items~ -If a file contains too many tags of a particular type (function, variable, -class, etc.), greater than that specified by the 'Tlist_Max_Submenu_Items' -variable, then the menu for that tag type will be split into multiple -sub-menus. The default setting for the 'Tlist_Max_Submenu_Items' variable is -25. This can be changed by setting the 'Tlist_Max_Submenu_Items' variable: -> - let Tlist_Max_Submenu_Items = 20 -< -The name of the submenu is formed using the names of the first and the last -tag entries in that submenu. - - *'Tlist_Max_Tag_Length'* -Tlist_Max_Tag_Length~ -Only the first 'Tlist_Max_Tag_Length' characters from the tag names will be -used to form the tag type submenu name. The default value for this variable is -10. Change the 'Tlist_Max_Tag_Length' setting if you want to include more or -less characters: -> - let Tlist_Max_Tag_Length = 10 -< - *'Tlist_Process_File_Always'* -Tlist_Process_File_Always~ -By default, the taglist plugin will generate and process the tags defined in -the newly opened files only when the taglist window is opened or when the -taglist menu is enabled. When the taglist window is closed, the taglist plugin -will stop processing the tags for newly opened files. - -You can set the 'Tlist_Process_File_Always' variable to 1 to generate the list -of tags for new files even when the taglist window is closed and the taglist -menu is disabled. -> - let Tlist_Process_File_Always = 1 -< -To use the ":TlistShowTag" and the ":TlistShowPrototype" commands without the -taglist window and the taglist menu, you should set this variable to 1. - - *'Tlist_Show_Menu'* -Tlist_Show_Menu~ -When using GUI Vim, you can display the tags defined in the current file in a -menu named "Tags". By default, this feature is turned off. To turn on this -feature, set the 'Tlist_Show_Menu' variable to 1: -> - let Tlist_Show_Menu = 1 -< - *'Tlist_Show_One_File'* -Tlist_Show_One_File~ -By default, the taglist plugin will display the tags defined in all the loaded -buffers in the taglist window. If you prefer to display the tags defined only -in the current buffer, then you can set the 'Tlist_Show_One_File' to 1. When -this variable is set to 1, as you switch between buffers, the taglist window -will be refreshed to display the tags for the current buffer and the tags for -the previous buffer will be removed. -> - let Tlist_Show_One_File = 1 -< - *'Tlist_Sort_Type'* -Tlist_Sort_Type~ -The 'Tlist_Sort_Type' variable specifies the sort order for the tags in the -taglist window. The tags can be sorted either alphabetically by their name or -by the order of their appearance in the file (chronological order). By -default, the tag names will be listed by the order in which they are defined -in the file. You can change the sort type (from name to order or from order to -name) by pressing the "s" key in the taglist window. You can also change the -default sort order by setting 'Tlist_Sort_Type' to "name" or "order": -> - let Tlist_Sort_Type = "name" -< - *'Tlist_Use_Horiz_Window'* -Tlist_Use_Horiz_Window~ -Be default, the tag names are displayed in a vertically split window. If you -prefer a horizontally split window, then set the 'Tlist_Use_Horiz_Window' -variable to 1. If you are running MS-Windows version of Vim in a MS-DOS -command window, then you should use a horizontally split window instead of a -vertically split window. Also, if you are using an older version of xterm in a -Unix system that doesn't support changing the xterm window width, you should -use a horizontally split window. -> - let Tlist_Use_Horiz_Window = 1 -< - *'Tlist_Use_Right_Window'* -Tlist_Use_Right_Window~ -By default, the vertically split taglist window will appear on the left hand -side. If you prefer to open the window on the right hand side, you can set the -'Tlist_Use_Right_Window' variable to 1: -> - let Tlist_Use_Right_Window = 1 -< - *'Tlist_Use_SingleClick'* -Tlist_Use_SingleClick~ -By default, when you double click on the tag name using the left mouse -button, the cursor will be positioned at the definition of the tag. You -can set the 'Tlist_Use_SingleClick' variable to 1 to jump to a tag when -you single click on the tag name using the mouse. By default this variable -is set to zero. -> - let Tlist_Use_SingleClick = 1 -< -Due to a bug in Vim, if you set 'Tlist_Use_SingleClick' to 1 and try to resize -the taglist window using the mouse, then Vim will crash. This problem is fixed -in Vim 6.3 and above. In the meantime, instead of resizing the taglist window -using the mouse, you can use normal Vim window resizing commands to resize the -taglist window. - - *'Tlist_WinHeight'* -Tlist_WinHeight~ -The default height of the horizontally split taglist window is 10. This can be -changed by modifying the 'Tlist_WinHeight' variable: -> - let Tlist_WinHeight = 20 -< -The |'winfixheight'| option is set for the taglist window, to maintain the -height of the taglist window, when new Vim windows are opened and existing -windows are closed. - - *'Tlist_WinWidth'* -Tlist_WinWidth~ -The default width of the vertically split taglist window is 30. This can be -changed by modifying the 'Tlist_WinWidth' variable: -> - let Tlist_WinWidth = 20 -< -Note that the value of the |'winwidth'| option setting determines the minimum -width of the current window. If you set the 'Tlist_WinWidth' variable to a -value less than that of the |'winwidth'| option setting, then Vim will use the -value of the |'winwidth'| option. - -When new Vim windows are opened and existing windows are closed, the taglist -plugin will try to maintain the width of the taglist window to the size -specified by the 'Tlist_WinWidth' variable. - -============================================================================== - *taglist-commands* -7. Commands~ - -The taglist plugin provides the following ex-mode commands: - -|:TlistAddFiles| Add multiple files to the taglist. -|:TlistAddFilesRecursive| - Add files recursively to the taglist. -|:TlistClose| Close the taglist window. -|:TlistDebug| Start logging of taglist debug messages. -|:TlistLock| Stop adding new files to the taglist. -|:TlistMessages| Display the logged taglist plugin debug messages. -|:TlistOpen| Open and jump to the taglist window. -|:TlistSessionSave| Save the information about files and tags in the - taglist to a session file. -|:TlistSessionLoad| Load the information about files and tags stored - in a session file to taglist. -|:TlistShowPrototype| Display the prototype of the tag at or before the - specified line number. -|:TlistShowTag| Display the name of the tag defined at or before the - specified line number. -|:TlistHighlightTag| Highlight the current tag in the taglist window. -|:TlistToggle| Open or close (toggle) the taglist window. -|:TlistUndebug| Stop logging of taglist debug messages. -|:TlistUnlock| Start adding new files to the taglist. -|:TlistUpdate| Update the tags for the current buffer. - - *:TlistAddFiles* -:TlistAddFiles {file(s)} [file(s) ...] - Add one or more specified files to the taglist. You can - specify multiple filenames using wildcards. To specify a - file name with space character, you should escape the space - character with a backslash. - Examples: -> - :TlistAddFiles *.c *.cpp - :TlistAddFiles file1.html file2.html -< - If you specify a large number of files, then it will take some - time for the taglist plugin to process all of them. The - specified files will not be edited in a Vim window and will - not be added to the Vim buffer list. - - *:TlistAddFilesRecursive* -:TlistAddFilesRecursive {directory} [ {pattern} ] - Add files matching {pattern} recursively from the specified - {directory} to the taglist. If {pattern} is not specified, - then '*' is assumed. To specify the current directory, use "." - for {directory}. To specify a directory name with space - character, you should escape the space character with a - backslash. - Examples: -> - :TlistAddFilesRecursive myproject *.java - :TlistAddFilesRecursive smallproject -< - If large number of files are present in the specified - directory tree, then it will take some time for the taglist - plugin to process all of them. - - *:TlistClose* -:TlistClose Close the taglist window. This command can be used from any - one of the Vim windows. - - *:TlistDebug* -:TlistDebug [filename] - Start logging of debug messages from the taglist plugin. - If {filename} is specified, then the debug messages are stored - in the specified file. Otherwise, the debug messages are - stored in a script local variable. If the file {filename} is - already present, then it is overwritten. - - *:TlistLock* -:TlistLock - Lock the taglist and don't process new files. After this - command is executed, newly edited files will not be added to - the taglist. - - *:TlistMessages* -:TlistMessages - Display the logged debug messages from the taglist plugin - in a window. This command works only when logging to a - script-local variable. - - *:TlistOpen* -:TlistOpen Open and jump to the taglist window. Creates the taglist - window, if the window is not opened currently. After executing - this command, the cursor is moved to the taglist window. When - the taglist window is opened for the first time, all the files - in the buffer list are processed and the tags defined in them - are displayed in the taglist window. - - *:TlistSessionSave* -:TlistSessionSave {filename} - Saves the information about files and tags in the taglist to - the specified file. This command can be used to save and - restore the taglist contents across Vim sessions. - - *:TlistSessionLoad* -:TlistSessionLoad {filename} - Load the information about files and tags stored in the - specified session file to the taglist. - - *:TlistShowPrototype* -:TlistShowPrototype [filename] [linenumber] - Display the prototype of the tag at or before the specified - line number. If the file name and the line number are not - specified, then the current file name and line number are - used. A tag spans multiple lines starting from the line where - it is defined to the line before the next tag. This command - displays the prototype for the tag for any line number in this - range. - - *:TlistShowTag* -:TlistShowTag [filename] [linenumber] - Display the name of the tag defined at or before the specified - line number. If the file name and the line number are not - specified, then the current file name and line number are - used. A tag spans multiple lines starting from the line where - it is defined to the line before the next tag. This command - displays the tag name for any line number in this range. - - *:TlistHighlightTag* -:TlistHighlightTag - Highlight the current tag in the taglist window. By default, - the taglist plugin periodically updates the taglist window to - highlight the current tag. This command can be used to force - the taglist plugin to highlight the current tag. - - *:TlistToggle* -:TlistToggle Open or close (toggle) the taglist window. Opens the taglist - window, if the window is not opened currently. Closes the - taglist window, if the taglist window is already opened. When - the taglist window is opened for the first time, all the files - in the buffer list are processed and the tags are displayed in - the taglist window. After executing this command, the cursor - is not moved from the current window to the taglist window. - - *:TlistUndebug* -:TlistUndebug - Stop logging of debug messages from the taglist plugin. - - *:TlistUnlock* -:TlistUnlock - Unlock the taglist and start processing newly edited files. - - *:TlistUpdate* -:TlistUpdate Update the tags information for the current buffer. This - command can be used to re-process the current file/buffer and - get the tags information. As the taglist plugin uses the file - saved in the disk (instead of the file displayed in a Vim - buffer), you should save a modified buffer before you update - the taglist. Otherwise the listed tags will not include the - new tags created in the buffer. You can use this command even - when the taglist window is not opened. - -============================================================================== - *taglist-functions* -8. Global functions~ - -The taglist plugin provides several global functions that can be used from -other Vim plugins to interact with the taglist plugin. These functions are -described below. - -|Tlist_Update_File_Tags()| Update the tags for the specified file -|Tlist_Get_Tag_Prototype_By_Line()| Return the prototype of the tag at or - before the specified line number in the - specified file. -|Tlist_Get_Tagname_By_Line()| Return the name of the tag at or - before the specified line number in - the specified file. -|Tlist_Set_App()| Set the name of the application - controlling the taglist window. - - *Tlist_Update_File_Tags()* -Tlist_Update_File_Tags({filename}, {filetype}) - Update the tags for the file {filename}. The second argument - specifies the Vim filetype for the file. If the taglist plugin - has not processed the file previously, then the exuberant - ctags tool is invoked to generate the tags for the file. - - *Tlist_Get_Tag_Prototype_By_Line()* -Tlist_Get_Tag_Prototype_By_Line([{filename}, {linenumber}]) - Return the prototype of the tag at or before the specified - line number in the specified file. If the filename and line - number are not specified, then the current buffer name and the - current line number are used. - - *Tlist_Get_Tagname_By_Line()* -Tlist_Get_Tagname_By_Line([{filename}, {linenumber}]) - Return the name of the tag at or before the specified line - number in the specified file. If the filename and line number - are not specified, then the current buffer name and the - current line number are used. - - *Tlist_Set_App()* -Tlist_Set_App({appname}) - Set the name of the plugin that controls the taglist plugin - window and buffer. This can be used to integrate the taglist - plugin with other Vim plugins. - - For example, the winmanager plugin and the Cream package use - this function and specify the appname as "winmanager" and - "cream" respectively. - - By default, the taglist plugin is a stand-alone plugin and - controls the taglist window and buffer. If the taglist window - is controlled by an external plugin, then the appname should - be set appropriately. - -============================================================================== - *taglist-extend* -9. Extending~ - -The taglist plugin supports all the languages supported by the exuberant ctags -tool, which includes the following languages: Assembly, ASP, Awk, Beta, C, -C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, Lua, -Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, SML, Sql, -TCL, Verilog, Vim and Yacc. - -You can extend the taglist plugin to add support for new languages and also -modify the support for the above listed languages. - -You should NOT make modifications to the taglist plugin script file to add -support for new languages. You will lose these changes when you upgrade to the -next version of the taglist plugin. Instead you should follow the below -described instructions to extend the taglist plugin. - -You can extend the taglist plugin by setting variables in the .vimrc or _vimrc -file. The name of these variables depends on the language name and is -described below. - -Modifying support for an existing language~ -To modify the support for an already supported language, you have to set the -tlist_xxx_settings variable in the ~/.vimrc or $HOME/_vimrc file. Replace xxx -with the Vim filetype name for the language file. For example, to modify the -support for the perl language files, you have to set the tlist_perl_settings -variable. To modify the support for java files, you have to set the -tlist_java_settings variable. - -To determine the filetype name used by Vim for a file, use the following -command in the buffer containing the file: - - :set filetype - -The above command will display the Vim filetype for the current buffer. - -The format of the value set in the tlist_xxx_settings variable is - - ;flag1:name1;flag2:name2;flag3:name3 - -The different fields in the value are separated by the ';' character. - -The first field 'language_name' is the name used by exuberant ctags to refer -to this language file. This name can be different from the file type name used -by Vim. For example, for C++, the language name used by ctags is 'c++' but the -filetype name used by Vim is 'cpp'. To get the list of language names -supported by exuberant ctags, use the following command: - - $ ctags --list-maps=all - -The remaining fields follow the format "flag:name". The sub-field 'flag' is -the language specific flag used by exuberant ctags to generate the -corresponding tags. For example, for the C language, to list only the -functions, the 'f' flag is used. To get the list of flags supported by -exuberant ctags for the various languages use the following command: - - $ ctags --list-kinds=all - -The sub-field 'name' specifies the title text to use for displaying the tags -of a particular type. For example, 'name' can be set to 'functions'. This -field can be set to any text string name. - -For example, to list only the classes and functions defined in a C++ language -file, add the following line to your .vimrc file: - - let tlist_cpp_settings = 'c++;c:class;f:function' - -In the above setting, 'cpp' is the Vim filetype name and 'c++' is the name -used by the exuberant ctags tool. 'c' and 'f' are the flags passed to -exuberant ctags to list C++ classes and functions and 'class' is the title -used for the class tags and 'function' is the title used for the function tags -in the taglist window. - -For example, to display only functions defined in a C file and to use "My -Functions" as the title for the function tags, use - - let tlist_c_settings = 'c;f:My Functions' - -When you set the tlist_xxx_settings variable, you will override the default -setting used by the taglist plugin for the 'xxx' language. You cannot add to -the default options used by the taglist plugin for a particular file type. To -add to the options used by the taglist plugin for a language, copy the option -values from the taglist plugin file to your .vimrc file and modify it. - -Adding support for a new language~ -If you want to add support for a new language to the taglist plugin, you need -to first extend the exuberant ctags tool. For more information about extending -exuberant ctags, visit the following page: - - http://ctags.sourceforge.net/EXTENDING.html - -To add support for a new language, set the tlist_xxx_settings variable in the -~/.vimrc file appropriately as described above. Replace 'xxx' in the variable -name with the Vim filetype name for the new language. - -For example, to extend the taglist plugin to support the latex language, you -can use the following line (assuming, you have already extended exuberant -ctags to support the latex language): - - let tlist_tex_settings='latex;b:bibitem;c:command;l:label' - -With the above line, when you edit files of filetype "tex" in Vim, the taglist -plugin will invoke the exuberant ctags tool passing the "latex" filetype and -the flags b, c and l to generate the tags. The text heading 'bibitem', -'command' and 'label' will be used in the taglist window for the tags which -are generated for the flags b, c and l respectively. - -============================================================================== - *taglist-faq* -10. Frequently Asked Questions~ - -Q. The taglist plugin doesn't work. The taglist window is empty and the tags - defined in a file are not displayed. -A. Are you using Vim version 6.0 and above? The taglist plugin relies on the - features supported by Vim version 6.0 and above. You can use the following - command to get the Vim version: -> - $ vim --version -< - Are you using exuberant ctags version 5.0 and above? The taglist plugin - relies on the features supported by exuberant ctags and will not work with - GNU ctags or the Unix ctags utility. You can use the following command to - determine whether the ctags installed in your system is exuberant ctags: -> - $ ctags --version -< - Is exuberant ctags present in one of the directories in your PATH? If not, - you need to set the Tlist_Ctags_Cmd variable to point to the location of - exuberant ctags. Use the following Vim command to verify that this is setup - correctly: -> - :echo system(Tlist_Ctags_Cmd . ' --version') -< - The above command should display the version information for exuberant - ctags. - - Did you turn on the Vim filetype detection? The taglist plugin relies on - the filetype detected by Vim and passes the filetype to the exuberant ctags - utility to parse the tags. Check the output of the following Vim command: -> - :filetype -< - The output of the above command should contain "filetype detection:ON". - To turn on the filetype detection, add the following line to the .vimrc or - _vimrc file: -> - filetype on -< - Is your version of Vim compiled with the support for the system() function? - The following Vim command should display 1: -> - :echo exists('*system') -< - In some Linux distributions (particularly Suse Linux), the default Vim - installation is built without the support for the system() function. The - taglist plugin uses the system() function to invoke the exuberant ctags - utility. You need to rebuild Vim after enabling the support for the - system() function. If you use the default build options, the system() - function will be supported. - - Do you have the |'shellslash'| option set? You can try disabling the - |'shellslash'| option. When the taglist plugin invokes the exuberant ctags - utility with the path to the file, if the incorrect slashes are used, then - you will see errors. - - Check the shell related Vim options values using the following command: -> - :set shell? shellcmdflag? shellpipe? - :set shellquote? shellredir? shellxquote? -< - If these options are set in your .vimrc or _vimrc file, try removing those - lines. - - Are you using a Unix shell in a MS-Windows environment? For example, - the Unix shell from the MKS-toolkit. Do you have the SHELL environment - set to point to this shell? You can try resetting the SHELL environment - variable. - - If you are using a Unix shell on MS-Windows, you should try to use - exuberant ctags that is compiled for Unix-like environments so that - exuberant ctags will understand path names with forward slash characters. - - Is your filetype supported by the exuberant ctags utility? The file types - supported by the exuberant ctags utility are listed in the ctags help. If a - file type is not supported, you have to extend exuberant ctags. You can use - the following command to list the filetypes supported by exuberant ctags: -> - ctags --list-languages -< - Run the following command from the shell prompt and check whether the tags - defined in your file are listed in the output from exuberant ctags: -> - ctags -f - --format=2 --excmd=pattern --fields=nks -< - If you see your tags in the output from the above command, then the - exuberant ctags utility is properly parsing your file. - - Do you have the .ctags or _ctags or the ctags.cnf file in your home - directory for specifying default options or for extending exuberant ctags? - If you do have this file, check the options in this file and make sure - these options are not interfering with the operation of the taglist plugin. - - If you are using MS-Windows, check the value of the TEMP and TMP - environment variables. If these environment variables are set to a path - with space characters in the name, then try using the DOS 8.3 short name - for the path or set them to a path without the space characters in the - name. For example, if the temporary directory name is "C:\Documents and - Settings\xyz\Local Settings\Temp", then try setting the TEMP variable to - the following: -> - set TEMP=C:\DOCUMEN~1\xyz\LOCALS~1\Temp -< - If exuberant ctags is installed in a directory with space characters in the - name, then try adding the directory to the PATH environment variable or try - setting the 'Tlist_Ctags_Cmd' variable to the shortest path name to ctags - or try copying the exuberant ctags to a path without space characters in - the name. For example, if exuberant ctags is installed in the directory - "C:\Program Files\Ctags", then try setting the 'Tlist_Ctags_Cmd' variable - as below: -> - let Tlist_Ctags_Cmd='C:\Progra~1\Ctags\ctags.exe' -< - If you are using a cygwin compiled version of exuberant ctags on MS-Windows, - make sure that either you have the cygwin compiled sort utility installed - and available in your PATH or compile exuberant ctags with internal sort - support. Otherwise, when exuberant ctags sorts the tags output by invoking - the sort utility, it may end up invoking the MS-Windows version of - sort.exe, thereby resulting in failure. - -Q. When I try to open the taglist window, I am seeing the following error - message. How do I fix this problem? - - Taglist: Failed to generate tags for /my/path/to/file - ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ... - -A. The taglist plugin will work only with the exuberant ctags tool. You - cannot use the GNU ctags or the Unix ctags program with the taglist plugin. - You will see an error message similar to the one shown above, if you try - use a non-exuberant ctags program with Vim. To fix this problem, either add - the exuberant ctags tool location to the PATH environment variable or set - the 'Tlist_Ctags_Cmd' variable. - -Q. A file has more than one tag with the same name. When I select a tag name - from the taglist window, the cursor is positioned at the incorrect tag - location. -A. The taglist plugin uses the search pattern generated by the exuberant ctags - utility to position the cursor at the location of a tag definition. If a - file has more than one tag with the same name and same prototype, then the - search pattern will be the same. In this case, when searching for the tag - pattern, the cursor may be positioned at the incorrect location. - -Q. I have made some modifications to my file and introduced new - functions/classes/variables. I have not yet saved my file. The taglist - plugin is not displaying the new tags when I update the taglist window. -A. The exuberant ctags utility will process only files that are present in the - disk. To list the tags defined in a file, you have to save the file and - then update the taglist window. - -Q. I have created a ctags file using the exuberant ctags utility for my source - tree. How do I configure the taglist plugin to use this tags file? -A. The taglist plugin doesn't use a tags file stored in disk. For every opened - file, the taglist plugin invokes the exuberant ctags utility to get the - list of tags dynamically. The Vim system() function is used to invoke - exuberant ctags and get the ctags output. This function internally uses a - temporary file to store the output. This file is deleted after the output - from the command is read. So you will never see the file that contains the - output of exuberant ctags. - -Q. When I set the |'updatetime'| option to a low value (less than 1000) and if - I keep pressing a key with the taglist window open, the current buffer - contents are changed. Why is this? -A. The taglist plugin uses the |CursorHold| autocmd to highlight the current - tag. The CursorHold autocmd triggers for every |'updatetime'| milliseconds. - If the |'updatetime'| option is set to a low value, then the CursorHold - autocmd will be triggered frequently. As the taglist plugin changes - the focus to the taglist window to highlight the current tag, this could - interfere with the key movement resulting in changing the contents of - the current buffer. The workaround for this problem is to not set the - |'updatetime'| option to a low value. - -============================================================================== - *taglist-license* -11. License~ -Permission is hereby granted to use and distribute the taglist plugin, with or -without modifications, provided that this copyright notice is copied with it. -Like anything else that's free, taglist.vim is provided *as is* and comes with -no warranty of any kind, either expressed or implied. In no event will the -copyright holder be liable for any damamges resulting from the use of this -software. - -============================================================================== - *taglist-todo* -12. Todo~ - -1. Group tags according to the scope and display them. For example, - group all the tags belonging to a C++/Java class -2. Support for displaying tags in a modified (not-yet-saved) file. -3. Automatically open the taglist window only for selected filetypes. - For other filetypes, close the taglist window. -4. When using the shell from the MKS toolkit, the taglist plugin - doesn't work. -5. The taglist plugin doesn't work with files edited remotely using the - netrw plugin. The exuberant ctags utility cannot process files over - scp/rcp/ftp, etc. - -============================================================================== - -vim:tw=78:ts=8:noet:ft=help: diff --git a/.vim/bundle/rbtweaks/plugin/a.vim b/.vim/bundle/rbtweaks/plugin/a.vim deleted file mode 100644 index 637feb5fe..000000000 --- a/.vim/bundle/rbtweaks/plugin/a.vim +++ /dev/null @@ -1,840 +0,0 @@ -" Copyright (c) 1998-2006 -" Michael Sharpe -" -" We grant permission to use, copy modify, distribute, and sell this -" software for any purpose without fee, provided that the above copyright -" notice and this text are not removed. We make no guarantee about the -" suitability of this software for any purpose and we are not liable -" for any damages resulting from its use. Further, we are under no -" obligation to maintain or extend this software. It is provided on an -" "as is" basis without any expressed or implied warranty. - -" Directory & regex enhancements added by Bindu Wavell who is well known on -" vim.sf.net -" -" Patch for spaces in files/directories from Nathan Stien (also reported by -" Soeren Sonnenburg) - -" Do not load a.vim if is has already been loaded. -if exists("loaded_alternateFile") - finish -endif -if (v:progname == "ex") - finish -endif -let loaded_alternateFile = 1 - -let alternateExtensionsDict = {} - -" setup the default set of alternate extensions. The user can override in thier -" .vimrc if the defaults are not suitable. To override in a .vimrc simply set a -" g:alternateExtensions_ variable to a comma separated list of alternates, -" where is the extension to map. -" E.g. let g:alternateExtensions_CPP = "inc,h,H,HPP,hpp" -" let g:alternateExtensions_{'aspx.cs'} = "aspx" - - -" This variable will be increased when an extension with greater number of dots -" is added by the AddAlternateExtensionMapping call. -let s:maxDotsInExtension = 1 - -" Function : AddAlternateExtensionMapping (PRIVATE) -" Purpose : simple helper function to add the default alternate extension -" mappings. -" Args : extension -- the extension to map -" alternates -- comma separated list of alternates extensions -" Returns : nothing -" Author : Michael Sharpe -function! AddAlternateExtensionMapping(extension, alternates) - " This code does not actually work for variables like foo{'a.b.c.d.e'} - "let varName = "g:alternateExtensions_" . a:extension - "if (!exists(varName)) - " let g:alternateExtensions_{a:extension} = a:alternates - "endif - - " This code handles extensions which contains a dot. exists() fails with - " such names. - "let v:errmsg = "" - " FIXME this line causes ex to return 1 instead of 0 for some reason?? - "silent! echo g:alternateExtensions_{a:extension} - "if (v:errmsg != "") - "let g:alternateExtensions_{a:extension} = a:alternates - "endif - - let g:alternateExtensionsDict[a:extension] = a:alternates - let dotsNumber = strlen(substitute(a:extension, "[^.]", "", "g")) - if s:maxDotsInExtension < dotsNumber - let s:maxDotsInExtension = dotsNumber - endif -endfunction - - -" Add all the default extensions -" Mappings for C and C++ -call AddAlternateExtensionMapping('h',"c,cpp,cxx,cc,CC") -call AddAlternateExtensionMapping('H',"C,CPP,CXX,CC") -call AddAlternateExtensionMapping('hpp',"cpp,c") -call AddAlternateExtensionMapping('HPP',"CPP,C") -call AddAlternateExtensionMapping('c',"h") -call AddAlternateExtensionMapping('C',"H") -call AddAlternateExtensionMapping('cpp',"h,hpp") -call AddAlternateExtensionMapping('CPP',"H,HPP") -call AddAlternateExtensionMapping('cc',"h") -call AddAlternateExtensionMapping('CC',"H,h") -call AddAlternateExtensionMapping('cxx',"h") -call AddAlternateExtensionMapping('CXX',"H") -" Mappings for PSL7 -call AddAlternateExtensionMapping('psl',"ph") -call AddAlternateExtensionMapping('ph',"psl") -" Mappings for ADA -call AddAlternateExtensionMapping('adb',"ads") -call AddAlternateExtensionMapping('ads',"adb") -" Mappings for lex and yacc files -call AddAlternateExtensionMapping('l',"y,yacc,ypp") -call AddAlternateExtensionMapping('lex',"yacc,y,ypp") -call AddAlternateExtensionMapping('lpp',"ypp,y,yacc") -call AddAlternateExtensionMapping('y',"l,lex,lpp") -call AddAlternateExtensionMapping('yacc',"lex,l,lpp") -call AddAlternateExtensionMapping('ypp',"lpp,l,lex") -" Mappings for OCaml -call AddAlternateExtensionMapping('ml',"mli") -call AddAlternateExtensionMapping('mli',"ml") -" ASP stuff -call AddAlternateExtensionMapping('aspx.cs', 'aspx') -call AddAlternateExtensionMapping('aspx.vb', 'aspx') -call AddAlternateExtensionMapping('aspx', 'aspx.cs,aspx.vb') - -" Setup default search path, unless the user has specified -" a path in their [._]vimrc. -if (!exists('g:alternateSearchPath')) - let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc' -endif - -" If this variable is true then a.vim will not alternate to a file/buffer which -" does not exist. E.g while editing a.c and the :A will not swtich to a.h -" unless it exists. -if (!exists('g:alternateNoDefaultAlternate')) - " by default a.vim will alternate to a file which does not exist - let g:alternateNoDefaultAlternate = 0 -endif - -" If this variable is true then a.vim will convert the alternate filename to a -" filename relative to the current working directory. -" Feature by Nathan Huizinga -if (!exists('g:alternateRelativeFiles')) - " by default a.vim will not convert the filename to one relative to the - " current working directory - let g:alternateRelativeFiles = 0 -endif - - -" Function : GetNthItemFromList (PRIVATE) -" Purpose : Support reading items from a comma seperated list -" Used to iterate all the extensions in an extension spec -" Used to iterate all path prefixes -" Args : list -- the list (extension spec, file paths) to iterate -" n -- the extension to get -" Returns : the nth item (extension, path) from the list (extension -" spec), or "" for failure -" Author : Michael Sharpe -" History : Renamed from GetNthExtensionFromSpec to GetNthItemFromList -" to reflect a more generic use of this function. -- Bindu -function! GetNthItemFromList(list, n) - let itemStart = 0 - let itemEnd = -1 - let pos = 0 - let item = "" - let i = 0 - while (i != a:n) - let itemStart = itemEnd + 1 - let itemEnd = match(a:list, ",", itemStart) - let i = i + 1 - if (itemEnd == -1) - if (i == a:n) - let itemEnd = strlen(a:list) - endif - break - endif - endwhile - if (itemEnd != -1) - let item = strpart(a:list, itemStart, itemEnd - itemStart) - endif - return item -endfunction - -" Function : ExpandAlternatePath (PRIVATE) -" Purpose : Expand path info. A path with a prefix of "wdr:" will be -" treated as relative to the working directory (i.e. the -" directory where vim was started.) A path prefix of "abs:" will -" be treated as absolute. No prefix or "sfr:" will result in the -" path being treated as relative to the source file (see sfPath -" argument). -" -" A prefix of "reg:" will treat the pathSpec as a regular -" expression substitution that is applied to the source file -" path. The format is: -" -" reg: -" -" seperator character, we often use one of [/|%#] -" is what you are looking for -" is the output pattern -" can be g for global replace or empty -" -" EXAMPLE: 'reg:/inc/src/g/' will replace every instance -" of 'inc' with 'src' in the source file path. It is possible -" to use match variables so you could do something like: -" 'reg:|src/\([^/]*\)|inc/\1||' (see 'help :substitute', -" 'help pattern' and 'help sub-replace-special' for more details -" -" NOTE: a.vim uses ',' (comma) internally so DON'T use it -" in your regular expressions or other pathSpecs unless you update -" the rest of the a.vim code to use some other seperator. -" -" Args : pathSpec -- path component (or substitution patterns) -" sfPath -- source file path -" Returns : a path that can be used by AlternateFile() -" Author : Bindu Wavell -function! ExpandAlternatePath(pathSpec, sfPath) - let prfx = strpart(a:pathSpec, 0, 4) - if (prfx == "wdr:" || prfx == "abs:") - let path = strpart(a:pathSpec, 4) - elseif (prfx == "reg:") - let re = strpart(a:pathSpec, 4) - let sep = strpart(re, 0, 1) - let patend = match(re, sep, 1) - let pat = strpart(re, 1, patend - 1) - let subend = match(re, sep, patend + 1) - let sub = strpart(re, patend+1, subend - patend - 1) - let flag = strpart(re, strlen(re) - 2) - if (flag == sep) - let flag = '' - endif - let path = substitute(a:sfPath, pat, sub, flag) - "call confirm('PAT: [' . pat . '] SUB: [' . sub . ']') - "call confirm(a:sfPath . ' => ' . path) - else - let path = a:pathSpec - if (prfx == "sfr:") - let path = strpart(path, 4) - endif - let path = a:sfPath . "/" . path - endif - return path -endfunction - -" Function : FindFileInSearchPath (PRIVATE) -" Purpose : Searches for a file in the search path list -" Args : filename -- name of the file to search for -" pathList -- the path list to search -" relPathBase -- the path which relative paths are expanded from -" Returns : An expanded filename if found, the empty string otherwise -" Author : Michael Sharpe (feline@irendi.com) -" History : inline code written by Bindu Wavell originally -function! FindFileInSearchPath(fileName, pathList, relPathBase) - let filepath = "" - let m = 1 - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = ExpandAlternatePath(pathSpec, a:relPathBase) - let fullname = path . "/" . a:fileName - let foundMatch = BufferOrFileExists(fullname) - if (foundMatch) - let filepath = fullname - break - endif - else - break - endif - let m = m + 1 - endwhile - endif - return filepath -endfunction - -" Function : FindFileInSearchPathEx (PRIVATE) -" Purpose : Searches for a file in the search path list -" Args : filename -- name of the file to search for -" pathList -- the path list to search -" relPathBase -- the path which relative paths are expanded from -" count -- find the count'th occurence of the file on the path -" Returns : An expanded filename if found, the empty string otherwise -" Author : Michael Sharpe (feline@irendi.com) -" History : Based on FindFileInSearchPath() but with extensions -function! FindFileInSearchPathEx(fileName, pathList, relPathBase, count) - let filepath = "" - let m = 1 - let spath = "" - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = ExpandAlternatePath(pathSpec, a:relPathBase) - if (spath != "") - let spath = spath . ',' - endif - let spath = spath . path - else - break - endif - let m = m + 1 - endwhile - endif - - if (&path != "") - if (spath != "") - let spath = spath . ',' - endif - let spath = spath . &path - endif - - let filepath = findfile(a:fileName, spath, a:count) - return filepath -endfunction - -" Function : EnumerateFilesByExtension (PRIVATE) -" Purpose : enumerates all files by a particular list of alternate extensions. -" Args : path -- path of a file (not including the file) -" baseName -- base name of the file to be expanded -" extension -- extension whose alternates are to be enumerated -" Returns : comma separated list of files with extensions -" Author : Michael Sharpe -function! EnumerateFilesByExtension(path, baseName, extension) - let enumeration = "" - let extSpec = "" - let v:errmsg = "" - silent! echo g:alternateExtensions_{a:extension} - if (v:errmsg == "") - let extSpec = g:alternateExtensions_{a:extension} - endif - if (extSpec == "") - if (has_key(g:alternateExtensionsDict, a:extension)) - let extSpec = g:alternateExtensionsDict[a:extension] - endif - endif - if (extSpec != "") - let n = 1 - let done = 0 - while (!done) - let ext = GetNthItemFromList(extSpec, n) - if (ext != "") - if (a:path != "") - let newFilename = a:path . "/" . a:baseName . "." . ext - else - let newFilename = a:baseName . "." . ext - endif - if (enumeration == "") - let enumeration = newFilename - else - let enumeration = enumeration . "," . newFilename - endif - else - let done = 1 - endif - let n = n + 1 - endwhile - endif - return enumeration -endfunction - -" Function : EnumerateFilesByExtensionInPath (PRIVATE) -" Purpose : enumerates all files by expanding the path list and the extension -" list. -" Args : baseName -- base name of the file -" extension -- extension whose alternates are to be enumerated -" pathList -- the list of paths to enumerate -" relPath -- the path of the current file for expansion of relative -" paths in the path list. -" Returns : A comma separated list of paths with extensions -" Author : Michael Sharpe -function! EnumerateFilesByExtensionInPath(baseName, extension, pathList, relPathBase) - let enumeration = "" - let filepath = "" - let m = 1 - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = ExpandAlternatePath(pathSpec, a:relPathBase) - let pe = EnumerateFilesByExtension(path, a:baseName, a:extension) - if (enumeration == "") - let enumeration = pe - else - let enumeration = enumeration . "," . pe - endif - else - break - endif - let m = m + 1 - endwhile - endif - return enumeration -endfunction - -" Function : DetermineExtension (PRIVATE) -" Purpose : Determines the extension of a filename based on the register -" alternate extension. This allow extension which contain dots to -" be considered. E.g. foo.aspx.cs to foo.aspx where an alternate -" exists for the aspx.cs extension. Note that this will only accept -" extensions which contain less than 5 dots. This is only -" implemented in this manner for simplicity...it is doubtful that -" this will be a restriction in non-contrived situations. -" Args : The path to the file to find the extension in -" Returns : The matched extension if any -" Author : Michael Sharpe (feline@irendi.com) -" History : idea from Tom-Erik Duestad -" Notes : there is some magic occuring here. The exists() function does not -" work well when the curly brace variable has dots in it. And why -" should it, dots are not valid in variable names. But the exists -" function is wierd too. Lets say foo_c does exist. Then -" exists("foo_c.e.f") will be true...even though the variable does -" not exist. However the curly brace variables do work when the -" variable has dots in it. E.g foo_{'c'} is different from -" foo_{'c.d.e'}...and foo_{'c'} is identical to foo_c and -" foo_{'c.d.e'} is identical to foo_c.d.e right? Yes in the current -" implementation of vim. To trick vim to test for existence of such -" variables echo the curly brace variable and look for an error -" message. -function! DetermineExtension(path) - let mods = ":t" - let i = 0 - while i <= s:maxDotsInExtension - let mods = mods . ":e" - let extension = fnamemodify(a:path, mods) - if (has_key(g:alternateExtensionsDict, extension)) - return extension - endif - let v:errmsg = "" - silent! echo g:alternateExtensions_{extension} - if (v:errmsg == "") - return extension - endif - let i = i + 1 - endwhile - return "" -endfunction - -" Function : AlternateFile (PUBLIC) -" Purpose : Opens a new buffer by looking at the extension of the current -" buffer and finding the corresponding file. E.g. foo.c <--> foo.h -" Args : accepts one argument. If present it used the argument as the new -" extension. -" Returns : nothing -" Author : Michael Sharpe -" History : + When an alternate can't be found in the same directory as the -" source file, a search path will be traversed looking for the -" alternates. -" + Moved some code into a separate function, minor optimization -" + rework to favor files in memory based on complete enumeration of -" all files extensions and paths -function! AlternateFile(splitWindow, ...) - let extension = DetermineExtension(expand("%:p")) - let baseName = substitute(expand("%:t"), "\." . extension . '$', "", "") - let currentPath = expand("%:p:h") - - if (a:0 != 0) - let newFullname = currentPath . "/" . baseName . "." . a:1 - call FindOrCreateBuffer(newFullname, a:splitWindow, 0) - else - let allfiles = "" - if (extension != "") - let allfiles1 = EnumerateFilesByExtension(currentPath, baseName, extension) - let allfiles2 = EnumerateFilesByExtensionInPath(baseName, extension, g:alternateSearchPath, currentPath) - - if (allfiles1 != "") - if (allfiles2 != "") - let allfiles = allfiles1 . ',' . allfiles2 - else - let allfiles = allfiles1 - endif - else - let allfiles = allfiles2 - endif - endif - - if (allfiles != "") - let bestFile = "" - let bestScore = 0 - let score = 0 - let n = 1 - - let onefile = GetNthItemFromList(allfiles, n) - let bestFile = onefile - while (onefile != "" && score < 2) - let score = BufferOrFileExists(onefile) - if (score > bestScore) - let bestScore = score - let bestFile = onefile - endif - let n = n + 1 - let onefile = GetNthItemFromList(allfiles, n) - endwhile - - if (bestScore == 0 && g:alternateNoDefaultAlternate == 1) - echo "No existing alternate available" - else - call FindOrCreateBuffer(bestFile, a:splitWindow, 1) - let b:AlternateAllFiles = allfiles - endif - else - echo "No alternate file/buffer available" - endif - endif -endfunction - -" Function : AlternateOpenFileUnderCursor (PUBLIC) -" Purpose : Opens file under the cursor -" Args : splitWindow -- indicates how to open the file -" Returns : Nothing -" Author : Michael Sharpe (feline@irendi.com) www.irendi.com -function! AlternateOpenFileUnderCursor(splitWindow,...) - let cursorFile = (a:0 > 0) ? a:1 : expand("") - let currentPath = expand("%:p:h") - let openCount = 1 - - let fileName = FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, openCount) - if (fileName != "") - call FindOrCreateBuffer(fileName, a:splitWindow, 1) - let b:openCount = openCount - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - echo "Can't find file" - endif -endfunction - -" Function : AlternateOpenNextFile (PUBLIC) -" Purpose : Opens the next file corresponding to the search which found the -" current file -" Args : bang -- indicates what to do if the current file has not been -" saved -" Returns : nothing -" Author : Michael Sharpe (feline@irendi.com) www.irendi.com -function! AlternateOpenNextFile(bang) - let cursorFile = "" - if (exists("b:cursorFile")) - let cursorFile = b:cursorFile - endif - - let currentPath = "" - if (exists("b:currentPath")) - let currentPath = b:currentPath - endif - - let openCount = 0 - if (exists("b:openCount")) - let openCount = b:openCount + 1 - endif - - if (cursorFile != "" && currentPath != "" && openCount != 0) - let fileName = FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, openCount) - if (fileName != "") - call FindOrCreateBuffer(fileName, "n".a:bang, 0) - let b:openCount = openCount - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - let fileName = FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, 1) - if (fileName != "") - call FindOrCreateBuffer(fileName, "n".a:bang, 0) - let b:openCount = 1 - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - echo "Can't find next file" - endif - endif - endif -endfunction - -comm! -nargs=? -bang IH call AlternateOpenFileUnderCursor("n", ) -comm! -nargs=? -bang IHS call AlternateOpenFileUnderCursor("h", ) -comm! -nargs=? -bang IHV call AlternateOpenFileUnderCursor("v", ) -comm! -nargs=? -bang IHT call AlternateOpenFileUnderCursor("t", ) -comm! -nargs=? -bang IHN call AlternateOpenNextFile("") -imap ih :IHS -nmap ih :IHS -imap is :IHS:A -nmap is :IHS:A -imap ihn :IHN -nmap ihn :IHN - -"function! PrintList(theList) -" let n = 1 -" let oneFile = GetNthItemFromList(a:theList, n) -" while (oneFile != "") -" let n = n + 1 -" let oneFile = GetNthItemFromList(a:theList, n) -" endwhile -"endfunction - -" Function : NextAlternate (PUBLIC) -" Purpose : Used to cycle through any other alternate file which existed on -" the search path. -" Args : bang (IN) - used to implement the AN vs AN! functionality -" Returns : nothing -" Author : Michael Sharpe -function! NextAlternate(bang) - if (exists('b:AlternateAllFiles')) - let currentFile = expand("%") - let n = 1 - let onefile = GetNthItemFromList(b:AlternateAllFiles, n) - while (onefile != "" && !EqualFilePaths(fnamemodify(onefile,":p"), fnamemodify(currentFile,":p"))) - let n = n + 1 - let onefile = GetNthItemFromList(b:AlternateAllFiles, n) - endwhile - - if (onefile != "") - let stop = n - let n = n + 1 - let foundAlternate = 0 - let nextAlternate = "" - while (n != stop) - let nextAlternate = GetNthItemFromList(b:AlternateAllFiles, n) - if (nextAlternate == "") - let n = 1 - continue - endif - let n = n + 1 - if (EqualFilePaths(fnamemodify(nextAlternate, ":p"), fnamemodify(currentFile, ":p"))) - continue - endif - if (filereadable(nextAlternate)) - " on cygwin filereadable("foo.H") returns true if "foo.h" exists - if (has("unix") && $WINDIR != "" && fnamemodify(nextAlternate, ":p") ==? fnamemodify(currentFile, ":p")) - continue - endif - let foundAlternate = 1 - break - endif - endwhile - if (foundAlternate == 1) - let s:AlternateAllFiles = b:AlternateAllFiles - "silent! execute ":e".a:bang." " . nextAlternate - call FindOrCreateBuffer(nextAlternate, "n".a:bang, 0) - let b:AlternateAllFiles = s:AlternateAllFiles - else - echo "Only this alternate file exists" - endif - else - echo "Could not find current file in alternates list" - endif - else - echo "No other alternate files exist" - endif -endfunction - -comm! -nargs=? -bang A call AlternateFile("n", ) -comm! -nargs=? -bang AS call AlternateFile("h", ) -comm! -nargs=? -bang AV call AlternateFile("v", ) -comm! -nargs=? -bang AT call AlternateFile("t", ) -comm! -nargs=? -bang AN call NextAlternate("") - -" Function : BufferOrFileExists (PRIVATE) -" Purpose : determines if a buffer or a readable file exists -" Args : fileName (IN) - name of the file to check -" Returns : 2 if it exists in memory, 1 if it exists, 0 otherwise -" Author : Michael Sharpe -" History : Updated code to handle buffernames using just the -" filename and not the path. -function! BufferOrFileExists(fileName) - let result = 0 - - let lastBuffer = bufnr("$") - let i = 1 - while i <= lastBuffer - if EqualFilePaths(expand("#".i.":p"), a:fileName) - let result = 2 - break - endif - let i = i + 1 - endwhile - - if (!result) - let bufName = fnamemodify(a:fileName,":t") - let memBufName = bufname(bufName) - if (memBufName != "") - let memBufBasename = fnamemodify(memBufName, ":t") - if (bufName == memBufBasename) - let result = 2 - endif - endif - - if (!result) - let result = bufexists(bufName) || bufexists(a:fileName) || filereadable(a:fileName) - endif - endif - - if (!result) - let result = filereadable(a:fileName) - endif - return result -endfunction - -" Function : FindOrCreateBuffer (PRIVATE) -" Purpose : searches the buffer list (:ls) for the specified filename. If -" found, checks the window list for the buffer. If the buffer is in -" an already open window, it switches to the window. If the buffer -" was not in a window, it switches to that buffer. If the buffer did -" not exist, it creates it. -" Args : filename (IN) -- the name of the file -" doSplit (IN) -- indicates whether the window should be split -" ("v", "h", "n", "v!", "h!", "n!", "t", "t!") -" findSimilar (IN) -- indicate weather existing buffers should be -" prefered -" Returns : nothing -" Author : Michael Sharpe -" History : + bufname() was not working very well with the possibly strange -" paths that can abound with the search path so updated this -" slightly. -- Bindu -" + updated window switching code to make it more efficient -- Bindu -" Allow ! to be applied to buffer/split/editing commands for more -" vim/vi like consistency -" + implemented fix from Matt Perry -function! FindOrCreateBuffer(fileName, doSplit, findSimilar) - " Check to see if the buffer is already open before re-opening it. - let FILENAME = escape(a:fileName, ' ') - let bufNr = -1 - let lastBuffer = bufnr("$") - let i = 1 - if (a:findSimilar) - while i <= lastBuffer - if EqualFilePaths(expand("#".i.":p"), a:fileName) - let bufNr = i - break - endif - let i = i + 1 - endwhile - - if (bufNr == -1) - let bufName = bufname(a:fileName) - let bufFilename = fnamemodify(a:fileName,":t") - - if (bufName == "") - let bufName = bufname(bufFilename) - endif - - if (bufName != "") - let tail = fnamemodify(bufName, ":t") - if (tail != bufFilename) - let bufName = "" - endif - endif - if (bufName != "") - let bufNr = bufnr(bufName) - let FILENAME = bufName - endif - endif - endif - - if (g:alternateRelativeFiles == 1) - let FILENAME = fnamemodify(FILENAME, ":p:.") - endif - - let splitType = a:doSplit[0] - let bang = a:doSplit[1] - if (bufNr == -1) - " Buffer did not exist....create it - let v:errmsg="" - if (splitType == "h") - silent! execute ":split".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vsplit".bang." " . FILENAME - elseif (splitType == "t") - silent! execute ":tab split".bang." " . FILENAME - else - silent! execute ":e".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - else - - " Find the correct tab corresponding to the existing buffer - let tabNr = -1 - " iterate tab pages - for i in range(tabpagenr('$')) - " get the list of buffers in the tab - let tabList = tabpagebuflist(i + 1) - let idx = 0 - " iterate each buffer in the list - while idx < len(tabList) - " if it matches the buffer we are looking for... - if (tabList[idx] == bufNr) - " ... save the number - let tabNr = i + 1 - break - endif - let idx = idx + 1 - endwhile - if (tabNr != -1) - break - endif - endfor - " switch the the tab containing the buffer - if (tabNr != -1) - execute "tabn ".tabNr - endif - - " Buffer was already open......check to see if it is in a window - let bufWindow = bufwinnr(bufNr) - if (bufWindow == -1) - " Buffer was not in a window so open one - let v:errmsg="" - if (splitType == "h") - silent! execute ":sbuffer".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vert sbuffer " . FILENAME - elseif (splitType == "t") - silent! execute ":tab sbuffer " . FILENAME - else - silent! execute ":buffer".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - else - " Buffer is already in a window so switch to the window - execute bufWindow."wincmd w" - if (bufWindow != winnr()) - " something wierd happened...open the buffer - let v:errmsg="" - if (splitType == "h") - silent! execute ":split".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vsplit".bang." " . FILENAME - elseif (splitType == "t") - silent! execute ":tab split".bang." " . FILENAME - else - silent! execute ":e".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - endif - endif - endif -endfunction - -" Function : EqualFilePaths (PRIVATE) -" Purpose : Compares two paths. Do simple string comparison anywhere but on -" Windows. On Windows take into account that file paths could differ -" in usage of separators and the fact that case does not matter. -" "c:\WINDOWS" is the same path as "c:/windows". has("win32unix") Vim -" version does not count as one having Windows path rules. -" Args : path1 (IN) -- first path -" path2 (IN) -- second path -" Returns : 1 if path1 is equal to path2, 0 otherwise. -" Author : Ilya Bobir -function! EqualFilePaths(path1, path2) - if has("win16") || has("win32") || has("win64") || has("win95") - return substitute(a:path1, "\/", "\\", "g") ==? substitute(a:path2, "\/", "\\", "g") - else - return a:path1 == a:path2 - endif -endfunction diff --git a/.vim/bundle/rbtweaks/plugin/autoclose.vim b/.vim/bundle/rbtweaks/plugin/autoclose.vim deleted file mode 100644 index 6b2366bfb..000000000 --- a/.vim/bundle/rbtweaks/plugin/autoclose.vim +++ /dev/null @@ -1,241 +0,0 @@ -" File: autoclose.vim -" Author: Karl Guertin -" Version: 1.2 -" Last Modified: June 18, 2009 -" Description: AutoClose, closes what's opened. -" -" This plugin closes opened parenthesis, braces, brackets, quotes as you -" type them. As of 1.1, if you type the open brace twice ({{), the closing -" brace will be pushed down to a new line. -" -" You can enable or disable this plugin by typing \a (or a if you -" changed your Leader char). You can define your own mapping and will need -" to do so if you have something else mapped to \a since this plugin won't -" clobber your mapping. Here's how to map \x: -" -" nmap x ToggleAutoCloseMappings -" -" You'll also probably want to know you can type ( if mswin is -" set) and the next character you type doesn't have mappings applied. This -" is useful when you want to insert only an opening paren or something. -" -" NOTE: If you're using this on a terminal and your arrow keys are broken, -" be sure to :set ttimeout and :set ttimeoutlen=100 -" -" Version Changes: --------------------------------------------------{{{2 -" 1.2 -- Fixed some edge cases where double the closing characters are -" entered when exiting insert mode. -" Finally (!) reproduced the arrow keys problem other people were -" running into and fixed. -" Typing a closing character will now behave consistently (jump -" out) regardless of the plugin's internal state. -" -" As a part of the close fix, I've opted to not try tracking the -" position of the closing characters through all the things that -" could be done with them, so arrowing/jumping around and not -" winding up back where you started will cause the input to not be -" repeatable. -" June 18, 2009 -" 1.1.2 -- Fixed a mapping typo and caught a double brace problem, -" September 20, 2007 -" 1.1.1 -- Missed a bug in 1.1, September 19, 2007 -" 1.1 -- When not inserting at the end, previous version would eat chars -" at end of line, added double open->newline, September 19, 2007 -" 1.0.1 -- Cruft from other parts of the mapping, knew I shouldn't have -" released the first as 1.0, April 3, 2007 - -" Setup -----------------------------------------------------{{{2 -if exists('g:autoclose_loaded') || &cp - finish -endif - - -let g:autoclose_loaded = 1 -let s:cotstate = &completeopt - -if !exists('g:autoclose_on') - let g:autoclose_on = 1 -endif - -" (Toggle) Mappings -----------------------------{{{1 -" -nmap ToggleAutoCloseMappings :call ToggleAutoCloseMappings() -if (!hasmapto( 'ToggleAutoCloseMappings', 'n' )) - nmap a ToggleAutoCloseMappings -endif -fun ToggleAutoCloseMappings() " --- {{{2 - if g:autoclose_on - iunmap " - iunmap ' - iunmap ( - iunmap ) - iunmap [ - iunmap ] - iunmap { - iunmap } - iunmap - iunmap - iunmap - let g:autoclose_on = 0 - echo "AutoClose Off" - else - inoremap " =QuoteDelim('"') - inoremap ' =match(getline('.')[col('.') - 2],'\w') == 0 && getline('.')[col('.')-1] != "'" ? "'" : QuoteDelim("'") - inoremap ( (=CloseStackPush(')') - inoremap ) =CloseStackPop(')') - inoremap [ [=CloseStackPush(']') - inoremap ] =CloseStackPop(']') - "inoremap { {=CloseStackPush('}') - inoremap { =OpenSpecial('{','}') - inoremap } =CloseStackPop('}') - inoremap =OpenCloseBackspace() - inoremap =OpenCloseBackspace() - inoremap =CloseStackPop('') - inoremap =CloseStackPop('') - "the following simply creates an ambiguous mapping so vim fully - "processes the escape sequence for terminal keys, see 'ttimeout' for a - "rough explanation, this just forces it to work - if &term[:4] == "xterm" - inoremap OC - endif - let g:autoclose_on = 1 - if a:0 == 0 - "this if is so this message doesn't show up at load - echo "AutoClose On" - endif - endif -endf -let s:closeStack = [] - -" AutoClose Utilities -----------------------------------------{{{1 -function OpenSpecial(ochar,cchar) " ---{{{2 - let line = getline('.') - let col = col('.') - 2 - "echom string(col).':'.line[:(col)].'|'.line[(col+1):] - if a:ochar == line[(col)] && a:cchar == line[(col+1)] "&& strlen(line) - (col) == 2 - "echom string(s:closeStack) - while len(s:closeStack) > 0 - call remove(s:closeStack, 0) - endwhile - return "\a\;\".a:cchar."\\"_xk$\"_xa" - endif - return a:ochar.CloseStackPush(a:cchar) -endfunction - -function CloseStackPush(char) " ---{{{2 - "echom "push" - let line = getline('.') - let col = col('.')-2 - if (col) < 0 - call setline('.',a:char.line) - else - "echom string(col).':'.line[:(col)].'|'.line[(col+1):] - call setline('.',line[:(col)].a:char.line[(col+1):]) - endif - call insert(s:closeStack, a:char) - "echom join(s:closeStack,'').' -- '.a:char - return '' -endf - -function JumpOut(char) " ----------{{{2 - let column = col('.') - 1 - let line = getline('.') - let mcol = match(line[column :], a:char) - if a:char != '' && mcol >= 0 - "Yeah, this is ugly but vim actually requires each to be special - "cased to avoid screen flashes/not doing the right thing. - echom len(line).' '.(column+mcol) - if line[column] == a:char - return "\" - elseif column+mcol == len(line)-1 - return "\A" - else - return "\f".a:char."\" - endif - else - return a:char - endif -endf -function CloseStackPop(char) " ---{{{2 - "echom "pop" - if(a:char == '') - pclose - endif - if len(s:closeStack) == 0 - return JumpOut(a:char) - endif - let column = col('.') - 1 - let line = getline('.') - let popped = '' - let lastpop = '' - "echom join(s:closeStack,'').' || '.lastpop - while len(s:closeStack) > 0 && ((lastpop == '' && popped == '') || lastpop != a:char) - let lastpop = remove(s:closeStack,0) - let popped .= lastpop - "echom join(s:closeStack,'').' || '.lastpop.' || '.popped - endwhile - "echom ' --> '.popped - if line[column : column+strlen(popped)-1] != popped - return JumpOut('') - endif - if column > 0 - call setline('.',line[:column-1].line[(column+strlen(popped)):]) - else - call setline('.','') - endif - return popped -endf - -function QuoteDelim(char) " ---{{{2 - let line = getline('.') - let col = col('.') - if line[col - 2] == "\\" - "Inserting a quoted quotation mark into the string - return a:char - elseif line[col - 1] == a:char - "Escaping out of the string - return "\=".s:SID()."CloseStackPop(\"\\".a:char."\")\" - else - "Starting a string - return a:char."\=".s:SID()."CloseStackPush(\"\\".a:char."\")\" - endif -endf - -" The strings returned from QuoteDelim aren't in scope for , so I -" have to fake it using this function (from the Vim help, but tweaked) -function s:SID() - return matchstr(expand(''), '\d\+_\zeSID$') -endfun - -function OpenCloseBackspace() " ---{{{2 - "if pumvisible() - " pclose - " call StopOmni() - " return "\" - "else - let curline = getline('.') - let curpos = col('.') - let curletter = curline[curpos-1] - let prevletter = curline[curpos-2] - if (prevletter == '"' && curletter == '"') || -\ (prevletter == "'" && curletter == "'") || -\ (prevletter == "(" && curletter == ")") || -\ (prevletter == "{" && curletter == "}") || -\ (prevletter == "[" && curletter == "]") - if len(s:closeStack) > 0 - call remove(s:closeStack,0) - endif - return "\\" - else - return "\" - endif - "endif -endf - -" Initialization ----------------------------------------{{{1 -if g:autoclose_on - let g:autoclose_on = 0 - silent call ToggleAutoCloseMappings() -endif -" vim: set ft=vim ff=unix et sw=4 ts=4 : -" vim600: set foldmethod=marker foldmarker={{{,}}} foldlevel=1 : diff --git a/.vim/bundle/rbtweaks/plugin/bufexplorer.vim b/.vim/bundle/rbtweaks/plugin/bufexplorer.vim deleted file mode 100644 index 3514a7dd5..000000000 --- a/.vim/bundle/rbtweaks/plugin/bufexplorer.vim +++ /dev/null @@ -1,1140 +0,0 @@ -"============================================================================== -" Copyright: Copyright (C) 2001-2010 Jeff Lanzarotta -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" bufexplorer.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damages -" resulting from the use of this software. -" Name Of File: bufexplorer.vim -" Description: Buffer Explorer Vim Plugin -" Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com) -" Last Changed: Tuesday, 16 Feb 2010 -" Version: See g:bufexplorer_version for version number. -" Usage: This file should reside in the plugin directory and be -" automatically sourced. -" -" You may use the default keymappings of -" -" be - Opens BE. -" bs - Opens horizontally window BE. -" bv - Opens vertically window BE. -" -" Or you can use -" -" ":BufExplorer" - Opens BE. -" ":BufExplorerHorizontalSplit" - Opens horizontally window BE. -" ":BufExplorerVerticalSplit" - Opens vertically window BE. -" -" For more help see supplied documentation. -" History: See supplied documentation. -"============================================================================== - -" Exit quickly if already running or when 'compatible' is set. {{{1 -if exists("g:bufexplorer_version") || &cp - finish -endif -"1}}} - -" Version number -let g:bufexplorer_version = "7.2.7" - -" Check for Vim version 700 or greater {{{1 -if v:version < 700 - echo "Sorry, bufexplorer ".g:bufexplorer_version."\nONLY runs with Vim 7.0 and greater." - finish -endif - -" Public Interface {{{1 -if maparg("be") =~ 'BufExplorer' - nunmap be -endif - -if maparg("bs") =~ 'BufExplorerHorizontalSplit' - nunmap bs -endif - -if maparg("bv") =~ 'BufExplorerVerticalSplit' - nunmap bv -endif - -nmap