diff options
author | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 16:55:42 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 16:58:10 -0500 |
commit | e5dfb045b994e1ab8fef9ef5d3f02ce20ea6b685 (patch) | |
tree | ba74287d80e46c70dab8c4311a1dc933fbfbdea1 /dot_vim | |
parent | fix pager again (diff) |
many more renames
Diffstat (limited to 'dot_vim')
332 files changed, 63041 insertions, 0 deletions
diff --git a/dot_vim/README.csupport b/dot_vim/README.csupport new file mode 100644 index 0000000..27ca4a9 --- /dev/null +++ b/dot_vim/README.csupport @@ -0,0 +1,188 @@ +README for c.vim (Version 5.0.5) / November 21 2007 + + * DESCRIPTION + * INSTALLATION + * RELEASE NOTES + * FILES + * ADDITIONAL TIPS + * CREDITS + +======================================================================================= + DESCRIPTION +======================================================================================= +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 indent or code checkers can be done with a keystroke. There +are many additional hints and options which can improve speed and comfort when +writing C/C++. See the help file csupport.txt for more information. + +======================================================================================= + INSTALLATION +======================================================================================= +The subdirectories in the zip archive cvim.zip mirror the directory structure +which is needed below the local installation directory $HOME/.vim/ for LINUX/UNIX +($VIM/vimfiles/ for Windows; find the value of $VIM with ":echo $VIM" from inside Vim). + +(0) Save the template files in '$HOME/.vim/c-support/templates/Templates' if + you have changed any of them. + +(1) Copy the zip archive cvim.zip to $HOME/.vim and run + + unzip cvim.zip + + If you have already an older version of cvim and you have modified the template + files you may want to save your templates first or copy the files from the + archive by hand. + +(2) 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. + +(3) Set at least some personal details in the file '$HOME/.vim/c-support/templates/Templates' + (file '$VIM\/c-support/templates/Templates' under Windows). + Here is the minimal personalization (my settings as an example, of course): + + |AUTHOR| = Dr. Fritz Mehner + |AUTHORREF| = mn + |EMAIL| = mehner@fh-swf.de + |COMPANY| = FH Südwestfalen, Iserlohn + |COPYRIGHT| = Copyright (c) |YEAR|, |AUTHOR| + + (Read more about the template system in the plugin documentation) + +(4) Consider additional settings in the file '$HOME/.vimrc'. + The files customization.vimrc and customization.gvimrc are replacements or + extensions for your .vimrc and .gvimrc ( _vimrc and _gvimrc under Windows). + You may want to use parts of them. The files are documented. + +There are a lot of features and options which can be used and influenced: + + * use of template files and tags + * surround marked blocks with statements + * using and managing personal code snippets + * generate/remove multiline comments + * picking up prototypes + * C/C++ dictionaries for keyword completion + * (re)moving the root menu + +Restart gVim/Vim generate the help tags + + :helptags ~/.vim/doc + +and look at csupport help with + + :help csupport + +or use the 'help' entry in the root menu of this plug-in. + + +-----------------------------------------------+ + | +-------------------------------------------+ | + | | ** PLEASE READ THE DOCUMENTATION ** | | + | | Actions differ for different modes! | | + | +-------------------------------------------+ | + +-----------------------------------------------+ + +Any problems ? See the TROUBLESHOOTING section at the end of the help file +'doc/csupport.txt'. + +======================================================================================= + RELEASE NOTES FOR VERSION 5.0.5 +======================================================================================= ++ Bugfix: on a few systems doubling of path components in the run command (F9). + Skip this upgrade if you do not have this problem. + + OLDER RELEASE NOTES : see file 'ChangeLog' +======================================================================================= + +======================================================================================= + FILES +======================================================================================= + +README.csupport This file. + +doc/csupport.txt The help file for the local on-line help. + +ftplugin/c.vim A file type plug-in. Define hotkeys, creates a local + dictionary for each C/C++ file. + +plugin/c.vim The C/C++ plug-in for GVIM. + +c-support/scripts/wrapper.sh The wrapper script for the use of an xterm. +c-support/templates/* C-style and C++-style template files (see csupport.txt). + + +c-support/wordlists/c-c++-keywords.list All C and C++ keywords (already in word.list). +c-support/wordlists/k+r.list K&R-Book: Words from the table of content. + They appear frequently in comments. +c-support/wordlists/stl_index.list STL: method and type names. + + +----------------------- ------------------------------------------------------------- + The following files and extensions are for convenience only. + c.vim will work without them. + ------------------------------------------------------------- +c-support/doc/c-hotkeys.pdf Hotkey reference card. +c-support/doc/ChangeLog The change log. + +rc/customization.ctags Additional settings I use in .ctags to enable navigation + through makefiles ans qmake files with the plug-in taglist.vim. + +rc/costumization.gvimrc Additional settings I use in .gvimrc : + hot keys, mouse settings, ... + The file is commented. Append it to your .gvimrc if you like. + +rc/costumization.indent.pro Additional settings I use in .indent.pro : + See the indent manual. + +rc/costumization.vimrc Additional settings I use in .vimrc : incremental search, + tabstop, hot keys, font, use of dictionaries, ... + The file is commented. Append it to your .vimrc if you like. + +======================================================================================= + ADDITIONAL 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 entry). + +(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). + +======================================================================================= + CREDITS +======================================================================================= + + Some ideas are taken from the following documents: + + 1. Recommended C Style and Coding Standards (Indian Hill Style Guide) + www.doc.ic.ac.uk/lab/secondyear/cstyle/cstyle.html + 2. Programming in C++, Ellemtel Telecommunication Systems Laboratories + www.it.bton.ac.uk/burks/burks/language/cpp/cppstyle/ellhome.htm + 3. C++ Coding Standard, Todd Hoff + www.possibility.com/Cpp/CppCodingStandard.html + + The splint error format is taken from the file splint.vim (Vim standard distribution). + +------------------ + + ... finally + + Johann Wolfgang von Goethe (1749-1832), the greatest of the German poets, + about LINUX, Vim/gVim and other great tools (Ok, almost.) : + + Ein Mann, der recht zu wirken denkt, Who on efficient work is bent, + Muß auf das beste Werkzeug halten. Must choose the fittest instrument. + + Faust, Teil 1, Vorspiel auf dem Theater Faust, Part 1, Prologue for the Theatre + +======================================================================================= diff --git a/dot_vim/autoload/haskellmode.vim b/dot_vim/autoload/haskellmode.vim new file mode 100644 index 0000000..ce20a67 --- /dev/null +++ b/dot_vim/autoload/haskellmode.vim @@ -0,0 +1,155 @@ +" +" utility functions for haskellmode plugins +" +" (Claus Reinke; last modified: 23/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + + + +" find start/extent of name/symbol under cursor; +" return start, symbolic flag, qualifier, unqualified id +" (this is used in both haskell_doc.vim and in GHC.vim) +function! haskellmode#GetNameSymbol(line,col,off) + let name = "[a-zA-Z0-9_']" + let symbol = "[-!#$%&\*\+/<=>\?@\\^|~:.]" + "let [line] = getbufline(a:buf,a:lnum) + let line = a:line + + " find the beginning of unqualified id or qualified id component + let start = (a:col - 1) + a:off + if line[start] =~ name + let pattern = name + elseif line[start] =~ symbol + let pattern = symbol + else + return [] + endif + while start > 0 && line[start - 1] =~ pattern + let start -= 1 + endwhile + let id = matchstr(line[start :],pattern.'*') + " call confirm(id) + + " expand id to left and right, to get full id + let idPos = id[0] == '.' ? start+2 : start+1 + let posA = match(line,'\<\(\([A-Z]'.name.'*\.\)\+\)\%'.idPos.'c') + let start = posA>-1 ? posA+1 : idPos + let posB = matchend(line,'\%'.idPos.'c\(\([A-Z]'.name.'*\.\)*\)\('.name.'\+\|'.symbol.'\+\)') + let end = posB>-1 ? posB : idPos + + " special case: symbolic ids starting with . + if id[0]=='.' && posA==-1 + let start = idPos-1 + let end = posB==-1 ? start : end + endif + + " classify full id and split into qualifier and unqualified id + let fullid = line[ (start>1 ? start-1 : 0) : (end-1) ] + let symbolic = fullid[-1:-1] =~ symbol " might also be incomplete qualified id ending in . + let qualPos = matchend(fullid, '\([A-Z]'.name.'*\.\)\+') + let qualifier = qualPos>-1 ? fullid[ 0 : (qualPos-2) ] : '' + let unqualId = qualPos>-1 ? fullid[ qualPos : -1 ] : fullid + " call confirm(start.'/'.end.'['.symbolic.']:'.qualifier.' '.unqualId) + + return [start,symbolic,qualifier,unqualId] +endfunction + +function! haskellmode#GatherImports() + let imports={0:{},1:{}} + let i=1 + while i<=line('$') + let res = haskellmode#GatherImport(i) + if !empty(res) + let [i,import] = res + let prefixPat = '^import\s*\(qualified\)\?\s\+' + let modulePat = '\([A-Z][a-zA-Z0-9_''.]*\)' + let asPat = '\(\s\+as\s\+'.modulePat.'\)\?' + let hidingPat = '\(\s\+hiding\s*\((.*)\)\)\?' + let listPat = '\(\s*\((.*)\)\)\?' + let importPat = prefixPat.modulePat.asPat.hidingPat.listPat ".'\s*$' + + let ml = matchlist(import,importPat) + if ml!=[] + let [_,qualified,module,_,as,_,hiding,_,explicit;x] = ml + let what = as=='' ? module : as + let hidings = split(hiding[1:-2],',') + let explicits = split(explicit[1:-2],',') + let empty = {'lines':[],'hiding':hidings,'explicit':[],'modules':[]} + let entry = has_key(imports[1],what) ? imports[1][what] : deepcopy(empty) + let imports[1][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module) + if !(qualified=='qualified') + let imports[0][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module) + endif + else + echoerr "haskellmode#GatherImports doesn't understand: ".import + endif + endif + let i+=1 + endwhile + if !has_key(imports[1],'Prelude') + let imports[0]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + let imports[1]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + endif + return imports +endfunction + +function! haskellmode#ListElem(list,elem) + for e in a:list | if e==a:elem | return 1 | endif | endfor + return 0 +endfunction + +function! haskellmode#ListIntersect(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)!=-1 | let l += [e] | endif | endfor + return l +endfunction + +function! haskellmode#ListUnion(list1,list2) + let l = [] + for e in a:list2 | if index(a:list1,e)==-1 | let l += [e] | endif | endfor + return a:list1 + l +endfunction + +function! haskellmode#ListWithout(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)==-1 | let l += [e] | endif | endfor + return l +endfunction + +function! haskellmode#MergeImport(entry,line,hiding,explicit,module) + let lines = a:entry['lines'] + [ a:line ] + let hiding = a:explicit==[] ? haskellmode#ListIntersect(a:entry['hiding'], a:hiding) + \ : haskellmode#ListWithout(a:entry['hiding'],a:explicit) + let explicit = haskellmode#ListUnion(a:entry['explicit'], a:explicit) + let modules = haskellmode#ListUnion(a:entry['modules'], [ a:module ]) + return {'lines':lines,'hiding':hiding,'explicit':explicit,'modules':modules} +endfunction + +" collect lines belonging to a single import statement; +" return number of last line and collected import statement +" (assume opening parenthesis, if any, is on the first line) +function! haskellmode#GatherImport(lineno) + let lineno = a:lineno + let import = getline(lineno) + if !(import=~'^import\s') | return [] | endif + let open = strlen(substitute(import,'[^(]','','g')) + let close = strlen(substitute(import,'[^)]','','g')) + while open!=close + let lineno += 1 + let linecont = getline(lineno) + let open += strlen(substitute(linecont,'[^(]','','g')) + let close += strlen(substitute(linecont,'[^)]','','g')) + let import .= linecont + endwhile + return [lineno,import] +endfunction + +function! haskellmode#UrlEncode(string) + let pat = '\([^[:alnum:]]\)' + let code = '\=printf("%%%02X",char2nr(submatch(1)))' + let url = substitute(a:string,pat,code,'g') + return url +endfunction + diff --git a/dot_vim/autoload/pythoncomplete.vim b/dot_vim/autoload/pythoncomplete.vim new file mode 120000 index 0000000..2b8df41 --- /dev/null +++ b/dot_vim/autoload/pythoncomplete.vim @@ -0,0 +1 @@ +../ftplugin/pythoncomplete.vim
\ No newline at end of file diff --git a/dot_vim/c-support/codesnippets/Makefile b/dot_vim/c-support/codesnippets/Makefile new file mode 100644 index 0000000..2208944 --- /dev/null +++ b/dot_vim/c-support/codesnippets/Makefile @@ -0,0 +1,178 @@ +#======================================================================================= +# +# Filename: Makefile +# Description: +# +# Usage: make (generate executable ) +# make clean (remove objects, executable, prerequisits ) +# make tarball (generate compressed archive ) +# make zip (generate compressed archive ) +# +# Version: 1.0 +# Created: +# Revision: --- +# +# Author: +# Company: +# Email: +# +# Notes: C extension : c +# C++ extensions : cc cpp C +# C and C++ sources can be mixed. +# Prerequisites are generated automatically; makedepend is not +# needed (see documentation for GNU make Version 3.80, July 2002, +# section 4.13). The utility sed is used. +# +#============================================== makefile template version 1.6 ========== + +# ------------ name of the executable ------------------------------------------------ +EXECUTABLE = main + +# ------------ list of all source files ---------------------------------------------- +SOURCES = main.c + +# ------------ compiler -------------------------------------------------------------- +CC = gcc +CXX = g++ + +# ------------ compiler flags -------------------------------------------------------- +CFLAGS = -Wall -O0 -g # Do not optimize. Produce debugging information. + +# ------------ linker-Flags ---------------------------------------------------------- +LFLAGS = -g + +# ------------ additional system include directories --------------------------------- +GLOBAL_INC_DIR = + +# ------------ private include directories ------------------------------------------- +LOCAL_INC_DIR = $(HOME)/include + +# ------------ system libraries (e.g. -lm ) ----------------------------------------- +SYS_LIBS = -lm + +# ------------ additional system library directories --------------------------------- +GLOBAL_LIB_DIR = + +# ------------ additional system libraries ------------------------------------------- +GLOBAL_LIBS = + +# ------------ private library directories ------------------------------------------- +LOCAL_LIB_DIR = $(HOME)/lib + +# ------------ private libraries (e.g. libxyz.a ) ----------------------------------- +LOCAL_LIBS = + +# ------------ archive generation ----------------------------------------------------- +TARBALL_EXCLUDE = *.{o,gz,zip} +ZIP_EXCLUDE = *.{o,gz,zip} + +# ------------ run executable out of this Makefile (yes/no) ------------------------- +# ------------ cmd line parameters for this executable ------------------------------- +EXE_START = no +EXE_CMDLINE = + +#======================================================================================= +# The following statements usually need not to be changed +#======================================================================================= + +C_SOURCES = $(filter %.c, $(SOURCES)) +CPP_SOURCES = $(filter-out %.c, $(SOURCES)) +ALL_INC_DIR = $(addprefix -I, $(LOCAL_INC_DIR) $(GLOBAL_INC_DIR)) +ALL_LIB_DIR = $(addprefix -L, $(LOCAL_LIB_DIR) $(GLOBAL_LIB_DIR)) +GLOBAL_LIBSS = $(addprefix $(GLOBAL_LIB_DIR)/, $(GLOBAL_LIBS)) +LOCAL_LIBSS = $(addprefix $(LOCAL_LIB_DIR)/, $(LOCAL_LIBS)) +ALL_CFLAGS = $(CFLAGS) $(ALL_INC_DIR) +ALL_LFLAGS = $(LFLAGS) $(ALL_LIB_DIR) +BASENAMES = $(basename $(SOURCES)) + +# ------------ generate the names of the object files -------------------------------- +OBJECTS = $(addsuffix .o,$(BASENAMES)) + +# ------------ generate the names of the hidden prerequisite files ------------------- +PREREQUISITES = $(addprefix .,$(addsuffix .d,$(BASENAMES))) + +# ------------ make the executable --------------------------------------------------- +$(EXECUTABLE): $(OBJECTS) +ifeq ($(strip $(CPP_SOURCES)),) + $(CC) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS) +else + $(CXX) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS) +endif +ifeq ($(EXE_START),yes) + ./$(EXECUTABLE) $(EXE_CMDLINE) +endif + +# ------------ include the automatically generated prerequisites --------------------- +# ------------ if target is not clean, tarball or zip --------------------- +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),tarball) +ifneq ($(MAKECMDGOALS),zip) +include $(PREREQUISITES) +endif +endif +endif + +# ------------ make the objects ------------------------------------------------------ +%.o: %.c + $(CC) -c $(ALL_CFLAGS) $< + +%.o: %.cc + $(CXX) -c $(ALL_CFLAGS) $< + +%.o: %.cpp + $(CXX) -c $(ALL_CFLAGS) $< + +%.o: %.C + $(CXX) -c $(ALL_CFLAGS) $< + +# ------------ make the prerequisites ------------------------------------------------ +# +.%.d: %.c + @$(make-prerequisite-c) + +.%.d: %.cc + @$(make-prerequisite-cplusplus) + +.%.d: %.cpp + @$(make-prerequisite-cplusplus) + +.%.d: %.C + @$(make-prerequisite-cplusplus) + +# canned command sequences +# echoing of the sed command is suppressed by the leading @ + +define make-prerequisite-c + @$(CC) -MM $(ALL_CFLAGS) $< > $@.$$$$; \ + sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \ + rm -f $@.$$$$; +endef + +define make-prerequisite-cplusplus + @$(CXX) -MM $(ALL_CFLAGS) $< > $@.$$$$; \ + sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \ + rm -f $@.$$$$; +endef + +# ------------ remove generated files ------------------------------------------------ +# ------------ remove hidden backup files -------------------------------------------- +clean: + rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES) *~ + +# ------------ tarball generation ------------------------------------------------------ +tarball: + @lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ + rm --force $$lokaldir.tar.gz; \ + tar --exclude=$(TARBALL_EXCLUDE) \ + --create \ + --gzip \ + --verbose \ + --file $$lokaldir.tar.gz * + +# ------------ zip --------------------------------------------------------------------- +zip: + @lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ + zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE) + +# ====================================================================================== +# vim: set tabstop=2: set shiftwidth=2: diff --git a/dot_vim/c-support/codesnippets/Makefile.multi-target.template b/dot_vim/c-support/codesnippets/Makefile.multi-target.template new file mode 100644 index 0000000..75da8dd --- /dev/null +++ b/dot_vim/c-support/codesnippets/Makefile.multi-target.template @@ -0,0 +1,70 @@ +#=============================================================================== +# +# File: Makefile +# Description: +# +# Usage: make (generate executable(s) ) +# make clean (remove objects, executables, prerequisits ) +# make tarball (generate compressed archive ) +# make zip (generate compressed archive ) +# +# Author: Dr.-Ing. Fritz Mehner +# Email: mehner@mfh-iserlohn.de +# Created: +# +#=============================================================================== + + +CC = gcc +CCP = g++ +CFLAGS = -c -g -Wall +LFLAGS = -g +SYS_LIBS = -lm +TARBALL_EXCLUDE = "*.{o,gz,zip}" +ZIP_EXCLUDE = *.o *.gz *.zip + +TARGETS = target_1 target_2 + +#---------- targets -------------------------------------- +all: $(TARGETS) + +%.o: %.c + $(CC) $(CFLAGS) $*.c + +%.o: %.cc + $(CCP) $(CFLAGS) $*.cc + +#---------- target 1 ------------------------------------- +# C target +target_1: target_1.o + $(CC) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) + +#---------- target 2 ------------------------------------- +# C++ target +target_2: target_2.o + $(CCP) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) + + +#---------- target 3 ------------------------------------- + + + +#---------- tarball -------------------------------------- +tarball: + lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ + rm --force $$lokaldir.tar.gz; \ + tar --exclude=$(TARBALL_EXCLUDE) \ + --create \ + --gzip \ + --verbose \ + --file $$lokaldir.tar.gz * + +#---------- zip ------------------------------------------ +zip: + lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ + zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE) + +#---------- clear up ------------------------------------- +clean: + rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES) + diff --git a/dot_vim/c-support/codesnippets/calloc_double_matrix.c b/dot_vim/c-support/codesnippets/calloc_double_matrix.c new file mode 100644 index 0000000..ec71658 --- /dev/null +++ b/dot_vim/c-support/codesnippets/calloc_double_matrix.c @@ -0,0 +1,36 @@ + +/* + * === FUNCTION ====================================================================== + * Name: calloc_double_matrix + * Description: Allocate a dynamic double-matrix of size rows*columns; + * return a pointer. + * ===================================================================================== + */ + double** +calloc_double_matrix ( int rows, int columns ) +{ + int i; + double **m; + m = calloc ( rows, sizeof(double*) ); /* allocate pointer array */ + assert( m != NULL); /* abort if allocation failed */ + *m = calloc ( rows*columns, sizeof(double) );/* allocate data array */ + assert(*m != NULL); /* abort if allocation failed */ + for ( i=1; i<rows; i+=1 ) /* set pointers */ + m[i] = m[i-1] + columns; + return m; +} /* ---------- end of function calloc_double_matrix ---------- */ + +/* + * === FUNCTION ====================================================================== + * Name: free_matrix_double + * Description: Free a dynamic double-matrix. + * ===================================================================================== + */ + void +free_double_matrix ( double **m ) +{ + free(*m); /* free data array */ + free( m); /* free pointer array */ + return ; +} /* ---------- end of function free_double_matrix ---------- */ + diff --git a/dot_vim/c-support/codesnippets/calloc_int_matrix.c b/dot_vim/c-support/codesnippets/calloc_int_matrix.c new file mode 100644 index 0000000..e21215b --- /dev/null +++ b/dot_vim/c-support/codesnippets/calloc_int_matrix.c @@ -0,0 +1,35 @@ + +/* + * === FUNCTION ====================================================================== + * Name: calloc_int_matrix + * Description: Allocate a dynamic int-matrix of size rows*columns; return a pointer. + * ===================================================================================== + */ +int** +calloc_int_matrix ( int rows, int columns ) +{ + int i; + int **m; + m = calloc ( rows, sizeof(int*) ); /* allocate pointer array */ + assert( m != NULL ); /* abort if allocation failed */ + *m = calloc ( rows*columns, sizeof(int) ); /* allocate data array */ + assert(*m != NULL ); /* abort if allocation failed */ + for ( i=1; i<rows; i+=1 ) /* set pointers */ + m[i] = m[i-1] + columns; + return m; +} /* ---------- end of function calloc_int_matrix ---------- */ + +/* + * === FUNCTION ====================================================================== + * Name: free_int_matrix + * Description: Free a dynamic int-matrix. + * ===================================================================================== + */ +void +free_int_matrix ( int **m ) +{ + free(*m); /* free data array */ + free( m); /* free pointer array */ + return ; +} /* ---------- end of function free_int_matrix ---------- */ + diff --git a/dot_vim/c-support/codesnippets/main.c b/dot_vim/c-support/codesnippets/main.c new file mode 100644 index 0000000..770f5d5 --- /dev/null +++ b/dot_vim/c-support/codesnippets/main.c @@ -0,0 +1,20 @@ +#include <errno.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* + * === FUNCTION ====================================================================== + * Name: main + * Description: main function + * ===================================================================================== + */ + int +main ( int argc, char *argv[] ) +{ + printf ("\nProgram %s\n\n", argv[0] ); + + return EXIT_SUCCESS; +} /* ---------- end of function main ---------- */ + diff --git a/dot_vim/c-support/codesnippets/main.cc b/dot_vim/c-support/codesnippets/main.cc new file mode 100644 index 0000000..d87f891 --- /dev/null +++ b/dot_vim/c-support/codesnippets/main.cc @@ -0,0 +1,18 @@ +#include <fstream> +#include <iomanip> +#include <iostream> + +using namespace std; + +// === FUNCTION ====================================================================== +// Name: main +// Description: main function +// ===================================================================================== + int +main ( int argc, char *argv[] ) +{ + cout << "\nProgram " << argv[0] << endl << endl; + + return EXIT_SUCCESS; +} // ---------- end of function main ---------- + diff --git a/dot_vim/c-support/codesnippets/print_double_array.c.noindent b/dot_vim/c-support/codesnippets/print_double_array.c.noindent new file mode 100644 index 0000000..6ced53a --- /dev/null +++ b/dot_vim/c-support/codesnippets/print_double_array.c.noindent @@ -0,0 +1,30 @@ + +/* + * === FUNCTION ====================================================================== + * Name: print_double_array + * Description: Print a double-array with one dimension. + * Use + * print_int_array( *matrix, n1*n2, n2, "matrix" ); + * for + * double matrix[n1][n2]; + * ===================================================================================== + */ +static void +print_double_array ( double array[], /* array to print */ + int n, /* number of elements to print */ + int nrow, /* number of elements per row */ + char *arrayname /* array name */ + ) +{ + int i; + printf ("\n\n array \"%s\", length %d\n", arrayname, n ); + for ( i=0; i<n; i+=1 ) + { + if( i%nrow == 0 ) + printf ("\n%6d : ", i ); + printf (" %8.2f", array[i] ); + } + printf ("\n\n"); + return ; +} /* ---------- end of function print_double_array ---------- */ + diff --git a/dot_vim/c-support/codesnippets/print_int_array.c.noindent b/dot_vim/c-support/codesnippets/print_int_array.c.noindent new file mode 100644 index 0000000..02d53c0 --- /dev/null +++ b/dot_vim/c-support/codesnippets/print_int_array.c.noindent @@ -0,0 +1,30 @@ + +/* + * === FUNCTION ====================================================================== + * Name: print_int_array + * Description: Print an int-array with one dimension. + * Use + * print_int_array( *matrix, n1*n2, n2, "matrix" ); + * for + * int matrix[n1][n2]; + * ===================================================================================== + */ +static void +print_int_array ( int array[], /* array to print */ + int n, /* number of elements to print */ + int nrow, /* number of elements per row */ + char *arrayname /* array name */ + ) +{ + int i; + printf ("\n\n array \"%s\", length %d\n", arrayname, n ); + for ( i=0; i<n; i+=1 ) + { + if( i%nrow == 0 ) + printf ("\n%6d : ", i ); + printf (" %6d", array[i] ); + } + printf ("\n\n"); + return ; +} /* ---------- end of function print_int_array ---------- */ + diff --git a/dot_vim/c-support/doc/ChangeLog b/dot_vim/c-support/doc/ChangeLog new file mode 100644 index 0000000..d0d4fd4 --- /dev/null +++ b/dot_vim/c-support/doc/ChangeLog @@ -0,0 +1,304 @@ +======================================================================================= + RELEASE NOTES FOR VERSION 5.0.4 +======================================================================================= ++ Format for the macros |DATE|, |TIME|, and |YEAR| can be defined by the user. ++ Help text improved. + +======================================================================================= + RELEASE NOTES FOR VERSION 5.0.3 +======================================================================================= ++ Code snippets can now be used in the console mode (Vim without GUI). ++ Bugfix: Possible conflict with 'indent' removed when inserting templates. + +======================================================================================= + RELEASE NOTES FOR VERSION 5.0.2 +======================================================================================= ++ Bugfix: Prototype picker did not alway delete no longer used prototypes. ++ Bugfix: Prototype picker removed template specializations from parameter lists. + +======================================================================================= + RELEASE NOTES FOR VERSION 5.0.1 +======================================================================================= ++ Bugfix: autocmd setting can influence autocmd settings of OTHER plugins. + +======================================================================================= + RELEASE NOTES FOR VERSION 5.0 +======================================================================================= ++ Completely new template system. Now every menu item is user definable. ++ Changes to allow a system-wide installation. ++ A few hotkeys added and renamed. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.6.1 +======================================================================================= ++ New global variable to control the filetype of *.h header files (default is now 'cpp'). ++ Bugfix: properly resetting 'compiler' after using make, splint, and CodeCheck. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.6 +======================================================================================= ++ New insert mode mappings (comments, statements, preprocessing, idioms, C++). ++ Some mappings renamed (easier to remember). ++ New tag (basename of a file reduced to characters allowed in names). + +======================================================================================= + RELEASE NOTES FOR VERSION 4.5 +======================================================================================= ++ New menu item and hotkey for the (re)alignement of end-of-line comments. ++ Hotkey \cn removed. Only one menu item for end-of-line comments left. ++ Changed hotkeys: \ce -> \cl and \cl -> \cs . ++ Three new tags (giving the basename of a file) for writing template files. ++ Prototype picker handles template methods. ++ Bugfix: splint works now under Windows. ++ Minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.4 +======================================================================================= ++ Plugin directories rearranged. ++ main- and for-idiom have a visual mode now. ++ Four new commands (command line) to control the comment style. ++ Comment style (C/C++) can automatically follow the filetype. ++ Bugfix: empty new file after removing the header template can't be closed. ++ Bugfix : Tools entry missing when root menu not shown from the start. ++ Minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.3 +======================================================================================= ++ CodeCheck (TM) integrated (source code analysing tool). ++ New key mappings for preprocessor statements. ++ New preprocessor menu. ++ Bugfix: indent under Windows. ++ Minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.2.1 +======================================================================================= ++ Bugfix: change needed for some menu names after patch 7.0.054 . + +======================================================================================= + RELEASE NOTES FOR VERSION 4.2 +======================================================================================= ++ Setting the starting column for trailing comments improved. ++ Small bug in block uncommenting fixed. ++ Mac OS X : circumvent a Vim bug which caused a crash when loading plugin version 4.1. ++ File syntax/c.vim removed (but see help in csupport.txt). + +======================================================================================= + RELEASE NOTES FOR VERSION 4.1 +======================================================================================= ++ A complete switch statement can be made from a list of labels. ++ Additional cases can be made from a list of labels. ++ Small bug in line end commenting fixed. ++ Some minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 4.0 +======================================================================================= + ++ Kernighan & Ritchie style for block statements can be enabled. ++ Changes to make it compatible with Vim 7. ++ Set C/C++ file type for source files which should not be preprocessed (*.i, *.ii). ++ Some minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.11 +======================================================================================= + ++ Hotkeys and an accompanying reference card added. ++ Preparation for syntax based folding. ++ Some minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.10 +======================================================================================= + ++ Remove "#if 0 ... #endif" from the inside. ++ Change C comments to C++ comments and vice versa. ++ try..catch / catch / catch(...) now can be set surround a marked area. ++ Prototype picking improved (for C++). ++ A hardcopy shows the localized date and time in the header line. ++ New help menu entry in the main menu of this plugin (shows the plugin documentation). ++ Switch between corresponding source and header files with <S-F2> if the plugin a.vim + is present. ++ Plugin can be used with autocompletion for (, [, and { . + +======================================================================================= + RELEASE NOTES FOR VERSION 3.9.1 +======================================================================================= + ++ Doubling of file header for new c- and h-files under Windows fixed (Thanks to + Fabricio C A Oliveira). ++ Tiny bug in the file open idioms fixed. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.9 +======================================================================================= + ++ Formatter 'indent' integrated. ++ Bugfix in the automatic header insertion. ++ Assert idiom added. ++ #if 0 ... #endif statement for blocking out code added. ++ Minor stylistic improvements in some idioms. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.8.2 +======================================================================================= + ++ Screen update problem solved: color inversion under FC4 (Thanks to Bernie Barton). ++ RTTI menu : additional v-mode. ++ Statement menu and C++ menu rearranged. ++ Include guard : name generation improved. ++ File header templates will be included for additional file extensions (cp, cxx, c++, ...). + +======================================================================================= + RELEASE NOTES FOR VERSION 3.8.1 +======================================================================================= + ++ More C++ output manipulators, manipulator insertion more intuitive. ++ Output into buffer: cursor goes to top of file. ++ Makefile template improved (code snippet). ++ Some internal improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.8 +======================================================================================= + ++ Windows support. Most features are now available under Windows. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.7.2 +======================================================================================= + ++ Run buffer through splint (A tool for statically checking C programs; see + http://www.splint.org). An error window will be opened; quickfix commands can be used. ++ Set buffer related command line arguments for splint. ++ Line end comments start in a fixed column (can be set from the menu). ++ Spaces in path names and file names are now possible. ++ Template files and snippet files are no longer kept in the list of alternate files. ++ Some minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.7.1 +======================================================================================= + ++ Bug fixed (command line arguments not passed to the executable). ++ File extension for executables can be set. ++ Minor improvements. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.7 +======================================================================================= + ++ Running a program: + (1) Run program from the gVim command line. + (2) Run program and direct the output into a window with name "C-Output". + This buffer and its content will disappear when closing the window. + The buffer is reused when still open. + (3) Run program in an xterm (adjustable). ++ Command line arguments are now buffer related (each buffer can have its own arguments). ++ Code snippets can be protected from being indented during insertion. ++ Picked up prototypes will be deleted after insertion. ++ A code snippet with the file name extension "ni" or "noindent" will not be + indented on insertion. ++ for- and calloc-/malloc-idioms improved. ++ Bug fixed (word list handling). + + +======================================================================================= + RELEASE NOTES FOR VERSION 3.6 +======================================================================================= + ++ Installation simplified. ++ for-loop-idiom asks for control variable, initial value, ... ++ malloc-idiom asks for pointer variable and size. ++ Toggling the comment style works correct again. ++ Empty error windows will be closed. ++ Prototype picker removes trailing parts of the function body if marked. ++ The dialog windows (GUI) have been replaced by more flexible command line inputs. ++ The undocumented and unnecessary hot key F12 has been removed. ++ Extension to ctags + taglist shows makefile targets and qmake targets. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.5 +======================================================================================= + ++ Aligned line end comments for consecutive lines. ++ Improved prototype picker removes comments. ++ Picked up prototypes can be shown. ++ Uncomment more than one block at once. ++ 3 new idioms. ++ Help file improved . + +======================================================================================= + RELEASE NOTES FOR VERSION 3.4 +======================================================================================= + ++ Two new global variables: C_Dictionary_File, C_MenuHeader . ++ The preprocessor statements #if... and the function idiom include marked + lines when invoked in visual mode. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.3 +======================================================================================= + ++ The C/C++ root menu can be disabled. + +======================================================================================= + RELEASE NOTES FOR VERSION 3.2 +======================================================================================= + ++ Only one C/C++ entry in the gVim root menu. ++ All hotkeys are only defined for C/C++ files (file type plugin added). ++ The following constructs are now read as templates from files: + class, class using new, + template class, template class using new, + error class ++ Install script added. ++ Customization improved. ++ Documentation improved (help file added). ++ Bug fix (template file handling) + +======================================================================================= + RELEASE NOTES FOR VERSION 3.1 +======================================================================================= + ++ When the comment style "C" is active the menu entry "Comments.code->comment" + turns a marked region in one multiline C-comment. ++ The menu entry "Comments.comment->code" turns marked multiline C-comment + back into code. ++ A marked region can be surrounded by a for-, if, if-else, while-, do-while-statement + (with indentation). ++ The menu entry "Snippets.make prototype" makes a C- or C++-prototype from + the current line or marked region and puts it in an internal buffer. ++ The menu entry "Snippets.add prototype" also makes a C- or C++-prototype from + the current line or a marked region and adds it to the internal buffer. ++ The menu entry "Snippets.put prototype" inserts all gathered prototypes + below the current line. ++ Tag substitution rewritten (Some characters in a substitution text for a tag + prevented the tag from being substituted). + +======================================================================================= + RELEASE NOTES FOR VERSION 3.0 +======================================================================================= + ++ C-style comments AND C++-style comments are supported now. ++ The menu entry 'Comments->Comment style ..' switches the styles (toggle). ++ Block comments are now read as templates or skeletons from files: + Frame Block, Function Description, Method Description, + Class Description, H+file header, C/C++-file header ++ These templates can contain tags like |FILENAME|, |AUTHOR| etc. which are replaced + after reading (KDevelop templates can be used without any change). ++ indentation: multiline inserts and code snippets will be indented after insertion. ++ Most menu entries are now also active in normal mode. ++ new menu items: + includes for the C99 header, + includes for the standard C++ header, + includes for the C++ version of the Standard C Library header, + multiline C comment + vim modeline ++ Reading the templates is done in one function which can be called in an autocmd. ++ Code cleanup: register z no longer used. Most function calls are silent now. + + diff --git a/dot_vim/c-support/doc/c-hotkeys.pdf b/dot_vim/c-support/doc/c-hotkeys.pdf Binary files differnew file mode 100644 index 0000000..07a6c7c --- /dev/null +++ b/dot_vim/c-support/doc/c-hotkeys.pdf diff --git a/dot_vim/c-support/rc/customization.ctags b/dot_vim/c-support/rc/customization.ctags new file mode 100644 index 0000000..75ccd5a --- /dev/null +++ b/dot_vim/c-support/rc/customization.ctags @@ -0,0 +1,7 @@ + +--regex-make=/^([^:# \t]+)[ \t]*[:]{1,2}/\1/t,targets/ + +--langdef=qmake +--langmap=qmake:+.pro +--regex-qmake=/^([[:upper:]_]+)/\1/t,SystemVariables/ + diff --git a/dot_vim/c-support/rc/customization.gvimrc b/dot_vim/c-support/rc/customization.gvimrc new file mode 100644 index 0000000..ff3d690 --- /dev/null +++ b/dot_vim/c-support/rc/customization.gvimrc @@ -0,0 +1,44 @@ +" +"=============================================================================== +"========== example gvimrc from the distribution ============================== +"=============================================================================== +" +runtime gvimrc_example.vim +" +" +"=============================================================================== +"========== CUSTOMIZATION (gvimrc) =========================================== +"=============================================================================== +" +"------------------------------------------------------------------------------- +" Moving cursor to other windows +" +" shift down : change window focus to lower one (cyclic) +" shift up : change window focus to upper one (cyclic) +" shift left : change window focus to one on left +" shift right : change window focus to one on right +"------------------------------------------------------------------------------- +" +nmap <s-down> <c-w>w +nmap <s-up> <c-w>W +nmap <s-left> <c-w>h +nmap <s-right> <c-w>l +" +" +"------------------------------------------------------------------------------- +" some additional hot keys +"------------------------------------------------------------------------------- +" S-F3 - call gvim file browser +"------------------------------------------------------------------------------- +" + map <silent> <s-F3> :silent browse confirm e<CR> +imap <silent> <s-F3> <Esc>:silent browse confirm e<CR> +" +" +"------------------------------------------------------------------------------- +" toggle insert mode <--> 'normal mode with the <RightMouse>-key +"------------------------------------------------------------------------------- +" +nmap <RightMouse> <Insert> +imap <RightMouse> <ESC> +" diff --git a/dot_vim/c-support/rc/customization.indent.pro b/dot_vim/c-support/rc/customization.indent.pro new file mode 100644 index 0000000..95f6081 --- /dev/null +++ b/dot_vim/c-support/rc/customization.indent.pro @@ -0,0 +1,8 @@ +--blank-lines-after-procedures +--brace-indent0 +--comment-indentation49 +--declaration-comment-column49 +--declaration-indentation10 +--space-after-parentheses +--swallow-optional-blank-lines +--tab-size2 diff --git a/dot_vim/c-support/rc/customization.vimrc b/dot_vim/c-support/rc/customization.vimrc new file mode 100644 index 0000000..f9ab5a7 --- /dev/null +++ b/dot_vim/c-support/rc/customization.vimrc @@ -0,0 +1,149 @@ +" +"=============================================================================== +"========== load example vimrc from the distribution ========================= +"=============================================================================== +" +runtime vimrc_example.vim +" +filetype plugin on +" +"=============================================================================== +"========== CUSTOMIZATION (vimrc) ============================================ +"=============================================================================== +" +" Platform specific items: +" - central backup directory (has to be created) +" - default dictionary +" Uncomment your choice. +if has("win16") || has("win32") || has("win64") || + \ has("win95") || has("win32unix") + " +" runtime mswin.vim +" set backupdir =$VIM\vimfiles\backupdir +" set dictionary=$VIM\vimfiles\wordlists/german.list +else +" set backupdir =$HOME/.vim.backupdir +" set dictionary=$HOME/.vim/wordlists/german.list +endif +" +" Using a backupdir under UNIX/Linux: you may want to include a line similar to +" find $HOME/.vim.backupdir -name "*" -type f -mtime +60 -exec rm -f {} \; +" in one of your shell startup files (e.g. $HOME/.profile) +" +"------------------------------------------------------------------------------- +" Use of dictionaries +"------------------------------------------------------------------------------- +" +set complete+=k " scan the files given with the 'dictionary' option +" +"------------------------------------------------------------------------------- +" Various settings +"------------------------------------------------------------------------------- +" +set autoread " read open files again when changed outside Vim +set autowrite " write a modified buffer on each :next , ... +set browsedir =current " which directory to use for the file browser +set incsearch " use incremental search +set nowrap " do not wrap lines +set shiftwidth =2 " number of spaces to use for each step of indent +set tabstop =2 " number of spaces that a <Tab> in the file counts for +set visualbell " visual bell instead of beeping +" +" +"------------------------------------------------------------------------------- +" some additional hot keys +"------------------------------------------------------------------------------- +" F2 - write file without confirmation +" F3 - call file explorer Ex +" F4 - show tag under curser in the preview window (tagfile must exist!) +" F5 - open quickfix error window +" F6 - close quickfix error window +" F7 - display previous error +" F8 - display next error +" S-Tab - Fast switching between buffers (see below) +" C-q - Leave the editor with Ctrl-q (see below) +"------------------------------------------------------------------------------- +" +map <silent> <F2> :write<CR> +map <silent> <F3> :Explore<CR> +nmap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR> +map <silent> <F5> :copen<CR> +map <silent> <F6> :cclose<CR> +map <silent> <F7> :cp<CR> +map <silent> <F8> :cn<CR> +" +imap <silent> <F2> <Esc>:write<CR> +imap <silent> <F3> <Esc>:Explore<CR> +imap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR> +imap <silent> <F5> <Esc>:copen<CR> +imap <silent> <F6> <Esc>:cclose<CR> +imap <silent> <F7> <Esc>:cp<CR> +imap <silent> <F8> <Esc>:cn<CR> +" +"------------------------------------------------------------------------------- +" Fast switching between buffers +" The current buffer will be saved before switching to the next one. +" Choose :bprevious or :bnext +"------------------------------------------------------------------------------- +" + map <silent> <s-tab> <Esc>:if &modifiable && !&readonly && + \ &modified <CR> :write<CR> :endif<CR>:bprevious<CR> +imap <silent> <s-tab> <Esc>:if &modifiable && !&readonly && + \ &modified <CR> :write<CR> :endif<CR>:bprevious<CR> +" +"------------------------------------------------------------------------------- +" Leave the editor with Ctrl-q : Write all changed buffers and exit Vim +"------------------------------------------------------------------------------- +nmap <C-q> :wqa<CR> +" +"------------------------------------------------------------------------------- +" autocomplete parenthesis, brackets and braces +"------------------------------------------------------------------------------- +inoremap ( ()<Left> +inoremap [ []<Left> +inoremap { {}<Left> +" +vnoremap ( s()<Esc>P<Right>% +vnoremap [ s[]<Esc>P<Right>% +vnoremap { s{}<Esc>P<Right>% +" +"------------------------------------------------------------------------------- +" Change the working directory to the directory containing the current file +"------------------------------------------------------------------------------- +if has("autocmd") + autocmd BufEnter * :lchdir %:p:h +endif " has("autocmd") +" +"------------------------------------------------------------------------------- +" Filename completion +" +" wildmenu : command-line completion operates in an enhanced mode +" wildignore : A file that matches with one of these +" patterns is ignored when completing file or directory names. +"------------------------------------------------------------------------------- +" +set wildmenu +set wildignore=*.bak,*.o,*.e,*~ +" +"------------------------------------------------------------------------------- +" print options (pc = percentage of the media size) +"------------------------------------------------------------------------------- +set printoptions=left:8pc,right:3pc +" +"------------------------------------------------------------------------------- +" taglist.vim : toggle the taglist window +" taglist.vim : define the title texts for make +" taglist.vim : define the title texts for qmake +"------------------------------------------------------------------------------- + noremap <silent> <F11> <Esc><Esc>:Tlist<CR> +inoremap <silent> <F11> <Esc><Esc>:Tlist<CR> + +let tlist_make_settings = 'make;m:makros;t:targets' + +let tlist_qmake_settings = 'qmake;t:SystemVariables' + +if has("autocmd") + " ---------- qmake : set filetype for *.pro ---------- + autocmd BufNewFile,BufRead *.pro set filetype=qmake +endif " has("autocmd") + diff --git a/dot_vim/c-support/scripts/wrapper.sh b/dot_vim/c-support/scripts/wrapper.sh new file mode 100644 index 0000000..55d9961 --- /dev/null +++ b/dot_vim/c-support/scripts/wrapper.sh @@ -0,0 +1,34 @@ +#!/bin/bash +#=============================================================================== +# FILE: wrapper.sh +# USAGE: ./wrapper.sh executable [cmd-line-args] +# DESCRIPTION: Wraps the execution of a programm or script. +# Use with xterm: xterm -e wrapper.sh executable cmd-line-args +# This script is used by several plugins: +# bash-support.vim, c.vim and perl-support.vim +# OPTIONS: --- +# REQUIREMENTS: which(1) - shows the full path of (shell) commands. +# BUGS: --- +# NOTES: --- +# AUTHOR: Dr.-Ing. Fritz Mehner (Mn), mehner@fh-swf.de +# COMPANY: Fachhochschule Südwestfalen, Iserlohn +# CREATED: 23.11.2004 18:04:01 CET +# REVISION: $Id: wrapper.sh,v 1.3 2007/10/03 09:06:09 mehner Exp $ +#=============================================================================== + +command=${@} # the complete command line +executable=${1} # name of the executable; may be quoted + +fullname=$(which $executable) +[ $? -eq 0 ] && executable=$fullname + +if [ ${#} -ge 1 ] && [ -x "$executable" ] +then + shift + "$executable" ${@} + echo -e "> \"${command}\" returned ${?}" +else + echo -e "\n !! file \"${executable}\" does not exist or is not executable !!" +fi +echo -e " ... press return key ... " +read dummy diff --git a/dot_vim/c-support/syntax/c.vim b/dot_vim/c-support/syntax/c.vim new file mode 100644 index 0000000..395e0d9 --- /dev/null +++ b/dot_vim/c-support/syntax/c.vim @@ -0,0 +1,21 @@ +"=================================================================================== +" +" FILE: c.vim +" DESCRIPTION: syntax file +" enable syntax based folding +" part of the c-support plugin +" +" AUTHOR: Dr.-Ing. Fritz Mehner +" EMAIL: mehner@fh-swf.de +" COMPANY: FH Südwestfalen, Iserlohn +" VERSION: 1.0 +" CREATED: 11.03.2006 +" REVISION: --- +"=================================================================================== +" +" fold C blocks +" +syn region cBlock start="{" end="}" transparent fold +set foldmethod=syntax +set foldlevel=999 + diff --git a/dot_vim/c-support/templates/Templates b/dot_vim/c-support/templates/Templates new file mode 100644 index 0000000..9aa86fc --- /dev/null +++ b/dot_vim/c-support/templates/Templates @@ -0,0 +1,26 @@ +$ +$ ============================================================= +$ ========== USER MACROS ====================================== +$ ============================================================= +$ +|AUTHOR| = Ryan Kavanagh +|AUTHORREF| = ryanakca +|EMAIL| = ryanakca@kubuntu.org +|COPYRIGHT| = Copyright (c) 2008 Ryan Kavanagh +|LICENSE| = GNU GPL v2 +$ +$ ============================================================= +$ ========== FILE INCLUDES ==================================== +$ ============================================================= +$ +|includefile| = c.comments.template +|includefile| = c.cpp.template +|includefile| = c.idioms.template +|includefile| = c.preprocessor.template +|includefile| = c.statements.template + +$|includefile| = cpp.comments.template +$|includefile| = cpp.cpp.template +$|includefile| = cpp.idioms.template +$|includefile| = cpp.preprocessor.template +$|includefile| = cpp.statements.template diff --git a/dot_vim/c-support/templates/c.comments.template b/dot_vim/c-support/templates/c.comments.template new file mode 100644 index 0000000..8080968 --- /dev/null +++ b/dot_vim/c-support/templates/c.comments.template @@ -0,0 +1,147 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.end-of-line-comment == append == +/* <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.frame == +/*-------------------------------------------------------------------------- + * <CURSOR> + *------------------------------------------------------------------------*/ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.function == +/* + * === FUNCTION ========================================================== + * Name: |?FUNCTION_NAME| + * Description: <CURSOR> + * ========================================================================= + */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.method == +/* + *-------------------------------------------------------------------------- + * Class: |?CLASSNAME| + * Method: |?METHODNAME| + * Description: <CURSOR> + *-------------------------------------------------------------------------- + */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.class == +/* + * ========================================================================= + * Class: |?CLASSNAME| + * Description: <CURSOR> + * ========================================================================= + */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-description == start == +/* + * ========================================================================= + * + * Filename: |FILENAME| + * + * Description: <CURSOR> + * + * Version: 1.0 + * Created: |DATE| |TIME| + * Revision: none + * Compiler: gcc + * + * Author: |AUTHOR| (|AUTHORREF|), |EMAIL| + * License: |LICENSE| + * + * ========================================================================= + */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-bug == append == + /* :BUG:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-compiler == append == + /* :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-todo == append == + /* :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-tricky == append == + /* :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-warning == append == + /* :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-workaround == append == + /* :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-keyword == append == + /* :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-header-includes == +/* ##### HEADER FILE INCLUDES ################################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-macros == +/* ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-typedefs == +/* ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-data-types == +/* ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ############################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-defs == +/* ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################## */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-local-variables == +/* ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################ */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-prototypes == +/* ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ############################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-function-defs-exported == +/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-function-defs-local == +/* ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ##################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-implementations-exported == +/* ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES ############################# */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-implementations-local == +/* ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################ */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-header-includes == +/* ##### HEADER FILE INCLUDES ################################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-macros == +/* ##### EXPORTED MACROS ######################################################## */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-typedefs == +/* ##### EXPORTED TYPE DEFINITIONS ############################################## */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-data-types == +/* ##### EXPORTED DATA TYPES #################################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-class-defs == +/* ##### EXPORTED CLASS DEFINITIONS ############################################# */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-variables == +/* ##### EXPORTED VARIABLES ##################################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-function-declarations == +/* ##### EXPORTED FUNCTION DECLARATIONS ######################################### */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/c.cpp.template b/dot_vim/c-support/templates/c.cpp.template new file mode 100644 index 0000000..ce15421 --- /dev/null +++ b/dot_vim/c-support/templates/c.cpp.template @@ -0,0 +1,353 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.method-implementation == +<CURSOR>void +|?CLASSNAME|::|?METHODNAME| ( ) +{ + return ; +} /* ----- end of method |CLASSNAME|::|?METHODNAME| ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.class == +/* + * ===================================================================================== + * Class: |?CLASSNAME:c| + * Description: <CURSOR> + * ===================================================================================== + */ +class |CLASSNAME| +{ + public: + /* ==================== LIFECYCLE ======================================= */ + |CLASSNAME| (); /* constructor */ + + /* ==================== OPERATORS ======================================= */ + + /* ==================== OPERATIONS ======================================= */ + + /* ==================== ACCESS ======================================= */ + + /* ==================== INQUIRY ======================================= */ + + /* ==================== DATA MEMBERS ======================================= */ + protected: + + private: + +}; /* ----- end of class |CLASSNAME| ----- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: constructor + *-------------------------------------------------------------------------------------- + */ +|CLASSNAME|::|CLASSNAME| () +{ +} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.class-using-new == +/* + * ===================================================================================== + * Class: |?CLASSNAME:c| + * Description: <CURSOR> + * ===================================================================================== + */ +class |CLASSNAME| +{ + public: + + /* ==================== LIFECYCLE ======================================= */ + |CLASSNAME| (); /* constructor */ + |CLASSNAME| ( const |CLASSNAME| &other ); /* copy constructor */ + ~|CLASSNAME| (); /* destructor */ + + /* ==================== OPERATORS ======================================= */ + const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); /* assignment operator */ + + /* ==================== OPERATIONS ======================================= */ + + /* ==================== ACCESS ======================================= */ + + /* ==================== INQUIRY ======================================= */ + + /* ==================== DATA MEMBERS ======================================= */ + protected: + + private: + +}; /* ----- end of class |CLASSNAME| ----- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: constructor + *-------------------------------------------------------------------------------------- + */ +|CLASSNAME|::|CLASSNAME| () +{ +} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: copy constructor + *-------------------------------------------------------------------------------------- + */ +|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other ) +{ +} /* ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) ----- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: ~|CLASSNAME| + * Description: destructor + *-------------------------------------------------------------------------------------- + */ +|CLASSNAME|::~|CLASSNAME| () +{ +} /* ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) ----- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: operator = + * Description: assignment operator + *-------------------------------------------------------------------------------------- + */ +const |CLASSNAME|& +|CLASSNAME|::operator = ( const |CLASSNAME| &other ) +{ + if ( this != &other ) { + } + return *this; +} /* ----- end of method |CLASSNAME|::operator = (assignment operator) ----- */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.error-class == +/* + * ===================================================================================== + * Class: |?CLASSNAME:c| + * Description: <CURSOR> + * ===================================================================================== + */ +class |CLASSNAME| +{ + public: |CLASSNAME| ( char *msg ):message(msg) { } + virtual ~|CLASSNAME| ( ) { } + virtual const char* what ( ) const throw ( ) { return message; } + protected: char *message; +}; /* ----- end of class |CLASSNAME| ----- */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-method-implementation == +template < class T > +void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( ) +{ + return ; +} /* ----- end of method |CLASSNAME|<T>::|METHODNAME| ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-class == +/* + * ===================================================================================== + * Class: |?CLASSNAME:c| + * Description: <CURSOR> + * ===================================================================================== + */ +template < class T > +class |CLASSNAME| +{ + public: + + /* ==================== LIFECYCLE ======================================= */ + |CLASSNAME| (); /* constructor */ + + /* ==================== OPERATORS ======================================= */ + + /* ==================== OPERATIONS ======================================= */ + + /* ==================== ACCESS ======================================= */ + + /* ==================== INQUIRY ======================================= */ + + /* ==================== DATA MEMBERS ======================================= */ + protected: + + private: + +}; /* ---------- end of template class |CLASSNAME| ---------- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: + *-------------------------------------------------------------------------------------- + */ +template < class T > +|CLASSNAME| < T >::|CLASSNAME| () +{ +} /* ---------- end of constructor of template class |CLASSNAME| ---------- */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-class-using-new == +/* + * ===================================================================================== + * Class: |?CLASSNAME:c| + * Description: <CURSOR> + * ===================================================================================== + */ +template < class T > +class |CLASSNAME| +{ + public: + + /* ==================== LIFECYCLE ======================================= */ + |CLASSNAME| (); /* constructor */ + |CLASSNAME| (const |CLASSNAME| &other); /* copy constructor */ + ~|CLASSNAME| (); /* destructor */ + + /* ==================== OPERATORS ======================================= */ + const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); /* assignment operator */ + + /* ==================== OPERATIONS ======================================= */ + + /* ==================== ACCESS ======================================= */ + + /* ==================== INQUIRY ======================================= */ + + /* ==================== DATA MEMBERS ======================================= */ + protected: + + private: + +}; /* ---------- end of template class |CLASSNAME| ---------- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: constructor + *-------------------------------------------------------------------------------------- + */ +template < class T > +|CLASSNAME|< T >::|CLASSNAME| () +{ +} /* ---------- end of constructor of template class |CLASSNAME| ---------- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: |CLASSNAME| + * Description: copy constructor + *-------------------------------------------------------------------------------------- + */ +template < class T > +|CLASSNAME|< T >::|CLASSNAME| ( const |CLASSNAME| &other ) +{ +} /* ---------- end of copy constructor of template class |CLASSNAME| ---------- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: ~|CLASSNAME| + * Description: destructor + *-------------------------------------------------------------------------------------- + */ +template < class T > +|CLASSNAME|< T >::~|CLASSNAME| () +{ +} /* ---------- end of destructor of template class |CLASSNAME| ---------- */ + +/* + *-------------------------------------------------------------------------------------- + * Class: |CLASSNAME| + * Method: operator = + * Description: assignment operator + *-------------------------------------------------------------------------------------- + */ +template < class T > +const |CLASSNAME|< T >& |CLASSNAME|< T >::operator = ( const |CLASSNAME| &other ) +{ + return *this; +} /* ---------- end of assignment operator of template class |CLASSNAME| ---------- */ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-function == +template <class T> +<CURSOR>void |?TEMPALTE_FUNCTION_NAME| ( T param ) +{ + return ; +} /* ----- end of template function |?TEMPALTE_FUNCTION_NAME| ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.operator-in == +ostream & +operator << ( ostream & os, const |?CLASSNAME| & obj ) +{ + os << obj.<CURSOR> ; + return os; +} /* ----- end of function operator << ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.operator-out == +istream & +operator >> ( istream & is, |?CLASSNAME| & obj ) +{ + is >> obj.<CURSOR> ; + return is; +} /* ----- end of function operator >> ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.try-catch == +try {<CURSOR> +<SPLIT>} +catch ( const &ExceptObj ) { /* handle exception: */ +} +catch (...) { /* handle exception: unspezified */ +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.catch == +catch ( <CURSOR>const &ExceptObj ) { /* handle exception: */ +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.catch-points == +catch (...) { /* handle exception: */ +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.extern == +extern "C" {<CURSOR> +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.open-input-file == +char *ifs_file_name = "<CURSOR>"; /* 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); +} + + +ifs.close (); /* close ifstream */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.open-output-file == +char *ofs_file_name = "<CURSOR>"; /* output file name */ +ofstream ofs; /* create ofstream object */ + +ofs.open (ofs_file_name); /* open ofstream */ +if (!ofs) { + cerr << "\nERROR : failed to open output file " << ofs_file_name << endl; + exit (EXIT_FAILURE); +} + + +ofs.close (); /* close ofstream */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.namespace == +namespace |?NAMESPACE| +{<CURSOR> +<SPLIT>} /* ----- end of |NAMESPACE| name ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/c.idioms.template b/dot_vim/c-support/templates/c.idioms.template new file mode 100644 index 0000000..09bc0b7 --- /dev/null +++ b/dot_vim/c-support/templates/c.idioms.template @@ -0,0 +1,98 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.function == +void<CURSOR> +|?FUNCTION_NAME| ( ) +{ +<SPLIT> return ; +} /* ----- end of function |FUNCTION_NAME| ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.function-static == +static void<CURSOR> +|?FUNCTION_NAME| ( ) +{ +<SPLIT> return ; +} /* ----- end of static function |FUNCTION_NAME| ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.main == +int +main ( int argc, char *argv[] ) +{<CURSOR> +<SPLIT> return EXIT_SUCCESS; +} /* ---------- end of function main ---------- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.enum == +enum |?ENUM_NAME| {<CURSOR> +<SPLIT>}; /* ---------- end of enum |ENUM_NAME| ---------- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.struct == +struct |?STRUCT_NAME| {<CURSOR> +<SPLIT>}; /* ---------- end of struct |STRUCT_NAME| ---------- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.union == +union |?UNION_NAME| {<CURSOR> +<SPLIT>}; /* ---------- end of union |UNION_NAME| ---------- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.calloc == +|?POINTER| = (<CURSOR>TYPE*)calloc ( (size_t)(COUNT), sizeof(TYPE) ); +if ( |POINTER|==NULL ) { + fprintf ( stderr, "\ndynamic memory allocation failed\n" ); + exit (EXIT_FAILURE); +} + +free (|POINTER|); + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.malloc == +|?POINTER| = (<CURSOR>TYPE*)malloc ( sizeof(TYPE) ); +if ( |POINTER|==NULL ) { + fprintf ( stderr, "\ndynamic memory allocation failed\n" ); + exit (EXIT_FAILURE); +} + +free (|POINTER|); + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.open-input-file == +FILE *|?FILEPOINTER|; /* input-file pointer */ +char *|FILEPOINTER|_file_name = "<CURSOR>"; /* input-file name */ + +|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" ); +if ( |FILEPOINTER| == NULL ) { + fprintf ( stderr, "couldn't open file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + + +if( fclose(|FILEPOINTER|) == EOF ) { /* close input file */ + fprintf ( stderr, "couldn't close file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.open-output-file == +FILE *|?FILEPOINTER|; /* output-file pointer */ +char *|FILEPOINTER|_file_name = "<CURSOR>"; /* output-file name */ + +|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" ); +if ( |FILEPOINTER| == NULL ) { + fprintf ( stderr, "couldn't open file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + + +if( fclose(|FILEPOINTER|) == EOF ) { /* close output file */ + fprintf ( stderr, "couldn't close file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.fprintf == +fprintf ( |?FILEPOINTER|, "<CURSOR>\n", ); +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.fscanf == +fscanf ( |?FILEPOINTER|, "<CURSOR>", & ); +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/c.preprocessor.template b/dot_vim/c-support/templates/c.preprocessor.template new file mode 100644 index 0000000..3ec674a --- /dev/null +++ b/dot_vim/c-support/templates/c.preprocessor.template @@ -0,0 +1,34 @@ +$------------------------------------------------------------------------- +== preprocessor.define == +#define <CURSOR> /* */ +$------------------------------------------------------------------------- +== preprocessor.undefine == +#undef <CURSOR> /* */ +$------------------------------------------------------------------------- +== preprocessor.if-else-endif == +#if |?CONDITION:u| +<CURSOR><SPLIT> +#else /* ----- not |CONDITION| ----- */ + +#endif /* ----- not |CONDITION| ----- */ +$------------------------------------------------------------------------- +== preprocessor.ifdef-else-endif == +#ifdef |?CONDITION:u| +<CURSOR><SPLIT> +#else /* ----- not |CONDITION| ----- */ + +#endif /* ----- not |CONDITION| ----- */ +$------------------------------------------------------------------------- +== preprocessor.ifndef-else-endif == +#ifndef |?CONDITION:u| +<CURSOR><SPLIT> +#else /* ----- not |CONDITION| ----- */ + +#endif /* ----- not |CONDITION| ----- */ +$------------------------------------------------------------------------- +== preprocessor.ifndef-def-endif == +#ifndef |?BASENAME:L|_INC +#define |BASENAME|_INC +<CURSOR><SPLIT> +#endif /* ----- #ifndef |BASENAME|_INC ----- */ +$------------------------------------------------------------------------- diff --git a/dot_vim/c-support/templates/c.statements.template b/dot_vim/c-support/templates/c.statements.template new file mode 100644 index 0000000..966ae3a --- /dev/null +++ b/dot_vim/c-support/templates/c.statements.template @@ -0,0 +1,62 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.do-while == +do { +<SPLIT>} while ( <CURSOR> ); /* ----- end do-while ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.for == +for ( <CURSOR>; ; ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.for-block == +for ( <CURSOR>; ; ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if == +if ( <CURSOR> ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-block == +if ( <CURSOR> ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-else == +if ( <CURSOR> ) +<SPLIT>else +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-block-else == +if ( <CURSOR> ) { +<SPLIT>} else { +} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.while == +while ( <CURSOR> ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.while-block == +while ( <CURSOR> ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.switch == +switch ( <CURSOR> ) { + case : + <SPLIT>break; + + case : + break; + + case : + break; + + case : + break; + + default: + break; +} /* ----- end switch ----- */ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.case == +case <CURSOR>: +break; + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.block == +{<CURSOR> +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/cpp.comments.template b/dot_vim/c-support/templates/cpp.comments.template new file mode 100644 index 0000000..9929eab --- /dev/null +++ b/dot_vim/c-support/templates/cpp.comments.template @@ -0,0 +1,139 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.end-of-line-comment == append == +// <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.frame == +//---------------------------------------------------------------------- +// <CURSOR> +//---------------------------------------------------------------------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.function == +// === FUNCTION =========================================================== +// Name: |?FUNCTION_NAME| +// Description: <CURSOR> +// ========================================================================== +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.method == +//--------------------------------------------------------------------------- +// Class: |?CLASSNAME| +// Method: |?METHODNAME| +// Description: <CURSOR> +//--------------------------------------------------------------------------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.class == +// ========================================================================== +// Class: |?CLASSNAME| +// Description: <CURSOR> +// ========================================================================== +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-description == start == +// ========================================================================== +// +// Filename: |FILENAME| +// +// Description: <CURSOR> +// +// Version: 1.0 +// Created: |DATE| |TIME| +// Revision: none +// Compiler: g++ +// +// Author: |AUTHOR| (|AUTHORREF|), |EMAIL| +// License: |LICENSE| +// +// ========================================================================== + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-bug == append == + // :BUG:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-compiler == append == + // :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-todo == append == + // :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-tricky == append == + // :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-warning == append == + // :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-workaround == append == + // :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.keyword-keyword == append == + // :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR> +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-header-includes == +// ##### HEADER FILE INCLUDES ################################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-macros == +// ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-typedefs == +// ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-data-types == +// ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ############################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-defs == +// ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################## + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-local-variables == +// ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-prototypes == +// ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ############################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-function-defs-exported == +// ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-function-defs-local == +// ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ##################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-implementations-exported == +// ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES ############################# + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-cpp-class-implementations-local == +// ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################ + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-header-includes == +// ##### HEADER FILE INCLUDES ################################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-macros == +// ##### EXPORTED MACROS ######################################################## + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-typedefs == +// ##### EXPORTED TYPE DEFINITIONS ############################################## + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-data-types == +// ##### EXPORTED DATA TYPES #################################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-class-defs == +// ##### EXPORTED CLASS DEFINITIONS ############################################# + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-variables == +// ##### EXPORTED VARIABLES ##################################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== comment.file-section-hpp-exported-function-declarations == +// ##### EXPORTED FUNCTION DECLARATIONS ######################################### + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/cpp.cpp.template b/dot_vim/c-support/templates/cpp.cpp.template new file mode 100644 index 0000000..7773989 --- /dev/null +++ b/dot_vim/c-support/templates/cpp.cpp.template @@ -0,0 +1,329 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.method-implementation == +<CURSOR>void +|?CLASSNAME|::|?METHODNAME| ( ) +{ + return ; +} // ----- end of method |CLASSNAME|::|METHODNAME| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.class == +// ===================================================================================== +// Class: |?CLASSNAME:c| +// Description: <CURSOR> +// ===================================================================================== +class |CLASSNAME| +{ + public: + + // ==================== LIFECYCLE ======================================= + |CLASSNAME| (); // constructor + + // ==================== OPERATORS ======================================= + + // ==================== OPERATIONS ======================================= + + // ==================== ACCESS ======================================= + + // ==================== INQUIRY ======================================= + + // ==================== DATA MEMBERS ======================================= + protected: + + private: + +}; // ----- end of class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: constructor +//-------------------------------------------------------------------------------------- +|CLASSNAME|::|CLASSNAME| () +{ +} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.class-using-new == +// ===================================================================================== +// Class: |?CLASSNAME:c| +// Description: <CURSOR> +// ===================================================================================== +class |CLASSNAME| +{ + public: + + // ==================== LIFECYCLE ======================================= + |CLASSNAME| (); // constructor + |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor + ~|CLASSNAME| (); // destructor + + // ==================== OPERATORS ======================================= + const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator + + // ==================== OPERATIONS ======================================= + + // ==================== ACCESS ======================================= + + // ==================== INQUIRY ======================================= + + // ==================== DATA MEMBERS ======================================= + protected: + + private: + +}; // ----- end of class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: constructor +//-------------------------------------------------------------------------------------- +|CLASSNAME|::|CLASSNAME| () +{ +} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: copy constructor +//-------------------------------------------------------------------------------------- +|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other ) +{ +} // ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: ~|CLASSNAME| +// Description: destructor +//-------------------------------------------------------------------------------------- +|CLASSNAME|::~|CLASSNAME| () +{ +} // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: operator = +// Description: assignment operator +//-------------------------------------------------------------------------------------- +const |CLASSNAME|& +|CLASSNAME|::operator = ( const |CLASSNAME| &other ) +{ + if ( this != &other ) { + } + return *this; +} // ----- end of method |CLASSNAME|::operator = (assignment operator) ----- + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.error-class == +// ===================================================================================== +// Class: |?CLASSNAME:c| +// Description: <CURSOR> +// ===================================================================================== +class |CLASSNAME| +{ + public: |CLASSNAME| ( char *msg ):message(msg) { } + virtual ~|CLASSNAME| ( ) { } + virtual const char* what ( ) const throw ( ) { return message; } + protected: char *message; +}; // ---------- end of class |CLASSNAME| ---------- + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-method-implementation == +template < class T > +void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( ) +{ + return ; +} // ----- end of method |CLASSNAME|<T>::|METHODNAME| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-class == +// ===================================================================================== +// Class: |?CLASSNAME:c| +// Description: <CURSOR> +// ===================================================================================== + +template < class T > +class |CLASSNAME| +{ + public: + + // ==================== LIFECYCLE ======================================= + |CLASSNAME| (); // constructor + + // ==================== OPERATORS ======================================= + + // ==================== OPERATIONS ======================================= + + // ==================== ACCESS ======================================= + + // ==================== INQUIRY ======================================= + + // ==================== DATA MEMBERS ======================================= + protected: + + private: + +}; // ----- end of template class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: constructor +//-------------------------------------------------------------------------------------- +template < class T > +|CLASSNAME| <T>:: |CLASSNAME| () +{ +} // ----- end of constructor of template class |CLASSNAME| ----- + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-class-using-new == +// ===================================================================================== +// Class: |?CLASSNAME:c| +// Description: <CURSOR> +// ===================================================================================== + +template < class T > +class |CLASSNAME| +{ + public: + + // ==================== LIFECYCLE ======================================= + |CLASSNAME| (); // constructor + |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor + ~|CLASSNAME| (); // destructor + + // ==================== OPERATORS ======================================= + + const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator + + // ==================== OPERATIONS ======================================= + + // ==================== ACCESS ======================================= + + // ==================== INQUIRY ======================================= + + // ==================== DATA MEMBERS ======================================= + protected: + + private: + +}; // ----- end of template class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: constructor +//-------------------------------------------------------------------------------------- +template < class T > +|CLASSNAME|<T>::|CLASSNAME| () +{ +} // ----- end of constructor of template class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: |CLASSNAME| +// Description: copy constructor +//-------------------------------------------------------------------------------------- +template < class T > +|CLASSNAME|<T>::|CLASSNAME| ( const |CLASSNAME| &other ) +{ +} // ----- end of copy constructor of template class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: ~|CLASSNAME| +// Description: destructor +//-------------------------------------------------------------------------------------- +template < class T > +|CLASSNAME|<T>::~|CLASSNAME| () +{ +} // ----- end of destructor of template class |CLASSNAME| ----- + +//-------------------------------------------------------------------------------------- +// Class: |CLASSNAME| +// Method: operator = +// Description: assignment operator +//-------------------------------------------------------------------------------------- +template < class T > +const |CLASSNAME|<T>& |CLASSNAME|<T>::operator = ( const |CLASSNAME| &other ) +{ + if ( this != &other ) { + } + return *this; +} // ----- end of assignment operator of template class |CLASSNAME| ----- + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.template-function == +template <class T> +<CURSOR>void |?TEMPALTE_FUNCTION_NAME| ( T param ) +{ + return ; +} // ----- end of template function |?TEMPALTE_FUNCTION_NAME| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.operator-in == +ostream & +operator << ( ostream & os, const |?CLASSNAME| & obj ) +{ + os << obj.<CURSOR> ; + return os; +} // ----- end of function operator << ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.operator-out == +istream & +operator >> ( istream & is, |?CLASSNAME| & obj ) +{ + is >> obj.<CURSOR> ; + return is; +} // ----- end of function operator >> ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.try-catch == +try {<CURSOR> +<SPLIT>} +catch ( const &ExceptObj ) { // handle exception: +} +catch (...) { // handle exception: unspezified +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.catch == +catch ( <CURSOR>const &ExceptObj ) { // handle exception: +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.catch-points == +catch (...) { // handle exception: +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.extern == +extern "C" {<CURSOR> +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.open-input-file == +char *ifs_file_name = "<CURSOR>"; // 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); +} + + +ifs.close (); // close ifstream +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.open-output-file == +char *ofs_file_name = "<CURSOR>"; // output file name +ofstream ofs; // create ofstream object + +ofs.open (ofs_file_name); // open ofstream +if (!ofs) { + cerr << "\nERROR : failed to open output file " << ofs_file_name << endl; + exit (EXIT_FAILURE); +} + + +ofs.close (); // close ofstream +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== cpp.namespace == +namespace |?NAMESPACE| +{<CURSOR> +<SPLIT>} // ----- end of |NAMESPACE| name ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/cpp.idioms.template b/dot_vim/c-support/templates/cpp.idioms.template new file mode 100644 index 0000000..febc375 --- /dev/null +++ b/dot_vim/c-support/templates/cpp.idioms.template @@ -0,0 +1,98 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.function == +void<CURSOR> +|?FUNCTION_NAME| ( ) +{ +<SPLIT> return ; +} // ----- end of function |FUNCTION_NAME| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.function-static == +static void<CURSOR> +|?FUNCTION_NAME| ( ) +{ +<SPLIT> return ; +} // ----- end of static function |FUNCTION_NAME| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.main == +int +main ( int argc, char *argv[] ) +{<CURSOR> +<SPLIT> return EXIT_SUCCESS; +} // ---------- end of function main ---------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.enum == +enum |?ENUM_NAME| {<CURSOR> +<SPLIT>}; // ---------- end of enum |ENUM_NAME| ---------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.struct == +struct |?STRUCT_NAME| {<CURSOR> +<SPLIT>}; // ---------- end of struct |STRUCT_NAME| ---------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.union == +union |?UNION_NAME| {<CURSOR> +<SPLIT>}; // ---------- end of union |UNION_NAME| ---------- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.calloc == +|?POINTER| = (<CURSOR>TYPE*)calloc ( (size_t)(COUNT), sizeof(TYPE) ); +if ( |POINTER|==NULL ) { + fprintf ( stderr, "\ndynamic memory allocation failed\n" ); + exit (EXIT_FAILURE); +} + +free (|POINTER|); + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.malloc == +|?POINTER| = (<CURSOR>TYPE*)malloc ( sizeof(TYPE) ); +if ( |POINTER|==NULL ) { + fprintf ( stderr, "\ndynamic memory allocation failed\n" ); + exit (EXIT_FAILURE); +} + +free (|POINTER|); + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.open-input-file == +FILE *|?FILEPOINTER|; // input-file pointer +char *|FILEPOINTER|_file_name = "<CURSOR>"; // input-file name + +|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" ); +if ( |FILEPOINTER| == NULL ) { + fprintf ( stderr, "couldn't open file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + + +if( fclose(|FILEPOINTER|) == EOF ) { // close input file + fprintf ( stderr, "couldn't close file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.open-output-file == +FILE *|?FILEPOINTER|; // output-file pointer +char *|FILEPOINTER|_file_name = "<CURSOR>"; // output-file name + +|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" ); +if ( |FILEPOINTER| == NULL ) { + fprintf ( stderr, "couldn't open file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + + +if( fclose(|FILEPOINTER|) == EOF ) { // close output file + fprintf ( stderr, "couldn't close file '%s'; %s\n", + |FILEPOINTER|_file_name, strerror(errno) ); + exit (EXIT_FAILURE); +} + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.fprintf == +fprintf ( |?FILEPOINTER|, "<CURSOR>\n", ); +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== idioms.fscanf == +fscanf ( |?FILEPOINTER|, "<CURSOR>", & ); +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/cpp.preprocessor.template b/dot_vim/c-support/templates/cpp.preprocessor.template new file mode 100644 index 0000000..dbf8abb --- /dev/null +++ b/dot_vim/c-support/templates/cpp.preprocessor.template @@ -0,0 +1,34 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.define == +#define <CURSOR> // +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.undefine == +#undef <CURSOR> // +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.if-else-endif == +#if |?CONDITION:u| +<CURSOR><SPLIT> +#else // ----- not |CONDITION| ----- + +#endif // ----- not |CONDITION| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.ifdef-else-endif == +#ifdef |?CONDITION:u| +<CURSOR><SPLIT> +#else // ----- not |CONDITION| ----- + +#endif // ----- not |CONDITION| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.ifndef-else-endif == +#ifndef |?CONDITION:u| +<CURSOR><SPLIT> +#else // ----- not |CONDITION| ----- + +#endif // ----- not |CONDITION| ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== preprocessor.ifndef-def-endif == +#ifndef |?BASENAME:L|_INC +#define |BASENAME|_INC +<CURSOR><SPLIT> +#endif // ----- #ifndef |BASENAME|_INC ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/templates/cpp.statements.template b/dot_vim/c-support/templates/cpp.statements.template new file mode 100644 index 0000000..8018334 --- /dev/null +++ b/dot_vim/c-support/templates/cpp.statements.template @@ -0,0 +1,62 @@ +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.do-while == +do { +<SPLIT>} while ( <CURSOR> ); // ----- end do-while ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.for == +for ( <CURSOR>; ; ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.for-block == +for ( <CURSOR>; ; ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if == +if ( <CURSOR> ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-block == +if ( <CURSOR> ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-else == +if ( <CURSOR> ) +<SPLIT>else +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.if-block-else == +if ( <CURSOR> ) { +<SPLIT>} else { +} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.while == +while ( <CURSOR> ) +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.while-block == +while ( <CURSOR> ) { +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.switch == +switch ( <CURSOR> ) { + case : + <SPLIT>break; + + case : + break; + + case : + break; + + case : + break; + + default: + break; +} // ----- end switch ----- +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.case == +case <CURSOR>: +break; + +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +== statements.block == +{<CURSOR> +<SPLIT>} +$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/dot_vim/c-support/wordlists/c-c++-keywords.list b/dot_vim/c-support/wordlists/c-c++-keywords.list new file mode 100644 index 0000000..5a97dd6 --- /dev/null +++ b/dot_vim/c-support/wordlists/c-c++-keywords.list @@ -0,0 +1,209 @@ +adjustfield +basefield +boolalpha +floatfield +internal +scientific +setbase +setiosflags +setprecision +showbase +showpoint +showpos +uppercase + +auto +break +case +char +const +continue +default +double +else +enum +extern +float +goto +inline +long +register +restrict +return +short +signed +sizeof +static +struct +switch +typedef +union +unsigned +void +volatile +while +_Bool +_Complex +_Imaginary +EXIT_FAILURE +EXIT_SUCCESS + +bool +catch +class +const_cast +delete +dynamic_cast +explicit +export +false +friend +mutable +namespace +operator +private +protected +public +reinterpret_cast +static_cast +template +this +throw +true +typeid +typename +using +virtual +wchar_t + +and_eq +bitand +bitor +compl +not_eq +or_eq +xor_eq + +define +defined +elif +endif +error +ifdef +ifndef +include +pragma +undef + +exception +bad_alloc +bad_exception +bad_cast +bad_typeid +ios_base::failure +logic_error +domain_error +invalid_argument +length_error +out_of_range +runtime_error +range_error +overflow_error +underflow_error +uncaught_exception + +__DATE__ +__FILE__ +__LINE__ +__STDC__ +__STDC_HOSTED__ +__STDC_IEC_559__ +__STDC_IEC_559_COMPLEX__ +__STDC_ISO_10646__ +__STDC_VERSION__ +__TIME__ +__func__ +__cplusplus + +__BORLANDC__ +__CYGWIN__ +__CYGWIN32__ +__GNUC__ +__WIN32__ +__WINDOWS__ + +assert +ctype +errno +float +limits +locale +math +setjmp +signal +stdarg +stddef +stdio +stdlib +string +time + +complex +fenv +inttypes +iso646 +stdbool +stdint +tgmath +wchar +wctype + +algorithm +bitset +complex +deque +exception +fstream +functional +iomanip +ios +iosfwd +iostream +istream +iterator +limits +list +locale + +map +memory +new +numeric +ostream +queue +set +sstream +stack +stdexcept +streambuf +string +typeinfo +utility +valarray +vector + +cassert +cctype +cerrno +cfloat +climits +clocale +cmath +csetjmp +csignal +cstdarg +cstddef +cstdio +cstdlib +cstring +ctime diff --git a/dot_vim/c-support/wordlists/k+r.list b/dot_vim/c-support/wordlists/k+r.list new file mode 100644 index 0000000..805756a --- /dev/null +++ b/dot_vim/c-support/wordlists/k+r.list @@ -0,0 +1,108 @@ +address +allocator +allocation +argument +arithmetic +array +assignement +bitwise +block +character +command +condition +conditional +constant +conversion +declaration +decrement +defined +definition +descriptor +description +dimension +evaluation +expression +external +format +formatted +function +global +handling +identifier +implementation +increment +initialization +input +interface +label +lexical +local +logical +lookup +loop +lvalue +miscellaneous +notation +numerical +operator +operation +output +pointer +precedence +preprocessor +preprocessing +program +random +recursion +recursive +reference +referential +relational +scope +standard +statement +string +structure +system +undefined +variable + +abstract +algorithm +alignment +application +assignment +asynchronous +binary +buffer +component +constructor +container +destructor +difference +enumeration +exception +floating-point +horizontal +inheritance +instantiation +integer +internal +invariant +iterator +localization +overflow +overload +override +overwrite +polymorphic +portability +position +postcondition +precision +precondition +prototype +subscript +underflow +vertical +whitespace diff --git a/dot_vim/c-support/wordlists/stl_index.list b/dot_vim/c-support/wordlists/stl_index.list new file mode 100644 index 0000000..b5d98a3 --- /dev/null +++ b/dot_vim/c-support/wordlists/stl_index.list @@ -0,0 +1,202 @@ +accumulate +adjacent_difference +adjacent_find +advance +append +assign +auto_ptr +back +back_inserter +basic_string +bidirectional_iterator +bidirectional_iterator_tag +binary_compose +binary_function +binary_negate +binary_search +bind1st +bind2nd +bit_vector +bitset +capacity +char_producer +char_traits +char_type +compare +construct +copy +copy_backward +copy_n +count +count_if +deque +destroy +distance +distance_type +divides +equal +equal_range +equal_to +erase +fill +fill_n +find +find_end +find_first_not_of +find_first_of +find_if +find_last_not_of +find_last_of +for_each +forward_iterator +forward_iterator_tag +front +front_inserter +generate +generate_n +get_temporary_buffer +greater +greater_equal +hash +hash_map +hash_multimap +hash_multiset +hash_set +identity +includes +inner_product +inplace_merge +input_iterator +input_iterator_tag +insert +insert_iterator +inserter +int_type +iota +is_heap +is_sorted +istream_iterator +istream_type +istreambuf_iterator +iter_swap +iterator_category +iterator_traits +less +less_equal +lexicographical_compare +lexicographical_compare_3way +list +logical_and +logical_not +logical_or +lower_bound +make_heap +make_pair +map +max +max_element +mem_fun1_ref_t +mem_fun1_t +mem_fun_ref_t +mem_fun_t +merge +min +min_element +minus +mismatch +modulus +multimap +multiplies +multiset +negate +next_permutation +not_equal_to +nth_element +operator +ostream_iterator +ostreambuf_iterator +output_iterator +output_iterator_tag +pair +partial_sort +partial_sort_copy +partial_sum +partition +plus +pointer_to_binary_function +pointer_to_unary_function +pop_back +pop_front +pop_heap +power +prev_permutation +priority_queue +project1st +project2nd +ptr_fun +push_back +push_front +push_heap +queue +random_access_iterator +random_access_iterator_tag +random_sample +random_sample_n +random_shuffle +raw_storage_iterator +release +remove +remove_copy +remove_copy_if +remove_if +replace +replace_copy +replace_copy_if +replace_if +reset +resize +return_temporary_buffer +reverse +reverse_bidirectional_iterator +reverse_copy +reverse_iterator +rfind +rope +rotate +rotate_copy +search +search_n +select1st +select2nd +sequence_buffer +set +set_difference +set_intersection +set_symmetric_difference +set_union +slist +sort +sort_heap +stable_partition +stable_sort +stack +streambuf_type +substr +subtractive_rng +swap +swap_ranges +temporary_buffer +transform +unary_compose +unary_function +unary_negate +uninitialized_copy +uninitialized_copy_n +uninitialized_fill +uninitialized_fill_n +unique +unique_copy +upper_bound +value_comp +value_type +vector diff --git a/dot_vim/colors/adam.vim b/dot_vim/colors/adam.vim new file mode 100644 index 0000000..748ca7f --- /dev/null +++ b/dot_vim/colors/adam.vim @@ -0,0 +1,48 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" +" Based on an original vim color file by +" Ron Aaron <ron@mossbayeng.com> (2001 Jul 28) +" +" Maintainer: Adam Krouskop +" Last Change: 2003 Jul 3 + + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "adam" +hi Normal guifg=#008844 guibg=#002244 +hi NonText guifg=brown +hi comment guifg=#D80033 +hi constant guifg=#CCCCCC +hi identifier guifg=#0033FF gui=NONE +hi statement guifg=white gui=NONE +hi preproc guifg=#009999 +hi type guifg=#0033FF gui=NONE +hi special guifg=#FFFF00 gui=NONE +hi ErrorMsg guifg=Black guibg=Red +hi WarningMsg guifg=Black guibg=Green +hi Error guibg=Red +hi Todo guifg=Black guibg=orange +hi Cursor guibg=#ffffff guifg=#cac2ff +hi Search guibg=#103F5F gui=bold +hi IncSearch gui=bold guibg=#285f7f +hi LineNr guifg=darkgrey +hi title guifg=darkgrey +hi StatusLineNC gui=NONE guifg=lightblue guibg=darkblue +hi StatusLine gui=bold guifg=cyan guibg=blue +hi label guifg=gold2 +hi operator guifg=orange +hi clear Visual +hi Visual term=reverse cterm=reverse gui=reverse +hi DiffChange guibg=darkgreen +hi DiffText guibg=olivedrab +hi DiffAdd guibg=slateblue +hi DiffDelete guibg=coral +hi Folded guibg=gray30 +hi FoldColumn guibg=gray30 guifg=white +hi cIf0 guifg=gray diff --git a/dot_vim/colors/adaryn.vim b/dot_vim/colors/adaryn.vim new file mode 100644 index 0000000..1b17f22 --- /dev/null +++ b/dot_vim/colors/adaryn.vim @@ -0,0 +1,72 @@ +" Vim color file +" Maintainer: Glenn T. Norton <gtnorton@adaryn.com> +" Last Change: 2003-04-11 + +" adaryn - A color scheme named after my daughter, Adaryn. (A-da-rin) +" I like deep, sharp colors and this scheme is inspired by +" Bohdan Vlasyuk's darkblue. +" The cterm background is black since the dark blue was just too light. +" Also the cterm colors are very close to an old Borland C++ color setup. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "adaryn" + +hi Normal guifg=#fffff0 guibg=#00003F ctermfg=white ctermbg=Black +hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=red +hi Visual guifg=#8080ff guibg=fg gui=reverse ctermfg=blue ctermbg=fg cterm=reverse + +hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline + +hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue + +hi Search guifg=#90fff0 guibg=#2050d0 ctermfg=white ctermbg=darkblue cterm=underline term=underline + +hi IncSearch guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray + +hi SpecialKey guifg=cyan ctermfg=darkcyan +hi Directory guifg=cyan ctermfg=cyan +hi Title guifg=#BDD094 gui=none ctermfg=magenta cterm=bold +hi WarningMsg guifg=red ctermfg=red +hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none +hi ModeMsg guifg=#22cce2 ctermfg=lightblue +hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen +hi Question guifg=green gui=none ctermfg=green cterm=none +hi NonText guifg=#0030ff ctermfg=darkblue + +hi StatusLine guifg=blue guibg=darkgray gui=none ctermfg=blue ctermbg=gray term=none cterm=none + +hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none + +hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none + +hi Folded guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold + +hi FoldColumn guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold + +hi LineNr guifg=#90f020 ctermfg=green cterm=none + +hi DiffAdd guibg=darkblue ctermbg=darkblue term=none cterm=none +hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none +hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan +hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red + +hi Cursor guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown +hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen + + +hi Comment guifg=yellow ctermfg=Yellow +hi Constant ctermfg=green guifg=green cterm=none +hi Special ctermfg=White guifg=#FFFFFF cterm=none gui=none +hi Identifier ctermfg=DarkRed guifg=#BDD094 cterm=none +hi Statement ctermfg=LightCyan cterm=none guifg=#A9A900 gui=none +hi PreProc ctermfg=DarkRed guifg=#ffffff gui=none cterm=none +hi type ctermfg=LightCyan guifg=LightBlue gui=none cterm=none +hi Underlined cterm=underline term=underline +hi Ignore guifg=bg ctermfg=bg + + diff --git a/dot_vim/colors/adrian.vim b/dot_vim/colors/adrian.vim new file mode 100644 index 0000000..ba830cd --- /dev/null +++ b/dot_vim/colors/adrian.vim @@ -0,0 +1,97 @@ +" Vim colorscheme file +" Maintainer: Adrian Nagle <vim@naglenet.org> +" Last Change: 2001-09-25 07:48:15 Mountain Daylight Time +" URL: http://www.naglenet.org/vim/syntax/adrian.vim +" MAIN URL: http://www.naglenet.org/vim + +" This is my custom syntax file to override the defaults provided with Vim. +" This file should be located in $HOME/vimfiles/colors. + +" This file should automatically be sourced by $RUNTIMEPATH. + +" NOTE(S): +" *(1) +" The color definitions assumes and is intended for a black or dark +" background. + +" *(2) +" This file is specifically in Unix style EOL format so that I can simply +" copy this file between Windows and Unix systems. VIM can source files in +" with the UNIX EOL format (only <NL> instead of <CR><NR> for DOS) in any +" operating system if the 'fileformats' is not empty and there is no <CR> +" just before the <NL> on the first line. See ':help :source_crnl' and +" ':help fileformats'. +" +" *(3) +" Move this file to adrian.vim for vim6.0aw. +" + + + +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "adrian" + +" Normal is for the normal (unhighlighted) text and background. +" NonText is below the last line (~ lines). +highlight Normal guibg=Black guifg=Green +highlight Cursor guibg=Grey70 guifg=White +highlight NonText guibg=Grey80 +highlight StatusLine gui=bold guibg=DarkGrey guifg=Orange +highlight StatusLineNC guibg=DarkGrey guifg=Orange + +highlight Comment term=bold ctermfg=LightGrey guifg=#d1ddff +highlight Constant term=underline ctermfg=White guifg=#ffa0a0 +"highlight Number term=underline ctermfg=Yellow guifg=Yellow +highlight Identifier term=underline ctermfg=Cyan guifg=#40ffff +highlight Statement term=bold ctermfg=Yellow gui=bold guifg=#ffff60 +highlight PreProc term=underline ctermfg=Blue guifg=#ff4500 +highlight Type term=underline ctermfg=DarkGrey gui=bold guifg=#7d96ff +highlight Special term=bold ctermfg=Magenta guifg=Orange +highlight Ignore ctermfg=black guifg=bg +highlight Error ctermfg=White ctermbg=Red guifg=White guibg=Red +highlight Todo ctermfg=Blue ctermbg=Yellow guifg=Blue guibg=Yellow + +" Change the highlight of search matches (for use with :set hls). +highlight Search ctermfg=Black ctermbg=Yellow guifg=Black guibg=Yellow + +" Change the highlight of visual highlight. +highlight Visual cterm=NONE ctermfg=Black ctermbg=LightGrey gui=NONE guifg=Black guibg=Grey70 + +highlight Float ctermfg=Blue guifg=#88AAEE +highlight Exception ctermfg=Red ctermbg=White guifg=Red guibg=White +highlight Typedef ctermfg=White ctermbg=Blue gui=bold guifg=White guibg=Blue +highlight SpecialChar ctermfg=Black ctermbg=White guifg=Black guibg=White +highlight Delimiter ctermfg=White ctermbg=Black guifg=White guibg=Black +highlight SpecialComment ctermfg=Black ctermbg=Green guifg=Black guibg=Green + +" Common groups that link to default highlighting. +" You can specify other highlighting easily. +highlight link String Constant +highlight link Character Constant +highlight link Number Constant +highlight link Boolean Statement +"highlight link Float Number +highlight link Function Identifier +highlight link Conditional Type +highlight link Repeat Type +highlight link Label Type +highlight link Operator Type +highlight link Keyword Type +"highlight link Exception Type +highlight link Include PreProc +highlight link Define PreProc +highlight link Macro PreProc +highlight link PreCondit PreProc +highlight link StorageClass Type +highlight link Structure Type +"highlight link Typedef Type +"highlight link SpecialChar Special +highlight link Tag Special +"highlight link Delimiter Special +"highlight link SpecialComment Special +highlight link Debug Special + diff --git a/dot_vim/colors/af.vim b/dot_vim/colors/af.vim new file mode 100644 index 0000000..d85e7d3 --- /dev/null +++ b/dot_vim/colors/af.vim @@ -0,0 +1,99 @@ +" Vim color file +" Maintainer: Stanislav Lechev [AngelFire] <af@mis.bg> +" Last Change: 2004/03/31 +" URL: http://af.mis.bg/vim/af.vim +" ICQ: 2924004 +" Info: based on desert and a little bit of gothic +" Version: 1.1 + +set background=dark +if version > 580 + hi clear + if exists("syntax_on") + syntax reset + endif +endif +let g:colors_name="af" + +hi User1 guibg=darkblue guifg=yellow +hi User2 guibg=darkblue guifg=lightblue +hi User3 guibg=darkblue guifg=red +hi User4 guibg=darkblue guifg=cyan +hi User5 guibg=darkblue guifg=lightgreen +set statusline=%<%1*===\ %5*%f%1*%(\ ===\ %4*%h%1*%)%(\ ===\ %4*%m%1*%)%(\ ===\ %4*%r%1*%)\ ===%====\ %2*%b(0x%B)%1*\ ===\ %3*%l,%c%V%1*\ ===\ %5*%P%1*\ ===%0* laststatus=2 + + +hi Normal guifg=#dfdfdf guibg=#000000 +"hi Normal guifg=#87dee0 guibg=#000000 +"hi Normal guifg=#98fb98 guibg=#000000 +hi Cursor guibg=khaki guifg=slategrey +hi Comment guifg=#808080 +"hi Identifier guifg=#98FB98 +hi Identifier guifg=#87def0 +hi Constant guifg=#FF99FF +"hi String guifg=#87cee0 +hi String guifg=lightred +hi Character guifg=#87cee0 +hi Statement guifg=khaki +hi PreProc guifg=red +"hi Type guifg=#a0a0ff gui=none +hi Type guifg=lightgreen gui=none +hi Todo guifg=orangered guibg=yellow2 +hi Special guifg=Orange +hi Visual guifg=SkyBlue guibg=grey60 gui=none +hi IncSearch guifg=#ffff60 guibg=#0000ff gui=none +hi Search guifg=khaki guibg=slategrey gui=none +hi Ignore guifg=grey40 + +hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none +hi Folded guibg=grey30 guifg=gold +hi FoldColumn guibg=grey30 guifg=tan +hi ModeMsg guifg=goldenrod +hi MoreMsg guifg=SeaGreen +hi NonText guifg=LightBlue guibg=#000000 +hi Question guifg=springgreen +hi SpecialKey guifg=yellowgreen +hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none +hi Title guifg=indianred +hi WarningMsg guifg=salmon + + +" these are from desert ... i didn't change it +" color terminal definitions +hi SpecialKey ctermfg=darkgreen +hi NonText cterm=bold ctermfg=darkblue +hi Directory ctermfg=darkcyan +hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 +hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green +hi Search cterm=NONE ctermfg=grey ctermbg=blue +hi MoreMsg ctermfg=darkgreen +hi ModeMsg cterm=NONE ctermfg=brown +hi LineNr ctermfg=3 +hi Question ctermfg=green +hi StatusLine cterm=bold,reverse +hi StatusLineNC cterm=reverse +hi VertSplit cterm=reverse +hi Title ctermfg=5 +hi Visual cterm=reverse +hi VisualNOS cterm=bold,underline +hi WarningMsg ctermfg=1 +hi WildMenu ctermfg=0 ctermbg=3 +hi Folded ctermfg=darkgrey ctermbg=NONE +hi FoldColumn ctermfg=darkgrey ctermbg=NONE +hi DiffAdd ctermbg=4 +hi DiffChange ctermbg=5 +hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 +hi DiffText cterm=bold ctermbg=1 +hi Comment ctermfg=darkcyan +hi Constant ctermfg=brown +hi Special ctermfg=5 +hi Identifier ctermfg=6 +hi Statement ctermfg=3 +hi PreProc ctermfg=5 +hi Type ctermfg=2 +hi Underlined cterm=underline ctermfg=5 +hi Ignore cterm=bold ctermfg=7 +hi Error cterm=bold ctermfg=7 ctermbg=1 + + +"vim: sw=4 diff --git a/dot_vim/colors/aiseered.vim b/dot_vim/colors/aiseered.vim new file mode 100644 index 0000000..7e71108 --- /dev/null +++ b/dot_vim/colors/aiseered.vim @@ -0,0 +1,37 @@ +" gVim color file for working with files in GDL/VCG format. +" Works nice in conjunction with gdl.vim +" (see www.vim.org or www.aisee.com) +" Works fine for C/C++, too. + +" Author : Alexander A. Evstyugov-Babaev <alex@absint.com> +" Version: 0.2 for gVim/Linux, +" tested with gVim 6.3.25 under Ubuntu Linux (Warty) +" by Jo Vermeulen <jo@lumumba.luc.ac.be> +" Date : January 25th 2005 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name="aiseered" + +hi Normal guifg=lightred guibg=#600000 +hi Cursor guifg=bg guibg=fg +hi ErrorMsg guibg=red ctermfg=1 +hi Search term=reverse ctermfg=darkred ctermbg=lightred guibg=lightred guifg=#060000 + +hi Comment guifg=#ffffff +hi Constant guifg=#88ddee +hi String guifg=#ffcc88 +hi Character guifg=#ffaa00 +hi Number guifg=#88ddee +hi Identifier guifg=#cfcfcf +hi Statement guifg=#eeff99 gui=bold +hi PreProc guifg=firebrick1 gui=italic +hi Type guifg=#88ffaa gui=none +hi Special guifg=#ffaa00 +hi SpecialChar guifg=#ffaa00 +hi StorageClass guifg=#ddaacc +hi Error guifg=red guibg=white diff --git a/dot_vim/colors/aqua.vim b/dot_vim/colors/aqua.vim new file mode 100644 index 0000000..483b6ac --- /dev/null +++ b/dot_vim/colors/aqua.vim @@ -0,0 +1,44 @@ +" Vim color file +" Maintainer: tranquility@portugalmail.pt +" Last Change: 6 Apr 2002 + + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="aqua" + +hi Normal guibg=steelblue guifg=linen +hi Cursor guibg=lightblue3 guifg=black gui=bold +hi VertSplit guifg=white guibg=navyblue gui=none +hi Folded guibg=darkblue guifg=white +hi FoldColumn guibg=lightgray guifg=navyblue +hi ModeMsg guifg=black guibg=steelblue1 +hi MoreMsg guifg=black guibg=steelblue1 +hi NonText guifg=white guibg=steelblue4 gui=none +hi Question guifg=snow +hi Search guibg=#FFFFFF guifg=midnightblue gui=bold +hi SpecialKey guifg=navyblue +hi StatusLine guibg=skyblue3 guifg=black gui=none +hi StatusLineNC guibg=skyblue1 guifg=black gui=none +hi Title guifg=bisque3 +hi Subtitle guifg=black +hi Visual guifg=white guibg=royalblue4 gui=none +hi WarningMsg guifg=salmon4 guibg=gray60 gui=bold +hi Comment guifg=lightskyblue +hi Constant guifg=turquoise gui=bold +hi Identifier guifg=lightcyan +hi Statement guifg=royalblue4 +hi PreProc guifg=black gui=bold +hi Type guifg=lightgreen +hi Special guifg=navajowhite +hi Ignore guifg=grey29 +hi Todo guibg=black guifg=white +hi WildMenu guibg=aquamarine diff --git a/dot_vim/colors/astronaut.vim b/dot_vim/colors/astronaut.vim new file mode 100644 index 0000000..ae1dbf2 --- /dev/null +++ b/dot_vim/colors/astronaut.vim @@ -0,0 +1,160 @@ +" astronaut.vim: a colorscheme +" Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov> +" Date: Sep 01, 2004 +" Version: 6 NOT RELEASED +" +" Usage: +" Put into your <.vimrc> file: +" color astronaut +" +" Optional Modifiers: +" let g:astronaut_bold=1 : term, cterm, and gui receive bold modifier +" let g:astronaut_dark=1 : dark colors used (otherwise some terminals +" make everything bold, which can be all one +" color) +" let g:astronaut_underline=1 : assume that underlining works on your terminal +" let g:astronaut_italic=1 : allows italic to be used in gui +" Examples: +" iris : let astronaut_dark=1 +" Linux xterm: no modifiers needed +" +" GetLatestVimScripts: 122 1 :AutoInstall: astronaut.vim + +set background=dark +hi clear +if exists( "syntax_on" ) + syntax reset +endif +let g:colors_name = "astronaut" +let g:loaded_astronaut = "v6" + +" --------------------------------------------------------------------- +" Default option values +if !exists("g:astronaut_bold") + " on some machines, notably SGIs, a bold qualifier means everything is + " one color (SGIs: yellow) + let g:astronaut_bold= 0 +endif +if !exists("g:astronaut_dark") + " this option, if true, means darkcolor (ex. darkred, darkmagenta, etc) + " is understood and wanted + let g:astronaut_dark= 0 +endif +if !exists("g:astronaut_underline") + let g:astronaut_underline= 1 +endif +if !exists("g:astronaut_italic") + let g:astronaut_italic= 0 +endif + +" --------------------------------------------------------------------- +" Settings based on options +if g:astronaut_bold != 0 + let s:usebold=",bold" +else + let s:usebold="" +endif + +if g:astronaut_italic != 0 + " only affects Alt* in gvim + let s:useitalic= ",italic" +else + let s:useitalic= "" +endif + +if g:astronaut_dark != 0 + let s:black = "black" + let s:red = "darkred" + let s:green = "darkgreen" + let s:yellow = "darkyellow" + let s:blue = "darkblue" + let s:magenta = "darkmagenta" + let s:cyan = "darkcyan" + let s:white = "white" +else + let s:black = "black" + let s:red = "red" + let s:green = "green" + let s:yellow = "yellow" + let s:blue = "blue" + let s:magenta = "magenta" + let s:cyan = "cyan" + let s:white = "white" +endif + +if g:astronaut_underline != 0 + let s:underline= ",underline" + let s:ulbg = "" +else + let s:underline= "none" + if exists("g:astronaut_dark") + let s:ulbg = "ctermbg=darkmagenta guibg=magenta4" + else + let s:ulbg = "ctermbg=magenta guibg=magenta" + endif +endif + +" --------------------------------------------------------------------- +exe "hi Blue start=[m[34m stop=[m[32m ctermfg=".s:blue." guifg=blue guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Comment start=[m[37m stop=[m[32m ctermfg=".s:white." guifg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Conceal ctermfg=".s:blue." ctermbg=".s:black." guifg=Blue guibg=Black term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Constant start=[m[33m stop=[m[32m ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Cursor guifg=blue guibg=green term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Cyan start=[m[36m stop=[m[32m ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Debug start=[m[31m stop=[m[32m ctermfg=".s:red." guifg=magenta guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Delimiter start=[m[37m stop=[m[32m ctermfg=".s:white." guifg=white guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi DiffAdd ctermfg=".s:white." ctermbg=".s:magenta." guifg=White guibg=Magenta term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi DiffChange ctermfg=".s:black." ctermbg=".s:green." guifg=Black guibg=Green term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi DiffDelete ctermfg=".s:white." ctermbg=".s:blue." guifg=White guibg=Blue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi DiffText ctermfg=".s:white." ctermbg=".s:red." guifg=White guibg=Red term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Directory start=[m[37m stop=[m[32m ctermfg=".s:white." guifg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Error start=[m[37;41m stop=[m[32m ctermfg=".s:white." ctermbg=".s:red." guifg=white guibg=red term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi ErrorMsg ctermfg=".s:white." ctermbg=".s:red." guifg=White guibg=Red term=standout".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi FoldColumn start=[m[36;40m stop=[m[32m ctermfg=".s:cyan." ctermbg=".s:black." guifg=Cyan guibg=Brown term=standout".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Folded start=[m[35;40m stop=[m[32m ctermfg=".s:magenta." ctermbg=".s:black." guifg=magenta guibg=black term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Function start=[m[36m stop=[m[32m ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Green start=[m[32m stop=[m[32m ctermfg=".s:green." guifg=green guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Identifier start=[m[45m stop=[m[32m ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Ignore ctermfg=".s:black ." guifg=bg term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi IncSearch start=[m[30;42m stop=[m[32m ctermfg=".s:black ." ctermbg=".s:green." guifg=black guibg=green term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi LineNr ctermfg=".s:yellow." ".s:ulbg." guifg=Yellow term=none".s:underline.s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Magenta start=[m[35m stop=[m[32m ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Menu guifg=black guibg=gray75 term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi ModeMsg ctermfg=".s:green." guifg=SeaGreen term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi MoreMsg ctermfg=".s:green." guifg=SeaGreen term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi NonText ctermfg=".s:blue." guifg=Blue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Normal start=[m[32m stop=[m[32m ctermfg=".s:green." guifg=green guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi PreProc start=[m[37;44m stop=[m[32m ctermfg=".s:white." ctermbg=".s:blue." guifg=white guibg=blue3 term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Question start=[m[33m stop=[m[32m ctermfg=".s:yellow." guifg=yellow term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Red start=[m[31m stop=[m[32m ctermfg=".s:red." guifg=red guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Scrollbar guifg=gray80 guibg=gray70 term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Search start=[m[33;44m stop=[m[32m ctermfg=".s:yellow." ctermbg=".s:blue." guifg=yellow guibg=blue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Special start=[m[32;44m stop=[m[32m ctermfg=".s:green." ctermbg=".s:blue." guifg=green guibg=blue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi SpecialKey start=[m[30;45m stop=[m[32m ctermfg=".s:black." ctermbg=".s:magenta." guifg=black guibg=magenta term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Statement start=[m[36m stop=[m[32m ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi StatusLine start=[m[30;46m stop=[m[32m ctermfg=".s:black." ctermbg=".s:cyan." guifg=black guibg=cyan term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi StatusLineNC start=[m[30;42m stop=[m[32m ctermfg=".s:black." ctermbg=".s:green." guifg=black guibg=green term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi String start=[m[33m stop=[m[32m ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Subtitle start=[m[35m stop=[m[32m ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Tags start=[m[33;44m stop=[m[32m ctermfg=".s:yellow." ctermbg=".s:blue." guifg=yellow guibg=blue3 term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Title start=[m[37m stop=[m[32m ctermfg=".s:white." guifg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Todo start=[m[37;45m stop=[m[32m ctermfg=".s:white." ctermbg=".s:magenta." guifg=white guibg=magenta term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Type start=[m[4;32m stop=[m[32m ctermfg=".s:green." ".s:ulbg." guifg=seagreen1 term=none".s:underline.s:usebold." cterm=none".s:usebold.s:underline." gui=none".s:usebold.s:underline +exe "hi Underlined ctermfg=".s:green." ".s:ulbg." guifg=green term=none".s:underline.s:usebold." cterm=none".s:usebold.s:underline." gui=none".s:usebold.s:underline +exe "hi Unique start=[m[34;47m stop=[m[32m ctermfg=".s:blue." ctermbg=".s:white." guifg=blue3 guibg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi AltUnique start=[m[35;47m stop=[m[32m ctermfg=".s:magenta." ctermbg=".s:white." guifg=magenta guibg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi AltAltUnique start=[m[30;47m stop=[m[32m ctermfg=".s:black." ctermbg=".s:white." guifg=black guibg=white term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi VertSplit start=[m[30;42m stop=[m[32m ctermfg=".s:black." ctermbg=".s:green." guifg=black guibg=green term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Visual start=[m[40;32m stop=[m[32m ctermfg=black ctermbg=green guifg=Grey guibg=fg term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi VisualNOS ".s:ulbg." term=none".s:underline.s:usebold." cterm=none".s:usebold.s:underline." gui=none".s:usebold.s:underline +exe "hi WarningMsg start=[m[30;43m stop=[m[32m ctermfg=".s:black." ctermbg=".s:yellow." guifg=black guibg=yellow term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi White start=[m[37m stop=[m[32m ctermfg=".s:white." guifg=white guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi WildMenu ctermfg=".s:black." ctermbg=".s:yellow." guifg=Black guibg=Yellow term=standout".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi Yellow start=[m[33m stop=[m[32m ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi lCursor guifg=bg guibg=fg term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold +exe "hi AltConstant start=[m[33;40m stop=[m[32m ctermfg=".s:yellow." ctermbg=".s:black." guifg=yellow guibg=black term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold.s:useitalic +exe "hi AltFunction start=[m[32;40m stop=[m[32m ctermfg=".s:green." ctermbg=".s:black." guifg=green guibg=black term=none".s:usebold." cterm=none".s:usebold." gui=none".s:usebold.s:useitalic +exe "hi AltType start=[m[4;32;40m stop=[m[32m ctermfg=".s:green." ctermbg=".s:black." guifg=seagreen1 guibg=black term=none".s:underline.s:usebold." cterm=none".s:usebold.s:underline." gui=none".s:usebold.s:underline.s:useitalic +exe "hi User1 ctermfg=".s:white." ctermbg=".s:blue." guifg=white guibg=blue" +exe "hi User2 ctermfg=".s:yellow." ctermbg=".s:blue." guifg=yellow guibg=blue" +" vim: nowrap diff --git a/dot_vim/colors/asu1dark.vim b/dot_vim/colors/asu1dark.vim new file mode 100644 index 0000000..ce5f90f --- /dev/null +++ b/dot_vim/colors/asu1dark.vim @@ -0,0 +1,59 @@ +" Vim color file +" Maintainer: A. Sinan Unur +" Last Change: 2001/10/04 + +" Dark color scheme + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="asu1dark" + +" Console Color Scheme +hi Normal term=NONE cterm=NONE ctermfg=LightGray ctermbg=Black +hi NonText term=NONE cterm=NONE ctermfg=Brown ctermbg=Black +hi Function term=NONE cterm=NONE ctermfg=DarkCyan ctermbg=Black +hi Statement term=BOLD cterm=BOLD ctermfg=DarkBlue ctermbg=Black +hi Special term=NONE cterm=NONE ctermfg=DarkGreen ctermbg=Black +hi SpecialChar term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black +hi Constant term=NONE cterm=NONE ctermfg=Blue ctermbg=Black +hi Comment term=NONE cterm=NONE ctermfg=DarkGray ctermbg=Black +hi Preproc term=NONE cterm=NONE ctermfg=DarkGreen ctermbg=Black +hi Type term=NONE cterm=NONE ctermfg=DarkMagenta ctermbg=Black +hi Identifier term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black +hi StatusLine term=BOLD cterm=NONE ctermfg=Yellow ctermbg=DarkBlue +hi StatusLineNC term=NONE cterm=NONE ctermfg=Black ctermbg=Gray +hi Visual term=NONE cterm=NONE ctermfg=White ctermbg=DarkCyan +hi Search term=NONE cterm=NONE ctermbg=Yellow ctermfg=DarkBlue +hi VertSplit term=NONE cterm=NONE ctermfg=Black ctermbg=Gray +hi Directory term=NONE cterm=NONE ctermfg=Green ctermbg=Black +hi WarningMsg term=NONE cterm=NONE ctermfg=Blue ctermbg=Yellow +hi Error term=NONE cterm=NONE ctermfg=DarkRed ctermbg=Gray +hi Cursor ctermfg=Black ctermbg=Cyan +hi LineNr term=NONE cterm=NONE ctermfg=Red ctermbg=Black + +" GUI Color Scheme +hi Normal gui=NONE guifg=White guibg=#110022 +hi NonText gui=NONE guifg=#ff9999 guibg=#444444 +hi Function gui=NONE guifg=#7788ff guibg=#110022 +hi Statement gui=BOLD guifg=Yellow guibg=#110022 +hi Special gui=NONE guifg=Cyan guibg=#110022 +hi Constant gui=NONE guifg=#ff9900 guibg=#110022 +hi Comment gui=NONE guifg=#99cc99 guibg=#110022 +hi Preproc gui=NONE guifg=#33ff66 guibg=#110022 +hi Type gui=NONE guifg=#ff5577 guibg=#110022 +hi Identifier gui=NONE guifg=Cyan guibg=#110022 +hi StatusLine gui=BOLD guifg=White guibg=#336600 +hi StatusLineNC gui=NONE guifg=Black guibg=#cccccc +hi Visual gui=NONE guifg=White guibg=#00aa33 +hi Search gui=BOLD guibg=Yellow guifg=DarkBlue +hi VertSplit gui=NONE guifg=White guibg=#666666 +hi Directory gui=NONE guifg=Green guibg=#110022 +hi WarningMsg gui=STANDOUT guifg=#0000cc guibg=Yellow +hi Error gui=NONE guifg=White guibg=Red +hi Cursor guifg=White guibg=#00ff33 +hi LineNr gui=NONE guifg=#cccccc guibg=#334444 +hi ModeMsg gui=NONE guifg=Blue guibg=White +hi Question gui=NONE guifg=#66ff99 guibg=#110022 diff --git a/dot_vim/colors/automation.vim b/dot_vim/colors/automation.vim new file mode 100644 index 0000000..b449145 --- /dev/null +++ b/dot_vim/colors/automation.vim @@ -0,0 +1,59 @@ +" Vim color file (automation.vim) +" Maintainer: Ken McConnell <nacer@yahoo.com> +" Last Change: 2004 Jan 15 +" +" This color scheme uses a light grey background. It was created to simulate +" the look of an IDE. It is named after the MFP Automation Team at HP Boise. +" + +" First remove all existing highlighting. +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "automation" + +hi Normal ctermbg=Black ctermfg=LightGrey guifg=Black guibg=Grey96 + +" Groups used in the 'highlight' and 'guicursor' options default value. +hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White +hi IncSearch term=reverse cterm=bold gui=bold +hi ModeMsg term=bold cterm=bold gui=bold +hi StatusLine term=bold cterm=bold gui=bold +hi StatusLineNC term=bold cterm=bold gui=bold +hi VertSplit term=bold cterm=bold gui=bold +hi Visual term=bold cterm=bold gui=bold guifg=Grey guibg=fg +hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold +hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red +hi Cursor guibg=Black guifg=Black +hi lCursor guibg=Cyan guifg=Black +hi Directory term=bold ctermfg=LightCyan guifg=DarkBlue +hi LineNr term=underline ctermfg=DarkGrey guifg=DarkGrey guibg=LightGrey +hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen +hi NonText term=bold ctermfg=LightBlue gui=bold guifg=DarkGreen guibg=grey80 +hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green +hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black +hi SpecialKey term=bold ctermfg=DarkBlue guifg=DarkBlue +hi Title term=bold ctermfg=LightMagenta gui=bold guifg=DarkBlue +hi WarningMsg term=standout ctermfg=LightRed guifg=Red +hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black +hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue +hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue +hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue +hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta +hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan +hi Comment guifg=Blue guibg=Grey90 ctermfg=DarkGreen +hi String guifg=DarkGreen ctermfg=DarkGreen +hi Statement guifg=DarkBlue ctermfg=Blue +hi Label gui=bold guifg=DarkBlue +" Groups for syntax highlighting +hi Constant term=underline ctermfg=DarkBlue guifg=DarkBlue guibg=Grey96 +hi Special term=bold ctermfg=LightRed guifg=DarkBlue guibg=Grey96 +if &t_Co > 8 + hi Statement term=bold cterm=bold ctermfg=DarkBlue guifg=DarkBlue +endif +hi Ignore ctermfg=LightGrey guifg=grey90 + +" vim: sw=2 diff --git a/dot_vim/colors/autumn.vim b/dot_vim/colors/autumn.vim new file mode 100644 index 0000000..f269b35 --- /dev/null +++ b/dot_vim/colors/autumn.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/14 Mon 16:41. +" version: 1.0 +" This color scheme uses a light background. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "autumn" + +hi Normal guifg=#404040 guibg=#fff4e8 + +" Search +hi IncSearch gui=UNDERLINE guifg=#404040 guibg=#e0e040 +hi Search gui=NONE guifg=#544060 guibg=#f0c0ff + +" Messages +hi ErrorMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi WarningMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi ModeMsg gui=NONE guifg=#d06000 guibg=NONE +hi MoreMsg gui=NONE guifg=#0090a0 guibg=NONE +hi Question gui=NONE guifg=#8000ff guibg=NONE + +" Split area +hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#904838 +hi StatusLineNC gui=BOLD guifg=#c0b0a0 guibg=#904838 +hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#904838 +hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#ff3030 + +" Diff +hi DiffText gui=NONE guifg=#2850a0 guibg=#c0d0f0 +hi DiffChange gui=NONE guifg=#208040 guibg=#c0f0d0 +hi DiffDelete gui=NONE guifg=#ff2020 guibg=#eaf2b0 +hi DiffAdd gui=NONE guifg=#ff2020 guibg=#eaf2b0 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#0080f0 +hi lCursor gui=NONE guifg=#ffffff guibg=#8040ff +hi CursorIM gui=NONE guifg=#ffffff guibg=#8040ff + +" Fold +hi Folded gui=NONE guifg=#804030 guibg=#ffc0a0 +hi FoldColumn gui=NONE guifg=#a05040 guibg=#f8d8c4 + +" Other +hi Directory gui=NONE guifg=#7050ff guibg=NONE +hi LineNr gui=NONE guifg=#e0b090 guibg=NONE +hi NonText gui=BOLD guifg=#a05040 guibg=#ffe4d4 +hi SpecialKey gui=NONE guifg=#0080ff guibg=NONE +hi Title gui=BOLD guifg=fg guibg=NONE +hi Visual gui=NONE guifg=#804020 guibg=#ffc0a0 +" hi VisualNOS gui=NONE guifg=#604040 guibg=#e8dddd + +" Syntax group +hi Comment gui=NONE guifg=#ff5050 guibg=NONE +hi Constant gui=NONE guifg=#00884c guibg=NONE +hi Error gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi Identifier gui=NONE guifg=#b07800 guibg=NONE +hi Ignore gui=NONE guifg=bg guibg=NONE +hi PreProc gui=NONE guifg=#0090a0 guibg=NONE +hi Special gui=NONE guifg=#8040f0 guibg=NONE +hi Statement gui=BOLD guifg=#80a030 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#0080f0 guibg=NONE +hi Type gui=BOLD guifg=#b06c58 guibg=NONE +hi Underlined gui=UNDERLINE guifg=blue guibg=NONE diff --git a/dot_vim/colors/autumn2.vim b/dot_vim/colors/autumn2.vim new file mode 100644 index 0000000..f269b35 --- /dev/null +++ b/dot_vim/colors/autumn2.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/14 Mon 16:41. +" version: 1.0 +" This color scheme uses a light background. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "autumn" + +hi Normal guifg=#404040 guibg=#fff4e8 + +" Search +hi IncSearch gui=UNDERLINE guifg=#404040 guibg=#e0e040 +hi Search gui=NONE guifg=#544060 guibg=#f0c0ff + +" Messages +hi ErrorMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi WarningMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi ModeMsg gui=NONE guifg=#d06000 guibg=NONE +hi MoreMsg gui=NONE guifg=#0090a0 guibg=NONE +hi Question gui=NONE guifg=#8000ff guibg=NONE + +" Split area +hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#904838 +hi StatusLineNC gui=BOLD guifg=#c0b0a0 guibg=#904838 +hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#904838 +hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#ff3030 + +" Diff +hi DiffText gui=NONE guifg=#2850a0 guibg=#c0d0f0 +hi DiffChange gui=NONE guifg=#208040 guibg=#c0f0d0 +hi DiffDelete gui=NONE guifg=#ff2020 guibg=#eaf2b0 +hi DiffAdd gui=NONE guifg=#ff2020 guibg=#eaf2b0 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#0080f0 +hi lCursor gui=NONE guifg=#ffffff guibg=#8040ff +hi CursorIM gui=NONE guifg=#ffffff guibg=#8040ff + +" Fold +hi Folded gui=NONE guifg=#804030 guibg=#ffc0a0 +hi FoldColumn gui=NONE guifg=#a05040 guibg=#f8d8c4 + +" Other +hi Directory gui=NONE guifg=#7050ff guibg=NONE +hi LineNr gui=NONE guifg=#e0b090 guibg=NONE +hi NonText gui=BOLD guifg=#a05040 guibg=#ffe4d4 +hi SpecialKey gui=NONE guifg=#0080ff guibg=NONE +hi Title gui=BOLD guifg=fg guibg=NONE +hi Visual gui=NONE guifg=#804020 guibg=#ffc0a0 +" hi VisualNOS gui=NONE guifg=#604040 guibg=#e8dddd + +" Syntax group +hi Comment gui=NONE guifg=#ff5050 guibg=NONE +hi Constant gui=NONE guifg=#00884c guibg=NONE +hi Error gui=BOLD guifg=#f8f8f8 guibg=#4040ff +hi Identifier gui=NONE guifg=#b07800 guibg=NONE +hi Ignore gui=NONE guifg=bg guibg=NONE +hi PreProc gui=NONE guifg=#0090a0 guibg=NONE +hi Special gui=NONE guifg=#8040f0 guibg=NONE +hi Statement gui=BOLD guifg=#80a030 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#0080f0 guibg=NONE +hi Type gui=BOLD guifg=#b06c58 guibg=NONE +hi Underlined gui=UNDERLINE guifg=blue guibg=NONE diff --git a/dot_vim/colors/autumnleaf.vim b/dot_vim/colors/autumnleaf.vim new file mode 100644 index 0000000..f7af59f --- /dev/null +++ b/dot_vim/colors/autumnleaf.vim @@ -0,0 +1,154 @@ +" Vim color file +" Maintainer: Anders Korte +" Last Change: 17 Oct 2004 + +" AutumnLeaf color scheme 1.0 + +set background=light + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name="AutumnLeaf" + + +" Colors for the User Interface. + +hi Cursor guibg=#aa7733 guifg=#ffeebb gui=bold +hi Normal guibg=#fffdfa guifg=black gui=none +hi NonText guibg=#eafaea guifg=#000099 gui=bold +hi Visual guibg=#fff8cc guifg=black gui=none +" hi VisualNOS + +hi Linenr guibg=bg guifg=#999999 gui=none + +" Uncomment these if you use Diff...?? +" hi DiffText guibg=#cc0000 guifg=white gui=none +" hi DiffAdd guibg=#0000cc guifg=white gui=none +" hi DiffChange guibg=#990099 guifg=white gui=none +" hi DiffDelete guibg=#888888 guifg=#333333 gui=none + +hi Directory guibg=bg guifg=#337700 gui=none + +hi IncSearch guibg=#c8e8ff guifg=black gui=none +hi Search guibg=#c8e8ff guifg=black gui=none +hi SpecialKey guibg=bg guifg=fg gui=none +hi Titled guibg=bg guifg=fg gui=none + +hi ErrorMsg guibg=bg guifg=#cc0000 gui=bold +hi ModeMsg guibg=bg guifg=#003399 gui=none +hi link MoreMsg ModeMsg +hi link Question ModeMsg +hi WarningMsg guibg=bg guifg=#cc0000 gui=bold + +hi StatusLine guibg=#ffeebb guifg=black gui=bold +hi StatusLineNC guibg=#aa8866 guifg=#f8e8cc gui=none +hi VertSplit guibg=#aa8866 guifg=#ffe0bb gui=none + +" hi Folded +" hi FoldColumn +" hi SignColumn + + +" Colors for Syntax Highlighting. + +hi Comment guibg=#ddeedd guifg=#002200 gui=none + +hi Constant guibg=bg guifg=#003399 gui=bold +hi String guibg=bg guifg=#003399 gui=italic +hi Character guibg=bg guifg=#003399 gui=italic +hi Number guibg=bg guifg=#003399 gui=bold +hi Boolean guibg=bg guifg=#003399 gui=bold +hi Float guibg=bg guifg=#003399 gui=bold + +hi Identifier guibg=bg guifg=#003399 gui=none +hi Function guibg=bg guifg=#0055aa gui=bold +hi Statement guibg=bg guifg=#003399 gui=none + +hi Conditional guibg=bg guifg=#aa7733 gui=bold +hi Repeat guibg=bg guifg=#aa5544 gui=bold +hi link Label Conditional +hi Operator guibg=bg guifg=#aa7733 gui=bold +hi link Keyword Statement +hi Exception guibg=bg guifg=#228877 gui=bold + +hi PreProc guibg=bg guifg=#aa7733 gui=bold +hi Include guibg=bg guifg=#558811 gui=bold +hi link Define Include +hi link Macro Include +hi link PreCondit Include + +hi Type guibg=bg guifg=#007700 gui=bold +hi link StorageClass Type +hi link Structure Type +hi Typedef guibg=bg guifg=#009900 gui=italic + +hi Special guibg=bg guifg=fg gui=none +hi SpecialChar guibg=bg guifg=fg gui=bold +hi Tag guibg=bg guifg=#003399 gui=bold +hi link Delimiter Special +hi SpecialComment guibg=#dddddd guifg=#aa0000 gui=none +hi link Debug Special + +hi Underlined guibg=bg guifg=blue gui=underline + +hi Title guibg=bg guifg=fg gui=bold +hi Ignore guibg=bg guifg=#999999 gui=none +hi Error guibg=red guifg=white gui=none +hi Todo guibg=bg guifg=#aa0000 gui=none + + + +" The same in cterm colors. +hi Cursor ctermbg=6 ctermfg=14 +hi Normal ctermbg=15 ctermfg=0 +hi NonText ctermbg=10 ctermfg=1 +hi Visual ctermbg=14 ctermfg=0 +" hi VisualNOS +hi Linenr ctermbg=bg ctermfg=7 +" hi DiffText ctermbg=4 ctermfg=15 +" hi DiffAdd ctermbg=1 ctermfg=15 +" hi DiffChange ctermbg=5 ctermfg=15 +" hi DiffDelete ctermbg=7 ctermfg=8 +hi Directory ctermbg=bg ctermfg=2 +hi IncSearch ctermbg=9 ctermfg=0 +hi Search ctermbg=9 ctermfg=0 +hi SpecialKey ctermbg=bg ctermfg=fg +hi Titled ctermbg=bg ctermfg=fg +hi ErrorMsg ctermbg=bg ctermfg=12 +hi ModeMsg ctermbg=bg ctermfg=9 +hi WarningMsg ctermbg=bg ctermfg=12 +hi StatusLine ctermbg=14 ctermfg=0 +hi StatusLineNC ctermbg=6 ctermfg=14 +hi VertSplit ctermbg=6 ctermfg=14 +" hi Folded +" hi FoldColumn +" hi SignColumn +hi Comment ctermbg=10 ctermfg=2 +hi Constant ctermbg=bg ctermfg=9 +hi String ctermbg=bg ctermfg=9 cterm=italic +hi Character ctermbg=bg ctermfg=9 cterm=italic +hi Number ctermbg=bg ctermfg=9 cterm=bold +hi Boolean ctermbg=bg ctermfg=9 cterm=bold +hi Float ctermbg=bg ctermfg=9 cterm=bold +hi Function ctermbg=bg ctermfg=9 cterm=bold +hi Statement ctermbg=bg ctermfg=9 cterm=bold +hi Conditional ctermbg=bg ctermfg=6 cterm=bold +hi Repeat ctermbg=bg ctermfg=6 cterm=bold +hi Operator ctermbg=bg ctermfg=6 cterm=bold +hi Exception ctermbg=bg ctermfg=2 cterm=bold +hi PreProc ctermbg=bg ctermfg=6 +hi Include ctermbg=bg ctermfg=2 cterm=bold +hi Type ctermbg=bg ctermfg=2 cterm=bold +hi Typedef ctermbg=bg ctermfg=2 cterm=italic +hi Special ctermbg=bg ctermfg=fg cterm=bold +hi Tag ctermbg=bg ctermfg=9 cterm=bold +hi SpecialComment ctermbg=7 ctermfg=4 +hi Underlined ctermbg=bg ctermfg=9 cterm=underline +hi Title ctermbg=bg ctermfg=fg cterm=bold +hi Ignore ctermbg=bg ctermfg=7 +hi Error ctermbg=12 ctermfg=15 +hi Todo ctermbg=bg ctermfg=15 diff --git a/dot_vim/colors/billw.vim b/dot_vim/colors/billw.vim new file mode 100644 index 0000000..740642f --- /dev/null +++ b/dot_vim/colors/billw.vim @@ -0,0 +1,99 @@ +" vim: set tw=0 sw=4 sts=4 et: + +" Vim color file +" Maintainer: Datila Carvalho <datila@saci.homeip.net> +" Last Change: November, 3, 2003 +" Version: 0.1 + +" This is a VIM's version of the emacs color theme +" _Billw_ created by Bill White. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "billw" + + +""" Colors + +" GUI colors +hi Cursor guifg=fg guibg=cornsilk +hi CursorIM guifg=NONE guibg=cornsilk +"hi Directory +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg gui=bold guifg=White guibg=Red +"hi VertSplit +"hi Folded +"hi FoldColumn +"hi IncSearch +"hi LineNr +hi ModeMsg gui=bold +"hi MoreMsg +"hi NonText +hi Normal guibg=black guifg=cornsilk +"hi Question +hi Search gui=bold guifg=Black guibg=cornsilk +"hi SpecialKey +hi StatusLine guifg=orange1 +hi StatusLineNC guifg=yellow4 +"hi Title +hi Visual guifg=gray35 guibg=fg +hi VisualNOS gui=bold guifg=black guibg=fg +hi WarningMsg guifg=White guibg=Tomato +"hi WildMenu + +" Colors for syntax highlighting +hi Comment guifg=gold + +hi Constant guifg=mediumspringgreen + hi String guifg=orange + hi Character guifg=orange + hi Number guifg=mediumspringgreen + hi Boolean guifg=mediumspringgreen + hi Float guifg=mediumspringgreen + +hi Identifier guifg=yellow + hi Function guifg=mediumspringgreen + +hi Statement gui=bold guifg=cyan1 + hi Conditional gui=bold guifg=cyan1 + hi Repeat gui=bold guifg=cyan1 + hi Label guifg=cyan1 + hi Operator guifg=cyan1 + "hi Keyword + "hi Exception + +hi PreProc guifg=LightSteelBlue + hi Include guifg=LightSteelBlue + hi Define guifg=LightSteelBlue + hi Macro guifg=LightSteelBlue + hi PreCondit guifg=LightSteelBlue + +hi Type guifg=yellow + hi StorageClass guifg=cyan1 + hi Structure gui=bold guifg=cyan1 + hi Typedef guifg=cyan1 + +"hi Special + ""Underline Character + "hi SpecialChar gui=underline + "hi Tag gui=bold,underline + ""Statement + "hi Delimiter gui=bold + ""Bold comment (in Java at least) + "hi SpecialComment gui=bold + "hi Debug gui=bold + +hi Underlined gui=underline + +hi Ignore guifg=bg + +hi Error gui=bold guifg=White guibg=Red + +"hi Todo diff --git a/dot_vim/colors/biogoo.vim b/dot_vim/colors/biogoo.vim new file mode 100644 index 0000000..cec72b1 --- /dev/null +++ b/dot_vim/colors/biogoo.vim @@ -0,0 +1,85 @@ +" Vim color File +" Name: biogoo +" Maintainer: Benjamin Esham <bdesham@iname.com> +" Last Change: 2004-02-03 +" Version: 1.2 +" +" A fairly simple gray-background scheme. Feedback is greatly appreciated! +" +" Installation: +" Copy to ~/.vim/colors; do :color biogoo +" +" Customization Options: +" Use a 'normal' cursor color: +" let g:biogoo_normal_cursor = 1 +" +" Props: +" Jani Nurminen's zenburn.vim as an example file. +" Scott and Matt for feature suggestions. +" +" Version History: +" 1.2: added `SpellErrors' group for use with vimspell. +" 1.1: added `IncSearch' group for improved visibility in incremental searches. +" 1.0: minor tweaks +" 0.95: initial release +" +" TODO: Possibly add some more groups -- please email me if I've left any out. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "biogoo" + +hi Comment guifg=#0000c3 +hi Constant guifg=#0000ff +hi Delimiter guifg=#00007f +hi DiffAdd guifg=#007f00 guibg=#e5e5e5 +hi DiffChange guifg=#00007f guibg=#e5e5e5 +hi DiffDelete guifg=#7f0000 guibg=#e5e5e5 +hi DiffText guifg=#ee0000 guibg=#e5e5e5 +hi Directory guifg=#b85d00 +hi Error guifg=#d6d6d6 guibg=#7f0000 +hi ErrorMsg guifg=#ffffff guibg=#ff0000 gui=bold +hi Float guifg=#b85d00 +hi FoldColumn guifg=#00007f guibg=#e5e5e5 +hi Folded guifg=#00007f guibg=#e5e5e5 +hi Function guifg=#7f0000 +hi Identifier guifg=#004000 +hi Include guifg=#295498 gui=bold +hi IncSearch guifg=#ffffff guibg=#0000ff gui=bold +hi LineNr guifg=#303030 guibg=#e5e5e5 gui=underline +hi Keyword guifg=#00007f +hi Macro guifg=#295498 +hi ModeMsg guifg=#00007f +hi MoreMsg guifg=#00007f +hi NonText guifg=#007f00 +hi Normal guifg=#000000 guibg=#d6d6d6 +hi Number guifg=#b85d00 +hi Operator guifg=#00007f +hi PreCondit guifg=#295498 gui=bold +hi PreProc guifg=#0c3b6b gui=bold +hi Question guifg=#00007f +hi Search guibg=#ffff00 +hi Special guifg=#007f00 +hi SpecialKey guifg=#00007f +hi SpellErrors guifg=#7f0000 gui=underline +hi Statement guifg=#00007f gui=none +hi StatusLine guifg=#00007f guibg=#ffffff +hi StatusLineNC guifg=#676767 guibg=#ffffff +hi String guifg=#d10000 +hi Title guifg=#404040 gui=bold +hi Todo guifg=#00007f guibg=#e5e5e5 gui=underline +hi Type guifg=#540054 gui=bold +hi Underlined guifg=#b85d00 +hi VertSplit guifg=#676767 guibg=#ffffff +hi Visual guifg=#7f7f7f guibg=#ffffff +hi VisualNOS guifg=#007f00 guibg=#e5e5e5 +hi WarningMsg guifg=#500000 +hi WildMenu guifg=#540054 + +if !exists("g:biogoo_normal_cursor") + " use a gray-on-blue cursor + hi Cursor guifg=#ffffff guibg=#00007f +endif diff --git a/dot_vim/colors/black_angus.vim b/dot_vim/colors/black_angus.vim new file mode 100644 index 0000000..145b639 --- /dev/null +++ b/dot_vim/colors/black_angus.vim @@ -0,0 +1,115 @@ +" Vim color file +" Maintainer: Angus Salkeld +" Last Change: 14 September 2004 +" Version: 1.0 +" mainly green on black + +set background=dark +highlight clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "black_angus" + +" GUI +" ----------------------------------------------------------------------- +highlight Normal guifg=Grey80 guibg=Black +highlight Search guifg=brown gui=reverse +highlight Visual guifg=Grey25 gui=bold +highlight Cursor guifg=Yellow guibg=DarkGreen gui=bold +highlight DiffAdd guibg=#000080 gui=NONE +highlight DiffChange guibg=#800080 gui=NONE +highlight DiffDelete guifg=#80c0e0 guibg=#404040 gui=NONE +highlight DiffText guifg=Black guibg=#c0e080 gui=NONE + +" Console +" ----------------------------------------------------------------------- +highlight Normal ctermfg=LightGrey ctermbg=Black +highlight Search ctermfg=Brown cterm=reverse +highlight Visual cterm=reverse +highlight Cursor ctermfg=Yellow ctermbg=Green cterm=bold + +" both +" ----------------------------------------------------------------------- +highlight StatusLine guifg=LightGreen guibg=#003300 gui=none ctermfg=LightGreen ctermbg=DarkGreen term=none +highlight VertSplit guifg=LightGreen guibg=#003300 gui=none ctermfg=LightGreen ctermbg=DarkGreen term=none +highlight Folded guifg=#aaDDaa guibg=#333333 gui=none ctermfg=LightGray ctermbg=DarkGray term=none +highlight FoldColumn guifg=LightGreen guibg=#003300 gui=none ctermfg=LightGreen ctermbg=DarkGreen term=none +highlight SignColumn guifg=LightGreen guibg=#003300 gui=none ctermfg=LightGreen ctermbg=DarkGreen term=none +highlight WildMenu guifg=LightGreen guibg=#003300 gui=none ctermfg=LightGreen ctermbg=DarkGreen term=none + +highlight LineNr guifg=DarkGreen guibg=Black gui=none ctermfg=DarkGreen ctermbg=Black term=none +highlight Directory guifg=LightGreen ctermfg=LightGreen +highlight Comment guifg=DarkGrey ctermfg=DarkGray + +highlight Special guifg=Orange ctermfg=Brown +highlight Title guifg=Orange ctermfg=Brown +highlight Tag guifg=DarkRed ctermfg=DarkRed +highlight link Delimiter Special +highlight link SpecialChar Special +highlight link SpecialComment Special +highlight link SpecialKey Special +highlight link NonText Special + +highlight Error guifg=White guibg=DarkRed gui=none ctermfg=White ctermbg=DarkRed cterm=none +highlight Debug guifg=White guibg=DarkGreen gui=none ctermfg=White ctermbg=DarkRed cterm=none +highlight ErrorMsg guifg=White guibg=DarkBlue gui=none ctermfg=White ctermbg=DarkRed cterm=none +highlight WarningMsg guifg=White guibg=DarkBlue gui=none ctermfg=White ctermbg=DarkBlue cterm=none +highlight Todo guifg=White guibg=DarkYellow gui=none ctermfg=White ctermbg=DarkBlue cterm=none +highlight link cCommentStartError WarningMsg +highlight link cCommentError Debug + +" Preprocesor +highlight PreCondit guifg=Cyan3 ctermfg=Cyan +highlight PreProc guifg=Magenta ctermfg=Magenta +highlight Include guifg=DarkCyan ctermfg=DarkCyan +highlight ifdefIfOut guifg=DarkGray ctermfg=DarkGray +highlight link Macro Include +highlight link Define Include + +" lang +highlight Function guifg=#AAEEAA gui=none ctermfg=LightGreen +highlight Identifier guifg=#bbccbb gui=none ctermfg=Grey +highlight Statement guifg=LightGreen gui=underline ctermfg=LightGreen +highlight Operator guifg=Yellow gui=none ctermfg=Yellow +highlight Conditional guifg=lightslateblue gui=none ctermfg=LightBlue + +highlight link Exception Statement +highlight link Label Statement +highlight link Repeat Conditional + +highlight link Keyword Label + +highlight Constant guifg=LightGreen ctermfg=LightGreen gui=none +highlight link Character Constant +highlight link Number Constant +highlight link Boolean Constant +highlight link String Constant +highlight link Float Constant + +highlight Type guifg=DarkGreen ctermfg=DarkGreen gui=none +highlight link StorageClass Type +highlight link Structure Type +highlight link Typedef Type + +" ------------------------------------------------------------------------------ +" Common groups that link to other highlighting definitions. +highlight link Search IncSearch +highlight link Question Statement +highlight link VisualNOS Visual +" ------------------------------------------------------------------------------ + +" only for vim 5 +if has("unix") + if v:version<600 + highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE + highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold + highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold + highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue + highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue + endif +endif + + + diff --git a/dot_vim/colors/blackbeauty.vim b/dot_vim/colors/blackbeauty.vim new file mode 100644 index 0000000..a824ea3 --- /dev/null +++ b/dot_vim/colors/blackbeauty.vim @@ -0,0 +1,66 @@ +" Vim color file +" Maintainer: Surya +" Last Change: 12/23/2003 10:32:41 . +" version: 1.0 +" This color scheme uses a dark background. +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "koehler" +hi Normal guifg=white guibg=black +hi Scrollbar guibg=darkgray guifg=darkgray +hi Menu guifg=black guibg=gray +hi SpecialKey term=bold cterm=bold ctermfg=darkred guifg=Blue +hi NonText term=bold cterm=bold ctermfg=darkred gui=bold guifg=Blue +hi Directory term=bold cterm=bold ctermfg=brown guifg=Blue +hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=blue gui=bold guifg=White guibg=brown +hi Search term=reverse ctermfg=white ctermbg=red gui=bold guifg=#000000 guibg=Magenta +hi MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=SeaGreen +hi ModeMsg term=bold cterm=bold gui=bold guifg=White guibg=Blue +hi LineNr term=underline cterm=bold ctermfg=darkcyan guibg=brown guifg=white +hi Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=Green +hi StatusLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guibg=white guifg=brown +hi StatusLineNC term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue +hi Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=Magenta +hi Visual term=reverse cterm=reverse gui=reverse +hi WarningMsg term=standout cterm=bold ctermfg=darkblue gui=bold guifg=cyan guibg=Black +hi Cursor guifg=bg guibg=cyan +hi Comment term=bold cterm=bold ctermfg=cyan guifg=#80a0ff +hi Constant term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0 +hi String term=underline cterm=bold ctermfg=magenta gui=bold guifg=brown guibg=darkgray +hi Number term=underline cterm=bold ctermfg=magenta guifg=#00ffff +hi Special term=bold gui=bold cterm=bold ctermfg=red guifg=Orange +hi Identifier term=underline ctermfg=brown guifg=#40ffff +hi Statement term=bold cterm=bold ctermfg=yellow gui=bold guifg=#ffff60 +hi PreProc term=underline ctermfg=darkblue guifg=#ff80ff +hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60 +hi Error gui=bold guifg=Yellow guibg=Black +hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow +"hi VertSplit guifg=#00FFFF guibg=#000000 gui=bold +hi link IncSearch Visual +hi link Character Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special + diff --git a/dot_vim/colors/blackdust.vim b/dot_vim/colors/blackdust.vim new file mode 100644 index 0000000..0eb20a7 --- /dev/null +++ b/dot_vim/colors/blackdust.vim @@ -0,0 +1,62 @@ +set background=dark +hi clear + +hi Boolean guifg=#dca3a3 gui=bold +hi Character guifg=#dca3a3 gui=bold +hi Comment guifg=#7f7f7f +hi Condtional guifg=#8fffff +hi Constant guifg=#dca3a3 gui=bold +hi Cursor guifg=#000000 guibg=#aeaeae +hi Debug guifg=#dca3a3 gui=bold +hi Define guifg=#ffcfaf gui=bold +hi Delimiter guifg=#8f8f8f +hi DiffAdd guibg=#613c46 +hi DiffChange guibg=#333333 +hi DiffDelete guifg=#333333 guibg=#464646 gui=none +hi DiffText guifg=#ffffff guibg=#1f1f1f gui=bold +hi Directory guifg=#ffffff gui=bold +hi Error guifg=#000000 guibg=#00ffff +hi ErrorMsg guifg=#000000 guibg=#00c0cf +hi Exception guifg=#8fffff gui=underline +hi Float guifg=#9c93b3 +hi FoldColumn guifg=#dca3a3 guibg=#464646 +hi Folded guifg=#dca3a3 guibg=#333333 +hi Function guifg=#ffff8f +hi Identifier guifg=#ffffff +hi Include guifg=#ffcfaf gui=bold +hi IncSearch guifg=#000000 guibg=#c15c66 +hi Keyword guifg=#ffffff gui=bold +hi Label guifg=#8fffff gui=underline +hi LineNr guifg=#7f7f7f guibg=#464646 +hi Macro guifg=#ffcfaf gui=bold +hi ModeMsg guifg=#dca3a3 gui=bold +hi MoreMsg guifg=#ffffff gui=bold +hi NonText guifg=#1f1f1f +hi Normal guifg=#cccccc guibg=#3f3f3f +hi Number guifg=#aca0a3 +hi Operator guifg=#ffffff +hi PreCondit guifg=#dfaf8f gui=bold +hi PreProc guifg=#ffcfaf gui=bold +hi Question guifg=#ffffff gui=bold +hi Repeat guifg=#8fffff gui=underline +hi Search guifg=#000000 guibg=#c15c66 +hi SpecialChar guifg=#dca3a3 gui=bold +hi SpecialComment guifg=#dca3a3 gui=bold +hi Special guifg=#7f7f7f +hi SpecialKey guifg=#7e7e7e +hi Statement guifg=#8fffff +hi StatusLine guifg=#333333 guibg=#f18c96 +hi StatusLineNC guifg=#333333 guibg=#cccccc +hi StorageClass guifg=#ffffff gui=bold +hi String guifg=#cc9393 +hi Structure guifg=#ffffff gui=bold,underline +hi Tag guifg=#dca3a3 gui=bold +hi Title guifg=#ffffff guibg=#333333 gui=bold +hi Todo guifg=#ffffff guibg=#000000 gui=bold +hi Typedef guifg=#ffffff gui=bold,underline +hi Type guifg=#ffffff gui=bold +hi VertSplit guifg=#333333 guibg=#cccccc +hi Visual guifg=#333333 guibg=#f18c96 gui=reverse +hi VisualNOS guifg=#333333 guibg=#f18c96 gui=bold,underline +hi WarningMsg guifg=#ffffff guibg=#333333 gui=bold +hi WildMenu guifg=#000000 guibg=#dca3a3 diff --git a/dot_vim/colors/blacksea.vim b/dot_vim/colors/blacksea.vim new file mode 100644 index 0000000..5cd38a3 --- /dev/null +++ b/dot_vim/colors/blacksea.vim @@ -0,0 +1,32 @@ +" Vim color file +" Maintainer: Gerald S. Williams +" Last Change: 2003 Mar 20 + +" This is a dark version/opposite of "seashell". The cterm version of this is +" very similar to "evening". +" +" Only values that differ from defaults are specified. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "BlackSea" + +hi Normal guibg=Black guifg=seashell ctermfg=White +hi NonText guifg=LavenderBlush ctermfg=LightMagenta +hi DiffDelete guibg=DarkRed guifg=Black ctermbg=DarkRed ctermfg=White +hi DiffAdd guibg=DarkGreen ctermbg=DarkGreen ctermfg=White +hi DiffChange guibg=Gray30 ctermbg=DarkCyan ctermfg=White +hi DiffText gui=NONE guibg=DarkCyan ctermbg=DarkCyan ctermfg=Yellow +hi Comment guifg=LightBlue +hi Constant guifg=DeepPink +hi PreProc guifg=Magenta ctermfg=Magenta +hi StatusLine guibg=#1f001f guifg=DarkSeaGreen cterm=NONE ctermfg=White ctermbg=DarkGreen +hi StatusLineNC guifg=Gray +hi VertSplit guifg=Gray +hi Type gui=NONE +hi Identifier guifg=Cyan +hi Statement guifg=brown3 ctermfg=DarkRed +hi Search guibg=Gold3 ctermfg=White diff --git a/dot_vim/colors/blue.vim b/dot_vim/colors/blue.vim new file mode 100644 index 0000000..220700f --- /dev/null +++ b/dot_vim/colors/blue.vim @@ -0,0 +1,41 @@ +" Vim color file +" Maintainer: TaQ <taq@taq.cjb.net> +" Last Change: 10 October 2001 - 0.2 +" URL: http://taq.cjb.net + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark " or light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="blue" + +hi Normal ctermfg=Gray ctermbg=Black guifg=#CCCCCC guibg=#000040 +hi NonText ctermfg=Gray ctermbg=Black guifg=#0050EE guibg=#000040 + +hi Statement ctermfg=White ctermbg=Black guifg=#007FFF guibg=#000040 gui=BOLD +hi Comment ctermfg=Blue ctermbg=Black guifg=#00A0FF guibg=#000090 gui=NONE +hi Constant ctermfg=White ctermbg=Black guifg=#0050EE guibg=#000040 gui=NONE +hi Identifier ctermfg=Cyan ctermbg=Black guifg=#FFFFFF guibg=#000040 gui=NONE +hi Type ctermfg=Cyan ctermbg=Black guifg=#5050FF guibg=#000040 gui=NONE +hi Folded ctermfg=White ctermbg=Blue guifg=#00A0FF guibg=#000050 gui=BOLD +hi Special ctermfg=Blue ctermbg=Black guifg=#00A0FF guibg=#000090 gui=NONE +hi PreProc ctermfg=Blue ctermbg=Black guifg=#00FF00 guibg=#000040 gui=BOLD +hi Scrollbar ctermfg=Blue ctermbg=Black guifg=#00C0FF guibg=#000040 +hi Cursor ctermfg=white ctermbg=Black guifg=#FFFFFF guibg=#5050FF +hi ErrorMsg ctermfg=white ctermbg=Red guifg=#FFFFFF guibg=#FF0000 +hi WarningMsg ctermfg=Black ctermbg=Yellow guifg=#000000 guibg=#FFFF00 +hi VertSplit ctermfg=White ctermbg=Blue guifg=#000090 guibg=#000090 +hi Directory ctermfg=Cyan ctermbg=DarkBlue guifg=#00A0F0 guibg=#000040 +hi Visual ctermfg=Black ctermbg=Cyan guifg=#5050FF guibg=#FFFFFF +hi Title ctermfg=White ctermbg=Blue guifg=#FFFFFF guibg=#0050EE gui=NONE + +hi StatusLine term=bold cterm=bold ctermfg=White ctermbg=Blue gui=bold guifg=#FFFFFF guibg=#0050EE +hi StatusLineNC term=bold cterm=bold ctermfg=Gray ctermbg=Blue gui=bold guifg=#AAAAAA guibg=#000090 +hi LineNr term=bold cterm=bold ctermfg=White ctermbg=DarkBlue gui=bold guifg=#00A0FF guibg=#000050 + diff --git a/dot_vim/colors/bluegreen.vim b/dot_vim/colors/bluegreen.vim new file mode 100644 index 0000000..0b23dcd --- /dev/null +++ b/dot_vim/colors/bluegreen.vim @@ -0,0 +1,52 @@ + + +" Vim color file +" Maintainer: +" Last Change: +" URL: + + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="mine" + +hi Normal guifg=White guibg=#061A3E + +" highlight groups +hi Cursor guibg=#D74141 guifg=#e3e3e3 +hi VertSplit guibg=#C0FFFF guifg=#075554 gui=none +hi Folded guibg=#FFC0C0 guifg=black +hi FoldColumn guibg=#800080 guifg=tan +"hi IncSearch cterm=none ctermbg=blue ctermfg=grey guifg=slategrey guibg=khaki +hi ModeMsg guifg=#404040 guibg=#C0C0C0 +hi MoreMsg guifg=darkturquoise guibg=#188F90 +hi NonText guibg=#334C75 guifg=#9FADC5 +hi Question guifg=#F4BB7E +hi Search guibg=fg guifg=bg +hi SpecialKey guifg=#BF9261 +hi StatusLine guibg=#004443 guifg=#c0ffff gui=none +hi StatusLineNC guibg=#067C7B guifg=#004443 gui=bold +hi Title guifg=#8DB8C3 +hi Visual gui=bold guifg=black guibg=#C0FFC0 +hi WarningMsg guifg=#F60000 gui=underline + +" syntax highlighting groups +hi Comment guifg=#DABEA2 +hi Constant guifg=#72A5E4 gui=bold +hi Identifier guifg=#ADCBF1 +hi Statement guifg=#7E75B5 +hi PreProc guifg=#14F07C +hi Type guifg=#A9EE8A +hi Special guifg=#EEBABA +hi Ignore guifg=grey60 +hi Todo guibg=#9C8C84 guifg=#244C0A + +"vim: ts=4 diff --git a/dot_vim/colors/blugrine.vim b/dot_vim/colors/blugrine.vim new file mode 100644 index 0000000..6ba6330 --- /dev/null +++ b/dot_vim/colors/blugrine.vim @@ -0,0 +1,42 @@ +" author Helder Correia < helder (dot) correia (at) netcabo (dot) pt> +" version 2004.0 +" based on bluegreen colorscheme by Joao Estevao +" feel free to modify / redistribute this file + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="blugrine" + +hi Normal guifg=White guibg=#000000 + +" highlight groups +hi Cursor guibg=#D74141 guifg=#e3e3e3 +hi VertSplit guibg=#C0FFFF guifg=#075554 gui=none +hi Folded guibg=#FFC0C0 guifg=black +hi FoldColumn guibg=#800080 guifg=tan +hi ModeMsg guifg=#404040 guibg=#C0C0C0 +hi MoreMsg guifg=darkturquoise guibg=#188F90 +hi NonText guibg=#334C75 guifg=#9FADC5 +hi Question guifg=#F4BB7E +hi Search guibg=fg guifg=bg +hi SpecialKey guifg=#BF9261 +hi StatusLine guibg=#004443 guifg=#c0ffff gui=none +hi StatusLineNC guibg=#067C7B guifg=#004443 gui=bold +hi Title guifg=#8DB8C3 +hi Visual gui=bold guifg=black guibg=#C0FFC0 +hi WarningMsg guifg=#F60000 gui=underline + +" syntax highlighting groups +hi Comment guifg=#DABEA2 +hi Constant guifg=#72A5E4 gui=bold +hi Identifier guifg=#ADCBF1 +hi Statement guifg=#7E75B5 +hi PreProc guifg=#14F07C +hi Type guifg=#A9EE8A +hi Special guifg=#EEBABA +hi Ignore guifg=grey60 +hi Todo guibg=#9C8C84 guifg=#244C0A + diff --git a/dot_vim/colors/bmichaelsen.vim b/dot_vim/colors/bmichaelsen.vim new file mode 100644 index 0000000..b63f65c --- /dev/null +++ b/dot_vim/colors/bmichaelsen.vim @@ -0,0 +1,55 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Björn Michaelsen <bmichaelsen@gmx.de> +" based on: Zellner maintained by Ron Aaron <ronaharon@yahoo.com> +" Last Change: 2003 Sep 09 + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "bmichaelsen" + +hi Comment term=bold ctermfg=Red guifg=Red +hi Normal guifg=black guibg=#dee2ee +hi Constant term=underline ctermfg=Magenta guifg=Magenta +hi Special term=bold ctermfg=Magenta guifg=Magenta +hi Identifier term=underline ctermfg=Blue guifg=Blue +hi Statement term=bold ctermfg=DarkRed gui=NONE guifg=Brown +hi PreProc term=underline ctermfg=Magenta guifg=Purple +hi Type term=underline ctermfg=Blue gui=NONE guifg=Blue +hi Visual term=reverse ctermfg=Yellow ctermbg=Red gui=NONE guifg=Black guibg=#5a5d6a +hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan +hi Tag term=bold ctermfg=DarkGreen guifg=DarkGreen +hi Error term=reverse ctermfg=15 ctermbg=9 guibg=Red guifg=White +hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=#5a5d6a +hi StatusLine term=bold,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=NONE guifg=Black guibg=#a4b2c5 +hi! link MoreMsg Comment +hi! link ErrorMsg Visual +hi! link WarningMsg ErrorMsg +hi! link Question Comment +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special diff --git a/dot_vim/colors/bog.vim b/dot_vim/colors/bog.vim new file mode 100644 index 0000000..542262d --- /dev/null +++ b/dot_vim/colors/bog.vim @@ -0,0 +1,87 @@ +" Vim color file +" Maintainer: [smeagol] <webmaster@quantumz.net> +" Last Change: +" URL: + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +" your pick: +set background=light " or light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="bog" + +hi Normal guifg=#3a3a3d guibg=white ctermfg=darkgrey ctermbg=white + +" OR + +" highlight clear Normal +" set background& +" highlight clear +" if &background == "light" +" highlight Error ... +" ... +" else +" highlight Error ... +" ... +" endif + +" A good way to see what your colorscheme does is to follow this procedure: +" :w +" :so % +" +" Then to see what the current setting is use the highlight command. +" For example, +" :hi Cursor +" gives +" Cursor xxx guifg=bg guibg=fg + +" Uncomment and complete the commands you want to change from the default. + +hi Cursor guifg=#04ae6c guibg=#0056a0 ctermfg=darkgreen ctermbg=darkblue +"hi CursorIM +hi Directory guifg=green ctermfg=green +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg guibg=#004a8a guifg=white ctermfg=white ctermbg=darkblue +hi VertSplit guibg=#04ae6c guifg=#0056a0 +hi Folded guibg=#0a62c4 guifg=#60abff ctermfg=lightgrey ctermbg=blue +hi FoldColumn guibg=#0a62c4 guifg=#60abff ctermfg=lightgrey ctermbg=blue +hi IncSearch guifg=white guibg=#ffdc34 ctermfg=white ctermbg=lightred gui=underline +hi LineNr guifg=#3669e8 guibg=white ctermfg=lightblue ctermbg=white +hi ModeMsg guifg=orange guibg=white ctermfg=lightred ctermbg=white +hi MoreMsg guifg=orange guibg=white ctermfg=lightred ctermbg=white +hi NonText gui=bold +hi Question guifg=white guibg=orange ctermfg=white ctermbg=lightred +hi Search guifg=white guibg=#ffdc34 ctermfg=white ctermbg=lightred gui=underline +"hi SpecialKey +hi StatusLine guifg=#04ae6c guibg=white ctermfg=darkgreen ctermbg=white +hi StatusLineNC guifg=#04ae6c guibg=white ctermfg=darkgreen ctermbg=white +hi Title guifg=#02233f gui=bold +hi Visual guifg=darkblue guibg=white ctermfg=darkblue ctermbg=white +"hi VisualNOS +hi WarningMsg guifg=white guibg=orange ctermfg=white ctermbg=lightblue +hi WildMenu guifg=#75dc34 guibg=white ctermfg=lightgreen ctermbg=white +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=orange guibg=white ctermbg=white ctermfg=blue +hi Constant guifg=#5b8f8d guibg=white ctermfg=grey ctermbg=white +hi Identifier guifg=#aad2ff guibg=white ctermfg=grey ctermbg=white +hi Statement guifg=#808283 guibg=white ctermfg=lightgrey ctermbg=white +hi PreProc guifg=#023a6a gui=bold guibg=white ctermfg=darkblue ctermbg=white +hi Type guifg=#0e9152 guibg=white ctermfg=darkgreen ctermbg=white +hi Special guifg=white guibg=skyblue ctermfg=white ctermbg=blue +hi Underlined guifg=#00d0e8 ctermbg=blue +hi Ignore guifg=black guibg=white ctermfg=black ctermbg=white +"hi Error +hi Todo guibg=lightblue guifg=white ctermbg=lightblue ctermfg=white diff --git a/dot_vim/colors/borland.vim b/dot_vim/colors/borland.vim new file mode 100644 index 0000000..c39c101 --- /dev/null +++ b/dot_vim/colors/borland.vim @@ -0,0 +1,60 @@ +" Vim color file +" Maintainer: Yegappan Lakshmanan +" Last Change: 2001 Sep 9 + +" Color settings similar to that used in Borland IDE's. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="borland" + +hi Normal term=NONE cterm=NONE ctermfg=Yellow ctermbg=DarkBlue +hi Normal gui=NONE guifg=Yellow guibg=DarkBlue +hi NonText term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi NonText gui=NONE guifg=White guibg=DarkBlue + +hi Statement term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi Statement gui=NONE guifg=White guibg=DarkBlue +hi Special term=NONE cterm=NONE ctermfg=Cyan ctermbg=DarkBlue +hi Special gui=NONE guifg=Cyan guibg=DarkBlue +hi Constant term=NONE cterm=NONE ctermfg=Magenta ctermbg=DarkBlue +hi Constant gui=NONE guifg=Magenta guibg=DarkBlue +hi Comment term=NONE cterm=NONE ctermfg=Gray ctermbg=DarkBlue +hi Comment gui=NONE guifg=Gray guibg=DarkBlue +hi Preproc term=NONE cterm=NONE ctermfg=Green ctermbg=DarkBlue +hi Preproc gui=NONE guifg=Green guibg=DarkBlue +hi Type term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi Type gui=NONE guifg=White guibg=DarkBlue +hi Identifier term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi Identifier gui=NONE guifg=White guibg=DarkBlue + +hi StatusLine term=bold cterm=bold ctermfg=Black ctermbg=White +hi StatusLine gui=bold guifg=Black guibg=White + +hi StatusLineNC term=NONE cterm=NONE ctermfg=Black ctermbg=White +hi StatusLineNC gui=NONE guifg=Black guibg=White + +hi Visual term=NONE cterm=NONE ctermfg=Black ctermbg=DarkCyan +hi Visual gui=NONE guifg=Black guibg=DarkCyan + +hi Search term=NONE cterm=NONE ctermbg=Gray +hi Search gui=NONE guibg=Gray + +hi VertSplit term=NONE cterm=NONE ctermfg=Black ctermbg=White +hi VertSplit gui=NONE guifg=Black guibg=White + +hi Directory term=NONE cterm=NONE ctermfg=Green ctermbg=DarkBlue +hi Directory gui=NONE guifg=Green guibg=DarkBlue + +hi WarningMsg term=standout cterm=NONE ctermfg=Red ctermbg=DarkBlue +hi WarningMsg gui=standout guifg=Red guibg=DarkBlue + +hi Error term=NONE cterm=NONE ctermfg=White ctermbg=Red +hi Error gui=NONE guifg=White guibg=Red + +hi Cursor ctermfg=Black ctermbg=Yellow +hi Cursor guifg=Black guibg=Yellow + diff --git a/dot_vim/colors/breeze.vim b/dot_vim/colors/breeze.vim new file mode 100644 index 0000000..21cf417 --- /dev/null +++ b/dot_vim/colors/breeze.vim @@ -0,0 +1,70 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/30 Wed 00:08. +" version: 1.0 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "breeze" + +hi Normal guifg=#ffffff guibg=#005c70 + +" Search +hi IncSearch gui=UNDERLINE guifg=#60ffff guibg=#6060ff +hi Search gui=NONE guifg=#ffffff guibg=#6060ff + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi ModeMsg gui=NONE guifg=#60ffff guibg=NONE +hi MoreMsg gui=NONE guifg=#ffc0ff guibg=NONE +hi Question gui=NONE guifg=#ffff60 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#d0d0e0 +hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0 +hi VertSplit gui=NONE guifg=#606080 guibg=#d0d0e0 +hi WildMenu gui=NONE guifg=#000000 guibg=#00c8f0 + +" Diff +hi DiffText gui=UNDERLINE guifg=#ffff00 guibg=#000000 +hi DiffChange gui=NONE guifg=#ffffff guibg=#000000 +hi DiffDelete gui=NONE guifg=#60ff60 guibg=#000000 +hi DiffAdd gui=NONE guifg=#60ff60 guibg=#000000 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#d86020 +hi lCursor gui=NONE guifg=#ffffff guibg=#e000b0 +hi CursorIM gui=NONE guifg=#ffffff guibg=#e000b0 + +" Fold +hi Folded gui=NONE guifg=#ffffff guibg=#0088c0 +" hi Folded gui=NONE guifg=#ffffff guibg=#2080d0 +hi FoldColumn gui=NONE guifg=#60e0e0 guibg=#006c7f + +" Other +hi Directory gui=NONE guifg=#00e0ff guibg=NONE +hi LineNr gui=NONE guifg=#60a8bc guibg=NONE +hi NonText gui=BOLD guifg=#00c0c0 guibg=#006276 +hi SpecialKey gui=NONE guifg=#e0a0ff guibg=NONE +hi Title gui=BOLD guifg=#ffffff guibg=NONE +hi Visual gui=NONE guifg=#ffffff guibg=#6060d0 +" hi VisualNOS gui=NONE guifg=#ffffff guibg=#6060d0 + +" Syntax group +hi Comment gui=NONE guifg=#c8d0d0 guibg=NONE +hi Constant gui=NONE guifg=#60ffff guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi Identifier gui=NONE guifg=#cacaff guibg=NONE +hi Ignore gui=NONE guifg=#006074 guibg=NONE +hi PreProc gui=NONE guifg=#ffc0ff guibg=NONE +hi Special gui=NONE guifg=#ffd074 guibg=NONE +hi Statement gui=NONE guifg=#ffff80 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#ffb0b0 guibg=NONE +hi Type gui=NONE guifg=#80ffa0 guibg=NONE +hi Underlined gui=UNDERLINE guifg=#ffffff guibg=NONE diff --git a/dot_vim/colors/brookstream.vim b/dot_vim/colors/brookstream.vim new file mode 100644 index 0000000..ee907c6 --- /dev/null +++ b/dot_vim/colors/brookstream.vim @@ -0,0 +1,83 @@ +"-------------------------------------------------------------------- +" Name Of File: brookstream.vim. +" Description: Gvim colorscheme, works best with version 6.1 GUI . +" Maintainer: Peter Bäckström. +" Creator: Peter Bäckström. +" URL: http://www.brookstream.org (Swedish). +" Credits: Inspiration from the darkdot scheme. +" Last Change: Friday, April 13, 2003. +" Installation: Drop this file in your $VIMRUNTIME/colors/ directory. +"-------------------------------------------------------------------- + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="brookstream" + +"-------------------------------------------------------------------- + +hi Normal gui=none guibg=#000000 guifg=#bbbbbb +hi Cursor guibg=#44ff44 guifg=#000000 +hi Directory guifg=#44ffff +hi DiffAdd guibg=#080808 guifg=#ffff00 +hi DiffDelete guibg=#080808 guifg=#444444 +hi DiffChange guibg=#080808 guifg=#ffffff +hi DiffText guibg=#080808 guifg=#bb0000 +hi ErrorMsg guibg=#880000 guifg=#ffffff +hi Folded guifg=#000088 +hi IncSearch guibg=#000000 guifg=#bbcccc +hi LineNr guibg=#050505 guifg=#4682b4 +hi ModeMsg guifg=#ffffff +hi MoreMsg guifg=#44ff44 +hi NonText guifg=#4444ff +hi Question guifg=#ffff00 +hi SpecialKey guifg=#4444ff +hi StatusLine gui=none guibg=#2f4f4f guifg=#ffffff +hi StatusLineNC gui=none guibg=#bbbbbb guifg=#000000 +hi Title guifg=#ffffff +hi Visual gui=none guibg=#bbbbbb guifg=#000000 +hi WarningMsg guifg=#ffff00 + +" syntax highlighting groups ---------------------------------------- + +hi Comment guifg=#696969 +hi Constant guifg=#00aaaa +hi Identifier guifg=#00e5ee +hi Statement guifg=#00ffff +hi PreProc guifg=#8470ff +hi Type guifg=#ffffff +hi Special gui=none guifg=#87cefa +hi Underlined gui=bold guifg=#4444ff +hi Ignore guifg=#444444 +hi Error guibg=#000000 guifg=#bb0000 +hi Todo guibg=#aa0006 guifg=#fff300 +hi Operator gui=none guifg=#00bfff +hi Function guifg=#1e90ff +hi String gui=None guifg=#4682b4 +hi Boolean guifg=#9bcd9b + +"hi link Character Constant +"hi link Number Constant +"hi link Boolean Constant +"hi link Float Number +"hi link Conditional Statement +"hi link Label Statement +"hi link Keyword Statement +"hi link Exception Statement +"hi link Repeat Statement +"hi link Include PreProc +"hi link Define PreProc +"hi link Macro PreProc +"hi link PreCondit PreProc +"hi link StorageClass Type +"hi link Structure Type +"hi link Typedef Type +"hi link Tag Special +"hi link Delimiter Special +"hi link SpecialComment Special +"hi link Debug Special +"hi link FoldColumn Folded + +"- end of colorscheme ----------------------------------------------- diff --git a/dot_vim/colors/brown.vim b/dot_vim/colors/brown.vim new file mode 100644 index 0000000..aecfe4e --- /dev/null +++ b/dot_vim/colors/brown.vim @@ -0,0 +1,32 @@ +hi comment guifg=#fef8ff ctermfg=red +hi constant guifg=#aa712f ctermfg=white +hi cursor guibg=#5e3807 guifg=#deb887 +hi diffadd ctermbg=green ctermfg=black +hi diffchange ctermbg=green ctermfg=white +hi diffdelete ctermbg=none ctermfg=darkyellow +hi difftext ctermbg=black ctermfg=green +hi directory guifg=#3e1807 ctermfg=green +hi error guibg=#cc3807 guifg=#deb887 +hi errormsg guifg=#cc3807 guibg=#f9d7a6 +hi identifier guifg=#5e3807 ctermfg=green +hi incsearch guifg=#f9d7a6 guibg=#8e6837 +hi modemsg guifg=#793807 ctermbg=none ctermfg=cyan gui=none +hi moremsg guifg=#793807 gui=none +hi nontext guifg=#ffffff ctermfg=darkgrey +hi normal guibg=#deb887 guifg=#846037 +hi preproc guifg=#7e6f27 ctermfg=white +hi question guifg=#793807 gui=none +hi scrollbar guibg=#deb887 guifg=#ae8857 +hi search guifg=#f9d7a6 ctermbg=cyan ctermfg=yellow guibg=#8e6837 +hi special guifg=#000000 ctermfg=yellow +hi specialkey guifg=#ffffff ctermfg=white +hi statement guifg=#7e5827 ctermfg=cyan +hi statusline guibg=#fee8b7 ctermbg=black ctermfg=darkgreen guifg=#793807 gui=none +hi statuslinenc guibg=#ae8857 ctermbg=black ctermfg=darkcyan guifg=#deb887 gui=none +hi title guifg=#793807 ctermfg=darkgreen gui=none +hi todo guibg=#995827 guifg=#fed8a7 +hi type guifg=#7e5827 ctermfg=yellow gui=none +hi vertsplit guibg=#ae8857 ctermbg=green ctermfg=black guifg=#ae8857 gui=none +hi visual guifg=#f9d7a6 guibg=#8e6837 ctermbg=black ctermfg=darkcyan +hi warningmsg guifg=#cc3807 +hi wildmenu guifg=#f9d7a6 guibg=#8e6837 diff --git a/dot_vim/colors/buttercream.vim b/dot_vim/colors/buttercream.vim new file mode 100644 index 0000000..30fb10d --- /dev/null +++ b/dot_vim/colors/buttercream.vim @@ -0,0 +1,59 @@ +" Vim color file +" vim: tw=0 ts=8 sw=4 +" Scriptname: buttercream +" Maintainer: Håkan Wikström <hakan@wikstrom.st> +" Version: 1.0 (initial release) +" Last Change: 20040126 +" As of now only gui is supported +" Based on the theme fog theme by Thomas R. Kimpton <tomk@emcity.net> + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = "buttercream" + +" Highlight Foreground Background Extras + +hi Normal guifg=#213a58 guibg=#f3edbb +hi NonText guifg=LightBlue guibg=#f4df8b gui=bold +hi Comment guifg=#2f8e99 +hi Constant guifg=#7070a0 +hi Statement guifg=DarkGreen gui=bold +hi identifier guifg=DarkGreen +hi preproc guifg=#408040 +hi type guifg=DarkBlue +hi label guifg=#c06000 +hi operator guifg=DarkGreen gui=bold +hi StorageClass guifg=#a02060 gui=bold +hi Number guifg=Blue +hi Special guifg=#aa8822 +hi Cursor guifg=LightGrey guibg=#880088 +hi lCursor guifg=Black guibg=Cyan +hi ErrorMsg guifg=White guibg=DarkRed +hi DiffText guibg=DarkRed gui=bold +hi Directory guifg=DarkGrey gui=underline +hi LineNr guifg=#ccaa22 +hi MoreMsg guifg=SeaGreen gui=bold +hi Question guifg=DarkGreen gui=bold +hi Search guifg=Black guibg=#887722 +hi SpecialKey guifg=Blue +hi SpecialChar guifg=DarkGrey gui=bold +hi Title guifg=DarkMagenta gui=underline +hi WarningMsg guifg=DarkBlue guibg=#9999cc +hi WildMenu guifg=Black guibg=Yellow gui=underline +hi Folded guifg=DarkBlue guibg=LightGrey +hi FoldColumn guifg=DarkBLue guibg=Grey +hi DiffAdd guibg=DarkBlue +hi DiffChange guibg=DarkMagenta +hi DiffDelete guifg=Blue guibg=DarkCyan gui=bold +hi Ignore guifg=grey90 +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi StatusLine gui=reverse,bold +hi StatusLineNC gui=reverse +hi VertSplit gui=reverse +hi Visual guifg=LightGrey gui=reverse +hi VisualNOS gui=underline,bold +hi Todo guibg=#ccaa22 gui=bold,underline diff --git a/dot_vim/colors/bw.vim b/dot_vim/colors/bw.vim new file mode 100644 index 0000000..4c97e57 --- /dev/null +++ b/dot_vim/colors/bw.vim @@ -0,0 +1,55 @@ +" Vim color file +" Maintainer: Hans Fugal <hans@fugal.net> +" Last Change: 5 Oct 2001 +" URL: http://fugal.net/vim/colors/bw.vim + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors +" +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="bw" + +hi SpecialKey cterm=bold ctermfg=NONE +hi NonText cterm=bold ctermfg=NONE +hi Directory cterm=bold ctermfg=NONE +hi ErrorMsg cterm=standout ctermfg=NONE +hi IncSearch cterm=reverse ctermfg=NONE +hi Search cterm=reverse ctermfg=NONE +hi MoreMsg cterm=bold ctermfg=NONE +hi ModeMsg cterm=bold ctermfg=NONE +hi LineNr cterm=underline ctermfg=NONE +hi Question cterm=standout ctermfg=NONE +hi StatusLine cterm=bold,reverse ctermfg=NONE +hi StatusLineNC cterm=reverse ctermfg=NONE +hi VertSplit cterm=reverse ctermfg=NONE +hi Title cterm=bold ctermfg=NONE +hi Visual cterm=reverse ctermfg=NONE +hi VisualNOS cterm=bold,underline ctermfg=NONE +hi WarningMsg cterm=standout ctermfg=NONE +hi WildMenu cterm=standout ctermfg=NONE +hi Folded cterm=standout ctermfg=NONE +hi FoldColumn cterm=standout ctermfg=NONE +hi DiffAdd cterm=bold ctermfg=NONE +hi DiffChange cterm=bold ctermfg=NONE +hi DiffDelete cterm=bold ctermfg=NONE +hi DiffText cterm=reverse ctermfg=NONE +hi Comment cterm=bold ctermfg=NONE +hi Constant cterm=underline ctermfg=NONE +hi Special cterm=bold ctermfg=NONE +hi Identifier cterm=underline ctermfg=NONE +hi Statement cterm=bold ctermfg=NONE +hi PreProc cterm=underline ctermfg=NONE +hi Type cterm=underline ctermfg=NONE +hi Underlined cterm=underline ctermfg=NONE +hi Ignore cterm=bold ctermfg=NONE +hi Error cterm=reverse ctermfg=NONE +hi Todo cterm=standout ctermfg=NONE diff --git a/dot_vim/colors/c.vim b/dot_vim/colors/c.vim new file mode 100644 index 0000000..6109c22 --- /dev/null +++ b/dot_vim/colors/c.vim @@ -0,0 +1,32 @@ +" Vim Syntax Highlighting File +" +" Language: C +" +" Extra: This is to copy the vi clone elvis on its +" syntax highlighting. +" +" Maintainer: Dean Jones<dean@cleancode.org> +" +" Comment: This works well with the default c.vim +" that comes with vim6.x. It basically +" overrides the very bright colors it uses +" and uses simple white for highlighting +" key words and types in the C language. +" If you're using Eterm, uncomment the +" Normal line specified below. + +hi clear + +" Eterm users, uncomment the line below +" hi Normal ctermfg=grey + +hi PreProc ctermfg=white +hi Type ctermfg=white +hi Statement ctermfg=white +hi Comment ctermfg=grey +hi Constant cterm=NONE ctermfg=NONE +hi Number cterm=NONE ctermfg=NONE +hi String cterm=NONE ctermfg=NONE +hi Special cterm=NONE ctermfg=NONE + +" EOF for Dean's Elvis like highlighting diff --git a/dot_vim/colors/camo.vim b/dot_vim/colors/camo.vim new file mode 100644 index 0000000..059af42 --- /dev/null +++ b/dot_vim/colors/camo.vim @@ -0,0 +1,76 @@ +" Vim color file +" Maintainer: Tim Aldrich <aldy0169@yahoo.com> +" Last Change: 19 January 2002 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="camo" +hi Normal guifg=bisque guibg=grey15 +hi Cursor guifg=snow guibg=bisque3 +hi CursorIM guifg=OliveDrab4 guibg=bisque +hi Directory guifg=OliveDrab4 guibg=grey15 +hi DiffAdd guifg=DarkOliveGreen1 guibg=grey15 +hi DiffChange guifg=PaleGreen guibg=grey15 +hi DiffDelete guifg=red guibg=grey15 +hi DiffText guifg=grey15 guibg=red +hi ErrorMsg guifg=snow guibg=red +hi VertSplit guifg=bisque4 guibg=DarkOliveGreen1 +hi Folded guifg=DarkOliveGreen2 guibg=grey30 +hi FoldColumn guifg=DarkOliveGreen2 guibg=grey30 +hi IncSearch guifg=bisque guibg=red +hi LineNr guifg=OliveDrab4 guibg=grey15 +hi ModeMsg guifg=khaki3 guibg=grey15 +hi MoreMsg guifg=khaki3 guibg=grey15 +hi NonText guifg=DarkSalmon guibg=grey10 +hi Question guifg=IndianRed guibg=grey10 +hi Search guifg=DarkSalmon guibg=grey15 +hi SpecialKey guifg=yellow guibg=grey15 +hi StatusLine guifg=bisque4 guibg=DarkOliveGreen1 +hi StatusLineNC guifg=bisque4 guibg=DarkOliveGreen3 +hi Title guifg=IndianRed guibg=grey15 +hi Visual guifg=OliveDrab4 guibg=bisque1 +hi WarningMsg guifg=bisque guibg=red +hi WildMenu guifg=LightBlue guibg=DarkViolet + + +"Syntax hilight groups + +hi Comment guifg=tan +hi Constant guifg=khaki +hi String guifg=moccasin +hi Character guifg=chocolate +hi Number guifg=chocolate +hi Boolean guifg=OliveDrab3 +hi Float guifg=chocolate +hi Identifier guifg=khaki4 +hi Function guifg=OliveDrab4 +hi Statement guifg=khaki +hi Conditional guifg=khaki +hi Repeat guifg=khaki +hi Label guifg=khaki +hi Operator guifg=DarkKhaki +hi Keyword guifg=DarkKhaki +hi Exception guifg=khaki +hi PreProc guifg=khaki4 +hi Include guifg=khaki4 +hi Define guifg=khaki1 +hi Macro guifg=khaki2 +hi PreCondit guifg=khaki3 +hi Type guifg=khaki3 +hi StorageClass guifg=tan +hi Structure guifg=DarkGoldenrod +hi Typedef guifg=khaki3 +hi Special guifg=IndianRed +hi SpecialChar guifg=DarkGoldenrod +hi Tag guifg=DarkKhaki +hi Delimiter guifg=DarkGoldenrod +hi SpecialComment guifg=cornsilk +hi Debug guifg=brown +hi Underlined guifg=IndianRed +hi Ignore guifg=grey30 +hi Error guifg=bisque guibg=red +hi Todo guifg=red guibg=bisque + diff --git a/dot_vim/colors/campfire.vim b/dot_vim/colors/campfire.vim new file mode 100644 index 0000000..b77c3fc --- /dev/null +++ b/dot_vim/colors/campfire.vim @@ -0,0 +1,57 @@ +" Vim color file
+" Maintainer: Alexander Timmermans <alexandertimmermans@orange.nl>
+" Last Change: 28 september 2006
+
+set bg=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "campfire"
+
+hi Normal guifg=#c0c0c0 guibg=#000040 ctermfg=gray ctermbg=black
+hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=lightblue
+hi Visual guifg=#8080ff guibg=fg gui=reverse ctermfg=lightblue ctermbg=fg cterm=reverse
+hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline
+hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue
+hi Search guifg=#90fff0 guibg=#2050d0 ctermfg=white ctermbg=darkblue cterm=underline term=underline
+hi IncSearch guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray
+
+hi SpecialKey guifg=cyan ctermfg=darkcyan
+hi Directory guifg=cyan ctermfg=cyan
+hi Title guifg=magenta gui=none ctermfg=magenta cterm=bold
+hi WarningMsg guifg=red ctermfg=red
+hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none
+hi ModeMsg guifg=#22cce2 ctermfg=lightblue
+hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen
+hi Question guifg=green gui=none ctermfg=green cterm=none
+hi NonText guifg=#0030ff ctermfg=darkblue
+
+hi StatusLine guifg=blue guibg=darkgray gui=none ctermfg=blue ctermbg=gray term=none cterm=none
+hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+
+hi Folded guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+hi FoldColumn guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+hi LineNr guifg=#90f020 ctermfg=green cterm=none
+
+hi DiffAdd guibg=darkblue ctermbg=darkblue term=none cterm=none
+hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none
+hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
+hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red
+
+hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen
+
+
+hi Comment guifg=#80a0ff ctermfg=darkred
+hi Constant ctermfg=magenta guifg=#ffa0a0 cterm=none
+hi Special ctermfg=brown guifg=Orange cterm=none gui=none
+hi Identifier ctermfg=cyan guifg=seagreen1 cterm=none
+hi Statement ctermfg=yellow cterm=none guifg=#ffff60 gui=none
+hi PreProc ctermfg=magenta guifg=gold gui=none cterm=none
+hi type ctermfg=green guifg=seagreen1 gui=none cterm=none
+hi Underlined cterm=underline term=underline
+hi Ignore guifg=bg ctermfg=bg
+hi String term=NONE cterm=NONE gui=NONE start=^[[m^[[33m stop=^[[m^[[32m ctermfg=3 guifg=LightGrey
+hi Constant term=NONE cterm=NONE gui=NONE start=^[[m^[[33m stop=^[[m^[[32m ctermfg=3 guifg=LightGrey
diff --git a/dot_vim/colors/candy.vim b/dot_vim/colors/candy.vim new file mode 100644 index 0000000..545ff7c --- /dev/null +++ b/dot_vim/colors/candy.vim @@ -0,0 +1,78 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/04/28 Sun 19:35. +" version: 1.0 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "candy" + +hi Normal guifg=#f0f0f8 guibg=#000000 + +" Search +hi IncSearch gui=UNDERLINE guifg=#80ffff guibg=#0060c0 +hi Search gui=NONE guifg=#f0f0f8 guibg=#0060c0 + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffa0ff guibg=NONE +hi WarningMsg gui=BOLD guifg=#ffa0ff guibg=NONE +hi ModeMsg gui=BOLD guifg=#40f0d0 guibg=NONE +hi MoreMsg gui=BOLD guifg=#00ffff guibg=#008070 +hi Question gui=BOLD guifg=#e8e800 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#c8c8d8 +hi StatusLineNC gui=NONE guifg=#707080 guibg=#c8c8d8 +hi VertSplit gui=NONE guifg=#606080 guibg=#c8c8d8 +hi WildMenu gui=NONE guifg=#000000 guibg=#a0a0ff + +" Diff +hi DiffText gui=NONE guifg=#ff78f0 guibg=#a02860 +hi DiffChange gui=NONE guifg=#e03870 guibg=#601830 +hi DiffDelete gui=NONE guifg=#a0d0ff guibg=#0020a0 +hi DiffAdd gui=NONE guifg=#a0d0ff guibg=#0020a0 + +" Cursor +hi Cursor gui=NONE guifg=#00ffff guibg=#008070 +hi lCursor gui=NONE guifg=#ffffff guibg=#8800ff +hi CursorIM gui=NONE guifg=#ffffff guibg=#8800ff + +" Fold +hi Folded gui=NONE guifg=#40f0f0 guibg=#005080 +hi FoldColumn gui=NONE guifg=#40c0ff guibg=#00305c + +" Other +hi Directory gui=NONE guifg=#40f0d0 guibg=NONE +hi LineNr gui=NONE guifg=#9090a0 guibg=NONE +hi NonText gui=BOLD guifg=#4080ff guibg=NONE +hi SpecialKey gui=BOLD guifg=#8080ff guibg=NONE +hi Title gui=BOLD guifg=#f0f0f8 guibg=NONE +hi Visual gui=NONE guifg=#e0e0f0 guibg=#707080 + +" Syntax group +hi Comment gui=NONE guifg=#c0c0d0 guibg=NONE +hi Constant gui=NONE guifg=#90d0ff guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#ff0088 +hi Identifier gui=NONE guifg=#40f0f0 guibg=NONE +hi Ignore gui=NONE guifg=#000000 guibg=NONE +hi PreProc gui=NONE guifg=#40f0a0 guibg=NONE +hi Special gui=NONE guifg=#e0e080 guibg=NONE +hi Statement gui=NONE guifg=#ffa0ff guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#ffa0a0 guibg=NONE +hi Type gui=NONE guifg=#ffc864 guibg=NONE +hi Underlined gui=UNDERLINE guifg=#f0f0f8 guibg=NONE + +" HTML +hi htmlLink gui=UNDERLINE +hi htmlBold gui=BOLD +hi htmlBoldItalic gui=BOLD,ITALIC +hi htmlBoldUnderline gui=BOLD,UNDERLINE +hi htmlBoldUnderlineItalic gui=BOLD,UNDERLINE,ITALIC +hi htmlItalic gui=ITALIC +hi htmlUnderline gui=UNDERLINE +hi htmlUnderlineItalic gui=UNDERLINE,ITALIC diff --git a/dot_vim/colors/caramel.vim b/dot_vim/colors/caramel.vim new file mode 100644 index 0000000..81f6fd5 --- /dev/null +++ b/dot_vim/colors/caramel.vim @@ -0,0 +1,67 @@ +" Vim color file +" Maintainer : Brian Gant +" Email : gantbd@muohio.edu +" Last Change : 2/15/03 +" Version : 0.1 +" +" TODO : add colors for diff and other non-implemented +" stuff +" +" LICENCE (heh) : Emailware. Basically it means use it, +" abuse it, change it, love it, leave it, whatever! I +" do however make the simple request that if you use the +" scheme, drop me an email and let me know what you think +" about it, especially if you modify it! I don't use +" the non-implemented features on a regular enough basis +" to get a feel for how they flesh out. +" +" Designed for use with COBOL, but looks pretty good with +" Perl, PHP, and C/C++ too (at least I think so). +" +" Brian +" +" --------------------------------------------------------- + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="caramel" + +" --------------------------------------------------------- + +hi Normal guifg=#dca454 guibg=#5c5094 + +" --------------------------------------------------------- + +hi Cursor guifg=#303030 guibg=#dca454 +hi CursorIM guifg=#303030 guibg=#dca454 +hi ErrorMsg guifg=#b4a8a8 guibg=bg +hi IncSearch guifg=#e0d070 guibg=#303030 +hi LineNr guifg=#b4a8a8 guibg=#39325d +hi ModeMsg guifg=#b4a8a8 guibg=bg +hi MoreMsg guifg=#b4a8a8 guibg=bg +hi NonText guifg=#b4a8a8 guibg=#39325d +hi Question guifg=#b4a8a8 guibg=bg +hi Search guifg=#303030 guibg=#e0d070 +hi StatusLine guifg=#e0d070 guibg=#303030 +hi StatusLineNC guifg=#dca454 guibg=#303030 +hi Title guifg=#b4a8a8 guibg=#39325d +hi Visual guifg=#b4a8a8 guibg=#303030 +hi VisualNOS guifg=#b4a8a8 guibg=#303030 +hi WarningMsg guifg=#b4a8a8 guibg=#39325d + +" --------------------------------------------------------- + +hi Comment guifg=#b4a8a8 guibg=bg +hi Constant guifg=#9cd464 guibg=bg +hi Identifier guifg=#e8c47c guibg=bg +hi Statement guifg=#8088bc guibg=bg +hi PreProc guifg=#e0d070 guibg=bg +hi Type guifg=#e0d070 guibg=bg +hi Special guifg=#e0d070 guibg=bg +hi Underlined guifg=#9cd464 guibg=bg +hi Ignore guifg=fg guibg=bg +hi Error guifg=#cc74a8 guibg=#9cd464 +hi Todo guifg=bg guibg=#e0d070 diff --git a/dot_vim/colors/chela_light.vim b/dot_vim/colors/chela_light.vim new file mode 100644 index 0000000..3fd8d95 --- /dev/null +++ b/dot_vim/colors/chela_light.vim @@ -0,0 +1,89 @@ +" Vim color file +" +" Maintainer: Stefan Karlsson <stefan.74@comhem.se> +" Last Change: 29 September 2004 +" + +set background=light + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name="chela_light" + + +"= Syntax Groups ============================================= + +hi comment guibg=#fafafa guifg=#339900 gui=none + +hi constant guibg=#fafafa guifg=#dd3333 gui=none +hi specialchar guibg=#fafafa guifg=#ff3333 gui=underline + +hi identifier guibg=#fafafa guifg=#3333ff gui=none + +hi statement guibg=#fafafa guifg=#3333ff gui=none +hi label guibg=#fafafa guifg=#3333ff gui=none + +hi preproc guibg=#fafafa guifg=#3333ff gui=none +hi include guibg=#fafafa guifg=#3333ff gui=none +hi precondit guibg=#fafafa guifg=#cc00cc gui=none + +hi type guibg=#fafafa guifg=#3333ff gui=none + +hi special guibg=#fafafa guifg=#cc00cc gui=none + +hi error guibg=#ff3333 guifg=#ffffff gui=none + +hi todo guibg=#339933 guifg=#ffffff gui=none + + +"= General Groups ============================================ + +hi cursor guibg=#000000 guifg=#ffffff gui=none + +hi directory guibg=#fafafa guifg=#3333ff gui=none + +hi diffadd guibg=#66ff66 guifg=#000000 gui=none +hi diffdelete guibg=#ff6666 guifg=#ff6666 gui=none +hi diffchange guibg=#ffff00 guifg=#cccc99 gui=none +hi difftext guibg=#ffff00 guifg=#000000 gui=none + +hi errormsg guibg=#ff3333 guifg=#ffffff gui=none + +hi vertsplit guibg=#3333ff guifg=#3333ff gui=none + +hi folded guibg=#eeeeee guifg=#3333ff gui=none +hi foldcolumn guibg=#eeeeee guifg=#999999 gui=none + +hi linenr guibg=#fafafa guifg=#bbbbbb gui=none + +hi modemsg guibg=#fafafa guifg=#999999 gui=none + +hi moremsg guibg=#339900 guifg=#ffffff gui=none +hi question guibg=#339900 guifg=#ffffff gui=none + +hi nontext guibg=#fafafa guifg=#999999 gui=none + +hi normal guibg=#fafafa guifg=#000000 gui=none + +hi search guibg=#ffff00 guifg=#000000 gui=none +hi incsearch guibg=#ffbb00 guifg=#000000 gui=none + +hi specialkey guibg=#fafafa guifg=#cc00cc gui=none + +hi statusline guibg=#3333ff guifg=#ffffff gui=none +hi statuslinenc guibg=#3333ff guifg=#999999 gui=none + +hi title guibg=#fafafa guifg=#6666ff gui=none + +hi visual guibg=#bbbbbb guifg=#333333 gui=none + +hi warningmsg guibg=#fafafa guifg=#ff0000 gui=none + +hi wildmenu guibg=#339900 guifg=#ffffff gui=none + + +" [eof] + diff --git a/dot_vim/colors/chocolateliquor.vim b/dot_vim/colors/chocolateliquor.vim new file mode 100644 index 0000000..c71bdf3 --- /dev/null +++ b/dot_vim/colors/chocolateliquor.vim @@ -0,0 +1,34 @@ +" Vim color file +" Maintainer: Gerald S. Williams +" Last Change: 2003 Apr 17 + +" This started as a dark version (perhaps opposite is a better term) of +" PapayaWhip, but took on a life of its own. Easy on the eyes, but still +" has good contrast. Not bad on a color terminal, either (of course, on +" my color terms, Black == #3f1f1f and White == PapayaWhip :-P ). +" +" Only values that differ from defaults are specified. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "ChocolateLiquor" + +hi Normal guibg=#3f1f1f guifg=PapayaWhip ctermfg=White +hi NonText guibg=#1f0f0f guifg=Brown2 ctermfg=Brown +hi LineNr guibg=#1f0f0f guifg=Brown2 +hi DiffDelete guibg=DarkRed guifg=White ctermbg=DarkRed ctermfg=White +hi DiffAdd guibg=DarkGreen guifg=White ctermbg=DarkGreen ctermfg=White +hi DiffText gui=NONE guibg=DarkCyan guifg=Yellow ctermbg=DarkCyan ctermfg=Yellow +hi DiffChange guibg=DarkCyan guifg=White ctermbg=DarkCyan ctermfg=White +hi Constant ctermfg=Red +hi Comment guifg=LightBlue3 +hi PreProc guifg=Plum ctermfg=Magenta +hi StatusLine guibg=White guifg=Sienna4 cterm=NONE ctermfg=Gray ctermbg=Brown +hi StatusLineNC gui=NONE guifg=Black guibg=Gray ctermbg=Black ctermfg=Gray +hi VertSplit guifg=Gray +hi Search guibg=Gold3 ctermfg=White +hi Type gui=NONE guifg=DarkSeaGreen2 +hi Statement gui=NONE guifg=Gold3 diff --git a/dot_vim/colors/cleanphp.vim b/dot_vim/colors/cleanphp.vim new file mode 100644 index 0000000..c0af691 --- /dev/null +++ b/dot_vim/colors/cleanphp.vim @@ -0,0 +1,81 @@ +" Vim color file +" Maintainer: Billy McIntosh <billymcintosh@ntlworld.com> +" Last Change: June 24, 2003 +" Licence: Public Domain + +" This package offers a eye-catching color scheme for PHP syntax + +" First remove all existing highlighting. +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "cleanphp" + +hi Normal guifg=#008000 guibg=#d3e4f8 + +hi ErrorMsg guibg=#d3e4f8 guifg=Red +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi StatusLine gui=reverse,bold +hi StatusLineNC gui=reverse +hi VertSplit gui=reverse +hi Visual gui=reverse guifg=#c0c0c0 guibg=fg +hi VisualNOS gui=underline,bold +hi DiffText gui=bold guibg=Red +hi Cursor guibg=Black guifg=NONE +hi lCursor guibg=Black guifg=NONE +hi Directory guifg=#ff8040 +hi LineNr guifg=#008000 +hi MoreMsg gui=bold guifg=SeaGreen +hi NonText gui=bold guifg=#ff8040 guibg=#d3e4f8 +hi Question gui=bold guifg=Black +hi Search guibg=#008000 guifg=NONE +hi SpecialKey guifg=#ff8040 +hi Title gui=bold guifg=Magenta +hi WarningMsg guifg=Red +hi WildMenu guibg=Cyan guifg=#d3e4f8 +hi Folded guibg=White guifg=Darkblue +hi FoldColumn guibg=#c0c0c0 guifg=Darkblue +hi DiffAdd guibg=Lightblue +hi DiffChange guibg=LightMagenta +hi DiffDelete gui=bold guifg=#ff8040 guibg=LightCyan + +hi Comment guifg=#ff8040 guibg=#d3e4f8 +hi Constant guifg=#BB0000 guibg=#d3e4f8 +hi PreProc guifg=#008080 guibg=#d3e4f8 +hi Statement gui=NONE guifg=#008000 guibg=#d3e4f8 +hi Special guifg=#008080 guibg=#d3e4f8 +hi Ignore guifg=#c0c0c0 +hi Identifier guifg=#000080 guibg=#d3e4f8 +hi Type guifg=#00BB00 guibg=#d3e4f8 + +hi link IncSearch Visual +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special + +" vim: sw=2
\ No newline at end of file diff --git a/dot_vim/colors/coffee.vim b/dot_vim/colors/coffee.vim new file mode 100644 index 0000000..284fb01 --- /dev/null +++ b/dot_vim/colors/coffee.vim @@ -0,0 +1,60 @@ +" Vim color file +" Maintainer: David Lazar <david#c7.campus.utcluj.ro> +" Last Change: Fri Jan 31 01:08:13 UTC 2003 +" Version: 1.0 +" URL: http://c7.campus.utcluj.ro/~david/coffee.vim +" +" This colorscheme script was created using Hans Fugal's colorscheme template + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="coffee" + +hi Normal gui=none guibg= #514c44 guifg=#b0a594 + +hi Cursor gui=none guibg=#ffffff guifg=bg +hi link CursorIM Cursor +hi Directory guifg=#ffffff +hi DiffAdd guibg=#9e9485 guifg=bg +hi DiffDelete guibg=#2e2b26 guifg=fg +hi DiffChange guibg=#70695e guifg=fg +hi DiffText guibg=#70695e guifg=#880000 +hi ErrorMsg guibg=#880000 guifg=#ffffff +hi Folded guifg=#88c0c7 +hi FoldColumn guifg=#88c0c7 +hi IncSearch guifg=#fff0d6 guibg=#000000 +hi LineNr guibg=#000000 guifg=#ffff21 +hi ModeMsg guifg=#ffffff +hi MoreMsg guifg=#00ff00 +hi NonText guifg=#61616d +hi Question guifg=#ffff00 +hi link Search IncSearch +hi SpecialKey guifg=#ffffff +hi StatusLine guibg=#000000 guifg=#deefff +hi StatusLineNC guibg=#395956 guifg=#a4b1bd +hi VertSplit guibg=#395956 guifg=#a4b1bd +hi Title guifg=#ffffff +hi Visual guifg=#fff0d6 guibg=#000000 +hi VisualNOS guifg=#dddddd guibg=bg +hi WarningMsg guifg=#ffff00 +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=#1a1813 +hi Constant guifg=#cefece +hi Identifier guifg=#cc7c3d +hi Statement guifg=#effec5 +hi PreProc guifg=#85ff85 +hi Type guifg=#c6feeb +hi Special guifg=#eeffee +hi Underlined gui=underline guifg=#ffffff +hi Ignore guifg=fg +hi Error guibg=bg guifg=#ff4c4a +hi Todo guibg=#aa0006 guifg=#fff300 + diff --git a/dot_vim/colors/colorer.vim b/dot_vim/colors/colorer.vim new file mode 100644 index 0000000..30e1277 --- /dev/null +++ b/dot_vim/colors/colorer.vim @@ -0,0 +1,79 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Sergey V. Beduev <shaman@interdon.net> +" Last Change: Sun Mar 28 11:19:38 EEST 2004 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "colorer" + +hi Normal ctermfg=Gray guifg=DarkGray guibg=black +hi Visual ctermfg=DarkCyan guibg=black guifg=DarkCyan +hi Comment ctermfg=Brown guifg=#B46918 gui=NONE +hi PerlPOD ctermfg=Brown guifg=#B86A18 gui=NONE +hi Constant ctermfg=White guifg=White gui=NONE +hi Charachter ctermfg=Yellow guifg=Yellow gui=NONE +hi String ctermfg=Yellow guifg=Yellow gui=NONE +hi Number ctermfg=White guifg=White gui=NONE +hi Boolean ctermfg=Cyan guifg=DarkGray gui=NONE +hi Special ctermfg=DarkMagenta guifg=Red gui=NONE +hi Define ctermfg=LightMagenta guifg=Magenta gui=NONE +hi Identifier ctermfg=Green guifg=Green gui=NONE +hi Exception ctermfg=White guifg=White gui=NONE +hi Statement ctermfg=White guifg=White gui=NONE +hi Label ctermfg=White guifg=White gui=NONE +hi Keyword ctermfg=White guifg=White gui=NONE +hi PreProc ctermfg=Green guifg=Green gui=NONE +hi Type ctermfg=LightGreen guifg=Green gui=NONE +hi Function ctermfg=White guifg=White gui=NONE +hi Repeat ctermfg=White guifg=White gui=NONE +hi Operator ctermfg=White guifg=White gui=NONE +hi Ignore ctermfg=black guifg=bg +hi Folded ctermbg=LightBlue ctermfg=Gray guibg=DarkBlue guifg=DarkGray gui=NONE +hi Error term=reverse ctermbg=Red ctermfg=White guibg=darkRed guifg=White gui=NONE +hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Black guibg=#AD5500 gui=NONE +hi Done term=standout ctermbg=Gray ctermfg=White guifg=White guibg=Gray gui=NONE + +hi SpellErrors ctermfg=DarkRed guifg=Black gui=NONE + +hi MailQ ctermfg=darkcyan guibg=black gui=NONE +hi MailQu ctermfg=darkgreen guibg=black gui=NONE +hi MyDiffNew ctermfg=magenta guifg=red gui=NONE +hi MyDiffCommLine ctermfg=white ctermbg=red guifg=white guibg=darkred gui=NONE +hi MyDiffRemoved ctermfg=LightRed guifg=red gui=NONE +hi MyDiffSubName ctermfg=DarkCyan guifg=Cyan gui=NONE +hi MyDiffNormal ctermbg=White ctermfg=black guibg=White guifg=black gui=NONE +hi MoreMsg gui=NONE +hi ModeMsg gui=NONE +hi Title gui=NONE +hi NonText gui=NONE +hi DiffDelete gui=NONE +hi DiffText gui=NONE +hi StatusLine guifg=black guibg=gray gui=NONE +hi Question gui=NONE +" Common groups that link to default highlighting. +" You can specify other highlighting easily. +"hi link String Constant +"hi link Character Constant +"hi link Number Constant +"hi link Boolean Constant +hi link Float Number +hi link Conditional Repeat +hi link Include PreProc +hi link Structure Define +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Normal +hi link SpecialComment Special +hi link Debug Special + diff --git a/dot_vim/colors/cool.vim b/dot_vim/colors/cool.vim new file mode 100644 index 0000000..a7593d9 --- /dev/null +++ b/dot_vim/colors/cool.vim @@ -0,0 +1,82 @@ +" Vim color file +" Maintainer: Gergely Kontra <kgergely@mcl.hu> +" Last Change: 2002. 07. 03. +" Based on scite colors. +" I've changed my mind, and inverted the colors. +" After an hour, this is the result. +" Not resembles to scite's colors :-] +" I'm a bit red-blind, so if you have suggestions, don't hesitate :) +" ^^^^^^^^^ Sorry, I cannot speak English well, just want to say, +" that in some rare cases I cannot distinguish between some colors +" (I've just realized it, when I see some special tests) + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +"colorscheme default +let g:colors_name = "cool" + + +" GUI +"highlight Normal guifg=#77BBFF guibg=#304060 +highlight Normal guifg=#77BBFF guibg=#102040 +highlight Normal ctermfg=LightBlue ctermbg=Black + +highlight Comment guifg=#EEEEEE guibg=#393939 +highlight Comment ctermfg=white ctermbg=DarkGrey + +highlight Constant gui=underline +highlight Constant ctermfg=LightBlue cterm=bold,underline + +highlight Cursor guifg=#999999 guibg=#FFFFFF + +highlight Define guifg=#FFFF80 guibg=#000099 gui=bold +highlight Define ctermfg=Yellow ctermbg=DarkBlue cterm=bold + +highlight Delimiter guifg=#FFFFFF guibg=#221F22 gui=bold + +highlight FoldColumn guifg=#FFFFFF guibg=#222222 +highlight FoldColumn ctermfg=White ctermbg=DarkGrey cterm=reverse + +highlight Folded guifg=#000000 guibg=#999999 +highlight Folded ctermfg=DarkGrey ctermbg=Black cterm=reverse + +highlight Function guifg=#dddddd guibg=#000099 gui=bold +highlight Function ctermfg=White ctermbg=DarkBlue cterm=bold + +highlight IncSearch guifg=#000000 guibg=#ffffff gui=bold,underline + +highlight LineNr guifg=#FFFFFF guibg=#444444 + +highlight Number guifg=#dddddd gui=bold +highlight Number ctermfg=LightCyan + +highlight PreProc guibg=#000000 guifg=#77bbff gui=bold + +highlight Search guifg=#ffffff guibg=#335577 +highlight Search ctermfg=White ctermbg=Cyan cterm=reverse + +highlight Special guifg=#ccaa55 guibg=#102040 gui=none +highlight Special ctermfg=Brown ctermbg=Black cterm=bold + +highlight Statement guifg=#FF8080 gui=bold +highlight Statement ctermfg=Magenta cterm=bold + +highlight StatusLine guifg=#FFFFFF guibg=#553333 +highlight StatusLine ctermfg=white ctermbg=DarkRed + +highlight StatusLineNC guifg=#AA8888 guibg=#000000 +highlight StatusLineNC ctermfg=red ctermbg=black + +highlight String guifg=#99ffaa guibg=#000000 +highlight String ctermfg=White + +highlight Subtitle guifg=#FFFFFF guibg=#994444 gui=bold,underline + +highlight Type guifg=#FFFFFF gui=NONE +highlight Type guifg=white gui=NONE + +highlight Visual guibg=#112233 guifg=#6688AA +highlight Visual ctermbg=DarkBlue ctermfg=LightBlue diff --git a/dot_vim/colors/dante.vim b/dot_vim/colors/dante.vim new file mode 100644 index 0000000..f584889 --- /dev/null +++ b/dot_vim/colors/dante.vim @@ -0,0 +1,83 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" File: "/home/caciano/.vim/dante.vim" +" Created: "Thu, 23 May 2002 00:12:20 -0300 (caciano)" +" Updated: "Sat, 24 Aug 2002 14:04:21 -0300 (caciano)" +" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br> +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Colorscheme Option: +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +hi clear +if exists("syntax on") + syntax reset +endif +let g:colors_name = "dante" + +" General colors +hi Normal ctermfg=gray guifg=peachpuff3 guibg=black +hi Directory term=bold ctermfg=blue guifg=royalblue +hi ErrorMsg term=standout ctermfg=white ctermbg=red guifg=white guibg=red3 +hi NonText term=bold ctermfg=darkgray guibg=gray3 guifg=gray20 +hi SpecialKey term=bold ctermfg=darkgray guifg=gray30 +hi LineNr term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4 +hi IncSearch term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2 +hi Search term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2 +hi Visual term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black +hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline +hi MoreMsg term=bold ctermfg=green gui=bold guifg=olivedrab1 +hi ModeMsg term=bold cterm=bold gui=bold +hi Question term=standout ctermfg=green gui=bold guifg=olivedrab1 +hi WarningMsg term=standout ctermfg=red gui=bold guifg=red3 +hi WildMenu term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2 +hi Folded term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white +hi FoldColumn term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white +hi DiffAdd term=bold ctermbg=blue guibg=royalblue2 +hi DiffChange term=bold ctermbg=darkmagenta guibg=maroon +hi DiffDelete term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4 +hi DiffText term=reverse cterm=bold ctermbg=red gui=bold guibg=red3 +hi Cursor guifg=bg guibg=fg +hi lCursor guifg=bg guibg=fg +hi StatusLine term=reverse cterm=reverse gui=reverse guifg=gray60 +hi StatusLineNC term=reverse cterm=reverse gui=reverse guifg=gray40 +hi VertSplit term=reverse cterm=reverse gui=bold,reverse guifg=gray40 +hi Title term=bold ctermfg=magenta gui=bold guifg=aquamarine + +" syntax hi colors +hi Comment term=bold ctermfg=darkcyan guifg=cyan4 +hi PreProc term=underline ctermfg=darkblue guifg=dodgerblue4 +hi Constant term=underline ctermfg=darkred guifg=firebrick3 +hi Type term=underline ctermfg=darkgreen gui=none guifg=chartreuse3 +hi Statement term=bold ctermfg=darkyellow gui=none guifg=gold3 +hi Identifier term=underline ctermfg=darkgreen guifg=darkolivegreen4 +hi Ignore term=bold ctermfg=darkgray guifg=gray45 +hi Special term=underline ctermfg=brown guifg=sienna +hi Error term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3 +hi Todo term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4 +hi Underlined term=underline cterm=underline ctermfg=darkblue gui=underline guifg=slateblue +hi Number term=underline ctermfg=darkred guifg=red2 +" syntax hi links +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Number Constant +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Keyword Statement +hi link Exception Statement +hi link Operator Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/dot_vim/colors/darkblack.vim b/dot_vim/colors/darkblack.vim new file mode 100644 index 0000000..5dcd263 --- /dev/null +++ b/dot_vim/colors/darkblack.vim @@ -0,0 +1,60 @@ +" Vim color file +" Maintainer: Matthew Jimenez <mjimenez@ersnet.net> +" Last Change: 2005 Feb 25 + +" darkblack -- an alteration to the darkblue colorscheme by Bohdan Vlasyuk <bohdan@vstu.edu.ua> + + +set bg=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "darkblack" + +hi Normal guifg=lightgrey guibg=black ctermfg=lightgray ctermbg=black +hi ErrorMsg guifg=white guibg=lightblue ctermfg=white ctermbg=lightblue +hi Visual guifg=lightblue guibg=fg gui=reverse ctermfg=lightblue ctermbg=fg cterm=reverse +hi VisualNOS guifg=lightblue guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline +hi Todo guifg=red guibg=black ctermfg=red ctermbg=black +hi Search guifg=white guibg=black ctermfg=white ctermbg=black cterm=underline term=underline +hi IncSearch guifg=black guibg=gray ctermfg=black ctermbg=gray + +hi SpecialKey guifg=cyan ctermfg=darkcyan +hi Directory guifg=cyan ctermfg=cyan +hi Title guifg=magenta gui=none ctermfg=magenta cterm=bold +hi WarningMsg guifg=red ctermfg=red +hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none +hi ModeMsg guifg=lightblue ctermfg=lightblue +hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen +hi Question guifg=green gui=none ctermfg=green cterm=none +hi NonText guifg=lightcyan ctermfg=lightcyan + +hi StatusLine guifg=lightblue guibg=darkgray gui=none ctermfg=lightblue ctermbg=gray term=none cterm=none +hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none +hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none + +hi Folded guifg=darkgrey guibg=black ctermfg=darkgrey ctermbg=black cterm=bold term=bold +hi FoldColumn guifg=darkgrey guibg=black ctermfg=darkgrey ctermbg=black cterm=bold term=bold +hi LineNr guifg=green ctermfg=green cterm=none + +hi DiffAdd guibg=black ctermbg=black term=none cterm=none +hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none +hi DiffDelete ctermfg=lightblue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan +hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red + +hi Cursor guifg=bg guibg=lightgrey ctermfg=bg ctermbg=lightgrey +hi lCursor guifg=bg guibg=darkgreen ctermfg=bg ctermbg=darkgreen + + +hi Comment guifg=lightblue ctermfg=lightblue +hi Constant ctermfg=magenta guifg=magenta cterm=none +hi Special ctermfg=brown guifg=Orange cterm=none gui=none +hi Identifier ctermfg=cyan guifg=cyan cterm=none +hi Statement ctermfg=yellow cterm=none guifg=yellow gui=none +hi PreProc ctermfg=magenta guifg=magenta gui=none cterm=none +hi type ctermfg=green guifg=green gui=none cterm=none +hi Underlined cterm=underline term=underline +hi Ignore guifg=bg ctermfg=bg + diff --git a/dot_vim/colors/darkblue2.vim b/dot_vim/colors/darkblue2.vim new file mode 100644 index 0000000..e31483b --- /dev/null +++ b/dot_vim/colors/darkblue2.vim @@ -0,0 +1,99 @@ +" Vim color file +" Maintainer: Datila Carvalho <datila@saci.homeip.net> +" Last Change: November, 3, 2003 +" Version: 0.1 + +" This is a VIM's version of the emacs color theme +" _Dark Blue2_ created by Chris McMahan. + +""" Init stuff + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "darkblue2" + + +""" Colors + +" GUI colors +hi Cursor guifg=#233b5a guibg=Yellow +hi CursorIM guifg=NONE guibg=Yellow +hi Directory gui=bold guifg=cyan +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +hi DiffText guibg=grey50 +hi ErrorMsg gui=bold guifg=White guibg=gray85 +hi VertSplit gui=bold guifg=NONE guibg=gray80 +"hi Folded +"hi FoldColumn +"hi IncSearch +"hi LineNr +hi ModeMsg gui=bold +"hi MoreMsg +"hi NonText +hi Normal guibg=#233b5a guifg=#fff8dc +"hi Question +hi Search gui=bold guifg=#233b5a guibg=lightgoldenrod +"hi SpecialKey +hi StatusLine guifg=aquamarine +hi StatusLineNC guifg=steelblue3 +"hi Title +hi Visual guifg=steelblue guibg=fg +hi VisualNOS gui=bold guifg=steelblue guibg=fg +hi WarningMsg guifg=White guibg=Tomato +"hi WildMenu + +" Colors for syntax highlighting +hi Comment gui=italic guifg=mediumaquamarine + +hi Constant gui=bold guifg=lightgoldenrod1 + hi String guifg=aquamarine + hi Character guifg=aquamarine + hi Number gui=bold guifg=lightgoldenrod1 + hi Boolean gui=bold guifg=lightgoldenrod1 + hi Float gui=bold guifg=lightgoldenrod1 + +hi Identifier gui=bold guifg=palegreen + hi Function guifg=lightskyblue + +hi Statement gui=bold guifg=cyan + hi Conditional gui=bold guifg=cyan + hi Repeat gui=bold guifg=cyan + hi Label guifg=cyan + hi Operator guifg=cyan + "hi Keyword + "hi Exception + +hi PreProc guifg=lightsteelblue + hi Include gui=bold guifg=lightsteelblue + hi Define guifg=lightsteelblue + hi Macro guifg=lightsteelblue + hi PreCondit guifg=lightsteelblue + +hi Type gui=bold guifg=palegreen + hi StorageClass gui=bold guifg=lightgoldenrod1 + hi Structure gui=bold guifg=lightgoldenrod1 + hi Typedef gui=bold guifg=lightgoldenrod1 + +"hi Special + ""Underline Character + "hi SpecialChar + "hi Tag + ""Statement + "hi Delimiter + ""Bold comment (in Java at least) + "hi SpecialComment + "hi Debug + +hi Underlined gui=underline + +hi Ignore guifg=bg + +hi Error gui=bold guifg=White guibg=Red + +"hi Todo diff --git a/dot_vim/colors/darkdot.vim b/dot_vim/colors/darkdot.vim new file mode 100644 index 0000000..0275896 --- /dev/null +++ b/dot_vim/colors/darkdot.vim @@ -0,0 +1,80 @@ +" Vim color file +" Maintainer: David Lazar <david#c7.campus.utcluj.ro> +" Last Change: Thu May 20 16:27:13 EEST 2004 +" Version: 2.2 +" URL: http://www.c7obs.net/~david/stuff/darkdot.vim +" +" This colorscheme script was created using Hans Fugal's colorscheme template + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="darkdot" + +hi Normal cterm=none gui=none guibg=#101020 guifg=#a8aaaa +hi Cursor cterm=none guibg=#44ff44 guifg=#000000 +hi link CursorIM Cursor +hi Directory ctermfg=cyan guifg=#44ffff +hi DiffAdd ctermbg=blue ctermfg=yellow guibg=#080888 guifg=#ffff00 +hi DiffDelete ctermbg=black ctermfg=darkgray guibg=#080808 guifg=#444444 +hi DiffChange ctermbg=black guibg=#080808 guifg=#ffffff +hi DiffText ctermbg=black ctermfg=darkred guibg=#080808 guifg=#bb0000 +hi ErrorMsg ctermbg=darkred ctermfg=white guibg=#880000 guifg=#ffffff +hi Folded ctermbg=black ctermfg=darkblue guibg=black guifg=#000088 +hi link FoldColumn Folded +hi IncSearch ctermbg=black ctermfg=gray guibg=#000000 guifg=#bbcccc +hi LineNr ctermfg=yellow guibg=#404040 guifg=#ffff00 +hi ModeMsg ctermfg=white guifg=#ffffff +hi MoreMsg ctermfg=green guifg=#44ff44 +hi NonText ctermfg=blue guifg=#4444ff +hi Question ctermfg=yellow guifg=#ffff00 +hi Search ctermbg=NONE ctermfg=green guibg=NONE guifg=green +hi SpecialKey ctermfg=blue guifg=#4444ff +hi StatusLine cterm=none ctermbg=darkcyan ctermfg=white gui=none guibg=#00aaaa guifg=#ffffff +hi StatusLineNC cterm=none ctermbg=gray ctermfg=black gui=none guibg=#bbbbbb guifg=#000000 +hi link VertSplit StatusLineNC +hi Title ctermfg=white guifg=#ffffff +hi Visual cterm=none ctermbg=gray ctermfg=black gui=none guibg=#bbbbbb guifg=#000000 +hi link VisualNOS Visual +hi WarningMsg ctermfg=yellow guifg=#ffff00 +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment ctermfg=blue guifg=#4444ff +hi Constant ctermfg=darkcyan guifg=#00aaaa +hi Identifier ctermfg=white guifg=#ffffff +hi Statement ctermfg=cyan guifg=#44ffff +hi PreProc ctermfg=darkcyan guifg=#00aaaa +hi Type ctermfg=white guifg=#ffffff +hi Special ctermfg=blue cterm=bold guifg=#6666ff gui=bold +hi Underlined ctermfg=blue guifg=#4444ff +hi Ignore ctermfg=darkgray guifg=#444444 +hi Error ctermbg=black ctermfg=darkred guibg=#000000 guifg=#bb0000 +hi Todo ctermbg=darkred ctermfg=yellow guibg=#aa0006 guifg=#fff300 + +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Conditional Statement +hi link Label Statement +hi link Keyword Statement +hi link Exception Statement +hi link Repeat Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special +hi link FoldColumn Folded diff --git a/dot_vim/colors/darkocean.vim b/dot_vim/colors/darkocean.vim new file mode 100644 index 0000000..99d2ed3 --- /dev/null +++ b/dot_vim/colors/darkocean.vim @@ -0,0 +1,52 @@ +" Name Of File: darkocean.vim +" Description: Gvim colorscheme, works best with version 6.0. +" Maintainer: Naveen Chandra R <ncr AT iitbombay DOT org> +" Last Change: Thursday, August 15, 2002 +" Installation: Drop this file in your $VIMRUNTIME/colors/ directory +" or manually source this file using ':so darkocean.vim'. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="darkocean" + +hi Cursor gui=None guibg=#add8e6 guifg=#000000 +hi CursorIM gui=None guibg=#add8e6 guifg=#000000 +hi Directory gui=None guibg=bg guifg=#20b2aa +hi DiffAdd gui=Bold guibg=#7e354d guifg=fg +hi DiffChange gui=Bold guibg=#103040 guifg=#cc3300 +hi DiffDelete gui=Bold,Reverse guibg=#7e354d guifg=fg +hi DiffText gui=Bold guibg=#d74141 guifg=fg +hi ErrorMsg gui=None guibg=#b22222 guifg=#ffffe0 +hi VertSplit gui=None guibg=#999999 guifg=#000000 +hi Folded gui=Bold guibg=#003366 guifg=#999999 +hi FoldColumn gui=Bold guibg=#305070 guifg=#b0d0e0 +hi IncSearch gui=Bold guibg=#8db6cd guifg=fg +hi LineNr gui=Bold guibg=#0f0f0f guifg=#8db6cd +hi MoreMsg gui=Bold guibg=bg guifg=#bf9261 +hi ModeMsg gui=Bold guibg=bg guifg=#4682b4 +hi NonText gui=None guibg=#0f0f0f guifg=#87cefa +hi Normal gui=None guibg=#000000 guifg=#e0ffff +hi Question gui=Bold guibg=bg guifg=#f4bb7e +hi Search gui=Bold guibg=#607b8b guifg=#000000 +hi SpecialKey gui=None guibg=bg guifg=#63b8ff +hi StatusLine gui=Bold guibg=#8db6cd guifg=#000000 +hi StatusLineNC gui=None guibg=#607b8b guifg=#1a1a1a +hi Title gui=Bold guibg=bg guifg=#5cacee +hi Visual gui=Reverse guibg=#ffffff guifg=#36648b +hi VisualNOS gui=Bold,Underline guibg=#4682b4 guifg=fg +hi WarningMsg gui=Bold guibg=bg guifg=#b22222 +hi WildMenu gui=Bold guibg=#607b8b guifg=#000000 +hi Comment gui=None guibg=#102520 guifg=#8db6cd +hi Constant gui=None guibg=bg guifg=#c34a2c +hi Identifier gui=None guibg=bg guifg=#009acd +hi Statement gui=None guibg=bg guifg=#72a5ee +hi PreProc gui=None guibg=bg guifg=#c12869 +hi Include gui=None guibg=bg guifg=#ccccff +hi Type gui=None guibg=bg guifg=#3b9c9c +hi Error gui=None guibg=#b22222 guifg=#ffffe0 +hi Todo gui=None guibg=#507080 guifg=#3bcccc +hi Ignore gui=None guibg=bg guifg=#777777 +hi TagName gui=None guibg=#660000 guifg=#a7a7a7 diff --git a/dot_vim/colors/darkslategray.vim b/dot_vim/colors/darkslategray.vim new file mode 100644 index 0000000..b36aef0 --- /dev/null +++ b/dot_vim/colors/darkslategray.vim @@ -0,0 +1,117 @@ +" vim: set tw=0 sw=4 sts=4 et: + +" Vim color file +" Maintainer: Tuomas Susi <tsusi@cc.hut.fi> +" Last Change: 2004 October 05 +" Version: 1.7 + +" Emacs in RedHat Linux used to have (still does?) a kind of 'Wheat on +" DarkSlateGray' color scheme by default. This color scheme is created in the +" same spirit. +" +" Darkslategray is intended to be nice to your eyes (low contrast) and to take +" advantage of syntax hilighting as much as possible. +" +" This color scheme is for the GUI only, I'm happy with default console colors. +" Needs at least vim 6.0. + + +" Init stuff + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "darkslategray" + + +" GUI colors + +hi Cursor guifg=fg guibg=#da70d6 +hi CursorIM guifg=NONE guibg=#ff83fa +hi Directory guifg=#e0ffff +hi DiffAdd guibg=#528b8b +hi DiffChange guibg=#8b636c +hi DiffDelete gui=bold guifg=fg guibg=#000000 +hi DiffText gui=bold guibg=#6959cd +hi ErrorMsg gui=bold guifg=#ffffff guibg=#ff0000 +hi VertSplit gui=bold guifg=#bdb76b guibg=#000000 +hi Folded guifg=#000000 guibg=#bdb76b +hi FoldColumn guifg=#000000 guibg=#bdb76b +hi SignColumn gui=bold guifg=#bdb76b guibg=#20b2aa +hi IncSearch gui=bold guifg=#000000 guibg=#ffffff +hi LineNr gui=bold guifg=#bdb76b guibg=#528b8b +hi ModeMsg gui=bold +hi MoreMsg gui=bold guifg=#20b2aa +hi NonText gui=bold guifg=#ffffff +hi Normal guibg=#2f4f4f guifg=#f5deb3 +hi Question gui=bold guifg=#ff6347 +hi Search gui=bold guifg=#000000 guibg=#ffd700 +hi SpecialKey guifg=#00ffff +hi StatusLine gui=bold guifg=#f0e68c guibg=#000000 +hi StatusLineNC guibg=#bdb76b guifg=#404040 +hi Title gui=bold guifg=#ff6347 +hi Visual guifg=#000000 guibg=fg +hi VisualNOS gui=bold guifg=#000000 guibg=fg +hi WarningMsg guifg=#ffffff guibg=#ff6347 +hi WildMenu gui=bold guifg=#000000 guibg=#ffff00 + + +" I use GTK and don't wanna change these +"hi Menu foobar +"hi Scrollbar foobar +"hi Tooltip foobar + + +" Colors for syntax highlighting +hi Comment guifg=#da70d6 + +hi Constant guifg=#cdcd00 + hi String guifg=#7fffd4 + hi Character guifg=#7fffd4 + hi Number guifg=#ff6347 + hi Boolean guifg=#cdcd00 + hi Float guifg=#ff6347 + +hi Identifier guifg=#afeeee + hi Function guifg=#ffffff + +hi Statement gui=bold guifg=#4682b4 + hi Conditional gui=bold guifg=#4682b4 + hi Repeat gui=bold guifg=#4682b4 + hi Label gui=bold guifg=#4682b4 + hi Operator gui=bold guifg=#4682b4 + hi Keyword gui=bold guifg=#4682b4 + hi Exception gui=bold guifg=#4682b4 + +hi PreProc guifg=#cdcd00 + hi Include guifg=#ffff00 + hi Define guifg=#cdcd00 + hi Macro guifg=#cdcd00 + hi PreCondit guifg=#cdcd00 + +hi Type gui=bold guifg=#98fb98 + hi StorageClass guifg=#00ff00 + hi Structure guifg=#20b2aa + hi Typedef guifg=#00ff7f + +hi Special guifg=#ff6347 + "Underline Character + hi SpecialChar gui=underline guifg=#7fffd4 + hi Tag guifg=#ff6347 + "Statement + hi Delimiter gui=bold guifg=#b0c4de + "Bold comment (in Java at least) + hi SpecialComment gui=bold guifg=#da70d6 + hi Debug gui=bold guifg=#ff0000 + +hi Underlined gui=underline + +hi Ignore guifg=bg + +hi Error gui=bold guifg=#ffffff guibg=#ff0000 + +hi Todo gui=bold guifg=#000000 guibg=#ff83fa + diff --git a/dot_vim/colors/dawn.vim b/dot_vim/colors/dawn.vim new file mode 100644 index 0000000..5c65ca3 --- /dev/null +++ b/dot_vim/colors/dawn.vim @@ -0,0 +1,65 @@ +" Vim color file +" Maintainer: Ajit J. Thakkar (ajit AT unb DOT ca) +" Last Change: 2003 July 23 +" Version: 1.2 +" URL: http://www.unb.ca/chem/ajit/vim.htm + +" This GUI-only color scheme has a light grey background, and is a softer +" variant of the default and morning color schemes. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "dawn" + +hi Normal guifg=Black guibg=grey90 +"hi Normal guifg=Black guibg=grey80 + +" Groups used in the 'highlight' and 'guicursor' options default value. +hi ErrorMsg gui=NONE guifg=Red guibg=Linen +hi IncSearch gui=NONE guifg=fg guibg=LightGreen +hi ModeMsg gui=bold guifg=fg guibg=bg +hi StatusLine gui=NONE guifg=DarkBlue guibg=grey70 +hi StatusLineNC gui=NONE guifg=grey90 guibg=grey70 +hi VertSplit gui=NONE guifg=grey70 guibg=grey70 +hi Visual gui=reverse guifg=Grey guibg=fg +hi VisualNOS gui=underline,bold guifg=fg guibg=bg +hi DiffText gui=bold guifg=Blue guibg=LightYellow +hi Cursor guifg=NONE guibg=Green +hi lCursor guifg=NONE guibg=Cyan +hi Directory guifg=Blue guibg=bg +hi LineNr guifg=Brown guibg=bg +hi MoreMsg gui=bold guifg=SeaGreen guibg=bg +hi NonText gui=bold guifg=Blue guibg=grey80 +hi Question gui=bold guifg=SeaGreen guibg=bg +hi Search guifg=fg guibg=PeachPuff +hi SpecialKey guifg=Blue guibg=bg +hi Title gui=bold guifg=Magenta guibg=bg +hi WarningMsg guifg=Red guibg=bg +hi WildMenu guifg=fg guibg=PeachPuff +hi Folded guifg=Grey40 guibg=bg " guifg=DarkBlue guibg=LightGrey +hi FoldColumn guifg=DarkBlue guibg=Grey +hi DiffAdd gui=bold guifg=Blue guibg=LightCyan +hi DiffChange gui=bold guifg=fg guibg=MistyRose2 +hi DiffDelete gui=NONE guifg=LightBlue guibg=LightCyan + +" Colors for syntax highlighting +hi Constant gui=NONE guifg=azure4 guibg=bg +"hi Constant gui=NONE guifg=DeepSkyBlue4 guibg=bg +hi String gui=NONE guifg=DarkOliveGreen4 guibg=bg +hi Special gui=bold guifg=Cyan4 guibg=bg +hi Statement gui=NONE guifg=SlateBlue4 guibg=bg +hi Operator gui=NONE guifg=Purple guibg=bg +hi Ignore gui=NONE guifg=bg guibg=bg +hi ToDo gui=NONE guifg=DeepPink1 guibg=bg +hi Error gui=NONE guifg=Red guibg=Linen +hi Comment gui=NONE guifg=RoyalBlue guibg=NONE +hi Identifier gui=NONE guifg=SteelBlue4 guibg=NONE +hi PreProc gui=NONE guifg=Magenta4 guibg=NONE +hi Type gui=NONE guifg=Brown guibg=NONE +hi Underlined gui=underline guifg=SlateBlue guibg=bg + +" vim: sw=2 diff --git a/dot_vim/colors/delek.vim b/dot_vim/colors/delek.vim new file mode 100644 index 0000000..32e4536 --- /dev/null +++ b/dot_vim/colors/delek.vim @@ -0,0 +1,57 @@ +" Vim color file +" Maintainer: David Schweikert <dws@ee.ethz.ch> +" Last Change: 2001 Mai 14 + +" First remove all existing highlighting. +hi clear + +let colors_name = "delek" + +hi Normal guifg=Black guibg=white + +" Groups used in the 'highlight' and 'guicursor' options default value. +hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White +hi IncSearch term=reverse cterm=reverse gui=reverse +hi ModeMsg term=bold cterm=bold gui=bold +hi VertSplit term=reverse cterm=reverse gui=reverse +hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg +hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold +hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red +hi Cursor guibg=Green guifg=NONE +hi lCursor guibg=Cyan guifg=NONE +hi Directory term=bold ctermfg=DarkBlue guifg=Blue +hi LineNr term=underline ctermfg=Brown guifg=Brown +hi MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen +hi Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen +hi Search term=reverse ctermbg=Yellow ctermfg=NONE guibg=Yellow guifg=NONE +hi SpecialKey term=bold ctermfg=DarkBlue guifg=Blue +hi Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta +hi WarningMsg term=standout ctermfg=DarkRed guifg=Red +hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black +hi Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue +hi FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue +hi DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue +hi DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta +hi DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan + +hi StatusLine cterm=bold ctermbg=blue ctermfg=yellow guibg=gold guifg=blue +hi StatusLineNC cterm=bold ctermbg=blue ctermfg=black guibg=gold guifg=blue +hi NonText term=bold ctermfg=Blue gui=bold guifg=gray guibg=white +hi Cursor guibg=fg guifg=bg + +" syntax highlighting +hi PreProc term=underline cterm=NONE ctermfg=darkmagenta gui=NONE guifg=magenta3 +hi Identifier term=underline cterm=NONE ctermfg=darkcyan gui=NONE guifg=cyan4 +hi Comment term=NONE cterm=NONE ctermfg=darkred gui=NONE guifg=red2 +hi Constant term=underline cterm=NONE ctermfg=darkgreen gui=NONE guifg=green3 +hi Special term=bold cterm=NONE ctermfg=lightred gui=NONE guifg=deeppink +hi Statement term=bold cterm=bold ctermfg=blue gui=bold guifg=blue +hi Type term=underline cterm=NONE ctermfg=blue gui=bold guifg=blue + +if exists("syntax_on") + let syntax_cmd = "enable" + runtime syntax/syncolor.vim + unlet syntax_cmd +endif + +" vim: sw=2 diff --git a/dot_vim/colors/denim.vim b/dot_vim/colors/denim.vim new file mode 100644 index 0000000..c41af9f --- /dev/null +++ b/dot_vim/colors/denim.vim @@ -0,0 +1,141 @@ +" Maintainer: Tim Aldrich <aldy0169@yahoo.com> +" Last Change: 19 November 2001 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="denim" +" GUI colors {{{ +hi Normal guifg=#FFFFFF guibg=#000038 +hi Cursor guifg=#000038 guibg=#FFFFFF +hi CursorIM guifg=#6699CC guibg=#99CCCC +hi Directory guifg=#33CCFF guibg=#6699CC +hi DiffAdd guifg=#FFFFCC guibg=#000038 +hi DiffChange guifg=#FF9900 guibg=#000038 +hi DiffDelete guifg=#999999 guibg=#000038 +hi DiffText guifg=#FFFFFF guibg=#000038 +hi ErrorMsg guifg=#FFFFFF guibg=#FF0000 +hi VertSplit guifg=#FFFFFF guibg=#000038 +hi Folded guifg=#999999 guibg=#003366 +hi FoldColumn guifg=#0000EE guibg=#6699CC +hi IncSearch guifg=#FFFF00 guibg=#000038 +hi LineNr guifg=#FFFFEE guibg=#000038 +hi ModeMsg guifg=#FFFFFF guibg=#000038 +hi MoreMsg guifg=#FFFFFF guibg=#000038 +hi NonText guifg=#FFFFFF guibg=#00003D +hi Question guifg=#FFFFFF guibg=#0000EE +hi Search guifg=#993300 guibg=#6699CC +hi SpecialKey guifg=#FFFF00 guibg=#000038 +hi StatusLine guifg=#FFFFFF guibg=#000038 +hi StatusLineNC guifg=#CCCCCC guibg=#000038 +hi Title guifg=#FFFFFF guibg=#FF9900 +hi Visual guifg=#003366 guibg=#6699FF +hi WarningMsg guifg=#FF0000 guibg=#FFFFFF +hi WildMenu guifg=#000038 guibg=#999999 +" }}} + +" cterm colors {{{ +hi Normal ctermfg=white ctermbg=darkblue +hi Cursor ctermfg=darkblue ctermbg=white +hi CursorIM ctermfg=lightcyan ctermbg=lightcyan +hi Directory ctermfg=lightblue ctermbg=lightcyan +hi DiffAdd ctermfg=LightYellow ctermbg=darkblue +hi DiffChange ctermfg=darkred ctermbg=darkblue +hi DiffDelete ctermfg=grey ctermbg=darkblue +hi DiffText ctermfg=white ctermbg=darkblue +hi ErrorMsg ctermfg=red ctermbg=lightcyan +hi VertSplit ctermfg=white ctermbg=darkblue +hi Folded ctermfg=grey ctermbg=darkblue +hi FoldColumn ctermfg=darkred ctermbg=lightcyan +hi IncSearch ctermfg=yellow ctermbg=darkblue +hi LineNr ctermfg=lightyellow ctermbg=darkblue +hi ModeMsg ctermfg=white ctermbg=darkblue +hi MoreMsg ctermfg=white ctermbg=darkblue +hi NonText ctermfg=white ctermbg=lightblue +hi Question ctermfg=white ctermbg=darkblue +hi Search ctermfg=darkred ctermbg=lightcyan +hi SpecialKey ctermfg=yellow ctermbg=darkblue +hi StatusLine ctermfg=white ctermbg=darkblue +hi StatusLineNC ctermfg=lightgrey ctermbg=darkblue +hi Title ctermfg=white ctermbg=yellow +hi Visual ctermfg=lightblue ctermbg=cyan +hi WarningMsg ctermfg=red ctermbg=white +hi WildMenu ctermfg=darkblue ctermbg=grey +" }}} + +" GUI hilight groups {{{ + +hi Comment guifg=#999999 +hi Constant guifg=#33FF33 +hi String guifg=#CCCC99 +hi Character guifg=#33FF33 +hi Number guifg=#33FF33 +hi Boolean guifg=#33FF33 +hi Float guifg=#33FF33 +hi Identifier guifg=#33FFFF +hi Function guifg=#33FFFF +hi Statement guifg=#FFFFCC +hi Conditional guifg=#FFFFCC +hi Repeat guifg=#FFFFCC +hi Label guifg=#33FF99 +hi Operator guifg=#FFFF00 +hi Keyword guifg=#FFFF00 +hi Exception guifg=#FFFFAA +hi PreProc guifg=#66CCFF +hi Include guifg=#66CCFF +hi Define guifg=#66CCFF +hi Macro guifg=#66CCFF +hi PreCondit guifg=#66CCFF +hi Type guifg=#33FF99 +hi StorageClass guifg=#33FF99 +hi Structure guifg=#33FF99 +hi Typedef guifg=#33FF99 +hi Special guifg=#00FF00 +hi SpecialChar guifg=#00FF00 +hi Tag guifg=#CCCCFF +hi Delimiter guifg=#CCCCFF +hi SpecialComment guifg=#FFFFCC +hi Debug guifg=#CC3300 +hi Ignore guifg=#0066AA +hi Error guifg=#FF0000 guibg=#FFFFFF +hi Todo guifg=#999999 guibg=#FFFFFF +" }}} + +" cterm hilight groups {{{ +hi Comment ctermfg=grey +hi Constant ctermfg=lightgreen +hi String ctermfg=brown +hi Character ctermfg=lightgreen +hi Number ctermfg=lightgreen +hi Boolean ctermfg=lightgreen +hi Float ctermfg=lightgreen +hi Identifier ctermfg=lightcyan +hi Function ctermfg=lightcyan +hi Statement ctermfg=lightyellow +hi Conditional ctermfg=lightyellow +hi Repeat ctermfg=lightyellow +hi Label ctermfg=lightcyan +hi Operator ctermfg=yellow +hi Keyword ctermfg=yellow +hi Exception ctermfg=yellow +hi PreProc ctermfg=darkcyan +hi Include ctermfg=darkcyan +hi Define ctermfg=darkcyan +hi Macro ctermfg=darkcyan +hi PreCondit ctermfg=darkcyan +hi Type ctermfg=lightcyan +hi StorageClass ctermfg=lightcyan +hi Structure ctermfg=lightcyan +hi Typedef ctermfg=lightcyan +hi Special ctermfg=green +hi SpecialChar ctermfg=green +hi Tag ctermfg=brown +hi Delimiter ctermfg=brown +hi SpecialComment ctermfg=lightyellow +hi Debug ctermfg=magenta +hi Ignore ctermfg=lightblue +hi Error ctermfg=red ctermbg=white +hi Todo ctermfg=grey ctermbg=white +" }}} diff --git a/dot_vim/colors/desert.vim b/dot_vim/colors/desert.vim new file mode 100644 index 0000000..e43c61b --- /dev/null +++ b/dot_vim/colors/desert.vim @@ -0,0 +1,105 @@ +" Vim color file +" Maintainer: Hans Fugal <hans@fugal.net> +" Last Change: $Date: 2003/06/02 19:28:15 $ +" URL: http://hans.fugal.net/vim/colors/desert.vim + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +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="desert" + +hi Normal guifg=White guibg=grey20 + +" highlight groups +hi Cursor guibg=khaki guifg=slategrey +"hi CursorIM +"hi Directory +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +"hi ErrorMsg +hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none +hi Folded guibg=grey30 guifg=gold +hi FoldColumn guibg=grey30 guifg=tan +hi IncSearch guifg=slategrey guibg=khaki +"hi LineNr +hi ModeMsg guifg=goldenrod +hi MoreMsg guifg=SeaGreen +hi NonText guifg=LightBlue guibg=grey30 +hi Question guifg=springgreen +hi Search guibg=peru guifg=wheat +hi SpecialKey guifg=yellowgreen +hi StatusLine guibg=#c2bfa5 guifg=black gui=none +hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none +hi Title guifg=indianred +hi Visual gui=none guifg=khaki guibg=olivedrab +"hi VisualNOS +hi WarningMsg guifg=salmon +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=SkyBlue +hi Constant guifg=#ffa0a0 +hi Identifier guifg=palegreen +hi Statement guifg=khaki +hi PreProc guifg=indianred +hi Type guifg=darkkhaki +hi Special guifg=navajowhite +"hi Underlined +hi Ignore guifg=grey40 +"hi Error +hi Todo guifg=orangered guibg=yellow2 + +" color terminal definitions +hi SpecialKey ctermfg=darkgreen +hi NonText cterm=bold ctermfg=darkblue +hi Directory ctermfg=darkcyan +hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 +hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green +hi Search cterm=NONE ctermfg=grey ctermbg=blue +hi MoreMsg ctermfg=darkgreen +hi ModeMsg cterm=NONE ctermfg=brown +hi LineNr ctermfg=3 +hi Question ctermfg=green +hi StatusLine cterm=bold,reverse +hi StatusLineNC cterm=reverse +hi VertSplit cterm=reverse +hi Title ctermfg=5 +hi Visual cterm=reverse +hi VisualNOS cterm=bold,underline +hi WarningMsg ctermfg=1 +hi WildMenu ctermfg=0 ctermbg=3 +hi Folded ctermfg=darkgrey ctermbg=NONE +hi FoldColumn ctermfg=darkgrey ctermbg=NONE +hi DiffAdd ctermbg=4 +hi DiffChange ctermbg=5 +hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 +hi DiffText cterm=bold ctermbg=1 +hi Comment ctermfg=darkcyan +hi Constant ctermfg=brown +hi Special ctermfg=5 +hi Identifier ctermfg=6 +hi Statement ctermfg=3 +hi PreProc ctermfg=5 +hi Type ctermfg=2 +hi Underlined cterm=underline ctermfg=5 +hi Ignore ctermfg=darkgrey +hi Error cterm=bold ctermfg=7 ctermbg=1 + + +"vim: sw=4 diff --git a/dot_vim/colors/dusk.vim b/dot_vim/colors/dusk.vim new file mode 100644 index 0000000..fc7c8a5 --- /dev/null +++ b/dot_vim/colors/dusk.vim @@ -0,0 +1,64 @@ +" Vim color file +" Maintainer: Ajit J. Thakkar (ajit AT unb DOT ca) +" Last Change: 2003 Sep. 02 +" Version: 1.0 +" URL: http://www.unb.ca/chem/ajit/vim.htm + +" This GUI-only color scheme has a blue-black background + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "dusk" + +hi Normal guifg=ivory guibg=#1f3048 + +" Groups used in the 'highlight' and 'guicursor' options default value. +hi ErrorMsg gui=NONE guifg=Red guibg=Linen +hi IncSearch gui=NONE guibg=LightGreen guifg=Black +hi ModeMsg gui=NONE guifg=fg guibg=bg +hi StatusLine gui=NONE guifg=DarkBlue guibg=Grey +hi StatusLineNC gui=NONE guifg=Grey50 guibg=Grey +hi VertSplit gui=NONE guifg=Grey guibg=Grey +hi Visual gui=reverse guifg=fg guibg=LightSkyBlue4 +hi VisualNOS gui=underline guifg=fg guibg=bg +hi DiffText gui=NONE guifg=Yellow guibg=LightSkyBlue4 +hi Cursor guibg=Green guifg=Black +hi lCursor guibg=Cyan guifg=Black +hi Directory guifg=LightGreen guibg=bg +hi LineNr guifg=MistyRose3 guibg=bg +hi MoreMsg gui=NONE guifg=SeaGreen guibg=bg +hi NonText gui=NONE guifg=Cyan4 guibg=#102848 +hi Question gui=NONE guifg=LimeGreen guibg=bg +hi Search gui=NONE guifg=SkyBlue4 guibg=Bisque +hi SpecialKey guifg=Cyan guibg=bg +hi Title gui=NONE guifg=Yellow2 guibg=bg +hi WarningMsg guifg=Tomato3 guibg=Linen +hi WildMenu gui=NONE guifg=SkyBlue4 guibg=Bisque +hi Folded guifg=MistyRose2 guibg=bg +hi FoldColumn guifg=DarkBlue guibg=Grey +hi DiffAdd gui=NONE guifg=Blue guibg=LightCyan +hi DiffChange gui=NONE guifg=white guibg=LightCyan4 +hi DiffDelete gui=NONE guifg=LightBlue guibg=LightCyan + +" Colors for syntax highlighting +hi Constant gui=NONE guifg=MistyRose3 guibg=bg +hi String gui=NONE guifg=LightBlue3 guibg=bg +hi Special gui=NONE guifg=GoldenRod guibg=bg +hi Statement gui=NONE guifg=khaki guibg=bg +"hi Statement gui=NONE guifg=#d7cd7b guibg=bg +hi Operator gui=NONE guifg=Chartreuse guibg=bg +hi Ignore gui=NONE guifg=bg guibg=bg +hi ToDo gui=NONE guifg=DodgerBlue guibg=bg +hi Error gui=NONE guifg=Red guibg=Linen +hi Comment gui=NONE guifg=SlateGrey guibg=bg +hi Comment gui=NONE guifg=Lavender guibg=bg +hi Identifier gui=NONE guifg=BlanchedAlmond guibg=bg +hi PreProc gui=NONE guifg=#ffa0a0 guibg=bg +hi Type gui=NONE guifg=NavajoWhite guibg=bg +hi Underlined gui=underline guifg=fg guibg=bg + +" vim: sw=2 diff --git a/dot_vim/colors/earth.vim b/dot_vim/colors/earth.vim new file mode 100644 index 0000000..306529b --- /dev/null +++ b/dot_vim/colors/earth.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Shrinath +" Last Change: 2004/09/13 Mon 12:50. +" version: 0.2 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "earth" + +hi Normal guifg=#000000 guibg=#99CC99 + +" Search +hi IncSearch gui=UNDERLINE guifg=#60ffff guibg=#6060ff +hi Search gui=NONE guifg=#ffffff guibg=#6060ff + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi ModeMsg gui=NONE guifg=#60ffff guibg=NONE +hi MoreMsg gui=NONE guifg=#ffc0ff guibg=NONE +hi Question gui=NONE guifg=#ffff60 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#d0d0e0 +hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0 +hi VertSplit gui=NONE guifg=#606080 guibg=#d0d0e0 +hi WildMenu gui=NONE guifg=#000000 guibg=#00c8f0 + +" Diff +hi DiffText gui=UNDERLINE guifg=#ffff00 guibg=#000000 +hi DiffChange gui=NONE guifg=#ffffff guibg=#000000 +hi DiffDelete gui=NONE guifg=#60ff60 guibg=#000000 +hi DiffAdd gui=NONE guifg=#60ff60 guibg=#000000 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#d86020 +hi lCursor gui=NONE guifg=#ffffff guibg=#e000b0 +hi CursorIM gui=NONE guifg=#ffffff guibg=#e000b0 + +" Fold +hi Folded gui=NONE guifg=#ffffff guibg=#0088c0 +" hi Folded gui=NONE guifg=#ffffff guibg=#2080d0 +hi FoldColumn gui=NONE guifg=#60e0e0 guibg=#006c7f + +" Other +hi Directory gui=NONE guifg=#00e0ff guibg=NONE +hi LineNr gui=BOLD guifg=#669966 guibg=NONE +hi NonText gui=BOLD guifg=#00c0c0 guibg=#9999CC +hi SpecialKey gui=NONE guifg=#e0a0ff guibg=NONE +hi Title gui=BOLD guifg=#003300 guibg=NONE +hi Visual gui=NONE guifg=#000000 guibg=#6060d0 + +" Syntax group +hi Comment gui=NONE guifg=#996666 guibg=NONE +hi Constant gui=NONE guifg=#990066 guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#ff40a0 +hi Identifier gui=NONE guifg=#669966 guibg=NONE +hi Ignore gui=NONE guifg=#993300 guibg=NONE +hi PreProc gui=NONE guifg=#009900 guibg=NONE +hi Special gui=NONE guifg=#FF0000 guibg=NONE +hi Statement gui=NONE guifg=#CC9900 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#993300 guibg=NONE +hi Type gui=NONE guifg=#993300 guibg=NONE +hi Underlined gui=UNDERLINE guifg=#663300 guibg=NONE + diff --git a/dot_vim/colors/edo_sea.vim b/dot_vim/colors/edo_sea.vim new file mode 100644 index 0000000..f03300a --- /dev/null +++ b/dot_vim/colors/edo_sea.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/30 Wed 00:01. +" version: 1.0 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "Edo_sea" + +hi Normal guifg=#f0f0f8 guibg=#303060 + +" Search +hi IncSearch gui=UNDERLINE,BOLD guifg=#f0f0f0 guibg=#c030f0 +hi Search gui=BOLD guifg=#f0e0f0 guibg=#b020f0 + +" Messages +hi ErrorMsg gui=BOLD guifg=#f0f0f0 guibg=#f000a0 +hi WarningMsg gui=BOLD guifg=#f0f0f0 guibg=#f000a0 +hi ModeMsg gui=BOLD guifg=#00e0f0 guibg=NONE +hi MoreMsg gui=BOLD guifg=#00f0f0 guibg=#6060f0 +hi Question gui=BOLD guifg=#00f0d0 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#d0d0e0 +hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0 +hi VertSplit gui=NONE guifg=#606080 guibg=#d0d0e0 +hi WildMenu gui=NONE guifg=#000000 guibg=#f090f0 + +" Diff +hi DiffText gui=UNDERLINE guifg=#f0f000 guibg=#000000 +hi DiffChange gui=NONE guifg=#f0f0f0 guibg=#000000 +hi DiffDelete gui=NONE guifg=#60f060 guibg=#000000 +hi DiffAdd gui=NONE guifg=#60f060 guibg=#000000 + +" Cursor +hi Cursor gui=NONE guifg=#f0f0f0 guibg=#d86020 +hi lCursor gui=NONE guifg=#f0f0f0 guibg=#e000b0 +hi CursorIM gui=NONE guifg=#f0f0f0 guibg=#e000b0 + +" Fold +hi Folded gui=NONE guifg=#f0f0f0 guibg=#0080a0 +hi FoldColumn gui=NONE guifg=#9090f0 guibg=#3c3c88 + +" Other +hi Directory gui=NONE guifg=#00f0f0 guibg=NONE +hi LineNr gui=NONE guifg=#7070e8 guibg=NONE +hi NonText gui=BOLD guifg=#8080f0 guibg=NONE +hi SpecialKey gui=BOLD guifg=#60c0f0 guibg=NONE +hi Title gui=BOLD guifg=#f0f0f8 guibg=NONE +hi Visual gui=NONE guifg=#f0f0f0 guibg=#6060f0 +" hi VisualNOS gui=NONE guifg=#f0f0f0 guibg=#6060f0 + +" Syntax group +hi Comment gui=NONE guifg=#b0b0b8 guibg=#343478 +hi Constant gui=NONE guifg=#50f0d0 guibg=NONE +hi Error gui=NONE guifg=#f0f0f0 guibg=#c03030 +hi Identifier gui=NONE guifg=#d0c0f0 guibg=NONE +hi Ignore gui=NONE guifg=#303070 guibg=NONE +hi PreProc gui=NONE guifg=#f0b0f0 guibg=NONE +hi Special gui=NONE guifg=#d0f050 guibg=NONE +hi Statement gui=NONE guifg=#f0d050 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#f070e0 guibg=NONE +hi Type gui=NONE guifg=#40f080 guibg=NONE +hi Underlined gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=NONE diff --git a/dot_vim/colors/emacs.vim b/dot_vim/colors/emacs.vim new file mode 100644 index 0000000..21f22f7 --- /dev/null +++ b/dot_vim/colors/emacs.vim @@ -0,0 +1,63 @@ +" Vim color file +" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de> +" Last Change: 2001 Aug 16 +" Licence: Public Domain + +" This color scheme uses a White background. It's based on Bram's +" morning theme, but doesn't try to work for non-GUI editing. +" +" It's supposed to look like the Emacs standard colors, at least +" for C. But Emacs has different categories, so it's not very good. + +" First remove all existing highlighting. +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "emacs" + +hi Normal guifg=Black guibg=White + +" Groups used in the 'highlight' and 'guicursor' options default value. +hi ErrorMsg guibg=Red guifg=White +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi StatusLine gui=reverse,bold +hi StatusLineNC gui=reverse +hi VertSplit gui=reverse +hi Visual gui=reverse guifg=Grey guibg=fg +hi VisualNOS gui=underline,bold +hi DiffText gui=bold guibg=Red +hi Cursor guibg=Black guifg=NONE +hi lCursor guibg=Cyan guifg=NONE +hi Directory guifg=Blue +hi LineNr guifg=Brown +hi MoreMsg gui=bold guifg=SeaGreen +hi NonText gui=bold guifg=Blue guibg=grey90 +hi Question gui=bold guifg=SeaGreen +hi Search guibg=Yellow guifg=NONE +hi SpecialKey guifg=Blue +hi Title gui=bold guifg=Magenta +hi WarningMsg guifg=Red +hi WildMenu guibg=Yellow guifg=Black +hi Folded guibg=White guifg=DarkBlue +hi FoldColumn guibg=Grey guifg=DarkBlue +hi DiffAdd guibg=LightBlue +hi DiffChange guibg=LightMagenta +hi DiffDelete gui=bold guifg=Blue guibg=LightCyan + +" Colors for syntax highlighting +hi Comment guifg=#AC2020 guibg=White +hi Constant guifg=#C28F8F guibg=White +hi PreProc guifg=#D569D5 guibg=White +hi Statement gui=NONE guifg=#9C20EE guibg=White +hi Type guifg=#9C20EE guibg=White +hi Special guifg=SlateBlue guibg=White +hi Ignore guifg=White + +" Some specials (override hilinks) + + +" vim: sw=2 diff --git a/dot_vim/colors/fine_blue.vim b/dot_vim/colors/fine_blue.vim new file mode 100644 index 0000000..89c280c --- /dev/null +++ b/dot_vim/colors/fine_blue.vim @@ -0,0 +1,71 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/30 Wed 00:12. +" version: 1.7 +" This color scheme uses a light background. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "fine_blue" + +hi Normal guifg=#404048 guibg=#f8f8f8 + +" Search +hi IncSearch gui=UNDERLINE guifg=#404054 guibg=#40ffff +hi Search gui=NONE guifg=#404054 guibg=#ffffa0 + +" Messages +hi ErrorMsg gui=NONE guifg=#ff0070 guibg=#ffe0f4 +hi WarningMsg gui=NONE guifg=#ff0070 guibg=#ffe0f4 +hi ModeMsg gui=NONE guifg=#0070ff guibg=NONE +hi MoreMsg gui=NONE guifg=#a800ff guibg=NONE +hi Question gui=NONE guifg=#008050 guibg=NONE + +" Split area +hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#404054 +hi StatusLineNC gui=NONE guifg=#b8b8c0 guibg=#404054 +hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#404054 +hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#00aacc + +" Diff +hi DiffText gui=NONE guifg=#4040ff guibg=#c0c0ff +hi DiffChange gui=NONE guifg=#5050ff guibg=#e0e0ff +hi DiffDelete gui=NONE guifg=#4040ff guibg=#c8f2ea +hi DiffAdd gui=NONE guifg=#4040ff guibg=#c8f2ea + +" Cursor +hi Cursor gui=NONE guifg=#0000ff guibg=#00e0ff +hi lCursor gui=NONE guifg=#f8f8f8 guibg=#8000ff +hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#8000ff + +" Fold +hi Folded gui=NONE guifg=#7820ff guibg=#e0d8ff +hi FoldColumn gui=NONE guifg=#aa60ff guibg=#f0f0f4 +" hi Folded gui=NONE guifg=#58587c guibg=#e0e0e8 +" hi FoldColumn gui=NONE guifg=#9090b0 guibg=#f0f0f4 + +" Other +hi Directory gui=NONE guifg=#0070b8 guibg=NONE +hi LineNr gui=NONE guifg=#a0a0b0 guibg=NONE +hi NonText gui=BOLD guifg=#4000ff guibg=#ececf0 +hi SpecialKey gui=NONE guifg=#d87000 guibg=NONE +hi Title gui=NONE guifg=#004060 guibg=#c8f0f8 +hi Visual gui=NONE guifg=#404060 guibg=#dddde8 +" hi VisualNOS gui=NONE guifg=#404060 guibg=#dddde8 + +" Syntax group +hi Comment gui=NONE guifg=#ff00c0 guibg=NONE +hi Constant gui=NONE guifg=#2020ff guibg=#e8e8ff +hi Error gui=BOLD guifg=#ffffff guibg=#ff4080 +hi Identifier gui=NONE guifg=#c800ff guibg=NONE +hi Ignore gui=NONE guifg=#f8f8f8 guibg=NONE +hi PreProc gui=NONE guifg=#0070e6 guibg=NONE +hi Special gui=NONE guifg=#005858 guibg=#ccf7ee +hi Statement gui=NONE guifg=#008858 guibg=NONE +hi Todo gui=NONE guifg=#ff0070 guibg=#ffe0f4 +hi Type gui=NONE guifg=#7040ff guibg=NONE +hi Underlined gui=UNDERLINE guifg=#0000ff guibg=NONE diff --git a/dot_vim/colors/fnaqevan.vim b/dot_vim/colors/fnaqevan.vim new file mode 100644 index 0000000..d936cee --- /dev/null +++ b/dot_vim/colors/fnaqevan.vim @@ -0,0 +1,67 @@ +" Vim color file +" Maintainer: Rafal Sulejman <rms@poczta.onet.pl> +" Last Change: 2002.06.18 +" +" This color scheme uses a black (dark) background. + +" First remove all existing highlighting. +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "fnaqevan" + +hi Normal guibg=#000000 guifg=#C0C0C0 gui=NONE + +" Main colors +hi Constant guibg=#000000 guifg=#00B8E0 gui=NONE +hi Identifier guibg=#000000 guifg=#FFA850 gui=NONE +hi Special guibg=#000000 guifg=#B899C8 gui=NONE +hi Statement guibg=#000000 guifg=#EEE840 gui=NONE +hi Preproc guibg=#000000 guifg=#00B098 gui=NONE +hi Type guibg=#000000 guifg=#40D040 gui=NONE + +" Secondary colors +hi Comment guibg=#000000 guifg=#006699 gui=NONE +hi Visual guibg=#005900 guifg=#40C940 gui=NONE +hi VisualNOS guibg=#005900 guifg=#40C940 gui=NONE +hi Search guibg=#707000 guifg=#FFFF00 gui=NONE +hi IncSearch guibg=#D05000 guifg=#FFE000 gui=NONE + +" Special colors +hi WarningMsg guibg=#707000 guifg=#FFFF00 gui=NONE +hi MoreMsg guibg=#000070 guifg=#00B8E0 gui=NONE +hi ErrorMsg guibg=#CC0000 guifg=#FFEE00 gui=NONE +hi ModeMsg guibg=#000000 guifg=#E8E8E8 gui=NONE +hi WildMenu guibg=#5f5f5f guifg=#FFEE60 gui=NONE +hi StatusLine guibg=#1f1f1f guifg=#F0F0F0 gui=NONE +hi StatusLineNC guibg=#0f0f0f guifg=#eaea3a gui=NONE +hi VertSplit guibg=#1f1f1f guifg=#F0F0F0 gui=NONE +hi Error guibg=#EE0000 guifg=#FFDD60 gui=NONE +hi Todo guibg=#EEE000 guifg=#000000 gui=NONE +hi Title guibg=#000000 guifg=#ffffff gui=NONE +hi Question guibg=#005900 guifg=#40E840 gui=NONE +hi LineNr guibg=#000000 guifg=#F0B0E0 gui=NONE +hi Directory guibg=#000000 guifg=#D0D0D0 gui=NONE +hi NonText guibg=#000000 guifg=#FFDDAA gui=NONE +hi SpecialKey guibg=#000000 guifg=#FFFFFF gui=NONE + +" Diff colors +hi DiffAdd guibg=#505050 guifg=#D0D0D0 gui=NONE +hi DiffChange guibg=#505050 guifg=#D0D0D0 gui=NONE +hi DiffDelete guibg=#505050 guifg=#D0D0D0 gui=NONE +hi DiffText guibg=#707070 guifg=#F0F0F0 gui=NONE + +" Folding colors +hi Folded guibg=#703070 guifg=#DDB8DD gui=NONE +hi FoldColumn guibg=#C4153B guifg=#F0F0F0 gui=NONE + +" Cursor colors +hi Cursor guibg=#FFFFFF guifg=#000000 gui=NONE +hi icursor guibg=#FFEE00 guifg=#000000 gui=NONE +hi ncursor guibg=#FFFFFF guifg=#000000 gui=NONE +hi rcursor guibg=#00CCFF guifg=#000000 gui=NONE +hi lcursor guibg=#40D040 guifg=#000000 gui=NONE + diff --git a/dot_vim/colors/fog.vim b/dot_vim/colors/fog.vim new file mode 100644 index 0000000..ab263ab --- /dev/null +++ b/dot_vim/colors/fog.vim @@ -0,0 +1,170 @@ +" Vim color file +" vim: tw=0 ts=4 sw=4 +" Maintainer: Thomas R. Kimpton <tomk@emcity.net> +" Last Change: 2001 Nov 8 +" This color scheme is meant for the person that spends hours +" and hours and hours and... in vim and wants some contrast to +" help pick things out in the files they edit, but doesn't want +" **C**O**N**T**R**A**S**T**! + +set background=light + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "fog" + +hi Normal ctermbg=White ctermfg=Black +" 660066 = darkish purple +hi Normal guifg=#660066 guibg=grey80 + +hi NonText term=bold +hi NonText ctermfg=LightBlue +hi NonText gui=bold guifg=LightBlue guibg=grey80 + +hi Comment ctermfg=DarkGrey ctermbg=White +" 444499 = darkish blue grey +hi Comment guifg=#444499 + +hi Constant term=underline +hi Constant ctermfg=Magenta +hi Constant guifg=#7070a0 + +hi Statement term=bold +hi Statement cterm=bold ctermfg=DarkGreen ctermbg=White +hi Statement guifg=DarkGreen gui=bold + +hi identifier ctermfg=DarkGreen +hi identifier guifg=DarkGreen + +hi preproc ctermfg=DarkGreen +hi preproc guifg=#408040 + +hi type ctermfg=DarkBlue +hi type guifg=DarkBlue + +hi label ctermfg=yellow +hi label guifg=#c06000 + +hi operator ctermfg=darkYellow +hi operator guifg=DarkGreen gui=bold + +hi StorageClass ctermfg=DarkRed ctermbg=White +hi StorageClass guifg=#a02060 gui=bold + +hi Number ctermfg=Blue ctermbg=White +hi Number guifg=Blue + +hi Special term=bold +hi Special ctermfg=LightRed +hi Special guifg=#aa8822 + +hi Cursor ctermbg=DarkMagenta +hi Cursor guibg=#880088 guifg=LightGrey + +hi lCursor guibg=Cyan guifg=Black + +hi ErrorMsg term=standout +hi ErrorMsg ctermbg=DarkRed ctermfg=White +hi ErrorMsg guibg=DarkRed guifg=White + +hi DiffText term=reverse +hi DiffText cterm=bold ctermbg=DarkRed +hi DiffText gui=bold guibg=DarkRed + +hi Directory term=bold +hi Directory ctermfg=LightRed +hi Directory guifg=Red gui=underline + +hi LineNr term=underline +hi LineNr ctermfg=Yellow +hi LineNr guifg=#ccaa22 + +hi MoreMsg term=bold +hi MoreMsg ctermfg=LightGreen +hi MoreMsg gui=bold guifg=SeaGreen + +hi Question term=standout +hi Question ctermfg=LightGreen +hi Question gui=bold guifg=DarkGreen + +hi Search term=reverse +hi Search ctermbg=DarkYellow ctermfg=Black +hi Search guibg=#887722 guifg=Black + +hi SpecialKey term=bold +hi SpecialKey ctermfg=LightBlue +hi SpecialKey guifg=Blue + +hi SpecialChar ctermfg=DarkGrey ctermbg=White +hi SpecialChar guifg=DarkGrey gui=bold + +hi Title term=bold +hi Title ctermfg=LightMagenta +hi Title gui=underline guifg=DarkMagenta + +hi WarningMsg term=standout +hi WarningMsg ctermfg=LightRed +hi WarningMsg guifg=DarkBlue guibg=#9999cc + +hi WildMenu term=standout +hi WildMenu ctermbg=Yellow ctermfg=Black +hi WildMenu guibg=Yellow guifg=Black gui=underline + +hi Folded term=standout +hi Folded ctermbg=LightGrey ctermfg=DarkBlue +hi Folded guibg=LightGrey guifg=DarkBlue + +hi FoldColumn term=standout +hi FoldColumn ctermbg=LightGrey ctermfg=DarkBlue +hi FoldColumn guibg=Grey guifg=DarkBlue + +hi DiffAdd term=bold +hi DiffAdd ctermbg=DarkBlue +hi DiffAdd guibg=DarkBlue + +hi DiffChange term=bold +hi DiffChange ctermbg=DarkMagenta +hi DiffChange guibg=DarkMagenta + +hi DiffDelete term=bold +hi DiffDelete ctermfg=Blue ctermbg=DarkCyan +hi DiffDelete gui=bold guifg=Blue guibg=DarkCyan + +hi Ignore ctermfg=LightGrey +hi Ignore guifg=grey90 + +hi IncSearch term=reverse +hi IncSearch cterm=reverse +hi IncSearch gui=reverse + +hi ModeMsg term=bold +hi ModeMsg cterm=bold +hi ModeMsg gui=bold + +hi StatusLine term=reverse,bold +hi StatusLine cterm=reverse,bold +hi StatusLine gui=reverse,bold + +hi StatusLineNC term=reverse +hi StatusLineNC cterm=reverse +hi StatusLineNC gui=reverse + +hi VertSplit term=reverse +hi VertSplit cterm=reverse +hi VertSplit gui=reverse + +hi Visual term=reverse +hi Visual cterm=reverse +hi Visual gui=reverse guifg=DarkGrey guibg=fg + +hi VisualNOS term=underline,bold +hi VisualNOS cterm=underline,bold +hi VisualNOS gui=underline,bold + +hi Todo gui=reverse + +" vim: sw=2 diff --git a/dot_vim/colors/fruit.vim b/dot_vim/colors/fruit.vim new file mode 100644 index 0000000..624b90f --- /dev/null +++ b/dot_vim/colors/fruit.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/08/28 Wed 00:28. +" version: 1.3 +" This color scheme uses a light background. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "fruit" + +hi Normal guifg=#404040 guibg=#f8f8f8 + +" Search +hi IncSearch gui=UNDERLINE guifg=#404040 guibg=#40ffff +hi Search gui=NONE guifg=#404040 guibg=#ffff60 + +" Messages +hi ErrorMsg gui=NONE guifg=#ff0000 guibg=#ffe4e4 +hi WarningMsg gui=NONE guifg=#ff0000 guibg=#ffe4e4 +hi ModeMsg gui=NONE guifg=#ff4080 guibg=NONE +hi MoreMsg gui=NONE guifg=#009070 guibg=NONE +hi Question gui=NONE guifg=#f030d0 guibg=NONE + +" Split area +hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#404040 +hi StatusLineNC gui=NONE guifg=#a4a4a4 guibg=#404040 +hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#404040 +hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#ff4080 + +" Diff +hi DiffText gui=NONE guifg=#e04040 guibg=#ffd8d8 +hi DiffChange gui=NONE guifg=#408040 guibg=#d0f0d0 +hi DiffDelete gui=NONE guifg=#4848ff guibg=#ffd0ff +hi DiffAdd gui=NONE guifg=#4848ff guibg=#ffd0ff + +" Cursor +hi Cursor gui=NONE guifg=#0000ff guibg=#00e0ff +hi lCursor gui=NONE guifg=#f8f8f8 guibg=#8000ff +hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#8000ff + +" Fold +hi Folded gui=NONE guifg=#20605c guibg=#b8e8dc +hi FoldColumn gui=NONE guifg=#40a098 guibg=#f0f0f0 + +" Other +hi Directory gui=NONE guifg=#0070b8 guibg=NONE +hi LineNr gui=NONE guifg=#acacac guibg=NONE +hi NonText gui=BOLD guifg=#00a0c0 guibg=#ececec +hi SpecialKey gui=NONE guifg=#4040ff guibg=NONE +hi Title gui=NONE guifg=#0050a0 guibg=#c0e8ff +hi Visual gui=NONE guifg=#484848 guibg=#e0e0e0 +" hi VisualNOS gui=NONE guifg=#484848 guibg=#e0e0e0 + +" Syntax group +hi Comment gui=NONE guifg=#ff4080 guibg=NONE +hi Constant gui=NONE guifg=#8016ff guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#ff4080 +hi Identifier gui=NONE guifg=#008888 guibg=NONE +hi Ignore gui=NONE guifg=#f8f8f8 guibg=NONE +hi PreProc gui=NONE guifg=#e06800 guibg=NONE +hi Special gui=NONE guifg=#4a9400 guibg=NONE +hi Statement gui=NONE guifg=#f030d0 guibg=NONE +hi Todo gui=UNDERLINE guifg=#ff0070 guibg=#ffe0f4 +hi Type gui=NONE guifg=#0070e6 guibg=NONE +hi Underlined gui=UNDERLINE guifg=fg guibg=NONE diff --git a/dot_vim/colors/gobo.vim b/dot_vim/colors/gobo.vim new file mode 100644 index 0000000..13a8cf5 --- /dev/null +++ b/dot_vim/colors/gobo.vim @@ -0,0 +1,27 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" +" Created using ColorSchemeCreator +" by Otávio Corrêa Cordeiro (cordeiro@exatas.unisinos.br) (2004 July) +" +" Maintainer: Otávio Corrêa Cordeiro +" Last Change: 2004 July + + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "ColorSchemeCreator" +hi Normal guifg=#111111 guibg=#FFFFFF +hi comment guifg=#33CC99 gui=italic +hi constant guifg=#CC0099 gui=bold +hi statement guifg=#3399FF gui=bold +hi preproc guifg=#0066FF +hi type guifg=#6600CC gui=bold +hi special guifg=#6600CC +hi operator guifg=#CC0099 +hi clear Visual +hi Visual term=reverse cterm=reverse gui=reverse diff --git a/dot_vim/colors/golden.vim b/dot_vim/colors/golden.vim new file mode 100644 index 0000000..8cceaf7 --- /dev/null +++ b/dot_vim/colors/golden.vim @@ -0,0 +1,70 @@ +" vim: tw=0 ts=4 sw=4 +" Vim color file +" +" Creator: Ryan Phillips <ryan@trolocsis.com> +" Credits: This color scheme originated from the idea of +" Jeffrey Bakker, the creator of webcpp (http://webcpp.sourceforge.net/). +" URL: http://www.trolocsis.com/vim/golden.vim +" + +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "golden" +hi Normal ctermfg=yellow guifg=#ddbb00 guibg=black +hi Scrollbar ctermfg=Yellow guifg=#ddbb00 guibg=black +hi Menu ctermfg=darkyellow guifg=#ffddaa guibg=black +hi SpecialKey ctermfg=yellow term=bold cterm=bold guifg=#ffddaa +hi NonText ctermfg=LightBlue term=bold cterm=bold gui=bold guifg=#DBCA98 +hi Directory ctermfg=DarkYellow term=bold cterm=bold guifg=#ffddaa +hi ErrorMsg term=standout cterm=bold ctermfg=White ctermbg=Red guifg=White guibg=Red +hi Search term=reverse ctermfg=white ctermbg=red guifg=white guibg=Red +hi MoreMsg term=bold cterm=bold ctermfg=Yellow gui=bold guifg=#ddbb00 +hi ModeMsg term=bold ctermfg=DarkYellow cterm=bold gui=bold guifg=Black guibg=#ddbb00 +hi LineNr term=underline ctermfg=Brown cterm=bold guifg=#978345 +hi Question term=standout cterm=bold ctermfg=Brown gui=bold guifg=#ffddaa +hi StatusLine term=bold,reverse cterm=bold ctermfg=Black ctermbg=DarkGrey gui=bold guifg=#978345 guibg=#2E2E2E +hi StatusLineNC term=reverse ctermfg=white ctermbg=black guifg=grey guibg=#3E3E3E +hi Title term=bold cterm=bold ctermfg=brown gui=bold guifg=#DBCA98 +hi Visual term=reverse cterm=reverse gui=reverse +hi WarningMsg term=standout cterm=bold ctermfg=darkblue guifg=Red +hi Cursor guifg=bg guibg=#FF5E06 ctermbg=Brown +hi Comment term=bold cterm=bold ctermfg=brown guifg=#978345 +hi Constant term=underline cterm=bold ctermfg=red guifg=Red +hi Special term=bold cterm=bold ctermfg=red guifg=Orange +hi Identifier term=underline ctermfg=lightgray guifg=#DBCA98 +hi Statement term=bold cterm=bold ctermfg=lightgreen gui=bold guifg=#ffff60 +hi PreProc term=underline ctermfg=brown guifg=#ffddaa +hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#FFE13F +hi Error term=reverse ctermfg=darkcyan ctermbg=black guifg=Red guibg=Black +hi Todo term=standout ctermfg=black ctermbg=yellow guifg=#FFE13F guibg=#2E2E2E +hi VertSplit guifg=#2E2E2E guibg=#978345 ctermfg=black ctermbg=darkgrey +hi Folded guifg=orange guibg=#2E2E2E ctermfg=yellow + +hi link IncSearch Visual +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special diff --git a/dot_vim/colors/gor.vim b/dot_vim/colors/gor.vim new file mode 100644 index 0000000..b0584a1 --- /dev/null +++ b/dot_vim/colors/gor.vim @@ -0,0 +1,47 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Jokes +" Last Change: + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "gor" +hi Normal guifg=white guibg=#005856 +hi NonText guifg=white guibg=#005856 +hi comment guifg=darkgrey +hi constant guifg=orange +hi identifier guifg=orange gui=NONE +hi statement guifg=cyan gui=NONE +"hi preproc guifg=#6063CD +hi preproc guifg=cyan +hi type guifg=green gui=NONE +hi special guifg=yellow +hi ErrorMsg guifg=Black guibg=Red +hi WarningMsg guifg=Black guibg=Green +hi Error guibg=Red +hi Todo guifg=Black guibg=orange +hi Cursor guibg=#ffffff guifg=#004f50 +"hi Cursor guibg=#603070 guifg=#0000ff +hi Folded guifg=#999999 guibg=#006336 +hi Search guibg=orange +hi IncSearch gui=NONE guibg=orange +hi LineNr guifg=grey +hi title guifg=grey +"hi StatusLineNC gui=NONE guifg=lightblue guibg=darkblue +hi StatusLineNC gui=NONE guibg=red +hi StatusLine guifg=black guibg=darkgreen +hi label guifg=gold2 +hi operator guifg=orange +hi clear Visual +hi Visual guibg=orange guifg=#00932D +hi DiffChange guibg=darkgreen +hi DiffText guibg=olivedrab +hi DiffAdd guibg=slateblue +hi DiffDelete guibg=coral +hi Folded guibg=gray30 +hi FoldColumn guibg=gray30 guifg=white +hi cIf0 guifg=gray diff --git a/dot_vim/colors/gothic.vim b/dot_vim/colors/gothic.vim new file mode 100644 index 0000000..a637914 --- /dev/null +++ b/dot_vim/colors/gothic.vim @@ -0,0 +1,42 @@ +" Vim color file +" Maintainer: Stefano deFlorian - \Goth\ <stefano@junglebit.net> +" Last Change: 2003 Dec 9 +" Light - Dark :-) +" optimized for TFT panels + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +"colorscheme default +let g:colors_name = "gothic" + +" hardcoded colors : + +" GUI +highlight Normal guifg=#efefef guibg=#000000 +highlight Cursor guifg=#000000 guibg=#efefef gui=NONE +highlight Search guifg=#ffff60 guibg=#0000ff gui=NONE +highlight Visual guifg=Grey25 gui=NONE +highlight Special guifg=Orange +highlight Comment guifg=#3030ff +highlight StatusLine guifg=blue guibg=white +highlight Statement guifg=#ffff60 gui=NONE +highlight PreProc guifg=#a0e0a0 +highlight Identifier guifg=#00ffff +highlight Constant guifg=#a0a0a0 +highlight Type guifg=#a0a0ff gui=NONE + +" Console +highlight Normal ctermfg=LightGrey ctermbg=Black +highlight Cursor ctermfg=Black ctermbg=LightGrey cterm=NONE +highlight Search ctermfg=Yellow ctermbg=Blue cterm=NONE +highlight Visual cterm=reverse +highlight Special ctermfg=Brown +highlight Comment ctermfg=Blue +highlight StatusLine ctermfg=blue ctermbg=white +highlight Identifier ctermfg=Cyan +highlight Statement ctermfg=Yellow cterm=NONE +highlight Constant ctermfg=Grey cterm=NONE +highlight Type ctermfg=LightBlue cterm=NONE diff --git a/dot_vim/colors/greyblue.vim b/dot_vim/colors/greyblue.vim new file mode 100644 index 0000000..1b3c233 --- /dev/null +++ b/dot_vim/colors/greyblue.vim @@ -0,0 +1,75 @@ +" Vim color file +" + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "greyblue" + +hi Normal ctermfg=NONE ctermbg=NONE gui=NONE guifg=#b7af9f guibg=#090909 + +" Search +hi IncSearch ctermfg=NONE ctermbg=NONE gui=NONE guifg=#7800ff guibg=#e0d8ff +hi Search ctermfg=NONE ctermbg=NONE gui=NONE guifg=#7800ff guibg=#e0d8ff + +" Messages +hi ErrorMsg ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=NONE +hi WarningMsg ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=NONE +hi ModeMsg ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=NONE +hi MoreMsg ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=NONE +hi Question ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=NONE + +" Split area +hi StatusLine ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#070707 guibg=#cfcfbf +hi StatusLineNC ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#5f5f4f guibg=#cfcfbf +hi VertSplit ctermfg=NONE ctermbg=NONE gui=NONE guifg=#070707 guibg=#cfcfbf +hi WildMenu ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#070707 guibg=#ff5533 + +" Diff +hi DiffText ctermfg=NONE ctermbg=NONE gui=NONE guifg=#07cfef guibg=#00151f +hi DiffChange ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ff97ff guibg=#2f002f +hi DiffDelete ctermfg=NONE ctermbg=NONE gui=NONE guifg=#dfdf00 guibg=#370d15 +hi DiffAdd ctermfg=NONE ctermbg=NONE gui=NONE guifg=#dfdf00 guibg=#370d15 + +" Cursor +hi Cursor ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffff00 guibg=#7fff00 +hi lCursor ctermfg=NONE ctermbg=NONE gui=NONE guifg=#070707 guibg=#7fff00 +hi CursorIM ctermfg=NONE ctermbg=NONE gui=NONE guifg=#070707 guibg=#7fff00 + +" Fold +hi Folded ctermfg=NONE ctermbg=NONE gui=NONE guifg=#87ff00 guibg=#1f2700 +hi FoldColumn ctermfg=NONE ctermbg=NONE gui=NONE guifg=#559f00 guibg=#0f0f0b + +" Other +hi Directory ctermfg=NONE ctermbg=NONE gui=NONE guifg=#aaaaba guibg=NONE +hi LineNr ctermfg=NONE ctermbg=NONE gui=NONE guifg=#7f7f5f guibg=NONE +hi NonText ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#211d1a guibg=#211d1a +hi SpecialKey ctermfg=NONE ctermbg=NONE gui=NONE guifg=#378fff guibg=NONE +hi Title ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffbf9f guibg=#370f07 +hi Visual ctermfg=NONE ctermbg=NONE gui=reverse guifg=#a5a5a5 guibg=#353535 + +" Syntax group +hi Comment ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#555565 guibg=NONE +hi Constant ctermfg=NONE ctermbg=NONE gui=NONE guifg=#d1bfb1 guibg=#151515 +hi Error ctermfg=NONE ctermbg=NONE gui=NONE guifg=#00ffff guibg=NONE +hi Identifier ctermfg=NONE ctermbg=NONE gui=NONE guifg=#aaaaba guibg=NONE +hi Ignore ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreProc ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Special ctermfg=NONE ctermbg=NONE gui=NONE guifg=#aa1565 guibg=NONE +hi Statement ctermfg=NONE ctermbg=NONE gui=bold guifg=#d1bfb1 guibg=NONE +hi Todo ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Type ctermfg=NONE ctermbg=NONE gui=BOLD guifg=#d1bfb1 guibg=NONE +hi Underlined ctermfg=NONE ctermbg=NONE gui=UNDERLINE guifg=NONE guibg=NONE + +" HTML +hi htmlLink gui=UNDERLINE guifg=#ffff00 guibg=NONE +hi htmlBold gui=BOLD +hi htmlBoldItalic gui=BOLD,ITALIC +hi htmlBoldUnderline gui=BOLD,UNDERLINE +hi htmlBoldUnderlineItalic gui=BOLD,UNDERLINE,ITALIC +hi htmlItalic gui=ITALIC +hi htmlUnderline gui=UNDERLINE +hi htmlUnderlineItalic gui=UNDERLINE,ITALIC diff --git a/dot_vim/colors/hhazure.vim b/dot_vim/colors/hhazure.vim new file mode 100644 index 0000000..9dfed35 --- /dev/null +++ b/dot_vim/colors/hhazure.vim @@ -0,0 +1,83 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi VertSplit gui=underline guifg=bg guibg=#051525 +hi StatusLine gui=underline guifg=fg guibg=#051525 +hi StatusLineNC gui=underline guifg=#2c3c45 guibg=#051525 +hi LineNr gui=underline guifg=#54657d guibg=#051525 +hi Folded gui=none guifg=#54657d guibg=bg +hi FoldColumn gui=none guifg=#54657d guibg=bg +" title +hi Title gui=underline guifg=fg guibg=#34455d +" message +hi MoreMsg gui=underline guifg=bg guibg=#329858 +hi Question gui=underline guifg=bg guibg=#329858 + +hi Normal gui=none guifg=#7990a4 guibg=#152535 +hi NonText gui=underline guifg=#1d2d30 +hi NonText guibg=#1d2d30 + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#99ccb5 +hi Cursor gui=underline guifg=bg guibg=#99ccb5 +hi IncSearch gui=underline guifg=bg guibg=#99ccb5 +hi CursorIM gui=underline guifg=fg guibg=#006188 +hi Search gui=underline guifg=bg guibg=#33669a +hi Visual gui=underline guifg=bg guibg=#667888 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#8cdd66 +hi WarningMsg gui=underline guifg=bg guibg=#66cc6a +hi ModeMsg gui=underline guifg=bg guibg=#339599 + + +" inner {{{1 +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#66cc6a +hi Error gui=underline guifg=fg guibg=#884422 +hi Special gui=none guifg=#66bbb6 guibg=bg +hi SpecialKey gui=none guifg=#6695cc guibg=bg +hi Identifier gui=none guifg=#69be97 guibg=bg +hi Constant gui=none guifg=#22887b guibg=bg +hi Statement gui=none guifg=#74aa66 guibg=bg +hi Comment gui=none guifg=#006188 guibg=bg +hi Underlined gui=underline guifg=#826699 guibg=bg +hi Directory gui=none guifg=#447760 guibg=bg +hi PreProc gui=none guifg=#557767 guibg=bg +hi Type gui=none guifg=#429999 guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#99ffd0 +hi DiffChange gui=underline guifg=bg guibg=#55aa83 +hi DiffDelete gui=none guifg=bg guibg=#22a5aa +hi DiffAdd gui=underline guifg=bg guibg=#2ccc22 + + +" html {{{1 +hi htmlLink gui=underline guifg=#6696aa guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#74aa66 +hi htmlBoldUnderline gui=underline guifg=#74aa66 guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#44ccc0 +hi htmlUnderlineItalic gui=underline guifg=#44ccc0 guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#33aa40 +hi htmlBoldUnderlineItalic gui=underline guifg=#33aa40 guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdblue.vim b/dot_vim/colors/hhdblue.vim new file mode 100644 index 0000000..ebea8ba --- /dev/null +++ b/dot_vim/colors/hhdblue.vim @@ -0,0 +1,233 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:08. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkblue guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkblue ctermbg=black +hi Folded gui=NONE guifg=blue guibg=black +hi Folded cterm=NONE ctermfg=blue ctermbg=black +hi FoldColumn gui=NONE guifg=blue guibg=black +hi FoldColumn cterm=NONE ctermfg=blue ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=blue +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=blue +hi LineNr gui=UNDERLINE guifg=black guibg=lightblue +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi VertSplit gui=NONE guifg=darkblue guibg=darkblue +hi VertSplit cterm=NONE ctermfg=darkblue ctermbg=darkblue +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkblue +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkblue +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=blue +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=blue +hi Question gui=UNDERLINE guifg=black guibg=blue +hi Question cterm=UNDERLINE ctermfg=black ctermbg=blue + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdblue", "linenr", "light") +call s:SetOpt("cterm", "hhdblue", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightblue +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkblue +else + hi LineNr gui=NONE guifg=lightblue guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightblue +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkblue +else + hi LineNr cterm=NONE ctermfg=lightblue ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdblue", "nontext", "underlined") +call s:SetOpt("cterm", "hhdblue", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkblue guibg=black +else + hi NonText gui=NONE guifg=darkblue guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkblue ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkblue ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkblue +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdcyan.vim b/dot_vim/colors/hhdcyan.vim new file mode 100644 index 0000000..be41f2f --- /dev/null +++ b/dot_vim/colors/hhdcyan.vim @@ -0,0 +1,233 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:10. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkcyan guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkcyan ctermbg=black +hi Folded gui=NONE guifg=darkcyan guibg=black +hi Folded cterm=NONE ctermfg=darkcyan ctermbg=black +hi FoldColumn gui=NONE guifg=darkcyan guibg=black +hi FoldColumn cterm=NONE ctermfg=darkcyan ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkcyan +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=darkcyan +hi LineNr gui=UNDERLINE guifg=black guibg=lightcyan +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightcyan +hi VertSplit gui=NONE guifg=darkcyan guibg=darkcyan +hi VertSplit cterm=NONE ctermfg=darkcyan ctermbg=darkcyan +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkcyan +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkcyan +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkcyan +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkcyan +hi Question gui=UNDERLINE guifg=black guibg=darkcyan +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkcyan + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdcyan", "linenr", "light") +call s:SetOpt("cterm", "hhdcyan", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightcyan +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkcyan +else + hi LineNr gui=NONE guifg=lightcyan guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightcyan +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkcyan +else + hi LineNr cterm=NONE ctermfg=lightcyan ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdcyan", "nontext", "underlined") +call s:SetOpt("cterm", "hhdcyan", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkcyan guibg=black +else + hi NonText gui=NONE guifg=darkcyan guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkcyan ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkcyan ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkcyan +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdgray.vim b/dot_vim/colors/hhdgray.vim new file mode 100644 index 0000000..39249fc --- /dev/null +++ b/dot_vim/colors/hhdgray.vim @@ -0,0 +1,233 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:11. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkgray guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkgray ctermbg=black +hi Folded gui=NONE guifg=darkgray guibg=black +hi Folded cterm=NONE ctermfg=darkgray ctermbg=black +hi FoldColumn gui=NONE guifg=darkgray guibg=black +hi FoldColumn cterm=NONE ctermfg=darkgray ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkgray +hi StatusLineNC cterm=UNDERLINE ctermfg=black ctermbg=darkgray +hi LineNr gui=UNDERLINE guifg=black guibg=lightgray +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi VertSplit gui=NONE guifg=darkgray guibg=darkgray +hi VertSplit cterm=NONE ctermfg=darkgray ctermbg=darkgray +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkgray +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkgray +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkgray +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkgray +hi Question gui=UNDERLINE guifg=black guibg=darkgray +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkgray + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdgray", "linenr", "light") +call s:SetOpt("cterm", "hhdgray", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightgray +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkgray +else + hi LineNr gui=NONE guifg=lightgray guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightgray +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkgray +else + hi LineNr cterm=NONE ctermfg=lightgray ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdgray", "nontext", "underlined") +call s:SetOpt("cterm", "hhdgray", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkgray guibg=black +else + hi NonText gui=NONE guifg=darkgray guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkgray ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkgray ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkgray +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdgreen.vim b/dot_vim/colors/hhdgreen.vim new file mode 100644 index 0000000..f64cfc1 --- /dev/null +++ b/dot_vim/colors/hhdgreen.vim @@ -0,0 +1,233 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:11. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkgreen guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkgreen ctermbg=black +hi Folded gui=NONE guifg=darkgreen guibg=black +hi Folded cterm=NONE ctermfg=darkgreen ctermbg=black +hi FoldColumn gui=NONE guifg=darkgreen guibg=black +hi FoldColumn cterm=NONE ctermfg=darkgreen ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkgreen +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=darkgreen +hi LineNr gui=UNDERLINE guifg=black guibg=lightgreen +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi VertSplit gui=NONE guifg=darkgreen guibg=darkgreen +hi VertSplit cterm=NONE ctermfg=darkgreen ctermbg=darkgreen +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkgreen +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkgreen +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkgreen +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkgreen +hi Question gui=UNDERLINE guifg=black guibg=darkgreen +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkgreen + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdgreen", "linenr", "light") +call s:SetOpt("cterm", "hhdgreen", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightgreen +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkgreen +else + hi LineNr gui=NONE guifg=lightgreen guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkgreen +else + hi LineNr cterm=NONE ctermfg=lightgreen ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdgreen", "nontext", "underlined") +call s:SetOpt("cterm", "hhdgreen", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkgreen guibg=black +else + hi NonText gui=NONE guifg=darkgreen guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkgreen ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkgreen ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkgreen +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdmagenta.vim b/dot_vim/colors/hhdmagenta.vim new file mode 100644 index 0000000..ef91091 --- /dev/null +++ b/dot_vim/colors/hhdmagenta.vim @@ -0,0 +1,233 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:12. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkmagenta guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkmagenta ctermbg=black +hi Folded gui=NONE guifg=darkmagenta guibg=black +hi Folded cterm=NONE ctermfg=darkmagenta ctermbg=black +hi FoldColumn gui=NONE guifg=darkmagenta guibg=black +hi FoldColumn cterm=NONE ctermfg=darkmagenta ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkmagenta +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=darkmagenta +hi LineNr gui=UNDERLINE guifg=black guibg=lightmagenta +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightmagenta +hi VertSplit gui=NONE guifg=darkmagenta guibg=darkmagenta +hi VertSplit cterm=NONE ctermfg=darkmagenta ctermbg=darkmagenta +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkmagenta +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkmagenta +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkmagenta +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkmagenta +hi Question gui=UNDERLINE guifg=black guibg=darkmagenta +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkmagenta + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdmagenta", "linenr", "light") +call s:SetOpt("cterm", "hhdmagenta", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightmagenta +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkmagenta +else + hi LineNr gui=NONE guifg=lightmagenta guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightmagenta +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkmagenta +else + hi LineNr cterm=NONE ctermfg=lightmagenta ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdmagenta", "nontext", "underlined") +call s:SetOpt("cterm", "hhdmagenta", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkmagenta guibg=black +else + hi NonText gui=NONE guifg=darkmagenta guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkmagenta ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkmagenta ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkmagenta +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdred.vim b/dot_vim/colors/hhdred.vim new file mode 100644 index 0000000..a8f41a3 --- /dev/null +++ b/dot_vim/colors/hhdred.vim @@ -0,0 +1,234 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:14. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkred guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkred ctermbg=black +hi Folded gui=NONE guifg=brown guibg=black +hi Folded cterm=NONE ctermfg=brown ctermbg=black +hi FoldColumn gui=NONE guifg=brown guibg=black +hi FoldColumn cterm=NONE ctermfg=brown ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkred +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=darkred +hi LineNr gui=UNDERLINE guifg=black guibg=lightred +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi VertSplit gui=NONE guifg=darkred guibg=darkred +hi VertSplit cterm=NONE ctermfg=darkred ctermbg=darkred +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkred +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkred +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkred +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkred +hi Question gui=UNDERLINE guifg=black guibg=darkred +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkred + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdred", "linenr", "light") +call s:SetOpt("cterm", "hhdred", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightred +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkred +else + hi LineNr gui=NONE guifg=lightred guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightred +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkred +else + hi LineNr cterm=NONE ctermfg=lightred ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdred", "nontext", "underlined") +call s:SetOpt("cterm", "hhdred", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkred guibg=black +else + hi NonText gui=NONE guifg=darkred guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkred ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkred ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 brown +" 4 cyan +" 5 darkred +" 6 gray +" 7 green +" 8 lightblue +" 9 lightcyan +" 10 lightgray +" 11 lightgreen +" 12 lightmagenta +" 13 lightred +" 14 lightyellow +" 15 red +" 16 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhdyellow.vim b/dot_vim/colors/hhdyellow.vim new file mode 100644 index 0000000..d8d1b33 --- /dev/null +++ b/dot_vim/colors/hhdyellow.vim @@ -0,0 +1,235 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/08 (Sat) 15:09:19. +" Version: 1.3 +" This color scheme uses a dark background. + +" Options +" format: +" hhcs_<gui|cterm|both>_<theme|all>_<target>="value" +" target: +" linenr +" "light" : underline, fg=black, bg=light<theme> +" "dark" : underline, fg=black, bg=dark<theme> +" "normal" : none, fg=light<theme>, bg=black +" nontext +" "underlined" : underline, fg=dark<theme>, bg=black +" "normal" : none, fg=dark<theme>, bg=black +" +" This is original settings. +" :let hhcs_both_all_linenr ="light" +" :let hhcs_both_all_nontext ="underlined" +" +" This is prototype settings. +" :let hhcs_both_all_linenr ="dark" +" :let hhcs_both_all_nontext ="underlined" +" +" If you don't want to eccentric feature, try this. +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" +" Normal, except hhdgray(gui), hhdgreen(cterm). +" :let hhcs_both_all_linenr ="normal" +" :let hhcs_both_all_nontext ="normal" +" :let hhcs_gui_hhdgray_linenr ="light" +" :let hhcs_gui_hhdgray_nontext ="underlined" +" :let hhcs_cterm_hhdgreen_linenr ="dark" +" :let hhcs_cterm_hhdgreen_nontext ="underlined" +" +" For poor cterm +" :let hhcs_cterm_all_linenr ="normal" + +" Happy Hacking color scheme ((DARK)) {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi NonText gui=UNDERLINE guifg=darkyellow guibg=black +hi NonText cterm=UNDERLINE ctermfg=darkyellow ctermbg=black +hi Folded gui=NONE guifg=darkyellow guibg=black +hi Folded cterm=NONE ctermfg=darkyellow ctermbg=black +hi FoldColumn gui=NONE guifg=darkyellow guibg=black +hi FoldColumn cterm=NONE ctermfg=darkyellow ctermbg=black +hi StatusLineNC gui=UNDERLINE guifg=black guibg=darkyellow +hi StatusLineNC gui=UNDERLINE ctermfg=black ctermbg=darkyellow +hi LineNr gui=NONE guifg=lightyellow guibg=black +hi LineNr cterm=NONE ctermfg=lightyellow ctermbg=black +hi LineNr gui=UNDERLINE guifg=black guibg=lightyellow +hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightyellow +hi VertSplit gui=NONE guifg=darkyellow guibg=darkyellow +hi VertSplit cterm=NONE ctermfg=darkyellow ctermbg=darkyellow +" title +hi Title gui=UNDERLINE guifg=lightgray guibg=darkyellow +hi Title cterm=UNDERLINE ctermfg=lightgray ctermbg=darkyellow +" message +hi MoreMsg gui=UNDERLINE guifg=black guibg=darkyellow +hi MoreMsg cterm=UNDERLINE ctermfg=black ctermbg=darkyellow +hi Question gui=UNDERLINE guifg=black guibg=darkyellow +hi Question cterm=UNDERLINE ctermfg=black ctermbg=darkyellow + + +" cursor {{{1 +hi StatusLine gui=UNDERLINE guifg=black guibg=gray +hi StatusLine cterm=UNDERLINE ctermfg=black ctermbg=gray +hi WildMenu gui=UNDERLINE guifg=black guibg=green +hi WildMenu cterm=UNDERLINE ctermfg=black ctermbg=green +hi Cursor gui=UNDERLINE guifg=black guibg=green +hi Cursor cterm=UNDERLINE ctermfg=black ctermbg=green +hi IncSearch gui=UNDERLINE guifg=black guibg=green +hi IncSearch cterm=UNDERLINE ctermfg=black ctermbg=green +hi CursorIM gui=UNDERLINE guifg=black guibg=green +hi CursorIM cterm=UNDERLINE ctermfg=black ctermbg=green +hi Search gui=UNDERLINE guifg=black guibg=yellow +hi Search cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi Visual gui=UNDERLINE guifg=black guibg=gray +hi Visual cterm=UNDERLINE ctermfg=black ctermbg=gray + + +" message {{{1 +hi ErrorMsg gui=UNDERLINE guifg=black guibg=red +hi ErrorMsg cterm=UNDERLINE ctermfg=black ctermbg=red +hi WarningMsg gui=UNDERLINE guifg=black guibg=yellow +hi WarningMsg cterm=UNDERLINE ctermfg=black ctermbg=yellow +hi ModeMsg gui=UNDERLINE guifg=black guibg=green +hi ModeMsg cterm=UNDERLINE ctermfg=black ctermbg=green + + +" inner {{{1 +hi Normal gui=NONE guifg=lightgray guibg=black +hi Normal cterm=NONE ctermfg=lightgray ctermbg=black +hi Ignore gui=NONE guifg=black guibg=black +hi Ignore cterm=NONE ctermfg=black ctermbg=black +hi Todo gui=UNDERLINE guifg=black guibg=red +hi Todo cterm=UNDERLINE ctermfg=black ctermbg=red +hi Error gui=UNDERLINE guifg=lightgray guibg=red +hi Error cterm=UNDERLINE ctermfg=lightgray ctermbg=red +hi Special gui=NONE guifg=lightcyan guibg=black +hi Special cterm=NONE ctermfg=lightcyan ctermbg=black +hi SpecialKey gui=NONE guifg=cyan guibg=black +hi SpecialKey cterm=NONE ctermfg=cyan ctermbg=black +hi Identifier gui=NONE guifg=cyan guibg=black +hi Identifier cterm=NONE ctermfg=cyan ctermbg=black +hi Constant gui=NONE guifg=lightred guibg=black +hi Constant cterm=NONE ctermfg=lightred ctermbg=black +hi Statement gui=NONE guifg=lightyellow guibg=black +hi Statement cterm=NONE ctermfg=lightyellow ctermbg=black +hi Comment gui=NONE guifg=lightblue guibg=black +hi Comment cterm=NONE ctermfg=lightblue ctermbg=black +hi Underlined gui=UNDERLINE guifg=lightblue guibg=black +hi Underlined cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi Directory gui=NONE guifg=lightgreen guibg=black +hi Directory cterm=NONE ctermfg=lightgreen ctermbg=black +hi PreProc gui=NONE guifg=lightmagenta guibg=black +hi PreProc cterm=NONE ctermfg=lightmagenta ctermbg=black +hi Type gui=NONE guifg=lightgreen guibg=black +hi Type cterm=NONE ctermfg=lightgreen ctermbg=black + + +" option {{{1 +function! s:SetOpt(term, theme, target, default) + let s:opt_{a:term}_{a:target} + \ = exists("g:hhcs_".a:term."_".a:theme."_".a:target) + \ ? g:hhcs_{a:term}_{a:theme}_{a:target} + \ : exists("g:hhcs_".a:term."_all_".a:target) + \ ? g:hhcs_{a:term}_all_{a:target} + \ : exists("g:hhcs_both_all_".a:target) + \ ? g:hhcs_both_all_{a:target} + \ : a:default +endfunction + + +" LineNr {{{2 +" light, dark, normal +call s:SetOpt( "gui", "hhdyellow", "linenr", "light") +call s:SetOpt("cterm", "hhdyellow", "linenr", "light") +"echo "s:opt_gui_linenr=".s:opt_gui_linenr +if s:opt_gui_linenr == "light" + hi LineNr gui=UNDERLINE guifg=black guibg=lightyellow +elseif s:opt_gui_linenr == "dark" + hi LineNr gui=UNDERLINE guifg=black guibg=darkyellow +else + hi LineNr gui=NONE guifg=lightyellow guibg=black +endif +"echo "s:opt_cterm_linenr=".s:opt_cterm_linenr +if s:opt_cterm_linenr == "light" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=lightyellow +elseif s:opt_gui_linenr == "dark" + hi LineNr cterm=UNDERLINE ctermfg=black ctermbg=darkyellow +else + hi LineNr cterm=NONE ctermfg=lightyellow ctermbg=black +endif + + +" NonText {{{2 +" underlined, normal +call s:SetOpt( "gui", "hhdyellow", "nontext", "underlined") +call s:SetOpt("cterm", "hhdyellow", "nontext", "underlined") +"echo "s:opt_gui_nontext=".s:opt_gui_nontext +if s:opt_gui_nontext == "underlined" + hi NonText gui=UNDERLINE guifg=darkyellow guibg=black +else + hi NonText gui=NONE guifg=darkyellow guibg=black +endif +"echo "s:opt_cterm_nontext=".s:opt_cterm_nontext +if s:opt_cterm_nontext == "underlined" + hi NonText cterm=UNDERLINE ctermfg=darkyellow ctermbg=black +else + hi NonText cterm=NONE ctermfg=darkyellow ctermbg=black +endif + + +" 2}}} +" diff {{{1 +hi DiffText gui=UNDERLINE guifg=black guibg=red +hi DiffText cterm=UNDERLINE ctermfg=black ctermbg=red +hi DiffChange gui=UNDERLINE guifg=black guibg=lightgray +hi DiffChange cterm=UNDERLINE ctermfg=black ctermbg=lightgray +hi DiffDelete gui=NONE guifg=black guibg=blue +hi DiffDelete cterm=NONE ctermfg=black ctermbg=blue +hi DiffAdd gui=UNDERLINE guifg=black guibg=cyan +hi DiffAdd cterm=UNDERLINE ctermfg=black ctermbg=cyan + + +" html {{{1 +hi htmlLink gui=UNDERLINE guifg=lightblue guibg=black +hi htmlLink cterm=UNDERLINE ctermfg=lightblue ctermbg=black +hi htmlBold gui=UNDERLINE guifg=black guibg=lightred +hi htmlBold cterm=UNDERLINE ctermfg=black ctermbg=lightred +hi htmlItalic gui=UNDERLINE guifg=black guibg=lightgreen +hi htmlItalic cterm=UNDERLINE ctermfg=black ctermbg=lightgreen +hi htmlBoldItalic gui=UNDERLINE guifg=black guibg=lightblue +hi htmlBoldItalic cterm=UNDERLINE ctermfg=black ctermbg=lightblue +hi htmlUnderline gui=UNDERLINE guifg=lightgray guibg=black +hi htmlUnderline cterm=UNDERLINE ctermfg=lightgray ctermbg=black +hi htmlBoldUnderline gui=UNDERLINE guifg=lightred guibg=black +hi htmlBoldUnderline cterm=UNDERLINE ctermfg=lightred ctermbg=black +hi htmlUnderlineItalic gui=UNDERLINE guifg=lightgreen guibg=black +hi htmlUnderlineItalic cterm=UNDERLINE ctermfg=lightgreen ctermbg=black +hi htmlBoldUnderlineItalic gui=UNDERLINE guifg=lightblue guibg=black +hi htmlBoldUnderlineItalic cterm=UNDERLINE ctermfg=lightblue ctermbg=black + + +" colors{{{1 +" 1 black +" 2 blue +" 3 cyan +" 4 darkyellow +" 5 gray +" 6 green +" 7 lightblue +" 8 lightcyan +" 9 lightgray +" 10 lightgreen +" 11 lightmagenta +" 12 lightred +" 13 lightyellow +" 14 red +" 15 yellow +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhorange.vim b/dot_vim/colors/hhorange.vim new file mode 100644 index 0000000..a1de49d --- /dev/null +++ b/dot_vim/colors/hhorange.vim @@ -0,0 +1,82 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi LineNr gui=underline guifg=#756664 guibg=#1c1200 +hi Folded gui=none guifg=#756664 guibg=bg +hi FoldColumn gui=none guifg=#756664 guibg=bg +" title +hi Title gui=underline guifg=fg guibg=#553614 +" message +hi MoreMsg gui=underline guifg=bg guibg=#983235 +hi Question gui=underline guifg=bg guibg=#983235 + +hi NonText gui=underline guifg=#2c2210 guibg=#2c2210 +hi VertSplit gui=underline guifg=bg guibg=#1c1200 +hi StatusLine gui=underline guifg=fg guibg=#1c1200 +hi StatusLineNC gui=underline guifg=#3c2e2c guibg=#1c1200 + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#cc9069 +hi Cursor gui=underline guifg=bg guibg=#cc9069 +hi IncSearch gui=underline guifg=bg guibg=#cc9069 +hi CursorIM gui=underline guifg=fg guibg=#887900 +hi Search gui=underline guifg=bg guibg=#994113 +hi Visual gui=underline guifg=bg guibg=#886b46 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#dd66bb +hi WarningMsg gui=underline guifg=bg guibg=#cc668b +hi ModeMsg gui=underline guifg=bg guibg=#997433 + + +" inner {{{1 +hi Normal gui=none guifg=#9b8f78 guibg=#332412 +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#cc668b +hi Error gui=underline guifg=fg guibg=#413399 +hi Special gui=none guifg=#bb9466 guibg=bg +hi SpecialKey gui=none guifg=#becc66 guibg=bg +hi Identifier gui=none guifg=#be7569 guibg=bg +hi Constant gui=none guifg=#885222 guibg=bg +hi Statement gui=none guifg=#aa668f guibg=bg +hi Comment gui=none guifg=#887900 guibg=bg +hi Underlined gui=underline guifg=#66996d guibg=bg +hi Directory gui=none guifg=#774b44 guibg=bg +hi PreProc gui=none guifg=#775a55 guibg=bg +hi Type gui=none guifg=#bb7b22 guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#ffa799 +hi DiffChange gui=underline guifg=bg guibg=#aa6155 +hi DiffDelete gui=none guifg=bg guibg=#aa7922 +hi DiffAdd gui=underline guifg=bg guibg=#cc2270 + + +" html {{{1 +hi htmlLink gui=underline guifg=#aaa366 guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#aa668f +hi htmlBoldUnderline gui=underline guifg=#aa668f guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#cc8a44 +hi htmlUnderlineItalic gui=underline guifg=#cc8a44 guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#aa3355 +hi htmlBoldUnderlineItalic gui=underline guifg=#aa3355 guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhpink.vim b/dot_vim/colors/hhpink.vim new file mode 100644 index 0000000..cffe418 --- /dev/null +++ b/dot_vim/colors/hhpink.vim @@ -0,0 +1,85 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi Folded gui=none guifg=#855060 guibg=bg +hi FoldColumn gui=none guifg=#855060 guibg=bg +hi LineNr gui=underline guifg=#855060 guibg=#200510 +hi VertSplit gui=underline guifg=bg guibg=#200510 +hi StatusLine gui=underline guifg=fg guibg=#200510 +hi StatusLineNC gui=underline guifg=#3c2c31 guibg=#200510 +hi NonText gui=underline guifg=#3c2530 +hi NonText guibg=#3c2530 +" title +hi Title gui=underline guifg=fg guibg=#653040 +" message +hi MoreMsg gui=underline guifg=bg guibg=#983266 +hi Question gui=underline guifg=bg guibg=#983266 + + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#cc7990 +hi Cursor gui=underline guifg=bg guibg=#cc7990 +hi IncSearch gui=underline guifg=bg guibg=#cc7990 +hi CursorIM gui=underline guifg=fg guibg=#884830 +hi Search gui=underline guifg=bg guibg=#993356 +hi Visual gui=underline guifg=bg guibg=#885672 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#c666dd +hi WarningMsg gui=underline guifg=bg guibg=#cc66bc +hi ModeMsg gui=underline guifg=bg guibg=#994333 + + +"TODO + +" inner {{{1 +hi Normal gui=none guifg=#bb7899 guibg=#40202a +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#cc568c +hi Error gui=underline guifg=fg guibg=#335699 +hi Special gui=none guifg=#bb6b66 guibg=bg +hi SpecialKey gui=none guifg=#cca966 guibg=bg +hi Identifier gui=none guifg=#be6986 guibg=bg +hi Constant gui=none guifg=#882223 guibg=bg +hi Statement gui=none guifg=#a466aa guibg=bg +hi Comment gui=none guifg=#884830 guibg=bg +hi Underlined gui=underline guifg=#779966 guibg=bg +hi Directory gui=none guifg=#774455 guibg=bg +hi PreProc gui=none guifg=#775561 guibg=bg +hi Type gui=none guifg=#aa3222 guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#ff99bc +hi DiffChange gui=underline guifg=bg guibg=#aa5572 +hi DiffDelete gui=none guifg=bg guibg=#aa3822 +hi DiffAdd gui=underline guifg=bg guibg=#cc22c2 + + +" html {{{1 +hi htmlLink gui=underline guifg=#aa8266 guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#a466aa +hi htmlBoldUnderline gui=underline guifg=#a466aa guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#cc4944 +hi htmlUnderlineItalic gui=underline guifg=#cc4944 guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#aa338e +hi htmlBoldUnderlineItalic gui=underline guifg=#aa338e guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhspring.vim b/dot_vim/colors/hhspring.vim new file mode 100644 index 0000000..cee4174 --- /dev/null +++ b/dot_vim/colors/hhspring.vim @@ -0,0 +1,83 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi LineNr gui=underline guifg=#757164 guibg=#1c1910 +hi Folded gui=none guifg=#757164 guibg=bg +hi FoldColumn gui=none guifg=#757164 guibg=bg +" title +hi Title gui=underline guifg=fg guibg=#555144 +" message +hi MoreMsg gui=underline guifg=bg guibg=#986c32 +hi Question gui=underline guifg=bg guibg=#986c32 + +hi NonText gui=underline guifg=#2c2920 guibg=#2c2920 +hi VertSplit gui=underline guifg=bg guibg=#1c1910 +hi StatusLine gui=underline guifg=fg guibg=#1c1910 +hi StatusLineNC gui=underline guifg=#3c382c guibg=#1c1910 + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#ccbf99 +hi Cursor gui=underline guifg=bg guibg=#ccbf99 +hi IncSearch gui=underline guifg=bg guibg=#ccbf99 +hi CursorIM gui=underline guifg=fg guibg=#458800 +hi Search gui=underline guifg=bg guibg=#997e33 +hi Visual gui=underline guifg=bg guibg=#887f66 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#dd6674 +hi WarningMsg gui=underline guifg=bg guibg=#cc7e66 +hi ModeMsg gui=underline guifg=bg guibg=#819933 + + +"TODO +" inner {{{1 +hi Normal gui=none guifg=#bbae88 guibg=#332f22 +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#cc7e66 +hi Error gui=underline guifg=fg guibg=#7e3399 +hi Special gui=none guifg=#afbb66 guibg=bg +hi SpecialKey gui=none guifg=#81cc66 guibg=bg +hi Identifier gui=none guifg=#bea869 guibg=bg +hi Constant gui=none guifg=#818822 guibg=bg +hi Statement gui=none guifg=#aa6667 guibg=bg +hi Comment gui=none guifg=#458800 guibg=bg +hi Underlined gui=underline guifg=#66998c guibg=bg +hi Directory gui=none guifg=#776a44 guibg=bg +hi PreProc gui=none guifg=#776e55 guibg=bg +hi Type gui=none guifg=#9fbb22 guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#ffe499 +hi DiffChange gui=underline guifg=bg guibg=#aa9455 +hi DiffDelete gui=none guifg=bg guibg=#89aa22 +hi DiffAdd gui=underline guifg=bg guibg=#cc3a22 + + +" html {{{1 +hi htmlLink gui=underline guifg=#89aa66 guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#aa6667 +hi htmlBoldUnderline gui=underline guifg=#aa6667 guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#bccc44 +hi htmlUnderlineItalic gui=underline guifg=#bccc44 guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#aa5833 +hi htmlBoldUnderlineItalic gui=underline guifg=#aa5833 guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhteal.vim b/dot_vim/colors/hhteal.vim new file mode 100644 index 0000000..79dbb3c --- /dev/null +++ b/dot_vim/colors/hhteal.vim @@ -0,0 +1,83 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi LineNr gui=underline guifg=#647564 guibg=#101c10 +hi Folded gui=none guifg=#647564 guibg=bg +hi FoldColumn gui=none guifg=#647564 guibg=bg +" title +hi Title gui=underline guifg=fg guibg=#445544 +" message +hi MoreMsg gui=underline guifg=bg guibg=#439832 +hi Question gui=underline guifg=bg guibg=#439832 + +hi NonText gui=underline guifg=#202c20 guibg=#202c20 +hi VertSplit gui=underline guifg=bg guibg=#101c10 +hi StatusLine gui=underline guifg=fg guibg=#101c10 +hi StatusLineNC gui=underline guifg=#2c3c2c guibg=#101c10 + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#99cc99 +hi Cursor gui=underline guifg=bg guibg=#99cc99 +hi IncSearch gui=underline guifg=bg guibg=#99cc99 +hi CursorIM gui=underline guifg=fg guibg=#008866 +hi Search gui=underline guifg=bg guibg=#339933 +hi Visual gui=underline guifg=bg guibg=#668866 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#ccdd66 +hi WarningMsg gui=underline guifg=bg guibg=#99cc66 +hi ModeMsg gui=underline guifg=bg guibg=#339966 + + +"TODO +" inner {{{1 +hi Normal gui=none guifg=#88bb88 guibg=#223322 +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#99cc66 +hi Error gui=underline guifg=fg guibg=#993333 +hi Special gui=none guifg=#66bb88 guibg=bg +hi SpecialKey gui=none guifg=#66cccc guibg=bg +hi Identifier gui=none guifg=#69be69 guibg=bg +hi Constant gui=none guifg=#228844 guibg=bg +hi Statement gui=none guifg=#99aa66 guibg=bg +hi Comment gui=none guifg=#008866 guibg=bg +hi Underlined gui=underline guifg=#666699 guibg=bg +hi Directory gui=none guifg=#447744 guibg=bg +hi PreProc gui=none guifg=#557755 guibg=bg +hi Type gui=none guifg=#22bb66 guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#99ff99 +hi DiffChange gui=underline guifg=bg guibg=#55aa55 +hi DiffDelete gui=none guifg=bg guibg=#22aa66 +hi DiffAdd gui=underline guifg=bg guibg=#88cc22 + + +" html {{{1 +hi htmlLink gui=underline guifg=#66aa99 guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#99aa66 +hi htmlBoldUnderline gui=underline guifg=#99aa66 guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#44cc77 +hi htmlUnderlineItalic gui=underline guifg=#44cc77 guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#66aa33 +hi htmlBoldUnderlineItalic gui=underline guifg=#66aa33 guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/hhviolet.vim b/dot_vim/colors/hhviolet.vim new file mode 100644 index 0000000..b8fbf62 --- /dev/null +++ b/dot_vim/colors/hhviolet.vim @@ -0,0 +1,83 @@ +" Vim color file {{{1 +" Maintainer: hira@users.sourceforge.jp +" Last Change: 2003/11/29 (Sat) 13:28:25. +" Version: 1.2 +" This color scheme uses a dark background. + +" Happy Hacking color scheme {{{1 +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = expand("<sfile>:t:r") +let html_my_rendering = 1 + + +" frame & title & message (theme) {{{1 +hi LineNr gui=underline guifg=#686475 guibg=#13101c +hi Folded gui=none guifg=#686475 guibg=bg +hi FoldColumn gui=none guifg=#686475 guibg=bg +" title +hi Title gui=underline guifg=fg guibg=#484455 +" message +hi MoreMsg gui=underline guifg=bg guibg=#373298 +hi Question gui=underline guifg=bg guibg=#373298 + +hi NonText gui=underline guifg=#23202c guibg=#23202c +hi VertSplit gui=underline guifg=bg guibg=#13101c +hi StatusLine gui=underline guifg=fg guibg=#13101c +hi StatusLineNC gui=underline guifg=#302c3c guibg=#13101c + +" cursor {{{1 +hi WildMenu gui=underline guifg=bg guibg=#a499cc +hi Cursor gui=underline guifg=bg guibg=#a499cc +hi IncSearch gui=underline guifg=bg guibg=#a499cc +hi CursorIM gui=underline guifg=fg guibg=#662088 +hi Search gui=underline guifg=bg guibg=#493399 +hi Visual gui=underline guifg=bg guibg=#6d6688 + + +" message {{{1 +hi ErrorMsg gui=underline guifg=bg guibg=#66b2dd +hi WarningMsg gui=underline guifg=bg guibg=#6683cc +hi ModeMsg gui=underline guifg=bg guibg=#7c3399 + + +"TODO +" inner {{{1 +hi Normal gui=none guifg=#9388bb guibg=#262233 +hi Ignore gui=none guifg=bg guibg=bg +hi Todo gui=underline guifg=bg guibg=#6683cc +hi Error gui=underline guifg=fg guibg=#335544 +hi Special gui=none guifg=#9b66bb guibg=bg +hi SpecialKey gui=none guifg=#cc66b6 guibg=bg +hi Identifier gui=none guifg=#7c69be guibg=bg +hi Constant gui=none guifg=#774499 guibg=bg +hi Statement gui=none guifg=#668aaa guibg=bg +hi Comment gui=none guifg=#662088 guibg=bg +hi Underlined gui=underline guifg=#997166 guibg=bg +hi Directory gui=none guifg=#4f4477 guibg=bg +hi PreProc gui=none guifg=#5c5577 guibg=bg +hi Type gui=none guifg=#7733cc guibg=bg + + +" diff {{{1 +hi DiffText gui=underline guifg=bg guibg=#af99ff +hi DiffChange gui=underline guifg=bg guibg=#6855aa +hi DiffDelete gui=none guifg=bg guibg=#8422aa +hi DiffAdd gui=underline guifg=bg guibg=#2263cc + + +" html {{{1 +hi htmlLink gui=underline guifg=#a866aa guibg=bg +hi htmlBold gui=underline guifg=bg guibg=#668aaa +hi htmlBoldUnderline gui=underline guifg=#668aaa guibg=bg +hi htmlItalic gui=underline guifg=bg guibg=#9544cc +hi htmlUnderlineItalic gui=underline guifg=#9544cc guibg=bg +hi htmlBoldItalic gui=underline guifg=bg guibg=#334caa +hi htmlBoldUnderlineItalic gui=underline guifg=#334caa guibg=bg +hi htmlUnderline gui=underline guifg=fg guibg=bg + +"}}}1 +" vim:set nowrap foldmethod=marker expandtab: diff --git a/dot_vim/colors/ibmedit.vim b/dot_vim/colors/ibmedit.vim new file mode 100644 index 0000000..4b846c6 --- /dev/null +++ b/dot_vim/colors/ibmedit.vim @@ -0,0 +1,60 @@ +" Vim color file +" Maintainer: Maarten Slaets +" Last Change: 2002 Aug 16 + +" Color settings similar to that used in IBM Edit + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="ibmedit" + +hi Normal term=NONE cterm=NONE ctermfg=Gray ctermbg=DarkBlue +hi Normal gui=NONE guifg=#CCCCCC guibg=DarkBlue +hi NonText term=NONE cterm=NONE ctermfg=Gray ctermbg=DarkBlue +hi NonText gui=NONE guifg=#CCCCCC guibg=DarkBlue + +hi Statement term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi Statement gui=NONE guifg=White guibg=DarkBlue +hi Special term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue +hi Special gui=NONE guifg=White guibg=DarkBlue +hi Constant term=NONE cterm=NONE ctermfg=Cyan ctermbg=DarkBlue +hi Constant gui=NONE guifg=#99CCFF guibg=DarkBlue +hi Comment term=NONE cterm=NONE ctermfg=Blue ctermbg=DarkBlue +hi Comment gui=NONE guifg=#6666FF guibg=DarkBlue +hi Preproc term=NONE cterm=NONE ctermfg=Cyan ctermbg=DarkBlue +hi Preproc gui=NONE guifg=#99CCFF guibg=DarkBlue +hi Type term=NONE cterm=NONE ctermfg=Gray ctermbg=DarkBlue +hi Type gui=NONE guifg=#CCCCCC guibg=DarkBlue +hi Identifier term=NONE cterm=NONE ctermfg=Grey ctermbg=DarkBlue +hi Identifier gui=NONE guifg=#CCCCCC guibg=DarkBlue + +hi StatusLine term=bold cterm=bold ctermfg=Black ctermbg=White +hi StatusLine gui=bold guifg=Black guibg=White + +hi StatusLineNC term=NONE cterm=NONE ctermfg=Black ctermbg=White +hi StatusLineNC gui=NONE guifg=Black guibg=White + +hi Visual term=NONE cterm=NONE ctermfg=Black ctermbg=DarkCyan +hi Visual gui=NONE guifg=Black guibg=Gray + +hi Search term=NONE cterm=NONE ctermbg=Gray +hi Search gui=NONE guibg=Gray + +hi VertSplit term=NONE cterm=NONE ctermfg=Black ctermbg=White +hi VertSplit gui=NONE guifg=Black guibg=White + +hi Directory term=NONE cterm=NONE ctermfg=Green ctermbg=DarkBlue +hi Directory gui=NONE guifg=Green guibg=DarkBlue + +hi WarningMsg term=standout cterm=NONE ctermfg=Red ctermbg=DarkBlue +hi WarningMsg gui=standout guifg=Red guibg=DarkBlue + +hi Error term=NONE cterm=NONE ctermfg=White ctermbg=Red +hi Error gui=NONE guifg=White guibg=Red + +hi Cursor ctermfg=Black ctermbg=Yellow +hi Cursor guifg=Black guibg=Yellow + diff --git a/dot_vim/colors/inkpot.vim b/dot_vim/colors/inkpot.vim new file mode 100644 index 0000000..e70d992 --- /dev/null +++ b/dot_vim/colors/inkpot.vim @@ -0,0 +1,138 @@ +" Vim color file +" Name: inkpot.vim +" Maintainer: Ciaran McCreesh <ciaranm@gentoo.org> +" This should work in the GUI, rxvt-unicode (88 colour mode) and xterm (256 +" colour mode). It won't work in 8/16 colour terminals. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "inkpot" + +" map a urxvt cube number to an xterm-256 cube number +fun! <SID>M(a) + return strpart("0135", a:a, 1) + 0 +endfun + +" map a urxvt colour to an xterm-256 colour +fun! <SID>X(a) + if &t_Co == 88 + return a:a + else + if a:a == 8 + return 237 + elseif a:a < 16 + return a:a + elseif a:a > 79 + return 232 + (3 * (a:a - 80)) + else + let l:b = a:a - 16 + let l:x = l:b % 4 + let l:y = (l:b / 4) % 4 + let l:z = (l:b / 16) + return 16 + <SID>M(l:x) + (6 * <SID>M(l:y)) + (36 * <SID>M(l:z)) + endif + endif +endfun + +if has("gui_running") + hi Normal gui=NONE guifg=#cfbfad guibg=#1e1e27 + hi IncSearch gui=BOLD guifg=#303030 guibg=#cd8b60 + hi Search gui=NONE guifg=#303030 guibg=#cd8b60 + hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ff3300 + hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ff6600 + hi ModeMsg gui=BOLD guifg=#7e7eae guibg=NONE + hi MoreMsg gui=BOLD guifg=#7e7eae guibg=NONE + hi Question gui=BOLD guifg=#ffcd00 guibg=NONE + hi StatusLine gui=BOLD guifg=#b9b9b9 guibg=#3e3e5e + hi StatusLineNC gui=NONE guifg=#b9b9b9 guibg=#3e3e5e + hi VertSplit gui=NONE guifg=#b9b9b9 guibg=#3e3e5e + hi WildMenu gui=BOLD guifg=#ffcd00 guibg=#1e1e2e + + hi DiffText gui=NONE guifg=#ffffcd guibg=#00cd00 + hi DiffChange gui=NONE guifg=#ffffcd guibg=#008bff + hi DiffDelete gui=NONE guifg=#ffffcd guibg=#cd0000 + hi DiffAdd gui=NONE guifg=#ffffcd guibg=#00cd00 + + hi Cursor gui=NONE guifg=#404040 guibg=#8b8bff + hi lCursor gui=NONE guifg=#404040 guibg=#8b8bff + hi CursorIM gui=NONE guifg=#404040 guibg=#8b8bff + + hi Folded gui=NONE guifg=#cfcfcd guibg=#4b208f + hi FoldColumn gui=NONE guifg=#8b8bcd guibg=#2e2e2e + + hi Directory gui=NONE guifg=#00ff8b guibg=NONE + hi LineNr gui=NONE guifg=#8b8bcd guibg=#2e2e2e + hi NonText gui=BOLD guifg=#8b8bcd guibg=NONE + hi SpecialKey gui=BOLD guifg=#8b00cd guibg=NONE + hi Title gui=BOLD guifg=#af4f4b guibg=#1e1e27 + hi Visual gui=NONE guifg=#603030 guibg=#edab60 + + hi Comment gui=NONE guifg=#cd8b00 guibg=NONE + hi Constant gui=NONE guifg=#ffcd8b guibg=NONE + hi String gui=NONE guifg=#ffcd8b guibg=#404040 + hi Error gui=NONE guifg=#ffffff guibg=#ff0000 + hi Identifier gui=NONE guifg=#ff8bff guibg=NONE + hi Ignore gui=NONE guifg=#8b8bcd guibg=NONE + hi Number gui=NONE guifg=#506dbd guibg=NONE + hi PreProc gui=NONE guifg=#409090 guibg=NONE + hi Special gui=NONE guifg=#c080d0 guibg=NONE + hi Statement gui=NONE guifg=#808bed guibg=NONE + hi Todo gui=BOLD guifg=#303030 guibg=#c080d0 + hi Type gui=NONE guifg=#ff8bff guibg=NONE + hi Underlined gui=BOLD guifg=#ffffcd guibg=NONE + hi TaglistTagName gui=BOLD guifg=#808bed guibg=NONE + +else + exec "hi Normal cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(80) . "" + exec "hi IncSearch cterm=BOLD ctermfg=" . <SID>X("80") . " ctermbg=" . <SID>X(73) . "" + exec "hi Search cterm=NONE ctermfg=" . <SID>X("80") . " ctermbg=" . <SID>X(73) . "" + exec "hi ErrorMsg cterm=BOLD ctermfg=" . <SID>X("79") . " ctermbg=" . <SID>X(64) . "" + exec "hi WarningMsg cterm=BOLD ctermfg=" . <SID>X("79") . " ctermbg=" . <SID>X(68) . "" + exec "hi ModeMsg cterm=BOLD ctermfg=" . <SID>X("39") . "" + exec "hi MoreMsg cterm=BOLD ctermfg=" . <SID>X("39") . "" + exec "hi Question cterm=BOLD ctermfg=" . <SID>X("72") . "" + exec "hi StatusLine cterm=BOLD ctermfg=" . <SID>X("84") . " ctermbg=" . <SID>X(81) . "" + exec "hi StatusLineNC cterm=NONE ctermfg=" . <SID>X("84") . " ctermbg=" . <SID>X(81) . "" + exec "hi VertSplit cterm=NONE ctermfg=" . <SID>X("84") . " ctermbg=" . <SID>X(82) . "" + exec "hi WildMenu cterm=BOLD ctermfg=" . <SID>X("72") . " ctermbg=" . <SID>X(80) . "" + + exec "hi DiffText cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(24) . "" + exec "hi DiffChange cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(23) . "" + exec "hi DiffDelete cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(48) . "" + exec "hi DiffAdd cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(24) . "" + + exec "hi Cursor cterm=NONE ctermfg=" . <SID>X("8") . " ctermbg=" . <SID>X(39) . "" + exec "hi lCursor cterm=NONE ctermfg=" . <SID>X("8") . " ctermbg=" . <SID>X(39) . "" + exec "hi CursorIM cterm=NONE ctermfg=" . <SID>X("8") . " ctermbg=" . <SID>X(39) . "" + + exec "hi Folded cterm=NONE ctermfg=" . <SID>X("78") . " ctermbg=" . <SID>X(35) . "" + exec "hi FoldColumn cterm=NONE ctermfg=" . <SID>X("38") . " ctermbg=" . <SID>X(80) . "" + + exec "hi Directory cterm=NONE ctermfg=" . <SID>X("29") . " ctermbg=NONE" + exec "hi LineNr cterm=NONE ctermfg=" . <SID>X("38") . " ctermbg=" . <SID>X(80) . "" + exec "hi NonText cterm=BOLD ctermfg=" . <SID>X("38") . " ctermbg=NONE" + exec "hi SpecialKey cterm=BOLD ctermfg=" . <SID>X("34") . " ctermbg=NONE" + exec "hi Title cterm=BOLD ctermfg=" . <SID>X("52") . " ctermbg=" . <SID>X(80) . "" + exec "hi Visual cterm=NONE ctermfg=" . <SID>X("80") . " ctermbg=" . <SID>X(73) . "" + + exec "hi Comment cterm=NONE ctermfg=" . <SID>X("52") . " ctermbg=NONE" + exec "hi Constant cterm=NONE ctermfg=" . <SID>X("73") . " ctermbg=NONE" + exec "hi String cterm=NONE ctermfg=" . <SID>X("73") . " ctermbg=" . <SID>X(8) . "" + exec "hi Error cterm=NONE ctermfg=" . <SID>X("79") . " ctermbg=" . <SID>X(64) . "" + exec "hi Identifier cterm=NONE ctermfg=" . <SID>X("71") . " ctermbg=NONE" + exec "hi Ignore cterm=NONE ctermfg=" . <SID>X("38") . " ctermbg=NONE" + exec "hi Number cterm=NONE ctermfg=" . <SID>X("22") . " ctermbg=NONE" + exec "hi PreProc cterm=NONE ctermfg=" . <SID>X("10") . " ctermbg=NONE" + exec "hi Special cterm=NONE ctermfg=" . <SID>X("39") . " ctermbg=NONE" + exec "hi Statement cterm=NONE ctermfg=" . <SID>X("26") . " ctermbg=NONE" + exec "hi Todo cterm=BOLD ctermfg=" . <SID>X("08") . " ctermbg=" . <SID>X(39) . "" + exec "hi Type cterm=NONE ctermfg=" . <SID>X("71") . " ctermbg=NONE" + exec "hi Underlined cterm=BOLD ctermfg=" . <SID>X("78") . " ctermbg=NONE" + exec "hi TaglistTagName cterm=BOLD ctermfg=" . <SID>X("26") . " ctermbg=NONE" +endif + +" vim: set et : diff --git a/dot_vim/colors/ironman.vim b/dot_vim/colors/ironman.vim new file mode 100644 index 0000000..c82ce3d --- /dev/null +++ b/dot_vim/colors/ironman.vim @@ -0,0 +1,80 @@ +" Vim color file +" Maintainer: Michael Boehler +" Mail: michael@familie-boehler.de +" Last Change: 2002-09-24 +" Version: 1.3 +" This color scheme uses a light background. +" GUI only + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "ironman" + +hi Normal guifg=#333333 guibg=NONE + +" Search +hi IncSearch gui=NONE guifg=#303040 guibg=#ffff00 +hi Search gui=NONE guifg=#303040 guibg=#ccff00 + +" Messages +hi ErrorMsg gui=NONE guifg=#FF0000 guibg=NONE +hi WarningMsg gui=NONE guifg=#FF6600 guibg=NONE +hi ModeMsg gui=NONE guifg=#0070ff guibg=NONE +hi MoreMsg gui=NONE guifg=#a800ff guibg=NONE +hi Question gui=NONE guifg=#008050 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#fffacd guibg=#DF6A6A +hi StatusLineNC gui=NONE guifg=#fffacd guibg=#b2bbcc +hi VertSplit gui=NONE guifg=#fffacd guibg=#b2bbcc +hi WildMenu gui=NONE guifg=#ffffff guibg=#3399cc + +" Diff +hi DiffText gui=NONE guifg=#f83010 guibg=#ffeae0 +hi DiffChange gui=NONE guifg=#006800 guibg=#d0ffd0 +hi DiffDelete gui=NONE guifg=#2020ff guibg=#c8f2ea +hi DiffAdd gui=NONE guifg=#2020ff guibg=#c8f2ea + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#DF6A6A +hi lCursor gui=NONE guifg=#f8f8f8 guibg=#8000ff +hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#8000ff + +" Fold +hi Folded gui=NONE guifg=#3399ff guibg=#EAF5FF +hi FoldColumn gui=NONE guifg=#3399ff guibg=#EAF5FF + +" Other +hi Directory gui=NONE guifg=#0000ff guibg=NONE +hi LineNr gui=NONE guifg=#cccccc guibg=NONE +hi NonText gui=NONE guifg=#cccccc guibg=NONE +hi SpecialKey gui=NONE guifg=#66cccc guibg=NONE +hi Title gui=NONE guifg=#004060 guibg=#c8f0f8 +hi Visual gui=NONE guifg=#ffffff guibg=#6889de + +" Syntax group +hi Comment gui=NONE guifg=#ff5050 guibg=#ffebeb +hi Constant gui=NONE guifg=#333333 guibg=#ededed +hi Error gui=BOLD guifg=#ffffff guibg=#ff4080 +hi Identifier gui=NONE guifg=#339933 guibg=NONE +hi Ignore gui=NONE guifg=#f8f8f8 guibg=NONE +hi PreProc gui=NONE guifg=#0070e6 guibg=NONE +hi Special gui=NONE guifg=#0000ff guibg=#ccf7ee +hi Statement gui=NONE guifg=#0000FF guibg=NONE +hi Todo gui=NONE guifg=#ff0070 guibg=#ffe0f4 +hi Type gui=NONE guifg=#eb7950 guibg=NONE +hi Underlined gui=UNDERLINE guifg=#0000ff guibg=NONE + +" HTML +hi htmlLink gui=UNDERLINE guifg=#0000ff guibg=NONE +hi htmlBold gui=BOLD +hi htmlBoldItalic gui=BOLD,ITALIC +hi htmlBoldUnderline gui=BOLD,UNDERLINE +hi htmlBoldUnderlineItalic gui=BOLD,UNDERLINE,ITALIC +hi htmlItalic gui=ITALIC +hi htmlUnderline gui=UNDERLINE +hi htmlUnderlineItalic gui=UNDERLINE,ITALIC diff --git a/dot_vim/colors/jhdark.vim b/dot_vim/colors/jhdark.vim new file mode 100644 index 0000000..22e5494 --- /dev/null +++ b/dot_vim/colors/jhdark.vim @@ -0,0 +1,72 @@ +" Vim color file by Jörn Horstmann <joern_h@gmx.net> +" Light background in GUI, dark background in Console +" Last change 16.07.2004 +" TODO + +set bg=dark + +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "jhdark" + +hi Normal guifg=#999999 guibg=#000000 gui=none ctermfg=gray ctermbg=black cterm=none + +hi ErrorMsg guifg=#ff0000 guibg=bg gui=none ctermfg=red ctermbg=bg cterm=none +hi Visual guifg=bg guibg=#4444aa gui=none ctermfg=bg ctermbg=darkcyan cterm=none +hi VisualNOS guifg=bg guibg=#4444aa gui=none ctermfg=bg ctermbg=darkcyan cterm=none +hi Todo guifg=bg guibg=#aaaa00 gui=none ctermfg=bg ctermbg=yellow cterm=none +"hi Todo guifg=#884400 guibg=bg gui=none ctermfg=bg ctermbg=yellow cterm=none +hi Search guifg=bg guibg=#8888ee gui=none ctermfg=bg ctermbg=blue cterm=none +hi IncSearch guifg=bg guibg=#8888ee gui=none ctermfg=bg ctermbg=blue cterm=none + +hi SpecialKey guifg=#775522 guibg=bg gui=none ctermfg=magenta ctermbg=bg cterm=none +hi Directory guifg=#000088 guibg=bg gui=none ctermfg=blue ctermbg=bg cterm=none +hi WarningMsg guifg=#ff0000 guibg=bg gui=none ctermfg=red ctermbg=bg cterm=none +hi WildMenu guifg=bg guibg=#ffff00 gui=none ctermfg=bg ctermbg=yellow cterm=none +hi ModeMsg guifg=fg guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi Title guifg=fg guibg=#cccccc gui=none ctermfg=bg ctermbg=fg cterm=none +hi MoreMsg guifg=fg guibg=bg gui=none ctermfg=bg ctermbg=fg cterm=none +hi Question guifg=fg guibg=bg gui=none ctermfg=bg ctermbg=fg cterm=none +hi NonText guifg=#666666 guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none + +hi StatusLine guifg=#dddddd guibg=#000088 gui=none ctermfg=bg ctermbg=darkblue cterm=none +hi StatusLineNC guifg=#dddddd guibg=#333333 gui=none ctermfg=bg ctermbg=darkgray cterm=none +hi VertSplit guifg=#dddddd guibg=#333333 gui=none ctermfg=bg ctermbg=darkgray cterm=none + +hi Folded guifg=#bb0099 guibg=#222222 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +hi FoldColumn guifg=#bb0099 guibg=#222222 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +hi SignColumn guifg=#bb0099 guibg=#222222 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +hi LineNr guifg=#bb0099 guibg=#222222 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none + +"hi Folded guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi FoldColumn guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi SignColumn guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi LineNr guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none + +hi DiffChange guifg=bg guibg=#888800 gui=none ctermfg=bg ctermbg=brown cterm=none +hi DiffAdd guifg=bg guibg=#000088 gui=none ctermfg=bg ctermbg=darkblue cterm=none +hi DiffDelete guifg=bg guibg=#880000 gui=none ctermfg=bg ctermbg=darkred cterm=none +hi DiffText guifg=fg guibg=#dd0000 gui=none ctermfg=fg ctermbg=red cterm=none + +hi Cursor guifg=bg guibg=fg gui=none ctermfg=bg ctermbg=fg cterm=none +hi lCursor guifg=bg guibg=fg gui=none ctermfg=bg ctermbg=fg cterm=none + +hi Comment guifg=#008800 guibg=bg gui=none ctermfg=darkgreen ctermbg=bg cterm=none +hi Operator guifg=fg guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi Constant guifg=#aa0000 guibg=bg gui=none ctermfg=darkred ctermbg=bg cterm=none +hi Special guifg=#997700 guibg=bg gui=none ctermfg=brown ctermbg=bg cterm=none + +hi Identifier guifg=#dddddd guibg=bg gui=none ctermfg=white ctermbg=bg cterm=none + +hi Type guifg=#6666dd guibg=bg gui=none ctermfg=cyan ctermbg=bg cterm=none +hi Statement guifg=#dddddd guibg=bg gui=none ctermfg=white ctermbg=bg cterm=none + +hi PreProc guifg=#008888 guibg=bg gui=none ctermfg=darkcyan ctermbg=bg cterm=none + +hi Error guifg=fg guibg=#ff0000 gui=none ctermfg=bg ctermbg=red cterm=none + +hi Ignore guifg=bg ctermfg=bg +hi Underlined guifg=fg guibg=bg ctermfg=fg ctermbg=bg cterm=underline term=underline gui=underline diff --git a/dot_vim/colors/jhlight.vim b/dot_vim/colors/jhlight.vim new file mode 100644 index 0000000..753232e --- /dev/null +++ b/dot_vim/colors/jhlight.vim @@ -0,0 +1,80 @@ +" Vim color file by Jörn Horstmann <joern_h@gmx.net> +" Light background, works in GUI and cobnsole +" Last change 08.09.2004 +" TODO + +set bg=light + +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "jhlight" + +hi Normal guifg=#000000 guibg=#dddddd gui=none ctermfg=black ctermbg=grey cterm=none + +hi ErrorMsg guifg=#ff0000 guibg=bg gui=none ctermfg=red ctermbg=bg cterm=none +hi Visual guifg=bg guibg=#4444aa gui=none ctermfg=bg ctermbg=darkcyan cterm=none +hi VisualNOS guifg=bg guibg=#4444aa gui=none ctermfg=bg ctermbg=darkcyan cterm=none +hi Todo guifg=fg guibg=#bbbb77 gui=none ctermfg=bg ctermbg=brown cterm=none +"hi Todo guifg=#884400 guibg=bg gui=none ctermfg=bg ctermbg=yellow cterm=none +hi Search guifg=fg guibg=#8888ee gui=none ctermfg=bg ctermbg=blue cterm=none +hi IncSearch guifg=fg guibg=#8888ee gui=none ctermfg=bg ctermbg=blue cterm=none + +hi SpecialKey guifg=#553300 guibg=bg gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +hi Directory guifg=#000088 guibg=bg gui=none ctermfg=blue ctermbg=bg cterm=none +hi WarningMsg guifg=#ff0000 guibg=bg gui=none ctermfg=red ctermbg=bg cterm=none +hi WildMenu guifg=fg guibg=#ffff00 gui=none ctermfg=bg ctermbg=brown cterm=none +hi ModeMsg guifg=fg guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi Title guifg=#000088 guibg=#cccccc gui=none ctermfg=fg ctermbg=bg cterm=none +hi MoreMsg guifg=#000088 guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi Question guifg=#000088 guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi NonText guifg=#444444 guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none + +hi StatusLine guifg=#dddddd guibg=#000088 gui=none ctermfg=white ctermbg=darkblue cterm=none +hi StatusLineNC guifg=#dddddd guibg=#333333 gui=none ctermfg=grey ctermbg=black cterm=none +hi VertSplit guifg=#dddddd guibg=#333333 gui=none ctermfg=white ctermbg=black cterm=none + +hi Folded guifg=#005500 guibg=#999999 gui=none ctermfg=darkgreen ctermbg=darkgray cterm=none +hi FoldColumn guifg=#005500 guibg=#999999 gui=none ctermfg=darkgreen ctermbg=darkgray cterm=none +hi SignColumn guifg=#005500 guibg=#999999 gui=none ctermfg=darkgreen ctermbg=darkgray cterm=none +hi LineNr guifg=#005500 guibg=#999999 gui=none ctermfg=darkgreen ctermbg=darkgray cterm=none + +"hi Folded guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi FoldColumn guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi SignColumn guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +"hi LineNr guifg=#dddddd guibg=#666666 gui=none ctermfg=darkmagenta ctermbg=bg cterm=none + +hi DiffChange guifg=bg guibg=#888800 gui=none ctermfg=bg ctermbg=brown cterm=none +hi DiffAdd guifg=bg guibg=#000088 gui=none ctermfg=bg ctermbg=darkblue cterm=none +hi DiffDelete guifg=bg guibg=#880000 gui=none ctermfg=bg ctermbg=darkred cterm=none +hi DiffText guifg=fg guibg=#dd0000 gui=none ctermfg=fg ctermbg=red cterm=none + +hi Cursor guifg=bg guibg=fg gui=none ctermfg=bg ctermbg=fg cterm=none +hi lCursor guifg=bg guibg=fg gui=none ctermfg=bg ctermbg=fg cterm=none + +hi Comment guifg=#005500 guibg=bg gui=none ctermfg=darkgreen ctermbg=bg cterm=none +hi Operator guifg=fg guibg=bg gui=none ctermfg=fg ctermbg=bg cterm=none +hi Constant guifg=#880000 guibg=bg gui=none ctermfg=darkred ctermbg=bg cterm=none +hi Special guifg=#553300 guibg=bg gui=none ctermfg=brown ctermbg=bg cterm=none + +hi Identifier guifg=#000088 guibg=bg gui=none ctermfg=darkblue ctermbg=bg cterm=none +"hi Function guifg=#000044 gui=none + +"hi Keyword guifg=#000088 gui=none + +if exists("g:jh_hi_use_bold") + hi Type guifg=#660044 guibg=bg gui=bold ctermfg=darkmagenta ctermbg=bg cterm=none + hi Statement guifg=#440066 guibg=bg gui=bold ctermfg=darkmagenta ctermbg=bg cterm=none +else + hi Type guifg=#660044 guibg=bg gui=none ctermfg=darkmagenta ctermbg=bg cterm=none + hi Statement guifg=#440066 guibg=bg gui=none ctermfg=darkmagenta ctermbg=bg cterm=none +endif + +hi PreProc guifg=#004466 guibg=bg gui=none ctermfg=darkcyan ctermbg=bg cterm=none + +hi Error guifg=fg guibg=#880000 gui=none ctermfg=bg ctermbg=red cterm=none + +hi Ignore guifg=bg ctermfg=bg +hi Underlined guifg=fg guibg=bg ctermfg=fg ctermbg=bg cterm=underline term=underline gui=underline diff --git a/dot_vim/colors/less.vim b/dot_vim/colors/less.vim new file mode 100644 index 0000000..c874913 --- /dev/null +++ b/dot_vim/colors/less.vim @@ -0,0 +1,54 @@ +" vim color file +" Maintainer: Brian Nelson <nelsonbc@gmail.com> +" Last Change: $Revision: 1.1 $ $Date: 2003/12/15 17:25:08 $ +" +" Less is More - A minimal color scheme. +" Disigned to work equally well on 8 or 16 colors, terminal or gui. + +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "less" + +hi Normal term=none ctermfg=7 ctermbg=0 gui=none guifg=LightGray guibg=black +hi Directory term=bold cterm=bold ctermfg=blue guifg=Blue +hi Search term=reverse ctermfg=white ctermbg=blue guifg=white guibg=Blue +hi MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=DarkGreen +hi ModeMsg term=bold cterm=bold gui=bold guifg=White guibg=Blue +hi LineNr term=underline cterm=bold ctermfg=darkcyan guifg=DarkCyan +hi Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=DarkGreen +hi Comment term=bold cterm=bold ctermfg=0 gui=none guifg=DarkGray +hi Constant term=bold cterm=none ctermfg=7 gui=none guifg=LightGray +hi Special term=bold cterm=none ctermfg=3 gui=none guifg=Orange +hi Identifier term=none cterm=none ctermfg=7 gui=none guifg=LightGray +hi PreProc term=underline cterm=bold ctermfg=7 gui=bold guifg=White +hi Error term=reverse cterm=bold ctermfg=7 ctermbg=1 gui=bold guifg=Black guibg=Red +hi Todo term=standout cterm=none ctermfg=0 ctermbg=7 guifg=Black guibg=White +hi String term=none cterm=none ctermfg=3 gui=none guifg=LightYellow +hi Function term=bold cterm=bold ctermfg=3 gui=none guifg=Yellow +hi Statement term=bold cterm=bold ctermfg=7 gui=bold guifg=White +hi Include term=bold cterm=bold ctermfg=4 gui=none guifg=LightBlue +hi StorageClass term=bold cterm=bold ctermfg=5 gui=none guifg=LightMagenta +hi Type term=none cterm=none ctermfg=7 gui=none guifg=LightGray +hi Defined term=bold cterm=bold ctermfg=6 gui=none guifg=LightCyan +hi link Character String +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Macro Include +hi link PreCondit PreProc +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special diff --git a/dot_vim/colors/lilac.vim b/dot_vim/colors/lilac.vim new file mode 100644 index 0000000..ef825fa --- /dev/null +++ b/dot_vim/colors/lilac.vim @@ -0,0 +1,75 @@ +" GUI-only vim color file +" Author: Christian MICHON +" Version: 1.0 +" Last Change: 10 Oct 2002 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "lilac" + +hi Boolean guifg=#00f080 guibg=#503040 gui=none +hi Character guifg=#00f080 guibg=#503040 gui=none +hi Comment guifg=#c0c0c0 guibg=#503040 gui=underline +hi Conditional guifg=#60d0d0 guibg=#503040 gui=bold +hi Constant guifg=#00f080 guibg=#503040 gui=none +hi Cursor guifg=#000000 guibg=#f0f000 gui=none +hi Debug guifg=#b0d0f0 guibg=#503040 gui=none +hi Define guifg=#f0f000 guibg=#503040 gui=none +hi Delimiter guifg=#b0d0f0 guibg=#503040 gui=none +hi DiffAdd guifg=#f0f000 guibg=#805070 gui=bold +hi DiffChange guifg=#f0f0f0 guibg=#805070 gui=none +hi DiffDelete guifg=#503040 guibg=#805070 gui=none +hi DiffText guifg=#000000 guibg=#f0f000 gui=bold +hi Directory guifg=#f0f000 guibg=#503040 gui=underline +hi Error guifg=#000000 guibg=#b0d0f0 gui=bold +hi ErrorMsg guifg=#000000 guibg=#b0d0f0 gui=bold +hi Exception guifg=#60d0d0 guibg=#503040 gui=bold +hi Float guifg=#00f080 guibg=#503040 gui=none +hi FoldColumn guifg=#b0d0f0 guibg=#805070 gui=bold +hi Folded guifg=#b0d0f0 guibg=#805070 gui=bold +hi Function guifg=#f0a070 guibg=#503040 gui=none +hi Identifier guifg=#f0a070 guibg=#503040 gui=none +hi Ignore guifg=#503040 guibg=#503040 gui=none +hi Include guifg=#f0f000 guibg=#503040 gui=none +hi IncSearch guifg=#000000 guibg=#b0d0f0 gui=bold +hi Keyword guifg=#60d0d0 guibg=#503040 gui=bold +hi Label guifg=#60d0d0 guibg=#503040 gui=bold +hi lCursor guifg=#f0f0f0 guibg=#503040 gui=none +hi LineNr guifg=#c0c0c0 guibg=#805070 gui=bold +hi Macro guifg=#f0f000 guibg=#503040 gui=none +hi ModeMsg guifg=#f0f0f0 guibg=#503040 gui=bold +hi MoreMsg guifg=#f070a0 guibg=#503040 gui=bold +hi NonText guifg=#c0c0c0 guibg=#503040 gui=bold +hi Normal guifg=#f0f0f0 guibg=#503040 gui=none +hi Number guifg=#00f080 guibg=#503040 gui=none +hi Operator guifg=#60d0d0 guibg=#503040 gui=bold +hi PreCondit guifg=#f0f000 guibg=#503040 gui=none +hi PreProc guifg=#f0f000 guibg=#503040 gui=none +hi Question guifg=#f070a0 guibg=#503040 gui=bold +hi Repeat guifg=#60d0d0 guibg=#503040 gui=bold +hi Search guifg=#000000 guibg=#b0d0f0 gui=bold +hi Special guifg=#b0d0f0 guibg=#503040 gui=none +hi SpecialChar guifg=#b0d0f0 guibg=#503040 gui=none +hi SpecialComment guifg=#b0d0f0 guibg=#503040 gui=none +hi SpecialKey guifg=#f0f000 guibg=#503040 gui=none +hi Statement guifg=#60d0d0 guibg=#503040 gui=bold +hi StatusLine guifg=#000000 guibg=#f0f0f0 gui=bold +hi StatusLineNC guifg=#c0c0c0 guibg=#805070 gui=bold +hi StorageClass guifg=#f070a0 guibg=#503040 gui=bold +hi String guifg=#00f080 guibg=#503040 gui=none +hi Structure guifg=#f070a0 guibg=#503040 gui=bold +hi Tag guifg=#b0d0f0 guibg=#503040 gui=none +hi Title guifg=#00f080 guibg=#503040 gui=bold +hi Todo guifg=#f0f000 guibg=#0000f0 gui=none +hi Type guifg=#f070a0 guibg=#503040 gui=bold +hi Typedef guifg=#f070a0 guibg=#503040 gui=bold +hi Underlined guifg=#b0d0f0 guibg=#503040 gui=underline +hi VertSplit guifg=#000000 guibg=#b0d0f0 gui=bold +hi Visual guifg=#000000 guibg=#b0d0f0 gui=underline +hi VisualNOS guifg=#f0f0f0 guibg=#503040 gui=underline +hi WarningMsg guifg=#000000 guibg=#b0d0f0 gui=bold +hi WildMenu guifg=#f0f0f0 guibg=#0000f0 gui=none diff --git a/dot_vim/colors/lingodirector.vim b/dot_vim/colors/lingodirector.vim new file mode 100644 index 0000000..57f2b3c --- /dev/null +++ b/dot_vim/colors/lingodirector.vim @@ -0,0 +1,44 @@ +" Vim color file +" Maintainer: Thomas Schmall <ts_nowhere@yahoo.com> +" Last Change: 2004 June 16 +" Version:1.0 +" URL: http://www.oxpal.com/index.php?o=dev_vim&lan=en +" +" Note: you can type :set number! to activate or deactivate the line numbering, wich also +" looks similar to Director + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="lingodirector" + +hi Normal guifg=black guibg=white ctermfg=Black ctermbg=white +hi Title guifg=black guibg=white ctermfg=Black ctermbg=white gui=BOLD +hi lCursor guibg=Cyan guifg=NONE + +hi LineNr guifg=white guibg=#8c9bfa + + + +" syntax highlighting groups +hi Comment ctermfg=Red guifg=#c80000 gui=NONE +hi Operator term=None cterm=None gui=None + +hi Identifier ctermfg=Green guifg=#008000 gui=NONE + +hi Statement ctermfg=Blue guifg=#0000c8 gui=NONE +hi TypeDef ctermfg=Blue guifg=#0000c8 gui=NONE +hi Type ctermfg=Blue guifg=#0000c8 gui=NONE +hi Boolean ctermfg=Blue guifg=#0000c8 gui=NONE + +hi String ctermfg=Gray guifg=#808080 gui=NONE +hi Number ctermfg=Gray guifg=#808080 gui=NONE +hi Constant ctermfg=Gray guifg=#808080 gui=NONE + +hi Function ctermfg=Green guifg=#008040 gui=NONE +hi PreProc ctermfg=Green guifg=#008040 gui=NONE +hi Keyword ctermfg=Green guifg=#008040 gui=NONE + +"set number diff --git a/dot_vim/colors/manxome.vim b/dot_vim/colors/manxome.vim new file mode 100644 index 0000000..0db38ea --- /dev/null +++ b/dot_vim/colors/manxome.vim @@ -0,0 +1,47 @@ +""" local syntax file - set colors on a per-machine basis: +""" Vim color file +""" Title: Manxome Foes Color Scheme +""" Maintainer: Ricardo SIGNES <rjbs-vim@lists.manxome.org> +""" This Version: R2v2 [2003-07-16] +""" suggested vim editing options: tw=0 ts=4 sw=4 + +"" clear and re-initialize global variables +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "manxome" + +"" set highlight groups +"" you'll notice that the ctermbg is often 'none'; this is so that when +"" console vim runs in a terminal, transparency (if any) is not broken + +highlight Title ctermfg=3 ctermbg=none cterm=bold guifg=#ffff00 guibg=#000000 gui=none +highlight Directory ctermfg=4 ctermbg=none cterm=bold guifg=#0000ff guibg=#000000 gui=none +highlight StatusLine ctermfg=7 ctermbg=4 cterm=bold guifg=#ffffff guibg=#0000ff gui=none +highlight StatusLineNC ctermfg=0 ctermbg=4 cterm=bold guifg=#000000 guibg=#0000ff gui=none +highlight Normal ctermfg=7 ctermbg=none cterm=none guifg=#cccccc guibg=#000000 gui=none +highlight Search ctermfg=7 ctermbg=4 cterm=bold guifg=#ffffff guibg=#0000ff gui=none +highlight Visual ctermfg=7 ctermbg=6 cterm=bold guifg=#ffffff guibg=#00aaaa gui=none + +"" set major preferred groups + +highlight Comment ctermfg=2 ctermbg=none cterm=bold guifg=#00ff00 guibg=#000000 gui=none +highlight Constant ctermfg=6 ctermbg=none cterm=bold guifg=#00ffff guibg=#000000 gui=none +highlight Identifier ctermfg=4 ctermbg=none cterm=bold guifg=#0000ee guibg=#000000 gui=none +highlight Statement ctermfg=6 ctermbg=none cterm=none guifg=#00aaaa guibg=#000000 gui=none +highlight PreProc ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight Type ctermfg=6 ctermbg=none cterm=none guifg=#00aaaa guibg=#000000 gui=none +highlight Special ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight Underlined ctermfg=2 ctermbg=none cterm=none guifg=#00aa00 guibg=#000000 gui=none +highlight Ignore ctermfg=0 ctermbg=none cterm=bold guifg=#aaaaaa guibg=#000000 gui=none +highlight Error ctermfg=1 ctermbg=none cterm=bold guibg=#ff0000 guibg=#000000 gui=none +highlight Todo ctermfg=3 ctermbg=none cterm=none guifg=#aaaa00 guibg=#000000 gui=none + +" set syntax-specific groups +" I'd like to avoid using these, but the default settings for these two are +" just no good. Seeing italic text in Vim is just plain wrong. + +highlight htmlBold ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight htmlItalic ctermfg=5 ctermbg=none cterm=bold guifg=#ff00ff guibg=#000000 gui=none diff --git a/dot_vim/colors/mars.vim b/dot_vim/colors/mars.vim new file mode 100644 index 0000000..408ae79 --- /dev/null +++ b/dot_vim/colors/mars.vim @@ -0,0 +1,142 @@ +" Maintainer: Tim Aldrich <aldy0169@yahoo.com> +" Last Change: 19 November 2003 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="mars" +" GUI colors {{{ +"hi Normal guifg=#FFFFFF guibg=#961E00 +hi Normal guifg=#FFFFFF guibg=#961E00 +hi Cursor guifg=#A0963C guibg=#FFFFFF +hi CursorIM guifg=#6699CC guibg=#99CCCC +hi Directory guifg=#B45000 guibg=#961E00 +hi DiffAdd guifg=#FFFFCC guibg=#961E00 +hi DiffChange guifg=#FF9900 guibg=#961E00 +hi DiffDelete guifg=#999999 guibg=#961E00 +hi DiffText guifg=#FFFFFF guibg=#961E00 +hi ErrorMsg guifg=#FFFFFF guibg=#FF0000 +hi VertSplit guifg=#FFFFFF guibg=#961E00 +hi Folded guifg=#999999 guibg=#BE1E00 gui=italic +hi FoldColumn guifg=#CC0000 guibg=#999999 +hi IncSearch guifg=#FFFF00 guibg=#961E00 +hi LineNr guifg=#999999 guibg=#BE1E00 +hi ModeMsg guifg=#FFFFFF guibg=#961E00 +hi MoreMsg guifg=#FFFFFF guibg=#961E00 +hi NonText guifg=#FFFFFF guibg=#A0141E +hi Question guifg=#FFFFFF guibg=#EE0000 +hi Search guifg=#A0142B guibg=#FFFF00 gui=underline +hi SpecialKey guifg=#FFFF00 guibg=#961E00 +hi StatusLine guifg=#FFFFFF guibg=#961E00 +hi StatusLineNC guifg=#CCCCCC guibg=#961E00 +hi Title guifg=#FFFFFF guibg=#FF9900 +hi Visual guifg=#B45000 guibg=#961E00 +hi WarningMsg guifg=#FF0000 guibg=#FFFFFF +hi WildMenu guifg=#961E00 guibg=#999999 +" }}} + +" cterm colors {{{ +hi Normal ctermfg=white ctermbg=darkblue +hi Cursor ctermfg=darkblue ctermbg=white +hi CursorIM ctermfg=lightcyan ctermbg=lightcyan +hi Directory ctermfg=lightblue ctermbg=lightcyan +hi DiffAdd ctermfg=LightYellow ctermbg=darkblue +hi DiffChange ctermfg=darkred ctermbg=darkblue +hi DiffDelete ctermfg=grey ctermbg=darkblue +hi DiffText ctermfg=white ctermbg=darkblue +hi ErrorMsg ctermfg=red ctermbg=lightcyan +hi VertSplit ctermfg=white ctermbg=darkblue +hi Folded ctermfg=grey ctermbg=darkblue +hi FoldColumn ctermfg=darkred ctermbg=lightcyan +hi IncSearch ctermfg=yellow ctermbg=darkblue +hi LineNr ctermfg=lightyellow ctermbg=darkblue +hi ModeMsg ctermfg=white ctermbg=darkblue +hi MoreMsg ctermfg=white ctermbg=darkblue +hi NonText ctermfg=white ctermbg=lightblue +hi Question ctermfg=white ctermbg=darkblue +hi Search ctermfg=darkred ctermbg=lightcyan +hi SpecialKey ctermfg=yellow ctermbg=darkblue +hi StatusLine ctermfg=white ctermbg=darkblue +hi StatusLineNC ctermfg=lightgrey ctermbg=darkblue +hi Title ctermfg=white ctermbg=yellow +hi Visual ctermfg=lightblue ctermbg=cyan +hi WarningMsg ctermfg=red ctermbg=white +hi WildMenu ctermfg=darkblue ctermbg=grey +" }}} + +" GUI hilight groups {{{ + +hi Comment guifg=#999999 +hi Constant guifg=#FFFF00 +hi String guifg=#CCCC99 +hi Character guifg=#A0963C +hi Number guifg=#A0963C +hi Boolean guifg=#A0963C +hi Float guifg=#A0963C +hi Identifier guifg=#E6fA46 +hi Function guifg=#E6fA46 +hi Statement guifg=#FFFFCC +hi Conditional guifg=#FFFFCC +hi Repeat guifg=#FFFFCC +hi Label guifg=#E66E46 +hi Operator guifg=#FFFF00 +hi Keyword guifg=#FFFF00 +hi Exception guifg=#FFFFAA +hi PreProc guifg=#C8783C +hi Include guifg=#C8783C +hi Define guifg=#C8783C +hi Macro guifg=#C8783C +hi PreCondit guifg=#C8783C +hi Type guifg=#E6641E +hi StorageClass guifg=#E66E46 +hi Structure guifg=#E66E46 +hi Typedef guifg=#E66E46 +hi Special guifg=#00FF00 +hi SpecialChar guifg=#00FF00 +hi Tag guifg=#CCCCFF +hi Delimiter guifg=#CCCCFF +hi SpecialComment guifg=#FFFFCC +hi Debug guifg=#CC3300 +hi Ignore guifg=#961E00 +hi Error guifg=#FF0000 guibg=#FFFFFF +hi Todo guifg=#FFFF00 guibg=#961E00 +" }}} + +" cterm hilight groups {{{ +hi Comment ctermfg=grey +hi Constant ctermfg=lightgreen +hi String ctermfg=brown +hi Character ctermfg=lightgreen +hi Number ctermfg=lightgreen +hi Boolean ctermfg=lightgreen +hi Float ctermfg=lightgreen +hi Identifier ctermfg=lightcyan +hi Function ctermfg=lightcyan +hi Statement ctermfg=lightyellow +hi Conditional ctermfg=lightyellow +hi Repeat ctermfg=lightyellow +hi Label ctermfg=lightcyan +hi Operator ctermfg=yellow +hi Keyword ctermfg=yellow +hi Exception ctermfg=yellow +hi PreProc ctermfg=darkcyan +hi Include ctermfg=darkcyan +hi Define ctermfg=darkcyan +hi Macro ctermfg=darkcyan +hi PreCondit ctermfg=darkcyan +hi Type ctermfg=lightcyan +hi StorageClass ctermfg=lightcyan +hi Structure ctermfg=lightcyan +hi Typedef ctermfg=lightcyan +hi Special ctermfg=green +hi SpecialChar ctermfg=green +hi Tag ctermfg=brown +hi Delimiter ctermfg=brown +hi SpecialComment ctermfg=lightyellow +hi Debug ctermfg=magenta +hi Ignore ctermfg=lightblue +hi Error ctermfg=red ctermbg=white +hi Todo ctermfg=grey ctermbg=white +" }}} diff --git a/dot_vim/colors/matrix.vim b/dot_vim/colors/matrix.vim new file mode 100644 index 0000000..da5c687 --- /dev/null +++ b/dot_vim/colors/matrix.vim @@ -0,0 +1,80 @@ +" vim:set ts=8 sts=2 sw=2 tw=0: +" +" matrix.vim - MATRIX like colorscheme. +" +" Maintainer: MURAOKA Taro <koron@tka.att.ne.jp> +" Last Change: 10-Jun-2003. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = 'matrix' + +" the character under the cursor +hi Cursor guifg=#226622 guibg=#55ff55 +hi lCursor guifg=#226622 guibg=#55ff55 +" like Cursor, but used when in IME mode |CursorIM| +hi CursorIM guifg=#226622 guibg=#55ff55 +" directory names (and other special names in listings) +hi Directory guifg=#55ff55 guibg=#000000 +" diff mode: Added line |diff.txt| +hi DiffAdd guifg=#55ff55 guibg=#226622 gui=none +" diff mode: Changed line |diff.txt| +hi DiffChange guifg=#55ff55 guibg=#226622 gui=none +" diff mode: Deleted line |diff.txt| +hi DiffDelete guifg=#113311 guibg=#113311 gui=none +" diff mode: Changed text within a changed line |diff.txt| +hi DiffText guifg=#55ff55 guibg=#339933 gui=bold +" error messages on the command line +hi ErrorMsg guifg=#55ff55 guibg=#339933 +" the column separating vertically split windows +hi VertSplit guifg=#339933 guibg=#339933 +" line used for closed folds +hi Folded guifg=#44cc44 guibg=#113311 +" 'foldcolumn' +hi FoldColumn guifg=#44cc44 guibg=#226622 +" 'incsearch' highlighting; also used for the text replaced with +hi IncSearch guifg=#226622 guibg=#55ff55 gui=none +" line number for ":number" and ":#" commands, and when 'number' +hi LineNr guifg=#44cc44 guibg=#000000 +" 'showmode' message (e.g., "-- INSERT --") +hi ModeMsg guifg=#44cc44 guibg=#000000 +" |more-prompt| +hi MoreMsg guifg=#44cc44 guibg=#000000 +" '~' and '@' at the end of the window, characters from +hi NonText guifg=#44cc44 guibg=#113311 +" normal text +hi Normal guifg=#44cc44 guibg=#000000 +" |hit-enter| prompt and yes/no questions +hi Question guifg=#44cc44 guibg=#000000 +" Last search pattern highlighting (see 'hlsearch'). +hi Search guifg=#113311 guibg=#44cc44 gui=none +" Meta and special keys listed with ":map", also for text used +hi SpecialKey guifg=#44cc44 guibg=#000000 +" status line of current window +hi StatusLine guifg=#55ff55 guibg=#339933 gui=none +" status lines of not-current windows +hi StatusLineNC guifg=#113311 guibg=#339933 gui=none +" titles for output from ":set all", ":autocmd" etc. +hi Title guifg=#55ff55 guibg=#113311 gui=bold +" Visual mode selection +hi Visual guifg=#55ff55 guibg=#339933 gui=none +" Visual mode selection when vim is "Not Owning the Selection". +hi VisualNOS guifg=#44cc44 guibg=#000000 +" warning messages +hi WarningMsg guifg=#55ff55 guibg=#000000 +" current match in 'wildmenu' completion +hi WildMenu guifg=#226622 guibg=#55ff55 + +hi Comment guifg=#226622 guibg=#000000 +hi Constant guifg=#55ff55 guibg=#226622 +hi Special guifg=#44cc44 guibg=#226622 +hi Identifier guifg=#55ff55 guibg=#000000 +hi Statement guifg=#55ff55 guibg=#000000 gui=bold +hi PreProc guifg=#339933 guibg=#000000 +hi Type guifg=#55ff55 guibg=#000000 gui=bold +hi Underlined guifg=#55ff55 guibg=#000000 gui=underline +hi Error guifg=#55ff55 guibg=#339933 +hi Todo guifg=#113311 guibg=#44cc44 gui=none diff --git a/dot_vim/colors/metacosm.vim b/dot_vim/colors/metacosm.vim new file mode 100644 index 0000000..e5eaa5f --- /dev/null +++ b/dot_vim/colors/metacosm.vim @@ -0,0 +1,132 @@ +" Vim color file +" Maintainer: Robert Melton ( vim at metacosm dot dhs dot org ) +" Last Change: 2004 June 19th + + +" ----------------------------------------------------------------------------- +" This color scheme uses a dark grey background. +" This theme, based on evening (with some input from Torte) is designed to +" seperate active text (code) from background/line numbers/folds/listchars by +" having different background colors on the non-code and the code (just +" slightly). If you look at the screenshot below, you will get the idea. +" All non-code(include indents) and string literals have a black background +" while code has a very dark grey background. +" ----------------------------------------------------------------------------- +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "metacosm" + + +" ----------------------------------------------------------------------------- +" Primary (hyper/selected/colored background) +" ----------------------------------------------------------------------------- +" Search +hi IncSearch guibg=black guifg=cyan +hi Search guibg=black guifg=cyan + +" Visual +hi Visual guibg=black guifg=yellow +hi VisualNOS guibg=black guifg=yellow gui=underline + +" Borders +hi StatusLine guibg=black guifg=white +hi StatusLineNC guibg=grey22 guifg=grey45 +hi VertSplit guibg=black guifg=grey45 + +" Cursors +hi Cursor guibg=white guifg=black +hi lCursor guibg=white guifg=black + +" Diff +hi DiffText guibg=red guifg=white gui=bold +hi DiffAdd guibg=darkblue guifg=white +hi DiffChange guibg=darkmagenta guifg=white +hi DiffDelete guibg=darkcyan guifg=blue gui=bold + +" Misc +hi Title guifg=magenta gui=bold +hi Question guibg=black guifg=green gui=bold +hi Todo guibg=black guifg=cyan +hi Error guibg=red guifg=white +hi WildMenu guibg=cyan guifg=black + + +" ----------------------------------------------------------------------------- +" Primary (active/code/text/grey background) +" ----------------------------------------------------------------------------- +" Normal +hi Normal guibg=grey22 guifg=white + +" Constants +hi Constant guibg=grey22 guifg=#ffa0a0 +hi String guibg=grey22 guifg=#ffa0a0 +hi Character guibg=grey22 guifg=#ffa0a0 +hi Number guibg=grey22 guifg=#ffa0a0 +hi Boolean guibg=grey22 guifg=#ffa0a0 +hi Float guibg=grey22 guifg=#ffa0a0 + +" Identifier +hi Identifier guibg=grey22 guifg=#40ffff +hi Function guibg=grey22 guifg=#40ffff + +" Statement +hi Statement guibg=grey22 guifg=#ffff60 +hi Conditional guibg=grey22 guifg=#ffff60 +hi Repeat guibg=grey22 guifg=#ffff60 +hi Label guibg=grey22 guifg=#ffff60 +hi Operator guibg=grey22 guifg=#ffff60 +hi Keyword guibg=grey22 guifg=#ffff60 +hi Exception guibg=grey22 guifg=#ffff60 + +" PreProc +hi PreProc guibg=grey22 guifg=#ff80ff +hi Include guibg=grey22 guifg=#ff80ff +hi Define guibg=grey22 guifg=#ff80ff +hi Macro guibg=grey22 guifg=#ff80ff +hi PreCondit guibg=grey22 guifg=#ff80ff + +" Type +hi Type guibg=grey22 guifg=#60ff60 +hi StorageClass guibg=grey22 guifg=#60ff60 +hi Structure guibg=grey22 guifg=#60ff60 +hi Typedef guibg=grey22 guifg=#60ff60 + +" Special +hi Special guibg=grey22 guifg=orange +hi SpecialChar guibg=grey22 guifg=orange +hi Tag guibg=grey22 guifg=orange +hi Delimiter guibg=grey22 guifg=orange +hi Debug guibg=grey22 guifg=orange + +" Misc +hi Underlined guibg=grey22 guifg=#ffff60 gui=underline + + +" ----------------------------------------------------------------------------- +" Secondary (inactive/black background) +" ----------------------------------------------------------------------------- +" Comments +hi Comment guibg=black guifg=#80a0ff +hi SpecialComment guibg=black guifg=#80a0ff gui=underline + +" Messages +hi ModeMsg guibg=black guifg=white gui=bold +hi MoreMsg guibg=black guifg=seagreen gui=bold +hi WarningMsg guibg=black guifg=blue gui=bold +hi ErrorMsg guibg=black guifg=red gui=bold + +" Folding +hi Folded guibg=black guifg=grey45 +hi FoldColumn guibg=black guifg=grey45 + +" Misc +hi Ignore guibg=black guifg=grey45 +hi NonText guibg=black guifg=grey45 +hi LineNr guibg=black guifg=grey45 +hi SpecialKey guibg=black guifg=grey45 +hi SignColumn guibg=black guifg=grey45 +hi Directory guibg=black guifg=cyan diff --git a/dot_vim/colors/midnight.vim b/dot_vim/colors/midnight.vim new file mode 100644 index 0000000..5fab610 --- /dev/null +++ b/dot_vim/colors/midnight.vim @@ -0,0 +1,80 @@ +" Vim color file +" Maintainer: Michael Brailsford <brailsmt@yahoo.com> +" Date: $Date: 2002/04/11 03:29:51 $ +" Version: $Revision: 1.4 $ + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +" your pick: +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="midnight" + +hi Normal guifg=lightsteelblue guibg=#00006f ctermfg=14 + +"Toggle semicolon matching at the end of lines +nmap <silent> <leader>; :call ToggleSemicolonHighlighting()<cr> +"{{{ +function! ToggleSemicolonHighlighting() + if exists("b:semicolon") + unlet b:semicolon + hi semicolon guifg=NONE gui=NONE ctermfg=NONE + else + syn match semicolon #;$# + hi semicolon guifg=red gui=bold ctermfg=1 + let b:semicolon = 1 + endif +endfunction +"}}} + +hi Cursor guifg=bg guibg=fg ctermfg=0 ctermbg=11 +"hi CursorIM +hi Directory gui=bold +hi DiffAdd guifg=yellow guibg=darkgreen ctermbg=0 +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg guibg=red ctermfg=1 +"hi VertSplit +hi Folded guibg=#000047 ctermbg=4 guifg=yellow ctermfg=11 gui=bold +hi FoldColumn guibg=steelblue3 ctermbg=14 guifg=darkblue ctermfg=11 gui=bold +"hi IncSearch +hi LineNr guifg=yellow ctermfg=11 +hi ModeMsg guifg=yellow gui=bold +"hi MoreMsg +"hi NonText +"hi Question +hi Search guibg=yellow guifg=bg +"hi SpecialKey +hi StatusLine guifg=steelblue1 +hi StatusLineNC guifg=steelblue3 +"hi Title +hi Visual guifg=fg guibg=bg +"hi VisualNOS +"hi WarningMsg +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=green ctermfg=10 +hi Constant guifg=lightmagenta gui=bold ctermfg=13 +hi String guifg=indianred1 ctermfg=5 +hi Character guifg=violet ctermfg=5 +hi Number guifg=turquoise1 ctermfg=5 +"hi Identifier +hi Statement guifg=khaki1 gui=bold ctermfg=15 cterm=underline +hi PreProc guifg=firebrick1 gui=italic ctermfg=9 +hi Type guifg=gold gui=bold ctermfg=3 +"hi Special +"hi Underlined +"hi Ignore +"hi Error +hi Todo guifg=yellow guibg=blue gui=bold diff --git a/dot_vim/colors/midnight2.vim b/dot_vim/colors/midnight2.vim new file mode 100644 index 0000000..da99d00 --- /dev/null +++ b/dot_vim/colors/midnight2.vim @@ -0,0 +1,86 @@ +" Vim color file +" Maintainer: Michael Brailsford <brailsmt@yahoo.com> +" Date: $Date: 2002/04/11 03:29:51 $ +" Version: $Revision: 1.4 $ +" Inspiration: This colorscheme was inspired by midnight.vim. It is a darker +" version of it. With some colors tweaked. +" Thanks: Thanks go to Hans Fugal for creating the colorscheme template. +" Without it I would have been lost creating the original midnight.vim +" Note: If you do not like the dark look of the colorscheme, you can +" easily lighten things up with the following line: +" :%s/\(\w\)3/\12/g +" It is easily pasteable into the command line. you can also +" change "\12" to "\11", "\1" or "\14" (if you want things even +" darker). If you do use the "\14" replacement, then it looks +" like your monitor in a fog bank. :) + +" your pick: +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="midnight2" + +hi Normal guifg=slategray3 guibg=#000029 ctermfg=14 + +"Toggle semicolon matching at the end of lines +nmap <silent> <leader>; :call ToggleSemicolonHighlighting()<cr> +"{{{ +function! ToggleSemicolonHighlighting() + if exists("b:semicolon") + unlet b:semicolon + hi semicolon guifg=NONE gui=NONE ctermfg=NONE + else + syn match semicolon #;$# + hi semicolon guifg=red3 gui=bold ctermfg=1 + let b:semicolon = 1 + endif +endfunction +"}}} + +hi Cursor guifg=bg guibg=fg ctermfg=0 ctermbg=11 +"hi CursorIM +hi Directory gui=bold +hi DiffAdd guifg=yellow3 guibg=darkgreen ctermbg=0 +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg guibg=red3 ctermfg=1 +"hi VertSplit +hi Folded guibg=#00001a ctermbg=4 guifg=yellow3 ctermfg=11 gui=NONE +hi FoldColumn guibg=steelblue3 ctermbg=14 guifg=navyblue ctermfg=11 gui=bold +"hi IncSearch +hi LineNr guifg=yellow3 ctermfg=11 +hi ModeMsg guifg=yellow3 gui=bold +"hi MoreMsg +"hi NonText +"hi Question +hi Search guibg=yellow3 guifg=bg +"hi SpecialKey +hi StatusLine guifg=steelblue3 +hi StatusLineNC guifg=steelblue4 +"hi Title +hi Visual guifg=fg guibg=bg +"hi VisualNOS +"hi WarningMsg +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=chartreuse3 ctermfg=10 +hi Constant guifg=plum3 gui=bold ctermfg=13 +hi String guifg=indianred3 ctermfg=5 +hi Character guifg=mediumpurple3 ctermfg=5 +hi Number guifg=turquoise3 ctermfg=5 +"hi Identifier +hi Statement guifg=khaki3 gui=bold ctermfg=15 cterm=underline +hi PreProc guifg=firebrick3 gui=italic ctermfg=9 +hi Type guifg=gold3 gui=bold ctermfg=3 +"hi Special +"hi Underlined +"hi Ignore +"hi Error +hi Todo guifg=yellow3 guibg=blue3 gui=bold diff --git a/dot_vim/colors/mod_tcsoft.vim b/dot_vim/colors/mod_tcsoft.vim new file mode 100644 index 0000000..b36dab2 --- /dev/null +++ b/dot_vim/colors/mod_tcsoft.vim @@ -0,0 +1,68 @@ +"mod_tcsoft is based on the tcsoft-color scheme +"(http://www.vim.org/scripts/script.php?script_id=641), made by Ingo Fabbri +"<vim@tcsoft.net> +" +"I changed the cursor and the background-colors. Hope you like it. + +" Author: André Kelpe <fs111 at web dot de> +" Last Change: Jan 13 10:33:46 CET 2005 +" + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = "mod_tcsoft" + +hi Normal guifg=#000000 guibg=floralwhite +hi Ignore guifg=bg +hi Comment guifg=#1050ff gui=italic +hi Folded guifg=black guibg=#d1cdc5 +hi FoldColumn guifg=black guibg=#d1cdc5 +hi Constant guifg=#666666 gui=NONE "grau +hi Special guifg=#FF0000 gui=NONE "rot +hi Identifier guifg=#993300 gui=NONE "rostfarbig +hi Statement guifg=#FF9900 gui=NONE "orange +hi PreProc guifg=#009900 gui=NONE "dunkelgrün +hi Type guifg=#FF9900 gui=bold "orange +hi Cursor guifg=#FFFFFF guibg=#000000 "schwarz +hi LineNr guifg=#000000 gui=NONE "schwarz +hi StatusLine guifg=#000000 gui=reverse,bold "schwarz +hi Title guifg=#1050ff gui=bold +hi Todo guibg=#1050ff guifg=floralwhite gui=bold +hi Search guifg=white guibg=#1050ff + + +hi link Function PreProc +hi link String Constant +hi link Character Constant + +hi! link MoreMsg Comment +hi! link ErrorMsg Visual +hi! link WarningMsg ErrorMsg +hi! link Question Comment + +hi link Number Special +hi link Boolean Constant +hi link Float Number + +hi link Operator Identifier +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc + +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement + +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Comment +hi link Debug Special diff --git a/dot_vim/colors/navajo-night.vim b/dot_vim/colors/navajo-night.vim new file mode 100644 index 0000000..f0c27f0 --- /dev/null +++ b/dot_vim/colors/navajo-night.vim @@ -0,0 +1,119 @@ +" Vim colour file +" Maintainer: Matthew Hawkins <matt@mh.dropbear.id.au> +" Last Change: Mon, 22 Apr 2002 15:28:04 +1000 +" URI: http://mh.dropbear.id.au/vim/navajo-night.png +" +" This colour scheme uses a "navajo-black" background +" I have added colours for the statusbar and for spell checking +" as taken from Cream (http://cream.sf.net/) + + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "navajo-night" + +" This is the list of colour changes from Navajo that +" weren't a simple mathematical subtraction from 0xffffff +" DarkBlue -> #ffff74 +" DarkRed -> #74ffff +" DarkGreen -> #ff9bff +" DarkCyan -> #ff7474 +" DarkMagenta -> #74ff74 +" DarkYellow -> #7474ff +" DarkGray -> #565656 +" Blue -> Yellow +" Red -> Cyan +" Yellow -> Blue +" Gray -> #414141 +" Brown -> #5ad5d5 +" #ff8060 -> #007f9f +" #f6e8d0 -> #09172f +" #edb5cd -> #124a32 +" #c0c0c0 -> #3f3f3f +" #907050 -> #6f8faf +" #808080 -> #7f7f7f +" #707070 -> #8f8f8f +" SeaGreen -> #d174a8 +" LightRed (assuming #ee9090) -> #116f6f +" LightBlue -> #522719 + +hi Normal ctermfg=White guifg=White guibg=#35536f + +hi SpecialKey term=bold ctermfg=darkblue guifg=Yellow +hi NonText term=bold ctermfg=darkblue cterm=bold gui=bold guifg=#7f7f7f +hi Directory term=bold ctermfg=darkblue guifg=Yellow +hi ErrorMsg term=standout ctermfg=grey ctermbg=darkred cterm=bold gui=bold guifg=Black guibg=Cyan +hi IncSearch term=reverse cterm=reverse gui=reverse +hi Search term=reverse ctermbg=White ctermfg=Black cterm=reverse guibg=Black guifg=Yellow +hi MoreMsg term=bold ctermfg=green gui=bold guifg=#d174a8 +hi ModeMsg term=bold cterm=bold gui=bold +hi LineNr term=underline ctermfg=darkcyan ctermbg=grey guibg=#7f7f7f gui=bold guifg=White +hi Question term=standout ctermfg=darkgreen gui=bold guifg=#d174a8 +hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold guifg=Black guibg=White +hi StatusLineNC term=reverse cterm=reverse gui=bold guifg=#116f6f guibg=#8f8f8f +hi VertSplit term=reverse cterm=reverse gui=bold guifg=Black guibg=#8f8f8f +hi Title term=bold ctermfg=green gui=bold guifg=#74ff74 +"+++ Cream: +"hi Visual term=reverse cterm=reverse gui=reverse guifg=#3f3f3f guibg=White +"+++ +hi VisualNOS term=bold,underline cterm=bold,underline gui=reverse guifg=#414141 guibg=Black +hi WarningMsg term=standout ctermfg=darkred gui=bold guifg=Cyan +hi WildMenu term=standout ctermfg=White ctermbg=darkyellow guifg=White guibg=Blue +hi Folded term=standout ctermfg=darkblue ctermbg=grey guifg=White guibg=NONE guifg=#afcfef +hi FoldColumn term=standout ctermfg=darkblue ctermbg=grey guifg=#ffff74 guibg=#3f3f3f +hi DiffAdd term=bold ctermbg=darkblue guibg=Black +hi DiffChange term=bold ctermbg=darkmagenta guibg=#124a32 +hi DiffDelete term=bold ctermfg=darkblue ctermbg=blue cterm=bold gui=bold guifg=#522719 guibg=#09172f +hi DiffText term=reverse ctermbg=darkblue cterm=bold gui=bold guibg=#007f9f +hi Cursor gui=reverse guifg=#bfbfef guibg=Black +hi lCursor guifg=fg guibg=bg +hi Match term=bold,reverse ctermbg=Blue ctermfg=Yellow cterm=bold,reverse gui=bold,reverse guifg=Blue guibg=Yellow + + +" Colours for syntax highlighting +hi Comment term=bold ctermfg=darkblue guifg=#e7e77f +hi Constant term=underline ctermfg=darkred guifg=#3fffa7 +hi Special term=bold ctermfg=darkgreen guifg=#bfbfef +hi Identifier term=underline ctermfg=darkcyan cterm=NONE guifg=#ef9f9f +hi Statement term=bold ctermfg=darkred cterm=bold gui=bold guifg=#5ad5d5 +hi PreProc term=underline ctermfg=darkmagenta guifg=#74ff74 +hi Type term=underline ctermfg=green gui=bold guifg=#d174a8 +hi Ignore ctermfg=grey cterm=bold guifg=bg + +hi Error term=reverse ctermfg=grey ctermbg=darkred cterm=bold gui=bold guifg=Black guibg=Cyan +hi Todo term=standout ctermfg=darkblue ctermbg=Blue guifg=Yellow guibg=Blue + +"+++ Cream: statusbar +" Colours for statusbar +"hi User1 gui=bold guifg=#565656 guibg=#0c0c0c +"hi User2 gui=bold guifg=White guibg=#0c0c0c +"hi User3 gui=bold guifg=Yellow guibg=#0c0c0c +"hi User4 gui=bold guifg=Cyan guibg=#0c0c0c +highlight User1 gui=bold guifg=#999933 guibg=#45637f +highlight User2 gui=bold guifg=#e7e77f guibg=#45637f +highlight User3 gui=bold guifg=Black guibg=#45637f +highlight User4 gui=bold guifg=#33cc99 guibg=#45637f +"+++ + +"+++ Cream: selection +highlight Visual gui=bold guifg=Black guibg=#aacc77 +"+++ + +"+++ Cream: bookmarks +highlight Cream_ShowMarksHL ctermfg=blue ctermbg=lightblue cterm=bold guifg=Black guibg=#aacc77 gui=bold +"+++ + +"+++ Cream: spell check +" Colour misspelt words +"hi BadWord ctermfg=White ctermbg=darkred cterm=bold guifg=Yellow guibg=#522719 gui=bold +" mathematically correct: +"highlight BadWord ctermfg=black ctermbg=lightblue gui=NONE guifg=White guibg=#003333 +" adjusted: +highlight BadWord ctermfg=black ctermbg=lightblue gui=NONE guifg=#ff9999 guibg=#003333 +"+++ + + diff --git a/dot_vim/colors/navajo.vim b/dot_vim/colors/navajo.vim new file mode 100644 index 0000000..e7eebe7 --- /dev/null +++ b/dot_vim/colors/navajo.vim @@ -0,0 +1,65 @@ +" Vim color file +" Maintainer: R. Edward Ralston <eralston@techsan.org> +" Last Change: 2002-01-24 09:56:48 +" URI: http://eralston.tripod.com/navajo.png +" +" This color scheme uses a "navajo-white" background +" + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "navajo" + +" looks good on Linux +"hi Normal ctermfg=Black guifg=Black guibg=#b39674 +"hi Normal ctermfg=Black guifg=Black guibg=NavajoWhite3 + +" slightly brighter for w32 +hi Normal ctermfg=Black guifg=Black guibg=#ba9c80 + +hi SpecialKey term=bold ctermfg=DarkBlue guifg=Blue +hi NonText term=bold ctermfg=DarkBlue cterm=bold gui=bold guifg=#808080 +hi Directory term=bold ctermfg=DarkBlue guifg=Blue +hi ErrorMsg term=standout ctermfg=Gray ctermbg=DarkRed cterm=bold gui=bold guifg=White guibg=Red +hi IncSearch term=reverse cterm=reverse gui=reverse +hi Search term=reverse ctermbg=Black ctermfg=White cterm=reverse guibg=White +hi MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen +hi ModeMsg term=bold cterm=bold gui=bold +hi LineNr term=underline ctermfg=DarkCyan ctermbg=Gray guibg=#808080 gui=bold guifg=black +hi Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen +hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold guifg=White guibg=Black +hi StatusLineNC term=reverse cterm=reverse gui=bold guifg=LightRed guibg=#707070 +hi VertSplit term=reverse cterm=reverse gui=bold guifg=White guibg=#707070 +hi Title term=bold ctermfg=DarkMagenta gui=bold guifg=DarkMagenta +hi Visual term=reverse cterm=reverse gui=reverse guifg=#c0c0c0 guibg=black +hi VisualNOS term=bold,underline cterm=bold,underline gui=reverse guifg=Grey guibg=white +hi WarningMsg term=standout ctermfg=DarkRed gui=bold guifg=Red +hi WildMenu term=standout ctermfg=Black ctermbg=DarkYellow guifg=Black guibg=Yellow +hi Folded term=standout ctermfg=DarkBlue ctermbg=Gray guifg=Black guibg=NONE guifg=#907050 +hi FoldColumn term=standout ctermfg=DarkBlue ctermbg=Gray guifg=DarkBlue guibg=#c0c0c0 +hi DiffAdd term=bold ctermbg=DarkBlue guibg=White +hi DiffChange term=bold ctermbg=DarkMagenta guibg=#edb5cd +hi DiffDelete term=bold ctermfg=DarkBlue ctermbg=6 cterm=bold gui=bold guifg=LightBlue guibg=#f6e8d0 +hi DiffText term=reverse ctermbg=DarkRed cterm=bold gui=bold guibg=#ff8060 +hi Cursor gui=reverse guifg=#404010 guibg=white +hi lCursor guifg=bg guibg=fg +hi Match term=bold,reverse ctermbg=Yellow ctermfg=Blue cterm=bold,reverse gui=bold,reverse guifg=yellow guibg=blue + + +" Colors for syntax highlighting +hi Comment term=bold ctermfg=DarkBlue guifg=#181880 +hi Constant term=underline ctermfg=DarkRed guifg=#c00058 +hi Special term=bold ctermfg=DarkMagenta guifg=#404010 +hi Identifier term=underline ctermfg=DarkCyan cterm=NONE guifg=#106060 +hi Statement term=bold ctermfg=DarkRed cterm=bold gui=bold guifg=Brown +hi PreProc term=underline ctermfg=DarkMagenta guifg=DarkMagenta +hi Type term=underline ctermfg=DarkGreen gui=bold guifg=SeaGreen +hi Ignore ctermfg=Gray cterm=bold guifg=bg +hi Error term=reverse ctermfg=Gray ctermbg=DarkRed cterm=bold gui=bold guifg=White guibg=Red +hi Todo term=standout ctermfg=DarkBlue ctermbg=Yellow guifg=Blue guibg=Yellow + +" vim:set list et: diff --git a/dot_vim/colors/nedit.vim b/dot_vim/colors/nedit.vim new file mode 100644 index 0000000..652891f --- /dev/null +++ b/dot_vim/colors/nedit.vim @@ -0,0 +1,26 @@ +" Vim color file +" Maintainer: Vladimir Vrzic <random@bsd.org.yu> +" Last Change: 28. june 2003. +" URL: http://galeb.etf.bg.ac.yu/~random/pub/vim/ + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="nedit" + +hi Normal guifg=Black guibg=grey90 + +hi Comment gui=italic guifg=gray20 guibg=NONE +hi Constant gui=NONE guifg=darkGreen guibg=NONE +hi Identifier gui=bold guifg=red guibg=NONE +hi Statement gui=bold guifg=black guibg=NONE +hi PreProc gui=NONE guifg=RoyalBlue4 guibg=NONE +hi Type gui=bold guifg=brown guibg=NONE +hi Special gui=NONE guifg=darkGreen guibg=NONE +"hi Underlined +"hi Ignore +"hi Error +"hi Todo + diff --git a/dot_vim/colors/nedit2.vim b/dot_vim/colors/nedit2.vim new file mode 100644 index 0000000..54811f0 --- /dev/null +++ b/dot_vim/colors/nedit2.vim @@ -0,0 +1,29 @@ +" Vim color file based on nedit by Vladimir Vrzic <random@bsd.org.yu> +" Maintainer: KraL <kral@paranoici.org> +" Last Change: Friday 13 february 2004. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="nedit2" + +hi Normal guifg=Black guibg=grey90 + +hi Cursor guifg=white guibg=black +hi CursorIM guifg=black guibg=black + +hi Comment gui=italic guifg=Purple guibg=NONE +hi Constant gui=NONE guifg=blue guibg=NONE +hi Identifier gui=bold guifg=red guibg=NONE +hi Statement gui=bold guifg=black guibg=NONE +hi PreProc gui=NONE guifg=RoyalBlue4 guibg=NONE +hi Type gui=bold guifg=brown guibg=NONE +hi String gui=NONE guifg=RoyalBlue guibg=NONE +hi Special gui=bold guifg=Magenta3 guibg=NONE +"hi Underlined +"hi Ignore +"hi Error gui=NONE guifg=Red guibg=Linen +"hi Todo + diff --git a/dot_vim/colors/neon.vim b/dot_vim/colors/neon.vim new file mode 100644 index 0000000..d0ba309 --- /dev/null +++ b/dot_vim/colors/neon.vim @@ -0,0 +1,70 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/25 Fri 16:23. +" version: 1.2 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "neon" + +hi Normal guifg=#f0f0f0 guibg=#303030 + +" Search +hi IncSearch gui=UNDERLINE guifg=#80ffff guibg=#0060c0 +hi Search gui=NONE guifg=#ffffa8 guibg=#808000 +" hi Search gui=NONE guifg=#b0ffb0 guibg=#008000 + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffa0ff guibg=NONE +hi WarningMsg gui=BOLD guifg=#ffa0ff guibg=NONE +hi ModeMsg gui=BOLD guifg=#a0d0ff guibg=NONE +hi MoreMsg gui=BOLD guifg=#70ffc0 guibg=#8040ff +hi Question gui=BOLD guifg=#e8e800 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#c4c4c4 +hi StatusLineNC gui=NONE guifg=#707070 guibg=#c4c4c4 +hi VertSplit gui=NONE guifg=#707070 guibg=#c4c4c4 +hi WildMenu gui=NONE guifg=#000000 guibg=#ff80c0 + +" Diff +hi DiffText gui=NONE guifg=#ff78f0 guibg=#a02860 +hi DiffChange gui=NONE guifg=#e03870 guibg=#601830 +hi DiffDelete gui=NONE guifg=#a0d0ff guibg=#0020a0 +hi DiffAdd gui=NONE guifg=#a0d0ff guibg=#0020a0 + +" Cursor +hi Cursor gui=NONE guifg=#70ffc0 guibg=#8040ff +hi lCursor gui=NONE guifg=#ffffff guibg=#8800ff +hi CursorIM gui=NONE guifg=#ffffff guibg=#8800ff + +" Fold +hi Folded gui=NONE guifg=#40f0f0 guibg=#006090 +hi FoldColumn gui=NONE guifg=#40c0ff guibg=#404040 + +" Other +hi Directory gui=NONE guifg=#c8c8ff guibg=NONE +hi LineNr gui=NONE guifg=#707070 guibg=NONE +hi NonText gui=BOLD guifg=#d84070 guibg=#383838 +hi SpecialKey gui=BOLD guifg=#8888ff guibg=NONE +hi Title gui=BOLD guifg=fg guibg=NONE +hi Visual gui=NONE guifg=#b0ffb0 guibg=#008000 +hi VisualNOS gui=NONE guifg=#ffe8c8 guibg=#c06800 + +" Syntax group +hi Comment gui=NONE guifg=#c0c0c0 guibg=NONE +hi Constant gui=NONE guifg=#92d4ff guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#8000ff +hi Identifier gui=NONE guifg=#40f8f8 guibg=NONE +hi Ignore gui=NONE guifg=bg guibg=NONE +hi PreProc gui=NONE guifg=#ffa8ff guibg=NONE +hi Special gui=NONE guifg=#ffc890 guibg=NONE +hi Statement gui=NONE guifg=#dcdc78 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#ff80d0 guibg=NONE +hi Type gui=NONE guifg=#60f0a8 guibg=NONE +hi Underlined gui=UNDERLINE guifg=fg guibg=NONE diff --git a/dot_vim/colors/night.vim b/dot_vim/colors/night.vim new file mode 100644 index 0000000..8fb7f56 --- /dev/null +++ b/dot_vim/colors/night.vim @@ -0,0 +1,70 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/13 Sun 16:59. +" version: 2.2 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "night" + +hi Normal guifg=#f0f0f8 guibg=#303040 + +" Search +hi IncSearch gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=#d000d0 +hi Search gui=BOLD guifg=#ffd0ff guibg=#c000c0 + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#f00080 +hi WarningMsg gui=BOLD guifg=#ffffff guibg=#f00080 +hi ModeMsg gui=BOLD guifg=#00e0ff guibg=NONE +hi MoreMsg gui=BOLD guifg=#00ffdd guibg=NONE +hi Question gui=BOLD guifg=#d0d050 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#c8c8d8 +hi StatusLineNC gui=NONE guifg=#606080 guibg=#c8c8d8 +hi VertSplit gui=NONE guifg=#606080 guibg=#c8c8d8 +hi WildMenu gui=NONE guifg=#000000 guibg=#e0e078 + +" Diff +hi DiffText gui=NONE guifg=#ffffff guibg=#40a060 +hi DiffChange gui=NONE guifg=#ffffff guibg=#007070 +hi DiffDelete gui=NONE guifg=#ffffff guibg=#40a0c0 +hi DiffAdd gui=NONE guifg=#ffffff guibg=#40a0c0 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#d86020 +hi lCursor gui=NONE guifg=#ffffff guibg=#e000b0 +hi CursorIM gui=NONE guifg=#ffffff guibg=#e000b0 + +" Fold +hi Folded gui=NONE guifg=#ffffff guibg=#9060c0 +hi FoldColumn gui=NONE guifg=#c0a0ff guibg=#404052 + +" Other +hi Directory gui=NONE guifg=#00ffff guibg=NONE +hi LineNr gui=NONE guifg=#787894 guibg=NONE +hi NonText gui=BOLD guifg=#8040ff guibg=#383848 +hi SpecialKey gui=BOLD guifg=#60a0ff guibg=NONE +hi Title gui=BOLD guifg=#f0f0f8 guibg=#9000a0 +hi Visual gui=NONE guifg=#ffffff guibg=#c08040 +" hi VisualNOS gui=NONE guifg=#ffffff guibg=#c08040 + +" Syntax group +hi Comment gui=NONE guifg=#e0e070 guibg=NONE +hi Constant gui=NONE guifg=#f0f0f8 guibg=#4830a0 +hi Error gui=BOLD guifg=#ffffff guibg=#f00080 +hi Identifier gui=NONE guifg=#ffa0ff guibg=NONE +hi Ignore gui=NONE guifg=#303040 guibg=NONE +hi Number gui=BOLD guifg=#b8b8c8 guibg=NONE +hi PreProc gui=NONE guifg=#40ffa0 guibg=NONE +hi Special gui=NONE guifg=#40f8f8 guibg=#4830a0 +hi Statement gui=BOLD guifg=#00d8f8 guibg=NONE +hi Todo gui=BOLD guifg=#00ffe0 guibg=#0080a0 +hi Type gui=BOLD guifg=#bbaaff guibg=NONE +hi Underlined gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=NONE diff --git a/dot_vim/colors/nightshimmer.vim b/dot_vim/colors/nightshimmer.vim new file mode 100644 index 0000000..53dce84 --- /dev/null +++ b/dot_vim/colors/nightshimmer.vim @@ -0,0 +1,111 @@ +" Vim color file +" Maintainer: Niklas Lindström <nlm@valtech.se> +" Last Change: 2002-03-22 +" Version: 0.3 +" URI: http://localhost/ + + +""" Init +set background=dark +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "nightshimmer" + + +""""""""\ Colors \"""""""" + + +"""" GUI Colors + +highlight Cursor gui=None guibg=Green guifg=White +highlight CursorIM gui=bold guifg=white guibg=Green1 +highlight Directory guifg=LightSeaGreen guibg=bg +highlight DiffAdd gui=None guifg=fg guibg=DarkCyan +highlight DiffChange gui=None guifg=fg guibg=Green4 +highlight DiffDelete gui=None guifg=fg guibg=black +highlight DiffText gui=bold guifg=fg guibg=bg +highlight ErrorMsg guifg=LightYellow guibg=FireBrick +" previously 'FillColumn': +"highlight FillColumn gui=NONE guifg=black guibg=grey60 +highlight VertSplit gui=NONE guifg=black guibg=grey60 +highlight Folded gui=bold guibg=#305060 guifg=#b0d0e0 +highlight FoldColumn gui=bold guibg=#305060 guifg=#b0d0e0 +highlight IncSearch gui=reverse guifg=fg guibg=bg +highlight LineNr gui=bold guibg=grey6 guifg=Purple3 +highlight ModeMsg guibg=DarkGreen guifg=LightGreen +highlight MoreMsg gui=bold guifg=SeaGreen4 guibg=bg +if version < 600 + " same as SpecialKey + highlight NonText guibg=#123A4A guifg=#3D5D6D +else + " Bottom fill (use e.g. same as LineNr) + highlight NonText gui=None guibg=grey6 guifg=Purple +endif +highlight Normal gui=None guibg=#103040 guifg=honeydew2 +highlight Question gui=bold guifg=SeaGreen2 guibg=bg +highlight Search gui=NONE guibg=Purple4 guifg=NONE +highlight SpecialKey guibg=#123A4A guifg=#426272 +highlight StatusLine gui=bold guibg=grey88 guifg=black +highlight StatusLineNC gui=NONE guibg=grey60 guifg=grey10 +highlight Title gui=bold guifg=MediumOrchid1 guibg=bg +highlight Visual gui=reverse guibg=WHITE guifg=SeaGreen +highlight VisualNOS gui=bold,underline guifg=fg guibg=bg +highlight WarningMsg gui=bold guifg=FireBrick1 guibg=bg +highlight WildMenu gui=bold guibg=Chartreuse guifg=Black + + +"""" Syntax Colors + +highlight Comment gui=reverse guifg=#507080 +"highlight Comment gui=None guifg=#507080 + +highlight Constant guifg=Cyan guibg=bg + "hi String gui=None guifg=Cyan guibg=bg + "hi Character gui=None guifg=Cyan guibg=bg + highlight Number gui=None guifg=Cyan guibg=bg + highlight Boolean gui=bold guifg=Cyan guibg=bg + "hi Float gui=None guifg=Cyan guibg=bg + +highlight Identifier guifg=orchid1 + "hi Function gui=None guifg=orchid1 guibg=bg + +highlight Statement gui=NONE guifg=LightGreen + highlight Conditional gui=None guifg=LightGreen guibg=bg + highlight Repeat gui=None guifg=SeaGreen2 guibg=bg + "hi Label gui=None guifg=LightGreen guibg=bg + highlight Operator gui=None guifg=Chartreuse guibg=bg + highlight Keyword gui=bold guifg=LightGreen guibg=bg + highlight Exception gui=bold guifg=LightGreen guibg=bg + +highlight PreProc guifg=MediumPurple1 + "hi Include gui=None guifg=MediumPurple1 guibg=bg + "hi Define gui=None guifg=MediumPurple1g guibg=bg + "hi Macro gui=None guifg=MediumPurple1g guibg=bg + "hi PreCondit gui=None guifg=MediumPurple1g guibg=bg + +highlight Type gui=NONE guifg=LightBlue + "hi StorageClass gui=None guifg=LightBlue guibg=bg + "hi Structure gui=None guifg=LightBlue guibg=bg + "hi Typedef gui=None guifg=LightBlue guibg=bg + +highlight Special gui=bold guifg=White + "hi SpecialChar gui=bold guifg=White guibg=bg + "hi Tag gui=bold guifg=White guibg=bg + "hi Delimiter gui=bold guifg=White guibg=bg + "hi SpecialComment gui=bold guifg=White guibg=bg + "hi Debug gui=bold guifg=White guibg=bg + +highlight Underlined gui=underline guifg=honeydew4 guibg=bg + +highlight Ignore guifg=#204050 + +highlight Error guifg=LightYellow guibg=FireBrick + +highlight Todo guifg=Cyan guibg=#507080 + +""" OLD COLORS + + + diff --git a/dot_vim/colors/nightwish.vim b/dot_vim/colors/nightwish.vim new file mode 100644 index 0000000..e9bfe55 --- /dev/null +++ b/dot_vim/colors/nightwish.vim @@ -0,0 +1,59 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file, derived from colorscheme 'murphy' +" Maintainer: Michael Muhler <muhler AT web.de> +" Version: 1.0 +" URL: http://home.arcor.de/muhler +" Last Change: 2003 Apr 15 + +"help see colortest.vim + +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "nightwish" + + +hi Comment term=bold ctermfg=LightRed guifg=Orange +hi Constant term=underline ctermfg=LightGreen guifg=White gui=NONE +hi Directory term=bold ctermfg=LightCyan guifg=Cyan +hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White +hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White +hi Identifier term=underline ctermfg=LightCyan guifg=#00ffff +hi Ignore ctermfg=black guifg=bg +hi IncSearch term=reverse cterm=reverse gui=reverse +hi LineNr term=underline ctermfg=Yellow guifg=Yellow +hi ModeMsg term=bold cterm=bold gui=bold +hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen +hi NonText term=bold ctermfg=Blue gui=bold guifg=Blue +hi PreProc term=underline ctermfg=LightBlue guifg=Wheat +hi Question term=standout ctermfg=LightGreen gui=bold guifg=Cyan +hi Search term=reverse guifg=white guibg=Blue +hi Special term=bold ctermfg=LightRed guifg=magenta +hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan +hi Statement term=bold ctermfg=Yellow guifg=#ffff00 gui=NONE +hi StatusLine term=reverse,bold cterm=reverse gui=NONE guifg=White guibg=darkblue +hi StatusLineNC term=reverse cterm=reverse gui=NONE guifg=white guibg=#333333 +hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Pink +hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow +hi Type ctermfg=LightGreen guifg=grey gui=none +hi Visual term=reverse cterm=reverse gui=NONE guifg=white guibg=darkgreen +hi WarningMsg term=standout ctermfg=LightRed guifg=Red + +hi Normal ctermbg=Black ctermfg=lightgreen guibg=Black guifg=#a0a0ff +hi Cursor guifg=bg guibg=Green +hi String term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0 +hi Repeat term=underline ctermfg=Magenta guifg=Red +hi Delimiter term=standout ctermfg=Blue guifg=#00ff88 +hi Label term=standout ctermfg=DarkYellow guifg=DarkYellow +hi Keyword term=standout ctermfg=Green guifg=Green +hi Operator term=standout ctermfg=Yellow guifg=#ff5555 +hi Exception term=standout ctermfg=Magenta guifg=#ff0dd5 +hi Tag term=standout ctermfg=Green guifg=#55ff0d + +" missing items in murphy +hi Scrollbar guifg=darkcyan guibg=cyan +hi Menu guifg=black guibg=cyan +hi link Conditional Repeat diff --git a/dot_vim/colors/northsky.vim b/dot_vim/colors/northsky.vim new file mode 100644 index 0000000..e705ae4 --- /dev/null +++ b/dot_vim/colors/northsky.vim @@ -0,0 +1,70 @@ +" Vim color file based on bluegreen +" Maintainer: Sergey Khorev +" Last Change: +" URL: + + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="northsky" + +hi Normal guifg=white guibg=#061A3E + +" Search +"hi Search guibg=#A28D68 guifg=bg gui=none +"hi Search guibg=#4668A1 guifg=bg gui=none +hi Search guibg=#3D5B8C guifg=yellow gui=none +hi IncSearch guifg=bg guibg=cyan gui=bold + +" highlight groups +hi Cursor guibg=#D74141 guifg=#e3e3e3 +hi VertSplit guibg=#C0FFFF guifg=#075554 gui=none +hi Folded guifg=plum1 guibg=#061A3E +hi FoldColumn guibg=#800080 guifg=tan +hi ModeMsg guifg=#404040 guibg=#C0C0C0 +hi MoreMsg guifg=darkturquoise guibg=#188F90 +hi NonText guibg=#334C75 guifg=#9FADC5 +hi Question guifg=#F4BB7E + +hi SpecialKey guifg=#BF9261 +hi StatusLine guibg=#067C7B guifg=cyan gui=none +hi StatusLineNC guibg=#004443 guifg=DimGrey gui=none +hi Title guifg=#8DB8C3 +"hi Visual gui=bold guifg=black guibg=#C0FFC0 +hi Visual gui=bold guifg=black guibg=#84AF84 +hi WarningMsg guifg=#F60000 gui=underline + +" syntax highlighting groups +hi Comment guifg=DarkGray +hi Constant guifg=#72A5E4 gui=bold +hi Number guifg=chartreuse2 gui=bold +hi Identifier guifg=#ADCBF1 +hi Statement guifg=yellow +hi PreProc guifg=#14967C +hi Type guifg=#FFAE66 +hi Special guifg=#EEBABA +hi Ignore guifg=grey60 +hi Todo guibg=#9C8C84 guifg=#244C0A +hi Label guifg=#ffc0c0 + +" Vim defaults +hi ErrorMsg guifg=White guibg=Red +hi DiffAdd guibg=DarkBlue +hi DiffChange guibg=aquamarine4 +hi DiffDelete gui=bold guifg=Yellow guibg=DarkBlue +hi DiffText gui=bold guibg=firebrick3 +hi Directory guifg=Cyan +hi LineNr guifg=DarkGreen +hi WildMenu guifg=Black guibg=Yellow +" hi lCursor guifg=bg guibg=fg +hi lCursor guibg=SeaGreen1 guifg=NONE +hi Underlined gui=underline guifg=#80a0ff +hi Error guifg=White guibg=Red diff --git a/dot_vim/colors/nuvola.vim b/dot_vim/colors/nuvola.vim new file mode 100644 index 0000000..f9a608a --- /dev/null +++ b/dot_vim/colors/nuvola.vim @@ -0,0 +1,107 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Dr. J. Pfefferl <johann.pfefferl@agfa.com> +" Source: $Source: /MISC/projects/cvsroot/user/pfefferl/vim/colors/nuvola.vim,v $ +" Id: $Id: nuvola.vim,v 1.14 2003/08/11 14:03:28 pfefferl Exp $ +" Last Change: $Date: 2003/08/11 14:03:28 $ + +" Intro {{{1 +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "nuvola" + +" Normal {{{1 +hi Normal ctermfg=black ctermbg=NONE guifg=black guibg=#F9F5F9 + +" Search {{{1 +hi IncSearch cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=UNDERLINE guifg=Black guibg=#FFE568 +hi Search term=reverse cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=NONE guifg=Black guibg=#FFE568 + +" Messages {{{1 +hi ErrorMsg gui=BOLD guifg=#EB1513 guibg=NONE +hi! link WarningMsg ErrorMsg +hi ModeMsg gui=BOLD guifg=#0070ff guibg=NONE +hi MoreMsg guibg=NONE guifg=seagreen +hi! link Question MoreMsg + +" Split area {{{1 +hi StatusLine term=BOLD,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=BOLD guibg=#56A0EE guifg=white +hi StatusLineNC gui=NONE guibg=#56A0EE guifg=#E9E9F4 +hi! link VertSplit StatusLineNC +hi WildMenu gui=UNDERLINE guifg=#56A0EE guibg=#E9E9F4 + +" Diff {{{1 +hi DiffText gui=NONE guifg=#f83010 guibg=#ffeae0 +hi DiffChange gui=NONE guifg=#006800 guibg=#d0ffd0 +hi DiffDelete gui=NONE guifg=#2020ff guibg=#c8f2ea +hi! link DiffAdd DiffDelete + +" Cursor {{{1 +hi Cursor gui=none guifg=black guibg=orange +"hi lCursor gui=NONE guifg=#f8f8f8 guibg=#8000ff +hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#8000ff + +" Fold {{{1 +hi Folded gui=NONE guibg=#B5EEB5 guifg=black +"hi FoldColumn gui=NONE guibg=#9FD29F guifg=black +hi! link FoldColumn Folded + +" Other {{{1 +hi Directory gui=NONE guifg=#0000ff guibg=NONE +hi LineNr gui=NONE guifg=#8080a0 guibg=NONE +hi NonText gui=BOLD guifg=#4000ff guibg=#EFEFF7 +"hi SpecialKey gui=NONE guifg=#A35B00 guibg=NONE +hi Title gui=BOLD guifg=#1014AD guibg=NONE +hi Visual term=reverse ctermfg=yellow ctermbg=black gui=NONE guifg=Black guibg=#BDDFFF +hi VisualNOS term=reverse ctermfg=yellow ctermbg=black gui=UNDERLINE guifg=Black guibg=#BDDFFF + +" Syntax group {{{1 +hi Comment term=BOLD ctermfg=darkgray guifg=#3F6B5B +hi Constant term=UNDERLINE ctermfg=red guifg=#B91F49 +hi Error term=REVERSE ctermfg=15 ctermbg=9 guibg=Red guifg=White +hi Identifier term=UNDERLINE ctermfg=Blue guifg=Blue +hi Number term=UNDERLINE ctermfg=red gui=NONE guifg=#00C226 +hi PreProc term=UNDERLINE ctermfg=darkblue guifg=#1071CE +hi Special term=BOLD ctermfg=darkmagenta guifg=red2 +hi Statement term=BOLD ctermfg=DarkRed gui=NONE guifg=#F06F00 +hi Tag term=BOLD ctermfg=DarkGreen guifg=DarkGreen +hi Todo term=STANDOUT ctermbg=Yellow ctermfg=blue guifg=Blue guibg=Yellow +hi Type term=UNDERLINE ctermfg=Blue gui=NONE guifg=Blue +hi! link String Constant +hi! link Character Constant +hi! link Boolean Constant +hi! link Float Number +hi! link Function Identifier +hi! link Conditional Statement +hi! link Repeat Statement +hi! link Label Statemengreen +hi! link Operator Statement +hi! link Keyword Statement +hi! link Exception Statement +hi! link Include PreProc +hi! link Define PreProc +hi! link Macro PreProc +hi! link PreCondit PreProc +hi! link StorageClass Type +hi! link Structure Type +hi! link Typedef Type +hi! link SpecialChar Special +hi! link Delimiter Special +hi! link SpecialComment Special +hi! link Debug Special + +" HTML {{{1 +hi htmlLink gui=UNDERLINE guifg=#0000ff guibg=NONE +hi htmlBold gui=BOLD +hi htmlBoldItalic gui=BOLD,ITALIC +hi htmlBoldUnderline gui=BOLD,UNDERLINE +hi htmlBoldUnderlineItalic gui=BOLD,UNDERLINE,ITALIC +hi htmlItalic gui=ITALIC +hi htmlUnderline gui=UNDERLINE +hi htmlUnderlineItalic gui=UNDERLINE,ITALIC + +" vim600:foldmethod=marker diff --git a/dot_vim/colors/oceanblack.vim b/dot_vim/colors/oceanblack.vim new file mode 100644 index 0000000..e6e6be3 --- /dev/null +++ b/dot_vim/colors/oceanblack.vim @@ -0,0 +1,115 @@ +" Vim color file +" Maintainer: Chris Vertonghen <chris@vertonghen.org> +" Last Change: 2003-03-25 +" Version: 0.1 +" based on Tom Regner's oceanblue.vim + +""" Init +set background=dark +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "oceanblack" + + +""""""""\ Colors \"""""""" + + +"""" GUI Colors + +highlight Cursor gui=None guibg=PaleTurquoise3 guifg=White +highlight CursorIM gui=bold guifg=white guibg=PaleTurquoise3 +highlight Directory guifg=LightSeaGreen guibg=bg +highlight DiffAdd gui=None guifg=fg guibg=DarkCyan +highlight DiffChange gui=None guifg=fg guibg=Green4 +highlight DiffDelete gui=None guifg=fg guibg=black +highlight DiffText gui=bold guifg=fg guibg=bg +highlight ErrorMsg guifg=LightYellow guibg=FireBrick +" previously 'FillColumn': +"highlight FillColumn gui=NONE guifg=black guibg=grey60 +highlight VertSplit gui=NONE guifg=black guibg=grey60 +highlight Folded gui=bold guibg=#305060 guifg=#b0d0e0 +highlight FoldColumn gui=None guibg=#305060 guifg=#b0d0e0 +highlight IncSearch gui=reverse guifg=fg guibg=bg +"highlight LineNr guibg=grey6 guifg=LightSkyBlue3 +highlight LineNr guibg=grey6 guifg=#777777 +highlight ModeMsg guibg=DarkGreen guifg=LightGreen +highlight MoreMsg gui=bold guifg=SeaGreen4 guibg=bg +if version < 600 + " same as SpecialKey + highlight NonText guibg=#123A4A guifg=#3D5D6D +else + " Bottom fill (use e.g. same as LineNr) + highlight NonText gui=None guibg=#000000 guifg=LightSkyBlue +endif +highlight Normal gui=None guibg=#000000 guifg=honeydew2 +highlight Question gui=bold guifg=SeaGreen2 guibg=bg +highlight Search gui=NONE guibg=LightSkyBlue4 guifg=NONE +highlight SpecialKey guibg=#103040 guifg=#324262 +highlight StatusLine gui=bold guibg=grey88 guifg=black +highlight StatusLineNC gui=NONE guibg=grey60 guifg=grey10 +highlight Title gui=bold guifg=MediumOrchid1 guibg=bg +highlight Visual gui=reverse guibg=WHITE guifg=SeaGreen +highlight VisualNOS gui=bold,underline guifg=fg guibg=bg +highlight WarningMsg gui=bold guifg=FireBrick1 guibg=bg +highlight WildMenu gui=bold guibg=Chartreuse guifg=Black + + +"""" Syntax Colors + +"highlight Comment gui=reverse guifg=#507080 +"highlight Comment gui=None guifg=#507080 +highlight Comment gui=None guifg=#7C7268 + +highlight Constant guifg=cyan3 guibg=bg +"hi String gui=None guifg=turquoise2 guibg=bg +hi String gui=None guifg=#80a0ff guibg=bg + "hi Character gui=None guifg=Cyan guibg=bg + "highlight Number gui=None guifg=Cyan guibg=bg + highlight Number gui=None guifg=Cyan guibg=black + highlight Boolean gui=bold guifg=Cyan guibg=bg + "hi Float gui=None guifg=Cyan guibg=bg + +highlight Identifier guifg=LightSkyBlue3 +hi Function gui=None guifg=DarkSeaGreen3 guibg=bg + +highlight Statement gui=NONE guifg=LightGreen + highlight Conditional gui=None guifg=LightGreen guibg=bg + highlight Repeat gui=None guifg=SeaGreen2 guibg=bg + "hi Label gui=None guifg=LightGreen guibg=bg + highlight Operator gui=None guifg=Chartreuse guibg=bg + highlight Keyword gui=None guifg=LightGreen guibg=bg + highlight Exception gui=None guifg=LightGreen guibg=bg + +highlight PreProc guifg=SkyBlue1 +hi Include gui=None guifg=LightSteelBlue3 guibg=bg +hi Define gui=None guifg=LightSteelBlue2 guibg=bg +hi Macro gui=None guifg=LightSkyBlue3 guibg=bg +hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg + +highlight Type gui=NONE guifg=LightBlue +hi StorageClass gui=None guifg=LightBlue guibg=bg +hi Structure gui=None guifg=LightBlue guibg=bg +hi Typedef gui=None guifg=LightBlue guibg=bg + +"highlight Special gui=bold guifg=aquamarine3 +highlight Special guifg=#999999 + "hi SpecialChar gui=bold guifg=White guibg=bg + "hi Tag gui=bold guifg=White guibg=bg + "hi Delimiter gui=bold guifg=White guibg=bg + "hi SpecialComment gui=bold guifg=White guibg=bg + "hi Debug gui=bold guifg=White guibg=bg + +highlight Underlined gui=underline guifg=honeydew4 guibg=bg + +highlight Ignore guifg=#204050 + +highlight Error guifg=LightYellow guibg=FireBrick + +highlight Todo guifg=Cyan guibg=#507080 + +""" OLD COLORS + + + diff --git a/dot_vim/colors/oceandeep.vim b/dot_vim/colors/oceandeep.vim new file mode 100644 index 0000000..c19b2c0 --- /dev/null +++ b/dot_vim/colors/oceandeep.vim @@ -0,0 +1,111 @@ +" Vim color file +" Maintainer: Tom Regner <regner@dievision.de> +" Last Change: 2002-12-05 +" Version: 1.1 +" URL: http://vim.sourceforge.net/script.php?script_id=368 + + +""" Init +set background=dark +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "oceandeep" + + +""""""""\ Colors \"""""""" + + +"""" GUI Colors + +highlight Cursor gui=None guibg=PaleTurquoise3 guifg=White +highlight CursorIM gui=bold guifg=white guibg=PaleTurquoise3 +highlight Directory guifg=LightSeaGreen guibg=bg +highlight DiffAdd gui=None guifg=fg guibg=DarkCyan +highlight DiffChange gui=None guifg=fg guibg=Green4 +highlight DiffDelete gui=None guifg=fg guibg=black +highlight DiffText gui=bold guifg=fg guibg=bg +highlight ErrorMsg guifg=LightYellow guibg=FireBrick +" previously 'FillColumn': +"highlight FillColumn gui=NONE guifg=black guibg=grey60 +highlight VertSplit gui=NONE guifg=black guibg=grey60 +highlight Folded gui=bold guibg=#305060 guifg=#b0d0e0 +highlight FoldColumn gui=bold guibg=#305060 guifg=#b0d0e0 +highlight IncSearch gui=reverse guifg=fg guibg=bg +highlight LineNr gui=bold guibg=grey6 guifg=LightSkyBlue3 +highlight ModeMsg guibg=DarkGreen guifg=LightGreen +highlight MoreMsg gui=bold guifg=SeaGreen4 guibg=bg +if version < 600 + " same as SpecialKey + highlight NonText guibg=#123A4A guifg=#3D5D6D +else + " Bottom fill (use e.g. same as LineNr) + highlight NonText gui=None guibg=#103040 guifg=LightSkyBlue +endif +highlight Normal gui=None guibg=#103040 guifg=honeydew2 +highlight Question gui=bold guifg=SeaGreen2 guibg=bg +highlight Search gui=NONE guibg=LightSkyBlue4 guifg=NONE +highlight SpecialKey guibg=#103040 guifg=#324262 +highlight StatusLine gui=bold guibg=grey88 guifg=black +highlight StatusLineNC gui=NONE guibg=grey60 guifg=grey10 +highlight Title gui=bold guifg=MediumOrchid1 guibg=bg +highlight Visual gui=reverse guibg=WHITE guifg=SeaGreen +highlight VisualNOS gui=bold,underline guifg=fg guibg=bg +highlight WarningMsg gui=bold guifg=FireBrick1 guibg=bg +highlight WildMenu gui=bold guibg=Chartreuse guifg=Black + + +"""" Syntax Colors + +"highlight Comment gui=reverse guifg=#507080 +highlight Comment gui=None guifg=#507080 + +highlight Constant guifg=cyan3 guibg=bg +hi String gui=None guifg=turquoise2 guibg=bg + "hi Character gui=None guifg=Cyan guibg=bg + highlight Number gui=None guifg=Cyan guibg=bg + highlight Boolean gui=bold guifg=Cyan guibg=bg + "hi Float gui=None guifg=Cyan guibg=bg + +highlight Identifier guifg=LightSkyBlue3 +hi Function gui=None guifg=DarkSeaGreen3 guibg=bg + +highlight Statement gui=NONE guifg=LightGreen + highlight Conditional gui=None guifg=LightGreen guibg=bg + highlight Repeat gui=None guifg=SeaGreen2 guibg=bg + "hi Label gui=None guifg=LightGreen guibg=bg + highlight Operator gui=None guifg=Chartreuse guibg=bg + highlight Keyword gui=bold guifg=LightGreen guibg=bg + highlight Exception gui=bold guifg=LightGreen guibg=bg + +highlight PreProc guifg=SkyBlue1 +hi Include gui=None guifg=LightSteelBlue3 guibg=bg +hi Define gui=None guifg=LightSteelBlue2 guibg=bg +hi Macro gui=None guifg=LightSkyBlue3 guibg=bg +hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg + +highlight Type gui=NONE guifg=LightBlue +hi StorageClass gui=None guifg=LightBlue guibg=bg +hi Structure gui=None guifg=LightBlue guibg=bg +hi Typedef gui=None guifg=LightBlue guibg=bg + +highlight Special gui=bold guifg=aquamarine3 + "hi SpecialChar gui=bold guifg=White guibg=bg + "hi Tag gui=bold guifg=White guibg=bg + "hi Delimiter gui=bold guifg=White guibg=bg + "hi SpecialComment gui=bold guifg=White guibg=bg + "hi Debug gui=bold guifg=White guibg=bg + +highlight Underlined gui=underline guifg=honeydew4 guibg=bg + +highlight Ignore guifg=#204050 + +highlight Error guifg=LightYellow guibg=FireBrick + +highlight Todo guifg=Cyan guibg=#507080 + +""" OLD COLORS + + + diff --git a/dot_vim/colors/oceanlight.vim b/dot_vim/colors/oceanlight.vim new file mode 100644 index 0000000..08fb22e --- /dev/null +++ b/dot_vim/colors/oceanlight.vim @@ -0,0 +1,105 @@ +" Vim color file +" Maintainer: Håkan Wikström <hakan@wikstrom.st> +" Last Change: 2005-01-06 +" Version: 0.1 +" URL: +" Originally based on oceandeep by Tom Regner (Vim script #368) + + +""" Init +set background=light +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "oceanlight" + + +""""""""\ Colors \"""""""" + + +"""" GUI Colors + +highlight Cursor gui=None guibg=PaleTurquoise3 guifg=White +highlight CursorIM gui=none guifg=white guibg=PaleTurquoise3 +highlight Directory guifg=SeaGreen guibg=bg +highlight DiffAdd gui=None guifg=SteelBlue guibg=LightGray +highlight DiffChange gui=None guifg=fg guibg=CadetBlue +highlight DiffDelete gui=None guifg=LightGray guibg=SteelBlue +highlight DiffText gui=none guifg=fg guibg=bg +highlight ErrorMsg guifg=FireBrick guibg=bg +highlight VertSplit gui=NONE guifg=black guibg=grey60 +highlight Folded gui=none guibg=LightSteelBlue guifg=SteelBlue +highlight FoldColumn gui=none guibg=LightSteelBLue guifg=SteelBlue +highlight IncSearch gui=reverse guifg=fg guibg=bg +highlight LineNr gui=none guibg=#d3d3d3 guifg=#5daf83 +highlight ModeMsg guibg=CadetBlue guifg=LightGrey +highlight MoreMsg gui=none guifg=CadetBlue guibg=bg +if version < 600 + " same as SpecialKey + highlight NonText guibg=#d3d3d3 guifg=#3D5D6D +else + " Bottom fill (use e.g. same as LineNr) + highlight NonText gui=None guibg=#d3d3d3 guifg=#5daf83 +endif +highlight Normal gui=None guibg=#f5f5f5 guifg=DimGray +highlight Question gui=none guifg=SeaGreen2 guibg=bg +highlight Search gui=NONE guibg=SlateGray2 guifg=NONE +highlight SpecialKey guibg=LightGray guifg=CadetBlue +highlight StatusLine gui=none guibg=SlateGrey guifg=LightGrey +highlight StatusLineNC gui=NONE guibg=LightGrey guifg=SlateGrey +highlight Title gui=none guifg=MediumOrchid1 guibg=bg +highlight Visual gui=reverse guibg=slategray4 guifg=SlateGray2 +highlight VisualNOS gui=none,underline guifg=fg guibg=bg +highlight WarningMsg gui=none guifg=FireBrick1 guibg=bg +highlight WildMenu gui=none guibg=Chartreuse guifg=Black + + +"""" Syntax Colors + +"highlight Comment gui=reverse guifg=#507080 +highlight Comment gui=None guifg=LightSteelBlue + +highlight Constant guifg=#483d8b guibg=bg +hi String gui=None guifg=MediumAquamarine guibg=bg + "hi Character gui=None guifg=Cyan guibg=bg + highlight Number gui=None guifg=MediumSeaGreen guibg=bg + highlight Boolean gui=none guifg=DarkSeaGreen guibg=bg + "hi Float gui=None guifg=Cyan guibg=bg + +highlight Identifier guifg=CornflowerBlue +hi Function gui=None guifg=DarkSeaGreen guibg=bg + +highlight Statement gui=NONE guifg=SeaGreen + highlight Conditional gui=None guifg=#5daf83 guibg=bg + highlight Repeat gui=None guifg=#5daf83 guibg=bg + "hi Label gui=None guifg=seagreen guibg=bg + highlight Operator gui=None guifg=LightSlateBlue guibg=bg + highlight Keyword gui=none guifg=SeaGreen guibg=bg + highlight Exception gui=none guifg=SeaGreen guibg=bg + +highlight PreProc guifg=SkyBlue1 +hi Include gui=None guifg=SteelBlue guibg=bg +hi Define gui=None guifg=LightSteelBlue2 guibg=bg +hi Macro gui=None guifg=LightSkyBlue3 guibg=bg +hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg + +highlight Type gui=NONE guifg=SteelBlue +hi StorageClass gui=None guifg=SteelBlue guibg=bg +hi Structure gui=None guifg=SteelBlue guibg=bg +hi Typedef gui=None guifg=SteelBlue guibg=bg + +highlight Special gui=none guifg=aquamarine3 + "hi SpecialChar gui=none guifg=White guibg=bg + "hi Tag gui=none guifg=White guibg=bg + "hi Delimiter gui=none guifg=White guibg=bg + "hi SpecialComment gui=none guifg=White guibg=bg + "hi Debug gui=none guifg=White guibg=bg + +highlight Underlined gui=underline guifg=honeydew4 guibg=bg + +highlight Ignore guifg=#204050 + +highlight Error guifg=FireBrick gui=Bold guibg=bg + +highlight Todo guifg=LightSkyBlue guibg=SlateGray diff --git a/dot_vim/colors/olive.vim b/dot_vim/colors/olive.vim new file mode 100644 index 0000000..26dcd2c --- /dev/null +++ b/dot_vim/colors/olive.vim @@ -0,0 +1,119 @@ +" Vim color file +" Maintainer: Charles <cherry_avium@yahoo.com> +" Last Change: 11 June 2004 +" URL: http:// + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="olive" + +"======================================================= +hi Normal guifg=#D9D9C3 guibg=#333300 +hi Cursor guifg=black guibg=white +hi CursorIM guifg=black guibg=green +hi Directory guifg=gold gui=underline +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg guibg=indianred +"hi VertSplit guifg=gold +hi Folded guifg=khaki guibg=darkolivegreen gui=underline +hi FoldColumn guifg=khaki guibg=darkolivegreen gui=none +hi IncSearch guifg=black guibg=khaki +hi LineNr guifg=gray80 +hi ModeMsg guifg=greenyellow gui=bold +hi MoreMsg guifg=greenyellow gui=bold +"hi NonText guibg=black +hi Question guifg=yellowgreen gui=NONE +hi Search guifg=black guibg=khaki gui=NONE +hi SpecialKey guifg=black guibg=darkkhaki +hi StatusLine guifg=palegoldenrod guibg=#808000 gui=none +hi StatusLineNC guifg=gray guibg=darkolivegreen gui=none +hi Title guifg=gold gui=bold +hi Visual guifg=black guibg=darkkhaki gui=NONE +"hi VisualNOS +hi WarningMsg guifg=palevioletred +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + + +" ============================================================ +" syntax highlighting groups +" ============================================================ +hi Comment guifg=darkkhaki guibg=#4C4C00 gui=underline + +hi Constant guifg=navajowhite +hi String guifg=greenyellow +"hi Character +"hi Number +"hi Boolean +"hi Float + +hi Identifier guifg=lightsteelblue +" hi Function guibg=gray60 + +hi Statement guifg=darkseagreen gui=bold +"hi Conditional +"hi Repeat +"hi Label +hi Operator guifg=gold +"hi Keyword +"hi Exception + +hi PreProc guifg=sandybrown gui=bold +"hi Include +"hi Define +"hi Macro +"hi PreCondit + +hi Type guifg=goldenrod +"hi StorageClass +"hi Structure +"hi Typedef + +hi Special guifg=navajowhite gui=underline +"hi SpecialChar +"hi Tag +"hi Delimiter +"hi SpecialComment +"hi Debug + +hi Underlined gui=underline + +hi Ignore guifg=black + +hi Error guifg=white + +hi Todo guifg=black guibg=gold gui=NONE + +" ================================================================= +" Language specific color +" ================================================================= + +" C / C++ +hi cIncluded guifg=yellowgreen + +" HTML +hi Title guifg=palegoldenrod + +" VIM +hi VimError guifg=red gui=bold +hi VimOption guifg=gold + +" TeX / LaTeX +hi texSection guifg=greenyellow +" tex between { and } +hi texMatcher guifg=yellowgreen gui=none +hi texMath gui=none + diff --git a/dot_vim/colors/papayawhip.vim b/dot_vim/colors/papayawhip.vim new file mode 100644 index 0000000..5f8725a --- /dev/null +++ b/dot_vim/colors/papayawhip.vim @@ -0,0 +1,31 @@ +" Vim color file +" Maintainer: Gerald S. Williams +" Last Change: 2003 Apr 17 + +" A nice light background (you guessed it, PapayaWhip) that's relatively easy +" on the eyes yet very usable. Not nearly as "puffy" as peachpuff. +" +" Only values that differ from defaults are specified. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "PapayaWhip" + +hi Normal guifg=#3f1f1f guibg=PapayaWhip ctermbg=Gray ctermfg=Black +hi NonText guibg=Moccasin guifg=Brown ctermfg=Brown +hi LineNr guibg=Moccasin +hi DiffDelete guibg=LightRed guifg=Black ctermbg=DarkRed ctermfg=White +hi DiffAdd guibg=LightGreen ctermbg=DarkGreen ctermfg=White +hi DiffChange guibg=LightCyan3 ctermbg=DarkCyan ctermfg=White +hi DiffText gui=NONE guibg=Gray80 ctermbg=DarkCyan ctermfg=Yellow +hi Comment guifg=MediumBlue +hi Constant guifg=DeepPink +hi PreProc guifg=DarkMagenta +hi StatusLine guibg=White guifg=#5f3705 cterm=bold ctermbg=Brown ctermfg=White +hi StatusLineNC gui=None guibg=Gray +hi VertSplit gui=None guibg=Gray +hi Identifier guifg=#005f5f +hi Statement ctermfg=DarkRed diff --git a/dot_vim/colors/potts.vim b/dot_vim/colors/potts.vim new file mode 100644 index 0000000..79bc5e9 --- /dev/null +++ b/dot_vim/colors/potts.vim @@ -0,0 +1,53 @@ +" -*- vim -*- +" FILE: "/home/dp/.vim/colors/potts2.vim" {{{ +" LAST MODIFICATION: "Fri, 08 Feb 2002 09:47:10 (dp)" +" (C) 2001 by Douglas L. Potts, <dlpotts@spectral-sys.com> +" $Id: potts2.vim,v 1.3 2002/02/18 20:25:27 dp Exp $ }}} + +set background=dark +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="potts2" + +highlight SpecialKey term=bold ctermfg=9 guifg=Cyan +highlight NonText term=bold ctermfg=9 gui=bold guifg=green +highlight Directory term=bold ctermfg=11 guifg=Cyan +highlight ErrorMsg term=standout ctermfg=15 ctermbg=4 guifg=White guibg=Red +highlight IncSearch term=reverse cterm=reverse gui=reverse +highlight Search term=reverse ctermfg=15 ctermbg=12 guifg=white guibg=Red +highlight MoreMsg term=bold ctermfg=10 gui=bold guifg=SeaGreen +highlight ModeMsg term=bold cterm=bold gui=bold +highlight LineNr term=underline ctermfg=14 guifg=Yellow +highlight Question term=standout ctermfg=10 gui=bold guifg=Green +highlight StatusLine term=bold,reverse cterm=bold,reverse gui=bold,reverse +highlight StatusLineNC term=reverse cterm=reverse gui=reverse +highlight VertSplit term=reverse cterm=reverse gui=reverse +highlight Title term=bold ctermfg=13 gui=bold guifg=Magenta +highlight Visual term=reverse cterm=reverse gui=reverse guifg=gray guibg=black +highlight VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline +highlight WarningMsg term=standout ctermfg=12 guifg=Red +highlight WildMenu term=standout ctermfg=0 ctermbg=14 guifg=Black guibg=Yellow +highlight Folded term=standout cterm=bold ctermfg=11 guifg=cyan guibg=bg +highlight FoldColumn term=standout cterm=bold ctermfg=11 guifg=cyan guibg=bg +highlight DiffAdd term=bold ctermfg=10 ctermbg=9 guifg=Green guibg=Black +highlight DiffChange term=bold ctermfg=15 ctermbg=9 guifg=White guibg=Blue +highlight DiffDelete term=bold ctermfg=13 ctermbg=11 gui=bold guifg=Magenta guibg=Black +highlight DiffText term=reverse cterm=bold ctermfg=15 ctermbg=12 gui=bold guifg=White guibg=Red +highlight Cursor guifg=bg guibg=fg +highlight lCursor guifg=bg guibg=fg +highlight Normal guifg=gray guibg=black font='6x13' +highlight Comment term=bold ctermfg=11 guifg=#80a0ff +highlight Constant term=underline ctermfg=13 guifg=#ffa0a0 +highlight Special term=bold ctermfg=12 guifg=Orange +highlight Identifier term=underline cterm=bold ctermfg=11 guifg=#40ffff +highlight Statement term=bold ctermfg=14 gui=bold guifg=#ffff60 +highlight PreProc term=underline ctermfg=9 guifg=#ff80ff +highlight Type term=underline ctermfg=10 gui=bold guifg=#60ff60 +highlight Underlined term=underline cterm=underline ctermfg=9 gui=underline guifg=#80a0ff +highlight Ignore ctermfg=0 guifg=bg +highlight Error term=reverse ctermfg=15 ctermbg=12 guifg=White guibg=Red +highlight Todo term=standout ctermfg=0 ctermbg=14 guifg=Blue guibg=Yellow +highlight DebugBreak ctermfg=15 ctermbg=4 guifg=white guibg=darkred +highlight DebugStop ctermfg=15 ctermbg=10 guifg=white guibg=lightgreen diff --git a/dot_vim/colors/print_bw.vim b/dot_vim/colors/print_bw.vim new file mode 100644 index 0000000..4be35f4 --- /dev/null +++ b/dot_vim/colors/print_bw.vim @@ -0,0 +1,65 @@ +" Vim color file +" Maintainer: Mike Williams <mrw@eandem.co.uk> +" Last Change: 2nd June 2003 +" Version: 1.1 + +" Remove all existing highlighting. +set background=light + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "print_bw" + +highlight Normal cterm=NONE ctermfg=black ctermbg=white gui=NONE guifg=black guibg=white +highlight NonText ctermfg=black ctermbg=white guifg=black guibg=white +highlight LineNr cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white + +" Syntax highlighting scheme +highlight Comment cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white + +highlight Constant ctermfg=black ctermbg=white guifg=black guibg=white +highlight String ctermfg=black ctermbg=white guifg=black guibg=white +highlight Character ctermfg=black ctermbg=white guifg=black guibg=white +highlight Number ctermfg=black ctermbg=white guifg=black guibg=white +" Boolean defaults to Constant +highlight Float ctermfg=black ctermbg=white guifg=black guibg=white + +highlight Identifier ctermfg=black ctermbg=white guifg=black guibg=white +highlight Function ctermfg=black ctermbg=white guifg=black guibg=white + +highlight Statement ctermfg=black ctermbg=white guifg=black guibg=white +highlight Conditional ctermfg=black ctermbg=white guifg=black guibg=white +highlight Repeat ctermfg=black ctermbg=white guifg=black guibg=white +highlight Label ctermfg=black ctermbg=white guifg=black guibg=white +highlight Operator ctermfg=black ctermbg=white guifg=black guibg=white +" Keyword defaults to Statement +" Exception defaults to Statement + +highlight PreProc cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white +" Include defaults to PreProc +" Define defaults to PreProc +" Macro defaults to PreProc +" PreCondit defaults to PreProc + +highlight Type cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white +" StorageClass defaults to Type +" Structure defaults to Type +" Typedef defaults to Type + +highlight Special cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white +" SpecialChar defaults to Special +" Tag defaults to Special +" Delimiter defaults to Special +highlight SpecialComment cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white +" Debug defaults to Special + +highlight Todo cterm=italic,bold ctermfg=black ctermbg=white gui=italic,bold guifg=black guibg=white +" Ideally, the bg color would be white but VIM cannot print white on black! +highlight Error cterm=bold,reverse ctermfg=black ctermbg=grey gui=bold,reverse guifg=black guibg=grey + +" vim:et:ff=unix:tw=0:ts=4:sw=4 +" EOF print_bw.vim diff --git a/dot_vim/colors/ps_color.vim b/dot_vim/colors/ps_color.vim new file mode 100644 index 0000000..909abcf --- /dev/null +++ b/dot_vim/colors/ps_color.vim @@ -0,0 +1,400 @@ +" Vim colour file --- PSC +" Maintainer: Pan Shizhu <dicpan@hotmail.com> +" Last Change: 17 November 2004 +" Version: 2.82 +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 +" +" Please prepend [VIM] in the title when writing e-mail to me, or it will +" be automatically treated as spam and removed. +" +" See the help document for all details, the help document will be +" installed after the script has been sourced once, do not open the +" script when you source it for the first time. +" + +" Initializations: {{{1 +" +function! s:init_option(var, value) + if !exists("g:psc_".a:var) + execute "let s:".a:var." = ".a:value + else + let s:{a:var} = g:psc_{a:var} + endif +endfunction +command! -nargs=+ InitOpt call s:init_option(<f-args>) + +function! s:multi_hi(setting, ...) + let l:idx = a:0 + while l:idx > 0 + let l:hlgroup = a:{l:idx} + execute "highlight ".l:hlgroup." ".a:setting + let l:idx = l:idx - 1 + endwhile +endfunction +command! -nargs=+ MultiHi call s:multi_hi(<f-args>) + +InitOpt style 'cool' +InitOpt inversed_todo 0 +InitOpt use_default_for_cterm 0 +InitOpt statement_different_from_type 0 +if s:style == 'warm' + InitOpt fontface 'mixed' +else + InitOpt fontface 'plain' +endif + +if !has("gui_running") + call s:init_option("cterm_style", "'".s:style."'") + + " Forces 'cool' style when gui is not present Since the 'warm' style for + " terminal isn't available now, and probably never will be. + if s:cterm_style=='warm' | let s:cterm_style = 'cool' + endif + if s:use_default_for_cterm==1 | let s:cterm_style = 'default' + elseif s:use_default_for_cterm==2 | let s:cterm_style = 'defdark' + endif +endif + + +InitOpt other_style 0 + +if has("gui_running") + if s:style=='warm' || s:style=='default' + set background=light + elseif s:style=='cool' || s:style=='defdark' + set background=dark + else | let s:other_style = 1 + endif +else + if s:cterm_style=='cool' || s:cterm_style=='defdark' + set background=dark + elseif s:cterm_style=='default' + set background=light + else | let s:other_style = 1 + endif +endif + + +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let s:color_name = expand("<sfile>:t:r") + +if s:other_style==0 | let g:colors_name = s:color_name + " Go from console version to gui, the color scheme should be sourced again + execute "autocmd TermChanged * if g:colors_name == '".s:color_name."' | " + \."colo ".s:color_name." | endif" +else + execute "runtime colors/".s:style.".vim" +endif + +" Command to go different schemes easier. +execute "command! -nargs=1 Colo if '".s:color_name."'!=\"<args>\" | " + \'let g:psc_style = "<args>"| endif | colo '.s:color_name + +" Give control to 'reloaded' scheme if possible +if s:style == 'reloaded' + finish +endif + +" }}}1 + +" Relevant Help: +" :h highlight-groups +" :h psc-cterm-color-table +" :ru syntax/hitest.vim +" +" Hardcoded Colors Comment: +" #aabbcc = Red aa, Green bb, Blue cc +" we must use hard-coded colours to get more 'tender' colours +" + + +" GUI: +" +" I don't want to abuse folding, but here folding is used to avoid confusion. +if s:style=='warm' + " Warm style for gui here {{{2 + " LIGHT COLOR DEFINE START + + highlight Normal guifg=#000000 guibg=#e0e0e0 + highlight Search guifg=#902000 guibg=#f8f8f8 + highlight Visual guifg=fg guibg=#a6caf0 + highlight Cursor guifg=#f0f0f0 guibg=#008000 + " The idea of CursorIM is pretty good, however, the feature is still buggy + " in the current version (Vim 6.3). + " The following line will be kept commented until the bug fixed. + " + " highlight CursorIM guifg=#f0f0f0 guibg=#800080 + highlight Special guifg=#907000 guibg=bg + highlight Comment guifg=#505800 guibg=bg + highlight Number guifg=#907000 guibg=bg + highlight Constant guifg=#007068 guibg=bg + highlight StatusLine guifg=fg guibg=#a6caf0 + highlight LineNr guifg=#686868 guibg=bg + highlight Question guifg=fg guibg=#d0d090 + highlight PreProc guifg=#009030 guibg=bg + if s:statement_different_from_type==1 + highlight Statement guifg=#4020a0 guibg=bg + else + highlight Statement guifg=#2060a8 guibg=bg + endif + highlight Type guifg=#0850a0 guibg=bg + if s:inversed_todo==1 + highlight Todo guifg=#e0e090 guibg=#000080 + else + highlight Todo guifg=#800000 guibg=#e0e090 + endif + " NOTE THIS IS IN THE WARM SECTION + highlight Error guifg=#c03000 guibg=bg + highlight Identifier guifg=#a030a0 guibg=bg + highlight ModeMsg guifg=fg guibg=#b0b0e0 + highlight VisualNOS guifg=fg guibg=#b0b0e0 + highlight SpecialKey guifg=#1050a0 guibg=bg + highlight NonText guifg=#002090 guibg=#d0d0d0 + highlight Directory guifg=#a030a0 guibg=bg + highlight ErrorMsg guifg=fg guibg=#f0b090 + highlight MoreMsg guifg=#489000 guibg=bg + highlight Title guifg=#a030a0 guibg=bg + highlight WarningMsg guifg=#b02000 guibg=bg + highlight WildMenu guifg=fg guibg=#d0d090 + highlight Folded guifg=fg guibg=#b0e0b0 + highlight FoldColumn guifg=fg guibg=#90e090 + highlight DiffAdd guifg=fg guibg=#b0b0e0 + highlight DiffChange guifg=fg guibg=#e0b0e0 + highlight DiffDelete guifg=#002090 guibg=#d0d0d0 + highlight DiffText guifg=fg guibg=#c0e080 + highlight SignColumn guifg=fg guibg=#90e090 + highlight IncSearch guifg=#f0f0f0 guibg=#806060 + highlight StatusLineNC guifg=fg guibg=#c0c0c0 + highlight VertSplit guifg=fg guibg=#c0c0c0 + highlight Underlined guifg=#6a5acd guibg=bg gui=underline + highlight Ignore guifg=bg guibg=bg + + " LIGHT COLOR DEFINE END + " }}}2 +elseif s:style=='cool' + " Cool style for gui here {{{2 + " DARK COLOR DEFINE START + + highlight Normal guifg=#d0d0d0 guibg=#202020 + highlight Comment guifg=#d0d090 guibg=bg + highlight Constant guifg=#80c0e0 guibg=bg + highlight Number guifg=#e0c060 guibg=bg + highlight Identifier guifg=#f0c0f0 guibg=bg + if s:statement_different_from_type==1 + highlight Statement guifg=#98a8f0 guibg=bg + else + highlight Statement guifg=#c0d8f8 guibg=bg + endif + highlight PreProc guifg=#60f080 guibg=bg + highlight Type guifg=#b0d0f0 guibg=bg + highlight Special guifg=#e0c060 guibg=bg + highlight Error guifg=#f08060 guibg=bg + if s:inversed_todo==1 + highlight Todo guifg=#d0d090 guibg=#000080 + else + highlight Todo guifg=#800000 guibg=#d0d090 + endif + highlight Search guifg=#e0e0e0 guibg=#800000 + highlight Visual guifg=#000000 guibg=#a6caf0 + highlight Cursor guifg=#000000 guibg=#00f000 + " NOTE THIS IS IN THE COOL SECTION + " highlight CursorIM guifg=#000000 guibg=#f000f0 + highlight StatusLine guifg=#000000 guibg=#a6caf0 + highlight LineNr guifg=#b0b0b0 guibg=bg + highlight Question guifg=#000000 guibg=#d0d090 + highlight ModeMsg guifg=fg guibg=#000080 + highlight VisualNOS guifg=fg guibg=#000080 + highlight SpecialKey guifg=#b0d0f0 guibg=bg + highlight NonText guifg=#6080f0 guibg=#101010 + highlight Directory guifg=#80c0e0 guibg=bg + highlight ErrorMsg guifg=#d0d090 guibg=#800000 + highlight MoreMsg guifg=#c0e080 guibg=bg + highlight Title guifg=#f0c0f0 guibg=bg + highlight WarningMsg guifg=#f08060 guibg=bg + highlight WildMenu guifg=#000000 guibg=#d0d090 + highlight Folded guifg=#d0d0d0 guibg=#004000 + highlight FoldColumn guifg=#e0e0e0 guibg=#008000 + highlight DiffAdd guifg=fg guibg=#000080 + highlight DiffChange guifg=fg guibg=#800080 + highlight DiffDelete guifg=#6080f0 guibg=#202020 + highlight DiffText guifg=#000000 guibg=#c0e080 + highlight SignColumn guifg=#e0e0e0 guibg=#008000 + highlight IncSearch guifg=#000000 guibg=#d0d0d0 + highlight StatusLineNC guifg=#000000 guibg=#c0c0c0 + highlight VertSplit guifg=#000000 guibg=#c0c0c0 + highlight Underlined guifg=#80a0ff guibg=bg gui=underline + highlight Ignore guifg=#000000 guibg=bg + + " DARK COLOR DEFINE END + " }}}2 +elseif s:style=='defdark' + highlight Normal guifg=#f0f0f0 guibg=#000000 +endif + +" Take NT gui for example, If you want to use a console font such as +" Lucida_Console with font size larger than 14, the font looks already thick, +" and the bold font for that will be too thick, you may not want it be bolded. +" The following code does this. +" +" All of the bold font may be disabled, since continuously switching between +" bold and plain font hurts consistency and will inevitably fatigue your eye! + +" Maximum 20 parameters for vim script function +" +MultiHi gui=NONE ModeMsg Search Cursor Special Comment Constant Number LineNr Question PreProc Statement Type Todo Error Identifier Normal + +MultiHi gui=NONE VisualNOS SpecialKey NonText Directory ErrorMsg MoreMsg Title WarningMsg WildMenu Folded FoldColumn DiffAdd DiffChange DiffDelete DiffText SignColumn + +" For reversed stuffs +MultiHi gui=NONE IncSearch StatusLine StatusLineNC VertSplit Visual + +if s:style=="cool" || s:style=="warm" + if s:fontface=="mixed" + MultiHi gui=bold IncSearch StatusLine StatusLineNC VertSplit Visual + endif +else + if s:fontface=="mixed" + hi StatusLine gui=bold,reverse + else + hi StatusLine gui=reverse + endif + MultiHi gui=reverse IncSearch StatusLineNC VertSplit Visual +endif + +" Enable the bold style +if s:fontface=="mixed" + MultiHi gui=bold Question DiffText Statement Type MoreMsg ModeMsg NonText Title VisualNOS DiffDelete +endif + + + + +" Color Term: + +" It's not quite possible to support 'cool' and 'warm' simultaneously, since +" we cannot expect a terminal to have more than 16 color names. +" + +" I assume Vim will never go to cterm mode when has("gui_running") returns 1, +" Please enlighten me if I am wrong. +" +if !has('gui_running') + " cterm settings {{{1 + if s:cterm_style=='cool' + + highlight Normal ctermfg=LightGrey ctermbg=Black + highlight Search ctermfg=White ctermbg=DarkRed + highlight Visual ctermfg=Black ctermbg=DarkCyan + highlight Cursor ctermfg=Black ctermbg=Green + highlight Special ctermfg=Yellow ctermbg=Black + highlight Comment ctermfg=DarkYellow ctermbg=Black + highlight Constant ctermfg=Blue ctermbg=Black + highlight Number ctermfg=Yellow ctermbg=Black + highlight StatusLine ctermfg=Black ctermbg=DarkCyan + highlight LineNr ctermfg=DarkGrey ctermbg=Black + highlight Question ctermfg=Black ctermbg=DarkYellow + highlight PreProc ctermfg=Green ctermbg=Black + highlight Statement ctermfg=Cyan ctermbg=Black + highlight Type ctermfg=Cyan ctermbg=Black + if s:inversed_todo==0 + highlight Todo ctermfg=DarkRed ctermbg=DarkYellow + else + highlight Todo ctermfg=DarkYellow ctermbg=DarkBlue + endif + highlight Error ctermfg=Red ctermbg=Black + highlight Identifier ctermfg=Magenta ctermbg=Black + highlight Folded ctermfg=White ctermbg=DarkGreen + highlight ModeMsg ctermfg=Grey ctermbg=DarkBlue + highlight VisualNOS ctermfg=Grey ctermbg=DarkBlue + highlight SpecialKey ctermfg=Cyan ctermbg=Black + highlight NonText ctermfg=Blue ctermbg=Black + highlight Directory ctermfg=Blue ctermbg=Black + highlight ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed + highlight MoreMsg ctermfg=Green ctermbg=Black + highlight Title ctermfg=Magenta ctermbg=Black + highlight WarningMsg ctermfg=Red ctermbg=Black + highlight WildMenu ctermfg=Black ctermbg=DarkYellow + highlight FoldColumn ctermfg=White ctermbg=DarkGreen + highlight SignColumn ctermfg=White ctermbg=DarkGreen + highlight DiffText ctermfg=Black ctermbg=DarkYellow + highlight DiffDelete ctermfg=Blue ctermbg=Black + + if &t_Co==8 + " 8 colour terminal support, this assumes 16 colour is available through + " setting the 'bold' attribute, will get bright foreground colour. + " However, the bright background color is not available for 8-color terms. + " + " You can manually set t_Co=16 in your .vimrc to see if your terminal + " supports 16 colours, + MultiHi cterm=none DiffText Visual Cursor Comment Todo StatusLine Question DiffChange ModeMsg VisualNOS ErrorMsg WildMenu DiffAdd Folded DiffDelete Normal + MultiHi cterm=bold Search Special Constant Number LineNr PreProc Statement Type Error Identifier SpecialKey NonText MoreMsg Title WarningMsg FoldColumn SignColumn Directory DiffDelete + + else + " Background > 7 is only available with 16 or more colors + + " Only use the s:fontface option when there is 16-colour(or more) + " terminal support + + MultiHi cterm=none WarningMsg Search Visual Cursor Special Comment Constant Number LineNr PreProc Todo Error Identifier Folded SpecialKey Directory ErrorMsg Normal + MultiHi cterm=none WildMenu FoldColumn SignColumn DiffAdd DiffChange Question StatusLine DiffText + MultiHi cterm=reverse IncSearch StatusLineNC VertSplit + + " Well, well, bold font with color 0-7 is not possible. + " So, the Question, StatusLine, DiffText cannot act as expected. + + call s:multi_hi("cterm=".((s:fontface=="plain") ? "none" : "bold"), "Statement", "Type", "MoreMsg", "ModeMsg", "NonText", "Title", "VisualNOS", "DiffDelete") + + endif + + elseif s:cterm_style=='defdark' + highlight Normal ctermfg=LightGrey ctermbg=Black + endif + " }}}1 +endif + + +" Term: +" For console with only 4 colours (term, not cterm), we'll use the default. +" ... +" The default colorscheme is good enough for terms with no more than 4 colours +" + + +" Links: +" +if (s:style=='cool') || (s:style == 'warm') + " COLOR LINKS DEFINE START + + highlight link String Constant + " Character must be different from strings because in many languages + " (especially C, C++) a 'char' variable is scalar while 'string' is pointer, + " mistaken a 'char' for a 'string' will cause disaster! + highlight link Character Number + highlight link SpecialChar LineNr + highlight link Tag Identifier + " The following are not standard hi links, + " these are used by DrChip + highlight link Warning MoreMsg + highlight link Notice Constant + " these are used by Calendar + highlight link CalToday PreProc + " these are used by TagList + highlight link MyTagListTagName IncSearch + highlight link MyTagListTagScope Constant + + " COLOR LINKS DEFINE END +endif + + +" Clean: +" +delcommand InitOpt +delcommand MultiHi + +" vim:et:nosta:sw=2:ts=8: +" vim600:fdm=marker:fdl=1: diff --git a/dot_vim/colors/putty.vim b/dot_vim/colors/putty.vim new file mode 100644 index 0000000..4c86ad5 --- /dev/null +++ b/dot_vim/colors/putty.vim @@ -0,0 +1,82 @@ +" Vim color file +" Maintainer: Prachya Boonkwan <kaamanita@hotmail.com> +" Last Change: April 29, 2003 +" Licence: Public Domain + +" This package offers a eye-catching color scheme that resembles the +" default color scheme of Putty telnet terminal. + +" First remove all existing highlighting. +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "putty" + +hi Normal guifg=Grey guibg=Black + +hi ErrorMsg guibg=Red guifg=White +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi StatusLine gui=reverse,bold +hi StatusLineNC gui=reverse +hi VertSplit gui=reverse +hi Visual gui=reverse guifg=Grey guibg=fg +hi VisualNOS gui=underline,bold +hi DiffText gui=bold guibg=Red +hi Cursor guibg=Green guifg=NONE +hi lCursor guibg=Cyan guifg=NONE +hi Directory guifg=Blue +hi LineNr guifg=#BBBB00 +hi MoreMsg gui=bold guifg=SeaGreen +hi NonText gui=bold guifg=Blue guibg=Black +hi Question gui=bold guifg=SeaGreen +hi Search guibg=#BBBB00 guifg=NONE +hi SpecialKey guifg=Blue +hi Title gui=bold guifg=Magenta +hi WarningMsg guifg=Red +hi WildMenu guibg=Cyan guifg=Black +hi Folded guibg=White guifg=DarkBlue +hi FoldColumn guibg=Grey guifg=DarkBlue +hi DiffAdd guibg=LightBlue +hi DiffChange guibg=LightMagenta +hi DiffDelete gui=bold guifg=Blue guibg=LightCyan + +hi Comment guifg=Blue guibg=Black +hi Constant guifg=#BB0000 guibg=Black +hi PreProc guifg=#BB00BB guibg=Black +hi Statement gui=NONE guifg=#BBBB00 guibg=Black +hi Special guifg=#BB00BB guibg=Black +hi Ignore guifg=Grey +hi Identifier guifg=#00BBBB guibg=Black +hi Type guifg=#00BB00 guibg=Black + +hi link IncSearch Visual +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special + +" vim: sw=2 diff --git a/dot_vim/colors/python.vim b/dot_vim/colors/python.vim new file mode 100644 index 0000000..6f4a765 --- /dev/null +++ b/dot_vim/colors/python.vim @@ -0,0 +1,104 @@ +""" Init +set background=light +highlight clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "python" + + +""""""""\ Colors \"""""""" + + +"""" GUI Colors + +highlight Cursor gui=None guibg=Palegreen3 guifg=White +highlight CursorIM gui=bold guifg=white guibg=PaleTurquoise3 +highlight Directory guifg=LightSeaGreen guibg=bg +highlight DiffAdd gui=None guifg=fg guibg=DarkCyan +highlight DiffChange gui=None guifg=fg guibg=Green4 +highlight DiffDelete gui=None guifg=fg guibg=black +highlight DiffText gui=bold guifg=fg guibg=bg +highlight ErrorMsg guifg=LightYellow guibg=FireBrick +" previously 'FillColumn': +"highlight FillColumn gui=NONE guifg=black guibg=grey60 +highlight VertSplit gui=NONE guifg=black guibg=#c8d6b3 +highlight Folded gui=bold guibg=#305060 guifg=#b0d0e0 +highlight FoldColumn gui=bold guibg=#395602 guifg=#6f9b1f +highlight IncSearch gui=reverse guifg=fg guibg=bg +highlight LineNr gui=bold guibg=#395602 guifg=#6f9b1f +highlight ModeMsg guibg=DarkGreen guifg=Green +highlight MoreMsg gui=bold guifg=SeaGreen4 guibg=bg +if version < 600 + " same as SpecialKey + highlight NonText guibg=#123A4A guifg=#3D5D6D +else + " Bottom fill (use e.g. same as LineNr) + highlight NonText gui=None guibg=bg guifg=fg +endif +highlight Normal gui=None guibg=#f6ffe5 guifg=black +highlight Question gui=bold guifg=SeaGreen2 guibg=bg +highlight Search gui=NONE guibg=LightSkyBlue4 guifg=NONE +highlight SpecialKey guibg=#103040 guifg=#324262 +highlight StatusLine gui=bold guibg=#c8d6b3 guifg=black +highlight StatusLineNC gui=NONE guibg=#c8d6b3 guifg=black +highlight Title gui=bold guifg=MediumOrchid1 guibg=bg +highlight Visual gui=reverse guibg=WHITE guifg=SeaGreen +highlight VisualNOS gui=bold,underline guifg=fg guibg=bg +highlight WarningMsg gui=bold guifg=FireBrick1 guibg=bg +highlight WildMenu gui=bold guibg=Chartreuse guifg=Black + + +"""" Syntax Colors + +"highlight Comment gui=reverse guifg=#507080 +highlight Comment gui=italic guifg=#507080 + +highlight Constant guifg=black guibg=bg +hi String gui=None guifg=#ccab3f guibg=bg + "hi Character gui=None guifg=#969248 guibg=bg + highlight Number gui=None guifg=#969248 guibg=bg + highlight Boolean gui=bold guifg=#969248 guibg=bg + "hi Float gui=None guifg=#969248 guibg=bg + +highlight Identifier guifg=#6f9b1f +hi Function gui=None guifg=#775d05 guibg=bg + +highlight Statement gui=NONE guifg=#669907 + highlight Conditional gui=None guifg=Green guibg=bg + highlight Repeat gui=None guifg=SeaGreen2 guibg=bg + "hi Label gui=None guifg=Green guibg=bg + highlight Operator gui=None guifg=Chartreuse guibg=bg + highlight Keyword gui=bold guifg=#6f9b1f guibg=bg + highlight Exception gui=bold guifg=Green guibg=bg + +highlight PreProc guifg=SkyBlue1 +hi Include gui=None guifg=#725c05 guibg=bg +hi Define gui=None guifg=#725c05 guibg=bg +hi Macro gui=None guifg=#486610 guibg=bg +hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg + +highlight Type gui=NONE guifg=#ccab3f +hi StorageClass gui=None guifg=#ccab3f guibg=bg +hi Structure gui=None guifg=#ccab3f guibg=bg +hi Typedef gui=None guifg=#ccab3f guibg=bg + +highlight Special gui=bold guifg=#ddb100 + "hi SpecialChar gui=bold guifg=White guibg=bg + "hi Tag gui=bold guifg=White guibg=bg + "hi Delimiter gui=bold guifg=White guibg=bg + "hi SpecialComment gui=bold guifg=White guibg=bg + "hi Debug gui=bold guifg=White guibg=bg + +highlight Underlined gui=underline guifg=honeydew4 guibg=bg + +highlight Ignore guifg=#204050 + +highlight Error guifg=LightYellow guibg=FireBrick + +highlight Todo guifg=#969248 guibg=#507080 + +""" OLD COLORS + + + diff --git a/dot_vim/colors/redblack.vim b/dot_vim/colors/redblack.vim new file mode 100644 index 0000000..793af52 --- /dev/null +++ b/dot_vim/colors/redblack.vim @@ -0,0 +1,62 @@ +set background=dark +hi clear + +hi Normal ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Boolean ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Character ctermbg=black guibg=black ctermfg=red guifg=red +hi Comment ctermbg=black guibg=black ctermfg=darkgrey guifg=#606060 cterm=bold +hi Condtional ctermbg=black guibg=black ctermfg=red guifg=red +hi Constant ctermbg=black guibg=black ctermfg=red guifg=red +hi Cursor ctermbg=black guibg=white ctermfg=grey guifg=grey +hi Debug ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Define ctermbg=black guibg=black ctermfg=white guifg=white +hi Delimiter ctermbg=black guibg=black ctermfg=grey guifg=grey +hi DiffAdd ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE cterm=NONE gui=NONE +hi DiffChange ctermbg=white guibg=white ctermfg=darkgrey guifg=#606060 +hi DiffDelete ctermbg=black guibg=black ctermfg=darkgrey guifg=#606060 cterm=bold +hi DiffText ctermbg=red guibg=red ctermfg=white guifg=white +hi Directory ctermbg=black guibg=black ctermfg=white guifg=white +hi Error ctermbg=red guibg=red ctermfg=white guifg=white +hi ErrorMsg ctermbg=red guibg=red ctermfg=white guifg=white +hi Exception ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Float ctermbg=black guibg=black ctermfg=red guifg=red cterm=NONE gui=NONE +hi FoldColumn ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Folded ctermbg=black guibg=black ctermfg=red guifg=red +hi Function ctermbg=black guibg=black ctermfg=white guifg=white +hi Identifier ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Include ctermbg=black guibg=black ctermfg=white guifg=white +hi IncSearch ctermbg=green guibg=green ctermfg=darkgrey guifg=#606060 +hi Keyword ctermbg=black guibg=black ctermfg=red guifg=red +hi Label ctermbg=black guibg=black ctermfg=white guifg=white +hi LineNr ctermbg=black guibg=black ctermfg=darkgrey guifg=#606060 cterm=bold +hi Macro ctermbg=black guibg=black ctermfg=grey guifg=grey +hi ModeMsg ctermbg=black guibg=black ctermfg=grey guifg=grey +hi MoreMsg ctermbg=black guibg=black ctermfg=grey guifg=grey +hi NonText ctermbg=black guibg=black ctermfg=darkgrey guifg=#606060 cterm=bold +hi Number ctermbg=black guibg=black ctermfg=red guifg=red cterm=NONE gui=NONE +hi Operator ctermbg=black guibg=black ctermfg=white guifg=white +hi PreCondit ctermbg=black guibg=black ctermfg=white guifg=white +hi PreProc ctermbg=black guibg=black ctermfg=white guifg=white +hi Question ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Repeat ctermbg=black guibg=black ctermfg=white guifg=white +hi Search ctermbg=black guibg=black ctermfg=green guifg=green +hi SpecialChar ctermbg=black guibg=black ctermfg=white guifg=white +hi SpecialComment ctermbg=black guibg=black ctermfg=white guifg=white +hi Special ctermbg=black guibg=black ctermfg=white guifg=white +hi SpecialKey ctermbg=white guibg=white ctermfg=black guifg=black +hi Statement ctermbg=black guibg=black ctermfg=white guifg=white +hi StatusLine ctermbg=white guibg=white ctermfg=red guifg=red +hi StatusLineNC ctermbg=black guibg=black ctermfg=grey guifg=grey +hi StorageClass ctermbg=black guibg=black ctermfg=white guifg=white +hi String ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Structure ctermbg=black guibg=black ctermfg=white guifg=white +hi Tag ctermbg=black guibg=black ctermfg=red guifg=red +hi Title ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Todo ctermbg=black guibg=black ctermfg=white guifg=white +hi Typedef ctermbg=black guibg=black ctermfg=white guifg=white +hi Type ctermbg=black guibg=black ctermfg=white guifg=white +hi VertSplit ctermbg=black guibg=black ctermfg=grey guifg=grey +hi Visual ctermbg=black guibg=black ctermfg=grey guifg=grey +hi VisualNOS ctermbg=black guibg=black ctermfg=grey guifg=grey +hi WarningMsg ctermbg=black guibg=black ctermfg=red guifg=red +hi WildMenu ctermbg=white guibg=white ctermfg=darkgrey guifg=#606060 diff --git a/dot_vim/colors/relaxedgreen.vim b/dot_vim/colors/relaxedgreen.vim new file mode 100644 index 0000000..6cc21df --- /dev/null +++ b/dot_vim/colors/relaxedgreen.vim @@ -0,0 +1,114 @@ +" ---------------------------------------------------------------------------------------------------------------------------------- +" Filename: relaxedgreen.vim +" Last Modified: 14 Aug 2006 02:24:33 PM by Dave V +" Maintainer: Dave Vehrs (dvehrs at gmail.com) +" Copyright: 2002,2003,2004,2005,2006 Dave Vehrs +" This script is free software; you can redistribute it and/or +" modify it under the terms of the GNU General Public License as +" published by the Free Software Foundation; either version 2 of +" the License, or (at your option) any later version. +" Description: Vim colorscheme file. +" Install: Put this file in the users colors directory (~/.vim/colors) or +" in the shared colors directory (/usr/shared/vim/vim<version>/colors/), +" then load it with :colorscheme relaxedgreen +" +" +" ---------------------------------------------------------------------------------------------------------------------------------- +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "relaxedgreen" +highlight Cursor term=reverse ctermfg=green ctermbg=blue guifg=#000000 guibg=#559955 +highlight CursorIM term=reverse ctermfg=black ctermbg=darkgreen guifg=#000000 guibg=#336633 +highlight CursorColumn term=none ctermbg=darkblue guibg=#333366 +highlight CursorColumn term=none ctermbg=darkblue guibg=#333366 +highlight Comment term=italic ctermfg=darkcyan ctermbg=black guifg=#00a594 +highlight Constant term=underline ctermfg=blue guifg=#0099dd +highlight Debug term=bold ctermfg=red ctermbg=black guifg=#dc0000 guibg=#000000 +highlight DiffAdd term=reverse ctermfg=black ctermbg=cyan guifg=#000000 guibg=#007200 +highlight DiffChange term=underline cterm=reverse ctermfg=darkgreen ctermbg=black guifg=#000000 guibg=#006700 +highlight DiffDelete term=standout ctermfg=black ctermbg=cyan guifg=#000000 guibg=#007200 +highlight DiffText term=bold ctermfg=green ctermbg=black guifg=#00ac00 guibg=#000000 +highlight Directory term=underline ctermfg=green ctermbg=black guifg=#336633 guibg=#000000 +highlight Error term=reverse,bold ctermfg=black ctermbg=red guifg=#000000 guibg=#dc0000 +highlight ErrorMsg term=reverse,bold ctermfg=white ctermbg=red guifg=#ffffff guibg=#dc0000 +highlight Folded ctermfg=darkgreen ctermbg=black guifg=#20de20 guibg=#000000 +highlight FoldColumn ctermfg=darkgreen ctermbg=black guifg=#20de20 guibg=#000000 +highlight Function term=standout ctermfg=darkgreen guifg=#22bb22 +highlight Identifier term=underline ctermfg=darkcyan gui=underline guifg=#008800 +highlight Ignore ctermfg=lightgreen guifg=#33bb33 +highlight IncSearch term=reverse ctermfg=black ctermbg=darkgreen guifg=#000000 guibg=#336633 +highlight LineNr term=bold ctermfg=green guifg=#00ff00 +highlight MatchParen term=bold ctermfg=black ctermbg=green guibg=#00ff00 guifg=#000000 +highlight ModeMsg term=bold cterm=bold gui=bold +highlight MoreMsg term=bold cterm=bold gui=bold +highlight NonText ctermfg=darkcyan guifg=#999999 +highlight Normal ctermfg=gray ctermbg=black guifg=#aaaaaa guibg=#000000 +highlight Pmenu term=reverse ctermfg=black ctermbg=green guifg=#000000 guibg=#337733 +highlight PmenuSel term=bold ctermfg=black ctermbg=gray guifg=#000000 guibg=#999999 +highlight PmenuSbar term=reverse ctermfg=black ctermbg=green guifg=#000000 guibg=#337733 +highlight PmenuThumb term=reverse ctermfg=gray ctermbg=black guifg=#999999 guibg=#000000 +highlight PreProc term=standout ctermfg=darkgreen guifg=#22bb22 +highlight Question term=standout ctermfg=red guifg=#ff0000 +highlight Search term=reverse ctermfg=black ctermbg=darkgreen guifg=#000000 guibg=#228822 +highlight SignColumn ctermfg=darkgreen guifg=#20de20 guibg=#000000 +highlight Special term=bold ctermfg=green guifg=#00ff00 +highlight SpecialKey term=bold ctermfg=green guifg=#00ff00 +highlight SpellBad term=reverse cterm=underline ctermfg=red ctermbg=black gui=undercurl guisp=#ff0000 +highlight SpellCap term=reverse cterm=underline ctermfg=yellow ctermbg=black gui=undercurl guisp=#00ffff +highlight SpellLocal term=reverse cterm=underline ctermfg=blue ctermbg=black gui=undercurl guisp=#0000ff +highlight SpellRare term=reverse cterm=underline ctermfg=darkgreen ctermbg=black gui=undercurl guisp=#00ff00 +highlight Statement term=standout ctermfg=darkred guifg=#ac0000 +highlight StatusLine term=reverse ctermfg=darkgreen ctermbg=black gui=none guibg=#228822 guifg=#000000 +highlight StatusLineNC term=reverse ctermfg=darkgreen ctermbg=blue gui=none guibg=#336633 guifg=#000000 +highlight TabLine term=reverse cterm=reverse ctermfg=black ctermbg=green guibg=#222222 guifg=#228822 +highlight TabLineFill term=reverse cterm=reverse ctermfg=green ctermbg=black guibg=#222222 guifg=#226622 +highlight TabLineSel ctermfg=black ctermbg=green guibg=#228822 guifg=#222222 +highlight Title term=reverse ctermfg=black ctermbg=green guifg=#000000 guibg=#00ff00 +highlight Todo term=reverse cterm=reverse ctermfg=darkgreen ctermbg=black guibg=#336633 guifg=#000000 +highlight Type term=standout ctermfg=green guifg=#559955 +highlight Visual term=reverse cterm=reverse ctermfg=darkgreen guifg=#000000 guibg=#336633 +highlight VisualNOS term=reverse,bold cterm=reverse ctermbg=darkgreen guifg=#000000 guibg=#228822 +highlight VertSplit term=reverse ctermfg=darkgreen guifg=#336633 +highlight User1 term=standout cterm=bold ctermbg=darkgreen ctermfg=red gui=bold guibg=#228822 guifg=#FF0000 +highlight WarningMsg term=reverse ctermfg=black ctermbg=yellow guifg=#000000 guibg=#007a7a +highlight WildMenu term=reverse ctermfg=blue ctermbg=darkgreen guifg=#000099 guibg=#00ac00 + +" ---------------------------------------------------------------------------------------------------------------------------------- +" Common groups that link to other highlight definitions. + +highlight link Constant Character +highlight link Constant Number +highlight link Constant Boolean +highlight link Constant String + +highlight link LineNr Operator + +highlight link Number Float + +highlight link PreProc Define +highlight link PreProc Include +highlight link PreProc Macro +highlight link PreProc PreCondit + +highlight link Question Repeat + +highlight link Repeat Conditional + +highlight link Special Delimiter +highlight link Special SpecialChar +highlight link Special SpecialComment +highlight link Special Tag + +highlight link Statement Exception +highlight link Statement Keyword +highlight link Statement Label + +highlight link Type StorageClass +highlight link Type Structure +highlight link Type Typedef + +" ---------------------------------------------------------------------------------------------------------------------------------- +" vim:tw=132:ts=4:sw=4 diff --git a/dot_vim/colors/reloaded.vim b/dot_vim/colors/reloaded.vim new file mode 100644 index 0000000..0c0c382 --- /dev/null +++ b/dot_vim/colors/reloaded.vim @@ -0,0 +1,856 @@ +" Vim colour file: The colorscheme reloaded. +" Maintainer: Pan Shizhu <dicpan@hotmail.com> +" Last Change: 16 July 2004 +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 +" Version: 0.6 +" +" Please prepend [VIM] in the title when writing e-mail to me, or it will +" be silently discarded. +" +" Description: +" +" See :h reloaded.txt for details +" +" Release Notes: +" +" v0.6 For default users it may be slow, Added :se lz to disable refresh +" Changed some groups of the sample parameter +" Use bracketed variable instead of the exe statement +" Changed the order of most division calculation to improve accuracy +" v0.5 Initial upload at 15 July 2004. +" + + +" minimal value of all the given numbers, maximum 20 parameters +fu! s:min(num1,num2,...) + let l:min = a:num1<a:num2 ? a:num1 : a:num2 + + let l:idx = a:0 + wh l:idx > 0 + let l:var = a:{l:idx} + if l:var < l:min + let l:min = l:var + en + let l:idx = l:idx - 1 + endw + retu l:min +endf + +" same as above for maximal value +fu! s:max(num1,num2,...) + let l:max = a:num1>a:num2 ? a:num1 : a:num2 + + let l:idx = a:0 + wh l:idx > 0 + let l:var = a:{l:idx} + if l:var > l:max + let l:max = l:var + en + let l:idx = l:idx - 1 + endw + retu l:max +endf + +" guard the var to be in the range between unity and base. +" if base is omitted, treat like degrees. +fu! s:guard(var,unity,...) + if a:0 + if a:var < a:1 + retu a:1 + elsei a:var > a:unity + retu a:unity + en + retu a:var + en + if a:var < 0 + retu a:unity + (a:var % a:unity) + en + retu a:var % a:unity +endf + +" sub-function + " 8-bit integer to 2 digit hexadecimal + fu! s:to_hex(num) + retu '0123456789abcdef' [a:num/16%16] . '0123456789abcdef' [a:num%16] + endf + +" rgb to rgb color string +fu! s:rgb2colors(red,green,blue) + retu "#".s:to_hex(a:red+0).s:to_hex(a:green+0).s:to_hex(a:blue+0) +endf + +" sub-functions + fu! s:hue2rgb(v1, v2, hue) + " trim to the first period + let l:hue = s:guard(a:hue, 360) + + if l:hue < 60 + retu a:v1 + l:hue * (a:v2 - a:v1) / 60 + en + if l:hue < 180 + retu a:v2 + en + if l:hue < 240 + retu a:v1 + (240 - l:hue) * (a:v2 - a:v1) / 60 + en + retu a:v1 + endf + +" hsl to rgb color string +fu! s:hsb2colors(hue,sat,bri) + " Hue: Any integer degree (modular 360) + " Saturation: 0 to 1023/1023 + " Luminance: 0 to 1023/1023 + " RGB results = 0 to 255 + + if a:sat == 0 + let l:lum = a:bri / 4 + retu s:rgb2colors(l:lum, l:lum, l:lum) + en + + if a:bri < 512 + let l:v2 = a:bri * ( 1023 + a:sat ) + el + let l:v2 = ( a:bri + a:sat ) * 1023 - ( a:sat * a:bri ) + en + + let l:v1 = 2 * 1023 * a:bri - l:v2 + + let l:red = s:hue2rgb(l:v1, l:v2, a:hue + 120) / 4092 + let l:green = s:hue2rgb(l:v1, l:v2, a:hue) / 4092 + let l:blue = s:hue2rgb(l:v1, l:v2, a:hue - 120) / 4092 + + retu s:rgb2colors(l:red, l:green, l:blue) + +endf + +" rgb color number to s:rgb +fu! s:color2rgb(color) + let s:red = a:color / 0x10000 + let s:green = (a:color / 0x100) % 0x100 + let s:blue = a:color % 0x100 +endf + +" rgb to s:hsl +fu! s:rgb2hsb(red,green,blue) + + let l:red = a:red * 1023 / 255 + let l:green = a:green * 1023 / 255 + let l:blue = a:blue * 1023 / 255 + + let l:min = s:min(l:red, l:green, l:blue) + let l:max = s:max(l:red, l:green, l:blue) + let l:delta = l:max - l:min + + let s:bri = (l:max + l:min) / 2 + + if l:delta == 0 + let s:hue = 180 " When sat = 0, hue default to 180 + let s:sat = 0 + el + if s:bri < 512 + let s:sat = l:delta * 1023 / (l:max + l:min) + el + let s:sat = l:delta * 1023 / (2*1023 - l:max - l:min) + en + + let l:del_r = ( (l:max-l:red) + (l:delta*3) ) * 60 / l:delta + let l:del_g = ( (l:max-l:green) + (l:delta*3) ) * 60 / l:delta + let l:del_b = ( (l:max-l:blue) + (l:delta*3) ) * 60 / l:delta + + if l:red == l:max + let s:hue = l:del_b - l:del_g + elsei l:green == l:max + let s:hue = 120 + l:del_r - l:del_b + elsei l:blue == l:max + let s:hue = 240 + l:del_g - l:del_r + en + + let s:hue = s:guard(s:hue, 360) + en +endf + +" sub-functions + if !exists("s:loaded") | let s:hue_range = 0 | let s:hue_phase = 0 | en + fu! s:cast_hue(hue) + retu a:hue * s:hue_range / 360 - s:hue_range / 2 + s:hue_phase + endf + + if !exists("s:loaded") | let s:sat_base = 0 | let s:sat_modify = 0 | en + fu! s:cast_sat(sat) + let l:sat = a:sat * (1024 - s:sat_base) / 1024 + s:sat_base + retu l:sat * s:sat_modify / 100 + endf + + if !exists("s:loaded") | let s:bri_base = 0 | let s:bri_modify = 0 | en + fu! s:cast_bri(bri) + let l:bri = a:bri * (1024 - s:bri_base) / 1024 + s:bri_base + retu l:bri * s:bri_modify / 100 + endf + +" input hsl, do modification in HSL color space, output rgb color string +fu! s:make_hsb(hue,sat,bri) + + let l:hue = s:guard(s:cast_hue(a:hue), 360) + let l:sat = s:guard(s:cast_sat(a:sat), 1023, s:sat_base) + let l:bri = s:guard(s:cast_bri(a:bri), 1023, s:bri_base) + + if s:verbose | ec "\"\tH=".l:hue."\tS=".l:sat."\tL=".l:bri | en + retu s:hsb2colors(l:hue, l:sat, l:bri) + +endf + +" input rgb color number, transfer to HSL, then do <sid>make_hsb +fu! s:make_color(color) + cal s:color2rgb(a:color) + cal s:rgb2hsb(s:red, s:green, s:blue) + retu s:make_hsb(s:hue, s:sat, s:bri) +endf + +" input color string, transfer in HSL, output rgb color string +fu! s:parse_color(p) + if a:p[6] == "#" + let l:p = '0x'.strpart(a:p, 7, 6) + 0 + retu strpart(a:p, 0, 6).s:make_color(l:p) + elsei a:p[6] == "@" + let l:hue = s:guard(strpart(a:p, 7, 3) + 0, 360) + let l:sat = s:guard(strpart(a:p, 10, 4) + 0, 1023, 0) + let l:bri = s:guard(strpart(a:p, 14, 4) + 0, 1023, 0) + retu strpart(a:p, 0, 6).s:make_hsb(l:hue, l:sat, l:bri) + el + retu a:p + en +endf + +if !exists("s:loaded") | let s:verbose = 0 | en +fu! s:psc_hi(group, p1, p2, ...) + if a:0 == 0 + let l:p3 = "gui=NONE" + el + let l:p3 = a:1 + en + let l:p1 = s:parse_color(a:p1) + let l:p2 = s:parse_color(a:p2) + if s:verbose | ec "hi ".a:group." ".l:p1." ".l:p2." ".l:p3 | en + exe "hi ".a:group." ".l:p1." ".l:p2." ".l:p3 +endf + +fu! s:multi_hi(setting, ...) + let l:idx = a:0 + wh l:idx > 0 + let l:hlgroup = a:{l:idx} + if s:verbose | ec "hi ".l:hlgroup." ".a:setting | en + exe "hi ".l:hlgroup." ".a:setting + let l:idx = l:idx - 1 + endw +endf + +" Transfer global variable into script variable +fu! s:init_option(var, value) + if !exists("g:psc_".a:var) + exe "let s:".a:var." = ".a:value + el + let s:{a:var} = g:psc_{a:var} + en +endf + +if !exists("loaded") | let s:file = expand("<sfile>") | en + +cal s:init_option("reload_prefix", "'".fnamemodify(s:file,":p:h")."/'") + +fu! s:psc_reload(...) + + " Only do color for GUI + if !has("gui_running") | retu | en + + if a:0 > 10 + echoe "Too many parameters, ".'a:0 == '.a:0 + retu + en + + com! -nargs=+ InitOpt cal s:init_option(<f-args>) + + if a:0 >= 6 + " Hue = phase +- (range/2) + " Sat = sat * modify% then promoted from base to 1024 + " Bri = bri * modify% then promoted from base to 1024 + + let s:hue_range = a:1 + let s:sat_modify = a:2 + let s:bri_modify = a:3 + + let s:hue_phase = a:4 + let s:sat_base = a:5 + let s:bri_base = a:6 + el + InitOpt hue_range 360 + InitOpt sat_modify 100 + InitOpt bri_modify 100 + + InitOpt hue_phase 180 + InitOpt sat_base 0 + InitOpt bri_base 0 + en + + if a:0 >= 7 + let s:lightbg = a:7 + el + InitOpt style 'cool' + if s:style == 'warm' + InitOpt lightbg 1 + el + InitOpt lightbg 0 + en + en + + if a:0 >= 8 + let s:plainfont = a:8 + el + InitOpt fontface 'mixed' + if s:fontface == 'mixed' + InitOpt plainfont 0 + el + InitOpt plainfont 1 + en + en + + if a:0 >= 9 + let s:verbose = a:9 + el + InitOpt verbose 0 + en + + if a:0 == 10 + let s:reload_filename = a:10 + el + InitOpt reload_filename 'ps_color.vim' + en + + delc InitOpt + + let s:reload_filename = s:reload_prefix.s:reload_filename + + if !filereadable(s:reload_filename) + echoe "Color data file ".s:reload_filename." not found." + retu + en + + se lz + + if !s:lightbg | se bg=dark | el | se bg=light | en + + hi clear + + if exists("syntax_on") | sy reset | en + + " This is mandatory, personally I think it is a bug rather than a feature. + let g:colors_name = expand("<sfile>:t:r") + + + " GUI: + " + " Matrix Reloaded style for gui + " + let s:tempfile = '__Temp_Colors__' + + exe "sil! 1new ".s:tempfile + sil! %d + exe "sil! 0r ".s:reload_filename + if s:verbose + ec '" Reloaded color scheme from '.s:reload_filename + ec '" with param ' s:hue_range s:sat_modify s:bri_modify + \s:hue_phase s:sat_base s:bri_base s:lightbg s:plainfont + ec '" ' + en + + if !s:lightbg + sil! 1,/^\s*" DARK COLOR DEFINE START$/d + sil! /^\s*" DARK COLOR DEFINE END$/,$d + el + sil! 1,/^\s*" LIGHT COLOR DEFINE START$/d + sil! /^\s*" LIGHT COLOR DEFINE END$/,$d + en + + sil! 0 + let s:nnb = 1 + com! -nargs=+ PscHi cal s:psc_hi(<f-args>) + wh 1 + let s:nnb = nextnonblank(s:nnb) + if !s:nnb | brea | en + + let s:line = getline(s:nnb) + + let s:nnb = s:nnb + 1 + + " Skip invalid lines + if s:line !~ '^\s*hi\%[ghlight]\s*.*' | con | en + + exe substitute(s:line, '\<hi\%[ghlight]\>', 'PscHi', '') + endw + sil! q! + delc PscHi + + " Enable the bold style + com! -nargs=+ MultiHi cal s:multi_hi(<f-args>) + if !s:plainfont + MultiHi gui=bold Question StatusLine DiffText Statement Type MoreMsg ModeMsg NonText Title VisualNOS DiffDelete + endif + delc MultiHi + + " Color Term: + " Are you crazy? + + + " Term: + " Don't be silly... + + + " Links: + " Something sensible + + exe "sil! 1new ".s:tempfile + sil! %d + exe "sil! 0r ".s:reload_filename + + sil! 1,/^\s*" COLOR LINKS DEFINE START$/d + sil! /^\s*" COLOR LINKS DEFINE END$/,$d + + sil! 0 + let s:nnb = 1 + wh 1 + let s:nnb = nextnonblank(s:nnb) + if !s:nnb + brea + en + let s:line = getline(s:nnb) + + let s:nnb = s:nnb + 1 + " Skip invalid lines + if s:line !~ '^\s*hi\%[ghlight]\s*.*' | con | en + + if s:verbose | ec s:line | en + + sil! exe s:line + endw + sil! q! + +endf + +" To flag the script variables are initialized +let s:loaded = 1 + +com! -nargs=* Reload cal <SID>psc_reload(<f-args>) + +" vim:et:nosta:sw=2:ts=8: +" HelpExtractor: +" The document {{{2 +fu! s:extract_help() + se lz + let docdir = substitute(s:file, '\<colors[/\\].*$', 'doc', '') + if !isdirectory(docdir) + if has("win32") + echoe 'Please make '.docdir.' directory first' + unl docdir + return + elsei !has("mac") + exe "!mkdir ".docdir + en + en + + let curfile = fnamemodify(s:file, ":t:r") + let docfile = substitute(fnamemodify(s:file, ":r").".txt", + \'\<colors\>', 'doc', '') + exe "silent! 1new ".docfile + sil! %d + exe "silent! 0r ".fnamemodify(s:file, ":p") + sil! 1,/^" HelpExtractorDoc:$/d + norm! GVkkd + cal append(line('$'), '') + cal append(line('$'), 'v' . 'im:tw=78:ts=8:noet:ft=help:fo+=t:norl:noet:') + sil! wq! + exe "helptags ".substitute(docfile,'^\(.*doc.\).*$','\1','e') + + exe "silent! 1new ".fnamemodify(s:file, ":p") + 1 + sil! /^" HelpExtractor:$/,$g/.*/d + sil! wq! + + noh +endf + +cal s:extract_help() +fini + +" --------------------------------------------------------------------- +" Put the help after the HelpExtractorDoc label... +" HelpExtractorDoc: +*reloaded.txt* Color Tuner and Reloader Last change: 16 July 2004 + + +PERSONAL COLOUR TUNER AND RELOADER *psc_reload* + + +Author: Pan, Shizhu. <dicpan> at <hotmail o com> > + (prepend '[VIM]' in the title or your mail may be silently removed.) +< +============================================================================== +CONTENTS *pcr* *pcr-contents* + + 1. Contents.....................|pcr-contents| + 2. PCR Overview.................|pcr-overview| + 3. PCR Usage....................|pcr-usage| + 4. PCR Options..................|pcr-options| + 5. PCR FAQ .....................|pcr-faq| + 6. PCR Todo List................|pcr-todo| + +For release notes, please see the header of reloaded.vim + +============================================================================== +PCR FEATURES OVERVIEW *pcr-features* *pcr-overview* + + Features ~ + + . PCR is a color scheme tuner and reloader. + . PCR is an optional utility for ps_color as well as other schemes + . It tunes the whole color scheme in HSL color space. + . Thousands of color styles can be achieved by HSL tuning. + . Tuned output can be saved to create new color schemes. + . Can be configured to tune your own color scheme. + . Works under GUI only, do not affect console version. + + Design Concern ~ + + When I'm designing the color scheme |ps_color|, I realized it is + extremely difficult to fine-tune the color, the whole step is not at + all straight forward. What is more, RGB is not quite comprehensive + for most average people. It would be much better if it is possible to + tune the color scheme in HSL color space. Many color schemes in vim + are actually similar, just some tune in the HSL color space. + + It is very easy to understand HSL color space even if one has NO + previous knowledge. This may be another reason to use HSL color + space. + + Portability ~ + + Before playing the game of colors, you are strongly recommended to + adjust your monitor to 6500k color temperature and proper gamma curve. + This has been described in the |ps_color.txt| at the same + "Portability" section. If you don't know how, just skip it. + + The only portability issue, for the obvious reason, this is GUI only. + ;-) + +============================================================================== +PSC USAGE *pcr-usage* + + For the impatient ~ + + Make sure both ps_color.vim and reloaded.vim are in your + [runtimepath]/colors and type in the following command > + + :colo reloaded +< + in your Vim or append to your |.vimrc|. The [runtimepath] can be any + 'writable' directory listed in |vimfiles|, normally your $HOME/.vim in + Unix or $HOME/vimfiles in Windows. + + Note that you don't need to remove your current :colo lines in .vimrc, + since the :colo reloaded does nothing on color scheme, the + reloaded.vim has to be a color scheme for some bizarre reason. + + Note if you do not want to have ps_color.vim, go to FAQ section to see + how to create your own. + + Experiencing ~ + + Normally, nothing will happen when you sourced the colorscheme + reloaded, this only enables the command :Reload. + + The :Reload command will be available after you sourced the + colorscheme reloaded. If not, type :colo reloaded now. + + Now try the following: +> + :Reload 60 100 100 120 341 0 0 0 0 +< + If you do as above, you will get a greenish feeling like "Matrix + reloaded". You can run the Reload command in vim command line as well + as in .vimrc. To see what the :Reload is capable of, try the + following, one by one: +> + :Reload 120 100 100 60 341 128 + :Reload 120 100 100 60 341 0 1 + :Reload 480 84 84 195 256 96 0 + :Reload 720 71 100 360 0 0 0 + :Reload 60 100 100 150 341 0 0 + :Reload 240 120 100 330 341 0 1 + :Reload 360 100 100 180 0 0 0 1 + :Reload 360 100 100 180 0 0 1 0 +< + (Hint: choose a document which has as much highlight as possible to + see what the come scheme looks like. Vim scripts or Vim help documents + may be good samples.) + + . The first line will give you a golden feeling, followed by + a reversed version. + . Next comes a low contrast dark-cyan-background scheme. + . Next comes a black background with decreased saturation. + . The Hue can be changed anyway. This is a cyan-green style, call it + "Matrix revolution"? + . Be hot, lets try a reddish style. + . The last two lines will give you the same as ps_color 'cool' and + 'warm' style. + + Are you amazed? I guess so. And, of course all the above can be + further fine-tuned. + + If you want to explore the mysteries inside this, see the next + section. + +============================================================================== +PCR OPTIONS *pcr-options* + + Since it is much easier and straight forward to specify command line + arguments, there are no need to create individual options. Here we + describe the 10 parameters. + + Synopsis ~ + + :Reload h_r s_m l_m h_p s_b l_b [ lbg [ pf [ vb [ cdf ] ] ] ] + + Scope ~ + + Hue is the dominant parameter to a color, because the human eye is + very sensitive to the changing of hue. Generally, the hue is + expressed by angle, can be 0 to 360 degrees, where 359 degree is equal + to -1 degree, 360 degree is equal to 0 degree, 361 degree is equal to + 1 degree, etc. + + The human eye is less sensitive to Saturation, the Black, Grey, and + White has saturation=0, The pure Red, Green, and Blue has + saturation=max, usually, saturation is defined to be between 0 and 1. + But Vim is not capable of handling floating points, so I defined the + saturation to be between 0 and 1023. + + The saturation is the amount the different color elements differs, if + the red, green, blue are similar, the saturation is low. + + The human eye is least sensitive to Luminance, since the dynamic range + of human eye can be changed on the fly. The luminance, or to say + brightness, needs no explanation, since the meaning is quite obvious. + + The Luminance is also defined to be 0 to 1023, for the same reason. + + Parameter h_r and h_p ~ + + This refers to hue range and hue phase. + + set the hue range to any positive value, the hue will be in the range + of hue_phase-(hue_range/2) to hue_phase-(hue_range/2) + + The normal hue is from 0 to 360, let hue_range=360 and hue_phase=180 + will have the range 0 to 360, hence the hue of original color scheme + will be retained. + + Set the hue range to between 0 and 360 will have the hue range + compressed, or to say a color-filtered look. Set the hue range to + 0 will force all colors in the color scheme to have the same hue value + as hue_phase. You may not want it to be that low, since the + hue_range=60 will in most cases enough to give the whole color scheme + a color-filtered look. + + Set the hue range to >360 will have the color changed without compress + the hue range, the behavior is not easy to describe, you need to do + more experiments to understand what it does. + + Set the hue range to <0 is illegal. + + The hue_phase is the base value the whole color scheme designed + around. Usually, the Hue=0 is Red, Hue=60 is Yellow, Hue=120 is + Green, Hue=180 is Cyan, Hue=240 is Blue, Hue=300 is Magenta, any other + value is between two color, for example, Hue=30 is Orange color. + + It would be very interesting to see how a color scheme changes when + change the hue_phase. + + Parameter s_m and s_b ~ + + This refers to saturation modify and saturation base + + The saturation modify is a percent value, 100 means no modify. + If set to 50, all saturation will be decreased to 50%, + If set to 0, the screen will be black and white (greyscale), + If set to 200, all saturation will be increased to 200% times the + original value. + + The saturation base is a linear value, it defines the minimum + saturation. + If set to 0, the saturation will not be modified. + If set to 256, the minimum saturation will be 1/4. + If set to 341, the minimum saturation will be 1/3. + If set to 512, the minimum saturation will be 1/2. + + Oops, please _note_ that a too high value of saturation is not quite + comfortable for most people. + + Parameter l_m and l_b ~ + + This refers to luminance modify and luminance base + + The luminance modify is a percent value, 100 means no modify. + If set to 50, all luminance will be decreased to 50%, + If set to 0, the screen will be completely dark (can be possibly used + for boss key?) + If set to 200, all luminance will be increased to 200% times the + original value. + + The luminance base is a linear value, it defines the minimum + luminance. + + Main use of this is to tune the background for a dark background + colorscheme. + If set to 0, the background will be black. + If set to 128, the background will be a 1/8 dark one, the color of + background can be tuned by saturation_base and hue_phase. + If set to 1023, the screen will be completely white. + + For light background, it is recommended to set luminance base to 0. + + + Parameter lbg ~ + + This refers to light background + + when set to 1, the reloader choose a light background scheme and set + bg to light, otherwise, it is set to 0. + + This options is optional, if omitted, it checks the value of + g:psc_style, if the style is 'warm', the light background is set to 1. + + Parameter pf ~ + + This refers to plain font + + Optional, set to 1 will turn all bolded font to plain font. + When not set, will check for g:psc_fontface, if non-exists, + default to 0. + + Parameter vb ~ + + This refers to 'verbose' + + When set to 1, some debug messages will be echoed when running the + command. + + Parameter cdf ~ + + This refers to custom data file + + The default data file is the ps_color.vim placed at the same directory + as reloaded.vim. You can set it to any file you want. + + When present, it should be the file name of your data file. + For example, if your data file is ~/.vim/colors/template.vim: +> + :Reload 360 100 100 180 0 0 1 0 0 template.vim +< + will reload the light color scheme in template.vim + *pcr-custom-data* + Designing a data file ~ + + The data file can be a normal color scheme script, such as + ps_color.vim, You may need to know more if you want to do + modifications. + + The ps_color.vim is fairly complicated, but only part of the file are + imported as data. Mainly, you only need to see how it organizes + statements in between "DEFINE START" and "DEFINE END" blocks. + + The data file should conform to some restrictions: + + . Must be in the same directory as reloaded.vim + + . ALL highlight group must be defined, do not accept any default + value, this include the Underline and Ignore groups, this also hints + that both foreground and background must be defined. Use :ru + syntax/hitest.vim to check if all highlight groups are defined. + + . Color names like "SlateBlue" should not be used, only hardcoded color + like #rrggbb is acceptable, the fg and bg can be used though, Since + fg and bg comes from the group Normal, and Normal group must be + defined with #rrggbb form of foreground and background. + + . The following should exist in the file +> + " DARK COLOR DEFINE START + " DARK COLOR DEFINE END + " LIGHT COLOR DEFINE START + " LIGHT COLOR DEFINE END + " COLOR LINKS DEFINE START + " COLOR LINKS DEFINE END +< + the highlight statement should be placed in between START and END. + All statement other than the 'highlight' will be silently discarded. + + You can put dark color scheme defines in dark color define section, + or light color scheme in light color section. It doesn't matter if + you have nothing in the section, since the defaults are used. + However, the defaults will not be tuned in the HSL color space, + which may be you want, and may not! + + Further statements can be put in color links define section, you can + put any 'highlight' statements in this section since the statements + in this section will be execute unparsed, if you want to manually + change some groups in a reloaded scheme, put something there. + + +============================================================================== +PCR FAQ AND TIPS *pcr-faq* +> + Q: How to make my own color to be tunable? +< + A: Your own color scheme must conform to some restrictions, + see |pcr-custom-data| for details. +> + Q: How to run reloaded.vim without having ps_color.vim? +< + A: reloaded.vim is just a utility to reload colorscheme, it does not + contain any colors. You must have a data file, or to say + colorscheme, contains the 'highlight' statements like those in + ps_color.vim, and tell the reloaded.vim to use that file. + Instructions on creating custom data file is described in + |pcr-custom-data|. +> + Q: How to export the tuned output to create new color scheme? +< + A: This is still under construction, currently you can set verbose in + the command line parameter and capture the output, but it is not + working very well. +> + Q: Why this should be a colorschme instead of a plugin utility? +< + A: This seems to be a Vim bug (or to say 'feature' if you prefer), the + main function will hang up if run as a plugin and you will not be + able to source the colorscheme in the current Vim session, so, + please put reloaded.vim in ~/.vim/colors, do NOT put it in + ~/.vim/plugin ! +> + Q: Why it is impossible to browse functions in reloaded.vim with + taglist plugin? +< + A: The old versions of exuberant ctags utility do not cope with <sid> + functions very well, please download and recompile the newest + version of exuberant ctags utility. + + +============================================================================== +PCR TODO LIST *pcr-todo* + + o Fix the remaining bugs. + o Try to be able to parse color names + o Improve the output feature + +============================================================================== +vim:et:nosta:sw=2:ts=8: +}}}2 vim600:fdm=marker:fdl=1: diff --git a/dot_vim/colors/revolutions.vim b/dot_vim/colors/revolutions.vim new file mode 100644 index 0000000..15450c9 --- /dev/null +++ b/dot_vim/colors/revolutions.vim @@ -0,0 +1,75 @@ +" MATRIX-REVOLUTIONS colorscheme +" Author: Christian MICHON +" Version: 1.0 +" Last Change: 23 Jun 2004 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = 'revolutions' + +hi Boolean guifg=#e6fff3 guibg=#43705a gui=none +hi Character guifg=#e6fff3 guibg=#43705a gui=none +hi Comment guifg=#43705a guibg=#000000 gui=underline +hi Conditional guifg=#e6fff3 guibg=#000000 gui=bold +hi Constant guifg=#e6fff3 guibg=#43705a gui=none +hi Cursor guifg=#43705a guibg=#e6fff3 gui=none +hi Debug guifg=#61a181 guibg=#000000 gui=none +hi Define guifg=#e6fff3 guibg=#000000 gui=none +hi Delimiter guifg=#61a181 guibg=#000000 gui=none +hi DiffAdd guifg=#e6fff3 guibg=#43705a gui=bold +hi DiffChange guifg=#e6fff3 guibg=#43705a gui=none +hi DiffDelete guifg=#e6fff3 guibg=#43705a gui=none +hi DiffText guifg=#000000 guibg=#e6fff3 gui=bold +hi Directory guifg=#e6fff3 guibg=#000000 gui=none +hi Error guifg=#e6fff3 guibg=#61a181 gui=bold +hi ErrorMsg guifg=#e6fff3 guibg=#61a181 gui=bold +hi Exception guifg=#e6fff3 guibg=#000000 gui=bold +hi Float guifg=#e6fff3 guibg=#43705a gui=none +hi FoldColumn guifg=#9bcfb5 guibg=#43705a gui=bold +hi Folded guifg=#9bcfb5 guibg=#43705a gui=bold +hi Function guifg=#e6fff3 guibg=#000000 gui=none +hi Identifier guifg=#e6fff3 guibg=#000000 gui=none +hi Ignore guifg=#000000 guibg=#000000 gui=none +hi Include guifg=#e6fff3 guibg=#000000 gui=none +hi IncSearch guifg=#1d3026 guibg=#61a181 gui=bold +hi Keyword guifg=#e6fff3 guibg=#000000 gui=bold +hi Label guifg=#e6fff3 guibg=#000000 gui=bold +hi lCursor guifg=#43705a guibg=#e6fff3 gui=none +hi LineNr guifg=#9bcfb5 guibg=#000000 gui=bold +hi Macro guifg=#e6fff3 guibg=#000000 gui=none +hi ModeMsg guifg=#9bcfb5 guibg=#000000 gui=bold +hi MoreMsg guifg=#9bcfb5 guibg=#000000 gui=bold +hi NonText guifg=#9bcfb5 guibg=#1d3026 gui=bold +hi Normal guifg=#9bcfb5 guibg=#000000 gui=none +hi Number guifg=#e6fff3 guibg=#000000 gui=none +hi Operator guifg=#e6fff3 guibg=#000000 gui=bold +hi PreCondit guifg=#e6fff3 guibg=#000000 gui=none +hi PreProc guifg=#61a181 guibg=#000000 gui=none +hi Question guifg=#9bcfb5 guibg=#000000 gui=bold +hi Repeat guifg=#e6fff3 guibg=#000000 gui=bold +hi Search guifg=#1d3026 guibg=#61a181 gui=bold +hi Special guifg=#61a181 guibg=#000000 gui=none +hi SpecialChar guifg=#61a181 guibg=#000000 gui=none +hi SpecialComment guifg=#61a181 guibg=#000000 gui=none +hi SpecialKey guifg=#9bcfb5 guibg=#000000 gui=none +hi Statement guifg=#e6fff3 guibg=#000000 gui=bold +hi StatusLine guifg=#e6fff3 guibg=#61a181 gui=bold +hi StatusLineNC guifg=#1d3026 guibg=#61a181 gui=bold +hi StorageClass guifg=#f070a0 guibg=#000000 gui=bold +hi String guifg=#e6fff3 guibg=#000000 gui=none +hi Structure guifg=#f070a0 guibg=#000000 gui=bold +hi Tag guifg=#61a181 guibg=#000000 gui=none +hi Title guifg=#e6fff3 guibg=#1d3026 gui=bold +hi Todo guifg=#1d3026 guibg=#9bcfb5 gui=none +hi Type guifg=#e6fff3 guibg=#000000 gui=bold +hi Typedef guifg=#f070a0 guibg=#000000 gui=bold +hi Underlined guifg=#e6fff3 guibg=#000000 gui=underline +hi VertSplit guifg=#61a181 guibg=#61a181 gui=none +hi Visual guifg=#e6fff3 guibg=#61a181 gui=none +hi VisualNOS guifg=#9bcfb5 guibg=#000000 gui=underline +hi WarningMsg guifg=#1d3026 guibg=#61a181 gui=bold +hi WildMenu guifg=#43705a guibg=#e6fff3 gui=none diff --git a/dot_vim/colors/robinhood.vim b/dot_vim/colors/robinhood.vim new file mode 100644 index 0000000..b6eb1bd --- /dev/null +++ b/dot_vim/colors/robinhood.vim @@ -0,0 +1,99 @@ +" vim: set tw=0 sw=4 sts=4 et: + +" Vim color file +" Maintainer: Datila Carvalho <datila@saci.homeip.net> +" Last Change: November, 3, 2003 +" Version: 0.1 + +" This is a VIM's version of the emacs color theme +" _Robin Hood_ created by Alex Schroede. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "robinhood" + + +""" Colors + +" GUI colors +hi Cursor guifg=fg guibg=gray +hi CursorIM guifg=NONE guibg=gray +"hi Directory +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg gui=bold guifg=White guibg=Red +"hi VertSplit +"hi Folded +"hi FoldColumn +"hi IncSearch +"hi LineNr +"hi ModeMsg +"hi MoreMsg +"hi NonText +hi Normal guibg=#304020 guifg=navajowhite +"hi Question +hi Search gui=bold guifg=Black guibg=gray +"hi SpecialKey +hi StatusLine guifg=palegreen +hi StatusLineNC guifg=yellowgreen +"hi Title +hi Visual guifg=darkslategrey guibg=fg +hi VisualNOS gui=bold guifg=Black guibg=fg +hi WarningMsg guifg=White guibg=Tomato +"hi WildMenu + +" Colors for syntax highlighting +hi Comment guifg=lightblue + +hi Constant gui=bold guifg=lightcyan + hi String guifg=lightsalmon + hi Character guifg=lightsalmon + hi Number gui=bold guifg=lightcyan + hi Boolean gui=bold guifg=lightcyan + hi Float gui=bold guifg=lightcyan + +hi Identifier gui=bold guifg=palegreen + hi Function guifg=yellowgreen + +hi Statement gui=bold guifg=salmon + hi Conditional gui=bold guifg=salmon + hi Repeat gui=bold guifg=salmon + hi Label guifg=salmon + hi Operator guifg=salmon + "hi Keyword + "hi Exception + +hi PreProc guifg=palegreen + hi Include gui=bold guifg=palegreen + hi Define guifg=palegreen + hi Macro guifg=aquamarine + hi PreCondit guifg=palegreen + +hi Type gui=bold guifg=palegreen + hi StorageClass gui=bold guifg=aquamarine + hi Structure gui=bold guifg=aquamarine + hi Typedef gui=bold guifg=aquamarine + +"hi Special + ""Underline Character + "hi SpecialChar gui=underline + "hi Tag gui=bold,underline + ""Statement + "hi Delimiter gui=bold + ""Bold comment (in Java at least) + "hi SpecialComment gui=bold + "hi Debug gui=bold + +hi Underlined gui=underline + +hi Ignore guifg=bg + +hi Error gui=bold guifg=White guibg=Red + +"hi Todo diff --git a/dot_vim/colors/sand.vim b/dot_vim/colors/sand.vim new file mode 100644 index 0000000..cc673df --- /dev/null +++ b/dot_vim/colors/sand.vim @@ -0,0 +1,30 @@ +" Vim color file +" Maintainer: Tim Alexeevsky <realtim@mail.ru> +" Last Change: 2002-03-14 +" Version: 0.5 +" URL: http://sunsite.cs.msu.su/~tim/vim/sand.vim +" +" Thanx to Hans Fugal for his colorscheme_template.vim + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="sand" + +highlight Normal guibg=cornsilk guifg=NONE +highlight PreProc guibg=NONE guifg=Maroon4 +highlight Comment guibg=NONE guifg=SteelBlue4 +highlight Constant guibg=NONE guifg=NavajoWhite4 +highlight Special guibg=NONE guifg=SlateBlue4 +highlight Identifier guibg=NONE guifg=SeaGreen +highlight Statement guibg=NONE guifg=bisque4 +highlight Type guibg=NONE guifg=DarkOliveGreen +highlight Todo guibg=LightYellow3 guifg=Blue4 +highlight NonText guibg=NONE guifg=DarkGreen +highlight LineNr guibg=NONE guifg=Brown +highlight StatusLineNC guifg=#8090a0 +highlight StatusLine guifg=#005070 + +"vim: tw=0 sw=3 ts=3 sts=3 et diff --git a/dot_vim/colors/scite.vim b/dot_vim/colors/scite.vim new file mode 100644 index 0000000..609ad98 --- /dev/null +++ b/dot_vim/colors/scite.vim @@ -0,0 +1,48 @@ +" Vim color file +" Maintainer: Gergely Kontra <kgergely@mcl.hu> +" Last Change: 2002. 04. 09. + +" I'm a bit red-blind, so if you have suggestions, don't hesitate :) +" ^^^^^^^^^ Sorry, I cannot speak English well, just want to say, +" that in some rare cases I cannot distinguish between some colors +" (I've just realized it, when I see some special tests) + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +"colorscheme default +let g:colors_name = "scite" + +" hardcoded colors : + +" GUI +"highlight Normal guifg=#7F6F5F guibg=#eeeeee +highlight Normal guifg=#7F6F5F guibg=#ffffff +highlight Search guibg=#bbbbbb gui=bold +highlight Visual guifg=#DADADA +highlight Folded guifg=#ffffff guibg=#666666 +highlight Cursor guifg=#666666 guibg=#000000 gui=bold +highlight Special guifg=#7F007F guibg=#eeeeff gui=bold +highlight Comment guifg=#007F00 guibg=#eeeeee +highlight StatusLine guifg=#000000 guibg=#aacccc +highlight StatusLineNC guifg=#557777 guibg=#ffffff +highlight Statement guifg=#007F7F gui=bold +highlight Type guifg=#0000ff gui=NONE +highlight Function guifg=#007F7F gui=bold +highlight LineNr guifg=#000000 guibg=#bbbbbb +highlight FoldColumn guifg=#000000 guibg=#dddddd +highlight Define guifg=#00007F guibg=#ddddff gui=bold +highlight Number guifg=#000000 guibg=#eeffff gui=bold +highlight Subtitle guifg=#000000 guibg=#66bbbb gui=bold,underline +highlight String guifg=#7F007F guibg=#ffdddd +highlight Delimiter guifg=#000000 guibg=#dde0dd gui=bold +highlight PreProc guifg=#0000ff guibg=#ffffff gui=bold +highlight Constant guifg=#000000 guibg=#aaaaaa gui=underline,bold + +"{{{ + +"}}} + + diff --git a/dot_vim/colors/sea.vim b/dot_vim/colors/sea.vim new file mode 100644 index 0000000..0c79c47 --- /dev/null +++ b/dot_vim/colors/sea.vim @@ -0,0 +1,69 @@ +" Vim color file +" Maintainer: Tiza +" Last Change: 2002/10/30 Wed 00:01. +" version: 1.0 +" This color scheme uses a dark background. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "sea" + +hi Normal guifg=#f0f0f8 guibg=#343478 + +" Search +hi IncSearch gui=UNDERLINE,BOLD guifg=#ffffff guibg=#c030ff +hi Search gui=BOLD guifg=#f0e0ff guibg=#b020ff + +" Messages +hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#f000a0 +hi WarningMsg gui=BOLD guifg=#ffffff guibg=#f000a0 +hi ModeMsg gui=BOLD guifg=#00e0ff guibg=NONE +hi MoreMsg gui=BOLD guifg=#00ffff guibg=#6060ff +hi Question gui=BOLD guifg=#00f0d0 guibg=NONE + +" Split area +hi StatusLine gui=NONE guifg=#000000 guibg=#d0d0e0 +hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0 +hi VertSplit gui=NONE guifg=#606080 guibg=#d0d0e0 +hi WildMenu gui=NONE guifg=#000000 guibg=#ff90ff + +" Diff +hi DiffText gui=UNDERLINE guifg=#ffff00 guibg=#000000 +hi DiffChange gui=NONE guifg=#ffffff guibg=#000000 +hi DiffDelete gui=NONE guifg=#60ff60 guibg=#000000 +hi DiffAdd gui=NONE guifg=#60ff60 guibg=#000000 + +" Cursor +hi Cursor gui=NONE guifg=#ffffff guibg=#d86020 +hi lCursor gui=NONE guifg=#ffffff guibg=#e000b0 +hi CursorIM gui=NONE guifg=#ffffff guibg=#e000b0 + +" Fold +hi Folded gui=NONE guifg=#ffffff guibg=#0080a0 +hi FoldColumn gui=NONE guifg=#9090ff guibg=#3c3c88 + +" Other +hi Directory gui=NONE guifg=#00ffff guibg=NONE +hi LineNr gui=NONE guifg=#7070e8 guibg=NONE +hi NonText gui=BOLD guifg=#8080ff guibg=#2c2c78 +hi SpecialKey gui=BOLD guifg=#60c0ff guibg=NONE +hi Title gui=BOLD guifg=#f0f0f8 guibg=NONE +hi Visual gui=NONE guifg=#ffffff guibg=#6060ff +" hi VisualNOS gui=NONE guifg=#ffffff guibg=#6060ff + +" Syntax group +hi Comment gui=NONE guifg=#b0b0c8 guibg=NONE +hi Constant gui=NONE guifg=#60ffff guibg=NONE +hi Error gui=BOLD guifg=#ffffff guibg=#f000a0 +hi Identifier gui=NONE guifg=#c0c0ff guibg=NONE +hi Ignore gui=NONE guifg=#303080 guibg=NONE +hi PreProc gui=NONE guifg=#ffb0ff guibg=NONE +hi Special gui=NONE guifg=#ffd858 guibg=NONE +hi Statement gui=NONE guifg=#f0f060 guibg=NONE +hi Todo gui=BOLD,UNDERLINE guifg=#ff70e0 guibg=NONE +hi Type gui=NONE guifg=#40ff80 guibg=NONE +hi Underlined gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=NONE diff --git a/dot_vim/colors/sean.vim b/dot_vim/colors/sean.vim new file mode 100644 index 0000000..1aa2b1e --- /dev/null +++ b/dot_vim/colors/sean.vim @@ -0,0 +1,83 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer:Sean Richards +" Last Change:Fri Aug 30 8:50 2002 NZST + +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "sean" +hi Normal guifg=white guibg=black +hi SpecialKey guifg=Blue +hi NonText gui=bold guifg=Blue +hi Directory guifg=Blue +hi ErrorMsg guifg=White guibg=Red +hi Search guifg=white guibg=Red +hi MoreMsg gui=bold guifg=SeaGreen +hi ModeMsg gui=bold guifg=White guibg=Blue +hi LineNr ctermfg=Darkyellow guifg=Yellow +hi Question gui=bold guifg=Green +hi StatusLineNC cterm=none ctermfg=grey ctermbg=darkblue gui=NONE guifg=white guibg=darkblue +hi StatusLine cterm=none ctermfg=white ctermbg=darkblue gui=bold guifg=white guibg=darkblue +hi VertSplit gui=bold guifg=White guibg=darkblue +hi Title gui=bold guifg=Magenta +hi Visual cterm=none ctermfg=white ctermbg=darkgreen gui=NONE guifg=white guibg=darkgreen +hi WarningMsg guifg=Red +hi FoldColumn ctermfg=Black ctermbg=Grey guibg=DarkGrey guifg=Black +hi Folded ctermfg=Black ctermbg=Grey guifg=Black +hi Cursor guifg=bg guibg=Green +hi Comment cterm=none ctermfg=darkgreen gui=italic guifg=green +hi Constant ctermfg=darkcyan guifg=darkcyan +hi Special ctermfg=darkyellow guifg=Orange +hi Identifier ctermfg=cyan guifg=cyan +hi Statement ctermfg=darkyellow gui=bold guifg=darkyellow +hi Number ctermfg=Cyan guifg=Cyan +hi PreProc ctermfg=darkmagenta guifg=darkmagenta +hi String ctermfg=darkred guifg=Red +hi Type ctermfg=darkblue guifg=blue +hi Error ctermfg=red guifg=Red guibg=Black +hi Todo ctermfg=blue ctermbg=yellow guifg=Blue guibg=Yellow +hi link IncSearch Visual +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special + + +"Toggle semicolon matching at the end of lines, author unknown! +nmap <silent> <leader>sc :call ToggleSemicolonHighlighting()<cr> +"{{{ +function! ToggleSemicolonHighlighting() + if exists("b:semicolon") + unlet b:semicolon + hi semicolon guifg=NONE gui=NONE ctermfg=NONE + else + syn match semicolon #;$# + hi semicolon guifg=red gui=bold ctermfg=1 + let b:semicolon = 1 + endif +endfunction +"}}} diff --git a/dot_vim/colors/seashell.vim b/dot_vim/colors/seashell.vim new file mode 100644 index 0000000..130785d --- /dev/null +++ b/dot_vim/colors/seashell.vim @@ -0,0 +1,32 @@ +" Vim color file +" Maintainer: Gerald S. Williams +" Last Change: 2003 Apr 17 + +" This is very reminiscent of a seashell. Good contrast, yet not too hard on +" the eyes. This is something of a cross between zellner and peachpuff, if +" such a thing is possible... +" +" Only values that differ from defaults are specified. + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "seashell" + +hi Normal guibg=seashell ctermbg=Gray ctermfg=Black +hi NonText guibg=LavenderBlush guifg=Gray30 +hi LineNr guibg=LavenderBlush guifg=Gray30 +hi DiffDelete guibg=LightRed guifg=Black ctermbg=DarkRed ctermfg=White +hi DiffAdd guibg=LightGreen ctermbg=DarkGreen ctermfg=White +hi DiffChange guibg=Gray90 ctermbg=DarkCyan ctermfg=White +hi DiffText gui=NONE guibg=LightCyan2 ctermbg=DarkCyan ctermfg=Yellow +hi Comment guifg=MediumBlue +hi Constant guifg=DeepPink +hi PreProc guifg=DarkMagenta +hi StatusLine guibg=White guifg=DarkSeaGreen cterm=None ctermfg=White ctermbg=DarkGreen +hi StatusLineNC gui=None guibg=Gray +hi VertSplit gui=None guibg=Gray +hi Identifier guifg=#006f6f +hi Statement ctermfg=DarkRed diff --git a/dot_vim/colors/sf.vim b/dot_vim/colors/sf.vim new file mode 100644 index 0000000..5b3033f --- /dev/null +++ b/dot_vim/colors/sf.vim @@ -0,0 +1,76 @@ +" GUI-only vim color file, based on colors from vim.sf.net +" Author: Christian MICHON +" Email: christian_michon@yahoo.fr +" Version: 1.1 +" Last Change: 28 Jul 2004 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "sf" + +hi Boolean guifg=#007f00 guibg=#f0f0dd gui=none +hi Character guifg=#007f00 guibg=#f0f0dd gui=none +hi Comment guifg=#b0b0b0 guibg=#f0f0dd gui=underline +hi Conditional guifg=#0000ee guibg=#f0f0dd gui=bold +hi Constant guifg=#007f00 guibg=#f0f0dd gui=none +hi Cursor guifg=#f0f0dd guibg=#cc0000 gui=none +hi Debug guifg=#0000ee guibg=#f0f0dd gui=none +hi Define guifg=#cc0000 guibg=#f0f0dd gui=none +hi Delimiter guifg=#0000ee guibg=#f0f0dd gui=none +hi DiffAdd guifg=#551a8b guibg=#007f00 gui=bold +hi DiffChange guifg=#f0f0dd guibg=#007f00 gui=none +hi DiffDelete guifg=#551a8b guibg=#007f00 gui=none +hi DiffText guifg=#f0f0dd guibg=#551a8b gui=bold +hi Directory guifg=#cc0000 guibg=#f0f0dd gui=underline +hi Error guifg=#ffffff guibg=#cc0000 gui=bold +hi ErrorMsg guifg=#ffffff guibg=#cc0000 gui=bold +hi Exception guifg=#0000ee guibg=#f0f0dd gui=bold +hi Float guifg=#007f00 guibg=#f0f0dd gui=none +hi FoldColumn guifg=#f0f0dd guibg=#007f00 gui=bold +hi Folded guifg=#f0f0dd guibg=#007f00 gui=bold +hi Function guifg=#cc0000 guibg=#f0f0dd gui=none +hi Identifier guifg=#cc0000 guibg=#f0f0dd gui=none +hi Ignore guifg=#f0f0dd guibg=#f0f0dd gui=none +hi Include guifg=#cc0000 guibg=#f0f0dd gui=none +hi IncSearch guifg=#ffffff guibg=#38d878 gui=bold +hi Keyword guifg=#0000ee guibg=#f0f0dd gui=bold +hi Label guifg=#0000ee guibg=#f0f0dd gui=bold +hi lCursor guifg=#000066 guibg=#f0f0dd gui=none +hi LineNr guifg=#b0b0b0 guibg=#007f00 gui=bold +hi Macro guifg=#cc0000 guibg=#f0f0dd gui=none +hi ModeMsg guifg=#000066 guibg=#f0f0dd gui=bold +hi MoreMsg guifg=#551a8b guibg=#f0f0dd gui=bold +hi NonText guifg=#b0b0b0 guibg=#f0f0dd gui=bold +hi Normal guifg=#000066 guibg=#f0f0dd gui=none +hi Number guifg=#007f00 guibg=#f0f0dd gui=none +hi Operator guifg=#0000ee guibg=#f0f0dd gui=bold +hi PreCondit guifg=#cc0000 guibg=#f0f0dd gui=none +hi PreProc guifg=#cc0000 guibg=#f0f0dd gui=none +hi Question guifg=#551a8b guibg=#f0f0dd gui=bold +hi Repeat guifg=#0000ee guibg=#f0f0dd gui=bold +hi Search guifg=#ffffff guibg=#38d878 gui=bold +hi Special guifg=#999973 guibg=#f0f0dd gui=none +hi SpecialChar guifg=#0000ee guibg=#f0f0dd gui=none +hi SpecialComment guifg=#0000ee guibg=#f0f0dd gui=none +hi SpecialKey guifg=#cc0000 guibg=#f0f0dd gui=none +hi Statement guifg=#0000ee guibg=#f0f0dd gui=bold +hi StatusLine guifg=#f0f0dd guibg=#cc0000 gui=bold +hi StatusLineNC guifg=#f0f0dd guibg=#000066 gui=bold +hi StorageClass guifg=#551a8b guibg=#f0f0dd gui=bold +hi String guifg=#007f00 guibg=#f0f0dd gui=none +hi Structure guifg=#551a8b guibg=#f0f0dd gui=bold +hi Tag guifg=#0000ee guibg=#f0f0dd gui=none +hi Title guifg=#007f00 guibg=#f0f0dd gui=bold +hi Todo guifg=#f0f0dd guibg=#0000ee gui=none +hi Type guifg=#551a8b guibg=#f0f0dd gui=bold +hi Typedef guifg=#551a8b guibg=#f0f0dd gui=bold +hi Underlined guifg=#0000ee guibg=#f0f0dd gui=underline +hi VertSplit guifg=#f0f0dd guibg=#000066 gui=bold +hi Visual guifg=#ffffff guibg=#00009c gui=none +hi VisualNOS guifg=#ffffff guibg=#b0b0b0 gui=none +hi WarningMsg guifg=#ffffff guibg=#cc0000 gui=bold +hi WildMenu guifg=#f0f0dd guibg=#0000ee gui=none diff --git a/dot_vim/colors/simpleandfriendly.vim b/dot_vim/colors/simpleandfriendly.vim new file mode 100644 index 0000000..6222e76 --- /dev/null +++ b/dot_vim/colors/simpleandfriendly.vim @@ -0,0 +1,56 @@ +" Vim color file +" Maintainer: Thomas Schmall <ts_nowhere@NOSPAM_yahoo.com> +" Last Change: 2004 Nov 20 +" URL: http://www.vim.org/scripts/script.php?script_id=792 +" Version: 1.3 + +" This color scheme uses a light grey background. + +" Last Changes: +" *line number colors changed + + +" First remove all existing highlighting. +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "simpleandfriendly" + +"Set nice colors #DC6210 +"Cursor is Cyan when ":lmap" mappings are active +hi lCursor guibg=Cyan guifg=NONE +hi LineNr guifg=white guibg=#acbbff + +"Text below the last line is darker grey +hi NonText guibg=grey80 +"Normal text is black background is grey +hi Normal guifg=black guibg=grey89 ctermfg=Black ctermbg=LightGrey +hi Comment guifg=Orange guibg=grey94 ctermfg=DarkCyan term=bold +"Constants are not underlined but have a slightly lighter background +hi Constant guifg=#8080a0 guibg=grey92 gui=NONE term=underline +hi String guifg=#80a0ff guibg=grey93 gui=NONE term=underline +hi Number guifg=#80a5ff guibg=grey91 gui=NONE ctermfg=Gray term=none +"Words like _if_ or _else_ (Grey27) +hi Statement guifg=#4A2B99 gui=NONE ctermfg=Blue + +hi Title guifg=red ctermfg=red gui=NONE term=BOLD +"color for _NONE_ for instance: +hi PreProc term=underline ctermfg=LightBlue guifg=#DC6210 +"color for _guifg_ for instance: (SlateBlue works here nice too) +hi Type guifg=#008080 ctermfg=LightGreen gui=None term=underline +hi Function guifg=#61577A term=bold +"in lingo the defined functions. (alt: SlateBlue) +hi Identifier guifg=Seagreen +"hi Identifier term=underline cterm=bold ctermfg=Cyan guifg=#40ffff + +"hi Repeat term=underline ctermfg=White guifg=white +"hi Ignore guifg=bg ctermfg=black +hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White +hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow +"Special Characters +hi Special guibg=grey90 guifg=Slateblue gui=UNDERLINE + +hi operator guifg=gray25 ctermfg=Black term=bold cterm=bold gui=bold diff --git a/dot_vim/colors/taqua.vim b/dot_vim/colors/taqua.vim new file mode 100644 index 0000000..947ebc9 --- /dev/null +++ b/dot_vim/colors/taqua.vim @@ -0,0 +1,85 @@ +" Vim color file +" Maintainer: TaQ <eustaquiorangel@yahoo.com> +" Last Change: 18 March 2003 +" URL: http://taq.cjb.net + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name="taqua" + +hi Normal gui=NONE guifg=#303030 guibg=#FFFFFF +hi NonText gui=BOLD guifg=#303030 guibg=#FFFFFF + +" Search +hi IncSearch gui=BOLD guifg=#008000 guibg=#CCFF00 +hi Search gui=BOLD guifg=#008000 guibg=#CCFF00 + +" Messages +hi ErrorMsg gui=BOLD guifg=#FFFFFF guibg=#FF0000 +hi WarningMsg gui=BOLD guifg=#008000 guibg=#CCFF00 + +" Split area +hi StatusLine gui=BOLD guifg=#FFFFFF guibg=#0E8ED3 +hi StatusLineNC gui=BOLD guifg=#FFFFFF guibg=#0A6799 + +" Diff +hi DiffText gui=BOLD guifg=#FF0000 guibg=#FFEAE0 +hi DiffChange gui=BOLD guifg=#303030 guibg=#FFFFFF +hi DiffDelete gui=NONE guifg=#FFFFFF guibg=#FF0000 +hi DiffAdd gui=NONE guifg=#008000 guibg=#00FF00 + +" Cursor +hi Cursor gui=BOLD guifg=#FFFFFF guibg=#000000 +hi lCursor gui=BOLD guifg=#f8f8f8 guibg=#162CF7 +hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#162CF7 + +" Fold +hi Folded gui=BOLD guifg=#0E8ED3 guibg=#DBF2FF +hi FoldColumn gui=NONE guifg=#0E8ED3 guibg=#DBF2FF + +" Other +hi LineNr gui=BOLD guifg=#00A0FF guibg=#DBF2FF +hi Directory gui=BOLD guifg=#0A6799 guibg=#FFFFFF +hi NonText gui=BOLD guifg=#009999 guibg=#FFFFFF +hi SpecialKey gui=BOLD guifg=#2020FF guibg=#FFFFFF +hi Title gui=BOLD guifg=#0000A0 guibg=#FFFFFF +hi Visual gui=NONE guifg=#404060 guibg=#dddde8 + +" Syntax group +" purple was #8000FF +hi Comment gui=NONE guifg=#0E8ED3 guibg=#DBF2FF +hi Constant gui=NONE guifg=#303030 guibg=#F5F5F5 +hi Error gui=BOLD guifg=#FF0000 guibg=#FFFFFF +hi Identifier gui=NONE guifg=#1F89E0 guibg=#FFFFFF +hi Ignore gui=NONE guifg=#f8f8f8 guibg=#FFFFFF +hi PreProc gui=BOLD guifg=#0BBF20 guibg=#FFFFFF +hi Special gui=NONE guifg=#0E8ED3 guibg=#DBF2FF +hi Statement gui=BOLD guifg=#2E9BF4 guibg=#FFFFFF +hi Todo gui=NONE guifg=#FF0070 guibg=#FFE0F4 +hi Type gui=BOLD guifg=#0971F9 guibg=#FFFFFF +hi Underlined gui=UNDERLINE guifg=#0000ff guibg=NONE + +" HTML +hi htmlLink gui=UNDERLINE guifg=#0000ff guibg=NONE +hi htmlBold gui=BOLD +hi htmlBoldItalic gui=BOLD,ITALIC +hi htmlBoldUnderline gui=BOLD,UNDERLINE +hi htmlBoldUnderlineItalic gui=BOLD,UNDERLINE,ITALIC +hi htmlItalic gui=ITALIC +hi htmlUnderline gui=UNDERLINE +hi htmlUnderlineItalic gui=UNDERLINE,ITALIC + +" Scrollbar +hi Scrollbar gui=BOLD guifg=#00C0FF guibg=#FFFFFF +hi VertSplit gui=BOLD guifg=#FFFFFF guibg=#0E8ED3 +hi Visual gui=BOLD guifg=#FFFFFF guibg=#1679F9 + + diff --git a/dot_vim/colors/tcsoft.vim b/dot_vim/colors/tcsoft.vim new file mode 100644 index 0000000..072831e --- /dev/null +++ b/dot_vim/colors/tcsoft.vim @@ -0,0 +1,62 @@ +" Vim Farben-Datei +" Ersteller: Ingo Fabbri <vim@tcsoft.net> +" Letzte Änderung: 2003 May 13 + +" Mein persönliches Farbschema. Es schont die Augen, da es keine grellen Farben verwendet. +" Am Besten geignet für PHP + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = "TCSoft" + +" Farb-Einstellungen für das GUI +hi Normal guifg=#000000 guibg=#FFFFFF "Schwarze Schrift auf weißem Hintergrund + +hi Ignore guifg=bg + +hi Comment guifg=#000099 gui=italic "dunkelblau +hi Constant guifg=#666666 gui=NONE "grau +hi Special guifg=#FF0000 gui=NONE "rot +hi Identifier guifg=#993300 gui=NONE "rostfarbig +hi Statement guifg=#FF9900 gui=NONE "orange +hi PreProc guifg=#009900 gui=NONE "dunkelgrün +hi Type guifg=#FF9900 gui=bold "orange +hi Cursor guifg=#000000 gui=reverse "schwarz +hi LineNr guifg=#000000 gui=NONE "schwarz +hi StatusLine guifg=#000000 gui=reverse,bold "schwarz + +hi link Function PreProc +hi link String Constant +hi link Character Constant + +hi! link MoreMsg Comment +hi! link ErrorMsg Visual +hi! link WarningMsg ErrorMsg +hi! link Question Comment + +hi link Number Special +hi link Boolean Constant +hi link Float Number + +hi link Operator Identifier +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc + +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement + +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Comment +hi link Debug Special diff --git a/dot_vim/colors/tibet.vim b/dot_vim/colors/tibet.vim new file mode 100644 index 0000000..48807bf --- /dev/null +++ b/dot_vim/colors/tibet.vim @@ -0,0 +1,101 @@ +" Vim color file +" Maintainer: Miguel Figueiredo + +" /usr/X11R6/lib/X11 +set background=dark + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name="tibet" + +hi Normal guifg=ivory guibg=darkred + +" highlight groups +"hi Cursor guibg=khaki guifg=slategrey +hi Cursor guibg=blue4 guifg=white +"hi CursorIM +"hi Directory +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +"hi ErrorMsg +"hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none +hi VertSplit guibg=darkgreen guifg=white gui=none +hi Folded guibg=darkred guifg=gold +hi FoldColumn guibg=grey30 guifg=tan +hi IncSearch guifg=slategrey guibg=khaki +hi LineNr guifg=yellow guibg=darkred +hi ModeMsg guifg=goldenrod +hi MoreMsg guifg=SeaGreen +hi NonText guifg=LightBlue guibg=darkred +hi Question guifg=springgreen +hi Search guibg=peru guifg=wheat +hi SpecialKey guifg=yellowgreen +hi StatusLine guibg=#c2bfa5 guifg=black gui=none +hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none +hi Title guifg=indianred +"hi Visual gui=none guifg=khaki guibg=olivedrab +hi Visual gui=none guifg=white guibg=#003300 +"hi VisualNOS +hi WarningMsg guifg=salmon +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=goldenrod +hi Constant guifg=#ffa0a0 +"hi String guifg=blue +hi Identifier guifg=palegreen +hi Statement guifg=khaki +hi PreProc guifg=#ffa0a0 +"hi Type guifg=darkkhaki +hi Type guifg=khaki +hi Special guifg=navajowhite +"hi Underlined +hi Ignore guifg=grey40 +"hi Error +hi Todo guifg=yellow guibg=#003300 + +" color terminal definitions +hi SpecialKey ctermfg=darkgreen +hi NonText cterm=bold ctermfg=darkblue +hi Directory ctermfg=darkcyan +hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 +hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green +hi Search cterm=NONE ctermfg=grey ctermbg=blue +hi MoreMsg ctermfg=darkgreen +hi ModeMsg cterm=NONE ctermfg=brown +hi LineNr ctermfg=3 +hi Question ctermfg=green +hi StatusLine cterm=bold,reverse +hi StatusLineNC cterm=reverse +hi VertSplit cterm=reverse +hi Title ctermfg=5 +hi Visual cterm=reverse +hi VisualNOS cterm=bold,underline +hi WarningMsg ctermfg=1 +hi WildMenu ctermfg=0 ctermbg=3 +hi Folded ctermfg=darkgrey ctermbg=NONE +hi FoldColumn ctermfg=darkgrey ctermbg=NONE +hi DiffAdd ctermbg=4 +hi DiffChange ctermbg=5 +hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 +hi DiffText cterm=bold ctermbg=1 +hi Comment ctermfg=darkcyan +hi Constant ctermfg=brown +hi Special ctermfg=5 +hi Identifier ctermfg=6 +hi Statement ctermfg=3 +hi PreProc ctermfg=5 +hi Type ctermfg=2 +hi Underlined cterm=underline ctermfg=5 +hi Ignore ctermfg=darkgrey +hi Error cterm=bold ctermfg=7 ctermbg=1 + + +" diff --git a/dot_vim/colors/tolerable.vim b/dot_vim/colors/tolerable.vim new file mode 100644 index 0000000..7b97b9a --- /dev/null +++ b/dot_vim/colors/tolerable.vim @@ -0,0 +1,43 @@ +" Vim color file +" Maintainer: Ian Langworth +" Last Change: 2004 Dec 24 +" Email: <langworth.com> + +" Color settings inspired by BBEdit for Mac OS, plus I liked +" the low-contrast comments from the 'oceandeep' colorscheme + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="tolerable" + +hi Cursor guifg=white guibg=darkgreen + +hi Normal gui=none guifg=black guibg=white +hi NonText gui=none guifg=orange guibg=white + +hi Statement gui=none guifg=blue +hi Special gui=none guifg=red +hi Constant gui=none guifg=darkred +hi Comment gui=none guifg=#555555 +hi Preproc gui=none guifg=darkcyan +hi Type gui=none guifg=darkmagenta +hi Identifier gui=none guifg=darkgreen +hi Title gui=none guifg=black + +hi StatusLine gui=none guibg=#333333 guifg=white +hi StatusLineNC gui=none guibg=#333333 guifg=white +hi VertSplit gui=none guibg=#333333 guifg=white + +hi Visual gui=none guibg=green guifg=black +hi Search gui=none guibg=yellow +hi Directory gui=none guifg=darkblue +hi WarningMsg gui=none guifg=red +hi Error gui=none guifg=white guibg=red +hi Todo gui=none guifg=black guibg=yellow + +hi MoreMsg gui=none +hi ModeMsg gui=none + diff --git a/dot_vim/colors/tomatosoup.vim b/dot_vim/colors/tomatosoup.vim new file mode 100644 index 0000000..7864aed --- /dev/null +++ b/dot_vim/colors/tomatosoup.vim @@ -0,0 +1,80 @@ +" Vim color file +" Maintainer: Michael Brailsford <brailsmt@yahoo.com> +" Date: $Date: 2002/04/11 03:29:51 $ +" Version: $Revision: 1.4 $ + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +" your pick: +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="tomatosoup" + +hi Normal guifg=black guibg=tomato1 ctermfg=14 + +"Toggle semicolon matching at the end of lines +nmap <silent> <leader>; :call ToggleSemicolonHighlighting()<cr> +"{{{ +function! ToggleSemicolonHighlighting() + if exists("b:semicolon") + unlet b:semicolon + hi semicolon guifg=NONE gui=NONE ctermfg=NONE + else + syn match semicolon #;$# + hi semicolon guifg=red gui=bold ctermfg=1 + let b:semicolon = 1 + endif +endfunction +"}}} + +hi Cursor guifg=bg guibg=fg ctermfg=0 ctermbg=11 +"hi CursorIM +hi Directory gui=bold +hi DiffAdd guifg=yellow guibg=darkgreen ctermbg=0 +"hi DiffChange +"hi DiffDelete +"hi DiffText +hi ErrorMsg guibg=red ctermfg=1 +"hi VertSplit +hi Folded guibg=darkred ctermbg=4 guifg=gold ctermfg=11 gui=bold +hi FoldColumn guibg=darkred ctermbg=14 guifg=gold ctermfg=11 gui=bold +"hi IncSearch +hi LineNr guifg=yellow ctermfg=11 +hi ModeMsg guifg=yellow gui=bold +"hi MoreMsg +"hi NonText +"hi Question +hi Search guibg=yellow guifg=bg +"hi SpecialKey +hi StatusLine guifg=brown +hi StatusLineNC guifg=darkred +"hi Title +hi Visual guifg=fg guibg=bg +"hi VisualNOS +"hi WarningMsg +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=pink ctermfg=10 +hi Constant guifg=lightmagenta gui=bold ctermfg=13 +hi String guifg=grey85 ctermfg=5 +hi Character guifg=violet ctermfg=5 +hi Number guifg=red ctermfg=5 +"hi Identifier +hi Statement guifg=khaki1 gui=bold ctermfg=15 cterm=underline +hi PreProc guifg=white gui=italic ctermfg=9 +hi Type guifg=yellow gui=bold ctermfg=3 +hi Special guifg=red gui=bold +"hi Underlined +"hi Ignore +"hi Error +hi Todo guifg=yellow guibg=blue gui=bold diff --git a/dot_vim/colors/toothpik.vim b/dot_vim/colors/toothpik.vim new file mode 100644 index 0000000..22e07a1 --- /dev/null +++ b/dot_vim/colors/toothpik.vim @@ -0,0 +1,45 @@ +set background=light +highlight clear +if exists( "syntax_on" ) + syntax reset +endif +let g:colors_name="toothpik" + +highlight Comment term=bold guifg=Yellow +highlight Constant term=underline guifg=Blue guibg=grey +highlight Cursor gui=reverse guifg=red guibg=white +highlight lCursor guifg=black guibg=green +highlight DiffAdd term=bold guibg=LightBlue +highlight DiffChange term=bold guibg=LightMagenta +highlight DiffDelete term=bold gui=bold guifg=Blue guibg=LightCyan +highlight DiffText term=reverse gui=bold guibg=Red +highlight Directory term=bold guifg=Blue +highlight Error term=reverse guifg=White guibg=Red +highlight ErrorMsg term=standout guifg=White guibg=Red +highlight Folded term=standout guifg=DarkBlue guibg=LightGrey +highlight FoldColumn term=standout guifg=DarkBlue guibg=Grey +highlight Identifier term=underline guifg=DarkCyan +highlight Ignore guifg=bg +highlight IncSearch term=reverse gui=reverse +highlight LineNr term=underline guifg=Brown +highlight MoreMsg term=bold gui=bold guifg=SeaGreen +highlight ModeMsg term=bold gui=bold +highlight NonText term=bold gui=bold guifg=Blue guibg=grey +highlight Normal guibg=grey font='Fixedsys' +highlight Question term=standout gui=bold guifg=SeaGreen +highlight PreProc term=underline guifg=Purple +highlight Search term=reverse guibg=Yellow +highlight Special term=bold guifg=darkred guibg=grey +highlight SpecialKey term=bold guifg=Blue +highlight Statement term=bold gui=bold guifg=Brown +highlight StatusLine term=bold,reverse gui=bold,reverse +highlight StatusLineNC term=reverse gui=reverse +highlight Title term=bold gui=bold guifg=Magenta +highlight Todo term=standout guifg=Blue guibg=Yellow +highlight Type term=underline gui=bold guifg=DarkGreen +highlight Underlined term=underline gui=underline guifg=SlateBlue +highlight VertSplit term=reverse gui=reverse +highlight Visual term=reverse gui=reverse guifg=Yellow guibg=Black +highlight VisualNOS term=bold,underline gui=bold,underline +highlight WarningMsg term=standout guifg=Red +highlight WildMenu term=standout guifg=Black guibg=Yellow diff --git a/dot_vim/colors/torte.vim b/dot_vim/colors/torte.vim new file mode 100644 index 0000000..f28ed60 --- /dev/null +++ b/dot_vim/colors/torte.vim @@ -0,0 +1,51 @@ +" Vim color file +" Maintainer: Thorsten Maerz <info@netztorte.de> +" Last Change: 2001 Jul 23 +" grey on black +" optimized for TFT panels +" $Revision: 1.1 $ + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +"colorscheme default +let g:colors_name = "torte" + +" hardcoded colors : +" GUI Comment : #80a0ff = Light blue + +" GUI +highlight Normal guifg=Grey80 guibg=Black +highlight Search guifg=Black guibg=Red gui=bold +highlight Visual guifg=Grey25 gui=bold +highlight Cursor guifg=Black guibg=Green gui=bold +highlight Special guifg=Orange +highlight Comment guifg=#80a0ff +highlight StatusLine guifg=blue guibg=white +highlight Statement guifg=Yellow gui=NONE +highlight Type gui=NONE + +" Console +highlight Normal ctermfg=LightGrey ctermbg=Black +highlight Search ctermfg=Black ctermbg=Red cterm=NONE +highlight Visual cterm=reverse +highlight Cursor ctermfg=Black ctermbg=Green cterm=bold +highlight Special ctermfg=Brown +highlight Comment ctermfg=Blue +highlight StatusLine ctermfg=blue ctermbg=white +highlight Statement ctermfg=Yellow cterm=NONE +highlight Type cterm=NONE + +" only for vim 5 +if has("unix") + if v:version<600 + highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE + highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold + highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold + highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE + highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE + endif +endif + diff --git a/dot_vim/colors/transparent.vim b/dot_vim/colors/transparent.vim new file mode 100644 index 0000000..274cd8e --- /dev/null +++ b/dot_vim/colors/transparent.vim @@ -0,0 +1,97 @@ +" Vim color file +" Maintainer: Sir Raorn <raorn@altlinux.ru> +" Last Change: Nov 10, 2002 +" URL: http://hell.binec.ru/ + +" This color scheme uses "transparent" background (dark dark blue in gvim) +" Looks really nice when vim (console) started in transparent aterm +" But gvim is good either +set background=dark + +" First remove all existing highlighting. +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="transparent" + +" default groups +hi Normal ctermfg=Gray ctermbg=NONE guifg=Gray guibg=#00002A + +hi Cursor guifg=Black guibg=Green +"hi CursorIM NONE guifg=Black guibg=Purple +hi Directory ctermfg=White guifg=White +hi DiffAdd ctermfg=White ctermbg=DarkCyan guifg=White guibg=DarkCyan +hi DiffChange ctermfg=Black ctermbg=Gray guifg=Black guibg=DarkGray +hi DiffDelete ctermfg=White ctermbg=DarkRed guifg=White guibg=DarkRed +hi DiffText cterm=bold ctermfg=White ctermbg=Gray gui=bold guifg=White guibg=DarkGray +hi ErrorMsg ctermfg=White ctermbg=DarkRed guifg=White guibg=DarkRed +hi VertSplit cterm=reverse gui=reverse +hi Folded cterm=bold ctermfg=Cyan ctermbg=NONE gui=bold guifg=Cyan guibg=DarkCyan +hi FoldColumn ctermfg=Green ctermbg=NONE guifg=Green guibg=#00002A +hi IncSearch ctermfg=White ctermbg=Black guifg=White guibg=Black +hi LineNr ctermfg=Yellow guifg=DarkCyan +hi ModeMsg cterm=bold ctermfg=White gui=bold guifg=White +hi MoreMsg cterm=bold ctermfg=White gui=bold guifg=White +hi NonText ctermfg=NONE guifg=NONE +hi Question ctermfg=Green guifg=Green +hi Search cterm=reverse ctermfg=fg ctermbg=NONE gui=reverse guifg=fg guibg=bg +hi SpecialKey ctermfg=LightRed guifg=Red +hi StatusLine cterm=bold,reverse ctermfg=White ctermbg=Black gui=bold,reverse guifg=White guibg=Black +hi StatusLineNC cterm=reverse ctermfg=Gray ctermbg=Black gui=reverse guifg=DarkGray guibg=Black +hi Title ctermfg=LightGreen gui=bold guifg=Green +hi Visual cterm=inverse ctermfg=White ctermbg=DarkGray gui=inverse guifg=DarkGray guibg=Black +hi VisualNOS cterm=bold,underline gui=bold,underline +hi WarningMsg ctermfg=White ctermbg=DarkRed guifg=White guibg=DarkRed +hi WildMenu cterm=bold ctermfg=Black ctermbg=Yellow gui=bold guifg=Black guibg=Yellow +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment ctermfg=DarkCyan guifg=DarkCyan + +hi Constant ctermfg=LightGreen guifg=LightGreen +hi String ctermfg=Yellow guifg=Yellow +hi Character ctermfg=Yellow guifg=Yellow +"hi Number +"hi Boolean +"hi Float + +hi Identifier ctermfg=LightCyan guifg=LightCyan +hi Function ctermfg=White guifg=White + +hi Statement ctermfg=Yellow guifg=Yellow +"hi Conditional +"hi Repeat +hi Label ctermfg=White guifg=White +hi Operator ctermfg=Green guifg=Green +"hi Keyword +hi Exception ctermfg=Black ctermbg=DarkRed guifg=Black guibg=DarkRed + +hi PreProc ctermfg=DarkGreen guifg=DarkGreen +"hi Include +"hi Define +"hi Macro +"hi PreCondit + +hi Type ctermfg=Green guifg=Green +"hi StorageClass +"hi Structure +hi Typedef ctermfg=Red guifg=Red + +hi Special ctermfg=Red guifg=Red +"hi SpecialChar +hi Tag ctermfg=LightGreen guifg=LightGreen +hi Delimiter ctermfg=Green guifg=Green +"hi SpecialComment +hi Debug ctermfg=White ctermbg=Black guifg=White guibg=Black + +hi Underlined cterm=underline gui=underline + +hi Ignore ctermfg=DarkBlue guifg=DarkBlue + +hi Error ctermfg=White ctermbg=DarkRed guifg=White guibg=DarkRed + +hi Todo ctermfg=Black ctermbg=Gray guifg=Black guibg=Gray + diff --git a/dot_vim/colors/turbo.vim b/dot_vim/colors/turbo.vim new file mode 100644 index 0000000..c6fda54 --- /dev/null +++ b/dot_vim/colors/turbo.vim @@ -0,0 +1,68 @@ +" Vim color file +" Maintainer: Bryant Casteel +" Web Site: http://bethings.provoplatinum.com +" Last Change: 2004 Jan. 22 + +" turbo -- Intended to look like the color scheme +" from Borland's Turbo C++ and Turbo Pascal. + +set bg=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "turbo" + + +hi Normal guifg=yellow guibg=#000040 ctermfg=yellow ctermbg=black +hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=lightblue +hi Visual guifg=#8080ff guibg=fg gui=reverse ctermfg=lightblue ctermbg=fg cterm=reverse +hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline +hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue +hi Search guifg=#90fff0 guibg=#2050d0 ctermfg=white ctermbg=darkblue cterm=underline +hi IncSearch guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray + + +hi SpecialKey guifg=cyan ctermfg=darkcyan +hi Directory guifg=cyan ctermfg=cyan +hi Title guifg=magenta gui=none ctermfg=magenta cterm=bold +hi WarningMsg guifg=red ctermfg=red +hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none +hi ModeMsg guifg=#22cce2 ctermfg=lightblue +hi MoreMsg guifg=darkgreen ctermfg=darkgreen +hi Question guifg=green gui=none ctermfg=green cterm=none +hi NonText guifg=#0030ff ctermfg=darkblue + +" Split window status bar +hi StatusLine guifg=blue guibg=yellow gui=none ctermfg=blue ctermbg=gray cterm=none +hi StatusLineNC guifg=black guibg=green gui=none ctermfg=black ctermbg=gray cterm=none +hi VertSplit guifg=black guibg=orange gui=none ctermfg=black ctermbg=gray cterm=none + +" Folded code +hi Folded guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold +hi FoldColumn guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold +hi LineNr guifg=#90f020 ctermfg=green cterm=none + + +hi DiffAdd guibg=darkblue ctermbg=darkblue cterm=none +hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none +hi DiffDelete guifg=Blue guibg=DarkCyan gui=bold ctermfg=blue ctermbg=cyan +hi DiffText guibg=Red gui=bold ctermbg=red cterm=bold + +" Cursor +hi Cursor guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown +hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen + +" Syntax highlighting: +hi Comment guifg=darkcyan ctermfg=darkcyan +hi Constant guifg=darkred ctermfg=darkred cterm=none +hi Special guifg=magenta gui=none ctermfg=magenta cterm=none +hi Identifier guifg=green ctermfg=green cterm=none +hi Statement guifg=white gui=bold ctermfg=white cterm=bold +hi PreProc guifg=darkgreen gui=none ctermfg=darkgreen cterm=none +hi type guifg=grey gui=bold ctermfg=grey cterm=bold +hi Underlined gui=underline cterm=underline +hi Ignore guifg=bg ctermfg=bg + + diff --git a/dot_vim/colors/umber-green.vim b/dot_vim/colors/umber-green.vim new file mode 100644 index 0000000..d1743a1 --- /dev/null +++ b/dot_vim/colors/umber-green.vim @@ -0,0 +1,89 @@ +" Vim color file +" Maintainer: horrorvacui-at-gmx.net +" Last Change: today... oh yes, it's 16.9.03 +" URL: + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +" your pick: +set background=dark " or light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="umber-green" + +"hi Normal + +" OR + +" highlight clear Normal +" set background& +" highlight clear +" if &background == "light" +" highlight Error ... +" ... +" else +" highlight Error ... +" ... +" endif + +" A good way to see what your colorscheme does is to follow this procedure: +" :w +" :so % +" +" Then to see what the current setting is use the highlight command. +" For example, +" :hi Cursor +" gives +" Cursor xxx guifg=bg guibg=fg + +" Uncomment and complete the commands you want to change from the default. + +hi Cursor guibg=#ffffff +"hi CursorIM +"hi Directory +"hi DiffAdd +"hi DiffChange +"hi DiffDelete +"hi DiffText +"hi ErrorMsg +"hi VertSplit +"hi Folded +"hi FoldColumn +"hi IncSearch +hi LineNr guifg=#e2844d guibg=#000000 +"hi ModeMsg +"hi MoreMsg +"hi NonText +"hi Question +"hi Search +"hi SpecialKey +hi StatusLine guifg=#ffffff +hi StatusLineNC guifg=#ffffff +"hi Title +"hi Visual +"hi VisualNOS +"hi WarningMsg +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Normal guifg=#eeaa11 guibg=#333333 +hi Comment guifg=#ff5555 +hi Constant guifg=#eeaa11 +hi Identifier guifg=#0000ff +hi Statement guifg=#77ee44 +hi PreProc guifg=#ff0000 +hi Type guifg=#eecc88 +hi Special guifg=#ddffcc +"hi Underlined +"hi Ignore +"hi Error +"hi Todo + diff --git a/dot_vim/colors/vc.vim b/dot_vim/colors/vc.vim new file mode 100644 index 0000000..53ecc22 --- /dev/null +++ b/dot_vim/colors/vc.vim @@ -0,0 +1,24 @@ +" Vim color file +" Maintainer: Vladimir Vrzic <random@bsd.org.yu> +" Last Change: 28. june 2003. +" URL: http://galeb.etf.bg.ac.yu/~random/pub/vim/ + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="vc" + +hi Comment gui=NONE guifg=SeaGreen guibg=NONE +hi Constant gui=NONE guifg=#004488 guibg=NONE +"hi Identifier gui=NONE guifg=Blue guibg=NONE +hi Statement gui=NONE guifg=Blue guibg=NONE +hi PreProc gui=NONE guifg=Blue guibg=NONE +hi Type gui=NONE guifg=Blue guibg=NONE +hi Special gui=NONE guifg=SteelBlue guibg=NONE +"hi Underlined +"hi Ignore +"hi Error +"hi Todo + diff --git a/dot_vim/colors/vcbc.vim b/dot_vim/colors/vcbc.vim new file mode 100644 index 0000000..07777c3 --- /dev/null +++ b/dot_vim/colors/vcbc.vim @@ -0,0 +1,31 @@ +" Vim color file +" Maintainer: Rajas Sambhare <rajas dot sambhare squigglylittleA gmail dot com> +" Last Change: Nov 18, 2004 +" Version: 1.0 +" Based on the colors for Visual C++ 6.0 and Beyond Compare for diffs. +" Inspired by vc.vim by Vladimir Vrzic + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="vcbc" + +hi Normal cterm=NONE ctermfg=Black ctermbg=White gui=NONE guifg=NONE guibg=NONE +hi NonText cterm=NONE ctermfg=Black ctermbg=Grey gui=NONE guifg=NONE guibg=LightGrey +hi LineNr cterm=NONE ctermfg=Black ctermbg=LightGrey gui=NONE guifg=NONE guibg=LightGrey +hi Comment cterm=NONE ctermfg=DarkGreen ctermbg=White gui=italic guifg=DarkGreen guibg=NONE +hi Constant cterm=NONE ctermfg=Red ctermbg=White gui=NONE guifg=Red guibg=NONE +hi Identifier cterm=NONE ctermfg=LightBlue ctermbg=White gui=NONE guifg=LightBlue guibg=NONE +hi Statement cterm=bold ctermfg=Blue ctermbg=White gui=bold guifg=Blue guibg=NONE +hi PreProc cterm=NONE ctermfg=DarkRed ctermbg=White gui=NONE guifg=DarkRed guibg=NONE +hi Type cterm=NONE ctermfg=Blue ctermbg=White gui=NONE guifg=Blue guibg=NONE +hi Underlined cterm=NONE ctermfg=Black ctermbg=White gui=underline guifg=NONE guibg=NONE +hi Error cterm=NONE ctermfg=Yellow ctermbg=Red gui=NONE guifg=Yellow guibg=Red +hi Todo cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=NONE guibg=LightYellow +"Diff colors +hi DiffAdd cterm=NONE ctermfg=Red ctermbg=LightGrey gui=NONE guifg=Red guibg=#fff0f0 +hi DiffChange cterm=NONE ctermfg=Red ctermbg=LightGrey gui=NONE guifg=Red guibg=#fff0f0 +hi DiffText cterm=NONE ctermfg=White ctermbg=DarkRed gui=bold,italic guifg=Red guibg=#fff0f0 +hi DiffDelete cterm=NONE ctermfg=White ctermbg=LightGrey gui=NONE guifg=DarkGrey guibg=#f0f0f0 diff --git a/dot_vim/colors/white.vim b/dot_vim/colors/white.vim new file mode 100644 index 0000000..25d055b --- /dev/null +++ b/dot_vim/colors/white.vim @@ -0,0 +1,62 @@ +" Vim color file +" created by mksa on 30.10.2003 10:58:20 +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + + + +set background=light +" First remove all existing highlighting. +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name="white" + +" color terminal definitions +hi Normal ctermfg=black ctermbg=white guifg=black guibg=white +hi SpecialKey ctermfg=darkgreen guifg=darkgreen +hi NonText ctermfg=black ctermbg=white guifg=black guibg=white +hi Directory ctermfg=darkcyan guifg=darkcyan +hi ErrorMsg ctermfg=lightred ctermbg=yellow guifg=lightred guibg=yellow +hi IncSearch ctermfg=white ctermbg=black guifg=white guibg=black +hi Search ctermfg=white ctermbg=black guifg=white guibg=black +hi MoreMsg ctermfg=darkgreen guifg=darkgreen +hi ModeMsg ctermfg=red guifg=red +hi LineNr ctermfg=yellow ctermbg=darkgrey guifg=yellow guibg=darkgrey +hi Question ctermfg=darkgreen guifg=darkgreen +"hi StatusLine cterm=reverse +hi StatusLineNC cterm=reverse +hi VertSplit cterm=reverse +hi Title ctermfg=lightred ctermbg=yellow guifg=red +hi Visual cterm=reverse +hi VisualNOS cterm=reverse +hi WarningMsg ctermfg=darkblue guifg=darkblue +hi WildMenu ctermfg=black ctermbg=darkcyan guifg=black guibg=darkcyan +hi Folded ctermfg=yellow ctermbg=darkgrey guifg=yellow guibg=darkgrey +hi FoldColumn ctermfg=yellow ctermbg=darkgrey guifg=yellow guibg=darkgrey +hi DiffAdd ctermfg=white ctermbg=red guifg=white guifg=red +hi DiffChange ctermfg=yellow ctermbg=magenta guifg=yellow guifg=magenta +hi DiffDelete ctermfg=red ctermbg=brown guifg=red guibg=brown +hi DiffText ctermbg=blue guibg=blue + +hi Comment ctermfg=white ctermbg=darkgrey guifg=white guibg=darkgrey +hi Constant ctermfg=darkblue guifg=darkblue +hi Special ctermfg=darkred guifg=darkred +hi Identifier ctermfg=darkmagenta guifg=darkmagenta +hi Statement ctermfg=blue guifg=blue +hi Operator ctermfg=blue guifg=blue +hi PreProc ctermfg=darkmagenta guifg=darkmagenta +hi Type ctermfg=blue guifg=blue +hi Underlined ctermbg=Yellow ctermfg=blue guifg=blue +hi Ignore ctermfg=grey guifg=grey +hi Error ctermfg=white ctermbg=red guifg=white guibg=red +hi Todo ctermfg=white ctermbg=darkgreen guifg=white guibg=darkgreen +hi String ctermfg=darkgreen guifg=darkgreen +hi Number ctermfg=magenta guifg=magenta + + +"vim: sw=4 diff --git a/dot_vim/colors/whitedust.vim b/dot_vim/colors/whitedust.vim new file mode 100644 index 0000000..a12dc7d --- /dev/null +++ b/dot_vim/colors/whitedust.vim @@ -0,0 +1,62 @@ +set background=light +hi clear + +hi Boolean guifg=#235C5C gui=bold +hi Character guifg=#235C5C gui=bold +hi Comment guifg=#808080 +hi Condtional guifg=#700000 +hi Constant guifg=#235C5C gui=bold +hi Cursor guifg=#FFFFFF guibg=#515151 +hi Debug guifg=#235C5C gui=bold +hi Define guifg=#003050 gui=bold +hi Delimiter guifg=#707070 +hi DiffAdd guibg=#9EC3B9 +hi DiffChange guibg=#CCCCCC +hi DiffDelete guifg=#CCCCCC guibg=#B9B9B9 gui=none +hi DiffText guifg=#000000 guibg=#E0E0E0 gui=bold +hi Directory guifg=#000000 gui=bold +hi Error guifg=#FFFFFF guibg=#FF0000 +hi ErrorMsg guifg=#FFFFFF guibg=#FF3F30 +hi Exception guifg=#700000 gui=underline +hi Float guifg=#636C4C +hi FoldColumn guifg=#235C5C guibg=#B9B9B9 +hi Folded guifg=#235C5C guibg=#CCCCCC +hi Function guifg=#000070 +hi Identifier guifg=#000000 +hi Include guifg=#003050 gui=bold +hi IncSearch guifg=#FFFFFF guibg=#3EA399 +hi Keyword guifg=#000000 gui=bold +hi Label guifg=#700000 gui=underline +hi LineNr guifg=#808080 guibg=#B9B9B9 +hi Macro guifg=#003050 gui=bold +hi ModeMsg guifg=#235C5C gui=bold +hi MoreMsg guifg=#000000 gui=bold +hi NonText guifg=#E0E0E0 +hi Normal guifg=#333333 guibg=#C0C0C0 +hi Number guifg=#535F5C +hi Operator guifg=#000000 +hi PreCondit guifg=#205070 gui=bold +hi PreProc guifg=#003050 gui=bold +hi Question guifg=#000000 gui=bold +hi Repeat guifg=#700000 gui=underline +hi Search guifg=#FFFFFF guibg=#3EA399 +hi SpecialChar guifg=#235C5C gui=bold +hi SpecialComment guifg=#235C5C gui=bold +hi Special guifg=#808080 +hi SpecialKey guifg=#818181 +hi Statement guifg=#700000 +hi StatusLine guifg=#CCCCCC guibg=#0E7369 +hi StatusLineNC guifg=#CCCCCC guibg=#333333 +hi StorageClass guifg=#000000 gui=bold +hi String guifg=#336C6C +hi Structure guifg=#000000 gui=bold,underline +hi Tag guifg=#235C5C gui=bold +hi Title guifg=#000000 guibg=#CCCCCC gui=bold +hi Todo guifg=#000000 guibg=#FFFFFF gui=bold +hi Typedef guifg=#000000 gui=bold,underline +hi Type guifg=#000000 gui=bold +hi VertSplit guifg=#CCCCCC guibg=#333333 +hi Visual guifg=#CCCCCC guibg=#0E7369 gui=reverse +hi VisualNOS guifg=#CCCCCC guibg=#0E7369 gui=bold,underline +hi WarningMsg guifg=#000000 guibg=#CCCCCC gui=bold +hi WildMenu guifg=#FFFFFF guibg=#235C5C diff --git a/dot_vim/colors/wintersday.vim b/dot_vim/colors/wintersday.vim new file mode 100644 index 0000000..9a77f7e --- /dev/null +++ b/dot_vim/colors/wintersday.vim @@ -0,0 +1,60 @@ +" Vim color file +" Mark Thomas <mark.thomas@bigswamp.org> +" Sun Feb 16, 2003 + +" This color scheme uses a dark background. + +" First remove all existing highlighting. +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "wintersday" + +hi Normal guifg=#CCCCCC guibg=#000000 + +hi Cursor gui=NONE guifg=#B9D3EE guibg=#8B8878 +"hi CursorIM +hi Directory gui=NONE guifg=#FFFFFF guibg=#000000 +hi DiffAdd gui=NONE guifg=#A0D0FF guibg=#0020A0 +hi DiffChange gui=NONE guifg=#E03870 guibg=#601830 +hi DiffDelete gui=NONE guifg=#A0D0FF guibg=#0020A0 +hi DiffText gui=NONE guifg=#FF9933 guibg=#A02860 +hi ErrorMsg gui=BOLD guifg=#FF6347 guibg=NONE +hi VertSplit gui=BOLD guifg=#FFFFFF guibg=#8B4513 +hi Folded gui=NONE guifg=#40F0F0 guibg=#005080 +hi FoldColumn gui=NONE guifg=#40C0FF guibg=#00305C +hi IncSearch gui=UNDERLINE guifg=#FFD700 guibg=#778899 +hi LineNr gui=NONE guifg=#696969 +hi ModeMsg gui=BOLD guifg=#990000 guibg=NONE +hi MoreMsg gui=BOLD guifg=#CC6666 guibg=NONE +hi NonText gui=BOLD guifg=#CC00FF guibg=NONE +hi Question gui=BOLD guifg=#CC00FF guibg=NONE +hi Search gui=NONE guifg=#FFD700 guibg=#778899 +hi SpecialKey gui=BOLD guifg=#CCCCCC guibg=NONE +hi StatusLine gui=BOLD guifg=#FFFFFF guibg=#8B4513 +hi StatusLineNC gui=BOLD guifg=#8B4513 guibg=#FFFFFF +hi Title gui=BOLD guifg=#CCCCCC guibg=NONE +hi Visual gui=NONE guifg=#B9D3EE guibg=#8B8878 +"hi VisualNOS +hi WarningMsg gui=BOLD guifg=#FFA0FF guibg=NONE +hi WildMenu gui=NONE guifg=#000000 guibg=#a0a0ff +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment gui=NONE guifg=#6699CC guibg=NONE +hi Constant gui=NONE guifg=#99CCFF guibg=NONE +hi Identifier gui=NONE guifg=#FFD700 guibg=NONE +hi Statement gui=NONE guifg=#CC6666 guibg=NONE +hi PreProc gui=NONE guifg=#40F0A0 guibg=NONE +hi Type gui=NONE guifg=#B0C4DE guibg=NONE +hi Special gui=NONE guifg=#00FFCC guibg=NONE +hi Underlined gui=NONE guifg=#FFFFFF guibg=NONE +hi Ignore gui=NONE guifg=#000000 guibg=NONE +hi Error gui=NONE guifg=#FFFFFF guibg=#FF0088 +hi Todo gui=BOLD guifg=#FFA0A0 guibg=NONE +hi Number gui=NONE guifg=#FFCCCC guibg=NONE diff --git a/dot_vim/colors/wombat.vim b/dot_vim/colors/wombat.vim new file mode 100644 index 0000000..9ad1e56 --- /dev/null +++ b/dot_vim/colors/wombat.vim @@ -0,0 +1,51 @@ +" 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=#808080 guibg=#303030 gui=none +hi LineNr guifg=#857b6f guibg=#000000 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 guifg=#8f8f8f gui=italic +hi Constant guifg=#e5786d gui=none +hi String guifg=#95e454 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/dot_vim/colors/xemacs.vim b/dot_vim/colors/xemacs.vim new file mode 100644 index 0000000..c47607c --- /dev/null +++ b/dot_vim/colors/xemacs.vim @@ -0,0 +1,46 @@ + +" Vim color file +" Maintainer: tranquility@portugalmail.pt +" Last Change: 5 June 2002 + + +" cool help screens +" :he group-name +" :he highlight-groups +" :he cterm-colors + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="xemacs" + +hi Normal guibg=#cdcecd guifg=black +hi Cursor guibg=red guifg=grey gui=bold +hi VertSplit guibg=grey60 guifg=black gui=none +hi Folded guibg=royalblue3 guifg=white +hi FoldColumn guibg=royalblue4 guifg=white +hi ModeMsg guifg=#cdcecd guibg=black +hi MoreMsg guifg=#cdcecd guibg=black +hi NonText guifg=black guibg=#cdcecd gui=none +hi Question guifg=black +hi Search guibg=#aceeee +hi SpecialKey guifg=navyblue +hi Special guifg=navyblue +hi StatusLine guibg=#b7b7b7 guifg=black gui=none +hi StatusLineNC guibg=#a6b7b7 guifg=black gui=none +hi Title guifg=bisque3 +hi Subtitle guifg=black +hi Visual guibg=#a4a5a3 guifg=black gui=none +hi WarningMsg guibg=#cdcecd guifg=black gui=bold +hi Comment guifg=#00008b +hi Constant guifg=#008900 +hi Identifier guibg=#cdcecd guifg=black +hi Statement guifg=royalblue4 +hi PreProc guifg=#0000cd +hi Type guifg=#4a81b4 gui=NONE +hi Ignore guifg=grey29 +hi Todo guibg=gold guifg=black +hi WildMenu guibg=#b7b7b7 guibg=grey91 +hi Directory guibg=#cdcecd guifg=navyblue diff --git a/dot_vim/colors/xian.vim b/dot_vim/colors/xian.vim new file mode 100644 index 0000000..3cc02d8 --- /dev/null +++ b/dot_vim/colors/xian.vim @@ -0,0 +1,50 @@ +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "xian" + +hi Comment guifg=#C0C0C0 guibg=#946464 gui=underline +hi Constant guifg=#00FF80 guibg=#946464 gui=none +hi Cursor guifg=#00FFFF guibg=#000000 gui=reverse +hi DiffAdd guifg=#00FFFF guibg=#754F4F gui=bold,underline +hi DiffChange guibg=#754F4F +hi DiffDelete guifg=#C0C0C0 guibg=#754F4F gui=bold +hi DiffText guifg=#000000 guibg=#FF0000 gui=bold,underline +hi Directory guifg=#FFFF00 guibg=#946464 gui=underline +hi Error guifg=#000000 guibg=#FF0000 gui=bold,underline +hi ErrorMsg guifg=#000000 guibg=#FF0000 gui=bold,underline +hi FoldColumn guifg=#ffff74 guibg=#754F4F gui=bold +hi Folded guifg=#ffff74 guibg=#754F4F gui=underline +hi Identifier guifg=#EEAA73 guibg=#946464 gui=none +hi Ignore guifg=#946464 guibg=#946464 gui=none +hi IncSearch guifg=#FFFFFF guibg=#946464 gui=reverse +hi lCursor guifg=#FFFFFF guibg=#946464 gui=none +hi LineNr guifg=#C0C0C0 guibg=#754F4F gui=bold +hi Match guifg=#0000FF guibg=#FFFF00 gui=bold,reverse +hi ModeMsg guifg=#FFFFFF guibg=#946464 gui=bold +hi MoreMsg guifg=#d174a8 guibg=#946464 gui=bold +hi NonText guifg=#C0C0C0 guibg=#946464 gui=none +hi Normal guifg=#FFFFFF guibg=#946464 gui=none +hi PreProc guifg=#FFFF00 guibg=#946464 gui=none +hi Question guifg=#d174a8 guibg=#946464 gui=bold +hi Search guifg=#FFFF00 guibg=#FF8500 gui=underline +hi Special guifg=#bfbfef guibg=#946464 gui=none +hi SpecialKey guifg=#FFFF00 guibg=#946464 gui=none +hi Statement guifg=#5ad5d5 guibg=#946464 gui=bold +hi StatusLine guifg=#000000 guibg=#FFFFFF gui=bold +hi StatusLineNC guifg=#C0C0C0 guibg=#754F4F gui=bold +hi Title guifg=#74FF74 guibg=#946464 gui=bold +hi Todo guifg=#FFFF00 guibg=#0000FF gui=none +hi Type guifg=#FF74A8 guibg=#946464 gui=bold +hi User1 guifg=#999933 guibg=#45637F gui=bold +hi User2 guifg=#E7E77F guibg=#45637F gui=bold +hi User3 guifg=#000000 guibg=#45637F gui=bold +hi User4 guifg=#33CC99 guibg=#45637F gui=bold +hi VertSplit guifg=#FFFF00 guibg=#000000 gui=bold +hi Visual guifg=#FFFF00 guibg=#6B959B gui=none +hi VisualNOS guifg=#FFFFFF guibg=#946464 gui=underline +hi WarningMsg guifg=#000000 guibg=#FF0000 gui=bold,underline +hi WildMenu guifg=#FFFFFF guibg=#0000FF gui=none diff --git a/dot_vim/colors/zenburn.vim b/dot_vim/colors/zenburn.vim new file mode 100644 index 0000000..af9c07f --- /dev/null +++ b/dot_vim/colors/zenburn.vim @@ -0,0 +1,133 @@ +" Vim color file +" Maintainer: Jani Nurminen <jani.nurminen@intellitel.com> +" Last Change: $Id: zenburn.vim,v 1.13 2002/09/16 18:03:49 jnurmine Exp $ +" URL: Not yet... +" License: GPL +" +" Nothing too fancy, just some alien fruit salad to keep you in the zone. +" This syntax file was designed to be used with dark environments and +" low light situations. Of course, if it works during a daybright office, go +" ahead :) +" +" Owes heavily to other Vim color files! With special mentions +" to "BlackDust", "Camo" and "Desert". +" +" To install, copy to ~/.vim/colors directory. Then :colorscheme zenburn. +" See also :help syntax +" +" CONFIGURABLE PARAMETERS: +" +" You can use the default (don't set any parameters), or you can +" set some parameters to tweak the Zenlook colours. +" +" * To get more contrast to the Visual selection, use +" +" let g:zenburn_alternate_Visual = 1 +" +" * To use alternate colouring for Error message, use +" +" let g:zenburn_alternate_Error = 1 +" +" * The new default for Include is a duller orang.e To use the original +" colouring for Include, use +" +" let g:zenburn_alternate_Include = 1 +" +" * To turn the parameter(s) back to defaults, use unlet. +" +" That's it, enjoy! +" +" TODO +" - IME colouring (CursorIM) +" - obscure syntax groups: check and colourize +" - add more groups if necessary + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="zenburn" + +hi Boolean guifg=#dca3a3 +hi Character guifg=#dca3a3 gui=bold +hi Comment guifg=#7f9f7f +hi Conditional guifg=#f0dfaf gui=bold +hi Constant guifg=#dca3a3 gui=bold +hi Cursor guifg=#000d18 guibg=#8faf9f gui=bold +hi Debug guifg=#dca3a3 gui=bold +hi Define guifg=#ffcfaf gui=bold +hi Delimiter guifg=#8f8f8f +hi DiffAdd guifg=#709080 guibg=#313c36 gui=bold +hi DiffChange guibg=#333333 +hi DiffDelete guifg=#333333 guibg=#464646 +hi DiffText guifg=#ecbcbc guibg=#41363c gui=bold +hi Directory guifg=#dcdccc gui=bold +hi ErrorMsg guifg=#60b48a guibg=#3f3f3f gui=bold +hi Exception guifg=#c3bf9f gui=bold +hi Float guifg=#c0bed1 +hi FoldColumn guifg=#93b3a3 guibg=#3f4040 +hi Folded guifg=#93b3a3 guibg=#3f4040 +hi Function guifg=#efef8f +hi Identifier guifg=#efdcbc +hi IncSearch guibg=#f8f893 guifg=#385f38 +hi Keyword guifg=#f0dfaf gui=bold +hi Label guifg=#dfcfaf gui=underline +hi LineNr guifg=#7f8f8f guibg=#464646 +hi Macro guifg=#ffcfaf gui=bold +hi ModeMsg guifg=#ffcfaf gui=none +hi MoreMsg guifg=#ffffff gui=bold +hi NonText guifg=#404040 +hi Normal guifg=#dcdccc guibg=#3f3f3f +hi Number guifg=#8cd0d3 +hi Operator guifg=#f0efd0 +hi PreCondit guifg=#dfaf8f gui=bold +hi PreProc guifg=#ffcfaf gui=bold +hi Question guifg=#ffffff gui=bold +hi Repeat guifg=#ffd7a7 gui=bold +hi Search guifg=#ffffe0 guibg=#385f38 +hi SpecialChar guifg=#dca3a3 gui=bold +hi SpecialComment guifg=#82a282 gui=bold +hi Special guifg=#cfbfaf +hi SpecialKey guifg=#9ece9e +hi Statement guifg=#e3ceab guibg=#3f3f3f gui=none +hi StatusLine guifg=#1e2320 guibg=#acbc90 +hi StatusLineNC guifg=#2e3330 guibg=#88b090 +hi StorageClass guifg=#c3bf9f gui=bold +hi String guifg=#cc9393 +hi Structure guifg=#efefaf gui=bold +hi Tag guifg=#dca3a3 gui=bold +hi Title guifg=#efefef guibg=#3f3f3f gui=bold +hi Todo guifg=#7faf8f guibg=#3f3f3f gui=bold +hi Typedef guifg=#dfe4cf gui=bold +hi Type guifg=#dfdfbf gui=bold +hi Underlined guifg=#dcdccc guibg=#3f3f3f gui=underline +hi VertSplit guifg=#303030 guibg=#688060 +hi VisualNOS guifg=#333333 guibg=#f18c96 gui=bold,underline +hi WarningMsg guifg=#ffffff guibg=#333333 gui=bold +hi WildMenu guibg=#2c302d guifg=#cbecd0 gui=underline + +if exists("g:zenburn_alternate_Visual") + " Visual with more contrast, thanks to Steve Hall & Cream posse + hi Visual guifg=#000000 guibg=#71d3b4 +else + " use default visual + hi Visual guifg=#233323 guibg=#71d3b4 +endif + +if exists("g:zenburn_alternate_Error") + " use a bit different Error + hi Error guifg=#ef9f9f guibg=#201010 gui=bold +else + " default + hi Error guifg=#e37170 guibg=#332323 gui=none +endif + +if exists("g:zenburn_alternate_Include") + " original setting + hi Include guifg=#ffcfaf gui=bold +else + " new, less contrasted one + hi Include guifg=#dfaf8f gui=bold +endif + " TODO check every syntax group that they're ok diff --git a/dot_vim/compiler/ghc.vim b/dot_vim/compiler/ghc.vim new file mode 100644 index 0000000..77a36ce --- /dev/null +++ b/dot_vim/compiler/ghc.vim @@ -0,0 +1,470 @@ + +" Vim Compiler File +" Compiler: GHC +" Maintainer: Claus Reinke <claus.reinke@talk21.com> +" Last Change: 21/04/2009 +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim + +" ------------------------------ paths & quickfix settings first +" + +if exists("current_compiler") && current_compiler == "ghc" + finish +endif +let current_compiler = "ghc" + +let s:scriptname = "ghc.vim" + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname.": can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif +let ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') +if (!exists("b:ghc_staticoptions")) + let b:ghc_staticoptions = '' +endif + +" set makeprg (for quickfix mode) +execute 'setlocal makeprg=' . g:ghc . '\ ' . escape(b:ghc_staticoptions,' ') .'\ -e\ :q\ %' +"execute 'setlocal makeprg=' . g:ghc .'\ -e\ :q\ %' +"execute 'setlocal makeprg=' . g:ghc .'\ --make\ %' + +" quickfix mode: +" fetch file/line-info from error message +" TODO: how to distinguish multiline errors from warnings? +" (both have the same header, and errors have no common id-tag) +" how to get rid of first empty message in result list? +setlocal errorformat= + \%-Z\ %#, + \%W%f:%l:%c:\ Warning:\ %m, + \%E%f:%l:%c:\ %m, + \%E%>%f:%l:%c:, + \%+C\ \ %#%m, + \%W%>%f:%l:%c:, + \%+C\ \ %#%tarning:\ %m, + +" oh, wouldn't you guess it - ghc reports (partially) to stderr.. +setlocal shellpipe=2> + +" ------------------------- but ghc can do a lot more for us.. +" + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +" initialize map of identifiers to their types +" associate type map updates to changedtick +if !exists("b:ghc_types") + let b:ghc_types = {} + let b:my_changedtick = b:changedtick +endif + +if exists("g:haskell_functions") + finish +endif +let g:haskell_functions = "ghc" + +" avoid hit-enter prompts +set cmdheight=3 + +" edit static GHC options +" TODO: add completion for options/packages? +command! GHCStaticOptions call GHC_StaticOptions() +function! GHC_StaticOptions() + let b:ghc_staticoptions = input('GHC static options: ',b:ghc_staticoptions) + execute 'setlocal makeprg=' . g:ghc . '\ ' . escape(b:ghc_staticoptions,' ') .'\ -e\ :q\ %' + let b:my_changedtick -=1 +endfunction + +map <LocalLeader>T :call GHC_ShowType(1)<cr> +map <LocalLeader>t :call GHC_ShowType(0)<cr> +function! GHC_ShowType(addTypeDecl) + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = ( symb ? '('.name.')' : name ) + call GHC_HaveTypes() + if !has_key(b:ghc_types,name) + redraw + echo pname "type not known" + else + redraw + for type in split(b:ghc_types[name],' -- ') + echo pname "::" type + if a:addTypeDecl + call append( line(".")-1, pname . " :: " . type ) + endif + endfor + endif +endfunction + +" show type of identifier under mouse pointer in balloon +if has("balloon_eval") + set ballooneval + set balloondelay=600 + set balloonexpr=GHC_TypeBalloon() + function! GHC_TypeBalloon() + if exists("b:current_compiler") && b:current_compiler=="ghc" + let [line] = getbufline(v:beval_bufnr,v:beval_lnum) + let namsym = haskellmode#GetNameSymbol(line,v:beval_col,0) + if namsym==[] + return '' + endif + let [start,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = name " ( symb ? '('.name.')' : name ) + silent call GHC_HaveTypes() + if has("balloon_multiline") + return (has_key(b:ghc_types,pname) ? split(b:ghc_types[pname],' -- ') : '') + else + return (has_key(b:ghc_types,pname) ? b:ghc_types[pname] : '') + endif + else + return '' + endif + endfunction +endif + +map <LocalLeader>si :call GHC_ShowInfo()<cr> +function! GHC_ShowInfo() + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : (qual.'.'.unqual) + let output = GHC_Info(name) + pclose | new + setlocal previewwindow + setlocal buftype=nofile + setlocal noswapfile + put =output + wincmd w + "redraw + "echo output +endfunction + +" fill the type map, unless nothing has changed since the last attempt +function! GHC_HaveTypes() + if b:ghc_types == {} && (b:my_changedtick != b:changedtick) + let b:my_changedtick = b:changedtick + return GHC_BrowseAll() + endif +endfunction + +" update b:ghc_types after successful make +au QuickFixCmdPost make if GHC_CountErrors()==0 | silent call GHC_BrowseAll() | endif + +" count only error entries in quickfix list, ignoring warnings +function! GHC_CountErrors() + let c=0 + for e in getqflist() | if e.type=='E' && e.text !~ "^[ \n]*Warning:" | let c+=1 | endif | endfor + return c +endfunction + +command! GHCReload call GHC_BrowseAll() +function! GHC_BrowseAll() + " let imports = haskellmode#GatherImports() + " let modules = keys(imports[0]) + keys(imports[1]) + let imports = {} " no need for them at the moment + let current = GHC_NameCurrent() + let module = current==[] ? 'Main' : current[0] + if GHC_VersionGE([6,8,1]) + return GHC_BrowseBangStar(module) + else + return GHC_BrowseMultiple(imports,['*'.module]) + endif +endfunction + +function! GHC_VersionGE(target) + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>target[0])) + return 1 + elseif (i==target[0]) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction + +function! GHC_NameCurrent() + let last = line("$") + let l = 1 + while l<last + let ml = matchlist( getline(l), '^module\s*\([^ (]*\)') + if ml != [] + let [_,module;x] = ml + return [module] + endif + let l += 1 + endwhile + redraw + echo "cannot find module header for file " . expand("%") + return [] +endfunction + +function! GHC_BrowseBangStar(module) + redraw + echo "browsing module " a:module + let command = ":browse! *" . a:module + let orig_shellredir = &shellredir + let &shellredir = ">" " ignore error/warning messages, only output or lack of it + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + let &shellredir = orig_shellredir + return GHC_ProcessBang(a:module,output) +endfunction + +function! GHC_BrowseMultiple(imports,modules) + redraw + echo "browsing modules " a:modules + let command = ":browse " . join( a:modules, " \n :browse ") + let command = substitute(command,'\(:browse \(\S*\)\)','putStrLn "-- \2" \n \1','g') + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + return GHC_Process(a:imports,output) +endfunction + +function! GHC_Info(what) + " call GHC_HaveTypes() + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%"), ":i ". a:what) + return output +endfunction + +function! GHC_ProcessBang(module,output) + let module = a:module + let b = a:output + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\)\(\S*\)\s*::\(.*\)' + let commentPat = '^-- \(\S*\)' + let definedPat = '^-- defined locally' + let importedPat = '^-- imported via \(.*\)' + if !(b=~commentPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute( id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse! *<current>, we get both unqualified and qualified ids + let qualified = (id =~ '\.') && (id =~ '[A-Z]') + let b:ghc_types[id] = type + if !qualified + for qual in qualifiers + let b:ghc_types[qual.'.'.id] = type + endfor + endif + else + let mlImported = matchlist( l, importedPat ) + let mlDefined = matchlist( l, definedPat ) + if mlImported != [] + let [_,modules;x] = mlImported + let qualifiers = split( modules, ', ' ) + elseif mlDefined != [] + let qualifiers = [module] + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +function! GHC_Process(imports,output) + let b = a:output + let imports = a:imports + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\s*\)\(\S*\)\s*::\(.*\)' + let modPat = '^-- \(\S*\)' + " add '-- defined locally' and '-- imported via ..' + if !(b=~modPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute(id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse *<current>, we get both unqualified and qualified ids + if current_module " || has_key(imports[0],module) + if has_key(b:ghc_types,id) && !(matchstr(b:ghc_types[id],escape(type,'[].'))==type) + let b:ghc_types[id] .= ' -- '.type + else + let b:ghc_types[id] = type + endif + endif + if 0 " has_key(imports[1],module) + let qualid = module.'.'.id + let b:ghc_types[qualid] = type + endif + else + let mlMod = matchlist( l, modPat ) + if mlMod != [] + let [_,module;x] = mlMod + let current_module = module[0]=='*' + let module = current_module ? module[1:] : module + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +let s:ghc_templates = ["module _ () where","class _ where","class _ => _ where","instance _ where","instance _ => _ where","type family _","type instance _ = ","data _ = ","newtype _ = ","type _ = "] + +" use ghci :browse index for insert mode omnicompletion (CTRL-X CTRL-O) +function! GHC_CompleteImports(findstart, base) + if a:findstart + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + call GHC_HaveTypes() + for key in keys(b:ghc_types) + if key[0 : l]==a:base + let res += [{"word":key,"menu":":: ".b:ghc_types[key],"dup":1}] + endif + endfor + return res + endif +endfunction +set omnifunc=GHC_CompleteImports +set completeopt=menu,menuone,longest + +map <LocalLeader>ct :call GHC_CreateTagfile()<cr> +function! GHC_CreateTagfile() + redraw + echo "creating tags file" + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -e ":ctags" ' . expand("%")) + " for ghcs older than 6.6, you would need to call another program + " here, such as hasktags + echo output +endfunction + +command! -nargs=1 GHCi redraw | echo system(g:ghc. ' ' . b:ghc_staticoptions .' '.expand("%").' -e "'.escape(<f-args>,'"').'"') + +" use :make 'not in scope' errors to explicitly list imported ids +" cursor needs to be on import line, in correctly loadable module +map <LocalLeader>ie :call GHC_MkImportsExplicit()<cr> +function! GHC_MkImportsExplicit() + let save_cursor = getpos(".") + let line = getline('.') + let lineno = line('.') + let ml = matchlist(line,'^import\(\s*qualified\)\?\s*\([^( ]\+\)') + if ml!=[] + let [_,q,mod;x] = ml + silent make + if getqflist()==[] + if line=~"import[^(]*Prelude" + call setline(lineno,substitute(line,"(.*","","").'()') + else + call setline(lineno,'-- '.line) + endif + silent write + silent make + let qflist = getqflist() + call setline(lineno,line) + silent write + let ids = {} + for d in qflist + let ml = matchlist(d.text,'Not in scope: \([^`]*\)`\([^'']*\)''') + if ml!=[] + let [_,what,qid;x] = ml + let id = ( qid =~ "^[A-Z]" ? substitute(qid,'.*\.\([^.]*\)$','\1','') : qid ) + let pid = ( id =~ "[a-zA-Z0-9_']\\+" ? id : '('.id.')' ) + if what =~ "data" + call GHC_HaveTypes() + if has_key(b:ghc_types,id) + let pid = substitute(b:ghc_types[id],'^.*->\s*\(\S*\).*$','\1','').'('.pid.')' + else + let pid = '???('.pid.')' + endif + endif + let ids[pid] = 1 + endif + endfor + call setline(lineno,'import'.q.' '.mod.'('.join(keys(ids),',').')') + else + copen + endif + endif + call setpos('.', save_cursor) +endfunction + +if GHC_VersionGE([6,8,2]) + let opts = filter(split(substitute(system(g:ghc . ' -v0 --interactive', ':set'), ' ', '','g'), '\n'), 'v:val =~ "-f"') +else + let opts = ["-fglasgow-exts","-fallow-undecidable-instances","-fallow-overlapping-instances","-fno-monomorphism-restriction","-fno-mono-pat-binds","-fno-cse","-fbang-patterns","-funbox-strict-fields"] +endif + +amenu ]OPTIONS_GHC.- :echo '-'<cr> +aunmenu ]OPTIONS_GHC +for o in opts + exe 'amenu ]OPTIONS_GHC.'.o.' :call append(0,"{-# OPTIONS_GHC '.o.' #-}")<cr>' +endfor +if has("gui_running") + map <LocalLeader>opt :popup ]OPTIONS_GHC<cr> +else + map <LocalLeader>opt :emenu ]OPTIONS_GHC. +endif + +amenu ]LANGUAGES_GHC.- :echo '-'<cr> +aunmenu ]LANGUAGES_GHC +if GHC_VersionGE([6,8]) + let ghc_supported_languages = split(system(g:ghc . ' --supported-languages'),'\n') + for l in ghc_supported_languages + exe 'amenu ]LANGUAGES_GHC.'.l.' :call append(0,"{-# LANGUAGE '.l.' #-}")<cr>' + endfor + if has("gui_running") + map <LocalLeader>lang :popup ]LANGUAGES_GHC<cr> + else + map <LocalLeader>lang :emenu ]LANGUAGES_GHC. + endif +endif diff --git a/dot_vim/compiler/tex.vim b/dot_vim/compiler/tex.vim new file mode 100644 index 0000000..993ecfe --- /dev/null +++ b/dot_vim/compiler/tex.vim @@ -0,0 +1,293 @@ +" File: tex.vim +" Type: compiler plugin for LaTeX +" Original Author: Artem Chuprina <ran@ran.pp.ru> +" Customization: Srinath Avadhanula <srinath@fastmail.fm> +" CVS: $Id: tex.vim 997 2006-03-20 09:45:45Z srinathava $ +" Description: {{{ +" This file sets the 'makeprg' and 'errorformat' options for the LaTeX +" compiler. It is customizable to optionally ignore certain warnings and +" provides the ability to set a dynamic 'ignore-warning' level. +" +" By default it is set up in a 'non-verbose', 'ignore-common-warnings' mode, +" which means that irrelevant lines from the compilers output will be +" ignored and also some very common warnings are ignored. +" +" Depending on the 'ignore-level', the following kinds of messages are +" ignored. An ignore level of 3 for instance means that messages 1-3 will be +" ignored. By default, the ignore level is set to 4. +" +" 1. LaTeX Warning: Specifier 'h' changed to 't'. +" This errors occurs when TeX is not able to correctly place a floating +" object at a specified location, because of which it defaulted to the +" top of the page. +" 2. LaTeX Warning: Underfull box ... +" 3. LaTeX Warning: Overfull box ... +" both these warnings (very common) are due to \hbox settings not being +" satisfied nicely. +" 4. LaTeX Warning: You have requested ..., +" This warning occurs in slitex when using the xypic package. +" 5. Missing number error: +" Usually, when the name of an included eps file is spelled incorrectly, +" then the \bb-error message is accompanied by a bunch of "missing +" number, treated as zero" error messages. This level ignores these +" warnings. +" NOTE: number 5 is actually a latex error, not a warning! +" +" Use +" TCLevel <level> +" where level is a number to set the ignore level dynamically. +" +" When TCLevel is called with the unquoted string strict +" TClevel strict +" then the 'efm' switches to a 'verbose', 'no-lines-ignored' mode which is +" useful when you want to make final checks of your document and want to be +" careful not to let things slip by. +" +" TIP: MikTeX has a bug where it sometimes erroneously splits a line number +" into multiple lines. i.e, if the warning is on line 1234. the compiler +" output is: +" LaTeX Warning: ... on input line 123 +" 4. +" In this case, vim will wrongly interpret the line-number as 123 instead +" of 1234. If you have cygwin, a simple remedy around this is to first +" copy the file vimlatex (provided) into your $PATH, make sure its +" executable and then set the variable g:tex_flavor to vimlatex in your +" ~/.vimrc (i.e putting let "g:tex_flavor = 'vimlatex'" in your .vimrc). +" This problem occurs rarely enough that its not a botheration for most +" people. +" +" TODO: +" 1. menu items for dynamically selecting a ignore warning level. +" }}} + +" avoid reinclusion for the same buffer. keep it buffer local so it can be +" externally reset in case of emergency re-sourcing. +if exists('b:doneTexCompiler') && !exists('b:forceRedoTexCompiler') + finish +endif +let b:doneTexCompiler = 1 + +" ============================================================================== +" Customization of 'efm': {{{ +" This section contains the customization variables which the user can set. +" g:Tex_IgnoredWarnings: This variable contains a ¡ seperated list of +" patterns which will be ignored in the TeX compiler's output. Use this +" carefully, otherwise you might end up losing valuable information. +if !exists('g:Tex_IgnoredWarnings') + let g:Tex_IgnoredWarnings = + \'Underfull'."\n". + \'Overfull'."\n". + \'specifier changed to'."\n". + \'You have requested'."\n". + \'Missing number, treated as zero.'."\n". + \'There were undefined references'."\n". + \'Citation %.%# undefined' +endif +" This is the number of warnings in the g:Tex_IgnoredWarnings string which +" will be ignored. +if !exists('g:Tex_IgnoreLevel') + let g:Tex_IgnoreLevel = 7 +endif +" There will be lots of stuff in a typical compiler output which will +" completely fall through the 'efm' parsing. This options sets whether or not +" you will be shown those lines. +if !exists('g:Tex_IgnoreUnmatched') + let g:Tex_IgnoreUnmatched = 1 +endif +" With all this customization, there is a slight risk that you might be +" ignoring valid warnings or errors. Therefore before getting the final copy +" of your work, you might want to reset the 'efm' with this variable set to 1. +" With that value, all the lines from the compiler are shown irrespective of +" whether they match the error or warning patterns. +" NOTE: An easier way of resetting the 'efm' to show everything is to do +" TCLevel strict +if !exists('g:Tex_ShowallLines') + let g:Tex_ShowallLines = 0 +endif + +" }}} +" ============================================================================== +" Customization of 'makeprg': {{{ + +" There are several alternate ways in which 'makeprg' is set up. +" +" Case 1 +" ------ +" The first is when this file is a part of latex-suite. In this case, a +" variable called g:Tex_DefaultTargetFormat exists, which gives the default +" format .tex files should be compiled into. In this case, we use the TTarget +" command provided by latex-suite. +" +" Case 2 +" ------ +" The user is using this file without latex-suite AND he wants to directly +" specify the complete 'makeprg'. Then he should set the g:Tex_CompileRule_dvi +" variable. This is a string which should be directly be able to be cast into +" &makeprg. An example of one such string is: +" +" g:Tex_CompileRule_dvi = 'pdflatex \\nonstopmode \\input\{$*\}' +" +" NOTE: You will need to escape back-slashes, {'s etc yourself if you are +" using this file independently of latex-suite. +" TODO: Should we also have a check for backslash escaping here based on +" platform? +" +" Case 3 +" ------ +" The use is using this file without latex-suite and he doesnt want any +" customization. In this case, this file makes some intelligent guesses based +" on the platform. If he doesn't want to specify the complete 'makeprg' but +" only the name of the compiler program (for example 'pdflatex' or 'latex'), +" then he sets b:tex_flavor or g:tex_flavor. + +if exists('g:Tex_DefaultTargetFormat') + exec 'TTarget '.g:Tex_DefaultTargetFormat +elseif exists('g:Tex_CompileRule_dvi') + let &l:makeprg = g:Tex_CompileRule_dvi +else + " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor, + " otherwize the same for global variable with same name, else it will be LaTeX + if exists("b:tex_flavor") + let current_compiler = b:tex_flavor + elseif exists("g:tex_flavor") + let current_compiler = g:tex_flavor + else + let current_compiler = "latex" + end + if has('win32') + let escChars = '' + else + let escChars = '{}\' + endif + " Furthermore, if 'win32' is detected, then we want to set the arguments up so + " that miktex can handle it. + if has('win32') + let options = '--src-specials' + else + let options = '' + endif + let &l:makeprg = current_compiler . ' ' . options . + \ escape(' \nonstopmode \input{$*}', escChars) +endif + +" }}} +" ============================================================================== +" Functions for setting up a customized 'efm' {{{ + +" IgnoreWarnings: parses g:Tex_IgnoredWarnings for message customization {{{ +" Description: +function! <SID>IgnoreWarnings() + let i = 1 + while s:Strntok(g:Tex_IgnoredWarnings, "\n", i) != '' && + \ i <= g:Tex_IgnoreLevel + let warningPat = s:Strntok(g:Tex_IgnoredWarnings, "\n", i) + let warningPat = escape(substitute(warningPat, '[\,]', '%\\\\&', 'g'), ' ') + exe 'setlocal efm+=%-G%.%#'.warningPat.'%.%#' + let i = i + 1 + endwhile +endfunction + +" }}} +" SetLatexEfm: sets the 'efm' for the latex compiler {{{ +" Description: +function! <SID>SetLatexEfm() + + let pm = ( g:Tex_ShowallLines == 1 ? '+' : '-' ) + + set efm= + + if !g:Tex_ShowallLines + call s:IgnoreWarnings() + endif + + setlocal efm+=%E!\ LaTeX\ %trror:\ %m + setlocal efm+=%E!\ %m + + setlocal efm+=%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%# + setlocal efm+=%+W%.%#\ at\ lines\ %l--%*\\d + setlocal efm+=%+WLaTeX\ %.%#Warning:\ %m + + exec 'setlocal efm+=%'.pm.'Cl.%l\ %m' + exec 'setlocal efm+=%'.pm.'Cl.%l\ ' + exec 'setlocal efm+=%'.pm.'C\ \ %m' + exec 'setlocal efm+=%'.pm.'C%.%#-%.%#' + exec 'setlocal efm+=%'.pm.'C%.%#[]%.%#' + exec 'setlocal efm+=%'.pm.'C[]%.%#' + exec 'setlocal efm+=%'.pm.'C%.%#%[{}\\]%.%#' + exec 'setlocal efm+=%'.pm.'C<%.%#>%m' + exec 'setlocal efm+=%'.pm.'C\ \ %m' + exec 'setlocal efm+=%'.pm.'GSee\ the\ LaTeX%m' + exec 'setlocal efm+=%'.pm.'GType\ \ H\ <return>%m' + exec 'setlocal efm+=%'.pm.'G\ ...%.%#' + exec 'setlocal efm+=%'.pm.'G%.%#\ (C)\ %.%#' + exec 'setlocal efm+=%'.pm.'G(see\ the\ transcript%.%#)' + exec 'setlocal efm+=%'.pm.'G\\s%#' + exec 'setlocal efm+=%'.pm.'O(%*[^()])%r' + exec 'setlocal efm+=%'.pm.'P(%f%r' + exec 'setlocal efm+=%'.pm.'P\ %\\=(%f%r' + exec 'setlocal efm+=%'.pm.'P%*[^()](%f%r' + exec 'setlocal efm+=%'.pm.'P(%f%*[^()]' + exec 'setlocal efm+=%'.pm.'P[%\\d%[^()]%#(%f%r' + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-P%*[^()] + endif + exec 'setlocal efm+=%'.pm.'Q)%r' + exec 'setlocal efm+=%'.pm.'Q%*[^()])%r' + exec 'setlocal efm+=%'.pm.'Q[%\\d%*[^()])%r' + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-Q%*[^()] + endif + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-G%.%# + endif + +endfunction + +" }}} +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" SetTexCompilerLevel: sets the "level" for the latex compiler {{{ +function! <SID>SetTexCompilerLevel(...) + if a:0 > 0 + let level = a:1 + else + call Tex_ResetIncrementNumber(0) + echo substitute(g:Tex_IgnoredWarnings, + \ '^\|\n\zs\S', '\=Tex_IncrementNumber(1)." ".submatch(0)', 'g') + let level = input("\nChoose an ignore level: ") + if level == '' + return + endif + endif + if level == 'strict' + let g:Tex_ShowallLines = 1 + elseif level =~ '^\d\+$' + let g:Tex_ShowallLines = 0 + let g:Tex_IgnoreLevel = level + else + echoerr "SetTexCompilerLevel: Unkwown option [".level."]" + end + call s:SetLatexEfm() +endfunction + +com! -nargs=? TCLevel :call <SID>SetTexCompilerLevel(<f-args>) +" }}} + +" }}} +" ============================================================================== + +call s:SetLatexEfm() + +if !exists('*Tex_Debug') + function! Tex_Debug(...) + endfunction +endif + +call Tex_Debug("compiler/tex.vim: sourcing this file", "comp") + +" vim: fdm=marker:commentstring=\ \"\ %s diff --git a/dot_vim/doc/csupport.txt b/dot_vim/doc/csupport.txt new file mode 100644 index 0000000..266b8db --- /dev/null +++ b/dot_vim/doc/csupport.txt @@ -0,0 +1,1577 @@ +*csupport.txt* C/C++ Support November 21 2007 + +C/C++ Support *c-support* *csupport* + Plugin version 5.0.5 + for Vim version 6.0 and above + Fritz Mehner <mehner@fh-swf.de> + +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 indent 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 KEYWORD + comment |csupport-comm-keywords| + 1.1.7 C to C++ comments and vice versa |csupport-comm-c-cpp| + 1.1.8 Date and date+time |csupport-comm-date| + 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.4 Menu 'Idioms' |csupport-idioms| + 1.5 Menu 'Snippets' |csupport-snippets| + 1.5.1 Code snippets |csupport-snippets| + 1.5.2 Picking up prototypes |csupport-proto| + 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.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.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| + 6. C/C++ Dictionaries |csupport-dictionary| + 7. Extend taglist.vim for make and qmake |csupport-taglist| + 8. Syntax based folding |csupport-folding| + 9. Windows particularities |csupport-windows| +10. Troubleshooting |csupport-troubleshooting| +11. 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 /* */ + ) /* */ + +------------------------------------------------------------------------------ + +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|). + +------------------------------------------------------------------------------ + +1.1.6 KEYWORD+comment *csupport-comm-keywords* + +Preliminary comments to document (and find again) places where works will be +resumed shortly. Usually not meant for the final documentation. + +------------------------------------------------------------------------------ + +1.1.7 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.1.8 DATE AND DATE+TIME *csupport-comm-date* + +The format for 'date' and 'date time' can be defined by the user (see +|csupport-templates-date|). + +------------------------------------------------------------------------------ +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; | + | } | + +----------------------------+-----------------------------+ + +For 'switch' and 'case' see |csupport-stat-switch| and |csupport-stat-case|. + +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.4 MENU 'Idioms' *csupport-idioms* +------------------------------------------------------------------------------ + +1.4.1 ENTRY '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 ENTRY 'open input file' + +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.3 ENTRY 'open output file' + +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 + + +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.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: unspezified + } + +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.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 <silent> <F7> <Esc>:cp<CR> + map <silent> <F8> <Esc>:cn<CR> +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. + +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 with 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 or a marked region. +Before formatting the whole 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 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* +------------------------------------------------------------------------------ + +The root menu item 'help' shows this plugin help in a help window. The help +tags must have been generated with + :helptags ~/.vim/doc + +============================================================================== +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 + + -- Load / Unload C/C++ Support ---------------------------------------- + + \lcs Load C/C++ Support Menus (n, GUI only)} + \ucs Unload C/C++ Support Menus (n, GUI only)} + + -- 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) + \c/ code -> comment // (n,v) + \co comment -> code (n,v) + \cfr frame comment (n,i) + \cfu function comment (n,i) + \cme method description (n,i) + \cca class description (n,i) + \cd date (n,i) + \ct date \& time (n,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) + \sw while (n,i) + \swh while { } (n,v,i) + \ss switch (n,v,i) + \sc case (n,i) + \s{ { } (n,v,i) + + -- Preprocessor ------------------------------------------------------- + + \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) + -- Idioms ------------------------------------------------------------- + + \if function (n,v,i) + \isf static function (n,v,i) + \im main() (n,v,i) + \i0 for( x=0; x<n; x+=1 ) (n,v,i) + \in for( x=n-1; 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,i) + \ii open input file (n,i) + \io open output file (n,i) + + -- Snippets ----------------------------------------------------------- + + \nr read code snippet (n) + \nw write code snippet (n,v) + \ne edit code snippet (n) + \np pick up prototype (n,v) + \ni insert prototype(s) (n) + \nc clear prototype(s) (n) + \ns show prototype(s) (n) + + -- C++ ---------------------------------------------------------------- + + \+m method implementation (n,i) + \+c class (n,i) + \+cn class (using new) (n,i) + \+tm template method implementation (n,i) + \+tc template class (n,i) + \+tcn template class (using new) (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) + \rl link (n) + \rr run (n) + \ra set comand line arguments (n) + \rm run make (n) + \rg cmd. line arg. for make (n) + \rp run splint (n) + \ri cmd. line arg. for splint (n) + \rk run CodeCheck (TM) (n) + \re cmd. line arg. for CodeCheck (TM) (n) + \rd run indent (n,v) + \rh hardcopy buffer (n,v) + \rs show plugin settings (n) + \rx set xterm size (n, only Linux/UNIX & GUI) + \ro change output destination (n) + \rt rebuild templates (n) + +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 + +============================================================================== +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 + +Shift-F2 can be used to switch between source files and header files if the +plugin a.vim 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 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|). + +============================================================================== +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_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" + + Linux/UNIX: + g:C_ObjExtension ".o" + g:C_ExeExtension "" + g:C_CCompiler "gcc" + g:C_CplusCompiler "g++" + Windows: + g:C_ObjExtension ".obj" + g:C_ExeExtension ".exe" + g:C_CCompiler "gcc.exe" + g:C_CplusCompiler "g++.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_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 + +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 + +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) + (see |csupport-comm-style|) + g:C_CCompiler : The name of the C compiler. + g:C_CplusCompiler : The name of the C++ compiler. + 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 comming 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|* "" +*|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 + +*|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 + ---------------------------------------------------------------------------- + <CURSOR> The cursor position after insertion of a template + <SPLIT> 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. + + ---------------------------------------------------------------------------- + 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 +<SPLIT>). + + TEMPLATE NAME MODES + -------------------------------------------------------------------------- + comment.end-of-line-comment normal visual + comment.frame normal + comment.function normal + comment.method normal + comment.class normal + comment.file-description normal + comment.keyword-bug normal + comment.keyword-compiler normal + comment.keyword-todo normal + comment.keyword-tricky normal + comment.keyword-warning normal + comment.keyword-workaround normal + comment.keyword-keyword normal + comment.file-section-cpp-header-includes normal + comment.file-section-cpp-macros normal + comment.file-section-cpp-typedefs normal + comment.file-section-cpp-data-types normal + comment.file-section-cpp-class-defs normal + comment.file-section-cpp-local-variables normal + comment.file-section-cpp-prototypes normal + comment.file-section-cpp-function-defs-exported normal + comment.file-section-cpp-function-defs-local normal + comment.file-section-cpp-class-implementations-exported normal + comment.file-section-cpp-class-implementations-local normal + comment.file-section-hpp-header-includes normal + comment.file-section-hpp-macros normal + comment.file-section-hpp-exported-typedefs normal + comment.file-section-hpp-exported-data-types normal + comment.file-section-hpp-exported-class-defs normal + comment.file-section-hpp-exported-variables normal + comment.file-section-hpp-exported-function-declarations normal + + cpp.method-implementation normal + cpp.class normal + cpp.class-using-new normal + cpp.error-class normal + cpp.template-method-implementation normal + cpp.template-class normal + cpp.template-class-using-new normal + cpp.template-function normal + cpp.operator-in normal + cpp.operator-out normal + cpp.try-catch normal visual + cpp.catch normal visual + cpp.catch-points normal visual + cpp.extern normal visual + cpp.open-input-file normal + cpp.open-output-file normal + cpp.namespace normal visual + + idioms.function normal visual + idioms.function-static normal visual + idioms.main normal visual + idioms.enum normal visual + idioms.struct normal visual + idioms.union normal visual + idioms.calloc normal + idioms.malloc normal + idioms.open-input-file normal + idioms.open-output-file normal + idioms.fprintf normal + idioms.fscanf normal + + preprocessor.define normal + preprocessor.undefine normal + preprocessor.if-else-endif normal visual + preprocessor.ifdef-else-endif normal visual + preprocessor.ifndef-else-endif normal visual + preprocessor.ifndef-def-endif normal visual + + statements.do-while normal visual + statements.for normal + statements.for-block normal visual + statements.if normal + statements.if-block normal visual + statements.if-else normal visual + statements.if-block-else normal visual + statements.while normal + statements.while-block normal visual + statements.switch normal visual + statements.case normal + statements.block normal visual + + + +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: <CURSOR> + * 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 <SPLIT>. The text before <SPLIT> will +than be inserted above the marked area, the text after <SPLIT> will be +inserted behind the marked area. An example: + + == statements.if-block-else == + if ( <CURSOR> ) { + <SPLIT>} 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<CURSOR> + *|?FUNCTION_NAME|* ( ) + { + <SPLIT> return ; + } /* ----- end of function*|FUNCTION_NAME|* ----- */ + +The 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* + <CURSOR><SPLIT> + #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 + + +============================================================================== +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. EXTEND taglist.vim FOR make AND qmake *csupport-taglist* +============================================================================== + +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 <silent> <F11> <Esc><Esc>:Tlist<CR> + inoremap <silent> <F11> <Esc><Esc>:Tlist<CR> + + let tlist_make_settings = 'make;m:makros;t:targets' + 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). + +============================================================================== +8. SYNTAX BASED FOLDING *csupport-folding* +============================================================================== + +Syntax based folding can be enabled by adding the following lines to the file +'~/.vim/syntax/c.vim': + + syn region cBlock start="{" end="}" transparent fold + set foldmethod=syntax + " initially all folds open: + set foldlevel=999 + +You may have to create this file first. See |folding| for more information. + +============================================================================== +9. 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++' + +============================================================================== +10. 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. + +============================================================================== +11. RELEASE NOTES *csupport-release-notes* +============================================================================== +See file c-support/doc/ChangeLog . + +============================================================================== +vim:tw=78:noet:ts=2:ft=help:norl: diff --git a/dot_vim/doc/haskellmode.txt b/dot_vim/doc/haskellmode.txt new file mode 100644 index 0000000..905349c --- /dev/null +++ b/dot_vim/doc/haskellmode.txt @@ -0,0 +1,456 @@ +*haskellmode.txt* Haskell Mode Plugins 23/04/2009 + +Authors: + Claus Reinke <claus.reinke@talk21.com> ~ + +Homepage: + http://projects.haskell.org/haskellmode-vim + +CONTENTS *haskellmode* + + 1. Overview |haskellmode-overview| + 1.1 Runtime Requirements |haskellmode-requirements| + 1.2 Quick Reference |haskellmode-quickref| + 2. Settings |haskellmode-settings| + 2.1 GHC and web browser |haskellmode-settings-main| + 2.2 Fine tuning - more configuration options |haskellmode-settings-fine| + 3. GHC Compiler Integration |haskellmode-compiler| + 4. Haddock Integration |haskellmode-haddock| + 4.1 Indexing |haskellmode-indexing| + 4.2 Lookup |haskellmode-lookup| + 4.3 Editing |haskellmode-editing| + 5. Hpaste Integration |haskellmode-hpaste| + 6. Additional Resources |haskellmode-resources| + +============================================================================== + *haskellmode-overview* +1. Overview ~ + + The Haskell mode plugins provide advanced support for Haskell development + using GHC/GHCi on Windows and Unix-like systems. The functionality is + based on Haddock-generated library indices, on GHCi's interactive + commands, or on simply activating (some of) Vim's built-in program editing + support in Haskell-relevant fashion. These plugins live side-by-side with + the pre-defined |syntax-highlighting| support for |haskell| sources, and + any other Haskell-related plugins you might want to install (see + |haskellmode-resources|). + + The Haskell mode plugins consist of three filetype plugins (haskell.vim, + haskell_doc.vim, haskell_hpaste.vim), which by Vim's |filetype| detection + mechanism will be auto-loaded whenever files with the extension '.hs' are + opened, and one compiler plugin (ghc.vim) which you will need to load from + your vimrc file (see |haskellmode-settings|). + + + *haskellmode-requirements* +1.1 Runtime Requirements ~ + + The plugins require a recent installation of GHC/GHCi. The functionality + derived from Haddock-generated library indices also requires a local + installation of the Haddock documentation for GHC's libraries (if there is + no documentation package for your system, you can download a tar-ball from + haskell.org), as well as an HTML browser (see |haddock_browser|). If you + want to use the experimental hpaste interface, you will also need Wget. + + * GHC/GHCi ~ + Provides core functionality. http://www.haskell.org/ghc + + * HTML library documentation files and indices generated by Haddock ~ + These usually come with your GHC installation, possibly as a separate + package. If you cannot get them this way, you can download a tar-ball + matching your GHC version from http://www.haskell.org/ghc/docs/ + + * HTML browser with basic CSS support ~ + For browsing Haddock docs. + + * Wget ~ + For interfacing with http://hpaste.org. + + Wget is widely available for modern Unix-like operating systems. Several + ports also exist for Windows, including: + + - Official GNU Wget (natively compiled for Win32) + http://www.gnu.org/software/wget/#downloading + + - UnxUtils Wget (natively compiled for Win32, bundled with other ported + Unix utilities) + http://sourceforge.net/projects/unxutils/ + + - Cygwin Wget (emulated POSIX in Win32, must be run under Cygwin) + http://cygwin.com/packages/wget/ + + *haskellmode-quickref* +1.2 Quick Reference ~ + +|:make| load into GHCi, show errors (|quickfix| |:copen|) +|_ct| create |tags| file +|_si| show info for id under cursor +|_t| show type for id under cursor +|_T| insert type declaration for id under cursor +|balloon| show type for id under mouse pointer +|_?| browse Haddock entry for id under cursor +|_?1| search Hoogle for id under cursor +|_?2| search Hayoo! for id under cursor +|:IDoc| {identifier} browse Haddock entry for unqualified {identifier} +|:MDoc| {module} browse Haddock entry for {module} +|:FlagReference| {s} browse Users Guide Flag Reference for section {s} +|_.| qualify unqualified id under cursor +|_i| add 'import <module>(<identifier>)' for id under cursor +|_im| add 'import <module>' for id under cursor +|_iq| add 'import qualified <module>(<identifier>)' for id under cursor +|_iqm| add 'import qualified <module>' for id under cursor +|_ie| make imports explit for import statement under cursor +|_opt| add OPTIONS_GHC pragma +|_lang| add LANGUAGE pragma +|i_CTRL-X_CTRL-O| insert-mode completion based on imported ids (|haskellmode-XO|) +|i_CTRL-X_CTRL-U| insert-mode completion based on documented ids (|haskellmode-XU|) +|i_CTRL-N| insert-mode completion based on imported sources +|:GHCi|{command/expr} run GHCi command/expr in current module + +|:GHCStaticOptions| edit static GHC options for this buffer +|:DocSettings| show current Haddock-files-related plugin settings +|:DocIndex| populate Haddock index +|:ExportDocIndex| cache current Haddock index to a file +|:HpasteIndex| Read index of most recent entries from hpaste.org +|:HpastePostNew| Submit current buffer as a new hpaste + + +============================================================================== + *haskellmode-settings* +2. Settings ~ + + The plugins try to find their dependencies in standard locations, so if + you're lucky, you will only need to set |compiler| to ghc, and configure + the location of your favourite web browser. You will also want to make + sure that |filetype| detection and |syntax| highlighting are on. Given the + variety of things to guess, however, some dependencies might not be found + correctly, or the defaults might not be to your liking, in which case you + can do some more fine tuning. All of this configuration should happen in + your |vimrc|. +> + " enable syntax highlighting + syntax on + + " enable filetype detection and plugin loading + filetype plugin on +< + + *haskellmode-settings-main* +2.1 GHC and web browser ~ + + *compiler-ghc* *ghc-compiler* + To use the features provided by the GHC |compiler| plugin, use the + following |autocommand| in your vimrc: +> + au BufEnter *.hs compiler ghc +< + *g:ghc* + If the compiler plugin can't locate your GHC binary, or if you have + several versions of GHC installed and have a preference as to which binary + is used, set |g:ghc|: +> + :let g:ghc="/usr/bin/ghc-6.6.1" +< + *g:haddock_browser* + The preferred HTML browser for viewing Haddock documentation can be set as + follows: +> + :let g:haddock_browser="/usr/bin/firefox" +< + + *haskellmode-settings-fine* +2.2 Fine tuning - more configuration options ~ + + Most of the fine tuning is likely to happen for the haskellmode_doc.vim + plugin, so you can check the current settings for this plugin via the + command |:DocSettings|. If all the settings reported there are to your + liking, you probably won't need to do any fine tuning. + + *g:haddock_browser_callformat* + By default, the web browser|g:haddock_browser| will be started + asynchronously (in the background) on Windows or when vim is running in a + GUI, and synchronously (in the foreground) otherwise. These settings seem + to work fine if you are using a console mode browser (eg, when editing in + a remote session), or if you are starting a GUI browser that will launch + itself in the background. But if these settings do not work for you, you + can change the default browser launching behavior. + + This is controlled by |g:haddock_browser_callformat|. It specifies a + format string which uses two '%s' parameters, the first representing the + path of the browser to launch, and the second is the documentation URL + (minus the protocol specifier, i.e. file://) passed to it by the Haddock + plugin. For instance, to launch a GUI browser on Unix-like systems and + force it to the background (see also |shellredir|): +> + :let g:haddock_browser_callformat = '%s file://%s '.printf(&shellredir,'/dev/null').' &' +< + *g:haddock_docdir* + Your system's installed Haddock documentation for GHC and its libraries + should be automatically detected. If the plugin can't locate them, you + must point |g:haddock_docdir| to the path containing the master index.html + file for the subdirectories 'libraries', 'Cabal', 'users_guide', etc.: +> + :let g:haddock_docdir="/usr/local/share/doc/ghc/html/" +< + *g:haddock_indexfiledir* + The information gathered from Haddock's index files will be stored in a + file called 'haddock_index.vim' in a directory derived from the Haddock + location, or in $HOME. To configure another directory for the index file, + use: +> + :let g:haddock_indexfiledir="~/.vim/" +< + *g:wget* + If you also want to try the experimental hpaste functionality, you might + you need to set |g:wget| before the |hpaste| plugin is loaded (unless wget + is in your PATH): +> + :let g:wget="C:\Program Files\wget\wget.exe" +< + + Finally, the mappings actually use|<LocalLeader>|behind the scenes, so if + you have to, you can redefine|maplocalleader|to something other than '_'. + Just remember that the docs still refer to mappings starting with '_', to + avoid confusing the majority of users!-) + +============================================================================== + *haskellmode-compiler* *ghc* +3. GHC Compiler Integration ~ + + The GHC |compiler| plugin sets the basic |errorformat| and |makeprg| to + enable |quickfix| mode using GHCi, and provides functionality for show + info (|_si|), show type (|_t| or mouse |balloon|), add type declaration + (|_T|), create tag file (|_ct|), and insert-mode completion + (|i_CTRL-X_CTRL-O|) based on GHCi browsing of the current and imported + modules. + + To avoid frequent calls to GHCi, type information is cached in Vim. The + cache will be populated the first time a command depends on it, and will + be refreshed every time a |:make| goes through without generating errors + (if the |:make| does not succeed, the old types will remain available in + Vim). You can also unconditionally force reloading of type info using + |:GHCReload| (if GHCi cannot load your file, the type info will be empty). + + + In addition to the standard|quickfix| commands, the GHC compiler plugin + provides: + + *:GHCReload* +:GHCReload Reload modules and unconditionally refresh cache of + type info. Usually, |:make| is prefered, as that will + refresh the cache only if GHCi reports no errors, and + show the errors otherwise. + + *:GHCStaticOptions* +:GHCStaticOptions Edit the static GHC options for the current buffer. + Useful for adding hidden packages (-package ghc). + + *:GHCi* +:GHCi {command/expr} Run GHCi commands/expressions in the current module. + + *_ct* +_ct Create |tags| file for the current Haskell source + file. This uses GHCi's :ctags command, so it will work + recursively, but will only list tags for exported + entities. + + *_opt* +_opt Shows a menu of frequently used GHC compiler options + (selecting an entry adds the option as a pragma to the + start of the file). Uses popup menu (GUI) or :emenu + and command-line completion (CLI). + + *_lang* +_lang Shows a menu of the LANGUAGE options supported by GHC + (selecting an entry adds the language as a pragma to + the start of the file). Uses popup menu (GUI) or + :emenu and command-line completion (CLI). + + *_si* +_si Show extended information for the name under the + cursor. Uses GHCi's :info command. Output appears in + |preview-window| (when done, close with |:pclose|). + + *_t* +_t Show type for the name under the cursor. Uses cached + info from GHCi's :browse command. + + *_T* +_T Insert type declaration for the name under the cursor. + Uses cached info from GHCi's :browse command. + + *haskellmode-XO* *haskellmode-omni-completion* +CTRL-X CTRL-O Standard insert-mode omni-completion based on the + cached type info from GHCi browsing current and + imported modules. Only names from the current and from + imported modules are included (the completion menu + also show the type of each identifier). + +============================================================================== + *haskellmode-haddock* *haddock* +4. Haddock Integration ~ + + Haskell mode integrates with Haddock-generated HTML documentation, + providing features such as navigating to the Haddock entry for the + identifier under the cursor (|_?|), completion for the identifier under + the cursor (|i_CTRL-X_CTRL-U|), and adding import statements (|_i| |_im| + |_iq| |_iqm|) or module qualifier (|_.|) for the identifier under the + cursor. + + These commands operate on an internal Haddock index built from the + platform's installed Haddock documentation for GHC's libraries. Since + populating this index takes several seconds, it should be stored as a + file called 'haddock_index.vim' in the directory specified by + |g:haddock_indexfiledir|. + + Some commands present a different interface (popup menu or command-line + completion) according to whether the current Vim instance is graphical or + console-based (actually: whether or not the GUI is running). Such + differences are marked below with the annotations (GUI) and (CLI), + respectively. + + |:DocSettings| shows the settings for this plugin. If you are happy with + them, you can call |:ExportDocIndex| to populate and write out the + documentation index (should be called once for every new version of GHC). + + *:DocSettings* +:DocSettings Show current Haddock-files-related plugin settings. + + + *haskellmode-indexing* +4.1 Indexing ~ + + *:DocIndex* +:DocIndex Populate the Haddock index from the GHC library + documentation. + + *:ExportDocIndex* +:ExportDocIndex Cache the current Haddock index to a file (populate + index first, if empty). + + + *haskellmode-lookup* +4.2 Lookup ~ + + *_?* +_? Open the Haddock entry (in |haddock_browser|) for an + identifier under the cursor, selecting full + qualifications from a popup menu (GUI) or via + command-line completion (CLI), if the identifier is + not qualified. + + *_?1* +_?1 Search Hoogle (using |haddock_browser|) for an + identifier under the cursor. + + + *_?2* +_?2 Search Hayoo! (using |haddock_browser|) for an + identifier under the cursor. + + *:IDoc* +:IDoc {identifier} Open the Haddock entry for the unqualified + {identifier} in |haddock_browser|, suggesting possible + full qualifications. + + *:MDoc* +:MDoc {module} Open the Haddock entry for {module} in + |haddock_browser| (with command-line completion for + the fully qualified module name). + + *:FlagReference* +:FlagReference {s} Browse Users Guide Flag Reference for section {s} + (with command-line completion for section headers). + + + *haskellmode-editing* +4.3 Editing ~ + + *_.* +_. Fully qualify the unqualified name under the cursor + selecting full qualifications from a popup menu (GUI) + or via command-line completion (CLI). + + *_iq* *_i* +_i _iq Add 'import [qualified] <module>(<identifier>)' + statement for the identifier under the cursor, + selecting fully qualified modules from a popup menu + (GUI) or via command-line completion (CLI), if the + identifier is not qualified. This currently adds one + import statement per call instead of merging into + existing import statements. + + *_iqm* *_im* +_im Add 'import [qualified] <module>' statement for the + identifier under the cursor, selecting fully qualified + modules from a popup menu (GUI) or via command-line + completion (CLI), if the identifier is not qualified. + This currently adds one import statement per call + instead of merging into existing import statements. + + *_ie* +_ie On an 'import <module>' line, in a correctly loadable + module, temporarily comment out import and use :make + 'not in scope' errors to explicitly list imported + identifiers. + + *haskellmode-XU* *haskellmode-user-completion* +CTRL-X CTRL-U User-defined insert mode name completion based on all + names known to the Haddock index, including package + names. Completions are presented in a popup menu which + also displays the fully qualified module from which + each entry may be imported. + + CamelCode shortcuts are supported, meaning that + lower-case letters can be elided, using only + upper-case letters and module qualifier separators (.) + for disambiguation: + + pSL -> putStrLn + C.E.t -> Control.Exception.t + C.M.MP -> Control.Monad.MonadPlus + + To reduce unwanted matches, the first letter of such + shortcuts and the first letter after each '.' have to + match directly. + +============================================================================== + *haskellmode-hpaste* *hpaste* +5. Hpaste Integration ~ + + This experimental feature allows browsing and posting to + http://hpaste.org, a Web-based pastebin tailored for Haskell code. + + + *:HpasteIndex* +:HpasteIndex Read the most recent entries from hpaste.org. Show an + index of the entries in a new buffer, where ',r' will + open the current highlighted entry [and ',p' will + annotate it with the current buffer]. + + *:HpastePostNew* +:HpastePostNew Submit current buffer as a new hpaste entry. + [This, and ',p' above, are temporarily disabled, + needs update to new hpaste.org layout] + +============================================================================== + *haskellmode-resources* +6. Additional Resources ~ + + An quick screencast tour through of these plugins is available at: + + http://projects.haskell.org/haskellmode-vim/screencasts.html + + Other Haskell-related Vim plugins can be found here: + + http://www.haskell.org/haskellwiki/Libraries_and_tools/Program_development#Vim + + Make sure to read about Vim's other program-editing features in its online + |user-manual|. Also have a look at Vim tips and plugins at www.vim.org - + two other plugins I tend to use when editing Haskell are AlignPlugin.vim + (to line up regexps for definitions, keywords, comments, etc. in + consecutive lines) and surround.vim (to surround text with quotes, + brackets, parentheses, comments, etc.). + +============================================================================== + vim:tw=78:ts=8:ft=help: diff --git a/dot_vim/doc/imaps.txt b/dot_vim/doc/imaps.txt new file mode 100644 index 0000000..087b3db --- /dev/null +++ b/dot_vim/doc/imaps.txt @@ -0,0 +1,116 @@ + IMAP -- A fluid replacement for :imap + *imaps.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + + + + Abstract + ======== +This plugin provides a function IMAP() which emulates vims |:imap| function. The +motivation for providing this plugin is that |:imap| suffers from problems +which get increasingly annoying with a large number of mappings. + +Consider an example. If you do > + imap lhs something + + +then a mapping is set up. However, there will be the following problems: +1. The 'ttimeout' option will generally limit how easily you can type the lhs. + if you type the left hand side too slowly, then the mapping will not be + activated. + +2. If you mistype one of the letters of the lhs, then the mapping is deactivated + as soon as you backspace to correct the mistake. + +3. The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters initiate + mappings. + +This script provides a function IMAP() which does not suffer from these +problems. + + + + *imaps.txt-toc* +|im_1| Using IMAP + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Using IMAP *im_1* *imaps-usage* + + + +Each call to IMAP is made using the syntax: > + call IMAP (lhs, rhs, ft [, phs, phe]) + + +This is equivalent to having <lhs> map to <rhs> for all files of type <ft>. + +Some characters in the <rhs> have special meaning which help in cursor placement +as described in |imaps-placeholders|. The optional arguments define these +special characters. + +Example One: > + call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") + + +This effectively sets up the map for "bit`" whenever you edit a latex file. When +you type in this sequence of letters, the following text is inserted: > + \begin{itemize} + \item * + \end{itemize}<++> + +where * shows the cursor position. The cursor position after inserting the text +is decided by the position of the first "place-holder". Place holders are +special characters which decide cursor placement and movement. In the example +above, the place holder characters are <+ and +>. After you have typed in the +item, press <C-j> and you will be taken to the next set of <++>'s. Therefore by +placing the <++> characters appropriately, you can minimize the use of movement +keys. + +Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. + +Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you +want different place holder characters. Also, b:Imap_PlaceHolderStart and +b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and +g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific +place holders. + +Example Two: You can use the <C-r> command to insert dynamic elements such as +dates. > + call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') + + + +With this mapping, typing date` will insert the present date into the file. + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','--\ \ \ \ ','') +================================================================================ diff --git a/dot_vim/doc/latex-suite-quickstart.txt b/dot_vim/doc/latex-suite-quickstart.txt new file mode 100644 index 0000000..8c18b72 --- /dev/null +++ b/dot_vim/doc/latex-suite-quickstart.txt @@ -0,0 +1,448 @@ + A (very) quick introduction to Latex-Suite + *latex-suite-quickstart.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + + + + Abstract + ======== +Latex-Suite is a comprehensive set of scripts to aid in editing, compiling and +viewing LaTeX documents. A thorough explanation of the full capabilities of +Latex-Suite is described in the user manual. This guide on the other hand, +provides a quick 30-45 minute running start to some of the more commonly used +functionalities of Latex-Suite. + + *latex-suite-quickstart.txt-toc* +|lq_1| Using this tutorial +|lq_2| Inserting a template +|lq_3| Inserting a package +|lq_4| Inserting an Environment +|lq_5| A few keyboard shortcuts +|lq_6| Folding in Latex-Suite +|lq_7| Inserting a Reference +|lq_8| Compiling a document + |lq_8_1| Debugging LaTeX source files +|lq_9| Viewing DVI files + |lq_9_1| Performing forward searches + |lq_9_2| Performing inverse searches +|lq_10| Conclusions + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Using this tutorial *lq_1* *lq_a_bc* + *lsq-using-tutorial* + + + +This tutorial assumes that you have vim version 6.1+ installed on your machine. +To check, open vim and type > + :ver +You will see the version in the first line of the output. Get the latest vim +version from http://vim.sf.net |lq_u_1|. + +Assuming you have Vim 6.1+ already up and running, follow the instructions here +|lq_u_2| to set up Latex-Suite. Remember to make sure your 'grepprg' setting of +Vim works. + +Good, now you are all set to start the tutorial. Since this tutorial aims to +explain the newbie-friendly version of Latex-Suite, it needs some GUI +functionality. Therefore, at least for this tutorial, open the gui version of +vim. (On MS windows, this is the default). Open up this help file in either the +same gvim session in a split window or in a different session and follow the +(friendly) instructions. + +================================================================================ +Inserting a template *lq_2* *lq_a_bd* + *lsq-inserting-template* + + + +Start up gvim and begin editing a new file. > + e newfile.tex +If the installation went well, you should see a new set of menus appear. Goto +Tex-Suite > Templates. You will see a number of templates to choose from. For +now, choose to insert a template for an article. You should get the following in +the main vim window (after possibly a hit-enter prompt). > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Sun Jun 22 04:00 PM 2003 P + 4 % + 5 \documentclass[a4paper]{article} + 6 \begin{document} + 7 + 8 \end{document} + 9 + 10 ~ + 11 ~ + 12 ~ + 13 ~ + -- INSERT -- 7,1 All + + + +The cursor is left on line 7 (just after the \begin{document} line) from where +you can start typing straight away. Trying to lessen movement is a recurring +theme in Latex-Suite. + +================================================================================ +Inserting a package *lq_3* *lq_a_be* + *lsq-lsq-inserting-package* + + + +Assume that we are writing a mathematical paper and we want to use the popular +amsmath package. We will use some functionality which Latex-Suite provides +specifically for including LaTeX packages, providing options etc. Navigate to +before the \begin{document} line (The portion of the document before the +\begin{document} is called the _preamble_ in LaTeX). On an empty line in the +preamble, type the single word amsmath and then press <F5> in normal mode. The +line will change to > + \usepackage[]{amsmath}<++> +with the cursor positioned conviniently between the []'s. For now, do not worry +about the trailing <++> at the end of this line. Assume we want to provide the +sumlimits options to amsmath. You can either type in this option manually, or +choose from a menu of package options which Latex-Suite automatically creates +when you insert a package using <F5>. With the cursor still placed between the +[], goto TeX-Suite > Packages > amsmath Options. Choose the sumlimits option. +The package line should get converted to: > + \usepackage[sumlimits,]{amsmath}<++> + + +with the cursor before ]. Press <C-j> in insert mode. You will see the cursor +jump to the end of the package line and the trailing <++> will dissapear. What +just happened?! You had your first taste of _Placeholders_. Read more about them +(later) here |lq_u_3|. In short, pressing <C-j> in insert mode takes you to the +next <++> in the text. + +================================================================================ +Inserting an Environment *lq_4* *lq_a_bf* + *lsq-insert-environment* + + + +Now let us type in a simple formula in LaTeX. Move back to the body of the +document (The portion of the document between \begin{document} and +\end{document} is called the body). Type in a few simple sentences and then on +an empty line, type the single word eqnarray. Escape to normal mode and press +<F5>. (Remember: <F5> is very useful!) This time, the line will change to: > + \begin{eqnarray} + \label{}<++> + \end{eqnarray}<++> +<with the cursor between the {}. Enter a label. We will use eqn:euler. After +typing in eqn:euler, press <C-j>. This will take you outside the curly-braces. +Another time you used a Placeholder! + +================================================================================ +A few keyboard shortcuts *lq_5* *lq_a_bg* + *lsq-keyboard-shortcuts* + + + +Now to type in the famous Euler formula. Our aim is to type > + e^{j\pi} + 1 &=& 0 +Instead of typing this blindly, let us use a few shortcuts to reduce movement. +Start out by typing e^. Now instead of typing {, type another ^. You will see +the e^^ change instantly to e^{}<++> with the cursor between {}'s. (The ^^ +changed to ^{}<++>.) Continue with the following sequence of letters: j`p. This +will change instantly to j\pi. (The `p changed to \pi.) Having typed in all we +need to type between the {}'s, press <C-j>. You will pop back out of the +curly-braces. Continue typing the rest of the formula. You can use == as a +shortcut for &=&. Latex-Suite provides a large number of such shortcuts which +should making typing much more fun and fast if you get acquainted with them. A +list is provided here |lq_u_4|. Definitely spend some time getting a feel for +them. Most of them are pretty intuitive like `/ for \frac{}{}, `8 for \infty +etc. + +In order to understand the next section better, it will be helpful to have one +more \label. Lets use the handy <F5> key to insert another equation. This time +something simple like the following will do: > + \begin{eqnarray} + \label{eqn:simple} + 1 + 1 = 2 + \end{eqnarray} + + +================================================================================ +Folding in Latex-Suite *lq_6* *lq_a_bh* *lsq-folding* + + + +Okay, we have typed enough. At this stage, hopefully, your file is looking +something like this: > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 \documentclass[a4paper]{article} + 6 + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &=& 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 \begin{eqnarray} + 18 \label{eqn:simple} + 19 1 + 1 &=& 2 + 20 \end{eqnarray} + 21 This is my contribution to mathematics. + 22 \end{document} + +In normal mode, press \rf. This will fold up the entire file and you should see +the file looking as below: > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- + 21 This is my contribution to mathematics. + 22 \end{document} + +What has happened is that Latex-Suite folded away blocks of LaTeX code into +folded regions. You can open and close folds by using the command za in normal +mode. + +================================================================================ +Inserting a Reference *lq_7* *lq_a_bi* + *lsq-inserting-reference* + + + +A necessary part of LaTeX editing is referencing equations, figures, +bibliographic entries etc. This is done with the \ref and the \cite commands. +Latex-Suite provides an easy way to do this. Somewhere in the body of the +document, type in the following sentence > + This is a reference to (\ref{}). +With the cursor between the {} press <F9> in insert mode. Your vim session will +sprout two new windows and it should look like below: > + + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- + 21 This is my contribution to mathematics. + 22 This is a reference to (\ref{}<++>)<++> + 23 \end{document} + ~ + ~ + ~ + test.tex [+] 22,29 Bot + test.tex|11| \label{eqn:euler} + test.tex|18| \label{eqn:simple} + ~ + ~ + ~ + [Error List] 1,1 All + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &=& 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + test.tex [Preview][+] 11,2-5 46% + + + +The cursor will relocate to the middle window which shows all \labels found in +all the .tex file in the current directory. You can scroll up and down in the +middle window till you reach the reference you want to insert. Notice how when +you scroll in the middle window, the bottom "Preview" window scrolls +automatically to show you the location of the current selection. This helps you +identify the reference with greater ease because often times, \labels are not +descriptive enough or there might be too many of them. To insert the reference, +just position the cursor on the relevant line in the middle window and press +<enter>. The line which you were editing will change to: > + This is a reference to (\ref{eqn:euler}) +<and the bottom windows close automatically. + +The <F9> key also works for inserting \cite commands to reference bibliographich +entries, inserting file names for the \inputgraphics command and just plain +searching for words. Click here |lq_u_5| for more information. + +================================================================================ +Compiling a document *lq_8* *lq_a_bj* + *lsq-compiling* + +|lq_8_1| Debugging LaTeX source files + + +Great! We have just created a small latex file. The next step is to make the +latex compiler create a .dvi file from it. Compiling via latex-suite is simple. +Goto normal mode and press \ll (replace \ with whatever mapleader setting you +have). This will call the latex compiler. If all goes well, then the focus +should return to the vim window. + +Nothing happend? Ouch! You might need to do some additional settings as +described here. |lq_u_6| + + +-------------------------------------------------------------------------------- +Debugging LaTeX source files *lq_8_1* *lq_a_bk* + *lsq-debugging* + +To illustrate the debugging procedure, let's create a few mistakes in the file. +Insert the following ``mistakes'' in the file: > + This is a $\mistake$. + And this is $\another$ +Now press \ll again. This time you will notice that after compilation finishes, +the cursor automatically lands on $\mistake$. In addition, 2 new windows will +appear as shown here: + +The middle window is an _Error List_ window showing you the errors which the +latex compiler found. Th bottom window is a _Log Preview_ window, which shows +you the context of the error made by displaying the relevant portion of the .log +file created during the latex compilation procedure. Jump to the _Error List_ +window and try scrolling around in it using either the j, k keys or the arrow +keys. You will notice that the _Log Preview_ window scrolls automatically to +retain the context of the error you are currently located on. If you press +<enter> on any line, you will see the cursor jump to the location of the error. +Latex-Suite tries to guess the column location as best as it can so you can +continue typing straight away. +Having got a taste for compiling, proceed by deleting the erroneous lines and +re-compiling. + +The Latex-Suite compiler is capable of much more including selectively filtering +out common errors which you might want to ignore for the moment, compiling parts +of a document, setting levels of verbosity in the compiler output etc. See here +|lq_u_7| for more. + +================================================================================ +Viewing DVI files *lq_9* *lq_a_bl* + *lsq-viewing-dvi* + +|lq_9_1| Performing forward searches +|lq_9_2| Performing inverse searches + + +Now that you have compiled your first latex source, its time to view it. Again, +this should be pretty simple. Press \lv in normal mode. Depending on your +platform, a DVI viewer program should open up and display the dvi file generated +in compilation step previously. + +Nothing happend? Ouch! You might need to do some additional settings as +described here. |lq_u_8| + + +-------------------------------------------------------------------------------- +Performing forward searches *lq_9_1* *lq_a_bm* + *lsq-quick-forward-searching* + +If you are using a modern DVI viewer, then it is possible to do what is called +forward and inverse searching. However, you will need to customize the standard +Latex-Suite distribution in order to utilize this functionality. Type in the +following on the command line: > + :let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' + :TCTarget dvi + + +Now recompile the latex file by pressing \ll. This time, instead of pressing \lv +to view the file, press \ls from within the tex file. If the DVI viewer supports +forward searching (most of them do), then the viewer will actually display the +portion of the DVI file corresponding to the location where you were editing the +tex file. + +NOTE: The reason Latex-Suite does not have this setting by default is that on + some systems this causes unpredictable results in the DVI output. If you + find the DVI output satisfactory, then you can insert the first of the 2 + lines above into your $VIM/ftplugin/tex.vim file. $VIM is ~/vimfiles for + windows and ~/.vim for *nix machines. + + + +-------------------------------------------------------------------------------- +Performing inverse searches *lq_9_2* *lq_a_bn* + *lsq-quick-inverse-searching* + +Most DVI viewers also support inverse searching, whereby you can make the DVI +viewer ask vim to display the tex source corresponding to the DVI file being +shown. This is extremeley helpful while proofreading large documents. + +Simply double-click anywhere in the viewer window. If the viewer supports it, +then it will attempt to open an editor window at the location corresponding to +where you double-clicked. On *nix platforms, Latex-Suite attempts to start the +viewer program in such a way that it already knows to use vim to open the tex +source. Thus you should see a vim window open up showing the tex file. However, +if there is an error, or some other program is used, you will need to tell the +viewer program to use gvim as the editor. On windows platforms, if you use the +commonly available yap viewer (available as part of the miktex distribution), +then this option can be set from View > Options > Inverse Search. In the Command +line: window, write > + "C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f" +(Customize the path according to where you have installed gvim). If you double +click in the view pane now, you will see gvim start up and take you to the +relevant portion of the tex file. + +================================================================================ +Conclusions *lq_10* *lq_a_bo* + *lsq-conclusions* + + + +Thats all folks! By now, you should know enough of the basic functions of +latex-suite. Ofcourse, latex-suite is capable of much, much more such as +compiling files multiple times to resolve changed labels, compiling +dependencies, handling user packages and more. To get a feel for that, you will +need to take a look at the Latex-Suite user manual. |lq_u_9| + +================================================================================ +URLs used in this file + +*lq_u_1* : http://vim.sf.net +*lq_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download&title=Download +*lq_u_3* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html +*lq_u_4* : http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html +*lq_u_5* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html +*lq_u_6* : http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-2 +*lq_u_7* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html +*lq_u_8* : http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-3 +*lq_u_9* : http://vim-latex.sourceforge.net/index.php?subject=manual&title=Manual#user-manual + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','') +================================================================================ diff --git a/dot_vim/doc/latex-suite.txt b/dot_vim/doc/latex-suite.txt new file mode 100644 index 0000000..a44cd9b --- /dev/null +++ b/dot_vim/doc/latex-suite.txt @@ -0,0 +1,3418 @@ + Latex-Suite Reference + *latex-suite.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + Mikolaj Machowski <mikmach AT wp DOT pl> + + + + Abstract + ======== +Latex-Suite attempts to provide a comprehensive set of tools to view, edit and +compile LaTeX documents in Vim. Together, they provide tools starting from +macros to speed up editing LaTeX documents to functions for forward searching +.dvi documents. Latex-Suite has been possible because of the contributions of +many people. Please see latex-suite-credits [|ls_a_dU|] for a list of people who +have helped. + +Latex-Suite is released under the Vim charityware license. For license and +conditions of use look at |copyright|. Replace all occurrences of ``Vim'' with +``Latex-Suite''. The current copyright holders of Latex-Suite are Srinath +Avadhanula and Mikolaj Machowski. + +Homepage: http://vim-latex.sourceforge.net |ls_u_1| + + + + *latex-suite.txt-toc* +|ls_1| Installation and recommended Settings +|ls_2| Inserting Templates +|ls_3| Latex-Suite Macros + |ls_3_1| Environment Mappings + |ls_3_2| Command Mappings + |ls_3_3| Font Mappings + |ls_3_4| Section Mappings + |ls_3_5| Greek Letter Mappings + |ls_3_6| Auc-Tex Key Bindings + |ls_3_7| Diacritics + |ls_3_8| BibTeX Shortcuts + |ls_3_9| Smart Key Mappings + |ls_3_10| Alt Key Macros + |ls_3_11| Custom Macros + |ls_3_12| Making your own Macros via IMAP() +|ls_4| Package Handling + |ls_4_1| Inserting package commands + |ls_4_2| Actions taken for supported packages + |ls_4_3| Automatic Package detection + |ls_4_4| Writing supporting for a package +|ls_5| Latex Completion + |ls_5_1| Latex-Suite completion example + |ls_5_2| Latex-Suite \ref completion + |ls_5_3| Latex-Suite \cite completion + |ls_5_4| Latex-Suite filename completion + |ls_5_5| Custom command completion +|ls_6| LaTeX Compiling + |ls_6_1| Setting Compilation rules + |ls_6_2| Handling dependencies in compilation + |ls_6_3| Compiling multiple times + |ls_6_4| Customizing the compiler output + |ls_6_5| Compiling parts of a file +|ls_7| Latex Viewing and Searching + |ls_7_1| Setting Viewing rules + |ls_7_2| Forward Searching DVI documents + |ls_7_3| Inverse Searching +|ls_8| Latex Folding + |ls_8_1| Default Folding Scheme in Latex-Suite + |ls_8_2| Customizing what to fold + |ls_8_3| Editing the folding.vim file directly +|ls_9| Multiple file LaTeX projects + |ls_9_1| Latex-Suite project settings + |ls_9_2| Specifying which file to compile +|ls_10| Latex-Suite Commands and Maps + |ls_10_1| Latex-Suite Maps + |ls_10_2| Latex Suite Commands +|ls_11| Customizing Latex-Suite + |ls_11_1| General Settings + |ls_11_2| Place-Holder Customization + |ls_11_3| Macro Customization + |ls_11_4| Smart Key Customization + |ls_11_5| Latex Completion Customization + |ls_11_6| Compiler Customization + |ls_11_7| Viewer Customization + |ls_11_8| Menu Customization + |ls_11_9| Folding Customization + |ls_11_10| Package Handling Customization +|ls_12| Credits + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Installation and recommended Settings *ls_1* *ls_a_bc* + *recommended-settings* + + + +If you are reading this, it most probably means that you have already installed +Latex-Suite and the help files. If this is not the case, follow the detailed +instructions on Latex-Suite's download page |ls_u_2|. + +Make sure that you create a few necessary settings in your ~/.vimrc. > + + " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. + filetype plugin on + + " IMPORTANT: win32 users will need to have 'shellslash' set so that latex + " can be called correctly. + set shellslash + + " IMPORTANT: grep will sometimes skip displaying the file name if you + " search in a singe file. This will confuse Latex-Suite. Set your grep + " program to always generate a file-name. + set grepprg=grep\ -nH\ $* + + " OPTIONAL: This enables automatic indentation as you type. + filetype indent on + + + +In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim +file: > + " this is mostly a matter of taste. but LaTeX looks good with just a bit + " of indentation. + set sw=2 + " TIP: if you write your \label's as \label{fig:something}, then if you + " type in \ref{fig: and press <C-n> you will automatically cycle through + " all the figure labels. Very useful! + set iskeyword+=: + + + +================================================================================ +Inserting Templates *ls_2* *ls_a_bd* + *latex-suite-templates* + + + +This functionality is available via the TeX-Suite > Templates menu. This module +provides a way to insert custom templates at the beginning of the current file. + +When Latex-Suite first starts up, it scans the +$VIM/ftplugin/latex-suite/templates/ directory and creates menu items based on +the files found there. When you select a template from this menu, the file will +be read in above the first line of the current file. + +A template file can utilize placeholders for initializing the cursor position +when the template is read in and subsequent movement. In addition, template +files can contain dynamic elements such as the time of creation of a file etc, +by using vim expressions. + +You can place your own templates in the $VIM/ftplugin/latex-suite/templates/ +directory in order for them to be available via the menu. Unless Latex-Suite +releases a template with the same name, these files should not get over-written +when you install a new release over an existing one. + +NOTE: Templates are also accessible for non-gui users with the command + |:TTemplate|. The argument should be name of the corresponding template + file. If the command is called without arguments (preferred usage), then a + list of available templates is displayed and the user is asked to choose + one of them. + + + +================================================================================ +Latex-Suite Macros *ls_3* *ls_a_be* + *latex-macros* + +|ls_3_1| Environment Mappings +|ls_3_2| Command Mappings +|ls_3_3| Font Mappings +|ls_3_4| Section Mappings +|ls_3_5| Greek Letter Mappings +|ls_3_6| Auc-Tex Key Bindings +|ls_3_7| Diacritics +|ls_3_8| BibTeX Shortcuts +|ls_3_9| Smart Key Mappings +|ls_3_10| Alt Key Macros +|ls_3_11| Custom Macros +|ls_3_12| Making your own Macros via IMAP() + + +Latex-Suite ships with a very comprehensive set of insert mode and |visual-mode| +mappings and menu items to typeset most of the LaTeX elements. + +NOTE: These mappings are are not standard mappings in the sense that only the + last character is mapped. See plugin/imaps.vim for further documentation. + For example, in the case of the mapping EFI provided by Latex-Suite you + can press the characters 'E', 'F' and 'I' as slowly as you wish (unlike + the normal imap command where timeout issues are involved). The characters + are visible as you type them (unlike normal imaps) and you can use the + movement or backspace key to correct yourself unlike normal mappings. + + + *place-holder* *ls_a_dV* + *place-holders* *ls_a_eD* +NOTE: Place Holders + ------------- + Almost all macros provided in Latex-Suite implement Stephen Riem's + bracketing system and Gergely Kontra's JumpFunc() for handling + place-holders. This consists of using "place-holders" to mark off + locations where the next relevant editing has to be done. As an example, + when you type EFI in |insert-mode|, you will get the following: > + \begin{figure}[h] + \centerline{\psfig{figure=<+eps file+>}} + \caption{<+caption text+>} + \label{fig:<+label+>} + \end{figure}<++> +< The text <+eps file+> will be selected and you will be left in + |select-mode| so that you can continue typing straight away. After having + typed in the file name, you can press <Ctrl-J> (while still in + insert-mode). This will take you directly to the next "place-holder". i.e, + <+caption text+> will be visually selected with Vim in select mode again + for typing in the caption. This saves on a lot of key presses. + + + *overriding-macros* *ls_a_eE* +NOTE: Over-riding Latex-Suite Macros + ------------------------------ + If you wish to change these macros from their default values, for example, + if you wish to change `w to expand to \omega instead of its default + expansion to \wedge, you should use the IMAP function as described in the + Using IMAP() [|ls_a_bG|] section. + + An important thing to note is that if you wish to over-ride macros created + by Latex-Suite rather than merely create new macros, you should place the + IMAP() calls in a script which gets sourced after the files in + Latex-Suite. A good place typically is as a file-type plugin file in the + ~/.vim/after/ftplugin/ directory. (Use ~/vimfiles if you are using + WINDOWS). For example to over-ride `w to \omega instead of \wedge, place + the following line in (say) ~/.vim/after/ftplugin/tex_macros.vim: > + call IMAP('`w', '\omega', 'tex') +< + + NOTE: It is important to use a file-name which will get sourced on a + FileType event. Therefore you must use a file-name which conforms to + the standards as described in |ftplugin-name|. + + + + *pausing-imaps* *ls_a_eF* +NOTE: Pausing Macro expansion + ----------------------- + If you wish to temporarily suspend the imaps functionality, then you can + set the Imap_FreezeImap to 1. If you set g:Imap_FreezeImap to 1, then it + will be a system-wide setting. Setting b:Imap_FreezeImap will affect only + the current buffer. + + +The following sections describe the various editing macros provided by +Latex-Suite. + + +-------------------------------------------------------------------------------- +Environment Mappings *ls_3_1* *ls_a_bf* + *environment-mappings* + +Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX +environments, i.e, \begin{...} ... \end{...} pairs. + +Inserting Environments *ls_3_1_1* *ls_a_bg* + *inserting-environments* + +Latex-Suite provides the following ways to insert environments + + + +Method 1: Pressing <F5> *ls_3_1_1_1* *ls_a_bh* + *inserting-env-f5* + +If you press <F5> in the insert or normal mode while on an empty line, +Latex-Suite prompts you with a list of environments you might want to insert. +You can either choose one from the list or type in a new environment name. If +you press <F5> on a line which already has a word, then that word is used +instead of prompting. + +See Tex_Env_name [|ls_a_cZ|] for a description of how Latex-Suite uses the word +to form the expansion and how to modify Latex-Suite's behavior. + +The list of environments which Latex-Suite prompts you with (when <F5> is +pressed on an empty line) is formed from the Tex_PromptedEnvironments +[|ls_a_di|] setting. + +In addition to this setting, Latex-Suite also lists environments found in custom +packages as described in the section Package actions. [|ls_a_bL|] + + +Method 2: Using <S-F1>-<S-F4> *ls_3_1_1_2* *ls_a_bi* + *inserting-env-shift-f1* + +The shifted function keys, <S-F1> to <S-F4> can be mapped to insert very +commonly used environments. The environments mapped to each key can be +customized via the g:Tex_HotKeyMappings [|ls_a_dj|] setting. + + +Method 3: Using three letter sequences *ls_3_1_1_3* *ls_a_bj* + *inserting-env-threeletter* + +Environments can also be inserted by pressing a 3 capital letter sequence +starting with an E. The sequence of 3 letters generally tries to follow the +following rules: + + +1. All environment mappings begin with E + +2. If the environment can be broken up into 2 distinct words, such as flushright + (flush + right), then the next 2 letters are the first letters of the 2 + words. Example: > + flushleft (_f_lush + _l_eft) ---> EFL + flushright (_f_lush + _r_ight) ---> EFR + eqnarray (_e_qn + _a_rray) ---> EEA +< If on the other hand, the environment name cannot be broken up into 2 + distinct words, then the next 2 letters are the first 2 letters of the name + of the environment. Example: > + equation (_eq_uation) ---> EEQ +< +Unfortunately there are some environments that cannot be split in two words and +first two letters in name are identical. In this case shortcut is created from +E, first and last letter. Example: > + quote (_q_uot_e_) ---> EQE + quotation (_q_uotatio_n_) ---> EQN +Of course, not every last one of the environments can follow this rule because +of ambiguities. In case of doubt, pull down the Tex-Environments menu. The menu +item should give the hint for the map. + + +Enclosing in Environments *ls_3_1_2* *ls_a_bk* + *enclosing-environments* + +Latex-Suite provides visual-mode mappings which enclose visually selected +portions of text in environments. There are two ways provided to do this. + + + +Method 1: Pressing <F5> *ls_3_1_2_1* *ls_a_bl* + *enclosing-env-f5* + +You can also select a portion of text visually and press <F5> while still in +visual mode. This will prompt you with a list of environments. (This list can be +customized via the g:Tex_PromptedEnvironments [|ls_a_di|] setting). You can +either choose from this list or type in a new environment name. Once the +selection is done, Latex-Suite encloses the visually selected portion in the +chosen environment. + + +Method 2: Using three letter mappings *ls_3_1_2_2* *ls_a_bm* + *enclosing-env-threeletter* + +You can also select text visually and press a sequence of three characters +beginning with , (the single comma character) and the selected text will be +enclosed in the chosen environment. The three letter sequence follows directly +from the three letter sequence used to insert environments as described here +[|ls_a_bj|]. The following example describes the rule used: + +If ECE inserts a \begin{center}...\end{center} environment, then to enclose a +block of selected text in \begin{center}...\end{center}, simply select the text +and press ,ce. The rule simply says that the leading E is converted to , and the +next 2 letters are small case. +Some of the visual mode mappings are sensitive to whether you choose line-wise +or character-wise. For example, if you choose a word and press ,ce, then you get +\centerline{word}, whereas if you press ,ce on a line-wise selection, you get: > + \begin{center} + line + \end{center} + + + +Changing Environments *ls_3_1_3* *ls_a_bn* + *changing-environments* + +Pressing <S-F5> in normal mode detects which environment the cursor is presently +located in and prompts you to replace it with a new one. The innermost +environment is detected. For example, in the following source: > + \begin{eqnarray} + \begin{array}{ccc} + 2 & 3 & 4 + \end{array} + \end{eqnarray} +if you are located in the middle "2 & 3 & 4" line, then pressing <S-F5> will +prompt you to change the array environment, not the eqnarray environment. In +addition, Latex-Suite will also try to change lines within the environment to be +consistent with the new environment. For example, if the original environment +was an eqnarray environment with a \label command, then changing it to an +eqnarray* environment will delete the \label. + +Pressing <F5> in normal mode has the same effect as pressing <F5> in +insert-mode, namely you will be prompted to choose an environment to insert. + +-------------------------------------------------------------------------------- +Command Mappings *ls_3_2* *ls_a_bo* + *latex-command-maps* + +Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX +commands. + +Inserting LaTeX commands *ls_3_2_1* *ls_a_bp* + *inserting-commands* + + *ls-imap-f7* *ls_a_dW* + *ls-imap-s-f7* *ls_a_dX* +Pressing <F7> in insert or normal mode while the cursor is touching a word will +insert a command formed from the word touching the cursor. + +For certain common commands, Latex-Suite will expand them to include additional +arguments as needed. For example, frac becomes \frac{<++>}{<++>}<++>. Otherwise, +it will simply change the word under the cursor as follows > + word --> \word{<++>}<++> +You can define custom expansions of commands using the Tex_Com_{name} setting as +described in here [|ls_a_da|]. + +If <F7> is pressed when the cursor is on white-space, then Latex-Suite will +prompt you to choose a command and insert that instead.The list of commands is +constructed from the g:Tex_PromptedCommands [|ls_a_dk|] setting and also from +commands which Latex-Suite finds while scanning custom packages which +Latex-Suite finds. See the Package actions [|ls_a_bL|] section for details on +which files are scanned etc. + + +Enclosing in a command *ls_3_2_2* *ls_a_bq* + *enclosing-commands* + +You can select a portion of text visually and press <F7> while still in visual +mode. This will prompt you with a list of commands. (This list can be customized +via the g:Tex_PromptedCommands [|ls_a_dk|] setting). You can either choose from +this list or type in a new command name. Once the selection is done, Latex-Suite +encloses the visually selected portion in the chosen command. + + +Changing commands *ls_3_2_3* *ls_a_br* + *changing-commands* + + *ls-vmap-f7* *ls_a_dY* +In both insert and normal mode <S-F7> will find out if you are presently within +an environment and then prompt you with a list of commands to change it to. + +-------------------------------------------------------------------------------- +Font Mappings *ls_3_3* *ls_a_bs* *font-maps* + +These mappings insert font descriptions such as: \textsf{<++>}<++> with the +cursor left in place of the first placeholder [|ls_a_eD|] (the <++> characters). + +Mnemonic: +1. first letter is always F (F for font) + +2. next 2 letters are the 2 letters describing the font. + +Example: Typing FEM in insert-mode expands to \emph{<++>}<++>. + +Just like environment mappings, you can visually select an area and press `sf to +have it enclosed in: \textsf{word} or > + {\sffamily + line + } +depending on character-wise or line-wise selection. + +-------------------------------------------------------------------------------- +Section Mappings *ls_3_4* *ls_a_bt* + *section-mappings* + +These maps insert LaTeX sections such as: > + \section{<++>}<++> +etc. Just as in the case of environments and fonts, can be enclosed with a +visual selection. The enclosing is not sensitive to character or line-wise +selection. + +Mnemonic: (make your own!) > + SPA for part + SCH for chapter + SSE for section + SSS for subsection + SS2 for subsubsection + SPG for paragraph + SSP for subparagraph + + +Example: SSE in insert mode inserts > + \section{<++>}<++> +If you select a word or line and press ,se, then you get > + \section{section name} +The menu item in Tex-Environments.Sections have a sub-menu called 'Advanced'. +Choosing an item from this sub-menu asks a couple of questions (whether you want +to include the section in the table of contents, whether there is a shorter name +for the table of contents) and then creates a more intelligent template. + +-------------------------------------------------------------------------------- +Greek Letter Mappings *ls_3_5* *ls_a_bu* + *greek-letter-mappings* + +Lower case + +`a through `z expand to \alpha through \zeta.Upper case: + + > + `D = \Delta + `F = \Phi + `G = \Gamma + `Q = \Theta + `L = \Lambda + `X = \Xi + `Y = \Psi + `S = \Sigma + `U = \Upsilon + `W = \Omega +NOTE: LaTeX does not support upper case for all greek alphabets. + + +Just like other Latex-Suite mappings, these mappings are not created using the +standard imap command. Thus you can type slowly, correct using <BS> etc. + +-------------------------------------------------------------------------------- +Auc-Tex Key Bindings *ls_3_6* *ls_a_bv* + *auc-tex-mappings* + +These are simple 2 key expansions for some very commonly used LaTeX elements: + + > + `^ Expands To \Hat{<++>}<++> + `_ expands to \bar{<++>}<++> + `6 expands to \partial + `8 expands to \infty + `/ expands to \frac{<++>}{<++>}<++> + `% expands to \frac{<++>}{<++>}<++> + `@ expands to \circ + `0 expands to ^\circ + `= expands to \equiv + `\ expands to \setminus + `. expands to \cdot + `* expands to \times + `& expands to \wedge + `- expands to \bigcap + `+ expands to \bigcup + `( expands to \subset + `) expands to \supset + `< expands to \le + `> expands to \ge + `, expands to \nonumber + `~ expands to \tilde{<++>}<++> + `; expands to \dot{<++>}<++> + `: expands to \ddot{<++>}<++> + `2 expands to \sqrt{<++>}<++> + `| expands to \Big| + `I expands to \int_{<++>}^{<++>}<++> +(again, notice the convenient place-holders) + +In addition the visual mode macros are provided: + + > + `( encloses selection in \left( and \right) + `[ encloses selection in \left[ and \right] + `{ encloses selection in \left\{ and \right\} + `$ encloses selection in $$ or \[ \] depending on characterwise or + linewise selection + + +-------------------------------------------------------------------------------- +Diacritics *ls_3_7* *ls_a_bw* + *diacritic-mappings* + +These mappings speed up typing European languages which contain diacritic +characters such as a-umlaut etc. > + +<l> expands to \v{<l>} + =<l> expands to \'{<l>} +where <l> is an alphabet. + + > + +} expands to \"{a} + +: expands to \^{o} +Latex-Suite also ships with smart backspacing [|ls_a_dZ|] functionality which +provides another convenience while editing languages with diacritics. + +NOTE: Diacritics are disabled by default in Latex-Suite because they can + sometimes be a little too intrusive. Moreover, most European users can + nowadays use font encodings which display diacritic characters directly + instead of having to rely on Latex-Suite's method of displaying + diacritics. + + Set the g:Tex_Diacritics [|ls_a_df|] variable to enable diacritics. + + + +-------------------------------------------------------------------------------- +BibTeX Shortcuts *ls_3_8* *ls_a_bx* + *bibtex-bindings* + +Latex-Suite provides an easy way of entering bibliographic entries. Four +insert-mode mappings: BBB, BBL, BBH and BBX are provided, all of which +essentially act in the same manner. When you type any of these in insert-mode, +you will get a prompt asking you to choose a entry type for the bibliographic +entry. + +When you choose an entry type, a bibliographic entry template will be inserted. +For example, if you choose the option 'book' via the map BBB, then the following +template will be inserted: > + @BOOK{<+key+>, + author = {<++>}, + editor = {<++>}, + title = {<++>}, + publisher = {<++>}, + year = {<++>}, + otherinfo = {<++>} + }<++> + + +<+key+> will be highlighted in select-mode and you can type in the bib-key. +After that you can use <Ctrl-J> to navigate to successive locations in the +template and enter new values. + +BBB inserts a template with only the fields mandatorily required for a given +entry type. BBL inserts a template with commonly used extra options. BBH inserts +a template with more options which are not as commonly used. BBX inserts a +template with all the fields which the entry type supports. + +NOTE: Mnemonic + -------- + B for Bibliographic entry, L for Large entry, H for Huge entry, and X + stands for all eXtras. + + + + +Customizing Bib-TeX fields *ls_3_8_1* *ls_a_by* + *adding-bib-options* + +If you wish the BBB command to insert a few additional fields in addition to the +fields it creates, then you will need to define global variables of the form > + g:Bib_{type}_options +in you $VIM/ftplugin/bib.vim file, where {type} is a string like 'article', +'book' etc. This variable should contain one of the letters defined in the +following table + +Character Field Type~ +w address +a author +b booktitle +c chapter +d edition +e editor +h howpublished +i institution +k isbn +j journal +m month +z note +n number +o organization +p pages +q publisher +r school +s series +t title +u type +v volume +y year + +For example, by default, choosing 'article' via BBB inserts the following +template by default > + @ARTICLE{<+key+>, + author = {<++>}, + title = {<++>}, + journal = {<++>}, + year = {<++>}, + otherinfo = {<++>} + }<++> +However, if g:Bib_article_options is defined as 'mnp', then 'article' will +insert the following template > + @ARTICLE{<+key+>, + author = {<++>}, + title = {<++>}, + journal = {<++>}, + year = {<++>}, + month = {<++>}, + number = {<++>}, + pages = {<++>}, + otherinfo = {<++>} + }<++> + + +If you have some other fields you wish to associate with an article which are +not listed above, then you will have to use the Bib_{type}_extrafields option. +This is a newline separated string of complete field names which will be +included in the template. For example, if you define > + let g:Bib_article_extrafields = "crossref\nabstract" +then the article template will include the lines > + crossref = {<++>}, + abstract = {<++>}, + + +NOTE: You will need to define Bib_* settings in your + $VIMRUNTIME/ftplugin/bib.vim file. + + + +-------------------------------------------------------------------------------- +Smart Key Mappings *ls_3_9* *ls_a_bz* + *smart-keys* + +Latex-Suite ships with the following smart keys: + +Smart Backspace +--------------- + *smart-backspace* *ls_a_dZ* +Pressing <BS> in insert mode checks to see whether we are just after something +like \'{a} and if so, deletes all of it. i.e, diacritics are treated as single +characters for backspacing. + +Smart Quotes +------------ +Pressing " (English double quote) will insert `` or '' by making an intelligent +guess about whether we intended to open or close a quote. + +Smart Space +----------- +Latex-Suite maps the <space> key in such a way that $ characters are not broken +across lines. It does this by first setting tw=0 so that Vim will not +automatically break lines and then maps the <space> key to insert newlines +keeping $$'s on the same line. + +Smart Dots +---------- +Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math +mode. + +-------------------------------------------------------------------------------- +Alt Key Macros *ls_3_10* *ls_a_bA* + *altkey-mappings* + +Latex-Suite utilizes a set of macros originally created by Carl Mueller in +auctex.vim to make inserting all the \left ... \right stuff very easy and to +also make some use of the heavily under-utilized <Alt> key. + +NOTE: By default, typing Alt-<key> in Vim takes focus to the menu bar if a menu + with the hotkey <key> exists. If in your case, there are conflicts due to + this behavior, you will need to set > + set winaltkeys=no +< in your $VIM/ftplugin/tex.vim in order to use these maps. + + +NOTE: Customizing the maps + -------------------- + If for some reason, you wish to not map the <Alt> keys, (some European + users need to use the <Alt> key to enter diacritics), you can change these + maps to other keys as described in the section Customizing Alt-key maps + [|ls_a_cx|]. + + + + +<Alt-L> *ls_3_10_1* *ls_a_bB* *Alt-L* + +This is a polymorphic insert-mode mapping which expands to one of the following +depending on the character just before the cursor location. + +Character before cursor Expansion~ +( \left( <++> \right) +[ \left[ <++> \right] +| \left| <++> \right| +{ \left\{ <++> \right\} +< \langle <++> \rangle +q \lefteqn{<++>}<++> + +If the character before the cursor is none of the above, then it will simply +insert a \label{<++>}<++>. + + +<Alt-B> *ls_3_10_2* *ls_a_bC* *Alt-B* + +This insert-mode mapping encloses the previous character in \mathbf{}. + + +<Alt-C> *ls_3_10_3* *ls_a_bD* *Alt-C* + +In insert mode, this key is polymorphic as follows: + + +1. If the previous character is a letter or number, then capitalize it and + enclose it in \mathcal{}. + +2. otherwise insert \cite{}. +In visual mode, it will simply enclose the selection in \mathcal{} + + +<Alt-I> *ls_3_10_4* *ls_a_bE* *Alt-I* + +This mapping inserts an \item command at the current cursor location depending +on which environment the cursor is enclosed in. The style of the \item command +is dependent on the enclosing environment. By default, <Alt-I> has styles +defined forthe following environments: + +Environment Style~ +itemize \item +enumerate \item +theindex \item +thebibliography \item[<+biblabel+>]{<+bibkey+>} <++> +description \item[<+label+>] <++> + +<Alt-I> is intelligent enough to account for nested environments. For example, > + \begin{itemize} + \item first item + \item second item + \begin{description} + \item[label1] first desc + \item[label2] second + % <Alt-I> will insert "\item[<+label+>] <++>" if + % used here + \end{description} + \item third item + % <Alt-I> will insert "\item " when if used here. + \end{itemize} + % <Alt-I> will insert nothing ("") if used here +< + +The style used by <Alt-I> can be customized using the +g:Tex_ItemStyle_environment [|ls_a_dl|] variable. + +-------------------------------------------------------------------------------- +Custom Macros *ls_3_11* *ls_a_bF* + *custom-macros-menu* + +This functionality available via the TeX-Suite.Macros menu, provides a way of +inserting customized macros into the current file via the menu. + +When Latex-Suite starts up, it scans the $VIM/ftplugin/latex-suite/macros/ +directory and creates a menu from the files found there. Each file is considered +as a single macro. You can place your own macros in this directory, using +placeholders [|ls_a_eD|] if wanted. + +When you choose a macro from the menu, the corresponding file is read into the +current buffer after the current cursor position. In non-gui mode, you can use +the |TMacro| command instead of choosing from the menu. This command takes the +macro file name as an argument. When called without arguments (preferred usage), +then a list of available macro files is displayed and the user is prompted to +choose one of them). + +There are some other tools provided in this menu, namely: + + +{New} Creates a new (unnamed) buffer in the latex-suite/macros/ directory. + Use the command :TexMacroNew in non-gui mode. +{Edit} Opens up the corresponding macro file for editing. Use |:TexMacroEdit| + in non-gui mode. When you try to edit {macro} not from local directory + Latex-Suite will copy it to your local directory with suffix "-local". + If local copy already exists Latex-Suite prompt for overwriting it. +{Delete} Deletes the corresponding macro. Use the prefixed numbers for fast + navigation of menus. Use |:TexMacroDelete| in non-gui mode. When you + choose to delete {macro} which is not in your local directory + Latex-Suite will refuse to delete it. +{Redraw} Rescans the macros/ directories and refreshes the macros list. + +-------------------------------------------------------------------------------- +Making your own Macros via IMAP() *ls_3_12* *ls_a_bG* + *ls-new-macros* + +If you find the need to create your own macros, then you can use the IMAP() +function provided with Latex-Suite. See [|ls_a_bH|] for a short explanation of +why you might prefer IMAP() over Vim's standard :imap command. An example best +explains the usage: > + :call IMAP('NOM', '\nomenclature{<++>}<++>', 'tex') +This will create a Latex-Suite-style mapping, where if you type NOM in insert +mode, you will get \nomenclature{<++>}<++> with the cursor left in place of the +first <++> characters. See [|ls_a_bI|] for a detailed explanation of the IMAP() +command. + +For maps which are triggered for a given filetype, the IMAP() command above +should be put in the filetype plugin script for that file. For example, for +tex-specific mappings, the IMAP() calls should go in $VIM/ftplugin/tex.vim. For +globally visible maps, you will need to use the following in either your +~/.vimrc or a file in your $VIM/plugin directory. > + augroup MyIMAPs + au! + au VimEnter * call IMAP('Foo', 'foo', '') + augroup END + + + + +Why use IMAP() *ls_3_12_1* *ls_a_bH* + *why-IMAP* + +Using IMAP instead of Vim's built-in :imap command has a couple of advantages: +1. The 'ttimeout' option will generally limit how easily you can type the left + hand side for a normal :imap. if you type the left hand side too slowly, then + the mapping will not be activated. + +2. If you mistype one of the letters of the lhs, then the mapping is deactivated + as soon as you backspace to correct the mistake. + +3. The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters initiate + mappings. + + +IMAP() syntax *ls_3_12_2* *ls_a_bI* + *ls-imaps-syntax* + +Formally, the syntax which is used for the IMAP function is: > + call IMAP (lhs, rhs, ft [, phs, phe]) + + +Argument Explanation~ +lhs This is the "left-hand-side" of the mapping. When you use IMAP, only + the last character of this word is actually mapped, although the + effect is that the whole word is mapped. + + If you have two mappings which end in a common lhs, then the mapping + with the longer lhs is used. For example, if you do > + call IMAP('BarFoo', 'something', 'tex') + call IMAP('Foo', 'something else', 'tex') +< Then typing BarFoo inserts "something", whereas Foo by itself inserts + "something else". + + Also, the nature of IMAP() makes creating certain combination of + mappings impossible. For example if you have > + call IMAP('foo', 'something', 'tex') + call IMAP('foobar', 'something else', 'tex') +< Then you will never be able to trigger "foobar" because typing "foo" + will immediately insert "something". This is the "cost" which you + incur over the normal :imap command for the convenience of no + 'timeout' problems, the ability to correct lhs etc. + + +rhs The "right-hand-side" of the mapping. This is the expansion you will + get when you type lhs. + + This string can also contain special characters such as <enter> etc. + To do this, you will need to specify the second argument in + double-quotes as follows: > + :call IMAP('EFE', "\\begin{figure}\<CR><++>\\end{figure}<++>", 'tex') +< With this, typing EFE is equivalent to typing in the right-hand side + with all the special characters in insert-mode. This has the advantage + that if you have filetype indentation set up, then the right hand side + will also be indented just as if you had typed it in normally. + + *IMAP_PutTextWithMovement* *ls_a_ea* + You can also set up a Latex-Suite style mapping which calls a custom + function as follows: > + :call IMAP('FOO', "\<C-r>=MyFoonction()\<CR>", 'tex') +< where MyFoonction is a custom function you have written. If + MyFoonction also has to return a string containing <++> characters, + then you will need to use the function IMAP_PutTextWithMovement(). An + example best explains the usage: + + > + call IMAP('FOO', "\<C-r>=AskVimFunc()\<CR>", 'vim') + " Askvimfunc: Asks For Function Name And Sets Up Template + " Description: + function! AskVimFunc() + let name = input('Name of the function : ') + if name == '' + let name = "<+Function Name+>" + end + let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y') + if islocal == 'y' + let sidstr = '<SID>' + else + let sidstr = '' + endif + return IMAP_PutTextWithMovement( + \ "\" ".name.": <+short description+> \<cr>" . + \ "Description: <+long description+>\<cr>" . + \ "\<C-u>function! ".name."(<+arguments+>)<++>\<cr>" . + \ "<+function body+>\<cr>" . + \ "endfunction \" " + \ ) + endfunction +< + + +ft The file type for which this mapping is active. When this string is + left empty, the mapping applies for all file-types. A filetype + specific mapping will always take precedence. + + +phs, phe If you prefer to write the rhs with characters other than <+ and +> to + denote place-holders, you can use the last 2 arguments to specify + which characters in the rhs specify place-holders. By default, these + are <+ and +> respectively. + + Note that the phs and phe arguments do not control what characters + will be displayed for the placeholders when the mapping is actually + triggered. What characters are used to display place-holders when you + trigger an IMAP are controlled by the Imap_PlaceHolderStart + [|ls_a_cV|] and Imap_PlaceHolderEnd [|ls_a_er|] settings. + + + +================================================================================ +Package Handling *ls_4* *ls_a_bJ* + *latex-packages* + +|ls_4_1| Inserting package commands +|ls_4_2| Actions taken for supported packages +|ls_4_3| Automatic Package detection +|ls_4_4| Writing supporting for a package + + +Latex-Suite has a lot of functionality written to ease working with packages. +Packages here refers to files which you include into the LaTeX document using +the \usepackage command. + + +-------------------------------------------------------------------------------- +Inserting package commands *ls_4_1* *ls_a_bK* + *inserting-packages* + +When you first invoke Latex-Suite, it scans the +$VIM/ftplugin/latex-suite/packages directory for package script files and +creates a menu from all the files found there. This menu is created under +TeX-Suite > Packages > Supported. This menu contains a list of packages +"supported" by Latex-Suite. When you choose one of the packages from this menu +(for example the amsmath package), then a line of the form > + \usepackage[<++>]{amsmath}<++> +will be inserted into the current file. + +The \usepackage line can also be inserted in an easy manner in the current file +by pressing <F5> while in the preamble of the current document. This will set up +a prompt from the supported packages and ask you to choose from one of them. If +you do not find the package you want to insert in the list, you can type in a +package-name and it will use that. Pressing <F5> in the preamble on a line +containing a single word will construct a \usepackage line from that word. + +You can also use the TPackage [|ls_a_cD|] to insert the \usepackage line. + +Once you have inserted a \usepackage line, for supported packages, you can use +the Options and Commands menus described in the next section [|ls_a_bL|]. + +-------------------------------------------------------------------------------- +Actions taken for supported packages *ls_4_2* *ls_a_bL* + *package-actions* + +Latex-Suite takes the following actions for packages detected when a file is +loaded, or a new \usepackage line is inserted using one of the methods described +in the previous section [|ls_a_bK|]. + +If you are using the GUI and you have g:Tex_Menus [|ls_a_dI|] set to 1, +Latex-Suite will create the following sub-menus +TeX-Suite > Packages > <package> Options + +TeX-Suite > Packages > <package> Commands + +where <package> is the package you just inserted (or was detected). You can use +these menus to insert commands, environments and options which Latex-Suite +recognizes as belonging to this package. + +NOTE: While inserting an option, you need to position yourself in the + appropriate place in the document, most commonly inside the square braces + in the \usepackage[]{packname} command. Latex-Suite will not navigate to + that location. + + +In addition to creating these sub-menus, Latex-Suite will also scan the +$VIM/ftplugin/latex-suite/dictionaries directory and if a dictionary file +corresponding to the package file is found, then it will add the file to the +'dict' setting in Vim so you can use the <C-X><C-K> command to complete words +from that file. + +For example, the SIUnits package has a custom dictionary. + + *latex-package-scanning* *ls_a_eb* +If a package detected at startup is found by Latex-Suite in the current +directory or in a location specified by the g:Tex_TEXINPUTS [|ls_a_dT|] +variable, Latex-Suite will scan the package for \newenvironment and newcommand +lines and also append any commands and environments found to the list of +commands and environments which you are prompted with when you press <F5> +[|ls_a_bh|] or <F7> [|ls_a_dW|] in insert mode. +In addition, the TeX-Suite > Packages menu also contains the following submenus + +Update +------ +This command is to be invoked with the cursor placed on the package name. If the +corresponding package is found, then a sub-menu with the supported commands and +options is created. + +Update All +---------- +This function reads the preamble of the document for \usepackage lines and if +Latex-Suite supports the detected packages, then sub-menus containing the +package options and commands are created. + + +-------------------------------------------------------------------------------- +Automatic Package detection *ls_4_3* *ls_a_bM* + *automatic-package-detection* + +Whenever Latex-Suite begins editing a new LaTeX file, it scans it for +\usepackage{name} lines, and if a supported package is found, then it will +create sub-menus and add to the 'dict' setting as described above. + +If a master-file [|ls_a_ct|] has been specified, then it will scan that file +instead of the current file. See the section Custom Packages [|ls_a_bN|] to see +which files Latex-Suite will scan in more detail. + +For all the packages detected in this manner, Latex-Suite will take certain +actions as described in the section package support. [|ls_a_bL|]. + + + +Custom Packages *ls_4_3_1* *ls_a_bN* + *custom-packages* + +Often times, the preamble can become too long, and some people prefer to put +most of their personalization in a custom package and include that using a +\usepackage line. Latex-Suite tries to search such customs package for other +\usepackage lines, so that supported packages included in this indirect manner +can also be used to create sub-menus, extend the 'dict' setting etc. The most +obvious place to place such custom packages is in the same directory as the +edited file. In addition, LaTeX also supports placing custom packages in places +pointed to by the $TEXINPUTS environment variable. + +If you use the $TEXINPUTS variable in LaTeX, and you wish Latex-Suite to search +these custom packages for \usepackage lines, then you need to initialize the +g:Tex_TEXINPUTS [|ls_a_dT|] variable. + +The g:Tex_TEXINPUTS variable needs to be set in the same format which Vim uses +for the 'path' setting. This format is explained in detail if you do > + :help file-searching +from within Vim. + +Therefore the value of g:Tex_TEXINPUTS will most probably be different from +$TEXINPUTS which your native LaTeX distribution uses. + +Example: > + let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**' +The ** indicates that all directories below the directory ~/texmf/mypackages and +./ are to be scanned for custom packages. + +NOTE: The present directory '.' is always searched. You need not include that in + g:Tex_TEXINPUTS. + + + +-------------------------------------------------------------------------------- +Writing supporting for a package *ls_4_4* *ls_a_bO* + *supporting-packages* + +Supporting a package is easy and consists of writing a vim script with the same +name as the package and placing it in the $VIM/ftplugin/latex-suite/packages +directory. A package script should define two variables as described in the next +two sections. In addition to these two variables, you can also define any +functions, environment definitions etc. in this file. + + + +g:Tex_package_option_<package> *ls_4_4_1* *ls_a_bP* + +This setting is a string containing a comma separated list of options supported +by this package. + +Example: > + g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4' +The = suffix means that the option takes a value. Use sbr:group name to separate +options into sub-menus. All successive options will be clubbed into the group1 +sub-menu till the next sbr: option is encountered. + + +g:Tex_package_<package> *ls_4_4_2* *ls_a_bQ* + + > + + g:TeX_package_<package> = "pre:Command,pre:Command1" + More detailed example is in latex-suite/packages/exmpl file (slightly + outdated). + Here is short summary of prefixes which can be used in package files: + (x - place with cursor, <++> - |placeholder|) + + {env:command} Environment: creates simple environment template + \begin{command} + x + \end{command}<++> + {eno:command} Environment with option: + \begin[x]{command} + <++> + \end{command}<++> + {ens:command[<<option>>]...} Environment special: + \begin[<<option>>]...{command} + <++> + \end{command}<++> + {bra:command} Brackets: + \command{x}<++> + {brd:command} Brackets double: + \command{x}{<++>}<++> + {brs:command[<<option>>]...} Brackets special (as environment special: + \command[<+x+>]{<++>}{<++>}<++> + {nor:command} Normal: + \command<Space + {noo:command} Normal with option: + \command[x]<++> + {nob:command} Normal with option and brackets: + \command[x]{<++>}<++> + {pla:command} Plain: + command<Space + {spe:command} Special: + command <-literal insertion of command + {sep:command} creates separator. Good for aesthetics and usability :) + {sbr:command} Breaks menu into submenus. <command> will be title of submenu. + Can be used also in package variable. + + Command can be also given without prefix:. The result is + \command + + + +================================================================================ +Latex Completion *ls_5* *ls_a_bR* + *latex-completion* + +|ls_5_1| Latex-Suite completion example +|ls_5_2| Latex-Suite \ref completion +|ls_5_3| Latex-Suite \cite completion +|ls_5_4| Latex-Suite filename completion +|ls_5_5| Custom command completion + + +Latex-Suite provides an easy way to insert references to labels and +bibliographic entries and also provide filename arguments to commands such as +\includegraphics. Although the completion capabilities are very diverse, +Latex-Suite only uses a single key (<F9> by default) to do all of it. Pressing +the <F9> key does different things based on where you are located. Latex-Suite +tries to guess what you might be trying to complete at the location where you +pressed <F9>. For example, pressing <F9> when you are within a \ref command will +try to list the \label's in the present directory. Pressing it when you are in a +\cite command will list bibliography keys. Latex-Suite also recognizes commands +which need a file name argument and will put up an explorer window for you to +choose a filename. + + *ls-set-grepprg* *ls_a_eG* +NOTE: Before you start with Latex-Suite's completion function... + ---------------------------------------------------------- + All of Latex-Suite's completion capabilities depend on a external program + being available on your system which can search through a number of files + for a reg-exp pattern. On *nix systems, the pre-installed grep utility is + more than adequate. Most windows systems come with a utility findstr, but + that has proven to be very inadequate (for one, it does not have an option + to force the file name to be displayed when searching through a single + file). Your best bet is to install cygwin |ls_u_3|, but if you think + that's overkill, you can search for |ls_u_4| a windows implementation of + GNU grep. (Latex-Suite testing on windows has been done with cygwin's port + of GNU grep). + + Once you have a grep program installed, you need to set the 'grepprg' + option for vim. Make sure you use a setting which forces the program to + display file names even when you are searching through a single file. For + GNU grep, the syntax is > + set grepprg=grep\ -nH\ $* +< + + + +-------------------------------------------------------------------------------- +Latex-Suite completion example *ls_5_1* *ls_a_bS* + *ls-completion-usage* + +Consider the situation where you are editing a file with two equations labelled +eqn:euler and eqn:einstein. Now you want to insert a reference to one of these +equations. To do this, you type the \ref{eqn:} command and with the cursor +placed after eqn:, press <F9>. This will bring up two new windows beneath the +main window you were working in as shown in the figure below. > + + 8 These are a couple of equations: + 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &=& 0--------------- + 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2--------------------- + 17 + 18 These are a couple of figures: + 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type------------------- + 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type----- + 33 + 34 This is a reference to \ref{eqn:}<++> + 35 + 36 + 37 \end{document} + 38 + ~ + ~ + ~ + newfile.tex 34,32 Bot + newfile.tex|11| \label{eqn:euler} + newfile.tex|15| \label{eqn:einstein} + ~ + [Error List] 1,1 All + 7 + 8 These are a couple of equations: + 9 \begin{eqnarray} + 10 e^{j\pi} + 1 &=& 0 + 11 \label{eqn:euler} + 12 \end{eqnarray} + 13 \begin{equation} + 14 E = m c^2 + 15 \label{eqn:einstein} + 16 \end{equation} + newfile.tex [Preview] 11,3 21% + + + +The first window (shown as [ErrorList] above) is a |cwindow| containing a list +of possible matches for the reference. The cursor will be located in the first +line of this window. The bottom window is a preview-window showing the context +of the \label. Moving around in the [ErrorList] window automatically scrolls the +preview window so as to always keep showing the context of the \label being +viewed in the [ErrorList] window. You can also press J and K in the [ErrorList] +window to scroll the preview window up and down. + +To insert one of the labels, simply position the cursor in the correct line in +the [ErrorList] window and press <enter>. This will immediately close the two +newly opened windows, get back to the correct location in the original file +being edited and insert the label into the \ref command. + +If you notice carefully in the example above, the [ErrorList] window only showed +the matches for the equations and did not list any of the figure labels. This is +because we pressed <F9> after \ref{eqn: instead of simply after \ref{. This +caused Latex-Suite to search only for those labels which started with the string +eqn:. If you had pressed <F9> after a \ref{, you would have been shown matches +from _all_ labels, not just those starting with eqn:. + +Thus prefixing all your labels with eqn:, fig:, tab: etc. depending on what you +are labelling will lead to an easier time completing references. + +-------------------------------------------------------------------------------- +Latex-Suite \ref completion *ls_5_2* *ls_a_bT* + *ls-completion-ref* + +Pressing <F9> when you are within a partially completed \ref command will split +open a window (named __OUTLINE__) which contains a nicely formatted list of all +the \labels found in the present project. The \labels are heirarchically +arranged according to which \section, \subsection etc of the overall document +structure they are present in. For example, when you first press <F9> after +typing \ref{, you should see something like: > + + +-- 54 lines: 2. Kinematics-------------------------------- + +-- 98 lines: 3. Aerodynamics of the MFI thorax------------ + +-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ + +-- 28 lines: 5. Design and Fabrication Issues------------- + +Each chapter is |fold|ed away so that you can quickly jump to the correct +section/subsection in which the relevant equation is defined. This makes +inserting references significantly faster for large projects with hundreds of +equations. You can then open some of the folds to see for example: > + + +-- 54 lines: 2. Kinematics-------------------------------- + 3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &=& T_z(\theta_2) + +The <Tab> key is mapped in this window to toggle folds so that you can quickly +open/close folds in order to navigate the heirarchy faster. Once you are +positioned on a label, press <Enter>. This closes the __OUTLINE__ window, +returns to the window in which you pressed <F9> and inserts the reference at the +current cursor position. + +NOTE: Filtering labels by prefix + -------------------------- + You can press <F9> after typing part of the \label. In this case, + Latex-Suite only presents \labels which begin with the already filled + characters. You can use this to choose between equations, figures, tables + etc. if you consistently label equations to begin with eqn:, figures to + begin with fig: etc. For example, with this scheme, pressing <F9> after + typing \ref{eqn: will only list equations. + + +NOTE: Latex-Suite works the same way if you press <F9> after any command which + contains the letters ref. Thus you can complete \eqref in exactly the same + manner. + + +NOTE: Requirements + ------------ + This method of preseting the \labels depends on Vim being compiled with + python support. To check if you have this, see the output of the :ver + command. If you see something like +python, you are all set. Failing this, + you will need to have python somewhere in your $PATH. + + + +-------------------------------------------------------------------------------- +Latex-Suite \cite completion *ls_5_3* *ls_a_bU* + *latex-completion-cite* + +Latex-Suite provides an easy way to insert references to bibliographic entries. +Pressing <F9> when the cursor is placed inside a partially completed \cite +command will split open a new window (named __OUTLINE__) which contains a +formatted and syntax highlighted list of all bibtex entries found. For example, +pressing <F9> after typing \ref{ should present you with a window which looks +something like this: > + + Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + + Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + + Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + + + +You can easily jump from one entry to another using the 'n' and 'p' keys (to go +to the next / previous entry respectively). + +You can also filter out a subset of the bibtex entries by pressing 'f' while in +this window. Doing this presents the following prompt: > + + Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) + Enter filter criterion [field<space>value]: + +At the prompt, type > + a ellington +Notice that the letter a is an acronym for author according to the prompt above. +Therefore this filter only shows those bibtex entries whose author field +contains the text ellington. You can keep narrowing your selection by repeatedly +filtering the results. If you would like to remove all the filters and see all +entries again, press 'a', which removes all the filters. + +You can also sort the bibtex entries based on a field. To do this, press 's'. +This will present you with a prompt like in the case of the filter and you are +asked to choose a field. In this case, you would type in a single character. +This sorts the entries according to that field. + +NOTE: <F9> will also work in a similar way after any command which contains the + word cite in it. For example, pressing <F9> will also work with \citenum + etc. + + +The following logic is applied to find out which bibliographic entries are +included in the completion. + + +1. Firstly, if the present file has a master-file [|ls_a_ct|] defined for it, + then Latex-Suite will perform the following steps on that file instead of on + the current file. + +2. First, the file is scanned for a \bibliography command. To explain better, + assume that a command > + \bibliography{file1,file2} +< is found in the present file. For each bibliography file, say file1, + Latex-Suite first tries to see if a .bib file, file1.bib can be found. If so, + it will scan it for bib-keys of the form @BOOK{ etc., and add these searches + to the completion list. If a .bib file cannot be found, then it will try to + see if file1.bbl can be found. If so, Latex-Suite will search it for bib-keys + of the form \bibitem and add these to the completion list. + + You can set the location where Latex-Suite will search for .bib and .bbl + files using the |Tex_BIBINPUTS| [|ls_a_dr|] variable. + +3. If a \bibliography command is not found, then Latex-Suite tries to scan the + present file for a \begin{thebibliography} environment. If found, Latex-Suite + searches the present file for bib-keys of the form \bibitem. + +4. Finally, it will try to see if this file includes other files via the \input + command. For each such file found, Latex-Suite will repeat the previous two + steps stopping at the first file which has either a \bibliography command or + a thebibliography environment. + + +Caching the \cite completion results *ls_5_3_1* *ls_a_bV* + *cite-search-caching* + + *TClearCiteHist* *ls_a_ec* +Often times, the editing cycle proceeds by first laying out a comprehensive +bibliography and then completing all the \cite commands in one session. In such +situations, it is inefficient to scan the whole list of bibliography files for +bib-keys each time. Latex-Suite provides a way to cache the results of the cite +completion search using the Tex_RememberCiteSearch [|ls_a_du|] variable. If set, +Latex-Suite will perform the search only the first time <F9> is used. Next time +on, it will reuse the search results. If you wish to redo the search results, +issue the command > + TClearCiteHist +This will redo the completion list next time you use <F9>. + +-------------------------------------------------------------------------------- +Latex-Suite filename completion *ls_5_4* *ls_a_bW* + *ls-filename-completion* + +When you press <F9> at a location where Latex-Suite guesses a filename needs to +be typed, then a new explorer window will open up with the list of files. You +can use this window to change directories etc. Pressing <enter> on a filename in +the explorer window will automatically close the explorer window, return to the +location where you pressed <F9> from and insert the filename into that position. + +Latex-Suite also tries to guess what kinds of files you might not want to insert +and hides those accordingly. For example, if you press <F9> when you are located +at \includegraphics{, then Latex-Suite knows that you will not want to insert +.tex files. Therefore, the explorer window will automatically hide these files. + +As of now, Latex-Suite recognizes the following commands for filename +completion. Along with the commands, this table also lists the files which +Latex-Suite will not show for completing each command. + +command hide pattern~ +\bibliography '^\.,\.[^b]..$' +\include \includeonly '^\.,\.[^t]..$' +\includegraphics \psfig '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$' +\input '' + +-------------------------------------------------------------------------------- +Custom command completion *ls_5_5* *ls_a_bX* + *ls-completion-custom* + +Latex-Suite also recognizes certain commonly used LaTeX commands for the <F9> +key. At the moment, the \bibliographystyle, \addtocontents and the +\addcontentsline commands are recognized, although more will be added in the +future. When you press the <F9> after such a command, Latex-Suite will prompt +you with a list of arguments which make sense for the command. + +This functionality is available for commands for which a global variable of the +form g:Tex_completion_{<command>} is defined where <command> is the command +name. This variable is a comma separated list of values which this command +takes. For example, the argument to the \bibliographystyle command is commonly +one of abbr,alpha,plain,unsrt. Therefore, Latex-Suite defines > + let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt' +You can define your own completion variables in a similar manner for commands +which you might use. + +================================================================================ +LaTeX Compiling *ls_6* *ls_a_bY* + *latex-compiling* + +|ls_6_1| Setting Compilation rules +|ls_6_2| Handling dependencies in compilation +|ls_6_3| Compiling multiple times +|ls_6_4| Customizing the compiler output +|ls_6_5| Compiling parts of a file + + +This functionality, available via the TeX-Suite menu, provides various tools to +compile and debug LaTeX files from within Vim. + +If you are using commonly used LaTeX tools, then you should be all set as soon +as you download and install Latex-Suite. In order to compile a LaTeX file, +simply press \ll while editing the file. This runs latex on the current file and +displays the errors in a |quickfix-window| below the file being edited. You can +then scroll through the errors and press <enter> to be taken to the location of +the corresponding error. Along with the errors being listed in the quickfix +window, the corresponding log file is also opened in |preview| mode beneath the +quickfix window. It is scrolled automatically to keep in sync with the error +being viewed in the quickfix window. You will be automatically taken to the +location of the first error/warning unless you set the g:Tex_GotoError +[|ls_a_dD|] variable to 0. + +Latex-Suite also supports compiling LaTeX into formats other than DVI. By +default, Latex-Suite supports PDF and PS formats. In order to choose a format +other than DVI, use the TTarget command or the TeX-Suite > Target Format menu +item. This will ask you to type in the name of the target format you want to +compile to. If a rule has been defined for the format (as described in the next +section [|ls_a_bZ|]), then Latex-Suite will switch to that format. + +Trying to choose a format for which no rule has been defined will result in +Latex-Suite displaying a warning message without taking any action. + +If you are using a multiple file project and need to compile a master file while +editing other files, then Latex-Suite provides a way to specify the file to be +compiled as described in latex-master-file [|ls_a_ct|]. + + +-------------------------------------------------------------------------------- +Setting Compilation rules *ls_6_1* *ls_a_bZ* + *compiler-rules* + +In order to compile LaTeX files into various formats, Latex-Suite needs to know +which external programs to call and in which way they need to be called. This +information is provided to Latex-Suite via a number of "rules". For each format +you want to compile to, you need to specify a rule. A rule is specified by +defining a variable of the form: > + g:Tex_CompileRule_<format> +where <format> is a string like "pdf", "dvi" etc. + +Example: By default, Latex-Suite uses the following rule for compiling LaTeX +documents into DVI. > + g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' + + +Default values are also provided for ps and pdf formats. You might want to +change these rules in texrc according to your local tex environment. + +NOTE: For win32 users user MikTeX, sometimes the latex compiler's output has a + bug where a single number is split across different lines. In this case, + put the included vim-latex file distributed with Latex-Suite. + + + +-------------------------------------------------------------------------------- +Handling dependencies in compilation *ls_6_2* *ls_a_ca* + *compiler-dependency* + +Latex-Suite also handles compiling dependencies automatically via certain rules +which specify the "dependency chain" for each target format. For example, if in +your case, you use > + .tex -> .dvi -> .ps -> .pdf +to generate pdf files from dvi files, then you will need to specify the +following setting in your Latex-Suite configuration (see customizing Latex-Suite +[|ls_a_cP|] for where these settings should go): > + + let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' + +This is a comma separated string of formats specifying the order in which the +formats to be compiled into should be chosen. With this setting, if you set the +target format to pdf, then the next time you compile via the \ll shortcut, +Latex-Suite will first generate a dvi file, then use that to generate the ps +file and finally create the pdf file from that. + +NOTE: If any of the intermediate formats is listed in the + g:Tex_MultipleCompileFormats setting as described in the section Compiling + multiple times [|ls_a_cb|], then Latex-Suite might make multiple calls to + the compiler to generate the output file of that format. + + +Along with the g:Tex_FormatDependency_{format} setting, you should ofcourse +specify the rule for compiling to each of the formats as described in the +previous section [|ls_a_bZ|]. For example, with the setting above, you could +use: > + + let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' + let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' + let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps' + + +NOTE: By default, Latex-Suite does not specify any compiler dependencies. Each + target format for which a rule has been derived will be compiled + independently. + + + +-------------------------------------------------------------------------------- +Compiling multiple times *ls_6_3* *ls_a_cb* + *compiling-multiple* + +Most LaTeX compilers need to be re-run several times in several commonly +occurring situations in order to get a final camera ready copy. For example, +when \label's change, when new \cite commands are added etc. If the target +format you are compiling to requires multiple compilations, then you will need +to include the format in the g:Tex_MultipleCompileFormats setting. This is a +comma separated string of formats which need multiple compilations to be +generated correctly. + +By default, this setting contains just the dvi format. If you use the pdflatex +compiler to generate pdf files, then you might want to also include pdf into the +above setting. + +For every format included in the g:Tex_MultipleCompileFormats setting described +above, Latex-Suite will use the following logic to generate the file. Note that +although the following description uses latex to refer to the compiler, it could +be some other compiler such as pdflatex for generating pdf output. + +1. If there was a .idx file, then remember its contents. + +2. Run latex. + +3. If the .idx file changed due to the latex compiler, then run makeindex to + redo the .ind file and then remember to rerun latex. + +4. If the .aux file generated by the latex compiler contains a \bibdata line, + then it means that we are using a .bib file. Therefore, run bibtex. + + NOTE: This means that we will always run bibtex whenever we use the + \bibliography command whether or not we actually need to. At this time, + Latex-Suite does not parse the .aux file before and after the latex + compiler to see if we are required to rerun bibtex. + +5. If the .bbl file changes because of this, then remember to rerun latex again. + +6. Also, we check to see if the LaTeX compiler gives certain standard warnings + which notify that we need to compile once again. In this case also, remember + to rerun LaTeX. + +7. If we found we had to rerun latex, then we repeat the steps above but not + running makeindex or bibtex again. + +The LaTeX file is compiled atmost 5 times using this logic. These steps will +ensure that on most platforms/environments, you will get a clean output with all +the cross-references, citations etc correctly labelled and ordered. + +-------------------------------------------------------------------------------- +Customizing the compiler output *ls_6_4* *ls_a_cc* + *compiler-output-customization* + +Most LaTeX compilers produce a very large amount of output during compilation, +most of which is not relevant to debugging type-setting errors. The compiler +plugin provided with Latex-Suite (which is an enhanced version of the standard +compiler plugin maintained by Artem Chuprina), provides a way to filter the +compiler output so that the actual errors/warnings can be presented much more +concisely. + +The compiler plugin is set up by default to function in a "non-verbose", +"ignore-common-warnings" mode, which means that irrelevant lines from the +compiler output will be ignored and some very common warnings are also ignored. +Latex-Suite does this via the global variable g:Tex_IgnoredWarnings [|ls_a_dA|]. +This is a list of patterns, which can be used to filter out (or ignore) some or +the warnings and errors reported by the compiler. See the link above for its +default value. + +Latex-Suite uses the g:Tex_IgnoreLevel [|ls_a_dB|] setting to set a default +ignore level. For example, for the default value of 4, Latex-Suite ignores +warnings and errors matching the first 4 patterns in g:Tex_IgnoredWarnings. + +In addition to setting a default value of the ignore level, Latex-Suite provides +the ability to set the level dynamically, using the TCLevel command. For +example, if you issue the command: > + TCLevel 3 +from within Vim, then the next time you compile the document, Latex-Suite will +ignore warnings and errors which match the first three patterns in +g:Tex_IgnoredWarnings. + +When TCLevel is called with the unquoted string strict as follows: > + TClevel strict +then Latex-Suite switches to a "verbose", "no-lines-ignored" mode which is +useful when you want to make final checks of your document and want to be +careful not to let things slip by. + +See the explanation of the settings g:Tex_IgnoredWarnings [|ls_a_dA|] and +g:Tex_IgnoreLevel [|ls_a_dB|] to find out how to customize the filtering done by +Latex-Suite + +-------------------------------------------------------------------------------- +Compiling parts of a file *ls_6_5* *ls_a_cd* + *part-compiling* + +Latex-Suite also provides a way to compile a fragment of a document. This can be +very useful while debugging a complex equation or one chapter in a book, etc. + +To do this, visually select a portion of the text and press \ll while in visual +mode. The visually selected portion will be saved to a temporary file with the +preamble from the current document prepended. Latex-Suite will then switch focus +to this temporary file and compile it. Continue to debug this file as required +and then replace the portion of the original file with this one. + +Pressing \lv while viewing the temporary file will view the output file +generated from the temporary file, not the original file + +Two commands |TPartComp| and |TPartView| are provided to be able to get this +functionality via the command line. + +From release 1.6 onwards of Latex-Suite, the temporary file created for part +compilation will reside in the same directory as the file from which the +fragment is being created. This ensures that any relative path-names defined in +the fragment will still work. Latex-Suite will attempt to clean the temporary +file(s) created when Vim exits. + +================================================================================ +Latex Viewing and Searching *ls_7* *ls_a_ce* + *latex-viewing* + +|ls_7_1| Setting Viewing rules +|ls_7_2| Forward Searching DVI documents +|ls_7_3| Inverse Searching + + + +-------------------------------------------------------------------------------- +Setting Viewing rules *ls_7_1* *ls_a_cf* + *latex-viewing-rules* + +In order to view the output files created by compiling the source files, you +need to specify which external program Latex-Suite should call. You can specify +the external program using one of two settings Tex_ViewRule_format [|ls_a_dF|] +or Tex_ViewRuleComplete_format [|ls_a_dG|]. By default, Latex-Suite has default +settings for viewing various common output formats via the Tex_ViewRule_format +settings, so that if you are using commonly used programs, you should be all set +to view compiled files from within Vim by simply pressing \lv. + +NOTE: The viewing function also takes the *.latexmain [|ls_a_ct|] file into + account to decide which file to show. + + +If pressing \lv does not work, then it most probably has to do with incorrect +settings of the g:Tex_ViewRule_<format> [|ls_a_dF|] where <format> is the format +you are attempting to view. See the link above for how to set this according to +your system. + +In addition to viewing the files, Latex-Suite also supports forward and inverse +searching for certain common tools for viewing DVI documents. At the moment, +there is built-in support for YAP on windows (which ships with MikTeX), and the +popular xdvi on *nix platforms. See the next few sections for details on forward +and inverse searching. + +-------------------------------------------------------------------------------- +Forward Searching DVI documents *ls_7_2* *ls_a_cg* + *forward-searching* + +Forward searching refers to making a DVI viewer display a given document at a +given location from within Vim. At present, this functionality is supported for +YAP on windows and xdvi on *nix machines. Pressing \ls from within Vim should +make the DVI viewer display the portion of the document where your cursor is +placed. + + *enabling-searching* *ls_a_ed* +NOTE: Enabling Forward and Inverse Searching + -------------------------------------- + Most DVI viewers need "source-special" information in order to do forward + (and inverse) searching. This information is embedded in the dvi file if + the LaTeX source is compiled with the --src-specials option. By default, + Latex-Suite does not supply this argument to the compiler. See the section + on to find out how this option can be set. + + + +-------------------------------------------------------------------------------- +Inverse Searching *ls_7_3* *ls_a_ch* + *inverse-searching* + +Inverse searching refers to the DVI viewer telling Vim to display the LaTeX +source file at a given location when you double-click in the DVI viewer window. + +You will need to enable searching [|ls_a_ed|] in order to use this +functionality. + +You will also need to specify certain settings to the DVI viewer conveying the +syntax which it needs to use to tell Vim how to display the source file. In YAP, +you can set this option in View > Options > Inverse Search. The Command Line +field needs to be set as follows: > + "C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f" +The command :RemoteOpen is supplied when you install Latex-Suite. + +On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way that +it already knows how to communicate with Vim. If this does not seem to be +working, you can use the RemoteOpen command described above. + +================================================================================ +Latex Folding *ls_8* *ls_a_ci* + *latex-folding* + +|ls_8_1| Default Folding Scheme in Latex-Suite +|ls_8_2| Customizing what to fold +|ls_8_3| Editing the folding.vim file directly + + +Latex-Suite ships with the plugin SyntaxFolds.vim which is a plugin for creating +"fake" syntax folds on the fly. The fold method is actually manual but the +folding is based on LaTeX syntax. This offers a speed increase over regular +syntax folding. Ofcourse it has the disadvantage that the folds are not dynamic, +i.e newly created syntax items are not automatically folded up. (This is a +compromise between speed and convenience). + +When you open up a LaTeX file, all the portions will be automatically folded up. +However, no new folds will be created until you press <F6> or \rf. (rf stands +for "refresh folds"). + +The fold-text is set to the first line of the folded text unless the fold is a +table, figure etc. (an environment). In this case, if a \caption and/or a label +is found in the folded region, then those are used to make a more meaningful +fold-text, otherwise the second line of the environment is displayed along with +the name of the environment. In other words, the following > + \begin{figure}[h] + \centerline{\psfig{figure=slidercrank.eps,height=6cm}} + \caption{The Slider Crank Mechanism.} + \label{fig:slidercrank} + \end{figure} + % a LaTeX comment. + \begin{eqnarray} + \sin(\pi) = 0 + \end{eqnarray} + + +will be shown as: > + +--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. ----- + % a LaTeX comment. + +--- 3 lines: eqnarray () : \sin(\pi) = 0 -------------------------------- + + + +-------------------------------------------------------------------------------- +Default Folding Scheme in Latex-Suite *ls_8_1* *ls_a_cj* + *default-folding* + +By default Latex-Suite creates folds in the following manner: + + > + \chapter + \section + %%fakesection + \subsection + \subsubsection + \item + \equation + \eqnarray + \figure + \table + \footnote +The indentation shows the "nestedness" of the folding scheme. See the next +section [|ls_a_ck|] to see how you can change this scheme. + +-------------------------------------------------------------------------------- +Customizing what to fold *ls_8_2* *ls_a_ck* + *customizing-what-to-fold* + +From version 1.6 onwards, the folding in Latex-Suite can be controlled to a +large extent via a number of global variables. + + + +Tex_FoldedSections *ls_8_2_1* *ls_a_cl* + *Tex_FoldedSections* + +This entry defines which sections will be folded. This setting is a comma +separated list of section names. The default value is: > + part,chapter,section,%%fakesection, + subsection,subsubsection,paragraph +Each of the entries in the list will fold up a section of the corresponding +name. The %%fakesection section is provided as a means for the user to group +lines into "fake" sections. A %%fakesection is assumed to start on a line which +begins with the string %%fakesection and continue till the start of the next +\section, \subsection or any other section. + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedEnvironments *ls_8_2_2* *ls_a_cm* + *Tex_FoldedEnvironments* + +This entry defines which environments will be folded. It is a comma separated +string of words each of which defines a single environment. The default setting +is > + verbatim,comment,eq,gather, + align,figure,table,thebibliography, + keywords,abstract,titlepage +The words need not be standard Latex environments. You can add any word you +like. Also, each word will fold up all environments whose name begins with that +word. For example, in the setting above, the word "eq" folds up the +\begin{equation}, \begin{eqnarray}, \begin{eqnarray*} environments. To avoid +this, you can replace the word "eq" with "eq}". + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedCommands *ls_8_2_3* *ls_a_cn* + *Tex_FoldedCommands* + +This entry defines which commands will be folded. It is a comma separated string +of words each of which defines a single command. The default setting is empty, +i.e no commands are folded. The words need not be standard Latex commands. You +can use whatever words you like. Each word will fold all commands whose name +begins with that word as in the case of the Tex_FoldedEnvironments [|ls_a_cm|] +variable. + +NOTE: It is very difficult to fold commands reliably because it is very + difficult to create a regexp which will match a line containing unmatched + parentheses (or curly brackets), but will not match a line containing + matched parentheses. + + Just to make things safer, only lines which start a command but do not + contain additional curly braces after the command has started are folded. + In other words, if you wanted to fold the the command "mycommand", then + the lines > + \mycommand{This is a line + and some more text on the next line + } +< will be folded, but the lines > + \mycommand{This is a \textbf{line} + and some more text + } +< will not be folded. This is a bug which is very difficult to fix. + + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedMisc *ls_8_2_4* *ls_a_co* + *Tex_FoldedMisc* + +This entry defines fold syntax for certain items which do not naturally fit into +the section, environment of command lists. It is a comma separated list of +words. The default value is: > + item,preamble,<<< +NOTE: Unlike the other Tex_FoldedXXXX variables, the words in this setting are + limited to take values from the following list: + + Value Meaning~ + comments Folds up contiguous blocks of comments + item Folds up the \items within list environments + preamble Folds up the preamble of a document. (The part between the + \documentclass command and the \begin{document} environment) + <<< Folds defined manually by the user using the <<< and >>> strings + as fold-markers. + + Any other words in the Tex_FoldedMisc setting are silently ignored. + + + +See also advanced fold settings [|ls_a_cp|]. + + +Advanced Fold setting details *ls_8_2_5* *ls_a_cp* + *fold-setting-advanced* + +The order of the words in the Tex_FoldedXXXX variables is _important_. The order +defines the order in which the folds are nested. For example, the value +"subsection,section" for the Tex_FoldedSections variable will not fold any +subsections at all. This is because the folds are created in the _reverse_ order +in which they occur in the Tex_FoldedSections setting and also, once a fold is +created, the interior of the fold is not examined for creating additional folds. +In the above case, this means that a \section is folded first and then its +interior is not examined further. The correct value should have been +"section,subsection" + + *fold-setting-adding* *ls_a_ee* +Each of the fold setting variables Tex_FoldedSections, Tex_FoldedEnvironments +etc., as explained previously is a comma separated string of variables. However, +to make it easier to _add_ to the default settings without having to repeat the +whole default setting again, Latex-Suite uses the following logic in forming the +complete setting string from the Tex_FoldedXXXX variables. If the variable +starts with a comma, then Tex_FoldedXXXX is added to the end of the default +string rather than replacing it. Similarly, if it ends with a comma, then it +will be prepended to the beginning of the default setting rather than replacing +it. + +For example, if Tex_FoldedEnvironments is set to the string "myenv", then only +an environment of the form \begin{myenv} will be folded. However, if the +Tex_FoldedEnvironments setting is ",myenv", then the \begin{myenv} environment +will be folded after all other environments in the default setting have been +folded. On the other hand if Tex_FoldedEnvironments is of the form "myenv,", the +\begin{myenv} environment will be folded before the rest of the environments in +the default setting. + +-------------------------------------------------------------------------------- +Editing the folding.vim file directly *ls_8_3* *ls_a_cq* + *editing-folding* + +If you are using version 1.5 of Latex-Suite or older, you will need to directly +edit the $VIM/ftplugin/latex-suite/folding.vim file if you wish to modify the +folding scheme. You will need to modify the function MakeTexFolds() defined in +that file to modify the fold syntax. MakeTexFolds makes a number of calls to +AddSyntaxFoldItem. Each such call defines a new "fold item". The order in which +these calls are made defines how the folds are nested. For example, if you +desire an figure environment to be nested within a section, then you should +define the fold for the figure first. The syntax of AddSyntaxFoldItem is as +follows: > + AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip]) +If the last two arguments are omitted, then they are assumed to default to the +empty strings ''. The explanation for each argument is as follows: + +Argument Explanation~ +startpat a line matching this pattern defines the beginning of a fold. +endpat a line matching this pattern defines the end of a fold. +startoff this is the offset from the starting line at which folding will + actually start +endoff like startoff, but gives the offset of the actual fold end from the + line satisfying endpat. startoff and endoff are necessary when the + folding region does not have a specific end pattern corresponding to + a start pattern. for example in LaTeX, \section{Section Name} defines + the beginning of a section, but there is no command which + specifically ends a section. Thus a \section is assumed to end 1 line + _before_ another section starts. +startskip A Pattern Which Defines The Beginning Of A "Skipped" Region. + + For example, suppose we define a \itemize fold as follows: > + = '^\s*\\item', + = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + = 0, + = -1 +< + + This defines a fold which starts with a line beginning with an \item + and ending one line before a line beginning with an \item or + \end{enumerate} etc. + + Then, as long as \item's are not nested things are fine. However, + once items begin to nest, the fold started by one \item can end + because of an \item in an \itemize environment within this \item. + i.e, the following can happen: > + \begin{itemize} + \item Some text <------- fold will start here + This item will contain a nested item + \begin{itemize} <----- fold will end here because next line contains \item... + \item Hello + \end{itemize} <----- ... instead of here. + \item Next item of the parent itemize + \end{itemize} +< + + Therefore, in order to completely define a folding item which allows + nesting, we need to also define a "skip" pattern. startskip and end + skip do that. Leave '' when there is no nesting. +endskip the pattern which defines the end of the "skip" pattern for nested + folds. + +NOTE: Example 1 + --------- + A syntax fold region for the latex section is defined with the following + arguments to AddSyntaxFoldItem: > + startpat = "\\section{" + endpat = "\\section{" + startoff = 0 + endoff = -1 + startskip = '' + endskip = '' +< Note that the start and end patterns are thus the same and endoff has a + negative value to capture the effect of a section ending one line before + the next starts. + + +NOTE: Example 2 + --------- + A syntax fold region for the \itemize environment is: > + startpat = '^\s*\\item', + endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + startoff = 0, + endoff = -1, + startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', + endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' +< Note the use of startskip and endskip to allow nesting. + + + +================================================================================ +Multiple file LaTeX projects *ls_9* *ls_a_cr* + *latex-project* + +|ls_9_1| Latex-Suite project settings +|ls_9_2| Specifying which file to compile + + + *latex-project-example* *ls_a_ef* +Many LaTeX projects contain multiple source files which are \included from a +master file. A typical example of this situation is a directory layout such as +the following + + > + thesis/ + main.tex + abstract.tex + intro/ + intro.tex + figures/ + fig1.eps + fig2.eps + chapter1/ + chap1.tex + figures/ + fig1.eps + conclusion/ + conclusion.tex + figures/ + + +In the above case, main.tex will typically look like + + > + % file: main.tex + \documentclass{report} + \begin{document} + + \input{abstract.tex} + \input{intro/intro.tex} + \input{chapter1/chap1.tex} + \input{conclusion/conclusion.tex} + + \end{document} + + + *latex-master-file-specification* *ls_a_eg* +In such situations, you will need to convey to Latex-Suite that main.tex is the +main file which \inputs the other files. This is done by creating a file called +main.tex.latexmain in the same directory in which main.tex resides. This file is +called the _master file_ in this manual. See Tex_MainFileExpression [|ls_a_eh|] +for an alternative way of specifying the master file. + +NOTE: Here main.tex.latexmain is (obviously) a different file from main.tex + itself. main.tex need not be renamed. This ofcourse restricts each + directory to have a single master file. + + +Each time Latex-Suite opens a new LaTeX file, it will try to see if it is part +of a multiple file project by searching upwards (to the root of the file-system) +from the current file's directory to see if it finds a file of the form +*.latexmain. If such a file is found, then it is considered that the current +file is part of a larger project. The name of the LaTeX master file is inferred +directly from the first part of the *.latexmain file as described in the example +above. + + +-------------------------------------------------------------------------------- +Latex-Suite project settings *ls_9_1* *ls_a_cs* + *latex-project-settings* + +If a master file [|ls_a_ct|] is found, then Latex-Suite :sources the file. Thus +this file needs to contain valid Vim commands. This file is typically used to +store project specific settings. + +Some typical per-project settings which are best put in the master file are +Tex_ProjectSourceFiles [|ls_a_dt|] + +-------------------------------------------------------------------------------- +Specifying which file to compile *ls_9_2* *ls_a_ct* + *latex-master-file* + +In the example described previously [|ls_a_ef|], if you are editing +intro/intro.tex and press \ll, then you still want Latex-Suite to compile +main.tex, because intro/intro.tex is merely a fragment which is \input'ed into +main.tex. If the master file is already specified using the *.latexmain +convention described previously [|ls_a_ef|], then Latex-Suite will automatically +compile the master file when you are editing any of its \input'ed fragments. +Thus pressing \ll while editing intro/intro.tex will compile main.tex. + + *Tex_MainFileExpression* *ls_a_eh* +If you wish to use some different logic to specify the main file name, you can +specify a custom expression via the Tex_MainFileExpression variable. This is a +string containing a valid vim expression. In addition, you can use a variable +modifier which is in the format used for |filename-modifiers|, for example, +':p:h'. You should utilize this variable to modify the filename of the main +file. > + let g:Tex_MainFileExpression = 'MainFile(modifier)' + function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif + endif + + +================================================================================ +Latex-Suite Commands and Maps *ls_10* *ls_a_cu* + *latex-suite-commands-maps* + +|ls_10_1| Latex-Suite Maps +|ls_10_2| Latex Suite Commands + + +This section describes the maps and commands used in Latex-Suite. It also +describes a way to change the map sequences according to your preference. + + +-------------------------------------------------------------------------------- +Latex-Suite Maps *ls_10_1* *ls_a_cv* + *latex-suite-maps* + + *remapping-latex-suite-keys* *ls_a_ei* +Most of the mappings used in Latex-Suite can be mapped to a different key +combination to suit your particular needs. An example best explains the +procedure for doing this. Suppose you want to remap the <C-j> key which +Latex-Suite (actually imaps.vim) uses to jump to the next placeholder. To do +this, you first need to find out which <Plug> mapping <C-j> is derived from. You +will need to look at the relevant section of this manual to do this. For +example, the section IMAP mappings [|ls_a_cw|] has the information that the +<C-j> key is derived from <Plug>IMAP_JumpForward. Therefore to remap the <C-j> +key to say <C-space>, you will need to put a statement like the following in +your ~/.vimrc. > + imap <C-space> <Plug>IMAP_JumpForward + + +NOTE: To change the IMAP mappings which affect jumping between placeholders, the + map statement above has to be placed in your ~/.vimrc. For other mappings + you can place the map statement in your $VIM/ftplugin/tex.vim file. The + reason for this is that the <C-j> maps are created in plugin/imaps.vim, + which is sourced as soon as Vim starts before sourcing any ftplugin files. + + + + +IMAP mappings *ls_10_1_1* *ls_a_cw* + *customize-imap-maps* + +These mappings are utilized for jumping between placeholders as described here +[|ls_a_eD|]. See the parent section [|ls_a_cv|] to find out how to use this +information to change the default maps. + + *Plug_IMAP_JumpForward* *ls_a_ej* + *Plug_IMAP_JumpBack* *ls_a_ek* + *Plug_IMAP_DeleteAndJumpForward* *ls_a_el* + *Plug_IMAP_DeleteAndJumBack* *ls_a_em* +Plug map Default Key~ +<Plug>IMAP_JumpForward <C-j> +<Plug>IMAP_JumpBack (none) +<Plug>IMAP_DeleteAndJumpForward (none) +<Plug>IMAP_DeleteAndJumpBack (none) + +<Plug>IMAP_JumpForward takes you to the location of the next place-holder +[|ls_a_eD|]. + +<Plug>IMAP_JumpBack takes you to the previous place-holder [|ls_a_eD|]. + +<Plug>IMAP_DeleteAndJumpForward deletes the presently selected place-holder and +jumps to the next place-holder irrespective of whether the present placeholder +is empty or not and ignoring the value of place-holder settings like +g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders +[|ls_a_cX|] + +<Plug>IMAP_DeleteAndJumpBack deletes the presently selected place-holder and +jumps to the previous place-holder irrespective of whether the present +placeholder is empty or not and ignoring the value of place-holder settings like +g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders +[|ls_a_cX|] + + +Alt-Key mappings *ls_10_1_2* *ls_a_cx* + *customize-alt-key-maps* + +These mappings are are described in the section Alt key macros [|ls_a_bA|]. See +the parent section [|ls_a_ei|] to see how to use the following information to +remap keys. + + *Plug_Tex_MathBF* *ls_a_en* + *Plug_Tex_MathCal* *ls_a_eo* + *Plug_Tex_LeftRight* *ls_a_ep* + *Plug_Tex_InsertItem* *ls_a_eq* +Plug Mapping Default Key~ +<Plug>Tex_MathBF <Alt-B> +<Plug>Tex_MathCal <Alt-C> +<Plug>Tex_LeftRight <Alt-L> +<Plug>Tex_InsertItem <Alt-I> + +-------------------------------------------------------------------------------- +Latex Suite Commands *ls_10_2* *ls_a_cy* + *latex-suite-commands* + + + +:TMacro [{macro}] *ls_10_2_1* *ls_a_cz* *TMacro* + +When used without any arguments lists all available macros defined in runtime +ftplugin/latex-suite/macros/ directories and prompts you to choose one of them. +With one argument |:read| this macro under cursor position. With more than one +argument it will not work :) In Vim >= 6.2 works completion of names of macros +(see 'wildmenu', 'wildmode' for more about command-line completion). + + +:TMacroEdit [{macro}] *ls_10_2_2* *ls_a_cA* + *TMacroEdit* + +Splits window for editing {macro}. When used without any arguments lists all +available macros defined in runtime ftplugin/latex-suite/macros/ directories and +prompt you to choose one of them. When you try to edit {macro} not from local +directory Latex-Suite will copy it to your local directory with suffix "-local". +If local copy already exists Latex-Suite prompt for overwriting it. In Vim >= +6.2 works completion of names of macros (see 'wildmenu', 'wildmode' for more +about command-line completion). + + +:TMacroNew *ls_10_2_3* *ls_a_cB* + *TMacroNew* + +Splits window to write new macro. Directory in new buffer is locally changed to +Latex-Suite/macros/. + + +:TMacroDelete [{macro}] *ls_10_2_4* *ls_a_cC* + *TMacroDelete* + +Delets {macro} from your local ftplugin/latex-suite/macros/ directory. When used +without any arguments lists all available macros defined in Latex-Suite/macros/ +directory and prompt you to choose one of them. When you choose to delete +{macro} which is not in your local directory Latex-Suite will refuse to delete +it. In Vim >= 6.2 works completion of names of macros (see 'wildmenu', +'wildmode' for more about command-line completion) + + +:TPackage [{package, ...}] *ls_10_2_5* *ls_a_cD* + *TPackage* + +When used without any arguments lists name of the packages for which support is +available. If you are using Vim GUI and have Tex_Menus set to 1, then it will +list all files found in the $VIM/ftplugin/latex-suite/packages directory. +Otherwise, Latex-Suite will list files found in the +$VIM/ftplugin/latex-suite/dictionaries directory. Choosing a file from the list +will insert a > + \usepackage[<++>]{<packname>} +line into the buffer at the current cursor location. For Vim 6.2 and above, you +can use command-line completion to choose a package file. You can also call +TPackage with one or more package names separated with spaces in which case, +Latex-Suite will insert \usepackage lines for each of them in turn. + +After inserting the \usepackage line(s), Latex-Suite will support it (them) in +various ways as described in the section Actions taken for supported packages +[|ls_a_bL|]. + + +:TPackageUpdate *ls_10_2_6* *ls_a_cE* + *TPackageUpdate* + +This command `reads' name of package under cursor and turns on possible support. + + +:TPackageUpdateAll *ls_10_2_7* *ls_a_cF* + *TPackageUpdateAll* + +After issuing this command latexSuite scans the file in looking for not declared +packages, removing not needed entries from Packages menu and turning off not +necessary packages' dictionaries. + + +:TTemplate [{template}] *ls_10_2_8* *ls_a_cG* + *TTemplate* + +When used without any arguments lists all available templates from +latex-suite/templates/ directory and prompts to choose one of them. With one +argument :0|read| {template} file. With more than one argument it will not work +:) In Vim >= 6.2 works completion of names of macros (see 'wildmenu', 'wildmode' +for more about command-line completion) + + +:TSection [{argument}] *ls_10_2_9* *ls_a_cH* + *TSection* + +Used without any arguments inserts last section type (|latex-sectioning|). +Accepts arguments: n> inserts section name in <n> logical level. Levels are: +0 part +1 chapter +2 section +3 subsection +4 subsubsection +5 paragraph +6 subparagraph + + ++<n> inserts section name <n> logical levels above the last used comand +-<n> inserts section name <n> logical levels below the last used comand ++ inserts section name one logical level below the last used command (equal + to +1). +++ inserts section name two logical levels below the last used command (equal + to +2). +- inserts section name one logical level over the last used command (equal + to -1). +-- inserts section name two logical levels over the last used command (equal + to -2). + + + +Command accepts also latexSuite mappings (|latex-macros|) without preceding S +and in lowercase: > + :TSection pa +will result in \part{}. It is possible to use full names of sections: :TSection +part + + +:TSectionAdvanced *ls_10_2_10* *ls_a_cI* + *TSectionAdvanced* + +Accepts the same arguments as |TSection| but leads to a couple of questions +(whether you want to include the section in the table of contents, whether there +is a shorter name for the table of contents) and then creates a more intelligent +template. + + +:TLook *ls_10_2_11* *ls_a_cJ* *TLook* + +Accepts one argument. Will look through .tex files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. Note: +TLook uses :grep command and is using 'grepprg'. Its regular expressions can be +different from those of Vim. + + +:TLookBib *ls_10_2_12* *ls_a_cK* + *TLookBib* + +Accepts one argument. Will look through .bib files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. + +NOTE: TLookBib uses :grep command and is using 'grepprg'. Its regular + expressions can be different from those of Vim. + + + + +:TLookAll *ls_10_2_13* *ls_a_cL* + *TLookAll* + +Accepts one argument. Will look through all files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. Note: +TLook uses :grep command and is using 'grepprg'. Its regular expressions can be +different from those of Vim. + + +:TPartComp *ls_10_2_14* *ls_a_cM* + *TPartComp* + +No argument allowed but accepts range in all formats. Define fragment of +interest with :'a,'b, :/a/,/b/, :'<,'> or :20,30. All other rules of compilation +apply. + + +:TPartView *ls_10_2_15* *ls_a_cN* + *TPartView* + +Show last compiled fragment. All rules of viewing apply but |latex-searching|. + + +:Tshortcuts [{arg}] *ls_10_2_16* *ls_a_cO* + *Tshortcuts* + +Show shortcuts in terminal (not using menu). Without {arg} you will see simple +menu prompting for one of them. Possible arguments: +g General shortcuts +e Environment shortcuts +f Font shortcuts +s Section shortcuts +m Math shortcuts +a All shortcuts + +================================================================================ +Customizing Latex-Suite *ls_11* *ls_a_cP* + *customizing-latex-suite* + +|ls_11_1| General Settings +|ls_11_2| Place-Holder Customization +|ls_11_3| Macro Customization +|ls_11_4| Smart Key Customization +|ls_11_5| Latex Completion Customization +|ls_11_6| Compiler Customization +|ls_11_7| Viewer Customization +|ls_11_8| Menu Customization +|ls_11_9| Folding Customization +|ls_11_10| Package Handling Customization + + +Customizing Latex-Suite is done by defining certain global variables in +$VIM/ftplugin/tex.vim, where $VIM corresponds to ~/.vim for *nix machines and +~/vimfiles for windows machines. This file is not part of the Latex-Suite +distribution. You will need to create this file yourself (or modify it if it +exists) if you need to change any default settings. Since this file is not +included as part of the Latex-Suite distribution, it will not be over-written in +subsequent updates. + +The default settings in Latex-Suite are defined in +$VIM/ftplugin/latex-suite/texrc. Please take a look at this file if you find +this documentation incomplete or confusing. That file is also well documented. + +This chapter describes the various settings which effect Latex-Suite and their +default values. The settings are broken up into sections according to the +behavior which they influence. + + +-------------------------------------------------------------------------------- +General Settings *ls_11_1* *ls_a_cQ* + *ls-general-purpose-settings* + + + +Tex_Debug *ls_11_1_1* *ls_a_cR* + *Tex_Debug* + +Type boolean +Default Value 0 + +If set to 1, then Latex-Suite will create certain global debug statements which +can be printed by doing > + :call Tex_PrintDebug() + + + +Tex_UsePython *ls_11_1_2* *ls_a_cS* + *Tex_UsePython* + +Type boolean +Default Value 1 + +If Latex-Suite detects that your vim is python enabled (using has('python')), +then it tries to use python in certain places to speed things up. If this +misbehaves, you can set this to zero, in which case, Latex-Suite will use +vimscript to accomplish the same. + +-------------------------------------------------------------------------------- +Place-Holder Customization *ls_11_2* *ls_a_cT* + *customizing-place-holders* + +Latex-Suite uses place-holders [|ls_a_eD|] to minimize using the movement keys +while typing. The following settings affect how place-holders are used. + +NOTE: These setting need to be set in your ~/.vimrc, not $VIM/ftplugin/tex.vim + because these settings affect the behavior of imaps.vim, which is a global + plugin, not a file-type plugin. + + + + +g:Imap_UsePlaceHolders *ls_11_2_1* *ls_a_cU* + *Imap_UsePlaceHolders* + + +Type Boolean +Default Value 1 + +Setting this to zero completely disables using place-holders. + + +g:Imap_PlaceHolderStart & g:Imap_PlaceHolderEnd *ls_11_2_2* *ls_a_cV* + *Imap_PlaceHolderStart* + + *Imap_PlaceHolderEnd* *ls_a_er* +Setting Type Value~ +Imap_PlaceHolderStart String '<+' +Imap_PlaceHolderEnd String '+>' + +These settings affect the strings displayed at the beginning and end of the +place-holder string. Set these strings to a value different than a commonly +occurring sequence of characters. + +NOTE: TIP + --- + If you use the latin1 encoding and do not type in french, then you can set + these strings to the \xab and \xbb characters (the french quotation + marks). + + + + +g:Imap_DeleteEmptyPlaceHolders *ls_11_2_3* *ls_a_cW* + *Imap_DeleteEmptyPlaceHolders* + + +Type Boolean +Default Value 1 + +When set to one, non-descriptive or empty place-holders are deleted on pressing +<Ctrl-J>. + + +g:Imap_StickyPlaceHolders *ls_11_2_4* *ls_a_cX* + *Imap_StickyPlaceHolders* + + +Type Boolean +Default Value 1 + +When set to 1, in visual mode, <Ctrl-J> takes you to the next placeholder +without deleting the current placeholder. + +-------------------------------------------------------------------------------- +Macro Customization *ls_11_3* *ls_a_cY* + *customizing-macros* + + + +Tex_Env_name *ls_11_3_1* *ls_a_cZ* + *Tex_Env_name* + +If you wish to wish to expand certain environments differently from the way +Latex-Suite does it, you can define custom expansions using global variables of +the form Tex_Env_{name} where name corresponds to the environment. + +For example, if you press <F5> after typing theorem, Latex-Suite will by default +expand it to > + \begin{theorem} + \label{<++>}<++> + \end{theorem}<++> +However, if you wish change this to > + \begin{theorem} + <++> + \end{theorem}<++> +then define the following variable > + let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}" +< + +If the expansion uses special keys such as carriage return etc, then use +double-quotes and use the "\<key>" notation for special keys. Backslashes have +to be doubled. + +You could even use strings returned by functions as the expansion by using the +IMAP_PutTextWithMovement() [|ls_a_ea|] function. + +If the name of the environment contains special characters (for example, the +eqnarray* environment), then use the following form: > + let g:Tex_Env_{'eqnarray*'} = + \ "\\begin{eqnarray*}\<CR><++> &=& <++>\<CR>\\end{eqnarray*}<++>" +This will make pressing <F5> after eqnarray* expand to > + \begin{eqnarray*} + <++> &=& <++> + \end{eqnarray*}<++> + + + +Tex_Com_name *ls_11_3_2* *ls_a_da* + *Tex_Com_name* + +If you wish to define new expansions for fast command insertion as described +here [|ls_a_bo|], or redefine expansions from the default values in Latex-Suite, +you will need to define variables of the form g:Tex_Com_{name} where name is a +command name. For example, with the setting > + let g:Tex_Com_frac = "\\frac{<++>}{<++>}<++>" +pressing <F7> after typing frac will change it to \frac{<++>}{<++>}<++> + +See Tex_Env_name [|ls_a_cZ|] for additional details on how to create this +setting in various special circumstances. + + +Enabling / disabling macros *ls_11_3_3* *ls_a_db* + *macro-enabling* + +The following variables disable various parts of the macro functionality of +Latex-Suite. See the links to the relevant sections to see what functionality +setting each of the variables to zero will take away. + + *Tex_EnvironmentMaps* *ls_a_es* + *Tex_EnvironmentMenus* *ls_a_et* + *Tex_FontMaps* *ls_a_eu* + *Tex_FontMenus* *ls_a_ev* + *Tex_SectionMaps* *ls_a_ew* + *Tex_SectionMenus* *ls_a_ex* +Setting Link to relevant section Default Value~ +g:Tex_EnvironmentMaps Environment Mappings [|ls_a_bf|] 1 +g:Tex_EnvironmentMenus 1 +g:Tex_FontMaps Font Mappings [|ls_a_bs|] 1 +g:Tex_FontMenus 1 +g:Tex_SectionMaps Section Mappings [|ls_a_bt|] 1 +g:Tex_SectionMenus 1 + + +g:Tex_UseMenuWizard *ls_11_3_4* *ls_a_dc* + *Tex_UseMenuWizard* + + +Type Boolean +Default Value 0 + +If this variable is set to 1, then when an environment is chosen from the menu +then for selected environments, Latex-Suite asks a series of questions on the +command line and inserts a template with the corresponding fields already filled +in. Setting this to zero will insert a template with place-holders [|ls_a_eD|] +marking off the places where fields need to be filled. + + +g:Imap_FreezeImap *ls_11_3_5* *ls_a_dd* + *Imap_FreezeImap* + +Type boolean +Default Value 0 + +This option when set to 1, temporarily freezes Latex-Suite's macro expansion. It +might be useful when you are using some other keymap which is causing excessive +macro expansion. Use a buffer-local variable of the same name if you wish to +affect just the present buffer. + + +g:Tex_CatchVisMapErrors *ls_11_3_6* *ls_a_de* + *Tex_CatchVisMapErrors* + + +Type Boolean +Default Value 1 + +With so many visual maps, its helpful to have a way of catching typing errors +made in visual mode. What this does is to prompt you to correct your visual mode +mapping if you start out with and then type some illegal keys. It basically maps +just the g:Tex_Leader character to a function. + + +g:Tex_Diacritics *ls_11_3_7* *ls_a_df* + *Tex_Diacritics* + + +Type Boolean +Default Value 0 + +Whether or not you want to use diacritics [|ls_a_bw|]. + + +g:Tex_Leader *ls_11_3_8* *ls_a_dg* + *Tex_Leader* + + +Type String +Default Value '`' + +The mappings in Latex-Suite are by default prefixed with the back-tick +character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the +prefix with the following setting. ',', '/', '`' are preferred values. '' or '\' +will lead to a _lot_ of trouble. + +g:Tex_Leader is also used for visual mode mappings for fonts. + + +g:Tex_Leader2 *ls_11_3_9* *ls_a_dh* + *Tex_Leader2* + + +Type String +Default Value ',' + +In order to avoid clashes between the large number of visual mode macros +provided, the visual mode macros for environments [|ls_a_bm|] and sections start +with a character different from g:Tex_Leader. + + +g:Tex_PromptedEnvironments *ls_11_3_10* *ls_a_di* + *Tex_PromptedEnvironments* + + +Type String +Default Value 'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*' + +This string represents a comma separated list of fields corresponding to +environments. Pressing <F5> in insert-mode in the body of the document asks you +to choose from one of these environments to insert. + +Leaving this string empty will leave the <F5> key unmapped + + +g:Tex_HotKeyMappings *ls_11_3_11* *ls_a_dj* + *Tex_HotKeyMappings* + + +Type String +Default Value 'eqnarray*,eqnarray,bmatrix' + +This string represents a comma separated list of environments which are mapped +to <Shift-F-1> through <Shift-F-4>. For example, pressing <Shift-F-2> with this +setting inserts the eqnarray environment. + +Leaving this string empty will leave <Shift-F-1> through <Shift-F-4> unmapped. + +NOTE: Only the first four fields of this list are used. The rest are silently + ignored. + + + + +g:Tex_PromptedCommands *ls_11_3_12* *ls_a_dk* + *Tex_PromptedCommands* + + +Type String +Default Value 'footnote,cite,pageref,label' + +This string represents a comma separated list of LaTeX commands which +Latex-Suite uses for the <F7> and <S-F7> maps as described here [|ls_a_bo|]. + +Leaving this string empty will leave the <F7> key unmapped. + + +Tex_ItemStyle_environment *ls_11_3_13* *ls_a_dl* + *Tex_ItemStyle_environment* + +This setting affects the style which Latex-Suite uses to insert an \item when +<Alt-I> is pressed as described here [|ls_a_bE|]. By default Latex-Suite defines +styles for the following environments: + +Environment Style~ +itemize \item +enumerate \item +theindex \item +thebibliography \item[<+biblabel+>]{<+bibkey+>} <++> +description \item[<+label+>] <++> + +Each style is defined by a variable of the form g:Tex_ItemStyle_{envname} where +envname is the name of the environment for which the style is defined. For +example, by default > + g:Tex_ItemStyle_description = '\item[<+label+>] <++>' +Redefining the style for a particular environment or defining a style for an +entirely new environment is simply a matter of setting the value of a variable +of the corresponding name. + +-------------------------------------------------------------------------------- +Smart Key Customization *ls_11_4* *ls_a_dm* + *customizing-smart-keys* + +These settings affect the smart key functionality as described here [|ls_a_bz|]. + + + +g:Tex_SmartKeyBS *ls_11_4_1* *ls_a_dn* + *Tex_SmartKeyBS* + + +Type Boolean +Default Value 1 + +Whether or not <Backspace> deletes diacritics. + + +g:Tex_SmartKeyQuote *ls_11_4_2* *ls_a_do* + *Tex_SmartKeyQuote* + + +Type Boolean +Default Value 1 + +Whether or not the smart quotes [|ls_a_bz|] functionality is available. + +If enabled, the quote characters can be customized by setting the following +variables: + +Setting Value~ +g:Tex_SmartQuoteOpen "``" +g:Tex_SmartQuoteClose "''" + +Non-English users will want to change these settings to their locale. These +global variables will be ignored if there are buffer-local variables (with the +same name), which may be set in the language specific package files, such as +$VIM/ftplugin/latex-suite/packages/german. + +-------------------------------------------------------------------------------- +Latex Completion Customization *ls_11_5* *ls_a_dp* + *customizing-latex-completion* + +The following settings affect the completion [|ls_a_bR|] functionality in +Latex-Suite. + + + +Window size settings *ls_11_5_1* *ls_a_dq* + *completion-window-preferences* + +These three settings affect the aesthetics of the completion functionality. + + *Tex_ViewerCwindowHeight* *ls_a_ey* + *Tex_ViewerPreviewHeight* *ls_a_ez* + *Tex_ExplorerHeight* *ls_a_eA* + *Tex_ImageDir* *ls_a_eB* +Setting Explanation Default Value~ +g:Tex_ViewerCwindowHeight The height of the cwindow which 5 + displays the list of \labels + etc. +g:Tex_ViewerPreviewHeight The height of the preview window 10 + which shows the context of a + \label etc. +g:Tex_ExplorerHeight The height of the explorer 10 + window which lists the files + from which to choose an image + file. +g:Tex_ImageDir The directory to scan for images '' + + +g:Tex_BIBINPUTS *ls_11_5_2* *ls_a_dr* + *Tex_BIBINPUTS* + + +Type string +Default Value '' + +This string describes the directories which are scanned while trying to search +for .bib and .bbl files. See the cite completion section [|ls_a_bU|] for more +details. + +This string should be set in the syntax accepted by Vim's native 'path' setting. +Do not include the present directory '.'. While searching for bibliography +files, the present directory will be prepended to this variable. + + +Tex_UseSimpleLabelSearch *ls_11_5_3* *ls_a_ds* + *Tex_UseSimpleLabelSearch* + +When set to 1, Latex-Suite searches for \labels in all .tex files in the +directory containing the file being edited when <F9> is pressed. See \ref +completion [|ls_a_bT|] for details. + + +g:Tex_ProjectSourceFiles *ls_11_5_4* *ls_a_dt* + *Tex_ProjectSourceFiles* + + +Type String +Default Value '' + +This setting is meant to be initialized on a per-project basis using the +Latex-Suite master file [|ls_a_ct|] as described in Latex-Suite Project +[|ls_a_cr|] section. It is a list of source files which are used in the project. +If defined, then instead of using the logic described in +Tex_UseSimpleLabelSearch [|ls_a_ds|] to search for files in which to search for +\labels, we simply search for \labels in this list. This significantly reduces +the time it takes to generate the list of possible completions for large +projects. + +The list is specified as a whitespace separated list of filenames relative to +the location of the main file. + + +g:Tex_RememberCiteSearch *ls_11_5_5* *ls_a_du* + *Tex_RememberCiteSearch* + + +Type Boolean +Default Value 0 + +When this variable is non-zero, then Latex-Suite will try to remember results +from the \cite completion as described in this section [|ls_a_bV|]. + +-------------------------------------------------------------------------------- +Compiler Customization *ls_11_6* *ls_a_dv* + *customizing-compiling* + +The following settings affect Latex-Suite's compilation functionality + + + +g:Tex_DefaultTargetFormat *ls_11_6_1* *ls_a_dw* + *Tex_DefaultTargetFormat* + + +Type String +Default Value dvi for windows/*nix and pdf for mac + +Use this setting to choose the default target format. For example, setting this +to pdf makes Latex-Suite compile a pdf file when you press \ll and fire up the +pdf viewer on pressing \lv. Make sure that a rules for compiling and viewing +have been defined for this target format as described here [|ls_a_dx|] and here +[|ls_a_dF|]. + + +g:Tex_CompileRule_<format> *ls_11_6_2* *ls_a_dx* + *Tex_CompileRule_format* + +Here <format> refers to the target format for which this rule is defined. +Latex-Suite supports compiling into dvi, ps and pdf by default. All these rules +are strings defined by default as follows: + + +g:Tex_CompileRule_dvi 'latex -interaction=nonstopmode $*' +g:Tex_CompileRule_ps 'ps2pdf $*' +g:Tex_CompileRule_pdf 'pdflatex -interaction=nonstopmode $*' + +If you desire forward and inverse searching via Latex-Suite, you will need to +change g:Tex_CompileRule_dvi to include -src-specials. However, this has been +known to cause problems with the output file. Therefore, use this with care. + + +g:Tex_FormatDependency_<format> *ls_11_6_3* *ls_a_dy* + +Type string +Default Value '' + +By default, there are no format dependencies defined. Each definition is of the +form above where <format> is a string such as 'dvi' etc. + +The value of each string is a comma separated string such as 'dvi,ps'. See the +Compiler dependency [|ls_a_ca|] section to see how to use/specify this setting + + +g:Tex_MultipleCompileFormats *ls_11_6_4* *ls_a_dz* + *Tex_MultipleCompileFormats* + +Type string +Default Value 'dvi' + +This is a comma separated string of formats for which the compiler needs to be +called multiple times in order to get cross-references, citations etc right. See +the Compiling multiple times [|ls_a_cb|] section for details. + + +g:Tex_IgnoredWarnings *ls_11_6_5* *ls_a_dA* + *Tex_IgnoredWarnings* + + +Type String +Default Value a new-line separated list of patterns as described below + +The default value of this setting is > + \"Underfull\n". + \"Overfull\n". + \"specifier changed to\n". + \"You have requested\n". + \"Missing number, treated as zero.\n". + \"There were undefined references\n" + \"Citation %.%# undefined" +This setting defines a set of patterns which will be filtered out when +displaying the output from the latex compiler. This is to aid in filtering out +very common warnings/errors. + +NOTE: Remember to check the value of g:Tex_IgnoreLevel [|ls_a_dB|] when you + change this setting. For example, if you append a new pattern which you + would like to ignore by default, increase the value of g:Tex_IgnoreLevel. + + + + +g:Tex_IgnoreLevel *ls_11_6_6* *ls_a_dB* + *Tex_IgnoreLevel* + + +Type Integer +Default Value 7 + +This setting defines a "filter level" or an "ignore level". A value of 7 for +instance means that any warning/error matching with any of the first 7 fields of +g:Tex_IgnoredWarnings [|ls_a_dA|] will be ignored. Setting this value to zero +will mean that no error/warning is ignored. However, even with a value of zero, +Latex-Suite will filter out most of the text which a LaTeX compiler typically +produces. Use > + TCLevel strict +from within Vim in order to see all the lines from the compiler's output. + + +Tex_UseMakefile *ls_11_6_7* *ls_a_dC* + *Tex_UseMakefile* + +Type boolean +Default Value 1 + +When set to 1, then if a makefile or Makefile is present in the current +directory, then Latex-Suite sets the makeprg option to just "make <target>", +where <target> is the target format chosen using the TCTarget or TTarget +commands. + +When set to 0, then Latex-Suite will set the makeprg setting to whatever is +defined by the g:Tex_CompileRule_target [|ls_a_dx|] setting. + + +g:Tex_GotoError *ls_11_6_8* *ls_a_dD* + *Tex_GotoError* + + +Type boolean +Default Value 1 + +If set to 1, then pressing \ll will take you to the location of the first +warning/error, otherwise you will remain in the original location but the +errors/warnings will be listed in the preview window. + +-------------------------------------------------------------------------------- +Viewer Customization *ls_11_7* *ls_a_dE* + *customizing-viewing* + +The following settings affect how Latex-Suite will display compiled files. + + + +g:Tex_ViewRule_<format> *ls_11_7_1* *ls_a_dF* + *Tex_ViewRule_format* + +Here <format> refers to a format such as dvi, ps, etc. This variable defines the +program which will be called to display a file of that format. + +By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF +formats as follows: + + Windows Unix~ +g:Tex_ViewRule_dvi 'yap -1' 'xdvi' +g:Tex_ViewRule_ps 'gsview32' 'ghostview' +g:Tex_ViewRule_pdf 'AcroRd32' 'xpdf' + +For Macintosh systems, these strings are left empty by default. This lets the +system pick the program for each format. If you define these variables for Mac, +the system choice will be over-ridden. + +Latex-Suite appends file.format to the above settings while calling the external +programs. For example, with > + let g:Tex_ViewRule_dvi = 'yap -1' +yap is called as > + !start yap -1 file.dvi +from within Vim. (The initial start is used on Windows platforms is to make yap +start as a separate process.) If you find the way Latex-Suite constructs the +command line too restrictive, you can use the Tex_ViewRuleComplete_format +[|ls_a_dG|] setting for more complete control on how the command line is +constructed while calling the external program for viewing. + +NOTE: For windows, you will need to set the $PATH variable to include the paths + to yap, AcroRd32, gsview32 and any other programs. See your system + documentation for how to do this. + + +NOTE: Default Viewing Format + ---------------------- + To change the default format for viewing files, set the + g:Tex_DefaultTargetFormat [|ls_a_dw|] variable. + + + + +Tex_ViewRuleComplete_<format> *ls_11_7_2* *ls_a_dG* + *Tex_ViewRuleComplete_format* + +Here <format> refers to the extension of a output format such as dvi, html etc. + +Tex_ViewRuleComplete_format takes precedence over Tex_ViewRule_format if both +are specified. By default, Latex-Suite does not define values for +Tex_ViewRuleComplete_format for any format. Unlike in the case of +Tex_ViewRule_format, Latex-Suite does not modify Tex_ViewRuleComplete_format at +all in constructing the command line. The only modification is to substitute +'$*' everywhere in the string with the name of the file being viewed (without +the extension). + +NOTE: IMPORTANT + --------- + Make sure you make the process go into the background otherwise vim will + wait for the viewer to terminate before letting you edit the file again. + + To make a process go into the background on a *nix platform, use a + trailing & in the setting. On Windows, use start at the beginning of the + setting. Example: Suppose you have a latex->html converter which converts + a file say foo.tex to a file foo/index.html. Then you would use: > + " On *nix platform + let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &' + " On windows platform + let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html' +< + + + +-------------------------------------------------------------------------------- +Menu Customization *ls_11_8* *ls_a_dH* + *customizing-menus* + +In addition to using the variables defined in this section to affect the +menu-layout permanently (i.e, the layout Latex-Suite will start with), you can +also use the TeX-Suite > Configure Menu menu to dynamically configure the menu +layout after Latex-Suite has started. + + + +g:Tex_Menus *ls_11_8_1* *ls_a_dI* + *Tex_Menus* + + +Type Boolean +Default Value 1 + +If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly +work in terminals. + + +g:Tex_MainMenuLocation *ls_11_8_2* *ls_a_dJ* + *Tex_MainMenuLocation* + + +Type number +Default Value 80 + +This setting decides the location of the first top-level Latex-Suite menu. You +can for example shift all the menus created by Latex-Suite to the very end by +setting this value to a large number like 990. + + +g:Tex_MathMenus *ls_11_8_3* *ls_a_dK* + *Tex_MathMenus* + + +Type Boolean +Default Value 1 + +The Tex-Math menu consists of hundreds of mathematical symbols used in LaTeX. +This menu comprises about 75% of the menus. + + +g:Tex_NestElementMenus *ls_11_8_4* *ls_a_dL* + *Tex_NestElementMenus* + + +Type Boolean +Default Value 1 + +This setting controls the "compactness" of the menus. If set to 1, then the +Font, Counter and Dimensioning menus are collected together in a single menu +called Tex-Elements, otherwise, they will each get a separate menu. + + +g:Tex_PackagesMenu *ls_11_8_5* *ls_a_dM* + *Tex_PackagesMenu* + + +Type Boolean +Default Value 1 + +Setting this to zero will stop Latex-Suite from automatically creating the +TeX-Suite > Packages > Supported menu at startup. You can still create the menu +after startup by going to TeX-Suite > Configure Menu. + + +g:Tex_NestPackagesMenu *ls_11_8_6* *ls_a_dN* + *Tex_NestPackagesMenu* + + +Type String +Default Value 'TeX-' + +This string is the prefix added to all the menus created by Latex-Suite. If you +define this variable with a dot ('.') as the last character, then all the menus +created by Latex-Suite will be nested under a single master menu. For example, +set this to '&LaTeX-Suite.' to nest all menus under a menu called &LaTeX-Suite. + + +g:Tex_UseUtfMenus *ls_11_8_7* *ls_a_dO* + *Tex_UseUtfMenus* + + +Type Boolean +Default Value 0 + +This setting controls whether Latex-Suite uses utf-8 symbols to display some of +the mathematical symbols in the TeX-Math menu. It is necessary for your +system/GUI to support utf-8. Setting this to 1 has the side-effect of setting +the 'encoding' option of Vim to 'utf-8'. + +-------------------------------------------------------------------------------- +Folding Customization *ls_11_9* *ls_a_dP* + *customizing-folding* + +The following settings control the folding [|ls_a_ci|] functionality of +Latex-Suite. + + + +g:Tex_Folding *ls_11_9_1* *ls_a_dQ* + *Tex_Folding* + + +Type Boolean +Default Value 1 + +Setting this to zero completely disables Latex-Suite's folding functionality. +However, the TexFoldTextFunction() is still available in case you want to use +another folding scheme but still want to continue using the fold text function. + + +g:Tex_AutoFolding *ls_11_9_2* *ls_a_dR* + *Tex_AutoFolding* + + +Type Boolean +Default Value 1 + +This setting controls whether Latex-Suite automatically creates manual folds for +a file when it is opened. You can still use the \rf mapping to refresh/create +folds even when this variable is set to zero. + +-------------------------------------------------------------------------------- +Package Handling Customization *ls_11_10* *ls_a_dS* + *customizing-packages* + +These settings affect the custom packages [|ls_a_bN|] functionality in +Latex-Suite + + + +g:Tex_TEXINPUTS *ls_11_10_1* *ls_a_dT* + *Tex_TEXINPUTS* + + +Type string +Default Value '' + +This setting describes the directories scanned by Latex-Suite while searching +for custom user packages as described in the custom packages [|ls_a_bN|] +section. Do not include the present directory in this setting. The present +directory is always scanned for custom packages. + +This string should be set in the syntax accepted by Vim's native 'path' setting. + +================================================================================ +Credits *ls_12* *ls_a_dU* + *latex-suite-credits* + + + +And finally, the credits: + + +Artur R. Czechowski maintains the BSD package of Latex-Suite. Lots of valuable + feedback. +Lubomir Host provided the diacritics and also helped in development. +Alexander Wagner valuable suggestions during development. +Luc Hermitte his variation of Stephen Riehm's bracketing system is used + in Latex-Suite. +Gergely Kontra the clever little JumpFunc() in imaps.vim is due to him. + The implementation of the templates also borrows from + mu-template.vim by him. +Dimitri Antoniou author of ltags and also provided the nice tip about + forward / reverse search on DVI documents. +Stephen Riehm the extremely helpful bracketing system is from him. +Alan Schmitt provided macros/folding elements. Continued feedback, + bug-reports/fixes. +Hari Krishna Dara for ExecMap(), the clever little function which makes + typing visual mode mappings so much easier and error-free. +Alan G Isac for the comprehensive BibT() function for entering bibtex + entries. +Gontran Baerts for libList.vim +Peter Heslin useful discussion and also a lot of bug fixes. the + %%fakesection in folding.vim. +Zhang Lin-bo lots of very useful additions to folding. The code for + customizing the folding scheme is due to him. + +A large number of functions in Latex-Suite come from various other people. Some +of those people might have been missed here. Each function should however have +the author's name/e-mail above it. Thats the more authoritative place to check +out who has done what. + + *latex-suite-maintainer* *ls_a_eC* +The current maintainer(s) of Latex-Suite is(are) + + +Srinath Avadhanula <srinath@fastmail.fm> + +Mikolaj Machowski <mikmach@wp.pl> + +Benji Fisher <benji@member.AMS.org> + +================================================================================ +URLs used in this file + +*ls_u_1* : http://vim-latex.sourceforge.net +*ls_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download +*ls_u_3* : http://www.cygwin.com +*ls_u_4* : http://www.google.com/search?q=windows%20gnu%20grep + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','') +================================================================================ diff --git a/dot_vim/doc/latexhelp.txt b/dot_vim/doc/latexhelp.txt new file mode 100644 index 0000000..2782424 --- /dev/null +++ b/dot_vim/doc/latexhelp.txt @@ -0,0 +1,2430 @@ +*latexhelp.txt* For Vim version 6.0. Last change: 2001 Dec 20 + + + LATEX HELP 1.6 + translated (with minor changes) for vim + by Mikolaj Machowski + +This file documents LaTeX2e, a document preparation system. LaTeX2e is a +macro package for TeX. + + This is edition 1.6 of the LaTeX2e documentation, and is for the Texinfo +that is distributed as part of Version 19 of GNU Emacs. It uses version +2.134 or later of the texinfo.tex input file. + + This is translated from LATEX.HLP v1.0a in the VMS Help Library. The +pre-translation version was written by George D. Greenwade of Sam Houston +State University. + + The LaTeX 2.09 version was written by Stephen Gilmore <stg@dcs.ed.ac.uk>. + + The LaTeX2e version was adapted from this by Torsten Martinsen +<bullestock@dk-online.dk>. + + Version for vim of this manual was written by Mikolaj Machowski +<mikmach@wp.pl> + + Copyright 1988,1994 Free Software Foundation, Inc. Copyright 1994-1996 +Torsten Martinsen. Copyright for `translation' for vim Mikolaj Machowski 2001. + + Permission is granted to make and distribute verbatim copies of this manual +provided the copyright notice and this permission notice are preserved on +all copies. + + Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + + Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that the sections entitled "Distribution" and "General Public +License" may be included in a translation approved by the author instead of +in the original English. + +============================================================================== +*LaTeX* *latex* + +The LaTeX command typesets a file of text using the TeX program and the LaTeX +Macro package for TeX. To be more specific, it processes an input file +containing the text of a document with interspersed commands that describe how +the text should be formatted. + +1. Commands |latex-commands| +2. Counters |latex-counters| +3. Cross References |latex-references| +4. Definitions |latex-definitions| +5. Document Classes |latex-classes| +6. Layout |latex-layout| +7. Environments |latex-environments| +8. Footnotes |latex-footnotes| +9. Lengths |latex-lengths| +10. Letters |latex-letters| +11. Line & Page Breaking |latex-breaking| +12. Making Paragraphs |latex-paragraphs| +13. Margin Notes |latex-margin-notes| +14. Math Formulae |latex-math| +15. Modes |latex-modes| +16. Page Styles |latex-page-styles| +17. Sectioning |latex-sectioning| +18. Spaces & Boxes |latex-spaces-boxes| +19. Special Characters |latex-special-char| +20. Splitting the Input |latex-inputting| +21. Starting & Ending |latex-start-end| +22. Table of Contents |latex-toc| +23. Terminal Input/Output |latex-terminal| +24. Typefaces |latex-typefaces| +25. Parameters |latex-parameters| + +============================================================================== +1. Commands *latex-commands* + +A LaTeX command begins with the command name, which consists of a \ followed +by either + (a) a string of letters or + (b) a single non-letter. + +Arguments contained in square brackets, [], are optional while arguments +contained in braces, {}, are required. + +NOTE: LaTeX is case sensitive. Enter all commands in lower case unless +explicitly directed to do otherwise. + +============================================================================== +2. Counters *latex-counters* + +|\addtocounter| Add a quantity to a counter +|\alph| Print value of a counter using letters +|\arabic| Print value of a counter using numerals +|\fnsymbol| Print value of a counter using symbols +|\newcounter| Define a new counter +|\refstepcounter| Add to counter, resetting subsidiary counters +|\roman| Print value of a counter using roman numerals +|\setcounter| Set the value of a counter +|\stepcounter| Add to counter, resetting subsidiary counters +|\usecounter| Use a specified counter in a list environment +|\value| Use the value of a counter in an expression + +Everything LaTeX numbers for you has a counter associated with it. The name of +the counter is the same as the name of the environment or command that +produces the number, except with no |\\|. (|lc-enumi| - |lc-enumiv| are used +for the nested |\enumerate| environment.) Below is a list of the counters +used in LaTeX's standard document classes to control numbering. + + |part| |paragraph| |figure| |enumi| |itemi| + |chapter| |subparagraph| |table| |enumii| |itemii| + |section| |page| |footnote| |enumiii| |itemiii| + |subsection| |equation| |mpfootnote| |enumiv| |itemiv| + |subsubsection| + + +\addtocounter{counter}{value} *\addtocounter* + Increments the {counter} by the amount specified by the + {value} argument. The {value} argument can be negative. + +\alph{counter} *\alph* *\Alph* +\Alph{counter} + This command causes the value of the counter to be printed in + alphabetic characters. |\alph| command uses lower case + alphabetic alphabetic characters, i.e., a, b, c... while the + |\Alph| command uses upper case alphabetic characters, i.e., + A, B, C.... + +\arabic{counter} *\arabic* + Causes the value of the {counter} to be printed in Arabic + numbers, i.e., 3. + +\fnsymbol{counter} *\fnsymbol* + Causes the value of the {counter} to be printed in a specific + sequence of nine symbols that can be used for numbering + footnotes. + Note: counter must have a value between 1 and 9 inclusive. + +\newcounter{foo}[counter] *\newcounter* + Defines a new counter named {foo}. The counter is initialized + to zero. The optional argument [counter] causes the counter + {foo} to be reset whenever the counter named in the optional + argument is incremented. + +\refstepcounter{counter} *\refstepcounter* + Command works like |\stepcounter|, except it also defines the + current |\ref| value to be the result of \thecounter. + +\roman{counter} *\roman* *\Roman* +\Roman{counter} + Causes the value of the {counter} to be printed in Roman + numerals. The |\roman| command uses lower case Roman numerals, + i.e., i, ii, iii..., while the |\Roman| command uses upper case + Roman numerals, i.e., I, II, III.... + +\stepcounter{counter} *\stepcounter* + Adds one to the {counter} and resets all subsidiary counters. + +\setcounter{counter}{value} *\setcounter* + Sets the value of the {counter} to that specified by the + {value} argument. + +\usecounter{counter} *\usecounter* + Command is used in the second argument of the |list| + environment to allow the {counter} specified to be used to + number the list items. + +\value{counter} *\value* + Produces the value of the {counter} named in the mandatory + argument. It can be used where LaTeX expects an integer or + number, such as the second argument of a |\setcounter| or + |\addtocounter| command, or in: > + \hspace{\value{foo}\parindent} +< It is useful for doing arithmetic with counters. + +============================================================================== +3. Cross References *latex-references* + +One reason for numbering things like figures and equations is to refer the +reader to them, as in "See Figure 3 for more details." + +|\label| Assign a symbolic name to a piece of text +|\pageref| Refer to a page number +|\ref| Refer to a section, figure or similar + + +\label{key} *\label* + Command appearing in ordinary text assigns to the {key} the + number of the current sectional unit; one appearing inside a + numbered environment assigns that number to the {key}. + + A {key} can consist of any sequence of letters, digits, or + punctuation characters. Upper and lowercase letters are + different. + + To avoid accidentally creating two labels with the same name, + it is common to use labels consisting of a prefix and a suffix + separated by a colon. The prefixes conventionally used are + * 'cha' for chapters + * 'sec' for lower-level sectioning commands + * 'fig' for figures + * 'tab' for tables + * 'eq' for equations + Thus, a label for a figure would look like: > + \label{fig:bandersnatch} + +\pageref{key} *\pageref* + Command produces the page number of the place in the text + where the corresponding |\label| command appears. ie. where + \label{key} appears. + +\ref{key} *\ref* + Command produces the number of the sectional unit, equation + number, ... of the corresponding |\label| command. + +============================================================================== +4. Definitions *latex-definitions* + +|\newcommand| Define a new command +|\newenvironment| Define a new environment +|\newtheorem| Define a new theorem-like environment +|\newfont| Define a new font name + + +\newcommand{cmd}[args]{definition} *\newcommand* *\renewcommand* +\newcommand{cmd}[args][default]{definition} +\renewcommand{cmd}[args]{definition} +\renewcommand{cmd}[args][default]{definition} + +These commands define (or redefine) a command. + +{cmd} A command name beginning with a |\\|. For |\newcommand| it must + not be already defined and must not begin with |\end|; for + |\renewcommand| it must already be defined. + +{args} An integer from 1 to 9 denoting the number of arguments of the + command being defined. The default is for the command to have + no arguments. + +{default} If this optional parameter is present, it means that the + command's first argument is optional. The default value of the + optional argument is default. + +{definition} The text to be substituted for every occurrence of {cmd}; a + parameter of the form #n in {cmd} is replaced by the text of + the nth argument when this substitution takes place. + + *\newenvironment* *\renewenvironment* +\newenvironment{nam}[args]{begdef}{enddef} +\newenvironment{nam}[args][default]{begdef}{enddef} +\renewenvironment{nam}[args]{begdef}{enddef} + +These commands define or redefine an environment. + +{nam} The name of the environment. For |\newenvironment| there must + be no currently defined environment by that name, and the + command \nam must be undefined. For |\renewenvironment| the + environment must already be defined. + +{args} An integer from 1 to 9 denoting the number of arguments of + the newly-defined environment. The default is no arguments. + +{default} If this is specified, the first argument is optional, and + default gives the default value for that argument. + +{begdef} The text substituted for every occurrence of \begin{nam}; a + parameter of the form #n in {cmd} is replaced by the text of + the nth argument when this substitution takes place. + +{enddef} The text substituted for every occurrence of \end{nam}. It + may not contain any argument parameters. + + +\newtheorem{envname}{caption}[within] *\newtheorem* +\newtheorem{envname}[numberedlike]{caption} + +This command defines a theorem-like environment. + +{envname} The name of the environment to be defined. A string of + letters. It must not be the name of an existing environment or + counter. + +{caption} The text printed at the beginning of the environment, right + before the number. This may simply say "Theorem", for example. + +{within} The name of an already defined counter, usually of a sectional + unit. Provides a means of resetting the new theorem counter + within the sectional unit. + +{numberedlike} The name of an already defined theorem-like environment. + +The |\newtheorem| command may have at most one optional argument. + + +\newfont{cmd}{fontname} *\newfont* + Defines the command name {cmd}, which must not be currently + defined, to be a declaration that selects the font named + {fontname} to be the current font. + +============================================================================== +5. Document Classes *latex-classes* + + +\documentclass[options]{class} *\documentclass* + +Valid LaTeX document classes include: + *article *article-class* + *report *report-class* + *letter *letter-class* + *book *book-class* + *slides *slides-class* + +All the standard classes (except slides) accept the following options for +selecting the typeface size (10 pt is default): + +10pt, 11pt, 12pt + +All classes accept these options for selecting the paper size (default is +letter): + +a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper + +Miscellaneous options: + +landscape *landscape* + Selects landscape format. Default is portrait. + +titlepage, notitlepage *notitlepage* + Selects if there should be a separate title page. + +leqno *leqno* *rqno* + Equation number on left side of equations. Default is + right side. + +fleqn *fleqn* + Displayed formulas flush left. Default is centred. + +openbib *openbib* + Use "open" bibliography format. + +draft, final *draft* *final* + Mark/do not mark overfull boxes with a rule. Default is + final. + +These options are not available with the slides class: + +oneside, twoside *oneside* *twoside* + Selects one- or twosided layout. Default is oneside, + except for the book class. + +openright, openany *openright* *openany* + Determines if a chapter should start on a right-hand page. + Default is openright for book. + +onecolumn, twocolumn *onecolumn* *twocolumn* + One or two columns. Defaults to one column. + +The slides class offers the option clock for printing the time at the bottom +of each |\note|. + +If you specify more than one option, they must be separated by a comma. + +\usepackage[options]{pkg} *\usepackage* + Additional packages are loaded by this. If you + specify more than one package, they must be separated by a + comma. + +Any options given in the |\documentclass| command that are unknown by the +selected document class are passed on to the packages loaded with |\usepackage|. + +============================================================================== +6. Layout *latex-layout* + +Miscellaneous commands for controlling the general layout of the page. + +|\flushbottom| Make all text pages the same height. +|\onecolumn| Use one-column layout. +|\raggedbottom| Allow text pages of differing height. +|\twocolumn| Use two-column layout. + +\flushbottom *\flushbottom* + Makes all text pages the same height, adding extra vertical + space when necessary to fill out the page. This is the + standard if twocolumn mode is selected. + +\onecolumn *\onecolumn* + Starts a new page and produces single-column output. + +\raggedbottom *\raggedbottom* + Makes all pages the height of the text on that page. No extra + vertical space is added. + +\twocolumn[text] *\twocolumn* + Starts a new page and produces two-column output. If the + optional [text] argument is present, it is typeset in + one-column mode. + +============================================================================== +7. Environments *latex-environments* + + *\begin* *\end* +LaTeX provides a number of different paragraph-making environments. Each +environment begins and ends in the same manner: > + + \begin{environment-name} + . + . + . + \end{environment-name} +< +a. |array| Math arrays +b. |center| Centred lines +c. |description| Labelled lists +d. |enumerate| Numbered lists +e. |eqnarray| Sequences of aligned equations +f. |equation| Displayed equation +g. |figure| Floating figures +h. |flushleft| Flushed left lines +i. |flushright| Flushed right lines +j. |itemize| Bulleted lists +k. |letter| Letters +l. |list| Generic list environment +m. |minipage| Miniature page +n. |picture| Picture with text, arrows, lines and circles +o. |quotation| Indented environment with paragraph indentation +p. |quote-l| Indented environment with no paragraph indentation +q. |tabbing| Align text arbitrarily +r. |table| Floating tables +s. |tabular| Align text in columns +t. |thebibliography| Bibliography or reference list +u. |theorem| Theorems, lemmas, etc +v. |titlepage| For hand crafted title pages +x. |verbatim| Simulating typed input +y. |verse| For poetry and other things + +============================================================================== + a. array *array* +> + \begin{array}{col1col2...coln} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{array} + +Math arrays are produced with the |array| environment. It has a single mandatory +argument describing the number of columns and the alignment within them. Each +column, coln, is specified by a single letter that tells how items in that row +should be formatted. + * c -- for centred + * l -- for flush left + * r -- for flush right +Column entries must be separated by an |&|. Column entries may include other +LaTeX commands. Each row of the array must be terminated with the string |\\|. + +Note that the |array| environment can only be used in |math-mode|, so normally +it is used inside an |equation| environment. + +============================================================================== +b. center *center* +> + \begin{center} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{center} + +The |\center| environment allows you to create a paragraph consisting of lines +that are centred within the left and right margins on the current page. Each +line must be terminated with the string |\\|. + +\centering *\centering* + This declaration corresponds to the |center| environment. This + declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. The text of a |figure| or |table| + can be centred on the page by putting a |\centering| command + at the beginning of the |figure| or |table| environment. + Unlike the |center| environment, the |\centering| command does + not start a new paragraph; it simply changes how LaTeX formats + paragraph units. To affect a paragraph unit's format, the + scope of the declaration must contain the blank line or |\end| + command (of an environment like |quote-l|) that ends the + paragraph unit. + +============================================================================== +c. description *description* +> + \begin{description} + \item [label] First item + \item [label] Second item + . + . + . + \end{description} + +The |description| environment is used to make labelled lists. The label is +bold face and flushed right. + +============================================================================== +d. enumerate *enumerate* +> + \begin{enumerate} + \item First item + \item Second item + . + . + . + \end{enumerate} + +The |enumerate| environment produces a numbered list. Enumerations can be +nested within one another, up to four levels deep. They can also be nested +within other paragraph-making environments. + +\item Each item of an enumerated list begins with an |\item| + command. There must be at least one |\item| command + within the environment. + +The |enumerate| environment uses the |\enumi| through |\enumiv| counters (see +section |latex-counters|). The type of numbering can be changed by redefining +\theenumi etc. + +============================================================================== +e. eqnarray *eqnarray* +> + \begin{eqnarray} + math formula 1 \\ + math formula 2 \\ + . + . + . + \end{eqnarray} + +The |eqnarray| environment is used to display a sequence of equations or +inequalities. It is very much like a three-column |array| environment, with +consecutive rows separated by |\\| and consecutive items within a row separated +by an |&|. + +\nonumber *\nonumber* + An equation number is placed on every line unless that + line has a |\nonumber| command. + +\lefteqn *\lefteqn* + The command |\lefteqn| is used for splitting long + formulas across lines. It typesets its argument in + display style flush left in a box of zero width. + +============================================================================== +f. equation *equation* +> + \begin{equation} + math formula + \end{equation} + +The |equation| environment centres your equation on the page and places the +equation number in the right margin. + +============================================================================== +g. figure *figure* +> + \begin{figure}[placement] + body of the figure + \caption{figure title} + \end{figure} + +Figures are objects that are not part of the normal text, and are usually +"floated" to a convenient place, like the top of a page. Figures will not be +split between two pages. + +The optional argument [placement] determines where LaTeX will try to place +your figure. There are four places where LaTeX can possibly put a float: + +h (Here) at the position in the text where the figure + environment appears. +t (Top) at the top of a text page. +b (Bottom) at the bottom of a text page. +p (Page of floats) on a separate float page, which is a page containing + no text, only floats. + +The standard |report-class| and |article-class| use the default placement +[tbp]. + +The body of the |figure| is made up of whatever text, LaTeX commands, etc. you +wish. + +The \caption command allows you to title your figure. + +============================================================================== +h. flushleft *flushleft* +> + \begin{flushleft} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{flushleft} + +The |flushleft| environment allows you to create a paragraph consisting of +lines that are flushed left, to the left-hand margin. Each line must be +terminated with the string |\\|. + +\raggedright *\raggedright* + This declaration corresponds to the |flushleft| environment. + This declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. Unlike the |flushleft| + environment, the |\raggedright| command does not start a new + paragraph; it simply changes how LaTeX formats paragraph + units. To affect a paragraph unit's format, the scope of the + declaration must contain the blank line or |\end| command (of + an environment like |quote-l|) that ends the paragraph unit. + +============================================================================== +i. flushright *flushright* +> + \begin{flushright} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{flushright} + +The |flushright| environment allows you to create a paragraph consisting of +lines that are flushed right, to the right-hand margin. Each line must be +terminated with the string |\\|. + +\raggedleft *\raggedleft* + This declaration corresponds to the |flushright| environment. + This declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. Unlike the |flushright| + environment, the |\raggedleft| command does not start a new + paragraph; it simply changes how LaTeX formats paragraph + units. To affect a paragraph unit's format, the scope of the + declaration must contain the blank line or |\end| command (of + an environment like |quote-l|) that ends the paragraph unit. + +============================================================================== +j. itemize *itemize* +> + \begin{itemize} + \item First item + \item Second item + . + . + . + \end{itemize} + +The |itemize| environment produces a "bulleted" list. Itemizations can be +nested within one another, up to four levels deep. They can also be nested +within other paragraph-making environments. + +\item *\item* + Each item of an itemized list begins with an |\item| command. + There must be at least one |\item| command within the + environment. + +The itemize environment uses the |\itemi| through |\itemiv| counters (see +section |latex-counters|). The type of numbering can be changed by redefining +\theitemi etc. + +============================================================================== +k. letter *\letter* + +This environment is used for creating letters. See section |latex-letters|. + +============================================================================== +l. list *list* + +The |list| environment is a generic environment which is used for defining many +of the more specific environments. It is seldom used in documents, but often +in macros. +> + \begin{list}{label}{spacing} + \item First item + \item Second item + . + . + . + \end{list} + +'label' The {label} argument specifies how items should be labelled. + This argument is a piece of text that is inserted in a box to + form the {label}. This argument can and usually does contain + other LaTeX commands. + +'spacing' The {spacing} argument contains commands to change the spacing + parameters for the |list|. This argument will most often be + null, i.e., {}. This will select all default spacing which + should suffice for most cases. + +============================================================================== +m. minipage *minipage* +> + \begin{minipage}[position]{width} + text + \end{minipage} + +The |minipage| environment is similar to a |\parbox| command. It takes the +same optional [position] argument and mandatory {width} argument. You may use +other paragraph-making environments inside a |minipage|. Footnotes in a +minipage environment are handled in a way that is particularly useful for +putting footnotes in figures or tables. A |\footnote| or |\footnotetext| +command puts the footnote at the bottom of the minipage instead of at the +bottom of the page, and it uses the |\mpfootnote| counter instead of the +ordinary footnote counter. See sections |latex-counters| and +|latex-footnotes|. + +NOTE: Don't put one |minipage| inside another if you are using footnotes; they +may wind up at the bottom of the wrong minipage. + +============================================================================== +n. picture *picture* +> + size position + \begin{picture}(width,height)(x offset,y offset) + . + . + picture commands + . + . + \end{picture} + +The |picture| environment allows you to create just about any kind of picture +you want containing text, lines, arrows and circles. You tell LaTeX where to +put things in the picture by specifying their coordinates. A coordinate is a +number that may have a decimal point and a minus sign -- a number like 5, 2.3 +or -3.1416. A coordinate specifies a length in multiples of the unit length +|\unitlength|, so if |\unitlength| has been set to 1cm, then the coordinate +2.54 specifies a length of 2.54 centimetres. You can change the value of +|\unitlength| anywhere you want, using the |\setlength| command, but strange +things will happen if you try changing it inside the |picture| environment. + +A position is a pair of coordinates, such as (2.4,-5), specifying the point +with x-coordinate 2.4 and y-coordinate -5. Coordinates are specified in the +usual way with respect to an origin, which is normally at the lower-left +corner of the |picture|. +Note that when a position appears as an argument, it is not enclosed in +braces; the parentheses serve to delimit the argument. + +The |picture| environment has one mandatory argument, which is a position. It +specifies the size of the picture. The environment produces a rectangular box +with width and height determined by this argument's x- and y-coordinates. + +The |picture| environment also has an optional position argument, following +the size argument, that can change the origin. (Unlike ordinary optional +arguments, this argument is not contained in square brackets.) The optional +argument gives the coordinates of the point at the lower-left corner of the +picture (thereby determining the origin). For example, if |\unitlength| has +been set to 1mm, the command: > + \begin{picture}(100,200)(10,20) +> +produces a picture of width 100 millimetres and height 200 millimetres, whose +lower-left corner is the point (10,20) and whose upper-right corner is +therefore the point (110,220). When you first draw a picture, you will omit +the optional argument, leaving the origin at the lower-left corner. If you +then want to modify your picture by shifting everything, you just add the +appropriate optional argument. + +The environment's mandatory argument determines the nominal size of the +picture. This need bear no relation to how large the picture really is; LaTeX +will happily allow you to put things outside the picture, or even off the +page. The picture's nominal size is used by LaTeX in determining how much room +to leave for it. + +Everything that appears in a picture is drawn by the |\put| command. The +command: > + \put (11.3,-.3){...} + +puts the object specified by ... in the picture, with its +reference point at coordinates (11.3,-.3). The reference points for various +objects will be described below. + +The |\put| creates an LR box (|lrbox|). You can put anything in the text +argument of the |\put| that you'd put into the argument of an |\mbox| and +related commands. When you do this, the reference point will be the lower left +corner of the box. + +Picture commands: +|\circle| Draw a circle +|\dashbox| Draw a dashed box +|\frame| Draw a frame around an object +|\framebox(picture)| Draw a box with a frame around it +|\line| Draw a straight line +|\linethickness| Set the line thickness +|\makebox(picture)| Draw a box of the specified size +|\multiput| Draw multiple instances of an object +|\oval| Draw an ellipse +|\put| Place an object at a specified place +|\shortstack| Make a pile of objects +|\vector| Draw a line with an arrow + +\circle[*]{diameter} *\circle* + Command produces a circle with a {diameter} as close to the + specified one as possible. If the *-form of the command is + used, LaTeX draws a solid circle. + Note: only circles up to 40 pt can be drawn. + + +\dashbox{dashlength}(width,height){...} *\dashbox* + Draws a box with a dashed line. The |\dashbox| has an extra + argument which specifies the width of each dash. A dashed box + looks best when the width and height are multiples of the + {dashlength}. + +\frame{...} *\frame* + Puts a rectangular frame around the object specified in the + argument. The reference point is the bottom left corner of the + frame. No extra space is put between the frame and the object. + +\framebox(width,height)[position]{...} *\picture-framebox* + The |\framebox| command is exactly the same as the + |picture-makebox| command, except that it puts a frame around + the outside of the box that it creates. The |\framebox| + command produces a rule of thickness |\fboxrule|, and leaves a + space |\fboxsep| between the rule and the contents of the box. + +\line(x slope,y slope){length} *\line* + Draws a line of the specified length and slope. + Note: LaTeX can only draw lines with slope = x/y, where x and + y have integer values from -6 through 6. + +\linethickness{dimension} *\linethickness* + Declares the thickness of horizontal and vertical lines in a + |picture| environment to be dimension, which must be a + positive length. It does not affect the thickness of slanted + lines (|\line|) and circles (|circle|), or the quarter circles + drawn by |\oval| to form the corners of an oval. + +\makebox(width,height)[position]{...} *picture-makebox* + The makebox command for the |picture| environment is similar + to the normal |\makebox| command except that you must specify + a width and height in multiples of |\unitlength|. + The optional argument, [position], specifies the quadrant that + your text appears in. You may select up to two of the + following: + t - Moves the item to the top of the rectangle + b - Moves the item to the bottom + l - Moves the item to the left + r - Moves the item to the right + + *\multiput* +\multiput(x coord,y coord)(delta x,delta y){no of copies}{object} + This command can be used when you are putting the same + object in a regular pattern across a picture. + +\oval(width,height)[portion] *\oval* + Produces a rectangle with rounded corners. The optional + argument, [portion], allows you to select part of the oval. + t - top portion + b - bottom portion + r - right portion + l - left portion + Note: the "corners" of the oval are made with quarter circles + with a maximum radius of 20 pt, so large "ovals" will look + more like boxes with rounded corners. + +\put(x coord,y coord){ ... } *\put* + Places the item specified by the mandatory argument at the + given coordinates. + +\shortstack[position]{... \\ ... \\ ...} *\shortstack* + The |\shortstack| command produces a stack of objects. + The valid positions are: + r - right of the stack + l - left of the stack + c - centre of the stack (default) + +\vector(x slope,y slope){length} *\vector* + Draws a line with an arrow of the specified length and slope. + The x and y values must lie between -4 and +4, inclusive. + +============================================================================== +o. quotation *quotation* + > + \begin{quotation} + text + \end{quotation} + +The margins of the |quotation| environment are indented on the left and the +right. The text is justified at both margins and there is paragraph +indentation. Leaving a blank line between text produces a new paragraph. + +============================================================================== +p. quote *quote-l* +> + \begin{quote} + text + \end{quote} + +The margins of the |quote-l| environment are indented on the left and the right. +The text is justified at both margins. Leaving a blank line between text +produces a new paragraph. + +============================================================================== +q. tabbing *tabbing* +> + \begin{tabbing} + text \= more text \= still more text \= last text \\ + second row \> \> more \\ + . + . + . + \end{tabbing} + +The |tabbing| environment provides a way to align text in columns. It works by +setting tab stops and tabbing to them much the way you do with an ordinary +typewriter. + +It is best suited for cases where the width of each column is constant and +known in advance. + +This environment can be broken across pages, unlike the |tabular| environment. +The following commands can be used inside a tabbing environment: + + *tab=* +\= Sets a tab stop at the current position. + + *tab>* +\> Advances to the next tab stop. + + *tab<* +\< This command allows you to put something to the left of the + local margin without changing the margin. Can only be used at + the start of the line. + + *tab+* +\+ Moves the left margin of the next and all the following + commands one tab stop to the right. + + *tab-* +\- Moves the left margin of the next and all the following + commands one tab stop to the left. + + *tab'* +\' Moves everything that you have typed so far in the current + column, i.e. everything from the most recent \> (|tab>|), \< + (|tab<|), \' (|tab'|), |\\|, or |\kill| command, to the right + of the previous column, flush against the current column's tab + stop. + + *tab`* +\` Allows you to put text flush right against any tab stop, + including tab stop 0. However, it can't move text to the right + of the last column because there's no tab stop there. The \` + (|tab`|) command moves all the text that follows it, up to the + |\\| or \end{tabbing} command that ends the line, to the right + margin of the tabbing environment. There must be no \> + (|tab>|) or \' (|tab'|) command between the \` (|tab`|) and + the command that ends the line. + + *\kill* +\kill Sets tab stops without producing text. Works just like |\\| + except that it throws away the current line instead of + producing output for it. The effect of any \= (|tab=|), \+ + (|tab+|) or \- (|tab-|) commands in that line remain in + effect. + + *\pushtabs* +\pushtabs Saves all current tab stop positions. Useful for temporarily + changing tab stop positions in the middle of a tabbing + environment. Also restores the tab stop positions saved by the + last |\pushtabs|. + + *taba* +\a In a tabbing environment, the commands \= (|tab=|), \' + (|tab'|) and \` (|tab`|) do not produce accents as normal. + Instead, the commands \a=, \a' and \a` are used. + +This example typesets a Pascal function in a traditional format: +> + \begin{tabbing} + function \= fact(n : integer) : integer;\\ + \> begin \= \+ \\ + \> if \= n $>$ 1 then \+ \\ + fact := n * fact(n-1) \- \\ + else \+ \\ + fact := 1; \-\- \\ + end;\\ + \end{tabbing} + +============================================================================== +r. table *\table* +> + \begin{table}[placement] + body of the table + \caption{table title} + \end{table} + +Tables are objects that are not part of the normal text, and are usually +"floated" to a convenient place, like the top of a page. Tables will not be +split between two pages. + +The optional argument [placement] determines where LaTeX will try to place +your table. There are four places where LaTeX can possibly put a float: + + h (Here) at the position in the text where the table + environment appears. + t (Top) at the top of a text page. + b (Bottom) at the bottom of a text page. + p (Page of floats) on a separate float page, which is a page + containing no text, only floats. + +The standard |report-class| and |article-class| use the default placement [tbp]. + +The body of the table is made up of whatever text, LaTeX commands, etc., you +wish. + +The \caption command allows you to title your table. + +============================================================================== +s. tabular *tabular* +> + \begin{tabular}[pos]{cols} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{tabular} + +or +> + \begin{tabular*}{width}[pos]{cols} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{tabular*} + +These environments produce a box consisting of a sequence of rows of items, +aligned vertically in columns. The mandatory and optional arguments consist +of: + +{width} Specifies the width of the tabular* environment. There must be + rubber space between columns that can stretch to fill out the + specified width. + +[pos] Specifies the vertical position; default is alignment on the + centre of the environment. + t - align on top row + b - align on bottom row + +{cols} Specifies the column formatting. It consists of a sequence of + the following specifiers, corresponding to the sequence of + columns and intercolumn material. + l - A column of left-aligned items. + + r - A column of right-aligned items. + + c - A column of centred items. + + | - A vertical line the full height and depth of the + environment. + + @{text} - This inserts text in every row. An @-expression + suppresses the intercolumn space normally inserted + between columns; any desired space between the + inserted text and the adjacent items must be included + in text. An \extracolsep{wd} command in an + @-expression causes an extra space of width {wd} to + appear to the left of all subsequent columns, until + countermanded by another |\extracolsep| command. Unlike + ordinary intercolumn space, this extra space is not + suppressed by an @-expression. An |\extracolsep| + command can be used only in an @-expression in the + cols argument. + + p{wd} - Produces a column with each item typeset in a |\parbox| + of width {wd}, as if it were the argument of a + \parbox[t]{wd} command. However, a |\\| may not appear + in the item, except in the following situations: + 1. inside an environment like |minipage|, |array|, or + |tabular|. + 2. inside an explicit |\parbox|. + 3. in the scope of a |\centering|, |\raggedright|, or + |\raggedleft| declaration. The latter declarations must + appear inside braces or an environment when used in a + p-column element. + + {num}{cols} - Equivalent to num copies of cols, where num is any positive + integer and cols is any list of column-specifiers, + which may contain another -expression. + +These commands can be used inside a tabular environment: + +|\cline| Draw a horizontal line spanning some columns. +|\hline| Draw a * horizontal line spanning all columns. +|\multicolumn| Make an item spanning * several columns. +|\vline| Draw a vertical line. + + +\cline{i-j} *\cline* + The |\cline| command draws horizontal lines across the columns + specified, beginning in column i and ending in column j, + which are identified in the mandatory argument. + +\hline *\hline* + The |\hline| command will draw a horizontal line the width of + the table. It's most commonly used to draw a line at the top, + bottom, and between the rows of the table. + +\multicolumn{cols}{pos}{text} *\multicolumn* + The |\multicolumn| is used to make an entry that spans several + columns. The first mandatory argument, {cols}, specifies the + number of columns to span. The second mandatory argument, + {pos}, specifies the formatting of the entry: + c - centered + l - flushleft + r - flushright. + The third mandatory argument, {text}, specifies what text is + to make up the entry. + +\vline *\vline* + The |\vline| command will draw a vertical line extending the + full height and depth of its row. An |\hfill| command can be + used to move the line to the edge of the column. It can also + be used in an @-expression. + +============================================================================== +t. thebibliography *\thebibliography* +> + \begin{thebibliography}{widestlabel} + \bibitem[label]{cite_key} + . + . + . + \end{thebibliography} + +The |\thebibliography| environment produces a bibliography or reference list. + +In the |article-class|, this reference list is labelled "References"; in the +|report-class|, it is labelled "Bibliography". + +{widestlabel} Text that, when printed, is approximately as wide as the + widest item label produces by the |\bibitem| commands. + +|\bibitem| Specify a bibliography item. +|\cite| Refer to a bibliography item. +|\nocite| Include an item in the bibliography. +|BibTeX| Automatic generation of bibliographies. + +\bibitem *\bibitem* +\bibitem[label]{citekey} + The |\bibitem| command generates an entry labelled by [label]. + If the [label] argument is missing, a number is generated as + the label, using the |\enumi| counter. The {citekey} is any + sequence of letters, numbers, and punctuation symbols not + containing a comma. This command writes an entry on the `.aux' + file containing {citekey} and the item's label. When this + `.aux' file is read by the \begin{document} command, the + item's label is associated with {citekey}, causing the + reference to {citekey} by a |\cite| command to produce the + associated label. + +\cite *\cite* +\cite[text]{keylist} + The {keylist} argument is a list of citation keys. This + command generates an in-text citation to the references + associated with the keys in {keylist} by entries on the `.aux' + file read by the \begin{document} command. + The optional text argument will appear after the + citation, i.e.: > + \cite[p.2]{knuth} +< might produce `[Knuth, p. 2]'. + +\nocite *\nocite* +\nocite{keylist} + The |\nocite| command produces no text, but writes + {keylist}, which is a list of one or more citation + keys, on the `.aux' file. + +BibTeX *BibTeX* *bibtex* + *\bibliographystyle* +If you use the BibTeX program by Oren Patashnik (highly recommended if you +need a bibliography of more than a couple of titles) to maintain your +bibliography, you don't use the |thebibliography| environment. Instead, you +include the lines: +> + \bibliographystyle{style} + \bibliography{bibfile} + +where {style} refers to a file style.bst, which defines how your citations +will look. The standard styles distributed with BibTeX are: + +{alpha} Sorted alphabetically. Labels are formed from name of author and year + of publication. +{plain} Sorted alphabetically. Labels are numeric. +{unsrt} Like plain, but entries are in order of citation. +{abbrv} Like plain, but more compact labels. + +In addition, numerous other BibTeX style files exist tailored to the demands +of various publications. + + *\bibliography* +The argument to |\bibliography| refers to the file bibfile.bib, which should +contain your database in BibTeX format. Only the entries referred to via +|\cite| and |\nocite| will be listed in the bibliography. + +============================================================================== +u. theorem *theorem* +> + \begin{theorem} + theorem text + \end{theorem} + +The |theorem| environment produces "Theorem x" in boldface followed by your +theorem text. + +============================================================================== +v. titlepage *titlepage* +> + \begin{titlepage} + text + \end{titlepage} + +The |titlepage| environment creates a title page, i.e. a page with no printed +page number or heading. It also causes the following page to be numbered page +one. Formatting the title page is left to you. The |\today| command comes in +handy for title pages. + +Note that you can use the |\maketitle| to produce a standard title page. + +============================================================================== +x. verbatim *verbatim* +> + \begin{verbatim} + text + \end{verbatim} + +The |verbatim| environment is a paragraph-making environment that gets LaTeX +to print exactly what you type in. It turns LaTeX into a typewriter with +carriage returns and blanks having the same effect that they would on a +typewriter. + +\verb *\verb* +\verb char literal_text char +\verb*char literal_text char + Typesets literal_text exactly as typed, including + special characters and spaces, using a typewriter |\tt| + type style. There may be no space between |\verb| or + |\verb|* and char (space is shown here only for + clarity). The *-form differs only in that spaces are + printed as `\verb*| |\'. + +============================================================================== +y. verse *verse* +> + \begin{verse} + text + \end{verse} + +The |verse| environment is designed for poetry, though you may find other uses +for it. + +The margins are indented on the left and the right. Separate the lines of each +stanza with |\\|, and use one or more blank lines to separate the stanzas. + +============================================================================== +8. Footnotes *latex-footnotes* + +Footnotes can be produced in one of two ways. They can be produced with one +command, the |\footnote| command. They can also be produced with two commands, +the |\footnotemark| and the |\footnotetext| commands. See the specific command for +information on why you would use one over the other. + +|\footnote| Insert a footnote +|\footnotemark| Insert footnote mark only +|\footnotetext| Insert footnote text only + +\footnote[number]{text} *\footnote* + Command places the numbered footnote text at the bottom of the + current page. The optional argument, number, is used to change + the default footnote number. This command can only be used in + outer paragraph mode; i.e., you cannot use it in sectioning + commands like |\chapter|, in |\figure|, |\table| or in a + |\tabular| environment. + +\footnotemark *\footnotemark* + Command puts the footnote number in the text. This command can + be used in inner paragraph mode. The text of the footnote is + supplied by the |\footnotetext| command. + This command can be used to produce several consecutive + footnote markers referring to the same footnote by using +> + \footnotemark[\value{footnote}] +< + after the first |\footnote| command. + +\footnotetext[number]{text} *\footnotetext* + Command produces the text to be placed at the bottom of the + page. This command can come anywhere after the |\footnotemark| + command. The |\footnotetext| command must appear in outer + paragraph mode. The optional argument, number, is used to + change the default footnote number. + +============================================================================== +9. Lengths *latex-lengths* + +A length is a measure of distance. Many LaTeX commands take a length as an +argument. + +|\newlength| Define a new length. +|\setlength| Set the value of a length. +|\addtolength| Add a quantity to a length. +|\settodepth| Set a length to the depth of something. +|\settoheight| Set a length to the height of something. +|\settowidth| Set a length to the width of something. +|pre-lengths| Lengths that are, like, predefined. + +\newlength{\gnat} *\newlength* + The |\newlength| command defines the mandatory argument, \gnat, + as a length command with a value of 0in. An error occurs if a + \gnat command already exists. + +\setlength{\gnat}{length} *\setlength* + The |\setlength| command is used to set the value of a \gnat + command. The {length} argument can be expressed in any terms + of length LaTeX understands, i.e., inches (in), millimetres + (mm), points (pt), etc. + +\addtolength{\gnat}{length} *\addtolength* + The |\addtolength| command increments a \gnat by the amount + specified in the {length} argument. It can be a negative + amount. + +\settodepth{\gnat}{text} *\settodepth* + The |\settodepth| command sets the value of a \gnat command + equal to the depth of the {text} argument. + +\settoheight{\gnat}{text} *\settoheight* + The |\settoheight| command sets the value of a \gnat command + equal to the height of the {text} argument. + +\settowidth{\gnat}{text} *\settowidth* + The |\settowidth| command sets the value of a \gnat command + equal to the width of the {text} argument. + +Predefined lengths *pre-lengths* + +\width *\width* +\height *\height* +\depth *\depth* +\totalheight *\totalheight* + These length parameters can be used in the arguments of the + box-making commands See section Spaces & Boxes. They specify + the natural width etc. of the text in the box. + \totalheight equals \height + \depth. + To make a box with the text stretched to double the natural + size, e.g., say: > + \makebox[2\width]{Get a stretcher} + +============================================================================== +10. Letters *latex-letters* + +You can use LaTeX to typeset letters, both personal and business. The letter +document class is designed to make a number of letters at once, although you +can make just one if you so desire. + +Your `.tex' source file has the same minimum commands as the other document +classes, i.e., you must have the following commands as a minimum: > + \documentclass{letter} + \begin{document} + ... + letters + ... + \end{document} + +Each letter is a letter environment, whose argument is the name and address of +the recipient. For example, you might have: > + \begin{letter} + {Mr. Joe Smith\\ + 2345 Princess St. \\ + Edinburgh, EH1 1AA} + ... + \end{letter} + +The letter itself begins with the |\opening| command. The text of the letter +follows. It is typed as ordinary LaTeX input. Commands that make no sense in +a letter, like |\chapter|, do not work. The letter closes with a |\closing| +command. + +After the closing, you can have additional material. The |\cc| command produces +the usual "cc: ...". There's also a similar |\encl| command for a list of +enclosures. With both these commands, use|\\| to separate the items. + +These commands are used with the letter class: +|\address| Your return address. +|\cc| Cc list. closing Saying goodbye. +|\encl| List of enclosed material. +|\location| Your organisation's address. +|\makelabels| Making address labels. +|\name| Your name, for the return address. +|\opening| Saying hello. +|\ps| Adding a postscript. +|\signature| Your signature. +|\startbreaks| Allow page breaks. +|\stopbreaks| Disallow page breaks. +|\telephone| Your phone number. + +\address{Return address} *\address* + The return address, as it should appear on the letter and the + envelope. Separate lines of the address should be separated + by |\\| commands. If you do not make an |\address| declaration, + then the letter will be formatted for copying onto your + organisation's standard letterhead. (See section Overview of + LaTeX and Local Guide, for details on your local + implementation). If you give an |\address| declaration, then + the letter will be formatted as a personal letter. + +\cc{Kate Schechter\\Rob McKenna} *\cc* + Generate a list of other persons the letter was sent to. Each + name is printed on a separate line. + +\closing{text} *\closing* + The letter closes with a |\closing| command, i.e., > + \closing{Best Regards,} \encl{CV\\Certificates} +< Generate a list of enclosed material. + +\location{address} *\location* + This modifies your organisation's standard address. This only + appears if the firstpage pagestyle is selected. + +\makelabels{number} *\makelabels* + If you issue this command in the preamble, LaTeX will create a + sheet of address labels. This sheet will be output before the + letters. + +\name{June Davenport} *\name* + Your name, used for printing on the envelope together with the + return address. + +\opening{text} *\opening* + The letter begins with the |\opening| command. The mandatory + argument, text, is whatever text you wish to start your + letter, i.e., > + \opening{Dear Joe,} + +\ps *\ps* + Use this command before a postscript. + +\signature{Harvey Swick} *\signature* + Your name, as it should appear at the end of the letter + underneath the space for your signature. Items that should go + on separate lines should be separated by |\\| commands. + +\startbreaks *\startbreaks* + Used after a |\stopbreaks| command to allow page breaks again. + +\stopbreaks *\stopbreaks* + Inhibit page breaks until a |\startbreaks| command occurs. + +\telephone{number} *\telephone* + This is your telephone number. This only appears if the + firstpage pagestyle is selected. + +============================================================================== +11. Line & Page Breaking *latex-breaking* + +The first thing LaTeX does when processing ordinary text is to translate your +input file into a string of glyphs and spaces. To produce a printed document, +this string must be broken into lines, and these lines must be broken into +pages. In some environments, you do the line breaking yourself with the |\\| +command, but LaTeX usually does it for you. + +|\\| Start a new line +|hyph-| Insert explicit hyphenation +|\cleardoublepage| Start a new right-hand page +|\clearpage| Start a new page +|\enlargethispage| Enlarge the current page a bit +|\fussy| Be fussy about line breaking +|\hyphenation| Tell LaTeX how to hyphenate a word +|\linebreak| Break the line +|\newline| Break the line prematurely +|\newpage| Start a new page +|\nolinebreak| Don't break the current line +|\nopagebreak| Don't make a page break here +|\pagebreak| Please make a page break here +|\sloppy| Be sloppy about line breaking + +\\[*][extraspace] *\\* *\\\\* + The |\\| command tells LaTeX to start a new line. It has an + optional argument, [extraspace], that specifies how much extra + vertical space is to be inserted before the next line. This + can be a negative amount. + The \\* command is the same as the ordinary |\\| command + except that it tells LaTeX not to start a new page after the + line. + +\- *hyph-* + The \- command tells LaTeX that it may hyphenate the word at + that point. LaTeX is very good at hyphenating, and it will + usually find all correct hyphenation points. The \- command is + used for the exceptional cases. + Note: when you insert \- commands in a word, the word will + only be hyphenated at those points and not at any of the + hyphenation points that LaTeX might otherwise have chosen. + +\cleardoublepage *\cleardoublepage* + The |\cleardoublepage| command ends the current page and causes + all figures and tables that have so far appeared in the input + to be printed. In a two-sided printing style (|twoside|), it + also makes the next page a right-hand (odd-numbered) page, + producing a blank page if necessary. + +\clearpage *\clearpage* + The |\clearpage| command ends the current page and causes all + figures and tables that have so far appeared in the input to + be printed. + +\enlargethispage{size} *\enlargethispage* +\enlargethispage*{size} + Enlarge the textheight for the current page by the + specified amount; e.g.: > + + \enlargethispage{\baselineskip} +< + will allow one additional line. The starred form + tries to squeeze the material together on the page as + much as possible. This is normally used together with + an explicit |\pagebreak|. + +\fussy *\fussy* + This declaration (which is the default) makes TeX more fussy + about line breaking. This can avoids too much space between + words, but may produce overfull boxes. This command cancels + the effect of a previous |\sloppy| command. + +\hyphenation{words} *\hyphenation* + The |\hyphenation| command declares allowed hyphenation points, + where words is a list of words, separated by spaces, in which + each hyphenation point is indicated by a - character. + +\linebreak[number] *\linebreak* + The |\linebreak| command tells LaTeX to break the current line + at the point of the command. With the optional argument, + number, you can convert the |\linebreak| command from a demand + to a request. The [number] must be a number from 0 to 4. The + higher the number, the more insistent the request is. The + |\linebreak| command causes LaTeX to stretch the line so it + extends to the right margin. + +\newline *\newline* + The |\newline| command breaks the line right where it is. It + can only be used in paragraph mode. + +\newpage *\newpage* + The |\newpage| command ends the current page. + +\nolinebreak[number] *\nolinebreak* + The |\nolinebreak| command prevents LaTeX from breaking the + current line at the point of the command. With the optional + argument, [number], you can convert the |\nolinebreak| command + from a demand to a request. The [number] must be a number from 0 + to 4. The higher the number, the more insistent the request + is. + +\nopagebreak[number] *\nopagebreak* + The |\nopagebreak| command prevents LaTeX from breaking the + current page at the point of the command. With the optional + argument, [number], you can convert the |\nopagebreak| command + from a demand to a request. The [number] must be a number from + 0 to 4. The higher the number, the more insistent the request + is. + +\pagebreak[number] *\pagebreak* + The |\pagebreak| command tells LaTeX to break the current page + at the point of the command. With the optional argument, + [number], you can convert the |\pagebreak| command from a + demand to a request. The [number] must be a number from 0 to + 4. The higher the number, the more insistent the request is. + +\sloppy *\sloppy* + This declaration makes TeX less fussy about line breaking. + This can prevent overfull boxes, but may leave too much space + between words. + Lasts until a |\fussy| command is issued. + +============================================================================== +12. Making Paragraphs *latex-paragraphs* + +A paragraph is ended by one or more completely blank lines -- lines not +containing even a |\%|. A blank line should not appear where a new paragraph +cannot be started, such as in math mode or in the argument of a sectioning +command. + +|\indent| Indent this paragraph. +|\noindent| Do not indent this paragraph. +|\par| Another way of writing a blank line. + +\indent *\indent* + This produces a horizontal space whose width equals the width + of the paragraph indentation. It is used to add paragraph + indentation where it would otherwise be suppressed. + +\noindent *\noindent* + When used at the beginning of the paragraph, it suppresses the + paragraph indentation. It has no effect when used in the + middle of a paragraph. + +\par *\par* + Equivalent to a blank line; often used to make command or + environment definitions easier to read. + +============================================================================== +13. Margin Notes *latex-margin-notes* + +\marginpar[left]{right} *\marginpar* + This command creates a note in the margin. The first line will + be at the same height as the line in the text where the + |\marginpar| occurs. + + When you only specify the mandatory argument {right}, the text + will be placed: + * in the right margin for one-sided layout + * in the outside margin for two-sided layout (|twoside|) + * in the nearest margin for two-column layout (|twocolumn|) + +\reversemarginpar *\reversemarginpar* + By issuing the command |\reversemarginpar|, you can force the + marginal notes to go into the opposite (inside) margin. + +When you specify both arguments, left is used for the left margin, and right +is used for the right margin. + +The first word will normally not be hyphenated; you can enable hyphenation by +prefixing the first word with a \hspace{0pt} command (|hspace|). + +============================================================================== +14. Math Formulae *latex-math* + *displaymath* +There are three environments (|latex-environments|) that put LaTeX in math +mode: +|math| For Formulae that appear right in the text. +|displaymath| For Formulae that appear on their own line. +|equation| The same as the displaymath environment except that it adds an + equation number in the right margin. + +The |math| environment can be used in both paragraph and LR mode, but the +|displaymath| and |equation| environments can be used only in paragraph mode. The +|math| and |displaymath| environments are used so often that they have the +following short forms: + \(...\) instead of \begin{math}...\end{math} + \[...\] instead of \begin{displaymath}...\end{displaymath} + +In fact, the math environment is so common that it has an even shorter form: + $ ... $ instead of \(...\) + +|sub-sup| Also known as exponent or index. +|math-symbols| Various mathematical squiggles. +|math-spacing| Thick, medium, thin and negative spaces. +|math-misc| Stuff that doesn't fit anywhere else. + +========== +Subscripts & Superscripts *sub-sup* + *subscripts* *superscripts* + +To get an expression exp to appear as a subscript, you just type _{exp}. To +get exp to appear as a superscript, you type ^{exp}. LaTeX handles +superscripted superscripts and all of that stuff in the natural way. It even +does the right thing when something has both a subscript and a superscript. + +========== +Math Symbols *math-symbols* + +LaTeX provides almost any mathematical symbol you're likely to need. The +commands for generating them can be used only in math mode. For example, if +you include > + $\pi$ +in your source, you will get the symbol in your output. + +========== +Spacing in Math Mode *math-spacing* + +In a math environment, LaTeX ignores the spaces you type and puts in the +spacing that it thinks is best. LaTeX formats mathematics the way it's done in +mathematics texts. If you want different spacing, LaTeX provides the following +four commands for use in math mode: + \; - a thick space *math;* + \: - a medium space *math:* + \, - a thin space *math,* + \! - a negative thin space *matn!* + +========== +Math Miscellany *math-misc* + +\cdots *\cdots* + Produces a horizontal ellipsis where the dots are raised to + the centre of the line. +\ddots *\ddots* + Produces a diagonal ellipsis. +\frac{num}{den} *\frac* + Produces the fraction num divided by den. +\ldots *\ldots* + Produces an ellipsis. This command works in any mode, not just + math mode. +\overbrace{text} *\overbrace* + Generates a brace over text. +\overline{text} *\overline* + Causes the argument text to be overlined. +\sqrt[root]{arg} *\sqrt* + Produces the square root of its argument. The optional + argument, [root], determines what root to produce, i.e., the + cube root of x+y would be typed as: > + $\sqrt[3]{x+y}$. +\underbrace{text} *\underbrace* + Generates text with a brace underneath. +\underline{text} *\underline* + Causes the argument text to be underlined. This command can + also be used in paragraph and LR mode. +\vdots *\vdots* + Produces a vertical ellipsis. + +============================================================================== +15. Modes *latex-modes* + +When LaTeX is processing your input text, it is always in one of three modes: + Paragraph mode *paragraph-mode* + Math mode *math-mode* + Left-to-right mode, called LR mode for short. *lr-mode* + +LaTeX changes mode only when it goes up or down a staircase to a different +level, though not all level changes produce mode changes. Mode changes occur +only when entering or leaving an environment, or when LaTeX is processing the +argument of certain text-producing commands. + +|paragraph-mode| is the most common; it's the one LaTeX is in when processing +ordinary text. In that mode, LaTeX breaks your text into lines and breaks the +lines into pages. LaTeX is in |math-mode| when it's generating a mathematical +formula. In |lr-mode|, as in |paragraph-mode|, LaTeX considers the output that +it produces to be a string of words with spaces between them. However, unlike +|paragraph-mode|, LaTeX keeps going from left to right; it never starts a new +line in |lr-mode|. Even if you put a hundred words into an |\mbox|, LaTeX would +keep typesetting them from left to right inside a single box, and then +complain because the resulting box was too wide to fit on the line. + +LaTeX is in |lr-mode| when it starts making a box with an |\mbox| command. You +can get it to enter a different mode inside the box - for example, you can +make it enter |math-mode| to put a formula in the box. There are also several +text-producing commands and environments for making a box that put LaTeX in +|paragraph-mode|. The box make by one of these commands or environments will be +called a |\parbox|. When LaTeX is in |paragraph-mode| while making a box, it is +said to be in "inner paragraph mode". Its normal |paragraph-mode|, which it +starts out in, is called "outer paragraph mode". + +============================================================================== +16. Page Styles *latex-page-styles* + +The |\documentclass| command determines the size and position of the page's head +and foot. The page style determines what goes in them. + +|\maketitle| Generate a title page. +|\pagenumbering| Set the style used for page numbers. +|\pagestyle| Change the headings/footings style. +|\thispagestyle| Change the headings/footings style for this page. + +\maketitle *\maketitle* + The |\maketitle| command generates a title on a separate title + page - except in the |\article| class, where the title normally + goes at the top of the first page. Information used to + produce the title is obtained from the following declarations: + + |\author| Who wrote this stuff? + |\date| The date the document was created. + |\thanks| A special form of footnote. + |\title| How to set the document title. + + \author{names} *\author* *\and* + The |\author| command declares the author(s), where + names is a list of authors separated by \and commands. + Use |\\| to separate lines within a single author's + entry -- for example, to give the author's institution + or address. + + \date{text} *\date* + The |\date| command declares text to be the document's + date. With no |\date| command, the current date is + used. + + \thanks{text} *\thanks* + The |\thanks| command produces a |\footnote| to the + title. + + \title{text} *\title* + The |\title| command declares text to be the title. Use + |\\| to tell LaTeX where to start a new line in a long + title. + +\pagenumbering{numstyle} *\pagenumbering* + Specifies the style of page numbers. Possible values of + 'numstyle' are: + arabic - Arabic numerals *arabic* + roman - Lowercase Roman numerals *roman* + Roman - Uppercase Roman numerals *Roman* + alph - Lowercase letters *alph* + Alph - Uppercase letters *Alph* + +\pagestyle{option} *\pagestyle* + *plain* *empty* *headings* + The |\pagestyle| command changes the style from the current + page on throughout the remainder of your document. + The valid options are: + plain - Just a plain page number. + empty - Produces empty heads and feet no page numbers. + headings - Puts running headings on each page. The document + style specifies what goes in the headings. + myheadings - You specify what is to go in the heading with the + |\markboth| or the |\markright| commands. + + |\markboth| Set left and right headings. + |\markright| Set right heading only. + + \markboth{left head}{right head} *\markboth* + The |\markboth| command is used in conjunction with the + page style myheadings for setting both the left and + the right heading. + Note that a "left-hand heading" is generated by the + last |\markboth| command before the end of the page, + while a "right-hand heading" is generated by the first + |\markboth| or |\markright| that comes on the page if + there is one, otherwise by the last one before the + page. + + + \markright{right head} *\markright* + The |\markright| command is used in conjunction with + the page style |\myheadings| for setting the right + heading, leaving the left heading unchanged. + Note that a "left-hand heading" is generated by the + last |\markboth| command before the end of the page, + while a "right-hand heading" is generated by the first + |\markboth| or |\markright| that comes on the page if + there is one, otherwise by the last one before the + page. + +\thispagestyle{option} *\thispagestyle* + The |\thispagestyle| command works in the same manner as the + |\pagestyle| command except that it changes the style for the + current page only. + +============================================================================== +17. Sectioning *latex-sectioning* + +Sectioning commands provide the means to structure your text into units. +|\part| +|\chapter| (report and book class only) +|\section| +|\subsection| +|\subsubsection| +|\paragraph| +|\subparagraph| + +All sectioning commands take the same general form, i.e., + + *\part* + *\chapter* (report and book class only) + *\section* *\subsection* *\subsubsection* + *\paragraph* *\subparagraph* +\chapter[optional]{title} + In addition to providing the heading in the text, the + mandatory argument of the sectioning command can appear in two + other places: + 1. The table of contents + 2. The running head at the top of the page. You may not want + the same thing to appear in these other two places as + appears in the text heading. To handle this situation, the + sectioning commands have an optional argument that provides + the text for these other two purposes. + +All sectioning commands have *\-forms that print a title, but do not include a +number and do not make an entry in the table of contents. + +\appendix *\appendix* + The |\appendix| command changes the way sectional units are + numbered. The |\appendix| command generates no text and does + not affect the numbering of parts. The normal use of this + command is something like: > + \chapter{The First Chapter} + ... + \appendix \chapter{The First Appendix} + + +============================================================================== +18. Spaces & Boxes *latex-spaces-boxes* + +All the predefined length parameters See section Predefined lengths can be +used in the arguments of the box-making commands. + + Horizontal space: + +|\dotfill| Stretchable horizontal dots. +|\hfill| Stretchable horizontal space. +|\hrulefill| Stretchable horizontal rule. +|\hspace| Fixed horizontal space. + + Vertical space: + +|\addvspace| Fixed vertical space. +|\bigskip| Fixed vertical space. +|\medskip| Fixed vertical space. +|\smallskip| Fixed vertical space. +|\vfill| Stretchable vertical space. +|\vspace| Fixed vertical space. + + Boxes: + +|\fbox| Framebox. +|\framebox| Framebox, adjustable position. +|\lrbox| An environment like |\sbox|. +|\makebox| Box, adjustable position. +|\mbox| Box. +|\newsavebox| Declare a name for saving a box. +|\parbox| Box with text in paragraph mode. +|\raisebox| Raise or lower text. +|\rule| Lines and squares. +|\savebox| Like |\makebox|, but save the text for later use. +|\sbox| Like |\mbox|, but save the text for later use. +|\usebox| Print saved text. + +Horizontal space: *latex-hor-space* + +LaTeX removes horizontal space that comes at the end of a line. If you don't +want LaTeX to remove this space, include the optional * argument. Then the +space is never removed. + +\dotfill *\dotfill* + The |\dotfill| command produces a "rubber length" that produces + dots instead of just spaces. + +\hfill *\hfill* + The |\hfill| fill command produces a "rubber length" which can + stretch or shrink horizontally. It will be filled with spaces. + +\hrulefill *\hrulefill* + The |\hrulefill| fill command produces a "rubber length" which + can stretch or shrink horizontally. It will be filled with a + horizontal rule. + +\hspace[*]{length} *\hspace* + The |\hspace| command adds horizontal space. The length of the + space can be expressed in any terms that LaTeX understands, + i.e., points, inches, etc. You can add negative as well as + positive space with an |\hspace| command. Adding negative space + is like backspacing. + + +Vertical space: *latex-ver-space* + +LaTeX removes vertical space that comes at the end of a page. If you don't +want LaTeX to remove this space, include the optional * argument. Then the +space is never removed. + +\addvspace{length} *\addvspace* + The |\addvspace| command normally adds a vertical space of + height length. However, if vertical space has already been + added to the same point in the output by a previous + |\addvspace| command, then this command will not add more space + than needed to make the natural length of the total vertical + space equal to length. + +\bigskip *\bigskip* + The |\bigskip| command is equivalent to \vspace{bigskipamount} + where bigskipamount is determined by the document class. + +\medskip *\medskip* + The |\medskip| command is equivalent to \vspace{medskipamount} + where medskipamount is determined by the document class. + +\smallskip *\smallskip* + The |\smallskip| command is equivalent to + \vspace{smallskipamount} where smallskipamount is determined + by the document class. + +\vfill *\vfill* + The |\vfill| fill command produces a rubber length which can + stretch or shrink vertically. + +\vspace[*]{length} *\vspace* + The |\vspace| command adds vertical space. The length of the + space can be expressed in any terms that LaTeX understands, + i.e., points, inches, etc. You can add negative as well as + positive space with an |\vspace| command. + + +Boxes: *latex-boxes* + +\fbox{text} *\fbox* + The |\fbox| command is exactly the same as the |\mbox| command, + except that it puts a frame around the outside of the box that + it creates. + +\framebox[width][position]{text} *\framebox* + The |\framebox| command is exactly the same as the |\makebox| + command, except that it puts a frame around the outside of the + box that it creates. + The |\framebox| command produces a rule of thickness + |\fboxrule|, and leaves a space |\fboxsep| between the rule and + the contents of the box. + +lrbox *\lrbox* +\begin{lrbox}{cmd} text \end{lrbox} + This is the environment form of |\sbox|. + The text inside the environment is saved in the box cmd, which + must have been declared with |\newsavebox|. + +\makebox[width][position]{text} *\makebox* + The |\makebox| command creates a box just wide enough to + contain the text specified. The width of the box is specified + by the optional [width] argument. The position of the text + within the box is determined by the optional [position] + argument. + c -- centred (default) + l -- flushleft + r -- flushright + s -- stretch from left to right margin. The text must + contain stretchable space for this to work. + See section |\picture-makebox|. + +\mbox{text} *\mbox* + The |\mbox| command creates a box just wide enough to hold the + text created by its argument. + Use this command to prevent text from being split across + lines. + +\newsavebox{cmd} *\newsavebox* + Declares {cmd}, which must be a command name that is not + already defined, to be a bin for saving boxes. + + +\parbox[position][height][innerpos]{width}{text} *\parbox* + A parbox is a box whose contents are created in + |\paragraph-mode|. The |\parbox| has two + + Mandatory arguments: +'width' specifies the width of the parbox +'text' the text that goes inside the parbox. + + Optional arguments: +'position' LaTeX will position a parbox so its centre lines up with the + centre of the text line. The optional position argument allows + you to line up either the top or bottom line in the parbox + (default is top). + +'height' If the height argument is not given, the box will have the + natural height of the text. + +'innerpos' The inner-pos argument controls the placement of the text + inside the box. If it is not specified, position is used. + t -- text is placed at the top of the box + c -- text is centred in the box + b -- text is placed at the bottom of the box + s -- stretch vertically. The text must contain + vertically stretchable space for this to work. + + A |\parbox| command is used for a parbox containing a small + piece of text, with nothing fancy inside. In particular, you + shouldn't use any of the paragraph-making environments inside + a |\parbox| argument. For larger pieces of text, including ones + containing a paragraph-making environment, you should use a + |\minipage| environment. + +\raisebox{distance}[extendabove][extendbelow]{text} *\raisebox* + The |\raisebox| command is used to raise or lower text. The + first mandatory argument specifies how high the text is to be + raised (or lowered if it is a negative amount). The text + itself is processed in LR mode. + Sometimes it's useful to make LaTeX think something has a + different size than it really does - or a different size than + LaTeX would normally think it has. The |\raisebox| command + lets you tell LaTeX how tall it is. + The first optional argument, extend-above, makes LaTeX think + that the text extends above the line by the amount specified. + The second optional argument, extend-below, makes LaTeX think + that the text extends below the line by the amount specified. + +\rule[raiseheight]{width}{thickness} *\rule* + The |\rule| command is used to produce horizontal lines. The + arguments are defined as follows: +'raiseheight' specifies how high to raise the rule (optional) +'width' specifies the length of the rule (mandatory) +'thickness' specifies the thickness of the rule (mandatory) + +\savebox{cmd}[width][pos]{text} *\savebox* + This command typeset text in a box just as for |\makebox|. + However, instead of printing the resulting box, it saves it in + bin cmd, which must have been declared with |\newsavebox|. + +\sbox{text} *\sbox* + This commands typeset text in a box just as for |\mbox|. + However, instead of printing the resulting box, it saves it in + bin cmd, which must have been declared with |\newsavebox|. + +\usebox{cmd} *\usebox* + Prints the box most recently saved in bin cmd by a |\savebox| + command. + +============================================================================== +19. Special Characters *latex-special* + +The following characters play a special role in LaTeX and are called "special +printing characters", or simply "special characters". > + # $ % & ~ _ ^ \ { } +Whenever you put one of these special characters into your file, you are doing +something special. If you simply want the character to be printed just as any +other letter, include a \ in front of the character. For example, \$ will +produce $ in your output. + +One exception to this rule is the \ itself because |\\| has its own special +meaning. A \ is produced by typing $\backslash$ in your file. + +Also, \~ means `place a tilde accent over the following letter', so you will +probably want to use |\verb| instead. + *\symbol* +In addition, you can access any character of a font once you know its number +by using the |\symbol| command. For example, the character used for displaying +spaces in the |\verb|* command has the code decimal 32, so it can be typed as +\symbol{32}. + +You can also specify octal numbers with ' or hexadecimal numbers with ", so +the previous example could also be written as \symbol{'40} or \symbol{"20}. + +============================================================================== +20. Splitting the Input *latex-inputting* + +A large document requires a lot of input. Rather than putting the whole input +in a single large file, it's more efficient to split it into several smaller +ones. Regardless of how many separate files you use, there is one that is the +root file; it is the one whose name you type when you run LaTeX. + +|\include| Conditionally include a file +|\includeonly| Determine which files are included +|\input| Unconditionally include a file + +\include{file} *\include* + The \include command is used in conjunction with the + |\includeonly| command for selective inclusion of + files. The file argument is the first name of a file, + denoting `file.tex' . If file is one the file names in + the file list of the |\includeonly| command or if there + is no |\includeonly| command, the \include command is + equivalent to: > + \clearpage \input{file} \clearpage +< + except that if the file `file.tex' does not exist, + then a warning message rather than an error is + produced. If the file is not in the file list, the + \include command is equivalent to |\clearpage|. + + The |\include| command may not appear in the preamble or in a + file read by another |\include| command. + +\includeonly{filelist} *\includeonly* + The |\includeonly| command controls which files will be read in + by an |\include| command. {filelist} should be a + comma-separated list of filenames. Each filename must match + exactly a filename specified in a |\include| command. This + command can only appear in the preamble. + +\input{file} *\input* + The |\input| command causes the indicated file to be read and + processed, exactly as if its contents had been inserted in the + current file at that point. The file name may be a complete + file name with extension or just a first name, in which case + the file `file.tex' is used. +============================================================================== +21. Starting & Ending *latex-start-end* + +Your input file must contain the following commands as a minimum: +\documentclass{class} |\documentclass| +\begin{document} |\begin| +... your text goes here ... +\end{document} |\end| + +where the class selected is one of the valid classes for LaTeX. +See |\classes|for details of the various document classes. + +You may include other LaTeX commands between the |\documentclass| and the +\begin{document} commands (i.e., in the `preamble'). +============================================================================== +22. Table of Contents *latex-toc* + + *\tableofcontents* +A table of contents is produced with the |\tableofcontents| command. You put +the command right where you want the table of contents to go; LaTeX does the +rest for you. It produces a heading, but it does not automatically start a new +page. If you want a new page after the table of contents, include a |\newpage| +command after the |\tableofcontents| command. + + *\listoffigures* *\listoftables* +There are similar commands |\listoffigures| and |\listoftables| for producing a +list of figures and a list of tables, respectively. Everything works exactly +the same as for the table of contents. + + *\nofiles* +NOTE: If you want any of these items to be generated, you cannot have the +\nofiles command in your document. + +|\addcontentsline| Add an entry to table of contents etc. +|\addtocontents| Add text directly to table of contents file etc. + +\addcontentsline{file}{secunit}{entry} *\addcontentsline* + The |\addcontentsline| command adds an entry to the specified + list or table where: +{file} is the extension of the file on which information is to be + written: + toc (table of contents), + lof (list of figures), + lot (list of tables). +{secunit} controls the formatting of the entry. It should be one of the + following, depending upon the value of the file argument: + toc -- the name of the sectional unit, such as part or + subsection. + lof -- figure + lot -- table +{entry} is the text of the entry. + +\addtocontents{file}{text} *\addtocontents* + The |\addtocontents| command adds text (or formatting commands) + directly to the file that generates the table of contents or + list of figures or tables. +{file} is the extension of the file on which information is to be written: + toc (table of contents), + lof (list of figures), + lot (list of tables). +{text} is the information to be written. + +============================================================================== +23. Terminal Input/Output *latex-terminal* + +|\typein| Read text from the terminal. +|\typeout| Write text to the terminal. + +\typein[cmd]{msg} *\typein* + Prints {msg} on the terminal and causes LaTeX to stop and wait + for you to type a line of input, ending with return. If the + [cmd] argument is missing, the typed input is processed as if + it had been included in the input file in place of the + |\typein| command. If the [cmd] argument is present, it must be + a command name. This command name is then defined or redefined + to be the typed input. + +\typeout{msg} *\typeout* + Prints {msg} on the terminal and in the `.log' file. Commands + in {msg} that are defined with |\newcommand| or |\renewcommand| + are replaced by their definitions before being printed. + + *\space* +LaTeX's usual rules for treating multiple spaces as a single space and +ignoring spaces after a command name apply to {msg}. A |\space| command in {msg} +causes a single space to be printed. A ^^J in {msg} prints a newline. + +============================================================================== +24. Typefaces *latex-typefaces* + +The typeface is specified by giving the "size" and "style". A typeface is also +called a "font". +|font-styles| Select roman, italics etc. +|font-size| Select point size. +|font-lowlevelcommands| Commands for wizards. + +Styles *font-styles* + +The following type style commands are supported by LaTeX. + +These commands are used like: > + \textit{italics text}. +The corresponding command in parenthesis is the "declaration form", which +takes no arguments. The scope of the declaration form lasts until the next +type style command or the end of the current group. + +The declaration forms are cumulative; i.e., you can say: > + \sffamily\bfseries +to get sans serif boldface. + +You can also use the environment form of the declaration forms; e.g.: > + \begin{ttfamily}...\end{ttfamily}. +< +\textrm (\rmfamily) *\textrm* *\rmfamily* + Roman + +\textit (\itshape) *\textit* *\itshape* *\emph* + Emphasis (toggles between |\textit| and |\textrm|). + +\textmd (\mdseries) *\textmd* *\mdseries* + Medium weight (default). The opposite of boldface. + +\textbf (\bfseries) *\textbf* *\bfseries* + Boldface. + +\textup (\upshape) *\textup* *\upshape* + Upright (default). The opposite of slanted. + +\textsl (\slshape) *\textsl* *\slshape* + Slanted. + +\textsf (\sffamily) *\textsf* *\sffamily* + Sans serif. + +\textsc (\scshape) *\textsc* *\scshape* + Small caps. + +\texttt (\ttfamily) *\texttt* *\ttfamily* + Typewriter. + +\textnormal (\normalfont) *\textnormal* *\normalfont* + Main document font. + +\mathrm *\mathrm* + Roman, for use in math mode. + +\mathbf *\mathbf* + Boldface, for use in math mode. + +\mathsf *\mathsf* + Sans serif, for use in math mode. + +\mathtt *\mathtt* + Typewriter, for use in math mode. + +\mathit *\mathit* + Italics, for use in math mode, e.g. variable names with + several letters. + +\mathnormal *\mathnormal* + For use in math mode, e.g. inside another type style + declaration. + +\mathcal *\mathcal* + `Calligraphic' letters, for use in math mode. + + *\mathversion* +In addition, the command \mathversion{bold} can be used for switching to bold +letters and symbols in formulas. \mathversion{normal} restores the default. + +========== +Sizes *font-size* + +The following standard type size commands are supported by LaTeX. + +The commands as listed here are "declaration forms". The scope of the +declaration form lasts until the next type style command or the end of the +current group. + +You can also use the environment form of these commands; e.g. > + \begin{tiny}...\end{tiny} + +\tiny *\tiny* +\scriptsize *\scriptsize* +\footnotesize *\footnotesize* +\small *\small* +\normalsize(default) *\normalsize* +\large *\large* +\Large *\Large* +\LARGE *\LARGE* +\huge *\huge* +\Huge *\Huge* + +========== +Low-level font commands *font-lowlevelcommands* + +These commands are primarily intended for writers of macros and packages. The +commands listed here are only a subset of the available ones. For full +details, you should consult Chapter 7 of The LaTeX Companion. + +\fontencoding{enc} *\fontencoding* + Select font encoding. Valid encodings include OT1 and T1. + +\fontfamily{family} *\fontfamily* + Select font family. Valid families include: + cmr for Computer Modern Roman + cmss for Computer Modern Sans Serif + cmtt for Computer Modern Typewriter + and numerous others. + +\fontseries{series} *\fontseries* + Select font series. Valid series include: + m Medium (normal) + b Bold + c Condensed + bc Bold condensed + bx Bold extended + and various other combinations. + +\fontshape{shape} *\fontshape* + Select font shape. Valid shapes are: + n Upright (normal) + it Italic + sl Slanted (oblique) + sc Small caps + ui Upright italics + ol Outline + The two last shapes are not available for most font families. + +\fontsize{size}{skip} *\fontsize* + Set font size. The first parameter is the font size to switch + to; the second is the \baselineskip to use. The unit of both + parameters defaults to pt. A rule of thumb is that the + baselineskip should be 1.2 times the font size. + +\selectfont *\selectfont* + The changes made by calling the four font commands described + above do not come into effect until |\selectfont| is called. + +\usefont{enc}{family}{series}{shape} *\usefont* + Equivalent to calling |\fontencoding|, |\fontfamily|, + |\fontseries| and |\fontshape| with the given parameters, + followed by |\selectfont|. + +============================================================================== +25. Parameters *latex-parameters* + +The input file specification indicates the file to be formatted; TeX uses +`.tex' as a default file extension. If you omit the input file entirely, TeX +accepts input from the terminal. You specify command options by supplying a +string as a parameter to the command; e.g. > + + latex "\scrollmode\input foo.tex" + +will process `foo.tex' without pausing after every error. + +Output files are always created in the current directory. When you fail to +specify an input file name, TeX bases the output names on the file +specification associated with the logical name TEX_OUTPUT, typically +texput.log. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/dot_vim/doc/ps_color.txt b/dot_vim/doc/ps_color.txt new file mode 100644 index 0000000..caf6a4a --- /dev/null +++ b/dot_vim/doc/ps_color.txt @@ -0,0 +1,585 @@ +*ps_color.txt* PSC For Vim version 6.3 Last change: 17 November 2004 + + +PERSONAL COLOUR SWITCHER *ps_colour* *pscolor* + + +Author: Pan, Shizhu. <dicpan> at <hotmail o com> > + (prepend '[VIM]' in the title or your mail may be silently removed.) +< +============================================================================== +CONTENTS *psc* *psc-contents* + + 1. Contents.....................|psc-contents| + 2. PSC Overview.................|psc-overview| + 3. PSC Installation.............|psc-usage| + 4. PSC Options..................|psc-options| + 5. PSC under color term ........|psc-cterm| + 6. PSC FAQ and Tips ............|psc-faq| + 7. PSC Release notes............|psc-release-notes| + 8. PSC Todo List................|psc-todo| + +For release notes, please see the header of ps_color.vim + +============================================================================== +PSC FEATURES OVERVIEW *psc-features* *psc-overview* + + Features ~ + + . PSC is firstly a color scheme which have both dark and light + background styles. + . It can have the same appearance in [cterm] as in [gui]. + . It is designed with gentle color to minimize fatigue of eye. + . It also works with other color schemes. + . Default foreground and background can easily be changed, it is more + configurable than most other color schemes + . Works with the optional tool reloaded.vim, can change the whole + color scheme in Hue,Saturation,Luminance color space. + + Design Concern ~ + + At the first glance this color scheme may look pretty 'dull', don't be + afraid, this is quite normal. Bear in mind that a text editor is not + a photo album, if a text editor looks exciting you may not be able to + stare at it for a long time. + + Predefined Vim Syntax highlighting can be too colorful or contrasty so + that many programmers prefer to switch off the syntax highlighting at + work. That is not a good idea because you will lost the advantages of + syntax high-lighting. It is often the case that we have to work for + 300+ minutes, then I decide to do-it-myself. + + Many user-defined color schemes in vim.sf.net tend to achieve low + contrast by having a strong color-cast, i.e. looks blueish or + yellowish or reddish. This does look comfortable at first, however, + any type of color-cast will cause the eyes less sensitive for + particular color after a long-time work session, and that's no good to + health. + + Efforts had been made to ensure no color-cast for this scheme, all + elementary colors like RGB and CYMK are evenly used. Like TeX, + 'consistency' is the principle this color scheme based on. Default + values which hurt consistency are amended according to the vim script + syntax/hitest.vim + + There are 3 parameters to describe a color: Hue, Saturation and + Brightness. In this color scheme, the saturation is low and the + brightness are designed to be very close to each other in order not to + fatigue our eyes after a whole day's programming work. + + Portability ~ + + Different monitor settings led to different look. In this color + scheme, it is assumed that the monitor adjust at 6500k color + temperature with a good gamma curve. If you have a 9300k monitor or + if the gamma curve is not optimal, the appearance may be less + comfortable, use adobe gamma loader or similar tools to adjust + your monitor if your monitor do not have the option to change color + temperature and/or gamma curve. + + Needless to say, VI is an editor originally designed to do edit tasks + in a text terminal, and VIM is an improved version of VI. Its a shame + that a color scheme cannot have a satisfactory appearance in cterm. + The cterm compatibility should be considered high priority when + designing ViM color scheme. + + I had made much attempt to make support for 8-color terminals, + however, 8 colors is not enough to represent a color scheme. Finally + I end up making the cterm support for 16-color terminal. Have to say + sorry if the color scheme sucks in your 8-color terminal, I had tried + my best. More details about cterm please see |psc-cterm|. + + *psc-about-background* + About the Background ~ + + We have talked about off-white backgrounds, any background which is + not black, grey or white should be changed constantly in order not to + make the eyes less sensitive to particular color. i.e. you can use + blue background on Monday, red background on Tuesday, green background + on Wednesday, but if you use blue background everyday, that's no good + to your health. + + Now we talk about the brightness of the background. Why dark + background is preferred over others? There are many reasons, such as, + the monitor emits lower radiation for black background. You may have + lots of similar reasons... + + But I'll talk about something you may not know: +> + It is easier to distinguish foreground colors on a dark background + than on a light background. + + At the same time, it is easier to distinguish background colors on + a light background than on a dark background. + + We will mainly change foreground colors for syntax highlighting. +< + Hence, we can reduce the contrast and saturation of the color in + a dark-background scheme, while retain the readability. Schemes with + white background usually comes with higher contrast and saturation. + This is probably the most important reason that the color scheme is + designed to be dark-background instead of light one. + + Now we came to know, that change the foreground color is enough to + emphasis text in a dark background, while for a white background, we + need to change the font shape (bold or italic, etc.), or change the + background color to effectively emphasis the text. This is probably + the reason Vim default scheme has bold properties for highlighting + groups, because the default scheme is a light background one. + + No one knows what color scheme is best for you, except yourself. Try! + +============================================================================== +PSC INSTALLATION *psc-usage* + + Step 1, Enable the color scheme ~ + + To use PSC is simple, just put ps_color.vim into your + [runtimepath]/colors and append the line > + + colorscheme ps_color +< + to your |.vimrc|. The [runtimepath] can be any directory listed in + |vimfiles|, normally your $HOME/.vim in Unix or $HOME/vimfiles in + Windows. + + Step 2, Install the help document ~ + + The help document will be automatically installed when the colorscheme + be sourced the first time. If it is not, type :colo ps_color now. + + After successfully installed the help document, you can use > + + :help psc-options +< + to go to the following section. + +============================================================================== +PSC OPTIONS *psc-options* + + You can let these options in your ~/.vimrc, most options works for + both GUI and cterm, only some of them do not work for both. + + Options set using the 'let' command must present [BEFORE] the color + scheme been sourced. + + *psc_style* + Style ~ +> + let psc_style='cool' + let psc_style='warm' + let psc_style='default' + let psc_style='defdark' +< + This selects between styles of colors, + The 'cool' is the default, dark background. + The 'warm' is the experimental, light background scheme. + + See |psc-about-background| for more knowledge about the background, + and the differences of two style. + + The 'default' and 'defdark' refers to Vim system default color scheme. + Which are provided only for reference. + + Let psc_style to any string other than the above 4 will switch to the + specified color scheme. For example, let psc_style='desert' and then + activate the ps_color, the color scheme will be chosen according to + desert.vim color scheme. + + *psc_cterm_style* + Color Term Style ~ +> + let psc_cterm_style='cool' +< + This is exactly the same to psc_style, except that it only affects the + console version of vim in a color terminal, the 'warm' is not + available for cterm. + By default, it will be set to the same value as 'psc_style'. You can + change it if you want different style in cterm from gui. + + + *psc_fontface* + Font face ~ +> + let psc_fontface='plain' + let psc_fontface='mixed' +< + The Vim default behavior is the 'mixed', however, the mixed font style + in a dark colorscheme is not optimal. This color uses 'plain' for + 'cool' style, i.e. No texts are bolded font. For 'warm', the default + is still 'mixed', If you want the mixed style in which the highlighted + statements are bolded font, choose this. If you want all texts be + bolded, choose 'plain' and specify a bolded guifont or terminal font. + + In GUI, this option also works for other color schemes. You can + disable the bold font and use your favorite color scheme. See + |psc-faq-ffothers| for detail. + + *psc_inversed_todo* + Inversed Todo ~ +> + let psc_inversed_todo=1 +< + When set to 1, the TODO group will be dark background with light font, + Otherwise, the TODO group have light background with dark foreground. + Default is 0. + + *psc_use_default_for_cterm* + Use default for cterm (obsoleted)~ + + This option is Obsoleted, retained only for backward compatibility, + see |psc_cterm_style| for alternative. + + *psc_statement_different_from_type* + Statement different from type ~ +> + let psc_statement_different_from_type=1 +< + The Statement-group and Type-group are easy to distinguish, different + color for them are not necessary, I use similar color for S-group + & T-group in order not to make the screen too 'colorful', also this + saves a color name for cterm. But if you do want the Statement & Type + to be different color, try 'let statement_different_from_type=1' in + your .vimrc file, which is available only for GUI. Since the color + names in cterm is limited to 16 we cannot have too many different + colors in cterm. + Default is 0, i.e. they have very similar color. + + *psc-change-background* + Changing the Background color ~ + + You may prefer a dark background over pure black one, and it is + possible to change the background, this may make life more interesting. + To do this is quite straight forward for GUI, just define the Normal + highlight in your .gvimrc, [AFTER] the color scheme has been sourced. + + For example: +> + highlight Normal guibg=#103040 +< + The #103040 will give a taste similar to oceandeep, #152535 for + hhazure, #303030 for desert, #404040 for zenburn... Replace #103040 + with any color you like. You can do the same to guifg foreground if + you are careful enough, remember this is only possible with ps_color + version 2.7 or above, and only possible for GUI. + + You can do this to the NonText group also, for example. +> + highlight NonText guibg=#202020 +< + will give you a taste similar to most color schemes on vim.sf.net, in + which the NonText has a different background than Normal text. + However, this is only useful in GUI, in cterm, there are only + 8 background colors, so it is wise not to have a different color. + + If you want more variations, please try the optional utility + reloaded.vim, this optional utility provides an amazing level of + customization. + + Quick switching between warm and cold styles ~ + + Here is an example to define hot key of different style switching, + note that I had only given this example without actually define it. + You can choose to define it in .vimrc or anyway you prefer. +> + nnoremap <Leader>pc :let psc_style='cool'<CR>:colo ps_color<CR> + nnoremap <Leader>pw :let psc_style='warm'<CR>:colo ps_color<CR> +< + Alternatively, you can use the capitalized :Colo command, like + :Colo cool or :Colo warm + +============================================================================== +PSC WITH CTERM *psc-cterm* + + Colour Term ~ + + The cterm color is designed mainly in these terminals: +> + 1. Cygwin bash shell in NT command prompt box + 2. XTERM and RXVT + 3. Other color terminals which have at least 16 colors +< + *psc-cterm-nt* + In Windows NT Prompt console you can change the exact value of each + color, so you can have the same color with your GUI version of Vim, + for 'cool' color style you just change the color according to the + |psc-cterm-color-table|, for how to redefine the color of Windows NT + prompt console please see Windows Help. + + NT Cygwin bash shell console supports 16 foreground colors by add bold + attribute to 8 color, the cterm=bold specifies which should be bright + color, so totally the 16 color foreground is available, but color + name DarkXXX and LightXXX are the same. + + The pre-configured Cygwin.lnk is available for download on my web page + for Vim, but the site seems down, if my site would be on again, it + should be at the following URL: > + http://poet.tomud.com/pub/Cygwin.lnk.gz +< + Cygwin is highly recommended for Vim user if you are using Windows NT + based systems (e.g. NT 4.0, Win2k, WinXP, Win2003, etc). But Cygwin is + not that versatile under Windows 95/98/ME. I'm not sure whether this + works for DOS DJGPP or Windows 95 console version of Vim because + I don't have the system, in case you encountered problem please + contact me, if you like. + + *psc-cterm-xterm* + XTERM is a much more feature-rich terminal than Windows Console so the + support is much better, add the following recommend line into your + .Xdefaults and you can achieve the same color as in GUI version. + + Add the following into your .Xdefaults: + This works for XTERM and RXVT. +> + XTerm*color0: #000000 + XTerm*color1: #800000 + XTerm*color2: #008000 + XTerm*color3: #d0d090 + XTerm*color4: #000080 + XTerm*color5: #800080 + XTerm*color6: #a6caf0 + XTerm*color7: #d0d0d0 + XTerm*color8: #b0b0b0 + XTerm*color9: #f08060 + XTerm*color10: #60f080 + XTerm*color11: #e0c060 + XTerm*color12: #80c0e0 + XTerm*color13: #f0c0f0 + XTerm*color14: #c0d8f8 + XTerm*color15: #e0e0e0 + XTerm*cursorColor: #00f000 + + ! The following are recommended but optional + XTerm*reverseVideo: False + XTerm*background: #000000 + XTerm*foreground: #d0d0d0 + XTerm*boldMode: False +< + There is an assumption that your RXVT or XTERM supports 16 colors, + most RXVTs and XTERMs support this, if yours do not, get a source of + RXVT and recompile it. + + Sometimes the color mode are not recognized well, or you do not want + bright foreground be bolded. If this is the case, add the following in + your .vimrc (before the color scheme been sourced) +> + if &term=='xterm' " Change 'xterm' to your term name if necessary + set t_Co=16 + endif +< + If the t_Co=16 have problem, set t_Co=8 and :colo ps_color again. + vice versa. + + My rxvt works well with t_Co=16: > + Rxvt v2.7.10 - released: 26 MARCH 2003 + Options: + XPM,transparent,utmp,menubar,frills,linespace,multichar_languages, + scrollbars=rxvt+NeXT+xterm,.Xdefaults +< But I've know that my rxvt v2.6.4 in another machine has problem with + t_Co=16, if that is the case, set t_Co=8 instead. + + *psc-cterm-others* + For other terminals, you can manually set the color according to the + following table + + Hints for Manually set the color (for 'cool' style only): + *psc-cterm-color-table* + Color name Hex value Decimal value ~ + 0 Black = #000000 0,0,0 + 4 DarkBlue = #000080 0,0,128 + 2 DarkGreen = #008000 0,128,0 + 6 DarkCyan = #a6caf0 166,202,240 + 1 DarkRed = #800000 128,0,0 + 5 DarkMagenta = #800080 128,0,128 + 3 DarkYellow = #d0d090 208,208,144 + 7 Grey = #d0d0d0 208,208,208 + 8 DarkGrey = #b0b0b0 176,176,176 + 12 Blue = #80c0e0 128,192,224 + 10 Green = #60f080 96,240,128 + 14 Cyan = #c0d8f8 192,216,248 + 9 Red = #f08060 240,128,96 + 13 LMag. = #f0c0f0 240,192,240 + 11 Yellow = #e0c060 224,192,96 + 15 White = #e0e0e0 224,224,224 + + *psc-cterm-incompatible* + If your color terminal does only have 8 colors and cannot achieve 16 + colors with cterm=bold, you may want to switch to other color schemes + to gain more readability. Anyway, you can specify in your .vimrc to + use different color scheme under different consoles and GUI. + For example: +> + let psc_cterm_style = 'foobarcolor' + let psc_style = 'cool' + colo ps_color +< + The 'foobarcolor' means the color scheme you want to choose, such as + 'desert', I recommend to try vim default schemes 'default' and + 'defdark' before experience others. + +============================================================================== +PSC FAQ AND TIPS *psc-faq* *psc-tips* +> + Q: What is meant by `PS' ? +< + A: PS means: PostScript, PhotoShop, PerSonal, ... or anything you can + imagine and anything you want it do be. +> + Q: How to obtain the same appreance as gui in color term? +< + A: This need some work around, see |psc-cterm| for details. + Generally speaking, you should ensure your color term has support + for 16 foreground colors, and each color is customizable. + + *psc-faq-ffothers* > + Q: How to use psc_fontface with other colorschemes? +< + A: Make sure you had sourced :colo ps_color in your .vimrc, then you + can use the Capitalized :Colo instead of :colo + e.g. you want to use 'murphy', just type :Colo murphy after you + sourced the ps_color, the 'defdark', 'cool', 'warm' can also be + used here. +> + Q: I updated from v2.0 to v2.3 or above, why the cterm color scheme + for Comment is different? +< + A: The color map of DarkYellow and Yellow have been exchanged, + You need to reconfigure your terminal to meet the change, + see |psc-cterm-color-table| for guide, or if you are using xterm + compatible terminal, just update the .XDefaults according to + |psc-cterm-xterm|. +> + Q: What do you mean by 'Vanilla Windows'? +< + A: People often argue that Windows is not a REAL operating system. + Well, I agree this, but only for vanilla windows. i.e. with no + plug-ins installed. Vanilla windows is a very limited platform, + since it is not POSIX compliant. + + There are currently many working around to make Windows POSIX + Compliant, do you still mind which OS to use when it is POSIX + Compliant? I don't. If you installed Cygwin kernel in your + NT-based Windows, the Windows will be more or less POSIX compliant + and you can use it in the same way as you use any Unix, BSD, + Solaris, Linux, XWindow, etc... What is more, Cygwin is not the + only kernel which makes Windows POSIX Compliant, make a google + search and you will find many alternatives. +> + Q: How to change the Normal background color? Why don't you use + different background for NonText group? +< + A: This is for compatibility, since we have to use only 8 colors as + background in a color terminal. For GUI you can change this, see + |psc-change-background| for details. + +============================================================================== +PSC RELEASE NOTES *psc-release-notes* + + 2.82 Release Note: ~ + + Fixed bug with the reversed group for the Vim default, or other + schemes. + + Fixed bug with the Diff mode fg mistaken as fg. + + Shrink the script a lot to improve load performance, moved the release + notes into document. + + Change the default gui background color to #202020 (Dark Grey) + + + 2.81 Release Note: ~ + + Provided a separate utility reloaded.vim to fine tune the GUI color + scheme based on Hue, Saturation and Brightness(Luminance). + + Added some groups to meet the need of reloaded.vim, no essential + change. + + 2.8 Release Note: ~ + + Bugfix : when psc_style=='mixed', the visual got reversed wrong. + + 'mixed' is now the default for 'warm' style. + + changed the function name to lower case. + + removed pre-2.0 compatibility, (the non-psc version of s-d-f-t). + + Added variable psc_cterm_style, see |psc_cterm_style| + + Added group Underline + + Tuned the function call. + + 2.7 Release Note: ~ + + Now it is possible to change the Background, + see :h psc-change-background for details. + + Linked the Tag group to Identifier. + + NonText as Notice is not good for 'warm', changed to Constant. + + Added links for the most popular plugins: taglist, calendar + + Tuned the 'Statement' color when different from Type (gui only). + + Re-adjusted cterm scheme according to syntax/hitest.vim + + The 'defdark' style for cterm is not functioning, fixed. + + Many 'cosmetic' changes, makes no difference for functionality. + + Use of DrChip's help extractor to auto-install help document. + + Added command define, :Colo + + 2.6 Release Note: ~ + + As stated in the v2.3, the only 'todo' thing seems to be the 'warm' + style, now in this version I had been working on it. + + There also are some minor fixes for the document, to be more friendly + for new readers. + + The 'StatusLine' of 'cold' style is modified by mistake in the v2.3, + this time the bug is fixed. + + The 'Directory' in GUI 'cold' style is different from 'cterm' one, + now fixed. + + 2.3 Release Note: ~ + + This is an incompatible update, main changes are in 'cterm'. + A new group 'SignColumn' had been added, new links added for engspchk + v52, hundreds of typos fixed in the document, thanks to the engspchk. + + The support for 8-color cterm is slightly better now, but the mappings + of the DarkYellow and Yellow are exchanged, you need to update the + .Xdefaults or your terminal configuration before apply this update if + you are using v2.0. Guide for redefinition the color value is + available in the document, make sure you had updated the ps_color.txt, + then see |psc-cterm-color-table| + + 2.0 Release Note: ~ + + There've been great enhancement since this version, so I'd choose to + bump the version number to 2. This version comes with Vim online help, + if you had installed ps_color.txt, you can see for details in + |pscolor| + + n/a Release: ~ + + Initial upload, can be called as v1.8 + + +============================================================================== +PSC TODO LIST *psc-todo* + + . Fix the remain bugs. + . Follow the new Vim versions for new added highlighting group + +============================================================================== + +vim:tw=78:ts=8:noet:ft=help:fo+=t:norl:noet: diff --git a/dot_vim/doc/taglist.txt b/dot_vim/doc/taglist.txt new file mode 100755 index 0000000..6a62b39 --- /dev/null +++ b/dot_vim/doc/taglist.txt @@ -0,0 +1,1501 @@ +*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 <F8> key to toggle the taglist window. +> + nnoremap <silent> <F8> :TlistToggle<CR> +< +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 <Enter> 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 <Enter> key +or by double clicking the file name using the mouse. + +In the taglist window, you can use the [[ or <Backspace> key to jump to the +beginning of the previous file. You can use the ]] or <Tab> 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 <CTRL-C>. + +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 <file name> +< +To load a saved taglist session, use the ":TlistSessionLoad" command: > + + :TlistSessionLoad <file name> +< +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~ + + <CR> 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. + <Space> 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 + <Backspace> Jump to the beginning of the previous file + ]] Jump to the beginning of the next file + <Tab> Jump to the beginning of the next file + q Close the taglist window + <F1> 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-<keyword>" command to get help on the various taglist +topics. + +You can press the <F1> key in the taglist window to display the help +information about using the taglist window. If you again press the <F1> 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 + + <language_name>;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 <filename> +< + 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/dot_vim/doc/tags b/dot_vim/doc/tags new file mode 100644 index 0000000..9049f74 --- /dev/null +++ b/dot_vim/doc/tags @@ -0,0 +1,1138 @@ +'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* +'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* +'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* +'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* +'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* +'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* +'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* +'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* +'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* +'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* +'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* +'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* +'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* +'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* +'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* +'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* +'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* +'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* +'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* +'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* +'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* +'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* +'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* +'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* +'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* +:DocIndex haskellmode.txt /*:DocIndex* +:DocSettings haskellmode.txt /*:DocSettings* +:ExportDocIndex haskellmode.txt /*:ExportDocIndex* +:FlagReference haskellmode.txt /*:FlagReference* +:GHCReload haskellmode.txt /*:GHCReload* +:GHCStaticOptions haskellmode.txt /*:GHCStaticOptions* +:GHCi haskellmode.txt /*:GHCi* +:HpasteIndex haskellmode.txt /*:HpasteIndex* +:HpastePostNew haskellmode.txt /*:HpastePostNew* +:IDoc haskellmode.txt /*:IDoc* +:MDoc haskellmode.txt /*:MDoc* +:TlistAddFiles taglist.txt /*:TlistAddFiles* +:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* +:TlistClose taglist.txt /*:TlistClose* +:TlistDebug taglist.txt /*:TlistDebug* +:TlistHighlightTag taglist.txt /*:TlistHighlightTag* +:TlistLock taglist.txt /*:TlistLock* +:TlistMessages taglist.txt /*:TlistMessages* +:TlistOpen taglist.txt /*:TlistOpen* +:TlistSessionLoad taglist.txt /*:TlistSessionLoad* +:TlistSessionSave taglist.txt /*:TlistSessionSave* +:TlistShowPrototype taglist.txt /*:TlistShowPrototype* +:TlistShowTag taglist.txt /*:TlistShowTag* +:TlistToggle taglist.txt /*:TlistToggle* +:TlistUndebug taglist.txt /*:TlistUndebug* +:TlistUnlock taglist.txt /*:TlistUnlock* +:TlistUpdate taglist.txt /*:TlistUpdate* +Alph latexhelp.txt /*Alph* +Alt-B latex-suite.txt /*Alt-B* +Alt-C latex-suite.txt /*Alt-C* +Alt-I latex-suite.txt /*Alt-I* +Alt-L latex-suite.txt /*Alt-L* +BibTeX latexhelp.txt /*BibTeX* +IMAP_PutTextWithMovement latex-suite.txt /*IMAP_PutTextWithMovement* +Imap_DeleteEmptyPlaceHolders latex-suite.txt /*Imap_DeleteEmptyPlaceHolders* +Imap_FreezeImap latex-suite.txt /*Imap_FreezeImap* +Imap_PlaceHolderEnd latex-suite.txt /*Imap_PlaceHolderEnd* +Imap_PlaceHolderStart latex-suite.txt /*Imap_PlaceHolderStart* +Imap_StickyPlaceHolders latex-suite.txt /*Imap_StickyPlaceHolders* +Imap_UsePlaceHolders latex-suite.txt /*Imap_UsePlaceHolders* +LaTeX latexhelp.txt /*LaTeX* +Plug_IMAP_DeleteAndJumBack latex-suite.txt /*Plug_IMAP_DeleteAndJumBack* +Plug_IMAP_DeleteAndJumpForward latex-suite.txt /*Plug_IMAP_DeleteAndJumpForward* +Plug_IMAP_JumpBack latex-suite.txt /*Plug_IMAP_JumpBack* +Plug_IMAP_JumpForward latex-suite.txt /*Plug_IMAP_JumpForward* +Plug_Tex_InsertItem latex-suite.txt /*Plug_Tex_InsertItem* +Plug_Tex_LeftRight latex-suite.txt /*Plug_Tex_LeftRight* +Plug_Tex_MathBF latex-suite.txt /*Plug_Tex_MathBF* +Plug_Tex_MathCal latex-suite.txt /*Plug_Tex_MathCal* +Roman latexhelp.txt /*Roman* +TClearCiteHist latex-suite.txt /*TClearCiteHist* +TLook latex-suite.txt /*TLook* +TLookAll latex-suite.txt /*TLookAll* +TLookBib latex-suite.txt /*TLookBib* +TMacro latex-suite.txt /*TMacro* +TMacroDelete latex-suite.txt /*TMacroDelete* +TMacroEdit latex-suite.txt /*TMacroEdit* +TMacroNew latex-suite.txt /*TMacroNew* +TPackage latex-suite.txt /*TPackage* +TPackageUpdate latex-suite.txt /*TPackageUpdate* +TPackageUpdateAll latex-suite.txt /*TPackageUpdateAll* +TPartComp latex-suite.txt /*TPartComp* +TPartView latex-suite.txt /*TPartView* +TSection latex-suite.txt /*TSection* +TSectionAdvanced latex-suite.txt /*TSectionAdvanced* +TTemplate latex-suite.txt /*TTemplate* +Tex_AutoFolding latex-suite.txt /*Tex_AutoFolding* +Tex_BIBINPUTS latex-suite.txt /*Tex_BIBINPUTS* +Tex_CatchVisMapErrors latex-suite.txt /*Tex_CatchVisMapErrors* +Tex_Com_name latex-suite.txt /*Tex_Com_name* +Tex_CompileRule_format latex-suite.txt /*Tex_CompileRule_format* +Tex_Debug latex-suite.txt /*Tex_Debug* +Tex_DefaultTargetFormat latex-suite.txt /*Tex_DefaultTargetFormat* +Tex_Diacritics latex-suite.txt /*Tex_Diacritics* +Tex_Env_name latex-suite.txt /*Tex_Env_name* +Tex_EnvironmentMaps latex-suite.txt /*Tex_EnvironmentMaps* +Tex_EnvironmentMenus latex-suite.txt /*Tex_EnvironmentMenus* +Tex_ExplorerHeight latex-suite.txt /*Tex_ExplorerHeight* +Tex_FoldedCommands latex-suite.txt /*Tex_FoldedCommands* +Tex_FoldedEnvironments latex-suite.txt /*Tex_FoldedEnvironments* +Tex_FoldedMisc latex-suite.txt /*Tex_FoldedMisc* +Tex_FoldedSections latex-suite.txt /*Tex_FoldedSections* +Tex_Folding latex-suite.txt /*Tex_Folding* +Tex_FontMaps latex-suite.txt /*Tex_FontMaps* +Tex_FontMenus latex-suite.txt /*Tex_FontMenus* +Tex_GotoError latex-suite.txt /*Tex_GotoError* +Tex_HotKeyMappings latex-suite.txt /*Tex_HotKeyMappings* +Tex_IgnoreLevel latex-suite.txt /*Tex_IgnoreLevel* +Tex_IgnoredWarnings latex-suite.txt /*Tex_IgnoredWarnings* +Tex_ImageDir latex-suite.txt /*Tex_ImageDir* +Tex_ItemStyle_environment latex-suite.txt /*Tex_ItemStyle_environment* +Tex_Leader latex-suite.txt /*Tex_Leader* +Tex_Leader2 latex-suite.txt /*Tex_Leader2* +Tex_MainFileExpression latex-suite.txt /*Tex_MainFileExpression* +Tex_MainMenuLocation latex-suite.txt /*Tex_MainMenuLocation* +Tex_MathMenus latex-suite.txt /*Tex_MathMenus* +Tex_Menus latex-suite.txt /*Tex_Menus* +Tex_MultipleCompileFormats latex-suite.txt /*Tex_MultipleCompileFormats* +Tex_NestElementMenus latex-suite.txt /*Tex_NestElementMenus* +Tex_NestPackagesMenu latex-suite.txt /*Tex_NestPackagesMenu* +Tex_PackagesMenu latex-suite.txt /*Tex_PackagesMenu* +Tex_ProjectSourceFiles latex-suite.txt /*Tex_ProjectSourceFiles* +Tex_PromptedCommands latex-suite.txt /*Tex_PromptedCommands* +Tex_PromptedEnvironments latex-suite.txt /*Tex_PromptedEnvironments* +Tex_RememberCiteSearch latex-suite.txt /*Tex_RememberCiteSearch* +Tex_SectionMaps latex-suite.txt /*Tex_SectionMaps* +Tex_SectionMenus latex-suite.txt /*Tex_SectionMenus* +Tex_SmartKeyBS latex-suite.txt /*Tex_SmartKeyBS* +Tex_SmartKeyQuote latex-suite.txt /*Tex_SmartKeyQuote* +Tex_TEXINPUTS latex-suite.txt /*Tex_TEXINPUTS* +Tex_UseMakefile latex-suite.txt /*Tex_UseMakefile* +Tex_UseMenuWizard latex-suite.txt /*Tex_UseMenuWizard* +Tex_UsePython latex-suite.txt /*Tex_UsePython* +Tex_UseSimpleLabelSearch latex-suite.txt /*Tex_UseSimpleLabelSearch* +Tex_UseUtfMenus latex-suite.txt /*Tex_UseUtfMenus* +Tex_ViewRuleComplete_format latex-suite.txt /*Tex_ViewRuleComplete_format* +Tex_ViewRule_format latex-suite.txt /*Tex_ViewRule_format* +Tex_ViewerCwindowHeight latex-suite.txt /*Tex_ViewerCwindowHeight* +Tex_ViewerPreviewHeight latex-suite.txt /*Tex_ViewerPreviewHeight* +Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* +Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* +Tlist_Set_App() taglist.txt /*Tlist_Set_App()* +Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* +Tshortcuts latex-suite.txt /*Tshortcuts* +\Alph latexhelp.txt /*\\Alph* +\Huge latexhelp.txt /*\\Huge* +\LARGE latexhelp.txt /*\\LARGE* +\Large latexhelp.txt /*\\Large* +\Roman latexhelp.txt /*\\Roman* +\\ latexhelp.txt /*\\\\* +\\\\ latexhelp.txt /*\\\\\\\\* +\addcontentsline latexhelp.txt /*\\addcontentsline* +\address latexhelp.txt /*\\address* +\addtocontents latexhelp.txt /*\\addtocontents* +\addtocounter latexhelp.txt /*\\addtocounter* +\addtolength latexhelp.txt /*\\addtolength* +\addvspace latexhelp.txt /*\\addvspace* +\alph latexhelp.txt /*\\alph* +\and latexhelp.txt /*\\and* +\appendix latexhelp.txt /*\\appendix* +\arabic latexhelp.txt /*\\arabic* +\author latexhelp.txt /*\\author* +\begin latexhelp.txt /*\\begin* +\bfseries latexhelp.txt /*\\bfseries* +\bibitem latexhelp.txt /*\\bibitem* +\bibliography latexhelp.txt /*\\bibliography* +\bibliographystyle latexhelp.txt /*\\bibliographystyle* +\bigskip latexhelp.txt /*\\bigskip* +\cc latexhelp.txt /*\\cc* +\cdots latexhelp.txt /*\\cdots* +\centering latexhelp.txt /*\\centering* +\chapter latexhelp.txt /*\\chapter* +\circle latexhelp.txt /*\\circle* +\cite latexhelp.txt /*\\cite* +\cleardoublepage latexhelp.txt /*\\cleardoublepage* +\clearpage latexhelp.txt /*\\clearpage* +\cline latexhelp.txt /*\\cline* +\closing latexhelp.txt /*\\closing* +\dashbox latexhelp.txt /*\\dashbox* +\date latexhelp.txt /*\\date* +\ddots latexhelp.txt /*\\ddots* +\depth latexhelp.txt /*\\depth* +\documentclass latexhelp.txt /*\\documentclass* +\dotfill latexhelp.txt /*\\dotfill* +\emph latexhelp.txt /*\\emph* +\end latexhelp.txt /*\\end* +\enlargethispage latexhelp.txt /*\\enlargethispage* +\fbox latexhelp.txt /*\\fbox* +\flushbottom latexhelp.txt /*\\flushbottom* +\fnsymbol latexhelp.txt /*\\fnsymbol* +\fontencoding latexhelp.txt /*\\fontencoding* +\fontfamily latexhelp.txt /*\\fontfamily* +\fontseries latexhelp.txt /*\\fontseries* +\fontshape latexhelp.txt /*\\fontshape* +\fontsize latexhelp.txt /*\\fontsize* +\footnote latexhelp.txt /*\\footnote* +\footnotemark latexhelp.txt /*\\footnotemark* +\footnotesize latexhelp.txt /*\\footnotesize* +\footnotetext latexhelp.txt /*\\footnotetext* +\frac latexhelp.txt /*\\frac* +\frame latexhelp.txt /*\\frame* +\framebox latexhelp.txt /*\\framebox* +\fussy latexhelp.txt /*\\fussy* +\height latexhelp.txt /*\\height* +\hfill latexhelp.txt /*\\hfill* +\hline latexhelp.txt /*\\hline* +\hrulefill latexhelp.txt /*\\hrulefill* +\hspace latexhelp.txt /*\\hspace* +\huge latexhelp.txt /*\\huge* +\hyphenation latexhelp.txt /*\\hyphenation* +\include latexhelp.txt /*\\include* +\includeonly latexhelp.txt /*\\includeonly* +\indent latexhelp.txt /*\\indent* +\input latexhelp.txt /*\\input* +\item latexhelp.txt /*\\item* +\itshape latexhelp.txt /*\\itshape* +\kill latexhelp.txt /*\\kill* +\label latexhelp.txt /*\\label* +\large latexhelp.txt /*\\large* +\ldots latexhelp.txt /*\\ldots* +\lefteqn latexhelp.txt /*\\lefteqn* +\letter latexhelp.txt /*\\letter* +\line latexhelp.txt /*\\line* +\linebreak latexhelp.txt /*\\linebreak* +\linethickness latexhelp.txt /*\\linethickness* +\listoffigures latexhelp.txt /*\\listoffigures* +\listoftables latexhelp.txt /*\\listoftables* +\location latexhelp.txt /*\\location* +\lrbox latexhelp.txt /*\\lrbox* +\makebox latexhelp.txt /*\\makebox* +\makelabels latexhelp.txt /*\\makelabels* +\maketitle latexhelp.txt /*\\maketitle* +\marginpar latexhelp.txt /*\\marginpar* +\markboth latexhelp.txt /*\\markboth* +\markright latexhelp.txt /*\\markright* +\mathbf latexhelp.txt /*\\mathbf* +\mathcal latexhelp.txt /*\\mathcal* +\mathit latexhelp.txt /*\\mathit* +\mathnormal latexhelp.txt /*\\mathnormal* +\mathrm latexhelp.txt /*\\mathrm* +\mathsf latexhelp.txt /*\\mathsf* +\mathtt latexhelp.txt /*\\mathtt* +\mathversion latexhelp.txt /*\\mathversion* +\mbox latexhelp.txt /*\\mbox* +\mdseries latexhelp.txt /*\\mdseries* +\medskip latexhelp.txt /*\\medskip* +\multicolumn latexhelp.txt /*\\multicolumn* +\multiput latexhelp.txt /*\\multiput* +\name latexhelp.txt /*\\name* +\newcommand latexhelp.txt /*\\newcommand* +\newcounter latexhelp.txt /*\\newcounter* +\newenvironment latexhelp.txt /*\\newenvironment* +\newfont latexhelp.txt /*\\newfont* +\newlength latexhelp.txt /*\\newlength* +\newline latexhelp.txt /*\\newline* +\newpage latexhelp.txt /*\\newpage* +\newsavebox latexhelp.txt /*\\newsavebox* +\newtheorem latexhelp.txt /*\\newtheorem* +\nocite latexhelp.txt /*\\nocite* +\nofiles latexhelp.txt /*\\nofiles* +\noindent latexhelp.txt /*\\noindent* +\nolinebreak latexhelp.txt /*\\nolinebreak* +\nonumber latexhelp.txt /*\\nonumber* +\nopagebreak latexhelp.txt /*\\nopagebreak* +\normalfont latexhelp.txt /*\\normalfont* +\normalsize latexhelp.txt /*\\normalsize* +\onecolumn latexhelp.txt /*\\onecolumn* +\opening latexhelp.txt /*\\opening* +\oval latexhelp.txt /*\\oval* +\overbrace latexhelp.txt /*\\overbrace* +\overline latexhelp.txt /*\\overline* +\pagebreak latexhelp.txt /*\\pagebreak* +\pagenumbering latexhelp.txt /*\\pagenumbering* +\pageref latexhelp.txt /*\\pageref* +\pagestyle latexhelp.txt /*\\pagestyle* +\par latexhelp.txt /*\\par* +\paragraph latexhelp.txt /*\\paragraph* +\parbox latexhelp.txt /*\\parbox* +\part latexhelp.txt /*\\part* +\picture-framebox latexhelp.txt /*\\picture-framebox* +\ps latexhelp.txt /*\\ps* +\pushtabs latexhelp.txt /*\\pushtabs* +\put latexhelp.txt /*\\put* +\raggedbottom latexhelp.txt /*\\raggedbottom* +\raggedleft latexhelp.txt /*\\raggedleft* +\raggedright latexhelp.txt /*\\raggedright* +\raisebox latexhelp.txt /*\\raisebox* +\ref latexhelp.txt /*\\ref* +\refstepcounter latexhelp.txt /*\\refstepcounter* +\renewcommand latexhelp.txt /*\\renewcommand* +\renewenvironment latexhelp.txt /*\\renewenvironment* +\reversemarginpar latexhelp.txt /*\\reversemarginpar* +\rmfamily latexhelp.txt /*\\rmfamily* +\roman latexhelp.txt /*\\roman* +\rule latexhelp.txt /*\\rule* +\savebox latexhelp.txt /*\\savebox* +\sbox latexhelp.txt /*\\sbox* +\scriptsize latexhelp.txt /*\\scriptsize* +\scshape latexhelp.txt /*\\scshape* +\section latexhelp.txt /*\\section* +\selectfont latexhelp.txt /*\\selectfont* +\setcounter latexhelp.txt /*\\setcounter* +\setlength latexhelp.txt /*\\setlength* +\settodepth latexhelp.txt /*\\settodepth* +\settoheight latexhelp.txt /*\\settoheight* +\settowidth latexhelp.txt /*\\settowidth* +\sffamily latexhelp.txt /*\\sffamily* +\shortstack latexhelp.txt /*\\shortstack* +\signature latexhelp.txt /*\\signature* +\sloppy latexhelp.txt /*\\sloppy* +\slshape latexhelp.txt /*\\slshape* +\small latexhelp.txt /*\\small* +\smallskip latexhelp.txt /*\\smallskip* +\space latexhelp.txt /*\\space* +\sqrt latexhelp.txt /*\\sqrt* +\startbreaks latexhelp.txt /*\\startbreaks* +\stepcounter latexhelp.txt /*\\stepcounter* +\stopbreaks latexhelp.txt /*\\stopbreaks* +\subparagraph latexhelp.txt /*\\subparagraph* +\subsection latexhelp.txt /*\\subsection* +\subsubsection latexhelp.txt /*\\subsubsection* +\symbol latexhelp.txt /*\\symbol* +\table latexhelp.txt /*\\table* +\tableofcontents latexhelp.txt /*\\tableofcontents* +\telephone latexhelp.txt /*\\telephone* +\textbf latexhelp.txt /*\\textbf* +\textit latexhelp.txt /*\\textit* +\textmd latexhelp.txt /*\\textmd* +\textnormal latexhelp.txt /*\\textnormal* +\textrm latexhelp.txt /*\\textrm* +\textsc latexhelp.txt /*\\textsc* +\textsf latexhelp.txt /*\\textsf* +\textsl latexhelp.txt /*\\textsl* +\texttt latexhelp.txt /*\\texttt* +\textup latexhelp.txt /*\\textup* +\thanks latexhelp.txt /*\\thanks* +\thebibliography latexhelp.txt /*\\thebibliography* +\thispagestyle latexhelp.txt /*\\thispagestyle* +\tiny latexhelp.txt /*\\tiny* +\title latexhelp.txt /*\\title* +\totalheight latexhelp.txt /*\\totalheight* +\ttfamily latexhelp.txt /*\\ttfamily* +\twocolumn latexhelp.txt /*\\twocolumn* +\typein latexhelp.txt /*\\typein* +\typeout latexhelp.txt /*\\typeout* +\underbrace latexhelp.txt /*\\underbrace* +\underline latexhelp.txt /*\\underline* +\upshape latexhelp.txt /*\\upshape* +\usebox latexhelp.txt /*\\usebox* +\usecounter latexhelp.txt /*\\usecounter* +\usefont latexhelp.txt /*\\usefont* +\usepackage latexhelp.txt /*\\usepackage* +\value latexhelp.txt /*\\value* +\vdots latexhelp.txt /*\\vdots* +\vector latexhelp.txt /*\\vector* +\verb latexhelp.txt /*\\verb* +\vfill latexhelp.txt /*\\vfill* +\vline latexhelp.txt /*\\vline* +\vspace latexhelp.txt /*\\vspace* +\width latexhelp.txt /*\\width* +_. haskellmode.txt /*_.* +_? haskellmode.txt /*_?* +_?1 haskellmode.txt /*_?1* +_?2 haskellmode.txt /*_?2* +_T haskellmode.txt /*_T* +_ct haskellmode.txt /*_ct* +_i haskellmode.txt /*_i* +_ie haskellmode.txt /*_ie* +_im haskellmode.txt /*_im* +_iq haskellmode.txt /*_iq* +_iqm haskellmode.txt /*_iqm* +_lang haskellmode.txt /*_lang* +_opt haskellmode.txt /*_opt* +_si haskellmode.txt /*_si* +_t haskellmode.txt /*_t* +adding-bib-options latex-suite.txt /*adding-bib-options* +alph latexhelp.txt /*alph* +altkey-mappings latex-suite.txt /*altkey-mappings* +arabic latexhelp.txt /*arabic* +array latexhelp.txt /*array* +article-class latexhelp.txt /*article-class* +auc-tex-mappings latex-suite.txt /*auc-tex-mappings* +automatic-package-detection latex-suite.txt /*automatic-package-detection* +bibtex latexhelp.txt /*bibtex* +bibtex-bindings latex-suite.txt /*bibtex-bindings* +book-class latexhelp.txt /*book-class* +c-support csupport.txt /*c-support* +center latexhelp.txt /*center* +changing-commands latex-suite.txt /*changing-commands* +changing-environments latex-suite.txt /*changing-environments* +cite-search-caching latex-suite.txt /*cite-search-caching* +compiler-dependency latex-suite.txt /*compiler-dependency* +compiler-ghc haskellmode.txt /*compiler-ghc* +compiler-output-customization latex-suite.txt /*compiler-output-customization* +compiler-rules latex-suite.txt /*compiler-rules* +compiling-multiple latex-suite.txt /*compiling-multiple* +completion-window-preferences latex-suite.txt /*completion-window-preferences* +csupport csupport.txt /*csupport* +csupport-c++ csupport.txt /*csupport-c++* +csupport-c++-method-impl csupport.txt /*csupport-c++-method-impl* +csupport-c++-normal-mode csupport.txt /*csupport-c++-normal-mode* +csupport-c++-visual-mode csupport.txt /*csupport-c++-visual-mode* +csupport-code-to-comm csupport.txt /*csupport-code-to-comm* +csupport-comm csupport.txt /*csupport-comm* +csupport-comm-aligned csupport.txt /*csupport-comm-aligned* +csupport-comm-c-cpp csupport.txt /*csupport-comm-c-cpp* +csupport-comm-date csupport.txt /*csupport-comm-date* +csupport-comm-frame csupport.txt /*csupport-comm-frame* +csupport-comm-keywords csupport.txt /*csupport-comm-keywords* +csupport-comm-realign csupport.txt /*csupport-comm-realign* +csupport-comm-to-code csupport.txt /*csupport-comm-to-code* +csupport-custom csupport.txt /*csupport-custom* +csupport-custom-glob-vars csupport.txt /*csupport-custom-glob-vars* +csupport-custom-root-menu csupport.txt /*csupport-custom-root-menu* +csupport-dictionary csupport.txt /*csupport-dictionary* +csupport-folding csupport.txt /*csupport-folding* +csupport-help csupport.txt /*csupport-help* +csupport-hotkeys csupport.txt /*csupport-hotkeys* +csupport-idioms csupport.txt /*csupport-idioms* +csupport-prep csupport.txt /*csupport-prep* +csupport-prep-if0 csupport.txt /*csupport-prep-if0* +csupport-prep-normal-mode csupport.txt /*csupport-prep-normal-mode* +csupport-prep-visual-mode csupport.txt /*csupport-prep-visual-mode* +csupport-proto csupport.txt /*csupport-proto* +csupport-release-notes csupport.txt /*csupport-release-notes* +csupport-run csupport.txt /*csupport-run* +csupport-run-buffer csupport.txt /*csupport-run-buffer* +csupport-run-cmdline-args csupport.txt /*csupport-run-cmdline-args* +csupport-run-codecheck csupport.txt /*csupport-run-codecheck* +csupport-run-hardcopy csupport.txt /*csupport-run-hardcopy* +csupport-run-indent csupport.txt /*csupport-run-indent* +csupport-run-make csupport.txt /*csupport-run-make* +csupport-run-make-args csupport.txt /*csupport-run-make-args* +csupport-run-output csupport.txt /*csupport-run-output* +csupport-run-splint csupport.txt /*csupport-run-splint* +csupport-run-templates csupport.txt /*csupport-run-templates* +csupport-run-xterm csupport.txt /*csupport-run-xterm* +csupport-snippets csupport.txt /*csupport-snippets* +csupport-stat csupport.txt /*csupport-stat* +csupport-stat-normal-mode csupport.txt /*csupport-stat-normal-mode* +csupport-stat-visual-mode csupport.txt /*csupport-stat-visual-mode* +csupport-system-wide csupport.txt /*csupport-system-wide* +csupport-taglist csupport.txt /*csupport-taglist* +csupport-templates csupport.txt /*csupport-templates* +csupport-templates-date csupport.txt /*csupport-templates-date* +csupport-templates-definition csupport.txt /*csupport-templates-definition* +csupport-templates-expansion csupport.txt /*csupport-templates-expansion* +csupport-templates-files csupport.txt /*csupport-templates-files* +csupport-templates-macros csupport.txt /*csupport-templates-macros* +csupport-templates-names csupport.txt /*csupport-templates-names* +csupport-troubleshooting csupport.txt /*csupport-troubleshooting* +csupport-usage-gvim csupport.txt /*csupport-usage-gvim* +csupport-usage-vim csupport.txt /*csupport-usage-vim* +csupport-windows csupport.txt /*csupport-windows* +csupport.txt csupport.txt /*csupport.txt* +custom-macros-menu latex-suite.txt /*custom-macros-menu* +custom-packages latex-suite.txt /*custom-packages* +customize-alt-key-maps latex-suite.txt /*customize-alt-key-maps* +customize-imap-maps latex-suite.txt /*customize-imap-maps* +customizing-compiling latex-suite.txt /*customizing-compiling* +customizing-folding latex-suite.txt /*customizing-folding* +customizing-latex-completion latex-suite.txt /*customizing-latex-completion* +customizing-latex-suite latex-suite.txt /*customizing-latex-suite* +customizing-macros latex-suite.txt /*customizing-macros* +customizing-menus latex-suite.txt /*customizing-menus* +customizing-packages latex-suite.txt /*customizing-packages* +customizing-place-holders latex-suite.txt /*customizing-place-holders* +customizing-smart-keys latex-suite.txt /*customizing-smart-keys* +customizing-viewing latex-suite.txt /*customizing-viewing* +customizing-what-to-fold latex-suite.txt /*customizing-what-to-fold* +default-folding latex-suite.txt /*default-folding* +description latexhelp.txt /*description* +diacritic-mappings latex-suite.txt /*diacritic-mappings* +displaymath latexhelp.txt /*displaymath* +draft latexhelp.txt /*draft* +editing-folding latex-suite.txt /*editing-folding* +empty latexhelp.txt /*empty* +enabling-searching latex-suite.txt /*enabling-searching* +enclosing-commands latex-suite.txt /*enclosing-commands* +enclosing-env-f5 latex-suite.txt /*enclosing-env-f5* +enclosing-env-threeletter latex-suite.txt /*enclosing-env-threeletter* +enclosing-environments latex-suite.txt /*enclosing-environments* +enumerate latexhelp.txt /*enumerate* +environment-mappings latex-suite.txt /*environment-mappings* +eqnarray latexhelp.txt /*eqnarray* +equation latexhelp.txt /*equation* +figure latexhelp.txt /*figure* +final latexhelp.txt /*final* +fleqn latexhelp.txt /*fleqn* +flushleft latexhelp.txt /*flushleft* +flushright latexhelp.txt /*flushright* +fold-setting-adding latex-suite.txt /*fold-setting-adding* +fold-setting-advanced latex-suite.txt /*fold-setting-advanced* +font-lowlevelcommands latexhelp.txt /*font-lowlevelcommands* +font-maps latex-suite.txt /*font-maps* +font-size latexhelp.txt /*font-size* +font-styles latexhelp.txt /*font-styles* +forward-searching latex-suite.txt /*forward-searching* +g:ghc haskellmode.txt /*g:ghc* +g:haddock_browser haskellmode.txt /*g:haddock_browser* +g:haddock_browser_callformat haskellmode.txt /*g:haddock_browser_callformat* +g:haddock_docdir haskellmode.txt /*g:haddock_docdir* +g:haddock_indexfiledir haskellmode.txt /*g:haddock_indexfiledir* +g:wget haskellmode.txt /*g:wget* +ghc haskellmode.txt /*ghc* +ghc-compiler haskellmode.txt /*ghc-compiler* +greek-letter-mappings latex-suite.txt /*greek-letter-mappings* +haddock haskellmode.txt /*haddock* +haskellmode haskellmode.txt /*haskellmode* +haskellmode-XO haskellmode.txt /*haskellmode-XO* +haskellmode-XU haskellmode.txt /*haskellmode-XU* +haskellmode-compiler haskellmode.txt /*haskellmode-compiler* +haskellmode-editing haskellmode.txt /*haskellmode-editing* +haskellmode-haddock haskellmode.txt /*haskellmode-haddock* +haskellmode-hpaste haskellmode.txt /*haskellmode-hpaste* +haskellmode-indexing haskellmode.txt /*haskellmode-indexing* +haskellmode-lookup haskellmode.txt /*haskellmode-lookup* +haskellmode-omni-completion haskellmode.txt /*haskellmode-omni-completion* +haskellmode-overview haskellmode.txt /*haskellmode-overview* +haskellmode-quickref haskellmode.txt /*haskellmode-quickref* +haskellmode-requirements haskellmode.txt /*haskellmode-requirements* +haskellmode-resources haskellmode.txt /*haskellmode-resources* +haskellmode-settings haskellmode.txt /*haskellmode-settings* +haskellmode-settings-fine haskellmode.txt /*haskellmode-settings-fine* +haskellmode-settings-main haskellmode.txt /*haskellmode-settings-main* +haskellmode-user-completion haskellmode.txt /*haskellmode-user-completion* +haskellmode.txt haskellmode.txt /*haskellmode.txt* +headings latexhelp.txt /*headings* +hpaste haskellmode.txt /*hpaste* +hyph- latexhelp.txt /*hyph-* +im_1 imaps.txt /*im_1* +imaps-usage imaps.txt /*imaps-usage* +imaps.txt imaps.txt /*imaps.txt* +imaps.txt-toc imaps.txt /*imaps.txt-toc* +inserting-commands latex-suite.txt /*inserting-commands* +inserting-env-f5 latex-suite.txt /*inserting-env-f5* +inserting-env-shift-f1 latex-suite.txt /*inserting-env-shift-f1* +inserting-env-threeletter latex-suite.txt /*inserting-env-threeletter* +inserting-environments latex-suite.txt /*inserting-environments* +inserting-packages latex-suite.txt /*inserting-packages* +inverse-searching latex-suite.txt /*inverse-searching* +itemize latexhelp.txt /*itemize* +landscape latexhelp.txt /*landscape* +latex latexhelp.txt /*latex* +latex-boxes latexhelp.txt /*latex-boxes* +latex-breaking latexhelp.txt /*latex-breaking* +latex-classes latexhelp.txt /*latex-classes* +latex-command-maps latex-suite.txt /*latex-command-maps* +latex-commands latexhelp.txt /*latex-commands* +latex-compiling latex-suite.txt /*latex-compiling* +latex-completion latex-suite.txt /*latex-completion* +latex-completion-cite latex-suite.txt /*latex-completion-cite* +latex-counters latexhelp.txt /*latex-counters* +latex-definitions latexhelp.txt /*latex-definitions* +latex-environments latexhelp.txt /*latex-environments* +latex-folding latex-suite.txt /*latex-folding* +latex-footnotes latexhelp.txt /*latex-footnotes* +latex-hor-space latexhelp.txt /*latex-hor-space* +latex-inputting latexhelp.txt /*latex-inputting* +latex-layout latexhelp.txt /*latex-layout* +latex-lengths latexhelp.txt /*latex-lengths* +latex-letters latexhelp.txt /*latex-letters* +latex-macros latex-suite.txt /*latex-macros* +latex-margin-notes latexhelp.txt /*latex-margin-notes* +latex-master-file latex-suite.txt /*latex-master-file* +latex-master-file-specification latex-suite.txt /*latex-master-file-specification* +latex-math latexhelp.txt /*latex-math* +latex-modes latexhelp.txt /*latex-modes* +latex-package-scanning latex-suite.txt /*latex-package-scanning* +latex-packages latex-suite.txt /*latex-packages* +latex-page-styles latexhelp.txt /*latex-page-styles* +latex-paragraphs latexhelp.txt /*latex-paragraphs* +latex-parameters latexhelp.txt /*latex-parameters* +latex-project latex-suite.txt /*latex-project* +latex-project-example latex-suite.txt /*latex-project-example* +latex-project-settings latex-suite.txt /*latex-project-settings* +latex-references latexhelp.txt /*latex-references* +latex-sectioning latexhelp.txt /*latex-sectioning* +latex-spaces-boxes latexhelp.txt /*latex-spaces-boxes* +latex-special latexhelp.txt /*latex-special* +latex-start-end latexhelp.txt /*latex-start-end* +latex-suite-commands latex-suite.txt /*latex-suite-commands* +latex-suite-commands-maps latex-suite.txt /*latex-suite-commands-maps* +latex-suite-credits latex-suite.txt /*latex-suite-credits* +latex-suite-maintainer latex-suite.txt /*latex-suite-maintainer* +latex-suite-maps latex-suite.txt /*latex-suite-maps* +latex-suite-quickstart.txt latex-suite-quickstart.txt /*latex-suite-quickstart.txt* +latex-suite-quickstart.txt-toc latex-suite-quickstart.txt /*latex-suite-quickstart.txt-toc* +latex-suite-templates latex-suite.txt /*latex-suite-templates* +latex-suite.txt latex-suite.txt /*latex-suite.txt* +latex-suite.txt-toc latex-suite.txt /*latex-suite.txt-toc* +latex-terminal latexhelp.txt /*latex-terminal* +latex-toc latexhelp.txt /*latex-toc* +latex-typefaces latexhelp.txt /*latex-typefaces* +latex-ver-space latexhelp.txt /*latex-ver-space* +latex-viewing latex-suite.txt /*latex-viewing* +latex-viewing-rules latex-suite.txt /*latex-viewing-rules* +latexhelp.txt latexhelp.txt /*latexhelp.txt* +leqno latexhelp.txt /*leqno* +letter-class latexhelp.txt /*letter-class* +list latexhelp.txt /*list* +lq_1 latex-suite-quickstart.txt /*lq_1* +lq_10 latex-suite-quickstart.txt /*lq_10* +lq_2 latex-suite-quickstart.txt /*lq_2* +lq_3 latex-suite-quickstart.txt /*lq_3* +lq_4 latex-suite-quickstart.txt /*lq_4* +lq_5 latex-suite-quickstart.txt /*lq_5* +lq_6 latex-suite-quickstart.txt /*lq_6* +lq_7 latex-suite-quickstart.txt /*lq_7* +lq_8 latex-suite-quickstart.txt /*lq_8* +lq_8_1 latex-suite-quickstart.txt /*lq_8_1* +lq_9 latex-suite-quickstart.txt /*lq_9* +lq_9_1 latex-suite-quickstart.txt /*lq_9_1* +lq_9_2 latex-suite-quickstart.txt /*lq_9_2* +lq_a_bc latex-suite-quickstart.txt /*lq_a_bc* +lq_a_bd latex-suite-quickstart.txt /*lq_a_bd* +lq_a_be latex-suite-quickstart.txt /*lq_a_be* +lq_a_bf latex-suite-quickstart.txt /*lq_a_bf* +lq_a_bg latex-suite-quickstart.txt /*lq_a_bg* +lq_a_bh latex-suite-quickstart.txt /*lq_a_bh* +lq_a_bi latex-suite-quickstart.txt /*lq_a_bi* +lq_a_bj latex-suite-quickstart.txt /*lq_a_bj* +lq_a_bk latex-suite-quickstart.txt /*lq_a_bk* +lq_a_bl latex-suite-quickstart.txt /*lq_a_bl* +lq_a_bm latex-suite-quickstart.txt /*lq_a_bm* +lq_a_bn latex-suite-quickstart.txt /*lq_a_bn* +lq_a_bo latex-suite-quickstart.txt /*lq_a_bo* +lq_u_1 latex-suite-quickstart.txt /*lq_u_1* +lq_u_2 latex-suite-quickstart.txt /*lq_u_2* +lq_u_3 latex-suite-quickstart.txt /*lq_u_3* +lq_u_4 latex-suite-quickstart.txt /*lq_u_4* +lq_u_5 latex-suite-quickstart.txt /*lq_u_5* +lq_u_6 latex-suite-quickstart.txt /*lq_u_6* +lq_u_7 latex-suite-quickstart.txt /*lq_u_7* +lq_u_8 latex-suite-quickstart.txt /*lq_u_8* +lq_u_9 latex-suite-quickstart.txt /*lq_u_9* +lr-mode latexhelp.txt /*lr-mode* +ls-completion-custom latex-suite.txt /*ls-completion-custom* +ls-completion-ref latex-suite.txt /*ls-completion-ref* +ls-completion-usage latex-suite.txt /*ls-completion-usage* +ls-filename-completion latex-suite.txt /*ls-filename-completion* +ls-general-purpose-settings latex-suite.txt /*ls-general-purpose-settings* +ls-imap-f7 latex-suite.txt /*ls-imap-f7* +ls-imap-s-f7 latex-suite.txt /*ls-imap-s-f7* +ls-imaps-syntax latex-suite.txt /*ls-imaps-syntax* +ls-new-macros latex-suite.txt /*ls-new-macros* +ls-set-grepprg latex-suite.txt /*ls-set-grepprg* +ls-vmap-f7 latex-suite.txt /*ls-vmap-f7* +ls_1 latex-suite.txt /*ls_1* +ls_10 latex-suite.txt /*ls_10* +ls_10_1 latex-suite.txt /*ls_10_1* +ls_10_1_1 latex-suite.txt /*ls_10_1_1* +ls_10_1_2 latex-suite.txt /*ls_10_1_2* +ls_10_2 latex-suite.txt /*ls_10_2* +ls_10_2_1 latex-suite.txt /*ls_10_2_1* +ls_10_2_10 latex-suite.txt /*ls_10_2_10* +ls_10_2_11 latex-suite.txt /*ls_10_2_11* +ls_10_2_12 latex-suite.txt /*ls_10_2_12* +ls_10_2_13 latex-suite.txt /*ls_10_2_13* +ls_10_2_14 latex-suite.txt /*ls_10_2_14* +ls_10_2_15 latex-suite.txt /*ls_10_2_15* +ls_10_2_16 latex-suite.txt /*ls_10_2_16* +ls_10_2_2 latex-suite.txt /*ls_10_2_2* +ls_10_2_3 latex-suite.txt /*ls_10_2_3* +ls_10_2_4 latex-suite.txt /*ls_10_2_4* +ls_10_2_5 latex-suite.txt /*ls_10_2_5* +ls_10_2_6 latex-suite.txt /*ls_10_2_6* +ls_10_2_7 latex-suite.txt /*ls_10_2_7* +ls_10_2_8 latex-suite.txt /*ls_10_2_8* +ls_10_2_9 latex-suite.txt /*ls_10_2_9* +ls_11 latex-suite.txt /*ls_11* +ls_11_1 latex-suite.txt /*ls_11_1* +ls_11_10 latex-suite.txt /*ls_11_10* +ls_11_10_1 latex-suite.txt /*ls_11_10_1* +ls_11_1_1 latex-suite.txt /*ls_11_1_1* +ls_11_1_2 latex-suite.txt /*ls_11_1_2* +ls_11_2 latex-suite.txt /*ls_11_2* +ls_11_2_1 latex-suite.txt /*ls_11_2_1* +ls_11_2_2 latex-suite.txt /*ls_11_2_2* +ls_11_2_3 latex-suite.txt /*ls_11_2_3* +ls_11_2_4 latex-suite.txt /*ls_11_2_4* +ls_11_3 latex-suite.txt /*ls_11_3* +ls_11_3_1 latex-suite.txt /*ls_11_3_1* +ls_11_3_10 latex-suite.txt /*ls_11_3_10* +ls_11_3_11 latex-suite.txt /*ls_11_3_11* +ls_11_3_12 latex-suite.txt /*ls_11_3_12* +ls_11_3_13 latex-suite.txt /*ls_11_3_13* +ls_11_3_2 latex-suite.txt /*ls_11_3_2* +ls_11_3_3 latex-suite.txt /*ls_11_3_3* +ls_11_3_4 latex-suite.txt /*ls_11_3_4* +ls_11_3_5 latex-suite.txt /*ls_11_3_5* +ls_11_3_6 latex-suite.txt /*ls_11_3_6* +ls_11_3_7 latex-suite.txt /*ls_11_3_7* +ls_11_3_8 latex-suite.txt /*ls_11_3_8* +ls_11_3_9 latex-suite.txt /*ls_11_3_9* +ls_11_4 latex-suite.txt /*ls_11_4* +ls_11_4_1 latex-suite.txt /*ls_11_4_1* +ls_11_4_2 latex-suite.txt /*ls_11_4_2* +ls_11_5 latex-suite.txt /*ls_11_5* +ls_11_5_1 latex-suite.txt /*ls_11_5_1* +ls_11_5_2 latex-suite.txt /*ls_11_5_2* +ls_11_5_3 latex-suite.txt /*ls_11_5_3* +ls_11_5_4 latex-suite.txt /*ls_11_5_4* +ls_11_5_5 latex-suite.txt /*ls_11_5_5* +ls_11_6 latex-suite.txt /*ls_11_6* +ls_11_6_1 latex-suite.txt /*ls_11_6_1* +ls_11_6_2 latex-suite.txt /*ls_11_6_2* +ls_11_6_3 latex-suite.txt /*ls_11_6_3* +ls_11_6_4 latex-suite.txt /*ls_11_6_4* +ls_11_6_5 latex-suite.txt /*ls_11_6_5* +ls_11_6_6 latex-suite.txt /*ls_11_6_6* +ls_11_6_7 latex-suite.txt /*ls_11_6_7* +ls_11_6_8 latex-suite.txt /*ls_11_6_8* +ls_11_7 latex-suite.txt /*ls_11_7* +ls_11_7_1 latex-suite.txt /*ls_11_7_1* +ls_11_7_2 latex-suite.txt /*ls_11_7_2* +ls_11_8 latex-suite.txt /*ls_11_8* +ls_11_8_1 latex-suite.txt /*ls_11_8_1* +ls_11_8_2 latex-suite.txt /*ls_11_8_2* +ls_11_8_3 latex-suite.txt /*ls_11_8_3* +ls_11_8_4 latex-suite.txt /*ls_11_8_4* +ls_11_8_5 latex-suite.txt /*ls_11_8_5* +ls_11_8_6 latex-suite.txt /*ls_11_8_6* +ls_11_8_7 latex-suite.txt /*ls_11_8_7* +ls_11_9 latex-suite.txt /*ls_11_9* +ls_11_9_1 latex-suite.txt /*ls_11_9_1* +ls_11_9_2 latex-suite.txt /*ls_11_9_2* +ls_12 latex-suite.txt /*ls_12* +ls_2 latex-suite.txt /*ls_2* +ls_3 latex-suite.txt /*ls_3* +ls_3_1 latex-suite.txt /*ls_3_1* +ls_3_10 latex-suite.txt /*ls_3_10* +ls_3_10_1 latex-suite.txt /*ls_3_10_1* +ls_3_10_2 latex-suite.txt /*ls_3_10_2* +ls_3_10_3 latex-suite.txt /*ls_3_10_3* +ls_3_10_4 latex-suite.txt /*ls_3_10_4* +ls_3_11 latex-suite.txt /*ls_3_11* +ls_3_12 latex-suite.txt /*ls_3_12* +ls_3_12_1 latex-suite.txt /*ls_3_12_1* +ls_3_12_2 latex-suite.txt /*ls_3_12_2* +ls_3_1_1 latex-suite.txt /*ls_3_1_1* +ls_3_1_1_1 latex-suite.txt /*ls_3_1_1_1* +ls_3_1_1_2 latex-suite.txt /*ls_3_1_1_2* +ls_3_1_1_3 latex-suite.txt /*ls_3_1_1_3* +ls_3_1_2 latex-suite.txt /*ls_3_1_2* +ls_3_1_2_1 latex-suite.txt /*ls_3_1_2_1* +ls_3_1_2_2 latex-suite.txt /*ls_3_1_2_2* +ls_3_1_3 latex-suite.txt /*ls_3_1_3* +ls_3_2 latex-suite.txt /*ls_3_2* +ls_3_2_1 latex-suite.txt /*ls_3_2_1* +ls_3_2_2 latex-suite.txt /*ls_3_2_2* +ls_3_2_3 latex-suite.txt /*ls_3_2_3* +ls_3_3 latex-suite.txt /*ls_3_3* +ls_3_4 latex-suite.txt /*ls_3_4* +ls_3_5 latex-suite.txt /*ls_3_5* +ls_3_6 latex-suite.txt /*ls_3_6* +ls_3_7 latex-suite.txt /*ls_3_7* +ls_3_8 latex-suite.txt /*ls_3_8* +ls_3_8_1 latex-suite.txt /*ls_3_8_1* +ls_3_9 latex-suite.txt /*ls_3_9* +ls_4 latex-suite.txt /*ls_4* +ls_4_1 latex-suite.txt /*ls_4_1* +ls_4_2 latex-suite.txt /*ls_4_2* +ls_4_3 latex-suite.txt /*ls_4_3* +ls_4_3_1 latex-suite.txt /*ls_4_3_1* +ls_4_4 latex-suite.txt /*ls_4_4* +ls_4_4_1 latex-suite.txt /*ls_4_4_1* +ls_4_4_2 latex-suite.txt /*ls_4_4_2* +ls_5 latex-suite.txt /*ls_5* +ls_5_1 latex-suite.txt /*ls_5_1* +ls_5_2 latex-suite.txt /*ls_5_2* +ls_5_3 latex-suite.txt /*ls_5_3* +ls_5_3_1 latex-suite.txt /*ls_5_3_1* +ls_5_4 latex-suite.txt /*ls_5_4* +ls_5_5 latex-suite.txt /*ls_5_5* +ls_6 latex-suite.txt /*ls_6* +ls_6_1 latex-suite.txt /*ls_6_1* +ls_6_2 latex-suite.txt /*ls_6_2* +ls_6_3 latex-suite.txt /*ls_6_3* +ls_6_4 latex-suite.txt /*ls_6_4* +ls_6_5 latex-suite.txt /*ls_6_5* +ls_7 latex-suite.txt /*ls_7* +ls_7_1 latex-suite.txt /*ls_7_1* +ls_7_2 latex-suite.txt /*ls_7_2* +ls_7_3 latex-suite.txt /*ls_7_3* +ls_8 latex-suite.txt /*ls_8* +ls_8_1 latex-suite.txt /*ls_8_1* +ls_8_2 latex-suite.txt /*ls_8_2* +ls_8_2_1 latex-suite.txt /*ls_8_2_1* +ls_8_2_2 latex-suite.txt /*ls_8_2_2* +ls_8_2_3 latex-suite.txt /*ls_8_2_3* +ls_8_2_4 latex-suite.txt /*ls_8_2_4* +ls_8_2_5 latex-suite.txt /*ls_8_2_5* +ls_8_3 latex-suite.txt /*ls_8_3* +ls_9 latex-suite.txt /*ls_9* +ls_9_1 latex-suite.txt /*ls_9_1* +ls_9_2 latex-suite.txt /*ls_9_2* +ls_a_bA latex-suite.txt /*ls_a_bA* +ls_a_bB latex-suite.txt /*ls_a_bB* +ls_a_bC latex-suite.txt /*ls_a_bC* +ls_a_bD latex-suite.txt /*ls_a_bD* +ls_a_bE latex-suite.txt /*ls_a_bE* +ls_a_bF latex-suite.txt /*ls_a_bF* +ls_a_bG latex-suite.txt /*ls_a_bG* +ls_a_bH latex-suite.txt /*ls_a_bH* +ls_a_bI latex-suite.txt /*ls_a_bI* +ls_a_bJ latex-suite.txt /*ls_a_bJ* +ls_a_bK latex-suite.txt /*ls_a_bK* +ls_a_bL latex-suite.txt /*ls_a_bL* +ls_a_bM latex-suite.txt /*ls_a_bM* +ls_a_bN latex-suite.txt /*ls_a_bN* +ls_a_bO latex-suite.txt /*ls_a_bO* +ls_a_bP latex-suite.txt /*ls_a_bP* +ls_a_bQ latex-suite.txt /*ls_a_bQ* +ls_a_bR latex-suite.txt /*ls_a_bR* +ls_a_bS latex-suite.txt /*ls_a_bS* +ls_a_bT latex-suite.txt /*ls_a_bT* +ls_a_bU latex-suite.txt /*ls_a_bU* +ls_a_bV latex-suite.txt /*ls_a_bV* +ls_a_bW latex-suite.txt /*ls_a_bW* +ls_a_bX latex-suite.txt /*ls_a_bX* +ls_a_bY latex-suite.txt /*ls_a_bY* +ls_a_bZ latex-suite.txt /*ls_a_bZ* +ls_a_bc latex-suite.txt /*ls_a_bc* +ls_a_bd latex-suite.txt /*ls_a_bd* +ls_a_be latex-suite.txt /*ls_a_be* +ls_a_bf latex-suite.txt /*ls_a_bf* +ls_a_bg latex-suite.txt /*ls_a_bg* +ls_a_bh latex-suite.txt /*ls_a_bh* +ls_a_bi latex-suite.txt /*ls_a_bi* +ls_a_bj latex-suite.txt /*ls_a_bj* +ls_a_bk latex-suite.txt /*ls_a_bk* +ls_a_bl latex-suite.txt /*ls_a_bl* +ls_a_bm latex-suite.txt /*ls_a_bm* +ls_a_bn latex-suite.txt /*ls_a_bn* +ls_a_bo latex-suite.txt /*ls_a_bo* +ls_a_bp latex-suite.txt /*ls_a_bp* +ls_a_bq latex-suite.txt /*ls_a_bq* +ls_a_br latex-suite.txt /*ls_a_br* +ls_a_bs latex-suite.txt /*ls_a_bs* +ls_a_bt latex-suite.txt /*ls_a_bt* +ls_a_bu latex-suite.txt /*ls_a_bu* +ls_a_bv latex-suite.txt /*ls_a_bv* +ls_a_bw latex-suite.txt /*ls_a_bw* +ls_a_bx latex-suite.txt /*ls_a_bx* +ls_a_by latex-suite.txt /*ls_a_by* +ls_a_bz latex-suite.txt /*ls_a_bz* +ls_a_cA latex-suite.txt /*ls_a_cA* +ls_a_cB latex-suite.txt /*ls_a_cB* +ls_a_cC latex-suite.txt /*ls_a_cC* +ls_a_cD latex-suite.txt /*ls_a_cD* +ls_a_cE latex-suite.txt /*ls_a_cE* +ls_a_cF latex-suite.txt /*ls_a_cF* +ls_a_cG latex-suite.txt /*ls_a_cG* +ls_a_cH latex-suite.txt /*ls_a_cH* +ls_a_cI latex-suite.txt /*ls_a_cI* +ls_a_cJ latex-suite.txt /*ls_a_cJ* +ls_a_cK latex-suite.txt /*ls_a_cK* +ls_a_cL latex-suite.txt /*ls_a_cL* +ls_a_cM latex-suite.txt /*ls_a_cM* +ls_a_cN latex-suite.txt /*ls_a_cN* +ls_a_cO latex-suite.txt /*ls_a_cO* +ls_a_cP latex-suite.txt /*ls_a_cP* +ls_a_cQ latex-suite.txt /*ls_a_cQ* +ls_a_cR latex-suite.txt /*ls_a_cR* +ls_a_cS latex-suite.txt /*ls_a_cS* +ls_a_cT latex-suite.txt /*ls_a_cT* +ls_a_cU latex-suite.txt /*ls_a_cU* +ls_a_cV latex-suite.txt /*ls_a_cV* +ls_a_cW latex-suite.txt /*ls_a_cW* +ls_a_cX latex-suite.txt /*ls_a_cX* +ls_a_cY latex-suite.txt /*ls_a_cY* +ls_a_cZ latex-suite.txt /*ls_a_cZ* +ls_a_ca latex-suite.txt /*ls_a_ca* +ls_a_cb latex-suite.txt /*ls_a_cb* +ls_a_cc latex-suite.txt /*ls_a_cc* +ls_a_cd latex-suite.txt /*ls_a_cd* +ls_a_ce latex-suite.txt /*ls_a_ce* +ls_a_cf latex-suite.txt /*ls_a_cf* +ls_a_cg latex-suite.txt /*ls_a_cg* +ls_a_ch latex-suite.txt /*ls_a_ch* +ls_a_ci latex-suite.txt /*ls_a_ci* +ls_a_cj latex-suite.txt /*ls_a_cj* +ls_a_ck latex-suite.txt /*ls_a_ck* +ls_a_cl latex-suite.txt /*ls_a_cl* +ls_a_cm latex-suite.txt /*ls_a_cm* +ls_a_cn latex-suite.txt /*ls_a_cn* +ls_a_co latex-suite.txt /*ls_a_co* +ls_a_cp latex-suite.txt /*ls_a_cp* +ls_a_cq latex-suite.txt /*ls_a_cq* +ls_a_cr latex-suite.txt /*ls_a_cr* +ls_a_cs latex-suite.txt /*ls_a_cs* +ls_a_ct latex-suite.txt /*ls_a_ct* +ls_a_cu latex-suite.txt /*ls_a_cu* +ls_a_cv latex-suite.txt /*ls_a_cv* +ls_a_cw latex-suite.txt /*ls_a_cw* +ls_a_cx latex-suite.txt /*ls_a_cx* +ls_a_cy latex-suite.txt /*ls_a_cy* +ls_a_cz latex-suite.txt /*ls_a_cz* +ls_a_dA latex-suite.txt /*ls_a_dA* +ls_a_dB latex-suite.txt /*ls_a_dB* +ls_a_dC latex-suite.txt /*ls_a_dC* +ls_a_dD latex-suite.txt /*ls_a_dD* +ls_a_dE latex-suite.txt /*ls_a_dE* +ls_a_dF latex-suite.txt /*ls_a_dF* +ls_a_dG latex-suite.txt /*ls_a_dG* +ls_a_dH latex-suite.txt /*ls_a_dH* +ls_a_dI latex-suite.txt /*ls_a_dI* +ls_a_dJ latex-suite.txt /*ls_a_dJ* +ls_a_dK latex-suite.txt /*ls_a_dK* +ls_a_dL latex-suite.txt /*ls_a_dL* +ls_a_dM latex-suite.txt /*ls_a_dM* +ls_a_dN latex-suite.txt /*ls_a_dN* +ls_a_dO latex-suite.txt /*ls_a_dO* +ls_a_dP latex-suite.txt /*ls_a_dP* +ls_a_dQ latex-suite.txt /*ls_a_dQ* +ls_a_dR latex-suite.txt /*ls_a_dR* +ls_a_dS latex-suite.txt /*ls_a_dS* +ls_a_dT latex-suite.txt /*ls_a_dT* +ls_a_dU latex-suite.txt /*ls_a_dU* +ls_a_dV latex-suite.txt /*ls_a_dV* +ls_a_dW latex-suite.txt /*ls_a_dW* +ls_a_dX latex-suite.txt /*ls_a_dX* +ls_a_dY latex-suite.txt /*ls_a_dY* +ls_a_dZ latex-suite.txt /*ls_a_dZ* +ls_a_da latex-suite.txt /*ls_a_da* +ls_a_db latex-suite.txt /*ls_a_db* +ls_a_dc latex-suite.txt /*ls_a_dc* +ls_a_dd latex-suite.txt /*ls_a_dd* +ls_a_de latex-suite.txt /*ls_a_de* +ls_a_df latex-suite.txt /*ls_a_df* +ls_a_dg latex-suite.txt /*ls_a_dg* +ls_a_dh latex-suite.txt /*ls_a_dh* +ls_a_di latex-suite.txt /*ls_a_di* +ls_a_dj latex-suite.txt /*ls_a_dj* +ls_a_dk latex-suite.txt /*ls_a_dk* +ls_a_dl latex-suite.txt /*ls_a_dl* +ls_a_dm latex-suite.txt /*ls_a_dm* +ls_a_dn latex-suite.txt /*ls_a_dn* +ls_a_do latex-suite.txt /*ls_a_do* +ls_a_dp latex-suite.txt /*ls_a_dp* +ls_a_dq latex-suite.txt /*ls_a_dq* +ls_a_dr latex-suite.txt /*ls_a_dr* +ls_a_ds latex-suite.txt /*ls_a_ds* +ls_a_dt latex-suite.txt /*ls_a_dt* +ls_a_du latex-suite.txt /*ls_a_du* +ls_a_dv latex-suite.txt /*ls_a_dv* +ls_a_dw latex-suite.txt /*ls_a_dw* +ls_a_dx latex-suite.txt /*ls_a_dx* +ls_a_dy latex-suite.txt /*ls_a_dy* +ls_a_dz latex-suite.txt /*ls_a_dz* +ls_a_eA latex-suite.txt /*ls_a_eA* +ls_a_eB latex-suite.txt /*ls_a_eB* +ls_a_eC latex-suite.txt /*ls_a_eC* +ls_a_eD latex-suite.txt /*ls_a_eD* +ls_a_eE latex-suite.txt /*ls_a_eE* +ls_a_eF latex-suite.txt /*ls_a_eF* +ls_a_eG latex-suite.txt /*ls_a_eG* +ls_a_ea latex-suite.txt /*ls_a_ea* +ls_a_eb latex-suite.txt /*ls_a_eb* +ls_a_ec latex-suite.txt /*ls_a_ec* +ls_a_ed latex-suite.txt /*ls_a_ed* +ls_a_ee latex-suite.txt /*ls_a_ee* +ls_a_ef latex-suite.txt /*ls_a_ef* +ls_a_eg latex-suite.txt /*ls_a_eg* +ls_a_eh latex-suite.txt /*ls_a_eh* +ls_a_ei latex-suite.txt /*ls_a_ei* +ls_a_ej latex-suite.txt /*ls_a_ej* +ls_a_ek latex-suite.txt /*ls_a_ek* +ls_a_el latex-suite.txt /*ls_a_el* +ls_a_em latex-suite.txt /*ls_a_em* +ls_a_en latex-suite.txt /*ls_a_en* +ls_a_eo latex-suite.txt /*ls_a_eo* +ls_a_ep latex-suite.txt /*ls_a_ep* +ls_a_eq latex-suite.txt /*ls_a_eq* +ls_a_er latex-suite.txt /*ls_a_er* +ls_a_es latex-suite.txt /*ls_a_es* +ls_a_et latex-suite.txt /*ls_a_et* +ls_a_eu latex-suite.txt /*ls_a_eu* +ls_a_ev latex-suite.txt /*ls_a_ev* +ls_a_ew latex-suite.txt /*ls_a_ew* +ls_a_ex latex-suite.txt /*ls_a_ex* +ls_a_ey latex-suite.txt /*ls_a_ey* +ls_a_ez latex-suite.txt /*ls_a_ez* +ls_u_1 latex-suite.txt /*ls_u_1* +ls_u_2 latex-suite.txt /*ls_u_2* +ls_u_3 latex-suite.txt /*ls_u_3* +ls_u_4 latex-suite.txt /*ls_u_4* +lsq-compiling latex-suite-quickstart.txt /*lsq-compiling* +lsq-conclusions latex-suite-quickstart.txt /*lsq-conclusions* +lsq-debugging latex-suite-quickstart.txt /*lsq-debugging* +lsq-folding latex-suite-quickstart.txt /*lsq-folding* +lsq-insert-environment latex-suite-quickstart.txt /*lsq-insert-environment* +lsq-inserting-reference latex-suite-quickstart.txt /*lsq-inserting-reference* +lsq-inserting-template latex-suite-quickstart.txt /*lsq-inserting-template* +lsq-keyboard-shortcuts latex-suite-quickstart.txt /*lsq-keyboard-shortcuts* +lsq-lsq-inserting-package latex-suite-quickstart.txt /*lsq-lsq-inserting-package* +lsq-quick-forward-searching latex-suite-quickstart.txt /*lsq-quick-forward-searching* +lsq-quick-inverse-searching latex-suite-quickstart.txt /*lsq-quick-inverse-searching* +lsq-using-tutorial latex-suite-quickstart.txt /*lsq-using-tutorial* +lsq-viewing-dvi latex-suite-quickstart.txt /*lsq-viewing-dvi* +macro-enabling latex-suite.txt /*macro-enabling* +math, latexhelp.txt /*math,* +math-misc latexhelp.txt /*math-misc* +math-mode latexhelp.txt /*math-mode* +math-spacing latexhelp.txt /*math-spacing* +math-symbols latexhelp.txt /*math-symbols* +math: latexhelp.txt /*math:* +math; latexhelp.txt /*math;* +matn! latexhelp.txt /*matn!* +minipage latexhelp.txt /*minipage* +notitlepage latexhelp.txt /*notitlepage* +onecolumn latexhelp.txt /*onecolumn* +oneside latexhelp.txt /*oneside* +openany latexhelp.txt /*openany* +openbib latexhelp.txt /*openbib* +openright latexhelp.txt /*openright* +otl2html vo_readme.txt.gz /*otl2html* +overriding-macros latex-suite.txt /*overriding-macros* +package-actions latex-suite.txt /*package-actions* +paragraph-mode latexhelp.txt /*paragraph-mode* +part-compiling latex-suite.txt /*part-compiling* +pausing-imaps latex-suite.txt /*pausing-imaps* +picture latexhelp.txt /*picture* +picture-makebox latexhelp.txt /*picture-makebox* +place-holder latex-suite.txt /*place-holder* +place-holders latex-suite.txt /*place-holders* +plain latexhelp.txt /*plain* +pre-lengths latexhelp.txt /*pre-lengths* +ps_color.txt ps_color.txt /*ps_color.txt* +ps_colour ps_color.txt /*ps_colour* +psc ps_color.txt /*psc* +psc-about-background ps_color.txt /*psc-about-background* +psc-change-background ps_color.txt /*psc-change-background* +psc-contents ps_color.txt /*psc-contents* +psc-cterm ps_color.txt /*psc-cterm* +psc-cterm-color-table ps_color.txt /*psc-cterm-color-table* +psc-cterm-incompatible ps_color.txt /*psc-cterm-incompatible* +psc-cterm-nt ps_color.txt /*psc-cterm-nt* +psc-cterm-others ps_color.txt /*psc-cterm-others* +psc-cterm-xterm ps_color.txt /*psc-cterm-xterm* +psc-faq ps_color.txt /*psc-faq* +psc-faq-ffothers ps_color.txt /*psc-faq-ffothers* +psc-features ps_color.txt /*psc-features* +psc-options ps_color.txt /*psc-options* +psc-overview ps_color.txt /*psc-overview* +psc-release-notes ps_color.txt /*psc-release-notes* +psc-tips ps_color.txt /*psc-tips* +psc-todo ps_color.txt /*psc-todo* +psc-usage ps_color.txt /*psc-usage* +psc_cterm_style ps_color.txt /*psc_cterm_style* +psc_fontface ps_color.txt /*psc_fontface* +psc_inversed_todo ps_color.txt /*psc_inversed_todo* +psc_statement_different_from_type ps_color.txt /*psc_statement_different_from_type* +psc_style ps_color.txt /*psc_style* +psc_use_default_for_cterm ps_color.txt /*psc_use_default_for_cterm* +pscolor ps_color.txt /*pscolor* +quotation latexhelp.txt /*quotation* +quote-l latexhelp.txt /*quote-l* +recommended-settings latex-suite.txt /*recommended-settings* +remapping-latex-suite-keys latex-suite.txt /*remapping-latex-suite-keys* +report-class latexhelp.txt /*report-class* +roman latexhelp.txt /*roman* +rqno latexhelp.txt /*rqno* +section-mappings latex-suite.txt /*section-mappings* +slides-class latexhelp.txt /*slides-class* +smart-backspace latex-suite.txt /*smart-backspace* +smart-keys latex-suite.txt /*smart-keys* +sub-sup latexhelp.txt /*sub-sup* +subscripts latexhelp.txt /*subscripts* +superscripts latexhelp.txt /*superscripts* +supporting-packages latex-suite.txt /*supporting-packages* +tab' latexhelp.txt /*tab'* +tab+ latexhelp.txt /*tab+* +tab- latexhelp.txt /*tab-* +tab< latexhelp.txt /*tab<* +tab= latexhelp.txt /*tab=* +tab> latexhelp.txt /*tab>* +tab` latexhelp.txt /*tab`* +taba latexhelp.txt /*taba* +tabbing latexhelp.txt /*tabbing* +tabular latexhelp.txt /*tabular* +taglist-commands taglist.txt /*taglist-commands* +taglist-debug taglist.txt /*taglist-debug* +taglist-extend taglist.txt /*taglist-extend* +taglist-faq taglist.txt /*taglist-faq* +taglist-functions taglist.txt /*taglist-functions* +taglist-install taglist.txt /*taglist-install* +taglist-internet taglist.txt /*taglist-internet* +taglist-intro taglist.txt /*taglist-intro* +taglist-keys taglist.txt /*taglist-keys* +taglist-license taglist.txt /*taglist-license* +taglist-menu taglist.txt /*taglist-menu* +taglist-options taglist.txt /*taglist-options* +taglist-requirements taglist.txt /*taglist-requirements* +taglist-session taglist.txt /*taglist-session* +taglist-todo taglist.txt /*taglist-todo* +taglist-using taglist.txt /*taglist-using* +taglist.txt taglist.txt /*taglist.txt* +theorem latexhelp.txt /*theorem* +titlepage latexhelp.txt /*titlepage* +twocolumn latexhelp.txt /*twocolumn* +twoside latexhelp.txt /*twoside* +verbatim latexhelp.txt /*verbatim* +verse latexhelp.txt /*verse* +vimoutliner vo_readme.txt.gz /*vimoutliner* +vo vo_readme.txt.gz /*vo* +vo-activities vo_readme.txt.gz /*vo-activities* +vo-advanced vo_readme.txt.gz /*vo-advanced* +vo-cautions vo_readme.txt.gz /*vo-cautions* +vo-checkbox vo_readme.txt.gz /*vo-checkbox* +vo-color vo_readme.txt.gz /*vo-color* +vo-command vo_readme.txt.gz /*vo-command* +vo-debian vo_readme.txt.gz /*vo-debian* +vo-executable-lines vo_readme.txt.gz /*vo-executable-lines* +vo-hoisting vo_readme.txt.gz /*vo-hoisting* +vo-install vo_readme.txt.gz /*vo-install* +vo-license vo_readme.txt.gz /*vo-license* +vo-maketags vo_readme.txt.gz /*vo-maketags* +vo-menu vo_readme.txt.gz /*vo-menu* +vo-objects vo_readme.txt.gz /*vo-objects* +vo-other-files vo_readme.txt.gz /*vo-other-files* +vo-other-info vo_readme.txt.gz /*vo-other-info* +vo-philosophy vo_readme.txt.gz /*vo-philosophy* +vo-plugins vo_readme.txt.gz /*vo-plugins* +vo-post-processors vo_readme.txt.gz /*vo-post-processors* +vo-running vo_readme.txt.gz /*vo-running* +vo-scripts vo_readme.txt.gz /*vo-scripts* +vo-testing vo_readme.txt.gz /*vo-testing* +vo-troubleshooting vo_readme.txt.gz /*vo-troubleshooting* +vo-version vo_readme.txt.gz /*vo-version* +vo_readme.txt vo_readme.txt.gz /*vo_readme.txt* +why-IMAP latex-suite.txt /*why-IMAP* diff --git a/dot_vim/filetype.vim b/dot_vim/filetype.vim new file mode 100644 index 0000000..e5a223d --- /dev/null +++ b/dot_vim/filetype.vim @@ -0,0 +1,4 @@ +" RELAX NG Compact Syntax +augroup filetypedetect + au! BufRead,BufNewFile *.rnc setfiletype rnc +augroup END diff --git a/dot_vim/ftdetect/beluga.vim b/dot_vim/ftdetect/beluga.vim new file mode 100644 index 0000000..0a7ed67 --- /dev/null +++ b/dot_vim/ftdetect/beluga.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.bel set filetype=beluga diff --git a/dot_vim/ftplugin/beluga.vim b/dot_vim/ftplugin/beluga.vim new file mode 100644 index 0000000..b4c3e84 --- /dev/null +++ b/dot_vim/ftplugin/beluga.vim @@ -0,0 +1 @@ +map <LocalLeader>s :syn sync fromstart<CR>:se fdm=manual<CR>:se fdm=indent<CR> diff --git a/dot_vim/ftplugin/bib_latexSuite.vim b/dot_vim/ftplugin/bib_latexSuite.vim new file mode 100644 index 0000000..6b803af --- /dev/null +++ b/dot_vim/ftplugin/bib_latexSuite.vim @@ -0,0 +1,16 @@ +" File: bib_latexSuite.vim +" Author: Srinath Avadhanula +" License: Vim Charityware License +" Description: +" This file sources the bibtex.vim file distributed as part of latex-suite. +" That file sets up 3 maps BBB, BAS, and BBA which are easy wasy to type in +" bibliographic entries. +" +" CVS: $Id: bib_latexSuite.vim 997 2006-03-20 09:45:45Z srinathava $ + +" source main.vim because we need a few functions from it. +runtime ftplugin/latex-suite/main.vim +" Disable smart-quotes because we need to enter real quotes in bib files. +runtime ftplugin/latex-suite/bibtex.vim + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/dot_vim/ftplugin/c.vim b/dot_vim/ftplugin/c.vim new file mode 100644 index 0000000..ff5a637 --- /dev/null +++ b/dot_vim/ftplugin/c.vim @@ -0,0 +1,294 @@ +" Vim filetype plugin file +" +" Language : C / C++ +" Plugin : c.vim (version 5.0) +" Maintainer : Fritz Mehner <mehner@fh-swf.de> +" Revision : $Id: c.vim,v 1.18 2007/11/20 18:12:02 mehner Exp $ +" +" This will enable keyword completion for C and C++ +" using Vim's dictionary feature |i_CTRL-X_CTRL-K|. +" ----------------------------------------------------------------- +" +" Only do this when not done yet for this buffer +" +if exists("b:did_C_ftplugin") + finish +endif +let b:did_C_ftplugin = 1 +" +" ---------- C/C++ dictionary ----------------------------------- +" +if exists("g:C_Dictionary_File") + silent! exec 'setlocal dictionary+='.g:C_Dictionary_File +endif +" +" ---------- F-key mappings ------------------------------------ +" +" Alt-F9 write buffer and compile +" F9 compile and link +" Ctrl-F9 run executable +" Shift-F9 command line arguments +" + map <buffer> <silent> <A-F9> <C-C>:call C_Compile()<CR>:redraw<CR>:call C_HlMessage()<CR> +imap <buffer> <silent> <A-F9> <C-C><C-C>:call C_Compile()<CR>:redraw<CR>:call C_HlMessage()<CR> +" + map <buffer> <silent> <F9> <C-C>:call C_Link()<CR>:redraw<CR>:call C_HlMessage()<CR> +imap <buffer> <silent> <F9> <C-C><C-C>:call C_Link()<CR>:redraw<CR>:call C_HlMessage()<CR> +" +" <C-C> seems to be essential here: + map <buffer> <silent> <C-F9> <C-C>:call C_Run()<CR> +imap <buffer> <silent> <C-F9> <C-C><C-C>:call C_Run()<CR> +" + map <buffer> <silent> <S-F9> <C-C>:call C_Arguments()<CR> +imap <buffer> <silent> <S-F9> <C-C><C-C>:call C_Arguments()<CR> +" +" alternate file plugin +" +"if exists("loaded_alternateFile") +" map <buffer> <silent> <S-F2> <C-C>:A<CR> +"imap <buffer> <silent> <S-F2> <C-C><C-C>:A<CR> +"endif +" +" +" ---------- KEY MAPPINGS : MENU ENTRIES ------------------------------------- +" +" ---------- comments menu ------------------------------------------------ +" + + noremap <buffer> <silent> <Leader>cl <Esc>:call C_LineEndComment()<CR> +inoremap <buffer> <silent> <Leader>cl <Esc>:call C_LineEndComment()<CR>a +vnoremap <buffer> <silent> <Leader>cl <Esc>:call C_MultiLineEndComments()<CR> + noremap <buffer> <silent> <Leader>cj <Esc>:call C_AdjustLineEndComm("a")<CR> +vnoremap <buffer> <silent> <Leader>cj <Esc>:call C_AdjustLineEndComm("v")<CR> +inoremap <buffer> <silent> <Leader>cj <Esc>:call C_AdjustLineEndComm("a")<CR>a + noremap <buffer> <silent> <Leader>cs <Esc>:call C_GetLineEndCommCol()<CR> + noremap <buffer> <silent> <Leader>c* <Esc>:call C_CodeComment("a","yes")<CR><Esc>:nohlsearch<CR>j +vnoremap <buffer> <silent> <Leader>c* <Esc>:call C_CodeComment("v","yes")<CR><Esc>:nohlsearch<CR>j + noremap <buffer> <silent> <Leader>c/ <Esc>:call C_CodeComment("a","no")<CR><Esc>:nohlsearch<CR>j +vnoremap <buffer> <silent> <Leader>c/ <Esc>:call C_CodeComment("v","no")<CR><Esc>:nohlsearch<CR>j + noremap <buffer> <silent> <Leader>co <Esc>:call C_CommentCode("a")<CR><Esc>:nohlsearch<CR> +vnoremap <buffer> <silent> <Leader>co <Esc>:call C_CommentCode("v")<CR><Esc>:nohlsearch<CR> + + noremap <buffer> <silent> <Leader>cfr <Esc>:call C_InsertTemplate("comment.frame")<CR> + noremap <buffer> <silent> <Leader>cfu <Esc>:call C_InsertTemplate("comment.function")<CR> + noremap <buffer> <silent> <Leader>cme <Esc>:call C_InsertTemplate("comment.method")<CR> + noremap <buffer> <silent> <Leader>ccl <Esc>:call C_InsertTemplate("comment.class")<CR> + +inoremap <buffer> <silent> <Leader>cfr <Esc>:call C_InsertTemplate("comment.frame")<CR> +inoremap <buffer> <silent> <Leader>cfu <Esc>:call C_InsertTemplate("comment.function")<CR> +inoremap <buffer> <silent> <Leader>cme <Esc>:call C_InsertTemplate("comment.method")<CR> +inoremap <buffer> <silent> <Leader>ccl <Esc>:call C_InsertTemplate("comment.class")<CR> + + noremap <buffer> <silent> <Leader>cd a<C-R>=C_InsertDateAndTime('d')<CR> +inoremap <buffer> <silent> <Leader>cd <C-R>=C_InsertDateAndTime('d')<CR> + noremap <buffer> <silent> <Leader>ct a<C-R>=C_InsertDateAndTime('dt')<CR> +inoremap <buffer> <silent> <Leader>ct <C-R>=C_InsertDateAndTime('dt')<CR> +" +" ---------- statements menu ------------------------------------------------ +" + noremap <buffer> <silent> <Leader>sd <Esc>:call C_InsertTemplate("statements.do-while")<CR> +vnoremap <buffer> <silent> <Leader>sd <Esc>:call C_InsertTemplate("statements.do-while", "v")<CR> +inoremap <buffer> <silent> <Leader>sd <Esc>:call C_InsertTemplate("statements.do-while")<CR> + + noremap <buffer> <silent> <Leader>sf <Esc>:call C_InsertTemplate("statements.for")<CR> +inoremap <buffer> <silent> <Leader>sf <Esc>:call C_InsertTemplate("statements.for")<CR> + + noremap <buffer> <silent> <Leader>sfo <Esc>:call C_InsertTemplate("statements.for-block")<CR> +vnoremap <buffer> <silent> <Leader>sfo <Esc>:call C_InsertTemplate("statements.for-block", "v")<CR> +inoremap <buffer> <silent> <Leader>sfo <Esc>:call C_InsertTemplate("statements.for-block")<CR> + + noremap <buffer> <silent> <Leader>si <Esc>:call C_InsertTemplate("statements.if")<CR> +inoremap <buffer> <silent> <Leader>si <Esc>:call C_InsertTemplate("statements.if")<CR> + + noremap <buffer> <silent> <Leader>sif <Esc>:call C_InsertTemplate("statements.if-block")<CR> +vnoremap <buffer> <silent> <Leader>sif <Esc>:call C_InsertTemplate("statements.if-block", "v")<CR> +inoremap <buffer> <silent> <Leader>sif <Esc>:call C_InsertTemplate("statements.if-block")<CR> + + noremap <buffer> <silent> <Leader>sie <Esc>:call C_InsertTemplate("statements.if-else")<CR> +vnoremap <buffer> <silent> <Leader>sie <Esc>:call C_InsertTemplate("statements.if-else", "v")<CR> +inoremap <buffer> <silent> <Leader>sie <Esc>:call C_InsertTemplate("statements.if-else")<CR> + + noremap <buffer> <silent> <Leader>sife <Esc>:call C_InsertTemplate("statements.if-block-else")<CR> +vnoremap <buffer> <silent> <Leader>sife <Esc>:call C_InsertTemplate("statements.if-block-else", "v")<CR> +inoremap <buffer> <silent> <Leader>sife <Esc>:call C_InsertTemplate("statements.if-block-else")<CR> + + noremap <buffer> <silent> <Leader>sw <Esc>:call C_InsertTemplate("statements.while")<CR> +inoremap <buffer> <silent> <Leader>sw <Esc>:call C_InsertTemplate("statements.while")<CR> + + noremap <buffer> <silent> <Leader>swh <Esc>:call C_InsertTemplate("statements.while-block")<CR> +vnoremap <buffer> <silent> <Leader>swh <Esc>:call C_InsertTemplate("statements.while-block", "v")<CR> +inoremap <buffer> <silent> <Leader>swh <Esc>:call C_InsertTemplate("statements.while-block")<CR> + + noremap <buffer> <silent> <Leader>ss <Esc>:call C_InsertTemplate("statements.switch")<CR> +vnoremap <buffer> <silent> <Leader>ss <Esc>:call C_InsertTemplate("statements.switch", "v")<CR> +inoremap <buffer> <silent> <Leader>ss <Esc>:call C_InsertTemplate("statements.switch")<CR> + + noremap <buffer> <silent> <Leader>sc <Esc>:call C_InsertTemplate("statements.case")<CR> +inoremap <buffer> <silent> <Leader>sc <Esc>:call C_InsertTemplate("statements.case")<CR> + + noremap <buffer> <silent> <Leader>s{ <Esc>:call C_InsertTemplate("statements.block")<CR> +vnoremap <buffer> <silent> <Leader>s{ <Esc>:call C_InsertTemplate("statements.block", "v")<CR> +inoremap <buffer> <silent> <Leader>s{ <Esc>:call C_InsertTemplate("statements.block")<CR> +" +" ---------- preprocessor menu ---------------------------------------------- +" +inoremap <buffer> <silent> <Leader>p< <Esc><Esc>o#include<Tab><><Left> +inoremap <buffer> <silent> <Leader>p" <Esc><Esc>o#include<Tab>""<Left> +inoremap <buffer> <silent> <Leader>pd <Esc><Esc>:call C_InsertTemplate("preprocessor.define")<CR> +inoremap <buffer> <silent> <Leader>pu <Esc><Esc>:call C_InsertTemplate("preprocessor.undefine")<CR> +" + noremap <buffer> <silent> <Leader>p< <Esc><Esc>o#include<Tab><><Left> + noremap <buffer> <silent> <Leader>p" <Esc><Esc>o#include<Tab>""<Left> + noremap <buffer> <silent> <Leader>pd <Esc><Esc>:call C_InsertTemplate("preprocessor.define")<CR> + noremap <buffer> <silent> <Leader>pu <Esc><Esc>:call C_InsertTemplate("preprocessor.undefine")<CR> + + noremap <buffer> <silent> <Leader>pie <Esc><Esc>:call C_InsertTemplate("preprocessor.if-else-endif")<CR> + noremap <buffer> <silent> <Leader>pid <Esc><Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR> + noremap <buffer> <silent> <Leader>pin <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR> + noremap <buffer> <silent> <Leader>pind <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR> + noremap <buffer> <silent> <Leader>pi0 <Esc><Esc>:call C_PPIf0("a")<CR>2ji + +vnoremap <buffer> <silent> <Leader>pie <Esc><Esc>:call C_InsertTemplate("preprocessor.if-else-endif", "v")<CR> +vnoremap <buffer> <silent> <Leader>pid <Esc><Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif", "v")<CR> +vnoremap <buffer> <silent> <Leader>pin <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif", "v")<CR> +vnoremap <buffer> <silent> <Leader>pind <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif", "v")<CR> +vnoremap <buffer> <silent> <Leader>pi0 <Esc><Esc>:call C_PPIf0("v")<CR> + +inoremap <buffer> <silent> <Leader>pie <Esc><Esc>:call C_InsertTemplate("preprocessor.if-else-endif")<CR> +inoremap <buffer> <silent> <Leader>pid <Esc><Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR> +inoremap <buffer> <silent> <Leader>pin <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR> +inoremap <buffer> <silent> <Leader>pind <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR> +inoremap <buffer> <silent> <Leader>pi0 <Esc><Esc>:call C_PPIf0("a")<CR>2ji + + noremap <buffer> <silent> <Leader>pr0 <Esc><Esc>:call C_PPIf0Remove()<CR> +" +" ---------- idioms menu ---------------------------------------------------- +" + noremap <buffer> <silent> <Leader>if <Esc>:call C_InsertTemplate("idioms.function")<CR> +vnoremap <buffer> <silent> <Leader>if <Esc>:call C_InsertTemplate("idioms.function", "v")<CR> +inoremap <buffer> <silent> <Leader>if <Esc>:call C_InsertTemplate("idioms.function")<CR> + noremap <buffer> <silent> <Leader>isf <Esc>:call C_InsertTemplate("idioms.function-static")<CR> +vnoremap <buffer> <silent> <Leader>isf <Esc>:call C_InsertTemplate("idioms.function-static", "v")<CR> +inoremap <buffer> <silent> <Leader>isf <Esc>:call C_InsertTemplate("idioms.function-static")<CR> + noremap <buffer> <silent> <Leader>im <Esc>:call C_InsertTemplate("idioms.main")<CR> +vnoremap <buffer> <silent> <Leader>im <Esc>:call C_InsertTemplate("idioms.main", "v")<CR> +inoremap <buffer> <silent> <Leader>im <Esc>:call C_InsertTemplate("idioms.main")<CR> +" + noremap <buffer> <silent> <Leader>i0 <Esc>:call C_CodeFor("up" , "a")<CR>a +vnoremap <buffer> <silent> <Leader>i0 <Esc>:call C_CodeFor("up" , "v")<CR> +inoremap <buffer> <silent> <Leader>i0 <Esc>:call C_CodeFor("up" , "a")<CR>a + noremap <buffer> <silent> <Leader>in <Esc>:call C_CodeFor("down", "a")<CR>a +vnoremap <buffer> <silent> <Leader>in <Esc>:call C_CodeFor("down", "v")<CR> +inoremap <buffer> <silent> <Leader>in <Esc>:call C_CodeFor("down", "a")<CR>a +" + noremap <buffer> <silent> <Leader>ie <Esc>:call C_InsertTemplate("idioms.enum")<CR> +vnoremap <buffer> <silent> <Leader>ie <Esc>:call C_InsertTemplate("idioms.enum" , "v")<CR> +inoremap <buffer> <silent> <Leader>ie <Esc>:call C_InsertTemplate("idioms.enum")<CR> + noremap <buffer> <silent> <Leader>is <Esc>:call C_InsertTemplate("idioms.struct")<CR> +vnoremap <buffer> <silent> <Leader>is <Esc>:call C_InsertTemplate("idioms.struct", "v")<CR> +inoremap <buffer> <silent> <Leader>is <Esc>:call C_InsertTemplate("idioms.struct")<CR> + noremap <buffer> <silent> <Leader>iu <Esc>:call C_InsertTemplate("idioms.union")<CR> +vnoremap <buffer> <silent> <Leader>iu <Esc>:call C_InsertTemplate("idioms.union" , "v")<CR> +inoremap <buffer> <silent> <Leader>iu <Esc>:call C_InsertTemplate("idioms.union")<CR> +" + noremap <buffer> <silent> <Leader>ip <Esc><Esc>oprintf("\n");<Esc>2F"a +inoremap <buffer> <silent> <Leader>ip printf("\n");<Esc>2F"a + noremap <buffer> <silent> <Leader>isc <Esc><Esc>oscanf("", & );<Esc>F"i +inoremap <buffer> <silent> <Leader>isc scanf("", & );<Esc>F"i +" + noremap <buffer> <silent> <Leader>ica <Esc>:call C_InsertTemplate("idioms.calloc") +inoremap <buffer> <silent> <Leader>ica <Esc>:call C_InsertTemplate("idioms.calloc") + noremap <buffer> <silent> <Leader>ima <Esc>:call C_InsertTemplate("idioms.malloc")<CR> +inoremap <buffer> <silent> <Leader>ima <Esc>:call C_InsertTemplate("idioms.malloc")<CR> +" + noremap <buffer> <silent> <Leader>isi isizeof()<Left> +vnoremap <buffer> <silent> <Leader>isi ssizeof()<Esc>P +inoremap <buffer> <silent> <Leader>isi sizeof()<Left> + noremap <buffer> <silent> <Leader>ias <Esc><Esc>oassert();<Left><Left> +vnoremap <buffer> <silent> <Leader>ias sassert();<Esc>F(p +inoremap <buffer> <silent> <Leader>ias assert();<Left><Left> +" + noremap <buffer> <silent> <Leader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file")<CR> +inoremap <buffer> <silent> <Leader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file")<CR> + noremap <buffer> <silent> <Leader>io <Esc>:call C_InsertTemplate("idioms.open-output-file")<CR> +inoremap <buffer> <silent> <Leader>io <Esc>:call C_InsertTemplate("idioms.open-output-file")<CR> +" +" ---------- snippet menu ---------------------------------------------------- +" + noremap <buffer> <silent> <Leader>nr <Esc>:call C_CodeSnippet("r")<CR> + noremap <buffer> <silent> <Leader>nw <Esc>:call C_CodeSnippet("w")<CR> +vnoremap <buffer> <silent> <Leader>nw <Esc>:call C_CodeSnippet("wv")<CR> + noremap <buffer> <silent> <Leader>ne <Esc>:call C_CodeSnippet("e")<CR> +" + noremap <buffer> <silent> <Leader>np <Esc>:call C_ProtoPick("n")<CR> +vnoremap <buffer> <silent> <Leader>np <Esc>:call C_ProtoPick("v")<CR> + noremap <buffer> <silent> <Leader>ni <Esc>:call C_ProtoInsert()<CR> + noremap <buffer> <silent> <Leader>nc <Esc>:call C_ProtoClear()<CR> + noremap <buffer> <silent> <Leader>ns <Esc>:call C_ProtoShow()<CR> +" +" ---------- C++ menu ---------------------------------------------------- +" + noremap <buffer> <silent> <Leader>+m <Esc>:call C_InsertTemplate("cpp.method-implementation")<CR> +inoremap <buffer> <silent> <Leader>+m <Esc>:call C_InsertTemplate("cpp.method-implementation")<CR> + noremap <buffer> <silent> <Leader>+c <Esc>:call C_InsertTemplate("cpp.class")<CR> +inoremap <buffer> <silent> <Leader>+c <Esc>:call C_InsertTemplate("cpp.class")<CR> + noremap <buffer> <silent> <Leader>+cn <Esc>:call C_InsertTemplate("cpp.class-using-new")<CR> +inoremap <buffer> <silent> <Leader>+cn <Esc>:call C_InsertTemplate("cpp.class-using-new")<CR> + + noremap <buffer> <silent> <Leader>+tm <Esc>:call C_InsertTemplate("cpp.template-method-implementation")<CR> +inoremap <buffer> <silent> <Leader>+tm <Esc>:call C_InsertTemplate("cpp.template-method-implementation")<CR> + noremap <buffer> <silent> <Leader>+tc <Esc>:call C_InsertTemplate("cpp.template-class")<CR> +inoremap <buffer> <silent> <Leader>+tc <Esc>:call C_InsertTemplate("cpp.template-class")<CR> + noremap <buffer> <silent> <Leader>+tcn <Esc>:call C_InsertTemplate("cpp.template-class-using-new")<CR> +inoremap <buffer> <silent> <Leader>+tcn <Esc>:call C_InsertTemplate("cpp.template-class-using-new")<CR> + + noremap <buffer> <silent> <Leader>+tf <Esc>:call C_InsertTemplate("cpp.template-function")<CR> +inoremap <buffer> <silent> <Leader>+tf <Esc>:call C_InsertTemplate("cpp.template-function")<CR> + + noremap <buffer> <silent> <Leader>+ec <Esc>:call C_InsertTemplate("cpp.error-class")<CR> +inoremap <buffer> <silent> <Leader>+ec <Esc>:call C_InsertTemplate("cpp.error-class")<CR> + + noremap <buffer> <silent> <Leader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch")<CR> +vnoremap <buffer> <silent> <Leader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch", "v")<CR> +inoremap <buffer> <silent> <Leader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch")<CR> + + noremap <buffer> <silent> <Leader>+ca <Esc>:call C_InsertTemplate("cpp.catch")<CR> +vnoremap <buffer> <silent> <Leader>+ca <Esc>:call C_InsertTemplate("cpp.catch", "v")<CR> +inoremap <buffer> <silent> <Leader>+ca <Esc>:call C_InsertTemplate("cpp.catch")<CR> + + noremap <buffer> <silent> <Leader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points")<CR> +vnoremap <buffer> <silent> <Leader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points", "v")<CR> +inoremap <buffer> <silent> <Leader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points")<CR> +" +" +" ---------- run menu -------------------------------------------------------- +" + map <buffer> <silent> <Leader>rc <C-C>:call C_Compile()<CR>:redraw<CR>:call C_HlMessage()<CR> + map <buffer> <silent> <Leader>rl <C-C>:call C_Link()<CR>:redraw<CR>:call C_HlMessage()<CR> + map <buffer> <silent> <Leader>rr <C-C>:call C_Run()<CR> + map <buffer> <silent> <Leader>ra <C-C>:call C_Arguments()<CR> + map <buffer> <silent> <Leader>rm <C-C>:call C_Make()<CR> + map <buffer> <silent> <Leader>rg <C-C>:call C_MakeArguments()<CR> + map <buffer> <silent> <Leader>rp <C-C>:call C_SplintCheck()<CR>:redraw<CR>:call C_HlMessage()<CR> + map <buffer> <silent> <Leader>ri <C-C>:call C_SplintArguments()<CR> + map <buffer> <silent> <Leader>rd <C-C>:call C_Indent("a")<CR>:redraw<CR>:call C_HlMessage()<CR> +vmap <buffer> <silent> <Leader>rd <C-C>:call C_Indent("v")<CR>:redraw<CR>:call C_HlMessage()<CR> + map <buffer> <silent> <Leader>rh <C-C>:call C_Hardcopy("n")<CR> +vmap <buffer> <silent> <Leader>rh <C-C>:call C_Hardcopy("v")<CR> + map <buffer> <silent> <Leader>rs <C-C>:call C_Settings()<CR> + map <buffer> <silent> <Leader>rt <C-C>:call C_RebuildTemplates()<CR> + if has("unix") + map <buffer> <silent> <Leader>rx <C-C>:call C_XtermSize()<CR> + endif + map <buffer> <silent> <Leader>ro <C-C>:call C_Toggle_Gvim_Xterm()<CR> +" +" Abraxas CodeCheck (R) +" +if executable("check") + map <buffer> <silent> <Leader>rk <C-C>:call C_CodeCheck()<CR>:redraw<CR>:call C_HlMessage()<CR> + map <buffer> <silent> <Leader>re <C-C>:call C_CodeCheckArguments()<CR> +endif +" ---------- plugin help ----------------------------------------------------- +" + map <buffer> <silent> <Leader>h <Esc>:call C_HelpCsupport()<CR> +" diff --git a/dot_vim/ftplugin/cpp.vim b/dot_vim/ftplugin/cpp.vim new file mode 100644 index 0000000..79b3445 --- /dev/null +++ b/dot_vim/ftplugin/cpp.vim @@ -0,0 +1,164 @@ +" Line numbering +set number +" Set syntax highlighting +syntax on +" Tabbing +set et +set shiftwidth=4 +set smarttab +set autoindent +" Complete Brackets { +" +" }" +" Complete quotes" +inoremap " ""<Left> +" We want a mouse in consoles, so:" +set mouse=a +" +"=============================================================================== +"========== load example vimrc from the distribution ========================= +"=============================================================================== +" +runtime vimrc_example.vim +" +filetype plugin on +" +"=============================================================================== +"========== CUSTOMIZATION (vimrc) ============================================ +"=============================================================================== +" +" Platform specific items: +" - central backup directory (has to be created) +" - default dictionary +" Uncomment your choice. +if has("win16") || has("win32") || has("win64") || + \ has("win95") || has("win32unix") + " +" runtime mswin.vim +" set backupdir =$VIM\vimfiles\backupdir +" set dictionary=$VIM\vimfiles\wordlists/german.list +else +" set backupdir =$HOME/.vim.backupdir +" set dictionary=$HOME/.vim/wordlists/german.list +endif +" +" Using a backupdir under UNIX/Linux: you may want to include a line similar to +" find $HOME/.vim.backupdir -name "*" -type f -mtime +60 -exec rm -f {} \; +" in one of your shell startup files (e.g. $HOME/.profile) +" +"------------------------------------------------------------------------------- +" Use of dictionaries +"------------------------------------------------------------------------------- +" +set complete+=k " scan the files given with the 'dictionary' option +" +"------------------------------------------------------------------------------- +" Various settings +"------------------------------------------------------------------------------- +" +set autoread " read open files again when changed outside Vim +set autowrite " write a modified buffer on each :next , ... +set browsedir =current " which directory to use for the file browser +set incsearch " use incremental search +"set nowrap " do not wrap lines +set shiftwidth =4 " number of spaces to use for each step of indent +set tabstop =4 " number of spaces that a <Tab> in the file counts for +set visualbell " visual bell instead of beeping +" +" +"------------------------------------------------------------------------------- +" some additional hot keys +"------------------------------------------------------------------------------- +" F2 - write file without confirmation +" F3 - call file explorer Ex +" F4 - show tag under curser in the preview window (tagfile must exist!) +" F5 - open quickfix error window +" F6 - close quickfix error window +" F7 - display previous error +" F8 - display next error +" S-Tab - Fast switching between buffers (see below) +" C-q - Leave the editor with Ctrl-q (see below) +"------------------------------------------------------------------------------- +" +map <silent> <F2> :write<CR> +map <silent> <F3> :Explore<CR> +nmap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR> +map <silent> <F5> :copen<CR> +map <silent> <F6> :cclose<CR> +map <silent> <F7> :cp<CR> +map <silent> <F8> :cn<CR> +" +imap <silent> <F2> <Esc>:write<CR> +imap <silent> <F3> <Esc>:Explore<CR> +imap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR> +imap <silent> <F5> <Esc>:copen<CR> +imap <silent> <F6> <Esc>:cclose<CR> +imap <silent> <F7> <Esc>:cp<CR> +imap <silent> <F8> <Esc>:cn<CR> +" +"------------------------------------------------------------------------------- +" Fast switching between buffers +" The current buffer will be saved before switching to the next one. +" Choose :bprevious or :bnext +"------------------------------------------------------------------------------- +" + map <silent> <s-tab> <Esc>:if &modifiable && !&readonly && + \ &modified <CR> :write<CR> :endif<CR>:bprevious<CR> +imap <silent> <s-tab> <Esc>:if &modifiable && !&readonly && + \ &modified <CR> :write<CR> :endif<CR>:bprevious<CR> +" +"------------------------------------------------------------------------------- +" Leave the editor with Ctrl-q : Write all changed buffers and exit Vim +"------------------------------------------------------------------------------- +nmap <C-q> :wqa<CR> +" +"------------------------------------------------------------------------------- +" autocomplete parenthesis, brackets and braces +"------------------------------------------------------------------------------- +inoremap ( ()<Left> +inoremap [ []<Left> +inoremap { {<CR>}<ESC>ko +" +vnoremap ( s()<Esc>P<Right>% +vnoremap [ s[]<Esc>P<Right>% +vnoremap { s{}<Esc>P<Right>% +" +"------------------------------------------------------------------------------- +" Change the working directory to the directory containing the current file +"------------------------------------------------------------------------------- +if has("autocmd") + autocmd BufEnter * :lchdir %:p:h +endif " has("autocmd") +" +"------------------------------------------------------------------------------- +" Filename completion +" +" wildmenu : command-line completion operates in an enhanced mode +" wildignore : A file that matches with one of these +" patterns is ignored when completing file or directory names. +"------------------------------------------------------------------------------- +" +set wildmenu +set wildignore=*.bak,*.o,*.e,*~ +" +"------------------------------------------------------------------------------- +" print options (pc = percentage of the media size) +"------------------------------------------------------------------------------- +set printoptions=left:8pc,right:3pc +" +"------------------------------------------------------------------------------- +" taglist.vim : toggle the taglist window +" taglist.vim : define the title texts for make +" taglist.vim : define the title texts for qmake +"------------------------------------------------------------------------------- + noremap <silent> <F11> <Esc><Esc>:Tlist<CR> +inoremap <silent> <F11> <Esc><Esc>:Tlist<CR> + +let tlist_make_settings = 'make;m:makros;t:targets' + +let tlist_qmake_settings = 'qmake;t:SystemVariables' + +if has("autocmd") + " ---------- qmake : set filetype for *.pro ---------- + autocmd BufNewFile,BufRead *.pro set filetype=qmake +endif " has("autocmd") diff --git a/dot_vim/ftplugin/gpg.vim b/dot_vim/ftplugin/gpg.vim new file mode 100644 index 0000000..20f641f --- /dev/null +++ b/dot_vim/ftplugin/gpg.vim @@ -0,0 +1,33 @@ +" Transparent editing of gpg encrypted files. +" By Wouter Hanegraaff <wouter@blub.net> +augroup encrypted +au! +" First make sure nothing is written to ~/.viminfo while editing +" an encrypted file. +autocmd BufReadPre,FileReadPre *.gpg set viminfo= +" We don't want a swap file, as it writes unencrypted data to disk +autocmd BufReadPre,FileReadPre *.gpg set noswapfile +" Switch to binary mode to read the encrypted file +autocmd BufReadPre,FileReadPre *.gpg set bin +autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 +autocmd BufReadPre,FileReadPre *.gpg let shsave=&sh +autocmd BufReadPre,FileReadPre *.gpg let &sh='sh' +autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 +autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt --default-recipient-self 2> /dev/null +autocmd BufReadPost,FileReadPost *.gpg let &sh=shsave +" Switch to normal mode for editing +autocmd BufReadPost,FileReadPost *.gpg set nobin +autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save +autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r") +" Convert all text to encrypted text before writing +autocmd BufWritePre,FileWritePre *.gpg set bin +autocmd BufWritePre,FileWritePre *.gpg let shsave=&sh +autocmd BufWritePre,FileWritePre *.gpg let &sh='sh' +autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --encrypt --default-recipient-self 2>/dev/null +autocmd BufWritePre,FileWritePre *.gpg let &sh=shsave +" Undo the encryption so we are back in the normal text, directly +" after the file has been written. +autocmd BufWritePost,FileWritePost *.gpg silent u +autocmd BufWritePost,FileWritePost *.gpg set nobin +augroup END + diff --git a/dot_vim/ftplugin/haskell.vim b/dot_vim/ftplugin/haskell.vim new file mode 100644 index 0000000..ffe83fe --- /dev/null +++ b/dot_vim/ftplugin/haskell.vim @@ -0,0 +1,13 @@ +" +" general Haskell source settings +" (shared functions are in autoload/haskellmode.vim) +" +" (Claus Reinke, last modified: 21/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + +" try gf on import line, or ctrl-x ctrl-i, or [I, [i, .. +set include=^import\\s*\\(qualified\\)\\?\\s* +set includeexpr=substitute(v:fname,'\\.','/','g').'.hs' + diff --git a/dot_vim/ftplugin/haskell_doc.vim b/dot_vim/ftplugin/haskell_doc.vim new file mode 100644 index 0000000..f850667 --- /dev/null +++ b/dot_vim/ftplugin/haskell_doc.vim @@ -0,0 +1,817 @@ +" +" use haddock docs and index files +" show documentation, complete & qualify identifiers +" +" (Claus Reinke; last modified: 24/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + +" :Doc <name> and :IDoc <name> open haddocks for <name> in opera +" +" :Doc needs qualified name (default Prelude) and package (default base) +" :IDoc needs unqualified name, looks up possible links in g:haddock_index +" +" :DocIndex populates g:haddock_index from haddock's index files +" :ExportDocIndex saves g:haddock_index to cache file +" :ImportDocIndex reloads g:haddock_index from cache file +" +" all the following use the haddock index (g:haddock_index) +" +" _? opens haddocks for unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _. fully qualifies unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _i add import <module>(<name>) statement for unqualified <name> under cursor, +" _im add import <module> statement for unqualified <name> under cursor, +" suggesting alternative full qualifications in popup menu +" (this currently adds one statement per call, instead of +" merging into existing import statements, but it's a start;-) +" +" CTRL-X CTRL-U (user-defined insert mode completion) +" suggests completions of unqualified names in popup menu + +let s:scriptname = "haskell_doc.vim" + +" script parameters +" g:haddock_browser *mandatory* which browser to call +" g:haddock_browser_callformat [optional] how to call browser +" g:haddock_indexfiledir [optional] where to put 'haddock_index.vim' +" g:haddock_docdir [optional] where to find html docs +" g:ghc [optional] which ghc to call +" g:ghc_pkg [optional] which ghc_pkg to call + +" been here before? +if exists("g:haddock_index") + finish +endif + +" initialise nested dictionary, to be populated +" - from haddock index files via :DocIndex +" - from previous cached version via :ImportDocIndex +let g:haddock_index = {} + +" initialise dictionary, mapping modules with haddocks to their packages, +" populated via MkHaddockModuleIndex() or HaveModuleIndex() +let g:haddock_moduleindex = {} + +" program to open urls, please set this in your vimrc + "examples (for windows): + "let g:haddock_browser = "C:/Program Files/Opera/Opera.exe" + "let g:haddock_browser = "C:/Program Files/Mozilla Firefox/firefox.exe" + "let g:haddock_browser = "C:/Program Files/Internet Explorer/IEXPLORE.exe" +if !exists("g:haddock_browser") + echoerr s:scriptname." WARNING: please set g:haddock_browser!" +endif + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname." can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif + +if (!exists("g:ghc_pkg") || !executable(g:ghc_pkg)) + let g:ghc_pkg = substitute(g:ghc,'\(.*\)ghc','\1ghc-pkg','') +endif + +if exists("g:haddock_docdir") && isdirectory(g:haddock_docdir) + let s:docdir = g:haddock_docdir +elseif executable(g:ghc_pkg) +" try to figure out location of html docs +" first choice: where the base docs are (from the first base listed) + let [field;x] = split(system(g:ghc_pkg . ' field base haddock-html'),'\n') + let field = substitute(field,'haddock-html: \(.*\)libraries.base','\1','') + let field = substitute(field,'\\','/','g') + let alternate = substitute(field,'html','doc/html','') + if isdirectory(field) + let s:docdir = field + elseif isdirectory(alternate) + let s:docdir = alternate + endif +else + echoerr s:scriptname." can't find ghc-pkg (set g:ghc_pkg ?)." +endif + +" second choice: try some known suspects for windows/unix +if !exists('s:docdir') || !isdirectory(s:docdir) + let s:ghc_libdir = substitute(system(g:ghc . ' --print-libdir'),'\n','','') + let location1a = s:ghc_libdir . '/doc/html/' + let location1b = s:ghc_libdir . '/doc/' + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let location2 = '/usr/share/doc/ghc-' . s:ghc_version . '/html/' + if isdirectory(location1a) + let s:docdir = location1a + elseif isdirectory(location1b) + let s:docdir = location1b + elseif isdirectory(location2) + let s:docdir = location2 + else " give up + echoerr s:scriptname." can't find locaton of html documentation (set g:haddock_docdir)." + finish + endif +endif + +" todo: can we turn s:docdir into a list of paths, and +" include docs for third-party libs as well? + +let s:libraries = s:docdir . 'libraries/' +let s:guide = s:docdir . 'users_guide/' +let s:index = 'index.html' +if exists("g:haddock_indexfiledir") && filewritable(g:haddock_indexfiledir) + let s:haddock_indexfiledir = g:haddock_indexfiledir +elseif filewritable(s:libraries) + let s:haddock_indexfiledir = s:libraries +elseif filewritable($HOME) + let s:haddock_indexfiledir = $HOME.'/' +else "give up + echoerr s:scriptname." can't locate index file. please set g:haddock_indexfiledir" + finish +endif +let s:haddock_indexfile = s:haddock_indexfiledir . 'haddock_index.vim' + +" different browser setups require different call formats; +" you might want to call the browser synchronously or +" asynchronously, and the latter is os-dependent; +" +" by default, the browser is started in the background when on +" windows or if running in a gui, and in the foreground otherwise +" (eg, console-mode for remote sessions, with text-mode browsers). +" +" you can override these defaults in your vimrc, via a format +" string including 2 %s parameters (the first being the browser +" to call, the second being the url). +if !exists("g:haddock_browser_callformat") + if has("win32") || has("win64") + let g:haddock_browser_callformat = 'start %s "%s"' + else + if has("gui_running") + let g:haddock_browser_callformat = '%s %s '.printf(&shellredir,'/dev/null').' &' + else + let g:haddock_browser_callformat = '%s %s' + endif + endif +endif + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +command! DocSettings call DocSettings() +function! DocSettings() + for v in ["g:haddock_browser","g:haddock_browser_callformat","g:haddock_docdir","g:haddock_indexfiledir","s:ghc_libdir","s:ghc_version","s:docdir","s:libraries","s:guide","s:haddock_indexfile"] + if exists(v) + echo v '=' eval(v) + else + echo v '=' + endif + endfor +endfunction + +function! DocBrowser(url) + "echomsg "DocBrowser(".url.")" + if (!exists("g:haddock_browser") || !executable(g:haddock_browser)) + echoerr s:scriptname." can't find documentation browser. please set g:haddock_browser" + return + endif + " start browser to open url, according to specified format + let url = a:url=~'^\(file://\|http://\)' ? a:url : 'file://'.a:url + silent exe '!'.printf(g:haddock_browser_callformat,g:haddock_browser,escape(url,'#%')) +endfunction + +"usage examples: +" :Doc length +" :Doc Control.Monad.when +" :Doc Data.List. +" :Doc Control.Monad.State.runState mtl +" :Doc -top +" :Doc -libs +" :Doc -guide +command! -nargs=+ Doc call Doc('v',<f-args>) +command! -nargs=+ Doct call Doc('t',<f-args>) + +function! Doc(kind,qualname,...) + let suffix = '.html' + let relative = '#'.a:kind.'%3A' + + if a:qualname=="-top" + call DocBrowser(s:docdir . s:index) + return + elseif a:qualname=="-libs" + call DocBrowser(s:libraries . s:index) + return + elseif a:qualname=="-guide" + call DocBrowser(s:guide . s:index) + return + endif + + if a:0==0 " no package specified + let package = 'base/' + else + let package = a:1 . '/' + endif + + if match(a:qualname,'\.')==-1 " unqualified name + let [qual,name] = [['Prelude'],a:qualname] + let file = join(qual,'-') . suffix . relative . name + elseif a:qualname[-1:]=='.' " module qualifier only + let parts = split(a:qualname,'\.') + let quallen = len(parts)-1 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix + else " qualified name + let parts = split(a:qualname,'\.') + let quallen = len(parts)-2 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix . relative . name + endif + +" let path = s:libraries . package . file + let path = file + call DocBrowser(path) +endfunction + +" TODO: add commandline completion for :IDoc +" indexed variant of Doc, looking up links in g:haddock_index +" usage: +" 1. :IDoc length +" 2. click on one of the choices, or select by number (starting from 0) +command! -nargs=+ IDoc call IDoc(<f-args>) +function! IDoc(name,...) + let choices = HaddockIndexLookup(a:name) + if choices=={} | return | endif + if a:0==0 + let keylist = map(deepcopy(keys(choices)),'substitute(v:val,"\\[.\\]","","")') + let choice = inputlist(keylist) + else + let choice = a:1 + endif + let path = values(choices)[choice] " assumes same order for keys/values.. + call DocBrowser(path) +endfunction + +let s:flagref = s:guide . 'flag-reference.html' +if filereadable(s:flagref) + " extract the generated fragment ids for the + " flag reference sections + let s:headerPat = '.\{-}<h3 class="title"><a name="\([^"]*\)"><\/a>\([^<]*\)<\/h3>\(.*\)' + let s:flagheaders = [] + let s:flagheaderids = {} + let s:contents = join(readfile(s:flagref)) + let s:ml = matchlist(s:contents,s:headerPat) + while s:ml!=[] + let [_,s:id,s:title,s:r;s:x] = s:ml + let s:flagheaders = add(s:flagheaders, s:title) + let s:flagheaderids[s:title] = s:id + let s:ml = matchlist(s:r,s:headerPat) + endwhile + command! -nargs=1 -complete=customlist,CompleteFlagHeaders FlagReference call FlagReference(<f-args>) + function! FlagReference(section) + let relativeUrl = a:section==""||!exists("s:flagheaderids['".a:section."']") ? + \ "" : "#".s:flagheaderids[a:section] + call DocBrowser(s:flagref.relativeUrl) + endfunction + function! CompleteFlagHeaders(al,cl,cp) + let s:choices = s:flagheaders + return CompleteAux(a:al,a:cl,a:cp) + endfunction +endif + +command! -nargs=1 -complete=customlist,CompleteHaddockModules MDoc call MDoc(<f-args>) +function! MDoc(module) + let suffix = '.html' + call HaveModuleIndex() + if !has_key(g:haddock_moduleindex,a:module) + echoerr a:module 'not found in haddock module index' + return + endif + let package = g:haddock_moduleindex[a:module]['package'] + let file = substitute(a:module,'\.','-','g') . suffix +" let path = s:libraries . package . '/' . file + let path = g:haddock_moduleindex[a:module]['html'] + call DocBrowser(path) +endfunction + +function! CompleteHaddockModules(al,cl,cp) + call HaveModuleIndex() + let s:choices = keys(g:haddock_moduleindex) + return CompleteAux(a:al,a:cl,a:cp) +endfunction + +" create a dictionary g:haddock_index, containing the haddoc index +command! DocIndex call DocIndex() +function! DocIndex() + let files = split(globpath(s:libraries,'doc-index*.html'),'\n') + let g:haddock_index = {} + call ProcessHaddockIndexes2(s:libraries,files) + if GHC_VersionGE([6,8,2]) + if &shell =~ 'sh' " unix-type shell + let s:addon_libraries = split(system(g:ghc_pkg . ' field \* haddock-html'),'\n') + else " windows cmd.exe and the like + let s:addon_libraries = split(system(g:ghc_pkg . ' field * haddock-html'),'\n') + endif + for addon in s:addon_libraries + let ml = matchlist(addon,'haddock-html: \("\)\?\(file:///\)\?\([^"]*\)\("\)\?') + if ml!=[] + let [_,quote,file,addon_path;x] = ml + let addon_path = substitute(addon_path,'\(\\\\\|\\\)','/','g') + let addon_files = split(globpath(addon_path,'doc-index*.html'),'\n') + call ProcessHaddockIndexes2(addon_path,addon_files) + endif + endfor + endif + return 1 +endfunction + +function! ProcessHaddockIndexes(location,files) + let entryPat= '.\{-}"indexentry"[^>]*>\([^<]*\)<\(\%([^=]\{-}TD CLASS="\%(indexentry\)\@!.\{-}</TD\)*\)[^=]\{-}\(\%(="indexentry\|TABLE\).*\)' + let linkPat = '.\{-}HREF="\([^"]*\)".>\([^<]*\)<\(.*\)' + + redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let contents = join(readfile(f)) + let ml = matchlist(contents,entryPat) + while ml!=[] + let [_,entry,links,r;x] = ml + "echo entry links + let ml2 = matchlist(links,linkPat) + let link = {} + while ml2!=[] + let [_,l,m,links;x] = ml2 + "echo l m + let link[m] = a:location . '/' . l + let ml2 = matchlist(links,linkPat) + endwhile + let g:haddock_index[DeHTML(entry)] = deepcopy(link) + "echo entry g:haddock_index[entry] + let ml = matchlist(r,entryPat) + endwhile + endfor +endfunction + +" concatenating all lines is too slow for a big file, process lines directly +function! ProcessHaddockIndexes2(location,files) + let entryPat= '^>\([^<]*\)</' + let linkPat = '.\{-}A HREF="\([^"]*\)"' + let kindPat = '#\(.\)' + + " redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let isEntry = 0 + let isLink = '' + let link = {} + let entry = '' + for line in readfile(f) + if line=~'CLASS="indexentry' + if (link!={}) && (entry!='') + if has_key(g:haddock_index,DeHTML(entry)) + let dict = extend(g:haddock_index[DeHTML(entry)],deepcopy(link)) + else + let dict = deepcopy(link) + endif + let g:haddock_index[DeHTML(entry)] = dict + let link = {} + let entry = '' + endif + let isEntry=1 + continue + endif + if isEntry==1 + let ml = matchlist(line,entryPat) + if ml!=[] | let [_,entry;x] = ml | let isEntry=0 | continue | endif + endif + if entry!='' + let ml = matchlist(line,linkPat) + if ml!=[] | let [_,isLink;x]=ml | continue | endif + endif + if isLink!='' + let ml = matchlist(line,entryPat) + if ml!=[] + let [_,module;x] = ml + let [_,kind;x] = matchlist(isLink,kindPat) + let last = a:location[strlen(a:location)-1] + let link[module."[".kind."]"] = a:location . (last=='/'?'':'/') . isLink + let isLink='' + continue + endif + endif + endfor + if link!={} + if has_key(g:haddock_index,DeHTML(entry)) + let dict = extend(g:haddock_index[DeHTML(entry)],deepcopy(link)) + else + let dict = deepcopy(link) + endif + let g:haddock_index[DeHTML(entry)] = dict + endif + endfor +endfunction + +command! ExportDocIndex call ExportDocIndex() +function! ExportDocIndex() + call HaveIndex() + let entries = [] + for key in keys(g:haddock_index) + let entries += [key,string(g:haddock_index[key])] + endfor + call writefile(entries,s:haddock_indexfile) + redir end +endfunction + +command! ImportDocIndex call ImportDocIndex() +function! ImportDocIndex() + if filereadable(s:haddock_indexfile) + let lines = readfile(s:haddock_indexfile) + let i=0 + while i<len(lines) + let [key,dict] = [lines[i],lines[i+1]] + sandbox let g:haddock_index[key] = eval(dict) + let i+=2 + endwhile + return 1 + else + return 0 + endif +endfunction + +function! HaveIndex() + return (g:haddock_index!={} || ImportDocIndex() || DocIndex() ) +endfunction + +function! MkHaddockModuleIndex() + let g:haddock_moduleindex = {} + call HaveIndex() + for key in keys(g:haddock_index) + let dict = g:haddock_index[key] + for module in keys(dict) + let html = dict[module] + let html = substitute(html ,'#.*$','','') + let module = substitute(module,'\[.\]','','') + let ml = matchlist(html,'libraries/\([^\/]*\)\/') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + let ml = matchlist(html,'/\([^\/]*\)\/html/[A-Z]') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + endfor + endfor +endfunction + +function! HaveModuleIndex() + return (g:haddock_moduleindex!={} || MkHaddockModuleIndex() ) +endfunction + +" decode HTML symbol encodings (are these all we need?) +function! DeHTML(entry) + let res = a:entry + let decode = { '<': '<', '>': '>', '&': '\\&' } + for enc in keys(decode) + exe 'let res = substitute(res,"'.enc.'","'.decode[enc].'","g")' + endfor + return res +endfunction + +" find haddocks for word under cursor +" also lists possible definition sites +" - needs to work for both qualified and unqualified items +" - for 'import qualified M as A', consider M.item as source of A.item +" - offer sources from both type [t] and value [v] namespaces +" - for unqualified items, list all possible sites +" - for qualified items, list imported sites only +" keep track of keys with and without namespace tags: +" the former are needed for lookup, the latter for matching against source +map <LocalLeader>? :call Haddock()<cr> +function! Haddock() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let imports = haskellmode#GatherImports() + let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let name = unqual + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + " for qualified items, narrow results to possible imports that provide qualifier + let filteredKeys = filter(copy(keys(dict)) + \ ,'match(asm,substitute(v:val,''\[.\]'','''',''''))!=-1') + let keys = (qual!='') ? filteredKeys : keys(dict) + if (keys==[]) && (qual!='') + echoerr qual.'.'.unqual.' not found in imports' + return 0 + endif + if len(keys)==1 && exists("g:haskell_avoid_singleton_menus") + call DocBrowser(dict[keys[0]]) + elseif has("gui_running") + for key in keys + exe 'amenu ]Popup.'.escape(key,'\.').' :call DocBrowser('''.dict[key].''')<cr>' + endfor + popup ]Popup + else + let s:choices = keys + let key = input('browse docs for '.name.' in: ','','customlist,CompleteAux') + if key!='' + call DocBrowser(dict[key]) + endif + endif +endfunction + +if !exists("g:haskell_search_engines") + let g:haskell_search_engines = + \ {'hoogle':'http://www.haskell.org/hoogle/?hoogle=%s' + \ ,'hayoo!':'http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=%s' + \ } +endif + +map <LocalLeader>?? :let es=g:haskell_search_engines + \ \|echo "g:haskell_search_engines" + \ \|for e in keys(es) + \ \|echo e.' : '.es[e] + \ \|endfor<cr> +map <LocalLeader>?1 :call HaskellSearchEngine('hoogle')<cr> +map <LocalLeader>?2 :call HaskellSearchEngine('hayoo!')<cr> + +" query one of the Haskell search engines for the thing under cursor +" - unqualified symbols need to be url-escaped +" - qualified ids need to be fed as separate qualifier and id for +" both hoogle (doesn't handle qualified symbols) and hayoo! (no qualified +" ids at all) +" - qualified ids referring to import-qualified-as qualifiers need to be +" translated to the multi-module searches over the list of original modules +function! HaskellSearchEngine(engine) + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let imports = haskellmode#GatherImports() + let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let unqual = haskellmode#UrlEncode(unqual) + if a:engine=='hoogle' + let name = asm!=[] ? unqual.'+'.join(map(copy(asm),'"%2B".v:val'),'+') + \ : qual!='' ? unqual.'+'.haskellmode#UrlEncode('+').qual + \ : unqual + elseif a:engine=='hayoo!' + let name = asm!=[] ? unqual.'+module:('.join(copy(asm),' OR ').')' + \ : qual!='' ? unqual.'+module:'.qual + \ : unqual + else + let name = qual=="" ? unqual : qual.".".unqual + endif + if has_key(g:haskell_search_engines,a:engine) + call DocBrowser(printf(g:haskell_search_engines[a:engine],name)) + else + echoerr "unknown search engine: ".a:engine + endif +endfunction + +" used to pass on choices to CompleteAux +let s:choices=[] + +" if there's no gui, use commandline completion instead of :popup +" completion function CompleteAux suggests completions for a:al, wrt to s:choices +function! CompleteAux(al,cl,cp) + "echomsg '|'.a:al.'|'.a:cl.'|'.a:cp.'|' + let res = [] + let l = len(a:al)-1 + for r in s:choices + if l==-1 || r[0 : l]==a:al + let res += [r] + endif + endfor + return res +endfunction + +" CamelCase shorthand matching: +" favour upper-case letters and module qualifier separators (.) for disambiguation +function! CamelCase(shorthand,string) + let s1 = a:shorthand + let s2 = a:string + let notFirst = 0 " don't elide before first pattern letter + while ((s1!="")&&(s2!="")) + let head1 = s1[0] + let head2 = s2[0] + let elide = notFirst && ( ((head1=~'[A-Z]') && (head2!~'[A-Z.]')) + \ ||((head1=='.') && (head2!='.')) ) + if elide + let s2=s2[1:] + elseif (head1==head2) + let s1=s1[1:] + let s2=s2[1:] + else + return 0 + endif + let notFirst = (head1!='.')||(head2!='.') " treat separators as new beginnings + endwhile + return (s1=="") +endfunction + +" use haddock name index for insert mode completion (CTRL-X CTRL-U) +function! CompleteHaddock(findstart, base) + if a:findstart + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + let qual = a:base =~ '^[A-Z][a-zA-Z0-9_'']*\(\.[A-Z][a-zA-Z0-9_'']*\)*\(\.[a-zA-Z0-9_'']*\)\?$' + call HaveIndex() + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if (key[0 : l]==a:base) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if word[0 : l]==a:base + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + if res==[] " no prefix matches, try CamelCase shortcuts + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if CamelCase(a:base,key) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if CamelCase(a:base,word) + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + endif + return res + endif +endfunction +set completefunc=CompleteHaddock +set completeopt=menu,menuone,longest + +" fully qualify an unqualified name +" TODO: - standardise commandline versions of menus +map <LocalLeader>. :call Qualify()<cr> +function! Qualify() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + if qual!='' " TODO: should we support re-qualification? + redraw + echo 'already qualified' + return 0 + endif + let name = unqual + let line = line('.') + let prefix = (start<=1 ? '' : getline(line)[0:start-2] ) + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + let imports = haskellmode#GatherImports() + let qualifiedImports = [] + for qualifiedImport in keys(imports[1]) + let c=0 + for module in imports[1][qualifiedImport]['modules'] + if haskellmode#ListElem(keylist,module) | let c+=1 | endif + endfor + if c>0 | let qualifiedImports=[qualifiedImport]+qualifiedImports | endif + endfor + "let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let keylist = filter(copy(keylist),'index(qualifiedImports,v:val)==-1') + if has("gui_running") + " amenu ]Popup.-imported- : + for key in qualifiedImports + let lhs=escape(prefix.name,'/.|\') + let rhs=escape(prefix.key.'.'.name,'/&|\') + exe 'amenu ]Popup.'.escape(key,'\.').' :'.line.'s/'.lhs.'/'.rhs.'/<cr>:noh<cr>' + endfor + amenu ]Popup.-not\ imported- : + for key in keylist + let lhs=escape(prefix.name,'/.|\') + let rhs=escape(prefix.key.'.'.name,'/&|\') + exe 'amenu ]Popup.'.escape(key,'\.').' :'.line.'s/'.lhs.'/'.rhs.'/<cr>:noh<cr>' + endfor + popup ]Popup + else + let s:choices = qualifiedImports+keylist + let key = input('qualify '.name.' with: ','','customlist,CompleteAux') + if key!='' + let lhs=escape(prefix.name,'/.\') + let rhs=escape(prefix.key.'.'.name,'/&\') + exe line.'s/'.lhs.'/'.rhs.'/' + noh + endif + endif +endfunction + +" create (qualified) import for a (qualified) name +" TODO: refine search patterns, to avoid misinterpretation of +" oddities like import'Neither or not'module +map <LocalLeader>i :call Import(0,0)<cr> +map <LocalLeader>im :call Import(1,0)<cr> +map <LocalLeader>iq :call Import(0,1)<cr> +map <LocalLeader>iqm :call Import(1,1)<cr> +function! Import(module,qualified) + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let name = unqual + let pname = ( symb ? '('.name.')' : name ) + let importlist = a:module ? '' : '('.pname.')' + let qualified = a:qualified ? 'qualified ' : '' + + if qual!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.qual.importlist.''')' + return + endif + + let line = line('.') + let prefix = getline(line)[0:start-1] + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + if has("gui_running") + for key in keylist + " exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search("\\%1c\\(import\\\\|module\\\\|{-# OPTIONS\\)","nb"),"import '.key.importlist.'")<cr>' + exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search(''\%1c\(\<import\>\\|\<module\>\\|{-# OPTIONS\\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.escape(importlist,'|').''')<cr>' + endfor + popup ]Popup + else + let s:choices = keylist + let key = input('import '.name.' from: ','','customlist,CompleteAux') + if key!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.importlist.''')' + endif + endif +endfunction + +function! HaddockIndexLookup(name) + call HaveIndex() + if !has_key(g:haddock_index,a:name) + echoerr a:name 'not found in haddock index' + return {} + endif + return g:haddock_index[a:name] +endfunction + +" copied from ghc.vim :-( should we move everything to using autoload instead? +" we query the ghc version here, as we don't otherwise need it.. +function! GHC_VersionGE(target) + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>target[0])) + return 1 + elseif (i==target[0]) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction diff --git a/dot_vim/ftplugin/haskell_hpaste.vim b/dot_vim/ftplugin/haskell_hpaste.vim new file mode 100644 index 0000000..33ea0bd --- /dev/null +++ b/dot_vim/ftplugin/haskell_hpaste.vim @@ -0,0 +1,79 @@ +" rudimentary hpaste support for vim +" (using netrw for reading, wget for posting/annotating) +" +" claus reinke, last modified: 07/04/2009 +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim + +" unless wget is in your PATH, you need to set g:wget +" before loading this script. windows users are out of +" luck, unless they have wget installed (such as the +" cygwin one looked for here), or adapt this script to +" whatever alternative they have at hand (perhaps using +" vim's perl/python bindings?) +if !exists("g:wget") + if executable("wget") + let g:wget = "!wget -q" + else + let g:wget = "!c:\\cygwin\\bin\\wget -q" + endif +endif + +" read (recent) hpaste files +" show index in new buffer, where ,r will open current entry +" and ,p will annotate current entry with current buffer +command! HpasteIndex call HpasteIndex() +function! HpasteIndex() + new + read http://hpaste.org + %s/\_$\_.//g + %s/<tr[^>]*>//g + %s/<\/tr>/
/g + g/<\/table>/d + g/DOCTYPE/d + %s/<td>\([^<]*\)<\/td><td><a href="\/fastcgi\/hpaste\.fcgi\/view?id=\([0-9]*\)">\([^<]*\)<\/a><\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td>/\2 [\1] "\3" \4 \5 \6/ + map <buffer> ,r 0yE:noh<cr>:call HpasteEditEntry('"')<cr> +endfunction + +" load an existing entry for editing +command! -nargs=1 HpasteEditEntry call HpasteEditEntry(<f-args>) +function! HpasteEditEntry(entry) + new + exe 'Nread http://hpaste.org/fastcgi/hpaste.fcgi/raw?id='.a:entry + "exe 'map <buffer> ,p :call HpasteAnnotate('''.a:entry.''')<cr>' +endfunction + +" " posting temporarily disabled -- needs someone to look into new +" " hpaste.org structure + +" " annotate existing entry (only to be called via ,p in HpasteIndex) +" function! HpasteAnnotate(entry) +" let nick = input("nick? ") +" let title = input("title? ") +" if nick=='' || title=='' +" echo "nick or title missing. aborting annotation" +" return +" endif +" call HpastePost('annotate/'.a:entry,nick,title) +" endfunction +" +" " post new hpaste entry +" " using 'wget --post-data' and url-encoded content +" command! HpastePostNew call HpastePost('new',<args>) +" function! HpastePost(mode,nick,title,...) +" let lines = getbufline("%",1,"$") +" let pat = '\([^[:alnum:]]\)' +" let code = '\=printf("%%%02X",char2nr(submatch(1)))' +" let lines = map(lines,'substitute(v:val."\r\n",'''.pat.''','''.code.''',''g'')') +" +" let url = 'http://hpaste.org/' . a:mode +" let nick = substitute(a:nick,pat,code,'g') +" let title = substitute(a:title,pat,code,'g') +" if a:0==0 +" let announce = 'false' +" else +" let announce = a:1 +" endif +" let cmd = g:wget.' --post-data="content='.join(lines,'').'&nick='.nick.'&title='.title.'&announce='.announce.'" '.url +" exe escape(cmd,'%') +" endfunction diff --git a/dot_vim/ftplugin/latex-suite/bibtex.vim b/dot_vim/ftplugin/latex-suite/bibtex.vim new file mode 100644 index 0000000..8037914 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/bibtex.vim @@ -0,0 +1,266 @@ +"============================================================================= +" File: bibtex.vim +" Function: BibT +" Author: Alan G Isaac <aisaac@american.edu> +" modified by Srinath Avadhanula for latex-suite. +" License: Vim Charityware license. +" CVS: $Id: bibtex.vim 997 2006-03-20 09:45:45Z srinathava $ +"============================================================================= + +" Fields: +" Define what field type each letter denotes {{{ +" +let s:w_standsfor = 'address' +let s:a_standsfor = 'author' +let s:b_standsfor = 'booktitle' +let s:c_standsfor = 'chapter' +let s:d_standsfor = 'edition' +let s:e_standsfor = 'editor' +let s:h_standsfor = 'howpublished' +let s:i_standsfor = 'institution' +let s:k_standsfor = 'isbn' +let s:j_standsfor = 'journal' +let s:m_standsfor = 'month' +let s:n_standsfor = 'number' +let s:o_standsfor = 'organization' +let s:p_standsfor = 'pages' +let s:q_standsfor = 'publisher' +let s:r_standsfor = 'school' +let s:s_standsfor = 'series' +let s:t_standsfor = 'title' +let s:u_standsfor = 'type' +let s:v_standsfor = 'volume' +let s:y_standsfor = 'year' +let s:z_standsfor = 'note' + +" }}} +" Define the fields required for the various entry types {{{ +" +" s:{type}_required defines the required fields +" s:{type}_optional1 defines common optional fields +" s:{type}_optional2 defines uncommmon optional fields +" s:{type}_retval defines the first line of the formatted bib entry. +" +let s:key='<+key+>' + +let s:{'article'}_required="atjy" +let s:{'article'}_optional1="vnpm" +let s:{'article'}_optional2="z" " z is note +let s:{'article'}_retval = '@ARTICLE{' . s:key . ','."\n" + +let s:{'book'}_required="aetqy" " requires author *or* editor +let s:{'book'}_optional1="wd" +let s:{'book'}_optional2="vnsmz" " w is address, d is edition +let s:{'book'}_extras="k" " isbn +let s:{'book'}_retval = '@BOOK{' . s:key . ','."\n" + +let s:{'booklet'}_required="t" +let s:{'booklet'}_optional1="ahy" +let s:{'booklet'}_optional2="wmz" " w is address +let s:{'booklet'}_retval = '@BOOKLET{' . s:key . ','."\n" + +let s:{'inbook'}_required="aetcpqy" +let s:{'inbook'}_optional1="w" " w is address +let s:{'inbook'}_optional2="vnsudmz" " d is edition +let s:{'inbook'}_extras="k" " isbn +let s:{'inbook'}_retval = '@INBOOK{' . s:key . ','."\n" + +let s:{'incollection'}_required="atbqy" " b is booktitle +let s:{'incollection'}_optional1="cpw" " w is address, c is chapter +let s:{'incollection'}_optional2="evnsudmz" " d is edition +let s:{'incollection'}_extras="k" " isbn +let s:{'incollection'}_retval = '@INCOLLECTION{' . s:key . ','."\n" + +let s:{'inproceedings'}_required="atby" " b is booktitle +let s:{'inproceedings'}_optional1="epwoq" " w is address, q is publisher +let s:{'inproceedings'}_optional2="vnsmz" +let s:{'inproceedings'}_extras="k" " isbn +let s:{'inproceedings'}_retval = '@INPROCEEDINGS{' . s:key . ','."\n" + +let s:{'conference'}_required="atby" " b is booktitle +let s:{'conference'}_optional1="epwoq" " w is address, q is publisher +let s:{'conference'}_optional2="vnsmz" +let s:{'conference'}_extras="k" " isbn +let s:{'conference'}_retval = '@CONFERENCE{' . s:key . ','."\n" + +let s:{'manual'}_required="t" +let s:{'manual'}_optional1="ow" +let s:{'manual'}_optional2="admyz" " w is address +let s:{'manual'}_retval = '@MANUAL{' . s:key . ','."\n" + +let s:{'msthesis'}_required="atry" " r is school +let s:{'msthesis'}_optional1="w" " w is address +let s:{'msthesis'}_optional2="umz" " u is type, w is address +let s:{'msthesis'}_retval = '@MASTERSTHESIS{' . s:key . ','."\n" + +let s:{'misc'}_required="" +let s:{'misc'}_optional1="ath" +let s:{'misc'}_optional2="myz" +let s:{'misc'}_retval = '@MISC{' . s:key . ','."\n" + +let s:{'phdthesis'}_required="atry" " r is school +let s:{'phdthesis'}_optional1="w" " w is address +let s:{'phdthesis'}_optional2="umz" " u is type +let s:{'phdthesis'}_retval = '@PHDTHESIS{' . s:key . ','."\n" + +let s:{'proceedings'}_required="ty" +let s:{'proceedings'}_optional1="ewo" " w is address +let s:{'proceedings'}_optional2="vnsmqz" " q is publisher +let s:{'proceedings'}_retval = '@PROCEEDINGS{' . s:key . ','."\n" + +let s:{'techreport'}_required="atiy" +let s:{'techreport'}_optional1="unw" " u is type, w is address +let s:{'techreport'}_optional2="mz" +let s:{'techreport'}_retval = '@TECHREPORT{' . s:key . ','."\n" + +let s:{'unpublished'}_required="atz" +let s:{'unpublished'}_optional1="y" +let s:{'unpublished'}_optional2="m" +let s:{'unpublished'}_retval = '@UNPUBLISHED{' . s:key . ','."\n" + +" }}} + +if exists('s:done') + finish +endif +let s:done = 1 + +call IMAP ('BBB', "\<C-r>=BibT('', '', 0)\<CR>", 'bib') +call IMAP ('BBL', "\<C-r>=BibT('', 'o', 0)\<CR>", 'bib') +call IMAP ('BBH', "\<C-r>=BibT('', 'O', 0)\<CR>", 'bib') +call IMAP ('BBX', "\<C-r>=BibT('', 'Ox', 0)\<CR>", 'bib') + +" BibT: function to generate a formatted bibtex entry {{{ +" three sample usages: +" :call BibT() will request type choice +" :call BibT("article") preferred, provides most common fields +" :call BibT("article","ox") more optional fields (o) and extras (x) +" +" Input Arguments: +" type: is one of the types listed above. (this should be a complete name, not +" the acronym). +" options: a string containing 0 or more of the letters 'oOx' +" where +" o: include a bib entry with first set of options +" O: include a bib entry with extended options +" x: incude bib entry with extra options +" prompt: whether the fields are asked to be filled on the command prompt or +" whether place-holders are used. when prompt == 1, then comman line +" questions are used. +" +" Returns: +" a string containing a formatted bib entry +function BibT(type, options, prompt) + if a:type != '' + let choosetype = a:type + else + let types = + \ 'article'."\n". + \ 'booklet'."\n". + \ 'book'."\n". + \ 'conference'."\n". + \ 'inbook'."\n". + \ 'incollection'."\n". + \ 'inproceedings'."\n". + \ 'manual'."\n". + \ 'msthesis'."\n". + \ 'misc'."\n". + \ 'phdthesis'."\n". + \ 'proceedings'."\n". + \ 'techreport'."\n". + \ 'unpublished' + let choosetype = Tex_ChooseFromPrompt( + \ "Choose the type of bibliographic entry: \n" . + \ Tex_CreatePrompt(types, 3, "\n") . + \ "\nEnter number or filename :", + \ types, "\n") + if choosetype == '' + let choosetype = 'article' + endif + if types !~ '^\|\n'.choosetype.'$\|\n' + echomsg 'Please choose only one of the given types' + return + endif + endif + if a:options != '' + let options = a:options + else + let options = "" + endif + + let fields = '' + let extras="" + let retval = "" + + " define fields + let fields = s:{choosetype}_required + if options =~ 'o' && exists('s:'.choosetype.'_optional1') + let fields = fields . s:{choosetype}_optional1 + endif + if options =~ "O" && exists('s:'.choosetype.'_optional2') + if options !~ 'o'&& exists('s:'.choosetype.'_optional1') + let fields = fields . s:{choosetype}_optional1 + endif + let fields = fields . s:{choosetype}_optional2 + endif + if options =~ "x" && exists('s:'.choosetype.'_extras') + let fields = fields . extras + endif + if exists('g:Bib_'.choosetype.'_options') + let fields = fields . g:Bib_{choosetype}_options + endif + + let retval = s:{choosetype}_retval + + let i = 0 + while i < strlen(fields) + let field = strpart(fields, i, 1) + + if exists('s:'.field.'_standsfor') + let field_name = s:{field}_standsfor + let retval = retval.field_name." = {<++>},\n" + endif + + let i = i + 1 + endwhile + + " If the user wants even more fine-tuning... + if Tex_GetVarValue('Bib_'.choosetype.'_extrafields') != '' + + let extrafields = Tex_GetVarValue('Bib_'.choosetype.'_extrafields') + + let i = 1 + while 1 + let field_name = Tex_Strntok(extrafields, "\n", i) + if field_name == '' + break + endif + + let retval = retval.field_name." = {<++>},\n" + + let i = i + 1 + endwhile + + endif + + let retval = retval.'otherinfo = {<++>}'."\n" + let retval = retval."}<++>"."\n" + + return IMAP_PutTextWithMovement(retval) +endfunction + +" }}} +function! s:Input(prompt, ask) " {{{ + if a:ask == 1 + let retval = input(a:prompt) + if retval == '' + return "<++>" + endif + else + return "<++>" + endif +endfunction + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/bibtools.py b/dot_vim/ftplugin/latex-suite/bibtools.py new file mode 100644 index 0000000..0a5366c --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/bibtools.py @@ -0,0 +1,221 @@ +# Author: Srinath Avadhanula +# This file is distributed as part of the vim-latex project +# http://vim-latex.sf.net + +import re + +class Bibliography(dict): + def __init__(self, txt, macros={}): + """ + txt: + a string which represents the entire bibtex entry. A typical + entry is of the form: + @ARTICLE{ellington:84:part3, + author = {Ellington, C P}, + title = {The Aerodynamics of Hovering Insect Flight. III. Kinematics}, + journal = {Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences}, + year = {1984}, + volume = {305}, + pages = {41-78}, + number = {1122}, + owner = {Srinath}, + pdf = {C:\srinath\research\papers\Ellington-3-Kinematics.pdf}, + timestamp = {2006.01.02}, + } + """ + + if macros: + for k, v in macros.iteritems(): + txt = txt.replace(k, '{'+v+'}') + + m = re.match(r'\s*@(\w+){((\S+),)?(.*)}\s*', txt, re.MULTILINE | re.DOTALL) + if not m: + return None + + self['bibtype'] = m.group(1).capitalize() + self['key'] = m.group(3) + self['body'] = m.group(4) + + body = self['body'] + self['bodytext'] = '' + while 1: + m = re.search(r'(\S+?)\s*=\s*(.)', body) + if not m: + break + + field = m.group(1) + + body = body[(m.start(2)+1):] + if m.group(2) == '{': + # search for the next closing brace. This is not simply a + # matter of searching for the next closing brace since + # braces can be nested. The following code basically goes + # to the next } which has not already been closed by a + # following {. + mniter = re.finditer(r'{|}', body) + + count = 1 + while 1: + try: + mn = mniter.next() + except StopIteration: + return None + + if mn.group(0) == '{': + count += 1 + else: + count -= 1 + + if count == 0: + value = body[:(mn.start(0))] + break + + elif m.group(2) == '"': + # search for the next unquoted double-quote. To be more + # precise, a double quote which is preceded by an even + # number of double quotes. + mn = re.search(r'(?!\\)(\\\\)*"', body) + if not mn: + return None + + value = body[:(mn.start(0))] + + else: + # $ always matches. So we do not need to do any + # error-checking. + mn = re.search(r',|$', body) + value = m.group(2) + body[:(mn.start(0))].rstrip() + + self[field] = re.sub(r'\s+', ' ', value) + body = body[(mn.start(0)+1):] + + self['bodytext'] += (' %s: %s\n' % (field, value)) + if self['bibtype'].lower() == 'string': + self['macro'] = {field: value} + + self['bodytext'] = self['bodytext'].rstrip() + + + def __getitem__(self, key): + try: + return dict.__getitem__(self, key) + except KeyError: + return '' + + def __str__(self): + if self['bibtype'].lower() == 'string': + return 'String: %(macro)s' % self + + elif self['bibtype'].lower() == 'article': + return ('Article [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(journal)s, %(year)s') % self + + elif self['bibtype'].lower() == 'conference': + return ('Conference [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(booktitle)s, %(year)s') % self + + elif self['bibtype'].lower() == 'mastersthesis': + return ('Masters [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(school)s, %(year)s') % self + + elif self['bibtype'].lower() == 'phdthesis': + return ('PhD [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(school)s, %(year)s') % self + + elif self['bibtype'].lower() == 'book': + return ('Book [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN %(publisher)s, %(year)s') % self + + else: + s = '%(bibtype)s [%(key)s]\n' % self + if self['title']: + s += 'TI "%(title)s"\n' % self + if self['author']: + s += 'AU %(author)s\n' % self + for k, v in self.iteritems(): + if k not in ['title', 'author', 'bibtype', 'key', 'id', 'file', 'body', 'bodytext']: + s += 'MI %s: %s\n' % (k, v) + + return s.rstrip() + + def satisfies(self, filters): + for field, regexp in filters: + if not re.search(regexp, self[field], re.I): + return False + + return True + +class BibFile: + + def __init__(self, filelist=''): + self.bibentries = [] + self.filters = [] + self.macros = {} + self.sortfields = [] + if filelist: + for f in filelist.splitlines(): + self.addfile(f) + + def addfile(self, file): + fields = open(file).read().split('@') + for f in fields: + if not (f and re.match('string', f, re.I)): + continue + + b = Bibliography('@' + f) + self.macros.update(b['macro']) + + for f in fields: + if not f or re.match('string', f, re.I): + continue + + b = Bibliography('@' + f, self.macros) + if b: + b['file'] = file + b['id'] = len(self.bibentries) + self.bibentries += [b] + + + def addfilter(self, filterspec): + self.filters += [filterspec.split()] + + def rmfilters(self): + self.filters = [] + + def __str__(self): + s = '' + for b in self.bibentries: + if b['key'] and b.satisfies(self.filters): + s += '%s\n\n' % b + return s + + def addsortfield(self, field): + self.sortfields += [field] + + def rmsortfields(self): + self.sortfields = [] + + def sort(self): + def cmpfun(b1, b2): + for f in self.sortfields: + c = cmp(b1[f], b2[f]) + if c: + return c + return 0 + self.bibentries.sort(cmp=cmpfun) + +if __name__ == "__main__": + import sys + + bf = BibFile(sys.argv[1]) + print bf diff --git a/dot_vim/ftplugin/latex-suite/bibtools.pyc b/dot_vim/ftplugin/latex-suite/bibtools.pyc Binary files differnew file mode 100644 index 0000000..c79961f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/bibtools.pyc diff --git a/dot_vim/ftplugin/latex-suite/brackets.vim b/dot_vim/ftplugin/latex-suite/brackets.vim new file mode 100644 index 0000000..0669ce4 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/brackets.vim @@ -0,0 +1,145 @@ +" ============================================================================== +" History: This was originally part of auctex.vim by Carl Mueller. +" Srinath Avadhanula incorporated it into latex-suite with +" significant modifications. +" Parts of this file may be copyrighted by others as noted. +" CVS: $Id: brackets.vim 997 2006-03-20 09:45:45Z srinathava $ +" Description: +" This ftplugin provides the following maps: +" . <M-b> encloses the previous character in \mathbf{} +" . <M-c> is polymorphic as follows: +" Insert mode: +" 1. If the previous character is a letter or number, then capitalize it and +" enclose it in \mathcal{} +" 2. otherwise insert \cite{} +" Visual Mode: +" 1. Enclose selection in \mathcal{} +" . <M-l> is also polymorphic as follows: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(\right +" similarly for [, | +" {<M-l> \left\{\right\} +" 2. <<M-l> \langle\rangle +" 3. q<M-l> \lefteqn{} +" otherwise insert \label{} +" . <M-i> inserts \item commands at the current cursor location depending on +" the surrounding environment. For example, inside itemize, it will +" insert a simple \item, but within a description, it will insert +" \item[<+label+>] etc. +" +" These functions make it extremeley easy to do all the \left \right stuff in +" latex. +" ============================================================================== + +" Avoid reinclusion. +if exists('b:did_brackets') + finish +endif +let b:did_brackets = 1 + +" define the funtions only once. +if exists('*Tex_MathBF') + finish +endif + +" Tex_MathBF: encloses te previous letter/number in \mathbf{} {{{ +" Description: +function! Tex_MathBF() + return "\<Left>\\mathbf{\<Right>}" +endfunction " }}} +" Tex_MathCal: enclose the previous letter/number in \mathcal {{{ +" Description: +" if the last character is not a letter/number, then insert \cite{} +function! Tex_MathCal() + let line = getline(line(".")) + let char = line[col(".")-2] + + if char =~ '[a-zA-Z0-9]' + return "\<BS>".'\mathcal{'.toupper(char).'}' + else + return IMAP_PutTextWithMovement('\cite{<++>}<++>') + endif +endfunction +" }}} +" Tex_LeftRight: maps <M-l> in insert mode. {{{ +" Description: +" This is a polymorphic function, which maps the behaviour of <M-l> in the +" following way: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(<++>\right<++> +" similarly for [, | +" {<M-l> \left\{<++>\right\}<++> +" 2. <<M-l> \langle<++>\rangle<++> +" 3. q<M-l> \lefteqn{<++>}<++> +" otherwise insert \label{<++>}<++> +function! Tex_LeftRight() + let line = getline(line(".")) + let char = line[col(".")-2] + let previous = line[col(".")-3] + + let matchedbrackets = '()[]{}||' + if char =~ '(\|\[\|{\||' + let add = '' + if char =~ '{' + let add = "\\" + endif + let rhs = matchstr(matchedbrackets, char.'\zs.\ze') + return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'<++>\right'.add.rhs.'<++>') + elseif char == '<' + return "\<BS>".IMAP_PutTextWithMovement('langle<++>\rangle<++>') + elseif char == 'q' + return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{<++>}<++>') + else + return IMAP_PutTextWithMovement('\label{<++>}<++>') + endif +endfunction " }}} +" Tex_PutLeftRight: maps <M-l> in normal mode {{{ +" Description: +" Put \left...\right in front of the matched brackets. +function! Tex_PutLeftRight() + let previous = getline(line("."))[col(".") - 2] + let char = getline(line("."))[col(".") - 1] + if previous == '\' + if char == '{' + exe "normal ileft\\\<Esc>l%iright\\\<Esc>l%" + elseif char == '}' + exe "normal iright\\\<Esc>l%ileft\\\<Esc>l%" + endif + elseif char =~ '\[\|(' + exe "normal i\\left\<Esc>l%i\\right\<Esc>l%" + elseif char =~ '\]\|)' + exe "normal i\\right\<Esc>l%i\\left\<Esc>l%" + endif +endfunction " }}} + +" Provide <plug>'d mapping for easy user customization. {{{ +inoremap <silent> <Plug>Tex_MathBF <C-r>=Tex_MathBF()<CR> +inoremap <silent> <Plug>Tex_MathCal <C-r>=Tex_MathCal()<CR> +inoremap <silent> <Plug>Tex_LeftRight <C-r>=Tex_LeftRight()<CR> +vnoremap <silent> <Plug>Tex_MathBF <C-C>`>a}<Esc>`<i\mathbf{<Esc> +vnoremap <silent> <Plug>Tex_MathCal <C-C>`>a}<Esc>`<i\mathcal{<Esc> +nnoremap <silent> <Plug>Tex_LeftRight :call Tex_PutLeftRight()<CR> + +" }}} +" Tex_SetBracketingMaps: create mappings for the current buffer {{{ +function! <SID>Tex_SetBracketingMaps() + + call Tex_MakeMap('<M-b>', '<Plug>Tex_MathBF', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-c>', '<Plug>Tex_MathCal', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-l>', '<Plug>Tex_LeftRight', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-b>', '<Plug>Tex_MathBF', 'v', '<buffer> <silent>') + call Tex_MakeMap('<M-c>', '<Plug>Tex_MathCal', 'v', '<buffer> <silent>') + call Tex_MakeMap('<M-l>', '<Plug>Tex_LeftRight', 'n', '<buffer> <silent>') + +endfunction +" }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('brackets.vim: Catching LatexSuiteFileType event', 'brak') | + \ call <SID>Tex_SetBracketingMaps() +augroup END + +" vim:fdm=marker diff --git a/dot_vim/ftplugin/latex-suite/compiler.vim b/dot_vim/ftplugin/latex-suite/compiler.vim new file mode 100644 index 0000000..245f6cd --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/compiler.vim @@ -0,0 +1,820 @@ +"============================================================================= +" File: compiler.vim +" Author: Srinath Avadhanula +" Created: Tue Apr 23 05:00 PM 2002 PST +" +" Description: functions for compiling/viewing/searching latex documents +" CVS: $Id: compiler.vim 997 2006-03-20 09:45:45Z srinathava $ +"============================================================================= + +" Tex_SetTeXCompilerTarget: sets the 'target' for the next call to Tex_RunLaTeX() {{{ +function! Tex_SetTeXCompilerTarget(type, target) + call Tex_Debug("+Tex_SetTeXCompilerTarget: setting target to [".a:target."] for ".a:type."r", "comp") + + if a:target == '' + let target = Tex_GetVarValue('Tex_DefaultTargetFormat') + let target = input('Enter the target format for '.a:type.'r: ', target) + else + let target = a:target + endif + if target == '' + let target = 'dvi' + endif + + let targetRule = Tex_GetVarValue('Tex_'.a:type.'Rule_'.target) + + if targetRule != '' + if a:type == 'Compile' + let &l:makeprg = escape(targetRule, Tex_GetVarValue('Tex_EscapeChars')) + elseif a:type == 'View' + let s:viewer = targetRule + endif + let s:target = target + + elseif Tex_GetVarValue('Tex_'.a:type.'RuleComplete_'.target) != '' + let s:target = target + + else + let curd = getcwd() + exe 'cd '.expand('%:p:h') + if !Tex_GetVarValue('Tex_UseMakefile') || (glob('makefile*') == '' && glob('Makefile*') == '') + if has('gui_running') + call confirm( + \'No '.a:type.' rule defined for target '.target."\n". + \'Please specify a rule in $VIMRUNTIME/ftplugin/tex/texrc'."\n". + \' :help Tex_'.a:type.'Rule_format'."\n". + \'for more information', + \"&ok", 1, 'Warning') + else + call input( + \'No '.a:type.' rule defined for target '.target."\n". + \'Please specify a rule in $VIMRUNTIME/ftplugin/tex/texrc'."\n". + \' :help Tex_'.a:type.'Rule_format'."\n". + \'for more information' + \) + endif + else + echomsg 'Assuming target is for makefile' + let s:target = target + endif + exe 'cd '.curd + endif +endfunction + +function! SetTeXTarget(...) + if a:0 < 1 + let target = Tex_GetVarValue('Tex_DefaultTargetFormat') + let target = input('Enter the target format for compiler and viewer: ', target) + else + let target = a:1 + endif + if target == '' + let target = 'dvi' + endif + + call Tex_SetTeXCompilerTarget('Compile', target) + call Tex_SetTeXCompilerTarget('View', target) +endfunction + +com! -nargs=1 TCTarget :call Tex_SetTeXCompilerTarget('Compile', <f-args>) +com! -nargs=1 TVTarget :call Tex_SetTeXCompilerTarget('View', <f-args>) +com! -nargs=? TTarget :call SetTeXTarget(<f-args>) + +" }}} +" Tex_CompileLatex: compiles the present file. {{{ +" Description: +function! Tex_CompileLatex() + if &ft != 'tex' + echo "calling Tex_RunLaTeX from a non-tex file" + return + end + + " close any preview windows left open. + pclose! + + let curd = getcwd() + + " Find the main file corresponding to this file. Always cd to the + " directory containing the file to avoid problems with the directory + " containing spaces. + " Latex on linux seems to be unable to handle file names with spaces at + " all! Therefore for the moment, do not attempt to handle spaces in the + " file name. + if exists('b:fragmentFile') + let mainfname = expand('%:p:t') + call Tex_CD(expand('%:p:h')) + else + let mainfname = Tex_GetMainFileName(':p:t') + call Tex_CD(Tex_GetMainFileName(':p:h')) + end + + call Tex_Debug('Tex_CompileLatex: getting mainfname = ['.mainfname.'] from Tex_GetMainFileName', 'comp') + + " if a makefile exists and the user wants to use it, then use that + " irrespective of whether *.latexmain exists or not. mainfname is still + " extracted from *.latexmain (if possible) log file name depends on the + " main file which will be compiled. + if Tex_GetVarValue('Tex_UseMakefile') && (glob('makefile') != '' || glob('Makefile') != '') + let _makeprg = &l:makeprg + call Tex_Debug("Tex_CompileLatex: using the makefile in the current directory", "comp") + let &l:makeprg = 'make $*' + if exists('s:target') + call Tex_Debug('Tex_CompileLatex: execing [make! '.s:target.']', 'comp') + exec 'make! '.s:target + else + call Tex_Debug('Tex_CompileLatex: execing [make!]', 'comp') + exec 'make!' + endif + let &l:makeprg = _makeprg + else + " If &makeprg has something like "$*.ps", it means that it wants the + " file-name without the extension... Therefore remove it. + if &makeprg =~ '\$\*\.\w\+' + let mainfname = fnamemodify(mainfname, ':r') + endif + call Tex_Debug('Tex_CompileLatex: execing [make! '.mainfname.']', 'comp') + exec 'make! '.mainfname + endif + redraw! + + call Tex_CD(curd) +endfunction " }}} +" Tex_RunLaTeX: compilation function {{{ +" this function runs the latex command on the currently open file. often times +" the file being currently edited is only a fragment being \input'ed into some +" master tex file. in this case, make a file called mainfile.latexmain in the +" directory containig the file. in other words, if the current file is +" ~/thesis/chapter.tex +" so that doing "latex chapter.tex" doesnt make sense, then make a file called +" main.tex.latexmain +" in the ~/thesis directory. this will then run "latex main.tex" when +" Tex_RunLaTeX() is called. +function! Tex_RunLaTeX() + call Tex_Debug('+Tex_RunLaTeX, b:fragmentFile = '.exists('b:fragmentFile'), 'comp') + + let dir = expand("%:p:h").'/' + let curd = getcwd() + call Tex_CD(expand("%:p:h")) + + let initTarget = s:target + + " first get the dependency chain of this format. + call Tex_Debug("Tex_RunLaTeX: compiling to target [".s:target."]", "comp") + + if Tex_GetVarValue('Tex_FormatDependency_'.s:target) != '' + let dependency = Tex_GetVarValue('Tex_FormatDependency_'.s:target) + if dependency !~ ','.s:target.'$' + let dependency = dependency.','.s:target + endif + else + let dependency = s:target + endif + + call Tex_Debug('Tex_RunLaTeX: getting dependency chain = ['.dependency.']', 'comp') + + " now compile to the final target format via each dependency. + let i = 1 + while Tex_Strntok(dependency, ',', i) != '' + let s:target = Tex_Strntok(dependency, ',', i) + + call Tex_SetTeXCompilerTarget('Compile', s:target) + call Tex_Debug('Tex_RunLaTeX: setting target to '.s:target, 'comp') + + if Tex_GetVarValue('Tex_MultipleCompileFormats') =~ '\<'.s:target.'\>' + call Tex_Debug("Tex_RunLaTeX: compiling file multiple times via Tex_CompileMultipleTimes", "comp") + call Tex_CompileMultipleTimes() + else + call Tex_Debug("Tex_RunLaTeX: compiling file once via Tex_CompileLatex", "comp") + call Tex_CompileLatex() + endif + + let errlist = Tex_GetErrorList() + call Tex_Debug("Tex_RunLaTeX: errlist = [".errlist."]", "comp") + + " If there are any errors, then break from the rest of the steps + if errlist =~ '\v(error|warning)' + call Tex_Debug('Tex_RunLaTeX: There were errors in compiling, breaking chain...', 'comp') + break + endif + + let i = i + 1 + endwhile + + let s:target = initTarget + let s:origwinnum = winnr() + call Tex_SetupErrorWindow() + + call Tex_CD(curd) + call Tex_Debug("-Tex_RunLaTeX", "comp") +endfunction + +" }}} +" Tex_ViewLaTeX: opens viewer {{{ +" Description: opens the DVI viewer for the file being currently edited. +" Again, if the current file is a \input in a master file, see text above +" Tex_RunLaTeX() to see how to set this information. +function! Tex_ViewLaTeX() + if &ft != 'tex' + echo "calling Tex_ViewLaTeX from a non-tex file" + return + end + + let curd = getcwd() + + " If b:fragmentFile is set, it means this file was compiled as a fragment + " using Tex_PartCompile, which means that we want to ignore any + " *.latexmain or makefile's. + if !exists('b:fragmentFile') + " cd to the location of the file to avoid having to deal with spaces + " in the directory name. + let mainfname = Tex_GetMainFileName(':p:t:r') + call Tex_CD(Tex_GetMainFileName(':p:h')) + else + let mainfname = expand("%:p:t:r") + call Tex_CD(expand("%:p:h")) + endif + + if Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target) != '' + + let execString = Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target) + let execString = substitute(execString, '{v:servername}', v:servername, 'g') + + elseif has('win32') + " unfortunately, yap does not allow the specification of an external + " editor from the command line. that would have really helped ensure + " that this particular vim and yap are connected. + let execString = 'start '.s:viewer.' "$*.'.s:target.'"' + + elseif has('macunix') + if strlen(s:viewer) + let s:viewer = '-a '.s:viewer + endif + let execString = 'open '.s:viewer.' $*.'.s:target + + else + " taken from Dimitri Antoniou's tip on vim.sf.net (tip #225). + " slight change to actually use the current servername instead of + " hardcoding it as xdvi. + " Using an option for specifying the editor in the command line + " because that seems to not work on older bash'es. + if s:target == 'dvi' + + if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ v:servername != '' && + \ (s:viewer == "xdvi" || s:viewer == "xdvik") + + let execString = s:viewer.' -editor "gvim --servername '.v:servername. + \ ' --remote-silent +\%l \%f" $*.dvi &' + + elseif Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ s:viewer == "kdvi" + + let execString = 'kdvi --unique $*.dvi &' + + else + + let execString = s:viewer.' $*.dvi &' + + endif + + else + + let execString = s:viewer.' $*.'.s:target.' &' + + endif + end + + let execString = substitute(execString, '\V$*', mainfname, 'g') + call Tex_Debug("Tex_ViewLaTeX: execString = ".execString, "comp") + + exec 'silent! !'.execString + + if !has('gui_running') + redraw! + endif + + call Tex_CD(curd) +endfunction + +" }}} +" Tex_ForwardSearchLaTeX: searches for current location in dvi file. {{{ +" Description: if the DVI viewr is compatible, then take the viewer to that +" position in the dvi file. see docs for Tex_RunLaTeX() to set a +" master file if this is an \input'ed file. +" Tip: With YAP on Windows, it is possible to do forward and inverse searches +" on DVI files. to do forward search, you'll have to compile the file +" with the --src-specials option. then set the following as the command +" line in the 'view/options/inverse search' dialog box: +" gvim --servername LATEX --remote-silent +%l "%f" +" For inverse search, if you are reading this, then just pressing \ls +" will work. +function! Tex_ForwardSearchLaTeX() + if &ft != 'tex' + echo "calling Tex_ViewLaTeX from a non-tex file" + return + end + + " only know how to do forward search for yap on windows and xdvik (and + " some newer versions of xdvi) on unices. Therefore forward searching will + " automatically open the DVI viewer irrespective of what the user chose as + " the default view format. + if Tex_GetVarValue('Tex_ViewRule_dvi') == '' + return + endif + let viewer = Tex_GetVarValue('Tex_ViewRule_dvi') + + let curd = getcwd() + + let mainfname = Tex_GetMainFileName(':t') + let mainfnameRoot = fnamemodify(Tex_GetMainFileName(), ':t:r') + " cd to the location of the file to avoid problems with directory name + " containing spaces. + call Tex_CD(Tex_GetMainFileName(':p:h')) + + " inverse search tips taken from Dimitri Antoniou's tip and Benji Fisher's + " tips on vim.sf.net (vim.sf.net tip #225) + if has('win32') + + let execString = 'silent! !start '. viewer.' -s '.line('.').expand('%').' '.mainfnameRoot + + else + if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ exists('v:servername') && + \ (viewer == "xdvi" || viewer == "xdvik") + + let execString = 'silent! !'.viewer.' -name xdvi -sourceposition '.line('.').expand("%"). + \ ' -editor "gvim --servername '.v:servername.' --remote-silent +\%l \%f" '. + \ mainfnameRoot.'.dvi &' + + elseif Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && viewer == "kdvi" + + let execString = 'silent! !kdvi --unique file:'.mainfnameRoot.'.dvi\#src:'.line('.').expand("%").' &' + + else + + let execString = 'silent! !'.viewer.' -name xdvi -sourceposition '.line('.').expand("%").' '.mainfnameRoot.'.dvi &' + + endif + end + + call Tex_Debug("Tex_ForwardSearchLaTeX: execString = ".execString, "comp") + execute execString + if !has('gui_running') + redraw! + endif + + call Tex_CD(curd) +endfunction + +" }}} + +" ============================================================================== +" Functions for compiling parts of a file. +" ============================================================================== +" Tex_PartCompile: compiles selected fragment {{{ +" Description: creates a temporary file from the selected fragment of text +" prepending the preamble and \end{document} and then asks Tex_RunLaTeX() to +" compile it. +function! Tex_PartCompile() range + call Tex_Debug('+Tex_PartCompile', 'comp') + " Save position + let pos = line('.').' | normal! '.virtcol('.').'|' + + " Get a temporary file in the same directory as the file from which + " fragment is being extracted. This is to enable the use of relative path + " names in the fragment. + let tmpfile = Tex_GetTempName(expand('%:p:h')) + + " Remember all the temp files and for each temp file created, remember + " where the temp file came from. + let s:Tex_NumTempFiles = (exists('s:Tex_NumTempFiles') ? s:Tex_NumTempFiles + 1 : 1) + let s:Tex_TempFiles = (exists('s:Tex_TempFiles') ? s:Tex_TempFiles : '') + \ . tmpfile."\n" + let s:Tex_TempFile_{s:Tex_NumTempFiles} = tmpfile + " TODO: For a function Tex_RestoreFragment which restores a temp file to + " its original location. + let s:Tex_TempFileOrig_{s:Tex_NumTempFiles} = expand('%:p') + let s:Tex_TempFileRange_{s:Tex_NumTempFiles} = a:firstline.','.a:lastline + + " Set up an autocmd to clean up the temp files when Vim exits. + if Tex_GetVarValue('Tex_RemoveTempFiles') + augroup RemoveTmpFiles + au! + au VimLeave * :call Tex_RemoveTempFiles() + augroup END + endif + + " If mainfile exists open it in tiny window and extract preamble there, + " otherwise do it from current file + let mainfile = Tex_GetMainFileName(":p") + exe 'bot 1 split '.escape(mainfile, ' ') + exe '1,/\s*\\begin{document}/w '.tmpfile + wincmd q + + exe a:firstline.','.a:lastline."w! >> ".tmpfile + + " edit the temporary file + exec 'drop '.tmpfile + + " append the \end{document} line. + $ put ='\end{document}' + w + + " set this as a fragment file. + let b:fragmentFile = 1 + + silent! call Tex_RunLaTeX() +endfunction " }}} +" Tex_RemoveTempFiles: cleans up temporary files created during part compilation {{{ +" Description: During part compilation, temporary files containing the +" visually selected text are created. These files need to be +" removed when Vim exits to avoid "file leakage". +function! Tex_RemoveTempFiles() + if !exists('s:Tex_NumTempFiles') || !Tex_GetVarValue('Tex_RemoveTempFiles') + return + endif + let i = 1 + while i <= s:Tex_NumTempFiles + let tmpfile = s:Tex_TempFile_{i} + " Remove the tmp file and all other associated files such as the + " .log files etc. + call Tex_DeleteFile(fnamemodify(tmpfile, ':p:r').'.*') + let i = i + 1 + endwhile +endfunction " }}} + +" ============================================================================== +" Compiling a file multiple times to resolve references/citations etc. +" ============================================================================== +" Tex_CompileMultipleTimes: The main function {{{ +" Description: compiles a file multiple times to get cross-references right. +function! Tex_CompileMultipleTimes() + " Just extract the root without any extension because we want to construct + " the log file names etc from it. + let curd = getcwd() + let mainFileName_root = Tex_GetMainFileName(':p:t:r') + call Tex_CD(Tex_GetMainFileName(':p:h')) + + " First ignore undefined references and the + " "rerun to get cross-references right" message from + " the compiler output. + let origlevel = Tex_GetVarValue('Tex_IgnoreLevel') + let origpats = Tex_GetVarValue('Tex_IgnoredWarnings') + + let g:Tex_IgnoredWarnings = g:Tex_IgnoredWarnings."\n" + \ . 'Reference %.%# undefined'."\n" + \ . 'Rerun to get cross-references right' + TCLevel 1000 + + let idxFileName = mainFileName_root.'.idx' + let auxFileName = mainFileName_root.'.aux' + + let runCount = 0 + let needToRerun = 1 + while needToRerun == 1 && runCount < 5 + " assume we need to run only once. + let needToRerun = 0 + + let idxlinesBefore = Tex_CatFile(idxFileName) + let auxlinesBefore = Tex_GetAuxFile(auxFileName) + + " first run latex. + echomsg "latex run number : ".(runCount+1) + call Tex_Debug("Tex_CompileMultipleTimes: latex run number : ".(runCount+1), "comp") + silent! call Tex_CompileLatex() + + " If there are errors in any latex compilation step, immediately + " return. For now, do not bother with warnings because those might go + " away after compiling again or after bibtex is run etc. + let errlist = Tex_GetErrorList() + call Tex_Debug("Tex_CompileMultipleTimes: errors = [".errlist."]", "comp") + + if errlist =~ 'error' + let g:Tex_IgnoredWarnings = origpats + exec 'TCLevel '.origlevel + + return + endif + + let idxlinesAfter = Tex_CatFile(idxFileName) + + " If .idx file changed, then run makeindex to generate the new .ind + " file and remember to rerun latex. + if runCount == 0 && glob(idxFileName) != '' && idxlinesBefore != idxlinesAfter + echomsg "Running makeindex..." + let temp_mp = &mp | let &mp = Tex_GetVarValue('Tex_MakeIndexFlavor') + exec 'silent! make '.mainFileName_root + let &mp = temp_mp + + let needToRerun = 1 + endif + + " The first time we see if we need to run bibtex and if the .bbl file + " changes, we will rerun latex. + if runCount == 0 && Tex_IsPresentInFile('\\bibdata', mainFileName_root.'.aux') + let bibFileName = mainFileName_root.'.bbl' + + let biblinesBefore = Tex_CatFile(bibFileName) + + echomsg "Running '".Tex_GetVarValue('Tex_BibtexFlavor')."' ..." + let temp_mp = &mp | let &mp = Tex_GetVarValue('Tex_BibtexFlavor') + exec 'silent! make '.mainFileName_root + let &mp = temp_mp + + let biblinesAfter = Tex_CatFile(bibFileName) + + " If the .bbl file changed after running bibtex, we need to + " latex again. + if biblinesAfter != biblinesBefore + echomsg 'Need to rerun because bibliography file changed...' + call Tex_Debug('Tex_CompileMultipleTimes: Need to rerun because bibliography file changed...', 'comp') + let needToRerun = 1 + endif + endif + + " check if latex asks us to rerun + let auxlinesAfter = Tex_GetAuxFile(auxFileName) + if auxlinesAfter != auxlinesBefore + echomsg "Need to rerun because the AUX file changed..." + call Tex_Debug("Tex_CompileMultipleTimes: Need to rerun to get cross-references right...", 'comp') + let needToRerun = 1 + endif + + let runCount = runCount + 1 + endwhile + + call Tex_Debug("Tex_CompileMultipleTimes: Ran latex ".runCount." time(s)", "comp") + echomsg "Ran latex ".runCount." time(s)" + + let g:Tex_IgnoredWarnings = origpats + exec 'TCLevel '.origlevel + " After all compiler calls are done, reparse the .log file for + " errors/warnings to handle the situation where the clist might have been + " emptied because of bibtex/makeindex being run as the last step. + exec 'silent! cfile '.mainFileName_root.'.log' + + call Tex_CD(curd) +endfunction " }}} +" Tex_GetAuxFile: get the contents of the AUX file {{{ +" Description: get the contents of the AUX file recursively including any +" @\input'ted AUX files. +function! Tex_GetAuxFile(auxFile) + if !filereadable(a:auxFile) + return '' + endif + + let auxContents = Tex_CatFile(a:auxFile) + let pattern = '@\input{\(.\{-}\)}' + + let auxContents = substitute(auxContents, pattern, '\=Tex_GetAuxFile(submatch(1))', 'g') + + return auxContents +endfunction " }}} + +" ============================================================================== +" Helper functions for +" . viewing the log file in preview mode. +" . syncing the display between the quickfix window and preview window +" . going to the correct line _and column_ number from from the quick fix +" window. +" ============================================================================== +" Tex_SetupErrorWindow: sets up the cwindow and preview of the .log file {{{ +" Description: +function! Tex_SetupErrorWindow() + let mainfname = Tex_GetMainFileName() + + let winnum = winnr() + + " close the quickfix window before trying to open it again, otherwise + " whether or not we end up in the quickfix window after the :cwindow + " command is not fixed. + cclose + cwindow + " create log file name from mainfname + let mfnlog = fnamemodify(mainfname, ":t:r").'.log' + call Tex_Debug('Tex_SetupErrorWindow: mfnlog = '.mfnlog, 'comp') + " if we moved to a different window, then it means we had some errors. + if winnum != winnr() + if Tex_GetVarValue('Tex_ShowErrorContext') + call Tex_UpdatePreviewWindow(mfnlog) + exe 'nnoremap <buffer> <silent> j j:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> k k:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> <up> <up>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> <down> <down>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + endif + exe 'nnoremap <buffer> <silent> <enter> :call Tex_GotoErrorLocation("'.mfnlog.'")<CR>' + + setlocal nowrap + + " resize the window to just fit in with the number of lines. + exec ( line('$') < 4 ? line('$') : 4 ).' wincmd _' + if Tex_GetVarValue('Tex_GotoError') == 1 + call Tex_GotoErrorLocation(mfnlog) + else + exec s:origwinnum.' wincmd w' + endif + endif + +endfunction " }}} +" Tex_PositionPreviewWindow: positions the preview window correctly. {{{ +" Description: +" The purpose of this function is to count the number of times an error +" occurs on the same line. or in other words, if the current line is +" something like |10 error|, then we want to count the number of +" lines in the quickfix window before this line which also contain lines +" like |10 error|. +" +function! Tex_PositionPreviewWindow(filename) + + if getline('.') !~ '|\d\+ \(error\|warning\)|' + if !search('|\d\+ \(error\|warning\)|') + call Tex_Debug("not finding error pattern anywhere in quickfix window :".bufname(bufnr('%')), + \ 'comp') + pclose! + return + endif + endif + + " extract the error pattern (something like 'file.tex|10 error|') on the + " current line. + let errpat = matchstr(getline('.'), '^\f*|\d\+ \(error\|warning\)|\ze') + let errfile = matchstr(getline('.'), '^\f*\ze|\d\+ \(error\|warning\)|') + " extract the line number from the error pattern. + let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(error\|warning\)|') + + " if we are on an error, then count the number of lines before this in the + " quickfix window with an error on the same line. + if errpat =~ 'error|$' + " our location in the quick fix window. + let errline = line('.') + + " goto the beginning of the quickfix window and begin counting the lines + " which show an error on the same line. + 0 + let numrep = 0 + while 1 + " if we are on the same kind of error line, then means we have another + " line containing the same error pattern. + if getline('.') =~ errpat + let numrep = numrep + 1 + normal! 0 + endif + " if we have reached the original location in the quick fix window, + " then break. + if line('.') == errline + break + else + " otherwise, search for the next line which contains the same + " error pattern again. goto the end of the current line so we + " dont count this line again. + normal! $ + call search(errpat, 'W') + endif + endwhile + else + let numrep = 1 + endif + + if getline('.') =~ '|\d\+ warning|' + let searchpat = escape(matchstr(getline('.'), '|\d\+ warning|\s*\zs.*'), '\ ') + else + let searchpat = 'l\.'.linenum + endif + + " We first need to be in the scope of the correct file in the .log file. + " This is important for example, when a.tex and b.tex both have errors on + " line 9 of the file and we want to go to the error of b.tex. Merely + " searching forward from the beginning of the log file for l.9 will always + " land us on the error in a.tex. + if errfile != '' + exec 'silent! bot pedit +/(\\(\\f\\|\\[\\|\]\\|\\s\\)*'.errfile.'/ '.a:filename + else + exec 'bot pedit +0 '.a:filename + endif + " Goto the preview window + " TODO: This is not robust enough. Check that a wincmd j actually takes + " us to the preview window. + wincmd j + " now search forward from this position in the preview window for the + " numrep^th error of the current line in the quickfix window. + while numrep > 0 + call search(searchpat, 'W') + let numrep = numrep - 1 + endwhile + normal! z. + +endfunction " }}} +" Tex_UpdatePreviewWindow: updates the view of the log file {{{ +" Description: +" This function should be called when focus is in a quickfix window. +" It opens the log file in a preview window and makes it display that +" part of the log file which corresponds to the error which the user is +" currently on in the quickfix window. Control returns to the quickfix +" window when the function returns. +" +function! Tex_UpdatePreviewWindow(filename) + call Tex_PositionPreviewWindow(a:filename) + + if &previewwindow + 6 wincmd _ + wincmd p + endif +endfunction " }}} +" Tex_GotoErrorLocation: goes to the correct location of error in the tex file {{{ +" Description: +" This function should be called when focus is in a quickfix window. This +" function will first open the preview window of the log file (if it is not +" already open), position the display of the preview to coincide with the +" current error under the cursor and then take the user to the file in +" which this error has occured. +" +" The position is both the correct line number and the column number. +function! Tex_GotoErrorLocation(filename) + + " first use vim's functionality to take us to the location of the error + " accurate to the line (not column). This lets us go to the correct file + " without applying any logic. + exec "normal! \<enter>" + " If the log file is not found, then going to the correct line number is + " all we can do. + if glob(a:filename) == '' + return + endif + + let winnum = winnr() + " then come back to the quickfix window + wincmd w + + " find out where in the file we had the error. + let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(warning\|error\)|') + call Tex_PositionPreviewWindow(a:filename) + + if getline('.') =~ 'l.\d\+' + + let brokenline = matchstr(getline('.'), 'l.'.linenum.' \zs.*\ze') + " If the line is of the form + " l.10 ...and then there was some error + " it means (most probably) that only part of the erroneous line is + " shown. In this case, finding the length of the broken line is not + " correct. Instead goto the beginning of the line and search forward + " for the part which is displayed and then go to its end. + if brokenline =~ '^\M...' + let partline = matchstr(brokenline, '^\M...\m\zs.*') + let normcmd = "0/\\V".escape(partline, "\\")."/e+1\<CR>" + else + let column = strlen(brokenline) + 1 + let normcmd = column.'|' + endif + + elseif getline('.') =~ 'LaTeX Warning: \(Citation\|Reference\) `.*' + + let ref = matchstr(getline('.'), "LaTeX Warning: \\(Citation\\|Reference\\) `\\zs[^']\\+\\ze'") + let normcmd = '0/'.ref."\<CR>" + + else + + let normcmd = '0' + + endif + + " go back to the window where we came from. + exec winnum.' wincmd w' + exec 'silent! '.linenum.' | normal! '.normcmd + + if !Tex_GetVarValue('Tex_ShowErrorContext') + pclose! + endif +endfunction " }}} +" Tex_SetCompilerMaps: sets maps for compiling/viewing/searching {{{ +" Description: +function! <SID>Tex_SetCompilerMaps() + if exists('b:Tex_doneCompilerMaps') + return + endif + let s:ml = exists('g:mapleader') ? g:mapleader : "\\" + + nnoremap <buffer> <Plug>Tex_Compile :call Tex_RunLaTeX()<cr> + vnoremap <buffer> <Plug>Tex_Compile :call Tex_PartCompile()<cr> + nnoremap <buffer> <Plug>Tex_View :call Tex_ViewLaTeX()<cr> + nnoremap <buffer> <Plug>Tex_ForwardSearch :call Tex_ForwardSearchLaTeX()<cr> + + call Tex_MakeMap(s:ml."ll", "<Plug>Tex_Compile", 'n', '<buffer>') + call Tex_MakeMap(s:ml."ll", "<Plug>Tex_Compile", 'v', '<buffer>') + call Tex_MakeMap(s:ml."lv", "<Plug>Tex_View", 'n', '<buffer>') + call Tex_MakeMap(s:ml."ls", "<Plug>Tex_ForwardSearch", 'n', '<buffer>') +endfunction +" }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('compiler.vim: Catching LatexSuiteFileType event', 'comp') | + \ call <SID>Tex_SetCompilerMaps() +augroup END + +command! -nargs=0 -range=% TPartCompile :<line1>, <line2> silent! call Tex_PartCompile() +" Setting b:fragmentFile = 1 makes Tex_CompileLatex consider the present file +" the _main_ file irrespective of the presence of a .latexmain file. +command! -nargs=0 TCompileThis let b:fragmentFile = 1 +command! -nargs=0 TCompileMainFile let b:fragmentFile = 0 + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/custommacros.vim b/dot_vim/ftplugin/latex-suite/custommacros.vim new file mode 100644 index 0000000..1b1c6bd --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/custommacros.vim @@ -0,0 +1,257 @@ +"============================================================================= +" File: custommacros.vim +" Author: Mikolaj Machowski +" Version: 1.0 +" Created: Tue Apr 23 05:00 PM 2002 PST +" CVS: $Id: custommacros.vim 997 2006-03-20 09:45:45Z srinathava $ +" +" Description: functions for processing custom macros in the +" latex-suite/macros directory +"============================================================================= + +let s:path = expand('<sfile>:p:h') + +" Set path to macros dir dependent on OS {{{ +if has("unix") || has("macunix") + let s:macrodirpath = $HOME."/.vim/ftplugin/latex-suite/macros/" +elseif has("win32") + if exists("$HOME") + let s:macrodirpath = $HOME."/vimfiles/ftplugin/latex-suite/macros/" + else + let s:macrodirpath = $VIM."/vimfiles/ftplugin/latex-suite/macros/" + endif +endif + +" }}} +" SetCustomMacrosMenu: sets up the menu for Macros {{{ +function! <SID>SetCustomMacrosMenu() + let flist = Tex_FindInRtp('', 'macros') + exe 'amenu '.g:Tex_MacrosMenuLocation.'&New :call <SID>NewMacro("FFFromMMMenu")<CR>' + exe 'amenu '.g:Tex_MacrosMenuLocation.'&Redraw :call RedrawMacro()<CR>' + + let i = 1 + while 1 + let fname = Tex_Strntok(flist, ',', i) + if fname == '' + break + endif + exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fname." :call <SID>DeleteMacro('".fname."')<CR>" + exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fname." :call <SID>EditMacro('".fname."')<CR>" + exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>" + exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." i<C-r>=<SID>ReadMacro('".fname."')<CR>" + let i = i + 1 + endwhile +endfunction + +if g:Tex_Menus + call <SID>SetCustomMacrosMenu() +endif + +" }}} +" NewMacro: opens new file in macros directory {{{ +function! <SID>NewMacro(...) + " Allow for calling :TMacroNew without argument or from menu and prompt + " for name. + if a:0 > 0 + let newmacroname = a:1 + else + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + endif + + if newmacroname == "FFFromMMMenu" + " Check if NewMacro was called from menu and prompt for insert macro + " name + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + elseif Tex_FindInRtp(newmacroname, 'macros') != '' + " If macro with this name already exists, prompt for another name. + exe "echomsg 'Macro ".newmacroname." already exists. Try another name.'" + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + endif + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.newmacroname) + setlocal filetype=tex +endfunction + +" }}} +" RedrawMacro: refreshes macro menu {{{ +function! RedrawMacro() + aunmenu TeX-Suite.Macros + call <SID>SetCustomMacrosMenu() +endfunction + +" }}} +" ChooseMacro: choose a macro file {{{ +" " Description: +function! s:ChooseMacro(ask) + let filelist = Tex_FindInRtp('', 'macros') + let filename = Tex_ChooseFromPrompt( + \ a:ask."\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or filename :", + \ filelist, ',') +endfunction + +" }}} +" DeleteMacro: deletes macro file {{{ +function! <SID>DeleteMacro(...) + if a:0 > 0 + let filename = a:1 + else + let filename = s:ChooseMacro('Choose a macro file for deletion :') + endif + + if !filereadable(s:macrodirpath.filename) + " When file is not in local directory decline to remove it. + call confirm('This file is not in your local directory: '.filename."\n". + \ 'It will not be deleted.' , '&OK', 1) + + else + let ch = confirm('Really delete '.filename.' ?', "&Yes\n&No", 2) + if ch == 1 + call delete(s:macrodirpath.filename) + endif + call RedrawMacro() + endif +endfunction + +" }}} +" EditMacro: edits macro file {{{ +function! <SID>EditMacro(...) + if a:0 > 0 + let filename = a:1 + else + let filename = s:ChooseMacro('Choose a macro file for insertion:') + endif + + if filereadable(s:macrodirpath.filename) + " If file exists in local directory open it. + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.filename) + else + " But if file doesn't exist in local dir it probably is in user + " restricted area. Instead opening try to copy it to local dir. + " Pity VimL doesn't have mkdir() function :) + let ch = confirm("You are trying to edit file which is probably read-only.\n". + \ "It will be copied to your local LaTeX-Suite macros directory\n". + \ "and you will be operating on local copy with suffix -local.\n". + \ "It will succeed only if ftplugin/latex-suite/macros dir exists.\n". + \ "Do you agree?", "&Yes\n&No", 1) + if ch == 1 + " But there is possibility we already created local modification. + " Check it and offer opening this file. + if filereadable(s:macrodirpath.filename.'-local') + let ch = confirm('Local version of '.filename." already exists.\n". + \ 'Do you want to open it or overwrite with original version?', + \ "&Open\nOver&write\n&Cancel", 1) + if ch == 1 + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.filename.'-local') + elseif ch == 2 + new + exe '0read '.Tex_FindInRtp(filename, 'macros') + " This is possible macro was edited before, wipe it out. + if bufexists(s:macrodirpath.filename.'-local') + exe 'bwipe '.s:macrodirpath.filename.'-local' + endif + exe 'write! '.s:macrodirpath.filename.'-local' + else + return + endif + else + " If file doesn't exist, open new file, read in system macro and + " save it in local macro dir with suffix -local + new + exe '0read '.Tex_FindInRtp(filename, 'macros') + exe 'write '.s:macrodirpath.filename.'-local' + endif + endif + + endif + setlocal filetype=tex +endfunction + +" }}} +" ReadMacro: reads in a macro from a macro file. {{{ +" allowing for placement via placeholders. +function! <SID>ReadMacro(...) + + if a:0 > 0 + let filename = a:1 + else + let filelist = Tex_FindInRtp('', 'macros') + let filename = + \ Tex_ChooseFromPrompt("Choose a macro file:\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or name of file :", + \ filelist, ',') + endif + + let fname = Tex_FindInRtp(filename, 'macros', ':p') + + let markerString = '<---- Latex Suite End Macro ---->' + let _a = @a + let position = line('.').' | normal! '.virtcol('.').'|' + silent! call append(line('.'), markerString) + silent! exec "read ".fname + silent! exec "normal! V/^".markerString."$/-1\<CR>\"ax" + " This is kind of tricky: At this stage, we are one line after the one we + " started from with the marker text on it. We need to + " 1. remove the marker and the line. + " 2. get focus to the previous line. + " 3. not remove anything from the previous line. + silent! exec "normal! $v0k$\"_x" + + call Tex_CleanSearchHistory() + + let @a = substitute(@a, '['."\n\r\t ".']*$', '', '') + let textWithMovement = IMAP_PutTextWithMovement(@a) + let @a = _a + + return textWithMovement + +endfunction + +" }}} +" commands for macros {{{ +com! -nargs=? TMacroNew :call <SID>NewMacro(<f-args>) + +" This macros had to have 2 versions: +if v:version >= 602 + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacro + \ :let s:retVal = <SID>ReadMacro(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacroEdit + \ :call <SID>EditMacro(<f-args>) + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacroDelete + \ :call <SID>DeleteMacro(<f-args>) + + " Tex_CompleteMacroName: for completing names in TMacro... commands {{{ + " Description: get list of macro names with Tex_FindInRtp(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompleteMacroName(A,P,L) + " Get name of macros from all runtimepath directories + let macronames = Tex_FindInRtp('', 'macros') + " Separate names with \n not , + let macronames = substitute(macronames,',','\n','g') + return macronames + endfunction + + " }}} + +else + com! -nargs=? TMacro + \ :let s:retVal = <SID>ReadMacro(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + com! -nargs=? TMacroEdit :call <SID>EditMacro(<f-args>) + com! -nargs=? TMacroDelete :call <SID>DeleteMacro(<f-args>) + +endif + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/diacritics.vim b/dot_vim/ftplugin/latex-suite/diacritics.vim new file mode 100644 index 0000000..616d30a --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/diacritics.vim @@ -0,0 +1,124 @@ +"============================================================================= +" File: diacritics.vim +" Author: Lubomir Host +" Created: Tue Apr 23 07:00 PM 2002 PST +" +" Description: shortcuts for all diacritics. +"============================================================================= + +if !g:Tex_Diacritics + finish +endif + +" \'{a} {{{ +call IMAP ('=a', "\\\'{a}", 'tex') +call IMAP ('=b', "\\'{b}", 'tex') +call IMAP ('=c', "\\'{c}", 'tex') +call IMAP ('=d', "\\'{d}", 'tex') +call IMAP ('=e', "\\'{e}", 'tex') +call IMAP ('=f', "\\'{f}", 'tex') +call IMAP ('=g', "\\'{g}", 'tex') +call IMAP ('=h', "\\'{h}", 'tex') +call IMAP ('=i', "\\'{\i}", 'tex') +call IMAP ('=j', "\\'{j}", 'tex') +call IMAP ('=k', "\\'{k}", 'tex') +call IMAP ('=l', "\\'{l}", 'tex') +call IMAP ('=m', "\\'{m}", 'tex') +call IMAP ('=n', "\\'{n}", 'tex') +call IMAP ('=o', "\\'{o}", 'tex') +call IMAP ('=p', "\\'{p}", 'tex') +call IMAP ('=q', "\\'{q}", 'tex') +call IMAP ('=r', "\\'{r}", 'tex') +call IMAP ('=s', "\\'{s}", 'tex') +call IMAP ('=t', "\\'{t}", 'tex') +call IMAP ('=u', "\\'{u}", 'tex') +call IMAP ('=v', "\\'{v}", 'tex') +call IMAP ('=w', "\\'{w}", 'tex') +call IMAP ('=x', "\\'{x}", 'tex') +call IMAP ('=y', "\\'{y}", 'tex') +call IMAP ('=z', "\\'{z}", 'tex') +call IMAP ('=A', "\\'{A}", 'tex') +call IMAP ('=B', "\\'{B}", 'tex') +call IMAP ('=C', "\\'{C}", 'tex') +call IMAP ('=D', "\\'{D}", 'tex') +call IMAP ('=E', "\\'{E}", 'tex') +call IMAP ('=F', "\\'{F}", 'tex') +call IMAP ('=G', "\\'{G}", 'tex') +call IMAP ('=H', "\\'{H}", 'tex') +call IMAP ('=I', "\\'{\I}", 'tex') +call IMAP ('=J', "\\'{J}", 'tex') +call IMAP ('=K', "\\'{K}", 'tex') +call IMAP ('=L', "\\'{L}", 'tex') +call IMAP ('=M', "\\'{M}", 'tex') +call IMAP ('=N', "\\'{N}", 'tex') +call IMAP ('=O', "\\'{O}", 'tex') +call IMAP ('=P', "\\'{P}", 'tex') +call IMAP ('=Q', "\\'{Q}", 'tex') +call IMAP ('=R', "\\'{R}", 'tex') +call IMAP ('=S', "\\'{S}", 'tex') +call IMAP ('=T', "\\'{T}", 'tex') +call IMAP ('=U', "\\'{U}", 'tex') +call IMAP ('=V', "\\'{V}", 'tex') +call IMAP ('=W', "\\'{W}", 'tex') +call IMAP ('=X', "\\'{X}", 'tex') +call IMAP ('=Y', "\\'{Y}", 'tex') +call IMAP ('=Z', "\\'{Z}", 'tex') +" }}} +" \v{a} {{{ +call IMAP ('+a', "\\v{a}", 'tex') +call IMAP ('+b', "\\v{b}", 'tex') +call IMAP ('+c', "\\v{c}", 'tex') +call IMAP ('+d', "\\v{d}", 'tex') +call IMAP ('+e', "\\v{e}", 'tex') +call IMAP ('+f', "\\v{f}", 'tex') +call IMAP ('+g', "\\v{g}", 'tex') +call IMAP ('+h', "\\v{h}", 'tex') +call IMAP ('+i', "\\v{\i}", 'tex') +call IMAP ('+j', "\\v{j}", 'tex') +call IMAP ('+k', "\\v{k}", 'tex') +call IMAP ('+l', "\\q l", 'tex') +call IMAP ('+m', "\\v{m}", 'tex') +call IMAP ('+n', "\\v{n}", 'tex') +call IMAP ('+o', "\\v{o}", 'tex') +call IMAP ('+p', "\\v{p}", 'tex') +call IMAP ('+q', "\\v{q}", 'tex') +call IMAP ('+r', "\\v{r}", 'tex') +call IMAP ('+s', "\\v{s}", 'tex') +call IMAP ('+t', "\\q t", 'tex') +call IMAP ('+u', "\\v{u}", 'tex') +call IMAP ('+v', "\\v{v}", 'tex') +call IMAP ('+w', "\\v{w}", 'tex') +call IMAP ('+x', "\\v{x}", 'tex') +call IMAP ('+y', "\\v{y}", 'tex') +call IMAP ('+z', "\\v{z}", 'tex') +call IMAP ('+A', "\\v{A}", 'tex') +call IMAP ('+B', "\\v{B}", 'tex') +call IMAP ('+C', "\\v{C}", 'tex') +call IMAP ('+D', "\\v{D}", 'tex') +call IMAP ('+E', "\\v{E}", 'tex') +call IMAP ('+F', "\\v{F}", 'tex') +call IMAP ('+G', "\\v{G}", 'tex') +call IMAP ('+H', "\\v{H}", 'tex') +call IMAP ('+I', "\\v{\I}", 'tex') +call IMAP ('+J', "\\v{J}", 'tex') +call IMAP ('+K', "\\v{K}", 'tex') +call IMAP ('+L', "\\v{L}", 'tex') +call IMAP ('+M', "\\v{M}", 'tex') +call IMAP ('+N', "\\v{N}", 'tex') +call IMAP ('+O', "\\v{O}", 'tex') +call IMAP ('+P', "\\v{P}", 'tex') +call IMAP ('+Q', "\\v{Q}", 'tex') +call IMAP ('+R', "\\v{R}", 'tex') +call IMAP ('+S', "\\v{S}", 'tex') +call IMAP ('+T', "\\v{T}", 'tex') +call IMAP ('+U', "\\v{U}", 'tex') +call IMAP ('+V', "\\v{V}", 'tex') +call IMAP ('+W', "\\v{W}", 'tex') +call IMAP ('+X', "\\v{X}", 'tex') +call IMAP ('+Y', "\\v{Y}", 'tex') +call IMAP ('+Z', "\\v{Z}", 'tex') +" }}} +call IMAP ('+}', "\\\"{a}", 'tex') +call IMAP ('+:', "\\^{o}", 'tex') + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/dictionaries/SIunits b/dot_vim/ftplugin/latex-suite/dictionaries/SIunits new file mode 100644 index 0000000..d4ac081 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/dictionaries/SIunits @@ -0,0 +1,289 @@ +addprefix +addunit +ampere +amperemetresecond +amperepermetre +amperepermetrenp +amperepersquaremetre +amperepersquaremetrenp +angstrom +arad +arcminute +arcsecond +are +atomicmass +atto +attod +barn +bbar +becquerel +becquerelbase +bel +candela +candelapersquaremetre +candelapersquaremetrenp +celsius +Celsius +celsiusbase +centi +centid +coulomb +coulombbase +coulombpercubicmetre +coulombpercubicmetrenp +coulombperkilogram +coulombperkilogramnp +coulombpermol +coulombpermolnp +coulombpersquaremetre +coulombpersquaremetrenp +cubed +cubic +cubicmetre +cubicmetreperkilogram +cubicmetrepersecond +curie +dday +deca +decad +deci +decid +degree +degreecelsius +deka +dekad +derbecquerel +dercelsius +dercoulomb +derfarad +dergray +derhenry +derhertz +derjoule +derkatal +derlumen +derlux +dernewton +derohm +derpascal +derradian +dersiemens +dersievert +dersteradian +dertesla +dervolt +derwatt +derweber +electronvolt +exa +exad +farad +faradbase +faradpermetre +faradpermetrenp +femto +femtod +fourth +gal +giga +gigad +gram +graybase +graypersecond +graypersecondnp +hectare +hecto +hectod +henry +henrybase +henrypermetre +henrypermetrenp +hertz +hertzbase +hour +joule +joulebase +joulepercubicmetre +joulepercubicmetrenp +jouleperkelvin +jouleperkelvinnp +jouleperkilogram +jouleperkilogramkelvin +jouleperkilogramkelvinnp +jouleperkilogramnp +joulepermole +joulepermolekelvin +joulepermolekelvinnp +joulepermolenp +joulepersquaremetre +joulepersquaremetrenp +joulepertesla +jouleperteslanp +katal +katalbase +katalpercubicmetre +katalpercubicmetrenp +kelvin +kilo +kilod +kilogram +kilogrammetrepersecond +kilogrammetrepersecondnp +kilogrammetrepersquaresecond +kilogrammetrepersquaresecondnp +kilogrampercubicmetre +kilogrampercubicmetrecoulomb +kilogrampercubicmetrecoulombnp +kilogrampercubicmetrenp +kilogramperkilomole +kilogramperkilomolenp +kilogrampermetre +kilogrampermetrenp +kilogrampersecond +kilogrampersecondcubicmetre +kilogrampersecondcubicmetrenp +kilogrampersecondnp +kilogrampersquaremetre +kilogrampersquaremetrenp +kilogrampersquaremetresecond +kilogrampersquaremetresecondnp +kilogramsquaremetre +kilogramsquaremetrenp +kilogramsquaremetrepersecond +kilogramsquaremetrepersecondnp +kilowatthour +liter +litre +lumen +lumenbase +lux +luxbase +mega +megad +meter +metre +metrepersecond +metrepersecondnp +metrepersquaresecond +metrepersquaresecondnp +micro +microd +milli +millid +minute +mole +molepercubicmetre +molepercubicmetrenp +nano +nanod +neper +newton +newtonbase +newtonmetre +newtonpercubicmetre +newtonpercubicmetrenp +newtonperkilogram +newtonperkilogramnp +newtonpermetre +newtonpermetrenp +newtonpersquaremetre +newtonpersquaremetrenp +NoAMS +no@qsk +ohm +ohmbase +ohmmetre +one +paminute +pascal +pascalbase +pascalsecond +pasecond +per +period@active +persquaremetresecond +persquaremetresecondnp +peta +petad +pico +picod +power +@qsk +quantityskip +rad +radian +radianbase +radianpersecond +radianpersecondnp +radianpersquaresecond +radianpersquaresecondnp +reciprocal +rem +roentgen +rp +rpcubed +rpcubic +rpcubicmetreperkilogram +rpcubicmetrepersecond +rperminute +rpersecond +rpfourth +rpsquare +rpsquared +rpsquaremetreperkilogram +second +siemens +siemensbase +sievert +sievertbase +square +squared +squaremetre +squaremetrepercubicmetre +squaremetrepercubicmetrenp +squaremetrepercubicsecond +squaremetrepercubicsecondnp +squaremetreperkilogram +squaremetrepernewtonsecond +squaremetrepernewtonsecondnp +squaremetrepersecond +squaremetrepersecondnp +squaremetrepersquaresecond +squaremetrepersquaresecondnp +steradian +steradianbase +tera +terad +tesla +teslabase +ton +tonne +unit +unitskip +usk +volt +voltbase +voltpermetre +voltpermetrenp +watt +wattbase +wattpercubicmetre +wattpercubicmetrenp +wattperkilogram +wattperkilogramnp +wattpermetrekelvin +wattpermetrekelvinnp +wattpersquaremetre +wattpersquaremetrenp +wattpersquaremetresteradian +wattpersquaremetresteradiannp +weber +weberbase +yocto +yoctod +yotta +yottad +zepto +zeptod +zetta +zettad diff --git a/dot_vim/ftplugin/latex-suite/dictionaries/dictionary b/dot_vim/ftplugin/latex-suite/dictionaries/dictionary new file mode 100644 index 0000000..458dc0b --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/dictionaries/dictionary @@ -0,0 +1,677 @@ +abbrv +abovedisplayshortskip +abovedisplayskip +abstract +abstract +abstractname +acute +addcontentsline +address +addtime +addtocontents +addtocounter +addtolength +addvspace +align +alph +Alph +alpha +amsmath +amsthm +and +appendix +appendixname +arabic +array +arraycolsep +arrayrulewidth +arraystretch +article +author +a4paper +a5paper +backmatter +bar +bar +baselineskip +baselinestretch +batchmode +begin +belowdisplayshortskip +belowdisplayskip +bezier +bf +bfseries +bibindent +bibitem +bibliography +bibliographystyle +bibname +big +Big +Bigg +bigg +Biggl +biggl +Biggm +biggm +Biggr +biggr +Bigl +bigl +bigm +Bigm +bigr +Bigr +bigskip +bigskipamount +binom +blg +boldmath +boldsymbol +book +botfigrule +bottmofraction +bottomnumber +boxedminipage +bp +breve +b5paper +calc +calc +caption +caption2 +capt-of +cases +cc +ccaption +ccname +cdotscenter +centering +cercle +cfrac +changebar +chapter +chapterbib +chaptername +check +cite +cleardoublepage +clearpage +cline +clock +closing +cm +COLON +columnsep +columnseprule +columnwidth +contentsline +contentsname +copyright +dag +dashbox +date +dbinom +dblfigure +dblfloatpage +dblfloatsep +dbltextfloatsep +dbltopfraction +dbltopnumber +dcolumn +dd +ddag +ddot +ddots +DeclareMathOperator +depth +description +dfrac +displaylimits +displaymath +displaystyle +document +documentclass +dot +dotfill +doublerulesep +downbracefill +draft +dropping +dywiz +em +emph +empty +encl +enclname +end +endfloat +enlargethispage +enskip +enspace +ensuremath +enumerate +enumi +enumii +enumiii +enumiv +eqnarray +equation +errorstopmode +eucal +eufrak +evensidemargin +everyship +ex +executivepaper +expdlist +extracolsep +extramark +fancybox +fancyhdr +fbox +fboxrule +fboxsep +figure +figurename +file +filecontents +final +flafter +fleqn +floatflt +floatpagefraction +floatsep +flushbottom +flushleft +flushright +fnpara +fnsymbol +fn2end +fontenc +footheight +footmisc +footnote +footnotemark +footnoterule +footnotesep +footnotesize +footnotetext +footnpag +footskip +frac +frame +framebox +frenchspacing +frontmatter +ftnright +fussy +gather +genfrac +geometry +glossary +glossaryentry +graphicx +graphpaper +grave +hat +hbox +headheihgt +headings +headsep +height +helvet +hfill +hhline +hline +hrulefill +hspace +huge +Huge +HUGE +hyperref +hyphenation +ifthen +in +include +includeonly +indent +indentfirst +index +indexentry +indexname +indexspace +input +inputenc +intertext +intextsep +invisible +it +item +itemindent +itemize +itemsep +itshape +jot +kill +label +labelenumi +labelenumii +labelenumiii +labelenumiv +labelitemi +labelitemii +labelitemiii +labelitemiv +labelsep +labelwidth +landscape +large +LARGE +Large +LaTeX +LaTeXe +latexsym +ldots +left +leftarrowfill +lefteqn +leftmargin +leftmargini +leftmarginii +leftmarginiii +leftmarginiv +leftmarginv +leftmarginvi +leftmark +legalpaper +leq +leqno +letter +letterpaper +letterspace +lhead +limits +line +linebreak +linethickness +linewidth +list +listfigurename +listfiles +listoffigures +listoftables +listparindent +location +longtable +lq +lrbox +lscape +mainmatter +makeatletter +makeatother +makebox +makeglossary +makeidx +makeindex +makelabel +maketitle +manyfoot +marginpar +marginparpush +marginparsep +marginparwidth +markboth +markleft +markright +math +mathbb +mathbf +mathbin +mathcal +mathclose +mathfrak +mathindent +mathit +mathnormal +mathop +mathopen +mathord +mathpunct +mathrel +mathrm +mathscr +mathsf +mathstrut +mathtt +mathversion +mbox +mdseries +medmuskip +medskip +medskipamount +minipage +minitoc +minus +mkern +mm +moreverbatim +mpfootnote +mu +multicol +multicolumn +multilanguage +multiput +multirow +myheadings +nabla +name +NeedsTeXFormat +newcommand +newcounter +newenvironment +newfont +newlength +newline +newpage +newsavebox +newtheorem +nocite +nofiles +noindent +nolimits +nolinebreak +nomathsymbols +nonfrenchspacing +nonumber +nopagebreak +normalfont +normalsize +not +notag +note +notitlepage +nu +numberline +numline +numprint +oddsidemargin +oldstyle +onecolumn +oneside +onlynotes +onlyslides +openany +openbib +opening +openright +operatorname +oval +overbrace +overlay +overleftarrow +overline +overrightarrow +page +pagebreak +pagenumbering +pageref +pagestyle +paperheight +paperwidth +par +paragraph +parbox +parbox +parindent +parsep +parskip +part +partial +partname +partopsep +pauza +pc +phi +pi +picture +plain +PLdateending +plmath +PLSlash +plus +pmb +pmod +polski +polski +poptabs +pounds +ppauza +prefixing +printindex +protect +providecommand +ps +pt +pushtabs +put +qbezier +qbeziermax +qquad +quad +quotation +quote +raggedbottom +raggedleft +raggedright +ragged2e +raisebox +ratio +real +ref +refname +refstepcounter +relsize +renewcommand +renewenvironment +report +reversemarginpar +rhead +right +rightarrowfill +rightmargin +rightmark +rm +rmfamily +roman +Roman +rotate +rotating +rq +rule +samepage +savebox +sb +sbox +sc +scriptscriptstyle +scriptsize +scriptstyle +scrollmode +scshape +secnumdepth +section +sectionmark +see +seename +selectfont +selectlanguage +setcounter +setlength +settime +settodepth +settoheight +settowidth +sf +sffamily +shadethm +shadow +shapepar +shortstack +showlabels +sidecap +signature +sin +sl +slide +slides +sloppy +sloppybar +slshape +small +smallskip +smallskipamount +soul +sp +space +sqrt +ss +SS +stackrel +startbreaks +stepcounter +stop +stopbreaks +stretch +strut +subfigure +subfigure +subitem +subparagraph +subsection +subsubitem +subsubsection +sum +supressfloats +symbol +symbol +tabbing +tabcolsep +table +tablename +tableofcontents +tabular +tabularx +tag +tan +tbinom +telephone +TeX +textbf +textbullet +textcircled +textcompwordmark +textemdash +textendash +textexclamdown +textfloatsep +textfraction +textheight +textit +textmd +textnormal +textperiodcenter +textquestiondown +textquotedblleft +textquotedblright +textquoteleft +textquoteright +textrm +textsc +textsf +textsl +textstyle +textsuperscript +texttt +textup +textvisiblespace +textwidth +tfrac +thanks +the +thebibliography +theindex +theorem +thepage +thesection +theta +thicklines +thickmuskip +thinlines +thispagestyle +tilde +time +times +tiny +title +titlepage +tocdepth +today +topfigrule +topfraction +topmargin +topmargin +topmargin +topsep +topskip +topskip +totalheight +totalnumber +trivlist +tt +ttfamily +twocolumn +twocolumn +twoside +typein +typein +typeout +typeout +ulem +ulem +unboldmath +underbrace +underline +unsort +unsrt +upbracefill +upshape +upshape +usebox +usebox +usecounter +usefont +usepackage +value +vbox +vdots +vec +vector +verb +verb +verbatim +verse +vfill +visible +vline +vmargin +voffset +vspace +widehat +widetilde +width +wrapfig +xleftarrow +xrightarrow +threeparttable diff --git a/dot_vim/ftplugin/latex-suite/elementmacros.vim b/dot_vim/ftplugin/latex-suite/elementmacros.vim new file mode 100644 index 0000000..8960a0f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/elementmacros.vim @@ -0,0 +1,338 @@ +"============================================================================= +" File: elementmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for dimensions/fonts/counters. +" and various common commands such ref/label/footnote. +"============================================================================= + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +if exists('s:lastElementsLocation') && g:Tex_ElementsMenuLocation == s:lastElementsLocation + finish +endif + +if exists('s:lastElementsLocation') + exe 'aunmenu '.s:lastElementsLocation.'Font.' + exe 'aunmenu '.s:lastElementsLocation.'Dimension.' + exe 'aunmenu '.s:lastElementsLocation.'Counters.' + exe 'aunmenu '.s:lastElementsLocation.'Various.' +endif + +let s:lastElementsLocation = g:Tex_ElementsMenuLocation + +let s:fontMenuLoc = g:Tex_ElementsMenuLocation.'Font.' +let s:dimensionMenuLoc = g:Tex_ElementsMenuLocation.'Dimension.' +let s:counterMenuLoc = g:Tex_ElementsMenuLocation.'Counters.' +let s:variousMenuLoc = g:Tex_ElementsMenuLocation.'Various.' + +" ============================================================================== +" Set up the functions the first time. +" ============================================================================== +if !exists('s:definedFuncs') " {{{ + let s:definedFuncs = 1 + + " Tex_RemoveElementMenus: remove the elements menu {{{ + " + function! Tex_RemoveElementMenus() + exe 'silent! aunmenu '.s:lastElementsLocation.'Font.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Dimension.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Counters.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Various.' + endfunction + + " }}} + " Tex_FontFamily: sets up font menus {{{ + " + function! <SID>Tex_FontFamily(font,fam) + let vislhs = matchstr(tolower(a:font), '^.\zs.*') + + " avoid redoing imaps and vmaps for every reconfiguration of menus. + if !exists('s:doneOnce') && g:Tex_FontMaps + exe "vnoremap <silent> ".g:Tex_Leader.vislhs. + \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" + exe 'call IMAP ("'.a:font.'", "\\text'.vislhs.'{<++>}<++>", "tex")' + endif + + " menu entry. + if g:Tex_Menus && g:Tex_FontMenus + let location = s:fontMenuLoc.substitute(a:fam, '^.', '\u&', '').'.'.vislhs.a:fam.'<tab>'.a:font.'\ ('.g:Tex_Leader.vislhs.')' + exe "amenu ".location. + \" <plug><C-r>=IMAP_PutTextWithMovement('\\text".vislhs."{<++>}<++>')<CR>" + exe "vmenu ".location. + \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" + endif + + endfunction + + " }}} + " Tex_FontDiacritics: sets up menus for diacritics. {{{ + " + function! <SID>Tex_FontDiacritics(name, rhs) + let location = s:fontMenuLoc.'&Diacritics.'.a:name.'<tab>' + exe 'amenu '.location. + \" <plug><C-r>=IMAP_PutTextWithMovement('\\".a:rhs."{<++>}<++>')<CR>" + exe 'vmenu '.location. + \" \<C-\\>\<C-n>:call VEnclose('\\".a:rhs."{', '}', '', '')<CR>" + endfunction " }}} + " Tex_FontSize: sets up size fonts {{{ + " + function! <SID>Tex_FontSize(name) + let location = s:fontMenuLoc.'&Size.'.a:name.'<tab>' + exe 'amenu '.location." <plug>\\".a:name + exe 'vunmenu '.location + endfunction " }}} + " Tex_Fontfont: sets up the 'font' part of font menus {{{ + " + function! <SID>Tex_Fontfont(desc, lhs) + let location = s:fontMenuLoc.'&font.'.a:desc.'<tab>' + exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" + exe "vunmenu ".location + endfunction " }}} + " Tex_DimMenus: set up dimension menus {{{ + function! <SID>Tex_DimMenus(submenu, rhs) + let location = s:dimensionMenuLoc.a:submenu.'.'.a:rhs.'<tab>' + exe "amenu ".location." <plug>\\".a:rhs + exe "vunmenu ".location + endfunction " }}} + " Tex_CounterMenus: set up counters menus {{{ + function! <SID>Tex_CounterMenus(submenu, rhs) + let location = s:counterMenuLoc.a:submenu.'.'.a:rhs.'<tab>' + exe "amenu ".location." <plug>\\".a:rhs + exe "vunmenu ".location + endfunction " }}} + " Tex_VariousMenus: set up various menus {{{ + function! <SID>Tex_VariousMenus(desc, lhs) + let location = s:variousMenuLoc.a:desc.'<tab>' + exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" + exe "vunmenu ".location + endfunction " }}} +endif +" }}} + +" ============================================================================== +" Fonts +" ============================================================================== +" series/family/shape {{{ +call <SID>Tex_FontFamily("FBF","series") +call <SID>Tex_FontFamily("FMD","series") + +call <SID>Tex_FontFamily("FTT","family") +call <SID>Tex_FontFamily("FSF","family") +call <SID>Tex_FontFamily("FRM","family") + +call <SID>Tex_FontFamily("FUP","shape") +call <SID>Tex_FontFamily("FSL","shape") +call <SID>Tex_FontFamily("FSC","shape") +call <SID>Tex_FontFamily("FIT","shape") + +" the \emph is special. +if g:Tex_FontMaps | exe "vnoremap <silent> ".g:Tex_Leader."em \<C-\\>\<C-N>:call VEnclose('\\emph{', '}', '{\\em', '\\/}')<CR>" | endif +if g:Tex_FontMaps | exe 'call IMAP ("FEM", "\\emph{<++>}<++>", "tex")' | endif + +" }}} +if g:Tex_Menus && g:Tex_FontMenus + " {{{ diacritics + call <SID>Tex_FontDiacritics('Acute', '"') + call <SID>Tex_FontDiacritics('Breve', 'u') + call <SID>Tex_FontDiacritics('Circle', 'r') + call <SID>Tex_FontDiacritics('Circumflex', '^') + call <SID>Tex_FontDiacritics('Umlaut', '"') + call <SID>Tex_FontDiacritics('HUmlaut', 'H') + call <SID>Tex_FontDiacritics('Dot\ over', '.') + call <SID>Tex_FontDiacritics('Grave', '`') + call <SID>Tex_FontDiacritics('Hacek', 'v') + call <SID>Tex_FontDiacritics('Makron', '=') + call <SID>Tex_FontDiacritics('Tilde', '~') + call <SID>Tex_FontDiacritics('Underline', 'b') + call <SID>Tex_FontDiacritics('Cedille', 'c') + call <SID>Tex_FontDiacritics('Dot\ under', ' ') + call <SID>Tex_FontDiacritics('Ligature', 't') + " }}} + " {{{ Si&ze. + call <SID>Tex_FontSize('tiny') + call <SID>Tex_FontSize('scriptsize') + call <SID>Tex_FontSize('footnotesize') + call <SID>Tex_FontSize('small') + call <SID>Tex_FontSize('normalsize') + call <SID>Tex_FontSize('large') + call <SID>Tex_FontSize('Large') + call <SID>Tex_FontSize('LARGE') + call <SID>Tex_FontSize('huge') + call <SID>Tex_FontSize('Huge') + " }}} + " {{{ &font. + call s:Tex_Fontfont('fontencoding{}', '\fontencoding{<++>}<++>') + call s:Tex_Fontfont('fontfamily{qtm}', '\fontfamily{<++>}<++>') + call s:Tex_Fontfont('fontseries{m\ b\ bx\ sb\ c}', '\fontseries{<++>}<++>') + call s:Tex_Fontfont('fontshape{n\ it\ sl\ sc\ ui}', '\fontshape{<++>}<++>') + call s:Tex_Fontfont('fontsize{}{}', '\fontsize{<++>}{<++>}<++>') + call s:Tex_Fontfont('selectfont', '\selectfont ') + " }}} +endif + +" ============================================================================== +" Dimensions +" ============================================================================== +if g:Tex_Menus + " {{{ Static1 + call <SID>Tex_DimMenus('Static1', 'arraycolsep') + call <SID>Tex_DimMenus('Static1', 'arrayrulewidth') + call <SID>Tex_DimMenus('Static1', 'bibindent') + call <SID>Tex_DimMenus('Static1', 'columnsep') + call <SID>Tex_DimMenus('Static1', 'columnseprule') + call <SID>Tex_DimMenus('Static1', 'columnwidth') + call <SID>Tex_DimMenus('Static1', 'doublerulesep') + call <SID>Tex_DimMenus('Static1', 'evensidemargin') + call <SID>Tex_DimMenus('Static1', 'fboxrule') + call <SID>Tex_DimMenus('Static1', 'fboxsep') + call <SID>Tex_DimMenus('Static1', 'footheight') + call <SID>Tex_DimMenus('Static1', 'footnotesep') + call <SID>Tex_DimMenus('Static1', 'footskip') + call <SID>Tex_DimMenus('Static1', 'headheight') + call <SID>Tex_DimMenus('Static1', 'headsep') + call <SID>Tex_DimMenus('Static1', 'itemindent') + call <SID>Tex_DimMenus('Static1', 'labelsep') + call <SID>Tex_DimMenus('Static1', 'labelwidth') + call <SID>Tex_DimMenus('Static1', 'leftmargin') + call <SID>Tex_DimMenus('Static1', 'leftmargini') + call <SID>Tex_DimMenus('Static1', 'leftmarginii') + call <SID>Tex_DimMenus('Static1', 'leftmarginiii') + call <SID>Tex_DimMenus('Static1', 'leftmarginiv') + call <SID>Tex_DimMenus('Static1', 'leftmarginv') + call <SID>Tex_DimMenus('Static1', 'leftmarginvi') + call <SID>Tex_DimMenus('Static1', 'linewidth') + call <SID>Tex_DimMenus('Static1', 'listparindent') + call <SID>Tex_DimMenus('Static1', 'marginparpush') + call <SID>Tex_DimMenus('Static1', 'marginparsep') + call <SID>Tex_DimMenus('Static1', 'marginparwidth') + call <SID>Tex_DimMenus('Static1', 'mathindent') + call <SID>Tex_DimMenus('Static1', 'oddsidemargin') + " }}} + " {{{ Static2 + call <SID>Tex_DimMenus('Static2', 'paperheight') + call <SID>Tex_DimMenus('Static2', 'paperwidth') + call <SID>Tex_DimMenus('Static2', 'parindent') + call <SID>Tex_DimMenus('Static2', 'rightmargin') + call <SID>Tex_DimMenus('Static2', 'tabbingsep') + call <SID>Tex_DimMenus('Static2', 'tabcolsep') + call <SID>Tex_DimMenus('Static2', 'textheight') + call <SID>Tex_DimMenus('Static2', 'textwidth') + call <SID>Tex_DimMenus('Static2', 'topmargin') + call <SID>Tex_DimMenus('Static2', 'unitlength') + " }}} + " {{{ Dynamic + call <SID>Tex_DimMenus('Dynamic', 'abovedisplayshortskip') + call <SID>Tex_DimMenus('Dynamic', 'abovedisplayskip') + call <SID>Tex_DimMenus('Dynamic', 'baselineskip') + call <SID>Tex_DimMenus('Dynamic', 'belowdisplayshortskip') + call <SID>Tex_DimMenus('Dynamic', 'belowdisplayskip') + call <SID>Tex_DimMenus('Dynamic', 'dblfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'dbltextfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'floatsep') + call <SID>Tex_DimMenus('Dynamic', 'intextsep') + call <SID>Tex_DimMenus('Dynamic', 'itemsep') + call <SID>Tex_DimMenus('Dynamic', 'parsep') + call <SID>Tex_DimMenus('Dynamic', 'parskip') + call <SID>Tex_DimMenus('Dynamic', 'partopsep') + call <SID>Tex_DimMenus('Dynamic', 'textfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'topsep') + call <SID>Tex_DimMenus('Dynamic', 'topskip') + " }}} + " {{{ Change + call <SID>Tex_DimMenus('Change', 'setlength') + call <SID>Tex_DimMenus('Change', 'addtolength') + call <SID>Tex_DimMenus('Change', 'settoheight') + call <SID>Tex_DimMenus('Change', 'settowidth') + call <SID>Tex_DimMenus('Change', 'settolength') + " }}} +endif + +" ============================================================================== +" Counters +" ============================================================================== +if g:Tex_Menus + " Counters {{{ + call <SID>Tex_CounterMenus('Counters', 'bottomnumber') + call <SID>Tex_CounterMenus('Counters', 'chapter') + call <SID>Tex_CounterMenus('Counters', 'dbltopnumber') + call <SID>Tex_CounterMenus('Counters', 'enumi') + call <SID>Tex_CounterMenus('Counters', 'enumii') + call <SID>Tex_CounterMenus('Counters', 'enumiii') + call <SID>Tex_CounterMenus('Counters', 'enumiv') + call <SID>Tex_CounterMenus('Counters', 'equation') + call <SID>Tex_CounterMenus('Counters', 'figure') + call <SID>Tex_CounterMenus('Counters', 'footnote') + call <SID>Tex_CounterMenus('Counters', 'mpfootnote') + call <SID>Tex_CounterMenus('Counters', 'page') + call <SID>Tex_CounterMenus('Counters', 'paragraph') + call <SID>Tex_CounterMenus('Counters', 'part') + call <SID>Tex_CounterMenus('Counters', 'secnumdepth') + call <SID>Tex_CounterMenus('Counters', 'section') + call <SID>Tex_CounterMenus('Counters', 'subparagraph') + call <SID>Tex_CounterMenus('Counters', 'subsection') + call <SID>Tex_CounterMenus('Counters', 'subsubsection') + call <SID>Tex_CounterMenus('Counters', 'table') + call <SID>Tex_CounterMenus('Counters', 'tocdepth') + call <SID>Tex_CounterMenus('Counters', 'topnumber') + call <SID>Tex_CounterMenus('Counters', 'totalnumber') + " }}} + " theCounters {{{ + call <SID>Tex_CounterMenus('theCounters', 'thebottomnumber') + call <SID>Tex_CounterMenus('theCounters', 'thechapter') + call <SID>Tex_CounterMenus('theCounters', 'thedbltopnumber') + call <SID>Tex_CounterMenus('theCounters', 'theenumi') + call <SID>Tex_CounterMenus('theCounters', 'theenumii') + call <SID>Tex_CounterMenus('theCounters', 'theenumiii') + call <SID>Tex_CounterMenus('theCounters', 'theenumiv') + call <SID>Tex_CounterMenus('theCounters', 'theequation') + call <SID>Tex_CounterMenus('theCounters', 'thefigure') + call <SID>Tex_CounterMenus('theCounters', 'thefootnote') + call <SID>Tex_CounterMenus('theCounters', 'thempfootnote') + call <SID>Tex_CounterMenus('theCounters', 'thepage') + call <SID>Tex_CounterMenus('theCounters', 'theparagraph') + call <SID>Tex_CounterMenus('theCounters', 'thepart') + call <SID>Tex_CounterMenus('theCounters', 'thesecnumdepth') + call <SID>Tex_CounterMenus('theCounters', 'thesection') + call <SID>Tex_CounterMenus('theCounters', 'thesubparagraph') + call <SID>Tex_CounterMenus('theCounters', 'thesubsection') + call <SID>Tex_CounterMenus('theCounters', 'thesubsubsection') + call <SID>Tex_CounterMenus('theCounters', 'thetable') + call <SID>Tex_CounterMenus('theCounters', 'thetocdepth') + call <SID>Tex_CounterMenus('theCounters', 'thetopnumber') + call <SID>Tex_CounterMenus('theCounters', 'thetotalnumber') + " }}} + " Type {{{ + call <SID>Tex_CounterMenus('Type', 'alph') + call <SID>Tex_CounterMenus('Type', 'Alph') + call <SID>Tex_CounterMenus('Type', 'arabic') + call <SID>Tex_CounterMenus('Type', 'roman') + call <SID>Tex_CounterMenus('Type', 'Roman') + " }}} +endif + +" ============================================================================== +" Various +" ============================================================================== +if g:Tex_Menus + " Various {{{ + call <SID>Tex_VariousMenus('ref{}' , '\ref{<++>}<++>') + call <SID>Tex_VariousMenus('pageref{}' , '\pageref{<++>}<++>') + call <SID>Tex_VariousMenus('label{}' , '\label{<++>}<++>') + call <SID>Tex_VariousMenus('footnote{}' , '\footnote{<++>}<++>') + call <SID>Tex_VariousMenus('footnotemark{}', '\footnotemark{<++>}<++>') + call <SID>Tex_VariousMenus('footnotemark{}', '\footnotetext{<++>}<++>') + call <SID>Tex_VariousMenus('cite{}' , '\cite{<++>}<++>') + call <SID>Tex_VariousMenus('nocite{}' , '\nocite{<++>}<++>') + " }}} +endif + +if g:Tex_CatchVisMapErrors + exe "vnoremap ".g:Tex_Leader." :\<C-u>call ExecMap('".g:Tex_Leader."', 'v')\<CR>" +endif +" this is for avoiding reinclusion of imaps from next time on. +let s:doneOnce = 1 + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/envmacros.vim b/dot_vim/ftplugin/latex-suite/envmacros.vim new file mode 100644 index 0000000..2f41a27 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/envmacros.vim @@ -0,0 +1,1167 @@ +"============================================================================= +" File: envmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 08:00 PM 2002 PST +" CVS Header: $Id: envmacros.vim 997 2006-03-20 09:45:45Z srinathava $ +" Description: mappings/menus for environments. +"============================================================================= + +if !g:Tex_EnvironmentMaps && !g:Tex_EnvironmentMenus + finish +endif + +exe 'so '.expand('<sfile>:p:h').'/wizardfuncs.vim' + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +" Define environments for IMAP evaluation " {{{ +let s:figure = "\\begin{figure}[<+htpb+>]\<cr>\\begin{center}\<cr>\\psfig{figure=<+eps file+>}\<cr>\\end{center}\<cr>\\caption{<+caption text+>}\<cr>\\label{fig:<+label+>}\<cr>\\end{figure}<++>" +let s:figure_graphicx = "\\begin{figure}[<+htpb+>]\<cr>\\begin{center}\<cr>\\includegraphics{<+file+>}\<cr>\\end{center}\<cr>\\caption{<+caption text+>}\<cr>\\label{fig:<+label+>}\<cr>\\end{figure}<++>" +let s:minipage = "\\begin{minipage}[<+tb+>]{<+width+>}\<cr><++>\<cr>\\end{minipage}<++>" +let s:picture = "\\begin{picture}(<+width+>, <+height+>)(<+xoff+>,<+yoff+>)\<cr>\\put(<+xoff+>,<+yoff+>){\\framebox(<++>,<++>){<++>}}\<cr>\\end{picture}<++>" +let s:list = "\\begin{list}{<+label+>}{<+spacing+>}\<cr>\\item <++>\<cr>\\end{list}<++>" +let s:table = "\\begin{table}\<cr>\\centering\<cr>\\begin{tabular}{<+dimensions+>}\<cr><++>\<cr>\\end{tabular}\<cr>\\caption{<+Caption text+>}\<cr>\\label{tab:<+label+>}\<cr>\\end{table}<++>" +let s:array = "\\left<++>\<cr>\\begin{array}{<+dimension+>}\<cr><+elements+>\<cr>\\end{array}\<cr>\\right<++>" +let s:description ="\\begin{description}\<cr>\\item[<+label+>]<++>\<cr>\\end{description}<++>" +let s:document = "\\documentclass[<+options+>]{<+class+>}\<cr>\<cr>\\begin{document}\<cr><++>\<cr>\\end{document}" +let s:tabular = "\\begin{tabular}[<+hbtp+>]{<+format+>}\<cr><++>\<cr>\\end{tabular}" +let s:tabular_star = "\\begin{tabular*}[<+hbtp+>]{<+format+>}\<cr><++>\<cr>\\end{tabular*}" +let s:frame = "\\begin{frame}{<+title>}\<cr><++>\<cr>\\end{frame}<++>" + +" }}} +" define environments with special behavior in line wise selection. {{{ +if !exists('s:vis_center_left') + let s:vis_center_left = '\centerline{' + let s:vis_center_right = '}' + + let s:vis_verbatim_left = '\verb\|' + let s:vis_verbatim_right = '\|' + + let s:vis_flushright_left = '{\raggedright ' + let s:vis_flushright_right = '}' + + let s:vis_fushleft_left = '{\raggedleft ' + let s:vis_fushleft_right = '}' + + let s:vis_lrbox_left = '\sbox{' + let s:vis_lrbox_right = '}' +endif +" }}} +" Tex_EnvMacros: sets up maps and menus for environments {{{ +" Description: +function! <SID>Tex_EnvMacros(lhs, submenu, name) + + let extra = '' + if a:submenu =~ 'Lists' + let extra = '\item ' + endif + + let vright = '' + let vleft = '' + if exists('s:vis_'.a:name.'_right') + let vright = s:vis_{a:name}_right + let vleft = s:vis_{a:name}_left + endif + let vrhs = "\<C-\\>\<C-N>:call VEnclose('".vleft."', '".vright."', '\\begin{".a:name."}', '\\end{".a:name."}')\<CR>" + let location = g:Tex_EnvMenuLocation.a:submenu.a:name.'<tab>' + + if a:lhs != '' + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let location = location.a:lhs.'\ ('.vlhs.')' + + if g:Tex_EnvironmentMaps && !exists('s:doneOnce') + call IMAP(a:lhs, "\<C-r>=Tex_PutEnvironment('".a:name."')\<CR>", 'tex') + exec 'vnoremap <silent> '.vlhs.' '.vrhs + endif + + endif + + if g:Tex_Menus && g:Tex_EnvironmentMenus && has("gui_running") + exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' + exe 'vmenu '.location.' '.vrhs + endif + +endfunction + +" }}} +" Tex_SpecialMacros: macros with special right hand sides {{{ +" Description: +function! <SID>Tex_SpecialMacros(lhs, submenu, name, irhs, ...) + + let wiz = 1 + if a:0 > 0 && a:1 == 0 + let wiz = 0 + endif + + let location = g:Tex_EnvMenuLocation.a:submenu.a:name + + let vright = '' + let vleft = '' + if exists('s:vis_'.a:name.'_right') + let vright = s:vis_{a:name}_right + let vleft = s:vis_{a:name}_left + endif + let vrhs = "\<C-\\>\<C-N>:call VEnclose('".vleft."', '".vright."', '\\begin{".a:name."}', '\\end{".a:name."}')\<CR>" + + if a:lhs != '' + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let location = location.'<tab>'.a:lhs.'\ ('.vlhs.')' + + if g:Tex_EnvironmentMaps && !exists('s:doneOnce') + call IMAP(a:lhs, a:irhs, 'tex') + exec 'vnoremap '.vlhs.' '.vrhs + endif + + endif + + if g:Tex_Menus && g:Tex_EnvironmentMenus + if wiz + exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' + else + exe 'amenu '.location." <plug><C-r>=IMAP_PutTextWithMovement('".a:irhs."')<CR>" + endif + exe 'vmenu '.location.' '.vrhs + endif + +endfunction " }}} +" Tex_SectionMacros: creates section maps and menus {{{ +" Description: +function! <SID>Tex_SectionMacros(lhs, name) + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let vrhs = "\<C-\\>\<C-N>:call VEnclose('\\".a:name."{', '}', '', '')<CR>" + + if g:Tex_SectionMaps && !exists('s:doneOnce') + exe 'vnoremap '.vlhs.' '.vrhs + call IMAP (a:lhs, "\\".a:name.'{<++>}<++>', 'tex') + endif + + if g:Tex_Menus && g:Tex_SectionMenus + let location = g:Tex_EnvMenuLocation.'Sections.'.a:name.'<tab>'.a:lhs.'\ ('.vlhs.')' + let advlocation = g:Tex_EnvMenuLocation.'Sections.Advanced.'.a:name + + let irhs = "\<C-r>=IMAP_PutTextWithMovement('\\".a:name."{<++>}<++>')\<CR>" + + let advirhs = "\<C-r>=Tex_InsSecAdv('".a:name."')\<CR>" + let advvrhs = "\<C-\\>\<C-N>:call Tex_VisSecAdv('".a:name."')\<CR>" + + exe 'amenu '.advlocation.' <plug>'.advirhs + exe 'vnoremenu '.advlocation." ".advvrhs + + exe 'amenu '.location.' <plug>'.irhs + exe 'vnoremenu '.location." ".vrhs + endif +endfunction " }}} + +" NewEnvironments {{{ +call s:Tex_SpecialMacros('', '', 'newenvironment', '\newenvironment{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'newenvironment*', '\newenvironment*{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'renewenvironment', '\renewenvironment{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'renewenvironment*', '\renewenvironment*{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', '-sepenv0-', ' :', 0) +" }}} +" Environments specific commands {{{ +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', '&item', '\item', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', 'i&tem[]', '\item[<++>]<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', '&bibitem{}', '\bibitem{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&=', '\=', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&>', '\>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&\\\\', '\\', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&+', '\+', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&-', '\-', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', "\\\'", "\\\'", 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&`', '\`', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&kill', '\kill', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&makron\ \\CHAR=', '\<++>=<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', "&aigu\ \\CHAR\'", "\\<++>\'<++>", 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&grave\ \\CHAR`', '\<++>`<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', 'p&ushtabs', '\pushtabs', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', 'p&optabs', '\poptabs', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&hline', '\hline', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&cline', '\cline', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&\&', '&', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&\\\\', '\\', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&multicolumn{}{}{}', '\multicolumn{<++>}{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&makelabels', '\makelabels', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&address', '\address', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&signature', '\signature', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&date', '\date', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '-sepenva4-', ' :', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&opening{}', '\opening{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&closing{}', '\closing{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&ps{}', '\ps{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', 'cc&{}', '\cc{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&onlyslides{}', '\onlyslides{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&onlynotes{}', '\onlynotes{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '-sepenva5-', ' :', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&invisible', '\invisible', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&visible', '\visible', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&settime', '\settime', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&addtime', '\addtime', 0) +call s:Tex_SpecialMacros('', '', '-sepenv0-', ' :', 0) +" }}} +" Lists {{{ +call s:Tex_SpecialMacros('ELI', '&Lists.', 'list', s:list) +call s:Tex_SpecialMacros('EDE', '&Lists.', 'description', s:description) +call s:Tex_EnvMacros('EEN', '&Lists.', 'enumerate') +call s:Tex_EnvMacros('EIT', '&Lists.', 'itemize') +call s:Tex_EnvMacros('ETI', '&Lists.', 'theindex') +call s:Tex_EnvMacros('ETL', '&Lists.', 'trivlist') +" }}} +" Tables {{{ +call s:Tex_SpecialMacros('ETE', '&Tables.', 'table', s:table) +call s:Tex_EnvMacros('ETG', '&Tables.', 'tabbing') +call s:Tex_EnvMacros('', '&Tables.', 'table*') +call s:Tex_EnvMacros('', '&Tables.', 'table2') +call s:Tex_SpecialMacros('ETR', '&Tables.', 'tabular', s:tabular) +call s:Tex_SpecialMacros('', '&Tables.', 'tabular*', s:tabular_star) +" }}} +" Math {{{ +call s:Tex_EnvMacros('EAR', '&Math.', 'array') +call s:Tex_EnvMacros('EDM', '&Math.', 'displaymath') +call s:Tex_EnvMacros('EEA', '&Math.', 'eqnarray') +call s:Tex_EnvMacros('', '&Math.', 'eqnarray*') +call s:Tex_EnvMacros('EEQ', '&Math.', 'equation') +call s:Tex_EnvMacros('EMA', '&Math.', 'math') +" }}} +" Structure {{{ +call s:Tex_SpecialMacros('EAR', 'Math.', 'array', s:array) +call s:Tex_EnvMacros('EAB', '&Structure.', 'abstract') +call s:Tex_EnvMacros('EAP', '&Structure.', 'appendix') +call s:Tex_EnvMacros('ECE', '&Structure.', 'center') +call s:Tex_EnvMacros('EDO', '&Structure.', 'document') +call s:Tex_EnvMacros('EFC', '&Structure.', 'filecontents') +call s:Tex_EnvMacros('', '&Structure.', 'filecontents*') +call s:Tex_EnvMacros('EFL', '&Structure.', 'flushleft') +call s:Tex_EnvMacros('EFR', '&Structure.', 'flushright') +call s:Tex_EnvMacros('EQN', '&Structure.', 'quotation') +call s:Tex_EnvMacros('EQE', '&Structure.', 'quote') +call s:Tex_EnvMacros('ESB', '&Structure.', 'sloppybar') +call s:Tex_EnvMacros('ETI', '&Structure.', 'theindex') +call s:Tex_EnvMacros('ETP', '&Structure.', 'titlepage') +call s:Tex_EnvMacros('EVM', '&Structure.', 'verbatim') +call s:Tex_EnvMacros('', '&Structure.', 'verbatim*') +call s:Tex_EnvMacros('EVE', '&Structure.', 'verse') +call s:Tex_EnvMacros('ETB', '&Structure.', 'thebibliography') +call s:Tex_SpecialMacros('', '&Structure.', '-sepstruct0-', ':', 0) +call s:Tex_EnvMacros('ENO', '&Structure.', 'note') +call s:Tex_EnvMacros('EOV', '&Structure.', 'overlay') +call s:Tex_EnvMacros('ESL', '&Structure.', 'slide') +" }}} +" Sections {{{ +call s:Tex_SectionMacros('SPA', 'part') +call s:Tex_SectionMacros('SCH', 'chapter') +call s:Tex_SectionMacros('SSE', 'section') +call s:Tex_SectionMacros('SSS', 'subsection') +call s:Tex_SectionMacros('SS2', 'subsubsection') +call s:Tex_SectionMacros('SPG', 'paragraph') +call s:Tex_SectionMacros('SSP', 'subparagraph') +" }}} +" Miscellaneous {{{ +call s:Tex_SpecialMacros('', '', '-sepenv1-', ' :', 0) +call s:Tex_SpecialMacros('EFI', '', 'figure', "\<C-r>=Tex_PutEnvironment('figure')\<CR>") +call s:Tex_EnvMacros('', '', 'figure*') +call s:Tex_EnvMacros('ELR', '', 'lrbox') +call s:Tex_SpecialMacros('EMP', '', 'minipage', s:minipage) +call s:Tex_SpecialMacros('EPI', '', 'picture', s:picture) +" }}} + +if g:Tex_CatchVisMapErrors + exe 'vnoremap '.g:Tex_Leader2." :\<C-u>call ExecMap('".g:Tex_Leader2."', 'v')\<CR>" +endif + +" ============================================================================== +" Specialized functions for various environments +" +" All these functions are to be used as: +" +" inoremap <lhs> <C-r>=Tex_itemize('enumerate')<CR> +" nnoremap <lhs> i<C-r>=Tex_itemize('enumerate')<CR> +" +" and so on... +" ============================================================================== +" Tex_itemize: {{{ +function! Tex_itemize(env) + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>\\item <++>\<cr>\\end{".a:env."}<++>") +endfunction +" }}} +" Tex_description: {{{ +function! Tex_description(env) + if g:Tex_UseMenuWizard == 1 + let itlabel = input('(Optional) Item label? ') + if itlabel != '' + let itlabel = '['.itlabel.']' + endif + return IMAP_PutTextWithMovement("\\begin{description}\<cr>\\item".itlabel." <++>\<cr>\\end{description}<++>") + else + return IMAP_PutTextWithMovement(s:description) + endif +endfunction +" }}} +" Tex_figure: {{{ +function! Tex_figure(env) + if g:Tex_UseMenuWizard == 1 + let flto = input('Float to (htbp)? ') + let caption = input('Caption? ') + let center = input('Center ([y]/n)? ') + let label = input('Label (for use with \ref)? ') + " additional to AUC Tex since my pics are usually external files + let pic = input('Name of Pic-File? ') + if flto != '' + let flto = '['.flto."]\<cr>" + else + let flto = "\<cr>" + endif + if pic != '' + let pic = '\input{'.pic."}\<cr>" + else + let pic = "<++>\<cr>" + endif + if caption != '' + let caption = '\caption{'.caption."}\<cr>" + endif + if label != '' + let label = '\label{fig:'.label."}\<cr>" + endif + if center == 'y' + let centr = '\begin{center}' . "\<cr>" + let centr = centr . pic + let centr = centr . caption + let centr = centr . label + let centr = centr . '\end{center}' . "\<cr>" + else + let centr = pic + let centr = centr . caption + let centr = centr . label + endif + let figure = '\begin{'.a:env.'}'.flto + let figure = figure . centr + let figure = figure . '\end{'.a:env.'}' + return IMAP_PutTextWithMovement(figure) + else + if g:Tex_package_detected =~ '\<graphicx\>' + return IMAP_PutTextWithMovement(s:figure_graphicx) + else + return IMAP_PutTextWithMovement(s:figure) + endif + endif +endfunction +" }}} +" Tex_table: {{{ +function! Tex_table(env) + if g:Tex_UseMenuWizard == 1 + let flto = input('Float to (htbp)? ') + let caption = input('Caption? ') + let center = input('Center (y/n)? ') + let label = input('Label? ') + if flto != '' + let flto ='['.flto."]\<cr>" + else + let flto = '' + endif + let ret='\begin{table}'.flto + if center == 'y' + let ret=ret."\\begin{center}\<cr>" + endif + let foo = '\begin{tabular}' + let pos = input('(Optional) Position (t b)? ') + if pos != '' + let foo = foo.'['.pos.']' + else + let foo = foo."\<cr>" + endif + let format = input("Format ( l r c p{width} | @{text} )? ") + if format == '' + let format = '<++>' + endif + let ret = ret.foo.'{'.format."}\<cr><++>\<cr>\\end{tabular}<++>\<cr>" + if center == 'y' + let ret=ret."\\end{center}\<cr>" + endif + if caption != '' + let ret=ret.'\caption{'.caption."}\<cr>" + endif + if label != '' + let ret=ret.'\label{tab:'.label."}\<cr>" + endif + let ret=ret.'\end{table}<++>' + return IMAP_PutTextWithMovement(ret) + else + return IMAP_PutTextWithMovement(s:table) + endif +endfunction +" }}} +" Tex_tabular: {{{ +function! Tex_tabular(env) + if g:Tex_UseMenuWizard == 1 + let pos = input('(Optional) Position (t b)? ') + let format = input("Format ( l r c p{width} | @{text} )? ") + if pos != '' + let pos = '['.pos.']' + endif + if format != '' + let format = '{'.format.'}' + endif + return IMAP_PutTextWithMovement('\begin{'.a:env.'}'.pos.format."\<cr> \<cr>\\end{".a:env.'}<++>') + else + return IMAP_PutTextWithMovement('\begin{'.a:env.'}[<+position+>]{<+format+>}'."\<cr><++>\<cr>\\end{".a:env.'}<++>') + endif +endfunction +" }}} +" Tex_eqnarray: {{{ +function! Tex_eqnarray(env) + if g:Tex_UseMenuWizard == 1 + if a:env !~ '\*' + let label = input('Label? ') + if label != '' + let arrlabel = '\label{'.label."}\<cr>" + else + let arrlabel = '' + endif + else + let arrlabel = '' + endif + else + if a:env !~ '\*' + let arrlabel = "\\label{<++>}\<cr>" + else + let arrlabel = "" + endif + endif + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>".arrlabel."\\end{".a:env."}<++>") +endfunction +" }}} +" Tex_list: {{{ +function! Tex_list(env) + if g:Tex_UseMenuWizard == 1 + let label = input('Label (for \item)? ') + if label != '' + let label = '{'.label.'}' + let addcmd = input('Additional commands? ') + if addcmd != '' + let label = label . '{'.addcmd.'}' + endif + else + let label = '' + endif + return IMAP_PutTextWithMovement('\begin{list}'.label."\<cr>\\item \<cr>\\end{list}<++>") + else + return IMAP_PutTextWithMovement(s:list) + endif +endfunction +" }}} +" Tex_document: {{{ +function! Tex_document(env) + if g:Tex_UseMenuWizard == 1 + let dstyle = input('Document style? ') + let opts = input('(Optional) Options? ') + let foo = '\documentclass' + if opts == '' + let foo = foo.'{'.dstyle.'}' + else + let foo = foo.'['.opts.']'.'{'.dstyle.'}' + endif + return IMAP_PutTextWithMovement(foo."\<cr>\<cr>\\begin{document}\<cr><++>\<cr>\\end{document}") + else + return IMAP_PutTextWithMovement(s:document) + endif +endfunction +" }}} +" Tex_minipage: {{{ +function! Tex_minipage(env) + if g:Tex_UseMenuWizard == 1 + let foo = '\begin{minipage}' + let pos = input('(Optional) Position (t b)? ') + let width = input('Width? ') + if pos == '' + let foo = foo.'{'.width.'}' + else + let foo = foo.'['.pos.']{'.width.'}' + endif + return IMAP_PutTextWithMovement(foo."\<cr><++>\<cr>\\end{minipage}<++>") + else + return IMAP_PutTextWithMovement(s:minipage) + endif +endfunction +" }}} +" Tex_thebibliography: {{{ +function! Tex_thebibliography(env) + if g:Tex_UseMenuWizard == 1 + " AUC Tex: "Label for BibItem: 99" + let indent = input('Indent for BibItem? ') + let foo = '{'.indent.'}' + let biblabel = input('(Optional) Bibitem label? ') + let key = input('Add key? ') + let bar = '\bibitem' + if biblabel != '' + let bar = bar.'['.biblabel.']' + endif + let bar = bar.'{'.key.'}' + return IMAP_PutTextWithMovement('\begin{thebibliography}'.foo."\<cr>".bar." \<cr>\\end{thebibliography}<++>\<Up>") + else + return IMAP_PutTextWithMovement( + \ "\\begin{thebibliography}\<CR>". + \ "\\item[<+biblabel+>]{<+bibkey+>} <++>\<CR>". + \ "<++>\<CR>". + \ "\\end{thebibliography}<++>") + endif +endfunction +" }}} + +" ============================================================================== +" Contributions / suggestions from Carl Mueller (auctex.vim) +" ============================================================================== +" PromptForEnvironment: prompts for an environment {{{ +" Description: +function! PromptForEnvironment(ask) + return Tex_ChooseFromPrompt( + \ a:ask."\n" . + \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ",") . + \ "\nEnter nae or number of environment :", + \ g:Tex_PromptedEnvironments, ",") +endfunction " }}} +" Tex_DoEnvironment: fast insertion of environments {{{ +" Description: +" The menus call this function with an argument (the name of the environment +" to insert). The maps call this without any arguments. In this case, it +" prompts for an environment to enter if the current line is empty. If +" called without arguments and there is a word on the current line, then use +" that as the name of a new environment. +function! Tex_DoEnvironment(...) + if a:0 < 1 + let env = matchstr(getline('.'), '^\s*\zs\w*\*\=\ze\s*$') + " If in current line is more than one word or in visual mode + " ignore contents of line and prompt for environment + if env == '' || (exists('s:isvisual') && s:isvisual == 'yes') + let env = PromptForEnvironment('Choose which environment to insert: ') + if env != '' + return Tex_PutEnvironment(env) + else + return '' + endif + else + " delete the word on the line into the blackhole register. + normal! 0"_D + return Tex_PutEnvironment(env) + endif + else + return Tex_PutEnvironment(a:1) + endif +endfunction " }}} +" Tex_PutEnvironment: calls various specialized functions {{{ +" Description: +" Based on input argument, it calls various specialized functions. +function! Tex_PutEnvironment(env) + if exists("s:isvisual") && s:isvisual == "yes" + let s:isvisual = 'no' + if a:env == '\[' + return VEnclose('', '', '\[', '\]') + elseif a:env == '$$' + return VEnclose('', '', '$$', '$$') + endif + return VEnclose('\begin{'.a:env.'}', '\end{'.a:env.'}', '\begin{'.a:env.'}', '\end{'.a:env.'}') + else + " The user can define something like + " let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}" + " This will effectively over-write the default definition of the + " theorem environment which uses a \label. + if exists("b:Tex_Env_{'".a:env."'}") + return IMAP_PutTextWithMovement(b:Tex_Env_{a:env}) + elseif exists("g:Tex_Env_{'".a:env."'}") + return IMAP_PutTextWithMovement(g:Tex_Env_{a:env}) + elseif a:env =~ 'equation*\|eqnarray*\|theorem\|lemma\|equation\|eqnarray\|align\*\|align\>\|multline' + let g:aa = a:env + return Tex_eqnarray(a:env) + elseif a:env =~ "enumerate\\|itemize\\|theindex\\|trivlist" + return Tex_itemize(a:env) + elseif a:env =~ "table\\|table*" + return Tex_table(a:env) + elseif a:env =~ "tabular\\|tabular*\\|array\\|array*" + return Tex_tabular(a:env) + elseif exists('*Tex_'.a:env) + exe 'return Tex_'.a:env.'(a:env)' + elseif a:env == '$$' + return IMAP_PutTextWithMovement('$$<++>$$') + elseif a:env == '\[' + return IMAP_PutTextWithMovement("\\[\<CR><++>\<CR>\\]<++>") + else + " Look in supported packages if exists template for environment + " given in the line + if exists('g:Tex_package_supported') && g:Tex_package_supported != '' + let i = 1 + while Tex_Strntok(g:Tex_package_supported, ',', i) != '' + let checkpack = Tex_Strntok(g:Tex_package_supported, ',', i) + if g:TeX_package_{checkpack} =~ 'e..:'.a:env + if a:env =~ '*' + " Don't allow * to be treated as wildcard + let aenv = substitute(a:env, '*', '\\*', '') + else + let aenv = a:env + endif + let envcommand = matchstr(g:TeX_package_{checkpack}, '\zse..:'.aenv.'[^,]\{-}\ze,') + return Tex_ProcessPackageCommand(envcommand) + endif + let i = i + 1 + endwhile + endif + " If nothing before us managed to create an environment, then just + " create a bare-bones environment from the name. + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>") + endif +endfunction " }}} +" Mapping the <F5> key to insert/prompt for an environment/package {{{ +" and <S-F5> to prompt/replace an environment +" +" g:Tex_PromptedEnvironments is a variable containing a comma seperated list +" of environments. This list defines the prompt which latex-suite sets up when +" the user presses <F5> on an empty line. +" +" Leaving this empty is equivalent to disabling the feature. +if g:Tex_PromptedEnvironments != '' + + let b:DoubleDollars = 0 + + " Provide only <plug>s here. main.vim will create the actual maps. + inoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-r>=Tex_FastEnvironmentInsert("no")<cr> + nnoremap <silent> <Plug>Tex_FastEnvironmentInsert i<C-r>=Tex_FastEnvironmentInsert("no")<cr> + vnoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-\><C-N>:call Tex_FastEnvironmentInsert("yes")<CR> + inoremap <silent> <Plug>Tex_FastEnvironmentChange <C-O>:call Tex_ChangeEnvironments()<CR> + nnoremap <silent> <Plug>Tex_FastEnvironmentChange :call Tex_ChangeEnvironments()<CR> + + " Tex_FastEnvironmentInsert: maps <F5> to prompt for env and insert it " {{{ + " Description: + " This function calculates whether we are in the preamble. If we are + " then inserts a \usepackage line by either reading in a word from the + " current line or prompting to type in one. If not in the preamble, then + " inserts a environment template either by reading in a word from the + " current line or prompting the user to choose one. + " + function! Tex_FastEnvironmentInsert(isvisual) + + let start_line = line('.') + let pos = line('.').' | normal! '.virtcol('.').'|' + let s:isvisual = a:isvisual + + " decide if we are in the preamble of the document. If we are then + " insert a package, otherwise insert an environment. + " + if search('\\documentclass', 'bW') && search('\\begin{document}') + + " If there is a \documentclass line and a \begin{document} line in + " the file, then a part of the file is the preamble. + + " search for where the document begins. + let begin_line = search('\\begin{document}') + " if the document begins after where we are presently, then we are + " in the preamble. + if start_line < begin_line + " return to our original location and insert a package + " statement. + exe pos + return Tex_package_from_line() + else + " we are after the preamble. insert an environment. + exe pos + return Tex_DoEnvironment() + endif + + elseif search('\\documentclass') + " if there is only a \documentclass but no \begin{document}, then + " the entire file is a preamble. Put a package. + + exe pos + return Tex_package_from_line() + + else + " no \documentclass, put an environment. + + exe pos + return Tex_DoEnvironment() + + endif + + endfunction + + " }}} + " Tex_package_from_line: puts a \usepackage line in the current line. " {{{ + " Description: + " + function! Tex_package_from_line() + " Function Tex_PutPackage is defined in packages.vim + " Ignores <F5> in Visual mode + if s:isvisual == "yes" + return 0 + else + let l = getline(".") + let pack = matchstr(l, '^\s*\zs.*') + normal! 0"_D + return Tex_pack_one(pack) + endif + endfunction + + " }}} + " Tex_ChangeEnvironments: calls Change() to change the environment {{{ + " Description: + " Finds out which environment the cursor is positioned in and changes + " that to the chosen new environment. This function knows the changes + " which need to be made to change one env to another and calls + " Change() with the info. + " + function! Tex_ChangeEnvironments() + + let env_line = searchpair('$$\|\\[\|begin{', '', '$$\|\\]\|end{', "bn") + + if env_line != 0 + if getline(env_line) !~ 'begin{' + let env_name = '[' + else + let env_name = matchstr(getline(env_line), 'begin{\zs.\{-}\ze}') + endif + endif + + if !exists('env_name') + echomsg "You are not inside environment" + return 0 + endif + + exe 'echomsg "You are within a '.env_name.' environment."' + let change_env = PromptForEnvironment('What do you want to change it to? ') + + if change_env == 'eqnarray' + call <SID>Change('eqnarray', 1, '', 1) + elseif change_env == 'eqnarray*' + call <SID>Change('eqnarray*', 0, '\\nonumber', 0) + elseif change_env == 'align' + call <SID>Change('align', 1, '', 1) + elseif change_env == 'align*' + call <SID>Change('align*', 0, '\\nonumber', 0) + elseif change_env == 'equation*' + call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) + elseif change_env == '' + return 0 + else + call <SID>Change(change_env, 0, '', '') + return 0 + endif + + endfunction + + " }}} + " Change: changes the current env to the new env {{{ + " Description: + " This function needs to know the changes which need to be made while + " going from an old environment to a new one. This info, it gets from + " Tex_ChangeEnvironments + " + " env : name of the new environment. + " label : if 1, then insert a \label at the end of the environment. + " otherwise, delete any \label line found. + " delete : a pattern which is to be deleted from the original environment. + " for example, going to a eqnarray* environment means we need to + " delete \label's. + " putInNonumber : whether we need to put a \nonumber before the end of the + " environment. + function! s:Change(env, label, delete, putInNonumber) + + let start_line = line('.') + let start_col = virtcol('.') + + if a:env == '[' + if b:DoubleDollars == 0 + let first = '\\[' + let second = '\\]' + else + let first = '$$' + let second = '$$' + endif + else + let first = '\\begin{' . a:env . '}' + let second = '\\end{' . a:env . '}' + endif + + if b:DoubleDollars == 0 + let bottom = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','') + s/\\\]\|\\end{.\{-}}/\=second/ + let top = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','b') + s/\\\[\|\\begin{.\{-}}/\=first/ + else + let bottom = search('\$\$\|\\end{') + s/\$\$\|\\end{.\{-}}/\=second/ + let top = search('\$\$\|\\begin{','b') + s/\$\$\|\\begin{.\{-}}/\=first/ + end + if a:delete != '' + exe 'silent '. top . "," . bottom . 's/' . a:delete . '//e' + endif + + if a:putInNonumber == 1 + exe top + call search('\\end\|\\\\') + if line('.') != bottom + exe '.+1,' . bottom . 's/\\\\/\\nonumber\\\\/e' + exe (bottom-1) . 's/\s*$/ \\nonumber/' + endif + endif + + if a:label == 1 + exe top + if search("\\label", "W") > bottom + exe top + let local_label = input('Label? ') + if local_label != '' + put = '\label{'.local_label.'}' + endif + normal $ + endif + else + exe 'silent '.top . ',' . bottom . ' g/\\label/delete' + endif + + if exists('local_label') && local_label != '' + exe start_line + 1.' | normal! '.start_col.'|' + else + exe start_line.' | normal! '.start_col.'|' + endif + endfunction " }}} + +endif + +" }}} +" Map <S-F1> through <S-F4> to insert environments {{{ +if g:Tex_HotKeyMappings != '' + + " SetUpHotKeys: maps <F1> through <F4> to insert environments + " Description: + function! <SID>SetUpHotKeys() + let i = 1 + let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) + while envname != '' + + exec 'inoremap <silent> <buffer> <S-F'.i.'> <C-r>=Tex_PutEnvironment("'.envname.'")<CR>' + + let i = i + 1 + let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) + + endwhile + + endfunction + +endif + +" }}} +" Tex_SetFastEnvironmentMaps: function for setting up the <F5> and <S-F1>-<S-F4> keys {{{ +" Description: This function is made public so it can be called by the +" SetTeXOptions() function in main.vim +function! Tex_SetFastEnvironmentMaps() + if g:Tex_PromptedEnvironments != '' + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'i', '<silent> <buffer>') + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'n', '<silent> <buffer>') + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'v', '<silent> <buffer>') + call Tex_MakeMap("<S-F5>", "<Plug>Tex_FastEnvironmentChange", 'i', '<silent> <buffer>') + call Tex_MakeMap("<S-F5>", "<Plug>Tex_FastEnvironmentChange", 'n', '<silent> <buffer>') + endif + if g:Tex_HotKeyMappings != '' + call s:SetUpHotKeys() + endif +endfunction " }}} + +" ============================================================================== +" Contributions / Tex_InsertItem() from Johannes Tanzler +" ============================================================================== +" Tex_GetCurrentEnv: gets the current environment in which the cursor lies {{{ +" Description: handles cases such as: +" +" \begin{itemize} +" \item first item +" \item second item +" \begin{description} +" \item first desc +" \item second +" % Tex_GetCurrentEnv will return "description" when called from here +" \end{description} +" \item third item +" % Tex_GetCurrentEnv will return "itemize" when called from here +" \end{itemize} +" % Tex_GetCurrentEnv will return "" when called from here +" +" Author: Alan Schmitt +function! Tex_GetCurrentEnv() + let pos = line('.').' | normal! '.virtcol('.').'|' + let i = 0 + while 1 + let env_line = search('^[^%]*\\\%(begin\|end\){', 'bW') + if env_line == 0 + " we reached the beginning of the file, so we return the empty string + exe pos + return '' + endif + if match(getline(env_line), '^[^%]*\\begin{') == -1 + " we found a \\end, so we keep searching + let i = i + 1 + continue + else + " we found a \\begin which has not been \\end'ed. we are done. + if i == 0 + let env = matchstr(getline(env_line), '\\begin{\zs.\{-}\ze}') + exe pos + return env + else + " this \\begin closes a \\end, continue searching. + let i = i - 1 + continue + endif + endif + endwhile +endfunction +" }}} +" Tex_InsertItem: insert \item into a list {{{ +" Description: Find last \begin line, extract env name, return to the start +" position and insert proper \item, depending on env name. +" Env names are stored in g: variables it can be used by +" package files. + +TexLet g:Tex_ItemStyle_itemize = '\item ' +TexLet g:Tex_ItemStyle_enumerate = '\item ' +TexLet g:Tex_ItemStyle_theindex = '\item ' +TexLet g:Tex_ItemStyle_thebibliography = '\item[<+biblabel+>]{<+bibkey+>} <++>' +TexLet g:Tex_ItemStyle_description = '\item[<+label+>] <++>' + +function! Tex_InsertItem() + " Get current enclosing environment + let env = Tex_GetCurrentEnv() + + if exists('g:Tex_ItemStyle_'.env) + return IMAP_PutTextWithMovement(g:Tex_ItemStyle_{env}) + else + return '' + endif +endfunction +" }}} +" Tex_SetItemMaps: sets the \item inserting maps for current buffer {{{ +" Description: + +inoremap <script> <silent> <Plug>Tex_InsertItemOnThisLine <Esc>a<C-r>=Tex_InsertItem()<CR> +inoremap <script> <silent> <Plug>Tex_InsertItemOnNextLine <ESC>o<C-R>=Tex_InsertItem()<CR> + +function! Tex_SetItemMaps() + if !hasmapto("<Plug>Tex_InsertItem", "i") + imap <buffer> <M-i> <Plug>Tex_InsertItemOnThisLine + endif + if !hasmapto("<Plug>Tex_InsertItemOnNextLine", "i") + imap <buffer> <C-CR> <Plug>Tex_InsertItemOnNextLine + endif +endfunction " }}} + +" ============================================================================== +" Implementation of Fast Environment commands for LaTeX commands +" ============================================================================== +" Define certain commonly used command definitions {{{ + +TexLet g:Tex_Com_{'newtheorem'} = '\newtheorem{<+name+>}{<+caption+>}[<+within+>]' +TexLet g:Tex_Com_{'frac'} = '\frac{<+n+>}{<+d+>}<++>' + +" }}} +" PromptForCommand: prompts for a command {{{ +" Description: +function! PromptForCommand(ask) + let common_com_prompt = + \ Tex_CreatePrompt(g:Tex_PromptedCommands, 2, ',') . "\n" . + \ "Enter number or command name :" + + let inp = input(a:ask."\n".common_com_prompt) + if inp =~ '^[0-9]\+$' + let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) + else + let com = inp + endif + + return com +endfunction " }}} +" Tex_DoCommand: fast insertion of commands {{{ +" Description: +" +function! Tex_DoCommand(isvisual) + " If the current line is empty or if a visual selection has been made, + " prompt for a new environment. + if getline('.') == '' || a:isvisual == 'yes' + let com = PromptForCommand('Choose a command to insert: ') + if com != '' + return Tex_PutCommand(com, a:isvisual) + else + return '' + endif + else + " We want to find out the word under the cursor without issuing + " any movement commands. + let presline = getline('.') + let c = col('.') + + let wordbef = matchstr(strpart(presline, 0, c-1), '\k\+\*\?$') + let wordaft = matchstr(strpart(presline, c-1), '^\k\+\*\?') + + let word = wordbef . wordaft + call Tex_Debug("Tex_DoCommand: wordbef = [".wordbef."], wordaft = [".wordaft."], word = [".word."]", 'env') + + " We use \<Del> instead of \<Bs> because \<Bs> does not work + " unless bs=2 + if word != '' + return substitute(wordbef, '.', "\<Left>", 'g') + \ . substitute(word, '.', "\<Del>", 'g') + \ . Tex_PutCommand(word, a:isvisual) + else + let cmd = PromptForCommand('Choose a command to insert: ') + if cmd != '' + return Tex_PutCommand(cmd, a:isvisual) + else + return '' + endif + endif + endif +endfunction " }}} +" Tex_PutCommand: calls various specialized functions {{{ +" Description: +" Based on input argument, it calls various specialized functions. +function! Tex_PutCommand(com, isvisual) + if a:isvisual == "yes" + if a:com == '$' + return VEnclose('$', '$', '$', '$') + elseif a:com == '\\(' + return VEnclose('\\(', '\\)', '\\(', '\\)') + else + return VEnclose("\\".a:com.'{', '}', "\\".a:com.'{', '}') + endif + else + if exists('b:Tex_Com_{"'.a:com.'"}') + return IMAP_PutTextWithMovement(b:Tex_Com_{a:com}) + elseif exists('g:Tex_Com_{"'.a:com.'"}') + return IMAP_PutTextWithMovement(g:Tex_Com_{a:com}) + elseif a:com == '$' + return IMAP_PutTextWithMovement('$<++>$') + else + return IMAP_PutTextWithMovement("\\".a:com.'{<++>}<++>') + endif + endif +endfunction " }}} +" Mapping the <F7> key to prompt/insert for command {{{ +" and <S-F7> to prompt/replace command +" +" g:Tex_PromptedCommands is a variable containing a comma seperated list +" of commands. +" +" Leaving this empty is equivalent to disabling the feature. +if g:Tex_PromptedCommands != '' + + let b:DoubleDollars = 0 + + inoremap <silent> <Plug>Tex_FastCommandInsert <C-r>=Tex_DoCommand('no')<cr> + nnoremap <silent> <Plug>Tex_FastCommandInsert i<C-r>=Tex_DoCommand('no')<cr> + vnoremap <silent> <Plug>Tex_FastCommandInsert <C-\><C-N>:call Tex_DoCommand('yes')<CR> + + inoremap <silent> <Plug>Tex_FastCommandChange <C-O>:call Tex_ChangeCommand('no')<CR> + nnoremap <silent> <Plug>Tex_FastCommandChange :call Tex_ChangeCommand('no')<CR> + + " Tex_ChangeCommand: calls ChangeCommand() to change the environment {{{ + " Description: + " Finds out which environment the cursor is positioned in and changes + " that to the chosen new environment. This function knows the changes + " which need to be made to change one env to another and calls + " ChangeCommand() with the info. + " + function! Tex_ChangeCommand(isvisual) + + let pos_com = line('.').' | normal! '.virtcol('.').'|' + + let com_line = searchpair('\\\k\{-}{', '', '}', 'b') + + if com_line != 0 + normal l + let com_name = expand('<cword>') + endif + + if !exists('com_name') + echomsg "You are not inside command" + exe pos_com + return 0 + endif + + exe 'echomsg "You are within a '.com_name.' command."' + let change_com = PromptForCommand('Do you want to change it to (number or name)? ') + + if change_com == '' + exe pos_com + return 0 + else + call <SID>ChangeCommand(change_com) + exe pos_com + return 0 + endif + + endfunction + + " }}} + " ChangeCommand: Changes current command according to prompt menu {{{ + " Description: + " + function! s:ChangeCommand(newcom) + + exe 'normal! ct{'.a:newcom."\<Esc>" + + endfunction + " }}} + +endif + +" }}} +" Tex_SetFastCommandMaps: function for setting up the <F7> keys {{{ +" Description: This function is made public so it can be called by the +" SetTeXOptions() function in main.vim +function! Tex_SetFastCommandMaps() + if g:Tex_PromptedCommands != '' + if !hasmapto('<Plug>Tex_FastCommandInsert', 'i') + imap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + if !hasmapto('<Plug>Tex_FastCommandInsert', 'n') + nmap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + if !hasmapto('<Plug>Tex_FastCommandChange', 'i') + imap <silent> <buffer> <S-F7> <Plug>Tex_FastCommandChange + endif + if !hasmapto('<Plug>Tex_FastCommandChange', 'n') + nmap <silent> <buffer> <S-F7> <Plug>Tex_FastCommandChange + endif + if !hasmapto('<Plug>Tex_FastCommandInsert', 'v') + vmap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + endif +endfunction " }}} + +" SetEnvMacrosOptions: sets mappings for buffers {{{ +" " Description: +function! <SID>SetEnvMacrosOptions() + if exists('b:doneTexEnvMaps') + return + endif + let b:doneTexEnvMaps = 1 + if g:Tex_PromptedEnvironments != '' || g:Tex_HotKeyMappings != '' + call Tex_SetFastEnvironmentMaps() + endif + if g:Tex_PromptedCommands != '' + call Tex_SetFastCommandMaps() + endif + call Tex_SetItemMaps() +endfunction " }}} +" Catch the Filetype event so we set maps for each buffer {{{ +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('envmacros.vim: Catching LatexSuiteFileType event', 'env') | + \ call s:SetEnvMacrosOptions() +augroup END +" }}} + +" this statement has to be at the end. +let s:doneOnce = 1 + +" vim:fdm=marker:nowrap:noet:ff=unix diff --git a/dot_vim/ftplugin/latex-suite/folding.vim b/dot_vim/ftplugin/latex-suite/folding.vim new file mode 100644 index 0000000..dfaa450 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/folding.vim @@ -0,0 +1,393 @@ +"============================================================================= +" File: folding.vim +" Author: Srinath Avadhanula +" modifications/additions by Zhang Linbo +" CVS: $Id: folding.vim 997 2006-03-20 09:45:45Z srinathava $ +" Created: Tue Apr 23 05:00 PM 2002 PST +" +" Description: functions to interact with Syntaxfolds.vim +"============================================================================= + +nnoremap <unique> <Plug>Tex_RefreshFolds :call MakeTexFolds(1)<cr> + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('folding.vim: catching LatexSuiteFileType', 'fold') | + \ call Tex_SetFoldOptions() +augroup END + +" Tex_SetFoldOptions: sets maps for every buffer {{{ +" Description: +function! Tex_SetFoldOptions() + if exists('b:doneSetFoldOptions') + return + endif + let b:doneSetFoldOptions = 1 + + setlocal foldtext=TexFoldTextFunction() + + if g:Tex_Folding && g:Tex_AutoFolding + call MakeTexFolds(0) + endif + + let s:ml = exists('g:mapleader') ? g:mapleader : "\\" + + call Tex_MakeMap(s:ml."rf", "<Plug>Tex_RefreshFolds", 'n', '<silent> <buffer>') + +endfunction " }}} +" Tex_FoldSections: creates section folds {{{ +" Author: Zhang Linbo +" Description: +" This function takes a comma seperated list of "sections" and creates fold +" definitions for them. The first item is supposed to be the "shallowest" field +" and the last is the "deepest". See g:Tex_FoldedSections for the default +" definition of the lst input argument. +" +" **works recursively** +function! Tex_FoldSections(lst, endpat) + let i = match(a:lst, ',') + if i > 0 + let s = strpart(a:lst, 0, i) + else + let s = a:lst + endif + if s =~ '%%fakesection' + let s = '^\s*' . s + else + let s = '^\s*\\' . s . '\W' + endif + let endpat = s . '\|' . a:endpat + if i > 0 + call Tex_FoldSections(strpart(a:lst,i+1), endpat) + endif + let endpat = '^\s*\\appendix\W\|' . endpat + call AddSyntaxFoldItem(s, endpat, 0, -1) +endfunction +" }}} +" MakeTexFolds: function to create fold items for latex. {{{ +" +" used in conjunction with MakeSyntaxFolds(). +" see ../plugin/syntaxFolds.vim for documentation +function! MakeTexFolds(force) + if exists('g:Tex_Folding') && !g:Tex_Folding + return + endif + if &ft != 'tex' + return + end + + " Setup folded items lists g:Tex_Foldedxxxx + " 1. Use default value if g:Tex_Foldedxxxxxx is not defined + " 2. prepend default value to g:Tex_Foldedxxxxxx if it starts with ',' + " 3. append default value to g:Tex_Foldedxxxxxx if it ends with ',' + + " Folding items which are not caught in any of the standard commands, + " environments or sections. + let s = 'item,slide,preamble,<<<' + if !exists('g:Tex_FoldedMisc') + let g:Tex_FoldedMisc = s + elseif g:Tex_FoldedMisc[0] == ',' + let g:Tex_FoldedMisc = s . g:Tex_FoldedMisc + elseif g:Tex_FoldedMisc =~ ',$' + let g:Tex_FoldedMisc = g:Tex_FoldedMisc . s + endif + + " By default do not fold any commands. It looks like trying to fold + " commands is a difficult problem since commands can be arbitrarily nested + " and the end patterns are not unique unlike the case of environments. + " For this to work well, we need a regexp which will match a line only if + " a command begins on that line but does not end on that line. This + " requires a regexp which will match unbalanced curly braces and that is + " apparently not doable with regexps. + let s = '' + if !exists('g:Tex_FoldedCommands') + let g:Tex_FoldedCommands = s + elseif g:Tex_FoldedCommands[0] == ',' + let g:Tex_FoldedCommands = s . g:Tex_FoldedCommands + elseif g:Tex_FoldedCommands =~ ',$' + let g:Tex_FoldedCommands = g:Tex_FoldedCommands . s + endif + + let s = 'verbatim,comment,eq,gather,align,figure,table,thebibliography,' + \. 'keywords,abstract,titlepage' + if !exists('g:Tex_FoldedEnvironments') + let g:Tex_FoldedEnvironments = s + elseif g:Tex_FoldedEnvironments[0] == ',' + let g:Tex_FoldedEnvironments = s . g:Tex_FoldedEnvironments + elseif g:Tex_FoldedEnvironments =~ ',$' + let g:Tex_FoldedEnvironments = g:Tex_FoldedEnvironments . s + endif + + if !exists('g:Tex_FoldedSections') + let g:Tex_FoldedSections = 'part,chapter,section,%%fakesection,' + \. 'subsection,subsubsection,paragraph' + endif + + " the order in which these calls are made decides the nestedness. in + " latex, a table environment will always be embedded in either an item or + " a section etc. not the other way around. so we first fold up all the + " tables. and then proceed with the other regions. + + let b:numFoldItems = 0 + + " ======================================================================== + " How to add new folding items {{{ + " ======================================================================== + " + " Each of the following function calls defines a syntax fold region. Each + " definition consists of a call to the AddSyntaxFoldItem() function. + " + " The order in which the folds are defined is important. Juggling the + " order of the function calls will create havoc with folding. The + " "deepest" folding item needs to be called first. For example, if + " the \begin{table} environment is a subset (or lies within) the \section + " environment, then add the definition for the \table first. + " + " The AddSyntaxFoldItem() function takes either 4 or 6 arguments. When it + " is called with 4 arguments, it is equivalent to calling it with 6 + " arguments with the last two left blank (i.e as empty strings) + " + " The explanation for each argument is as follows: + " startpat: a line matching this pattern defines the beginning of a fold. + " endpat : a line matching this pattern defines the end of a fold. + " startoff: this is the offset from the starting line at which folding will + " actually start + " endoff : like startoff, but gives the offset of the actual fold end from + " the line satisfying endpat. + " startoff and endoff are necessary when the folding region does + " not have a specific end pattern corresponding to a start + " pattern. for example in latex, + " \begin{section} + " defines the beginning of a section, but its not necessary to + " have a corresponding + " \end{section} + " the section is assumed to end 1 line _before_ another section + " starts. + " startskip: a pattern which defines the beginning of a "skipped" region. + " + " For example, suppose we define a \itemize fold as follows: + " startpat = '^\s*\\item', + " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + " startoff = 0, + " endoff = -1 + " + " This defines a fold which starts with a line beginning with an + " \item and ending one line before a line beginning with an + " \item or \end{enumerate} etc. + " + " Then, as long as \item's are not nested things are fine. + " However, once items begin to nest, the fold started by one + " \item can end because of an \item in an \itemize + " environment within this \item. i.e, the following can happen: + " + " \begin{itemize} + " \item Some text <------- fold will start here + " This item will contain a nested item + " \begin{itemize} <----- fold will end here because next line contains \item... + " \item Hello + " \end{itemize} <----- ... instead of here. + " \item Next item of the parent itemize + " \end{itemize} + " + " Therefore, in order to completely define a folding item which + " allows nesting, we need to also define a "skip" pattern. + " startskip and end skip do that. + " Leave '' when there is no nesting. + " endskip: the pattern which defines the end of the "skip" pattern for + " nested folds. + " + " Example: + " 1. A syntax fold region for a latex section is + " startpat = "\\section{" + " endpat = "\\section{" + " startoff = 0 + " endoff = -1 + " startskip = '' + " endskip = '' + " Note that the start and end patterns are thus the same and endoff has a + " negative value to capture the effect of a section ending one line before + " the next starts. + " 2. A syntax fold region for the \itemize environment is: + " startpat = '^\s*\\item', + " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + " startoff = 0, + " endoff = -1, + " startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', + " endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' + " Note the use of startskip and endskip to allow nesting. + " + " + " }}} + " ======================================================================== + + " {{{ comment lines + if g:Tex_FoldedMisc =~ '\<comments\>' + call AddSyntaxFoldItem ( + \ '^%\([^%]\|[^f]\|[^a]\|[^k]\|[^e]\)', + \ '^[^%]', + \ 0, + \ -1 + \ ) + endif + " }}} + + " {{{ items + if g:Tex_FoldedMisc =~ '\<item\>' + call AddSyntaxFoldItem ( + \ '^\s*\\item', + \ '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + \ 0, + \ -1, + \ '^\s*\\begin{\(enumerate\|itemize\|description\)}', + \ '^\s*\\end{\(enumerate\|itemize\|description\)}' + \ ) + endif + " }}} + + " {{{ title + if g:Tex_FoldedMisc =~ '\<title\>' + call AddSyntaxFoldItem ( + \ '^\s*\\title\W', + \ '^\s*\\maketitle', + \ 0, + \ 0 + \ ) + endif + " }}} + + " Commands and Environments {{{ + " Fold the commands and environments in 2 passes. + let pass = 0 + while pass < 2 + if pass == 0 + let lst = g:Tex_FoldedCommands + else + let lst = g:Tex_FoldedEnvironments + endif + while lst != '' + let i = match(lst, ',') + if i > 0 + let s = strpart(lst, 0, i) + let lst = strpart(lst, i+1) + else + let s = lst + let lst = '' + endif + if s != '' + if pass == 0 + " NOTE: This pattern ensures that a command which is + " terminated on the same line will not start a fold. + " However, it will also refuse to fold certain commands + " which have not terminated. eg: + " \commandname{something \bf{text} and + " will _not_ start a fold. + " In other words, the pattern is safe, but not exact. + call AddSyntaxFoldItem('^\s*\\'.s.'{[^{}]*$','^[^}]*}',0,0) + else + call AddSyntaxFoldItem('^\s*\\begin{'.s,'^\s*\\end{'.s,0,0) + endif + endif + endwhile + let pass = pass + 1 + endwhile + " }}} + + " Sections {{{ + if g:Tex_FoldedSections != '' + call Tex_FoldSections(g:Tex_FoldedSections, + \ '^\s*\\frontmatter\|^\s*\\mainmatter\|^\s*\\backmatter\|' + \. '^\s*\\begin{thebibliography\|>>>\|^\s*\\endinput\|' + \. '^\s*\\begin{slide\|^\s*\\end{document') + endif + " }}} + + " {{{ slide + if g:Tex_FoldedMisc =~ '\<slide\>' + call AddSyntaxFoldItem ( + \ '^\s*\\begin{slide', + \ '^\s*\\appendix\W\|^\s*\\chapter\W\|^\s*\\end{slide\|^\s*\\end{document', + \ 0, + \ 0 + \ ) + endif + " }}} + + " {{{ preamble + if g:Tex_FoldedMisc =~ '\<preamble\>' + call AddSyntaxFoldItem ( + \ '^\s*\\document\(class\|style\).*{', + \ '^\s*\\begin{document}', + \ 0, + \ -1 + \ ) + endif + " }}} + + " Manually folded regions {{{ + if g:Tex_FoldedMisc =~ '\(^\|,\)<<<\(,\|$\)' + call AddSyntaxFoldItem ( + \ '<<<', + \ '>>>', + \ 0, + \ 0 + \ ) + endif + " }}} + + call MakeSyntaxFolds(a:force) + normal! zv +endfunction + +" }}} +" TexFoldTextFunction: create fold text for folds {{{ +function! TexFoldTextFunction() + let leadingSpace = matchstr(' ', ' \{,'.indent(v:foldstart).'}') + if getline(v:foldstart) =~ '^\s*\\begin{' + let header = matchstr(getline(v:foldstart), + \ '^\s*\\begin{\zs\([:alpha:]*\)[^}]*\ze}') + let caption = '' + let label = '' + let i = v:foldstart + while i <= v:foldend + if getline(i) =~ '\\caption' + " distinguish between + " \caption{fulldesc} - fulldesc will be displayed + " \caption[shortdesc]{fulldesc} - shortdesc will be displayed + if getline(i) =~ '\\caption\[' + let caption = matchstr(getline(i), '\\caption\[\zs[^\]]*') + let caption = substitute(caption, '\zs\]{.*}[^}]*$', '', '') + else + let caption = matchstr(getline(i), '\\caption{\zs.*') + let caption = substitute(caption, '\zs}[^}]*$', '', '') + end + elseif getline(i) =~ '\\label' + let label = matchstr(getline(i), '\\label{\zs.*') + let label = substitute(label, '\zs}[^}]*$', '', '') + end + + let i = i + 1 + endwhile + + let ftxto = foldtext() + " if no caption found, then use the second line. + if caption == '' + let caption = getline(v:foldstart + 1) + end + + let retText = matchstr(ftxto, '^[^:]*').': '.header. + \ ' ('.label.') : '.caption + return leadingSpace.retText + + elseif getline(v:foldstart) =~ '^%' && getline(v:foldstart) !~ '^%%fake' + let ftxto = foldtext() + return leadingSpace.substitute(ftxto, ':', ': % ', '') + elseif getline(v:foldstart) =~ '^\s*\\document\(class\|style\).*{' + let ftxto = leadingSpace.foldtext() + return substitute(ftxto, ':', ': Preamble: ', '') + else + return leadingSpace.foldtext() + end +endfunction +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/macros/example b/dot_vim/ftplugin/latex-suite/macros/example new file mode 100644 index 0000000..395311f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/macros/example @@ -0,0 +1,11 @@ +% my long complicated macro. This is an example of how to set up a +% tex-macro for latex-suite. simply type in the lines as you would in +% latex. Place holders are allowed. +% NOTE: if you have filetype indentation turned on, then do not do +% formatting here. the indentation will follow automatically... +\begin{mycomplicatedenvironment} +\mycommand1{<++>} +\mycommand2{<+hint2+>} +\mycommand3{<++>} +\mycommand4{<++>} +\end{mycomplicatedenvironment}<++> diff --git a/dot_vim/ftplugin/latex-suite/main.vim b/dot_vim/ftplugin/latex-suite/main.vim new file mode 100644 index 0000000..063c6f6 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/main.vim @@ -0,0 +1,1024 @@ +" LaTeX filetype +" Language: LaTeX (ft=tex) +" Maintainer: Srinath Avadhanula +" CVS: $Id: main.vim 999 2006-03-21 05:32:37Z srinathava $ +" URL: + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +" avoiding re-inclusion {{{ +" the avoiding re-inclusion statement is not provided here because the files +" which call this file should in the normal course of events handle the +" re-inclusion stuff. + +" we definitely dont want to run through the entire file each and every time. +" only once to define the functions. for successive latex files, just set up +" the folding and mappings and quit. +if exists('s:doneFunctionDefinitions') && !exists('b:forceRedoLocalTex') + call s:SetTeXOptions() + finish +endif + +let s:doneFunctionDefinitions = 1 + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +let s:path = expand('<sfile>:p:h') +" set up personal defaults. +runtime ftplugin/tex/texrc +" set up global defaults. +exe "so ".s:path.'/texrc' + +" }}} + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +" ============================================================================== +" mappings +" ============================================================================== +" {{{ +" calculate the mapleader character. +let s:ml = exists('g:mapleader') ? g:mapleader : '\' + +if !exists('s:doneMappings') + let s:doneMappings = 1 + " short forms for latex formatting and math elements. {{{ + " taken from auctex.vim or miktexmacros.vim + call IMAP ('__', '_{<++>}<++>', "tex") + call IMAP ('()', '(<++>)<++>', "tex") + call IMAP ('[]', '[<++>]<++>', "tex") + call IMAP ('{}', '{<++>}<++>', "tex") + call IMAP ('^^', '^{<++>}<++>', "tex") + call IMAP ('$$', '$<++>$<++>', "tex") + call IMAP ('==', '&=& ', "tex") + call IMAP ('~~', '&\approx& ', "tex") + call IMAP ('=~', '\approx', "tex") + call IMAP ('::', '\dots', "tex") + call IMAP ('((', '\left( <++> \right)<++>', "tex") + call IMAP ('[[', '\left[ <++> \right]<++>', "tex") + call IMAP ('{{', '\left\{ <++> \right\}<++>', "tex") + call IMAP (g:Tex_Leader.'^', '\hat{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'_', '\bar{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'6', '\partial', "tex") + call IMAP (g:Tex_Leader.'8', '\infty', "tex") + call IMAP (g:Tex_Leader.'/', '\frac{<++>}{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'%', '\frac{<++>}{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'@', '\circ', "tex") + call IMAP (g:Tex_Leader.'0', '^\circ', "tex") + call IMAP (g:Tex_Leader.'=', '\equiv', "tex") + call IMAP (g:Tex_Leader."\\",'\setminus', "tex") + call IMAP (g:Tex_Leader.'.', '\cdot', "tex") + call IMAP (g:Tex_Leader.'*', '\times', "tex") + call IMAP (g:Tex_Leader.'&', '\wedge', "tex") + call IMAP (g:Tex_Leader.'-', '\bigcap', "tex") + call IMAP (g:Tex_Leader.'+', '\bigcup', "tex") + call IMAP (g:Tex_Leader.'M', '\sum_{<++>}^{<++>}<++>', 'tex') + call IMAP (g:Tex_Leader.'S', '\sum_{<++>}^{<++>}<++>', 'tex') + call IMAP (g:Tex_Leader.'(', '\subset', "tex") + call IMAP (g:Tex_Leader.')', '\supset', "tex") + call IMAP (g:Tex_Leader.'<', '\le', "tex") + call IMAP (g:Tex_Leader.'>', '\ge', "tex") + call IMAP (g:Tex_Leader.',', '\nonumber', "tex") + call IMAP (g:Tex_Leader.'~', '\tilde{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.';', '\dot{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.':', '\ddot{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'2', '\sqrt{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'|', '\Big|', "tex") + call IMAP (g:Tex_Leader.'I', "\\int_{<++>}^{<++>}<++>", 'tex') + " }}} + " Greek Letters {{{ + call IMAP(g:Tex_Leader.'a', '\alpha', 'tex') + call IMAP(g:Tex_Leader.'b', '\beta', 'tex') + call IMAP(g:Tex_Leader.'c', '\chi', 'tex') + call IMAP(g:Tex_Leader.'d', '\delta', 'tex') + call IMAP(g:Tex_Leader.'e', '\varepsilon', 'tex') + call IMAP(g:Tex_Leader.'f', '\varphi', 'tex') + call IMAP(g:Tex_Leader.'g', '\gamma', 'tex') + call IMAP(g:Tex_Leader.'h', '\eta', 'tex') + call IMAP(g:Tex_Leader.'k', '\kappa', 'tex') + call IMAP(g:Tex_Leader.'l', '\lambda', 'tex') + call IMAP(g:Tex_Leader.'m', '\mu', 'tex') + call IMAP(g:Tex_Leader.'n', '\nu', 'tex') + call IMAP(g:Tex_Leader.'p', '\pi', 'tex') + call IMAP(g:Tex_Leader.'q', '\theta', 'tex') + call IMAP(g:Tex_Leader.'r', '\rho', 'tex') + call IMAP(g:Tex_Leader.'s', '\sigma', 'tex') + call IMAP(g:Tex_Leader.'t', '\tau', 'tex') + call IMAP(g:Tex_Leader.'u', '\upsilon', 'tex') + call IMAP(g:Tex_Leader.'v', '\varsigma', 'tex') + call IMAP(g:Tex_Leader.'w', '\omega', 'tex') + call IMAP(g:Tex_Leader.'w', '\wedge', 'tex') " AUCTEX style + call IMAP(g:Tex_Leader.'x', '\xi', 'tex') + call IMAP(g:Tex_Leader.'y', '\psi', 'tex') + call IMAP(g:Tex_Leader.'z', '\zeta', 'tex') + " not all capital greek letters exist in LaTeX! + " reference: http://www.giss.nasa.gov/latex/ltx-405.html + call IMAP(g:Tex_Leader.'D', '\Delta', 'tex') + call IMAP(g:Tex_Leader.'F', '\Phi', 'tex') + call IMAP(g:Tex_Leader.'G', '\Gamma', 'tex') + call IMAP(g:Tex_Leader.'Q', '\Theta', 'tex') + call IMAP(g:Tex_Leader.'L', '\Lambda', 'tex') + call IMAP(g:Tex_Leader.'X', '\Xi', 'tex') + call IMAP(g:Tex_Leader.'Y', '\Psi', 'tex') + call IMAP(g:Tex_Leader.'S', '\Sigma', 'tex') + call IMAP(g:Tex_Leader.'U', '\Upsilon', 'tex') + call IMAP(g:Tex_Leader.'W', '\Omega', 'tex') + " }}} + " ProtectLetters: sets up indentity maps for things like ``a {{{ + " " Description: If we simply do + " call IMAP('`a', '\alpha', 'tex') + " then we will never be able to type 'a' after a tex-quotation. Since + " IMAP() always uses the longest map ending in the letter, this problem + " can be avoided by creating a fake map for ``a -> ``a. + " This function sets up fake maps of the following forms: + " ``[aA] -> ``[aA] (for writing in quotations) + " \`[aA] -> \`[aA] (for writing diacritics) + " "`[aA] -> "`[aA] (for writing german quotations) + " It does this for all printable lower ascii characters just to make sure + " we dont let anything slip by. + function! s:ProtectLetters(first, last) + let i = a:first + while i <= a:last + if nr2char(i) =~ '[[:print:]]' + call IMAP('``'.nr2char(i), '``'.nr2char(i), 'tex') + call IMAP('\`'.nr2char(i), '\`'.nr2char(i), 'tex') + call IMAP('"`'.nr2char(i), '"`'.nr2char(i), 'tex') + endif + let i = i + 1 + endwhile + endfunction + call s:ProtectLetters(32, 127) + " }}} + " vmaps: enclose selected region in brackets, environments {{{ + " The action changes depending on whether the selection is character-wise + " or line wise. for example, selecting linewise and pressing \v will + " result in the region being enclosed in \begin{verbatim}, \end{verbatim}, + " whereas in characterise visual mode, the thingie is enclosed in \verb| + " and |. + exec 'vnoremap <silent> '.g:Tex_Leader."( \<C-\\>\<C-N>:call VEnclose('\\left( ', ' \\right)', '\\left(', '\\right)')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."[ \<C-\\>\<C-N>:call VEnclose('\\left[ ', ' \\right]', '\\left[', '\\right]')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."{ \<C-\\>\<C-N>:call VEnclose('\\left\\{ ', ' \\right\\}', '\\left\\{', '\\right\\}')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."$ \<C-\\>\<C-N>:call VEnclose('$', '$', '\\[', '\\]')\<CR>" + " }}} +end + +" }}} + +" ============================================================================== +" Helper functions for debugging +" ============================================================================== +" Tex_Debug: appends the argument into s:debugString {{{ +" Description: +" +" Do not want a memory leak! Set this to zero so that latex-suite always +" starts out in a non-debugging mode. +if !exists('g:Tex_Debug') + let g:Tex_Debug = 0 +endif +function! Tex_Debug(str, ...) + if !g:Tex_Debug + return + endif + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if !exists('s:debugString_'.pattern) + let s:debugString_{pattern} = '' + endif + let s:debugString_{pattern} = s:debugString_{pattern}.a:str."\n" + + let s:debugString_ = (exists('s:debugString_') ? s:debugString_ : '') + \ . pattern.' : '.a:str."\n" + + if Tex_GetVarValue('Tex_DebugLog') != '' + exec 'redir! >> '.Tex_GetVarValue('Tex_DebugLog') + silent! echo pattern.' : '.a:str + redir END + endif +endfunction " }}} +" Tex_PrintDebug: prings s:debugString {{{ +" Description: +" +function! Tex_PrintDebug(...) + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if exists('s:debugString_'.pattern) + echo s:debugString_{pattern} + endif +endfunction " }}} +" Tex_ClearDebug: clears the s:debugString string {{{ +" Description: +" +function! Tex_ClearDebug(...) + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if exists('s:debugString_'.pattern) + let s:debugString_{pattern} = '' + endif +endfunction " }}} +" Tex_ShowVariableValue: debugging help {{{ +" provides a way to examine script local variables from outside the script. +" very handy for debugging. +function! Tex_ShowVariableValue(...) + let i = 1 + while i <= a:0 + exe 'let arg = a:'.i + if exists('s:'.arg) || + \ exists('*s:'.arg) + exe 'let val = s:'.arg + echomsg 's:'.arg.' = '.val + end + let i = i + 1 + endwhile +endfunction + +" }}} + +" ============================================================================== +" Helper functions for grepping +" ============================================================================== +" Tex_Grep: shorthand for :grep or :vimgrep {{{ +function! Tex_Grep(string, where) + if v:version >= 700 + exec 'silent! vimgrep! /'.a:string.'/ '.a:where + else + exec 'silent! grep! '.Tex_EscapeForGrep(a:string).' '.a:where + endif +endfunction + +" }}} +" Tex_Grepadd: shorthand for :grepadd or :vimgrepadd {{{ +function! Tex_Grepadd(string, where) + if v:version >= 700 + exec 'silent! vimgrepadd! /'.a:string.'/ '.a:where + else + exec "silent! grepadd! ".Tex_EscapeForGrep(a:string).' '.a:where + endif +endfunction + +" }}} +" Tex_EscapeForGrep: escapes back-slashes and doublequotes the correct number of times {{{ +" Description: This command escapes the backslash and double quotes in a +" search pattern the correct number of times so it can be used in the ``:grep`` +" command. This command is meant to be used as:: +" +" exec "silent! grep ".Tex_EscapeForGrep(pattern)." file" +" +" The input argument to this function should be the string which you want +" the external command to finally see. For example, to search for a string +" ``'\bibitem'``, the grep command needs to be passed a string like +" ``'\\bibitem'``. Examples:: +" +" Tex_EscapeForGrep('\\bibitem') " correct +" Tex_EscapeForGrep('\bibitem') " wrong +" Tex_EscapeForGrep("\\bibitem") " wrong +" Tex_EscapeForGrep('\<word\>') " correct +" +function! Tex_EscapeForGrep(string) + let retVal = a:string + + " The shell halves the backslashes. + if &shell =~ 'sh' + let retVal = escape(retVal, "\\") + + " If shellxquote is set, then the backslashes are halved yet again. + if &shellxquote == '"' + let retVal = escape(retVal, "\"\\") + endif + + endif + " escape special characters which bash/cmd.exe might interpret + let retVal = escape(retVal, "<>") + + return retVal +endfunction " }}} + +" ============================================================================== +" Uncategorized helper functions +" ============================================================================== +" Tex_Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! Tex_Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" Tex_CreatePrompt: creates a prompt string {{{ +" Description: +" Arguments: +" promptList: This is a string of the form: +" 'item1,item2,item3,item4' +" cols: the number of columns in the resultant prompt +" sep: the list seperator token +" +" Example: +" Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') +" returns +" "(1) item1\t(2)item2\n(3)item3\t(4)item4" +" +" This string can be used in the input() function. +function! Tex_CreatePrompt(promptList, cols, sep) + + let g:listSep = a:sep + let num_common = GetListCount(a:promptList) + + let i = 1 + let promptStr = "" + + while i <= num_common + + let j = 0 + while j < a:cols && i + j <= num_common + let com = Tex_Strntok(a:promptList, a:sep, i+j) + let promptStr = promptStr.'('.(i+j).') '. + \ com."\t".( strlen(com) < 4 ? "\t" : '' ) + + let j = j + 1 + endwhile + + let promptStr = promptStr."\n" + + let i = i + a:cols + endwhile + return promptStr +endfunction + +" }}} +" Tex_CleanSearchHistory: removes last search item from search history {{{ +" Description: This function needs to be globally visible because its +" called from outside the script during expansion. +function! Tex_CleanSearchHistory() + call histdel("/", -1) + let @/ = histget("/", -1) +endfunction +nmap <silent> <script> <plug>cleanHistory :call Tex_CleanSearchHistory()<CR> + +" }}} +" Tex_GetVarValue: gets the value of the variable {{{ +" Description: +" See if a window-local, buffer-local or global variable with the given name +" exists and if so, returns the corresponding value. If none exist, return +" an empty string. +function! Tex_GetVarValue(varname, ...) + if exists('w:'.a:varname) + return w:{a:varname} + elseif exists('b:'.a:varname) + return b:{a:varname} + elseif exists('g:'.a:varname) + return g:{a:varname} + elseif a:0 > 0 + return a:1 + else + return '' + endif +endfunction " }}} +" Tex_GetMainFileName: gets the name of the main file being compiled. {{{ +" Description: returns the full path name of the main file. +" This function checks for the existence of a .latexmain file +" which might point to the location of a "main" latex file. +" If .latexmain exists, then return the full path name of the +" file being pointed to by it. +" +" Otherwise, return the full path name of the current buffer. +" +" You can supply an optional "modifier" argument to the +" function, which will optionally modify the file name before +" returning. +" NOTE: From version 1.6 onwards, this function always trims +" away the .latexmain part of the file name before applying the +" modifier argument. +function! Tex_GetMainFileName(...) + if a:0 > 0 + let modifier = a:1 + else + let modifier = ':p' + endif + + " If the user wants to use his own way to specify the main file name, then + " use it straight away. + if Tex_GetVarValue('Tex_MainFileExpression') != '' + exec 'let retval = '.Tex_GetVarValue('Tex_MainFileExpression') + return retval + endif + + let curd = getcwd() + + let dirmodifier = '%:p:h' + let dirLast = expand(dirmodifier) + call Tex_CD(dirLast) + + " move up the directory tree until we find a .latexmain file. + " TODO: Should we be doing this recursion by default, or should there be a + " setting? + while glob('*.latexmain') == '' + let dirmodifier = dirmodifier.':h' + " break from the loop if we cannot go up any further. + if expand(dirmodifier) == dirLast + break + endif + let dirLast = expand(dirmodifier) + call Tex_CD(dirLast) + endwhile + + let lheadfile = glob('*.latexmain') + if lheadfile != '' + " Remove the trailing .latexmain part of the filename... We never want + " that. + let lheadfile = fnamemodify(substitute(lheadfile, '\.latexmain$', '', ''), modifier) + else + " If we cannot find any main file, just modify the filename of the + " current buffer. + let lheadfile = expand('%'.modifier) + endif + + call Tex_CD(curd) + + " NOTE: The caller of this function needs to escape spaces in the + " file name as appropriate. The reason its not done here is that + " escaping spaces is not safe if this file is to be used as part of + " an external command on certain platforms. + return lheadfile +endfunction + +" }}} +" Tex_ChooseFromPrompt: process a user input to a prompt string {{{ +" " Description: +function! Tex_ChooseFromPrompt(dialog, list, sep) + let g:Tex_ASDF = a:dialog + let inp = input(a:dialog) + if inp =~ '\d\+' + return Tex_Strntok(a:list, a:sep, inp) + else + return inp + endif +endfunction " }}} +" Tex_ChooseFile: produces a file list and prompts for choice {{{ +" Description: +function! Tex_ChooseFile(dialog) + let files = glob('*') + if files == '' + return '' + endif + let s:incnum = 0 + echo a:dialog + let filenames = substitute(files, "\\v(^|\n)", "\\=submatch(0).Tex_IncrementNumber(1).' : '", 'g') + echo filenames + let choice = input('Enter Choice : ') + let g:choice = choice + if choice == '' + return '' + endif + if choice =~ '^\s*\d\+\s*$' + let retval = Tex_Strntok(files, "\n", choice) + else + let filescomma = substitute(files, "\n", ",", "g") + let retval = GetListMatchItem(filescomma, choice) + endif + if retval == '' + return '' + endif + return retval +endfunction + +" }}} +" Tex_IncrementNumber: returns an incremented number each time {{{ +" Description: +let s:incnum = 0 +function! Tex_IncrementNumber(increm) + let s:incnum = s:incnum + a:increm + return s:incnum +endfunction + +" }}} +" Tex_ResetIncrementNumber: increments s:incnum to zero {{{ +" Description: +function! Tex_ResetIncrementNumber(val) + let s:incnum = a:val +endfunction " }}} +" Tex_FindInRtp: check if file exists in &rtp {{{ +" Description: Checks if file exists in globpath(&rtp, ...) and cuts off the +" rest of returned names. This guarantees that sourced file is +" from $HOME. +" If an optional argument is given, it specifies how to expand +" each filename found. For example, '%:p' will return a list of +" the complete paths to the files. By default returns trailing +" path-names without extenions. +" NOTE: This function is very slow when a large number of +" matches are found because of a while loop which modifies +" each filename found. Some speedup was acheived by using +" a tokenizer approach rather than using Tex_Strntok which +" would have been more obvious. +function! Tex_FindInRtp(filename, directory, ...) + " how to expand each filename. ':p:t:r' modifies each filename to its + " trailing part without extension. + let expand = (a:0 > 0 ? a:1 : ':p:t:r') + " The pattern used... An empty filename should be regarded as '*' + let pattern = (a:filename != '' ? a:filename : '*') + + let filelist = globpath(&rtp, 'ftplugin/latex-suite/'.a:directory.'/'.pattern)."\n" + + if filelist == "\n" + return '' + endif + + if a:filename != '' + return fnamemodify(Tex_Strntok(filelist, "\n", 1), expand) + endif + + " Now cycle through the files modifying each filename in the desired + " manner. + let retfilelist = '' + let i = 1 + while 1 + " Extract the portion till the next newline. Then shorten the filelist + " by removing till the newline. + let nextnewline = stridx(filelist, "\n") + if nextnewline == -1 + break + endif + let filename = strpart(filelist, 0, nextnewline) + let filelist = strpart(filelist, nextnewline+1) + + " The actual modification. + if fnamemodify(filename, expand) != '' + let retfilelist = retfilelist.fnamemodify(filename, expand)."," + endif + let i = i + 1 + endwhile + + return substitute(retfilelist, ',$', '', '') +endfunction + +" }}} +" Tex_GetErrorList: returns vim's clist {{{ +" Description: returns the contents of the error list available via the :clist +" command. +function! Tex_GetErrorList() + let _a = @a + redir @a | silent! clist | redir END + let errlist = @a + let @a = _a + + if errlist =~ 'E42: ' + let errlist = '' + endif + + return errlist +endfunction " }}} +" Tex_GetTempName: get the name of a temporary file in specified directory {{{ +" Description: Unlike vim's native tempname(), this function returns the name +" of a temporary file in the directory specified. This enables +" us to create temporary files in a specified directory. +function! Tex_GetTempName(dirname) + let prefix = 'latexSuiteTemp' + let slash = (a:dirname =~ '\\\|/$' ? '' : '/') + let i = 0 + while filereadable(a:dirname.slash.prefix.i.'.tex') && i < 1000 + let i = i + 1 + endwhile + if filereadable(a:dirname.slash.prefix.i.'.tex') + echoerr "Temporary file could not be created in ".a:dirname + return '' + endif + return expand(a:dirname.slash.prefix.i.'.tex', ':p') +endfunction +" }}} +" Tex_MakeMap: creates a mapping from lhs to rhs if rhs is not already mapped {{{ +" Description: +function! Tex_MakeMap(lhs, rhs, mode, extraargs) + if !hasmapto(a:rhs, a:mode) + exec a:mode.'map '.a:extraargs.' '.a:lhs.' '.a:rhs + endif +endfunction " }}} +" Tex_CD: cds to given directory escaping spaces if necessary {{{ +" " Description: +function! Tex_CD(dirname) + exec 'cd '.Tex_EscapeSpaces(a:dirname) +endfunction " }}} +" Tex_EscapeSpaces: escapes unescaped spaces from a path name {{{ +" Description: +function! Tex_EscapeSpaces(path) + return substitute(a:path, '[^\\]\(\\\\\)*\zs ', '\\ ', 'g') +endfunction " }}} +" Tex_FindFile: finds a file in the vim's 'path' {{{ +" Description: finds a file in vim's 'path' +function! Tex_FindFile(fname, path, suffixesadd) + if exists('*findfile') + let _suffixesadd = &suffixesadd + let &suffixesadd = a:suffixesadd + let retval = findfile(a:fname, a:path) + let &suffixesadd = _suffixesadd + else + " split a new window so we do not screw with the current buffer. We + " want to use the same filename each time so that multiple scratch + " buffers are not created. + let retval = '' + silent! split __HOPEFULLY_THIS_FILE_DOES_NOT_EXIST__ + let _suffixesadd = &suffixesadd + let _path = &path + let &suffixesadd = a:suffixesadd + let &path = a:path + exec 'silent! find '.a:fname + if bufname('%') != '__HOPEFULLY_THIS_FILE_DOES_NOT_EXIST__' + let retval = expand('%:p') + end + silent! bdelete! + let &suffixesadd = _suffixesadd + let &path = _path + endif + return retval +endfunction " }}} + +" ============================================================================== +" Smart key-mappings +" ============================================================================== +" TexQuotes: inserts `` or '' instead of " {{{ +if g:Tex_SmartKeyQuote + + " TexQuotes: inserts `` or '' instead of " + " Taken from texmacro.vim by Benji Fisher <benji@e-math.AMS.org> + " TODO: Deal with nested quotes. + " The :imap that calls this function should insert a ", move the cursor to + " the left of that character, then call this with <C-R>= . + function! s:TexQuotes() + let l = line(".") + let c = col(".") + let restore_cursor = l . "G" . virtcol(".") . "|" + normal! H + let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor + execute restore_cursor + " In math mode, or when preceded by a \, just move the cursor past the + " already-inserted " character. + if synIDattr(synID(l, c, 1), "name") =~ "^texMath" + \ || (c > 1 && getline(l)[c-2] == '\') + return "\<Right>" + endif + " Find the appropriate open-quote and close-quote strings. + if exists("b:Tex_SmartQuoteOpen") + let open = b:Tex_SmartQuoteOpen + elseif exists("g:Tex_SmartQuoteOpen") + let open = g:Tex_SmartQuoteOpen + else + let open = "``" + endif + if exists("b:Tex_SmartQuoteClose") + let close = b:Tex_SmartQuoteClose + elseif exists("g:Tex_SmartQuoteClose") + let close = g:Tex_SmartQuoteClose + else + let close = "''" + endif + let boundary = '\|' + " This code seems to be obsolete, since this script variable is never + " set. The idea is that some languages use ",," as an open- or + " close-quote string, and we want to avoid confusing ordinary "," + " with a quote boundary. + if exists("s:TeX_strictquote") + if( s:TeX_strictquote == "open" || s:TeX_strictquote == "both" ) + let boundary = '\<' . boundary + endif + if( s:TeX_strictquote == "close" || s:TeX_strictquote == "both" ) + let boundary = boundary . '\>' + endif + endif + + " Eventually return q; set it to the default value now. + let q = open + let pattern = + \ escape(open, '\~') . + \ boundary . + \ escape(close, '\~') . + \ '\|^$\|"' + + while 1 " Look for preceding quote (open or close), ignoring + " math mode and '\"' . + call search(pattern, "bw") + if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" + \ && strpart(getline('.'), col('.')-2, 2) != '\"' + break + endif + endwhile + + " Now, test whether we actually found a _preceding_ quote; if so, is it + " an open quote? + if ( line(".") < l || line(".") == l && col(".") < c ) + if strpart(getline("."), col(".")-1) =~ '\V\^' . escape(open, '\') + if line(".") == l && col(".") + strlen(open) == c + " Insert "<++>''<++>" instead of just "''". + let q = IMAP_PutTextWithMovement("<++>".close."<++>") + else + let q = close + endif + endif + endif + + " Return to line l, column c: + execute restore_cursor + " Start with <Del> to remove the " put in by the :imap . + return "\<Del>" . q + + endfunction + +endif +" }}} +" SmartBS: smart backspacing {{{ +if g:Tex_SmartKeyBS + + " SmartBS: smart backspacing + " SmartBS lets you treat diacritic characters (those \'{a} thingies) as a + " single character. This is useful for example in the following situation: + " + " \v{s}\v{t}astn\'{y} ('happy' in Slovak language :-) ) + " If you will delete this normally (without using smartBS() function), you + " must press <BS> about 19x. With function smartBS() you must press <BS> only + " 7x. Strings like "\v{s}", "\'{y}" are considered like one character and are + " deleted with one <BS>. + let s:smartBS_pat = Tex_GetVarValue('Tex_SmartBSPattern') + + fun! s:SmartBS_pat() + return s:smartBS_pat + endfun + + " This function comes from Benji Fisher <benji@e-math.AMS.org> + " http://vim.sourceforge.net/scripts/download.php?src_id=409 + " (modified/patched by Lubomir Host 'rajo' <host8 AT keplerDOTfmphDOTuniba.sk>) + function! s:SmartBS(pat) + let init = strpart(getline("."), 0, col(".")-1) + let matchtxt = matchstr(init, a:pat) + if matchtxt != '' + let bstxt = substitute(matchtxt, '.', "\<bs>", 'g') + return bstxt + else + return "\<bs>" + endif + endfun + +endif " }}} +" SmartDots: inserts \cdots instead of ... in math mode otherwise \ldots {{{ +" if amsmath package is detected then just use \dots and let amsmath take care +" of it. +if g:Tex_SmartKeyDot + + function! <SID>SmartDots() + if strpart(getline('.'), col('.')-3, 2) == '..' && + \ g:Tex_package_detected =~ '\<amsmath\>' + return "\<bs>\<bs>\\dots" + elseif synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath' + \&& strpart(getline('.'), col('.')-3, 2) == '..' + return "\<bs>\<bs>\\cdots" + elseif strpart(getline('.'), col('.')-3, 2) == '..' + return "\<bs>\<bs>\\ldots" + else + return '.' + endif + endfunction + +endif +" }}} + +" source texproject.vim before other files +exe 'source '.s:path.'/texproject.vim' + +" source all the relevant files. +exe 'source '.s:path.'/texmenuconf.vim' +exe 'source '.s:path.'/envmacros.vim' +exe 'source '.s:path.'/elementmacros.vim' + +" source utf-8 or plain math menus +if exists("g:Tex_UseUtfMenus") && g:Tex_UseUtfMenus != 0 && has("gui_running") + exe 'source '.s:path.'/mathmacros-utf.vim' +else + exe 'source '.s:path.'/mathmacros.vim' +endif + +exe 'source '.s:path.'/multicompile.vim' +exe 'source '.s:path.'/compiler.vim' +exe 'source '.s:path.'/folding.vim' +exe 'source '.s:path.'/templates.vim' +exe 'source '.s:path.'/custommacros.vim' +exe 'source '.s:path.'/bibtex.vim' + +" source advanced math functions +if g:Tex_AdvancedMath == 1 + exe 'source '.s:path.'/brackets.vim' + exe 'source '.s:path.'/smartspace.vim' +endif + +if g:Tex_Diacritics != 0 + exe 'source '.s:path.'/diacritics.vim' +endif + +exe 'source '.s:path.'/texviewer.vim' +exe 'source '.s:path.'/version.vim' + +" ============================================================================== +" Finally set up the folding, options, mappings and quit. +" ============================================================================== +" SetTeXOptions: sets options/mappings for this file. {{{ +function! <SID>SetTeXOptions() + " Avoid reinclusion. + if exists('b:doneSetTeXOptions') + return + endif + let b:doneSetTeXOptions = 1 + + exe 'setlocal dict^='.s:path.'/dictionaries/dictionary' + + call Tex_Debug('SetTeXOptions: sourcing maps', 'main') + " smart functions + if g:Tex_SmartKeyQuote + inoremap <buffer> <silent> " "<Left><C-R>=<SID>TexQuotes()<CR> + endif + if g:Tex_SmartKeyBS + inoremap <buffer> <silent> <BS> <C-R>=<SID>SmartBS(<SID>SmartBS_pat())<CR> + endif + if g:Tex_SmartKeyDot + inoremap <buffer> <silent> . <C-R>=<SID>SmartDots()<CR> + endif + + " This line seems to be necessary to source our compiler/tex.vim file. + " The docs are unclear why this needs to be done even though this file is + " the first compiler plugin in 'runtimepath'. + runtime compiler/tex.vim + +endfunction + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('main.vim: Catching LatexSuiteFileType event', 'main') | + \ call <SID>SetTeXOptions() +augroup END + +" }}} + +" ============================================================================== +" Settings for taglist.vim plugin +" ============================================================================== +" Sets Tlist_Ctags_Cmd for taglist.vim and regexps for ctags {{{ +if exists("g:Tex_TaglistSupport") && g:Tex_TaglistSupport == 1 + if !exists("g:tlist_tex_settings") + let g:tlist_tex_settings = 'tex;s:section;c:chapter;l:label;r:ref' + endif + + if exists("Tlist_Ctags_Cmd") + let s:tex_ctags = Tlist_Ctags_Cmd + else + let s:tex_ctags = 'ctags' " Configurable in texrc? + endif + + if exists("g:Tex_InternalTagsDefinitions") && g:Tex_InternalTagsDefinitions == 1 + let Tlist_Ctags_Cmd = s:tex_ctags ." --langdef=tex --langmap=tex:.tex.ltx.latex" + \.' --regex-tex="/\\\\begin{abstract}/Abstract/s,abstract/"' + \.' --regex-tex="/\\\\part[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,part/"' + \.' --regex-tex="/\\\\chapter[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,chapter/"' + \.' --regex-tex="/\\\\section[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,section/"' + \.' --regex-tex="/\\\\subsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsection/"' + \.' --regex-tex="/\\\\subsubsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsubsection/"' + \.' --regex-tex="/\\\\paragraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,paragraph/"' + \.' --regex-tex="/\\\\subparagraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subparagraph/"' + \.' --regex-tex="/\\\\begin{thebibliography}/BIBLIOGRAPHY/s,thebibliography/"' + \.' --regex-tex="/\\\\tableofcontents/TABLE OF CONTENTS/s,tableofcontents/"' + \.' --regex-tex="/\\\\frontmatter/FRONTMATTER/s,frontmatter/"' + \.' --regex-tex="/\\\\mainmatter/MAINMATTER/s,mainmatter/"' + \.' --regex-tex="/\\\\backmatter/BACKMATTER/s,backmatter/"' + \.' --regex-tex="/\\\\appendix/APPENDIX/s,appendix/"' + \.' --regex-tex="/\\\\label[ \t]*\*?\{[ \t]*([^}]*)\}/\1/l,label/"' + \.' --regex-tex="/\\\\ref[ \t]*\*?\{[ \t]*([^}]*)\}/\1/r,ref/"' + endif +endif + +" }}} + +" commands to completion +let g:Tex_completion_explorer = ',' + +" Mappings defined in package files will overwrite all other +exe 'source '.s:path.'/packages.vim' + +" ============================================================================== +" These functions are used to immitate certain operating system type functions +" (like reading the contents of a file), which are not available in vim. For +" example, in Vim, its not possible to read the contents of a file without +" opening a buffer on it, which means that over time, lots of buffers can open +" up needlessly. +" +" If python is available (and allowed), then these functions utilize python +" library functions without making calls to external programs. +" ============================================================================== +" Tex_GotoTempFile: open a temp file. reuse from next time on {{{ +function! Tex_GotoTempFile() + if !exists('s:tempFileName') + let s:tempFileName = tempname() + endif + exec 'silent! split '.s:tempFileName +endfunction " }}} +" Tex_IsPresentInFile: finds if a string str, is present in filename {{{ +if has('python') && g:Tex_UsePython + function! Tex_IsPresentInFile(regexp, filename) + exec 'python isPresentInFile(r"'.a:regexp.'", r"'.a:filename.'")' + + return retval + endfunction +else + function! Tex_IsPresentInFile(regexp, filename) + call Tex_GotoTempFile() + + silent! 1,$ d _ + let _report = &report + let _sc = &sc + set report=9999999 nosc + exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename + set nomod + let &report = _report + let &sc = _sc + + if search(a:regexp, 'w') + let retval = 1 + else + let retval = 0 + endif + silent! bd + return retval + endfunction +endif " }}} +" Tex_CatFile: returns the contents of a file in a <NL> seperated string {{{ +if has('*readfile') + function! Tex_CatFile(filename) + return join(readfile(filename), "\n") + endfunction +elseif has('python') && g:Tex_UsePython + function! Tex_CatFile(filename) + " catFile assigns a value to retval + exec 'python catFile("'.a:filename.'")' + + return retval + endfunction +else + function! Tex_CatFile(filename) + if glob(a:filename) == '' + return '' + endif + + call Tex_GotoTempFile() + + silent! 1,$ d _ + + let _report = &report + let _sc = &sc + set report=9999999 nosc + exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename + + set nomod + let _a = @a + silent! normal! ggVG"ay + let retval = @a + let @a = _a + + silent! bd + let &report = _report + let &sc = _sc + return retval + endfunction +endif +" }}} +" Tex_DeleteFile: removes a file if present {{{ +" Description: +if has('python') && g:Tex_UsePython + function! Tex_DeleteFile(filename) + exec 'python deleteFile(r"'.a:filename.'")' + + if exists('retval') + return retval + endif + endfunction +else + function! Tex_DeleteFile(filename) + if filereadable(a:filename) + exec '! '.g:Tex_RmCmd.' '.a:filename + endif + endfunction +endif +" }}} + + +let &cpo = s:save_cpo + +" Define the functions in python if available. +if !has('python') || !g:Tex_UsePython + finish +endif + +exec 'pyfile '.expand('<sfile>:p:h').'/pytools.py' + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/dot_vim/ftplugin/latex-suite/mathmacros-utf.vim b/dot_vim/ftplugin/latex-suite/mathmacros-utf.vim new file mode 100644 index 0000000..f5b5b85 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/mathmacros-utf.vim @@ -0,0 +1,729 @@ +"============================================================================= +" File: mathmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for everything mathematical in latex. +"============================================================================= + +if !(has('gui_running') && g:Tex_MathMenus && g:Tex_Menus) + finish +endif + +let s:MathMenuName = g:Tex_MenuPrefix.'Ma&th.' + +function! Tex_MathMenuRemove() + exe 'silent! aunmenu '.s:MathMenuName +endfunction + +let s:pA = 'amenu <silent> 85 '.s:MathMenuName + +" brackets and dollars {{{ +exe s:pA.'\\&[\ \\] <plug><C-r>=IMAP_PutTextWithMovement("\\[<++>\\]<++>")<cr>' +exe s:pA.'\\&(\ \\) <plug><C-r>=IMAP_PutTextWithMovement("\\(<++>\\)<++>")<cr>' +exe s:pA.'&$\ $ <plug>$$' +exe s:pA.'-sepmath1- :' +" }}} +" MATH arrows {{{ +let s:pA1 = s:pA."&Arrows." +exe s:pA1.'Leftarrow<Tab>⇠<plug>\Leftarrow ' +exe s:pA1.'leftarrow<Tab>↠<plug>\leftarrow' +exe s:pA1.'longleftarrow<Tab>↠<plug>\longleftarrow ' +exe s:pA1.'Longleftarrow<Tab>⇠<plug>\Longleftarrow ' +exe s:pA1.'rightarrow<Tab>→ <plug>\rightarrow ' +exe s:pA1.'longrightarrow<Tab>→ <plug>\longrightarrow ' +exe s:pA1.'Rightarrow<Tab>⇒ <plug>\Rightarrow ' +exe s:pA1.'Longrightarrow<Tab>⇒ <plug>\Longrightarrow ' +exe s:pA1.'leftrightarrow<Tab>⇆ <plug>\leftrightarrow ' +exe s:pA1.'longleftrightarrow<Tab>↔ <plug>\longleftrightarrow ' +exe s:pA1.'Leftrightarrow<Tab>⇔ <plug>\Leftrightarrow ' +exe s:pA1.'Longleftrightarrow<Tab>⇔ <plug>\Longleftrightarrow ' +exe s:pA1.'uparrow<Tab>↑ <plug>\uparrow ' +exe s:pA1.'Uparrow<Tab>⇑ <plug>\Uparrow ' +exe s:pA1.'downarrow<Tab>↓ <plug>\downarrow ' +exe s:pA1.'Downarrow<Tab>⇓ <plug>\Downarrow ' +exe s:pA1.'updownarrow<Tab>↕ <plug>\updownarrow ' +exe s:pA1.'Updownarrow<Tab>⇕ <plug>\Updownarrow ' +exe s:pA1.'nearrow<Tab>↗ <plug>\nearrow ' +exe s:pA1.'searrow<Tab>↘ <plug>\searrow ' +exe s:pA1.'swarrow<Tab>↙ <plug>\swarrow ' +exe s:pA1.'nwarrow<Tab>↖ <plug>\nwarrow ' +exe s:pA1.'mapsto<Tab>↦ <plug>\mapsto ' +exe s:pA1.'leadsto<Tab>↠<plug>\leadsto ' +exe s:pA1.'longmapsto<Tab>⇖ <plug>\longmapsto ' +exe s:pA1.'hookleftarrow<Tab>↩ <plug>\hookleftarrow ' +exe s:pA1.'hookrightarrow<Tab>↪ <plug>\hookrightarrow ' +exe s:pA1.'leftharpoonup<Tab>↼ <plug>\leftharpoonup ' +exe s:pA1.'leftharpoondown<Tab>↽ <plug>\leftharpoondown ' +exe s:pA1.'rightharpoonup<Tab>⇀ <plug>\rightharpoonup ' +exe s:pA1.'rightharpoondown<Tab>⇠<plug>\rightharpoondown ' +exe s:pA1.'rightleftharpoons<Tab>⇌ <plug>\rightleftharpoons ' +exe s:pA1.'overleftarrow<Tab> <plug>\overleftarrow ' +exe s:pA1.'overrightarrow<Tab> <plug>\overrightarrow ' +exe s:pA1.'overleftrightarrow<Tab> <plug>\overleftrightarrow ' +exe s:pA1.'underleftarrow<Tab> <plug>\underleftarrow ' +exe s:pA1.'underrightarrow<Tab> <plug>\underrightarrow ' +exe s:pA1.'underleftrightarrow<Tab> <plug>\underleftrightarrow ' +exe s:pA1.'xleftarrow<Tab> <plug>\xleftarrow ' +exe s:pA1.'xrightarrow<Tab> <plug>\xrightarrow ' +" }}} +" MATH Arrows2 {{{ +let s:pA1a = s:pA."Arrows2." +exe s:pA1a.'dashleftarrow<Tab>⇠<plug>\dashleftarrow ' +exe s:pA1a.'leftleftarrows<Tab>⇇ <plug>\leftleftarrows ' +exe s:pA1a.'leftrightarrows<Tab>⇆ <plug>\leftrightarrows ' +exe s:pA1a.'Lleftarrow<Tab>⇚ <plug>\Lleftarrow ' +exe s:pA1a.'twoheadleftarrow<Tab>↞ <plug>\twoheadleftarrow ' +exe s:pA1a.'leftarrowtail<Tab>↢ <plug>\leftarrowtail ' +exe s:pA1a.'leftrightharpoons<Tab>⇋ <plug>\leftrightharpoons ' +exe s:pA1a.'Lsh<Tab>↰ <plug>\Lsh ' +exe s:pA1a.'looparrowleft<Tab>↫ <plug>\looparrowleft ' +exe s:pA1a.'curvearrowleft<Tab>↶ <plug>\curvearrowleft ' +exe s:pA1a.'circlearrowleft<Tab>↺ <plug>\circlearrowleft ' +exe s:pA1a.'dashrightarrow<Tab>⇢ <plug>\dashrightarrow ' +exe s:pA1a.'rightrightarrows<Tab>⇉ <plug>\rightrightarrows ' +exe s:pA1a.'rightleftarrows<Tab>⇄ <plug>\rightleftarrows ' +exe s:pA1a.'Rrightarrow<Tab>⇛ <plug>\Rrightarrow ' +exe s:pA1a.'twoheadrightarrow<Tab>↠<plug>\twoheadrightarrow ' +exe s:pA1a.'rightarrowtail<Tab>↣ <plug>\rightarrowtail ' +exe s:pA1a.'rightleftharpoons<Tab>⇌ <plug>\rightleftharpoons ' +exe s:pA1a.'Rsh<Tab>↱ <plug>\Rsh ' +exe s:pA1a.'looparrowright<Tab>↬ <plug>\looparrowright ' +exe s:pA1a.'curvearrowright<Tab>↷ <plug>\curvearrowright ' +exe s:pA1a.'circlearrowright<Tab>↻ <plug>\circlearrowright ' +exe s:pA1a.'multimap<Tab>⊸ <plug>\multimap ' +exe s:pA1a.'upuparrows<Tab>⇈ <plug>\upuparrows ' +exe s:pA1a.'downdownarrows<Tab>⇊ <plug>\downdownarrows ' +exe s:pA1a.'upharpoonleft<Tab>↿ <plug>\upharpoonleft ' +exe s:pA1a.'upharpoonright<Tab>↾ <plug>\upharpoonright ' +exe s:pA1a.'downharpoonleft<Tab>⇃ <plug>\downharpoonleft ' +exe s:pA1a.'downharpoonright<Tab>⇂ <plug>\downharpoonright ' +exe s:pA1a.'rightsquigarrow<Tab>⇠<plug>\rightsquigarrow ' +exe s:pA1a.'leftrightsquigarrow<Tab>↠<plug>\leftrightsquigarrow ' +" }}} +" MATH nArrows {{{ +let s:pA1b = s:pA."&nArrows." +exe s:pA1b.'nleftarrow<Tab>↚ <plug>\nleftarrow ' +exe s:pA1b.'nLeftarrow<Tab>⇠<plug>\nLeftarrow ' +exe s:pA1b.'nleftrightarrow<Tab>↮ <plug>\nleftrightarrow ' +exe s:pA1b.'nLeftrightarrow<Tab>⇎ <plug>\nleftrightarrow ' +exe s:pA1b.'nrightarrow<Tab>↛ <plug>\nrightarrow ' +exe s:pA1b.'nRightarrow<Tab>⇠<plug>\nRightarrow ' +" }}} +" MATH Fonts {{{ +let s:pA2a = s:pA."&MathFonts." +" exe s:pA2a.'mathbf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbf{<++>}<++>")<cr>' +exe s:pA2a.'mathrm{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathrm{<++>}<++>")<cr>' +exe s:pA2a.'mathsf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathsf{<++>}<++>")<cr>' +exe s:pA2a.'mathtt{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathtt{<++>}<++>")<cr>' +exe s:pA2a.'mathit{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathit{<++>}<++>")<cr>' +exe s:pA2a.'mathfrak{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathfrak{<++>}<++>")<cr>' +exe s:pA2a.'mathcal{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathcal{<++>}<++>")<cr>' +exe s:pA2a.'mathscr{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathscr{<++>}<++>")<cr>' +exe s:pA2a.'mathbb{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbb{<++>}<++>")<cr>' +" }}} +" Greek Letters small {{{ +let s:pA2 = s:pA."&Greek.&Small." +exe s:pA2.'alpha<Tab>`a\ \ α <plug>\alpha ' +exe s:pA2.'beta<Tab>`b\ \ β <plug>\beta ' +exe s:pA2.'gamma<Tab>`g\ \ γ <plug>\gamma ' +exe s:pA2.'delta<Tab>`d\ \ δ <plug>\delta ' +exe s:pA2.'epsilon<Tab>∊ <plug>\epsilon ' +exe s:pA2.'varepsilon<Tab>`e\ \ ε <plug>\varepsilon ' +exe s:pA2.'zeta<Tab>`z\ \ ζ <plug>\zeta ' +exe s:pA2.'eta<Tab>`h\ \ η <plug>\eta ' +exe s:pA2.'theta<Tab>`q\ \ θ <plug>\theta ' +exe s:pA2.'vartheta<Tab>Ï‘ <plug>\vartheta ' +exe s:pA2.'iota<Tab>`i\ \ ι <plug>\iota ' +exe s:pA2.'kappa<Tab>`k\ \ κ <plug>\kappa ' +exe s:pA2.'lambda<Tab>`l\ \ λ <plug>\lambda ' +exe s:pA2.'mu<Tab>`m\ \ μ <plug>\mu ' +exe s:pA2.'nu<Tab>`n\ \ ν <plug>\nu ' +exe s:pA2.'xi<Tab>`x\ \ ξ <plug>\xi ' +exe s:pA2.'pi<Tab>`p\ \ Ï€ <plug>\pi ' +exe s:pA2.'varpi<Tab>Ï– <plug>\varpi ' +exe s:pA2.'rho<Tab>`r\ \ Ï <plug>\rho ' +exe s:pA2.'varrho<Tab>ϱ <plug>\varrho ' +exe s:pA2.'sigma<Tab>`s\ \ σ <plug>\sigma ' +exe s:pA2.'varsigma<Tab>`v\ \ Ï‚ <plug>\varsigma ' +exe s:pA2.'tau<Tab>`t\ \ Ï„ <plug>\tau ' +exe s:pA2.'upsilon<Tab>`u\ \ Ï… <plug>\upsilon ' +exe s:pA2.'phi<Tab>φ <plug>\phi ' +exe s:pA2.'varphi<Tab>`f\ \ Ï• <plug>\varphi ' +exe s:pA2.'chi<Tab>`c\ \ χ <plug>\chi ' +exe s:pA2.'psi<Tab>`y\ \ ψ <plug>\psi ' +exe s:pA2.'omega<Tab>`w\ \ ω <plug>\omega ' +" }}} +" Greek Letters big {{{ +let s:pA3 = s:pA.'&Greek.&Big.' +exe s:pA3.'Alpha<Tab>`A\ \ A <plug>\Alpha ' +exe s:pA3.'Beta<Tab>`B\ \ B <plug>\Beta ' +exe s:pA3.'Gamma<Tab>`G\ \ Γ <plug>\Gamma ' +exe s:pA3.'Delta<Tab>`D\ \ Δ <plug>\Delta ' +exe s:pA3.'Epsilon<Tab>`E\ \ E <plug>\Epsilon ' +exe s:pA3.'Zeta<Tab>`Z\ \ Z <plug>\mathrm{Z} ' +exe s:pA3.'Eta<Tab>`H\ \ H <plug>\Eta ' +exe s:pA3.'Theta<Tab>Θ <plug>\Theta ' +exe s:pA3.'Iota<Tab>I <plug>\mathrm{I} ' +exe s:pA3.'Kappa<Tab>`K\ \ K <plug>\Kappa ' +exe s:pA3.'Lambda<Tab>`L\ \ Λ <plug>\Lambda ' +exe s:pA3.'Mu<Tab>`M\ \ M <plug>\Mu ' +exe s:pA3.'Nu<Tab>`N\ \ N <plug>\Nu ' +exe s:pA3.'Xi<Tab>`X\ \ Ξ <plug>\Xi ' +exe s:pA3.'Pi<Tab>`P\ \ Î <plug>\Pi ' +exe s:pA3.'Rho<Tab>`R\ \ P <plug>\Rho ' +exe s:pA3.'Sigma<Tab>`S\ \ Σ <plug>\Sigma ' +exe s:pA3.'Tau<Tab>`T\ \ T <plug>\Tau ' +exe s:pA3.'Upsilon<Tab>`U\ \ Y <plug>\Upsilon ' +exe s:pA3.'Phi<Tab>Φ <plug>\Phi ' +exe s:pA3.'Chi<Tab>`C\ \ X <plug>\Chi ' +exe s:pA3.'Psi<Tab>`Y\ \ Ψ <plug>\Psi ' +exe s:pA3.'Omega<Tab>`W\ \ Ω <plug>\Omega ' +" }}} +" BinaryRel1 {{{ +let s:pA4 = s:pA."&BinaryRel1." +exe s:pA4.'ll<Tab>≪ <plug>\ll ' +exe s:pA4.'lll<Tab>⋘ <plug>\lll ' +exe s:pA4.'leqslant<Tab>≤ <plug>\leqslant ' +exe s:pA4.'leq<Tab>≤ <plug>\leq ' +exe s:pA4.'leqq<Tab>≦ <plug>\leqq ' +exe s:pA4.'eqslantless<Tab>â‹œ <plug>\eqslantless ' +exe s:pA4.'lessdot<Tab>â‹– <plug>\lessdot ' +exe s:pA4.'prec<Tab>≺ <plug>\prec ' +exe s:pA4.'preceq<Tab>≼ <plug>\preceq ' +exe s:pA4.'preccurlyeq<Tab>≼ <plug>\preccurlyeq ' +exe s:pA4.'curlyeqprec<Tab>â‹ž <plug>\curlyeqprec ' +exe s:pA4.'lesssim<Tab>≲ <plug>\lesssim ' +exe s:pA4.'lessapprox<Tab> <plug>\lessapprox ' +exe s:pA4.'precsim<Tab>≾ <plug>\precsim ' +exe s:pA4.'precapprox<Tab> <plug>\precapprox ' +exe s:pA4.'in<Tab>∈ <plug>\in ' +exe s:pA4.'subset<Tab>`(\ \ ⊂ <plug>\subset ' +exe s:pA4.'Subset<Tab>`)\ \ â‹ <plug>\Subset ' +exe s:pA4.'subseteq<Tab>⊆ <plug>\subseteq ' +exe s:pA4.'subseteqq<Tab> <plug>\subseteqq ' +exe s:pA4.'sqsubset<Tab>⊠<plug>\sqsubset ' +exe s:pA4.'sqsubseteq<Tab>⊑ <plug>\sqsubseteq ' +exe s:pA4.'smile<Tab>⌣ <plug>\smile ' +exe s:pA4.'smallsmile<Tab>⌣ <plug>\smallsmile ' +exe s:pA4.'parallel<Tab>∥ <plug>\parallel ' +exe s:pA4.'shortparallel<Tab>∥ <plug>\shortparallel ' +exe s:pA4.'dashv<Tab>⊣ <plug>\dashv ' +exe s:pA4.'vdash<Tab>⊢ <plug>\vdash ' +exe s:pA4.'vDash<Tab>⊨ <plug>\vDash ' +exe s:pA4.'models<Tab>⊨ <plug>\models ' +exe s:pA4.'therefore<Tab>∴ <plug>\therefore ' +exe s:pA4.'backepsilon<Tab>∠<plug>\backepsilon ' +" }}} +" nBinaryRel1 {{{ +let s:pA4a = s:pA."&nBinaryRel1." +exe s:pA4a.'nless<Tab>≮ <plug>\nless ' +exe s:pA4a.'nleqslant<Tab>≰ <plug>\nleqslant ' +exe s:pA4a.'nleq<Tab> <plug>\nleq ' +exe s:pA4a.'lneq<Tab> <plug>\lneq ' +exe s:pA4a.'nleqq<Tab> <plug>\nleqq ' +exe s:pA4a.'lneqq<Tab>≨ <plug>\lneqq ' +exe s:pA4a.'lvertneqq<Tab> <plug>\lvertneqq ' +exe s:pA4a.'nprec<Tab>⊀ <plug>\nprec ' +exe s:pA4a.'npreceq<Tab>â‹ <plug>\npreceq ' +exe s:pA4a.'precneqq<Tab> <plug>\precneqq ' +exe s:pA4a.'lnsim<Tab>⋦ <plug>\lnsim ' +exe s:pA4a.'lnapprox<Tab> <plug>\lnapprox ' +exe s:pA4a.'precnsim<Tab>⋨ <plug>\precnsim ' +exe s:pA4a.'precnapprox<Tab> <plug>\precnapprox ' +exe s:pA4a.'notin<Tab>∉ <plug>\notin ' +exe s:pA4a.'nsubseteq<Tab>⊈ <plug>\nsubseteq ' +exe s:pA4a.'varsubsetneq<Tab> <plug>\varsubsetneq ' +exe s:pA4a.'subsetneq<Tab>⊊ <plug>\subsetneq ' +exe s:pA4a.'nsubseteqq<Tab> <plug>\nsubseteqq ' +exe s:pA4a.'varsubsetneqq<Tab> <plug>\varsubsetneqq ' +exe s:pA4a.'subsetneqq<Tab>⊈ <plug>\subsetneqq ' +exe s:pA4a.'nparallel<Tab>∦ <plug>\nparallel ' +exe s:pA4a.'nshortparallel<Tab> <plug>\nshortparallel ' +exe s:pA4a.'nvdash<Tab>⊬ <plug>\nvdash ' +exe s:pA4a.'nvDash<Tab>⊠<plug>\nvDash ' +" }}} +" BinaryRel2 {{{ +let s:pA5 = s:pA."&BinaryRel2." +exe s:pA5.'gg<Tab>≫ <plug>\gg ' +exe s:pA5.'ggg<Tab>â‹™ <plug>\ggg ' +exe s:pA5.'gggtr<Tab>â‹™ <plug>\gggtr ' +exe s:pA5.'geqslant<Tab> <plug>\geqslant ' +exe s:pA5.'geq<Tab>≥ <plug>\geq ' +exe s:pA5.'geqq<Tab>≧ <plug>\geqq ' +exe s:pA5.'eqslantgtr<Tab> <plug>\eqslantgtr ' +exe s:pA5.'gtrdot<Tab>â‹— <plug>\gtrdot ' +exe s:pA5.'succ<Tab>≻ <plug>\succ ' +exe s:pA5.'succeq<Tab>≽ <plug>\succeq ' +exe s:pA5.'succcurlyeq<Tab>≽ <plug>\succcurlyeq ' +exe s:pA5.'curlyeqsucc<Tab>â‹Ÿ <plug>\curlyeqsucc ' +exe s:pA5.'gtrsim<Tab>≳ <plug>\gtrsim ' +exe s:pA5.'gtrapprox<Tab> <plug>\gtrapprox ' +exe s:pA5.'succsim<Tab>≿ <plug>\succsim ' +exe s:pA5.'succapprox<Tab> <plug>\succapprox ' +exe s:pA5.'ni<Tab>∋ <plug>\ni ' +exe s:pA5.'owns<Tab> <plug>\owns ' +exe s:pA5.'supset<Tab>⊃ <plug>\supset ' +exe s:pA5.'Supset<Tab>â‹‘ <plug>\Supset ' +exe s:pA5.'supseteq<Tab>⊇ <plug>\supseteq ' +exe s:pA5.'supseteqq<Tab> <plug>\supseteqq ' +exe s:pA5.'sqsupset<Tab>⊠<plug>\sqsupset ' +exe s:pA5.'sqsupseteq<Tab>⊒ <plug>\sqsupseteq ' +exe s:pA5.'frown<Tab>⌢ <plug>\frown ' +exe s:pA5.'smallfrown<Tab>⌢ <plug>\smallfrown ' +exe s:pA5.'mid<Tab>∣ <plug>\mid ' +exe s:pA5.'shortmid<Tab> <plug>\shortmid ' +exe s:pA5.'between<Tab>≬ <plug>\between ' +exe s:pA5.'Vdash<Tab>⊩ <plug>\Vdash ' +exe s:pA5.'bowtie<Tab>⋈ <plug>\bowtie ' +exe s:pA5.'Join<Tab>⋈ <plug>\Join ' +exe s:pA5.'pitchfork<Tab>â‹” <plug>\pitchfork ' +" }}} +" {{{ nBinaryRel2 +let s:pA5a = s:pA."n&BinaryRel2." "TODO: dorobiæ logarytmy +exe s:pA5a.'ngtr<Tab>≯ <plug>\ngtr ' +exe s:pA5a.'ngeqslant<Tab>≱ <plug>\ngeqslant ' +exe s:pA5a.'ngeq<Tab> <plug>\ngeq ' +exe s:pA5a.'gneq<Tab> <plug>\gneq ' +exe s:pA5a.'ngeqq<Tab> <plug>\ngeqq ' +exe s:pA5a.'gneqq<Tab>≩ <plug>\gneqq ' +exe s:pA5a.'nsucc<Tab>⊠<plug>\nsucc ' +exe s:pA5a.'nsucceq<Tab>â‹¡ <plug>\nsucceq ' +exe s:pA5a.'succneqq<Tab> <plug>\succneqq ' +exe s:pA5a.'gnsim<Tab>⋧ <plug>\gnsim ' +exe s:pA5a.'gnapprox<Tab> <plug>\gnapprox ' +exe s:pA5a.'succnsim<Tab>â‹© <plug>\succnsim ' +exe s:pA5a.'succnapprox<Tab> <plug>\succnapprox ' +exe s:pA5a.'nsupseteq<Tab>⊉ <plug>\nsupseteq ' +exe s:pA5a.'varsupsetneq<Tab> <plug>\varsupsetneq ' +exe s:pA5a.'supsetneq<Tab>⊋ <plug>\supsetneq ' +exe s:pA5a.'nsupseteqq<Tab> <plug>\nsupseteqq ' +exe s:pA5a.'varsupsetneqq<Tab> <plug>\varsupsetneqq ' +exe s:pA5a.'supsetneqq<Tab> <plug>\supsetneqq ' +exe s:pA5a.'nmid<Tab>∤ <plug>\nmid ' +exe s:pA5a.'nshortmid<Tab> <plug>\nshortmid ' +exe s:pA5a.'nVdash<Tab>⊮ <plug>\nVdash ' +" }}} +" {{{ BinaryRel3 +let s:pA6 = s:pA."&BinaryRel3." +exe s:pA6.'doteq<Tab>≠<plug>\doteq ' +exe s:pA6.'circeq<Tab>≗ <plug>\circeq ' +exe s:pA6.'eqcirc<Tab>≖ <plug>\eqcirc ' +exe s:pA6.'risingdotseq<Tab>≓ <plug>\risingdotseq ' +exe s:pA6.'doteqdot<Tab>≑ <plug>\doteqdot ' +exe s:pA6.'Doteq<Tab>≑ <plug>\Doteq ' +exe s:pA6.'fallingdotseq<Tab>≒ <plug>\fallingdotseq ' +exe s:pA6.'triangleq<Tab>≜ <plug>\triangleq ' +exe s:pA6.'bumpeq<Tab>≠<plug>\bumpeq ' +exe s:pA6.'Bumpeq<Tab>≎ <plug>\Bumpeq ' +exe s:pA6.'equiv<Tab>`=\ \ ≡ <plug>\equiv ' +exe s:pA6.'sim<Tab>∼ <plug>\sim ' +exe s:pA6.'thicksim<Tab>∼ <plug>\thicksim ' +exe s:pA6.'backsim<Tab>∽ <plug>\backsim ' +exe s:pA6.'simeq<Tab>≃ <plug>\simeq ' +exe s:pA6.'backsimeq<Tab>â‹ <plug>\backsimeq ' +exe s:pA6.'cong<Tab>≅ <plug>\cong ' +exe s:pA6.'approx<tab>=~\ \ ≈ <plug>\approx ' +exe s:pA6.'thickapprox<Tab>≈ <plug>\thickapprox ' +exe s:pA6.'approxeq<Tab>≊ <plug>\approxeq ' +exe s:pA6.'blacktriangleleft<Tab>â—€ <plug>\blacktriangleleft ' +exe s:pA6.'vartriangleleft<Tab>⊲ <plug>\vartriangleleft ' +exe s:pA6.'trianglelefteq<Tab>⊴ <plug>\trianglelefteq ' +exe s:pA6.'blacktriangleright<Tab>â–¶ <plug>\blacktriangleright ' +exe s:pA6.'vartriangleright<Tab>⊳ <plug>\vartriangleright ' +exe s:pA6.'trianglerighteq<Tab>⊵ <plug>\trianglerighteq ' +exe s:pA6.'perp<Tab>⊥ <plug>\perp ' +exe s:pA6.'asymp<Tab>≠<plug>\asymp ' +exe s:pA6.'Vvdash<Tab>⊪ <plug>\Vvdash ' +exe s:pA6.'propto<Tab>∠<plug>\propto ' +exe s:pA6.'varpropto<Tab>∠<plug>\varpropto ' +exe s:pA6.'because<Tab>∵ <plug>\because ' +" }}} +" {{{ nBinaryRel3 +let s:pA6a = s:pA."&nBinaryRel3." +exe s:pA6a.'neq<Tab>≠<plug>\neq ' +exe s:pA6a.'nsim<Tab>≠<plug>\nsim ' +exe s:pA6a.'ncong<Tab>≆ <plug>\ncong ' +exe s:pA6a.'ntriangleleft<Tab>⋪ <plug>\ntriangleleft ' +exe s:pA6a.'ntrianglelefteq<Tab>⋬ <plug>\ntrianglelefteq ' +exe s:pA6a.'ntriangleright<Tab>â‹« <plug>\ntriangleright ' +exe s:pA6a.'ntrianglerighteq<Tab>â‹ <plug>\ntrianglerighteq ' +" }}} +" {{{ BinaryRel4 +let s:pA7 = s:pA."&BinaryRel4." +exe s:pA7.'lessgtr<Tab>≶ <plug>\lessgtr ' +exe s:pA7.'gtrless<Tab>≷ <plug>\gtrless ' +exe s:pA7.'lesseqgtr<Tab>â‹š <plug>\lesseqgtr ' +exe s:pA7.'gtreqless<Tab>â‹› <plug>\gtreqless ' +exe s:pA7.'lesseqqgtr<Tab> <plug>\lesseqqgtr ' +exe s:pA7.'gtreqqless<Tab> <plug>\gtreqqless ' +" }}} +" {{{ BigOp +let s:pA8a = s:pA."&BigOp." +exe s:pA8a.'limits<Tab> <plug>\limits' +exe s:pA8a.'nolimits<Tab> <plug>\nolimits' +exe s:pA8a.'displaylimits<Tab> <plug>\displaylimits' +exe s:pA8a.'-seplimits- :' +exe s:pA8a.'bigcap<Tab>`-\ \ â‹‚ <plug>\bigcap' +exe s:pA8a.'bigcup<Tab>`+\ \ ⋃ <plug>\bigcup' +exe s:pA8a.'bigodot<Tab>⊙ <plug>\bigodot' +exe s:pA8a.'bigoplus<Tab>⊕ <plug>\bigoplus' +exe s:pA8a.'bigotimes<Tab>⊗ <plug>\bigotimes' +exe s:pA8a.'bigsqcup<Tab>⊔ <plug>\bigsqcup' +exe s:pA8a.'biguplus<Tab>⊎ <plug>\biguplus' +exe s:pA8a.'bigvee<Tab>â‹ <plug>\bigvee' +exe s:pA8a.'bigwedge<Tab>â‹€ <plug>\bigwedge' +exe s:pA8a.'coprod<Tab>∠<plug>\coprod' +exe s:pA8a.'int<Tab>∫ <plug>\int' +exe s:pA8a.'iint<Tab>∬ <plug>\int' +exe s:pA8a.'iiint<Tab>∠<plug>\int' +exe s:pA8a.'oint<Tab>∮ <plug>\oint' +exe s:pA8a.'prod<Tab>∠<plug>\prod' +exe s:pA8a.'sum<Tab>∑ <plug>\sum' +" }}} +" {{{ BinaryOp +let s:pA8 = s:pA."&BinaryOp." +exe s:pA8.'pm<Tab>± <plug>\pm ' +exe s:pA8.'mp<Tab>∓ <plug>\mp ' +exe s:pA8.'dotplus<Tab>∔ <plug>\dotplus ' +exe s:pA8.'cdot<Tab>`.\ \ â‹… <plug>\cdot ' +exe s:pA8.'centerdot<Tab>â‹… <plug>\centerdot ' +exe s:pA8.'times<Tab>`*\ \ × <plug>\times ' +exe s:pA8.'ltimes<Tab>⋉ <plug>\ltimes ' +exe s:pA8.'rtimes<Tab>â‹Š <plug>\rtimes ' +exe s:pA8.'leftthreetimes<Tab>â‹‹ <plug>\leftthreetimes ' +exe s:pA8.'rightthreetimes<Tab>â‹Œ <plug>\rightthreetimes ' +exe s:pA8.'div<Tab>÷ <plug>\div ' +exe s:pA8.'divideontimes<Tab>⋇ <plug>\divideontimes ' +exe s:pA8.'bmod<Tab> <plug>\bmod ' +exe s:pA8.'ast<Tab>∗ <plug>\ast ' +exe s:pA8.'star<Tab>⋆ <plug>\star ' +exe s:pA8.'setminus<Tab>`\\\ \ ∖ <plug>\setminus ' +exe s:pA8.'smallsetminus<Tab>∖ <plug>\smallsetminus ' +exe s:pA8.'diamond<Tab>â‹„ <plug>\diamond ' +exe s:pA8.'wr<Tab>≀ <plug>\wr ' +exe s:pA8.'intercal<Tab>⊺ <plug>\intercal ' +exe s:pA8.'circ<Tab>`@\ \ ∘ <plug>\circ ' +exe s:pA8.'bigcirc<Tab>â—‹ <plug>\bigcirc ' +exe s:pA8.'bullet<Tab>∙ <plug>\bullet ' +exe s:pA8.'cap<Tab>∩ <plug>\cap ' +exe s:pA8.'Cap<Tab>â‹’ <plug>\Cap ' +exe s:pA8.'cup<Tab>∪ <plug>\cup ' +exe s:pA8.'Cup<Tab>â‹“ <plug>\Cup ' +exe s:pA8.'sqcap<Tab>⊓ <plug>\sqcap ' +exe s:pA8.'sqcup<Tab>⊔ <plug>\sqcup' +exe s:pA8.'amalg<Tab> <plug>\amalg ' +exe s:pA8.'uplus<Tab>⊎ <plug>\uplus ' +exe s:pA8.'triangleleft<Tab>â— <plug>\triangleleft ' +exe s:pA8.'triangleright<Tab>â–· <plug>\triangleright ' +exe s:pA8.'bigtriangleup<Tab>â–³ <plug>\bigtriangleup ' +exe s:pA8.'bigtriangledown<Tab>â–½ <plug>\bigtriangledown ' +exe s:pA8.'vee<Tab>∨ <plug>\vee ' +exe s:pA8.'veebar<Tab>⊻ <plug>\veebar ' +exe s:pA8.'curlyvee<Tab>â‹Ž <plug>\curlyvee ' +exe s:pA8.'wedge<Tab>`&\ \ ∧ <plug>\wedge ' +exe s:pA8.'barwedge<Tab>⊼ <plug>\barwedge ' +exe s:pA8.'doublebarwedge<Tab>⌆ <plug>\doublebarwedge ' +exe s:pA8.'curlywedge<Tab>â‹ <plug>\curlywedge ' +exe s:pA8.'oplus<Tab>⊕ <plug>\oplus ' +exe s:pA8.'ominus<Tab>⊖ <plug>\ominus ' +exe s:pA8.'otimes<Tab>⊗ <plug>\otimes ' +exe s:pA8.'oslash<Tab>⊘ <plug>\oslash ' +exe s:pA8.'boxplus<Tab>⊞ <plug>\boxplus ' +exe s:pA8.'boxminus<Tab>⊟ <plug>\boxminus ' +exe s:pA8.'boxtimes<Tab>⊠<plug>\boxtimes ' +exe s:pA8.'boxdot<Tab>⊡ <plug>\boxdot ' +exe s:pA8.'odot<Tab>⊙ <plug>\odot ' +exe s:pA8.'circledast<Tab>⊛ <plug>\circledast ' +exe s:pA8.'circleddash<Tab>⊠<plug>\circleddash ' +exe s:pA8.'circledcirc<Tab>⊚ <plug>\circledcirc ' +exe s:pA8.'dagger<Tab>†<plug>\dagger ' +exe s:pA8.'ddagger<Tab>‡ <plug>\ddagger ' +exe s:pA8.'lhd<Tab>⊲ <plug>\lhd ' +exe s:pA8.'unlhd<Tab>⊴ <plug>\unlhd ' +exe s:pA8.'rhd<Tab>⊳ <plug>\rhd ' +exe s:pA8.'unrhd<Tab>⊵ <plug>\unrhd ' +" }}} +" {{{ Other1 +let s:pA9 = s:pA."&Other1." +" exe s:pA9.'hat<Tab>â <plug>\hat ' +exe s:pA9.'check<Tab>ÇŽ <plug>\check ' +exe s:pA9.'grave<Tab>à <plug>\grave ' +exe s:pA9.'acute<Tab>á <plug>\acute ' +exe s:pA9.'dot<Tab>ȧ <plug>\dot ' +exe s:pA9.'ddot<Tab>ä <plug>\ddot ' +exe s:pA9.'tilde<Tab>`,\ \ ã <plug>\tilde ' +exe s:pA9.'breve<Tab>ă <plug>\breve ' +exe s:pA9.'bar<Tab>Ä <plug>\bar ' +exe s:pA9.'vec<Tab>a⃗ <plug>\vec ' +exe s:pA9.'aleph<Tab>× <plug>\aleph ' +exe s:pA9.'hbar<Tab>â„ <plug>\hbar ' +exe s:pA9.'imath<Tab> <plug>\imath ' +exe s:pA9.'jmath<Tab> <plug>\jmath ' +exe s:pA9.'ell<Tab>â„“ <plug>\ell ' +exe s:pA9.'wp<Tab>℘ <plug>\wp ' +exe s:pA9.'Re<Tab>â„œ <plug>\Re ' +exe s:pA9.'Im<Tab>â„‘ <plug>\Im ' +exe s:pA9.'partial<Tab>∂ <plug>\partial ' +exe s:pA9.'infty<Tab>`8\ \ ∞ <plug>\infty ' +exe s:pA9.'prime<Tab>′ <plug>\prime ' +exe s:pA9.'emptyset<Tab>∅ <plug>\emptyset ' +exe s:pA9.'nabla<Tab>∇ <plug>\nabla ' +exe s:pA9.'surd<Tab>√ <plug>\surd ' +exe s:pA9.'top<Tab>⊤ <plug>\top ' +exe s:pA9.'bot<Tab>⊥ <plug>\bot ' +exe s:pA9.'angle<Tab>∠<plug>\angle ' +exe s:pA9.'triangle<Tab>â–³ <plug>\triangle ' +exe s:pA9.'backslash<Tab>\\ <plug>\backslash ' +exe s:pA9.'forall<Tab>∀ <plug>\forall ' +exe s:pA9.'exists<Tab>∃ <plug>\exists ' +exe s:pA9.'neg<Tab>¬ <plug>\neg ' +exe s:pA9.'flat<Tab>â™ <plug>\flat ' +exe s:pA9.'natural<Tab>â™® <plug>\natural ' +exe s:pA9.'sharp<Tab>♯ <plug>\sharp ' +exe s:pA9.'clubsuit<Tab>♣ <plug>\clubsuit ' +exe s:pA9.'diamondsuit<Tab>♢ <plug>\diamondsuit ' +exe s:pA9.'heartsuit<Tab>♡ <plug>\heartsuit ' +exe s:pA9.'spadesuit<Tab>â™ <plug>\spadesuit ' +exe s:pA9.'S<Tab>§ <plug>\S ' +exe s:pA9.'P<Tab>¶ <plug>\P' +" }}} +" {{{ MathCreating +let s:pA10 = s:pA."&MathCreating." +exe s:pA10.'not<Tab> <plug>\not' +exe s:pA10.'mkern<Tab> <plug>\mkern' +exe s:pA10.'mathbin<Tab> <plug>\mathbin' +exe s:pA10.'mathrel<Tab> <plug>\mathrel' +exe s:pA10.'stackrel<Tab> <plug>\stackrel' +exe s:pA10.'mathord<Tab> <plug>\mathord' +" }}} +" {{{ Styles +let s:pA11 = s:pA."&Styles." +exe s:pA11.'displaystyle<Tab> <plug>\displaystyle' +exe s:pA11.'textstyle<Tab> <plug>\textstyle' +exe s:pA11.'scritpstyle<Tab> <plug>\scritpstyle' +exe s:pA11.'scriptscriptstyle<Tab> <plug>\scriptscriptstyle' +" }}} +" {{{ MathDiacritics +let s:pA12 = s:pA."&MathDiacritics." +exe s:pA12.'acute{}<Tab>á <plug><C-r>=IMAP_PutTextWithMovement("\\acute{<++>}<++>")<cr>' +exe s:pA12.'bar{}<Tab>`_\ \ Ä <plug><C-r>=IMAP_PutTextWithMovement("\\bar{<++>}<++>")<cr>' +exe s:pA12.'breve{}<Tab>ă <plug><C-r>=IMAP_PutTextWithMovement("\\breve{<++>}<++>")<cr>' +exe s:pA12.'check{}<Tab>ÇŽ <plug><C-r>=IMAP_PutTextWithMovement("\\check{<++>}<++>")<cr>' +exe s:pA12.'ddot{}<Tab>`:\ \ ä <plug><C-r>=IMAP_PutTextWithMovement("\\ddot{<++>}<++>")<cr>' +exe s:pA12.'dot{}<Tab>`;\ \ ȧ <plug><C-r>=IMAP_PutTextWithMovement("\\dot{<++>}<++>")<cr>' +exe s:pA12.'grave{}<Tab>à <plug><C-r>=IMAP_PutTextWithMovement("\\grave{<++>}<++>")<cr>' +" exe s:pA12.'hat{}<Tab>`^\ \ â <plug><C-r>=IMAP_PutTextWithMovement("\\hat{<++>}<++>")<cr>' +exe s:pA12.'tilde{}<tab>`~\ \ ã <plug><C-r>=IMAP_PutTextWithMovement("\\tilde{<++>}<++>")<cr>' +exe s:pA12.'vec{}<Tab>a⃗ <plug><C-r>=IMAP_PutTextWithMovement("\\vec{<++>}<++>")<cr>' +exe s:pA12.'widehat{}<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\widehat{<++>}<++>")<cr>' +exe s:pA12.'widetilde{}<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\widetilde{<++>}<++>")<cr>' +exe s:pA12.'imath<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\imath")<cr>' +exe s:pA12.'jmath<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\jmath")<cr>' +" }}} +" {{{ OverlineAndCo +let s:pA13 = s:pA."&OverlineAndCo." +exe s:pA13.'overline{} <plug><C-r>=IMAP_PutTextWithMovement("\\overline{}")<cr>' +exe s:pA13.'underline{} <plug><C-r>=IMAP_PutTextWithMovement("\\underline{}")<cr>' +exe s:pA13.'overrightarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overrightarrow{}")<cr>' +exe s:pA13.'overleftarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overleftarrow{}")<cr>' +exe s:pA13.'overbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\overbrace{}")<cr>' +exe s:pA13.'underbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\underbrace{}")<cr>' +" }}} +" {{{ Symbols1 +let s:pA14a = s:pA."&Symbols1." +exe s:pA14a.'forall<Tab>∀ <plug>\forall ' +exe s:pA14a.'exists<Tab>∃ <plug>\exists ' +exe s:pA14a.'nexists<Tab>∄ <plug>\nexists ' +exe s:pA14a.'neg<Tab>¬ <plug>\neg ' +exe s:pA14a.'top<Tab>⊤ <plug>\top ' +exe s:pA14a.'bot<Tab>⊥ <plug>\bot ' +exe s:pA14a.'emptyset<Tab>∅ <plug>\emptyset ' +exe s:pA14a.'varnothing<Tab>⌀ <plug>\varnothing ' +exe s:pA14a.'infty<Tab>∞ <plug>\infty ' +exe s:pA14a.'aleph<Tab>× <plug>\aleph ' +exe s:pA14a.'beth<Tab>ב <plug>\beth ' +exe s:pA14a.'gimel<Tab>×’ <plug>\gimel ' +exe s:pA14a.'daleth<Tab>ד <plug>\daleth ' +exe s:pA14a.'hbar<Tab> <plug>\hbar ' +exe s:pA14a.'hslash<Tab>â„ <plug>\hslash ' +exe s:pA14a.'diagup<Tab>â„ <plug>\diagup ' +exe s:pA14a.'vert<Tab>\| <plug>\vert ' +exe s:pA14a.'Vert<Tab>∥ <plug>\Vert ' +exe s:pA14a.'backslash<Tab>\\ <plug>\backslash ' +exe s:pA14a.'diagdown<Tab> <plug>\diagdown ' +exe s:pA14a.'Bbbk<Tab>ᵕ <plug>\Bbbk ' +exe s:pA14a.'P<Tab>¶ <plug>\P ' +exe s:pA14a.'S<Tab>§ <plug>\S ' +" }}} +" {{{ Symbols2 +let s:pA14b = s:pA."&Symbols2." +exe s:pA14b.'# <plug>\# ' +exe s:pA14b.'% <plug>\% ' +exe s:pA14b.'_<Tab> <plug>\_ ' +exe s:pA14b.'$ <plug>\$ ' +exe s:pA14b.'& <plug>\& ' +exe s:pA14b.'imath<Tab> <plug>\imath ' +exe s:pA14b.'jmath<Tab> <plug>\jmath ' +exe s:pA14b.'ell<Tab>â„“ <plug>\ell ' +exe s:pA14b.'wp<Tab>℘ <plug>\wp ' +exe s:pA14b.'Re<Tab>â„œ <plug>\Re ' +exe s:pA14b.'Im<Tab>â„‘ <plug>\Im ' +exe s:pA14b.'prime<Tab>′ <plug>\prime ' +exe s:pA14b.'backprime<Tab>‵ <plug>\backprime ' +exe s:pA14b.'nabla<Tab>∇ <plug>\nabla ' +exe s:pA14b.'surd<Tab>√ <plug>\surd ' +exe s:pA14b.'flat<Tab>â™ <plug>\flat ' +exe s:pA14b.'sharp<Tab>♯ <plug>\sharp ' +exe s:pA14b.'natural<Tab>â™® <plug>\natural ' +exe s:pA14b.'eth<Tab>ð <plug>\eth ' +exe s:pA14b.'bigstar<Tab>★ <plug>\bigstar ' +exe s:pA14b.'circledS<Tab>Ⓢ <plug>\circledS ' +exe s:pA14b.'Finv<Tab>Ⅎ <plug>\Finv ' +exe s:pA14b.'dag<Tab>†<plug>\dag ' +exe s:pA14b.'ddag<Tab>‡ <plug>\ddag ' +" }}} +" {{{ Symbols3 +let s:pA14c = s:pA."&Symbols3." +exe s:pA14c.'angle<Tab>∠<plug>\angle ' +exe s:pA14c.'measuredangle<Tab>∡ <plug>\measuredangle ' +exe s:pA14c.'sphericalangle<Tab>∢ <plug>\sphericalangle ' +exe s:pA14c.'spadesuit<Tab>â™ <plug>\spadesuit ' +exe s:pA14c.'heartsuit<Tab>♡ <plug>\heartsuit ' +exe s:pA14c.'diamondsuit<Tab>♢ <plug>\diamondsuit ' +exe s:pA14c.'clubsuit<Tab>♣ <plug>\clubsuit ' +exe s:pA14c.'lozenge<Tab>â—Š <plug>\lozenge ' +exe s:pA14c.'blacklozenge<Tab>â—† <plug>\blacklozenge ' +exe s:pA14c.'Diamond<Tab>â—‡ <plug>\Diamond ' +exe s:pA14c.'triangle<Tab>â–³ <plug>\triangle ' +exe s:pA14c.'vartriangle<Tab>â–³ <plug>\vartriangle ' +exe s:pA14c.'blacktriangle<Tab>â–² <plug>\blacktriangle ' +exe s:pA14c.'triangledown<Tab>â–½ <plug>\triangledown ' +exe s:pA14c.'blacktriangledown<Tab>â–¼ <plug>\blacktriangledown ' +exe s:pA14c.'Box<Tab>â–¡ <plug>\Box ' +exe s:pA14c.'square<Tab>â–¡ <plug>\square ' +exe s:pA14c.'blacksquare<Tab>â– <plug>\blacksquare ' +exe s:pA14c.'complement<Tab>∠<plug>\complement ' +exe s:pA14c.'mho<Tab>℧ <plug>\mho ' +exe s:pA14c.'Game<Tab>â… <plug>\Game ' +exe s:pA14c.'partial<Tab>`6\ \ ∂ <plug>\partial ' +exe s:pA14c.'smallint<Tab>∫ <plug>\smallint ' +" }}} +" {{{ Logic +let s:pA15 = s:pA."&Logic." +exe s:pA15.'lnot<Tab>¬ <plug>\lnot ' +exe s:pA15.'lor<Tab>∨ <plug>\lor ' +exe s:pA15.'land<Tab>∧ <plug>\land ' +" }}} +" {{{ Limits1 +let s:pA16 = s:pA."&Limits1." +exe s:pA16.'left<Tab>( <plug>\left' +exe s:pA16.'right<Tab>) <plug>\right' +exe s:pA16.'-sepbigl- :' +exe s:pA16.'bigl<Tab> <plug>\bigl' +exe s:pA16.'Bigl<Tab> <plug>\Bigl' +exe s:pA16.'biggl<Tab> <plug>\biggl' +exe s:pA16.'Biggl<Tab> <plug>\Biggl' +exe s:pA16.'-sepbigr- :' +exe s:pA16.'bigr<Tab> <plug>\bigr' +exe s:pA16.'Bigr<Tab> <plug>\Bigr' +exe s:pA16.'biggr<Tab> <plug>\biggr' +exe s:pA16.'Biggr<Tab> <plug>\Biggr' +exe s:pA16.'-sepbig- :' +exe s:pA16.'big<Tab> <plug>\big' +exe s:pA16.'bigm<Tab> <plug>\bigm' +exe s:pA16.'-sepfloor- :' +exe s:pA16.'lfloor<Tab>⌊ <plug>\lfloor ' +exe s:pA16.'lceil<Tab>⌈ <plug>\lceil ' +exe s:pA16.'rfloor<Tab>⌋ <plug>\rfloor ' +exe s:pA16.'rceil<Tab>⌉ <plug>\rceil ' +exe s:pA16.'-sepangle- :' +exe s:pA16.'langle<Tab>〈 <plug>\langle ' +exe s:pA16.'rangle<Tab>〉 <plug>\rangle ' +" }}} +" {{{ Limits2 +let s:pA16a = s:pA."&Limits2." +exe s:pA16a.'ulcorner<Tab>⌜ <plug>\ulcorner ' +exe s:pA16a.'urcorner<Tab>⌠<plug>\urcorner ' +exe s:pA16a.'llcorner<Tab>⌞ <plug>\llcorner ' +exe s:pA16a.'rlcorner<Tab>⌟ <plug>\rlcorner ' +exe s:pA16a.'-sepcorner- :' +exe s:pA16a.'vert<Tab>\| <plug>\vert ' +exe s:pA16a.'Vert<Tab>∥ <plug>\Vert ' +exe s:pA16a.'lvert<Tab> <plug>\lvert ' +exe s:pA16a.'lVert<Tab> <plug>\lVert ' +exe s:pA16a.'rvert<Tab> <plug>\rvert ' +exe s:pA16a.'rVert<Tab> <plug>\rVert ' +exe s:pA16a.'uparrow<Tab>↑ <plug>\uparrow ' +exe s:pA16a.'Uparrow<Tab>⇑ <plug>\Uparrow ' +exe s:pA16a.'downarrow<Tab>↓ <plug>\downarrow ' +exe s:pA16a.'Downarrow<Tab>⇓ <plug>\Downarrow ' +exe s:pA16a.'updownarrow<Tab>↕ <plug>\updownarrow ' +exe s:pA16a.'Updownarrow<Tab>⇕ <plug>\Updownarrow ' +exe s:pA16a.'lgroup<Tab> <plug>\lgroup ' +exe s:pA16a.'rgroup<Tab> <plug>\rgroup ' +exe s:pA16a.'lmoustache<Tab>∫ <plug>\lmoustache ' +exe s:pA16a.'rmoustache<Tab> <plug>\rmoustache ' +exe s:pA16a.'arrowvert<Tab> <plug>\arrowvert ' +exe s:pA16a.'Arrowvert<Tab> <plug>\Arrowvert ' +exe s:pA16a.'bracevert<Tab> <plug>\bracevert ' +" }}} +" {{{ Log-likes +let s:pA17 = s:pA."Lo&g-likes." +exe s:pA17.'arccos<Tab> <plug>\arccos ' +exe s:pA17.'arcsin<Tab> <plug>\arcsin ' +exe s:pA17.'arctan<Tab> <plug>\arctan ' +exe s:pA17.'arg<Tab> <plug>\arg ' +exe s:pA17.'cos<Tab> <plug>\cos ' +exe s:pA17.'cosh<Tab> <plug>\cosh ' +exe s:pA17.'cot<Tab> <plug>\cot ' +exe s:pA17.'coth<Tab> <plug>\coth ' +exe s:pA17.'csc<Tab> <plug>\csc ' +exe s:pA17.'deg<Tab> <plug>\deg ' +exe s:pA17.'det<Tab> <plug>\det ' +exe s:pA17.'dim<Tab> <plug>\dim ' +exe s:pA17.'exp<Tab> <plug>\exp ' +exe s:pA17.'gcd<Tab> <plug>\gcd ' +exe s:pA17.'hom<Tab> <plug>\hom ' +exe s:pA17.'inf<Tab> <plug>\inf ' +exe s:pA17.'injlim<Tab> <plug>\injlim ' +exe s:pA17.'ker<Tab> <plug>\ker ' +exe s:pA17.'lg<Tab> <plug>\lg ' +exe s:pA17.'lim<Tab> <plug>\lim ' +exe s:pA17.'liminf<Tab> <plug>\liminf ' +exe s:pA17.'limsup<Tab> <plug>\limsup ' +exe s:pA17.'ln<Tab> <plug>\ln ' +exe s:pA17.'log<Tab> <plug>\log ' +exe s:pA17.'max<Tab> <plug>\max ' +exe s:pA17.'min<Tab> <plug>\min ' +exe s:pA17.'Pr<Tab> <plug>\Pr ' +exe s:pA17.'projlim<Tab> <plug>\projlim ' +exe s:pA17.'sec<Tab> <plug>\sec ' +exe s:pA17.'sin<Tab> <plug>\sin ' +exe s:pA17.'sinh<Tab> <plug>\sinh ' +exe s:pA17.'sup<Tab> <plug>\sup ' +exe s:pA17.'tan<Tab> <plug>\tan ' +exe s:pA17.'tanh<Tab> <plug>\tanh ' +exe s:pA17.'varlimsup<Tab> <plug>\varlimsup ' +exe s:pA17.'varliminf<Tab> <plug>\varliminf ' +exe s:pA17.'varinjlim<Tab> <plug>\varinjlim ' +exe s:pA17.'varprojlim<Tab> <plug>\varprojlim ' +" }}} +" {{{ MathSpacing +let s:pA18 = s:pA."MathSpacing." +exe s:pA18.', <plug>\, ' +exe s:pA18.': <plug>\: ' +exe s:pA18.'; <plug>\; ' +exe s:pA18.'[space] <plug>\ ' +exe s:pA18.'quad<Tab> <plug>\quad ' +exe s:pA18.'qquad<Tab> <plug>\qquad ' +exe s:pA18.'! <plug>\! ' +exe s:pA18.'thinspace<Tab> <plug>\thinspace ' +exe s:pA18.'medspace<Tab> <plug>\medspace ' +exe s:pA18.'thickspace<Tab> <plug>\thickspace ' +exe s:pA18.'negthinspace<Tab> <plug>\negthinspace ' +exe s:pA18.'negmedspace<Tab> <plug>\negmedspace ' +exe s:pA18.'negthickspace<Tab> <plug>\negthickspace ' +" 1}}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:fenc=utf-8 diff --git a/dot_vim/ftplugin/latex-suite/mathmacros.vim b/dot_vim/ftplugin/latex-suite/mathmacros.vim new file mode 100644 index 0000000..f160db5 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/mathmacros.vim @@ -0,0 +1,730 @@ +"============================================================================= +" File: mathmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for everything mathematical in latex. +"============================================================================= + +if !(has('gui_running') && g:Tex_MathMenus && g:Tex_Menus) + finish +endif + +let s:MathMenuName = g:Tex_MenuPrefix.'&Math.' + +function! Tex_MathMenuRemove() + exe 'silent! aunmenu '.s:MathMenuName +endfunction + +let s:pA = 'amenu <silent> '.g:Tex_NextMenuLocation.' '.s:MathMenuName +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + +" brackets and dollars {{{ +exe s:pA.'\\&[\ \\] <plug><C-r>=IMAP_PutTextWithMovement("\\[<++>\\]<++>")<cr>' +exe s:pA.'\\&(\ \\) <plug><C-r>=IMAP_PutTextWithMovement("\\(<++>\\)<++>")<cr>' +exe s:pA.'&$\ $ <plug>$$' +exe s:pA.'-sepmath1- :' +" }}} +" MATH arrows {{{ +let s:pA1 = s:pA."&Arrows." +exe s:pA1.'Leftarrow <plug>\leftarrow ' +exe s:pA1.'leftarrow <plug>\leftarrow' +exe s:pA1.'longleftarrow <plug>\longleftarrow ' +exe s:pA1.'Leftarrow <plug>\Leftarrow ' +exe s:pA1.'Longleftarrow <plug>\Longleftarrow ' +exe s:pA1.'rightarrow <plug>\rightarrow ' +exe s:pA1.'longrightarrow <plug>\longrightarrow ' +exe s:pA1.'Rightarrow <plug>\Rightarrow ' +exe s:pA1.'Longrightarrow <plug>\Longrightarrow ' +exe s:pA1.'leftrightarrow <plug>\leftrightarrow ' +exe s:pA1.'longleftrightarrow <plug>\longleftrightarrow ' +exe s:pA1.'Leftrightarrow <plug>\Leftrightarrow ' +exe s:pA1.'Longleftrightarrow <plug>\Longleftrightarrow ' +exe s:pA1.'uparrow <plug>\uparrow ' +exe s:pA1.'Uparrow <plug>\Uparrow ' +exe s:pA1.'downarrow <plug>\downarrow ' +exe s:pA1.'Downarrow <plug>\Downarrow ' +exe s:pA1.'updownarrow <plug>\updownarrow ' +exe s:pA1.'Updownarrow <plug>\Updownarrow ' +exe s:pA1.'nearrow <plug>\nearrow ' +exe s:pA1.'searrow <plug>\searrow ' +exe s:pA1.'swarrow <plug>\swarrow ' +exe s:pA1.'nwarrow <plug>\nwarrow ' +exe s:pA1.'mapsto <plug>\mapsto ' +exe s:pA1.'leadsto <plug>\leadsto ' +exe s:pA1.'longmapsto <plug>\longmapsto ' +exe s:pA1.'hookleftarrow <plug>\hookleftarrow ' +exe s:pA1.'hookrightarrow <plug>\hookrightarrow ' +exe s:pA1.'leftharpoonup <plug>\leftharpoonup ' +exe s:pA1.'leftharpoondown <plug>\leftharpoondown ' +exe s:pA1.'rightharpoonup <plug>\rightharpoonup ' +exe s:pA1.'rightharpoondown <plug>\rightharpoondown ' +exe s:pA1.'rightleftharpoons <plug>\rightleftharpoons ' +exe s:pA1.'overleftarrow <plug>\overleftarrow ' +exe s:pA1.'overrightarrow <plug>\overrightarrow ' +exe s:pA1.'overleftrightarrow <plug>\overleftrightarrow ' +exe s:pA1.'underleftarrow <plug>\underleftarrow ' +exe s:pA1.'underrightarrow <plug>\underrightarrow ' +exe s:pA1.'underleftrightarrow <plug>\underleftrightarrow ' +exe s:pA1.'xleftarrow <plug>\xleftarrow ' +exe s:pA1.'xrightarrow <plug>\xrightarrow ' +" }}} + + +" MATH nArrows {{{ +let s:pA1a = s:pA."&nArrows." +exe s:pA1a.'nleftarrow <plug>\nleftarrow ' +exe s:pA1a.'nLeftarrow <plug>\nLeftarrow ' +exe s:pA1a.'nleftrightarrow <plug>\nleftrightarrow ' +exe s:pA1a.'nrightarrow <plug>\nrightarrow ' +exe s:pA1a.'nRightarrow <plug>\nRightarrow ' +" }}} +" MATH Arrows2 {{{ +let s:pA1a = s:pA."Arrows2." +exe s:pA1a.'dashleftarrow <plug>\dashleftarrow ' +exe s:pA1a.'leftleftarrows <plug>\leftleftarrows ' +exe s:pA1a.'leftrightarrows <plug>\leftrightarrows ' +exe s:pA1a.'Lleftarrow <plug>\Lleftarrow ' +exe s:pA1a.'twoheadleftarrow <plug>\twoheadleftarrow ' +exe s:pA1a.'leftarrowtail <plug>\leftarrowtail ' +exe s:pA1a.'leftrightharpoons <plug>\leftrightharpoons ' +exe s:pA1a.'Lsh <plug>\Lsh ' +exe s:pA1a.'looparrowleft <plug>\looparrowleft ' +exe s:pA1a.'curvearrowleft <plug>\curvearrowleft ' +exe s:pA1a.'circlearrowleft <plug>\circlearrowleft ' +exe s:pA1a.'dashrightarrow <plug>\dashrightarrow ' +exe s:pA1a.'rightrightarrows <plug>\rightrightarrows ' +exe s:pA1a.'rightleftarrows <plug>\rightleftarrows ' +exe s:pA1a.'Rrightarrow <plug>\Rrightarrow ' +exe s:pA1a.'twoheadrightarrow <plug>\twoheadrightarrow ' +exe s:pA1a.'rightarrowtail <plug>\rightarrowtail ' +exe s:pA1a.'rightleftharpoons <plug>\rightleftharpoons ' +exe s:pA1a.'Rsh <plug>\Rsh ' +exe s:pA1a.'looparrowright <plug>\looparrowright ' +exe s:pA1a.'curvearrowright <plug>\curvearrowright ' +exe s:pA1a.'circlearrowright <plug>\circlearrowright ' +exe s:pA1a.'multimap <plug>\multimap ' +exe s:pA1a.'upuparrows <plug>\upuparrows ' +exe s:pA1a.'downdownarrows <plug>\downdownarrows ' +exe s:pA1a.'upharpoonleft <plug>\upharpoonleft ' +exe s:pA1a.'upharpoonright <plug>\upharpoonright ' +exe s:pA1a.'downharpoonleft <plug>\downharpoonleft ' +exe s:pA1a.'downharpoonright <plug>\downharpoonright ' +exe s:pA1a.'rightsquigarrow <plug>\rightsquigarrow ' +exe s:pA1a.'leftrightsquigarrow <plug>\leftrightsquigarrow ' +" }}} +" MATH Fonts {{{ +let s:pA2a = s:pA."&MathFonts." +" exe s:pA2a.'mathbf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbf{<++>}<++>")<cr>' +exe s:pA2a.'mathrm{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathrm{<++>}<++>")<cr>' +exe s:pA2a.'mathsf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathsf{<++>}<++>")<cr>' +exe s:pA2a.'mathtt{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathtt{<++>}<++>")<cr>' +exe s:pA2a.'mathit{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathit{<++>}<++>")<cr>' +exe s:pA2a.'mathfrak{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathfrak{<++>}<++>")<cr>' +exe s:pA2a.'mathcal{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathcal{<++>}<++>")<cr>' +exe s:pA2a.'mathscr{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathscr{<++>}<++>")<cr>' +exe s:pA2a.'mathbb{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbb{<++>}<++>")<cr>' +" }}} +" Greek Letters small {{{ +let s:pA2 = s:pA."&Greek.&Small." +exe s:pA2.'alpha<Tab>`a <plug>\alpha ' +exe s:pA2.'beta<Tab>`b <plug>\beta ' +exe s:pA2.'gamma<Tab>`g <plug>\gamma ' +exe s:pA2.'delta<Tab>`d <plug>\delta ' +exe s:pA2.'epsilon <plug>\epsilon ' +exe s:pA2.'varepsilon<Tab>`e <plug>\varepsilon ' +exe s:pA2.'zeta<Tab>`z <plug>\zeta ' +exe s:pA2.'eta<Tab>`h <plug>\eta ' +exe s:pA2.'theta<Tab>`q <plug>\theta ' +exe s:pA2.'vartheta <plug>\vartheta ' +exe s:pA2.'iota<Tab>`i <plug>\iota ' +exe s:pA2.'kappa<Tab>`k <plug>\kappa ' +exe s:pA2.'lambda<Tab>`l <plug>\lambda ' +exe s:pA2.'mu<Tab>`m <plug>\mu ' +exe s:pA2.'nu<Tab>`n <plug>\nu ' +exe s:pA2.'xi<Tab>`x <plug>\xi ' +exe s:pA2.'pi<Tab>`p <plug>\pi ' +exe s:pA2.'varpi <plug>\varpi ' +exe s:pA2.'rho<Tab>`r <plug>\rho ' +exe s:pA2.'varrho <plug>\varrho ' +exe s:pA2.'sigma<Tab>`s <plug>\sigma ' +exe s:pA2.'varsigma<Tab>`v <plug>\varsigma ' +exe s:pA2.'tau<Tab>`t <plug>\tau ' +exe s:pA2.'upsilon<Tab>`u <plug>\upsilon ' +exe s:pA2.'phi <plug>\phi ' +exe s:pA2.'varphi<Tab>`f <plug>\varphi ' +exe s:pA2.'chi<Tab>`c <plug>\chi ' +exe s:pA2.'psi<Tab>`y <plug>\psi ' +exe s:pA2.'omega<Tab>`w <plug>\omega ' +" }}} +" Greek Letters big {{{ +let s:pA3 = s:pA.'&Greek.&Big.' +exe s:pA3.'Alpha<Tab>`A <plug>\Alpha ' +exe s:pA3.'Beta<Tab>`B <plug>\Beta ' +exe s:pA3.'Gamma<Tab>`G <plug>\Gamma ' +exe s:pA3.'Delta<Tab>`D <plug>\Delta ' +exe s:pA3.'Epsilon<Tab>`E <plug>\Epsilon ' +exe s:pA3.'Zeta<Tab>`Z <plug>\mathrm{Z} ' +exe s:pA3.'Eta<Tab>`H <plug>\Eta ' +exe s:pA3.'Theta <plug>\Theta ' +exe s:pA3.'Iota <plug>\mathrm{I} ' +exe s:pA3.'Kappa<Tab>`K <plug>\Kappa ' +exe s:pA3.'Lambda<Tab>`L <plug>\Lambda ' +exe s:pA3.'Mu<Tab>`M <plug>\Mu ' +exe s:pA3.'Nu<Tab>`N <plug>\Nu ' +exe s:pA3.'Xi<Tab>`X <plug>\Xi ' +exe s:pA3.'Pi<Tab>`P <plug>\Pi ' +exe s:pA3.'Rho<Tab>`R <plug>\Rho ' +exe s:pA3.'Sigma<Tab>`S <plug>\Sigma ' +exe s:pA3.'Tau<Tab>`T <plug>\Tau ' +exe s:pA3.'Upsilon<Tab>`U <plug>\Upsilon ' +exe s:pA3.'Phi <plug>\Phi ' +exe s:pA3.'Chi<Tab>`C <plug>\Chi ' +exe s:pA3.'Psi<Tab>`Y <plug>\Psi ' +exe s:pA3.'Omega<Tab>`W <plug>\Omega ' +" }}} +" BinaryRel1 {{{ +let s:pA4 = s:pA."&BinaryRel1." +exe s:pA4.'ll <plug>\ll ' +exe s:pA4.'lll <plug>\lll ' +exe s:pA4.'leqslant <plug>\leqslant ' +exe s:pA4.'leq <plug>\leq ' +exe s:pA4.'leqq <plug>\leqq ' +exe s:pA4.'eqslantless <plug>\eqslantless ' +exe s:pA4.'lessdot <plug>\lessdot ' +exe s:pA4.'prec <plug>\prec ' +exe s:pA4.'preceq <plug>\preceq ' +exe s:pA4.'preccurlyeq <plug>\preccurlyeq ' +exe s:pA4.'curlyeqprec <plug>\curlyeqprec ' +exe s:pA4.'lesssim <plug>\lesssim ' +exe s:pA4.'lessapprox <plug>\lessapprox ' +exe s:pA4.'precsim <plug>\precsim ' +exe s:pA4.'precapprox <plug>\precapprox ' +exe s:pA4.'in <plug>\in ' +exe s:pA4.'subset<Tab>`( <plug>\subset ' +exe s:pA4.'Subset<Tab>`) <plug>\Subset ' +exe s:pA4.'subseteq <plug>\subseteq ' +exe s:pA4.'subseteqq <plug>\subseteqq ' +exe s:pA4.'sqsubset <plug>\sqsubset ' +exe s:pA4.'sqsubseteq <plug>\sqsubseteq ' +exe s:pA4.'smile <plug>\smile ' +exe s:pA4.'smallsmile <plug>\smallsmile ' +exe s:pA4.'parallel <plug>\parallel ' +exe s:pA4.'shortparallel <plug>\shortparallel ' +exe s:pA4.'dashv <plug>\dashv ' +exe s:pA4.'vdash <plug>\vdash ' +exe s:pA4.'vDash <plug>\vDash ' +exe s:pA4.'models <plug>\models ' +exe s:pA4.'therefore <plug>\therefore ' +exe s:pA4.'backepsilon <plug>\backepsilon ' +" }}} +" nBinaryRel1 {{{ +let s:pA4a = s:pA."&nBinaryRel1." +exe s:pA4a.'nless <plug>\nless ' +exe s:pA4a.'nleqslant <plug>\nleqslant ' +exe s:pA4a.'nleq <plug>\nleq ' +exe s:pA4a.'lneq <plug>\lneq ' +exe s:pA4a.'nleqq <plug>\nleqq ' +exe s:pA4a.'lneqq <plug>\lneqq ' +exe s:pA4a.'lvertneqq <plug>\lvertneqq ' +exe s:pA4a.'nprec <plug>\nprec ' +exe s:pA4a.'npreceq <plug>\npreceq ' +exe s:pA4a.'precneqq <plug>\precneqq ' +exe s:pA4a.'lnsim <plug>\lnsim ' +exe s:pA4a.'lnapprox <plug>\lnapprox ' +exe s:pA4a.'precnsim <plug>\precnsim ' +exe s:pA4a.'precnapprox <plug>\precnapprox ' +exe s:pA4a.'notin <plug>\notin ' +exe s:pA4a.'nsubseteq <plug>\nsubseteq ' +exe s:pA4a.'varsubsetneq <plug>\varsubsetneq ' +exe s:pA4a.'subsetneq <plug>\subsetneq ' +exe s:pA4a.'nsubseteqq <plug>\nsubseteqq ' +exe s:pA4a.'varsubsetneqq <plug>\varsubsetneqq ' +exe s:pA4a.'subsetneqq <plug>\subsetneqq ' +exe s:pA4a.'nparallel <plug>\nparallel ' +exe s:pA4a.'nshortparallel <plug>\nshortparallel ' +exe s:pA4a.'nvdash <plug>\nvdash ' +exe s:pA4a.'nvDash <plug>\nvDash ' +" }}} +" BinaryRel2 {{{ +let s:pA5 = s:pA."&BinaryRel2." +exe s:pA5.'gg <plug>\gg ' +exe s:pA5.'ggg <plug>\ggg ' +exe s:pA5.'gggtr <plug>\gggtr ' +exe s:pA5.'geqslant <plug>\geqslant ' +exe s:pA5.'geq <plug>\geq ' +exe s:pA5.'geqq <plug>\geqq ' +exe s:pA5.'eqslantgtr <plug>\eqslantgtr ' +exe s:pA5.'gtrdot <plug>\gtrdot ' +exe s:pA5.'succ <plug>\succ ' +exe s:pA5.'succeq <plug>\succeq ' +exe s:pA5.'succcurlyeq <plug>\succcurlyeq ' +exe s:pA5.'curlyeqsucc <plug>\curlyeqsucc ' +exe s:pA5.'gtrsim <plug>\gtrsim ' +exe s:pA5.'gtrapprox <plug>\gtrapprox ' +exe s:pA5.'succsim <plug>\succsim ' +exe s:pA5.'succapprox <plug>\succapprox ' +exe s:pA5.'ni <plug>\ni ' +exe s:pA5.'owns <plug>\owns ' +exe s:pA5.'supset <plug>\supset ' +exe s:pA5.'Supset <plug>\Supset ' +exe s:pA5.'supseteq <plug>\supseteq ' +exe s:pA5.'supseteqq <plug>\supseteqq ' +exe s:pA5.'sqsupset <plug>\sqsupset ' +exe s:pA5.'sqsupseteq <plug>\sqsupseteq ' +exe s:pA5.'frown <plug>\frown ' +exe s:pA5.'smallfrown <plug>\smallfrown ' +exe s:pA5.'mid <plug>\mid ' +exe s:pA5.'shortmid <plug>\shortmid ' +exe s:pA5.'between <plug>\between ' +exe s:pA5.'Vdash <plug>\Vdash ' +exe s:pA5.'bowtie <plug>\bowtie ' +exe s:pA5.'Join <plug>\Join ' +exe s:pA5.'pitchfork <plug>\pitchfork ' +" }}} +" {{{ nBinaryRel2 +let s:pA5a = s:pA."n&BinaryRel2." "TODO: dorobiæ logarytmy +exe s:pA5a.'ngtr <plug>\ngtr ' +exe s:pA5a.'ngeqslant <plug>\ngeqslant ' +exe s:pA5a.'ngeq <plug>\ngeq ' +exe s:pA5a.'gneq <plug>\gneq ' +exe s:pA5a.'ngeqq <plug>\ngeqq ' +exe s:pA5a.'gneqq <plug>\gneqq ' +exe s:pA5a.'nsucc <plug>\nsucc ' +exe s:pA5a.'nsucceq <plug>\nsucceq ' +exe s:pA5a.'succneqq <plug>\succneqq ' +exe s:pA5a.'gnsim <plug>\gnsim ' +exe s:pA5a.'gnapprox <plug>\gnapprox ' +exe s:pA5a.'succnsim <plug>\succnsim ' +exe s:pA5a.'succnapprox <plug>\succnapprox ' +exe s:pA5a.'nsupseteq <plug>\nsupseteq ' +exe s:pA5a.'varsupsetneq <plug>\varsupsetneq ' +exe s:pA5a.'supsetneq <plug>\supsetneq ' +exe s:pA5a.'nsupseteqq <plug>\nsupseteqq ' +exe s:pA5a.'varsupsetneqq <plug>\varsupsetneqq ' +exe s:pA5a.'supsetneqq <plug>\supsetneqq ' +exe s:pA5a.'nmid <plug>\nmid ' +exe s:pA5a.'nshortmid <plug>\nshortmid ' +exe s:pA5a.'nVdash <plug>\nVdash ' +" }}} +" {{{ BinaryRel3 +let s:pA6 = s:pA."&BinaryRel3." +exe s:pA6.'doteq <plug>\doteq ' +exe s:pA6.'circeq <plug>\circeq ' +exe s:pA6.'eqcirc <plug>\eqcirc ' +exe s:pA6.'risingdotseq <plug>\risingdotseq ' +exe s:pA6.'doteqdot <plug>\doteqdot ' +exe s:pA6.'Doteq <plug>\Doteq ' +exe s:pA6.'fallingdotseq <plug>\fallingdotseq ' +exe s:pA6.'triangleq <plug>\triangleq ' +exe s:pA6.'bumpeq <plug>\bumpeq ' +exe s:pA6.'Bumpeq <plug>\Bumpeq ' +exe s:pA6.'equiv<Tab>`= <plug>\equiv ' +exe s:pA6.'sim <plug>\sim ' +exe s:pA6.'thicksim <plug>\thicksim ' +exe s:pA6.'backsim <plug>\backsim ' +exe s:pA6.'simeq <plug>\simeq ' +exe s:pA6.'backsimeq <plug>\backsimeq ' +exe s:pA6.'cong <plug>\cong ' +exe s:pA6.'approx<tab>=~ <plug>\approx ' +exe s:pA6.'thickapprox <plug>\thickapprox ' +exe s:pA6.'approxeq <plug>\approxeq ' +exe s:pA6.'blacktriangleleft <plug>\blacktriangleleft ' +exe s:pA6.'vartriangleleft <plug>\vartriangleleft ' +exe s:pA6.'trianglelefteq <plug>\trianglelefteq ' +exe s:pA6.'blacktriangleright <plug>\blacktriangleright ' +exe s:pA6.'vartriangleright <plug>\vartriangleright ' +exe s:pA6.'trianglerighteq <plug>\trianglerighteq ' +exe s:pA6.'perp <plug>\perp ' +exe s:pA6.'asymp <plug>\asymp ' +exe s:pA6.'Vvdash <plug>\Vvdash ' +exe s:pA6.'propto <plug>\propto ' +exe s:pA6.'varpropto <plug>\varpropto ' +exe s:pA6.'because <plug>\because ' +" }}} +" {{{ nBinaryRel3 +let s:pA6a = s:pA."&nBinaryRel3." +exe s:pA6a.'neq <plug>\neq ' +exe s:pA6a.'nsim <plug>\nsim ' +exe s:pA6a.'ncong <plug>\ncong ' +exe s:pA6a.'ntriangleleft <plug>\ntriangleleft ' +exe s:pA6a.'ntrianglelefteq <plug>\ntrianglelefteq ' +exe s:pA6a.'ntriangleright <plug>\ntriangleright ' +exe s:pA6a.'ntrianglerighteq <plug>\ntrianglerighteq ' +" }}} +" {{{ BinaryRel4 +let s:pA7 = s:pA."&BinaryRel4." +exe s:pA7.'lessgtr <plug>\lessgtr ' +exe s:pA7.'gtrless <plug>\gtrless ' +exe s:pA7.'lesseqgtr <plug>\lesseqgtr ' +exe s:pA7.'gtreqless <plug>\gtreqless ' +exe s:pA7.'lesseqqgtr <plug>\lesseqqgtr ' +exe s:pA7.'gtreqqless <plug>\gtreqqless ' +" }}} +" {{{ BigOp +let s:pA8a = s:pA."&BigOp." +exe s:pA8a.'limits <plug>\limits' +exe s:pA8a.'nolimits <plug>\nolimits' +exe s:pA8a.'displaylimits <plug>\displaylimits' +exe s:pA8a.'-seplimits- :' +exe s:pA8a.'bigcap<Tab>`- <plug>\bigcap' +exe s:pA8a.'bigcup<Tab>`+ <plug>\bigcup' +exe s:pA8a.'bigodot <plug>\bigodot' +exe s:pA8a.'bigoplus <plug>\bigoplus' +exe s:pA8a.'bigotimes <plug>\bigotimes' +exe s:pA8a.'bigsqcup <plug>\bigsqcup' +exe s:pA8a.'biguplus <plug>\biguplus' +exe s:pA8a.'bigvee <plug>\bigvee' +exe s:pA8a.'bigwedge <plug>\bigwedge' +exe s:pA8a.'coprod <plug>\coprod' +exe s:pA8a.'int <plug>\int' +exe s:pA8a.'oint <plug>\oint' +exe s:pA8a.'prod <plug>\prod' +exe s:pA8a.'sum <plug>\sum' +" }}} +" {{{ BinaryOp +let s:pA8 = s:pA."&BinaryOp." +exe s:pA8.'pm <plug>\pm ' +exe s:pA8.'mp <plug>\mp ' +exe s:pA8.'dotplus <plug>\dotplus ' +exe s:pA8.'cdot<Tab>`. <plug>\cdot ' +exe s:pA8.'centerdot <plug>\centerdot ' +exe s:pA8.'times<Tab>`* <plug>\times ' +exe s:pA8.'ltimes <plug>\ltimes ' +exe s:pA8.'rtimes <plug>\rtimes ' +exe s:pA8.'leftthreetimes <plug>\leftthreetimes ' +exe s:pA8.'rightthreetimes <plug>\rightthreetimes ' +exe s:pA8.'div <plug>\div ' +exe s:pA8.'divideontimes <plug>\divideontimes ' +exe s:pA8.'bmod <plug>\bmod ' +exe s:pA8.'ast <plug>\ast ' +exe s:pA8.'star <plug>\star ' +exe s:pA8.'setminus<Tab>`\\ <plug>\setminus ' +exe s:pA8.'smallsetminus <plug>\smallsetminus ' +exe s:pA8.'diamond <plug>\diamond ' +exe s:pA8.'wr <plug>\wr ' +exe s:pA8.'intercal <plug>\intercal ' +exe s:pA8.'circ<Tab>`@ <plug>\circ ' +exe s:pA8.'bigcirc <plug>\bigcirc ' +exe s:pA8.'bullet <plug>\bullet ' +exe s:pA8.'cap <plug>\cap ' +exe s:pA8.'Cap <plug>\Cap ' +exe s:pA8.'cup <plug>\cup ' +exe s:pA8.'Cup <plug>\Cup ' +exe s:pA8.'sqcap <plug>\sqcap ' +exe s:pA8.'sqcup <plug>\sqcup' +exe s:pA8.'amalg <plug>\amalg ' +exe s:pA8.'uplus <plug>\uplus ' +exe s:pA8.'triangleleft <plug>\triangleleft ' +exe s:pA8.'triangleright <plug>\triangleright ' +exe s:pA8.'bigtriangleup <plug>\bigtriangleup ' +exe s:pA8.'bigtriangledown <plug>\bigtriangledown ' +exe s:pA8.'vee <plug>\vee ' +exe s:pA8.'veebar <plug>\veebar ' +exe s:pA8.'curlyvee <plug>\curlyvee ' +exe s:pA8.'wedge<Tab>`& <plug>\wedge ' +exe s:pA8.'barwedge <plug>\barwedge ' +exe s:pA8.'doublebarwedge <plug>\doublebarwedge ' +exe s:pA8.'curlywedge <plug>\curlywedge ' +exe s:pA8.'oplus <plug>\oplus ' +exe s:pA8.'ominus <plug>\ominus ' +exe s:pA8.'otimes <plug>\otimes ' +exe s:pA8.'oslash <plug>\oslash ' +exe s:pA8.'boxplus <plug>\boxplus ' +exe s:pA8.'boxminus <plug>\boxminus ' +exe s:pA8.'boxtimes <plug>\boxtimes ' +exe s:pA8.'boxdot <plug>\boxdot ' +exe s:pA8.'odot <plug>\odot ' +exe s:pA8.'circledast <plug>\circledast ' +exe s:pA8.'circleddash <plug>\circleddash ' +exe s:pA8.'circledcirc <plug>\circledcirc ' +exe s:pA8.'dagger <plug>\dagger ' +exe s:pA8.'ddagger <plug>\ddagger ' +exe s:pA8.'lhd <plug>\lhd ' +exe s:pA8.'unlhd <plug>\unlhd ' +exe s:pA8.'rhd <plug>\rhd ' +exe s:pA8.'unrhd <plug>\unrhd ' +" }}} +" {{{ Other1 +let s:pA9 = s:pA."&Other1." +exe s:pA9.'hat <plug>\hat ' +exe s:pA9.'check <plug>\check ' +exe s:pA9.'grave <plug>\grave ' +exe s:pA9.'acute <plug>\acute ' +exe s:pA9.'dot <plug>\dot ' +exe s:pA9.'ddot <plug>\ddot ' +exe s:pA9.'tilde<Tab>`, <plug>\tilde ' +exe s:pA9.'breve <plug>\breve ' +exe s:pA9.'bar <plug>\bar ' +exe s:pA9.'vec <plug>\vec ' +exe s:pA9.'aleph <plug>\aleph ' +exe s:pA9.'hbar <plug>\hbar ' +exe s:pA9.'imath <plug>\imath ' +exe s:pA9.'jmath <plug>\jmath ' +exe s:pA9.'ell <plug>\ell ' +exe s:pA9.'wp <plug>\wp ' +exe s:pA9.'Re <plug>\Re ' +exe s:pA9.'Im <plug>\Im ' +exe s:pA9.'partial <plug>\partial ' +exe s:pA9.'infty<Tab>`8 <plug>\infty ' +exe s:pA9.'prime <plug>\prime ' +exe s:pA9.'emptyset <plug>\emptyset ' +exe s:pA9.'nabla <plug>\nabla ' +exe s:pA9.'surd <plug>\surd ' +exe s:pA9.'top <plug>\top ' +exe s:pA9.'bot <plug>\bot ' +exe s:pA9.'angle <plug>\angle ' +exe s:pA9.'triangle <plug>\triangle ' +exe s:pA9.'backslash <plug>\backslash ' +exe s:pA9.'forall <plug>\forall ' +exe s:pA9.'exists <plug>\exists ' +exe s:pA9.'neg <plug>\neg ' +exe s:pA9.'flat <plug>\flat ' +exe s:pA9.'natural <plug>\natural ' +exe s:pA9.'sharp <plug>\sharp ' +exe s:pA9.'clubsuit <plug>\clubsuit ' +exe s:pA9.'diamondsuit <plug>\diamondsuit ' +exe s:pA9.'heartsuit <plug>\heartsuit ' +exe s:pA9.'spadesuit <plug>\spadesuit ' +exe s:pA9.'S <plug>\S ' +exe s:pA9.'P <plug>\P' +" }}} +" {{{ MathCreating +let s:pA10 = s:pA."&MathCreating." +exe s:pA10.'not <plug>\not' +exe s:pA10.'mkern <plug>\mkern' +exe s:pA10.'mathbin <plug>\mathbin' +exe s:pA10.'mathrel <plug>\mathrel' +exe s:pA10.'stackrel <plug>\stackrel' +exe s:pA10.'mathord <plug>\mathord' +" }}} +" {{{ Styles +let s:pA11 = s:pA."&Styles." +exe s:pA11.'displaystyle <plug>\displaystyle' +exe s:pA11.'textstyle <plug>\textstyle' +exe s:pA11.'scritpstyle <plug>\scritpstyle' +exe s:pA11.'scriptscriptstyle <plug>\scriptscriptstyle' +" }}} +" {{{ MathDiacritics +let s:pA12 = s:pA."&MathDiacritics." +exe s:pA12.'acute{} <plug><C-r>=IMAP_PutTextWithMovement("\\acute{<++>}<++>")<cr>' +exe s:pA12.'bar{}<Tab>`_ <plug><C-r>=IMAP_PutTextWithMovement("\\bar{<++>}<++>")<cr>' +exe s:pA12.'breve{} <plug><C-r>=IMAP_PutTextWithMovement("\\breve{<++>}<++>")<cr>' +exe s:pA12.'check{} <plug><C-r>=IMAP_PutTextWithMovement("\\check{<++>}<++>")<cr>' +exe s:pA12.'ddot{}<Tab>`: <plug><C-r>=IMAP_PutTextWithMovement("\\ddot{<++>}<++>")<cr>' +exe s:pA12.'dot{}<Tab>`; <plug><C-r>=IMAP_PutTextWithMovement("\\dot{<++>}<++>")<cr>' +exe s:pA12.'grave{} <plug><C-r>=IMAP_PutTextWithMovement("\\grave{<++>}<++>")<cr>' +exe s:pA12.'hat{}<Tab>`^ <plug><C-r>=IMAP_PutTextWithMovement("\\hat{<++>}<++>")<cr>' +exe s:pA12.'tilde{}<tab>`~ <plug><C-r>=IMAP_PutTextWithMovement("\\tilde{<++>}<++>")<cr>' +exe s:pA12.'vec{} <plug><C-r>=IMAP_PutTextWithMovement("\\vec{<++>}<++>")<cr>' +exe s:pA12.'widehat{} <plug><C-r>=IMAP_PutTextWithMovement("\\widehat{<++>}<++>")<cr>' +exe s:pA12.'widetilde{} <plug><C-r>=IMAP_PutTextWithMovement("\\widetilde{<++>}<++>")<cr>' +exe s:pA12.'imath <plug><C-r>=IMAP_PutTextWithMovement("\\imath")<cr>' +exe s:pA12.'jmath <plug><C-r>=IMAP_PutTextWithMovement("\\jmath")<cr>' +" }}} +" {{{ OverlineAndCo +let s:pA13 = s:pA."&OverlineAndCo." +exe s:pA13.'overline{} <plug><C-r>=IMAP_PutTextWithMovement("\\overline{}")<cr>' +exe s:pA13.'underline{} <plug><C-r>=IMAP_PutTextWithMovement("\\underline{}")<cr>' +exe s:pA13.'overrightarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overrightarrow{}")<cr>' +exe s:pA13.'overleftarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overleftarrow{}")<cr>' +exe s:pA13.'overbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\overbrace{}")<cr>' +exe s:pA13.'underbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\underbrace{}")<cr>' +" }}} +" {{{ Symbols1 +let s:pA14a = s:pA."&Symbols1." +exe s:pA14a.'forall <plug>\forall ' +exe s:pA14a.'exists <plug>\exists ' +exe s:pA14a.'nexists <plug>\nexists ' +exe s:pA14a.'neg <plug>\neg ' +exe s:pA14a.'top <plug>\top ' +exe s:pA14a.'bot <plug>\bot ' +exe s:pA14a.'emptyset <plug>\emptyset ' +exe s:pA14a.'varnothing <plug>\varnothing ' +exe s:pA14a.'infty <plug>\infty ' +exe s:pA14a.'aleph <plug>\aleph ' +exe s:pA14a.'beth <plug>\beth ' +exe s:pA14a.'gimel <plug>\gimel ' +exe s:pA14a.'daleth <plug>\daleth ' +exe s:pA14a.'hbar <plug>\hbar ' +exe s:pA14a.'hslash <plug>\hslash ' +exe s:pA14a.'diagup <plug>\diagup ' +exe s:pA14a.'vert <plug>\vert ' +exe s:pA14a.'Vert <plug>\Vert ' +exe s:pA14a.'backslash <plug>\backslash ' +exe s:pA14a.'diagdown <plug>\diagdown ' +exe s:pA14a.'Bbbk <plug>\Bbbk ' +exe s:pA14a.'P <plug>\P ' +exe s:pA14a.'S <plug>\S ' +" }}} +" {{{ Symbols2 +let s:pA14b = s:pA."&Symbols2." +exe s:pA14b.'# <plug>\# ' +exe s:pA14b.'% <plug>\% ' +exe s:pA14b.'_ <plug>\_ ' +exe s:pA14b.'$ <plug>\$ ' +exe s:pA14b.'& <plug>\& ' +exe s:pA14b.'imath <plug>\imath ' +exe s:pA14b.'jmath <plug>\jmath ' +exe s:pA14b.'ell <plug>\ell ' +exe s:pA14b.'wp <plug>\wp ' +exe s:pA14b.'Re <plug>\Re ' +exe s:pA14b.'Im <plug>\Im ' +exe s:pA14b.'prime <plug>\prime ' +exe s:pA14b.'backprime <plug>\backprime ' +exe s:pA14b.'nabla <plug>\nabla ' +exe s:pA14b.'surd <plug>\surd ' +exe s:pA14b.'flat <plug>\flat ' +exe s:pA14b.'sharp <plug>\sharp ' +exe s:pA14b.'natural <plug>\natural ' +exe s:pA14b.'eth <plug>\eth ' +exe s:pA14b.'bigstar <plug>\bigstar ' +exe s:pA14b.'circledS <plug>\circledS ' +exe s:pA14b.'Finv <plug>\Finv ' +exe s:pA14b.'dag <plug>\dag ' +exe s:pA14b.'ddag <plug>\ddag ' +" }}} +" {{{ Symbols3 +let s:pA14c = s:pA."&Symbols3." +exe s:pA14c.'angle <plug>\angle ' +exe s:pA14c.'measuredangle <plug>\measuredangle ' +exe s:pA14c.'sphericalangle <plug>\sphericalangle ' +exe s:pA14c.'spadesuit <plug>\spadesuit ' +exe s:pA14c.'heartsuit <plug>\heartsuit ' +exe s:pA14c.'diamondsuit <plug>\diamondsuit ' +exe s:pA14c.'clubsuit <plug>\clubsuit ' +exe s:pA14c.'lozenge <plug>\lozenge ' +exe s:pA14c.'blacklozenge <plug>\blacklozenge ' +exe s:pA14c.'Diamond <plug>\Diamond ' +exe s:pA14c.'triangle <plug>\triangle ' +exe s:pA14c.'vartriangle <plug>\vartriangle ' +exe s:pA14c.'blacktriangle <plug>\blacktriangle ' +exe s:pA14c.'triangledown <plug>\triangledown ' +exe s:pA14c.'blacktriangledown <plug>\blacktriangledown ' +exe s:pA14c.'Box <plug>\Box ' +exe s:pA14c.'square <plug>\square ' +exe s:pA14c.'blacksquare <plug>\blacksquare ' +exe s:pA14c.'complement <plug>\complement ' +exe s:pA14c.'mho <plug>\mho ' +exe s:pA14c.'Game <plug>\Game ' +exe s:pA14c.'partial<Tab>`6 <plug>\partial ' +exe s:pA14c.'smallint <plug>\smallint ' +" }}} +" {{{ Logic +let s:pA15 = s:pA."&Logic." +exe s:pA15.'lnot <plug>\lnot ' +exe s:pA15.'lor <plug>\lor ' +exe s:pA15.'land <plug>\land ' +" }}} +" {{{ Limits1 +let s:pA16 = s:pA."&Limits1." +exe s:pA16.'left <plug>\left' +exe s:pA16.'right <plug>\right' +exe s:pA16.'-sepbigl- :' +exe s:pA16.'bigl <plug>\bigl' +exe s:pA16.'Bigl <plug>\Bigl' +exe s:pA16.'biggl <plug>\biggl' +exe s:pA16.'Biggl <plug>\Biggl' +exe s:pA16.'-sepbigr- :' +exe s:pA16.'bigr <plug>\bigr' +exe s:pA16.'Bigr <plug>\Bigr' +exe s:pA16.'biggr <plug>\biggr' +exe s:pA16.'Biggr <plug>\Biggr' +exe s:pA16.'-sepbig- :' +exe s:pA16.'big <plug>\big' +exe s:pA16.'bigm <plug>\bigm' +exe s:pA16.'-sepfloor- :' +exe s:pA16.'lfloor <plug>\lfloor ' +exe s:pA16.'lceil <plug>\lceil ' +exe s:pA16.'rfloor <plug>\rfloor ' +exe s:pA16.'rceil <plug>\rceil ' +exe s:pA16.'-sepangle- :' +exe s:pA16.'langle <plug>\langle ' +exe s:pA16.'rangle <plug>\rangle ' +" }}} +" {{{ Limits2 +let s:pA16a = s:pA."&Limits2." +exe s:pA16a.'ulcorner <plug>\ulcorner ' +exe s:pA16a.'urcorner <plug>\urcorner ' +exe s:pA16a.'llcorner <plug>\llcorner ' +exe s:pA16a.'rlcorner <plug>\rlcorner ' +exe s:pA16a.'-sepcorner- :' +exe s:pA16a.'vert <plug>\vert ' +exe s:pA16a.'Vert <plug>\Vert ' +exe s:pA16a.'lvert <plug>\lvert ' +exe s:pA16a.'lVert <plug>\lVert ' +exe s:pA16a.'rvert <plug>\rvert ' +exe s:pA16a.'rVert <plug>\rVert ' +exe s:pA16a.'uparrow <plug>\uparrow ' +exe s:pA16a.'Uparrow <plug>\Uparrow ' +exe s:pA16a.'downarrow <plug>\downarrow ' +exe s:pA16a.'Downarrow <plug>\Downarrow ' +exe s:pA16a.'updownarrow <plug>\updownarrow ' +exe s:pA16a.'Updownarrow <plug>\Updownarrow ' +exe s:pA16a.'lgroup <plug>\lgroup ' +exe s:pA16a.'rgroup <plug>\rgroup ' +exe s:pA16a.'lmoustache <plug>\lmoustache ' +exe s:pA16a.'rmoustache <plug>\rmoustache ' +exe s:pA16a.'arrowvert <plug>\arrowvert ' +exe s:pA16a.'Arrowvert <plug>\Arrowvert ' +exe s:pA16a.'bracevert <plug>\bracevert ' +" }}} +" {{{ Log-likes +let s:pA17 = s:pA."Lo&g-likes." +exe s:pA17.'arccos <plug>\arccos ' +exe s:pA17.'arcsin <plug>\arcsin ' +exe s:pA17.'arctan <plug>\arctan ' +exe s:pA17.'arg <plug>\arg ' +exe s:pA17.'cos <plug>\cos ' +exe s:pA17.'cosh <plug>\cosh ' +exe s:pA17.'cot <plug>\cot ' +exe s:pA17.'coth <plug>\coth ' +exe s:pA17.'csc <plug>\csc ' +exe s:pA17.'deg <plug>\deg ' +exe s:pA17.'det <plug>\det ' +exe s:pA17.'dim <plug>\dim ' +exe s:pA17.'exp <plug>\exp ' +exe s:pA17.'gcd <plug>\gcd ' +exe s:pA17.'hom <plug>\hom ' +exe s:pA17.'inf <plug>\inf ' +exe s:pA17.'injlim <plug>\injlim ' +exe s:pA17.'ker <plug>\ker ' +exe s:pA17.'lg <plug>\lg ' +exe s:pA17.'lim <plug>\lim ' +exe s:pA17.'liminf <plug>\liminf ' +exe s:pA17.'limsup <plug>\limsup ' +exe s:pA17.'ln <plug>\ln ' +exe s:pA17.'log <plug>\log ' +exe s:pA17.'max <plug>\max ' +exe s:pA17.'min <plug>\min ' +exe s:pA17.'Pr <plug>\Pr ' +exe s:pA17.'projlim <plug>\projlim ' +exe s:pA17.'sec <plug>\sec ' +exe s:pA17.'sin <plug>\sin ' +exe s:pA17.'sinh <plug>\sinh ' +exe s:pA17.'sup <plug>\sup ' +exe s:pA17.'tan <plug>\tan ' +exe s:pA17.'tanh <plug>\tanh ' +exe s:pA17.'varlimsup <plug>\varlimsup ' +exe s:pA17.'varliminf <plug>\varliminf ' +exe s:pA17.'varinjlim <plug>\varinjlim ' +exe s:pA17.'varprojlim <plug>\varprojlim ' +" }}} +" {{{ MathSpacing +let s:pA18 = s:pA."MathSpacing." +exe s:pA18.', <plug>\, ' +exe s:pA18.': <plug>\: ' +exe s:pA18.'; <plug>\; ' +exe s:pA18.'[space] <plug>\ ' +exe s:pA18.'quad <plug>\quad ' +exe s:pA18.'qquad <plug>\qquad ' +exe s:pA18.'! <plug>\! ' +exe s:pA18.'thinspace <plug>\thinspace ' +exe s:pA18.'medspace <plug>\medspace ' +exe s:pA18.'thickspace <plug>\thickspace ' +exe s:pA18.'negthinspace <plug>\negthinspace ' +exe s:pA18.'negmedspace <plug>\negmedspace ' +exe s:pA18.'negthickspace <plug>\negthickspace ' +" 1}}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/multicompile.vim b/dot_vim/ftplugin/latex-suite/multicompile.vim new file mode 100644 index 0000000..f5598cc --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/multicompile.vim @@ -0,0 +1,17 @@ +" ============================================================================ +" File: multicompile.vim +" Author: Srinath Avadhanula +" Created: Sat Jul 05 03:00 PM 2003 +" Description: compile a .tex file multiple times to get cross references +" right. +" License: Vim Charityware License +" Part of vim-latexSuite: http://vim-latex.sourceforge.net +" CVS: $Id: multicompile.vim 997 2006-03-20 09:45:45Z srinathava $ +" ============================================================================ + +" The contents of this file have been moved to compiler.vim, the file which +" contains all functions relevant to compiling and viewing. +" This file is kept empty on purpose so that it will over-write previous +" versions of multicompile.vim, therby preventing conflicts. + +" vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/outline.py b/dot_vim/ftplugin/latex-suite/outline.py new file mode 100644 index 0000000..7bb6896 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/outline.py @@ -0,0 +1,186 @@ +#!/usr/bin/python + +# Part of Latex-Suite +# +# Copyright: Srinath Avadhanula +# Description: +# This file implements a simple outline creation for latex documents. + +import re +import os +import sys +import StringIO + +# getFileContents {{{ +def getFileContents(argin, ext=''): + if type(argin) is str: + fname = argin + ext + else: + fname = argin.group(3) + ext + + # This longish thing is to make sure that all files are converted into + # \n seperated lines. + contents = '\n'.join(open(fname).read().splitlines()) + + # TODO what are all the ways in which a tex file can include another? + pat = re.compile(r'^\\(@?)(include|input){(.*?)}', re.M) + contents = re.sub(pat, lambda input: getFileContents(input, ext), contents) + + return ('%%==== FILENAME: %s' % fname) + '\n' + contents + +# }}} +# stripComments {{{ +def stripComments(contents): + # remove all comments except those of the form + # %%==== FILENAME: <filename.tex> + uncomm = [re.sub('%(?!==== FILENAME: ).*', '', line) for line in contents.splitlines()] + # also remove all only-whitespace lines. + nonempty = [line for line in uncomm if line.strip()] + + return nonempty +# }}} +# addFileNameAndNumber {{{ +def addFileNameAndNumber(lines): + filename = '' + retval = '' + for line in lines: + if re.match('%==== FILENAME: ', line): + filename = line.split('%==== FILENAME: ')[1] + else: + retval += '<%s>%s\n' % (filename, line) + + return retval +# }}} +# getSectionLabels_Root {{{ +def getSectionLabels_Root(lineinfo, section_prefix, label_prefix): + prev_txt = '' + inside_env = 0 + prev_env = '' + outstr = StringIO.StringIO('') + pres_depth = len(section_prefix) + + #print '+getSectionLabels_Root: lineinfo = [%s]' % lineinfo + for line in lineinfo.splitlines(): + if not line: + continue + + # throw away leading white-space + m = re.search('<(.*?)>(.*)', line) + + fname = m.group(1) + line = m.group(2).lstrip() + + # we found a label! + m = re.search(r'\\label{(%s.*?)}' % label_prefix, line) + if m: + # add the current line (except the \label command) to the text + # which will be displayed below this label + prev_txt += re.search(r'(^.*?)\\label{', line).group(1) + + # for the figure environment however, just display the caption. + # instead of everything since the \begin command. + if prev_env == 'figure': + cm = re.search(r'\caption(\[.*?\]\s*)?{(.*?)}', prev_txt) + if cm: + prev_txt = cm.group(2) + + # print a nice formatted text entry like so + # + # > eqn:label + # : e^{i\pi} + 1 = 0 + # + # Use the current "section depth" for the leading indentation. + print >>outstr, '>%s%s\t\t<%s>' % (' '*(2*pres_depth+2), + m.group(1), fname) + print >>outstr, ':%s%s' % (' '*(2*pres_depth+4), prev_txt) + prev_txt = '' + + # If we just encoutered the start or end of an environment or a + # label, then do not remember this line. + # NOTE: This assumes that there is no equation text on the same + # line as the \begin or \end command. The text on the same line as + # the \label was already handled. + if re.search(r'\\begin{(equation|eqnarray|align|figure)', line): + prev_txt = '' + prev_env = re.search(r'\\begin{(.*?)}', line).group(1) + inside_env = 1 + + elif re.search(r'\\label', line): + prev_txt = '' + + elif re.search(r'\\end{(equation|eqnarray|align|figure)', line): + inside_env = 0 + prev_env = '' + + else: + # If we are inside an environment, then the text displayed with + # the label is the complete text within the environment, + # otherwise its just the previous line. + if inside_env: + prev_txt += line + else: + prev_txt = line + + return outstr.getvalue() + +# }}} +# getSectionLabels {{{ +def getSectionLabels(lineinfo, + sectypes=['chapter', 'section', 'subsection', 'subsubsection'], + section_prefix='', label_prefix=''): + + if not sectypes: + return getSectionLabels_Root(lineinfo, section_prefix, label_prefix) + + ##print 'sectypes[0] = %s, section_prefix = [%s], lineinfo = [%s]' % ( + ## sectypes[0], section_prefix, lineinfo) + + sections = re.split(r'(<.*?>\\%s{.*})' % sectypes[0], lineinfo) + + # there will 1+2n sections, the first containing the "preamble" and the + # others containing the child sections as paris of [section_name, + # section_text] + + rettext = getSectionLabels(sections[0], sectypes[1:], section_prefix, label_prefix) + + for i in range(1,len(sections),2): + sec_num = (i+1)/2 + section_name = re.search(r'\\%s{(.*?)}' % sectypes[0], sections[i]).group(1) + section_label_text = getSectionLabels(sections[i] + sections[i+1], sectypes[1:], + section_prefix+('%d.' % sec_num), label_prefix) + + if section_label_text: + sec_heading = 2*' '*len(section_prefix) + section_prefix + sec_heading += '%d. %s' % (sec_num, section_name) + sec_heading += '<<<%d\n' % (len(section_prefix)/2+1) + + rettext += sec_heading + section_label_text + + return rettext + +# }}} + +# main {{{ +def main(fname, label_prefix): + [head, tail] = os.path.split(fname) + if head: + os.chdir(head) + + [root, ext] = os.path.splitext(tail) + contents = getFileContents(root, ext) + nonempty = stripComments(contents) + lineinfo = addFileNameAndNumber(nonempty) + + return getSectionLabels(lineinfo, label_prefix=label_prefix) +# }}} + +if __name__ == "__main__": + if len(sys.argv) > 2: + prefix = sys.argv[2] + else: + prefix = '' + + print main(sys.argv[1], prefix) + + +# vim: fdm=marker diff --git a/dot_vim/ftplugin/latex-suite/outline.pyc b/dot_vim/ftplugin/latex-suite/outline.pyc Binary files differnew file mode 100644 index 0000000..8049cdc --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/outline.pyc diff --git a/dot_vim/ftplugin/latex-suite/packages.vim b/dot_vim/ftplugin/latex-suite/packages.vim new file mode 100644 index 0000000..c3bf2b1 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages.vim @@ -0,0 +1,669 @@ +"============================================================================= +" File: packages.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" CVS: $Id: packages.vim 997 2006-03-20 09:45:45Z srinathava $ +" +" Description: handling packages from within vim +"============================================================================= + +" avoid reinclusion. +if !g:Tex_PackagesMenu || exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +let s:path = expand("<sfile>:p:h") + +let s:menu_div = 20 + +com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall(1) +com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall(1) + +" Custom command-line completion of Tcommands is very useful but this feature +" is available only in Vim 6.2 and above. Check number of version and choose +" proper command and function. +if v:version >= 602 + com! -complete=custom,Tex_CompletePackageName -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + + " Tex_CompletePackageName: for completing names in TPackage command {{{ + " Description: get list of package names with globpath(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompletePackageName(A,P,L) + " Get name of packages from all runtimepath directories + let packnames = Tex_FindInRtp('', 'packages') + let packnames = substitute(packnames, '^,', '', 'e') + " Separate names with \n not , + let packnames = substitute(packnames,',','\n','g') + return packnames + endfunction + " }}} + +else + com! -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + +endif + +imap <silent> <plug> <Nop> +nmap <silent> <plug> i + +let g:Tex_package_supported = '' +let g:Tex_package_detected = '' +" Remember the defaults because we want g:Tex_PromptedEnvironments to contain +" in addition to the default, \newenvironments, and the \newenvironments might +" change... +let g:Tex_PromptedEnvironmentsDefault = g:Tex_PromptedEnvironments +let g:Tex_PromptedCommandsDefault = g:Tex_PromptedCommands + + +" Tex_pack_check: creates the package menu and adds to 'dict' setting. {{{ +" +function! Tex_pack_check(package) + " Use Tex_FindInRtp() function to get first name from packages list in all + " rtp directories conforming with latex-suite directories hierarchy + " Store names in variables to process functions only once. + let packname = Tex_FindInRtp(a:package, 'packages') + if packname != '' + exe 'runtime! ftplugin/latex-suite/packages/' . a:package + if has("gui_running") + call Tex_pack(a:package) + endif + if g:Tex_package_supported !~ a:package + let g:Tex_package_supported = g:Tex_package_supported.','.a:package + endif + endif + " Return full list of dictionaries (separated with ,) for package in &rtp + call Tex_Debug("Tex_pack_check: searching for ".a:package." in dictionaries/ in &rtp", "pack") + let dictname = Tex_FindInRtp(a:package, 'dictionaries', ':p') + if dictname != '' + exe 'setlocal dict^=' . dictname + call Tex_Debug('Tex_pack_check: setlocal dict^=' . dictname, 'pack') + if g:Tex_package_supported !~ a:package + let g:Tex_package_supported = g:Tex_package_supported.','.a:package + endif + endif + if g:Tex_package_detected !~ '\<'.a:package.'\>' + let g:Tex_package_detected = g:Tex_package_detected.','.a:package + endif + let g:Tex_package_detected = substitute(g:Tex_package_detected, '^,', '', '') + let g:Tex_package_supported = substitute(g:Tex_package_supported, '^,', '', '') +endfunction + +" }}} +" Tex_pack_uncheck: removes package from menu and 'dict' settings. {{{ +function! Tex_pack_uncheck(package) + if has("gui_running") && Tex_FindInRtp(a:package, 'packages') != '' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.'-sep'.a:package.'-' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Options' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Commands' + endif + if Tex_FindInRtp(a:package, 'dictionaries') != '' + exe 'setlocal dict-='.Tex_FindInRtp(a:package, 'dictionaries') + endif +endfunction + +" }}} +" Tex_pack_updateall: updates the TeX-Packages menu {{{ +" Description: +" This function first calls Tex_pack_all to scan for \usepackage's etc if +" necessary. After that, it 'supports' and 'unsupports' packages as needed +" in such a way as to not repeat work. +function! Tex_pack_updateall(force) + call Tex_Debug('+Tex_pack_updateall', 'pack') + + " Find out which file we need to scan. + let fname = Tex_GetMainFileName(':p') + + " If this is the same as last time, don't repeat. + if !a:force && exists('s:lastScannedFile') && + \ s:lastScannedFile == fname + return + endif + " Remember which file we scanned for next time. + let s:lastScannedFile = fname + + " Remember which packages we detected last time. + if exists('g:Tex_package_detected') + let oldpackages = g:Tex_package_detected + else + let oldpackages = '' + endif + + " This sets up a global variable of all detected packages. + let g:Tex_package_detected = '' + " reset the environments and commands. + let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironmentsDefault + let g:Tex_PromptedCommands = g:Tex_PromptedCommandsDefault + + if expand('%:p') != fname + call Tex_Debug(':Tex_pack_updateall: sview '.Tex_EscapeSpaces(fname), 'pack') + exe 'sview '.Tex_EscapeSpaces(fname) + else + call Tex_Debug(':Tex_pack_updateall: split', 'pack') + split + endif + + call Tex_ScanForPackages() + q + + call Tex_Debug(':Tex_pack_updateall: detected ['.g:Tex_package_detected.'] in first run', 'pack') + + " Now for each package find out if this is a custom package and if so, + " scan that as well. We will use the ':find' command in vim to let vim + " search through the file paths for us. + " + " NOTE: This while loop will also take into account packages included + " within packages to any level of recursion as long as + " g:Tex_package_detected is always padded with new package names + " from the end. + " + " First set the &path setting to the user's TEXINPUTS setting. + let _path = &path + let _suffixesadd = &suffixesadd + + let &path = '.,'.g:Tex_TEXINPUTS + let &suffixesadd = '.sty,.tex' + + let scannedPackages = '' + + let i = 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + while packname != '' + + call Tex_Debug(':Tex_pack_updateall: scanning package '.packname, 'pack') + + " Scan this package only if we have not scanned it before in this + " run. + if scannedPackages =~ '\<'.packname.'\>' + let i = i + 1 + + call Tex_Debug(':Tex_pack_updateall: '.packname.' already scanned', 'pack') + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + continue + endif + + " Split this window in two. The packages/files being found will open + " in this new window and we also need not bother with files being + " modified etc. + split + + call Tex_Debug(':Tex_pack_updateall: silent! find '.Tex_EscapeSpaces(packname).'.sty', 'pack') + let thisbufnum = bufnr('%') + exec 'silent! find '.Tex_EscapeSpaces(packname).'.sty' + call Tex_Debug(':Tex_pack_updateall: present file = '.bufname('%'), 'pack') + + " If this file was not found, assume that it means its not a + " custom package and mark it "scanned". + " A package is not found if we stay in the same buffer as before and + " its not the one where we want to go. + if bufnr('%') == thisbufnum && bufnr('%') != bufnr(packname.'.sty') + let scannedPackages = scannedPackages.','.packname + q + + call Tex_Debug(':Tex_pack_updateall: '.packname.' not found anywhere', 'pack') + let i = i + 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + continue + endif + + " otherwise we are presently editing a custom package, scan it for + " more \usepackage lines from the first line to the last. + let packpath = expand('%:p') + let &complete = &complete.'s'.packpath + + call Tex_Debug(':Tex_pack_updateall: found custom package '.packpath, 'pack') + call Tex_ScanForPackages(line('$'), line('$')) + call Tex_Debug(':Tex_pack_updateall: After scanning, g:Tex_package_detected = '.g:Tex_package_detected, 'pack') + + let scannedPackages = scannedPackages.','.packname + " Do not use bwipe, but that leads to excessive buffer number + " consumption. Besides, its intuitive for a custom package to remain + " on the buffer list. + q + + let i = i + 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + endwhile + + let &path = _path + let &suffixesadd = _suffixesadd + + " Now only support packages we didn't last time. + " First remove packages which were used last time but are no longer used. + let i = 1 + let oldPackName = Tex_Strntok(oldpackages, ',', i) + while oldPackName != '' + if g:Tex_package_detected !~ oldPackName + call Tex_pack_uncheck(oldPackName) + endif + let i = i + 1 + let oldPackName = Tex_Strntok(oldpackages, ',', i) + endwhile + + " Then support packages which are used this time but weren't used last + " time. + let i = 1 + let newPackName = Tex_Strntok(g:Tex_package_detected, ',', i) + while newPackName != '' + if oldpackages !~ newPackName + call Tex_pack_one(newPackName) + endif + let i = i + 1 + let newPackName = Tex_Strntok(g:Tex_package_detected, ',', i) + endwhile + + " Throw an event that we are done scanning packages. Some packages might + " use this to change behavior based on which options have been used etc. + call Tex_Debug(":Tex_pack_updateall: throwing LatexSuiteScannedPackages event", "pack") + silent! do LatexSuite User LatexSuiteScannedPackages + + call Tex_Debug("-Tex_pack_updateall", "pack") +endfunction + +" }}} +" Tex_pack_one: supports each package in the argument list.{{{ +" Description: +" If no arguments are supplied, then the user is asked to choose from the +" packages found in the packages/ directory +function! Tex_pack_one(...) + if a:0 == 0 || (a:0 > 0 && a:1 == '') + let packlist = Tex_FindInRtp('', 'packages') + let packname = Tex_ChooseFromPrompt( + \ "Choose a package: \n" . + \ Tex_CreatePrompt(packlist, '3', ',') . + \ "\nEnter number or filename :", + \ packlist, ',') + if packname != '' + return Tex_pack_one(packname) + else + return '' + endif + else + " Support the packages supplied. This function can be called with + " multiple arguments in which case, support each of them in turn. + let retVal = '' + let omega = 1 + while omega <= a:0 + let packname = a:{omega} + if Tex_FindInRtp(packname, 'packages') != '' + call Tex_pack_check(packname) + if exists('g:TeX_package_option_'.packname) + \ && g:TeX_package_option_{packname} != '' + let retVal = retVal.'\usepackage[<++>]{'.packname.'}<++>' + else + let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>" + endif + else + let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>" + endif + let omega = omega + 1 + endwhile + return IMAP_PutTextWithMovement(substitute(retVal, "\<CR>$", '', ''), '<+', '+>') + endif +endfunction +" }}} +" Tex_ScanForPackages: scans the current file for \usepackage{} lines {{{ +" and if supported, loads the options and commands found in the +" corresponding package file. Also scans for \newenvironment and +" \newcommand lines and adds names to g:Tex_Prompted variables, they can be +" easy available through <F5> and <F7> shortcuts +function! Tex_ScanForPackages(...) + call Tex_Debug("+Tex_ScanForPackages", "pack") + + let pos = line('.').' | normal! '.virtcol('.').'|' + + " For package files without \begin and \end{document}, we might be told to + " search from beginning to end. + if a:0 < 2 + 0 + let beginline = search('\\begin{document}', 'W') + let endline = search('\\end{document}', 'W') + 0 + else + let beginline = a:1 + let endline = a:2 + endif + + call Tex_Debug(":Tex_ScanForPackages: Begining scans in [".bufname('%')."], beginline = ".beginline, "pack") + + + " Scan the file. First open up all the folds, because the command + " /somepattern + " issued in a closed fold _always_ goes to the first match. + let erm = v:errmsg + silent! normal! ggVGzO + let v:errmsg = erm + + call Tex_Debug(":Tex_ScanForPackages: beginning scan for \\usepackage lines", "pack") + " The wrap trick enables us to match \usepackage on the first line as + " well. + let wrap = 'w' + while search('^\s*\\usepackage\_.\{-}{\_.\+}', wrap) + let wrap = 'W' + + if line('.') > beginline + break + endif + + let saveA = @a + + " If there are options, then find those. + if getline('.') =~ '\\usepackage\[.\{-}\]' + let options = matchstr(getline('.'), '\\usepackage\[\zs.\{-}\ze\]') + elseif getline('.') =~ '\\usepackage\[' + " Entering here means that the user has split the \usepackage + " across newlines. Therefore, use yank. + exec "normal! /{\<CR>\"ayi}" + let options = @a + else + let options = '' + endif + + " The following statement puts the stuff between the { }'s of a + " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like + " because we can have things split across lines and such. + exec "normal! /{\<CR>\"ay/}\<CR>" + + " now remove all whitespace from @a. We need to remove \n and \r + " because we can encounter stuff like + " \usepackage{pack1, + " newpackonanotherline} + let @a = substitute(@a, "[ \t\n\r]", '', 'g') + + " Now we have something like pack1,pack2,pack3 with possibly commas + " and stuff before the first package and after the last package name. + " Remove those. + let @a = substitute(@a, '\(^\W*\|\W*$\)', '', 'g') + + " This gets us a string like 'pack1,pack2,pack3' + " TODO: This will contain duplicates if the user has duplicates. + " Should we bother taking care of this? + let g:Tex_package_detected = g:Tex_package_detected.','.@a + + " For each package found, form a global variable of the form + " g:Tex_{packagename}_options + " which contains a list of the options. + let j = 1 + while Tex_Strntok(@a, ',', j) != '' + let g:Tex_{Tex_Strntok(@a, ',', j)}_options = options + let j = j + 1 + endwhile + + " Finally convert @a into something like '"pack1","pack2"' + let @a = substitute(@a, '^\|$', '"', 'g') + let @a = substitute(@a, ',', '","', 'g') + + call Tex_Debug(":Tex_ScanForPackages: found package(s) [".@a."] on line ".line('.'), "pack") + + " restore @a + let @a = saveA + endwhile + call Tex_Debug(":Tex_ScanForPackages: End scan \\usepackage, detected packages = ".g:Tex_package_detected, "pack") + + " TODO: This needs to be changed. In the future, we might have + " functionality to remember the fold-state before opening up all the folds + " and then re-creating them. Use mkview.vim. + let erm = v:errmsg + silent! normal! ggVGzC + let v:errmsg = erm + + " Because creating list of detected packages gives string + " ',pack1,pack2,pack3' remove leading , + let g:Tex_package_detected = substitute(g:Tex_package_detected, '^,', '', '') + + call Tex_Debug(":Tex_ScanForPackages: Beginning scan for \\newcommand's", "pack") + " Scans whole file (up to \end{document}) for \newcommand and adds this + " commands to g:Tex_PromptedCommands variable, it is easily available + " through <F7> + 0 + while search('^\s*\\newcommand\*\?{.\{-}}', 'W') + + if line('.') > endline + break + endif + + let newcommand = matchstr(getline('.'), '\\newcommand\*\?{\\\zs.\{-}\ze}') + let g:Tex_PromptedCommands = g:Tex_PromptedCommands . ',' . newcommand + + endwhile + + " Scans whole file (up to \end{document}) for \newenvironment and adds this + " environments to g:Tex_PromptedEnvironments variable, it is easily available + " through <F5> + 0 + call Tex_Debug(":Tex_ScanForPackages: Beginning scan for \\newenvironment's", 'pack') + + while search('^\s*\\newenvironment\*\?{.\{-}}', 'W') + call Tex_Debug('found newenvironment on '.line('.'), 'pack') + + if line('.') > endline + break + endif + + let newenvironment = matchstr(getline('.'), '\\newenvironment\*\?{\zs.\{-}\ze}') + let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironments . ',' . newenvironment + + endwhile + + exe pos + " first make a random search so that we push at least one item onto the + " search history. Since vim puts only one item in the history per function + " call, this way we make sure that one and only item is put into the + " search history. + normal! /^<CR> + " now delete it... + call histdel('/', -1) + + call Tex_Debug("-Tex_ScanForPackages", "pack") +endfunction + +" }}} +" Tex_pack_supp_menu: sets up a menu for package files {{{ +" found in the packages directory groups the packages thus found into groups +" of 20... +function! Tex_pack_supp_menu() + let suplist = Tex_FindInRtp('', 'packages') + + call Tex_MakeSubmenu(suplist, g:Tex_PackagesMenuLocation.'Supported.', + \ '<plug><C-r>=Tex_pack_one("', '")<CR>') +endfunction + +" }}} +" Tex_pack: loads the options (and commands) for the given package {{{ +function! Tex_pack(pack) + if exists('g:TeX_package_'.a:pack) + + let optionList = g:TeX_package_option_{a:pack}.',' + let commandList = g:TeX_package_{a:pack}.',' + + " Don't create separator if in package file are only Vim commands. + " Rare but possible. + if !(commandList == ',' && optionList == ',') + exec 'amenu '.g:Tex_PackagesMenuLocation.'-sep'.a:pack.'- <Nop>' + endif + + if optionList != '' + + let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Options.' + call s:GroupPackageMenuItems(optionList, mainMenuName, + \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>') + + endif + + if commandList != '' + + let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Commands.' + call s:GroupPackageMenuItems(commandList, mainMenuName, + \ '<plug><C-r>=Tex_ProcessPackageCommand("', '")<CR>', + \ '<SID>FilterPackageMenuLHS') + endif + endif +endfunction + +" }}} + +" ============================================================================== +" Menu Functions +" Creating menu items for the all the package files found in the packages/ +" directory as well as creating menus for each supported package found in the +" preamble. +" ============================================================================== +" Tex_MakeSubmenu: makes a submenu given a list of items {{{ +" Description: +" This function takes a comma seperated list of menu items and creates a +" 'grouped' menu. i.e, it groups the items into s:menu_div items each and +" puts them in submenus of the given mainMenu. +" Each menu item is linked to the HandlerFunc. +" If an additional argument is supplied, then it is used to filter each of +" the menu items to generate better names for the menu display. +" +function! Tex_MakeSubmenu(menuList, mainMenuName, + \ handlerFuncLHS, handlerFuncRHS, ...) + + let extractFunction = (a:0 > 0 ? a:1 : '' ) + let menuList = substitute(a:menuList, '[^,]$', ',', '') + + let doneMenuSubmenu = 0 + + while menuList != '' + + " Extract upto s:menu_div menus at once. + let menuBunch = matchstr(menuList, '\v(.{-},){,'.s:menu_div.'}') + + " The remaining menus go into the list. + let menuList = strpart(menuList, strlen(menuBunch)) + + let submenu = '' + " If there is something remaining, then we got s:menu_div items. + " therefore put these menu items into a submenu. + if strlen(menuList) || doneMenuSubmenu + exec 'let firstMenu = '.extractFunction."(matchstr(menuBunch, '\\v^.{-}\\ze,'))" + exec 'let lastMenu = '.extractFunction."(matchstr(menuBunch, '\\v[^,]{-}\\ze,$'))" + + let submenu = firstMenu.'\ \-\ '.lastMenu.'.' + + let doneMenuSubmenu = 1 + endif + + " Now for each menu create a menu under the submenu + let i = 1 + let menuName = Tex_Strntok(menuBunch, ',', i) + while menuName != '' + exec 'let menuItem = '.extractFunction.'(menuName)' + execute 'amenu '.a:mainMenuName.submenu.menuItem + \ ' '.a:handlerFuncLHS.menuName.a:handlerFuncRHS + + let i = i + 1 + let menuName = Tex_Strntok(menuBunch, ',', i) + endwhile + endwhile +endfunction + +" }}} +" GroupPackageMenuItems: uses the sbr: to split menus into groups {{{ +" Description: +" This function first splits up the menuList into groups based on the +" special sbr: tag and then calls Tex_MakeSubmenu +" +function! <SID>GroupPackageMenuItems(menuList, menuName, + \ handlerFuncLHS, handlerFuncRHS,...) + + if a:0 > 0 + let extractFunction = a:1 + else + let extractFunction = '' + endif + let menuList = a:menuList + + while matchstr(menuList, 'sbr:') != '' + let groupName = matchstr(menuList, '\v^sbr:\zs.{-}\ze,') + let menuList = strpart(menuList, strlen('sbr:'.groupName.',')) + if matchstr(menuList, 'sbr:') != '' + let menuGroup = matchstr(menuList, '\v^.{-},\zesbr:') + else + let menuGroup = menuList + endif + + call Tex_MakeSubmenu(menuGroup, a:menuName.groupName.'.', + \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction) + + let menuList = strpart(menuList, strlen(menuGroup)) + endwhile + + call Tex_MakeSubmenu(menuList, a:menuName, + \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction) + +endfunction " }}} +" Definition of what to do for various package commands {{{ +let s:CommandSpec_bra = '\<+replace+>{<++>}<++>' +let s:CommandSpec_brs = '\<+replace+><++>' +let s:CommandSpec_brd = '\<+replace+>{<++>}{<++>}<++>' +let s:CommandSpec_env = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>' +let s:CommandSpec_ens = '\begin{<+replace+>}<+extra+>'."\<CR><++>\<CR>".'\end{<+replace+>}<++>' +let s:CommandSpec_eno = '\begin[<++>]{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}' +let s:CommandSpec_nor = '\<+replace+>' +let s:CommandSpec_noo = '\<+replace+>[<++>]' +let s:CommandSpec_nob = '\<+replace+>[<++>]{<++>}{<++>}<++>' +let s:CommandSpec_spe = '<+replace+>' +let s:CommandSpec_ = '\<+replace+>' + +let s:MenuLHS_bra = '\\&<+replace+>{}' +let s:MenuLHS_brs = '\\&<+replace+>{}' +let s:MenuLHS_brd = '\\&<+replace+>{}{}' +let s:MenuLHS_env = '&<+replace+>\ (E)' +let s:MenuLHS_ens = '&<+replace+>\ (E)' +let s:MenuLHS_eno = '&<+replace+>\ (E)' +let s:MenuLHS_nor = '\\&<+replace+>' +let s:MenuLHS_noo = '\\&<+replace+>[]' +let s:MenuLHS_nob = '\\&<+replace+>[]{}{}' +let s:MenuLHS_spe = '&<+replace+>' +let s:MenuLHS_sep = '-sep<+replace+>-' +let s:MenuLHS_ = '\\&<+replace+>' +" }}} +" Tex_ProcessPackageCommand: processes a command from the package menu {{{ +" Description: +function! Tex_ProcessPackageCommand(command) + if a:command =~ ':' + let commandType = matchstr(a:command, '^\w\+\ze:') + let commandName = matchstr(a:command, '^\w\+:\zs[^:]\+\ze:\?') + let extrapart = strpart(a:command, strlen(commandType.':'.commandName.':')) + else + let commandType = '' + let commandName = a:command + let extrapart = '' + endif + + let command = s:CommandSpec_{commandType} + let command = substitute(command, '<+replace+>', commandName, 'g') + let command = substitute(command, '<+extra+>', extrapart, 'g') + return IMAP_PutTextWithMovement(command) +endfunction +" }}} +" FilterPackageMenuLHS: filters the command description to provide a better menu item {{{ +" Description: +function! <SID>FilterPackageMenuLHS(command) + let commandType = matchstr(a:command, '^\w\+\ze:') + if commandType != '' + let commandName = strpart(a:command, strlen(commandType.':')) + else + let commandName = a:command + endif + + return substitute(s:MenuLHS_{commandType}, '<+replace+>', commandName, 'g') +endfunction " }}} + +if g:Tex_Menus + exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdatePackage :call Tex_pack(expand("<cword>"))<cr>' + exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdateAll :call Tex_pack_updateall(1)<cr>' + + call Tex_pack_supp_menu() +endif + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('packages.vim: Catching LatexSuiteFileType event', 'pack') | + \ call Tex_pack_updateall(0) +augroup END + +" vim:fdm=marker:ts=4:sw=4:noet:ff=unix diff --git a/dot_vim/ftplugin/latex-suite/packages/SIunits b/dot_vim/ftplugin/latex-suite/packages/SIunits new file mode 100644 index 0000000..ba110fa --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/SIunits @@ -0,0 +1,315 @@ +if exists("SIunits_package_file") + finish +endif +let SIunits_package_file = 1 + +let g:TeX_package_SIunits = +\'nor:addprefix,'. +\'nor:addunit,'. +\'nor:ampere,'. +\'nor:amperemetresecond,'. +\'nor:amperepermetre,'. +\'nor:amperepermetrenp,'. +\'nor:amperepersquaremetre,'. +\'nor:amperepersquaremetrenp,'. +\'nor:angstrom,'. +\'nor:arad,'. +\'nor:arcminute,'. +\'nor:arcsecond,'. +\'nor:are,'. +\'nor:atomicmass,'. +\'nor:atto,'. +\'nor:attod,'. +\'nor:barn,'. +\'nor:bbar,'. +\'nor:becquerel,'. +\'nor:becquerelbase,'. +\'nor:bel,'. +\'nor:candela,'. +\'nor:candelapersquaremetre,'. +\'nor:candelapersquaremetrenp,'. +\'nor:celsius,'. +\'nor:Celsius,'. +\'nor:celsiusbase,'. +\'nor:centi,'. +\'nor:centid,'. +\'nor:coulomb,'. +\'nor:coulombbase,'. +\'nor:coulombpercubicmetre,'. +\'nor:coulombpercubicmetrenp,'. +\'nor:coulombperkilogram,'. +\'nor:coulombperkilogramnp,'. +\'nor:coulombpermol,'. +\'nor:coulombpermolnp,'. +\'nor:coulombpersquaremetre,'. +\'nor:coulombpersquaremetrenp,'. +\'nor:cubed,'. +\'nor:cubic,'. +\'nor:cubicmetre,'. +\'nor:cubicmetreperkilogram,'. +\'nor:cubicmetrepersecond,'. +\'nor:curie,'. +\'nor:dday,'. +\'nor:deca,'. +\'nor:decad,'. +\'nor:deci,'. +\'nor:decid,'. +\'nor:degree,'. +\'nor:degreecelsius,'. +\'nor:deka,'. +\'nor:dekad,'. +\'nor:derbecquerel,'. +\'nor:dercelsius,'. +\'nor:dercoulomb,'. +\'nor:derfarad,'. +\'nor:dergray,'. +\'nor:derhenry,'. +\'nor:derhertz,'. +\'nor:derjoule,'. +\'nor:derkatal,'. +\'nor:derlumen,'. +\'nor:derlux,'. +\'nor:dernewton,'. +\'nor:derohm,'. +\'nor:derpascal,'. +\'nor:derradian,'. +\'nor:dersiemens,'. +\'nor:dersievert,'. +\'nor:dersteradian,'. +\'nor:dertesla,'. +\'nor:dervolt,'. +\'nor:derwatt,'. +\'nor:derweber,'. +\'nor:electronvolt,'. +\'nor:exa,'. +\'nor:exad,'. +\'nor:farad,'. +\'nor:faradbase,'. +\'nor:faradpermetre,'. +\'nor:faradpermetrenp,'. +\'nor:femto,'. +\'nor:femtod,'. +\'nor:fourth,'. +\'nor:gal,'. +\'nor:giga,'. +\'nor:gigad,'. +\'nor:gram,'. +\'nor:graybase,'. +\'nor:graypersecond,'. +\'nor:graypersecondnp,'. +\'nor:hectare,'. +\'nor:hecto,'. +\'nor:hectod,'. +\'nor:henry,'. +\'nor:henrybase,'. +\'nor:henrypermetre,'. +\'nor:henrypermetrenp,'. +\'nor:hertz,'. +\'nor:hertzbase,'. +\'nor:hour,'. +\'nor:joule,'. +\'nor:joulebase,'. +\'nor:joulepercubicmetre,'. +\'nor:joulepercubicmetrenp,'. +\'nor:jouleperkelvin,'. +\'nor:jouleperkelvinnp,'. +\'nor:jouleperkilogram,'. +\'nor:jouleperkilogramkelvin,'. +\'nor:jouleperkilogramkelvinnp,'. +\'nor:jouleperkilogramnp,'. +\'nor:joulepermole,'. +\'nor:joulepermolekelvin,'. +\'nor:joulepermolekelvinnp,'. +\'nor:joulepermolenp,'. +\'nor:joulepersquaremetre,'. +\'nor:joulepersquaremetrenp,'. +\'nor:joulepertesla,'. +\'nor:jouleperteslanp,'. +\'nor:katal,'. +\'nor:katalbase,'. +\'nor:katalpercubicmetre,'. +\'nor:katalpercubicmetrenp,'. +\'nor:kelvin,'. +\'nor:kilo,'. +\'nor:kilod,'. +\'nor:kilogram,'. +\'nor:kilogrammetrepersecond,'. +\'nor:kilogrammetrepersecondnp,'. +\'nor:kilogrammetrepersquaresecond,'. +\'nor:kilogrammetrepersquaresecondnp,'. +\'nor:kilogrampercubicmetre,'. +\'nor:kilogrampercubicmetrecoulomb,'. +\'nor:kilogrampercubicmetrecoulombnp,'. +\'nor:kilogrampercubicmetrenp,'. +\'nor:kilogramperkilomole,'. +\'nor:kilogramperkilomolenp,'. +\'nor:kilogrampermetre,'. +\'nor:kilogrampermetrenp,'. +\'nor:kilogrampersecond,'. +\'nor:kilogrampersecondcubicmetre,'. +\'nor:kilogrampersecondcubicmetrenp,'. +\'nor:kilogrampersecondnp,'. +\'nor:kilogrampersquaremetre,'. +\'nor:kilogrampersquaremetrenp,'. +\'nor:kilogrampersquaremetresecond,'. +\'nor:kilogrampersquaremetresecondnp,'. +\'nor:kilogramsquaremetre,'. +\'nor:kilogramsquaremetrenp,'. +\'nor:kilogramsquaremetrepersecond,'. +\'nor:kilogramsquaremetrepersecondnp,'. +\'nor:kilowatthour,'. +\'nor:liter,'. +\'nor:litre,'. +\'nor:lumen,'. +\'nor:lumenbase,'. +\'nor:lux,'. +\'nor:luxbase,'. +\'nor:mega,'. +\'nor:megad,'. +\'nor:meter,'. +\'nor:metre,'. +\'nor:metrepersecond,'. +\'nor:metrepersecondnp,'. +\'nor:metrepersquaresecond,'. +\'nor:metrepersquaresecondnp,'. +\'nor:micro,'. +\'nor:microd,'. +\'nor:milli,'. +\'nor:millid,'. +\'nor:minute,'. +\'nor:mole,'. +\'nor:molepercubicmetre,'. +\'nor:molepercubicmetrenp,'. +\'nor:nano,'. +\'nor:nanod,'. +\'nor:neper,'. +\'nor:newton,'. +\'nor:newtonbase,'. +\'nor:newtonmetre,'. +\'nor:newtonpercubicmetre,'. +\'nor:newtonpercubicmetrenp,'. +\'nor:newtonperkilogram,'. +\'nor:newtonperkilogramnp,'. +\'nor:newtonpermetre,'. +\'nor:newtonpermetrenp,'. +\'nor:newtonpersquaremetre,'. +\'nor:newtonpersquaremetrenp,'. +\'nor:NoAMS,'. +\'nor:no@qsk,'. +\'nor:ohm,'. +\'nor:ohmbase,'. +\'nor:ohmmetre,'. +\'nor:one,'. +\'nor:paminute,'. +\'nor:pascal,'. +\'nor:pascalbase,'. +\'nor:pascalsecond,'. +\'nor:pasecond,'. +\'nor:per,'. +\'nor:period@active,'. +\'nor:persquaremetresecond,'. +\'nor:persquaremetresecondnp,'. +\'nor:peta,'. +\'nor:petad,'. +\'nor:pico,'. +\'nor:picod,'. +\'nor:power,'. +\'nor:@qsk,'. +\'nor:quantityskip,'. +\'nor:rad,'. +\'nor:radian,'. +\'nor:radianbase,'. +\'nor:radianpersecond,'. +\'nor:radianpersecondnp,'. +\'nor:radianpersquaresecond,'. +\'nor:radianpersquaresecondnp,'. +\'nor:reciprocal,'. +\'nor:rem,'. +\'nor:roentgen,'. +\'nor:rp,'. +\'nor:rpcubed,'. +\'nor:rpcubic,'. +\'nor:rpcubicmetreperkilogram,'. +\'nor:rpcubicmetrepersecond,'. +\'nor:rperminute,'. +\'nor:rpersecond,'. +\'nor:rpfourth,'. +\'nor:rpsquare,'. +\'nor:rpsquared,'. +\'nor:rpsquaremetreperkilogram,'. +\'nor:second,'. +\'nor:siemens,'. +\'nor:siemensbase,'. +\'nor:sievert,'. +\'nor:sievertbase,'. +\'nor:square,'. +\'nor:squared,'. +\'nor:squaremetre,'. +\'nor:squaremetrepercubicmetre,'. +\'nor:squaremetrepercubicmetrenp,'. +\'nor:squaremetrepercubicsecond,'. +\'nor:squaremetrepercubicsecondnp,'. +\'nor:squaremetreperkilogram,'. +\'nor:squaremetrepernewtonsecond,'. +\'nor:squaremetrepernewtonsecondnp,'. +\'nor:squaremetrepersecond,'. +\'nor:squaremetrepersecondnp,'. +\'nor:squaremetrepersquaresecond,'. +\'nor:squaremetrepersquaresecondnp,'. +\'nor:steradian,'. +\'nor:steradianbase,'. +\'nor:tera,'. +\'nor:terad,'. +\'nor:tesla,'. +\'nor:teslabase,'. +\'nor:ton,'. +\'nor:tonne,'. +\'nor:unit,'. +\'nor:unitskip,'. +\'nor:usk,'. +\'nor:volt,'. +\'nor:voltbase,'. +\'nor:voltpermetre,'. +\'nor:voltpermetrenp,'. +\'nor:watt,'. +\'nor:wattbase,'. +\'nor:wattpercubicmetre,'. +\'nor:wattpercubicmetrenp,'. +\'nor:wattperkilogram,'. +\'nor:wattperkilogramnp,'. +\'nor:wattpermetrekelvin,'. +\'nor:wattpermetrekelvinnp,'. +\'nor:wattpersquaremetre,'. +\'nor:wattpersquaremetrenp,'. +\'nor:wattpersquaremetresteradian,'. +\'nor:wattpersquaremetresteradiannp,'. +\'nor:weber,'. +\'nor:weberbase,'. +\'nor:yocto,'. +\'nor:yoctod,'. +\'nor:yotta,'. +\'nor:yottad,'. +\'nor:zepto,'. +\'nor:zeptod,'. +\'nor:zetta,'. +\'nor:zettad' + +let g:TeX_package_option_SIunits = +\'amssymb,'. +\'binary,'. +\'cdot,'. +\'derived,'. +\'derivedinbase,'. +\'Gray,'. +\'mediumqspace,'. +\'mediumspace,'. +\'noams,'. +\'pstricks,'. +\'squaren,'. +\'textstyle,'. +\'thickqspace,'. +\'thickspace,'. +\'thinqspace,'. +\'thinspace' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/accents b/dot_vim/ftplugin/latex-suite/packages/accents new file mode 100644 index 0000000..706d95e --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/accents @@ -0,0 +1,28 @@ +if exists("accents_package_file") + finish +endif +let accents_package_file = 1 + +let g:TeX_package_option_accents = +\ 'nonscript,' +\.'single' + +let g:TeX_package_accents = +\ 'bra:grave,' +\.'bra:acute,' +\.'bra:check,' +\.'bra:breve,' +\.'bra:bar,' +\.'bra:ring,' +\.'bra:hat,' +\.'bra:dot,' +\.'bra:tilde,' +\.'bra:undertilde,' +\.'bra:ddot,' +\.'bra:dddot,' +\.'bra:ddddot,' +\.'bra:vec,' +\.'brd:accentset,' +\.'brd:underaccent' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/acromake b/dot_vim/ftplugin/latex-suite/packages/acromake new file mode 100644 index 0000000..2130f61 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/acromake @@ -0,0 +1,10 @@ +if exists("acromake_package_file") + finish +endif +let acromake_package_file = 1 + +let g:TeX_package_option_acromake = '' + +let g:TeX_package_acromake = 'brs:acromake{<++>}{<++>}{<++>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/afterpage b/dot_vim/ftplugin/latex-suite/packages/afterpage new file mode 100644 index 0000000..5087321 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/afterpage @@ -0,0 +1,10 @@ +if exists("afterpage_package_file") + finish +endif +let afterpage_package_file = 1 + +let g:TeX_package_option_afterpage = '' + +let g:TeX_package_afterpage = 'bra:afterpage' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/alltt b/dot_vim/ftplugin/latex-suite/packages/alltt new file mode 100644 index 0000000..c30b684 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/alltt @@ -0,0 +1,12 @@ +if exists("alltt_package_file") + finish +endif +let alltt_package_file = 1 + +let g:TeX_package_option_alltt = '' + +let g:TeX_package_alltt = 'env:alltt' + +syn region texZone start="\\begin{alltt}" end="\\end{alltt}\|%stopzone\>" fold + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/amsmath b/dot_vim/ftplugin/latex-suite/packages/amsmath new file mode 100644 index 0000000..fd7dcda --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/amsmath @@ -0,0 +1,106 @@ +if exists("amsmath_package_file") + finish +endif +let amsmath_package_file = 1 + +let g:TeX_package_option_amsmath = +\ 'centertags,' +\.'tbtags,' +\.'sumlimits,' +\.'nosumlimits,' +\.'intlimits,' +\.'nointlimits,' +\.'namelimits,' +\.'nonamelimits,' +\.'leqno,' +\.'reqno,' +\.'fleqno' + +let g:TeX_package_amsmath = +\ 'sbr:Environments,' +\.'env:equation,' +\.'env:equation*,' +\.'env:align,' +\.'env:align*,' +\.'env:gather,' +\.'env:gather*,' +\.'env:flalign,' +\.'env:flalign*,' +\.'env:multline,' +\.'env:multline*,' +\.'ens:alignat:{<+arg1+>}{<+arg2+>},' +\.'env:alignat,' +\.'ens:alignat*:{<+arg1+>}{<+arg2+>},,' +\.'env:alignat*,' +\.'env:subequations,' +\.'env:subarray,' +\.'env:split,' +\.'env:cases,' +\.'sbr:Matrices,' +\.'env:matrix,' +\.'env:pmatrix,' +\.'env:bmatrix,' +\.'env:Bmatrix,' +\.'env:vmatrix,' +\.'env:Vmatrix,' +\.'env:smallmatrix,' +\.'bra:hdotsfor,' +\.'sbr:Dots,' +\.'dotsc,' +\.'dotsb,' +\.'dotsm,' +\.'dotsi,' +\.'dotso,' +\.'sbr:ItalicGreek,' +\.'nor:varGamma,' +\.'nor:varDelta,' +\.'nor:varTheta,' +\.'nor:varLambda,' +\.'nor:varXi,' +\.'nor:varPi,' +\.'nor:varSigma,' +\.'nor:varUpsilon,' +\.'nor:varPhi,' +\.'nor:varPsi,' +\.'nor:varOmega,' +\.'sbr:Mod,' +\.'nor:mod,' +\.'nor:bmod,' +\.'nor:pmod,' +\.'nor:pod,' +\.'sbr:CreatingSymbols,' +\.'brd:overset,' +\.'brd:underset,' +\.'brd:sideset,' +\.'sbr:Fractions,' +\.'brd:frac,' +\.'brd:dfrac,' +\.'brd:tfrac,' +\.'brd:cfrac,' +\.'brd:binom,' +\.'brd:dbinom,' +\.'brd:tbinom,' +\.'brs:genfrac{<+ldelim+>}{<+rdelim+>}{<+thick+>}{<+style+>}{<+numer+>}{<+denom+>},' +\.'sbr:Commands,' +\.'nob:smash,' +\.'bra:substack,' +\.'bra:tag,' +\.'bra:tag*,' +\.'nor:notag,' +\.'bra:raisetag,' +\.'bra:shoveleft,' +\.'bra:shoveright,' +\.'bra:intertext,' +\.'bra:text,' +\.'nor:displaybreak,' +\.'noo:displaybreak,' +\.'noo:allowdisplaybreaks,' +\.'nor:nobreakdash,' +\.'brs:numberwithin{<+env+>}{<+parent+>},' +\.'bra:leftroot,' +\.'bra:uproot,' +\.'bra:boxed,' +\.'brs:DeclareMathSymbol{<++>}{<++>}{<++>}{<++>},' +\.'bra:eqref' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/amsthm b/dot_vim/ftplugin/latex-suite/packages/amsthm new file mode 100644 index 0000000..6bae018 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/amsthm @@ -0,0 +1,21 @@ +if exists("amsthm_package_file") + finish +endif +let amsthm_package_file = 1 + +let TeX_package_option_amsthm = '' + +let TeX_package_amsthm = +\ 'env:proof,' +\.'nor:swapnumbers,' +\.'brd:newtheorem,' +\.'brd:newtheorem*,' +\.'nor:theoremstyle{plain},' +\.'nor:theoremstyle{definition},' +\.'nor:theoremstyle{remark},' +\.'nor:newtheoremstyle,' +\.'nor:qedsymbol,' +\.'nor:qed,' +\.'nor:qedhere' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/amsxtra b/dot_vim/ftplugin/latex-suite/packages/amsxtra new file mode 100644 index 0000000..3875cc3 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/amsxtra @@ -0,0 +1,12 @@ +if exists("amsxtra_package_file") + finish +endif +let amsxtra_package_file = 1 + +let g:TeX_package_option_amsxtra = '' + +let g:TeX_package_amsxtra = +\ 'nor:sphat,' +\.'nor:sptilde' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/arabic b/dot_vim/ftplugin/latex-suite/packages/arabic new file mode 100644 index 0000000..46f8314 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/arabic @@ -0,0 +1,10 @@ +if exists("arabic_package_file") + finish +endif +let arabic_package_file = 1 + +let g:TeX_package_option_arabic = '' + +let g:TeX_package_arabic = 'bra:arabicnumeral' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/array b/dot_vim/ftplugin/latex-suite/packages/array new file mode 100644 index 0000000..99f3dbc --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/array @@ -0,0 +1,17 @@ +if exists("array_package_file") + finish +endif +let array_package_file = 1 + +let g:TeX_package_option_array = '' + +let g:TeX_package_array = +\ 'brs:newcolumntype{<+type+>}[<+no+>]{<+preamble+>},' +\.'arraycolsep,' +\.'tabcolsep,' +\.'arrayrulewidth,' +\.'doublerulesep,' +\.'arraystretch,' +\.'extrarowheight' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/babel b/dot_vim/ftplugin/latex-suite/packages/babel new file mode 100644 index 0000000..cdb76ec --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/babel @@ -0,0 +1,98 @@ +if exists("babel_package_file") + finish +endif +let babel_package_file = 1 + +" This package sets some language specific options. +" Since it needs to find out which options the user used with the babel +" package, it needs to wait till latex-suite is done scanning packages. It +" then catches the LatexSuiteScannedPackages event which +" Tex_pack_updateall() throws at which time g:Tex_pack_detected and +" g:Tex_babel_options contain the necessary information. + +let g:TeX_package_option_babel = +\ 'afrikaans,' +\.'bahasa,' +\.'basque,' +\.'breton,' +\.'bulgarian,' +\.'catalan,' +\.'croatian,' +\.'chech,' +\.'danish,' +\.'dutch,' +\.'english,USenglish,american,UKenglish,british,canadian,' +\.'esperanto,' +\.'estonian,' +\.'finnish,' +\.'french,francais,canadien,acadian,' +\.'galician,' +\.'austrian,german,germanb,ngerman,naustrian,' +\.'greek,polutonikogreek,' +\.'hebrew,' +\.'magyar,hungarian,' +\.'icelandic,' +\.'irish,' +\.'italian,' +\.'latin,' +\.'lowersorbian,' +\.'samin,' +\.'norsk,nynorsk,' +\.'polish,' +\.'portuges,portuguese,brazilian,brazil,' +\.'romanian,' +\.'russian,' +\.'scottish,' +\.'spanish,' +\.'slovak,' +\.'slovene,' +\.'swedish,' +\.'serbian,' +\.'turkish,' +\.'ukrainian,' +\.'uppersorbian,' +\.'welsh' + +let g:TeX_package_babel = +\ 'bra:selectlanguage,' +\.'env:otherlanguage,' +\.'env:otherlanguage*,' +\.'env:hyphenrules,' +\.'brd:foreignlanguage,' +\.'spe:iflanguage{<+name+>}{<+true+>}{<+false+>},' +\.'languagename,' +\.'bra:useshorthands,' +\.'brd:defineshorthand,' +\.'brd:aliasshorthand,' +\.'bra:languageshorthans,' +\.'bra:shorthandon,' +\.'bra:shorthandoff,' +\.'brd:languageattribute' + +" vim:ft=vim:ff=unix: +if exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +augroup LatexSuite + au LatexSuite User LatexSuiteScannedPackages + \ call Tex_Debug('babel: catching LatexSuiteScannedPackages event') | + \ call s:SetQuotes() +augroup END + +let s:path = expand('<sfile>:p:h') + +" SetQuotes: sets quotes for various languages {{{ +" Description: +function! <SID>SetQuotes() + if g:Tex_package_detected =~ '\<babel\>' + if g:Tex_babel_options =~ '\<german\>' + exec 'so '.s:path.'/german' + elseif g:Tex_babel_options =~ '\<ngerman\>' + exec 'so '.s:path.'/ngerman' + endif + endif +endfunction " }}} + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/bar b/dot_vim/ftplugin/latex-suite/packages/bar new file mode 100644 index 0000000..0087b95 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/bar @@ -0,0 +1,27 @@ +if exists("bar_package_file") + finish +endif +let bar_package_file = 1 + +let g:TeX_package_option_bar = '' + +let g:TeX_package_bar = +\ 'env:barenv,' +\.'brs:bar{<+height+>}{<+index+>}[<+desc+>],' +\.'hlineon,' +\.'brs:legend{<+index+>}{<+text+>},' +\.'bra:setdepth,' +\.'bra:sethspace,' +\.'brs:setlinestyle{<+solid-dotted+>},' +\.'brs:setnumberpos{<+empty-axis-down-inside-outside-up+>},' +\.'bra:setprecision,' +\.'bra:setstretch,' +\.'bra:setstyle,' +\.'bra:setwidth,' +\.'brs:setxaxis{<+w1+>}{<+w2+>}{<+step+>},' +\.'brs:setyaxis[<+n+>]{<+w1+>}{<+w2+>}{<+step+>},' +\.'brs:setxname[<+lrbt+>]{<+etiquette+>},' +\.'brs:setyname[<+lrbt+>]{<+etiquette+>},' +\.'brs:setxvaluetyp{<+day-month+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/bm b/dot_vim/ftplugin/latex-suite/packages/bm new file mode 100644 index 0000000..1cd5109 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/bm @@ -0,0 +1,10 @@ +if exists("bm_package_file") + finish +endif +let bm_package_file = 1 + +let g:TeX_package_option_bm = '' + +let g:TeX_package_bm = 'bra:bm' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/bophook b/dot_vim/ftplugin/latex-suite/packages/bophook new file mode 100644 index 0000000..16ca8b0 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/bophook @@ -0,0 +1,12 @@ +if exists("bophook_package_file") + finish +endif +let bophook_package_file = 1 + +let g:TeX_package_option_bophook = '' + +let g:TeX_package_bophook = +\ 'bra:AtBeginPage,' +\.'bra:PageLayout' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/boxedminipage b/dot_vim/ftplugin/latex-suite/packages/boxedminipage new file mode 100644 index 0000000..0917352 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/boxedminipage @@ -0,0 +1,10 @@ +if exists("boxedminipage_package_file") + finish +endif +let boxedminipage_package_file = 1 + +let g:TeX_package_option_boxedminipage = '' + +let g:TeX_package_boxedminipage = 'ens:boxedminipage:[<+pos+>]{<+size+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/caption2 b/dot_vim/ftplugin/latex-suite/packages/caption2 new file mode 100644 index 0000000..7e16031 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/caption2 @@ -0,0 +1,43 @@ +if exists("caption2_package_file") + finish +endif +let caption2_package_file = 1 + +let g:TeX_package_option_caption2 = +\ 'scriptsize,' +\.'footnotesize,' +\.'small,' +\.'normalsize,' +\.'large,' +\.'Large,' +\.'up,' +\.'it,' +\.'sl,' +\.'sc,' +\.'md,' +\.'bf,' +\.'rm,' +\.'sf,' +\.'tt,' +\.'ruled,' +\.'boxed,' +\.'centerlast,' +\.'anne,' +\.'center,' +\.'flushleft,' +\.'flushright,' +\.'oneline,' +\.'nooneline,' +\.'hang,' +\.'isu,' +\.'indent,' +\.'longtable' + +let g:TeX_package_caption2 = +\ 'bra:captionsize,' +\.'bra:captionfont,' +\.'bra:captionlabelfont,' +\.'bra:setcaptionmargin,' +\.'bra:setcaptionwidth' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/cases b/dot_vim/ftplugin/latex-suite/packages/cases new file mode 100644 index 0000000..a2deafe --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/cases @@ -0,0 +1,12 @@ +if exists("cases_package_file") + finish +endif +let cases_package_file = 1 + +let g:TeX_package_option_cases = '' + +let g:TeX_package_cases = +\ 'ens:numcases:{<+label+>},' +\.'ens:subnumcases:{<+label+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/ccaption b/dot_vim/ftplugin/latex-suite/packages/ccaption new file mode 100644 index 0000000..2ec3f2f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/ccaption @@ -0,0 +1,20 @@ +if exists("ccaption_package_file") + finish +endif +let ccaption_package_file = 1 + +let g:TeX_package_option_ccaption = '' + +let g:TeX_package_ccaption = +\ 'bra:contcaption,' +\.'bra:legend,' +\.'bra:namedlegend,' +\.'abovelegendskip,' +\.'belowlegendskip,' +\.'brd:newfixedcaption,' +\.'brd:renewfixedcaption,' +\.'brd:providefixedcaption,' +\.'brs:newfloatenv[<+counter+>]{<+name+>}{<+ext+>}{<+etiq+>},' +\.'brd:listfloats' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/changebar b/dot_vim/ftplugin/latex-suite/packages/changebar new file mode 100644 index 0000000..e5002cf --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/changebar @@ -0,0 +1,35 @@ +if exists("changebar_package_file") + finish +endif +let changebar_package_file = 1 + +let g:TeX_package_option_changebar = +\ 'DVItoLN03,' +\.'dvitoln03,' +\.'DVItoPS,' +\.'dvitops,' +\.'DVIps,' +\.'dvips,' +\.'emTeX,' +\.'emtex,' +\.'textures,' +\.'Textures,' +\.'outerbars,' +\.'innerbars,' +\.'leftbars,' +\.'rightbars,' +\.'traceon,' +\.'traceoff' + +let g:TeX_package_changebar = +\ 'ens:changebar:[<+thickness+>],' +\.'noo:cbstart,' +\.'cbend,' +\.'cbdelete,' +\.'changebarwidth,' +\.'deletebarwidth,' +\.'changebarsep,' +\.'spe:changebargrey,' +\.'nochangebars' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/chapterbib b/dot_vim/ftplugin/latex-suite/packages/chapterbib new file mode 100644 index 0000000..331e901 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/chapterbib @@ -0,0 +1,24 @@ +if exists("chapterbib_package_file") + finish +endif +let chapterbib_package_file = 1 + +let g:TeX_package_option_chapterbib = +\ 'sectionbib,' +\.'rootbib,' +\.'gather,' +\.'duplicate' + +let g:TeX_package_chapterbib = +\ 'env:cbunit,' +\.'brd:sectionbib,' +\.'bra:cbinput,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/cite b/dot_vim/ftplugin/latex-suite/packages/cite new file mode 100644 index 0000000..aa43e5b --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/cite @@ -0,0 +1,32 @@ +if exists("cite_package_file") + finish +endif +let cite_package_file = 1 + +let g:TeX_package_option_cite = +\ 'verbose,' +\.'nospace,' +\.'space,' +\.'nosort,' +\.'sort,' +\.'noadjust' + +let g:TeX_package_cite = +\ 'bra:cite,' +\.'bra:citen,' +\.'bra:citenum,' +\.'bra:citeonline,' +\.'bra:nocite,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citenum\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citeonline\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/color b/dot_vim/ftplugin/latex-suite/packages/color new file mode 100644 index 0000000..7f3aeac --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/color @@ -0,0 +1,43 @@ +if exists("color_package_file") + finish +endif +let color_package_file = 1 + +let g:TeX_package_option_color = +\ 'monochrome,' +\.'debugshow,' +\.'dvips,' +\.'xdvi,' +\.'dvipdf,' +\.'pdftex,' +\.'dvipsone,' +\.'dviwindo,' +\.'emtex,' +\.'dviwin,' +\.'oztex,' +\.'textures,' +\.'pctexps,' +\.'pctexwin,' +\.'pctexhp,' +\.'pctex32,' +\.'truetex,' +\.'tcidvi,' +\.'dvipsnames,' +\.'nodvipsnames,' +\.'usenames' + +let g:TeX_package_color = +\ 'brs:definecolor{<++>}{<++>}{<++>},' +\.'brs:DefineNamedColor{<++>}{<++>}{<++>}{<++>},' +\.'bra:color,' +\.'nob:color,' +\.'brd:textcolor,' +\.'brs:textcolor[<++>]{<++>}{<++>},' +\.'brd:colorbox,' +\.'brs:colorbox[<++>]{<++>}{<++>},' +\.'brs:fcolorbox{<++>}{<++>}{<++>},' +\.'brs:fcolorbox[<++>]{<++>}{<++>}{<++>},' +\.'brd:pagecolor,' +\.'nob:pagecolor' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/comma b/dot_vim/ftplugin/latex-suite/packages/comma new file mode 100644 index 0000000..5ec8d70 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/comma @@ -0,0 +1,12 @@ +if exists("comma_package_file") + finish +endif +let comma_package_file = 1 + +let g:TeX_package_option_comma = '' + +let g:TeX_package_comma = +\ 'bra:commaform,' +\.'bra:commaformtoken' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/deleq b/dot_vim/ftplugin/latex-suite/packages/deleq new file mode 100644 index 0000000..58426d2 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/deleq @@ -0,0 +1,36 @@ +if exists("deleq_package_file") + finish +endif +let deleq_package_file = 1 + +let g:TeX_package_option_deleq = '' + +let g:TeX_package_deleq = +\.'env:deqn,' +\.'env:ddeqn,' +\.'env:deqarr,' +\.'env:ddeqar,' +\.'env:deqrarr,' +\.'nor:nydeqno,' +\.'nor:heqno,' +\.'bra:reqno,' +\.'bra:rndeqno,' +\.'bra:rdeqno,' +\.'nob:eqreqno,' +\.'nob:deqreqno,' +\.'nob:ddeqreqno,' +\.'bra:arrlabel,' +\.'nor:where,' +\.'bra:remtext,' +\.'nor:nydeleqno,' +\.'nor:deleqno,' +\.'nor:jotbaseline' + +if !exists("tex_no_math") + syn region texMathZoneA start="\\begin\s*{\s*deqn\*\s*}" end="\\end\s*{\s*deqn\*\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneB start="\\begin\s*{\s*ddeqn\*\s*}" end="\\end\s*{\s*ddeqn\*\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneC start="\\begin\s*{\s*deqarr\s*}" end="\\end\s*{\s*deqarr\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneD start="\\begin\s*{\s*ddeqar\s*}" end="\\end\s*{\s*ddeqar\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneE start="\\begin\s*{\s*deqrarr\*\s*}" end="\\end\s*{\s*deqrarr\*\s*}" keepend fold contains=@texMathZoneGroup +endif +" vim:ft=vim:ff=unix:noet:ts=4: diff --git a/dot_vim/ftplugin/latex-suite/packages/drftcite b/dot_vim/ftplugin/latex-suite/packages/drftcite new file mode 100644 index 0000000..8c30447 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/drftcite @@ -0,0 +1,29 @@ +if exists("drftcite_package_file") + finish +endif +let drftcite_package_file = 1 + +let g:TeX_package_option_drftcite = +\ 'verbose,' +\.'nospace,' +\.'space,' +\.'breakcites,' +\.'manualsort,' +\.'tt,' +\.'shownumbers,' +\.'nocitecount' + +let g:TeX_package_drftcite = +\ 'bra:cite,' +\.'bra:citen,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/dropping b/dot_vim/ftplugin/latex-suite/packages/dropping new file mode 100644 index 0000000..bcfc11f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/dropping @@ -0,0 +1,12 @@ +if exists("dropping_package_file") + finish +endif +let dropping_package_file = 1 + +let g:TeX_package_option_dropping = '' + +let g:TeX_package_dropping = +\ 'brs:bigdrop{<+indent+>}{<+big+>}{<+font+>}{<+text+>},' +\.'brs:dropping[<+indent+>]{<+big+>}{<+text+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/enumerate b/dot_vim/ftplugin/latex-suite/packages/enumerate new file mode 100644 index 0000000..40c3f7c --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/enumerate @@ -0,0 +1,10 @@ +if exists("enumerate_package_file") + finish +endif +let enumerate_package_file = 1 + +let g:TeX_package_option_enumerate = '' + +let g:TeX_package_enumerate = 'ens:enumerate:[<+prefix+>]' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/eqlist b/dot_vim/ftplugin/latex-suite/packages/eqlist new file mode 100644 index 0000000..e1e249e --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/eqlist @@ -0,0 +1,19 @@ +if exists("eqlist_package_file") + finish +endif +let eqlist_package_file = 1 + +let g:TeX_package_option_eqlist = '' + +let g:TeX_package_eqlist = +\ 'env:eqlist,' +\.'env:eqlist*,' +\.'env:Eqlist,' +\.'env:Eqlist*,' +\.'sep:modificators,' +\.'eqlistinit,' +\.'eqliststarinit,' +\.'eqlistinitpar,' +\.'eqlistlabel' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/eqparbox b/dot_vim/ftplugin/latex-suite/packages/eqparbox new file mode 100644 index 0000000..a05061b --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/eqparbox @@ -0,0 +1,12 @@ +if exists("eqparbox_package_file") + finish +endif +let eqparbox_package_file = 1 + +let g:TeX_package_option_eqparbox = '' + +let g:TeX_package_eqparbox = +\ 'brs:eqparbox[<+pos+>][<+height+>][<+inner-pos+>]{<+tag+>}{<+text+>},' +\.'bra:eqboxwidth' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/everyshi b/dot_vim/ftplugin/latex-suite/packages/everyshi new file mode 100644 index 0000000..e42a3d5 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/everyshi @@ -0,0 +1,10 @@ +if exists("everyshi_package_file") + finish +endif +let everyshi_package_file = 1 + +let g:TeX_package_option_everyshi = '' + +let g:TeX_package_everyshi = 'bra:EveryShipOut' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/exmpl b/dot_vim/ftplugin/latex-suite/packages/exmpl new file mode 100644 index 0000000..e9e37fc --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/exmpl @@ -0,0 +1,55 @@ +if exists("exmpl_package_file") + finish +endif +let exmpl_package_file = 1 + +" Author: Mikolaj Machowski +" Date: 10.04.2002 +" Example plugin for packages in latexSuite +" + +" This variable creates Options submenu in package menu. Even when no options are +" given for this package it HAS to exist in form +" let TeX_package_option_exmpl = "" +" Options and commands are delimited with comma , + +let g:TeX_package_option_exmpl = "OpcjaA=,OpcjaB,OpcjaC" + +" Most command should have some definition before. Package menu system can +" recognize type of command and behave in good manner: +" env: (environment) creates simple environment template +" \begin{command} +" x <- cursor here +" \end{command} +" +" bra: (brackets) useful when inserting brackets commands +" \command{x}<<>> <- cursor at x, and placeholders as in other menu entries +" +" nor: (normal) nor: and pla: are `highlighted' in menu with `'' +" \command<Space> +" +" pla: (plain) +" command<Space> +" +" spe: (special) +" command <-literal insertion of command, in future here should go +" commands with special characters +" +" sep: (separator) creates separator. Good for aesthetics and usability :) +" +" Command can be also given with no prefix:. The result is +" \command (as in nor: but without <Space>) + + +let g:TeX_package_exmpl = "env:AEnvFirst,env:aEnvSec,env:BThi," + \ . "sep:a,env:zzzz," + \ . "bra:aBraFirst,bra:bBraSec,bra:cBraThi," + \ . "sep:b," + \ . "nor:aNorPri,nor:bNorSec,nor:cNorTer," + \ . "sep:c," + \ . "pla:aPla1,pla:bPla2,pla:cPla3," + \ . "sep:d," + \ . "spe:aSpe1,spe:bSpe2,spe:cSpe3," + \ . "sep:e," + \ . "aNo1,bNo2,cNo3" +" vim:ft=vim diff --git a/dot_vim/ftplugin/latex-suite/packages/flafter b/dot_vim/ftplugin/latex-suite/packages/flafter new file mode 100644 index 0000000..8859397 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/flafter @@ -0,0 +1,10 @@ +if exists("flafter_package_file") + finish +endif +let flafter_package_file = 1 + +let g:TeX_package_option_flafter = '' + +let g:TeX_package_flafter = 'noo:suppressfloats,noo:suppress' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/float b/dot_vim/ftplugin/latex-suite/packages/float new file mode 100644 index 0000000..7c1cf46 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/float @@ -0,0 +1,16 @@ +if exists("float_package_file") + finish +endif +let float_package_file = 1 + +let g:TeX_package_option_float = '' + +let g:TeX_package_float = +\ 'bra:floatstyle,' +\.'brs:newfloat{<++>}{<++>}{<++>}[<++>],' +\.'brd:floatname,' +\.'brd:listof,' +\.'bra:restylefloat,' +\.'brd:floatplacement' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/floatflt b/dot_vim/ftplugin/latex-suite/packages/floatflt new file mode 100644 index 0000000..4902d89 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/floatflt @@ -0,0 +1,12 @@ +if exists("floatflt_package_file") + finish +endif +let floatflt_package_file = 1 + +let g:TeX_package_option_floatflt = 'rflt,lflt,vflt' + +let g:TeX_package_floatflt = +\ 'ens:floatingfigure:[<+loc+>]{<+spec+>},' +\.'ens:floatingtable:[<+loc+>]{<+spec+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/fn2end b/dot_vim/ftplugin/latex-suite/packages/fn2end new file mode 100644 index 0000000..aac4184 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/fn2end @@ -0,0 +1,10 @@ +if exists("fn2end_package_file") + finish +endif +let fn2end_package_file = 1 + +let g:TeX_package_option_fn2end = '' + +let g:TeX_package_fn2end = 'makeendnotes,theendnotes' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/footmisc b/dot_vim/ftplugin/latex-suite/packages/footmisc new file mode 100644 index 0000000..04723f6 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/footmisc @@ -0,0 +1,21 @@ +if exists("footmisc_package_file") + finish +endif +let footmisc_package_file = 1 + +let g:TeX_package_option_footmisc = +\ 'bottom,' +\.'flushmargin,' +\.'marginal,' +\.'multiple,' +\.'norule,' +\.'para,' +\.'perpage,' +\.'splitrule,' +\.'stable,' +\.'symbol,' +\.'symbol+' + +let g:TeX_package_footmisc = '' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/geometry b/dot_vim/ftplugin/latex-suite/packages/geometry new file mode 100644 index 0000000..667a289 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/geometry @@ -0,0 +1,93 @@ +if exists("geometry_package_file") + finish +endif +let geometry_package_file = 1 + +let g:TeX_package_option_geometry = +\ 'sbr:Boolean,' +\.'verbose,' +\.'landscape,' +\.'portrait,' +\.'twoside,' +\.'includemp,' +\.'reversemp,' +\.'reversemarginpar,' +\.'nohead,' +\.'nofoot,' +\.'noheadfoot,' +\.'dvips,' +\.'pdftex,' +\.'vtex,' +\.'truedimen,' +\.'reset,' +\.'sbr:BooleanDimensions,' +\.'a0paper,' +\.'a1paper,' +\.'a2paper,' +\.'a3paper,' +\.'a4paper,' +\.'a5paper,' +\.'a6paper,' +\.'b0paper,' +\.'b1paper,' +\.'b2paper,' +\.'b3paper,' +\.'b4paper,' +\.'b5paper,' +\.'b6paper,' +\.'letterpaper,' +\.'executivepaper,' +\.'legalpaper,' +\.'sbr:SingleValueOption,' +\.'paper=,' +\.'papername=,' +\.'paperwidth=,' +\.'paperheight=,' +\.'width=,' +\.'totalwidth=,' +\.'height=,' +\.'totalheight=,' +\.'left=,' +\.'lmargin=,' +\.'right=,' +\.'rmargin=,' +\.'top=,' +\.'tmargin=,' +\.'bottom=,' +\.'bmargin=,' +\.'hscale=,' +\.'vscale=,' +\.'textwidth=,' +\.'textheight=,' +\.'marginparwidth=,' +\.'marginpar=,' +\.'marginparsep=,' +\.'headheight=,' +\.'head=,' +\.'headsep=,' +\.'footskip=,' +\.'hoffset=,' +\.'voffset=,' +\.'twosideshift=,' +\.'mag=,' +\.'columnsep=,' +\.'footnotesep=,' +\.'sbr:TwoValueOptions,' +\.'papersize={<++>},' +\.'total={<++>},' +\.'body={<++>},' +\.'text={<++>},' +\.'scale={<++>},' +\.'hmargin={<++>},' +\.'vmargin={<++>},' +\.'margin={<++>},' +\.'offset={<++>},' +\.'sbr:ThreeValueOptions,' +\.'hdivide={<++>},' +\.'vdivide={<++>},' +\.'divide={<++>}' + +let g:TeX_package_geometry = +\ 'bra:geometry' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/german b/dot_vim/ftplugin/latex-suite/packages/german new file mode 100644 index 0000000..9aa7519 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/german @@ -0,0 +1,12 @@ +if exists("german_package_file") + finish +endif +let german_package_file = 1 + +let g:TeX_package_german = '' +let g:TeX_package_option_german = '' +" For now just define the smart quotes. +let b:Tex_SmartQuoteOpen = '"`' +let b:Tex_SmartQuoteClose = "\"'" + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/graphicx b/dot_vim/ftplugin/latex-suite/packages/graphicx new file mode 100644 index 0000000..4aa7571 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/graphicx @@ -0,0 +1,69 @@ +if exists("graphicx_package_file") + finish +endif +let graphicx_package_file = 1 + +let g:TeX_package_option_graphicx = +\ 'sbr:Drivers,' +\.'xdvi,' +\.'dvipdf,' +\.'dvipdfm,' +\.'pdftex,' +\.'dvipsone,' +\.'dviwindo,' +\.'emtex,' +\.'dviwin,' +\.'oztex,' +\.'textures,' +\.'pctexps,' +\.'pctexwin,' +\.'pctexhp,' +\.'pctex32,' +\.'truetex,' +\.'tcidvi,' +\.'vtex,' +\.'sbr:Rest,' +\.'debugshow,' +\.'draft,' +\.'final,' +\.'hiderotate,' +\.'hiresbb,' +\.'hidescale,' +\.'unknownkeysallowed,' +\.'unknownkeyserror' + +let g:TeX_package_graphicx = +\ 'sbr:Includegraphics,' +\.'brs:includegraphics[<++>]{<++>},' +\.'spe:height=,' +\.'spe:width=,' +\.'spe:keepaspectratio=,' +\.'spe:totalheight=,' +\.'spe:angle=,' +\.'spe:scale=,' +\.'spe:origin=,' +\.'spe:clip,' +\.'spe:bb=,' +\.'spe:viewport=,' +\.'spe:trim=,' +\.'spe:draft,' +\.'spe:hiresbb,' +\.'spe:type=,' +\.'spe:ext=,' +\.'spe:read=,' +\.'spe:command=,' +\.'sbr:Rotatebox,' +\.'brs:rotatebox[<++>]{<++>}{<++>},' +\.'spe:origin=,' +\.'spe:x=,' +\.'spe:y=,' +\.'spe:units=,' +\.'sbr:Rest,' +\.'brs:scalebox{<++>}[<++>]{<++>},' +\.'brs:resizebox{<++>}{<++>}{<++>},' +\.'brs:resizebox*{<++>}{<++>}{<++>},' +\.'bra:DeclareGraphicsExtensions,' +\.'brs:DeclareGraphicsRule{<++>}{<++>}{<++>}{<++>},' +\.'bra:graphicspath' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/graphpap b/dot_vim/ftplugin/latex-suite/packages/graphpap new file mode 100644 index 0000000..ebbd268 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/graphpap @@ -0,0 +1,10 @@ +if exists("graphpap_package_file") + finish +endif +let graphpap_package_file = 1 + +let g:TeX_package_option_graphpap = '' + +let g:TeX_package_graphpap = 'brs:graphpaper[<+step+>](<+x1,y1+>)(<+x2,y2+>)' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/harpoon b/dot_vim/ftplugin/latex-suite/packages/harpoon new file mode 100644 index 0000000..994801d --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/harpoon @@ -0,0 +1,18 @@ +if exists("harpoon_package_file") + finish +endif +let harpoon_package_file = 1 + +let g:TeX_package_option_harpoon = '' + +let g:TeX_package_harpoon = +\ 'bra:overleftharp,' +\.'bra:overrightharp,' +\.'bra:overleftharpdown,' +\.'bra:overrightharpdown,' +\.'bra:underleftharp,' +\.'bra:underrightharp,' +\.'bra:underleftharpdown,' +\.'bra:underrightharpdown' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/hhline b/dot_vim/ftplugin/latex-suite/packages/hhline new file mode 100644 index 0000000..a024c19 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/hhline @@ -0,0 +1,21 @@ +if exists("hhline_package_file") + finish +endif +let hhline_package_file = 1 + +let g:TeX_package_option_hhline = '' + +let g:TeX_package_hhline = +\ 'bra:hhline,' +\.'sep:a,' +\.'spe:=,' +\.'spe:-,' +\.'spe:~,' +\."spe:\\\|," +\.'spe::,' +\.'spe:#,' +\.'spe:t,' +\.'spe:b,' +\.'spe:*' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/histogram b/dot_vim/ftplugin/latex-suite/packages/histogram new file mode 100644 index 0000000..b18fc07 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/histogram @@ -0,0 +1,13 @@ +if exists("histogram_package_file") + finish +endif +let histogram_package_file = 1 + +let g:TeX_package_option_histogram = '' + +let g:TeX_package_histogram = +\ 'histogram,' +\.'noverticallines,' +\.'verticallines' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/hyperref b/dot_vim/ftplugin/latex-suite/packages/hyperref new file mode 100644 index 0000000..a82aac3 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/hyperref @@ -0,0 +1,167 @@ +if exists("hyperref_package_file") + finish +endif +let hyperref_package_file = 1 + +let g:TeX_package_option_hyperref = +\ '4=,' +\.'a4paper,' +\.'a5paper,' +\.'anchorcolor=,' +\.'b5paper,' +\.'backref=,' +\.'baseurl={<++>},' +\.'bookmarks=,' +\.'bookmarksnumbered=,' +\.'bookmarksopen=,' +\.'bookmarksopenlevel=,' +\.'bookmarkstype=,' +\.'breaklinks=,' +\.'citebordercolor=,' +\.'citecolor=,' +\.'colorlinks=,' +\.'debug=,' +\.'draft,' +\.'dvipdf,' +\.'dvipdfm,' +\.'dvips,' +\.'dvipsone,' +\.'dviwindo,' +\.'executivepaper,' +\.'extension=,' +\.'filebordercolor=,' +\.'filecolor=,' +\.'frenchlinks=,' +\.'hyperfigures=,' +\.'hyperindex=,' +\.'hypertex,' +\.'hypertexnames=,' +\.'implicit=,' +\.'latex2html,' +\.'legalpaper,' +\.'letterpaper,' +\.'linkbordercolor=,' +\.'linkcolor=,' +\.'linktocpage=,' +\.'menubordercolor=,' +\.'menucolor=,' +\.'naturalnames,' +\.'nesting=,' +\.'pageanchor=,' +\.'pagebackref=,' +\.'pagebordercolor=,' +\.'pagecolor=,' +\.'pdfauthor={<++>},' +\.'pdfborder=,' +\.'pdfcenterwindow=,' +\.'pdfcreator={<++>},' +\.'pdffitwindow,' +\.'pdfhighlight=,' +\.'pdfkeywords={<++>},' +\.'pdfmenubar=,' +\.'pdfnewwindow=,' +\.'pdfpagelabels=,' +\.'pdfpagelayout=,' +\.'pdfpagemode=,' +\.'pdfpagescrop=,' +\.'pdfpagetransition=,' +\.'pdfproducer={<++>},' +\.'pdfstartpage={<++>},' +\.'pdfstartview={<++>},' +\.'pdfsubject={<++>},' +\.'pdftex,' +\.'pdftitle={<++>},' +\.'pdftoolbar=,' +\.'pdfusetitle=,' +\.'pdfview,' +\.'pdfwindowui=,' +\.'plainpages=,' +\.'ps2pdf,' +\.'raiselinks=,' +\.'runbordercolor,' +\.'tex4ht,' +\.'textures,' +\.'unicode=,' +\.'urlbordercolor=,' +\.'urlcolor=,' +\.'verbose=,' +\.'vtex' + +let g:TeX_package_hyperref = +\ 'sbr:Preamble,' +\.'bra:hypersetup,' +\.'wwwbrowser,' +\.'sbr:Links,' +\.'bra:hyperbaseurl,' +\.'brs:href{<+URL+>}{<+text+>},' +\.'bra:hyperimage,' +\.'brs:hyperdef{<+category+>}{<+name+>}{<+text+>},' +\.'brs:hyperref{<+URL+>}{<+category+>}{<+name+>}{<+text+>},' +\.'brs:hyperlink{<+name+>}{<+text+>},' +\.'brs:hypertarget{<+name+>}{<+text+>},' +\.'bra:url,' +\.'bra:htmladdnormallink,' +\.'brs:Acrobatmenu{<+option+>}{<+tekst+>},' +\.'brs:pdfbookmark[<++>]{<++>}{<++>},' +\.'bra:thispdfpagelabel,' +\.'sbr:Forms,' +\.'env:Form,' +\.'sep:Forms1,' +\.'brs:TextField[<+parameters+>]{<+label+>},' +\.'brs:CheckBox[<+parameters+>]{<+label+>},' +\.'brs:ChoiceMenu[<+parameters+>]{<+label+>}{<+choices+>},' +\.'brs:PushButton[<+parameters+>]{<+label+>},' +\.'brs:Submit[<+parameters+>]{<+label+>},' +\.'brs:Reset[<+parameters+>]{<+label+>},' +\.'sep:Forms2,' +\.'brs:LayoutTextField{<+label+>}{<+field+>},' +\.'brs:LayoutChoiceField{<+label+>}{<+field+>},' +\.'brs:LayoutCheckboxField{<+label+>}{<+field+>},' +\.'sep:Forms3,' +\.'brs:MakeRadioField{<+width+>}{<+height+>},' +\.'brs:MakeCheckField{<+width+>}{<+height+>},' +\.'brs:MakeTextField{<+width+>}{<+height+>},' +\.'brs:MakeChoiceField{<+width+>}{<+height+>},' +\.'brs:MakeButtonField{<+text+>},' +\.'sbr:Parameters,' +\.'spe:accesskey,' +\.'spe:align,' +\.'spe:backgroundcolor,' +\.'spe:bordercolor,' +\.'spe:bordersep,' +\.'spe:borderwidth,' +\.'spe:charsize,' +\.'spe:checked,' +\.'spe:color,' +\.'spe:combo,' +\.'spe:default,' +\.'spe:disabled,' +\.'spe:height,' +\.'spe:hidden,' +\.'spe:maxlen,' +\.'spe:menulength,' +\.'spe:multiline,' +\.'spe:name,' +\.'spe:onblur,' +\.'spe:onchange,' +\.'spe:onclick,' +\.'spe:ondblclick,' +\.'spe:onfocus,' +\.'spe:onkeydown,' +\.'spe:onkeypress,' +\.'spe:onkeyup,' +\.'spe:onmousedown,' +\.'spe:onmousemove,' +\.'spe:onmouseout,' +\.'spe:onmouseover,' +\.'spe:onmouseup,' +\.'spe:onselect,' +\.'spe:password,' +\.'spe:popdown,' +\.'spe:radio,' +\.'spe:readonly,' +\.'spe:tabkey,' +\.'spe:value,' +\.'spe:width' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/ifthen b/dot_vim/ftplugin/latex-suite/packages/ifthen new file mode 100644 index 0000000..82dbe69 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/ifthen @@ -0,0 +1,21 @@ +if exists("ifthen_package_file") + finish +endif +let ifthen_package_file = 1 + +let g:TeX_package_option_ifthen = '' + +let g:TeX_package_ifthen = +\ 'brs:ifthenelse{<++>}{<++>}{<++>},' +\.'brd:equal,' +\.'bra:boolean,' +\.'bra:lengthtest,' +\.'bra:isodd,' +\.'brd:whiledo,' +\.'bra:newboolean,' +\.'brd:setboolean,' +\.'nor:and,' +\.'nor:or,' +\.'nor:not' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/inputenc b/dot_vim/ftplugin/latex-suite/packages/inputenc new file mode 100644 index 0000000..73abe9a --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/inputenc @@ -0,0 +1,29 @@ +if exists("inputenc_package_file") + finish +endif +let inputenc_package_file = 1 + +let g:TeX_package_option_inputenc = +\ 'ascii,' +\.'latin1,' +\.'latin2,' +\.'latin3,' +\.'latin4,' +\.'latin5,' +\.'latin9,' +\.'decmulti,' +\.'cp850,' +\.'cp852,' +\.'cp437,' +\.'cp437de,' +\.'cp865,' +\.'applemac,' +\.'next,' +\.'ansinew,' +\.'cp1250,' +\.'cp1252' + +let g:TeX_package_inputenc = +\ 'bra:inputencoding' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/letterspace b/dot_vim/ftplugin/latex-suite/packages/letterspace new file mode 100644 index 0000000..9a53eaa --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/letterspace @@ -0,0 +1,10 @@ +if exists("letterspace_package_file") + finish +endif +let letterspace_package_file = 1 + +let g:TeX_package_option_letterspace = '' + +let g:TeX_package_letterspace = 'nor:letterspace' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/lineno b/dot_vim/ftplugin/latex-suite/packages/lineno new file mode 100644 index 0000000..4567602 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/lineno @@ -0,0 +1,60 @@ +if exists("lineno_package_file") + finish +endif +let lineno_package_file = 1 + +let g:TeX_package_option_lineno = +\ 'left,' +\.'right,' +\.'switch,' +\.'switch*,' +\.'pagewise,' +\.'running,' +\.'modulo,' +\.'mathlines,' +\.'displaymath,' +\.'hyperref' + +let g:TeX_package_lineno = +\ 'sbr:Environments,' +\.'env:linenumbers,' +\.'env:linenumbers*,' +\.'env:numquote,' +\.'env:numquote*,' +\.'env:numquotation,' +\.'env:numquotation*,' +\.'env:bframe,' +\.'env:linenomath,' +\.'env:linenomath*,' +\.'bra:linelabel,' +\.'sbr:Commands,' +\.'nor:linenumbers,' +\.'nor:linenumbers*,' +\.'noo:linenumbers,' +\.'nor:nolinenumbers,' +\.'nor:runninglinenumbers,' +\.'nor:runninglinenumbers*,' +\.'noo:runninglinenumbers,' +\.'nor:pagewiselinenumbers,' +\.'nor:resetlinenumber,' +\.'noo:resetlinenumber,' +\.'nor:setrunninglinenumbers,' +\.'nor:setpagewiselinenumbers,' +\.'nor:switchlinenumbers,' +\.'nor:switchlinenumbers*,' +\.'nor:leftlinenumbers,' +\.'nor:leftlinenumbers*,' +\.'nor:rightlinenumbers,' +\.'nor:rightlinenumbers*,' +\.'nor:runningpagewiselinenumbers,' +\.'nor:realpagewiselinenumbers,' +\.'nor:modulolinenumbers,' +\.'noo:modulolinenumbers,' +\.'nor:linenumberdisplaymath,' +\.'nor:nolinenumberdisplaymath,' +\.'nor:thelinenumber,' +\.'nob:linerefp,' +\.'nob:linerefr,' +\.'nob:lineref' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/longtable b/dot_vim/ftplugin/latex-suite/packages/longtable new file mode 100644 index 0000000..6644862 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/longtable @@ -0,0 +1,35 @@ +if exists("longtable_package_file") + finish +endif +let longtable_package_file = 1 + +let g:TeX_package_option_longtable = +\ 'errorshow,' +\.'pausing,' +\.'set,' +\.'final' + +let g:TeX_package_longtable = +\ 'sbr:Commands,' +\.'nor:setlongtables,' +\.'bra:LTleft,' +\.'bra:LTright,' +\.'bra:LTpre,' +\.'bra:LTpost,' +\.'bra:LTchunksize,' +\.'bra:LTcapwidth,' +\.'bra:LTcapwidth,' +\.'sbr:Longtable,' +\.'env:longtable,' +\.'sep:lt,' +\.'nor:endhead,' +\.'nor:endfirsthead,' +\.'nor:endfoot,' +\.'nor:endlastfoot,' +\.'nor:kill,' +\.'bra:caption,' +\.'nob:caption,' +\.'bra:caption*,' +\.'nor:newpage' + +" vim:ft=vim:ts=4:sw=4:noet:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/lscape b/dot_vim/ftplugin/latex-suite/packages/lscape new file mode 100644 index 0000000..33976ea --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/lscape @@ -0,0 +1,10 @@ +if exists("lscape_package_file") + finish +endif +let lscape_package_file = 1 + +let g:TeX_package_option_lscape = '' + +let g:TeX_package_lscape = 'env:landscape' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/manyfoot b/dot_vim/ftplugin/latex-suite/packages/manyfoot new file mode 100644 index 0000000..7cab55f --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/manyfoot @@ -0,0 +1,15 @@ +if exists("manyfoot_package_file") + finish +endif +let manyfoot_package_file = 1 + +let g:TeX_package_option_manyfoot = 'para' + +let g:TeX_package_manyfoot = +\ 'bra:newfootnote,bra:newfootnote[para],' +\.'bra:footnoteA,bra:footnoteB,' +\.'bra:FootnoteA,bra:FootnoteB,' +\.'bra:Footnotemark,bra:Footnotetext,' +\.'SplitNote' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/moreverb b/dot_vim/ftplugin/latex-suite/packages/moreverb new file mode 100644 index 0000000..8614e3b --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/moreverb @@ -0,0 +1,28 @@ +if exists("moreverb_package_file") + finish +endif +let moreverb_package_file = 1 + +let g:TeX_package_option_moreverb = '' + +let g:TeX_package_moreverb = +\ 'ens:verbatimwrite:{<++>},' +\.'ens:verbatimtab:[<++>],' +\.'ens:listing:[<+step+>]{<+number+>},' +\.'ens:listing*:[<+step+>]{<+number+>},' +\.'env:boxedverbatim,' +\.'bra:verbatimtabsize,' +\.'bra:listingoffset,' +\.'brs:listinginput[<++>]{<++>}{<++>},' +\.'brs:verbatimtabinput[<++>]{<++>}' + +let g:Tex_completion_explorer = g:Tex_completion_explorer.'verbatimtabinput,' + +syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" fold +syn region texZone start="\\begin{verbatimtab}" end="\\end{verbatimtab}\|%stopzone\>" fold +syn region texZone start="\\begin{boxedverbatim}" end="\\end{boxedverbatim}\|%stopzone\>" fold +syn region texZone start="\\begin{listing}" end="\\end{listing}\|%stopzone\>" fold +syn region texZone start="\\begin{listing*}" end="\\end{listing*}\|%stopzone\>" fold + + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/multibox b/dot_vim/ftplugin/latex-suite/packages/multibox new file mode 100644 index 0000000..00bccb2 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/multibox @@ -0,0 +1,10 @@ +if exists("multibox_package_file") + finish +endif +let multibox_package_file = 1 + +let g:TeX_package_option_multibox = '' + +let g:TeX_package_multibox = 'multimake,multiframe' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/multicol b/dot_vim/ftplugin/latex-suite/packages/multicol new file mode 100644 index 0000000..ca93189 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/multicol @@ -0,0 +1,21 @@ +if exists("multicol_package_file") + finish +endif +let multicol_package_file = 1 + +let g:TeX_package_option_multicol = '' + +let g:TeX_package_multicol = +\ 'ens:multicols:{<+cols+>}[<+text+>][<+sep+>],' +\.'columnbreak,' +\.'premulticols,' +\.'postmulticols,' +\.'multicolsep,' +\.'columnsep,' +\.'linewidth,' +\.'columnseprule,' +\.'flushcolumnt,' +\.'raggedcolumns,' +\.'unbalanced' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/newalg b/dot_vim/ftplugin/latex-suite/packages/newalg new file mode 100644 index 0000000..1480bb6 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/newalg @@ -0,0 +1,26 @@ +if exists("newalg_package_file") + finish +endif +let newalg_package_file = 1 + +let g:TeX_package_option_newalg = '' + +let g:TeX_package_newalg = +\ 'ens:algorithm:{<+name+>}{<++>},' +\.'ens:IF:{<+cond+>},' +\.'ens:FOR:{<+loop+>},' +\.'ens:WHILE:{<+cond+>},' +\.'bra:ERROR,' +\.'nor:ELSE,' +\.'nor:RETURN,' +\.'nor:NIL,' +\.'nor:TO,' +\.'bra:CALL,' +\.'bra:text,' +\.'env:REPEAT,' +\.'env:SWITCH,' +\.'nor:=,' +\.'bra:item,' +\.'nor:algkey' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/ngerman b/dot_vim/ftplugin/latex-suite/packages/ngerman new file mode 100644 index 0000000..534ac30 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/ngerman @@ -0,0 +1,10 @@ +if exists("ngerman_package_file") + finish +endif +let ngerman_package_file = 1 + +" For now just define the smart quotes. +let b:Tex_SmartQuoteOpen = '"`' +let b:Tex_SmartQuoteClose = "\"'" + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/numprint b/dot_vim/ftplugin/latex-suite/packages/numprint new file mode 100644 index 0000000..4eab5a2 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/numprint @@ -0,0 +1,18 @@ +if exists("numprint_package_file") + finish +endif +let numprint_package_file = 1 + +let g:TeX_package_option_numprint = '' + +let g:TeX_package_numprint = +\ 'bra:numprint,' +\.'nob:numprint,' +\.'bra:thousandsep,' +\.'bra:decimalsign,' +\.'bra:productsign,' +\.'bra:unitseparator,' +\.'brd:expnumprint,' +\.'global' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/oldstyle b/dot_vim/ftplugin/latex-suite/packages/oldstyle new file mode 100644 index 0000000..72b2774 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/oldstyle @@ -0,0 +1,12 @@ +if exists("oldstyle_package_file") + finish +endif +let oldstyle_package_file = 1 + +let g:TeX_package_option_oldstyle = '' + +let g:TeX_package_oldstyle = +\ 'bra:textos,' +\.'bra:mathos' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/outliner b/dot_vim/ftplugin/latex-suite/packages/outliner new file mode 100644 index 0000000..ca64322 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/outliner @@ -0,0 +1,19 @@ +if exists("outliner_package_file") + finish +endif +let outliner_package_file = 1 + +let g:TeX_package_option_outliner = '' + +let g:TeX_package_outliner = +\ 'env:Outline,' +\.'bra:Level,' +\.'bra:SetBaseLevel,' +\.'sep:preamble,' +\.'bra:OutlinePageBreaks,' +\.'bra:OutlinePageBreaks,' +\.'bra:OutlineLevelStart,' +\.'bra:OutlineLevelCont,' +\.'bra:OutlineLevelEnd' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/overcite b/dot_vim/ftplugin/latex-suite/packages/overcite new file mode 100644 index 0000000..25bc17d --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/overcite @@ -0,0 +1,34 @@ +if exists("overcite_package_file") + finish +endif +let overcite_package_file = 1 + +let g:TeX_package_option_overcite = +\ 'verbose,' +\.'ref,' +\.'nospace,' +\.'space,' +\.'nosort,' +\.'sort,' +\.'nomove,' +\.'noadjust' + +let g:TeX_package_overcite = +\ 'bra:cite,' +\.'bra:citen,' +\.'bra:citenum,' +\.'bra:citeonline,' +\.'bra:nocite,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citenum\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citeonline\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/parallel b/dot_vim/ftplugin/latex-suite/packages/parallel new file mode 100644 index 0000000..19dfe8e --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/parallel @@ -0,0 +1,15 @@ +if exists("parallel_package_file") + finish +endif +let parallel_package_file = 1 + +let g:TeX_package_option_parallel = '' + +let g:TeX_package_parallel = +\ 'env:Parallel,' +\.'bra:ParallelLText,' +\.'bra:ParallelRText,' +\.'nor:ParallelPar,' +\.'nor:tolerance' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/plain b/dot_vim/ftplugin/latex-suite/packages/plain new file mode 100644 index 0000000..6a3d092 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/plain @@ -0,0 +1,10 @@ +if exists("plain_package_file") + finish +endif +let plain_package_file = 1 + +let g:TeX_package_option_plain = '' + +let g:TeX_package_plain = 'env:plain' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/plates b/dot_vim/ftplugin/latex-suite/packages/plates new file mode 100644 index 0000000..e22817e --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/plates @@ -0,0 +1,16 @@ +if exists("plates_package_file") + finish +endif +let plates_package_file = 1 + +let g:TeX_package_option_plates = 'figures,onefloatperpage,memoir' + +let g:TeX_package_plates = +\ 'env:plate,' +\.'listofplates,' +\.'ProcessPlates,' +\.'bra:setplatename,' +\.'bra:setplatename,' +\.'bra:atBeginPlates' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/polski b/dot_vim/ftplugin/latex-suite/packages/polski new file mode 100644 index 0000000..e2c4efe --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/polski @@ -0,0 +1,165 @@ +" Author: Mikolaj Machowski <mikmach@wp.pl> +" (c) Copyright by Mikolaj Machowski 2002-2003 +" License: Vim Charityware +" Version: 1.6 +" +" Plik jest w kodowaniu iso-8859-2. Je¶li chcesz go uzywac w MS-Windows musisz +" go przekonwertowac na cp-1250. +" +" Plik ten jest czê¶ci± vim-latexSuite, ale: +" Nie u¿ywaj±cy vim-latexSuite (http://vim-latex.sourceforge.net) mog± wyci±æ +" oznaczon± czê¶æ. Reszta mo¿e byæ kopiowana jako osobny plik pod warunkiem +" niezmieniania tej notki i informacji o prawach autorskich. +" +" This file is in iso-8859-2 encoding. If you want to use it in MS-Windows you +" have to convert it to cp-1250. +" +" This file is part of vim-latexSuite but: +" Those who do not use vim-latexSuite (http://vim-latex.sourceforge.net) can +" cut off marked part. Rest of the file can be copied as separate file under +" condition of leaving this notice and information about copyrights unchanged. + +if exists("acromake_package_file") + finish +endif +let acromake_package_file = 1 + +" --------8<------------- +" Czesc odpowiedzialna za menu +let g:TeX_package_option_polski = +\'OT1,OT4,T1,QX,plmath,nomathsymbols,MeX,prefixingverb,noprefixingverb' +let g:TeX_package_polski = +\'sbr:Dywiz&Ska,'. +\'nor:dywiz,'. +\'nor:ppauza,'. +\'nor:pauza,'. +\'nor:prefixing,'. +\'nor:nonprefixing,'. +\'nor:PLdateending,'. +\'sbr:Matematyka,'. +\'nor:arccos,'. +\'nor:arcctan,'. +\'nor:arcsin,'. +\'nor:arctan,'. +\'nor:cot,'. +\'nor:ctanh,'. +\'nor:tan,'. +\'nor:tanh,'. +\'bra:arc,'. +\'nor:ctg,'. +\'nor:ctgh,'. +\'nor:tg,'. +\'nor:tgh,'. +\'nor:nwd' + +" To wymaga calego pakietu vim-latexSuite - zakomentuj lub wytnij je¶li nie +" u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net) +function! TPackagePolskiTylda() + call IMAP (" ---", "~---", "tex") +endfunction +call TPackagePolskiTylda() +" --------8<------------- + +" Polskie znaki cudzyslowow +TexLet g:Tex_SmartQuoteOpen = ",," +TexLet g:Tex_SmartQuoteClose = "''" + +" Zmodyfikowana i rozwinieta funkcja Andrzeja Ostruszki +" Z dodatkiem od Benjiego Fishera (sprawdzanie sk³adni) +" +" Spacja +inoremap <buffer> <silent> <Space> <C-R>=<SID>Tex_polish_space()<CR> +inoremap <buffer> <silent> <CR> <C-R>=<SID>Tex_polish_space()<CR><BS><CR> + +" Wymuszenie tyldy +inoremap <buffer> <silent> <S-Space> ~ + +" Wymuszenie zwyklej spacji +inoremap <buffer> <silent> <C-Space> <Space> + +" Latwe przelaczanie sie miedzy magiczna spacja a zwykla +inoremap <buffer> <silent> <F8> <C-R>=<SID>TogglePolishSpace()<CR> + +function! s:TogglePolishSpace() + if !exists("b:polishspace") + iunmap <buffer> <Space> + iunmap <buffer> <CR> + let b:polishspace = 1 + return '' + else + inoremap <buffer> <silent> <Space> <C-R>=<SID>Tex_polish_space()<CR> + inoremap <buffer> <silent> <CR> <C-R>=<SID>Tex_polish_space()<CR><BS><CR> + unlet b:polishspace + return '' + endif +endfunction + + +function! s:Tex_polish_space() + "Nic magicznego w matematyce + if synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath\|^texZone\^texRefZone' + return ' ' + else + let s:col = col('.') + let s:linelength = strlen(getline('.')) + 1 + " Wstaw tylde po spojnikach + if strpart(getline('.'), col('.') - 3, 2) =~? '^[[:space:]~(\[{]\?[aiouwz]$' + return '~' + " Wstaw tylde po inicjalach - konkretnie po pojedynczych wielkich + " literach i kropce. Obs³uguje poprawnie wiekszosc sytuacji. + elseif strpart(getline('.'), col('.') - 4, 3) =~? '^[[:space:]~(\[{]\?\u\.$' + return '~' + " Wstaw tylde po tytulach, skrotach bibliograficznych, podpisach + elseif strpart(getline('.'), col('.') - 9, 8) =~? '\(\s\|^\|\~\)\(str\.\|ryc\.\|rys\.\|tab\.\|art\.\|vol\.\|nr\|tabl\.\|rozdz\.\|ss\.\|s\.\|t\.\|z\.\|sir\|prof\.\|hab\.\|red\.\|min\.\|gen\.\|kpt\.\|przew\.\|p³k\|mjr\|mgr\|bp\|ks\.\|o\+\.\|¶w\.\|dr\)$' + return '~' + " Wstaw tylde miedzy rokiem, wiekiem, a odpowiednim skrotem + elseif strpart(getline('.'), col('.') - 8, 7) =~? '[0-9IVXLCM]\s\+\(r\|w\)\.[^a-z±æê³ñ󶿼]\{-}$' + s/[0-9IVXLCM]\zs\s\+\ze\(w\|r\)\.[^a-z±æê³ñ󶿼]\{-}\%#/\~/ei + exe 'normal '.s:col.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Wstaw tylde miedzy liczba a miara, itd. + elseif strpart(getline('.'), col('.') - 10, 9) =~? '\(\d\|mln\|mld\|tys\.\)\s\+\(z³\|gr\|ha\|t\|mies\|godz\|min\|sek\|cm\|km\|mln\|mld\|tys\.\)[^a-z±æê³ñ󶿼]\{-}$' + s/\(\d\|mln\|mld\|tys\.\)\zs\s\+\ze\(z³\|gr\|ha\|m\|t\|mies\|godz\|min\|sek\|cm\|km\|mln\|mld\|tys\.\)[^a-z±æê³ñ󶿼]\{-}\%#/\~/ei + exe 'normal '.s:col.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Rozwin myslnik w zbitkach w '\dywiz ': + " bialo-czerwony -> bialo\dywiz czerwony + elseif strpart(getline('.'), col('.') - 20, 19) =~? '[a-z±æê³ñ󶿼]-[a-z±æê³ñ󶿼]\{-}[^a-z±æê³ñ󶿼]\{-}$' + s/[a-z±æê³ñ󶿼]\zs-\ze[a-z±æê³ñ󶿼]\{-}[^a-z±æê³ñ󶿼]\{-}\%#/\\dywiz /ei + let colb = s:col + 6 + exe 'normal '.colb.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Rozwin '--' miedzy liczbami w '\ppauza ': + " 39--45 -> 39\ppauza 45 + elseif strpart(getline('.'), col('.') - 10, 9) =~? '[0-9IVXLCM]--[0-9IVXLCM]\{-}[^0-9IVXLCM]\{-}$' + s/[0-9IVXLCM]\zs--\ze[0-9IVXLCM]\{-}[^0-9IVXLCM]\{-}\%#/\\ppauza /ei + let colb = s:col + 6 + exe 'normal '.colb.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + endif + " Tu koncz komentowanie ostatniej sekcji + endif + return " " +endfunction + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/psgo b/dot_vim/ftplugin/latex-suite/packages/psgo new file mode 100644 index 0000000..1ef852c --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/psgo @@ -0,0 +1,27 @@ +if exists("psgo_package_file") + finish +endif +let psgo_package_file = 1 + +let g:TeX_package_option_psgo = '' + +let g:TeX_package_psgo = +\ 'env:psgogoard,' +\.'env:psgoboard*,' +\.'brs:stone{<+color+>}{<+letter+>}{<+number+>},' +\.'brs:stone[<+marker+>]{<+color+>}{<+letter+>}{<+number+>},' +\.'brs:move{<+letter+>}{<+number+>},' +\.'brs:move*{<+letter+>}{<+number+>},' +\.'brs:goline{<+letter1+>}{<+number1+>}{<+letter2+>}{<+number2+>},' +\.'brs:goarrow{<+letter1+>}{<+number1+>}{<+letter2+>}{<+number2+>},' +\.'sbr:Markers,' +\.'brs:markpos{<+marker+>}{<+letter+>}{<+number+>},' +\.'markma,' +\.'marktr,' +\.'markcr,' +\.'marksq,' +\.'bra:marklb,' +\.'marksl,' +\.'markdd' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/schedule b/dot_vim/ftplugin/latex-suite/packages/schedule new file mode 100644 index 0000000..7d58f6d --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/schedule @@ -0,0 +1,20 @@ +if exists("schedule_package_file") + finish +endif +let schedule_package_file = 1 + +let g:TeX_package_option_schedule = '' + +let g:TeX_package_schedule = +\ 'ens:schedule:[<+title+>],' +\.'bra:CellHeight,' +\.'bra:CellWidth,' +\.'bra:TimeRange,' +\.'bra:SubUnits,' +\.'bra:BeginOn,' +\.'bra:TextSize,' +\.'nor:FiveDay,' +\.'nor:SevenDay,' +\.'brs:NewAppointment{<+name+>}{<+bg+>}{<+fg+>}' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/textfit b/dot_vim/ftplugin/latex-suite/packages/textfit new file mode 100644 index 0000000..4d52785 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/textfit @@ -0,0 +1,12 @@ +if exists("textfit_package_file") + finish +endif +let textfit_package_file = 1 + +let g:TeX_package_option_textfit = '' + +let g:TeX_package_textfit = +\ 'brd:scaletowidth,' +\.'brd:scaletoheight' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/times b/dot_vim/ftplugin/latex-suite/packages/times new file mode 100644 index 0000000..499a13b --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/times @@ -0,0 +1,10 @@ +if exists("times_package_file") + finish +endif +let times_package_file = 1 + +let g:TeX_package_option_times = '' + +let g:TeX_package_times = '' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/tipa b/dot_vim/ftplugin/latex-suite/packages/tipa new file mode 100644 index 0000000..c89cc5d --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/tipa @@ -0,0 +1,364 @@ +if exists("tipa_package_file") + finish +endif +let tipa_package_file = 1 + +let g:TeX_package_option_tipa = +\ 'T1,' +\.'noenc,' +\.'tone,' +\.'extra,' +\.'safe' + +let g:TeX_package_tipa = +\ 'sbr:Common,' +\.'bra:textipa,' +\.'env:IPA,' +\.'tipaencoding,' +\.'bra:super,' +\.'nor:ipabar,' +\.'brd:tipalowaraccent,' +\.'brd:tipaupperaccent,' +\.'brd:tipaLowaraccent,' +\.'brd:tipaUpperaccent,' +\.'brd:ipaclap,' +\.'sbr:VowelsandConsonants,' +\.'nor:textturna,' +\.'nor:textrhooka,' +\.'nor:textlhookfour,' +\.'nor:textscripta,' +\.'nor:textturnscripta,' +\.'nor:textinvscripta,' +\.'ae,' +\.'nor:textaolig,' +\.'nor:textsca,' +\.'nor:textinvsca,' +\.'nor:textscaolig,' +\.'nor:textturnv,' +\.'nor:textsoftsign,' +\.'nor:texthardsign,' +\.'nor:texthtb,' +\.'nor:textscb,' +\.'nor:textcrb,' +\.'nor:textbarb,' +\.'nor:textbeta,' +\.'nor:textbarc,' +\.'nor:texthtc,' +\.'bra:v,' +\.'bra:c,' +\.'nor:textctc,' +\.'nor:textstretchc,' +\.'nor:textstretchcvar,' +\.'nor:textctstretchc,' +\.'nor:textctstretchcvar,' +\.'nor:textcrd,' +\.'nor:textbard,' +\.'nor:texthtd,' +\.'nor:textrtaild,' +\.'nor:texthtrtaild,' +\.'nor:textctd,' +\.'nor:textfrhookd,' +\.'nor:textfrhookdvar,' +\.'nor:textdblig,' +\.'nor:textdzlig,' +\.'nor:textdctzlig,' +\.'nor:textdyoghlig,' +\.'nor:textctdctzlig,' +\.'nor:textscdelta,' +\.'nor:dh,' +\.'nor:textrhooke,' +\.'nor:textschwa,' +\.'nor:textrhookschwa,' +\.'nor:textreve,' +\.'nor:textsce,' +\.'nor:textepsilon,' +\.'nor:textrhookepsilon,' +\.'nor:textcloseepsilon,' +\.'nor:textrevepsilon,' +\.'nor:textrhookrevepsilon,' +\.'nor:textcloserevepsilon,' +\.'nor:textscf,' +\.'nor:textscriptg,' +\.'nor:textbarg,' +\.'nor:textcrg,' +\.'nor:texthtg,' +\.'nor:textg,' +\.'nor:textscg,' +\.'nor:texthtscg,' +\.'nor:textgamma,' +\.'nor:textgrgamma,' +\.'nor:textfrtailgamma,' +\.'nor:textbktailgamma,' +\.'nor:textbabygamma,' +\.'nor:textramshorns,' +\.'nor:texthvlig,' +\.'nor:textcrh,' +\.'nor:texthth,' +\.'nor:textrtailhth,' +\.'nor:textheng,' +\.'nor:texththeng,' +\.'nor:textturnh,' +\.'nor:textsch,' +\.'nor:i,' +\.'nor:textbari,' +\.'nor:textiota,' +\.'nor:textlhti,' +\.'nor:textlhtlongi,' +\.'nor:textvibyi,' +\.'nor:textraisevibyi,' +\.'nor:textsci,' +\.'nor:j,' +\.'nor:textctj,' +\.'nor:textctjvar,' +\.'nor:textscj,' +\.'bra:v,' +\.'nor:textbardotlessj,' +\.'nor:textObardotlessj,' +\.'nor:texthtbardotlessj,' +\.'nor:texthtbardotlessjvar,' +\.'nor:texthtk,' +\.'nor:textturnk,' +\.'nor:textsck,' +\.'nor:textturnsck,' +\.'nor:textltilde,' +\.'nor:textbarl,' +\.'nor:textbeltl,' +\.'nor:textrtaill,' +\.'nor:textlyoghlig,' +\.'nor:textOlyoghlig,' +\.'nor:textscl,' +\.'nor:textrevscl,' +\.'nor:textlambda,' +\.'nor:textcrlambda,' +\.'nor:textltailm,' +\.'nor:textturnm,' +\.'nor:textturnmrleg,' +\.'nor:texthmlig,' +\.'nor:textscm,' +\.'nor:textnrleg,' +\.'~,' +\.'nor:textltailn,' +\.'nor:textfrbarn,' +\.'nor:ng,' +\.'nor:textrtailn,' +\.'nor:textctn,' +\.'nor:textnrleg,' +\.'nor:textscn,' +\.'nor:textbullseye,' +\.'nor:textObullseye,' +\.'nor:textbaro,' +\.'nor:o,' +\.'nor:textfemale,' +\.'nor:textuncrfemale,' +\.'nor:oe,' +\.'nor:textscoelig,' +\.'nor:textopeno,' +\.'nor:textrhookopeno,' +\.'nor:textturncelig,' +\.'nor:textomega,' +\.'nor:textinvomega,' +\.'nor:textscomega,' +\.'nor:textcloseomega,' +\.'nor:textlhookp,' +\.'nor:textscp,' +\.'nor:textwynn,' +\.'nor:textthorn,' +\.'nor:textthornvari,' +\.'nor:textthornvarii,' +\.'nor:textthornvariii,' +\.'nor:textthornvariv,' +\.'nor:texthtp,' +\.'nor:textphi,' +\.'nor:texthtq,' +\.'nor:textqplig,' +\.'nor:textscq,' +\.'nor:textfishhookr,' +\.'nor:textlonglegr,' +\.'nor:textrtailr,' +\.'nor:textturnr,' +\.'nor:textturnrrtail,' +\.'nor:textturnlonglegr,' +\.'nor:textscr,' +\.'nor:textinvscr,' +\.'nor:textrevscr,' +\.'bra:v,' +\.'nor:textrtails,' +\.'nor:textesh,' +\.'nor:textdoublebaresh,' +\.'nor:textctesh,' +\.'nor:textlooptoprevesh,' +\.'nor:texthtt,' +\.'nor:textlhookt,' +\.'nor:textrtailt,' +\.'nor:textfrhookt,' +\.'nor:textctturnt,' +\.'nor:texttctclig,' +\.'nor:texttslig,' +\.'nor:textteshlig,' +\.'nor:textturnt,' +\.'nor:textctt,' +\.'nor:textcttctclig,' +\.'nor:texttheta,' +\.'nor:textbaru,' +\.'nor:textupsilon,' +\.'nor:textscu,' +\.'nor:textturnscu,' +\.'nor:textscriptv,' +\.'nor:textturnw,' +\.'nor:textchi,' +\.'nor:textturny,' +\.'nor:textscy,' +\.'nor:textlhtlongy,' +\.'nor:textvibyy,' +\.'nor:textcommatailz,' +\.'bra:v,' +\.'nor:textctz,' +\.'nor:textrtailz,' +\.'nor:textcrtwo,' +\.'nor:textturntwo,' +\.'nor:textyogh,' +\.'nor:textbenttailyogh,' +\.'nor:textrevyogh,' +\.'nor:textctyogh,' +\.'nor:textturnthree,' +\.'nor:textglotstop,' +\.'nor:textraiseglotstop,' +\.'nor:textbarglotstop,' +\.'nor:textinvglotstop,' +\.'nor:textcrinvglotstop,' +\.'nor:textctinvglotstop,' +\.'nor:textrevglotstop,' +\.'nor:textturnglotstop,' +\.'nor:textbarrevglotstop,' +\.'nor:textpipe,' +\.'nor:textpipevar,' +\.'nor:textdoublebarpipe,' +\.'nor:textdoublebarpipevar,' +\.'nor:textdoublepipevar,' +\.'nor:textdoublepipe,' +\.'nor:textdoublebarslash,' +\.'sbr:Suprasegmentals,' +\.'nor:textprimstress,' +\.'nor:textsecstress,' +\.'nor:textlengthmark,' +\.'nor:texthalflength,' +\.'nor:textvertline,' +\.'nor:textdoublevertline,' +\.'bra:textbottomtiebar,' +\.'nor:textdownstep,' +\.'nor:textupstep,' +\.'nor:textglobfall,' +\.'nor:textglobrise,' +\.'nor:textspleftarrow,' +\.'nor:textdownfullarrow,' +\.'nor:textupfullarrow,' +\.'nor:textsubrightarrow,' +\.'nor:textsubdoublearrow,' +\.'sbr:AccentsandDiacritics,' +\.'`,' +\."'," +\.'^,' +\.'~,' +\.'",' +\.'bra:H,' +\.'bra:r,' +\.'bra:v,' +\.'bra:u,' +\.'=,' +\.'.,' +\.'bra:c,' +\.'bra:textpolhook,' +\.'nor:textrevpolhook{o,' +\.'bra:textdoublegrave,' +\.'bra:textsubgrave,' +\.'bra:textsubacute,' +\.'bra:textsubcircum,' +\.'bra:textroundcap,' +\.'bra:textacutemacron,' +\.'bra:textgravemacron,' +\.'bra:textvbaraccent,' +\.'bra:textdoublevbaraccent,' +\.'bra:textgravedot,' +\.'bra:textdotacute,' +\.'bra:textcircumdot,' +\.'bra:texttildedot,' +\.'bra:textbrevemacron,' +\.'bra:textringmacron,' +\.'bra:textacutewedge,' +\.'bra:textdotbreve,' +\.'bra:textsubbridge,' +\.'bra:textinvsubbridge,' +\.'sbr:SubscriptSquare,' +\.'bra:textsubrhalfring,' +\.'bra:textsublhalfring,' +\.'bra:textsubw,' +\.'bra:textoverw,' +\.'bra:textseagull,' +\.'bra:textovercross,' +\.'bra:textsubplus,' +\.'bra:textraising,' +\.'bra:textlowering,' +\.'bra:textadvancing,' +\.'bra:textretracting,' +\.'bra:textsubtilde,' +\.'bra:textsubumlaut,' +\.'bra:textsubring,' +\.'bra:textsubwedge,' +\.'bra:textsubbar,' +\.'bra:textsubdot,' +\.'bra:textsubarch,' +\.'bra:textsyllabic,' +\.'bra:textsuperimposetilde,' +\.'nor:textcorner,' +\.'nor:textopencorner,' +\.'nor:textrhoticity,' +\.'nor:textceltpal,' +\.'nor:textlptr,' +\.'nor:textrptr,' +\.'nor:textrectangle,' +\.'nor:textretractingvar,' +\.'bra:texttoptiebar,' +\.'nor:textrevapostrophe,' +\.'nor:texthooktop,' +\.'nor:textrthook,' +\.'nor:textrthooklong,' +\.'nor:textpalhook,' +\.'nor:textpalhooklong,' +\.'nor:textpalhookvar,' +\.'bra:textsuperscript,' +\.'sbr:ToneLetters,' +\.'bra:tone,' +\.'bra:stone,' +\.'bra:rtone,' +\.'nor:tone{55},' +\.'nor:tone{44},' +\.'nor:tone{33},' +\.'nor:tone{22},' +\.'nor:tone{11},' +\.'nor:tone{51},' +\.'nor:tone{15},' +\.'nor:tone{45},' +\.'nor:tone{12},' +\.'nor:tone{454},' +\.'sbr:DiacriticsExtIPA,' +\.'bra:spreadlips,' +\.'bra:overbridge,' +\.'bra:bibridge,' +\.'bra:subdoublebar,' +\.'bra:subdoublevert,' +\.'bra:subcorner,' +\.'bra:whistle,' +\.'bra:sliding,' +\.'bra:crtilde,' +\.'bra:dottedtilde,' +\.'bra:doubletilde,' +\.'bra:partvoiceless,' +\.'bra:inipartvoiceless,' +\.'bra:finpartvoiceless,' +\.'bra:partvoice,' +\.'bra:inipartvoice,' +\.'bra:finpartvoice,' +\.'bra:sublptr,' +\.'bra:subrptr' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/ulem b/dot_vim/ftplugin/latex-suite/packages/ulem new file mode 100644 index 0000000..9257713 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/ulem @@ -0,0 +1,21 @@ +if exists("ulem_package_file") + finish +endif +let ulem_package_file = 1 + +let g:TeX_package_option_ulem = +\ 'normalem,' +\.'ULforem,' +\.'normalbf,' +\.'UWforbf' + +let g:TeX_package_ulem = +\ 'bra:uwave,' +\.'bra:uline,' +\.'bra:uuline,' +\.'bra:sout,' +\.'bra:xout,' +\.'ULthickness,' +\.'ULdepth' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/url b/dot_vim/ftplugin/latex-suite/packages/url new file mode 100644 index 0000000..642148a --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/url @@ -0,0 +1,24 @@ +if exists("url_package_file") + finish +endif +let url_package_file = 1 + +let g:TeX_package_option_url = +\ 'hyphens,' +\.'obeyspaces,' +\.'spaces,' +\.'T1' + +let g:TeX_package_url = +\ 'bra:urlstyle,' +\.'bra:url,' +\.'bra:path,' +\.'bra:urldef' + +" TODO uncomment if you figure out +" 1. how to get this syn command to work every time instead of only the +" first time this file is sourced. +" syn region texZone start="\\url{" end="}\|%stopzone\>" +" syn region texZone start="\\path{" end="}\|%stopzone\>" + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/verbatim b/dot_vim/ftplugin/latex-suite/packages/verbatim new file mode 100644 index 0000000..f2137ff --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/verbatim @@ -0,0 +1,18 @@ +if exists("verbatim_package_file") + finish +endif +let verbatim_package_file = 1 + +let g:TeX_package_option_verbatim = '' + +let g:TeX_package_verbatim = +\ 'env:comment,' +\.'env:verbatim,' +\.'env:verbatim*,' +\.'bra:verbatiminput,' +\.'bra:verbatiminput' + +syn region texZone start="\\begin{comment}" end="\\end{comment}\|%stopzone\>" fold +syn region texZone start="\\begin{verbatim}" end="\\end{verbatim}\|%stopzone\>" fold + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/packages/version b/dot_vim/ftplugin/latex-suite/packages/version new file mode 100644 index 0000000..4de9da8 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/packages/version @@ -0,0 +1,12 @@ +if exists("version_package_file") + finish +endif +let version_package_file = 1 + +let g:TeX_package_option_version = '' + +let g:TeX_package_version = +\ 'bra:includeversion,' +\.'bra:excludeversion' + +" vim:ft=vim:ff=unix: diff --git a/dot_vim/ftplugin/latex-suite/projecttemplate.vim b/dot_vim/ftplugin/latex-suite/projecttemplate.vim new file mode 100644 index 0000000..1ab4be0 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/projecttemplate.vim @@ -0,0 +1,11 @@ +" Project name +" let g:projName = '' +" +" Project files +" let g:projFiles = '' + + +" Vim settings/maps/abbrs specific for this project + +" Modeline for this file +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:ft=vim diff --git a/dot_vim/ftplugin/latex-suite/pytools.py b/dot_vim/ftplugin/latex-suite/pytools.py new file mode 100644 index 0000000..1934e23 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/pytools.py @@ -0,0 +1,52 @@ +import string, vim, re, os, glob +# catFile: assigns a local variable retval to the contents of a file {{{ +def catFile(filename): + try: + file = open(filename) + lines = ''.join(file.readlines()) + file.close() + except: + lines = '' + + # escape double quotes and backslashes before quoting the string so + # everything passes throught. + vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', lines)) + return lines + +# }}} +# isPresentInFile: check if regexp is present in the file {{{ +def isPresentInFile(regexp, filename): + try: + fp = open(filename) + fcontents = string.join(fp.readlines(), '') + fp.close() + if re.search(regexp, fcontents): + vim.command('let retval = 1') + return 1 + else: + vim.command('let retval = 0') + return None + except: + vim.command('let retval = 0') + return None + +# }}} +# deleteFile: deletes a file if present {{{ +# If the file does not exist, check if its a filepattern rather than a +# filename. If its a pattern, then deletes all files matching the +# pattern. +def deleteFile(filepattern): + if os.path.exists(filepattern): + try: + os.remove(filepattern) + except: + vim.command('let retval = -1') + else: + if glob.glob(filepattern): + for filename in glob.glob(filepattern): + os.remove(filename) + else: + vim.command('let retval = -1') + +# }}} +# vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/dot_vim/ftplugin/latex-suite/smartspace.vim b/dot_vim/ftplugin/latex-suite/smartspace.vim new file mode 100644 index 0000000..07526d8 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/smartspace.vim @@ -0,0 +1,102 @@ +"============================================================================= +" File: smartspace.vim +" Author: Carl Muller +" Created: Fri Dec 06 12:00 AM 2002 PST +" +" Description: +" Maps the <space> key in insert mode so that mathematical formulaes are +" always kept on the same line. i.e, $$'s dont get broken across multiple +" lines. +"============================================================================= + +" Avoid reinclusion or if the user doesn't want us. +if exists('b:done_smartspace') + \ || (exists('g:Tex_SmartKeySpace') && !g:Tex_SmartKeySpace) + finish +endif +let b:done_smartspace = 1 + +" Smart space relies on taking over vim's insertion of carriage returns in +" order to keep $$'s on the same line. The only way to get vim not to break +" lines is to set tw=0. +" +" NOTE: setting tw != 0 will break smartspace +" the user's 'tw' setting is still respected in the insert mode. +" However, normal mode actions which rely on 'tw' such as gqap will be +" broken because of the faulty 'tw' setting. +let b:tw = &l:tw +setlocal tw=0 + +inoremap <buffer> <silent> <Space> <Space><Esc>:call <SID>TexFill(b:tw)<CR>a + +" Do not redefine the function. +if exists('*s:TexFill') + finish +endif + +" TexFormatLine: format line retaining $$'s on the same line. {{{ +function! s:TexFill(width) + if a:width != 0 && col(".") > a:width + " For future use, record the current line and the number of the current column + let current_line = getline(".") + let current_column = col(".") + exe "normal! a##\<Esc>" + call <SID>TexFormatLine(a:width,current_line,current_column) + exe "normal! ?##\<CR>2s\<Esc>" + " Remove ## from the search history. + call histdel("/", -1)|let @/=histget("/", -1) + endif +endfunction + +" }}} +function! s:TexFormatLine(width, current_line, current_column) " {{{ + " get the first non-blank character. + let first = matchstr(getline('.'), '\S') + normal! $ + let length = col('.') + let go = 1 + while length > a:width+2 && go + let between = 0 + let string = strpart(getline('.'), 0, a:width) + " Count the dollar signs + let number_of_dollars = 0 + let evendollars = 1 + let counter = 0 + while counter <= a:width-1 + " Pay attention to '$$'. + if string[counter] == '$' && string[counter-1] != '$' + let evendollars = 1 - evendollars + let number_of_dollars = number_of_dollars + 1 + endif + let counter = counter + 1 + endwhile + " Get ready to split the line. + exe 'normal! ' . (a:width + 1) . '|' + if evendollars + " Then you are not between dollars. + exe "normal! ?\\$\\+\\| \<CR>W" + else + " Then you are between dollars. + normal! F$ + if col(".") == 1 || getline('.')[col(".")-1] != "$" + let go = 0 + endif + endif + if first == '$' && number_of_dollars == 1 + let go = 0 + else + exe "normal! i\<CR>\<Esc>$" + " get the first non-blank character. + let first = matchstr(getline('.'), '\S') + endif + let length = col(".") + endwhile + if go == 0 && strpart(a:current_line, 0, a:current_column) =~ '.*\$.*\$.*' + exe "normal! ^f$a\<CR>\<Esc>" + call <SID>TexFormatLine(a:width, a:current_line, a:current_column) + endif +endfunction + +" }}} + +" vim:fdm=marker:ts=4:sw=4:noet diff --git a/dot_vim/ftplugin/latex-suite/templates.vim b/dot_vim/ftplugin/latex-suite/templates.vim new file mode 100644 index 0000000..e28e429 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/templates.vim @@ -0,0 +1,149 @@ +"============================================================================= +" File: templates.vim +" Author: Gergely Kontra +" (minor modifications by Srinath Avadhanula) +" (plus other modifications by Mikolaj Machowski) +" Version: 1.0 +" Created: Tue Apr 23 05:00 PM 2002 PST +" CVS: $Id: templates.vim 1002 2006-03-23 04:02:21Z srinathava $ +" +" Description: functions for handling templates in latex-suite/templates +" directory. +"============================================================================= + +let s:path = expand("<sfile>:p:h") + +" SetTemplateMenu: sets up the menu for templates {{{ +function! <SID>SetTemplateMenu() + let flist = Tex_FindInRtp('', 'templates') + let i = 1 + while 1 + let fname = Tex_Strntok(flist, ',', i) + if fname == '' + break + endif + exe "amenu ".g:Tex_TemplatesMenuLocation."&".i.":<Tab>".fname." ". + \":call <SID>ReadTemplate('".fname."')<CR>" + let i = i + 1 + endwhile +endfunction + +if g:Tex_Menus + call <SID>SetTemplateMenu() +endif + +" }}} +" ReadTemplate: reads in the template file from the template directory. {{{ +function! <SID>ReadTemplate(...) + if a:0 > 0 + let filename = a:1 + else + let filelist = Tex_FindInRtp('', 'templates') + let filename = + \ Tex_ChooseFromPrompt("Choose a template file:\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or name of file :", + \ filelist, ',') + endif + + let fname = Tex_FindInRtp(filename.'.tex', 'templates', ':p') + call Tex_Debug("0read ".fname, 'templates') + + silent! exe "0read ".fname + + " The first line of the file contains the specifications of what the + " placeholder characters and the other special characters are. + let pattern = '\v(\S+)\t(\S+)\t(\S+)\t(\S+)' + + let s:phsTemp = substitute(getline(1), pattern, '\1', '') + let s:pheTemp = substitute(getline(1), pattern, '\2', '') + let s:exeTemp = substitute(getline(1), pattern, '\3', '') + let s:comTemp = substitute(getline(1), pattern, '\4', '') + + 0 d_ + + call s:ProcessTemplate() + call Tex_pack_updateall(1) + + " Do not handle the placeholders here. Let IMAP_PutTextWithMovement do it + " because it handles UTF-8 character substitutions etc. Therefore delete + " the text into @a and paste it using IMAP_PutTextWithMovement(). + let _a = @a + normal! ggVG"ax + + let _fo = &fo + " Since IMAP_PutTextWithMovement simulates the key-presses, leading + " indendatation can get duplicated in strange ways if ``fo`` is non-empty. + " NOTE: the indentexpr thingie is still respected with an empty fo so that + " environments etc are properly indented. + set fo= + + call Tex_Debug("normal! i\<C-r>=IMAP_PutTextWithMovement(@a, '".s:phsTemp."', '".s:pheTemp."')\<CR>", 'templates') + exec "normal! i\<C-r>=IMAP_PutTextWithMovement(@a, '".s:phsTemp."', '".s:pheTemp."')\<CR>" + + let &fo = _fo + let @a = _a + + call Tex_Debug('phs = '.s:phsTemp.', phe = '.s:pheTemp.', exe = '.s:exeTemp.', com = '.s:comTemp, 'templates') + +endfunction + +" }}} +" ProcessTemplate: processes the special characters in template file. {{{ +" This implementation follows from Gergely Kontra's +" mu-template.vim +" http://vim.sourceforge.net/scripts/script.php?script_id=222 +function! <SID>ProcessTemplate() + if exists('s:phsTemp') && s:phsTemp != '' + + exec 'silent! %s/^'.s:comTemp.'\(\_.\{-}\)'.s:comTemp.'$/\=<SID>Compute(submatch(1))/ge' + exec 'silent! %s/'.s:exeTemp.'\(.\{-}\)'.s:exeTemp.'/\=<SID>Exec(submatch(1))/ge' + exec 'silent! g/'.s:comTemp.s:comTemp.'/d' + + " A function only puts one item into the search history... + call Tex_CleanSearchHistory() + endif +endfunction + +function! <SID>Exec(what) + exec 'return '.a:what +endfunction + +" Back-Door to trojans !!! +function! <SID>Compute(what) + exe a:what + if exists('s:comTemp') + return s:comTemp.s:comTemp + else + return '' + endif +endfunction + +" }}} +" Command definitions {{{ +if v:version >= 602 + com! -complete=custom,Tex_CompleteTemplateName -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>) + \| :startinsert + + " Tex_CompleteTemplateName: for completing names in TTemplate command {{{ + " Description: get list of template names with Tex_FindInRtp(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompleteTemplateName(A,P,L) + " Get name of macros from all runtimepath directories + let tmplnames = Tex_FindInRtp('', 'templates') + " Separate names with \n not , + let tmplnames = substitute(tmplnames,',','\n','g') + return tmplnames + endfunction + " }}} + +else + com! -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>) + \| :startinsert + +endif + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/templates/IEEEtran.tex b/dot_vim/ftplugin/latex-suite/templates/IEEEtran.tex new file mode 100644 index 0000000..104f9b2 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/templates/IEEEtran.tex @@ -0,0 +1,142 @@ +<+ +> !comp! !exe! +%% Based on <bare_jrnl.tex> in the ieee package available from CTAN, +%% I have changed the options so that most useful ones are clubbed together, +%% Have a look at <bare_jrnl.tex> to understand the function of each package. + +%% This code is offered as-is - no warranty - user assumes all risk. +%% Free to use, distribute and modify. + +% *** Authors should verify (and, if needed, correct) their LaTeX system *** +% *** with the testflow diagnostic prior to trusting their LaTeX platform *** +% *** with production work. IEEE's font choices can trigger bugs that do *** +% *** not appear when using other class files. *** +% Testflow can be obtained at: +% http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/testflow + +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[journal]{IEEEtran} + +\usepackage{cite, graphicx, subfigure, amsmath} +\interdisplaylinepenalty=2500 + +% *** Do not adjust lengths that control margins, column widths, etc. *** +% *** Do not use packages that alter fonts (such as pslatex). *** +% There should be no need to do such things with IEEEtran.cls V1.6 and later. + +<++> +% correct bad hyphenation here +\hyphenation{<+op-tical net-works semi-conduc-tor+>} + + +\begin{document} +% +% paper title +\title{<+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>} +% +% +% author names and IEEE memberships +% note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break +% a structure at a ~ so this keeps an author's name from being broken across +% two lines. +% use \thanks{} to gain access to the first footnote area +% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks +% was not built to handle multiple paragraphs +\author{<+Sumit Bhardwaj+>~\IEEEmembership{<+Student~Member,~IEEE,+>} +<+John~Doe+>,~\IEEEmembership{<+Fellow,~OSA,+>} +<+and~Jane~Doe,+>~\IEEEmembership{<+Life~Fellow,~IEEE+>}}% <-this % stops a space +\thanks{<+Manuscript received January 20, 2002; revised August 13, 2002. +This work was supported by the IEEE.+>}% <-this % stops a space +\thanks{<+S. Bhardwaj is with the Indian Institute of Technology, Delhi.+>} +% +% The paper headers +\markboth{<+Journal of VIM-\LaTeX\ Class Files,~Vol.~1, No.~8,~August~2002+>}{ +<+Bhardwaj \MakeLowercase{\textit{et al.}+>}: <+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>} +% The only time the second header will appear is for the odd numbered pages +% after the title page when using the twoside option. + + +% If you want to put a publisher's ID mark on the page +% (can leave text blank if you just want to see how the +% text height on the first page will be reduced by IEEE) +%\pubid{0000--0000/00\$00.00~\copyright~2002 IEEE} + +% use only for invited papers +%\specialpapernotice{(Invited Paper)} + +% make the title area +\maketitle + + +\begin{abstract} +<+The abstract goes here.+> +\end{abstract} + +\begin{keywords} +<+IEEEtran, journal, \LaTeX, paper, template, VIM, VIM-\LaTeX+>. +\end{keywords} + +\section{Introduction} +\PARstart{<+T+>}{<+his+>} <+demo file is intended to serve as a ``starter file" +for IEEE journal papers produced under \LaTeX\ using IEEEtran.cls version +1.6 and later.+> +% You must have at least 2 lines in the paragraph with the drop letter +% (should never be an issue) +<+May all your publication endeavors be successful.+> + +% needed in second column of first page if using \pubid +%\pubidadjcol + +% trigger a \newpage just before the given reference +% number - used to balance the columns on the last page +% adjust value as needed - may need to be readjusted if +% the document is modified later +%\IEEEtriggeratref{8} +% The "triggered" command can be changed if desired: +%\IEEEtriggercmd{\enlargethispage{-5in}} + +% references section + +%\bibliographystyle{IEEEtran.bst} +%\bibliography{IEEEabrv,../bib/paper} +\begin{thebibliography}{1} + +\bibitem{IEEEhowto:kopka} +H.~Kopka and P.~W. Daly, \emph{A Guide to {\LaTeX}}, 3rd~ed.\hskip 1em plus +0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999. + +\end{thebibliography} + +% biography section +% +\begin{biography}{Sumit Bhardwaj} +Biography text here. +\end{biography} + +% if you will not have a photo +\begin{biographynophoto}{John Doe} +Biography text here. +\end{biographynophoto} + +% insert where needed to balance the two columns on the last page +%\newpage + +\begin{biographynophoto}{Jane Doe} +Biography text here. +\end{biographynophoto} + +% You can push biographies down or up by placing +% a \vfill before or after them. The appropriate +% use of \vfill depends on what kind of text is +% on the last page and whether or not the columns +% are being equalized. + +%\vfill + +% Can be used to pull up biographies so that the bottom of the last one +% is flush with the other column. +%\enlargethispage{-5in} + +\end{document} diff --git a/dot_vim/ftplugin/latex-suite/templates/article.tex b/dot_vim/ftplugin/latex-suite/templates/article.tex new file mode 100644 index 0000000..ea7e1d1 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/templates/article.tex @@ -0,0 +1,9 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[a4paper]{article} +\begin{document} +<++> +\end{document} diff --git a/dot_vim/ftplugin/latex-suite/templates/report.tex b/dot_vim/ftplugin/latex-suite/templates/report.tex new file mode 100644 index 0000000..479c7b3 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/templates/report.tex @@ -0,0 +1,9 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[a4paper]{report} +\begin{document} +<++> +\end{document} diff --git a/dot_vim/ftplugin/latex-suite/templates/report_two_column.tex b/dot_vim/ftplugin/latex-suite/templates/report_two_column.tex new file mode 100644 index 0000000..15bd95e --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/templates/report_two_column.tex @@ -0,0 +1,9 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[a4paper,twocolumn]{report} +\begin{document} +<++> +\end{document} diff --git a/dot_vim/ftplugin/latex-suite/texmenuconf.vim b/dot_vim/ftplugin/latex-suite/texmenuconf.vim new file mode 100644 index 0000000..405e46a --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/texmenuconf.vim @@ -0,0 +1,131 @@ +"============================================================================= +" File: texmenuconf.vim +" Author: Srinath Avadhanula +" Copyright: Vim charityware license. :help license +" Description: +" CVS: $Id: texmenuconf.vim 997 2006-03-20 09:45:45Z srinathava $ +" +"============================================================================= + +" Paths, crucial for functions +let s:path = expand("<sfile>:p:h") +let s:up_path = expand("<sfile>:p:h:h") +let s:mainmenuname = g:Tex_MenuPrefix.'S&uite.' +let s:mapleader = exists('mapleader') ? mapleader : "\\" + +" This glboal variable is incremented each time a top-level latex-suite menu +" is created. We should always use this variable for setting the locations of +" newly created top-level menus. +let g:Tex_NextMenuLocation = g:Tex_MainMenuLocation + +" The templates and macros menus are always nested within the main latex-suit +" menu. +let g:Tex_TemplatesMenuLocation = g:Tex_MainMenuLocation.'.20 '.s:mainmenuname.'&Templates.' +let g:Tex_MacrosMenuLocation = g:Tex_MainMenuLocation.'.20 '.s:mainmenuname.'&Macros.' + +" The packages menu can either be a child of the main menu or be a top-level +" menu by itself. +if g:Tex_NestPackagesMenu + let g:Tex_PackagesMenuLocation = (g:Tex_MainMenuLocation).'.10 '.s:mainmenuname.'&Packages.' +else + let g:Tex_PackagesMenuLocation = (g:Tex_NextMenuLocation).'.10 '.g:Tex_MenuPrefix.'Packages.' + let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 +endif + +" Environments are always a top-level menu. +let g:Tex_EnvMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix.'E&nvironments.' +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + +" Elements are always a top-level menu. +" If we choose to nest elements, then the top-level &TeX-Elements menu +" contains <Fonts / Counters / Dimensions> +" otherwise, the Fonts, Counters and Dimensions menus become top-level menus. +if g:Tex_NestElementMenus + let g:Tex_ElementsMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix.'E&lements.' +else + let g:Tex_ElementsMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix +endif +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + + +" Set up the compiler/viewer menus. {{{ +" +if has('gui_running') && g:Tex_Menus + exec 'anoremenu '.g:Tex_MainMenuLocation.'.25 '. s:mainmenuname.'-sepsuite0- :' + + " menus for compiling / viewing etc. + exec 'anoremenu '.g:Tex_MainMenuLocation.'.30 '.s:mainmenuname.'&Compile<tab>'.s:mapleader.'ll'. + \' :silent! call Tex_RunLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.40 '.s:mainmenuname.'&View<tab>'.s:mapleader.'lv'. + \' :silent! call Tex_ViewLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.50 '.s:mainmenuname.'&Search<tab>'.s:mapleader.'ls'. + \' :silent! call ForwardSearchLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.60 '.s:mainmenuname.'&Target\ Format<tab>:TTarget'. + \' :call SetTeXTarget()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.70 '.s:mainmenuname.'&Compiler\ Target<tab>:TCTarget'. + \' :call Tex_SetTeXCompilerTarget("Compile", "")<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.80 '.s:mainmenuname.'&Viewer\ Target<tab>:TVTarget'. + \' :call Tex_SetTeXCompilerTarget("View", "")<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.90 '.s:mainmenuname.'Set\ &Ignore\ Level<tab>:TCLevel'. + \' :TCLevel<CR>' + exec 'imenu '.g:Tex_MainMenuLocation.'.100 '.s:mainmenuname.'C&omplete\ Ref/Cite'. + \' <Plug>Tex_Completion' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.110 '.s:mainmenuname.'-sepsuite1- :' + " refreshing folds + if g:Tex_Folding + exec 'anoremenu '.g:Tex_MainMenuLocation.'.120 '.s:mainmenuname.'&Refresh\ Folds<tab>'.s:mapleader.'rf'. + \' :call MakeTexFolds(1)<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.130 '.s:mainmenuname.'-sepsuite2- :' + endif +endif + +" }}} + +" ============================================================================== +" MenuConf: configure the menus as compact/extended, with/without math +" ============================================================================== +function! Tex_MenuConfigure(type, action) " {{{ + let menuloc = s:mainmenuname.'Configure\ Menu.' + if a:type == 'math' + if a:action == 1 + let g:Tex_MathMenus = 1 + exe 'so '.s:path.'/mathmacros.vim' + exe 'amenu disable '.menuloc.'Add\ Math\ Menu' + exe 'amenu enable '.menuloc.'Remove\ Math\ Menu' + elseif a:action == 0 + call Tex_MathMenuRemove() + exe 'amenu enable '.menuloc.'Add\ Math\ Menu' + exe 'amenu disable '.menuloc.'Remove\ Math\ Menu' + endif + elseif a:type == 'elements' + if a:action == 'expand' + let g:Tex_ElementsMenuLocation = '80.20 '.g:Tex_MenuPrefix + exe 'amenu disable '.menuloc.'Expand\ Elements' + exe 'amenu enable '.menuloc.'Compress\ Elements' + elseif a:action == 'nest' + let g:Tex_ElementsMenuLocation = '80.20 '.g:Tex_MenuPrefix.'Elements.' + exe 'amenu enable '.menuloc.'Expand\ Elements' + exe 'amenu disable '.menuloc.'Compress\ Elements' + endif + exe 'source '.s:path.'/elementmacros.vim' + elseif a:type == 'packages' + if a:action == 1 + let g:Tex_PackagesMenu = 1 + exe 'so '.s:path.'/packages.vim' + exe 'amenu disable '.menuloc.'Load\ Packages\ Menu' + endif + endif +endfunction + +" }}} + +" configuration menu. +if g:Tex_Menus + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Add\ Math\ Menu :call Tex_MenuConfigure("math", 1)<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Remove\ Math\ Menu :call Tex_MenuConfigure("math", 0)<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Expand\ Elements :call Tex_MenuConfigure("elements", "expand")<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Compress\ Elements :call Tex_MenuConfigure("elements", "nest")<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Load\ Packages\ Menu :call Tex_MenuConfigure("packages", 1)<cr>' +endif + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/texproject.vim b/dot_vim/ftplugin/latex-suite/texproject.vim new file mode 100644 index 0000000..bed9ed3 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/texproject.vim @@ -0,0 +1,54 @@ +"============================================================================= +" File: texproject.vim +" Author: Mikolaj Machowski +" Version: 1.0 +" Created: Wen Apr 16 05:00 PM 2003 +" +" Description: Handling tex projects. +"============================================================================= + +let s:path = expand("<sfile>:p:h") + +command! -nargs=0 TProjectEdit :call <SID>Tex_ProjectEdit() + +" Tex_ProjectEdit: Edit project file " {{{ +" Description: If project file exists (*.latexmain) open it in window created +" with ':split', if no create ':new' window and read there +" project template +" +function! s:Tex_ProjectEdit() + + let file = expand("%:p") + let mainfname = Tex_GetMainFileName() + if glob(mainfname.'.latexmain') != '' + exec 'split '.Tex_EscapeSpaces(mainfname.'.latexmain') + else + echohl WarningMsg + echomsg "Master file not found." + echomsg " :help latex-master-file" + echomsg "for more information" + echohl None + endif + +endfunction " }}} +" Tex_ProjectLoad: loads the .latexmain file {{{ +" Description: If a *.latexmain file exists, then sources it +function! Tex_ProjectLoad() + let curd = getcwd() + call Tex_CD(expand('%:p:h')) + + if glob(Tex_GetMainFileName(':p').'.latexmain') != '' + call Tex_Debug("Tex_ProjectLoad: sourcing [".Tex_GetMainFileName().".latexmain]", "proj") + exec 'source '.Tex_GetMainFileName().'.latexmain' + endif + + call Tex_CD(curd) +endfunction " }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug("texproject.vim: catching LatexSuiteFileType event", "proj") | + \ call Tex_ProjectLoad() +augroup END + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/texrc b/dot_vim/ftplugin/latex-suite/texrc new file mode 100644 index 0000000..79068a8 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/texrc @@ -0,0 +1,738 @@ +"============================================================================= +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:ff=unix +" File: texrc.vim +" Author: Srinath Avadhanula +" Created: Mon Apr 01 11:00 AM 2002 PST +" CVS: $Id: texrc 998 2006-03-20 09:52:12Z srinathava $ +" +" Description: This file contains resource configuration information for the +" latex-suite package. +" +" NOTE: Do NOT be edit this file directly: +" this file will be over-written each time you install a new copy +" of latex-suite. +" +" You can do one of the following: +" 1. Copy this file into $VIMFILES/ftplugin/tex/texrc +" and edit the values in that file. +" $VIMFILES is ~/.vim for UNIX systems and ~/vimfiles for +" WINDOWS systems. +" +" 2. Just set values of each setting individually in your +" $VIMFILES/ftplugin/tex.vim file. (See above for what +" $VIMFILES is). You will need to use :let instead of :TexLet +" in this case. +" +" NOTE: This file is best viewed with Vim-6.0+ with folding turned on. +" CVS: $Id: texrc 998 2006-03-20 09:52:12Z srinathava $ +"============================================================================= + +" ============================================================================== +" SafeLet: checks for value before giving default value {{{ +" Description: The function takes in a single argument and splits it into 2 +" parts, the first being the first <CWORD> found. this is taken +" as a variable name and the next part is assigned to it +" depending on whether the variable already exists or not. +" handles the case where the next part is quoted or not. +" All these calls work: +" TexLet g:varname = 1 +" TexLet g:varname = '1' +" TexLet g:varname = 'foo bar' +" TexLet g:varname = "foo\nbar" +" TexLet g:varname = foo bar +function! <SID>SafeLet(arg) + let name = matchstr(a:arg, '^\s*\zs\(\S\+\)\ze\s*=') + let value = matchstr(a:arg, '=\s*\zs.*\ze') + let value = substitute(value, '\s*$', '', '') + if !exists(name) + if value =~ "^'\\|^\"" + exec "let ".name." = ".value + else + exe "let ".name." = value" + endif + endif +endfunction +com! -nargs=+ TexLet :call <SID>SafeLet(<q-args>) +" }}} +" ============================================================================== + +" ============================================================================== +" General settings {{{ + +TexLet g:Tex_UsePython = 1 + +" the system command which pulls in a file. +if &shell =~ 'sh' + TexLet g:Tex_CatCmd = 'cat' + TexLet g:Tex_RmCmd = 'rm' +else + TexLet g:Tex_CatCmd = 'type' + TexLet g:Tex_RmCmd = 'del' +endif + +" whether to turn on debugging +TexLet g:Tex_Debug = 0 +" If non empty, all the debugging information will be written to a file of +" this name. +TexLet g:Tex_DebugLog = '' + +" }}} +" ============================================================================== +" Rules: specifications of programs for compiling and viewing {{{ +" + +" By default, when you compile a tex file using \ll, then you will be +" generating a .dvi file. Change this line if you want to set another default. +" NOTE: Make sure that a target for this format exists in the 'Compiler rules' +" section below and is set up properly for your system. +if has('macunix') + TexLet g:Tex_DefaultTargetFormat = 'pdf' +else + TexLet g:Tex_DefaultTargetFormat = 'dvi' +endif + +" A comma seperated list of formats which need multiple compilations to be +" correctly compiled. +TexLet g:Tex_MultipleCompileFormats = 'dvi' + +" Uncomment this line if you compile ps files via dvi files. +" TexLet g:Tex_FormatDependency_ps = 'dvi,ps' + +" ------------------------------------------------------------------------------ +" Compiler rules {{{ +" This is the first thing you should customize. It is set up for most common +" values, but if use some other compiler, then you will want to change this. +" As CompileFlags value you'd perhaps like to use, e.g., '-src-specials', +" but it is known that it can sometimes give different results in the output, +" so use it with care. +TexLet g:Tex_CompileRule_dvi = 'latex -interaction=nonstopmode $*' +TexLet g:Tex_EscapeChars = '{}\' + +TexLet g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' + +" ways to generate pdf files. there are soo many... +" NOTE: pdflatex generates the same output as latex. therefore quickfix is +" possible. +TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*' + +" TexLet g:Tex_CompileRule_pdf = 'ps2pdf $*.ps' +" TexLet g:Tex_CompileRule_pdf = 'dvipdfm $*.dvi' +" TexLet g:Tex_CompileRule_pdf = 'dvipdf $*.dvi' + +TexLet g:Tex_CompileRule_html = 'latex2html $*.tex' + +TexLet g:Tex_CompileRule_bib = g:Tex_BibtexFlavor . ' $*' + +" Set Tex_UseMakefile to 0 if you want to ignore the presence of a Makefile +" when deciding how to compile +TexLet g:Tex_UseMakefile = 1 + +" }}} +" ------------------------------------------------------------------------------ +" Viewer rules {{{ +" these programs are for viewing other formats. +" NOTE: latex-suite will automatically append file.<format> to these functions +" when calling them. The viewer therefore cannot accept arguments after +" the filename. +" NOTE: Windows users: +" Set your $PATH variable to include the full path to these programs. +if has('win32') + TexLet g:Tex_ViewRule_ps = 'gsview32' + TexLet g:Tex_ViewRule_pdf = 'AcroRd32' + TexLet g:Tex_ViewRule_dvi = 'yap -1' +elseif has('macunix') + " Let the system pick. If you want, you can override the choice here. + TexLet g:Tex_ViewRule_ps = '' + TexLet g:Tex_ViewRule_pdf = '' + " TexLet g:Tex_ViewRule_pdf = 'Acrobat\ Reader\ 5.1' + TexLet g:Tex_ViewRule_dvi = '' +else + TexLet g:Tex_ViewRule_ps = 'ghostview' + TexLet g:Tex_ViewRule_pdf = 'xpdf' + TexLet g:Tex_ViewRule_dvi = 'xdvi' + " the option below specifies an editor for the dvi viewer while starting + " up the dvi viewer according to Dimitri Antoniou's tip on vim.sf.net (tip + " #225) + TexLet g:Tex_UseEditorSettingInDVIViewer = 0 +endif + +" Tex_ViewRuleComplete_{format} +" +" If a variable like this is specified, then it takes precedence over the +" variable with the same suffix defined above. i.e, Tex_ViewRuleComplete_dvi +" takes precedence over Tex_ViewRule_dvi. +" +" If only Tex_ViewRule_{format} is specified, then latex-suite constructs the +" actual system command which calls that program automatically. For example, +" if you specify Tex_ViewRule_dvi = 'kdvi', then latex-suite will issue the +" command +" !kdvi --unique file.dvi & +" +" However, if your viewer program accepts the file to be viewed in a way which +" doesn't fit with the way latex-suite constructs the system command, then +" specify it using this variable. You can use the same format here which +" 'makeprg' accepts. So $* can be used in place of the main file name. +" +" IMPORTANT: Make sure you make the process go into the background otherwise +" vim will wait for the viewer to terminate before letting you edit +" the file again. +" +" Example: +" Suppose you have a latex->html converter which converts a file say foo.tex +" to a file foo/index.html. Then you would use: +" +" let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &' +" +" Doing something like this would not be possible using Tex_ViewRule_html +TexLet g:Tex_ViewRuleComplete_dvi = '' + +" }}} +" ------------------------------------------------------------------------------ +" }}} +" ============================================================================== +" Compiler: latex-suite comes with a customizable compiler plugin. {{{ +" :help latex-compiling for a detailed description of these options. +" +" this is the list of patterns which will be ignored from the compiler output. +" This is a handy way of specifying which warnings/errors to ignore. This is a +" list of patterns seperated by '¡' +TexLet g:Tex_IgnoredWarnings = + \'Underfull'."\n". + \'Overfull'."\n". + \'specifier changed to'."\n". + \'You have requested'."\n". + \'Missing number, treated as zero.'."\n". + \'There were undefined references'."\n". + \'Citation %.%# undefined' + +" the 'ignore level' of the 'efm'. A value of 4 says that the first 4 kinds of +" warnings in the list above will be ignored. Use the command TCLevel to set a +" level dynamically. +TexLet g:Tex_IgnoreLevel = 7 + +" NOTE: The values of g:Tex_Flavor and g:Tex_CompilerFlags are provided as a +" way to make compiler/tex.vim standalone. i.e independent of the rest +" of latex-suite. These variables are NOT used if you have already +" defined g:Tex_CompileRule_dvi above. +" +" specifies the current latex flavor. +TexLet g:Tex_Flavor = 'latex' + +" specifies the BibTeX flavor and if necessary options. If you use $* in this +" setting, it will be replaced by the *root* of the main file name, i.e, if +" the main file is "thesis.tex", $* will be "thesis". +TexLet g:Tex_BibtexFlavor = 'bibtex' + +" specifies the MakeIndedx flavor and if necessary options. $* will be +" replaced by the *root* of the main file name. See above. +TexLet g:Tex_MakeIndexFlavor = 'makeindex $*.idx' + +" By default the program described by g:Tex_Flavor above is called with the +" flags '--src-specials --interaction=nonstopmode'. If your particular version +" of latex does not accept these arguments, you will need to set this variable +" to the appropriate value. +" NOTE: leave commented for using the default flags. +" TODO: Is it necessary (or even desirable) to use 2 variables to specify a +" flavor and flags seperately? --SA +" TexLet g:Tex_CompilerFlags = '' + +" If disabled (set to 0) LaTeX-Suite doesn't go immediately to warnings or +" errors after compilation +TexLet g:Tex_GotoError = 1 + +" If set to 1, then latex-suite shows the context of the error in a preview +" window beneath the window showing the actual errors. +TexLet g:Tex_ShowErrorContext = 1 + +" Remove temp files created during part compilations when vim exits. +TexLet g:Tex_RemoveTempFiles = 1 + +" }}} +" ============================================================================== +" Project: how to deal with multi file projects via latex-suite {{{ + +" Use a valid vim expression here if you want to customize the way latex-suite +" searches for a master file from within another file. +TexLet g:Tex_MainFileExpression = '' + +" }}} +" ============================================================================== +" Macros: latex-suite comes with a large number of macros to speed up typing {{{ +" latex. +" +" Place Holder Options: {{{ +" (See |placeholders| for a description of what place-holders are). +" +" these options are actually used by imaps.vim, therefore the prefix is Imap_ +" and not Tex_. See |placeholders| for a description of how to use +" place-holders. You can either completely disable placeholders (not +" recommended) and/or you can change the place holder characters. + +TexLet g:Imap_UsePlaceHolders = 1 +TexLet g:Imap_PlaceHolderStart = '<+' +TexLet g:Imap_PlaceHolderEnd = '+>' + +" This option when set to 1 makes <C-J> in insert mode delete +" non-descriptive (empty) placeholders and enters insert mode. +" NOTE: This option _has_ to be set in the .vimrc. Setting this in a filetype +" plugin file such as ftplugin/tex.vim will not have any affect. +TexLet g:Imap_DeleteEmptyPlaceHolders = 0 + +" When set to 1, in visual mode, <C-J> takes you to the next placeholder +" without deleting the current placeholder. +" NOTE: This option _has_ to be set in the .vimrc. Setting this in a filetype +" plugin file such as ftplugin/tex.vim will not have any affect. +TexLet g:Imap_StickyPlaceHolders = 1 + + +" }}} +" Menu Wizard Option: {{{ +" If the following variable is set to 1, then when an enviroment is chosen +" from the menu then for selected environments, latex-suite asks a series of +" questions on the command line and inserts a template with the corresponding +" fields already filled in. +" Setting this to zero will insert a template with |placeholders| marking off +" the places where fields need to be filled. +TexLet g:Tex_UseMenuWizard = 0 + +" }}} +" Visual Mode Mapping Correction: {{{ +" With so many visual maps, its helpful to have a way of catching typing +" errors made in visual mode. What this does is to prompt you to correct your +" visual mode mapping if you start out with g:Tex_Leader and then type some +" illegal keys. +" It basically maps just the g:Tex_Leader character to a function +TexLet g:Tex_CatchVisMapErrors = 1 + +" }}} +" Diacritics: {{{ +" whether or not you want to use diacritics +" (diacritics speed up typing some languages. the way they are set up in +" latex-suite is +" =char> = \'{<char>} +" +char> = \v{<char>} +" +} = \"a +" :o = \^o +" Default: 0 +TexLet g:Tex_Diacritics = 0 + +" }}} +" Leader Options: {{{ +" The mappings in latex-suite are by default prefixed with the back-tick +" character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the +" prefix with the following setting. +" ',', '/', '`' are preferred values. '' or '\' will lead to a _lot_ of +" trouble. +" g:Tex_Leader is also used for visual mode mappings for fonts. +TexLet g:Tex_Leader = '`' + +" In order to avoid ambiguity between the large number of visual mode macros +" provided, the visual mode macros for environments and sections start with a +" character different from '`'. +TexLet g:Tex_Leader2 = ',' + +" }}} +" Environment Macros: {{{ +" These mappings insert LaTeX "environments" such as +" \begin{center} +" <++> +" \end{center}<++> +" with the cursor left at the first place-holder. +" (See |placeholders| for what these are.) +" Mnemonic: +" 1. All environment mappings begin with 'E' +" 2. The next two capital letters are (for the common environments) the +" first 2 letters of the environment name converted into upper case. For +" example, for the center environment above, use ECE. There are a few +" necessary exceptions such as: +" equation --> EEQ +" eqnarray --> EEA +" Please see texmaps.vim for the complete list. +" +" Along with the insert mode mappings, a set of visual mode mappings is +" provided which encloses the visually selected region in an environment. +" These maps are related to the corresponding insert mode mappings by the +" following rule: +" EFI --> ,fi +" and so on. i.e, the leading E becomes '`' and the next 2 letters are small +" case. Some of the visual mode mappings are sensetive to whether you choose +" line-wise or character wise. For example, if you choose a word and press +" `ve, then you get \verb|word|, whereas if you press `ve on a line-wise +" selection, you get: +" \begin{verbatim} +" line +" \end{verbatim} +" +" these 2 options give finer control on which aspect of the macros you want +" to enable. +TexLet g:Tex_EnvironmentMaps = 1 +TexLet g:Tex_EnvironmentMenus = 1 + + +" }}} +" Font Macros: {{{ +" These mappings insert font descriptions such as: +" \textsf{<++>}<++> +" again with the cursor at the first place-holder. +" Mnemonic: +" 1. first letter is always F (F for font) +" 2. next 2 letters are the 2 letters describing the font. +" +" Example: the above mapping is triggered by FSF. +" +" Just like environment mappings, you can visually select an area and press +" `sf to have it enclosed in: +" \textsf{word} +" or +" {\sffamily +" line +" } +" depending on character-wise or line-wise selection. +TexLet g:Tex_FontMaps = 1 +TexLet g:Tex_FontMenus = 1 + +" }}} +" Section Macros: {{{ +" Inserts LaTeX sections: +" \section +" etc. Just as in the case of environments and fonts, can be enclosed with a +" visual selection. The enclosing is not sensetive to character or line-wise +" selection. +" NOTE: In visual mode, you are supposed to select the name of the section +" etc, not the whole section. +" In the following case, select just the first line, not lines 1-3. +" 1 section name +" 2 some lines in this section +" 3 and some more lines +" Mnemonic: (make your own!) +" SPA for part +" SCH for chapter +" SSE for section +" SSS for subsection +" SS2 for subsubsection +" SPG for paragraph +" SSP for subparagraph +TexLet g:Tex_SectionMaps = 1 +TexLet g:Tex_SectionMenus = 1 + +" }}} +" Auctex Style Mappings: {{{ +" Auctex.vim has heavily inspired various portions of latex-suite providing +" various new ways of conviniently inserting environments. +" +" If you press <F5> in the insert mode while on an empty line, latex-suite +" prompts you with a list of environments you might want to insert. You can +" either choose one from the list or type in a new environment name. +" The variable below (which is a comma seperated list of environment names) +" decides the prompt which latex-suite generates. +" You can place as many items as you want here. If the environment name is a +" standard latex environment such as table or figure, then latex-suite will +" insert a template with additional fields, if not, just a bare bones +" \begin{env} +" <++> +" \end{env} +" is inserted. +" \[ and $$ are also recognized. +" NOTE: Setting this variable to the empty string is a way of leaving the +" <F5> key unmapped + +TexLet g:Tex_PromptedEnvironments = + \ 'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*' + +" Another quick way of inserting environments is to press one of the shifted +" function keys from <F1> through <F4>. +" Each environment in the following list is mapped to a corresponding shifted +" function key. +" NOTE: Setting this variable to the empty string is a way of leaving all the +" shifted function keys untouched by latex-suite. +" NOTE: Only the first 4 items of the list are used. The rest will be silently +" ignored. +" The number of items in this list decides how many shifted function keys are +" mapped. +TexLet g:Tex_HotKeyMappings = + \ 'eqnarray*,eqnarray,bmatrix' + +" Similar to above mechanisms works <F7> key. It prompts for command with list +" of commands from g:Tex_PromptedCommands. There are not HotKeys for commands. +" It works for commands of style \com{}. Changing of current command is done +" with <S-F7> + +TexLet g:Tex_PromptedCommands = + \ 'footnote,cite,pageref,label' + +" }}} +" Smart Key Mappings: {{{ +" Latex-suite shites with a number of 'smart' maps, where the behavior of +" standard keys is modified in a way which makes editing tex files easy. + +" Pressing <BS> in insert mode checks to see whether we are just after +" something like \'{a} and if so, deletes all of it. i.e, diacritics are +" treated as single characters for backspacing. +" Setting this to zero will leave the <BS> key unmapped. +" Default: 1 +TexLet g:Tex_SmartKeyBS = 1 +" The pattern used to detect whether the previous characters comprise a +" diacritic character. This default pattern detects the standard LaTeX +" diacritics +TexLet g:Tex_SmartBSPattern = + \ '\(' . + \ "\\\\[\"^'=v]{\\S}" . '\|' . + \ "\\\\[\"^'=]\\S" . '\|' . + \ '\\v \S' . '\|' . + \ "\\\\[\"^'=v]{\\\\[iI]}" . '\|' . + \ '\\v \\[iI]' . '\|' . + \ '\\q \S' . '\|' . + \ '\\-' . + \ '\)' . "$" + +" Pressing " (english double quote) will insert `` or '' by making an +" intelligent guess about whether we intended to open or close a quote. +" Default: 1 +TexLet g:Tex_SmartKeyQuote = 1 + +" Users of other languages might want to change the quote characters to suit +" their locale. These global values will be ignored if there are buffer-local +" versions, which may be set in the language-specific package files, such as +" ftplugin/latex-suite/packages/german +TexLet g:Tex_SmartQuoteOpen = "``" +TexLet g:Tex_SmartQuoteClose = "''" + +" Latex-suite maps the <space> key in such a way that $ characters are not +" broken across lines. +" NOTE: Setting this to 1 has the side-effect of making the 'tw' setting be 0. +" Default: +TexLet g:Tex_SmartKeySpace = 0 + +" Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math +" mode. +" +" TODO: Make it more intelligent within math mode. For example +" $1+...+3$ should expand to $1+\cdots+n$, whereas $1,...,n$ should expand +" to $1,\ldots,n$. The amsmath package actually provides a command \dots +" which does this. Maybe use that if amsmath is detected? +" Default: 1 +TexLet g:Tex_SmartKeyDot = 1 + +" }}} +" Advanced Math: {{{ +" These mappings allow for fast inserting of math constructions +" brackets, better handling of space in math mode, unfortunately +" they use <M-> mappings which conflicts with some encodings. This is easy way +" of turning them off. +" +" <M-b> encloses the previous character in \mathbf{} +" <M-c> is polymorphic as follows: +" Insert mode: +" 1. If the previous character is a letter or number, then capitalize it and +" enclose it in \mathcal{} +" 2. otherwise insert \cite{} +" Visual Mode: +" 1. Enclose selection in \mathcal{} +" <M-l> is also polymorphic as follows: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(\right +" similarly for [, | +" {<M-l> \left\{\right\} +" 2. <<M-l> \langle\rangle +" 3. q<M-l> \lefteqn{} +" otherwise insert \label{} +" <M-i> inserts \item commands at the current cursor location depending on +" the surrounding environment. For example, inside itemize, it will +" insert a simple \item, but within a description, it will insert +" \item[<+label+>] etc. +" +" Default: 1 +TexLet g:Tex_AdvancedMath = 1 + +" }}} + +" }}} +" ============================================================================== +" TeX Completion: {{{ + +" Options for controlling the window sizes of the completion windows {{{ + +" The height of the window which contains the \label's (when completing a +" \ref) or bibtex entries (when completing a \cite). This option is used in +" the newer methods of completing \ref's and \cite's. +TexLet g:Tex_OutlineWindowHeight = 15 + +" Options for preview window for ref/cite completion. The next two options +" are used only when g:Tex_UseOutlineCompletion = 0 or +" g:Tex_UseCiteCompletionVer2 = 0, i.e, when we use a classic method of +" completing \refs and \cites. +" Height of cwindow +TexLet g:Tex_ViewerCwindowHeight = 5 +" Height of preview window +TexLet g:Tex_ViewerPreviewHeight = 10 + +" Options for explorer completion. +" Height of explorer window +TexLet g:Tex_ExplorerHeight = 10 + +" Directory for images. Read |latex-completion-explorer| before changing +TexLet g:Tex_ImageDir = '' + +" }}} +" Options for completing a \ref {{{ + +" Whether to use the "outline mode" for displaying the \label's while doing +" \ref completion. In this mode, each label is displayed within the +" document element it resides in. The entire thing is folded to ease +" navigation. Should be easier/faster than the classical mode. +TexLet g:Tex_UseOutlineCompletion = 1 + +" This option should be set via the .latexmain file. It should be a newline +" seperated list of files which make up all the "source" files in the +" current project. This enables latex-suite to skip the more complicated +" algorithm of finding the source files by recursively searching for +" \input'ed files from the |latex-master-file|. +" +" Only used when g:Tex_UseOutlineCompletion = 0. +TexLet g:Tex_ProjectSourceFiles = '' + +" Whether latex-suite simply searches for \\label's in all the .tex file +" found in the current directory or whether it will use a more complex +" algorithm. This is used only g:Tex_UseOutlineCompletion = 0 and +" g:Tex_ProjectSourceFiles = ''. +" See +" :help Tex_UseSimpleLabelSearch +" for more information +TexLet g:Tex_UseSimpleLabelSearch = 0 + +" }}} +" Options for completing a \cite'ation {{{ + +" If set to 1, then the newer way of presenting the bibtex entries is used. +" Instead of a |cwindow| showing just the keys and a synced |preview| +" window beneath, show a single window containing a nicely formatted list +" of bibtex entries. This should be faster and easier to use than the +" classic mode +TexLet g:Tex_UseCiteCompletionVer2 = 1 + +" This is a string which is displayed to the user when he wants to sort or +" filter the bibtex entries. This string also serves to define acronyms for +" the various fields of a bibtex entry. +TexLet g:Tex_BibFieldPrompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + +" Whether or not to display the string above to aid the user in choosing +" the field to filter/sort with. +TexLet g:Tex_EchoBibFields = 1 + +" A setting of this form defines the letter 'a' as standing for the field +" 'author'. Thus when the user types +" a ellington +" when asked to enter a filter, it is equivalent to the user specifying the +" filter +" author ellington +" TexLet g:Tex_BibAcronym_a = 'author' + +" Whether or not to use Jabref to complete citations +" See +" :help latex-suite-jabref +" for more infomration +TexLet g:Tex_UseJabref = 0 + +" whether or not searches for \cite's are cached. +TexLet g:Tex_RememberCiteSearch = 0 +" Paths to the bibliography files and custom packages. +TexLet g:Tex_BIBINPUTS = '' +TexLet g:Tex_TEXINPUTS = '' + +" }}} + +" }}} +" ============================================================================== +" Menus: set the kinds of menus which you would like to see. {{{ +" +" Setting this variable to zero will immediately disable _all_ menus. +" for finer control set this to 1 and then play with the other options. +" Default: 1 +TexLet g:Tex_Menus = 1 + +" The location of the main menu +TexLet g:Tex_MainMenuLocation = 80 + +" Math contains a large number of tex math elemets such as arrows, +" mathematical fonts (\mathrm), mathematical diacritics (\dot), binary +" relational operators etc. This menu compromises about 75% of the menus. +" Default: 1 +TexLet g:Tex_MathMenus = 1 + +" The following options control the "compactness" of the menus. +" +" Setting this option to 1 makes the Font, Counter and Dimensioning menus to +" be collected together into a single 'Tex-Elements' menu. Setting this to 0 +" creates seperate menus for each of them. +" Default: 1 +TexLet g:Tex_NestElementMenus = 1 + +" Sometimes when you are using a lot of packages with lots of options etc, +" then a lot of time might be spent at startup loading the menus. +" Setting the following variable to 0 will stop autoloading the packages menu. +" You can still goto TeX-Suite.Configure Menu and load this after startup. +" Default: 1 +TexLet g:Tex_PackagesMenu = 1 +" The following option will create the packages option within the TeX-Suite +" menu. +" Default: 1 +TexLet g:Tex_NestPackagesMenu = 1 + +" This is the prefix added to the menu names created by latex suite. Add a +" dot to the following option to nest the menus under the menu name before the +" dot. +" NOTE: With a '.' as the last character of the following setting, every +" single menu created by latex suite will be nested under the same menu. +" Default: 'TeX-' +TexLet g:Tex_MenuPrefix = 'TeX-' + +" Use utf-8 menus. There is plenty of math symbols in LaTeX. It is hard to +" remember them. You can display them with utf-8. Your system/GUI interface +" have to support utf-8. This addition is necessary for resetting 'encoding'. +TexLet g:Tex_UseUtfMenus = 0 + +if g:Tex_UseUtfMenus != 0 && has("gui_running") + set encoding=utf-8 +endif + +" }}} +" ============================================================================== +" Folding: latex-suite comes with 'fake' syntax folding. {{{ +" +" specifies whether the MakeTeXFolds() function will be defined. If this is +" set to zero, then esentially you have disabled all of latex-suite's folding +" functions. no maps for refreshing folds will be set up etc. +" NOTE: However, the function TexFoldTextFunction() is still avaiable +" and 'foldexpr' is set to point to it. This is so you can continue +" using another folding scheme but still use the fold text function. +TexLet g:Tex_Folding = 1 + +" specifies whether a latex file is automatically folded up when opened. +" Setting this to zero means that a file is not folded up as soon as its +" opened. +" NOTE: the MakeTeXFolds() function will still be available (unless disabled +" by g:Tex_Folding), so you can do <F6> or \rf to refresh/create folds. +TexLet g:Tex_AutoFolding = 1 + +" }}} +" ============================================================================== +" Taglist: Support for taglist.vim {{{ +" +" LaTeX-Suite offers now support for taglist.vim, the most popular Vim +" interface for ctags. You should use ctags version >= 5.0 and taglist >= 3.0. +TexLet g:Tex_TaglistSupport = 1 + +" This option turns on definition of tags for LaTeX. +" NOTE: In taglist window you may see duplicate entries for the same tag. It +" means some definitions are repeated somewhere else. You can turn off +" internal definitions or remove external (read ctags description +" where). +TexLet g:Tex_InternalTagsDefinitions = 1 + +" }}} +" ============================================================================== diff --git a/dot_vim/ftplugin/latex-suite/texviewer.vim b/dot_vim/ftplugin/latex-suite/texviewer.vim new file mode 100644 index 0000000..4dc8861 --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/texviewer.vim @@ -0,0 +1,1052 @@ +" ============================================================================ +" File: texviewer.vim +" Author: Mikolaj Machowski +" Created: Sun Jan 26 06:00 PM 2003 +" Description: make a viewer for various purposes: \cite{, \ref{ +" License: Vim Charityware License +" Part of vim-latexSuite: http://vim-latex.sourceforge.net +" CVS: $Id: texviewer.vim 1004 2006-03-25 08:40:15Z srinathava $ +" ============================================================================ +" Tex_SetTexViewerMaps: sets maps for this ftplugin {{{ +function! Tex_SetTexViewerMaps() + inoremap <silent> <Plug>Tex_Completion <Esc>:call Tex_Complete("default","text")<CR> + if !hasmapto('<Plug>Tex_Completion', 'i') + if has('gui_running') + imap <buffer> <silent> <F9> <Plug>Tex_Completion + else + imap <buffer> <F9> <Plug>Tex_Completion + endif + endif +endfunction + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('texviewer.vim: Catching LatexSuiteFileType event', 'view') | + \ call Tex_SetTexViewerMaps() +augroup END + +command -nargs=1 TLook call Tex_Complete(<q-args>, 'tex') +command -nargs=1 TLookAll call Tex_Complete(<q-args>, 'all') +command -nargs=1 TLookBib call Tex_Complete(<q-args>, 'bib') + +" }}} + +" ============================================================================== +" Main completion function +" ============================================================================== +" Tex_Complete: main function {{{ +" Description: +function! Tex_Complete(what, where) + + " Get info about current window and position of cursor in file + let s:winnum = winnr() + + " Change to the directory of the file being edited before running all the + " :grep commands. We will change back to the original directory after we + " finish with the grep. + let s:origdir = getcwd() + cd %:p:h + + let s:pos = line('.').' | normal! '.virtcol('.').'|' + + unlet! s:type + unlet! s:typeoption + + if Tex_GetVarValue('Tex_WriteBeforeCompletion') == 1 + wall + endif + + if a:where == "text" + " What to do after <F9> depending on context + let s:curfile = expand("%:p") + let s:curline = strpart(getline('.'), 0, col('.')) + let s:prefix = matchstr(s:curline, '.*{\zs.\{-}\(}\|$\)') + " a command is of the type + " \psfig[option=value]{figure=} + " Thus + " s:curline = '\psfig[option=value]{figure=' + " (with possibly some junk before \psfig) + " from which we need to extract + " s:type = 'psfig' + " s:typeoption = '[option=value]' + let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\S\+\)\?$' + if s:curline =~ pattern + let s:type = substitute(s:curline, pattern, '\1', 'e') + let s:typeoption = substitute(s:curline, pattern, '\2', 'e') + call Tex_Debug('Tex_Complete: s:type = '.s:type.', typeoption = '.s:typeoption, 'view') + endif + + if exists("s:type") && s:type =~ 'ref' + if Tex_GetVarValue('Tex_UseOutlineCompletion') == 1 + call Tex_Debug("Tex_Complete: using outline search method", "view") + call Tex_StartOutlineCompletion() + + elseif Tex_GetVarValue('Tex_UseSimpleLabelSearch') == 1 + call Tex_Debug("Tex_Complete: searching for \\labels in all .tex files in the present directory", "view") + call Tex_Debug("Tex_Complete: silent! grep! ".Tex_EscapeForGrep('\\label{'.s:prefix)." *.tex", 'view') + call Tex_Grep('\\label{'.s:prefix, '*.tex') + call <SID>Tex_SetupCWindow() + + elseif Tex_GetVarValue('Tex_ProjectSourceFiles') != '' + call Tex_Debug('Tex_Complete: searching for \\labels in all Tex_ProjectSourceFiles', 'view') + call Tex_CD(Tex_GetMainFileName(':p:h')) + call Tex_Grep('\\label{'.s:prefix, Tex_GetVarValue('Tex_ProjectSourceFiles')) + call <SID>Tex_SetupCWindow() + + else + call Tex_Debug("Tex_Complete: calling Tex_GrepHelper", "view") + silent! grep! ____HIGHLY_IMPROBABLE___ % + call Tex_GrepHelper(s:prefix, 'label') + call <SID>Tex_SetupCWindow() + endif + + redraw! + + elseif exists("s:type") && s:type =~ 'cite' + + let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') + call Tex_Debug(":Tex_Complete: using s:prefix = ".s:prefix, "view") + + if has('python') && Tex_GetVarValue('Tex_UsePython') + \ && Tex_GetVarValue('Tex_UseCiteCompletionVer2') == 1 + + call Tex_CD(s:origdir) + silent! call Tex_StartCiteCompletion() + + elseif Tex_GetVarValue('Tex_UseJabref') == 1 + + call Tex_CD(s:origdir) + let g:Remote_WaitingForCite = 1 + let citation = input('Enter citation from jabref (<enter> to leave blank): ') + let g:Remote_WaitingForCite = 0 + call Tex_CompleteWord(citation) + + else + " grep! nothing % + " does _not_ clear the search history contrary to what the + " help-docs say. This was expected. So use something improbable. + " TODO: Is there a way to clear the search-history w/o making a + " useless, inefficient search? + silent! grep! ____HIGHLY_IMPROBABLE___ % + if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') + call <SID>Tex_SetupCWindow(s:citeSearchHistory) + else + call Tex_GrepHelper(s:prefix, 'bib') + redraw! + call <SID>Tex_SetupCWindow() + endif + if g:Tex_RememberCiteSearch && &ft == 'qf' + let _a = @a + silent! normal! ggVG"ay + let s:citeSearchHistory = @a + let @a = _a + endif + endif + + elseif exists("s:type") && (s:type =~ 'includegraphics' || s:type == 'psfig') + call Tex_SetupFileCompletion( + \ '', + \ '^\.\\|\.tex$\\|\.bib$\\|\.bbl$\\|\.zip$\\|\.gz$', + \ 'noext') + + elseif exists("s:type") && s:type == 'bibliography' + call Tex_SetupFileCompletion( + \ '\.b..$', + \ '', + \ 'noext') + + elseif exists("s:type") && s:type =~ 'include\(only\)\=' + call Tex_SetupFileCompletion( + \ '\.t..$', + \ '', + \ 'noext') + + elseif exists("s:type") && s:type == 'input' + call Tex_SetupFileCompletion( + \ '', + \ '', + \ 'ext') + + elseif exists('s:type') && exists("g:Tex_completion_".s:type) + call <SID>Tex_CompleteRefCiteCustom('plugin_'.s:type) + + else + let s:word = expand('<cword>') + if s:word == '' + if col('.') == strlen(getline('.')) + startinsert! + return + else + normal! l + startinsert + return + endif + endif + call Tex_Debug("silent! grep! ".Tex_EscapeForGrep('\<'.s:word.'\>')." *.tex", 'view') + call Tex_Grep('\<'.s:word.'\>', '*.tex') + + call <SID>Tex_SetupCWindow() + endif + + elseif a:where == 'tex' + " Process :TLook command + call Tex_Grep(a:what, "*.tex") + call <SID>Tex_SetupCWindow() + + elseif a:where == 'bib' + " Process :TLookBib command + call Tex_Grep(a:what, "*.bib") + call Tex_Grepadd(a:what, "*.bbl") + call <SID>Tex_SetupCWindow() + + elseif a:where == 'all' + " Process :TLookAll command + call Tex_Grep(a:what, "*") + call <SID>Tex_SetupCWindow() + endif + +endfunction +" }}} +" Tex_CompleteWord: inserts a word at the chosen location {{{ +" Description: This function is meant to be called when the user press +" ``<enter>`` in one of the [Error List] windows which shows the list of +" matches. completeword is the rest of the word which needs to be inserted. +function! Tex_CompleteWord(completeword) + exe s:pos + + " Complete word, check if add closing } + exe 'normal! a'.a:completeword."\<Esc>" + + if getline('.')[col('.')-1] !~ '{' && getline('.')[col('.')] !~ '}' + exe "normal! a}\<Esc>" + endif + + " Return to Insert mode + if col('.') == strlen(getline('.')) + startinsert! + else + normal! l + startinsert + endif +endfunction " }}} + +" ============================================================================== +" File name completion helper functons +" ============================================================================== +" Tex_SetupFileCompletion: {{{ +" Description: +function! Tex_SetupFileCompletion(accept, reject, ext) + call FB_SetVar('FB_AllowRegexp', a:accept) + call FB_SetVar('FB_RejectRegexp', a:reject) + call FB_SetVar('FB_CallBackFunction', 'Tex_CompleteFileName') + call FB_SetVar('FB_CallBackFunctionArgs', '"'.a:ext.'"') + + call FB_OpenFileBrowser('.') +endfunction " }}} +" Tex_CompleteFileName: {{{ +" Description: +function! Tex_CompleteFileName(filename, ext) + call Tex_Debug('+Tex_CompleteFileName: getting filename '.a:filename, 'view') + + if a:ext == 'noext' + let completeword = fnamemodify(a:filename, ':r') + endif + let completeword = Tex_RelPath(completeword, Tex_GetMainFileName(':p:h')) + + call Tex_Debug(":Tex_CompleteFileName: completing with ".completeword, "view") + call Tex_CompleteWord(completeword) +endfunction " }}} +" Tex_Common: common part of strings {{{ +function! s:Tex_Common(path1, path2) + " Assume the caller handles 'ignorecase' + if a:path1 == a:path2 + return a:path1 + endif + let n = 0 + while a:path1[n] == a:path2[n] + let n = n+1 + endwhile + return strpart(a:path1, 0, n) +endfunction " }}} +" Tex_NormalizePath: {{{ +" Description: +function! Tex_NormalizePath(path) + let retpath = a:path + if has("win32") || has("win16") || has("dos32") || has("dos16") + let retpath = substitute(retpath, '\\', '/', 'ge') + endif + if isdirectory(retpath) && retpath !~ '/$' + let retpath = retpath.'/' + endif + return retpath +endfunction " }}} +" Tex_RelPath: ultimate file name {{{ +function! Tex_RelPath(explfilename,texfilename) + let path1 = Tex_NormalizePath(a:explfilename) + let path2 = Tex_NormalizePath(a:texfilename) + + let n = matchend(<SID>Tex_Common(path1, path2), '.*/') + let path1 = strpart(path1, n) + let path2 = strpart(path2, n) + if path2 !~ '/' + let subrelpath = '' + else + let subrelpath = substitute(path2, '[^/]\{-}/', '../', 'ge') + let subrelpath = substitute(subrelpath, '[^/]*$', '', 'ge') + endif + let relpath = subrelpath.path1 + return escape(Tex_NormalizePath(relpath), ' ') +endfunction " }}} + +" ============================================================================== +" Helper functions for dealing with the 'quickfix' and 'preview' windows. +" ============================================================================== +" Tex_SetupCWindow: set maps and local settings for cwindow {{{ +" Description: Set local maps jkJKq<cr> for cwindow. Also size and basic +" settings +" +function! s:Tex_SetupCWindow(...) + call Tex_Debug('+Tex_SetupCWindow', 'view') + cclose + exe 'copen '. g:Tex_ViewerCwindowHeight + " If called with an argument, it means we want to re-use some search + " history from last time. Therefore, just paste it here and proceed. + if a:0 == 1 + set modifiable + % d _ + silent! 0put!=a:1 + $ d _ + endif + setlocal nonumber + setlocal nowrap + + let s:scrollOffVal = &scrolloff + call <SID>Tex_SyncPreviewWindow() + + " If everything went well, then we should be situated in the quickfix + " window. If there were problems, (no matches etc), then we will not be. + " Therefore return. + if &ft != 'qf' + call Tex_Debug('not in quickfix window, quitting', 'view') + return + endif + + nnoremap <buffer> <silent> j j:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> k k:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> <up> <up>:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> <down> <down>:call <SID>Tex_SyncPreviewWindow()<CR> + + " Change behaviour of <cr> only for 'ref' and 'cite' context. + if exists("s:type") && s:type =~ 'ref\|cite' + exec 'nnoremap <buffer> <silent> <cr> ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':silent! call <SID>Tex_CompleteRefCiteCustom("'.s:type.'")<CR>' + + else + " In other contexts jump to place described in cwindow and close small + " windows + exec 'nnoremap <buffer> <silent> <cr> ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':call <SID>Tex_GoToLocation()<cr>' + + endif + + " Scroll the preview window while in the quickfix window + nnoremap <buffer> <silent> J :wincmd j<cr><c-e>:wincmd k<cr> + nnoremap <buffer> <silent> K :wincmd j<cr><c-y>:wincmd k<cr> + + " Exit the quickfix window without doing anything. + exe 'nnoremap <buffer> <silent> q ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':call Tex_CloseSmallWindows()<CR>' + +endfunction " }}} +" Tex_CompleteRefCiteCustom: complete/insert name for current item {{{ +" Description: handle completion of items depending on current context +" +function! s:Tex_CompleteRefCiteCustom(type) + + if a:type =~ 'cite' + if getline('.') =~ '\\bibitem{' + let bibkey = matchstr(getline('.'), '\\bibitem{\zs.\{-}\ze}') + else + let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze\(,\|$\)') + endif + let completeword = strpart(bibkey, strlen(s:prefix)) + + elseif a:type =~ 'ref' + let label = matchstr(getline('.'), '\\label{\zs.\{-}\ze}') + let completeword = strpart(label, strlen(s:prefix)) + + elseif a:type =~ '^plugin_' + let type = substitute(a:type, '^plugin_', '', '') + let completeword = <SID>Tex_DoCompletion(type) + + endif + + call Tex_CloseSmallWindows() + call Tex_Debug(":Tex_CompleteRefCiteCustom: completing with ".completeword, "view") + call Tex_CompleteWord(completeword) +endfunction " }}} +" Tex_SyncPreviewWindow: synchronize quickfix and preview window {{{ +" Description: Usually quickfix engine takes care about most of these things +" but we discard it for better control of events. +" +function! s:Tex_SyncPreviewWindow() + call Tex_Debug('+Tex_SyncPreviewWindow', 'view') + + let viewfile = matchstr(getline('.'), '^\f*\ze|\d') + let viewline = matchstr(getline('.'), '|\zs\d\+\ze') + + " Hilight current line in cwindow + " Normally hightlighting is done with quickfix engine but we use something + " different and have to do it separately + syntax clear + runtime syntax/qf.vim + exe 'syn match vTodo /\%'. line('.') .'l.*/' + hi link vTodo Todo + + " Close preview window and open it again in new place + pclose + exe 'silent! bot pedit +'.viewline.' '.viewfile + + " Vanilla 6.1 has bug. This additional setting of cwindow height prevents + " resizing of this window + exe g:Tex_ViewerCwindowHeight.' wincmd _' + + " Handle situation if there is no item beginning with s:prefix. + " Unfortunately, because we know it late we have to close everything and + " return as in complete process + if v:errmsg =~ 'E32\>' + exe s:winnum.' wincmd w' + pclose! + cclose + if exists("s:prefix") + echomsg 'No bibkey, label or word beginning with "'.s:prefix.'"' + endif + if col('.') == strlen(getline('.')) + startinsert! + else + normal! l + startinsert + endif + let v:errmsg = '' + call Tex_Debug('Tex_SyncPreviewWindow: got error E32, no matches found, quitting', 'view') + return 0 + endif + + " Move to preview window. Really is it under cwindow? + wincmd j + + " Settings of preview window + exe g:Tex_ViewerPreviewHeight.' wincmd _' + setlocal nofoldenable + + if exists('s:type') && s:type =~ 'cite' + " In cite context place bibkey at the top of preview window. + setlocal scrolloff=0 + normal! zt + else + " In other contexts in the middle. Highlight this line? + setlocal scrolloff=100 + normal! z. + endif + + " Return to cwindow + wincmd p + +endfunction " }}} +" Tex_CloseSmallWindows: {{{ +" Description: +" +function! Tex_CloseSmallWindows() + exe s:winnum.' wincmd w' + pclose! + cclose + exe s:pos +endfunction " }}} +" Tex_GoToLocation: Go to chosen location {{{ +" Description: Get number of current line and go to this number +" +function! s:Tex_GoToLocation() + pclose! + let errmsg = v:errmsg + let v:errmsg = '' + exe 'silent! cc ' . line('.') + " If the current buffer is modified, then split + if v:errmsg =~ '^E37:' + split + exe 'silent! cc ' . line('.') + endif + cclose + let v:errmsg = errmsg +endfunction " }}} + +" ============================================================================== +" Functions for finding \\label's or \\bibitem's in the main file. +" ============================================================================== +" Tex_GrepHelper: grep main filename for \\bibitem's or \\label's {{{ +" Description: +function! Tex_GrepHelper(prefix, what) + let _path = &path + let _suffixesadd = &suffixesadd + let _hidden = &hidden + + let mainfname = Tex_GetMainFileName(':p') + " If we are already editing the file, then use :split without any + " arguments so it works even if the file is modified. + " FIXME: If mainfname is being presently edited in another window and + " is 'modified', then the second split statement will not work. + " We will need to travel to that window and back. + if mainfname == expand('%:p') + split + else + exec 'split '.Tex_EscapeSpaces(mainfname) + endif + + let pos = line('.').'| normal! '.virtcol('.').'|' + if a:what =~ 'bib' + call Tex_ScanFileForCite(a:prefix) + else + call Tex_ScanFileForLabels(a:prefix) + endif + exec pos + + q + let &path = _path + let &suffixesadd = _suffixesadd + +endfunction " }}} +" Tex_ScanFileForCite: search for \bibitem's in .bib or .bbl or tex files {{{ +" Description: +" Search for bibliographic entries in the presently edited file in the +" following manner: +" 1. First see if the file has a \bibliography command. +" If YES: +" 1. If a .bib file corresponding to the \bibliography command can be +" found, then search for '@.*'.a:prefix inside it. +" 2. Otherwise, if a .bbl file corresponding to the \bibliography command +" can be found, then search for '\bibitem'.a:prefix inside it. +" 2. Next see if the file has a \thebibliography environment +" If YES: +" 1. Search for '\bibitem'.a:prefix in this file. +" +" If neither a \bibliography or \begin{thebibliography} are found, then repeat +" steps 1 and 2 for every file \input'ed into this file. Abort any searching +" as soon as the first \bibliography or \begin{thebibliography} is found. +function! Tex_ScanFileForCite(prefix) + call Tex_Debug('+Tex_ScanFileForCite: searching for bibkeys in '.bufname('%').' (buffer #'.bufnr('%').')', 'view') + let presBufNum = bufnr('%') + + let foundCiteFile = 0 + " First find out if this file has a \bibliography command in it. If so, + " assume that this is the only file in the project which defines a + " bibliography. + if search('\\\(no\)\?bibliography{', 'w') + call Tex_Debug('Tex_ScanFileForCite: found bibliography command in '.bufname('%'), 'view') + " convey that we have found a bibliography command. we do not need to + " proceed any further. + let foundCiteFile = 1 + + " extract the bibliography filenames from the command. + let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') + let bibnames = substitute(bibnames, '\s', '', 'g') + + call Tex_Debug('trying to search through ['.bibnames.']', 'view') + + let &path = '.,'.g:Tex_BIBINPUTS + + let i = 1 + while 1 + let bibname = Tex_Strntok(bibnames, ',', i) + if bibname == '' + break + endif + + " first try to find if a .bib file exists. If so do not search in + " the corresponding .bbl file. (because the .bbl file will most + " probly be generated automatically from the .bib file with + " bibtex). + + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bib') + if fname != '' + call Tex_Debug('finding .bib file ['.bufname('%').']', 'view') + exec 'split '.Tex_EscapeSpaces(fname) + call Tex_Grepadd('@.*{'.a:prefix, "%") + q + else + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bbl') + if fname != '' + exec 'split '.Tex_EscapeSpaces(fname) + call Tex_Debug('finding .bbl file ['.bufname('.').']', 'view') + call Tex_Grepadd('\\bibitem{'.a:prefix, "%") + q + endif + endif + + let i = i + 1 + endwhile + + if foundCiteFile + return 1 + endif + endif + + " If we have a thebibliography environment, then again assume that this is + " the only file which defines the bib-keys. Aand convey this information + " upwards by returning 1. + if search('^\s*\\begin{thebibliography}', 'w') + call Tex_Debug('got a thebibliography environment in '.bufname('%'), 'view') + + let foundCiteFile = 1 + + split + lcd %:p:h + call Tex_Debug("silent! grepadd! ".Tex_EscapeForGrep('\\bibitem{'.a:prefix)." %", 'view') + call Tex_Grepadd('\\bibitem{'.a:prefix, "%") + q + + return 1 + endif + + " If we have not found any \bibliography or \thebibliography environment + " in this file, search for these environments in all the files which this + " file includes. + + exec 0 + let wrap = 'w' + while search('^\s*\\\(input\|include\)', wrap) + let wrap = 'W' + + let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') + + let foundfile = Tex_FindFile(filename, '.,'.g:Tex_TEXINPUTS, '.tex') + if foundfile != '' + exec 'split '.Tex_EscapeSpaces(foundfile) + call Tex_Debug('scanning recursively in ['.foundfile.']', 'view') + let foundCiteFile = Tex_ScanFileForCite(a:prefix) + q + endif + + if foundCiteFile + return 1 + endif + endwhile + + + return 0 +endfunction " }}} +" Tex_ScanFileForLabels: greps present file and included files for \\label's {{{ +" Description: +" Grep the presently edited file for \\label's. If the present file \include's +" or \input's other files, then recursively scan those as well, i.e we support +" arbitrary levels of \input'ed-ness. +function! Tex_ScanFileForLabels(prefix) + call Tex_Debug("+Tex_ScanFileForLabels: grepping in file [".bufname('%')."]", "view") + + lcd %:p:h + call Tex_Grepadd('\\label{'.a:prefix, "%") + + " Then recursively grep for all \include'd or \input'ed files. + exec 0 + let wrap = 'w' + while search('^\s*\\\(input\|include\)', wrap) + let wrap = 'W' + + let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') + let foundfile = Tex_FindFile(filename, '.,'.Tex_TEXINPUTS, '.tex') + if foundfile != '' + exec 'split '.Tex_EscapeSpaces(foundfile) + call Tex_Debug('Tex_ScanFileForLabels: scanning recursively in ['.foundfile.']', 'view') + call Tex_ScanFileForLabels(a:prefix) + q + endif + endwhile + +endfunction " }}} + +" ============================================================================== +" Functions for custom command completion +" ============================================================================== +" Tex_completion_{var}: similar variables can be set in package files {{{ +let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt' +let g:Tex_completion_addtocontents = 'lof}{,lot}{,toc}{' +let g:Tex_completion_addcontentsline = 'lof}{figure}{,lot}{table}{,toc}{chapter}{,toc}{part}{,'. + \ 'toc}{section}{,toc}{subsection}{,toc}{paragraph}{,'. + \ 'toc}{subparagraph}{' +" }}} +" Tex_PromptForCompletion: prompts for a completion {{{ +" Description: +function! s:Tex_PromptForCompletion(texcommand,ask) + + let common_completion_prompt = + \ Tex_CreatePrompt(g:Tex_completion_{a:texcommand}, 2, ',') . "\n" . + \ 'Enter number or completion: ' + + let inp = input(a:ask."\n".common_completion_prompt) + if inp =~ '^[0-9]\+$' + let completion = Tex_Strntok(g:Tex_completion_{a:texcommand}, ',', inp) + else + let completion = inp + endif + + return completion +endfunction " }}} +" Tex_DoCompletion: fast insertion of completion {{{ +" Description: +" +function! s:Tex_DoCompletion(texcommand) + let completion = <SID>Tex_PromptForCompletion(a:texcommand, 'Choose a completion to insert: ') + if completion != '' + return completion + else + return '' + endif +endfunction " }}} + +" ============================================================================== +" Functions for presenting an outlined version for completion +" ============================================================================== +" Tex_StartOutlineCompletion: sets up an outline window {{{ + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +let s:path = expand('<sfile>:p:h') +if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import outline +endif + +function! Tex_StartOutlineCompletion() + let mainfname = Tex_GetMainFileName(':p') + + " open the buffer + let _report = &report + let _cmdheight=&cmdheight + let _lazyredraw = &lazyredraw + set report=1000 + set cmdheight=1 + set lazyredraw + + bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' + + setlocal modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal nowrap + setlocal foldmethod=marker + setlocal foldmarker=<<<,>>> + + " delete everything in it to the blackhole + % d _ + + if has('python') && Tex_GetVarValue('Tex_UsePython') + exec 'python retval = outline.main(' + \. 'r"' . fnamemodify(mainfname, ':p') . '", ' + \. 'r"' . s:prefix . '")' + + " transfer variable from python to a local variable. + python vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', retval)) + + 0put!=retval + else + exec '0r!'.s:path.'/outline.py '.mainfname.' '.s:prefix + endif + + 0 + + call Tex_SetupOutlineSyntax() + + exec 'nnoremap <buffer> <cr> ' + \ .':cd '.s:origdir.'<CR>' + \ .':call Tex_FinishOutlineCompletion()<CR>' + exec 'nnoremap <buffer> q ' + \ .':cd '.s:origdir.'<CR>' + \ .':close<CR>' + + " once the buffer is initialized, go back to the original settings. + setlocal nomodifiable + setlocal nomodified + let &report = _report + let &cmdheight = _cmdheight + let &lazyredraw = _lazyredraw + +endfunction " }}} +" Tex_SetupOutlineSyntax: sets up the syntax items for the outline {{{ +" Description: +function! Tex_SetupOutlineSyntax() + syn match outlineFileName "<\f\+>$" contained + syn match foldMarkers "<<<\d$" contained + syn match firstSemiColon '^:' contained + syn match firstAngle '^>' contained + + syn match sectionNames '\(\d\.\)\+ .*' contains=foldMarkers + syn match previousLine '^:.*' contains=firstSemiColon + syn match labelLine '^>.*' contains=firstAngle,outlineFileName + + hi def link outlineFileName Ignore + hi def link foldMarkers Ignore + hi def link firstSemiColon Ignore + hi def link firstAngle Ignore + + hi def link sectionNames Type + hi def link previousLine Special + hi def link labelLine Comment +endfunction " }}} +" Tex_FinishOutlineCompletion: inserts the reference back in the text {{{ +function! Tex_FinishOutlineCompletion() + if getline('.') !~ '^[>:]' + return + endif + + if getline('.') =~ '^>' + let ref_complete = matchstr(getline('.'), '^>\s\+\zs\S\+\ze') + elseif getline('.') =~ '^:' + let ref_complete = matchstr(getline(line('.')-1), '^>\s\+\zs\S\+\ze') + endif + + let ref_remaining = strpart(ref_complete, strlen(s:prefix)) + close + call Tex_CompleteWord(ref_remaining) +endfunction " }}} + +" ============================================================================== +" Functions for presenting a nicer list of bibtex entries +" ============================================================================== +" Tex_FindBibFiles: finds all .bib files used by the main file {{{ +" Description: +function! Tex_FindBibFiles() + + let mainfname = Tex_GetMainFileName(':p') + wincmd n + exec 'silent! e '.mainfname + + if search('\\\(no\)\?bibliography{', 'w') + + call Tex_Debug('Tex_FindBibFiles: found bibliography command in '.bufname('%'), 'view') + + " extract the bibliography filenames from the command. + let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') + let bibnames = substitute(bibnames, '\s', '', 'g') + + call Tex_Debug(':Tex_FindBibFiles: trying to search through ['.bibnames.']', 'view') + + let bibfiles = '' + let i = 1 + while 1 + let bibname = Tex_Strntok(bibnames, ',', i) + if bibname == '' + break + endif + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bib') + if fname != '' + let bibfiles = bibfiles.fname."\n" + endif + let i = i + 1 + endwhile + + call Tex_Debug(":Tex_FindBibFiles: returning [".bibfiles."]", "view") + q + return bibfiles + + else + q + return '' + endif + +endfunction " }}} +" Tex_StartBibtexOutline: sets up an outline window {{{ + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import bibtools +endif + +function! Tex_StartCiteCompletion() + let bibfiles = Tex_FindBibFiles() + if bibfiles !~ '\S' + echohl WarningMsg + echomsg 'No bibfiles found! Sorry' + echohl None + return + endif + + bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' + + exec 'python Tex_BibFile = bibtools.BibFile("""'.bibfiles.'""")' + exec 'python Tex_BibFile.addfilter("key ^'.s:prefix.'")' + call Tex_DisplayBibList() + + nnoremap <Plug>Tex_JumpToNextBibEntry :call search('^\S.*\]$', 'W')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_JumpToPrevBibEntry :call search('^\S.*\]$', 'bW')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_FilterBibEntries :call Tex_HandleBibShortcuts('filter')<CR> + nnoremap <Plug>Tex_RemoveBibFilters :call Tex_HandleBibShortcuts('remove_filters')<CR> + nnoremap <Plug>Tex_SortBibEntries :call Tex_HandleBibShortcuts('sort')<CR> + nnoremap <Plug>Tex_CompleteCiteEntry :call Tex_CompleteCiteEntry()<CR> + + nmap <buffer> <silent> n <Plug>Tex_JumpToNextBibEntry + nmap <buffer> <silent> p <Plug>Tex_JumpToPrevBibEntry + nmap <buffer> <silent> f <Plug>Tex_FilterBibEntries + nmap <buffer> <silent> s <Plug>Tex_SortBibEntries + nmap <buffer> <silent> a <Plug>Tex_RemoveBibFilters + nmap <buffer> <silent> q :close<CR> + nmap <buffer> <silent> <CR> <Plug>Tex_CompleteCiteEntry + +endfunction " }}} +" Tex_DisplayBibList: displays the list of bibtex entries {{{ +" Description: +function! Tex_DisplayBibList() + " open the buffer + let _report = &report + let _cmdheight=&cmdheight + let _lazyredraw = &lazyredraw + set report=1000 + set cmdheight=1 + set lazyredraw + + setlocal modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal nowrap + setlocal foldmethod=marker + setlocal foldmarker=<<<,>>> + + + " delete everything in it to the blackhole + % d _ + + exec 'python Tex_CurBuf = vim.current.buffer' + exec 'python Tex_CurBuf[:] = str(Tex_BibFile).splitlines()' + + call Tex_SetupBibSyntax() + + 0 + call Tex_EchoBibShortcuts() + + " once the buffer is initialized, go back to the original settings. + setlocal nomodifiable + setlocal nomodified + let &report = _report + let &cmdheight = _cmdheight + let &lazyredraw = _lazyredraw + +endfunction " }}} +" Tex_EchoBibShortcuts: echos all the shortcuts in the status line {{{ +" Description: +function! Tex_EchoBibShortcuts() + echomsg '(a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose' +endfunction " }}} +" Tex_SetupBibSyntax: sets up the syntax items for the outline {{{ +" Description: +function! Tex_SetupBibSyntax() + syn match BibTitleHeader "^TI" contained + syn match BibAuthorHeader "^AU" contained + syn match BibLocationHeader "^IN" contained + syn match BibMiscHeader "^MI" contained + + syn match BibKeyLine '^\S.*\]$' contains=BibKey + syn match BibTitle "^TI .*" contains=BibTitleHeader + syn match BibAuthor "^AU .*" contains=BibAuthorHeader + syn match BibLocation "^IN .*" contains=BibLocationHeader + syn match BibMisc "^MI .*" contains=BibMiscHeader + + hi def link BibTitleHeader Ignore + hi def link BibAuthorHeader Ignore + hi def link BibLocationHeader Ignore + hi def link BibMiscHeader Ignore + + hi def link BibKeyLine Visual + hi def link BibTitle Type + hi def link BibAuthor Special + hi def link BibLocation Comment + hi def link BibMisc Comment +endfunction " }}} +" Tex_HandleBibShortcuts: handles user keypresses {{{ +" Description: +function! Tex_HandleBibShortcuts(command) + + if a:command == 'filter' || a:command == 'sort' + + let fieldprompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + + let fieldprompt = Tex_GetVarValue('Tex_BibFieldPrompt', fieldprompt) + + if Tex_GetVarValue('Tex_EchoBibFields', 1) == 1 + echo fieldprompt + endif + + let inp = input('Enter '.a:command.' criterion [field<space>value]: ') + if inp !~ '\v^\S+\s+\S.*' + echohl WarningMsg + echomsg 'Invalid filter specification. Use "field<space>value"' + echohl None + return + endif + + if inp != '' + " If the field is specified as a single character, then replace + " it with the corresponding 'full form'. + if inp =~ '^[a-z]\>' + if Tex_GetVarValue('Tex_BibAcronym_'.inp[0]) != '' + let inp = substitute(inp, '.', Tex_GetVarValue('Tex_BibAcronym_'.inp[0]), '') + elseif fieldprompt =~ '\['.inp[0].'\]' + let full = matchstr(fieldprompt, '\['.inp[0].'\] \zs\w\+\ze') + let inp = substitute(inp, '.', full, '') + endif + endif + call Tex_Debug(":Tex_HandleBibShortcuts: using inp = [".inp."]", "view") + if a:command == 'filter' + exec 'python Tex_BibFile.addfilter("'.inp.'")' + elseif a:command == 'sort' + exec "python Tex_BibFile.addsortfield(\"".inp."\")" + exec 'python Tex_BibFile.sort()' + endif + silent! call Tex_DisplayBibList() + endif + + elseif a:command == 'remove_filters' + + exec 'python Tex_BibFile.rmfilters()' + exec 'python Tex_BibFile.addfilter("key ^'.s:prefix.'")' + call Tex_DisplayBibList() + + endif + +endfunction " }}} +" Tex_CompleteCiteEntry: completes cite entry {{{ +" Description: +function! Tex_CompleteCiteEntry() + normal! 0 + call search('\[\S\+\]$', 'W') + if getline('.') !~ '\[\S\+\]$' + call search('\[\S\+\]$', 'bW') + endif + + if getline('.') !~ '\[\S\+\]$' + return + endif + + let ref = matchstr(getline('.'), '\[\zs\S\+\ze\]$') + close + call Tex_Debug(":Tex_CompleteCiteEntry: completing with ".ref, "view") + call Tex_CompleteWord(strpart(ref, strlen(s:prefix))) +endfunction " }}} + +com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory + +" vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 diff --git a/dot_vim/ftplugin/latex-suite/version.vim b/dot_vim/ftplugin/latex-suite/version.vim new file mode 100644 index 0000000..41089cf --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/version.vim @@ -0,0 +1,30 @@ +" Tex_Version: returns a string which gives the current version number of latex-suite +" Description: +" Each time a bug fix/addition is done in any source file in latex-suite, +" not just this file, the number below has to be incremented by the author. +" This will ensure that there is a single 'global' version number for all of +" latex-suite. +" +" If a change is done in the doc/ directory, i.e an addition/change in the +" documentation, then this number should NOT be incremented. +" +" Latex-suite will follow a 3-tier system of versioning just as Vim. A +" version number will be of the form: +" +" X.Y.ZZ +" +" 'X' will only be incremented for a major over-haul or feature addition. +" 'Y' will be incremented for significant changes which do not qualify +" as major. +" 'ZZ' will be incremented for bug-fixes and very trivial additions such +" as adding an option etc. Once ZZ reaches 50, then Y will be +" incremented and ZZ will be reset to 01. Each time we have a +" version number of the form X.Y.01, then we'll make a release on +" vim.sf.net and also create a cvs tag at that point. We'll try to +" "stabilize" that version by releasing a few pre-releases and then +" keep that as a stable point. +function! Tex_Version() + return "Latex-Suite: version 1.8.13" +endfunction + +com! -nargs=0 TVersion echo Tex_Version() diff --git a/dot_vim/ftplugin/latex-suite/wizardfuncs.vim b/dot_vim/ftplugin/latex-suite/wizardfuncs.vim new file mode 100644 index 0000000..113271c --- /dev/null +++ b/dot_vim/ftplugin/latex-suite/wizardfuncs.vim @@ -0,0 +1,377 @@ +" File: wizardfuncs.vim +" Author: Mikolaj Machowski <mikmach@wp.pl> +" Description: +" +" Installation: +" History: pluginized by Srinath Avadhanula +"============================================================================= + +if exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +let s:mapleader = exists('mapleader') ? mapleader : "\\" +" ============================================================================== +" Specialized functions for handling sections from command line +" ============================================================================== + +com! -nargs=? TSection call Tex_section(<f-args>) +com! -nargs=? TSectionAdvanced call Tex_section_adv(<f-args>) + +" Tex_VisSecAdv: handles visual selection for sections {{{ +function! Tex_VisSecAdv(section) + let shorttitle = input("Short title? ") + let toc = input("Include in table of contents [y]/n ? ") + let sstructure = "\\".a:section + if ( toc == "" || toc == "y" ) + let toc = "" + else + let toc = "*" + endif + if shorttitle != "" + let shorttitle = '['.shorttitle.']' + endif + exe "normal `>a}\<cr>\<esc>`<i".sstructure.toc.shorttitle."{" +endfunction + +" }}} +" Tex_InsSecAdv: section wizard in insert mode {{{ +function! Tex_InsSecAdv(structure) + let ttitle = input("Title? ") + let shorttitle = input("Short title? ") + let toc = input("Include in table of contents [y]/n ? ") + "Structure + let sstructure = "\\".a:structure + "TOC + if ( toc == "" || toc == "y" ) + let toc = "" + else + let toc = "*" + endif + "Shorttitle + if shorttitle != "" + let shorttitle = '['.shorttitle.']' + endif + "Title + let ttitle = '{'.ttitle.'}' + "Happy end? + return sstructure.toc.shorttitle.ttitle +endfunction + + +" }}} +function! Tex_section(...) "{{{ + silent let pos = line('.').' | normal! '.virtcol('.').'|' + silent let last_section_value = s:Tex_section_detection() + if a:0 == 0 + silent let last_section_name = s:Tex_section_name(last_section_value) + silent call s:Tex_section_call(last_section_name) + elseif a:1 =~ "[+=\-]" + silent let sec_arg = a:1 + silent let curr_section_value = s:Tex_section_curr_rel_value(sec_arg, last_section_value) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + elseif a:1 == "?" + echo s:last_section_line + else + silent let curr_section_value = s:Tex_section_curr_value(a:1) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + endif + silent exe pos +endfunction "}}} +function! Tex_section_adv(...) "{{{ + let pos = line('.').' | normal! '.virtcol('.').'|' + silent let last_section_value = s:Tex_section_detection() + if a:0 == 0 + silent let last_section_name = s:Tex_section_name(last_section_value) + let section = Tex_InsSecAdv(last_section_name) + elseif a:1 =~ "[+=\-]" + silent let sec_arg = a:1 + silent let curr_section_value = s:Tex_section_curr_rel_value(sec_arg, last_section_value) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + let section = Tex_InsSecAdv(curr_section_name) + else + silent let curr_section_value = s:Tex_section_curr_value(a:1) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + let section = Tex_InsSecAdv(curr_section_name) + endif + exe "normal i".section + exe pos +endfunction "}}} +function! s:Tex_section_detection() "{{{ + let pos = line('.').' | normal! '.virtcol('.').'|' + let last_section1 = search("\\\\\subparagraph\\|\\\\paragraph\\|\\\\subsubsection\\|\\\\subsection\\|\\\\section\\|\\\\chapter\\|\\\part\)", "b") + exe pos + let last_section2 = search("\\\\\part\\|\\\\chapter\\|\\\\section\\|\\\\subsection\\|\\\\subsubsection\\|\\\\paragraph\\|\\\subparagraph\)", "b") + if last_section1 > last_section2 + let last_section = last_section1 + else + let last_section = last_section2 + endif + if last_section != 0 + exe last_section + if getline(".") =~ "\\\\part" + let last_section_value = 0 + elseif getline(".") =~ "\\\\chapter" + let last_section_value = 1 + elseif getline(".") =~ "\\\\section" + let last_section_value = 2 + elseif getline(".") =~ "\\\\subsection" + let last_section_value = 3 + elseif getline(".") =~ "\\\\subsubsection" + let last_section_value = 4 + elseif getline(".") =~ "\\\\paragraph" + let last_section_value = 5 + elseif getline(".") =~ "\\\\subparagraph" + let last_section_value = 6 + endif + let s:last_section_line = getline(".") + else + let last_section_value = 0 + endif + exe pos + return last_section_value +endfunction "}}} +function! s:Tex_section_curr_value(sec_arg) "{{{ + if a:sec_arg == "pa" || a:sec_arg == "0" || a:sec_arg == "part" + let curr_section_value = 0 + elseif a:sec_arg == "ch" || a:sec_arg == "1" || a:sec_arg == "chapter" + let curr_section_value = 1 + elseif a:sec_arg == "se" || a:sec_arg == "2" || a:sec_arg == "section" + let curr_section_value = 2 + elseif a:sec_arg == "ss" || a:sec_arg == "3" || a:sec_arg == "subsection" + let curr_section_value = 3 + elseif a:sec_arg == "s2" || a:sec_arg == "4" || a:sec_arg == "subsubsection" + let curr_section_value = 4 + elseif a:sec_arg == "pr" || a:sec_arg == "5" || a:sec_arg == "paragraph" + let curr_section_value = 5 + elseif a:sec_arg == "sp" || a:sec_arg == "6" || a:sec_arg == "subparagraph" + let curr_section_value = 6 + endif + return curr_section_value +endfunction "}}} +function! s:Tex_section_curr_rel_value(sec_arg, last_section_value) "{{{ + let last_section_value = a:last_section_value + if a:sec_arg == "+" || a:sec_arg == "+1" + let curr_section_value = last_section_value + 1 + elseif a:sec_arg == "++" || a:sec_arg == "+2" + let curr_section_value = last_section_value + 2 + elseif a:sec_arg == "-" || a:sec_arg == "-1" + let curr_section_value = last_section_value - 1 + elseif a:sec_arg == "--" || a:sec_arg == "-2" + let curr_section_value = last_section_value - 2 + elseif a:sec_arg == "=" + let curr_section_value = last_section_value + else + exe "let curr_section_value = last_section_value".a:sec_arg + endif + if curr_section_value < 0 + let curr_section_value = 0 + elseif curr_section_value > 6 + let curr_section_value = 6 + endif + return curr_section_value +endfunction "}}} +function! s:Tex_section_name(section_value) "{{{ + if a:section_value == 0 + let section_name = "part" + elseif a:section_value == 1 + let section_name = "chapter" + elseif a:section_value == 2 + let section_name = "section" + elseif a:section_value == 3 + let section_name = "subsection" + elseif a:section_value == 4 + let section_name = "subsubsection" + elseif a:section_value == 5 + let section_name = "paragraph" + elseif a:section_value == 6 + let section_name = "subparagraph" + endif + return section_name +endfunction "}}} +function! s:Tex_section_call(section_name) "{{{ + exe "normal! i\\".a:section_name."{<++>}<++>\<Esc>0\<C-j>" +" let ret_section = "\\".a:section_name."{<++>}<++>" +" exe "normal! i\<C-r>=IMAP_PutTextWithMovement(ret_section)\<CR>" +" normal f}i +endfunction "}}} + +" ============================================================================== +" Add looking help into latexhelp.txt +" ============================================================================== + +inoremap <silent> <Plug>Tex_Help <C-o>:call <SID>TexHelp()<CR> +nnoremap <silent> <Plug>Tex_Help :call <SID>TexHelp()<CR> +command! -nargs=0 THelp call <SID>TexHelp() +call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'i', '') +call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'n', '') + +" TexHelp: Cursor being on LaTeX item check if exists help tag about it " {{{ +function! s:TexHelp() + let syntax_item = synIDattr(synID(line('.'),col('.')-1,0),"name") + if syntax_item =~ '^tex' + setlocal isk+=\ + let curword = expand('<cword>') + setlocal isk-=\ + let v:errmsg = '' + if curword =~ "^\\" || syntax_item == 'texSectionName' + exe 'silent! help '.curword + if v:errmsg =~ '^E149:' + echohl ErrorMsg + exe "echomsg 'Sorry, no help for LaTeX: ".curword."'" + echohl None + let v:errmsg = '' + endif + else + help + endif + else + help + endif +endfunction " }}} + +" ============================================================================== +" Tables of shortcuts +" ============================================================================== +" +command! -nargs=? Tshortcuts call Tex_shortcuts(<f-args>)<CR> + +" Tex_shortcuts: Show shortcuts in terminal after : command {{{ +function! Tex_shortcuts(...) + if a:0 == 0 + let shorts = input(" Allowed arguments are:" + \."\n g General" + \."\n e Environments" + \."\n f Fonts" + \."\n s Sections" + \."\n m Math" + \."\n a All" + \."\n Enter your choice (<Enter> quits) : ") + call Tex_shortcuts(shorts) + elseif a:1 == 'g' + echo g:generalshortcuts + elseif a:1 == 'e' + echo g:environmentshortcuts + elseif a:1 == 'f' + echo g:fontshortcuts + elseif a:1 == 's' + echo g:sectionshortcuts + elseif a:1 == 'm' + echo g:mathshortcuts + elseif a:1 == 'a' + echo g:generalshortcuts + echo g:environmentshortcuts + echo g:fontshortcuts + echo g:sectionshortcuts + echo g:mathshortcuts + endif + +endfunction +" }}} + +" General shortcuts {{{ +let g:generalshortcuts = '' +\."\n General shortcuts" +\."\n <mapleader> is a value of <Leader>" +\."\n ".s:mapleader.'ll compile whole document' +\."\n ".s:mapleader.'lv view compiled document' +\."\n ".s:mapleader.'ls forward searching (if possible)' +\."\n ".s:mapleader.'rf refresh folds' +" }}} +" Environment shortcuts {{{ +let g:environmentshortcuts = '' +\."\n Environment shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader2" +\."\n I v&V I v&V" +\."\n ELI ".g:Tex_Leader2."li list EQN ".g:Tex_Leader2."qn quotation" +\."\n EDE ".g:Tex_Leader2."de description ESB ".g:Tex_Leader2."sb sloppybar" +\."\n EEN ".g:Tex_Leader2."en enumerate ETI ".g:Tex_Leader2."ti theindex" +\."\n EIT ".g:Tex_Leader2."it itemize ETP ".g:Tex_Leader2."tp titlepage" +\."\n ETI ".g:Tex_Leader2."ti theindex EVM ".g:Tex_Leader2."vm verbatim" +\."\n ETL ".g:Tex_Leader2."tl trivlist EVE ".g:Tex_Leader2."ve verse" +\."\n ETE ".g:Tex_Leader2."te table ETB ".g:Tex_Leader2."tb thebibliography" +\."\n ETG ".g:Tex_Leader2."tg tabbing ENO ".g:Tex_Leader2."no note" +\."\n ETR ".g:Tex_Leader2."tr tabular EOV ".g:Tex_Leader2."ov overlay" +\."\n EAR ".g:Tex_Leader2."ar array ESL ".g:Tex_Leader2."sl slide" +\."\n EDM ".g:Tex_Leader2."dm displaymath EAB ".g:Tex_Leader2."ab abstract" +\."\n EEA ".g:Tex_Leader2."ea eqnarray EAP ".g:Tex_Leader2."ap appendix" +\."\n EEQ ".g:Tex_Leader2."eq equation ECE ".g:Tex_Leader2."ce center" +\."\n EDO ".g:Tex_Leader2."do document EFI ".g:Tex_Leader2."fi figure" +\."\n EFC ".g:Tex_Leader2."fc filecontents ELR ".g:Tex_Leader2."lr lrbox" +\."\n EFL ".g:Tex_Leader2."fl flushleft EMP ".g:Tex_Leader2."mp minipage" +\."\n EFR ".g:Tex_Leader2."fr flushright EPI ".g:Tex_Leader2."pi picture" +\."\n EMA ".g:Tex_Leader2."ma math EQE ".g:Tex_Leader2."qe quote" +" }}} +" Font shortcuts {{{ +let g:fontshortcuts = '' +\."\n Font shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader" +\."\n Shortcuts Effects" +\."\n I v&V I&v V" +\."\n FBF ".g:Tex_Leader."bf \\textbf{} {\\bfseries }" +\."\n FMD ".g:Tex_Leader."md \\textmd{} {\\mdseries }" +\."\n" +\."\n FTT ".g:Tex_Leader."tt \\texttt{} {\\ttfamily }" +\."\n FSF ".g:Tex_Leader."sf \\textsf{} {\\sffamily }" +\."\n FRM ".g:Tex_Leader."rm \\textrm{} {\\rmfamily }" +\."\n" +\."\n FUP ".g:Tex_Leader."up \\textup{} {\\upshape }" +\."\n FSL ".g:Tex_Leader."sl \\textsl{} {\\slshape }" +\."\n FSC ".g:Tex_Leader."sc \\textsc{} {\\scshape }" +\."\n FIT ".g:Tex_Leader."it \\textit{} {\\itshape }" +" }}} +" Section shortcuts {{{ +let g:sectionshortcuts = '' +\."\n Section shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader2" +\."\n I v&V" +\."\n SPA ".g:Tex_Leader2."pa part" +\."\n SCH ".g:Tex_Leader2."ch chapter" +\."\n SSE ".g:Tex_Leader2."se section" +\."\n SSS ".g:Tex_Leader2."ss subsection" +\."\n SS2 ".g:Tex_Leader2."s2 subsubsection" +\."\n SPG ".g:Tex_Leader2."pg paragraph" +\."\n SSP ".g:Tex_Leader2."sp subparagraph" +" }}} +" Math shortcuts {{{ +let g:mathshortcuts = '' +\."\n Math shortcuts - Insert mode" +\."\n `a \\alpha `b \\beta" +\."\n `g \\gamma `d \\delta" +\."\n `e \\varepsilon `z \\zeta" +\."\n `h \\eta `q \\theta" +\."\n `i \\iota `k \\kappa" +\."\n `l \\lambda `m \\mu" +\."\n `n \\nu `x \\xi" +\."\n `p \\pi `r \\rho" +\."\n `s \\sigma `v \\varsigma" +\."\n `t \\tau `u \\upsilon" +\."\n `f \\varphi `c \\chi" +\."\n `y \\psi `w \\omega" +\."\n `A \\Alpha `B \\Beta" +\."\n `G \\Gamma `D \\Delta" +\."\n `E \\Epsilon `Z \\mathrm{Z}" +\."\n `H \\Eta `K \\Kappa" +\."\n `L \\Lambda `M \\Mu" +\."\n `N \\Nu `X \\Xi" +\."\n `P \\Pi `R \\Rho" +\."\n `S \\Sigma `T \\Tau" +\."\n `U \\Upsilon `C \\Chi" +\."\n `Y \\Psi `W \\Omega" +\."\n `( \\subset `) \\Subset" +\."\n `= \\equiv =~ \\approx" +\."\n `- \\bigcap `+ \\bigcup" +\."\n `. \\cdot `* \\times" +\."\n `\\ \\setminus `@ \\circ" +\."\n `& \\wedge `, \\nonumber" +\."\n `8 \\infty `_ \\bar{}" +\."\n `: \\ddot{} `; \\dot{}" +\."\n `^ \\hat{} `~ \\tilde{}" +\."\n `6 \\partial" +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/dot_vim/ftplugin/po.vim b/dot_vim/ftplugin/po.vim new file mode 100644 index 0000000..8b083ab --- /dev/null +++ b/dot_vim/ftplugin/po.vim @@ -0,0 +1,407 @@ +" Vim ftplugin for PO file (GNU gettext) editing. +" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com> +" Last Change: Tue, 12 Apr 2005 13:49:55 -0400 +" +" *** Latest version: http://www.vim.org/scripts/script.php?script_id=695 *** +" +" DESCRIPTION +" This file is a Vim ftplugin for editing PO files (GNU gettext -- the GNU +" i18n and l10n system). It automates over a dozen frequent tasks that +" occur while editing files of this type. +" +" Key mappings +" Action (Insert mode) GUI Vim Vim +" =============================================================== +" Move to an untransl. string forward <S-F1> \m +" Move to an untransl. string backward <S-F2> \p +" Copy the msgid string to msgstr <S-F3> \c +" Delete the msgstr string <S-F4> \d +" Move to the next fuzzy translation <S-F5> \f +" Move to the previous fuzzy translation <S-F6> \b +" Label the translation fuzzy <S-F7> \z +" Remove the fuzzy label <S-F8> \r +" Show msgfmt statistics for the file(*) <S-F11> \s +" Browse through msgfmt errors for the file(*) <S-F12> \e +" Put the translator info in the header \t \t +" Put the lang. team info in the header \l \l +" --------------------------------------------------------------- +" (*) Only available on UNIX computers. +" +" +" Key mappings +" Action (Normal mode) GUI Vim Vim +" =============================================================== +" Move to an untransl. string forward <S-F1> \m +" Move to an untransl. string backward <S-F2> \p +" Move to the next fuzzy translation <S-F5> \f +" Move to the previous fuzzy translation <S-F6> \b +" Label the translation fuzzy <S-F7> \z +" Remove the fuzzy label <S-F8> \r +" Split-open the file under cursor gf gf +" Show msgfmt statistics for the file(*) <S-F11> \s +" Browse through msgfmt errors for the file(*) <S-F12> \e +" Put the translator info in the header \t \t +" Put the lang. team info in the header \l \l +" --------------------------------------------------------------- +" (*) Only available on UNIX computers. +" +" Remarks: +" - "S" in the above key mappings stands for the <Shift> key and "\" in +" fact means "<LocalLeader>" (:help <LocalLeader>), which is "\" by +" Vim's default. +" - Information about the translator and language team is supplied by two +" global variables: 'g:po_translator' and 'g:po_lang_team'. They should +" be defined in the ".vimrc" (UNIX) or "_vimrc" (Windows) file. If they +" are not defined, the default values (descriptive strings) are put +" instead. +" - Vim's "gf" Normal mode command is remapped (local to the PO buffer, of +" course). It will only function on lines starting with "#: ". Search +" for the file is performed in the directories specified by the 'path' +" option. The user can supply its own addition to this option via the +" 'g:po_path' global variable. Its default value for PO files can be +" found by typing ":set path?" from within a PO buffer. For the correct +" format please see ":help 'path'". Warning messages are printed if no +" or more than one file is found. +" - Vim's Quickfix mode (see ":help quickfix") is used for browsing +" through msgfmt-reported errors for the file. No MO file is created +" when running the msgfmt program since its output is directed to +" "/dev/null". The user can supply command-line arguments to the msgfmt +" program via the global variable 'g:po_msgfmt_args'. All arguments are +" allowed except the "-o" for output file. The default value is +" "-vv -c". +" +" But there's even more! +" +" Every time the PO file is saved, a PO-formatted time stamp is +" automatically added to the file header. +" +" INSTALLATION +" Put this file in a Vim ftplugin directory. On UNIX computers it is +" usually either "~/.vim/ftplugin" or "~/.vim/after/ftplugin". On Windows +" computers, the defaults are "$VIM\vimfiles\ftplugin" or +" "$VIM\vimfiles\after\ftplugin". For more information consult the Vim +" help, ":help 'ftplugin'" and ":help 'runtimepath'". +" +" REMOVAL +" Just delete the bloody file! + +" Only do this when not done yet for this buffer. +if exists("b:did_po_mode_ftplugin") || exists("loaded_po_ftplugin") + finish +endif +let b:did_po_mode_ftplugin = 1 +let loaded_po_ftplugin = 1 + +setlocal comments= +setlocal errorformat=%f:%l:\ %m +setlocal makeprg=msgfmt + +let b:po_path = '.,..,../src,../src/*' +if exists("g:po_path") + let b:po_path = b:po_path . ',' . g:po_path +endif +exe "setlocal path=" . b:po_path +unlet b:po_path + +" Check if GUI Vim is running. +if has("gui_running") + let gui = 1 +else + let gui = 0 +endif + +" Move to the first untranslated msgstr string forward. +if !hasmapto('<Plug>NextTransFwd') + if gui + imap <buffer> <unique> <S-F1> <Plug>NextTransFwd + nmap <buffer> <unique> <S-F1> <Plug>NextTransFwd + else + imap <buffer> <unique> <LocalLeader>m <Plug>NextTransFwd + nmap <buffer> <unique> <LocalLeader>m <Plug>NextTransFwd + endif +endif +inoremap <buffer> <unique> <Plug>NextTransFwd <ESC>/^msgstr\s*""\(\n\n\\|\%$\)<CR>:let @/=""<CR>:call histdel("/", -1)<CR>z.f"a +nnoremap <buffer> <unique> <Plug>NextTransFwd /^msgstr\s*""\(\n\n\\|\%$\)<CR>:let @/=""<CR>:call histdel("/", -1)<CR><C-L>z. + +" Move to the first untranslated msgstr string backward. +if !hasmapto('<Plug>NextTransBwd') + if gui + imap <buffer> <unique> <S-F2> <Plug>NextTransBwd + nmap <buffer> <unique> <S-F2> <Plug>NextTransBwd + else + imap <buffer> <unique> <LocalLeader>p <Plug>NextTransBwd + nmap <buffer> <unique> <LocalLeader>p <Plug>NextTransBwd + endif +endif +inoremap <buffer> <unique> <Plug>NextTransBwd <ESC>{?^msgstr\s*""\(\n\n\\|\%$\)<CR>:let @/=""<CR>:call histdel("/", -1)<CR>z.f"a +nnoremap <buffer> <unique> <Plug>NextTransBwd {?^msgstr\s*""\(\n\n\\|\%$\)<CR>:let @/=""<CR>:call histdel("/", -1)<CR><C-L>z. + +" Copy original msgid string into msgstr string. +if !hasmapto('<Plug>CopyMsgid') + if gui + imap <buffer> <unique> <S-F3> <Plug>CopyMsgid + else + imap <buffer> <unique> <LocalLeader>c <Plug>CopyMsgid + endif +endif +inoremap <buffer> <unique> <Plug>CopyMsgid <ESC>}?^msgid<CR>:let @/=""<CR>:call histdel("/", -1)<CR>f"y/^msgstr<CR>/^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR>f""_d$pa + +" Erase the translation string. +if !hasmapto('<Plug>DeleteTrans') + if gui + imap <buffer> <unique> <S-F4> <Plug>DeleteTrans + else + imap <buffer> <unique> <LocalLeader>d <Plug>DeleteTrans + endif +endif +inoremap <buffer> <unique> <Plug>DeleteTrans <ESC>}?^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR>f"lc}"<ESC>i + +" Move to the first fuzzy translation forward. +if !hasmapto('<Plug>NextFuzzy') + if gui + imap <buffer> <unique> <S-F5> <Plug>NextFuzzy + nmap <buffer> <unique> <S-F5> <Plug>NextFuzzy + else + imap <buffer> <unique> <LocalLeader>f <Plug>NextFuzzy + nmap <buffer> <unique> <LocalLeader>f <Plug>NextFuzzy + endif +endif +inoremap <buffer> <unique> <Plug>NextFuzzy <ESC>/^#,\(.*,\)\=\s*fuzzy<CR>:let @/=""<CR>:call histdel("/", -1)<CR>/^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR>z.$i +nnoremap <buffer> <unique> <Plug>NextFuzzy /^#,\(.*,\)\=\s*fuzzy<CR>:let @/=""<CR>:call histdel("/", -1)<CR>/^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR><C-L>z.$ + +" Move to the first fuzzy descriptor backward. +if !hasmapto('<Plug>PreviousFuzzy') + if gui + imap <buffer> <unique> <S-F6> <Plug>PreviousFuzzy + nmap <buffer> <unique> <S-F6> <Plug>PreviousFuzzy + else + imap <buffer> <unique> <LocalLeader>b <Plug>PreviousFuzzy + nmap <buffer> <unique> <LocalLeader>b <Plug>PreviousFuzzy + endif +endif +inoremap <buffer> <unique> <Plug>PreviousFuzzy <ESC>{?^#,\(.*,\)\=\s*fuzzy<CR>:let @/=""<CR>:call histdel("/", -1)<CR>/^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR>z.$i +nnoremap <buffer> <unique> <Plug>PreviousFuzzy {?^#,\(.*,\)\=\s*fuzzy<CR>:let @/=""<CR>:call histdel("/", -1)<CR>/^msgstr<CR>:let @/=""<CR>:call histdel("/", -1)<CR><C-L>z.$ + +" Insert fuzzy description for the translation. +if !hasmapto('<Plug>InsertFuzzy') + if gui + imap <buffer> <unique> <S-F7> <Plug>InsertFuzzy + nmap <buffer> <unique> <S-F7> <Plug>InsertFuzzy + else + imap <buffer> <unique> <LocalLeader>z <Plug>InsertFuzzy + nmap <buffer> <unique> <LocalLeader>z <Plug>InsertFuzzy + endif +endif +inoremap <buffer> <unique> <Plug>InsertFuzzy <ESC>{vap:call <SID>InsertFuzzy()<CR>gv<ESC>}i +nnoremap <buffer> <unique> <Plug>InsertFuzzy {vap:call <SID>InsertFuzzy()<CR>gv<ESC>} + +fu! <SID>InsertFuzzy() range + let n = a:firstline + while n <= a:lastline + let line = getline(n) + if line =~ '^#,.*fuzzy' + return + elseif line =~ '^#,' + call setline(n, substitute(line, '#,','#, fuzzy,', "")) + return + elseif line =~ '^msgid' + call append(n-1, '#, fuzzy') + return + endif + let n = n + 1 + endwhile +endf + +" Remove fuzzy description from the translation. +if !hasmapto('<Plug>RemoveFuzzy') + if gui + imap <buffer> <unique> <S-F8> <Plug>RemoveFuzzy + nmap <buffer> <unique> <S-F8> <Plug>RemoveFuzzy + else + imap <buffer> <unique> <LocalLeader>r <Plug>RemoveFuzzy + nmap <buffer> <unique> <LocalLeader>r <Plug>RemoveFuzzy + endif +endif +inoremap <buffer> <unique> <Plug>RemoveFuzzy <ESC>{vap:call <SID>RemoveFuzzy()<CR>i +nnoremap <buffer> <unique> <Plug>RemoveFuzzy {vap:call <SID>RemoveFuzzy()<CR> + +fu! <SID>RemoveFuzzy() + let line = getline(".") + if line =~ '^#,\s*fuzzy$' + exe "normal! dd" + elseif line =~ '^#,\(.*,\)\=\s*fuzzy' + exe 's/,\s*fuzzy//' + endif +endf + +" Show PO translation statistics. (Only available on UNIX computers for now.) +if has("unix") + if !hasmapto('<Plug>MsgfmtStats') + if gui + imap <buffer> <unique> <S-F11> <Plug>MsgfmtStats + nmap <buffer> <unique> <S-F11> <Plug>MsgfmtStats + else + imap <buffer> <unique> <LocalLeader>s <Plug>MsgfmtStats + nmap <buffer> <unique> <LocalLeader>s <Plug>MsgfmtStats + endif + endif + inoremap <buffer> <unique> <Plug>MsgfmtStats <ESC>:call <SID>Msgfmt('stats')<CR> + nnoremap <buffer> <unique> <Plug>MsgfmtStats :call <SID>Msgfmt('stats')<CR> + + if !hasmapto('<Plug>MsgfmtTest') + if gui + imap <buffer> <unique> <S-F12> <Plug>MsgfmtTest + nmap <buffer> <unique> <S-F12> <Plug>MsgfmtTest + else + imap <buffer> <unique> <LocalLeader>e <Plug>MsgfmtTest + nmap <buffer> <unique> <LocalLeader>e <Plug>MsgfmtTest + endif + endif + inoremap <buffer> <unique> <Plug>MsgfmtTest <ESC>:call <SID>Msgfmt('test')<CR> + nnoremap <buffer> <unique> <Plug>MsgfmtTest :call <SID>Msgfmt('test')<CR> + + fu! <SID>Msgfmt(action) + " Check if the file needs to be saved first. + exe "if &modified | w | endif" + if a:action == 'stats' + exe "!msgfmt --statistics -o /dev/null %" + elseif a:action == 'test' + if exists("g:po_msgfmt_args") + let args = g:po_msgfmt_args + else + let args = '-vv -c' + endif + exe "make! " . args . " -o /dev/null %" + copen + endif + endf +endif + +" Add translator info in the file header. +if !hasmapto('<Plug>TranslatorInfo') + if gui + imap <buffer> <unique> <LocalLeader>t <Plug>TranslatorInfo + nmap <buffer> <unique> <LocalLeader>t <Plug>TranslatorInfo + else + imap <buffer> <unique> <LocalLeader>t <Plug>TranslatorInfo + nmap <buffer> <unique> <LocalLeader>t <Plug>TranslatorInfo + endif +endif +inoremap <buffer> <unique> <Plug>TranslatorInfo <ESC>:call <SID>AddHeaderInfo('person')<CR>i +nnoremap <buffer> <unique> <Plug>TranslatorInfo :call <SID>AddHeaderInfo('person')<CR> + +" Add language team info in the file header. +if !hasmapto('<Plug>LangTeamInfo') + if gui + imap <buffer> <unique> <LocalLeader>l <Plug>LangTeamInfo + nmap <buffer> <unique> <LocalLeader>l <Plug>LangTeamInfo + else + imap <buffer> <unique> <LocalLeader>l <Plug>LangTeamInfo + nmap <buffer> <unique> <LocalLeader>l <Plug>LangTeamInfo + endif +endif +inoremap <buffer> <unique> <Plug>LangTeamInfo <ESC>:call <SID>AddHeaderInfo('team')<CR>i +nnoremap <buffer> <unique> <Plug>LangTeamInfo :call <SID>AddHeaderInfo('team')<CR> + +fu! <SID>AddHeaderInfo(action) + if a:action == 'person' + let search_for = 'Last-Translator' + if exists("g:po_translator") + let add = g:po_translator + else + let add = 'YOUR NAME <E-MAIL@ADDRESS>' + endif + elseif a:action == 'team' + let search_for = 'Language-Team' + if exists("g:po_lang_team") + let add = g:po_lang_team + else + let add = 'LANGUAGE TEAM <E-MAIL@ADDRESS or HOME PAGE>' + endif + else + " Undefined action -- just do nothing. + return + endif + let search_for = '"' . search_for . ':' + let add = add . '\\n"' + + normal! 1G + if search('^' . search_for) + silent! exe 's/^\(' . search_for . '\).*$/\1 ' . add + endif + call histdel("/", -1) +endf + +" Write automagically PO-formatted time stamp every time the file is saved. +augroup PoFileTimestamp + au! + au BufWrite *.po,*.po.gz call <SID>PoFileTimestamp() +augroup END + +fu! <SID>PoFileTimestamp() + " Prepare for cleanup at the end of this function. + let hist_search = histnr("/") + let old_report = 'set report='.&report + let &report = 100 + let cursor_pos_cmd = line(".").'normal! '.virtcol(".").'|' + normal! H + let scrn_pos = line(".").'normal! zt' + + " Put in time stamp. + normal! 1G + if search('^"PO-Revision-Date:') + silent! exe 's/^\("PO-Revision-Date:\).*$/\1 ' . strftime("%Y-%m-%d %H:%M%z") . '\\n"' + endif + + " Cleanup and restore old cursor position. + while histnr("/") > hist_search && histnr("/") > 0 + call histdel("/", -1) + endwhile + exe scrn_pos + exe cursor_pos_cmd + exe old_report +endf + +" On "gf" Normal mode command, split window and open the file under the +" cursor. +if !hasmapto('<Plug>OpenSourceFile') + map <buffer> <unique> gf <Plug>OpenSourceFile +endif +noremap <buffer> <unique> <Plug>OpenSourceFile :call <SID>OpenSourceFile()<CR> + +" This opens the file under the cursor in a split-window. +fu! <SID>OpenSourceFile() + " Check if we're at the right line. Return if not. + if getline(".") !~ '^#:\s\+' | return | endif + + " Get the reference, check it, and return if it doesn't have the assumed + " format. + let ref = expand("<cWORD>") + if ref !~ ':\d\+$' | return | endif + + " Split the reference into the file name and the line number parts. + let d = match(ref, ':') + let flnm = strpart(ref, 0, d) + let lnr = strpart(ref, d+1, 100) + + " Start searching for the file in the directories specified with the 'path' + " option. + let ff = globpath(&path, flnm) + + " Check what's been found. Report if no or more than one file found and + " return. + if ff == '' + echohl WarningMsg | echo "No file found in the path." + echohl None + exe "normal \<Esc>" + elseif match(ff, "\n") > 0 + echohl WarningMsg | echo "More than one file found: " . ff . "\nAborting." + echohl None + exe "normal \<Esc>" + else + " Split the window and open the file at the correct line. + execute "silent sp +" . lnr . " " . ff + endif +endf + +unlet gui diff --git a/dot_vim/ftplugin/pythoncomplete.vim b/dot_vim/ftplugin/pythoncomplete.vim new file mode 100644 index 0000000..57add71 --- /dev/null +++ b/dot_vim/ftplugin/pythoncomplete.vim @@ -0,0 +1,625 @@ +"pythoncomplete.vim - Omni Completion for python +" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> +" Version: 0.9 +" Last Updated: 18 Jun 2009 +" +" Changes +" TODO: +" 'info' item output can use some formatting work +" Add an "unsafe eval" mode, to allow for return type evaluation +" Complete basic syntax along with import statements +" i.e. "import url<c-x,c-o>" +" Continue parsing on invalid line?? +" +" v 0.9 +" * Fixed docstring parsing for classes and functions +" * Fixed parsing of *args and **kwargs type arguments +" * Better function param parsing to handle things like tuples and +" lambda defaults args +" +" v 0.8 +" * Fixed an issue where the FIRST assignment was always used instead of +" using a subsequent assignment for a variable +" * Fixed a scoping issue when working inside a parameterless function +" +" +" v 0.7 +" * Fixed function list sorting (_ and __ at the bottom) +" * Removed newline removal from docs. It appears vim handles these better in +" recent patches +" +" v 0.6: +" * Fixed argument completion +" * Removed the 'kind' completions, as they are better indicated +" with real syntax +" * Added tuple assignment parsing (whoops, that was forgotten) +" * Fixed import handling when flattening scope +" +" v 0.5: +" Yeah, I skipped a version number - 0.4 was never public. +" It was a bugfix version on top of 0.3. This is a complete +" rewrite. +" + +if !has('python') + echo "Error: Required vim compiled with +python" + finish +endif + +function! pythoncomplete#Complete(findstart, base) + "findstart = 1 when we need to get the text length + if a:findstart == 1 + let line = getline('.') + let idx = col('.') + while idx > 0 + let idx -= 1 + let c = line[idx] + if c =~ '\w' + continue + elseif ! c =~ '\.' + let idx = -1 + break + else + break + endif + endwhile + + return idx + "findstart = 0 when we need to return the list of completions + else + "vim no longer moves the cursor upon completion... fix that + let line = getline('.') + let idx = col('.') + let cword = '' + while idx > 0 + let idx -= 1 + let c = line[idx] + if c =~ '\w' || c =~ '\.' + let cword = c . cword + continue + elseif strlen(cword) > 0 || idx == 0 + break + endif + endwhile + execute "python vimcomplete('" . cword . "', '" . a:base . "')" + return g:pythoncomplete_completions + endif +endfunction + +function! s:DefPython() +python << PYTHONEOF +import sys, tokenize, cStringIO, types +from token import NAME, DEDENT, NEWLINE, STRING + +debugstmts=[] +def dbg(s): debugstmts.append(s) +def showdbg(): + for d in debugstmts: print "DBG: %s " % d + +def vimcomplete(context,match): + global debugstmts + debugstmts = [] + try: + import vim + def complsort(x,y): + try: + xa = x['abbr'] + ya = y['abbr'] + if xa[0] == '_': + if xa[1] == '_' and ya[0:2] == '__': + return xa > ya + elif ya[0:2] == '__': + return -1 + elif y[0] == '_': + return xa > ya + else: + return 1 + elif ya[0] == '_': + return -1 + else: + return xa > ya + except: + return 0 + cmpl = Completer() + cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')")) + all = cmpl.get_completions(context,match) + all.sort(complsort) + dictstr = '[' + # have to do this for double quoting + for cmpl in all: + dictstr += '{' + for x in cmpl: dictstr += '"%s":"%s",' % (x,cmpl[x]) + dictstr += '"icase":0},' + if dictstr[-1] == ',': dictstr = dictstr[:-1] + dictstr += ']' + #dbg("dict: %s" % dictstr) + vim.command("silent let g:pythoncomplete_completions = %s" % dictstr) + #dbg("Completion dict:\n%s" % all) + except vim.error: + dbg("VIM Error: %s" % vim.error) + +class Completer(object): + def __init__(self): + self.compldict = {} + self.parser = PyParser() + + def evalsource(self,text,line=0): + sc = self.parser.parse(text,line) + src = sc.get_code() + dbg("source: %s" % src) + try: exec(src) in self.compldict + except: dbg("parser: %s, %s" % (sys.exc_info()[0],sys.exc_info()[1])) + for l in sc.locals: + try: exec(l) in self.compldict + except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l)) + + def _cleanstr(self,doc): + return doc.replace('"',' ').replace("'",' ') + + def get_arguments(self,func_obj): + def _ctor(obj): + try: return class_ob.__init__.im_func + except AttributeError: + for base in class_ob.__bases__: + rc = _find_constructor(base) + if rc is not None: return rc + return None + + arg_offset = 1 + if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj) + elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func + else: arg_offset = 0 + + arg_text='' + if type(func_obj) in [types.FunctionType, types.LambdaType]: + try: + cd = func_obj.func_code + real_args = cd.co_varnames[arg_offset:cd.co_argcount] + defaults = func_obj.func_defaults or '' + defaults = map(lambda name: "=%s" % name, defaults) + defaults = [""] * (len(real_args)-len(defaults)) + defaults + items = map(lambda a,d: a+d, real_args, defaults) + if func_obj.func_code.co_flags & 0x4: + items.append("...") + if func_obj.func_code.co_flags & 0x8: + items.append("***") + arg_text = (','.join(items)) + ')' + + except: + dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1])) + pass + if len(arg_text) == 0: + # The doc string sometimes contains the function signature + # this works for alot of C modules that are part of the + # standard library + doc = func_obj.__doc__ + if doc: + doc = doc.lstrip() + pos = doc.find('\n') + if pos > 0: + sigline = doc[:pos] + lidx = sigline.find('(') + ridx = sigline.find(')') + if lidx > 0 and ridx > 0: + arg_text = sigline[lidx+1:ridx] + ')' + if len(arg_text) == 0: arg_text = ')' + return arg_text + + def get_completions(self,context,match): + dbg("get_completions('%s','%s')" % (context,match)) + stmt = '' + if context: stmt += str(context) + if match: stmt += str(match) + try: + result = None + all = {} + ridx = stmt.rfind('.') + if len(stmt) > 0 and stmt[-1] == '(': + result = eval(_sanitize(stmt[:-1]), self.compldict) + doc = result.__doc__ + if doc is None: doc = '' + args = self.get_arguments(result) + return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}] + elif ridx == -1: + match = stmt + all = self.compldict + else: + match = stmt[ridx+1:] + stmt = _sanitize(stmt[:ridx]) + result = eval(stmt, self.compldict) + all = dir(result) + + dbg("completing: stmt:%s" % stmt) + completions = [] + + try: maindoc = result.__doc__ + except: maindoc = ' ' + if maindoc is None: maindoc = ' ' + for m in all: + if m == "_PyCmplNoType": continue #this is internal + try: + dbg('possible completion: %s' % m) + if m.find(match) == 0: + if result is None: inst = all[m] + else: inst = getattr(result,m) + try: doc = inst.__doc__ + except: doc = maindoc + typestr = str(inst) + if doc is None or doc == '': doc = maindoc + + wrd = m[len(match):] + c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)} + if "function" in typestr: + c['word'] += '(' + c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) + elif "method" in typestr: + c['word'] += '(' + c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) + elif "module" in typestr: + c['word'] += '.' + elif "class" in typestr: + c['word'] += '(' + c['abbr'] += '(' + completions.append(c) + except: + i = sys.exc_info() + dbg("inner completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) + return completions + except: + i = sys.exc_info() + dbg("completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) + return [] + +class Scope(object): + def __init__(self,name,indent,docstr=''): + self.subscopes = [] + self.docstr = docstr + self.locals = [] + self.parent = None + self.name = name + self.indent = indent + + def add(self,sub): + #print 'push scope: [%s@%s]' % (sub.name,sub.indent) + sub.parent = self + self.subscopes.append(sub) + return sub + + def doc(self,str): + """ Clean up a docstring """ + d = str.replace('\n',' ') + d = d.replace('\t',' ') + while d.find(' ') > -1: d = d.replace(' ',' ') + while d[0] in '"\'\t ': d = d[1:] + while d[-1] in '"\'\t ': d = d[:-1] + dbg("Scope(%s)::docstr = %s" % (self,d)) + self.docstr = d + + def local(self,loc): + self._checkexisting(loc) + self.locals.append(loc) + + def copy_decl(self,indent=0): + """ Copy a scope's declaration only, at the specified indent level - not local variables """ + return Scope(self.name,indent,self.docstr) + + def _checkexisting(self,test): + "Convienance function... keep out duplicates" + if test.find('=') > -1: + var = test.split('=')[0].strip() + for l in self.locals: + if l.find('=') > -1 and var == l.split('=')[0].strip(): + self.locals.remove(l) + + def get_code(self): + str = "" + if len(self.docstr) > 0: str += '"""'+self.docstr+'"""\n' + for l in self.locals: + if l.startswith('import'): str += l+'\n' + str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n' + for sub in self.subscopes: + str += sub.get_code() + for l in self.locals: + if not l.startswith('import'): str += l+'\n' + + return str + + def pop(self,indent): + #print 'pop scope: [%s] to [%s]' % (self.indent,indent) + outer = self + while outer.parent != None and outer.indent >= indent: + outer = outer.parent + return outer + + def currentindent(self): + #print 'parse current indent: %s' % self.indent + return ' '*self.indent + + def childindent(self): + #print 'parse child indent: [%s]' % (self.indent+1) + return ' '*(self.indent+1) + +class Class(Scope): + def __init__(self, name, supers, indent, docstr=''): + Scope.__init__(self,name,indent, docstr) + self.supers = supers + def copy_decl(self,indent=0): + c = Class(self.name,self.supers,indent, self.docstr) + for s in self.subscopes: + c.add(s.copy_decl(indent+1)) + return c + def get_code(self): + str = '%sclass %s' % (self.currentindent(),self.name) + if len(self.supers) > 0: str += '(%s)' % ','.join(self.supers) + str += ':\n' + if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' + if len(self.subscopes) > 0: + for s in self.subscopes: str += s.get_code() + else: + str += '%spass\n' % self.childindent() + return str + + +class Function(Scope): + def __init__(self, name, params, indent, docstr=''): + Scope.__init__(self,name,indent, docstr) + self.params = params + def copy_decl(self,indent=0): + return Function(self.name,self.params,indent, self.docstr) + def get_code(self): + str = "%sdef %s(%s):\n" % \ + (self.currentindent(),self.name,','.join(self.params)) + if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' + str += "%spass\n" % self.childindent() + return str + +class PyParser: + def __init__(self): + self.top = Scope('global',0) + self.scope = self.top + + def _parsedotname(self,pre=None): + #returns (dottedname, nexttoken) + name = [] + if pre is None: + tokentype, token, indent = self.next() + if tokentype != NAME and token != '*': + return ('', token) + else: token = pre + name.append(token) + while True: + tokentype, token, indent = self.next() + if token != '.': break + tokentype, token, indent = self.next() + if tokentype != NAME: break + name.append(token) + return (".".join(name), token) + + def _parseimportlist(self): + imports = [] + while True: + name, token = self._parsedotname() + if not name: break + name2 = '' + if token == 'as': name2, token = self._parsedotname() + imports.append((name, name2)) + while token != "," and "\n" not in token: + tokentype, token, indent = self.next() + if token != ",": break + return imports + + def _parenparse(self): + name = '' + names = [] + level = 1 + while True: + tokentype, token, indent = self.next() + if token in (')', ',') and level == 1: + if '=' not in name: name = name.replace(' ', '') + names.append(name.strip()) + name = '' + if token == '(': + level += 1 + name += "(" + elif token == ')': + level -= 1 + if level == 0: break + else: name += ")" + elif token == ',' and level == 1: + pass + else: + name += "%s " % str(token) + return names + + def _parsefunction(self,indent): + self.scope=self.scope.pop(indent) + tokentype, fname, ind = self.next() + if tokentype != NAME: return None + + tokentype, open, ind = self.next() + if open != '(': return None + params=self._parenparse() + + tokentype, colon, ind = self.next() + if colon != ':': return None + + return Function(fname,params,indent) + + def _parseclass(self,indent): + self.scope=self.scope.pop(indent) + tokentype, cname, ind = self.next() + if tokentype != NAME: return None + + super = [] + tokentype, next, ind = self.next() + if next == '(': + super=self._parenparse() + elif next != ':': return None + + return Class(cname,super,indent) + + def _parseassignment(self): + assign='' + tokentype, token, indent = self.next() + if tokentype == tokenize.STRING or token == 'str': + return '""' + elif token == '(' or token == 'tuple': + return '()' + elif token == '[' or token == 'list': + return '[]' + elif token == '{' or token == 'dict': + return '{}' + elif tokentype == tokenize.NUMBER: + return '0' + elif token == 'open' or token == 'file': + return 'file' + elif token == 'None': + return '_PyCmplNoType()' + elif token == 'type': + return 'type(_PyCmplNoType)' #only for method resolution + else: + assign += token + level = 0 + while True: + tokentype, token, indent = self.next() + if token in ('(','{','['): + level += 1 + elif token in (']','}',')'): + level -= 1 + if level == 0: break + elif level == 0: + if token in (';','\n'): break + assign += token + return "%s" % assign + + def next(self): + type, token, (lineno, indent), end, self.parserline = self.gen.next() + if lineno == self.curline: + #print 'line found [%s] scope=%s' % (line.replace('\n',''),self.scope.name) + self.currentscope = self.scope + return (type, token, indent) + + def _adjustvisibility(self): + newscope = Scope('result',0) + scp = self.currentscope + while scp != None: + if type(scp) == Function: + slice = 0 + #Handle 'self' params + if scp.parent != None and type(scp.parent) == Class: + slice = 1 + newscope.local('%s = %s' % (scp.params[0],scp.parent.name)) + for p in scp.params[slice:]: + i = p.find('=') + if len(p) == 0: continue + pvar = '' + ptype = '' + if i == -1: + pvar = p + ptype = '_PyCmplNoType()' + else: + pvar = p[:i] + ptype = _sanitize(p[i+1:]) + if pvar.startswith('**'): + pvar = pvar[2:] + ptype = '{}' + elif pvar.startswith('*'): + pvar = pvar[1:] + ptype = '[]' + + newscope.local('%s = %s' % (pvar,ptype)) + + for s in scp.subscopes: + ns = s.copy_decl(0) + newscope.add(ns) + for l in scp.locals: newscope.local(l) + scp = scp.parent + + self.currentscope = newscope + return self.currentscope + + #p.parse(vim.current.buffer[:],vim.eval("line('.')")) + def parse(self,text,curline=0): + self.curline = int(curline) + buf = cStringIO.StringIO(''.join(text) + '\n') + self.gen = tokenize.generate_tokens(buf.readline) + self.currentscope = self.scope + + try: + freshscope=True + while True: + tokentype, token, indent = self.next() + #dbg( 'main: token=[%s] indent=[%s]' % (token,indent)) + + if tokentype == DEDENT or token == "pass": + self.scope = self.scope.pop(indent) + elif token == 'def': + func = self._parsefunction(indent) + if func is None: + print "function: syntax error..." + continue + dbg("new scope: function") + freshscope = True + self.scope = self.scope.add(func) + elif token == 'class': + cls = self._parseclass(indent) + if cls is None: + print "class: syntax error..." + continue + freshscope = True + dbg("new scope: class") + self.scope = self.scope.add(cls) + + elif token == 'import': + imports = self._parseimportlist() + for mod, alias in imports: + loc = "import %s" % mod + if len(alias) > 0: loc += " as %s" % alias + self.scope.local(loc) + freshscope = False + elif token == 'from': + mod, token = self._parsedotname() + if not mod or token != "import": + print "from: syntax error..." + continue + names = self._parseimportlist() + for name, alias in names: + loc = "from %s import %s" % (mod,name) + if len(alias) > 0: loc += " as %s" % alias + self.scope.local(loc) + freshscope = False + elif tokentype == STRING: + if freshscope: self.scope.doc(token) + elif tokentype == NAME: + name,token = self._parsedotname(token) + if token == '=': + stmt = self._parseassignment() + dbg("parseassignment: %s = %s" % (name, stmt)) + if stmt != None: + self.scope.local("%s = %s" % (name,stmt)) + freshscope = False + except StopIteration: #thrown on EOF + pass + except: + dbg("parse error: %s, %s @ %s" % + (sys.exc_info()[0], sys.exc_info()[1], self.parserline)) + return self._adjustvisibility() + +def _sanitize(str): + val = '' + level = 0 + for c in str: + if c in ('(','{','['): + level += 1 + elif c in (']','}',')'): + level -= 1 + elif level == 0: + val += c + return val + +sys.path.extend(['.','..']) +PYTHONEOF +endfunction + +call s:DefPython() +" vim: set et ts=4: diff --git a/dot_vim/ftplugin/tex.vim b/dot_vim/ftplugin/tex.vim new file mode 100644 index 0000000..e1d7438 --- /dev/null +++ b/dot_vim/ftplugin/tex.vim @@ -0,0 +1,10 @@ +" this is mostly a matter of taste. but LaTeX looks good with just a bit +" of indentation. +set sw=2 +" TIP: if you write your \label's as \label{fig:something}, then if you +" type in \ref{fig: and press <C-n> you will automatically cycle through +" all the figure labels. Very useful! +set iskeyword+=: + +" So I can use e-acute +imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine diff --git a/dot_vim/ftplugin/tex_latexSuite.vim b/dot_vim/ftplugin/tex_latexSuite.vim new file mode 100644 index 0000000..582d014 --- /dev/null +++ b/dot_vim/ftplugin/tex_latexSuite.vim @@ -0,0 +1,13 @@ +" LaTeX filetype +" Language: LaTeX (ft=tex) +" Maintainer: Srinath Avadhanula +" Email: srinath@fastmail.fm + +if !exists('s:initLatexSuite') + let s:initLatexSuite = 1 + exec 'so '.expand('<sfile>:p:h').'/latex-suite/main.vim' + + silent! do LatexSuite User LatexSuiteInitPost +endif + +silent! do LatexSuite User LatexSuiteFileType diff --git a/dot_vim/haskellmode-20081031.vba b/dot_vim/haskellmode-20081031.vba new file mode 100644 index 0000000..1a33424 --- /dev/null +++ b/dot_vim/haskellmode-20081031.vba @@ -0,0 +1,1850 @@ +" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. +UseVimball +finish +compiler/ghc.vim [[[1 +445 + +" Vim Compiler File +" Compiler: GHC +" Maintainer: Claus Reinke <claus.reinke@talk21.com> +" Last Change: 06/07/2008 +" +" part of haskell plugins: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ + +" ------------------------------ paths & quickfix settings first +" + +if exists("current_compiler") && current_compiler == "ghc" + finish +endif +let current_compiler = "ghc" + +let s:scriptname = "ghc.vim" + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname.": can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif +let ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') +let b:ghc_staticoptions = '' + +" set makeprg (for quickfix mode) +execute 'setlocal makeprg=' . g:ghc .'\ -e\ :q\ %' +"execute 'setlocal makeprg=' . g:ghc .'\ --make\ %' + +" quickfix mode: +" fetch file/line-info from error message +" TODO: how to distinguish multiline errors from warnings? +" (both have the same header, and errors have no common id-tag) +" how to get rid of first empty message in result list? +setlocal errorformat= + \%-Z\ %#, + \%W%f:%l:%c:\ Warning:\ %m, + \%E%f:%l:%c:\ %m, + \%E%>%f:%l:%c:, + \%+C\ \ %#%m, + \%W%>%f:%l:%c:, + \%+C\ \ %#%tarning:\ %m, + +" oh, wouldn't you guess it - ghc reports (partially) to stderr.. +setlocal shellpipe=2> + +" ------------------------- but ghc can do a lot more for us.. +" + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +" initialize map of identifiers to their types +" associate type map updates to changedtick +if !exists("b:ghc_types") + let b:ghc_types = {} + let b:my_changedtick = b:changedtick +endif + +if exists("g:haskell_functions") + finish +endif +let g:haskell_functions = "ghc" + +" avoid hit-enter prompts +set cmdheight=3 + +" edit static GHC options +" TODO: add completion for options/packages? +command! GHCStaticOptions call GHC_StaticOptions() +function! GHC_StaticOptions() + let b:ghc_staticoptions = input('GHC static options: ',b:ghc_staticoptions) + execute 'setlocal makeprg=' . g:ghc . '\ ' . escape(b:ghc_staticoptions,' ') .'\ -e\ :q\ %' + let b:my_changedtick -=1 +endfunction + +map <LocalLeader>T :call GHC_ShowType(1)<cr> +map <LocalLeader>t :call GHC_ShowType(0)<cr> +function! GHC_ShowType(addTypeDecl) + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = ( symb ? '('.name.')' : name ) + call GHC_HaveTypes() + if !has_key(b:ghc_types,name) + redraw + echo pname "type not known" + else + redraw + for type in split(b:ghc_types[name],' -- ') + echo pname "::" type + if a:addTypeDecl + call append( line(".")-1, pname . " :: " . type ) + endif + endfor + endif +endfunction + +" show type of identifier under mouse pointer in balloon +if has("balloon_eval") + set ballooneval + set balloondelay=600 + set balloonexpr=GHC_TypeBalloon() + function! GHC_TypeBalloon() + if exists("b:current_compiler") && b:current_compiler=="ghc" + let [line] = getbufline(v:beval_bufnr,v:beval_lnum) + let namsym = Haskell_GetNameSymbol(line,v:beval_col,0) + if namsym==[] + return '' + endif + let [start,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = name " ( symb ? '('.name.')' : name ) + silent call GHC_HaveTypes() + if has("balloon_multiline") + return (has_key(b:ghc_types,pname) ? split(b:ghc_types[pname],' -- ') : '') + else + return (has_key(b:ghc_types,pname) ? b:ghc_types[pname] : '') + endif + else + return '' + endif + endfunction +endif + +map <LocalLeader>si :call GHC_ShowInfo()<cr> +function! GHC_ShowInfo() + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : (qual.'.'.unqual) + let output = GHC_Info(name) + redraw + echo output +endfunction + +" fill the type map, unless nothing has changed since the last attempt +function! GHC_HaveTypes() + if b:ghc_types == {} && (b:my_changedtick != b:changedtick) + let b:my_changedtick = b:changedtick + return GHC_BrowseAll() + endif +endfunction + +" update b:ghc_types after successful make +au QuickFixCmdPost make if GHC_CountErrors()==0 | silent call GHC_BrowseAll() | endif + +" count only error entries in quickfix list, ignoring warnings +function! GHC_CountErrors() + let c=0 + for e in getqflist() | if e.type=='E' && e.text !~ "^[ \n]*Warning:" | let c+=1 | endif | endfor + return c +endfunction + +command! GHCReload call GHC_BrowseAll() +function! GHC_BrowseAll() + " let imports = Haskell_GatherImports() + " let modules = keys(imports[0]) + keys(imports[1]) + let imports = {} " no need for them at the moment + let current = GHC_NameCurrent() + let module = current==[] ? 'Main' : current[0] + if GHC_VersionGE([6,8,1]) + return GHC_BrowseBangStar(module) + else + return GHC_BrowseMultiple(imports,['*'.module]) + endif +endfunction + +function! GHC_VersionGE(target) + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>=target[0])) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction + +function! GHC_NameCurrent() + let last = line("$") + let l = 1 + while l<last + let ml = matchlist( getline(l), '^module\s*\([^ (]*\)') + if ml != [] + let [_,module;x] = ml + return [module] + endif + let l += 1 + endwhile + redraw + echo "cannot find module header for file " . expand("%") + return [] +endfunction + +function! GHC_BrowseBangStar(module) + redraw + echo "browsing module " a:module + let command = ":browse! *" . a:module + let orig_shellredir = &shellredir + let &shellredir = ">" " ignore error/warning messages, only output or lack of it + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + let &shellredir = orig_shellredir + return GHC_ProcessBang(a:module,output) +endfunction + +function! GHC_BrowseMultiple(imports,modules) + redraw + echo "browsing modules " a:modules + let command = ":browse " . join( a:modules, " \n :browse ") + let command = substitute(command,'\(:browse \(\S*\)\)','putStrLn "-- \2" \n \1','g') + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + return GHC_Process(a:imports,output) +endfunction + +function! GHC_Info(what) + " call GHC_HaveTypes() + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%"), ":i ". a:what) + return output +endfunction + +function! GHC_ProcessBang(module,output) + let module = a:module + let b = a:output + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\)\(\S*\)\s*::\(.*\)' + let commentPat = '^-- \(\S*\)' + let definedPat = '^-- defined locally' + let importedPat = '^-- imported via \(.*\)' + if !(b=~commentPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute( id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse! *<current>, we get both unqualified and qualified ids + let qualified = (id =~ '\.') && (id =~ '[A-Z]') + let b:ghc_types[id] = type + if !qualified + for qual in qualifiers + let b:ghc_types[qual.'.'.id] = type + endfor + endif + else + let mlImported = matchlist( l, importedPat ) + let mlDefined = matchlist( l, definedPat ) + if mlImported != [] + let [_,modules;x] = mlImported + let qualifiers = split( modules, ', ' ) + elseif mlDefined != [] + let qualifiers = [module] + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +function! GHC_Process(imports,output) + let b = a:output + let imports = a:imports + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\s*\)\(\S*\)\s*::\(.*\)' + let modPat = '^-- \(\S*\)' + " add '-- defined locally' and '-- imported via ..' + if !(b=~modPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute(id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse *<current>, we get both unqualified and qualified ids + if current_module " || has_key(imports[0],module) + if has_key(b:ghc_types,id) && !(matchstr(b:ghc_types[id],escape(type,'[].'))==type) + let b:ghc_types[id] .= ' -- '.type + else + let b:ghc_types[id] = type + endif + endif + if 0 " has_key(imports[1],module) + let qualid = module.'.'.id + let b:ghc_types[qualid] = type + endif + else + let mlMod = matchlist( l, modPat ) + if mlMod != [] + let [_,module;x] = mlMod + let current_module = module[0]=='*' + let module = current_module ? module[1:] : module + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +let s:ghc_templates = ["module _ () where","class _ where","class _ => _ where","instance _ where","instance _ => _ where","type family _","type instance _ = ","data _ = ","newtype _ = ","type _ = "] + +" use ghci :browse index for insert mode omnicompletion (CTRL-X CTRL-O) +function! GHC_CompleteImports(findstart, base) + if a:findstart + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + call GHC_HaveTypes() + for key in keys(b:ghc_types) + if key[0 : l]==a:base + let res += [{"word":key,"menu":":: ".b:ghc_types[key],"dup":1}] + endif + endfor + return res + endif +endfunction +set omnifunc=GHC_CompleteImports +set completeopt=menu,menuone,longest + +map <LocalLeader>ct :call GHC_CreateTagfile()<cr> +function! GHC_CreateTagfile() + redraw + echo "creating tags file" + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -e ":ctags" ' . expand("%")) + " for ghcs older than 6.6, you would need to call another program + " here, such as hasktags + echo output +endfunction + +command! -nargs=1 GHCi redraw | echo system(g:ghc. ' ' . b:ghc_staticoptions .' '.expand("%").' -e <f-args>') + +" use :make 'not in scope' errors to explicitly list imported ids +" cursor needs to be on import line, in correctly loadable module +map <LocalLeader>ie :call GHC_MkImportsExplicit()<cr> +function! GHC_MkImportsExplicit() + let save_cursor = getpos(".") + let line = getline('.') + let lineno = line('.') + let ml = matchlist(line,'^import\(\s*qualified\)\?\s*\([^( ]\+\)') + if ml!=[] + let [_,q,mod;x] = ml + silent make + if getqflist()==[] + call setline(lineno,'-- '.line) + silent write + silent make + let qflist = getqflist() + call setline(lineno,line) + silent write + let ids = [] + for d in qflist + let ml = matchlist(d.text,'Not in scope: `\([^'']*\)''') + if ml!=[] + let [_,qid;x] = ml + let id = ( qid =~ "^[A-Z]" ? substitute(qid,'.*\.\([^.]*\)$','\1','') : qid ) + let pid = ( id =~ "[a-zA-Z0-9_']\\+" ? id : '('.id.')' ) + let ids += [pid] + endif + endfor + call setline(lineno,'import'.q.' '.mod.'('.join(ids,',').')') + endif + endif + call setpos('.', save_cursor) +endfunction + +if GHC_VersionGE([6,8,2]) + let opts = filter(split(substitute(system(g:ghc . ' -v0 --interactive', ':set'), ' ', '','g'), '\n'), 'v:val =~ "-f"') +else + let opts = ["-fglasgow-exts","-fallow-undecidable-instances","-fallow-overlapping-instances","-fno-monomorphism-restriction","-fno-mono-pat-binds","-fno-cse","-fbang-patterns","-funbox-strict-fields"] +endif + +amenu ]OPTIONS_GHC.- :echo '-'<cr> +aunmenu ]OPTIONS_GHC +for o in opts + exe 'amenu ]OPTIONS_GHC.'.o.' :call append(0,"{-# OPTIONS_GHC '.o.' #-}")<cr>' +endfor +if has("gui_running") + map <LocalLeader>opt :popup ]OPTIONS_GHC<cr> +else + map <LocalLeader>opt :emenu ]OPTIONS_GHC. +endif + +amenu ]LANGUAGES_GHC.- :echo '-'<cr> +aunmenu ]LANGUAGES_GHC +if GHC_VersionGE([6,8]) + let ghc_supported_languages = split(system(g:ghc . ' --supported-languages'),'\n') + for l in ghc_supported_languages + exe 'amenu ]LANGUAGES_GHC.'.l.' :call append(0,"{-# LANGUAGE '.l.' #-}")<cr>' + endfor + if has("gui_running") + map <LocalLeader>lang :popup ]LANGUAGES_GHC<cr> + else + map <LocalLeader>lang :emenu ]LANGUAGES_GHC. + endif +endif +ftplugin/haskell.vim [[[1 +149 + +" todo: allow disabling and undo +" (Claus Reinke, last modified: 18/07/2008) +" +" part of haskell plugins: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ +" please send patches to <claus.reinke@talk21.com> + +" try gf on import line, or ctrl-x ctrl-i, or [I, [i, .. +set include=^import\\s*\\(qualified\\)\\?\\s* +set includeexpr=substitute(v:fname,'\\.','/','g').'.hs' + + +" find start/extent of name/symbol under cursor; +" return start, symbolic flag, qualifier, unqualified id +" (this is used in both haskell_doc.vim and in GHC.vim) +function! Haskell_GetNameSymbol(line,col,off) + let name = "[a-zA-Z0-9_']" + let symbol = "[-!#$%&\*\+/<=>\?@\\^|~:.]" + "let [line] = getbufline(a:buf,a:lnum) + let line = a:line + + " find the beginning of unqualified id or qualified id component + let start = (a:col - 1) + a:off + if line[start] =~ name + let pattern = name + elseif line[start] =~ symbol + let pattern = symbol + else + return [] + endif + while start > 0 && line[start - 1] =~ pattern + let start -= 1 + endwhile + let id = matchstr(line[start :],pattern.'*') + " call confirm(id) + + " expand id to left and right, to get full id + let idPos = id[0] == '.' ? start+2 : start+1 + let posA = match(line,'\<\(\([A-Z]'.name.'*\.\)\+\)\%'.idPos.'c') + let start = posA>-1 ? posA+1 : idPos + let posB = matchend(line,'\%'.idPos.'c\(\([A-Z]'.name.'*\.\)*\)\('.name.'\+\|'.symbol.'\+\)') + let end = posB>-1 ? posB : idPos + + " special case: symbolic ids starting with . + if id[0]=='.' && posA==-1 + let start = idPos-1 + let end = posB==-1 ? start : end + endif + + " classify full id and split into qualifier and unqualified id + let fullid = line[ (start>1 ? start-1 : 0) : (end-1) ] + let symbolic = fullid[-1:-1] =~ symbol " might also be incomplete qualified id ending in . + let qualPos = matchend(fullid, '\([A-Z]'.name.'*\.\)\+') + let qualifier = qualPos>-1 ? fullid[ 0 : (qualPos-2) ] : '' + let unqualId = qualPos>-1 ? fullid[ qualPos : -1 ] : fullid + " call confirm(start.'/'.end.'['.symbolic.']:'.qualifier.' '.unqualId) + + return [start,symbolic,qualifier,unqualId] +endfunction + +function! Haskell_GatherImports() + let imports={0:{},1:{}} + let i=1 + while i<=line('$') + let res = Haskell_GatherImport(i) + if !empty(res) + let [i,import] = res + let prefixPat = '^import\s*\(qualified\)\?\s\+' + let modulePat = '\([A-Z][a-zA-Z0-9_''.]*\)' + let asPat = '\(\s\+as\s\+'.modulePat.'\)\?' + let hidingPat = '\(\s\+hiding\s*\((.*)\)\)\?' + let listPat = '\(\s*\((.*)\)\)\?' + let importPat = prefixPat.modulePat.asPat.hidingPat.listPat ".'\s*$' + + let ml = matchlist(import,importPat) + if ml!=[] + let [_,qualified,module,_,as,_,hiding,_,explicit;x] = ml + let what = as=='' ? module : as + let hidings = split(hiding[1:-2],',') + let explicits = split(explicit[1:-2],',') + let empty = {'lines':[],'hiding':hidings,'explicit':[],'modules':[]} + let entry = has_key(imports[1],what) ? imports[1][what] : deepcopy(empty) + let imports[1][what] = Haskell_MergeImport(deepcopy(entry),i,hidings,explicits,module) + if !(qualified=='qualified') + let imports[0][what] = Haskell_MergeImport(deepcopy(entry),i,hidings,explicits,module) + endif + else + echoerr "Haskell_GatherImports doesn't understand: ".import + endif + endif + let i+=1 + endwhile + if !has_key(imports[1],'Prelude') + let imports[0]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + let imports[1]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + endif + return imports +endfunction + +function! Haskell_ListElem(list,elem) + for e in a:list | if e==a:elem | return 1 | endif | endfor + return 0 +endfunction + +function! Haskell_ListIntersect(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)!=-1 | let l += [e] | endif | endfor + return l +endfunction + +function! Haskell_ListUnion(list1,list2) + let l = [] + for e in a:list2 | if index(a:list1,e)==-1 | let l += [e] | endif | endfor + return a:list1 + l +endfunction + +function! Haskell_ListWithout(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)==-1 | let l += [e] | endif | endfor + return l +endfunction + +function! Haskell_MergeImport(entry,line,hiding,explicit,module) + let lines = a:entry['lines'] + [ a:line ] + let hiding = a:explicit==[] ? Haskell_ListIntersect(a:entry['hiding'], a:hiding) + \ : Haskell_ListWithout(a:entry['hiding'],a:explicit) + let explicit = Haskell_ListUnion(a:entry['explicit'], a:explicit) + let modules = Haskell_ListUnion(a:entry['modules'], [ a:module ]) + return {'lines':lines,'hiding':hiding,'explicit':explicit,'modules':modules} +endfunction + +" collect lines belonging to a single import statement; +" return number of last line and collected import statement +" (assume opening parenthesis, if any, is on the first line) +function! Haskell_GatherImport(lineno) + let lineno = a:lineno + let import = getline(lineno) + if !(import=~'^import') | return [] | endif + let open = strlen(substitute(import,'[^(]','','g')) + let close = strlen(substitute(import,'[^)]','','g')) + while open!=close + let lineno += 1 + let linecont = getline(lineno) + let open += strlen(substitute(linecont,'[^(]','','g')) + let close += strlen(substitute(linecont,'[^)]','','g')) + let import .= linecont + endwhile + return [lineno,import] +endfunction +ftplugin/haskell_doc.vim [[[1 +734 +" +" use haddock docs and index files +" show documentation, complete & qualify identifiers +" +" (Claus Reinke; last modified: 21/10/2008) +" +" part of haskell plugins: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ +" please send patches to <claus.reinke@talk21.com> + +" :Doc <name> and :IDoc <name> open haddocks for <name> in opera +" +" :Doc needs qualified name (default Prelude) and package (default base) +" :IDoc needs unqualified name, looks up possible links in g:haddock_index +" +" :DocIndex populates g:haddock_index from haddock's index files +" :ExportDocIndex saves g:haddock_index to cache file +" :ImportDocIndex reloads g:haddock_index from cache file +" +" all the following use the haddock index (g:haddock_index) +" +" _? opens haddocks for unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _. fully qualifies unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _i add import <module>(<name>) statement for unqualified <name> under cursor, +" _im add import <module> statement for unqualified <name> under cursor, +" suggesting alternative full qualifications in popup menu +" (this currently adds one statement per call, instead of +" merging into existing import statements, but it's a start;-) +" +" CTRL-X CTRL-U (user-defined insert mode completion) +" suggests completions of unqualified names in popup menu + +let s:scriptname = "haskell_doc.vim" + +" script parameters +" g:haddock_browser *mandatory* which browser to call +" g:haddock_browser_callformat [optional] how to call browser +" g:haddock_indexfiledir [optional] where to put 'haddock_index.vim' +" g:haddock_docdir [optional] where to find html docs +" g:ghc [optional] which ghc to call +" g:ghc_pkg [optional] which ghc_pkg to call + +" been here before? +if exists("g:haddock_index") + finish +endif + +" initialise nested dictionary, to be populated +" - from haddock index files via :DocIndex +" - from previous cached version via :ImportDocIndex +let g:haddock_index = {} + +" initialise dictionary, mapping modules with haddocks to their packages, +" populated via MkHaddockModuleIndex() or HaveModuleIndex() +let g:haddock_moduleindex = {} + +" program to open urls, please set this in your vimrc + "examples (for windows): + "let g:haddock_browser = "C:/Program Files/Opera/Opera.exe" + "let g:haddock_browser = "C:/Program Files/Mozilla Firefox/firefox.exe" + "let g:haddock_browser = "C:/Program Files/Internet Explorer/IEXPLORE.exe" +if !exists("g:haddock_browser") + echoerr s:scriptname." WARNING: please set g:haddock_browser!" +endif + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname." can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif + +if (!exists("g:ghc_pkg") || !executable(g:ghc_pkg)) + let g:ghc_pkg = substitute(g:ghc,'\(.*\)ghc','\1ghc-pkg','') +endif + +if exists("g:haddock_docdir") && isdirectory(g:haddock_docdir) + let s:docdir = g:haddock_docdir +elseif executable(g:ghc_pkg) +" try to figure out location of html docs +" first choice: where the base docs are + let field = substitute(system(g:ghc_pkg . ' field base haddock-html'),'\n','','') + let field = substitute(field,'haddock-html: \(.*\)libraries.base','\1','') + let field = substitute(field,'\\','/','g') + let alternate = substitute(field,'html','doc/html','') + if isdirectory(field) + let s:docdir = field + elseif isdirectory(alternate) + let s:docdir = alternate + endif +else + echoerr s:scriptname." can't find ghc-pkg (set g:ghc_pkg ?)." +endif + +" second choice: try some known suspects for windows/unix +if !exists('s:docdir') || !isdirectory(s:docdir) + let s:ghc_libdir = substitute(system(g:ghc . ' --print-libdir'),'\n','','') + let location1a = s:ghc_libdir . '/doc/html/' + let location1b = s:ghc_libdir . '/doc/' + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let location2 = '/usr/share/doc/ghc-' . s:ghc_version . '/html/' + if isdirectory(location1a) + let s:docdir = location1a + elseif isdirectory(location1b) + let s:docdir = location1b + elseif isdirectory(location2) + let s:docdir = location2 + else " give up + echoerr s:scriptname." can't find locaton of html documentation (set g:haddock_docdir)." + finish + endif +endif + +" todo: can we turn s:docdir into a list of paths, and +" include docs for third-party libs as well? + +let s:libraries = s:docdir . 'libraries/' +let s:guide = s:docdir . 'users_guide/' +let s:index = 'index.html' +if exists("g:haddock_indexfiledir") && filewritable(g:haddock_indexfiledir) + let s:haddock_indexfiledir = g:haddock_indexfiledir +elseif filewritable(s:libraries) + let s:haddock_indexfiledir = s:libraries +elseif filewritable($HOME) + let s:haddock_indexfiledir = $HOME.'/' +else "give up + echoerr s:scriptname." can't locate index file. please set g:haddock_indexfiledir" + finish +endif +let s:haddock_indexfile = s:haddock_indexfiledir . 'haddock_index.vim' + +" different browser setups require different call formats; +" you might want to call the browser synchronously or +" asynchronously, and the latter is os-dependent; +" +" by default, the browser is started in the background when on +" windows or if running in a gui, and in the foreground otherwise +" (eg, console-mode for remote sessions, with text-mode browsers). +" +" you can override these defaults in your vimrc, via a format +" string including 2 %s parameters (the first being the browser +" to call, the second being the url). +if !exists("g:haddock_browser_callformat") + if has("win32") || has("win64") + let g:haddock_browser_callformat = 'start %s "file://%s"' + else + if has("gui_running") + let g:haddock_browser_callformat = '%s file://%s '.printf(&shellredir,'/dev/null').' &' + else + let g:haddock_browser_callformat = '%s file://%s' + endif + endif +endif + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +command! DocSettings call DocSettings() +function! DocSettings() + for v in ["g:haddock_browser","g:haddock_browser_callformat","g:haddock_docdir","g:haddock_indexfiledir","s:ghc_libdir","s:ghc_version","s:docdir","s:libraries","s:guide","s:haddock_indexfile"] + if exists(v) + echo v '=' eval(v) + else + echo v '=' + endif + endfor +endfunction + +function! DocBrowser(url) + "echomsg "DocBrowser(".url.")" + if (!exists("g:haddock_browser") || !executable(g:haddock_browser)) + echoerr s:scriptname." can't find documentation browser. please set g:haddock_browser" + return + endif + " start browser to open url, according to specified format + silent exe '!'.printf(g:haddock_browser_callformat,g:haddock_browser,escape(a:url,'#%')) +endfunction + +"usage examples: +" :Doc length +" :Doc Control.Monad.when +" :Doc Data.List. +" :Doc Control.Monad.State.runState mtl +" :Doc -top +" :Doc -libs +" :Doc -guide +command! -nargs=+ Doc call Doc('v',<f-args>) +command! -nargs=+ Doct call Doc('t',<f-args>) + +function! Doc(kind,qualname,...) + let suffix = '.html' + let relative = '#'.a:kind.'%3A' + + if a:qualname=="-top" + call DocBrowser(s:docdir . s:index) + return + elseif a:qualname=="-libs" + call DocBrowser(s:libraries . s:index) + return + elseif a:qualname=="-guide" + call DocBrowser(s:guide . s:index) + return + endif + + if a:0==0 " no package specified + let package = 'base/' + else + let package = a:1 . '/' + endif + + if match(a:qualname,'\.')==-1 " unqualified name + let [qual,name] = [['Prelude'],a:qualname] + let file = join(qual,'-') . suffix . relative . name + elseif a:qualname[-1:]=='.' " module qualifier only + let parts = split(a:qualname,'\.') + let quallen = len(parts)-1 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix + else " qualified name + let parts = split(a:qualname,'\.') + let quallen = len(parts)-2 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix . relative . name + endif + +" let path = s:libraries . package . file + let path = file + call DocBrowser(path) +endfunction + +" TODO: add commandline completion for :IDoc +" indexed variant of Doc, looking up links in g:haddock_index +" usage: +" 1. :IDoc length +" 2. click on one of the choices, or select by number (starting from 0) +command! -nargs=+ IDoc call IDoc(<f-args>) +function! IDoc(name,...) + let choices = HaddockIndexLookup(a:name) + if choices=={} | return | endif + if a:0==0 + let keylist = map(deepcopy(keys(choices)),'substitute(v:val,"\\[.\\]","","")') + let choice = inputlist(keylist) + else + let choice = a:1 + endif + +" let path = s:libraries . values(choices)[choice] + let path = values(choices)[choice] " assumes same order for keys/values.. + call DocBrowser(path) +endfunction + +let s:flagref = s:guide . 'flag-reference.html' +if filereadable(s:flagref) + " extract the generated fragment ids for the + " flag reference sections + let s:headerPat = '.\{-}<h3 class="title"><a name="\([^"]*\)"><\/a>\([^<]*\)<\/h3>\(.*\)' + let s:flagheaders = [] + let s:flagheaderids = {} + let s:contents = join(readfile(s:flagref)) + let s:ml = matchlist(s:contents,s:headerPat) + while s:ml!=[] + let [_,s:id,s:title,s:r;s:x] = s:ml + let s:flagheaders = add(s:flagheaders, s:title) + let s:flagheaderids[s:title] = s:id + let s:ml = matchlist(s:r,s:headerPat) + endwhile + command! -nargs=1 -complete=customlist,CompleteFlagHeaders + \ FlagReference call FlagReference(<f-args>) + function! FlagReference(section) + let relativeUrl = a:section==""||!exists("s:flagheaderids['".a:section."']") ? + \ "" : "#".s:flagheaderids[a:section] + call DocBrowser(s:flagref.relativeUrl) + endfunction + function! CompleteFlagHeaders(al,cl,cp) + let s:choices = s:flagheaders + return CompleteAux(a:al,a:cl,a:cp) + endfunction +endif + +command! -nargs=1 -complete=customlist,CompleteHaddockModules MDoc call MDoc(<f-args>) +function! MDoc(module) + let suffix = '.html' + call HaveModuleIndex() + if !has_key(g:haddock_moduleindex,a:module) + echoerr a:module 'not found in haddock module index' + return + endif + let package = g:haddock_moduleindex[a:module]['package'] + let file = substitute(a:module,'\.','-','g') . suffix +" let path = s:libraries . package . '/' . file + let path = g:haddock_moduleindex[a:module]['html'] + call DocBrowser(path) +endfunction + +function! CompleteHaddockModules(al,cl,cp) + call HaveModuleIndex() + let s:choices = keys(g:haddock_moduleindex) + return CompleteAux(a:al,a:cl,a:cp) +endfunction + +" create a dictionary g:haddock_index, containing the haddoc index +command! DocIndex call DocIndex() +function! DocIndex() + let files = split(globpath(s:libraries,'doc-index*.html'),'\n') + "let files = [s:libraries.'doc-index-33.html'] + let g:haddock_index = {} + call ProcessHaddockIndexes2(s:libraries,files) + if GHC_VersionGE([6,8,2]) + " TODO: escape * when? + let s:addon_libraries = split(system(g:ghc_pkg . ' field * haddock-html'),'\n') + for addon in s:addon_libraries + let ml = matchlist(addon,'haddock-html: \("\)\?\(file:///\)\?\([^"]*\)\("\)\?') + if ml!=[] + let [_,quote,file,addon_path;x] = ml + let addon_path = substitute(addon_path,'\(\\\\\|\\\)','/','g') + let addon_files = split(globpath(addon_path,'doc-index*.html'),'\n') + call ProcessHaddockIndexes2(addon_path,addon_files) + endif + endfor + endif + return 1 +endfunction + +function! ProcessHaddockIndexes(location,files) + let entryPat= '.\{-}"indexentry"[^>]*>\([^<]*\)<\(\%([^=]\{-}TD CLASS="\%(indexentry\)\@!.\{-}</TD\)*\)[^=]\{-}\(\%(="indexentry\|TABLE\).*\)' + let linkPat = '.\{-}HREF="\([^"]*\)".>\([^<]*\)<\(.*\)' + + redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let contents = join(readfile(f)) + let ml = matchlist(contents,entryPat) + while ml!=[] + let [_,entry,links,r;x] = ml + "echo entry links + let ml2 = matchlist(links,linkPat) + let link = {} + while ml2!=[] + let [_,l,m,links;x] = ml2 + "echo l m + let link[m] = a:location . '/' . l + let ml2 = matchlist(links,linkPat) + endwhile + let g:haddock_index[DeHTML(entry)] = deepcopy(link) + "echo entry g:haddock_index[entry] + let ml = matchlist(r,entryPat) + endwhile + endfor +endfunction + +" concatenating all lines is too slow for a big file, process lines directly +function! ProcessHaddockIndexes2(location,files) + let entryPat= '^>\([^<]*\)</' + let linkPat = '.\{-}A HREF="\([^"]*\)"' + let kindPat = '#\(.\)' + + redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let isEntry = 0 + let isLink = '' + let link = {} + let entry = '' + for line in readfile(f) + if line=~'CLASS="indexentry' + if (link!={}) && (entry!='') + let g:haddock_index[DeHTML(entry)] = deepcopy(link) + let link = {} + let entry = '' + endif + let isEntry=1 + continue + endif + if isEntry==1 + let ml = matchlist(line,entryPat) + if ml!=[] | let [_,entry;x] = ml | let isEntry=0 | continue | endif + endif + if entry!='' + let ml = matchlist(line,linkPat) + if ml!=[] | let [_,isLink;x]=ml | continue | endif + endif + if isLink!='' + let ml = matchlist(line,entryPat) + if ml!=[] + let [_,module;x] = ml + let [_,kind;x] = matchlist(isLink,kindPat) + let last = a:location[strlen(a:location)-1] + let link[module."[".kind."]"] = a:location . (last=='/'?'':'/') . isLink + let isLink='' + continue + endif + endif + endfor + if link!={} | let g:haddock_index[DeHTML(entry)] = deepcopy(link) | endif + endfor +endfunction + +command! ExportDocIndex call ExportDocIndex() +function! ExportDocIndex() + call HaveIndex() + let entries = [] + for key in keys(g:haddock_index) + let entries += [key,string(g:haddock_index[key])] + endfor + call writefile(entries,s:haddock_indexfile) + redir end +endfunction + +command! ImportDocIndex call ImportDocIndex() +function! ImportDocIndex() + if filereadable(s:haddock_indexfile) + let lines = readfile(s:haddock_indexfile) + let i=0 + while i<len(lines) + let [key,dict] = [lines[i],lines[i+1]] + sandbox let g:haddock_index[key] = eval(dict) + let i+=2 + endwhile + return 1 + else + return 0 + endif +endfunction + +function! HaveIndex() + return (g:haddock_index!={} || ImportDocIndex() || DocIndex() ) +endfunction + +function! MkHaddockModuleIndex() + let g:haddock_moduleindex = {} + call HaveIndex() + for key in keys(g:haddock_index) + let dict = g:haddock_index[key] + for module in keys(dict) + let html = dict[module] + let ml = matchlist(html,'libraries/\([^\/]*\)\/') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + let ml = matchlist(html,'/\([^\/]*\)\/html/[A-Z]') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + endfor + endfor +endfunction + +function! HaveModuleIndex() + return (g:haddock_moduleindex!={} || MkHaddockModuleIndex() ) +endfunction + +" decode HTML symbol encodings (are these all we need?) +function! DeHTML(entry) + let res = a:entry + let decode = { '<': '<', '>': '>', '&': '\\&' } + for enc in keys(decode) + exe 'let res = substitute(res,"'.enc.'","'.decode[enc].'","g")' + endfor + return res +endfunction + +" find haddocks for word under cursor +" also lists possible definition sites +map <LocalLeader>? :call Haddock()<cr> +function! Haddock() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let imports = Haskell_GatherImports() + let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let name = unqual + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + let keys = ((qual=='')||(asm==[])||(qual==asm[0])) ? keys(dict) + \ : Haskell_ListIntersect(keylist,asm) + if (qual!='') && (asm!=[]) && (qual==asm[0]) + for key in keys + if key==qual + " call DocBrowser(s:libraries . dict[key]) + call DocBrowser(dict[key]) + endif + endfor + elseif has("gui_running") + let i=0 + for key in keys + exe 'amenu ]Popup.'.escape(key,'\.').' :call IDoc("'.escape(name,'|').'",'.i.')<cr>' + let i+=1 + endfor + popup ]Popup + else + let s:choices = keys + let key = input('browse docs for '.name.' in: ','','customlist,CompleteAux') + if key!='' + " call DocBrowser(s:libraries . dict[key]) + call DocBrowser(dict[key]) + endif + endif +endfunction + +" used to pass on choices to CompleteAux +let s:choices=[] + +" if there's no gui, use commandline completion instead of :popup +" completion function CompleteAux suggests completions for a:al, wrt to s:choices +function! CompleteAux(al,cl,cp) + "echomsg '|'.a:al.'|'.a:cl.'|'.a:cp.'|' + let res = [] + let l = len(a:al)-1 + for r in s:choices + if l==-1 || r[0 : l]==a:al + let res += [r] + endif + endfor + return res +endfunction + +" CamelCase shorthand matching: +" favour upper-case letters and module qualifier separators (.) for disambiguation +function! CamelCase(shorthand,string) + let s1 = a:shorthand + let s2 = a:string + let notFirst = 0 " don't elide before first pattern letter + while ((s1!="")&&(s2!="")) + let head1 = s1[0] + let head2 = s2[0] + let elide = notFirst && ( ((head1=~'[A-Z]') && (head2!~'[A-Z.]')) + \ ||((head1=='.') && (head2!='.')) ) + if elide + let s2=s2[1:] + elseif (head1==head2) + let s1=s1[1:] + let s2=s2[1:] + else + return 0 + endif + let notFirst = (head1!='.')||(head2!='.') " treat separators as new beginnings + endwhile + return (s1=="") +endfunction + +" use haddock name index for insert mode completion (CTRL-X CTRL-U) +function! CompleteHaddock(findstart, base) + if a:findstart + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + let qual = a:base =~ '^[A-Z][a-zA-Z0-9_'']*\(\.[A-Z][a-zA-Z0-9_'']*\)*\(\.[a-zA-Z0-9_'']*\)\?$' + call HaveIndex() + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if (key[0 : l]==a:base) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if word[0 : l]==a:base + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + if res==[] " no prefix matches, try CamelCase shortcuts + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if CamelCase(a:base,key) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if CamelCase(a:base,word) + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + endif + return res + endif +endfunction +set completefunc=CompleteHaddock +set completeopt=menu,menuone,longest + +" fully qualify an unqualified name +map <LocalLeader>. :call Qualify()<cr> +function! Qualify() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + if qual!='' " TODO: should we support re-qualification? + redraw + echo 'already qualified' + return 0 + endif + let name = unqual + let line = line('.') + let prefix = (start<=1 ? '' : getline(line)[0:start-2] ) + let i=0 + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + let imports = Haskell_GatherImports() + for qualifiedImport in keys(imports[1]) + let c=0 + for module in imports[1][qualifiedImport]['modules'] + if Haskell_ListElem(keylist,module) | let c+=1 | endif + endfor + if c>0 | let keylist=[qualifiedImport]+keylist | endif + endfor + "let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + if has("gui_running") + for key in keylist + let lhs=escape(prefix.name,'/.|\') + let rhs=escape(prefix.key.'.'.name,'/&|\') + exe 'amenu ]Popup.'.escape(key,'\.').' :'.line.'s/'.lhs.'/'.rhs.'/<cr>:noh<cr>' + let i+=1 + endfor + popup ]Popup + else + let s:choices = keylist + let key = input('qualify '.name.' with: ','','customlist,CompleteAux') + if key!='' + let lhs=escape(prefix.name,'/.\') + let rhs=escape(prefix.key.'.'.name,'/&\') + exe line.'s/'.lhs.'/'.rhs.'/' + noh + endif + endif +endfunction + +" create (qualified) import for a (qualified) name +map <LocalLeader>i :call Import(0,0)<cr> +map <LocalLeader>im :call Import(1,0)<cr> +map <LocalLeader>iq :call Import(0,1)<cr> +map <LocalLeader>iqm :call Import(1,1)<cr> +function! Import(module,qualified) + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = Haskell_GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let name = unqual + let pname = ( symb ? '('.name.')' : name ) + let importlist = a:module ? '' : '('.pname.')' + let qualified = a:qualified ? 'qualified ' : '' + + if qual!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.qual.importlist.''')' + return + endif + + let line = line('.') + let prefix = getline(line)[0:start-1] + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + if has("gui_running") + for key in keylist + " exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search("\\%1c\\(import\\\\|module\\\\|{-# OPTIONS\\)","nb"),"import '.key.importlist.'")<cr>' + exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search(''\%1c\(\<import\>\\|\<module\>\\|{-# OPTIONS\\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.escape(importlist,'|').''')<cr>' + endfor + popup ]Popup + else + let s:choices = keylist + let key = input('import '.name.' from: ','','customlist,CompleteAux') + if key!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.importlist.''')' + endif + endif +endfunction + +function! HaddockIndexLookup(name) + call HaveIndex() + if !has_key(g:haddock_index,a:name) + echoerr a:name 'not found in haddock index' + return {} + endif + return g:haddock_index[a:name] +endfunction + +" copied from ghc.vim :-( should we move everything to using autoload instead? +" we query the ghc version here, as we don't otherwise need it.. +function! GHC_VersionGE(target) + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>=target[0])) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction +ftplugin/haskell_hpaste.vim [[[1 +75 +" rudimentary hpaste support for vim +" (using netrw for reading, wget for posting/annotating) +" +" claus reinke, last modified: 19/08/2007 +" +" part of haskell plugins: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ + +" unless wget is in your PATH, you need to set g:wget +" before loading this script. windows users are out of +" luck, unless they have wget installed (such as the +" cygwin one looked for here), or adapt this script to +" whatever alternative they have at hand (perhaps using +" vim's perl/python bindings?) +if !exists("g:wget") + if executable("wget") + let g:wget = "!wget -q" + else + let g:wget = "!c:\\cygwin\\bin\\wget -q" + endif +endif + +" read (recent) hpaste files +" show index in new buffer, where ,r will open current entry +" and ,p will annotate current entry with current buffer +command! HpasteIndex call HpasteIndex() +function! HpasteIndex() + new + read http://hpaste.org + %s/\_$\_.//g + %s/<tr[^>]*>//g + %s/<\/tr>/
/g + g/<\/table>/d + g/DOCTYPE/d + %s/<td><a href="\/\([0-9]*\)">view<\/a><\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td>/\1 \2 (\3) "\4" \5/ + map <buffer> ,r 0ye:noh<cr>:call HpasteEditEntry('"')<cr> +endfunction + +" load an existing entry for editing +command! -nargs=1 HpasteEditEntry call HpasteEditEntry(<f-args>) +function! HpasteEditEntry(entry) + exe 'edit! http://hpaste.org/'.a:entry.'/0/plain' + exe 'map <buffer> ,p :call HpasteAnnotate('''.a:entry.''')<cr>' +endfunction + +" annotate existing entry (only to be called via ,p in HpasteIndex) +function! HpasteAnnotate(entry) + let nick = input("nick? ") + let title = input("title? ") + if nick=='' || title=='' + echo "nick or title missing. aborting annotation" + return + endif + call HpastePost('annotate/'.a:entry,nick,title) +endfunction + +" post new hpaste entry +" using 'wget --post-data' and url-encoded content +command! HpastePostNew call HpastePost('new',<args>) +function! HpastePost(mode,nick,title,...) + let lines = getbufline("%",1,"$") + let pat = '\([^[:alnum:]]\)' + let code = '\=printf("%%%02X",char2nr(submatch(1)))' + let lines = map(lines,'substitute(v:val."\r\n",'''.pat.''','''.code.''',''g'')') + + let url = 'http://hpaste.org/' . a:mode + let nick = substitute(a:nick,pat,code,'g') + let title = substitute(a:title,pat,code,'g') + if a:0==0 + let announce = 'false' + else + let announce = a:1 + endif + let cmd = g:wget.' --post-data="content='.join(lines,'').'&nick='.nick.'&title='.title.'&announce='.announce.'" '.url + exe escape(cmd,'%') +endfunction +doc/haskellmode.txt [[[1 +434 +*haskellmode.txt* Haskell Mode Plugins 18/07/2008 + +Authors: + Claus Reinke <claus.reinke@talk21.com> ~ + +Homepage: + http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/ + +CONTENTS *haskellmode* + + 1. Overview |haskellmode-overview| + 1.1 Runtime Requirements |haskellmode-requirements| + 1.2 Quick Reference |haskellmode-quickref| + 2. Settings |haskellmode-settings| + 2.1 GHC and web browser |haskellmode-settings-main| + 2.2 Fine tuning - more configuration options |haskellmode-settings-fine| + 3. GHC Compiler Integration |haskellmode-compiler| + 4. Haddock Integration |haskellmode-haddock| + 4.1 Indexing |haskellmode-indexing| + 4.2 Lookup |haskellmode-lookup| + 4.3 Editing |haskellmode-editing| + 5. Hpaste Integration |haskellmode-hpaste| + 6. Additional Resources |haskellmode-resources| + +============================================================================== + *haskellmode-overview* +1. Overview ~ + + The Haskell mode plugins provide advanced support for Haskell development + using GHC/GHCi on Windows and Unix-like systems. The functionality is + based on Haddock-generated library indices, on GHCi's interactive + commands, or on simply activating (some of) Vim's built-in program editing + support in Haskell-relevant fashion. These plugins live side-by-side with + the pre-defined |syntax-highlighting| support for |haskell| sources, and + any other Haskell-related plugins you might want to install (see + |haskellmode-resources|). + + The Haskell mode plugins consist of three filetype plugins (haskell.vim, + haskell_doc.vim, haskell_hpaste.vim), which by Vim's |filetype| detection + mechanism will be auto-loaded whenever files with the extension '.hs' are + opened, and one compiler plugin (ghc.vim) which you will need to load from + your vimrc file (see |haskellmode-settings|). + + + *haskellmode-requirements* +1.1 Runtime Requirements ~ + + The plugins require a recent installation of GHC/GHCi. The functionality + derived from Haddock-generated library indices also requires a local + installation of the Haddock documentation for GHC's libraries (if there is + no documentation package for your system, you can download a tar-ball from + haskell.org), as well as an HTML browser (see |haddock_browser|). If you + want to use the experimental hpaste interface, you will also need Wget. + + * GHC/GHCi ~ + Provides core functionality. http://www.haskell.org/ghc + + * HTML library documentation files and indices generated by Haddock ~ + These usually come with your GHC installation, possibly as a separate + package. If you cannot get them this way, you can download a tar-ball + from http://www.haskell.org/ghc/docs/latest/ + + * HTML browser with basic CSS support ~ + For browsing Haddock docs. + + * Wget ~ + For interfacing with http://hpaste.org. + + Wget is widely available for modern Unix-like operating systems. Several + ports also exist for Windows, including: + + - Official GNU Wget (natively compiled for Win32) + http://www.gnu.org/software/wget/#downloading + + - UnxUtils Wget (natively compiled for Win32, bundled with other ported + Unix utilities) + http://sourceforge.net/projects/unxutils/ + + - Cygwin Wget (emulated POSIX in Win32, must be run under Cygwin) + http://cygwin.com/packages/wget/ + + *haskellmode-quickref* +1.2 Quick Reference ~ + +|:make| load into GHCi, show errors (|quickfix| |:copen|) +|_ct| create |tags| file +|_si| show info for id under cursor +|_t| show type for id under cursor +|_T| insert type declaration for id under cursor +|balloon| show type for id under mouse pointer +|_?| browse Haddock entry for id under cursor +|:IDoc| {identifier} browse Haddock entry for unqualified {identifier} +|:MDoc| {module} browse Haddock entry for {module} +|:FlagReference| {s} browse Users Guide Flag Reference for section {s} +|_.| qualify unqualified id under cursor +|_i| add 'import <module>(<identifier>)' for id under cursor +|_im| add 'import <module>' for id under cursor +|_iq| add 'import qualified <module>(<identifier>)' for id under cursor +|_iqm| add 'import qualified <module>' for id under cursor +|_ie| make imports explit for import statement under cursor +|_opt| add OPTIONS_GHC pragma +|_lang| add LANGUAGE pragma +|i_CTRL-X_CTRL-O| insert-mode completion based on imported ids (|haskellmode-XO|) +|i_CTRL-X_CTRL-U| insert-mode completion based on documented ids (|haskellmode-XU|) +|i_CTRL-N| insert-mode completion based on imported sources +|:GHCi|{command/expr} run GHCi command/expr in current module + +|:GHCStaticOptions| edit static GHC options for this buffer +|:DocSettings| show current Haddock-files-related plugin settings +|:DocIndex| populate Haddock index +|:ExportDocIndex| cache current Haddock index to a file +|:HpasteIndex| Read index of most recent entries from hpaste.org +|:HpastePostNew| Submit current buffer as a new hpaste + + +============================================================================== + *haskellmode-settings* +2. Settings ~ + + The plugins try to find their dependencies in standard locations, so if + you're lucky, you will only need to set |compiler| to ghc, and configure + the location of your favourite web browser. Given the variety of things to + guess, however, some dependencies might not be found correctly, or the + defaults might not be to your liking, in which case you can do some more + fine tuning. All of this configuration should happen in your |vimrc|. + + *haskellmode-settings-main* +2.1 GHC and web browser ~ + + *compiler-ghc* *ghc-compiler* + To use the features provided by the GHC |compiler| plugin, use the + following |autocommand| in your vimrc: +> + au BufEnter *.hs compiler ghc +< + *g:ghc* + If the compiler plugin can't locate your GHC binary, or if you have + several versions of GHC installed and have a preference as to which binary + is used, set |g:ghc|: +> + :let g:ghc="/usr/bin/ghc-6.6.1" +< + + *:GHCStaticOptions* +:GHCStaticOptions Edit the static GHC options for the current buffer. + Useful for adding hidden packages (-package ghc). + + *g:haddock_browser* + The preferred HTML browser for viewing Haddock documentation can be set as + follows: +> + :let g:haddock_browser="/usr/bin/firefox" +< + + *haskellmode-settings-fine* +2.2 Fine tuning - more configuration options ~ + + Most of the fine tuning is likely to happen for the haskellmode_doc.vim + plugin, so you can check the current settings for this plugin via the + command |:DocSettings|. If all the settings reported there are to your + liking, you probably won't need to do any fine tuning. + + *g:haddock_browser_callformat* + By default, the web browser|g:haddock_browser| will be started + asynchronously (in the background) on Windows or when vim is running in a + GUI, and synchronously (in the foreground) otherwise. These settings seem + to work fine if you are using a console mode browser (eg, when editing in + a remote session), or if you are starting a GUI browser that will launch + itself in the background. But if these settings do not work for you, you + can change the default browser launching behavior. + + This is controlled by |g:haddock_browser_callformat|. It specifies a + format string which uses two '%s' parameters, the first representing the + path of the browser to launch, and the second is the documentation URL + (minus the protocol specifier, i.e. file://) passed to it by the Haddock + plugin. For instance, to launch a GUI browser on Unix-like systems and + force it to the background (see also |shellredir|): +> + :let g:haddock_browser_callformat = '%s file://%s '.printf(&shellredir,'/dev/null').' &' +< + *g:haddock_docdir* + Your system's installed Haddock documentation for GHC and its libraries + should be automatically detected. If the plugin can't locate them, you + must point |g:haddock_docdir| to the path containing the master index.html + file for the subdirectories 'libraries', 'Cabal', 'users_guide', etc.: +> + :let g:haddock_docdir="/usr/local/share/doc/ghc/html/" +< + *g:haddock_indexfiledir* + The information gathered from Haddock's index files will be stored in a + file called 'haddock_index.vim' in a directory derived from the Haddock + location, or in $HOME. To configure another directory for the index file, + use: +> + :let g:haddock_indexfiledir="~/.vim" +< + *g:wget* + If you also want to try the experimental hpaste functionality, you might + you need to set |g:wget| before the |hpaste| plugin is loaded (unless wget + is in your PATH): +> + :let g:wget="C:\Program Files\wget\wget.exe" +< + + Finally, the mappings actually use|<LocalLeader>|behind the scenes, so if + you have to, you can redefine|maplocalleader|to something other than '_'. + Just remember that the docs still refer to mappings starting with '_', to + avoid confusing the majority of users!-) + +============================================================================== + *haskellmode-compiler* *ghc* +3. GHC Compiler Integration ~ + + The GHC |compiler| plugin sets the basic |errorformat| and |makeprg| to + enable |quickfix| mode using GHCi, and provides functionality for show + info (|_si|), show type (|_t| or mouse |balloon|), add type declaration + (|_T|), create tag file (|_ct|), and insert-mode completion + (|i_CTRL-X_CTRL-O|) based on GHCi browsing of the current and imported + modules. + + To avoid frequent calls to GHCi, type information is cached in Vim. The + cache will be populated the first time a command depends on it, and will + be refreshed every time a |:make| goes through without generating errors + (if the |:make| does not succeed, the old types will remain available in + Vim). You can also unconditionally force reloading of type info using + |:GHCReload| (if GHCi cannot load your file, the type info will be empty). + + + In addition to the standard|quickfix| commands, the GHC compiler plugin + provides: + + *:GHCReload* +:GHCReload Reload modules and unconditionally refresh cache of + type info. Usually, |:make| is prefered, as that will + refresh the cache only if GHCi reports no errors, and + show the errors otherwise. + + *:GHCi* +:GHCi {command/expr} Run GHCi commands/expressions in the current module. + + *_ct* +_ct Create |tags| file for the current Haskell source + file. This uses GHCi's :ctags command, so it will work + recursively, but will only list tags for exported + entities. + + *_opt* +_opt Shows a menu of frequently used GHC compiler options + (selecting an entry adds the option as a pragma to the + start of the file). Uses popup menu (GUI) or :emenu + and command-line completion (CLI). + + *_lang* +_lang Shows a menu of the LANGUAGE options supported by GHC + (selecting an entry adds the language as a pragma to + the start of the file). Uses popup menu (GUI) or + :emenu and command-line completion (CLI). + + *_si* +_si Show extended information for the name under the + cursor. Uses GHCi's :info command. + + *_t* +_t Show type for the name under the cursor. Uses cached + info from GHCi's :browse command. + + *_T* +_T Insert type declaration for the name under the cursor. + Uses cached info from GHCi's :browse command. + + *haskellmode-XO* *haskellmode-omni-completion* +CTRL-X CTRL-O Standard insert-mode omni-completion based on the + cached type info from GHCi browsing current and + imported modules. Only names from the current and from + imported modules are included (the completion menu + also show the type of each identifier). + +============================================================================== + *haskellmode-haddock* *haddock* +4. Haddock Integration ~ + + Haskell mode integrates with Haddock-generated HTML documentation, + providing features such as navigating to the Haddock entry for the + identifier under the cursor (|_?|), completion for the identifier under + the cursor (|i_CTRL-X_CTRL-U|), and adding import statements (|_i| |_im| + |_iq| |_iqm|) or module qualifier (|_.|) for the identifier under the + cursor. + + These commands operate on an internal Haddock index built from the + platform's installed Haddock documentation for GHC's libraries. Since + populating this index takes several seconds, it should be stored as a + file called 'haddock_index.vim' in the directory specified by + |g:haddock_indexfiledir|. + + Some commands present a different interface (popup menu or command-line + completion) according to whether the current Vim instance is graphical or + console-based (actually: whether or not the GUI is running). Such + differences are marked below with the annotations (GUI) and (CLI), + respectively. + + |:DocSettings| shows the settings for this plugin. If you are happy with + them, you can call |:ExportDocIndex| to populate and write out the + documentation index (should be called once for every new version of GHC). + + *:DocSettings* +:DocSettings Show current Haddock-files-related plugin settings. + + + *haskellmode-indexing* +4.1 Indexing ~ + + *:DocIndex* +:DocIndex Populate the Haddock index from the GHC library + documentation. + + *:ExportDocIndex* +:ExportDocIndex Cache the current Haddock index to a file (populate + index first, if empty). + + + *haskellmode-lookup* +4.2 Lookup ~ + + *_?* +_? Open the Haddock entry (in |haddock_browser|) for an + identifier under the cursor, selecting full + qualifications from a popup menu (GUI) or via + command-line completion (CLI), if the identifier is + not qualified. + + *:IDoc* +:IDoc {identifier} Open the Haddock entry for the unqualified + {identifier} in |haddock_browser|, suggesting possible + full qualifications. + + *:MDoc* +:MDoc {module} Open the Haddock entry for {module} in + |haddock_browser| (with command-line completion for + the fully qualified module name). + + *:FlagReference* +:FlagReference {s} Browse Users Guide Flag Reference for section {s} + (with command-line completion for section headers). + + + *haskellmode-editing* +4.3 Editing ~ + + *_.* +_. Fully qualify the unqualified name under the cursor + selecting full qualifications from a popup menu (GUI) + or via command-line completion (CLI). + + *_iq* *_i* +_i _iq Add 'import [qualified] <module>(<identifier>)' + statement for the identifier under the cursor, + selecting fully qualified modules from a popup menu + (GUI) or via command-line completion (CLI), if the + identifier is not qualified. This currently adds one + import statement per call instead of merging into + existing import statements. + + *_iqm* *_im* +_im Add 'import [qualified] <module>' statement for the + identifier under the cursor, selecting fully qualified + modules from a popup menu (GUI) or via command-line + completion (CLI), if the identifier is not qualified. + This currently adds one import statement per call + instead of merging into existing import statements. + + *_ie* +_ie On an 'import <module>' line, in a correctly loadable + module, temporarily comment out import and use :make + 'not in scope' errors to explicitly list imported + identifiers. + + *haskellmode-XU* *haskellmode-user-completion* +CTRL-X CTRL-U User-defined insert mode name completion based on all + names known to the Haddock index, including package + names. Completions are presented in a popup menu which + also displays the fully qualified module from which + each entry may be imported. + + CamelCode shortcuts are supported, meaning that + lower-case letters can be elided, using only + upper-case letters and module qualifier separators (.) + for disambiguation: + + pSL -> putStrLn + C.E.t -> Control.Exception.t + C.M.MP -> Control.Monad.MonadPlus + + To reduce unwanted matches, the first letter of such + shortcuts and the first letter after each '.' have to + match directly. + +============================================================================== + *haskellmode-hpaste* *hpaste* +5. Hpaste Integration ~ + + This experimental feature allows browsing and posting to + http://hpaste.org, a Web-based pastebin tailored for Haskell code. + + + *:HpasteIndex* +:HpasteIndex Read the most recent entries from hpaste.org. Show an + index of the entries in a new buffer, where ',r' will + open the current highlighted entry and ',p' will + annotate it with the current buffer. + + *:HpastePostNew* +:HpastePostNew Submit current buffer as a new hpaste entry. + +============================================================================== + *haskellmode-resources* +6. Additional Resources ~ + + An illustrated walk-through of these plugins is available at: + + http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/vim.html + + Other Haskell-related Vim plugins can be found here: + + http://www.haskell.org/haskellwiki/Libraries_and_tools/Program_development#Vim + + Make sure to read about Vim's other program-editing features in its online + |user-manual|. Also have a look at Vim tips and plugins at www.vim.org - + two other plugins I tend to use when editing Haskell are AlignPlugin.vim + (to line up regexps for definitions, keywords, comments, etc. in + consecutive lines) and surround.vim (to surround text with quotes, + brackets, parentheses, comments, etc.). + +============================================================================== + vim:tw=78:ts=8:ft=help: diff --git a/dot_vim/haskellmode-20090424.vba b/dot_vim/haskellmode-20090424.vba new file mode 100644 index 0000000..e096c85 --- /dev/null +++ b/dot_vim/haskellmode-20090424.vba @@ -0,0 +1,2005 @@ +" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. +UseVimball +finish +compiler/ghc.vim [[[1 +470 + +" Vim Compiler File +" Compiler: GHC +" Maintainer: Claus Reinke <claus.reinke@talk21.com> +" Last Change: 21/04/2009 +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim + +" ------------------------------ paths & quickfix settings first +" + +if exists("current_compiler") && current_compiler == "ghc" + finish +endif +let current_compiler = "ghc" + +let s:scriptname = "ghc.vim" + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname.": can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif +let ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') +if (!exists("b:ghc_staticoptions")) + let b:ghc_staticoptions = '' +endif + +" set makeprg (for quickfix mode) +execute 'setlocal makeprg=' . g:ghc . '\ ' . escape(b:ghc_staticoptions,' ') .'\ -e\ :q\ %' +"execute 'setlocal makeprg=' . g:ghc .'\ -e\ :q\ %' +"execute 'setlocal makeprg=' . g:ghc .'\ --make\ %' + +" quickfix mode: +" fetch file/line-info from error message +" TODO: how to distinguish multiline errors from warnings? +" (both have the same header, and errors have no common id-tag) +" how to get rid of first empty message in result list? +setlocal errorformat= + \%-Z\ %#, + \%W%f:%l:%c:\ Warning:\ %m, + \%E%f:%l:%c:\ %m, + \%E%>%f:%l:%c:, + \%+C\ \ %#%m, + \%W%>%f:%l:%c:, + \%+C\ \ %#%tarning:\ %m, + +" oh, wouldn't you guess it - ghc reports (partially) to stderr.. +setlocal shellpipe=2> + +" ------------------------- but ghc can do a lot more for us.. +" + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +" initialize map of identifiers to their types +" associate type map updates to changedtick +if !exists("b:ghc_types") + let b:ghc_types = {} + let b:my_changedtick = b:changedtick +endif + +if exists("g:haskell_functions") + finish +endif +let g:haskell_functions = "ghc" + +" avoid hit-enter prompts +set cmdheight=3 + +" edit static GHC options +" TODO: add completion for options/packages? +command! GHCStaticOptions call GHC_StaticOptions() +function! GHC_StaticOptions() + let b:ghc_staticoptions = input('GHC static options: ',b:ghc_staticoptions) + execute 'setlocal makeprg=' . g:ghc . '\ ' . escape(b:ghc_staticoptions,' ') .'\ -e\ :q\ %' + let b:my_changedtick -=1 +endfunction + +map <LocalLeader>T :call GHC_ShowType(1)<cr> +map <LocalLeader>t :call GHC_ShowType(0)<cr> +function! GHC_ShowType(addTypeDecl) + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = ( symb ? '('.name.')' : name ) + call GHC_HaveTypes() + if !has_key(b:ghc_types,name) + redraw + echo pname "type not known" + else + redraw + for type in split(b:ghc_types[name],' -- ') + echo pname "::" type + if a:addTypeDecl + call append( line(".")-1, pname . " :: " . type ) + endif + endfor + endif +endfunction + +" show type of identifier under mouse pointer in balloon +if has("balloon_eval") + set ballooneval + set balloondelay=600 + set balloonexpr=GHC_TypeBalloon() + function! GHC_TypeBalloon() + if exists("b:current_compiler") && b:current_compiler=="ghc" + let [line] = getbufline(v:beval_bufnr,v:beval_lnum) + let namsym = haskellmode#GetNameSymbol(line,v:beval_col,0) + if namsym==[] + return '' + endif + let [start,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : qual.'.'.unqual + let pname = name " ( symb ? '('.name.')' : name ) + silent call GHC_HaveTypes() + if has("balloon_multiline") + return (has_key(b:ghc_types,pname) ? split(b:ghc_types[pname],' -- ') : '') + else + return (has_key(b:ghc_types,pname) ? b:ghc_types[pname] : '') + endif + else + return '' + endif + endfunction +endif + +map <LocalLeader>si :call GHC_ShowInfo()<cr> +function! GHC_ShowInfo() + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [_,symb,qual,unqual] = namsym + let name = qual=='' ? unqual : (qual.'.'.unqual) + let output = GHC_Info(name) + pclose | new + setlocal previewwindow + setlocal buftype=nofile + setlocal noswapfile + put =output + wincmd w + "redraw + "echo output +endfunction + +" fill the type map, unless nothing has changed since the last attempt +function! GHC_HaveTypes() + if b:ghc_types == {} && (b:my_changedtick != b:changedtick) + let b:my_changedtick = b:changedtick + return GHC_BrowseAll() + endif +endfunction + +" update b:ghc_types after successful make +au QuickFixCmdPost make if GHC_CountErrors()==0 | silent call GHC_BrowseAll() | endif + +" count only error entries in quickfix list, ignoring warnings +function! GHC_CountErrors() + let c=0 + for e in getqflist() | if e.type=='E' && e.text !~ "^[ \n]*Warning:" | let c+=1 | endif | endfor + return c +endfunction + +command! GHCReload call GHC_BrowseAll() +function! GHC_BrowseAll() + " let imports = haskellmode#GatherImports() + " let modules = keys(imports[0]) + keys(imports[1]) + let imports = {} " no need for them at the moment + let current = GHC_NameCurrent() + let module = current==[] ? 'Main' : current[0] + if GHC_VersionGE([6,8,1]) + return GHC_BrowseBangStar(module) + else + return GHC_BrowseMultiple(imports,['*'.module]) + endif +endfunction + +function! GHC_VersionGE(target) + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>target[0])) + return 1 + elseif (i==target[0]) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction + +function! GHC_NameCurrent() + let last = line("$") + let l = 1 + while l<last + let ml = matchlist( getline(l), '^module\s*\([^ (]*\)') + if ml != [] + let [_,module;x] = ml + return [module] + endif + let l += 1 + endwhile + redraw + echo "cannot find module header for file " . expand("%") + return [] +endfunction + +function! GHC_BrowseBangStar(module) + redraw + echo "browsing module " a:module + let command = ":browse! *" . a:module + let orig_shellredir = &shellredir + let &shellredir = ">" " ignore error/warning messages, only output or lack of it + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + let &shellredir = orig_shellredir + return GHC_ProcessBang(a:module,output) +endfunction + +function! GHC_BrowseMultiple(imports,modules) + redraw + echo "browsing modules " a:modules + let command = ":browse " . join( a:modules, " \n :browse ") + let command = substitute(command,'\(:browse \(\S*\)\)','putStrLn "-- \2" \n \1','g') + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%") , command ) + return GHC_Process(a:imports,output) +endfunction + +function! GHC_Info(what) + " call GHC_HaveTypes() + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -v0 --interactive ' . expand("%"), ":i ". a:what) + return output +endfunction + +function! GHC_ProcessBang(module,output) + let module = a:module + let b = a:output + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\)\(\S*\)\s*::\(.*\)' + let commentPat = '^-- \(\S*\)' + let definedPat = '^-- defined locally' + let importedPat = '^-- imported via \(.*\)' + if !(b=~commentPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute( id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse! *<current>, we get both unqualified and qualified ids + let qualified = (id =~ '\.') && (id =~ '[A-Z]') + let b:ghc_types[id] = type + if !qualified + for qual in qualifiers + let b:ghc_types[qual.'.'.id] = type + endfor + endif + else + let mlImported = matchlist( l, importedPat ) + let mlDefined = matchlist( l, definedPat ) + if mlImported != [] + let [_,modules;x] = mlImported + let qualifiers = split( modules, ', ' ) + elseif mlDefined != [] + let qualifiers = [module] + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +function! GHC_Process(imports,output) + let b = a:output + let imports = a:imports + let linePat = '^\(.\{-}\)\n\(.*\)' + let contPat = '\s\+\(.\{-}\)\n\(.*\)' + let typePat = '^\(\s*\)\(\S*\)\s*::\(.*\)' + let modPat = '^-- \(\S*\)' + " add '-- defined locally' and '-- imported via ..' + if !(b=~modPat) + echo s:scriptname.": GHCi reports errors (try :make?)" + return 0 + endif + let b:ghc_types = {} + let ml = matchlist( b , linePat ) + while ml != [] + let [_,l,rest;x] = ml + let mlDecl = matchlist( l, typePat ) + if mlDecl != [] + let [_,indent,id,type;x] = mlDecl + let ml2 = matchlist( rest , '^'.indent.contPat ) + while ml2 != [] + let [_,c,rest;x] = ml2 + let type .= c + let ml2 = matchlist( rest , '^'.indent.contPat ) + endwhile + let id = substitute(id, '^(\(.*\))$', '\1', '') + let type = substitute( type, '\s\+', " ", "g" ) + " using :browse *<current>, we get both unqualified and qualified ids + if current_module " || has_key(imports[0],module) + if has_key(b:ghc_types,id) && !(matchstr(b:ghc_types[id],escape(type,'[].'))==type) + let b:ghc_types[id] .= ' -- '.type + else + let b:ghc_types[id] = type + endif + endif + if 0 " has_key(imports[1],module) + let qualid = module.'.'.id + let b:ghc_types[qualid] = type + endif + else + let mlMod = matchlist( l, modPat ) + if mlMod != [] + let [_,module;x] = mlMod + let current_module = module[0]=='*' + let module = current_module ? module[1:] : module + endif + endif + let ml = matchlist( rest , linePat ) + endwhile + return 1 +endfunction + +let s:ghc_templates = ["module _ () where","class _ where","class _ => _ where","instance _ where","instance _ => _ where","type family _","type instance _ = ","data _ = ","newtype _ = ","type _ = "] + +" use ghci :browse index for insert mode omnicompletion (CTRL-X CTRL-O) +function! GHC_CompleteImports(findstart, base) + if a:findstart + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + call GHC_HaveTypes() + for key in keys(b:ghc_types) + if key[0 : l]==a:base + let res += [{"word":key,"menu":":: ".b:ghc_types[key],"dup":1}] + endif + endfor + return res + endif +endfunction +set omnifunc=GHC_CompleteImports +set completeopt=menu,menuone,longest + +map <LocalLeader>ct :call GHC_CreateTagfile()<cr> +function! GHC_CreateTagfile() + redraw + echo "creating tags file" + let output = system(g:ghc . ' ' . b:ghc_staticoptions . ' -e ":ctags" ' . expand("%")) + " for ghcs older than 6.6, you would need to call another program + " here, such as hasktags + echo output +endfunction + +command! -nargs=1 GHCi redraw | echo system(g:ghc. ' ' . b:ghc_staticoptions .' '.expand("%").' -e "'.escape(<f-args>,'"').'"') + +" use :make 'not in scope' errors to explicitly list imported ids +" cursor needs to be on import line, in correctly loadable module +map <LocalLeader>ie :call GHC_MkImportsExplicit()<cr> +function! GHC_MkImportsExplicit() + let save_cursor = getpos(".") + let line = getline('.') + let lineno = line('.') + let ml = matchlist(line,'^import\(\s*qualified\)\?\s*\([^( ]\+\)') + if ml!=[] + let [_,q,mod;x] = ml + silent make + if getqflist()==[] + if line=~"import[^(]*Prelude" + call setline(lineno,substitute(line,"(.*","","").'()') + else + call setline(lineno,'-- '.line) + endif + silent write + silent make + let qflist = getqflist() + call setline(lineno,line) + silent write + let ids = {} + for d in qflist + let ml = matchlist(d.text,'Not in scope: \([^`]*\)`\([^'']*\)''') + if ml!=[] + let [_,what,qid;x] = ml + let id = ( qid =~ "^[A-Z]" ? substitute(qid,'.*\.\([^.]*\)$','\1','') : qid ) + let pid = ( id =~ "[a-zA-Z0-9_']\\+" ? id : '('.id.')' ) + if what =~ "data" + call GHC_HaveTypes() + if has_key(b:ghc_types,id) + let pid = substitute(b:ghc_types[id],'^.*->\s*\(\S*\).*$','\1','').'('.pid.')' + else + let pid = '???('.pid.')' + endif + endif + let ids[pid] = 1 + endif + endfor + call setline(lineno,'import'.q.' '.mod.'('.join(keys(ids),',').')') + else + copen + endif + endif + call setpos('.', save_cursor) +endfunction + +if GHC_VersionGE([6,8,2]) + let opts = filter(split(substitute(system(g:ghc . ' -v0 --interactive', ':set'), ' ', '','g'), '\n'), 'v:val =~ "-f"') +else + let opts = ["-fglasgow-exts","-fallow-undecidable-instances","-fallow-overlapping-instances","-fno-monomorphism-restriction","-fno-mono-pat-binds","-fno-cse","-fbang-patterns","-funbox-strict-fields"] +endif + +amenu ]OPTIONS_GHC.- :echo '-'<cr> +aunmenu ]OPTIONS_GHC +for o in opts + exe 'amenu ]OPTIONS_GHC.'.o.' :call append(0,"{-# OPTIONS_GHC '.o.' #-}")<cr>' +endfor +if has("gui_running") + map <LocalLeader>opt :popup ]OPTIONS_GHC<cr> +else + map <LocalLeader>opt :emenu ]OPTIONS_GHC. +endif + +amenu ]LANGUAGES_GHC.- :echo '-'<cr> +aunmenu ]LANGUAGES_GHC +if GHC_VersionGE([6,8]) + let ghc_supported_languages = split(system(g:ghc . ' --supported-languages'),'\n') + for l in ghc_supported_languages + exe 'amenu ]LANGUAGES_GHC.'.l.' :call append(0,"{-# LANGUAGE '.l.' #-}")<cr>' + endfor + if has("gui_running") + map <LocalLeader>lang :popup ]LANGUAGES_GHC<cr> + else + map <LocalLeader>lang :emenu ]LANGUAGES_GHC. + endif +endif +ftplugin/haskell.vim [[[1 +13 +" +" general Haskell source settings +" (shared functions are in autoload/haskellmode.vim) +" +" (Claus Reinke, last modified: 21/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + +" try gf on import line, or ctrl-x ctrl-i, or [I, [i, .. +set include=^import\\s*\\(qualified\\)\\?\\s* +set includeexpr=substitute(v:fname,'\\.','/','g').'.hs' + +ftplugin/haskell_doc.vim [[[1 +817 +" +" use haddock docs and index files +" show documentation, complete & qualify identifiers +" +" (Claus Reinke; last modified: 24/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + +" :Doc <name> and :IDoc <name> open haddocks for <name> in opera +" +" :Doc needs qualified name (default Prelude) and package (default base) +" :IDoc needs unqualified name, looks up possible links in g:haddock_index +" +" :DocIndex populates g:haddock_index from haddock's index files +" :ExportDocIndex saves g:haddock_index to cache file +" :ImportDocIndex reloads g:haddock_index from cache file +" +" all the following use the haddock index (g:haddock_index) +" +" _? opens haddocks for unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _. fully qualifies unqualified name under cursor, +" suggesting alternative full qualifications in popup menu +" +" _i add import <module>(<name>) statement for unqualified <name> under cursor, +" _im add import <module> statement for unqualified <name> under cursor, +" suggesting alternative full qualifications in popup menu +" (this currently adds one statement per call, instead of +" merging into existing import statements, but it's a start;-) +" +" CTRL-X CTRL-U (user-defined insert mode completion) +" suggests completions of unqualified names in popup menu + +let s:scriptname = "haskell_doc.vim" + +" script parameters +" g:haddock_browser *mandatory* which browser to call +" g:haddock_browser_callformat [optional] how to call browser +" g:haddock_indexfiledir [optional] where to put 'haddock_index.vim' +" g:haddock_docdir [optional] where to find html docs +" g:ghc [optional] which ghc to call +" g:ghc_pkg [optional] which ghc_pkg to call + +" been here before? +if exists("g:haddock_index") + finish +endif + +" initialise nested dictionary, to be populated +" - from haddock index files via :DocIndex +" - from previous cached version via :ImportDocIndex +let g:haddock_index = {} + +" initialise dictionary, mapping modules with haddocks to their packages, +" populated via MkHaddockModuleIndex() or HaveModuleIndex() +let g:haddock_moduleindex = {} + +" program to open urls, please set this in your vimrc + "examples (for windows): + "let g:haddock_browser = "C:/Program Files/Opera/Opera.exe" + "let g:haddock_browser = "C:/Program Files/Mozilla Firefox/firefox.exe" + "let g:haddock_browser = "C:/Program Files/Internet Explorer/IEXPLORE.exe" +if !exists("g:haddock_browser") + echoerr s:scriptname." WARNING: please set g:haddock_browser!" +endif + +if (!exists("g:ghc") || !executable(g:ghc)) + if !executable('ghc') + echoerr s:scriptname." can't find ghc. please set g:ghc, or extend $PATH" + finish + else + let g:ghc = 'ghc' + endif +endif + +if (!exists("g:ghc_pkg") || !executable(g:ghc_pkg)) + let g:ghc_pkg = substitute(g:ghc,'\(.*\)ghc','\1ghc-pkg','') +endif + +if exists("g:haddock_docdir") && isdirectory(g:haddock_docdir) + let s:docdir = g:haddock_docdir +elseif executable(g:ghc_pkg) +" try to figure out location of html docs +" first choice: where the base docs are (from the first base listed) + let [field;x] = split(system(g:ghc_pkg . ' field base haddock-html'),'\n') + let field = substitute(field,'haddock-html: \(.*\)libraries.base','\1','') + let field = substitute(field,'\\','/','g') + let alternate = substitute(field,'html','doc/html','') + if isdirectory(field) + let s:docdir = field + elseif isdirectory(alternate) + let s:docdir = alternate + endif +else + echoerr s:scriptname." can't find ghc-pkg (set g:ghc_pkg ?)." +endif + +" second choice: try some known suspects for windows/unix +if !exists('s:docdir') || !isdirectory(s:docdir) + let s:ghc_libdir = substitute(system(g:ghc . ' --print-libdir'),'\n','','') + let location1a = s:ghc_libdir . '/doc/html/' + let location1b = s:ghc_libdir . '/doc/' + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let location2 = '/usr/share/doc/ghc-' . s:ghc_version . '/html/' + if isdirectory(location1a) + let s:docdir = location1a + elseif isdirectory(location1b) + let s:docdir = location1b + elseif isdirectory(location2) + let s:docdir = location2 + else " give up + echoerr s:scriptname." can't find locaton of html documentation (set g:haddock_docdir)." + finish + endif +endif + +" todo: can we turn s:docdir into a list of paths, and +" include docs for third-party libs as well? + +let s:libraries = s:docdir . 'libraries/' +let s:guide = s:docdir . 'users_guide/' +let s:index = 'index.html' +if exists("g:haddock_indexfiledir") && filewritable(g:haddock_indexfiledir) + let s:haddock_indexfiledir = g:haddock_indexfiledir +elseif filewritable(s:libraries) + let s:haddock_indexfiledir = s:libraries +elseif filewritable($HOME) + let s:haddock_indexfiledir = $HOME.'/' +else "give up + echoerr s:scriptname." can't locate index file. please set g:haddock_indexfiledir" + finish +endif +let s:haddock_indexfile = s:haddock_indexfiledir . 'haddock_index.vim' + +" different browser setups require different call formats; +" you might want to call the browser synchronously or +" asynchronously, and the latter is os-dependent; +" +" by default, the browser is started in the background when on +" windows or if running in a gui, and in the foreground otherwise +" (eg, console-mode for remote sessions, with text-mode browsers). +" +" you can override these defaults in your vimrc, via a format +" string including 2 %s parameters (the first being the browser +" to call, the second being the url). +if !exists("g:haddock_browser_callformat") + if has("win32") || has("win64") + let g:haddock_browser_callformat = 'start %s "%s"' + else + if has("gui_running") + let g:haddock_browser_callformat = '%s %s '.printf(&shellredir,'/dev/null').' &' + else + let g:haddock_browser_callformat = '%s %s' + endif + endif +endif + +" allow map leader override +if !exists("maplocalleader") + let maplocalleader='_' +endif + +command! DocSettings call DocSettings() +function! DocSettings() + for v in ["g:haddock_browser","g:haddock_browser_callformat","g:haddock_docdir","g:haddock_indexfiledir","s:ghc_libdir","s:ghc_version","s:docdir","s:libraries","s:guide","s:haddock_indexfile"] + if exists(v) + echo v '=' eval(v) + else + echo v '=' + endif + endfor +endfunction + +function! DocBrowser(url) + "echomsg "DocBrowser(".url.")" + if (!exists("g:haddock_browser") || !executable(g:haddock_browser)) + echoerr s:scriptname." can't find documentation browser. please set g:haddock_browser" + return + endif + " start browser to open url, according to specified format + let url = a:url=~'^\(file://\|http://\)' ? a:url : 'file://'.a:url + silent exe '!'.printf(g:haddock_browser_callformat,g:haddock_browser,escape(url,'#%')) +endfunction + +"usage examples: +" :Doc length +" :Doc Control.Monad.when +" :Doc Data.List. +" :Doc Control.Monad.State.runState mtl +" :Doc -top +" :Doc -libs +" :Doc -guide +command! -nargs=+ Doc call Doc('v',<f-args>) +command! -nargs=+ Doct call Doc('t',<f-args>) + +function! Doc(kind,qualname,...) + let suffix = '.html' + let relative = '#'.a:kind.'%3A' + + if a:qualname=="-top" + call DocBrowser(s:docdir . s:index) + return + elseif a:qualname=="-libs" + call DocBrowser(s:libraries . s:index) + return + elseif a:qualname=="-guide" + call DocBrowser(s:guide . s:index) + return + endif + + if a:0==0 " no package specified + let package = 'base/' + else + let package = a:1 . '/' + endif + + if match(a:qualname,'\.')==-1 " unqualified name + let [qual,name] = [['Prelude'],a:qualname] + let file = join(qual,'-') . suffix . relative . name + elseif a:qualname[-1:]=='.' " module qualifier only + let parts = split(a:qualname,'\.') + let quallen = len(parts)-1 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix + else " qualified name + let parts = split(a:qualname,'\.') + let quallen = len(parts)-2 + let [qual,name] = [parts[0:quallen],parts[-1]] + let file = join(qual,'-') . suffix . relative . name + endif + +" let path = s:libraries . package . file + let path = file + call DocBrowser(path) +endfunction + +" TODO: add commandline completion for :IDoc +" indexed variant of Doc, looking up links in g:haddock_index +" usage: +" 1. :IDoc length +" 2. click on one of the choices, or select by number (starting from 0) +command! -nargs=+ IDoc call IDoc(<f-args>) +function! IDoc(name,...) + let choices = HaddockIndexLookup(a:name) + if choices=={} | return | endif + if a:0==0 + let keylist = map(deepcopy(keys(choices)),'substitute(v:val,"\\[.\\]","","")') + let choice = inputlist(keylist) + else + let choice = a:1 + endif + let path = values(choices)[choice] " assumes same order for keys/values.. + call DocBrowser(path) +endfunction + +let s:flagref = s:guide . 'flag-reference.html' +if filereadable(s:flagref) + " extract the generated fragment ids for the + " flag reference sections + let s:headerPat = '.\{-}<h3 class="title"><a name="\([^"]*\)"><\/a>\([^<]*\)<\/h3>\(.*\)' + let s:flagheaders = [] + let s:flagheaderids = {} + let s:contents = join(readfile(s:flagref)) + let s:ml = matchlist(s:contents,s:headerPat) + while s:ml!=[] + let [_,s:id,s:title,s:r;s:x] = s:ml + let s:flagheaders = add(s:flagheaders, s:title) + let s:flagheaderids[s:title] = s:id + let s:ml = matchlist(s:r,s:headerPat) + endwhile + command! -nargs=1 -complete=customlist,CompleteFlagHeaders FlagReference call FlagReference(<f-args>) + function! FlagReference(section) + let relativeUrl = a:section==""||!exists("s:flagheaderids['".a:section."']") ? + \ "" : "#".s:flagheaderids[a:section] + call DocBrowser(s:flagref.relativeUrl) + endfunction + function! CompleteFlagHeaders(al,cl,cp) + let s:choices = s:flagheaders + return CompleteAux(a:al,a:cl,a:cp) + endfunction +endif + +command! -nargs=1 -complete=customlist,CompleteHaddockModules MDoc call MDoc(<f-args>) +function! MDoc(module) + let suffix = '.html' + call HaveModuleIndex() + if !has_key(g:haddock_moduleindex,a:module) + echoerr a:module 'not found in haddock module index' + return + endif + let package = g:haddock_moduleindex[a:module]['package'] + let file = substitute(a:module,'\.','-','g') . suffix +" let path = s:libraries . package . '/' . file + let path = g:haddock_moduleindex[a:module]['html'] + call DocBrowser(path) +endfunction + +function! CompleteHaddockModules(al,cl,cp) + call HaveModuleIndex() + let s:choices = keys(g:haddock_moduleindex) + return CompleteAux(a:al,a:cl,a:cp) +endfunction + +" create a dictionary g:haddock_index, containing the haddoc index +command! DocIndex call DocIndex() +function! DocIndex() + let files = split(globpath(s:libraries,'doc-index*.html'),'\n') + let g:haddock_index = {} + call ProcessHaddockIndexes2(s:libraries,files) + if GHC_VersionGE([6,8,2]) + if &shell =~ 'sh' " unix-type shell + let s:addon_libraries = split(system(g:ghc_pkg . ' field \* haddock-html'),'\n') + else " windows cmd.exe and the like + let s:addon_libraries = split(system(g:ghc_pkg . ' field * haddock-html'),'\n') + endif + for addon in s:addon_libraries + let ml = matchlist(addon,'haddock-html: \("\)\?\(file:///\)\?\([^"]*\)\("\)\?') + if ml!=[] + let [_,quote,file,addon_path;x] = ml + let addon_path = substitute(addon_path,'\(\\\\\|\\\)','/','g') + let addon_files = split(globpath(addon_path,'doc-index*.html'),'\n') + call ProcessHaddockIndexes2(addon_path,addon_files) + endif + endfor + endif + return 1 +endfunction + +function! ProcessHaddockIndexes(location,files) + let entryPat= '.\{-}"indexentry"[^>]*>\([^<]*\)<\(\%([^=]\{-}TD CLASS="\%(indexentry\)\@!.\{-}</TD\)*\)[^=]\{-}\(\%(="indexentry\|TABLE\).*\)' + let linkPat = '.\{-}HREF="\([^"]*\)".>\([^<]*\)<\(.*\)' + + redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let contents = join(readfile(f)) + let ml = matchlist(contents,entryPat) + while ml!=[] + let [_,entry,links,r;x] = ml + "echo entry links + let ml2 = matchlist(links,linkPat) + let link = {} + while ml2!=[] + let [_,l,m,links;x] = ml2 + "echo l m + let link[m] = a:location . '/' . l + let ml2 = matchlist(links,linkPat) + endwhile + let g:haddock_index[DeHTML(entry)] = deepcopy(link) + "echo entry g:haddock_index[entry] + let ml = matchlist(r,entryPat) + endwhile + endfor +endfunction + +" concatenating all lines is too slow for a big file, process lines directly +function! ProcessHaddockIndexes2(location,files) + let entryPat= '^>\([^<]*\)</' + let linkPat = '.\{-}A HREF="\([^"]*\)"' + let kindPat = '#\(.\)' + + " redraw + echo 'populating g:haddock_index from haddock index files in ' a:location + for f in a:files + echo f[len(a:location):] + let isEntry = 0 + let isLink = '' + let link = {} + let entry = '' + for line in readfile(f) + if line=~'CLASS="indexentry' + if (link!={}) && (entry!='') + if has_key(g:haddock_index,DeHTML(entry)) + let dict = extend(g:haddock_index[DeHTML(entry)],deepcopy(link)) + else + let dict = deepcopy(link) + endif + let g:haddock_index[DeHTML(entry)] = dict + let link = {} + let entry = '' + endif + let isEntry=1 + continue + endif + if isEntry==1 + let ml = matchlist(line,entryPat) + if ml!=[] | let [_,entry;x] = ml | let isEntry=0 | continue | endif + endif + if entry!='' + let ml = matchlist(line,linkPat) + if ml!=[] | let [_,isLink;x]=ml | continue | endif + endif + if isLink!='' + let ml = matchlist(line,entryPat) + if ml!=[] + let [_,module;x] = ml + let [_,kind;x] = matchlist(isLink,kindPat) + let last = a:location[strlen(a:location)-1] + let link[module."[".kind."]"] = a:location . (last=='/'?'':'/') . isLink + let isLink='' + continue + endif + endif + endfor + if link!={} + if has_key(g:haddock_index,DeHTML(entry)) + let dict = extend(g:haddock_index[DeHTML(entry)],deepcopy(link)) + else + let dict = deepcopy(link) + endif + let g:haddock_index[DeHTML(entry)] = dict + endif + endfor +endfunction + +command! ExportDocIndex call ExportDocIndex() +function! ExportDocIndex() + call HaveIndex() + let entries = [] + for key in keys(g:haddock_index) + let entries += [key,string(g:haddock_index[key])] + endfor + call writefile(entries,s:haddock_indexfile) + redir end +endfunction + +command! ImportDocIndex call ImportDocIndex() +function! ImportDocIndex() + if filereadable(s:haddock_indexfile) + let lines = readfile(s:haddock_indexfile) + let i=0 + while i<len(lines) + let [key,dict] = [lines[i],lines[i+1]] + sandbox let g:haddock_index[key] = eval(dict) + let i+=2 + endwhile + return 1 + else + return 0 + endif +endfunction + +function! HaveIndex() + return (g:haddock_index!={} || ImportDocIndex() || DocIndex() ) +endfunction + +function! MkHaddockModuleIndex() + let g:haddock_moduleindex = {} + call HaveIndex() + for key in keys(g:haddock_index) + let dict = g:haddock_index[key] + for module in keys(dict) + let html = dict[module] + let html = substitute(html ,'#.*$','','') + let module = substitute(module,'\[.\]','','') + let ml = matchlist(html,'libraries/\([^\/]*\)\/') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + let ml = matchlist(html,'/\([^\/]*\)\/html/[A-Z]') + if ml!=[] + let [_,package;x] = ml + let g:haddock_moduleindex[module] = {'package':package,'html':html} + endif + endfor + endfor +endfunction + +function! HaveModuleIndex() + return (g:haddock_moduleindex!={} || MkHaddockModuleIndex() ) +endfunction + +" decode HTML symbol encodings (are these all we need?) +function! DeHTML(entry) + let res = a:entry + let decode = { '<': '<', '>': '>', '&': '\\&' } + for enc in keys(decode) + exe 'let res = substitute(res,"'.enc.'","'.decode[enc].'","g")' + endfor + return res +endfunction + +" find haddocks for word under cursor +" also lists possible definition sites +" - needs to work for both qualified and unqualified items +" - for 'import qualified M as A', consider M.item as source of A.item +" - offer sources from both type [t] and value [v] namespaces +" - for unqualified items, list all possible sites +" - for qualified items, list imported sites only +" keep track of keys with and without namespace tags: +" the former are needed for lookup, the latter for matching against source +map <LocalLeader>? :call Haddock()<cr> +function! Haddock() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let imports = haskellmode#GatherImports() + let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let name = unqual + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + " for qualified items, narrow results to possible imports that provide qualifier + let filteredKeys = filter(copy(keys(dict)) + \ ,'match(asm,substitute(v:val,''\[.\]'','''',''''))!=-1') + let keys = (qual!='') ? filteredKeys : keys(dict) + if (keys==[]) && (qual!='') + echoerr qual.'.'.unqual.' not found in imports' + return 0 + endif + if len(keys)==1 && exists("g:haskell_avoid_singleton_menus") + call DocBrowser(dict[keys[0]]) + elseif has("gui_running") + for key in keys + exe 'amenu ]Popup.'.escape(key,'\.').' :call DocBrowser('''.dict[key].''')<cr>' + endfor + popup ]Popup + else + let s:choices = keys + let key = input('browse docs for '.name.' in: ','','customlist,CompleteAux') + if key!='' + call DocBrowser(dict[key]) + endif + endif +endfunction + +if !exists("g:haskell_search_engines") + let g:haskell_search_engines = + \ {'hoogle':'http://www.haskell.org/hoogle/?hoogle=%s' + \ ,'hayoo!':'http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=%s' + \ } +endif + +map <LocalLeader>?? :let es=g:haskell_search_engines + \ \|echo "g:haskell_search_engines" + \ \|for e in keys(es) + \ \|echo e.' : '.es[e] + \ \|endfor<cr> +map <LocalLeader>?1 :call HaskellSearchEngine('hoogle')<cr> +map <LocalLeader>?2 :call HaskellSearchEngine('hayoo!')<cr> + +" query one of the Haskell search engines for the thing under cursor +" - unqualified symbols need to be url-escaped +" - qualified ids need to be fed as separate qualifier and id for +" both hoogle (doesn't handle qualified symbols) and hayoo! (no qualified +" ids at all) +" - qualified ids referring to import-qualified-as qualifiers need to be +" translated to the multi-module searches over the list of original modules +function! HaskellSearchEngine(engine) + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let imports = haskellmode#GatherImports() + let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let unqual = haskellmode#UrlEncode(unqual) + if a:engine=='hoogle' + let name = asm!=[] ? unqual.'+'.join(map(copy(asm),'"%2B".v:val'),'+') + \ : qual!='' ? unqual.'+'.haskellmode#UrlEncode('+').qual + \ : unqual + elseif a:engine=='hayoo!' + let name = asm!=[] ? unqual.'+module:('.join(copy(asm),' OR ').')' + \ : qual!='' ? unqual.'+module:'.qual + \ : unqual + else + let name = qual=="" ? unqual : qual.".".unqual + endif + if has_key(g:haskell_search_engines,a:engine) + call DocBrowser(printf(g:haskell_search_engines[a:engine],name)) + else + echoerr "unknown search engine: ".a:engine + endif +endfunction + +" used to pass on choices to CompleteAux +let s:choices=[] + +" if there's no gui, use commandline completion instead of :popup +" completion function CompleteAux suggests completions for a:al, wrt to s:choices +function! CompleteAux(al,cl,cp) + "echomsg '|'.a:al.'|'.a:cl.'|'.a:cp.'|' + let res = [] + let l = len(a:al)-1 + for r in s:choices + if l==-1 || r[0 : l]==a:al + let res += [r] + endif + endfor + return res +endfunction + +" CamelCase shorthand matching: +" favour upper-case letters and module qualifier separators (.) for disambiguation +function! CamelCase(shorthand,string) + let s1 = a:shorthand + let s2 = a:string + let notFirst = 0 " don't elide before first pattern letter + while ((s1!="")&&(s2!="")) + let head1 = s1[0] + let head2 = s2[0] + let elide = notFirst && ( ((head1=~'[A-Z]') && (head2!~'[A-Z.]')) + \ ||((head1=='.') && (head2!='.')) ) + if elide + let s2=s2[1:] + elseif (head1==head2) + let s1=s1[1:] + let s2=s2[1:] + else + return 0 + endif + let notFirst = (head1!='.')||(head2!='.') " treat separators as new beginnings + endwhile + return (s1=="") +endfunction + +" use haddock name index for insert mode completion (CTRL-X CTRL-U) +function! CompleteHaddock(findstart, base) + if a:findstart + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),-1) " insert-mode: we're 1 beyond the text + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return -1 + endif + let [start,symb,qual,unqual] = namsym + return (start-1) + else " find keys matching with "a:base" + let res = [] + let l = len(a:base)-1 + let qual = a:base =~ '^[A-Z][a-zA-Z0-9_'']*\(\.[A-Z][a-zA-Z0-9_'']*\)*\(\.[a-zA-Z0-9_'']*\)\?$' + call HaveIndex() + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if (key[0 : l]==a:base) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if word[0 : l]==a:base + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + if res==[] " no prefix matches, try CamelCase shortcuts + for key in keys(g:haddock_index) + let keylist = map(deepcopy(keys(g:haddock_index[key])),'substitute(v:val,"\\[.\\]","","")') + if CamelCase(a:base,key) + for m in keylist + let res += [{"word":key,"menu":m,"dup":1}] + endfor + elseif qual " this tends to be slower + for m in keylist + let word = m . '.' . key + if CamelCase(a:base,word) + let res += [{"word":word,"menu":m,"dup":1}] + endif + endfor + endif + endfor + endif + return res + endif +endfunction +set completefunc=CompleteHaddock +set completeopt=menu,menuone,longest + +" fully qualify an unqualified name +" TODO: - standardise commandline versions of menus +map <LocalLeader>. :call Qualify()<cr> +function! Qualify() + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + if qual!='' " TODO: should we support re-qualification? + redraw + echo 'already qualified' + return 0 + endif + let name = unqual + let line = line('.') + let prefix = (start<=1 ? '' : getline(line)[0:start-2] ) + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + let imports = haskellmode#GatherImports() + let qualifiedImports = [] + for qualifiedImport in keys(imports[1]) + let c=0 + for module in imports[1][qualifiedImport]['modules'] + if haskellmode#ListElem(keylist,module) | let c+=1 | endif + endfor + if c>0 | let qualifiedImports=[qualifiedImport]+qualifiedImports | endif + endfor + "let asm = has_key(imports[1],qual) ? imports[1][qual]['modules'] : [] + let keylist = filter(copy(keylist),'index(qualifiedImports,v:val)==-1') + if has("gui_running") + " amenu ]Popup.-imported- : + for key in qualifiedImports + let lhs=escape(prefix.name,'/.|\') + let rhs=escape(prefix.key.'.'.name,'/&|\') + exe 'amenu ]Popup.'.escape(key,'\.').' :'.line.'s/'.lhs.'/'.rhs.'/<cr>:noh<cr>' + endfor + amenu ]Popup.-not\ imported- : + for key in keylist + let lhs=escape(prefix.name,'/.|\') + let rhs=escape(prefix.key.'.'.name,'/&|\') + exe 'amenu ]Popup.'.escape(key,'\.').' :'.line.'s/'.lhs.'/'.rhs.'/<cr>:noh<cr>' + endfor + popup ]Popup + else + let s:choices = qualifiedImports+keylist + let key = input('qualify '.name.' with: ','','customlist,CompleteAux') + if key!='' + let lhs=escape(prefix.name,'/.\') + let rhs=escape(prefix.key.'.'.name,'/&\') + exe line.'s/'.lhs.'/'.rhs.'/' + noh + endif + endif +endfunction + +" create (qualified) import for a (qualified) name +" TODO: refine search patterns, to avoid misinterpretation of +" oddities like import'Neither or not'module +map <LocalLeader>i :call Import(0,0)<cr> +map <LocalLeader>im :call Import(1,0)<cr> +map <LocalLeader>iq :call Import(0,1)<cr> +map <LocalLeader>iqm :call Import(1,1)<cr> +function! Import(module,qualified) + amenu ]Popup.- :echo '-'<cr> + aunmenu ]Popup + let namsym = haskellmode#GetNameSymbol(getline('.'),col('.'),0) + if namsym==[] + redraw + echo 'no name/symbol under cursor!' + return 0 + endif + let [start,symb,qual,unqual] = namsym + let name = unqual + let pname = ( symb ? '('.name.')' : name ) + let importlist = a:module ? '' : '('.pname.')' + let qualified = a:qualified ? 'qualified ' : '' + + if qual!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.qual.importlist.''')' + return + endif + + let line = line('.') + let prefix = getline(line)[0:start-1] + let dict = HaddockIndexLookup(name) + if dict=={} | return | endif + let keylist = map(deepcopy(keys(dict)),'substitute(v:val,"\\[.\\]","","")') + if has("gui_running") + for key in keylist + " exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search("\\%1c\\(import\\\\|module\\\\|{-# OPTIONS\\)","nb"),"import '.key.importlist.'")<cr>' + exe 'amenu ]Popup.'.escape(key,'\.').' :call append(search(''\%1c\(\<import\>\\|\<module\>\\|{-# OPTIONS\\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.escape(importlist,'|').''')<cr>' + endfor + popup ]Popup + else + let s:choices = keylist + let key = input('import '.name.' from: ','','customlist,CompleteAux') + if key!='' + exe 'call append(search(''\%1c\(\<import\>\|\<module\>\|{-# OPTIONS\|{-# LANGUAGE\)'',''nb''),''import '.qualified.key.importlist.''')' + endif + endif +endfunction + +function! HaddockIndexLookup(name) + call HaveIndex() + if !has_key(g:haddock_index,a:name) + echoerr a:name 'not found in haddock index' + return {} + endif + return g:haddock_index[a:name] +endfunction + +" copied from ghc.vim :-( should we move everything to using autoload instead? +" we query the ghc version here, as we don't otherwise need it.. +function! GHC_VersionGE(target) + let s:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','') + let current = split(g:ghc_version, '\.' ) + let target = a:target + for i in current + if ((target==[]) || (i>target[0])) + return 1 + elseif (i==target[0]) + let target = target[1:] + else + return 0 + endif + endfor + return 1 +endfunction +ftplugin/haskell_hpaste.vim [[[1 +79 +" rudimentary hpaste support for vim +" (using netrw for reading, wget for posting/annotating) +" +" claus reinke, last modified: 07/04/2009 +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim + +" unless wget is in your PATH, you need to set g:wget +" before loading this script. windows users are out of +" luck, unless they have wget installed (such as the +" cygwin one looked for here), or adapt this script to +" whatever alternative they have at hand (perhaps using +" vim's perl/python bindings?) +if !exists("g:wget") + if executable("wget") + let g:wget = "!wget -q" + else + let g:wget = "!c:\\cygwin\\bin\\wget -q" + endif +endif + +" read (recent) hpaste files +" show index in new buffer, where ,r will open current entry +" and ,p will annotate current entry with current buffer +command! HpasteIndex call HpasteIndex() +function! HpasteIndex() + new + read http://hpaste.org + %s/\_$\_.//g + %s/<tr[^>]*>//g + %s/<\/tr>/
/g + g/<\/table>/d + g/DOCTYPE/d + %s/<td>\([^<]*\)<\/td><td><a href="\/fastcgi\/hpaste\.fcgi\/view?id=\([0-9]*\)">\([^<]*\)<\/a><\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td>/\2 [\1] "\3" \4 \5 \6/ + map <buffer> ,r 0yE:noh<cr>:call HpasteEditEntry('"')<cr> +endfunction + +" load an existing entry for editing +command! -nargs=1 HpasteEditEntry call HpasteEditEntry(<f-args>) +function! HpasteEditEntry(entry) + new + exe 'Nread http://hpaste.org/fastcgi/hpaste.fcgi/raw?id='.a:entry + "exe 'map <buffer> ,p :call HpasteAnnotate('''.a:entry.''')<cr>' +endfunction + +" " posting temporarily disabled -- needs someone to look into new +" " hpaste.org structure + +" " annotate existing entry (only to be called via ,p in HpasteIndex) +" function! HpasteAnnotate(entry) +" let nick = input("nick? ") +" let title = input("title? ") +" if nick=='' || title=='' +" echo "nick or title missing. aborting annotation" +" return +" endif +" call HpastePost('annotate/'.a:entry,nick,title) +" endfunction +" +" " post new hpaste entry +" " using 'wget --post-data' and url-encoded content +" command! HpastePostNew call HpastePost('new',<args>) +" function! HpastePost(mode,nick,title,...) +" let lines = getbufline("%",1,"$") +" let pat = '\([^[:alnum:]]\)' +" let code = '\=printf("%%%02X",char2nr(submatch(1)))' +" let lines = map(lines,'substitute(v:val."\r\n",'''.pat.''','''.code.''',''g'')') +" +" let url = 'http://hpaste.org/' . a:mode +" let nick = substitute(a:nick,pat,code,'g') +" let title = substitute(a:title,pat,code,'g') +" if a:0==0 +" let announce = 'false' +" else +" let announce = a:1 +" endif +" let cmd = g:wget.' --post-data="content='.join(lines,'').'&nick='.nick.'&title='.title.'&announce='.announce.'" '.url +" exe escape(cmd,'%') +" endfunction +autoload/haskellmode.vim [[[1 +155 +" +" utility functions for haskellmode plugins +" +" (Claus Reinke; last modified: 23/04/2009) +" +" part of haskell plugins: http://projects.haskell.org/haskellmode-vim +" please send patches to <claus.reinke@talk21.com> + + + +" find start/extent of name/symbol under cursor; +" return start, symbolic flag, qualifier, unqualified id +" (this is used in both haskell_doc.vim and in GHC.vim) +function! haskellmode#GetNameSymbol(line,col,off) + let name = "[a-zA-Z0-9_']" + let symbol = "[-!#$%&\*\+/<=>\?@\\^|~:.]" + "let [line] = getbufline(a:buf,a:lnum) + let line = a:line + + " find the beginning of unqualified id or qualified id component + let start = (a:col - 1) + a:off + if line[start] =~ name + let pattern = name + elseif line[start] =~ symbol + let pattern = symbol + else + return [] + endif + while start > 0 && line[start - 1] =~ pattern + let start -= 1 + endwhile + let id = matchstr(line[start :],pattern.'*') + " call confirm(id) + + " expand id to left and right, to get full id + let idPos = id[0] == '.' ? start+2 : start+1 + let posA = match(line,'\<\(\([A-Z]'.name.'*\.\)\+\)\%'.idPos.'c') + let start = posA>-1 ? posA+1 : idPos + let posB = matchend(line,'\%'.idPos.'c\(\([A-Z]'.name.'*\.\)*\)\('.name.'\+\|'.symbol.'\+\)') + let end = posB>-1 ? posB : idPos + + " special case: symbolic ids starting with . + if id[0]=='.' && posA==-1 + let start = idPos-1 + let end = posB==-1 ? start : end + endif + + " classify full id and split into qualifier and unqualified id + let fullid = line[ (start>1 ? start-1 : 0) : (end-1) ] + let symbolic = fullid[-1:-1] =~ symbol " might also be incomplete qualified id ending in . + let qualPos = matchend(fullid, '\([A-Z]'.name.'*\.\)\+') + let qualifier = qualPos>-1 ? fullid[ 0 : (qualPos-2) ] : '' + let unqualId = qualPos>-1 ? fullid[ qualPos : -1 ] : fullid + " call confirm(start.'/'.end.'['.symbolic.']:'.qualifier.' '.unqualId) + + return [start,symbolic,qualifier,unqualId] +endfunction + +function! haskellmode#GatherImports() + let imports={0:{},1:{}} + let i=1 + while i<=line('$') + let res = haskellmode#GatherImport(i) + if !empty(res) + let [i,import] = res + let prefixPat = '^import\s*\(qualified\)\?\s\+' + let modulePat = '\([A-Z][a-zA-Z0-9_''.]*\)' + let asPat = '\(\s\+as\s\+'.modulePat.'\)\?' + let hidingPat = '\(\s\+hiding\s*\((.*)\)\)\?' + let listPat = '\(\s*\((.*)\)\)\?' + let importPat = prefixPat.modulePat.asPat.hidingPat.listPat ".'\s*$' + + let ml = matchlist(import,importPat) + if ml!=[] + let [_,qualified,module,_,as,_,hiding,_,explicit;x] = ml + let what = as=='' ? module : as + let hidings = split(hiding[1:-2],',') + let explicits = split(explicit[1:-2],',') + let empty = {'lines':[],'hiding':hidings,'explicit':[],'modules':[]} + let entry = has_key(imports[1],what) ? imports[1][what] : deepcopy(empty) + let imports[1][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module) + if !(qualified=='qualified') + let imports[0][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module) + endif + else + echoerr "haskellmode#GatherImports doesn't understand: ".import + endif + endif + let i+=1 + endwhile + if !has_key(imports[1],'Prelude') + let imports[0]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + let imports[1]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]} + endif + return imports +endfunction + +function! haskellmode#ListElem(list,elem) + for e in a:list | if e==a:elem | return 1 | endif | endfor + return 0 +endfunction + +function! haskellmode#ListIntersect(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)!=-1 | let l += [e] | endif | endfor + return l +endfunction + +function! haskellmode#ListUnion(list1,list2) + let l = [] + for e in a:list2 | if index(a:list1,e)==-1 | let l += [e] | endif | endfor + return a:list1 + l +endfunction + +function! haskellmode#ListWithout(list1,list2) + let l = [] + for e in a:list1 | if index(a:list2,e)==-1 | let l += [e] | endif | endfor + return l +endfunction + +function! haskellmode#MergeImport(entry,line,hiding,explicit,module) + let lines = a:entry['lines'] + [ a:line ] + let hiding = a:explicit==[] ? haskellmode#ListIntersect(a:entry['hiding'], a:hiding) + \ : haskellmode#ListWithout(a:entry['hiding'],a:explicit) + let explicit = haskellmode#ListUnion(a:entry['explicit'], a:explicit) + let modules = haskellmode#ListUnion(a:entry['modules'], [ a:module ]) + return {'lines':lines,'hiding':hiding,'explicit':explicit,'modules':modules} +endfunction + +" collect lines belonging to a single import statement; +" return number of last line and collected import statement +" (assume opening parenthesis, if any, is on the first line) +function! haskellmode#GatherImport(lineno) + let lineno = a:lineno + let import = getline(lineno) + if !(import=~'^import\s') | return [] | endif + let open = strlen(substitute(import,'[^(]','','g')) + let close = strlen(substitute(import,'[^)]','','g')) + while open!=close + let lineno += 1 + let linecont = getline(lineno) + let open += strlen(substitute(linecont,'[^(]','','g')) + let close += strlen(substitute(linecont,'[^)]','','g')) + let import .= linecont + endwhile + return [lineno,import] +endfunction + +function! haskellmode#UrlEncode(string) + let pat = '\([^[:alnum:]]\)' + let code = '\=printf("%%%02X",char2nr(submatch(1)))' + let url = substitute(a:string,pat,code,'g') + return url +endfunction + +doc/haskellmode.txt [[[1 +456 +*haskellmode.txt* Haskell Mode Plugins 23/04/2009 + +Authors: + Claus Reinke <claus.reinke@talk21.com> ~ + +Homepage: + http://projects.haskell.org/haskellmode-vim + +CONTENTS *haskellmode* + + 1. Overview |haskellmode-overview| + 1.1 Runtime Requirements |haskellmode-requirements| + 1.2 Quick Reference |haskellmode-quickref| + 2. Settings |haskellmode-settings| + 2.1 GHC and web browser |haskellmode-settings-main| + 2.2 Fine tuning - more configuration options |haskellmode-settings-fine| + 3. GHC Compiler Integration |haskellmode-compiler| + 4. Haddock Integration |haskellmode-haddock| + 4.1 Indexing |haskellmode-indexing| + 4.2 Lookup |haskellmode-lookup| + 4.3 Editing |haskellmode-editing| + 5. Hpaste Integration |haskellmode-hpaste| + 6. Additional Resources |haskellmode-resources| + +============================================================================== + *haskellmode-overview* +1. Overview ~ + + The Haskell mode plugins provide advanced support for Haskell development + using GHC/GHCi on Windows and Unix-like systems. The functionality is + based on Haddock-generated library indices, on GHCi's interactive + commands, or on simply activating (some of) Vim's built-in program editing + support in Haskell-relevant fashion. These plugins live side-by-side with + the pre-defined |syntax-highlighting| support for |haskell| sources, and + any other Haskell-related plugins you might want to install (see + |haskellmode-resources|). + + The Haskell mode plugins consist of three filetype plugins (haskell.vim, + haskell_doc.vim, haskell_hpaste.vim), which by Vim's |filetype| detection + mechanism will be auto-loaded whenever files with the extension '.hs' are + opened, and one compiler plugin (ghc.vim) which you will need to load from + your vimrc file (see |haskellmode-settings|). + + + *haskellmode-requirements* +1.1 Runtime Requirements ~ + + The plugins require a recent installation of GHC/GHCi. The functionality + derived from Haddock-generated library indices also requires a local + installation of the Haddock documentation for GHC's libraries (if there is + no documentation package for your system, you can download a tar-ball from + haskell.org), as well as an HTML browser (see |haddock_browser|). If you + want to use the experimental hpaste interface, you will also need Wget. + + * GHC/GHCi ~ + Provides core functionality. http://www.haskell.org/ghc + + * HTML library documentation files and indices generated by Haddock ~ + These usually come with your GHC installation, possibly as a separate + package. If you cannot get them this way, you can download a tar-ball + matching your GHC version from http://www.haskell.org/ghc/docs/ + + * HTML browser with basic CSS support ~ + For browsing Haddock docs. + + * Wget ~ + For interfacing with http://hpaste.org. + + Wget is widely available for modern Unix-like operating systems. Several + ports also exist for Windows, including: + + - Official GNU Wget (natively compiled for Win32) + http://www.gnu.org/software/wget/#downloading + + - UnxUtils Wget (natively compiled for Win32, bundled with other ported + Unix utilities) + http://sourceforge.net/projects/unxutils/ + + - Cygwin Wget (emulated POSIX in Win32, must be run under Cygwin) + http://cygwin.com/packages/wget/ + + *haskellmode-quickref* +1.2 Quick Reference ~ + +|:make| load into GHCi, show errors (|quickfix| |:copen|) +|_ct| create |tags| file +|_si| show info for id under cursor +|_t| show type for id under cursor +|_T| insert type declaration for id under cursor +|balloon| show type for id under mouse pointer +|_?| browse Haddock entry for id under cursor +|_?1| search Hoogle for id under cursor +|_?2| search Hayoo! for id under cursor +|:IDoc| {identifier} browse Haddock entry for unqualified {identifier} +|:MDoc| {module} browse Haddock entry for {module} +|:FlagReference| {s} browse Users Guide Flag Reference for section {s} +|_.| qualify unqualified id under cursor +|_i| add 'import <module>(<identifier>)' for id under cursor +|_im| add 'import <module>' for id under cursor +|_iq| add 'import qualified <module>(<identifier>)' for id under cursor +|_iqm| add 'import qualified <module>' for id under cursor +|_ie| make imports explit for import statement under cursor +|_opt| add OPTIONS_GHC pragma +|_lang| add LANGUAGE pragma +|i_CTRL-X_CTRL-O| insert-mode completion based on imported ids (|haskellmode-XO|) +|i_CTRL-X_CTRL-U| insert-mode completion based on documented ids (|haskellmode-XU|) +|i_CTRL-N| insert-mode completion based on imported sources +|:GHCi|{command/expr} run GHCi command/expr in current module + +|:GHCStaticOptions| edit static GHC options for this buffer +|:DocSettings| show current Haddock-files-related plugin settings +|:DocIndex| populate Haddock index +|:ExportDocIndex| cache current Haddock index to a file +|:HpasteIndex| Read index of most recent entries from hpaste.org +|:HpastePostNew| Submit current buffer as a new hpaste + + +============================================================================== + *haskellmode-settings* +2. Settings ~ + + The plugins try to find their dependencies in standard locations, so if + you're lucky, you will only need to set |compiler| to ghc, and configure + the location of your favourite web browser. You will also want to make + sure that |filetype| detection and |syntax| highlighting are on. Given the + variety of things to guess, however, some dependencies might not be found + correctly, or the defaults might not be to your liking, in which case you + can do some more fine tuning. All of this configuration should happen in + your |vimrc|. +> + " enable syntax highlighting + syntax on + + " enable filetype detection and plugin loading + filetype plugin on +< + + *haskellmode-settings-main* +2.1 GHC and web browser ~ + + *compiler-ghc* *ghc-compiler* + To use the features provided by the GHC |compiler| plugin, use the + following |autocommand| in your vimrc: +> + au BufEnter *.hs compiler ghc +< + *g:ghc* + If the compiler plugin can't locate your GHC binary, or if you have + several versions of GHC installed and have a preference as to which binary + is used, set |g:ghc|: +> + :let g:ghc="/usr/bin/ghc-6.6.1" +< + *g:haddock_browser* + The preferred HTML browser for viewing Haddock documentation can be set as + follows: +> + :let g:haddock_browser="/usr/bin/firefox" +< + + *haskellmode-settings-fine* +2.2 Fine tuning - more configuration options ~ + + Most of the fine tuning is likely to happen for the haskellmode_doc.vim + plugin, so you can check the current settings for this plugin via the + command |:DocSettings|. If all the settings reported there are to your + liking, you probably won't need to do any fine tuning. + + *g:haddock_browser_callformat* + By default, the web browser|g:haddock_browser| will be started + asynchronously (in the background) on Windows or when vim is running in a + GUI, and synchronously (in the foreground) otherwise. These settings seem + to work fine if you are using a console mode browser (eg, when editing in + a remote session), or if you are starting a GUI browser that will launch + itself in the background. But if these settings do not work for you, you + can change the default browser launching behavior. + + This is controlled by |g:haddock_browser_callformat|. It specifies a + format string which uses two '%s' parameters, the first representing the + path of the browser to launch, and the second is the documentation URL + (minus the protocol specifier, i.e. file://) passed to it by the Haddock + plugin. For instance, to launch a GUI browser on Unix-like systems and + force it to the background (see also |shellredir|): +> + :let g:haddock_browser_callformat = '%s file://%s '.printf(&shellredir,'/dev/null').' &' +< + *g:haddock_docdir* + Your system's installed Haddock documentation for GHC and its libraries + should be automatically detected. If the plugin can't locate them, you + must point |g:haddock_docdir| to the path containing the master index.html + file for the subdirectories 'libraries', 'Cabal', 'users_guide', etc.: +> + :let g:haddock_docdir="/usr/local/share/doc/ghc/html/" +< + *g:haddock_indexfiledir* + The information gathered from Haddock's index files will be stored in a + file called 'haddock_index.vim' in a directory derived from the Haddock + location, or in $HOME. To configure another directory for the index file, + use: +> + :let g:haddock_indexfiledir="~/.vim/" +< + *g:wget* + If you also want to try the experimental hpaste functionality, you might + you need to set |g:wget| before the |hpaste| plugin is loaded (unless wget + is in your PATH): +> + :let g:wget="C:\Program Files\wget\wget.exe" +< + + Finally, the mappings actually use|<LocalLeader>|behind the scenes, so if + you have to, you can redefine|maplocalleader|to something other than '_'. + Just remember that the docs still refer to mappings starting with '_', to + avoid confusing the majority of users!-) + +============================================================================== + *haskellmode-compiler* *ghc* +3. GHC Compiler Integration ~ + + The GHC |compiler| plugin sets the basic |errorformat| and |makeprg| to + enable |quickfix| mode using GHCi, and provides functionality for show + info (|_si|), show type (|_t| or mouse |balloon|), add type declaration + (|_T|), create tag file (|_ct|), and insert-mode completion + (|i_CTRL-X_CTRL-O|) based on GHCi browsing of the current and imported + modules. + + To avoid frequent calls to GHCi, type information is cached in Vim. The + cache will be populated the first time a command depends on it, and will + be refreshed every time a |:make| goes through without generating errors + (if the |:make| does not succeed, the old types will remain available in + Vim). You can also unconditionally force reloading of type info using + |:GHCReload| (if GHCi cannot load your file, the type info will be empty). + + + In addition to the standard|quickfix| commands, the GHC compiler plugin + provides: + + *:GHCReload* +:GHCReload Reload modules and unconditionally refresh cache of + type info. Usually, |:make| is prefered, as that will + refresh the cache only if GHCi reports no errors, and + show the errors otherwise. + + *:GHCStaticOptions* +:GHCStaticOptions Edit the static GHC options for the current buffer. + Useful for adding hidden packages (-package ghc). + + *:GHCi* +:GHCi {command/expr} Run GHCi commands/expressions in the current module. + + *_ct* +_ct Create |tags| file for the current Haskell source + file. This uses GHCi's :ctags command, so it will work + recursively, but will only list tags for exported + entities. + + *_opt* +_opt Shows a menu of frequently used GHC compiler options + (selecting an entry adds the option as a pragma to the + start of the file). Uses popup menu (GUI) or :emenu + and command-line completion (CLI). + + *_lang* +_lang Shows a menu of the LANGUAGE options supported by GHC + (selecting an entry adds the language as a pragma to + the start of the file). Uses popup menu (GUI) or + :emenu and command-line completion (CLI). + + *_si* +_si Show extended information for the name under the + cursor. Uses GHCi's :info command. Output appears in + |preview-window| (when done, close with |:pclose|). + + *_t* +_t Show type for the name under the cursor. Uses cached + info from GHCi's :browse command. + + *_T* +_T Insert type declaration for the name under the cursor. + Uses cached info from GHCi's :browse command. + + *haskellmode-XO* *haskellmode-omni-completion* +CTRL-X CTRL-O Standard insert-mode omni-completion based on the + cached type info from GHCi browsing current and + imported modules. Only names from the current and from + imported modules are included (the completion menu + also show the type of each identifier). + +============================================================================== + *haskellmode-haddock* *haddock* +4. Haddock Integration ~ + + Haskell mode integrates with Haddock-generated HTML documentation, + providing features such as navigating to the Haddock entry for the + identifier under the cursor (|_?|), completion for the identifier under + the cursor (|i_CTRL-X_CTRL-U|), and adding import statements (|_i| |_im| + |_iq| |_iqm|) or module qualifier (|_.|) for the identifier under the + cursor. + + These commands operate on an internal Haddock index built from the + platform's installed Haddock documentation for GHC's libraries. Since + populating this index takes several seconds, it should be stored as a + file called 'haddock_index.vim' in the directory specified by + |g:haddock_indexfiledir|. + + Some commands present a different interface (popup menu or command-line + completion) according to whether the current Vim instance is graphical or + console-based (actually: whether or not the GUI is running). Such + differences are marked below with the annotations (GUI) and (CLI), + respectively. + + |:DocSettings| shows the settings for this plugin. If you are happy with + them, you can call |:ExportDocIndex| to populate and write out the + documentation index (should be called once for every new version of GHC). + + *:DocSettings* +:DocSettings Show current Haddock-files-related plugin settings. + + + *haskellmode-indexing* +4.1 Indexing ~ + + *:DocIndex* +:DocIndex Populate the Haddock index from the GHC library + documentation. + + *:ExportDocIndex* +:ExportDocIndex Cache the current Haddock index to a file (populate + index first, if empty). + + + *haskellmode-lookup* +4.2 Lookup ~ + + *_?* +_? Open the Haddock entry (in |haddock_browser|) for an + identifier under the cursor, selecting full + qualifications from a popup menu (GUI) or via + command-line completion (CLI), if the identifier is + not qualified. + + *_?1* +_?1 Search Hoogle (using |haddock_browser|) for an + identifier under the cursor. + + + *_?2* +_?2 Search Hayoo! (using |haddock_browser|) for an + identifier under the cursor. + + *:IDoc* +:IDoc {identifier} Open the Haddock entry for the unqualified + {identifier} in |haddock_browser|, suggesting possible + full qualifications. + + *:MDoc* +:MDoc {module} Open the Haddock entry for {module} in + |haddock_browser| (with command-line completion for + the fully qualified module name). + + *:FlagReference* +:FlagReference {s} Browse Users Guide Flag Reference for section {s} + (with command-line completion for section headers). + + + *haskellmode-editing* +4.3 Editing ~ + + *_.* +_. Fully qualify the unqualified name under the cursor + selecting full qualifications from a popup menu (GUI) + or via command-line completion (CLI). + + *_iq* *_i* +_i _iq Add 'import [qualified] <module>(<identifier>)' + statement for the identifier under the cursor, + selecting fully qualified modules from a popup menu + (GUI) or via command-line completion (CLI), if the + identifier is not qualified. This currently adds one + import statement per call instead of merging into + existing import statements. + + *_iqm* *_im* +_im Add 'import [qualified] <module>' statement for the + identifier under the cursor, selecting fully qualified + modules from a popup menu (GUI) or via command-line + completion (CLI), if the identifier is not qualified. + This currently adds one import statement per call + instead of merging into existing import statements. + + *_ie* +_ie On an 'import <module>' line, in a correctly loadable + module, temporarily comment out import and use :make + 'not in scope' errors to explicitly list imported + identifiers. + + *haskellmode-XU* *haskellmode-user-completion* +CTRL-X CTRL-U User-defined insert mode name completion based on all + names known to the Haddock index, including package + names. Completions are presented in a popup menu which + also displays the fully qualified module from which + each entry may be imported. + + CamelCode shortcuts are supported, meaning that + lower-case letters can be elided, using only + upper-case letters and module qualifier separators (.) + for disambiguation: + + pSL -> putStrLn + C.E.t -> Control.Exception.t + C.M.MP -> Control.Monad.MonadPlus + + To reduce unwanted matches, the first letter of such + shortcuts and the first letter after each '.' have to + match directly. + +============================================================================== + *haskellmode-hpaste* *hpaste* +5. Hpaste Integration ~ + + This experimental feature allows browsing and posting to + http://hpaste.org, a Web-based pastebin tailored for Haskell code. + + + *:HpasteIndex* +:HpasteIndex Read the most recent entries from hpaste.org. Show an + index of the entries in a new buffer, where ',r' will + open the current highlighted entry [and ',p' will + annotate it with the current buffer]. + + *:HpastePostNew* +:HpastePostNew Submit current buffer as a new hpaste entry. + [This, and ',p' above, are temporarily disabled, + needs update to new hpaste.org layout] + +============================================================================== + *haskellmode-resources* +6. Additional Resources ~ + + An quick screencast tour through of these plugins is available at: + + http://projects.haskell.org/haskellmode-vim/screencasts.html + + Other Haskell-related Vim plugins can be found here: + + http://www.haskell.org/haskellwiki/Libraries_and_tools/Program_development#Vim + + Make sure to read about Vim's other program-editing features in its online + |user-manual|. Also have a look at Vim tips and plugins at www.vim.org - + two other plugins I tend to use when editing Haskell are AlignPlugin.vim + (to line up regexps for definitions, keywords, comments, etc. in + consecutive lines) and surround.vim (to surround text with quotes, + brackets, parentheses, comments, etc.). + +============================================================================== + vim:tw=78:ts=8:ft=help: diff --git a/dot_vim/indent/indent-r.vim b/dot_vim/indent/indent-r.vim new file mode 100644 index 0000000..30c03c5 --- /dev/null +++ b/dot_vim/indent/indent-r.vim @@ -0,0 +1,50 @@ +" Vim indent file +" Language: R +" Author: Jeremy Stephens <jeremy.f.stephens@vanderbilt.edu> +" URL: +" Last Change: +" Version: +" Notes: +" Changes: +" Options: + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetRIndent() +"setlocal indentkeys+=0=,0),=EO +setlocal indentkeys+=0=,0),=EO,=> + +" Only define the function once. +if exists("*GetRIndent") + finish +endif + +function GetRIndent() + " Find a non-blank line above the current line. + let lnum = prevnonblank(v:lnum - 1) + " Hit the start of the file, use zero indent. + if lnum == 0 + return 0 + endif + + let line = getline(lnum) " last line + let cline = getline(v:lnum) " current line + let pline = getline(lnum - 1) " previous to last line + let ind = indent(lnum) + + " Indent blocks enclosed by {} or () + "if line =~ '[{(]\s*\(#[^)}]*\)\=$' + if line =~ '[{(]\s*[^)}]*$' + let ind = ind + &sw + endif + if cline =~ '^\s*[)}]' + let ind = ind - &sw + endif + + return ind +endfunction +" vim: set ts=4 sw=4: diff --git a/dot_vim/indent/tex.vim b/dot_vim/indent/tex.vim new file mode 100644 index 0000000..5823dae --- /dev/null +++ b/dot_vim/indent/tex.vim @@ -0,0 +1,139 @@ +" Vim indent file +" Language: LaTeX +" Maintainer: Johannes Tanzler <jtanzler@yline.com> +" Created: Sat, 16 Feb 2002 16:50:19 +0100 +" Last Change: Sun, 17 Feb 2002 00:09:11 +0100 +" Last Update: 18th feb 2002, by LH : +" (*) better support for the option +" (*) use some regex instead of several '||'. +" Version: 0.02 +" URL: comming soon: http://www.unet.univie.ac.at/~a9925098/vim/indent/tex.vim + +" --> If you're a Vim guru & and you find something that could be done in a +" better (perhaps in a more Vim-ish or Vi-ish) way, please let me know! + +" Options: {{{ +" +" To set the following options (ok, currently it's just one), add a line like +" let g:tex_indent_items = 1 +" to your ~/.vimrc. +" +" * g:tex_indent_items +" +" If this variable is set, item-environments are indented like Emacs does +" it, i.e., continuation lines are indented with a shiftwidth. +" +" NOTE: I've already set the variable below; delete the corresponding line +" if you don't like this behaviour. +" +" Per default, it is unset. +" +" set unset +" ---------------------------------------------------------------- +" \begin{itemize} \begin{itemize} +" \item blablabla \item blablabla +" bla bla bla bla bla bla +" \item blablabla \item blablabla +" bla bla bla bla bla bla +" \end{itemize} \end{itemize} +" +" +" This option applies to itemize, description, enumerate, and +" thebibliography. +" +" }}} + +" Delete the next line to avoid the special indention of items +if !exists("g:tex_indent_items") + let g:tex_indent_items = 1 +endif + +if exists("b:did_indent") | finish +endif +let b:did_indent = 1 + + +setlocal indentexpr=GetTeXIndent() +setlocal nolisp +setlocal nosmartindent +setlocal autoindent +setlocal indentkeys+=},=\\item,=\\bibitem + + +" Only define the function once +if exists("*GetTeXIndent") | finish +endif + + + +function GetTeXIndent() + + " Find a non-blank line above the current line. + let lnum = prevnonblank(v:lnum - 1) + + " At the start of the file use zero indent. + if lnum == 0 | return 0 + endif + + let ind = indent(lnum) + let line = getline(lnum) " last line + let cline = getline(v:lnum) " current line + + " Do not change indentation of commented lines. + if line =~ '^\s*%' + return ind + endif + + " Add a 'shiftwidth' after beginning of environments. + " Don't add it for \begin{document} and \begin{verbatim} + ""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim' + " LH modification : \begin does not always start a line + if line =~ '\\begin{\(.*\)}' && line !~ 'verbatim' + \ && line !~ 'document' + + let ind = ind + &sw + + if g:tex_indent_items == 1 + " Add another sw for item-environments + if line =~ 'itemize\|description\|enumerate\|thebibliography' + let ind = ind + &sw + endif + endif + endif + + + " Subtract a 'shiftwidth' when an environment ends + if cline =~ '^\s*\\end' && cline !~ 'verbatim' + \&& cline !~ 'document' + + if g:tex_indent_items == 1 + " Remove another sw for item-environments + if cline =~ 'itemize\|description\|enumerate\|thebibliography' + let ind = ind - &sw + endif + endif + + let ind = ind - &sw + endif + + + " Special treatment for 'item' + " ---------------------------- + + if g:tex_indent_items == 1 + + " '\item' or '\bibitem' itself: + if cline =~ '^\s*\\\(bib\)\=item' + let ind = ind - &sw + endif + + " lines following to '\item' are intented once again: + if line =~ '^\s*\\\(bib\)\=item' + let ind = ind + &sw + endif + + endif + + return ind +endfunction + diff --git a/dot_vim/kde-devel-vim.vim b/dot_vim/kde-devel-vim.vim new file mode 100644 index 0000000..7ce39a9 --- /dev/null +++ b/dot_vim/kde-devel-vim.vim @@ -0,0 +1,1029 @@ +" To use this file, add this line to your ~/.vimrc:, w/o the dquote +" source /path/to/kde/sources/kdesdk/scripts/kde-devel-vim.vim +" +" For CreateChangeLogEntry() : If you don't want to re-enter your +" Name/Email in each vim session then make sure to have the viminfo +" option enabled in your ~/.vimrc, with the '!' flag, enabling persistent +" storage of global variables. Something along the line of +" set viminfo=%,!,'50,\"100,:100,n~/.viminfo +" should do the trick. +" +" To make use of the ,ll and ,lg shortcuts you need to have the files +" GPLHEADER and LGPLHEADER in your home directory. Their content will be +" copied as license header then. + +" Don't include these in filename completions +set suffixes+=.lo,.o,.moc,.la,.closure,.loT + +" Search for headers here +set path=.,/usr/include,/usr/local/include, +if $QTDIR != '' + let &path = &path . $QTDIR . '/include/,' + let &path = &path . $QTDIR . '/include/Qt/,' + let &path = &path . $QTDIR . '/include/QtCore/,' + let &path = &path . $QTDIR . '/include/Qt3Support/,' + let &path = &path . $QTDIR . '/include/QtAssistant/,' + let &path = &path . $QTDIR . '/include/QtDBus/,' + let &path = &path . $QTDIR . '/include/QtDesigner/,' + let &path = &path . $QTDIR . '/include/QtGui/,' + let &path = &path . $QTDIR . '/include/QtNetwork/,' + let &path = &path . $QTDIR . '/include/QtOpenGL/,' + let &path = &path . $QTDIR . '/include/QtSql/,' + let &path = &path . $QTDIR . '/include/QtSvg/,' + let &path = &path . $QTDIR . '/include/QtTest/,' + let &path = &path . $QTDIR . '/include/QtUiTools/,' + let &path = &path . $QTDIR . '/include/QtXml/,' +endif +if $KDEDIR != '' + let &path = &path . $KDEDIR . '/include/,' +endif +if $KDEDIRS != '' + let &path = &path . substitute( $KDEDIRS, '\(:\|$\)', '/include,', 'g' ) +endif +set path+=, + +" Use makeobj to build +set mp=makeobj + +" If TagList is Loaded then get a funny statusline +" Only works if kde-devel-vim.vim is loaded after taglist. +" Droping this script in ~/.vim/plugin works fine +if exists('loaded_taglist') + let Tlist_Process_File_Always=1 + set statusline=%<%f:[\ %{Tlist_Get_Tag_Prototype_By_Line()}\ ]\ %h%m%r%=%-14.(%l,%c%V%)\ %P +endif + +" Insert tab character in whitespace-only lines, complete otherwise +inoremap <Tab> <C-R>=SmartTab()<CR> + +if !exists("DisableSmartParens") +" Insert a space after ( or [ and before ] or ) unless preceded by a matching +" paren/bracket or space or inside a string or comment. Comments are only +" recognized as such if they start on the current line :-( +inoremap ( <C-R>=SmartParens( '(' )<CR> +inoremap [ <C-R>=SmartParens( '[' )<CR> +inoremap ] <C-R>=SmartParens( ']', '[' )<CR> +inoremap ) <C-R>=SmartParens( ')', '(' )<CR> +endif + +" Insert an #include statement for the current/last symbol +inoremap <F5> <C-O>:call AddHeader()<CR> + +" Insert a forward declaration for the current/last symbol +inoremap <S-F5> <C-O>:call AddForward()<CR> + +" Switch between header and implementation files on ,h +nmap <silent> ,h :call SwitchHeaderImpl()<CR> +nmap <silent> ,p :call SwitchPrivateHeaderImpl()<CR> + +" Comment selected lines on ,c in visual mode +vmap ,c :s,^,//X ,<CR>:noh<CR> +" Uncomment selected lines on ,u in visual mode +vmap ,u :s,^//X ,,<CR> + +" Insert an include guard based on the file name on ,i +nmap ,i :call IncludeGuard()<CR> + +" Insert license headers at the top of the file +nmap ,lg :call LicenseHeader( "GPL" )<CR> +nmap ,ll :call LicenseHeader( "LGPL" )<CR> +nmap ,lm :call LicenseHeader( "MIT" )<CR> + +" Insert simple debug statements into each method +nmap ,d :call InsertMethodTracer()<CR> + +" Expand #i to #include <.h> or #include ".h". The latter is chosen +" if the character typed after #i is a dquote +" If the character is > #include <> is inserted (standard C++ headers w/o .h) +iab #i <C-R>=SmartInclude()<CR> + +" Insert a stripped down CVS diff +iab DIFF <Esc>:call RunDiff()<CR> + +" mark 'misplaced' tab characters +set listchars=tab:·\ ,trail:· +set list + +set incsearch + +function! SetCodingStyle() + if &syntax == 'cmake' + call SmartParensOff() + set sw=3 + set ts=3 + set et + set tw=0 + return + endif + if ( &syntax !~ '^\(c\|cpp\|java\)$' ) + return + endif + "the path for the file + let pathfn = expand( '%:p:h' ) + if pathfn =~ 'nmm' + call SmartParensOff() + inoremap ( <C-R>=SpaceBetweenKeywordAndParens()<CR> + let g:need_brace_on_next_line = '\<\(class\|namespace\|struct\)\>' + let g:need_brace_on_same_line = '\<\(if\|else\|while\|switch\|do\|enum\|for\|try\|catch\)\>' + set sw=4 + set ts=4 + set noet + set tw=100 + elseif pathfn =~ 'kdepim' + if strlen(mapcheck('(','i')) > 0 + iunmap ( + endif + call SmartParensOn() + let g:need_brace_on_next_line = '\<\(class\|namespace\|struct\)\>' + let g:need_brace_on_same_line = '\<\(if\|else\|while\|switch\|do\|foreach\|forever\|enum\|for\|try\|catch\)\>' + set sw=2 + set sts=2 + set et + set tw=100 + elseif pathfn =~ 'kdemultimedia\/juk' + call SmartParensOff() + let g:need_brace_on_next_line = '\<\(class\|namespace\|struct\|if\|else\|while\|switch\|do\|foreach\|forever\|enum\|for\|try\|catch\)\>' + let g:need_brace_on_same_line = '' + set sw=4 + set sts=4 + set et + set tw=100 + else "if pathfn =~ '\(kdelibs\|qt-copy\)' + call SmartParensOff() + inoremap ( <C-R>=SpaceBetweenKeywordAndParens()<CR> + let g:need_brace_on_next_line = '\<\(class\|namespace\|struct\)\>' + let g:need_brace_on_same_line = '\<\(if\|else\|while\|switch\|do\|foreach\|forever\|enum\|for\|try\|catch\)\>' + set sw=4 + set sts=4 + set et + set tw=100 + endif + if ( !exists("g:noautobrace") ) + call EnableSmartLineBreak() + endif +endfunction + +function! DisableSmartLineBreak() + iunmap <CR> + iuna else +endfunction +function! EnableSmartLineBreak() + if exists("*pumvisible") + inoremap <CR> <C-R>=pumvisible() ? "\<lt>CR>" : "\<lt>ESC>:call SmartLineBreak()\<lt>CR>a\<lt>CR>"<CR> + else + inoremap <CR> <ESC>:call SmartLineBreak()<CR>a<CR> + endif + iab else <C-R>=SmartElse()<CR> +endfunction + +function! SmartElse() + "let next = nr2char( getchar( 0 ) ) + let prefix = '' + if strlen(g:need_brace_on_same_line) > 0 && 'else' =~ g:need_brace_on_same_line + if getline('.') =~ '^\s*$' + if getline(line('.') - 1) =~ '}$' + let prefix = prefix . "\<ESC>kmMjdd`MA " + elseif getline(line('.') - 1) =~ '}\s*$' + let prefix = prefix . "\<ESC>kmMjdd`MA" + endif + endif + endif + return prefix . "else\<Right>" +endfunction + +" automatic indenting is required for SmartLineBreak to work correctly +filetype indent on + +function! CreateMatchLine() + let linenum = line( '.' ) + let current_line = getline( linenum ) + " don't do magic if the cursor isn't at the end of the line or if it's + " inside a // comment + if col( '.' ) != strlen( current_line ) || match( current_line, '//' ) >= 0 + return '' + endif + " remove whitespace at the end + if match( current_line, '\s\+$' ) >= 0 + :execute ':s/\s*$//' + " the following is needed if return '' is called + :execute "normal $" + endif + let current_line = getline( linenum ) + " remove all /* */ comments + let current_line = substitute( current_line, '/\*.\{-}\*/', '', 'g' ) + " remove all strings + let current_line = substitute( current_line, "'[^']*'", '', 'g' ) + let current_line = substitute( current_line, '"\(\\"\|[^"]\)*"', '', 'g' ) + " remove all ( ) + while current_line =~ '(.*)' + let current_line = substitute( current_line, '([^()]*)', '', 'g' ) + endwhile + " prepend earlier lines until we find a ; or { + while linenum > 1 && current_line !~ ';' && current_line !~ '{.\+$' + let linenum = linenum - 1 + let prev_line = getline(linenum) + if synIDattr(synID(linenum, 1, 1), "name") == 'cComment' "inside a /* */ comment at the beginning of the line + if stridx(prev_line, '*/') == -1 + " next line please + let prev_line = '' + else + " remove everything before */ + let prev_line = substitute(prev_line, '^.*\*/', '*/', '') + endif + endif + " remove // comment + let prev_line = substitute(prev_line, '//.*$', '', '' ) + " concatenate the lines with a space in between + let current_line = prev_line.' '.current_line + " remove all /* */ comments + let current_line = substitute( current_line, '/\*.\{-}\*/', '', 'g' ) + " remove all strings + let current_line = substitute( current_line, "'[^']*'", '', 'g' ) + let current_line = substitute( current_line, '"\(\\"\|[^"]\)*"', '', 'g' ) + " remove all ( ) + while current_line =~ '(.*)' + let current_line = substitute( current_line, '([^()]*)', '', 'g' ) + endwhile + endwhile + " remove everything until the last ; + let current_line = substitute( current_line, '^.*;', '', '' ) + " remove everything until the last { which is not at the end of the line + let current_line = substitute( current_line, '^.*{\(.\+\)$', '\1', '' ) + " remove all [ ] + while current_line =~ '\[.*\]' + let current_line = substitute( current_line, '\[[^\[\]]*\]', '', 'g' ) + endwhile + " if <CR> was pressed inside ( ), [ ] or /* */ don't add braces + if current_line =~ '[(\[]' || current_line =~ '/\*' + return '' + endif + return current_line +endfunction + +function! AddClosingBrace(current_line) + if a:current_line =~ '\<enum\|class\|struct\>' + :execute "normal o};\<ESC>k" + elseif a:current_line =~ '\<namespace\>' + let namespace = substitute( a:current_line, '^.*namespace\s\+', '', '' ) + let namespace = substitute( namespace, '\s.*$', '', '' ) + :execute "normal o} // namespace " . namespace . "\<ESC>k" + else + :execute "normal o}\<ESC>k" + endif +endfunction + +function! SmartLineBreak() + if synIDattr(synID(line("."), col("."), 1), "name") == 'cComment' "inside a /* */ comment at the point where the line break occurs + return + endif + let match_line = CreateMatchLine() + if match_line == '' + return + endif + + let match_position1 = -1 + let match_position2 = -1 + if strlen(g:need_brace_on_same_line) > 0 + let match_position1 = match(match_line, g:need_brace_on_same_line) + if match_position1 > 0 + while strpart(match_line, match_position1 - 1, 1) == '#' + let old_position = match_position1 + let match_position1 = match(match_line, g:need_brace_on_same_line, match_position1 + 1) + if match_position1 == -1 + if strpart(match_line, old_position, 2) == 'if' + :execute "normal o#endif\<ESC>k$" + endif + return + endif + endwhile + endif + endif + if strlen(g:need_brace_on_next_line) > 0 && match_position1 == -1 + let match_position2 = match(match_line, g:need_brace_on_next_line) + if match_position2 > 0 + while strpart(match_line, match_position2 - 1, 1) == '#' + let old_position = match_position2 + let match_position2 = match(match_line, g:need_brace_on_same_line, match_position2 + 1) + if match_position2 == -1 + if strpart(match_line, old_position, 2) == 'if' + :execute "normal o#endif\<ESC>k$" + endif + return + endif + endwhile + endif + endif + + if match_position1 > -1 + if match_line =~ '}\s*else\>' + " make sure else is on the same line as the closing brace + if getline('.') =~ '^\s*else' + if getline(line('.') - 1) =~ '}$' + :execute "normal kA \<ESC>J" + elseif getline(line('.') - 1) =~ '}\s*$' + :execute "normal kJ" + endif + endif + endif + while getline('.') =~ '^\s*{$' + " opening brace is on its own line: move it up + :execute "normal kJ" + endwhile + if match_line =~ '{$' + if getline('.') =~ '[^ ]{$' + :execute ':s/{$/ {/' + endif + else + :execute ':s/$/ {/' + endif + call AddClosingBrace(match_line) + elseif getline('.') =~ '^\s*{$' + call AddClosingBrace('') + elseif match_position2 > -1 + if match_line =~ '{$' + :execute ':s/\s*{$//' + endif + :execute "normal o{" + call AddClosingBrace(match_line) + endif + :execute "normal $" +endfunction + +function! SmartParensOn() + inoremap ( <C-R>=SmartParens( '(' )<CR> + inoremap [ <C-R>=SmartParens( '[' )<CR> + inoremap ] <C-R>=SmartParens( ']', '[' )<CR> + inoremap ) <C-R>=SmartParens( ')', '(' )<CR> +endfunction + +function! SmartParensOff() + if strlen(mapcheck('[','i')) > 0 + iunmap ( + iunmap [ + iunmap ] + iunmap ) + endif +endfunction + +function! SmartTab() + let col = col('.') - 1 + if !col || getline('.')[col-1] !~ '\k' + return "\<Tab>" + else + return "\<C-P>" + endif +endfunction + +function! SmartParens( char, ... ) + if ! ( &syntax =~ '^\(c\|cpp\|java\)$' ) + return a:char + endif + let s = strpart( getline( '.' ), 0, col( '.' ) - 1 ) + if s =~ '//' + return a:char + endif + let s = substitute( s, '/\*\([^*]\|\*\@!/\)*\*/', '', 'g' ) + let s = substitute( s, "'[^']*'", '', 'g' ) + let s = substitute( s, '"\(\\"\|[^"]\)*"', '', 'g' ) + if s =~ "\\([\"']\\|/\\*\\)" + return a:char + endif + if a:0 > 0 + if strpart( getline( '.' ), col( '.' ) - 3, 2 ) == a:1 . ' ' + return "\<BS>" . a:char + endif + if strpart( getline( '.' ), col( '.' ) - 2, 1 ) == ' ' + return a:char + endif + return ' ' . a:char + endif + if !exists("g:DisableSpaceBeforeParen") + if a:char == '(' + if strpart( getline( '.' ), col( '.' ) - 3, 2 ) == 'if' || + \strpart( getline( '.' ), col( '.' ) - 4, 3 ) == 'for' || + \strpart( getline( '.' ), col( '.' ) - 6, 5 ) == 'while' || + \strpart( getline( '.' ), col( '.' ) - 7, 6 ) == 'switch' + return ' ( ' + endif + endif + endif + return a:char . ' ' +endfunction + +function! SpaceBetweenKeywordAndParens() + if ! ( &syntax =~ '^\(c\|cpp\|java\)$' ) + return '(' + endif + let s = strpart( getline( '.' ), 0, col( '.' ) - 1 ) + if s =~ '//' + " text inside a comment + return '(' + endif + let s = substitute( s, '/\*\([^*]\|\*\@!/\)*\*/', '', 'g' ) + let s = substitute( s, "'[^']*'", '', 'g' ) + let s = substitute( s, '"\(\\"\|[^"]\)*"', '', 'g' ) + if s =~ "\\([\"']\\|/\\*\\)" + " text inside a string + return '(' + endif + if a:0 > 0 + if strpart( getline( '.' ), col( '.' ) - 3, 2 ) == a:1 . ' ' + return "\<BS>" . a:char + endif + if strpart( getline( '.' ), col( '.' ) - 2, 1 ) == ' ' + return a:char + endif + return ' ' . a:char + endif + if strpart( getline( '.' ), col( '.' ) - 3, 2 ) == 'if' || + \strpart( getline( '.' ), col( '.' ) - 4, 3 ) == 'for' || + \strpart( getline( '.' ), col( '.' ) - 6, 5 ) == 'while' || + \strpart( getline( '.' ), col( '.' ) - 7, 6 ) == 'switch' || + \strpart( getline( '.' ), col( '.' ) - 8, 7 ) == 'foreach' || + \strpart( getline( '.' ), col( '.' ) - 8, 7 ) == 'forever' + return ' (' + endif + return '(' +endfunction + +function! SwitchHeaderImpl() + let privateheaders = '_p\.\([hH]\|hpp\|hxx\)$' + let headers = '\.\([hH]\|hpp\|hxx\)$' + let impl = '\.\([cC]\|cpp\|cc\|cxx\)$' + let fn = expand( '%' ) + if fn =~ privateheaders + let list = glob( substitute( fn, privateheaders, '.*', '' ) ) + elseif fn =~ headers + let list = glob( substitute( fn, headers, '.*', '' ) ) + elseif fn =~ impl + let list = glob( substitute( fn, impl, '.*', '' ) ) + endif + while strlen( list ) > 0 + let file = substitute( list, "\n.*", '', '' ) + let list = substitute( list, "[^\n]*", '', '' ) + let list = substitute( list, "^\n", '', '' ) + if ( ( fn =~ headers || fn =~ privateheaders ) && file =~ impl ) || ( fn =~ impl && file =~ headers ) + call AskToSave() + execute( "edit " . file ) + return + endif + endwhile + if ( fn =~ headers ) + call AskToSave() + if exists( "$implextension" ) + let file = substitute( fn, headers, '.' . $implextension, '' ) + else + let file = substitute( fn, headers, '.cpp', '' ) + endif + " check for modified state of current buffer and if modified ask: + " save, discard, cancel + execute( 'edit '.file ) + call append( 0, "#include \"".fn."\"" ) + call append( 2, "// vim: sw=4 sts=4 et tw=100" ) + execute( "set sw=4" ) + execute( "set sts=4" ) + execute( "set et" ) + execute( "set tw=100" ) + elseif fn =~ impl + call AskToSave() + let file = substitute( fn, impl, '.h', '' ) + execute( "edit ".file ) + endif +endfunction + +function! SwitchPrivateHeaderImpl() + let privateheaders = '_p\.\([hH]\|hpp\|hxx\)$' + let headers = '\.\([hH]\|hpp\|hxx\)$' + let impl = '\.\([cC]\|cpp\|cc\|cxx\)$' + let fn = expand( '%' ) + if fn =~ privateheaders + let list = glob( substitute( fn, privateheaders, '.*', '' ) ) + elseif fn =~ headers + let list = glob( substitute( fn, headers, '_p.*', '' ) ) + elseif fn =~ impl + let list = glob( substitute( fn, impl, '_p.*', '' ) ) + endif + while strlen( list ) > 0 + let file = substitute( list, "\n.*", '', '' ) + let list = substitute( list, "[^\n]*", '', '' ) + let list = substitute( list, "^\n", '', '' ) + if ( fn =~ privateheaders && file =~ impl ) || ( fn =~ impl && file =~ privateheaders ) || ( fn =~ headers && file =~ privateheaders ) + call AskToSave() + execute( "edit " . file ) + return + endif + endwhile + if ( fn =~ privateheaders ) + call AskToSave() + if exists( "$implextension" ) + let file = substitute( fn, privateheaders, '.' . $implextension, '' ) + else + let file = substitute( fn, privateheaders, '.cpp', '' ) + endif + " check for modified state of current buffer and if modified ask: + " save, discard, cancel + execute( 'edit '.file ) + call append( 0, "#include \"".fn."\"" ) + call append( 2, "// vim: sw=4 ts=4 noet" ) + execute( "set sw=4" ) + execute( "set ts=4" ) + elseif fn =~ impl + let file = substitute( fn, impl, '_p.h', '' ) + call CreatePrivateHeader( file ) + elseif fn =~ headers + let file = substitute( fn, headers, '_p.h', '' ) + call CreatePrivateHeader( file ) + endif +endfunction + +function! AskToSave() + if &modified + let yesorno = input("Save changes before switching file? [Y/n]") + if yesorno == 'y' || yesorno == '' || yesorno == 'Y' + :execute 'w' + return 1 + else + return 0 + endif + endif + return 1 +endfunction + +function! CreatePrivateHeader( privateHeader ) + let privateheaders = '_p\.\([hH]\|hpp\|hxx\)$' + let headers = '\.\([hH]\|hpp\|hxx\)$' + let impl = '\.\([cC]\|cpp\|cc\|cxx\)$' + let fn = expand( '%' ) + if fn =~ headers + let className = ClassNameFromHeader() + elseif fn =~ impl + let className = ClassNameFromImpl() + endif + + if AskToSave() && fn =~ headers + :normal gg + " check whether a Q_DECLARE_PRIVATE is needed + let dp = search( '\(^\|\s\+\)Q_DECLARE_PRIVATE\s*(\s*'.className.'\s*)' ) + if dp == 0 "nothing found + call search( '^\s*class\s\+\([A-Za-z0-9]\+_EXPORT\s\+\)[A-Za-z_]\+\s*\(:\s*[,\t A-Za-z_]\+\)\?\s*\n\?\s*{' ) + call search( '{' ) + let @c = className + if match(getline(line('.')+1), 'Q_OBJECT') + :normal joQ_DECLARE_PRIVATE(c) + else + :normal oQ_DECLARE_PRIVATE(c) + endif + :execute 'w' + endif + endif + execute( "edit ".a:privateHeader ) + let privateClassName = className . 'Private' + let header = substitute( a:privateHeader, privateheaders, '.h', '' ) + + call IncludeGuard() + " FIXME: find out what license to use + call LicenseHeader( "LGPL" ) + :set sw=4 + :set sts=4 + :set et + :set tw=100 + :normal Go// vim: sw=4 sts=4 et tw=100 + let @h = header + let @p = privateClassName + let @c = className + :normal kkko
#include "h"
class p
{
Q_DECLARE_PUBLIC(c)
protected:
c* q_ptr;
}; +endfunction + +function! ClassNameFromHeader() + :normal gg + call search( '^\s*class\s\+\([A-Za-z0-9]\+_EXPORT\s\+\)\?[A-Za-z_]\+\s*\(:\s*[,\t A-Za-z_]\+\)\?\s*\n\?\s*{' ) + "\zs and \ze mark start and end of the matching + return matchstr( getline('.'), '\s\+\zs\w\+\ze\s*\(:\|{\|$\)' ) +endfunction + +function! ClassNameFromImpl() + :normal gg + call search( '\s*\([A-Za-z_]\+\)::\1\s*(' ) + :normal "cye + return @c +endfunction + +function! IncludeGuard() + let guard = toupper( substitute( substitute( expand( '%' ), '\([^.]*\)\.h', '\1_h', '' ), '/', '_', '' ) ) + call append( '^', '#define ' . guard ) + + + call append( '^', '#ifndef ' . guard ) + call append( '$', '#endif // ' . guard ) + + +endfunction + +function! LicenseHeader( license ) + let filename = $HOME . "/" . a:license . "HEADER" + execute ":0r " . filename +" call append( 0, system( "cat " . filename ) ) +endfunction + +function! SmartInclude() + let next = nr2char( getchar( 0 ) ) + if next == '"' + return "#include \".h\"\<Left>\<Left>\<Left>" + endif + if next == '>' + return "#include <>\<Left>" + endif + return "#include <.h>\<Left>\<Left>\<Left>" +endfunction + +function! MapIdentHeader( ident ) + let header = tolower(substitute(a:ident, '::', '/', 'g')).'.h' + if a:ident =~ 'Private$' + let header = substitute(header, 'private', '_p', '') + endif + " always prefer the headers in the same directory + let check = header + let slash = 1 + while slash != -1 + if filereadable( check ) + return '"' . check . '"' + endif + let slash = match( check, '/' ) + let check = strpart( check, slash + 1 ) + endwhile + let check = tolower(substitute(a:ident, '::', '/', 'g')).'_p.h' + let slash = 1 + while slash != -1 + if filereadable(check) + return '"' . check . '"' + endif + let slash = match(check, '/') + let check = strpart(check, slash + 1) + endwhile + + " Qt stuff + if a:ident =~ '^Q[A-Z]' + " let's try to find the module + let module = '' + if $QTDIR != '' + if filereadable($QTDIR.'/include/QtCore/'.a:ident) + let module = 'QtCore/' + elseif filereadable($QTDIR.'/include/QtGui/'.a:ident) + let module = 'QtGui/' + elseif filereadable($QTDIR.'/include/Qt3Support/'.a:ident) + let module = 'Qt3Support/' + elseif filereadable($QTDIR.'/include/QtAssistant/'.a:ident) + let module = 'QtAssistant/' + elseif filereadable($QTDIR.'/include/QtDBus/'.a:ident) + let module = 'QtDBus/' + elseif filereadable($QTDIR.'/include/QtDesigner/'.a:ident) + let module = 'QtDesigner/' + elseif filereadable($QTDIR.'/include/QtNetwork/'.a:ident) + let module = 'QtNetwork/' + elseif filereadable($QTDIR.'/include/QtOpenGL/'.a:ident) + let module = 'QtOpenGL/' + elseif filereadable($QTDIR.'/include/QtSql/'.a:ident) + let module = 'QtSql/' + elseif filereadable($QTDIR.'/include/QtSvg/'.a:ident) + let module = 'QtSvg/' + elseif filereadable($QTDIR.'/include/QtTest/'.a:ident) + let module = 'QtTest/' + elseif filereadable($QTDIR.'/include/QtUiTools/'.a:ident) + let module = 'QtUiTools/' + elseif filereadable($QTDIR.'/include/QtXml/'.a:ident) + let module = 'QtXml/' + endif + endif + return '<'.module.a:ident.'>' + elseif a:ident == 'qDebug' || + \a:ident == 'qWarning' || + \a:ident == 'qCritical' || + \a:ident == 'qFatal' + return '<QtCore/QtDebug>' + elseif a:ident =~ 'Q_DECLARE_INTERFACE' + return '<QtCore/QObject>' + elseif a:ident =~ '^QT_VERSION' || + \a:ident =~ '^Q_\(W\|O\)S_' || + \a:ident =~ '^Q_CC_' || + \a:ident =~ '^Q_.*STRUCTOR_FUNCTION$' || + \a:ident =~ '^qu\?int' || + \a:ident =~ '^Q_.*_RESOURCE$' || + \a:ident == 'qreal' || + \a:ident == 'qAbs' || + \a:ident == 'qRound' || + \a:ident == 'qRound64' || + \a:ident == 'qMin' || + \a:ident == 'qMax' || + \a:ident == 'qBound' || + \a:ident == 'qVersion' || + \a:ident == 'qSharedBuild' || + \a:ident == 'Q_UNUSED' || + \a:ident == 'Q_ASSERT' || + \a:ident == 'qInstallMsgHandler' || + \a:ident == 'Q_GLOBAL_STATIC' || + \a:ident == 'Q_GLOBAL_STATIC_WITH_ARGS' || + \a:ident == 'qFuzzyCompare' || + \a:ident == 'qIsNull' || + \a:ident == 'qSwap' || + \a:ident =~ 'Q_DECLARE_\(FLAGS\|OPERATORS_FOR_FLAGS\|PRIVATE\|PUBLIC\)' || + \a:ident == 'Q_D' || + \a:ident == 'Q_Q' || + \a:ident == 'Q_DISABLE_COPY' || + \a:ident == 'qsrand' || + \a:ident == 'qrand' + return '<QtCore/QtGlobal>' + + " Phonon stuff + elseif a:ident =~ '^Phonon::[A-Z]' + if a:ident =~ '^Phonon::\(NoDisc\|Cd\|Dvd\|Vcd\|.\+MetaData\|.*State\|.*Category\|.\+Error\)' + return '<Phonon/Global>' + endif + return '<'.substitute(a:ident, '::', '/', 'g').'>' + endif + + " KDE stuff + let kdeincdir = substitute(system('kde4-config --prefix'), '[\n\r]*', '', 'g').'/include/KDE/' + let classname = substitute(a:ident, '^.*:', '', '') + let pathfn = expand('%:p:h') + if filereadable(kdeincdir.classname) && !pathfn =~ 'kdelibs' + return '<'.classname.'>' + elseif filereadable(kdeincdir.'Phonon/'.classname) + return '<Phonon/'.classname.'>' + elseif filereadable(kdeincdir.'Solid/'.classname) + return '<Solid/'.classname.'>' + elseif filereadable(kdeincdir.'KIO/'.classname) + return '<KIO/'.classname.'>' + elseif filereadable(kdeincdir.'KParts/'.classname) + return '<KParts/'.classname.'>' + elseif a:ident == 'K\(Double\|Int\)\(NumInput\|SpinBox\)' + return '<knuminput.h>' + elseif a:ident == 'KSharedConfig' + return '<kconfig.h>' + elseif a:ident == 'KConfigGroup' + return '<kconfiggroup.h>' + elseif a:ident == 'KListViewItem' + return '<klistview.h>' + elseif a:ident =~ 'kd\(Debug\|Warning\|Error\|Fatal\|Backtrace\)' + return '<kdebug.h>' + elseif a:ident == 'kapp' + return '<kapplication.h>' + elseif a:ident == 'i18n' || + \a:ident == 'I18N_NOOP' + return '<klocale.h>' + elseif a:ident == 'locate' || + \a:ident == 'locateLocal' + return '<kstandarddirs.h>' + elseif a:ident =~ '\(Small\|Desktop\|Bar\|MainBar\|User\)Icon\(Set\)\?' || + \a:ident == 'IconSize' + return '<kiconloader.h>' + + " aRts stuff + elseif a:ident =~ '\arts_\(debug\|info\|warning\|fatal\)' + return '<debug.h>' + + " Standard Library stuff + elseif a:ident =~ '\(std::\)\?\(cout\|cerr\|endl\)' + return '<iostream>' + elseif a:ident =~ '\(std::\)\?is\(alnum\|alpha\|ascii\|blank\|graph\|lower\|print\|punct\|space\|upper\|xdigit\)' + return '<cctype>' + elseif a:ident == 'printf' + return '<cstdio>' + endif + + let check = header + while 1 + if filereadable( check ) + return '"' . check . '"' + endif + let slash = match( check, '/' ) + if slash == -1 + return '<' . header . '>' + endif + let check = strpart( check, slash + 1 ) + endwhile +endfunction + +" This is a rather dirty hack, but seems to work somehow :-) (malte) +function! AddHeader() + let s = getline( '.' ) + let i = col( '.' ) - 1 + while i > 0 && strpart( s, i, 1 ) !~ '[A-Za-z0-9_:]' + let i = i - 1 + endwhile + while i > 0 && strpart( s, i, 1 ) =~ '[A-Za-z0-9_:]' + let i = i - 1 + endwhile + let start = match( s, '[A-Za-z0-9_]\+\(::[A-Z][A-Za-z0-9_]*\)*', i ) + let end = matchend( s, '[A-Za-z0-9_]\+\(::[A-Z][A-Za-z0-9_]*\)*', i ) +" if end > col( '.' ) +" let end = matchend( s, '[A-Za-z0-9_]\+', i ) +" endif + let ident = strpart( s, start, end - start ) + let header = MapIdentHeader(ident) + let include = '#include '.header + + let line = 1 + let incomment = 0 + let appendpos = 0 + let codestart = 0 + let similarpos = 0 + let similarity = 0 + while line <= line( '$' ) + let s = getline( line ) + if incomment == 1 + let end = matchend( s, '\*/' ) + if end == -1 + let line = line + 1 + continue + else + let s = strpart( s, end ) + let incomment = 0 + endif + endif + let s = substitute( s, '//.*', '', '' ) + let s = substitute( s, '/\*\([^*]\|\*\@!/\)*\*/', '', 'g' ) + if s =~ '/\*' + let incomment = 1 + elseif s =~ '^' . include + break + elseif s =~ '^#include' && s !~ '\.moc"' + let appendpos = line + if s =~ '^#include '.header[0:similarity+1] + let similarpos = line + let similarity = similarity + 1 + while s =~ '^#include '.header[0:similarity+1] + let similarity = similarity + 1 + endwhile + if s[9:strlen(s)-2] > header[0:strlen(header)-2] + let similarpos = similarpos - 1 + let similarity = 100 "this include belongs one line higher (assuming the order of includes already is alphabetically) + endif + endif + elseif codestart == 0 && s !~ '^$' + let codestart = line + endif + let line = line + 1 + endwhile + if similarpos > 0 + let appendpos = similarpos + endif + if line == line( '$' ) + 1 + if appendpos == 0 + call append( codestart - 1, include ) + call append( codestart, '' ) + else + call append( appendpos, include ) + endif + endif +endfunction + +function! AddForward() + let s = getline( '.' ) + let i = col( '.' ) - 1 + while i > 0 && strpart( s, i, 1 ) !~ '[A-Za-z0-9_:]' + let i = i - 1 + endwhile + while i > 0 && strpart( s, i, 1 ) =~ '[A-Za-z0-9_:]' + let i = i - 1 + endwhile + let start = match( s, '[A-Za-z0-9_]\+\(::[A-Za-z0-9_]\+\)*', i ) + let end = matchend( s, '[A-Za-z0-9_]\+\(::[A-Za-z0-9_]\+\)*', i ) + if end > col( '.' ) + let end = matchend( s, '[A-Za-z0-9_]\+', i ) + endif + let ident = strpart( s, start, end - start ) + let forward = 'class ' . ident . ';' + + let line = 1 + let incomment = 0 + let appendpos = 0 + let codestart = 0 + while line <= line( '$' ) + let s = getline( line ) + if incomment == 1 + let end = matchend( s, '\*/' ) + if end == -1 + let line = line + 1 + continue + else + let s = strpart( s, end ) + let incomment = 0 + endif + endif + let s = substitute( s, '//.*', '', '' ) + let s = substitute( s, '/\*\([^*]\|\*\@!/\)*\*/', '', 'g' ) + if s =~ '/\*' + let incomment = 1 + elseif s =~ '^' . forward + break + elseif s =~ '^\s*class [A-za-z0-9_]\+;' || (s =~ '^#include' && s !~ '\.moc"') + let appendpos = line + elseif codestart == 0 && s !~ '^$' + let codestart = line + endif + let line = line + 1 + endwhile + if line == line( '$' ) + 1 + if appendpos == 0 + call append( codestart - 1, forward ) + call append( codestart, '' ) + else + call append( appendpos, forward ) + endif + endif +endfunction + +function! RunDiff() + echo 'Diffing....' + read! cvs diff -bB -I \\\#include | egrep -v '(^Index:|^=+$|^RCS file:|^retrieving revision|^diff -u|^[+-]{3})' +endfunction + +function! CreateChangeLogEntry() + let currentBuffer = expand( "%" ) + + if exists( "g:EMAIL" ) + let mail = g:EMAIL + elseif exists( "$EMAIL" ) + let mail = $EMAIL + else + let mail = inputdialog( "Enter Name/Email for Changelog entry: " ) + if mail == "" + echo "Aborted ChangeLog edit..." + return + endif + let g:EMAIL = mail + endif + + if bufname( "ChangeLog" ) != "" && bufwinnr( bufname( "ChangeLog" ) ) != -1 + execute bufwinnr( bufname( "ChangeLog" ) ) . " wincmd w" + else + execute "split ChangeLog" + endif + + let lastEntry = getline( nextnonblank( 1 ) ) + let newEntry = strftime("%Y-%m-%d") . " " . mail + + if lastEntry != newEntry + call append( 0, "" ) + call append( 0, "" ) + call append( 0, newEntry ) + endif + + " like emacs, prepend the current buffer name to the entry. but unlike + " emacs I have no idea how to figure out the current function name :( + " (Simon) + if currentBuffer != "" + let newLine = "\t* " . currentBuffer . ": " + else + let newLine = "\t* " + endif + + call append( 2, newLine ) + + execute "normal 3G$" +endfunction + +function! AddQtSyntax() + if expand( "<amatch>" ) == "cpp" + syn keyword qtKeywords signals slots emit Q_SLOTS Q_SIGNALS + syn keyword qtMacros Q_OBJECT Q_WIDGET Q_PROPERTY Q_ENUMS Q_OVERRIDE Q_CLASSINFO Q_SETS SIGNAL SLOT Q_DECLARE_PUBLIC Q_DECLARE_PRIVATE Q_D Q_Q Q_DISABLE_COPY Q_DECLARE_METATYPE Q_PRIVATE_SLOT Q_FLAGS Q_INTERFACES Q_DECLARE_INTERFACE Q_EXPORT_PLUGIN2 Q_GADGET Q_SCRIPTABLE Q_INVOKABLE METHOD Q_ARG Q_RETURN_ARG + syn keyword qtCast qt_cast qobject_cast qvariant_cast qstyleoption_cast + syn keyword qtTypedef uchar uint ushort ulong Q_INT8 Q_UINT8 Q_INT16 Q_UINT16 Q_INT32 Q_UINT32 Q_LONG Q_ULONG Q_INT64 Q_UINT64 Q_LLONG Q_ULLONG pchar puchar pcchar qint8 quint8 qint16 quint16 qint32 quint32 qint64 quint64 qlonglong qulonglong qreal + syn keyword kdeKeywords k_dcop k_dcop_signals + syn keyword kdeMacros K_DCOP ASYNC PHONON_ABSTRACTBASE PHONON_OBJECT PHONON_HEIR PHONON_ABSTRACTBASE_IMPL PHONON_OBJECT_IMPL PHONON_HEIR_IMPL PHONON_PRIVATECLASS PHONON_PRIVATEABSTRACTCLASS K_DECLARE_PRIVATE K_D + syn keyword cRepeat foreach + syn keyword cRepeat forever + + hi def link qtKeywords Statement + hi def link qtMacros Type + hi def link qtCast Statement + hi def link qtTypedef Type + hi def link kdeKeywords Statement + hi def link kdeMacros Type + endif +endfunction + +function! InsertMethodTracer() + :normal [[kf(yBjokDebug() << ""()" << endl; +endfunction + +function! UpdateMocFiles() + if &syntax == "cpp" + let i = 1 + while i < 80 + let s = getline( i ) + if s =~ '^#include ".*\.moc"' + let s = substitute( s, '.*"\(.*\)\.moc"', '\1.h', '' ) + if stridx( &complete, s ) == -1 + let &complete = &complete . ',k' . s + endif + break + endif + let i = i + 1 + endwhile + endif +endfunction + +autocmd Syntax * call AddQtSyntax() +autocmd CursorHold * call UpdateMocFiles() +autocmd BufNewFile,BufRead * call SetCodingStyle() + +" vim: sw=4 sts=4 et diff --git a/dot_vim/ltags b/dot_vim/ltags new file mode 100644 index 0000000..bec7c56 --- /dev/null +++ b/dot_vim/ltags @@ -0,0 +1,78 @@ +#!/usr/bin/perl +# Author: Dimitri Antoniou <dimitri@risc2.aecom.yu.edu> +# usage: ltags filename +# handles: \label and \cite{ } with one or more arguments +# fails if arguments of cite spread over more than one line +# also searches in files that are \include or \input in the main file + +# get main LaTeX source file from command line: +$mainfile = shift; + +# get names of included files and store them in an array +open MAIN, $mainfile or die "$!" ; +@mainfile=<MAIN>; +@allsrcfiles = map{ /^\\(?:input|include){(.*?)}/ } @mainfile; +unshift @allsrcfiles, $mainfile; + +# loop over all source files +for $srcfile (@allsrcfiles) { + # if \input{fname} append .tex to fname + unless ( $srcfile =~ m/\.tex/ ) { $srcfile = $srcfile . "\.tex" } + open SRC, $srcfile or die "$!" ; + # store contents of source file in array @texfile + @texfile=<SRC>; + + # store lines with \label and \cite (or \citeonline) in arrays + @labelList = grep{ /\\label{/ } @texfile; + @citeList = grep{ /\\(cite|citeonline){/ } @texfile; + + # see if we use an external database; if yes, store its name in $bibfile + ($dbase) = grep{ /^\\bibliography{/ } @texfile; + if ($dbase) { + $dbase =~ m/\\bibliography{(.*?)}/; + $bibfile = $1; + } + + # write \bibitem in tags file + @mrefs=(); + @refs=(); + @multirefs=(); + foreach (@citeList) { + while ( m/\\(?:cite|citeonline){(.*?)}/g ) { + $refs = $1; + # if \cite has more than one argument, split them: + if ($refs =~ /,/) { + @mrefs = split /,/, $refs; + # there might be more than one \cite in a line: + push (@multirefs, @mrefs); + } + else { + @refs = ($refs); + push (@multirefs, @refs); + } + } + # in BibTeX, format is @ARTICLE{Name, }; in source file, \bibitem{Name} + for $ref (@multirefs) { + if ( $dbase ) { + push @unsorttag, "$ref\t$bibfile\t/{$ref,/\n" + } + else { + push @unsorttag, "$ref\t$srcfile\t/bibitem{$ref}/\n" + } + } + } + + # write \label in tag file + foreach (@labelList) { + m/\\label{(.*?)}/; + push @unsorttag, "$1\t$srcfile\t/label{$1}/\n"; + } +} + +# sort tag file; then, eliminate duplicates +@sortedtag = sort @unsorttag; +%seen = (); +@uniqtag = grep { ! $seen{$_} ++ } @sortedtag; + +open(TAGS, "> tags"); +print TAGS @uniqtag; diff --git a/dot_vim/moin1_6.vim b/dot_vim/moin1_6.vim new file mode 100644 index 0000000..f654af6 --- /dev/null +++ b/dot_vim/moin1_6.vim @@ -0,0 +1,83 @@ +" MoinMoin structured text syntax file +" Filename: moin.vim +" Language: MoinMoin structured text +" Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> +" Last Change: Sun, 02 Mar 2008 23:42:31 -0300 + +" remove any old syntax stuff hanging around +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn sync lines=30 + +syn region moinSettings start="\%^@@ Syntax:" end="^[^@]"me=e-1 end="^$" nextgroup=moinPragma +syn region moinPragma start="^#" end="^$" contained +syn region moinItalic start="''" end="''" +syn region moinBold start="'''" end="'''" +syn region moinUnderline start="__" end="__" +syn match moinSub ",,.{1,40},," +syn match moinSup "\^.\{-}\^" +syn region moinCode start="^{{{\z([^#]*\)" keepend end="\z1}}}" +syn match moinCode "{{{[^$]\{-}}}}" +syn region moinCode start="`" end="`" +syn cluster moinTextMarkup contains=moinItalic,moinBold,moinCode,moinUnderline,moinSup,moinSub +syn match moinComment "^##.*$" +syn region moinInlineComment start="/\*" end="\*/" +syn region moinMacro start="<<" end=">>" +syn region moinStrike start="--(" end=")--" +syn region moinHeader start="^\z(=\{1,5}\) " end=" \z1$" oneline +syn match moinRule "^-\{4,}$" +syn match moinSmileys "\(\s\|\_^\)\(%)\|(!)\|(./)\|/!\\\|:(\|:)\|:))\|:-(\|:-)\|:-))\|:-?\|:D\|:\\\|:o\|;)\|;-)\|<!>\|<:(\|>:>\|B)\|B-)\|X-(\|{\*}\|{1}\|{2}\|{3}\|{OK}\|{X}\|{da}\|{de}\|{en}\|{es}\|{fi}\|{fr}\|{it}\|{i}\|{ja}\|{ko}\|{nl}\|{o}\|{pt}\|{sv}\|{us}\|{zh}\||)\||-)\)\(\s\|\_$\)" +syn match moinLinkMoin "\([^!]\@<=\|^\)\<\(/\?\([[:upper:]][[:lower:][:digit:]]\+\)\{2,}\)\+\>" +syn match moinLinkMoinBang "!\ze\(/\?\([[:upper:]][[:lower:][:digit:]]\+\)\{2,}\)\+" +syn region moinLinkExplicit start="\[\[" end="\]\]" +syn region moinLinkEmbedded start="{{[^{]" end="}}" +syn match moinLinkEmail "<\?[[:alnum:]-._+]\+@[[:alnum:]-]\+\.[[:alnum:]-.]\+>\?" +syn match moinLinkUrl "\(http\|https\|ftp\|file\|mailto\|nntp\|news\|telnet\|irc\|ircs\|xmpp\|drawing\):\([^][:space:]<"'}|:,.)?!]\|[]"'}|:,.)?!][^][:space:]<"'}|:,.)?!]\)\+" +syn match moinLinkInter "[A-Z][a-zA-Z]\+:[^[:space:]'\":<]\([^][:space:]<"'}|:,.)?!]\|[]"'}|:,.)?!][^][:space:]<"'}|:,.)?!]\)\+" +syn cluster moinLinks contains=moinLinkMoin,moinLinkExplicit,moinLinkEmbedded,moinLinkEmail,moinLinkUrl,moinLinkInter +syn cluster moinMarkup contains=@moinTextMarkup,@moinLinks,moinMacro,moinStrike,moinSmileys +syn match moinTableOpt "<[^>]*>" contained +syn match moinTableMark "||\(<[^>]*>\)\?" contained contains=moinTableOpt +syn region moinTable start="^\s*||"rs=s end="||$"re=e oneline contains=moinTableMark,@moinMarkup +syn match moinDefinition "^\s\+.\{-}::\ze\(\s.*\)\?$" +syn match moinList "^\s\+\*\s" + +if !exists("did_dic_syntax_inits") + let did_dic_syntax_inits = 1 + hi link moinComment Comment + hi link moinInlineComment Comment + hi def moinBold term=bold cterm=bold gui=bold + hi def moinItalic ctermfg=darkcyan gui=italic + hi link moinUnderline moinItalic + hi link moinSub moinItalic + hi link moinSup moinItalic + hi def moinSettings ctermfg=green guifg=green + hi def moinPragma ctermfg=darkred guifg=darkred + hi link moinMacro Macro + hi def moinStrike ctermfg=darkgray guifg=darkgray + hi link moinHeader Title + hi def moinTableMark ctermfg=yellow guifg=yellow + hi def moinTableOpt ctermfg=darkyellow guifg=darkyellow + hi link moinDefinition moinBold + hi link moinList moinBold + hi link moinRule Title + hi def moinCode ctermfg=cyan guifg=cyan + hi def moinLink ctermfg=red guifg=red + hi link moinLinkExplicit moinLink + hi link moinLinkEmbedded moinLink + hi link moinLinkMoin moinLink + hi link moinLinkMoinBang moinLink + hi link moinLinkEmail moinLink + hi link moinLinkUrl moinLink + hi link moinLinkBUrl moinLinkUrl + hi link moinLinkQUrl moinLinkUrl + hi link moinLinkInter moinLink + hi def moinSmileys ctermfg=yellow guifg=yellow +endif + +let b:current_syntax = "moin" + diff --git a/dot_vim/plugin/SyntaxFolds.vim b/dot_vim/plugin/SyntaxFolds.vim new file mode 100644 index 0000000..27c622c --- /dev/null +++ b/dot_vim/plugin/SyntaxFolds.vim @@ -0,0 +1,323 @@ +" ============================================================================== +" File: syntaxFolds.vim +" Author: Srinath Avadhanula +" ( srinath@fastmail.fm ) +" Last Change: Sun Oct 27 01:00 AM 2002 PST +" Description: Emulation of the syntax folding capability of vim using manual +" folding +" +" This script provides an emulation of the syntax folding of vim using manual +" folding. Just as in syntax folding, the folds are defined by regions. Each +" region is specified by a call to FoldRegions() which accepts 4 parameters: +" +" call FoldRegions(startpat, endpat, startoff, endoff) +" +" startpat: a line matching this pattern defines the beginning of a fold. +" endpat : a line matching this pattern defines the end of a fold. +" startoff: this is the offset from the starting line at which folding will +" actually start +" endoff : like startoff, but gives the offset of the actual fold end from +" the line satisfying endpat. +" startoff and endoff are necessary when the folding region does +" not have a specific end pattern corresponding to a start +" pattern. for example in latex, +" \begin{section} +" defines the beginning of a section, but its not necessary to +" have a corresponding +" \end{section} +" the section is assumed to end 1 line _before_ another section +" starts. +" startskip: a pattern which defines the beginning of a "skipped" region. +" +" For example, suppose we define a \itemize fold as follows: +" startpat = '^\s*\\item', +" endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +" startoff = 0, +" endoff = -1 +" +" This defines a fold which starts with a line beginning with an +" \item and ending one line before a line beginning with an +" \item or \end{enumerate} etc. +" +" Then, as long as \item's are not nested things are fine. +" However, once items begin to nest, the fold started by one +" \item can end because of an \item in an \itemize +" environment within this \item. i.e, the following can happen: +" +" \begin{itemize} +" \item Some text <------- fold will start here +" This item will contain a nested item +" \begin{itemize} <----- fold will end here because next line contains \item... +" \item Hello +" \end{itemize} <----- ... instead of here. +" \item Next item of the parent itemize +" \end{itemize} +" +" Therefore, in order to completely define a folding item which +" allows nesting, we need to also define a "skip" pattern. +" startskip and end skip do that. +" Leave '' when there is no nesting. +" endskip: the pattern which defines the end of the "skip" pattern for +" nested folds. +" +" Example: +" 1. A syntax fold region for a latex section is +" startpat = "\\section{" +" endpat = "\\section{" +" startoff = 0 +" endoff = -1 +" startskip = '' +" endskip = '' +" Note that the start and end patterns are thus the same and endoff has a +" negative value to capture the effect of a section ending one line before +" the next starts. +" 2. A syntax fold region for the \itemize environment is: +" startpat = '^\s*\\item', +" endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +" startoff = 0, +" endoff = -1, +" startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', +" endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' +" Note the use of startskip and endskip to allow nesting. +" +" +" Each time a call is made to FoldRegions(), all the regions (which might be +" disjoint, but not nested) are folded up. +" Nested folds can be created by successive calls to FoldRegions(). The first +" call defines the region which is deepest in the folding. See MakeTexFolds() +" for an idea of how this works for latex files. + +" Function: AddSyntaxFoldItem (start, end, startoff, endoff [, skipStart, skipEnd]) {{{ +function! AddSyntaxFoldItem(start, end, startoff, endoff, ...) + if a:0 > 0 + let skipStart = a:1 + let skipEnd = a:2 + else + let skipStart = '' + let skipEnd = '' + end + if !exists('b:numFoldItems') + let b:numFoldItems = 0 + end + let b:numFoldItems = b:numFoldItems + 1 + + exe 'let b:startPat_'.b:numFoldItems.' = a:start' + exe 'let b:endPat_'.b:numFoldItems.' = a:end' + exe 'let b:startOff_'.b:numFoldItems.' = a:startoff' + exe 'let b:endOff_'.b:numFoldItems.' = a:endoff' + exe 'let b:skipStartPat_'.b:numFoldItems.' = skipStart' + exe 'let b:skipEndPat_'.b:numFoldItems.' = skipEnd' +endfunction + + +" }}} +" Function: MakeSyntaxFolds (force) {{{ +" Description: This function calls FoldRegions() several times with the +" parameters specifying various regions resulting in a nested fold +" structure for the file. +function! MakeSyntaxFolds(force, ...) + if exists('b:doneFolding') && a:force == 0 + return + end + + let skipEndPattern = '' + if a:0 > 0 + let line1 = a:1 + let skipEndPattern = '\|'.a:2 + else + let line1 = 1 + let r = line('.') + let c = virtcol('.') + + setlocal fdm=manual + normal! zE + end + if !exists('b:numFoldItems') + b:numFoldItems = 1000000 + end + + let i = 1 + + let maxline = line('.') + + while exists('b:startPat_'.i) && i <= b:numFoldItems + exe 'let startPat = b:startPat_'.i + exe 'let endPat = b:endPat_'.i + exe 'let startOff = b:startOff_'.i + exe 'let endOff = b:endOff_'.i + + let skipStart = '' + let skipEnd = '' + if exists('b:skipStartPat_'.i) + exe 'let skipStart = b:skipStartPat_'.i + exe 'let skipEnd = b:skipEndPat_'.i + end + exe line1 + let lastLoc = line1 + + if skipStart != '' + call InitStack('BeginSkipArray') + call FoldRegionsWithSkip(startPat, endPat, startOff, endOff, skipStart, skipEnd, 1, line('$')) + " call PrintError('done folding ['.startPat.']') + else + call FoldRegionsWithNoSkip(startPat, endPat, startOff, endOff, 1, line('$'), '') + end + + let i = i + 1 + endwhile + + exe maxline + + if a:0 == 0 + exe r + exe "normal! ".c."|" + if foldlevel(r) > 1 + exe "normal! ".(foldlevel(r) - 1)."zo" + end + let b:doneFolding = 0 + end +endfunction + + +" }}} +" FoldRegionsWithSkip: folding things such as \item's which can be nested. {{{ +function! FoldRegionsWithSkip(startpat, endpat, startoff, endoff, startskip, endskip, line1, line2) + exe a:line1 + " count the regions which have been skipped as we go along. do not want to + " create a fold which with a beginning or end line in one of the skipped + " regions. + let skippedRegions = '' + + " start searching for either the starting pattern or the end pattern. + while search(a:startskip.'\|'.a:endskip, 'W') + + if getline('.') =~ a:endskip + + let lastBegin = Pop('BeginSkipArray') + " call PrintError('popping '.lastBegin.' from stack and folding till '.line('.')) + call FoldRegionsWithNoSkip(a:startpat, a:endpat, a:startoff, a:endoff, lastBegin, line('.'), skippedRegions) + let skippedRegions = skippedRegions.lastBegin.','.line('.').'|' + + + " if this is the beginning of a skip region, then, push this line as + " the beginning of a skipped region. + elseif getline('.') =~ a:startskip + + " call PrintError('pushing '.line('.').' ['.getline('.').'] into stack') + call Push('BeginSkipArray', line('.')) + + end + endwhile + + " call PrintError('with skip starting at '.a:line1.' returning at line# '.line('.')) +endfunction + +" }}} +" FoldRegionsWithNoSkip: folding things such as \sections which do not nest. {{{ +function! FoldRegionsWithNoSkip(startpat, endpat, startoff, endoff, line1, line2, skippedRegions) + exe a:line1 + + " call PrintError('line1 = '.a:line1.', searching from '.line('.').'... for ['.a:startpat.'') + let lineBegin = s:MySearch(a:startpat, 'in') + " call PrintError('... and finding it at '.lineBegin) + + while lineBegin <= a:line2 + if IsInSkippedRegion(lineBegin, a:skippedRegions) + let lineBegin = s:MySearch(a:startpat, 'out') + " call PrintError(lineBegin.' is being skipped') + continue + end + let lineEnd = s:MySearch(a:endpat, 'out') + while IsInSkippedRegion(lineEnd, a:skippedRegions) && lineEnd <= a:line2 + let lineEnd = s:MySearch(a:endpat, 'out') + endwhile + if lineEnd > a:line2 + exe (lineBegin + a:startoff).','.a:line2.' fold' + break + else + " call PrintError ('for ['.a:startpat.'] '.(lineBegin + a:startoff).','.(lineEnd + a:endoff).' fold') + exe (lineBegin + a:startoff).','.(lineEnd + a:endoff).' fold' + end + + " call PrintError('line1 = '.a:line1.', searching from '.line('.').'... for ['.a:startpat.'') + let lineBegin = s:MySearch(a:startpat, 'in') + " call PrintError('... and finding it at '.lineBegin) + endwhile + + exe a:line2 + return +endfunction + +" }}} +" InitStack: initialize a stack {{{ +function! InitStack(name) + exe 'let s:'.a:name.'_numElems = 0' +endfunction +" }}} +" Push: push element into stack {{{ +function! Push(name, elem) + exe 'let numElems = s:'.a:name.'_numElems' + let numElems = numElems + 1 + exe 'let s:'.a:name.'_Element_'.numElems.' = a:elem' + exe 'let s:'.a:name.'_numElems = numElems' +endfunction +" }}} +" Pop: pops element off stack {{{ +function! Pop(name) + exe 'let numElems = s:'.a:name.'_numElems' + if numElems == 0 + return '' + else + exe 'let ret = s:'.a:name.'_Element_'.numElems + let numElems = numElems - 1 + exe 'let s:'.a:name.'_numElems = numElems' + return ret + end +endfunction +" }}} +" MySearch: just like search(), but returns large number on failure {{{ +function! <SID>MySearch(pat, opt) + if a:opt == 'in' + if getline('.') =~ a:pat + let ret = line('.') + else + let ret = search(a:pat, 'W') + end + else + normal! $ + let ret = search(a:pat, 'W') + end + + if ret == 0 + let ret = line('$') + 1 + end + return ret +endfunction +" }}} +" Function: IsInSkippedRegion (lnum, regions) {{{ +" Description: finds whether a given line number is within one of the regions +" skipped. +function! IsInSkippedRegion(lnum, regions) + let i = 1 + let subset = s:Strntok(a:regions, '|', i) + while subset != '' + let n1 = s:Strntok(subset, ',', 1) + let n2 = s:Strntok(subset, ',', 2) + if a:lnum >= n1 && a:lnum <= n2 + return 1 + end + + let subset = s:Strntok(a:regions, '|', i) + let i = i + 1 + endwhile + + return 0 +endfunction " }}} +" Function: Strntok (string, tok, n) {{{ +" extract the n^th token from s seperated by tok. +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun " }}} + +" vim600:fdm=marker diff --git a/dot_vim/plugin/c.vim b/dot_vim/plugin/c.vim new file mode 100644 index 0000000..bb9390f --- /dev/null +++ b/dot_vim/plugin/c.vim @@ -0,0 +1,2678 @@ +"############################################################################################### +" +" Filename: c.vim +" +" Description: C/C++-IDE. Write programs by inserting complete statements, +" comments, idioms, code snippets, templates and comments. +" Compile, link and run one-file-programs without a makefile. +" See also help file csupport.txt . +" +" GVIM Version: 7.0+ +" +" Configuration: There are some personal details which should be configured +" (see the files README.csupport and csupport.txt). +" +" Author: Dr.-Ing. Fritz Mehner, FH Südwestfalen, 58644 Iserlohn, Germany +" Email: mehner@fh-swf.de +" +" Version: see variable g:C_Version below +" Created: 04.11.2000 +" License: Copyright (c) 2000-2007, Fritz Mehner +" This program is free software; you can redistribute it and/or +" modify it under the terms of the GNU General Public License as +" published by the Free Software Foundation, version 2 of the +" License. +" This program is distributed in the hope that it will be +" useful, but WITHOUT ANY WARRANTY; without even the implied +" warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +" PURPOSE. +" See the GNU General Public License version 2 for more details. +" Revision: $Id: c.vim,v 1.35 2007/11/21 09:14:16 mehner Exp $ +" +"------------------------------------------------------------------------------ +" +if v:version < 700 + echohl WarningMsg | echo 'The plugin c-support.vim needs Vim version >= 7 .'| echohl None + finish +endif +" +" Prevent duplicate loading: +" +if exists("g:C_Version") || &cp + finish +endif +let g:C_Version= "5.0.5" " version number of this script; do not change +" +"############################################################################################### +" +" Global variables (with default values) which can be overridden. +" +" Platform specific items: {{{1 +" - root directory +" - characters that must be escaped for filenames +" +let s:MSWIN = has("win16") || has("win32") || has("win64") || + \ has("win95") || has("win32unix") +" +if s:MSWIN + " + let s:escfilename = '' + let s:plugin_dir = $VIM.'\vimfiles\' + let s:C_CodeSnippets = s:plugin_dir.'c-support/codesnippets/' + let s:C_IndentErrorLog = $HOME.'.indent.errorlog' + let s:installation = 'system' + " + let s:C_Display = '' + " +else + " + let s:escfilename = ' \%#[]' + let s:installation = 'local' + " + " user / system wide installation (Linux/Unix) + " + if match( expand("<sfile>"), $VIM ) >= 0 + " system wide installation + let s:plugin_dir = $VIM.'/vimfiles/' + let s:installation = 'system' + else + " user installation assumed + let s:plugin_dir = $HOME.'/.vim/' + endif + " + let s:C_CodeSnippets = $HOME.'/.vim/c-support/codesnippets/' + let s:C_IndentErrorLog = $HOME.'/.indent.errorlog' + " + let s:C_Display = system("echo -n $DISPLAY") + " +endif +" Use of dictionaries {{{1 +" Key word completion is enabled by the filetype plugin 'c.vim' +" g:C_Dictionary_File must be global +" +if !exists("g:C_Dictionary_File") + let g:C_Dictionary_File = s:plugin_dir.'c-support/wordlists/c-c++-keywords.list,'. + \ s:plugin_dir.'c-support/wordlists/k+r.list,'. + \ s:plugin_dir.'c-support/wordlists/stl_index.list' +endif +" +" Modul global variables (with default values) which can be overridden. {{{1 +" +if s:MSWIN + let s:C_CCompiler = 'gcc.exe' " the C compiler + let s:C_CplusCompiler = 'g++.exe' " the C++ compiler + let s:C_ExeExtension = '.exe' " file extension for executables (leading point required) + let s:C_ObjExtension = '.obj' " file extension for objects (leading point required) +else + let s:C_CCompiler = 'gcc' " the C compiler + let s:C_CplusCompiler = 'g++' " the C++ compiler + let s:C_ExeExtension = '' " file extension for executables (leading point required) + let s:C_ObjExtension = '.o' " file extension for objects (leading point required) +endif +" +let s:C_CExtension = 'c' " C file extension; everything else is C++ +let s:C_CFlags = '-Wall -g -O0 -c' " compiler flags: compile, don't optimize +let s:C_CodeCheckExeName = 'check' +let s:C_CodeCheckOptions = '-K13' +let s:C_LFlags = '-Wall -g -O0' " compiler flags: link , don't optimize +let s:C_Libs = '-lm' " libraries to use +let s:C_LineEndCommColDefault = 49 +let s:C_LoadMenus = 'yes' +let s:C_MenuHeader = 'yes' +let s:C_OutputGvim = 'vim' +let s:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" +let s:C_Root = '&C\/C\+\+.' " the name of the root menu of this plugin +let s:C_TypeOfH = 'cpp' +let s:C_Wrapper = s:plugin_dir.'c-support/scripts/wrapper.sh' +let s:C_XtermDefaults = '-fa courier -fs 12 -geometry 80x24' +" +let s:C_GlobalTemplateFile = s:plugin_dir.'c-support/templates/Templates' +let s:C_GlobalTemplateDir = fnamemodify( s:C_GlobalTemplateFile, ":p:h" ).'/' +let s:C_LocalTemplateFile = $HOME.'/.vim/c-support/templates/Templates' +let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/' +let s:C_TemplateOverwrittenMsg= 'yes' +" +let s:C_FormatDate = '%x' +let s:C_FormatTime = '%X' +let s:C_FormatYear = '%Y' +" +"------------------------------------------------------------------------------ +" +" Look for global variables (if any), to override the defaults. +" +function! C_CheckGlobal ( name ) + if exists('g:'.a:name) + exe 'let s:'.a:name.' = g:'.a:name + endif +endfunction " ---------- end of function C_CheckGlobal ---------- +" +call C_CheckGlobal('C_CCompiler ') +call C_CheckGlobal('C_CExtension ') +call C_CheckGlobal('C_CFlags ') +call C_CheckGlobal('C_CodeCheckExeName ') +call C_CheckGlobal('C_CodeCheckOptions ') +call C_CheckGlobal('C_CodeSnippets ') +call C_CheckGlobal('C_CplusCompiler ') +call C_CheckGlobal('C_ExeExtension ') +call C_CheckGlobal('C_FormatDate ') +call C_CheckGlobal('C_FormatTime ') +call C_CheckGlobal('C_FormatYear ') +call C_CheckGlobal('C_GlobalTemplateFile ') +call C_CheckGlobal('C_IndentErrorLog ') +call C_CheckGlobal('C_LFlags ') +call C_CheckGlobal('C_Libs ') +call C_CheckGlobal('C_LineEndCommColDefault ') +call C_CheckGlobal('C_LoadMenus ') +call C_CheckGlobal('C_LocalTemplateFile ') +call C_CheckGlobal('C_MenuHeader ') +call C_CheckGlobal('C_ObjExtension ') +call C_CheckGlobal('C_OutputGvim ') +call C_CheckGlobal('C_Printheader ') +call C_CheckGlobal('C_Root ') +call C_CheckGlobal('C_TemplateOverwrittenMsg ') +call C_CheckGlobal('C_TypeOfH ') +call C_CheckGlobal('C_XtermDefaults ') +" +"----- some variables for internal use only ----------------------------------- +" +" +" set default geometry if not specified +" +if match( s:C_XtermDefaults, "-geometry\\s\\+\\d\\+x\\d\\+" ) < 0 + let s:C_XtermDefaults = s:C_XtermDefaults." -geometry 80x24" +endif +" +" escape the printheader +" +let s:C_Printheader = escape( s:C_Printheader, ' %' ) +" +let s:C_HlMessage = "" +" +" characters that must be escaped for filenames +" +let s:C_If0_Counter = 0 +let s:C_If0_Txt = "If0Label_" +" +let s:C_SplintIsExecutable = 0 +if executable( "splint" ) + let s:C_SplintIsExecutable = 1 +endif +" +let s:C_CodeCheckIsExecutable = 0 +if executable( s:C_CodeCheckExeName ) + let s:C_CodeCheckIsExecutable = 1 +endif +" +"------------------------------------------------------------------------------ +" Control variables (not user configurable) +"------------------------------------------------------------------------------ +let s:Attribute = { 'below':'', 'above':'', 'start':'', 'append':'', 'insert':'' } +let s:C_Attribute = {} +let s:C_ExpansionLimit = 10 +let s:C_FileVisited = [] +" +let s:C_MacroNameRegex = '\([a-zA-Z][a-zA-Z0-9_]*\)' +let s:C_MacroLineRegex = '^\s*|'.s:C_MacroNameRegex.'|\s*=\s*\(.*\)' +let s:C_ExpansionRegex = '|?'.s:C_MacroNameRegex.'\(:\a\)\?|' +let s:C_NonExpansionRegex = '|'.s:C_MacroNameRegex.'\(:\a\)\?|' +" +let s:C_TemplateNameDelimiter = '-+_,\. ' +let s:C_TemplateLineRegex = '^==\s*\([a-zA-Z][0-9a-zA-Z'.s:C_TemplateNameDelimiter +let s:C_TemplateLineRegex .= ']\+\)\s*==\s*\([a-z]\+\s*==\)\?' +" +let s:C_ExpansionCounter = {} +let s:C_Template = {} +let s:C_Macro = {'|AUTHOR|' : 'first name surname', + \ '|AUTHORREF|' : '', + \ '|EMAIL|' : '', + \ '|COMPANY|' : '', + \ '|PROJECT|' : '', + \ '|COPYRIGHTHOLDER|': '' + \ } +let s:C_MacroFlag = { ':l' : 'lowercase' , + \ ':u' : 'uppercase' , + \ ':c' : 'capitalize' , + \ ':L' : 'legalize name' , + \ } + +"------------------------------------------------------------------------------ +" C : C_InitMenus {{{1 +" Initialization of C support menus +"------------------------------------------------------------------------------ +" +function! C_InitMenus () + " + "=============================================================================================== + "----- Menu : C main menu entry ------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_Root != "" + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'-Sep00- :' + endif + endif + " + "=============================================================================================== + "----- Menu : C-Comments -------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'&Comments.&Comments<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.-Sep00- :' + endif + exe "amenu <silent> ".s:C_Root.'&Comments.end-of-&line\ comment <Esc><Esc><Esc>:call C_LineEndComment( )<CR>' + exe "vmenu <silent> ".s:C_Root.'&Comments.end-of-&line\ comment <Esc><Esc><Esc>:call C_MultiLineEndComments( )<CR>' + + exe "amenu <silent> ".s:C_Root.'&Comments.ad&just\ end-of-line\ com\. <Esc><Esc>:call C_AdjustLineEndComm("a")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Comments.ad&just\ end-of-line\ com\. <Esc><Esc>:call C_AdjustLineEndComm("v")<CR>' + + exe "amenu <silent> ".s:C_Root.'&Comments.&set\ end-of-line\ com\.\ col\. <Esc><Esc>:call C_GetLineEndCommCol()<CR>' + + exe "amenu ".s:C_Root.'&Comments.-SEP10- :' + exe "amenu <silent> ".s:C_Root.'&Comments.code\ ->\ comment\ \/&*\ *\/ <Esc><Esc>:call C_CodeComment("a","yes")<CR><Esc>:nohlsearch<CR>j' + exe "vmenu <silent> ".s:C_Root.'&Comments.code\ ->\ comment\ \/&*\ *\/ <Esc><Esc>:call C_CodeComment("v","yes")<CR><Esc>:nohlsearch<CR>j' + exe "amenu <silent> ".s:C_Root.'&Comments.code\ ->\ comment\ &\/\/ <Esc><Esc>:call C_CodeComment("a","no")<CR><Esc>:nohlsearch<CR>j' + exe "vmenu <silent> ".s:C_Root.'&Comments.code\ ->\ comment\ &\/\/ <Esc><Esc>:call C_CodeComment("v","no")<CR><Esc>:nohlsearch<CR>j' + exe "amenu <silent> ".s:C_Root.'&Comments.c&omment\ ->\ code <Esc><Esc>:call C_CommentCode("a")<CR><Esc>:nohlsearch<CR>' + exe "vmenu <silent> ".s:C_Root.'&Comments.c&omment\ ->\ code <Esc><Esc>:call C_CommentCode("v")<CR><Esc>:nohlsearch<CR>' + + exe "amenu ".s:C_Root.'&Comments.-SEP0- :' + exe "amenu <silent> ".s:C_Root.'&Comments.&frame\ comment <Esc><Esc>:call C_InsertTemplate("comment.frame")<CR>' + exe "amenu <silent> ".s:C_Root.'&Comments.f&unction\ description <Esc><Esc>:call C_InsertTemplate("comment.function")<CR>' + exe "amenu ".s:C_Root.'&Comments.-SEP1- :' + exe "amenu <silent> ".s:C_Root.'&Comments.&method\ description <Esc><Esc>:call C_InsertTemplate("comment.method")<CR>' + exe "amenu <silent> ".s:C_Root.'&Comments.cl&ass\ description <Esc><Esc>:call C_InsertTemplate("comment.class")<CR>' + exe "amenu ".s:C_Root.'&Comments.-SEP2- :' + exe "amenu <silent> ".s:C_Root.'&Comments.file\ description <Esc><Esc>:call C_InsertTemplate("comment.file-description")<CR>' + exe "amenu ".s:C_Root.'&Comments.-SEP3- :' + " + "----- Submenu : C-Comments : file sections ------------------------------------------------------------- + " + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.file\ sections<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.-Sep0- :' + " + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.&Header\ File\ Includes <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-header-includes")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Macros <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-macros")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Type\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-typedefs")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Data\ Types <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-data-types")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Variables <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-class-defs")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Prototypes <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-local-variables")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.&Exp\.\ Function\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-prototypes")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.&Local\ Function\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-function-defs-exported")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.-SEP6- :' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.Local\ &Class\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-function-defs-local")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.E&xp\.\ Class\ Impl\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-class-implementations-exported")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.L&ocal\ Class\ Impl\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-cpp-class-implementations-local")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.-SEP7- :' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.&All\ sections,\ C ' + \'<Esc><Esc>:call C_Comment_C_SectionAll("c")<CR>' + exe "amenu ".s:C_Root.'&Comments.&C\/C\+\+-file\ sections.All\ §ions,\ C++ ' + \'<Esc><Esc>:call C_Comment_C_SectionAll("cpp")<CR>' + " + " + "----- Submenu : H-Comments : file sections ------------------------------------------------------------- + " + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.H-file\ sections<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.-Sep0- :' + "' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.&Header\ File\ Includes <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-header-includes")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.Exported\ &Macros <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-macros")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.Exported\ &Type\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-exported-typedefs")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.Exported\ &Data\ Types <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-exported-data-types")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.Exported\ &Variables <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-exported-class-defs")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.Exported\ &Funct\.\ Decl\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-exported-variables")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.-SEP4- :' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.E&xported\ Class\ Def\. <Esc><Esc>:call C_InsertTemplate("comment.file-section-hpp-exported-function-declarations")<CR>' + + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.-SEP5- :' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.&All\ sections,\ C ' + \'<Esc><Esc>:call C_Comment_H_SectionAll("c")<CR>' + exe "amenu ".s:C_Root.'&Comments.&H-file\ sections.All\ §ions,\ C++ ' + \'<Esc><Esc>:call C_Comment_H_SectionAll("cpp")<CR>' + " + exe "amenu ".s:C_Root.'&Comments.-SEP8- :' + " + "----- Submenu : C-Comments : keyword comments ---------------------------------------------------------- + " + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..keyw\.+comm\.<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..-Sep0- :' +" + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:&BUG\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-bug")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:&COMPILER\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-compiler")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:&TODO\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-todo")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:T&RICKY\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-tricky")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:&WARNING\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-warning")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:W&ORKAROUND\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-workaround")<CR>' + exe "amenu ".s:C_Root.'&Comments.&KEYWORD+comm\..\:&new\ keyword\: <Esc><Esc>$<Esc>:call C_InsertTemplate("comment.keyword-keyword")<CR>' + " + "----- Submenu : C-Comments : special comments ---------------------------------------------------------- + " + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..special\ comm\.<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..-Sep0- :' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..&EMPTY <Esc><Esc>$<Esc>:call C_CommentSpecial("EMPTY") <CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..&FALL\ THROUGH <Esc><Esc>$<Esc>:call C_CommentSpecial("FALL THROUGH") <CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..&IMPL\.\ TYPE\ CONV <Esc><Esc>$<Esc>:call C_CommentSpecial("IMPLICIT TYPE CONVERSION") <CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..&NO\ RETURN <Esc><Esc>$<Esc>:call C_CommentSpecial("NO RETURN") <CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..NOT\ &REACHED <Esc><Esc>$<Esc>:call C_CommentSpecial("NOT REACHED") <CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..&TO\ BE\ IMPL\. <Esc><Esc>$<Esc>:call C_CommentSpecial("REMAINS TO BE IMPLEMENTED")<CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..-SEP81- :' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..constant\ type\ is\ &long\ (L) <Esc><Esc>$<Esc>:call C_CommentSpecial("constant type is long")<CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..constant\ type\ is\ &unsigned\ (U) <Esc><Esc>$<Esc>:call C_CommentSpecial("constant type is unsigned")<CR>kgJA' + exe "amenu ".s:C_Root.'&Comments.&special\ comm\..constant\ type\ is\ unsigned\ l&ong\ (UL) <Esc><Esc>$<Esc>:call C_CommentSpecial("constant type is unsigned long")<CR>kgJA' + + " + "----- Submenu : C-Comments : Tags ---------------------------------------------------------- + " + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).tags\ (plugin)<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).-Sep0- :' + " + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&AUTHOR <Esc><Esc>:call C_InsertMacroValue("AUTHOR")<CR>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).AUTHOR&REF <Esc><Esc>:call C_InsertMacroValue("AUTHORREF")<CR>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&COMPANY <Esc><Esc>:call C_InsertMacroValue("COMPANY")<CR>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).C&OPYRIGHTHOLDER <Esc><Esc>:call C_InsertMacroValue("COPYRIGHTHOLDER")<CR>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&EMAIL <Esc><Esc>:call C_InsertMacroValue("EMAIL")<CR>' + exe "amenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&PROJECT <Esc><Esc>:call C_InsertMacroValue("PROJECT")<CR>' + + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&AUTHOR <Esc><Esc>:call C_InsertMacroValue("AUTHOR")<CR>a' + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).AUTHOR&REF <Esc><Esc>:call C_InsertMacroValue("AUTHORREF")<CR>a' + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&COMPANY <Esc><Esc>:call C_InsertMacroValue("COMPANY")<CR>a' + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).C&OPYRIGHTHOLDER <Esc><Esc>:call C_InsertMacroValue("COPYRIGHTHOLDER")<CR>a' + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&EMAIL <Esc><Esc>:call C_InsertMacroValue("EMAIL")<CR>a' + exe "imenu ".s:C_Root.'&Comments.ta&gs\ (plugin).&PROJECT <Esc><Esc>:call C_InsertMacroValue("PROJECT")<CR>a' + " + " + exe "amenu ".s:C_Root.'&Comments.-SEP9- :' + " + exe " menu ".s:C_Root.'&Comments.&date a<C-R>=C_InsertDateAndTime("d")<CR>' + exe "imenu ".s:C_Root.'&Comments.&date <C-R>=C_InsertDateAndTime("d")<CR>' + exe " menu ".s:C_Root.'&Comments.date\ &time a<C-R>=C_InsertDateAndTime("dt")<CR>' + exe "imenu ".s:C_Root.'&Comments.date\ &time <C-R>=C_InsertDateAndTime("dt")<CR>' + + exe "amenu ".s:C_Root.'&Comments.-SEP12- :' + exe "amenu <silent> ".s:C_Root.'&Comments.\/\/\ xxx\ \ \ \ \ &->\ \ \/*\ xxx\ *\/ <Esc><Esc>:call C_CommentCppToC()<CR>' + exe "vmenu <silent> ".s:C_Root.'&Comments.\/\/\ xxx\ \ \ \ \ &->\ \ \/*\ xxx\ *\/ <Esc><Esc>:'."'<,'>".'call C_CommentCppToC()<CR>' + exe "amenu <silent> ".s:C_Root.'&Comments.\/*\ xxx\ *\/\ \ -&>\ \ \/\/\ xxx <Esc><Esc>:call C_CommentCToCpp()<CR>' + exe "vmenu <silent> ".s:C_Root.'&Comments.\/*\ xxx\ *\/\ \ -&>\ \ \/\/\ xxx <Esc><Esc>:'."'<,'>".'call C_CommentCToCpp()<CR>' + " + "=============================================================================================== + "----- Menu : C-Statements------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'&Statements.&Statements<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Statements.-Sep00- :' + endif + " + exe "amenu <silent>".s:C_Root.'&Statements.&do\ \{\ \}\ while <Esc><Esc>:call C_InsertTemplate("statements.do-while")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.&do\ \{\ \}\ while <Esc><Esc>:call C_InsertTemplate("statements.do-while", "v")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.f&or <Esc><Esc>:call C_InsertTemplate("statements.for")<CR>' + " + exe "anoremenu <silent>".s:C_Root.'&Statements.fo&r\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.for-block")<CR>' + exe "vnoremenu <silent>".s:C_Root.'&Statements.fo&r\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.for-block", "v")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.&if <Esc><Esc>:call C_InsertTemplate("statements.if")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.i&f\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.if-block")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.i&f\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.if-block", "v")<CR>' + + exe "amenu <silent>".s:C_Root.'&Statements.if\ &else <Esc><Esc>:call C_InsertTemplate("statements.if-else")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.if\ &else <Esc><Esc>:call C_InsertTemplate("statements.if-else", "v")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.if\ \{\ \}\ e&lse\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.if-block-else")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.if\ \{\ \}\ e&lse\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.if-block-else", "v")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.&while <Esc><Esc>:call C_InsertTemplate("statements.while")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.w&hile\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.while-block")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.w&hile\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.while-block", "v")<CR>' + " + exe "amenu <silent>".s:C_Root.'&Statements.&switch\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.switch")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.&switch\ \{\ \} <Esc><Esc>:call C_InsertTemplate("statements.switch", "v")<CR>' + " + exe "amenu ".s:C_Root.'&Statements.&case\ \.\.\.\ break <<Esc><Esc>:call C_InsertTemplate("statements.case")<CR>' + " + " + exe "amenu <silent>".s:C_Root.'&Statements.&\{\ \} <Esc><Esc>:call C_InsertTemplate("statements.block")<CR>' + exe "vmenu <silent>".s:C_Root.'&Statements.&\{\ \} <Esc><Esc>:call C_InsertTemplate("statements.block", "v")<CR>' + " + " + "=============================================================================================== + "----- Menu : C-Idioms ---------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'&Idioms.&Idioms<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Idioms.-Sep00- :' + endif + exe "amenu <silent> ".s:C_Root.'&Idioms.&function <Esc><Esc>:call C_InsertTemplate("idioms.function")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.&function <Esc><Esc>:call C_InsertTemplate("idioms.function", "v")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.s&tatic\ function <Esc><Esc>:call C_InsertTemplate("idioms.function-static")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.s&tatic\ function <Esc><Esc>:call C_InsertTemplate("idioms.function-static", "v")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.&main <Esc><Esc>:call C_InsertTemplate("idioms.main")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.&main <Esc><Esc>:call C_InsertTemplate("idioms.main", "v")<CR>' + + exe "amenu ".s:C_Root.'&Idioms.-SEP1- :' + exe "amenu ".s:C_Root.'&Idioms.for(x=&0;\ x<n;\ x\+=1) <Esc><Esc>:call C_CodeFor("up" , "a")<CR>a' + exe "amenu ".s:C_Root.'&Idioms.for(x=&n-1;\ x>=0;\ x\-=1) <Esc><Esc>:call C_CodeFor("down", "a")<CR>a' + exe "vmenu ".s:C_Root.'&Idioms.for(x=&0;\ x<n;\ x\+=1) <Esc><Esc>:call C_CodeFor("up" , "v")<CR>' + exe "vmenu ".s:C_Root.'&Idioms.for(x=&n-1;\ x>=0;\ x\-=1) <Esc><Esc>:call C_CodeFor("down", "v")<CR>' + + exe "amenu ".s:C_Root.'&Idioms.-SEP2- :' + exe "amenu <silent> ".s:C_Root.'&Idioms.&enum\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.enum")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.&struct\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.struct")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.&union\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.union")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.&enum\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.enum" , "v")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.&struct\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.struct", "v")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Idioms.&union\+typedef <Esc><Esc>:call C_InsertTemplate("idioms.union" , "v")<CR>' + exe "amenu ".s:C_Root.'&Idioms.-SEP3- :' + " + exe " noremenu ".s:C_Root.'&Idioms.&printf <Esc><Esc>oprintf("\n");<Esc>2F"a' + exe "inoremenu ".s:C_Root.'&Idioms.&printf printf("\n");<Esc>2F"a' + + exe " noremenu ".s:C_Root.'&Idioms.s&canf <Esc><Esc>oscanf("", & );<Esc>F"i' + exe "inoremenu ".s:C_Root.'&Idioms.s&canf scanf("", & );<Esc>F"i' + " + exe "amenu ".s:C_Root.'&Idioms.-SEP4- :' + exe "amenu <silent> ".s:C_Root.'&Idioms.p=ca&lloc\(n,sizeof(type)\) <Esc><Esc>:call C_InsertTemplate("idioms.calloc")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.p=m&alloc\(sizeof(type)\) <Esc><Esc>:call C_InsertTemplate("idioms.malloc")<CR>' + " + exe "anoremenu <silent> ".s:C_Root.'&Idioms.si&zeof(\ \) isizeof()<Left>' + exe "inoremenu <silent> ".s:C_Root.'&Idioms.si&zeof(\ \) sizeof()<Left>' + exe "vnoremenu <silent> ".s:C_Root.'&Idioms.si&zeof(\ \) ssizeof()<Esc>P' + " + exe "anoremenu <silent> ".s:C_Root.'&Idioms.asse&rt(\ \) oassert();<Left><Left>' + exe "vnoremenu <silent> ".s:C_Root.'&Idioms.asse&rt(\ \) sassert();<Esc>F(p' + exe "amenu ".s:C_Root.'&Idioms.-SEP5- :' + exe "amenu <silent> ".s:C_Root.'&Idioms.open\ &input\ file <Esc><Esc>:call C_InsertTemplate("idioms.open-input-file")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.open\ &output\ file <Esc><Esc>:call C_InsertTemplate("idioms.open-output-file")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.fscanf <Esc><Esc>:call C_InsertTemplate("idioms.fscanf")<CR>' + exe "amenu <silent> ".s:C_Root.'&Idioms.fprintf <Esc><Esc>:call C_InsertTemplate("idioms.fprintf")<CR>' + " + "=============================================================================================== + "----- Menu : C-Preprocessor ---------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'&Preprocessor.&Preprocessor<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Preprocessor.-Sep00- :' + endif + " + "----- Submenu : C-Idioms: standard library ------------------------------------------------------- + "' + exe "amenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..Std\.Lib\.<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..-Sep0- :' + " + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&assert\.h <Esc><Esc>o#include<Tab><assert.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&ctype\.h <Esc><Esc>o#include<Tab><ctype.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&errno\.h <Esc><Esc>o#include<Tab><errno.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&float\.h <Esc><Esc>o#include<Tab><float.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&limits\.h <Esc><Esc>o#include<Tab><limits.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..l&ocale\.h <Esc><Esc>o#include<Tab><locale.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&math\.h <Esc><Esc>o#include<Tab><math.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..set&jmp\.h <Esc><Esc>o#include<Tab><setjmp.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..s&ignal\.h <Esc><Esc>o#include<Tab><signal.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..stdar&g\.h <Esc><Esc>o#include<Tab><stdarg.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..st&ddef\.h <Esc><Esc>o#include<Tab><stddef.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&stdio\.h <Esc><Esc>o#include<Tab><stdio.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..stdli&b\.h <Esc><Esc>o#include<Tab><stdlib.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..st&ring\.h <Esc><Esc>o#include<Tab><string.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &Std\.Lib\..&time\.h <Esc><Esc>o#include<Tab><time.h>' + " + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.C99<Tab>C\/C\+\+ <Esc>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.-Sep0- :' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.&complex\.h <Esc><Esc>o#include<Tab><complex.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.&fenv\.h <Esc><Esc>o#include<Tab><fenv.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.&inttypes\.h <Esc><Esc>o#include<Tab><inttypes.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.is&o646\.h <Esc><Esc>o#include<Tab><iso646.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.&stdbool\.h <Esc><Esc>o#include<Tab><stdbool.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.s&tdint\.h <Esc><Esc>o#include<Tab><stdint.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.tg&math\.h <Esc><Esc>o#include<Tab><tgmath.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.&wchar\.h <Esc><Esc>o#include<Tab><wchar.h>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ C&99.wct&ype\.h <Esc><Esc>o#include<Tab><wctype.h>' + " + exe "amenu ".s:C_Root.'&Preprocessor.-SEP2- :' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &\<\.\.\.\> <Esc><Esc>o#include<Tab><><Left>' + exe "anoremenu ".s:C_Root.'&Preprocessor.#include\ &\"\.\.\.\" <Esc><Esc>o#include<Tab>""<Left>' + exe "amenu ".s:C_Root.'&Preprocessor.#&define <Esc><Esc>:call C_InsertTemplate("preprocessor.define")<CR>' + exe "amenu ".s:C_Root.'&Preprocessor.&#undef <Esc><Esc>:call C_InsertTemplate("preprocessor.undefine")<CR>' + " + exe "amenu ".s:C_Root.'&Preprocessor.#&if\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.if-else-endif")<CR>' + exe "amenu ".s:C_Root.'&Preprocessor.#i&fdef\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR>' + exe "amenu ".s:C_Root.'&Preprocessor.#if&ndef\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR>' + exe "amenu ".s:C_Root.'&Preprocessor.#ifnd&ef\ #def\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR>' + exe "amenu ".s:C_Root.'&Preprocessor.#if\ &0\ #endif <Esc><Esc>:call C_PPIf0("a")<CR>2ji' + " + exe "vmenu ".s:C_Root.'&Preprocessor.#&if\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.if-else-endif", "v")<CR>' + exe "vmenu ".s:C_Root.'&Preprocessor.#i&fdef\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif", "v")<CR>' + exe "vmenu ".s:C_Root.'&Preprocessor.#if&ndef\ #else\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif", "v")<CR>' + exe "vmenu ".s:C_Root.'&Preprocessor.#ifnd&ef\ #def\ #endif <Esc><Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif", "v")<CR>' + exe "vmenu ".s:C_Root.'&Preprocessor.#if\ &0\ #endif <Esc><Esc>:call C_PPIf0("v")<CR>' + " + exe "amenu <silent> ".s:C_Root.'&Preprocessor.&remove\ #if\ 0\ #endif <Esc><Esc>:call C_PPIf0Remove()<CR>' + " + "=============================================================================================== + "----- Menu : Snippets ---------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'S&nippets.S&nippets<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'S&nippets.-Sep00- :' + endif + if s:C_CodeSnippets != "" + exe "amenu <silent> ".s:C_Root.'S&nippets.&read\ code\ snippet <C-C>:call C_CodeSnippet("r")<CR>' + exe "amenu <silent> ".s:C_Root.'S&nippets.&write\ code\ snippet <C-C>:call C_CodeSnippet("w")<CR>' + exe "vmenu <silent> ".s:C_Root.'S&nippets.&write\ code\ snippet <C-C>:call C_CodeSnippet("wv")<CR>' + exe "amenu <silent> ".s:C_Root.'S&nippets.&edit\ code\ snippet <C-C>:call C_CodeSnippet("e")<CR>' + exe " menu <silent> ".s:C_Root.'S&nippets.-SEP1- :' + endif + exe " menu <silent> ".s:C_Root.'S&nippets.&pick\ up\ prototype <C-C>:call C_ProtoPick("n")<CR>' + exe "vmenu <silent> ".s:C_Root.'S&nippets.&pick\ up\ prototype <C-C>:call C_ProtoPick("v")<CR>' + exe " menu <silent> ".s:C_Root.'S&nippets.&insert\ prototype(s) <C-C>:call C_ProtoInsert()<CR>' + exe " menu <silent> ".s:C_Root.'S&nippets.&clear\ prototype(s) <C-C>:call C_ProtoClear()<CR>' + exe " menu <silent> ".s:C_Root.'S&nippets.&show\ prototype(s) <C-C>:call C_ProtoShow()<CR>' + + " + "=============================================================================================== + "----- Menu : C++ --------------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'C&++.C&\+\+<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.-Sep00- :' + endif + exe " noremenu ".s:C_Root.'C&++.c&in <Esc><Esc>ocin<Tab>>> ;<Esc>i' + exe " noremenu ".s:C_Root.'C&++.cout\ &variable <Esc><Esc>ocout<Tab><< << endl;<Esc>2F<hi' + exe " noremenu ".s:C_Root.'C&++.cout\ &string <Esc><Esc>ocout<Tab><< "\n";<Esc>2F"a' + exe " noremenu ".s:C_Root.'C&++.<<\ &\"\" i<< "" <Left><Left>' + " + exe "inoremenu ".s:C_Root.'C&++.c&in cin<Tab>>> ;<Esc>i' + exe "inoremenu ".s:C_Root.'C&++.cout\ &variable cout<Tab><< << endl;<Esc>2F<hi' + exe "inoremenu ".s:C_Root.'C&++.cout\ &string cout<Tab><< "\n";<Esc>2F"a' + exe "inoremenu ".s:C_Root.'C&++.<<\ &\"\" << "" <Left><Left>' + " + "----- Submenu : C++ : output manipulators ------------------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.&output\ manipulators.output\ manip\.<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.&output\ manipulators.-Sep0- :' + " + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &boolalpha i<< boolalpha<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &dec i<< dec<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &endl i<< endl<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &fixed i<< fixed<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ fl&ush i<< flush<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &hex i<< hex<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &internal i<< internal<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &left i<< left<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &oct i<< oct<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &right i<< right<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ s&cientific i<< scientific<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &setbase\(\ \) i<< setbase(10) <Left><Left>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ se&tfill\(\ \) i<< setfill() <Left><Left>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ setiosfla&g\(\ \) i<< setiosflags() <Left><Left>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ set&precision\(\ \) i<< setprecision(6) <Left><Left>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ set&w\(\ \) i<< setw(0) <Left><Left>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showb&ase i<< showbase<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showpoi&nt i<< showpoint<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showpos\ \(&1\) i<< showpos<Space>' + exe " noremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ uppercase\ \(&2\) i<< uppercase<Space>' + " + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &boolalpha << boolalpha<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &dec << dec<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &endl << endl<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &fixed << fixed<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ fl&ush << flush<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &hex << hex<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &internal << internal<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &left << left<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ o&ct << oct<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &right << right<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ s&cientific << scientific<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ &setbase\(\ \) << setbase(10) <Left><Left>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ se&tfill\(\ \) << setfill() <Left><Left>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ setiosfla&g\(\ \) << setiosflags() <Left><Left>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ set&precision\(\ \) << setprecision(6) <Left><Left>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ set&w\(\ \) << setw(0) <Left><Left>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showb&ase << showbase<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showpoi&nt << showpoint<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ showpos\ \(&1\) << showpos<Space>' + exe "inoremenu ".s:C_Root.'C&++.&output\ manipulators.\<\<\ uppercase\ \(&2\) << uppercase<Space>' + " + "----- Submenu : C++ : ios flag bits ------------------------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.ios\ flag&bits.ios\ flags<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.ios\ flag&bits.-Sep0- :' + " + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&adjustfield iios::adjustfield' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::bas&efield iios::basefield' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&boolalpha iios::boolalpha' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&dec iios::dec' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&fixed iios::fixed' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::floa&tfield iios::floatfield' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&hex iios::hex' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&internal iios::internal' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&left iios::left' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&oct iios::oct' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&right iios::right' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::s&cientific iios::scientific' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::sho&wbase iios::showbase' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::showpoint\ \(&1\) iios::showpoint' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::show&pos iios::showpos' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&skipws iios::skipws' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::u&nitbuf iios::unitbuf' + exe " noremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&uppercase iios::uppercase' + " + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&adjustfield ios::adjustfield' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::bas&efield ios::basefield' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&boolalpha ios::boolalpha' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&dec ios::dec' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&fixed ios::fixed' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::floa&tfield ios::floatfield' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&hex ios::hex' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&internal ios::internal' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&left ios::left' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&oct ios::oct' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&right ios::right' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::s&cientific ios::scientific' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::sho&wbase ios::showbase' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::showpoint\ \(&1\) ios::showpoint' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::show&pos ios::showpos' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&skipws ios::skipws' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::u&nitbuf ios::unitbuf' + exe "inoremenu ".s:C_Root.'C&++.ios\ flag&bits.ios::&uppercase ios::uppercase' + " + "----- Submenu : C++ library (algorithm - locale) ---------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).alg\.\.loc<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).-Sep0- :' + " + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&algorithm <Esc><Esc>o#include<Tab><algorithm>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&bitset <Esc><Esc>o#include<Tab><bitset>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&complex <Esc><Esc>o#include<Tab><complex>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&deque <Esc><Esc>o#include<Tab><deque>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&exception <Esc><Esc>o#include<Tab><exception>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&fstream <Esc><Esc>o#include<Tab><fstream>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).f&unctional <Esc><Esc>o#include<Tab><functional>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).iomani&p <Esc><Esc>o#include<Tab><iomanip>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&ios <Esc><Esc>o#include<Tab><ios>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).iosf&wd <Esc><Esc>o#include<Tab><iosfwd>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).io&stream <Esc><Esc>o#include<Tab><iostream>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).istrea&m <Esc><Esc>o#include<Tab><istream>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).iterato&r <Esc><Esc>o#include<Tab><iterator>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).&limits <Esc><Esc>o#include<Tab><limits>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).lis&t <Esc><Esc>o#include<Tab><list>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <alg\.\.loc>\ \(&1\).l&ocale <Esc><Esc>o#include<Tab><locale>' + " + "----- Submenu : C++ library (map - vector) ---------------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).map\.\.vec<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).-Sep0- :' + + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&map <Esc><Esc>o#include<Tab><map>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).memor&y <Esc><Esc>o#include<Tab><memory>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&new <Esc><Esc>o#include<Tab><new>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).numeri&c <Esc><Esc>o#include<Tab><numeric>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&ostream <Esc><Esc>o#include<Tab><ostream>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&queue <Esc><Esc>o#include<Tab><queue>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&set <Esc><Esc>o#include<Tab><set>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).sst&ream <Esc><Esc>o#include<Tab><sstream>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).st&ack <Esc><Esc>o#include<Tab><stack>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).stde&xcept <Esc><Esc>o#include<Tab><stdexcept>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).stream&buf <Esc><Esc>o#include<Tab><streambuf>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).str&ing <Esc><Esc>o#include<Tab><string>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&typeinfo <Esc><Esc>o#include<Tab><typeinfo>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&utility <Esc><Esc>o#include<Tab><utility>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).&valarray <Esc><Esc>o#include<Tab><valarray>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <map\.\.vec>\ \(&2\).v&ector <Esc><Esc>o#include<Tab><vector>' + " + "----- Submenu : C library (cassert - ctime) ------------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cX<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).-Sep0- :' + " + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&assert <Esc><Esc>o#include<Tab><cassert>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&ctype <Esc><Esc>o#include<Tab><cctype>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&errno <Esc><Esc>o#include<Tab><cerrno>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&float <Esc><Esc>o#include<Tab><cfloat>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&limits <Esc><Esc>o#include<Tab><climits>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cl&ocale <Esc><Esc>o#include<Tab><clocale>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&math <Esc><Esc>o#include<Tab><cmath>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cset&jmp <Esc><Esc>o#include<Tab><csetjmp>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cs&ignal <Esc><Esc>o#include<Tab><csignal>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cstdar&g <Esc><Esc>o#include<Tab><cstdarg>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cst&ddef <Esc><Esc>o#include<Tab><cstddef>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&stdio <Esc><Esc>o#include<Tab><cstdio>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cstdli&b <Esc><Esc>o#include<Tab><cstdlib>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).cst&ring <Esc><Esc>o#include<Tab><cstring>' + exe "anoremenu ".s:C_Root.'C&++.#include\ <cX>\ \(&3\).c&time <Esc><Esc>o#include<Tab><ctime>' + " + "----- End Submenu : C library (cassert - ctime) --------------------------------------------- + " + exe "amenu <silent> ".s:C_Root.'C&++.-SEP2- :' + exe "amenu <silent> ".s:C_Root.'C&++.&method\ implement\. <Esc><Esc>:call C_InsertTemplate("cpp.method-implementation")<CR>' + + exe "amenu <silent> ".s:C_Root.'C&++.&class <Esc><Esc>:call C_InsertTemplate("cpp.class")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.class\ (w\.\ &new) <Esc><Esc>:call C_InsertTemplate("cpp.class-using-new")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.-SEP3- :' + exe "amenu <silent> ".s:C_Root.'C&++.tem&pl\.\ method\ impl\. <Esc><Esc>:call C_InsertTemplate("cpp.template-method-implementation")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.&templ\.\ class <Esc><Esc>:call C_InsertTemplate("cpp.template-class")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.templ\.\ class\ (w\.\ ne&w) <Esc><Esc>:call C_InsertTemplate("cpp.template-class-using-new")<CR>' + + exe "amenu <silent> ".s:C_Root.'C&++.-SEP31- :' + exe "amenu <silent> ".s:C_Root.'C&++.templ\.\ &function <Esc><Esc>:call C_InsertTemplate("cpp.template-function")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.&error\ class <Esc><Esc>:call C_InsertTemplate("cpp.error-class")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.-SEP4- :' + exe "amenu <silent> ".s:C_Root.'C&++.operator\ &<< <Esc><Esc>:call C_InsertTemplate("cpp.operator-in")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.operator\ &>> <Esc><Esc>:call C_InsertTemplate("cpp.operator-out")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.-SEP5- :' + exe "amenu <silent> ".s:C_Root.'C&++.tr&y\ \.\.\ catch <Esc><Esc>:call C_InsertTemplate("cpp.try-catch")<CR>' + exe "vmenu <silent> ".s:C_Root.'C&++.tr&y\ \.\.\ catch <Esc><Esc>:call C_InsertTemplate("cpp.try-catch", "v")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.catc&h <Esc><Esc>:call C_InsertTemplate("cpp.catch")<CR>' + exe "vmenu <silent> ".s:C_Root.'C&++.catc&h <Esc><Esc>:call C_InsertTemplate("cpp.catch", "v")<CR>' + + exe "amenu <silent> ".s:C_Root.'C&++.catch\(&\.\.\.\) <Esc><Esc>:call C_InsertTemplate("cpp.catch-points")<CR>' + exe "vmenu <silent> ".s:C_Root.'C&++.catch\(&\.\.\.\) <Esc><Esc>:call C_InsertTemplate("cpp.catch-points", "v")<CR>' + + exe "amenu <silent> ".s:C_Root.'C&++.-SEP6- :' + exe "amenu <silent> ".s:C_Root.'C&++.open\ input\ file\ \ \(&4\) <Esc><Esc>:call C_InsertTemplate("cpp.open-input-file")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.open\ output\ file\ \(&5\) <Esc><Esc>:call C_InsertTemplate("cpp.open-output-file")<CR>' + exe "amenu <silent> ".s:C_Root.'C&++.-SEP7- :' + + exe " menu <silent> ".s:C_Root.'C&++.&using\ namespace\ std; <Esc><Esc>ousing namespace std;<CR>' + exe " menu <silent> ".s:C_Root.'C&++.usin&g\ namespace\ ; <Esc><Esc>ousing namespace ;<Esc>$i' + exe "amenu <silent> ".s:C_Root.'C&++.namespace\ &\{\ \} <Esc><Esc>:call C_InsertTemplate("cpp.namespace")<CR>' + + exe "imenu <silent> ".s:C_Root.'C&++.&using\ namespace\ std; using namespace std;<CR>' + exe "imenu <silent> ".s:C_Root.'C&++.usin&g\ namespace\ ; using namespace ;<Esc>$i' + exe "vmenu <silent> ".s:C_Root.'C&++.namespace\ &\{\ \} <Esc><Esc>:call C_InsertTemplate("cpp.namespace", "v")<CR>' + + exe "amenu <silent> ".s:C_Root.'C&++.-SEP8- :' + " + "----- Submenu : RTTI ---------------------------------------------------------------------------- + " + exe "amenu ".s:C_Root.'C&++.&RTTI.RTTI<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'C&++.&RTTI.-Sep0- :' + " + exe " noremenu ".s:C_Root.'C&++.&RTTI.&typeid atypeid()<Esc>hr(a' + exe " noremenu ".s:C_Root.'C&++.&RTTI.&static_cast astatic_cast<>()<Left>' + exe " noremenu ".s:C_Root.'C&++.&RTTI.&const_cast aconst_cast<>()<Left>' + exe " noremenu ".s:C_Root.'C&++.&RTTI.&reinterpret_cast areinterpret_cast<>()<Left>' + exe " noremenu ".s:C_Root.'C&++.&RTTI.&dynamic_cast adynamic_cast<>()<Left>' + " + exe "vnoremenu ".s:C_Root.'C&++.&RTTI.&typeid stypeid()<Esc>hr(p' + exe "vnoremenu ".s:C_Root.'C&++.&RTTI.&static_cast sstatic_cast<>()<Esc>P' + exe "vnoremenu ".s:C_Root.'C&++.&RTTI.&const_cast sconst_cast<>()<Esc>P' + exe "vnoremenu ".s:C_Root.'C&++.&RTTI.&reinterpret_cast sreinterpret_cast<>()<Esc>P' + exe "vnoremenu ".s:C_Root.'C&++.&RTTI.&dynamic_cast sdynamic_cast<>()<Esc>P' + " + exe "inoremenu ".s:C_Root.'C&++.&RTTI.&typeid typeid()<Esc>hr(a' + exe "inoremenu ".s:C_Root.'C&++.&RTTI.&static_cast static_cast<>()<Left>' + exe "inoremenu ".s:C_Root.'C&++.&RTTI.&const_cast const_cast<>()<Left>' + exe "inoremenu ".s:C_Root.'C&++.&RTTI.&reinterpret_cast reinterpret_cast<>()<Left>' + exe "inoremenu ".s:C_Root.'C&++.&RTTI.&dynamic_cast dynamic_cast<>()<Left>' + " + "----- End Submenu : RTTI ------------------------------------------------------------------------ + " + exe "amenu <silent>".s:C_Root.'C&++.e&xtern\ \"C\"\ \{\ \} <Esc><Esc>:call C_InsertTemplate("cpp.extern")<CR>' + exe "vmenu <silent>".s:C_Root.'C&++.e&xtern\ \"C\"\ \{\ \} <Esc><Esc>:call C_InsertTemplate("cpp.extern", "v")<CR>' + " + "=============================================================================================== + "----- Menu : run ----- -------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_MenuHeader == 'yes' + exe "amenu ".s:C_Root.'&Run.&Run<Tab>C\/C\+\+ <Esc>' + exe "amenu ".s:C_Root.'&Run.-Sep00- :' + endif + " + exe "amenu <silent> ".s:C_Root.'&Run.save\ and\ &compile<Tab>\<A-F9\> <C-C>:call C_Compile()<CR>:redraw<CR>:call C_HlMessage()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.&link<Tab>\<F9\> <C-C>:call C_Link()<CR>:redraw<CR>:call C_HlMessage()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.&run<Tab>\<C-F9\> <C-C>:call C_Run()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.cmd\.\ line\ &arg\.<Tab>\<S-F9\> <C-C>:call C_Arguments()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.-SEP0- :' + exe "amenu <silent> ".s:C_Root.'&Run.&make <C-C>:call C_Make()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.cmd\.\ line\ ar&g\.\ for\ make <C-C>:call C_MakeArguments()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.-SEP1- :' + if s:C_SplintIsExecutable==1 + exe "amenu <silent> ".s:C_Root.'&Run.s&plint <C-C>:call C_SplintCheck()<CR>:redraw<CR>:call C_HlMessage()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.cmd\.\ line\ arg\.\ for\ spl&int <C-C>:call C_SplintArguments()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.-SEP2- :' + endif + " + if s:C_CodeCheckIsExecutable==1 + exe "amenu <silent> ".s:C_Root.'&Run.CodeChec&k <C-C>:call C_CodeCheck()<CR>:redraw<CR>:call C_HlMessage()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.cmd\.\ line\ arg\.\ for\ Cod&eCheck <C-C>:call C_CodeCheckArguments()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.-SEP3- :' + endif + " + exe "amenu ".s:C_Root.'&Run.in&dent <C-C>:call C_Indent("a")<CR>:redraw<CR>:call C_HlMessage()<CR>' + exe "vmenu ".s:C_Root.'&Run.in&dent <C-C>:call C_Indent("v")<CR>:redraw<CR>:call C_HlMessage()<CR>' + if s:MSWIN + exe "amenu <silent> ".s:C_Root.'&Run.&hardcopy\ to\ printer <C-C>:call C_Hardcopy("n")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Run.&hardcopy\ to\ printer <C-C>:call C_Hardcopy("v")<CR>' + else + exe "amenu <silent> ".s:C_Root.'&Run.&hardcopy\ to\ FILENAME\.ps <C-C>:call C_Hardcopy("n")<CR>' + exe "vmenu <silent> ".s:C_Root.'&Run.&hardcopy\ to\ FILENAME\.ps <C-C>:call C_Hardcopy("v")<CR>' + endif + exe "imenu <silent> ".s:C_Root.'&Run.-SEP4- :' + + exe "amenu <silent> ".s:C_Root.'&Run.rebuild\ &templates <C-C>:call C_RebuildTemplates()<CR>' + exe "amenu <silent> ".s:C_Root.'&Run.&settings <C-C>:call C_Settings()<CR>' + exe "imenu <silent> ".s:C_Root.'&Run.-SEP5- :' + + if !s:MSWIN + exe "amenu <silent> ".s:C_Root.'&Run.&xterm\ size <C-C>:call C_XtermSize()<CR>' + endif + if s:C_OutputGvim == "vim" + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ VIM->buffer->xterm <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + else + if s:C_OutputGvim == "buffer" + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ BUFFER->xterm->vim <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + else + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ XTERM->vim->buffer <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + endif + endif + " + "=============================================================================================== + "----- Menu : help ------------------------------------------------------- {{{2 + "=============================================================================================== + " + if s:C_Root != "" + exe "menu <silent> ".s:C_Root.'&help\ \(plugin\) <C-C><C-C>:call C_HelpCsupport()<CR>' + endif + +endfunction " ---------- end of function C_InitMenus ---------- +" +"=============================================================================================== +"----- Menu Functions -------------------------------------------------------------------------- +"=============================================================================================== +" +"------------------------------------------------------------------------------ +" C_Input: Input after a highlighted prompt {{{1 +"------------------------------------------------------------------------------ +function! C_Input ( promp, text ) + echohl Search " highlight prompt + call inputsave() " preserve typeahead + let retval=input( a:promp, a:text ) " read input + call inputrestore() " restore typeahead + echohl None " reset highlighting + let retval = substitute( retval, '^\s\+', "", "" ) " remove leading whitespaces + let retval = substitute( retval, '\s\+$', "", "" ) " remove trailing whitespaces + return retval +endfunction " ---------- end of function C_Input ---------- +" +"------------------------------------------------------------------------------ +" C_AdjustLineEndComm: adjust line-end comments {{{1 +"------------------------------------------------------------------------------ +function! C_AdjustLineEndComm ( mode ) range + " + if !exists("b:C_LineEndCommentColumn") + let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault + endif + + let save_cursor = getpos(".") + + let save_expandtab = &expandtab + exe ":set expandtab" + + if a:mode == 'v' + let pos0 = line("'<") + let pos1 = line("'>") + else + let pos0 = line(".") + let pos1 = pos0 + endif + + let linenumber = pos0 + exe ":".pos0 + + while linenumber <= pos1 + let line= getline(".") + " look for a C comment + let idx1 = 1 + match( line, '\s*\/\*.\{-}\*\/' ) + let idx2 = 1 + match( line, '\/\*.\{-}\*\/' ) + if idx2 == 0 + " look for a C++ comment + let idx1 = 1 + match( line, '\s*\/\/.*$' ) + let idx2 = 1 + match( line, '\/\/.*$' ) + endif + + let ln = line(".") + call setpos(".", [ 0, ln, idx1, 0 ] ) + let vpos1 = virtcol(".") + call setpos(".", [ 0, ln, idx2, 0 ] ) + let vpos2 = virtcol(".") + + if ! ( vpos2 == b:C_LineEndCommentColumn + \ || vpos1 > b:C_LineEndCommentColumn + \ || idx2 == 0 ) + + exe ":.,.retab" + " insert some spaces + if vpos2 < b:C_LineEndCommentColumn + let diff = b:C_LineEndCommentColumn-vpos2 + call setpos(".", [ 0, ln, vpos2, 0 ] ) + let @" = ' ' + exe "normal ".diff."P" + endif + + " remove some spaces + if vpos1 < b:C_LineEndCommentColumn && vpos2 > b:C_LineEndCommentColumn + let diff = vpos2 - b:C_LineEndCommentColumn + call setpos(".", [ 0, ln, b:C_LineEndCommentColumn, 0 ] ) + exe "normal ".diff."x" + endif + + endif + let linenumber=linenumber+1 + normal j + endwhile + " restore tab expansion settings and cursor position + let &expandtab = save_expandtab + call setpos('.', save_cursor) + +endfunction " ---------- end of function C_AdjustLineEndComm ---------- +" +"------------------------------------------------------------------------------ +" C_GetLineEndCommCol: get line-end comment position {{{1 +"------------------------------------------------------------------------------ +function! C_GetLineEndCommCol () + let actcol = virtcol(".") + if actcol+1 == virtcol("$") + let b:C_LineEndCommentColumn = C_Input( 'start line-end comment at virtual column : ', actcol ) + else + let b:C_LineEndCommentColumn = virtcol(".") + endif + echomsg "line end comments will start at column ".b:C_LineEndCommentColumn +endfunction " ---------- end of function C_GetLineEndCommCol ---------- +" +"------------------------------------------------------------------------------ +" C_LineEndComment: single line-end comment {{{1 +"------------------------------------------------------------------------------ +function! C_LineEndComment ( ) + if !exists("b:C_LineEndCommentColumn") + let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault + endif + " ----- trim whitespaces ----- + exe 's/\s*$//' + let linelength= virtcol("$") - 1 + if linelength < b:C_LineEndCommentColumn + let diff = b:C_LineEndCommentColumn -1 -linelength + exe "normal ".diff."A " + endif + " append at least one blank + if linelength >= b:C_LineEndCommentColumn + exe "normal A " + endif + call C_InsertTemplate('comment.end-of-line-comment') +endfunction " ---------- end of function C_LineEndComment ---------- +" +"------------------------------------------------------------------------------ +" C_MultiLineEndComments: multi line-end comments {{{1 +"------------------------------------------------------------------------------ +function! C_MultiLineEndComments ( ) + " + if !exists("b:C_LineEndCommentColumn") + let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault + endif + " + let pos0 = line("'<") + let pos1 = line("'>") + " + " ----- trim whitespaces ----- + exe pos0.','.pos1.'s/\s*$//' + " + " ----- find the longest line ----- + let maxlength = 0 + let linenumber = pos0 + normal '< + while linenumber <= pos1 + if getline(".") !~ "^\\s*$" && maxlength<virtcol("$") + let maxlength= virtcol("$") + endif + let linenumber=linenumber+1 + normal j + endwhile + " + if maxlength < b:C_LineEndCommentColumn + let maxlength = b:C_LineEndCommentColumn + else + let maxlength = maxlength+1 " at least 1 blank + endif + " + " ----- fill lines with blanks ----- + let linenumber = pos0 + while linenumber <= pos1 + exe ":".linenumber + if getline(".") !~ "^\\s*$" + let diff = maxlength - virtcol("$") + exe "normal ".diff."A " + call C_InsertTemplate('comment.end-of-line-comment') + endif + let linenumber=linenumber+1 + endwhile + " + " ----- back to the begin of the marked block ----- + let diff = pos1-pos0 + normal a + if pos1-pos0 > 0 + exe "normal ".diff."k" + end +endfunction " ---------- end of function C_MultiLineEndComments ---------- +" +"------------------------------------------------------------------------------ +" C_CommentSpecial : special comments {{{1 +"------------------------------------------------------------------------------ +function! C_CommentSpecial (special) + put = ' '.s:C_Com1.' '.a:special.' '.s:C_Com2 +endfunction " ---------- end of function C_CommentSpecial ---------- +" +"------------------------------------------------------------------------------ +" C_Comment_C_SectionAll: Section Comments {{{1 +"------------------------------------------------------------------------------ +" +function! C_Comment_C_SectionAll ( type ) + + call C_InsertTemplate("comment.file-section-cpp-header-includes") + call C_InsertTemplate("comment.file-section-cpp-macros") + call C_InsertTemplate("comment.file-section-cpp-typedefs") + call C_InsertTemplate("comment.file-section-cpp-data-types") + if a:type=="cpp" + call C_InsertTemplate("comment.file-section-cpp-class-defs") + endif + call C_InsertTemplate("comment.file-section-cpp-local-variables") + call C_InsertTemplate("comment.file-section-cpp-prototypes") + call C_InsertTemplate("comment.file-section-cpp-function-defs-exported") + call C_InsertTemplate("comment.file-section-cpp-function-defs-local") + if a:type=="cpp" + call C_InsertTemplate("comment.file-section-cpp-class-implementations-exported") + call C_InsertTemplate("comment.file-section-cpp-class-implementations-local") + endif + +endfunction " ---------- end of function C_Comment_C_SectionAll ---------- +" +function! C_Comment_H_SectionAll ( type ) + + call C_InsertTemplate("comment.file-section-hpp-header-includes") + call C_InsertTemplate("comment.file-section-hpp-macros") + call C_InsertTemplate("comment.file-section-hpp-exported-typedefs") + call C_InsertTemplate("comment.file-section-hpp-exported-data-types") + if a:type=="cpp" + call C_InsertTemplate("comment.file-section-hpp-exported-class-defs") + endif + call C_InsertTemplate("comment.file-section-hpp-exported-variables") + call C_InsertTemplate("comment.file-section-hpp-exported-function-declarations") + +endfunction " ---------- end of function C_Comment_H_SectionAll ---------- +" +"---------------------------------------------------------------------- +" C_CodeComment : Code -> Comment {{{1 +"---------------------------------------------------------------------- +function! C_CodeComment( mode, style ) + + if a:mode=="a" + if a:style == 'yes' + silent exe ":s#^#/\* #" + silent put = ' */' + else + silent exe ":s#^#//#" + endif + endif + + if a:mode=="v" + if a:style == 'yes' + silent exe ":'<,'>s/^/ \* /" + silent exe ":'< s'^ '\/'" + silent exe ":'>" + silent put = ' */' + else + silent exe ":'<,'>s#^#//#" + endif + endif + +endfunction " ---------- end of function C_CodeComment ---------- +" +"---------------------------------------------------------------------- +" C_StartMultilineComment : Comment -> Code {{{1 +"---------------------------------------------------------------------- +let s:C_StartMultilineComment = '^\s*\/\*[\*! ]\=' + +function! C_RemoveCComment( start, end ) + + if a:end-a:start<1 + return 0 " lines removed + endif + " + " Is the C-comment complete ? Get length. + " + let check = getline( a:start ) =~ s:C_StartMultilineComment + let linenumber = a:start+1 + while linenumber < a:end && getline( linenumber ) !~ '^\s*\*\/' + let check = check && getline( linenumber ) =~ '^\s*\*[ ]\=' + let linenumber = linenumber+1 + endwhile + let check = check && getline( linenumber ) =~ '^\s*\*\/' + " + " remove a complete comment + " + if check + exe "silent :".a:start.' s/'.s:C_StartMultilineComment.'//' + let linenumber1 = a:start+1 + while linenumber1 < linenumber + exe "silent :".linenumber1.' s/^\s*\*[ ]\=//' + let linenumber1 = linenumber1+1 + endwhile + exe "silent :".linenumber1.' s/^\s*\*\///' + endif + + return linenumber-a:start+1 " lines removed +endfunction " ---------- end of function C_RemoveCComment ---------- +" +"---------------------------------------------------------------------- +" C_CommentCode : Comment -> Code {{{1 +"---------------------------------------------------------------------- +function! C_CommentCode(mode) + if a:mode=="a" + let pos1 = line(".") + let pos2 = pos1 + endif + if a:mode=="v" + let pos1 = line("'<") + let pos2 = line("'>") + endif + + let removed = 0 + " + let linenumber=pos1 + while linenumber <= pos2 + " Do we have a C++ comment ? + if getline( linenumber ) =~ '^\s*//' + exe "silent :".linenumber.' s#^\s*//##' + let removed = 1 + endif + " Do we have a C comment ? + if removed == 0 && getline( linenumber ) =~ s:C_StartMultilineComment + let removed = C_RemoveCComment(linenumber,pos2) + endif + + if removed!=0 + let linenumber = linenumber+removed + let removed = 0 + else + let linenumber = linenumber+1 + endif + endwhile +endfunction " ---------- end of function C_CommentCode ---------- +" +"---------------------------------------------------------------------- +" C_CommentCppToC : C++ Comment -> C Comment {{{1 +" Removes trailing whitespaces. +"---------------------------------------------------------------------- +function! C_CommentCppToC() + silent! exe ':s#\/\/\s*\(.*\)\s*$#/* \1 */#' +endfunction " ---------- end of function C_CommentCppToC ---------- +" +"---------------------------------------------------------------------- +" C_CommentCToCpp : C Comment -> C++ Comment {{{1 +" Changes the first comment in case of multiple comments: +" xxxx; /* */ /* */ +" xxxx; // /* */ +" Removes trailing whitespaces. +"---------------------------------------------------------------------- +function! C_CommentCToCpp() + silent! exe ':s!\/\*\s*\(.\{-}\)\*\/!\/\/ \1!' + silent! exe ':s!\s*$!!' +endfunction " ---------- end of function C_CommentCToCpp ---------- +" +"===================================================================================== +"----- Menu : Statements ----------------------------------------------------------- +"===================================================================================== +" +"------------------------------------------------------------------------------ +" C_PPIf0 : #if 0 .. #endif {{{1 +"------------------------------------------------------------------------------ +function! C_PPIf0 (mode) + " + let s:C_If0_Counter = 0 + let save_line = line(".") + let actual_line = 0 + " + " search for the maximum option number (if any) + " + normal gg + while actual_line < search( s:C_If0_Txt."\\d\\+" ) + let actual_line = line(".") + let actual_opt = matchstr( getline(actual_line), s:C_If0_Txt."\\d\\+" ) + let actual_opt = strpart( actual_opt, strlen(s:C_If0_Txt),strlen(actual_opt)-strlen(s:C_If0_Txt)) + if s:C_If0_Counter < actual_opt + let s:C_If0_Counter = actual_opt + endif + endwhile + let s:C_If0_Counter = s:C_If0_Counter+1 + silent exe ":".save_line + " + if a:mode=='a' + let zz= "\n#if 0 ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n" + let zz= zz."\n#endif ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n\n" + put =zz + if v:version >= 700 + normal 4k + endif + endif + + if a:mode=='v' + let zz= "\n#if 0 ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n" + :'<put! =zz + let zz= "#endif ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n\n" + :'>put =zz + :normal '< + endif + +endfunction " ---------- end of function C_PPIf0 ---------- +" +"------------------------------------------------------------------------------ +" C_PPIf0Remove : remove #if 0 .. #endif {{{1 +"------------------------------------------------------------------------------ +function! C_PPIf0Remove () + + let frstline = searchpair( '^\s*#if\s\+0', '', '^\s*#endif\>.\+\<If0Label_', 'bn' ) + if frstline<=0 + echohl WarningMsg | echo 'no #if 0 ... #endif found or cursor not inside such a directive'| echohl None + return + endif + let lastline = searchpair( '^\s*#if\s\+0', '', '^\s*#endif\>.\+\<If0Label_', 'n' ) + if lastline<=0 + echohl WarningMsg | echo 'no #if 0 ... #endif found or cursor not inside such a directive'| echohl None + return + endif + let actualnumber1 = matchstr( getline(frstline), s:C_If0_Txt."\\d\\+" ) + let actualnumber2 = matchstr( getline(lastline), s:C_If0_Txt."\\d\\+" ) + if actualnumber1 != actualnumber2 + echohl WarningMsg | echo 'lines '.frstline.', '.lastline.': comment tags do not match'| echohl None + return + endif + + silent exe ':'.lastline.','.lastline.'d' + silent exe ':'.frstline.','.frstline.'d' + +endfunction " ---------- end of function C_PPIf0Remove ---------- +" +"------------------------------------------------------------------------------- +" C_LegalizeName : replace non-word characters by underscores +" - multiple whitespaces +" - multiple non-word characters +" - multiple underscores +"------------------------------------------------------------------------------- +function! C_LegalizeName ( name ) + let identifier = substitute( a:name, '\s\+', '_', 'g' ) + let identifier = substitute( identifier, '\W\+', '_', 'g' ) + let identifier = substitute( identifier, '_\+', '_', 'g' ) + return identifier +endfunction " ---------- end of function C_LegalizeName ---------- + +"------------------------------------------------------------------------------ +" C_CodeSnippet : read / edit code snippet {{{1 +"------------------------------------------------------------------------------ +function! C_CodeSnippet(mode) + + if isdirectory(s:C_CodeSnippets) + " + " read snippet file, put content below current line and indent + " + if a:mode == "r" + if has("gui_running") + let l:snippetfile=browse(0,"read a code snippet",s:C_CodeSnippets,"") + else + let l:snippetfile=input("read snippet ", s:C_CodeSnippets, "file" ) + end + if filereadable(l:snippetfile) + let linesread= line("$") + let l:old_cpoptions = &cpoptions " Prevent the alternate buffer from being set to this files + setlocal cpoptions-=a + :execute "read ".l:snippetfile + let &cpoptions = l:old_cpoptions " restore previous options + let linesread= line("$")-linesread-1 + if linesread>=0 && match( l:snippetfile, '\.\(ni\|noindent\)$' ) < 0 + endif + endif + if line(".")==2 && getline(1)=~"^$" + silent exe ":1,1d" + endif + endif + " + " update current buffer / split window / edit snippet file + " + if a:mode == "e" + if has("gui_running") + let l:snippetfile = browse(0,"edit a code snippet",s:C_CodeSnippets,"") + else + let l:snippetfile=input("edit snippet ", s:C_CodeSnippets, "file" ) + end + if l:snippetfile != "" + :execute "update! | split | edit ".l:snippetfile + endif + endif + " + " write whole buffer into snippet file + " + if a:mode == "w" || a:mode == "wv" + if has("gui_running") + let l:snippetfile = browse(0,"edit a code snippet",s:C_CodeSnippets,"") + else + let l:snippetfile=input("edit snippet ", s:C_CodeSnippets, "file" ) + end + if l:snippetfile != "" + if filereadable(l:snippetfile) + if confirm("File ".l:snippetfile." exists ! Overwrite ? ", "&Cancel\n&No\n&Yes") != 3 + return + endif + endif + if a:mode == "w" + :execute ":write! ".l:snippetfile + else + :execute ":*write! ".l:snippetfile + end + endif + endif + + else + echo "code snippet directory ".s:C_CodeSnippets." does not exist (please create it)" + endif +endfunction " ---------- end of function C_CodeSnippets ---------- +" +"------------------------------------------------------------------------------ +" C_CodeFor : for (idiom) {{{1 +"------------------------------------------------------------------------------ +function! C_CodeFor( direction, mode ) + if a:direction=="up" + let string = C_Input( " loop var. [ start [ end [ incr. ]]] : ", "" ) + else + let string = C_Input( " loop var. [ start [ end [ decr. ]]] : ", "" ) + endif + let pos = 0 + let jmp = 0 + if string != "" + " + " use internal formatting to avoid conficts when using == below + let equalprg_save = &equalprg + set equalprg= + " + " loop variable + let loopvar = matchstr( string, '\S\+\s*', pos ) + let pos = pos + strlen(loopvar) + let loopvar = substitute( loopvar, '\s*$', "", "" ) + " + " start value + let startval = matchstr( string, '\S\+\s*', pos ) + let pos = pos + strlen(startval) + let startval = substitute( startval, '\s*$', "", "" ) + + " end value + let endval = matchstr( string, '\S\+\s*', pos ) + let pos = pos + strlen(endval) + let endval = substitute( endval, '\s*$', "", "" ) + + " increment + let incval = matchstr( string, '\S\+\s*', pos ) + let pos = pos + strlen(incval) + let incval = substitute( incval, '\s*$', "", "" ) + + if incval=="" + let incval = '1' + let jmp = 10 + endif + + if a:direction=="up" + if endval=="" + let endval = 'n' + let jmp = 7 + endif + if startval=="" + let startval = '0' + let jmp = 4 + endif + let zz= "for ( ".loopvar." = ".startval."; ".loopvar." < ".endval."; ".loopvar." += ".incval." )" + else + if endval=="" + let endval = '0' + let jmp = 7 + endif + if startval=="" + let startval = 'n-1' + let jmp = 4 + endif + let zz= "for ( ".loopvar." = ".startval."; ".loopvar." >= ".endval."; ".loopvar." -= ".incval." )" + endif + + " ----- normal mode ---------------- + if a:mode=="a" + put =zz + normal 2== + if jmp!=0 + exe "normal ".jmp."Wh" + else + exe 'normal $' + endif + endif + + " ----- visual mode ---------------- + if a:mode=="v" + let zz = zz." {" + :'<put! =zz + let zz= "}" + :'>put =zz + :'<-1 + :exe "normal =".(line("'>")-line(".")+3)."+" + endif + " + " restore formatter programm + let &equalprg = equalprg_save + " + endif +endfunction " ---------- end of function C_CodeFor ---------- +" +"------------------------------------------------------------------------------ +" Handle prototypes {{{1 +"------------------------------------------------------------------------------ +" +let s:C_Prototype = [] +let s:C_PrototypeShow = [] +let s:C_PrototypeCounter = 0 +let s:C_CComment = '\/\*.\{-}\*\/\s*' " C comment with trailing whitespaces + " '.\{-}' any character, non-greedy +let s:C_CppComment = '\/\/.*$' " C++ comment +" +"------------------------------------------------------------------------------ +" C_ProtoPick : pick up (normal/visual) {{{1 +"------------------------------------------------------------------------------ +function! C_ProtoPick (mode) + if a:mode=="n" + " --- normal mode ------------------- + let pos1 = line(".") + let pos2 = pos1 + else + " --- visual mode ------------------- + let pos1 = line("'<") + let pos2 = line("'>") + endif + " + " remove C/C++-comments, leading and trailing whitespaces, squeeze whitespaces + " + let prototyp = '' + let linenumber = pos1 + while linenumber <= pos2 + let newline = getline(linenumber) + let newline = substitute( newline, s:C_CppComment, "", "" ) " remove C++ comment + let prototyp = prototyp." ".newline + let linenumber = linenumber+1 + endwhile + " + let prototyp = substitute( prototyp, '^\s\+', "", "" ) " remove leading whitespaces + let prototyp = substitute( prototyp, s:C_CComment, "", "g" ) " remove (multiline) C comments + let prototyp = substitute( prototyp, '\s\+', " ", "g" ) " squeeze whitespaces + let prototyp = substitute( prototyp, '\s\+$', "", "" ) " remove trailing whitespaces + " + " remove template keyword + " + let prototyp = substitute( prototyp, '^template\s*<\s*class \w\+\s*>\s*', "", "" ) + " + let parlist = stridx( prototyp, '(' ) " start of the parameter list + let part1 = strpart( prototyp, 0, parlist ) + let part2 = strpart( prototyp, parlist ) + " + " remove the scope res. operator + " + let part1 = substitute( part1, '<\s*\w\+\s*>', "", "g" ) + let part1 = substitute( part1, '\<std\s*::', 'std##', 'g' ) " remove the scope res. operator + let part1 = substitute( part1, '\<\h\w*\s*::', '', 'g' ) " remove the scope res. operator + let part1 = substitute( part1, '\<std##', 'std::', 'g' ) " remove the scope res. operator + let prototyp = part1.part2 + " + " remove trailing parts of the function body; add semicolon + " + let prototyp = substitute( prototyp, '\s*{.*$', "", "" ) + let prototyp = prototyp.";\n" + " + " bookkeeping + " + let s:C_PrototypeCounter += 1 + let s:C_Prototype += [prototyp] + let s:C_PrototypeShow += ["(".s:C_PrototypeCounter.") ".bufname("%")." # ".prototyp] + " + echo s:C_PrototypeCounter.' prototype(s)' + " +endfunction " --------- end of function C_ProtoPick ---------- +" +"------------------------------------------------------------------------------ +" C_ProtoInsert : insert {{{1 +"------------------------------------------------------------------------------ +function! C_ProtoInsert () + " + " use internal formatting to avoid conficts when using == below + let equalprg_save = &equalprg + set equalprg= + " + if s:C_PrototypeCounter > 0 + for protytype in s:C_Prototype + put =protytype + endfor + let lines = s:C_PrototypeCounter - 1 + silent exe "normal =".lines."-" + call C_ProtoClear() + else + echo "currently no prototypes available" + endif + " + " restore formatter programm + let &equalprg = equalprg_save + " +endfunction " --------- end of function C_ProtoInsert ---------- +" +"------------------------------------------------------------------------------ +" C_ProtoClear : clear {{{1 +"------------------------------------------------------------------------------ +function! C_ProtoClear () + if s:C_PrototypeCounter > 0 + let s:C_Prototype = [] + let s:C_PrototypeShow = [] + let s:C_PrototypeCounter = 0 + echo 'prototypes deleted' + else + echo "currently no prototypes available" + endif +endfunction " --------- end of function C_ProtoClear ---------- +" +"------------------------------------------------------------------------------ +" C_ProtoShow : show {{{1 +"------------------------------------------------------------------------------ +function! C_ProtoShow () + if s:C_PrototypeCounter > 0 + for protytype in s:C_PrototypeShow + echo protytype + endfor + else + echo "currently no prototypes available" + endif +endfunction " --------- end of function C_ProtoShow ---------- +" +"------------------------------------------------------------------------------ +" C_EscapeBlanks : C_EscapeBlanks {{{1 +"------------------------------------------------------------------------------ +function! C_EscapeBlanks (arg) + return substitute( a:arg, " ", "\\ ", "g" ) +endfunction " --------- end of function C_EscapeBlanks ---------- +" +"------------------------------------------------------------------------------ +" C_Compile : C_Compile {{{1 +"------------------------------------------------------------------------------ +" The standard make program 'make' called by vim is set to the C or C++ compiler +" and reset after the compilation (set makeprg=... ). +" The errorfile created by the compiler will now be read by gvim and +" the commands cl, cp, cn, ... can be used. +"------------------------------------------------------------------------------ +function! C_Compile () + + let l:currentbuffer = bufname("%") + let s:C_HlMessage = "" + exe ":cclose" + let Sou = expand("%:p") " name of the file in the current buffer + let Obj = expand("%:p:r").s:C_ObjExtension " name of the object + let SouEsc= escape( Sou, s:escfilename ) + let ObjEsc= escape( Obj, s:escfilename ) + + " update : write source file if necessary + exe ":update" + + " compilation if object does not exist or object exists and is older then the source + if !filereadable(Obj) || (filereadable(Obj) && (getftime(Obj) < getftime(Sou))) + " &makeprg can be a string containing blanks + let makeprg_saved='"'.&makeprg.'"' + if expand("%:e") == s:C_CExtension + exe "set makeprg=".s:C_CCompiler + else + exe "set makeprg=".s:C_CplusCompiler + endif + " + " COMPILATION + " + if s:MSWIN + exe "make ".s:C_CFlags." \"".SouEsc."\" -o \"".ObjEsc."\"" + else + exe "make ".s:C_CFlags." ".SouEsc." -o ".ObjEsc + endif + exe "set makeprg=".makeprg_saved + " + " open error window if necessary + exe ":botright cwindow" + else + let s:C_HlMessage = " '".Obj."' is up to date " + endif + +endfunction " ---------- end of function C_Compile ---------- +" +"------------------------------------------------------------------------------ +" C_Link : C_Link {{{1 +"------------------------------------------------------------------------------ +" The standard make program which is used by gvim is set to the compiler +" (for linking) and reset after linking. +" +" calls: C_Compile +"------------------------------------------------------------------------------ +function! C_Link () + + call C_Compile() + + let s:C_HlMessage = "" + let Sou = expand("%:p") " name of the file in the current buffer + let Obj = expand("%:p:r").s:C_ObjExtension " name of the object file + let Exe = expand("%:p:r").s:C_ExeExtension " name of the executable + let ObjEsc= escape( Obj, s:escfilename ) + let ExeEsc= escape( Exe, s:escfilename ) + + " no linkage if: + " executable exists + " object exists + " source exists + " executable newer then object + " object newer then source + + if filereadable(Exe) && + \ filereadable(Obj) && + \ filereadable(Sou) && + \ (getftime(Exe) >= getftime(Obj)) && + \ (getftime(Obj) >= getftime(Sou)) + let s:C_HlMessage = " '".Exe."' is up to date " + return + endif + + " linkage if: + " object exists + " source exists + " object newer then source + + if filereadable(Obj) && (getftime(Obj) >= getftime(Sou)) + let makeprg_saved='"'.&makeprg.'"' + if expand("%:e") == s:C_CExtension + exe "set makeprg=".s:C_CCompiler + else + exe "set makeprg=".s:C_CplusCompiler + endif + let v:statusmsg="" + if s:MSWIN + silent exe "make ".s:C_LFlags." ".s:C_Libs." -o \"".ExeEsc."\" \"".ObjEsc."\"" + else + silent exe "make ".s:C_LFlags." ".s:C_Libs." -o ".ExeEsc." ".ObjEsc + endif + if v:statusmsg != "" + let s:C_HlMessage = v:statusmsg + endif + exe "set makeprg=".makeprg_saved + endif +endfunction " ---------- end of function C_Link ---------- +" +"------------------------------------------------------------------------------ +" C_Run : C_Run {{{1 +" calls: C_Link +"------------------------------------------------------------------------------ +" +let s:C_OutputBufferName = "C-Output" +let s:C_OutputBufferNumber = -1 +" +function! C_Run () +" + let Sou = expand("%:p") " name of the source file + let Obj = expand("%:p:r").s:C_ObjExtension " name of the object file + let Exe = expand("%:p:r").s:C_ExeExtension " name of the executable + let ExeEsc = escape( Exe, s:escfilename ) " name of the executable, escaped + " + let l:arguments = exists("b:C_CmdLineArgs") ? b:C_CmdLineArgs : '' + " + let l:currentbuffer = bufname("%") + " + "============================================================================== + " run : run from the vim command line + "============================================================================== + if s:C_OutputGvim == "vim" + " + silent call C_Link() + " + if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) + if s:MSWIN + exe "!\"".ExeEsc."\" ".l:arguments + else + exe "!".ExeEsc." ".l:arguments + endif + else + echomsg "file ".Exe." does not exist / is not executable" + endif + + endif + " + "============================================================================== + " run : redirect output to an output buffer + "============================================================================== + if s:C_OutputGvim == "buffer" + let l:currentbuffernr = bufnr("%") + " + silent call C_Link() + " + if l:currentbuffer == bufname("%") + " + " + if bufloaded(s:C_OutputBufferName) != 0 && bufwinnr(s:C_OutputBufferNumber)!=-1 + exe bufwinnr(s:C_OutputBufferNumber) . "wincmd w" + " buffer number may have changed, e.g. after a 'save as' + if bufnr("%") != s:C_OutputBufferNumber + let s:C_OutputBufferNumber = bufnr(s:C_OutputBufferName) + exe ":bn ".s:C_OutputBufferNumber + endif + else + silent exe ":new ".s:C_OutputBufferName + let s:C_OutputBufferNumber=bufnr("%") + setlocal buftype=nofile + setlocal noswapfile + setlocal syntax=none + setlocal bufhidden=delete + setlocal tabstop=8 + endif + " + " run programm + " + setlocal modifiable + if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) + if s:MSWIN + exe "%!\"".ExeEsc."\" ".l:arguments + else + exe "%!".ExeEsc." ".l:arguments + endif + endif + setlocal nomodifiable + " + if winheight(winnr()) >= line("$") + exe bufwinnr(l:currentbuffernr) . "wincmd w" + endif + " + endif + endif + " + "============================================================================== + " run : run in a detached xterm (not available for MS Windows) + "============================================================================== + if s:C_OutputGvim == "xterm" + " + silent call C_Link() + " + if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) + if s:MSWIN + exe "!\"".ExeEsc."\" ".l:arguments + else + silent exe '!xterm -title '.ExeEsc.' '.s:C_XtermDefaults.' -e '.s:C_Wrapper.' '.ExeEsc.' '.l:arguments.' &' + :redraw! + endif + endif + endif + +endfunction " ---------- end of function C_Run ---------- +" +"------------------------------------------------------------------------------ +" C_Arguments : Arguments for the executable {{{1 +"------------------------------------------------------------------------------ +function! C_Arguments () + let Exe = expand("%:r").s:C_ExeExtension + if Exe == "" + redraw + echohl WarningMsg | echo " no file name " | echohl None + return + endif + let prompt = 'command line arguments for "'.Exe.'" : ' + if exists("b:C_CmdLineArgs") + let b:C_CmdLineArgs= C_Input( prompt, b:C_CmdLineArgs ) + else + let b:C_CmdLineArgs= C_Input( prompt , "" ) + endif +endfunction " ---------- end of function C_Arguments ---------- +" +"---------------------------------------------------------------------- +" C_Toggle_Gvim_Xterm : change output destination {{{1 +"---------------------------------------------------------------------- +function! C_Toggle_Gvim_Xterm () + + if s:C_OutputGvim == "vim" + if has("gui_running") + exe "aunmenu <silent> ".s:C_Root.'&Run.&output:\ VIM->buffer->xterm' + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ BUFFER->xterm->vim <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + endif + let s:C_OutputGvim = "buffer" + else + if s:C_OutputGvim == "buffer" + if has("gui_running") + exe "aunmenu <silent> ".s:C_Root.'&Run.&output:\ BUFFER->xterm->vim' + if (!s:MSWIN) + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ XTERM->vim->buffer <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + else + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ VIM->buffer->xterm <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + endif + endif + if (!s:MSWIN) && (s:C_Display != '') + let s:C_OutputGvim = "xterm" + else + let s:C_OutputGvim = "vim" + end + else + " ---------- output : xterm -> gvim + if has("gui_running") + exe "aunmenu <silent> ".s:C_Root.'&Run.&output:\ XTERM->vim->buffer' + exe "amenu <silent> ".s:C_Root.'&Run.&output:\ VIM->buffer->xterm <C-C>:call C_Toggle_Gvim_Xterm()<CR><CR>' + endif + let s:C_OutputGvim = "vim" + endif + endif + echomsg "output destination is '".s:C_OutputGvim."'" + +endfunction " ---------- end of function C_Toggle_Gvim_Xterm ---------- +" +"------------------------------------------------------------------------------ +" C_XtermSize : xterm geometry {{{1 +"------------------------------------------------------------------------------ +function! C_XtermSize () + let regex = '-geometry\s\+\d\+x\d\+' + let geom = matchstr( s:C_XtermDefaults, regex ) + let geom = matchstr( geom, '\d\+x\d\+' ) + let geom = substitute( geom, 'x', ' ', "" ) + let answer= C_Input(" xterm size (COLUMNS LINES) : ", geom ) + while match(answer, '^\s*\d\+\s\+\d\+\s*$' ) < 0 + let answer= C_Input(" + xterm size (COLUMNS LINES) : ", geom ) + endwhile + let answer = substitute( answer, '\s\+', "x", "" ) " replace inner whitespaces + let s:C_XtermDefaults = substitute( s:C_XtermDefaults, regex, "-geometry ".answer , "" ) +endfunction " ---------- end of function C_XtermSize ---------- +" +"------------------------------------------------------------------------------ +" C_MakeArguments : run make(1) {{{1 +"------------------------------------------------------------------------------ + +let s:C_MakeCmdLineArgs = "" " command line arguments for Run-make; initially empty + +function! C_MakeArguments () + let s:C_MakeCmdLineArgs= C_Input("make command line arguments : ",s:C_MakeCmdLineArgs) +endfunction " ---------- end of function C_MakeArguments ---------- +" +function! C_Make() + " update : write source file if necessary + exe ":update" + " run make + exe ":!make ".s:C_MakeCmdLineArgs +endfunction " ---------- end of function C_Make ---------- +" +"------------------------------------------------------------------------------ +" C_SplintArguments : splint command line arguments {{{1 +"------------------------------------------------------------------------------ +function! C_SplintArguments () + if s:C_SplintIsExecutable==0 + let s:C_HlMessage = ' Splint is not executable or not installed! ' + else + let prompt = 'Splint command line arguments for "'.expand("%").'" : ' + if exists("b:C_SplintCmdLineArgs") + let b:C_SplintCmdLineArgs= C_Input( prompt, b:C_SplintCmdLineArgs ) + else + let b:C_SplintCmdLineArgs= C_Input( prompt , "" ) + endif + endif +endfunction " ---------- end of function C_SplintArguments ---------- +" +"------------------------------------------------------------------------------ +" C_SplintCheck : run splint(1) {{{1 +"------------------------------------------------------------------------------ +function! C_SplintCheck () + if s:C_SplintIsExecutable==0 + let s:C_HlMessage = ' Splint is not executable or not installed! ' + return + endif + let l:currentbuffer=bufname("%") + if &filetype != "c" && &filetype != "cpp" + let s:C_HlMessage = ' "'.l:currentbuffer.'" seems not to be a C/C++ file ' + return + endif + let s:C_HlMessage = "" + exe ":cclose" + silent exe ":update" + let makeprg_saved='"'.&makeprg.'"' + " Windows seems to need this: + if s:MSWIN + :compiler splint + endif + :set makeprg=splint + " + let l:arguments = exists("b:C_SplintCmdLineArgs") ? b:C_SplintCmdLineArgs : ' ' + silent exe "make ".l:arguments." ".escape(l:currentbuffer,s:escfilename) + exe "set makeprg=".makeprg_saved + exe ":botright cwindow" + " + " message in case of success + " + if l:currentbuffer == bufname("%") + let s:C_HlMessage = " Splint --- no warnings for : ".l:currentbuffer + endif +endfunction " ---------- end of function C_SplintCheck ---------- +" +"------------------------------------------------------------------------------ +" C_CodeCheckArguments : CodeCheck command line arguments {{{1 +"------------------------------------------------------------------------------ +function! C_CodeCheckArguments () + if s:C_CodeCheckIsExecutable==0 + let s:C_HlMessage = ' CodeCheck is not executable or not installed! ' + else + let prompt = 'CodeCheck command line arguments for "'.expand("%").'" : ' + if exists("b:C_CodeCheckCmdLineArgs") + let b:C_CodeCheckCmdLineArgs= C_Input( prompt, b:C_CodeCheckCmdLineArgs ) + else + let b:C_CodeCheckCmdLineArgs= C_Input( prompt , s:C_CodeCheckOptions ) + endif + endif +endfunction " ---------- end of function C_CodeCheckArguments ---------- +" +"------------------------------------------------------------------------------ +" C_CodeCheck : run CodeCheck {{{1 +"------------------------------------------------------------------------------ +function! C_CodeCheck () + if s:C_CodeCheckIsExecutable==0 + let s:C_HlMessage = ' CodeCheck is not executable or not installed! ' + return + endif + let l:currentbuffer=bufname("%") + if &filetype != "c" && &filetype != "cpp" + let s:C_HlMessage = ' "'.l:currentbuffer.'" seems not to be a C/C++ file ' + return + endif + let s:C_HlMessage = "" + exe ":cclose" + silent exe ":update" + let makeprg_saved='"'.&makeprg.'"' + exe "set makeprg=".s:C_CodeCheckExeName + " + " match the splint error messages (quickfix commands) + " ignore any lines that didn't match one of the patterns + " + :setlocal errorformat=%f(%l)%m + " + let l:arguments = exists("b:C_CodeCheckCmdLineArgs") ? b:C_CodeCheckCmdLineArgs : "" + if l:arguments == "" + let l:arguments = s:C_CodeCheckOptions + endif + exe ":make ".l:arguments." ".escape( l:currentbuffer, s:escfilename ) + exe ':setlocal errorformat=' + exe "set makeprg=".makeprg_saved + exe ":botright cwindow" + " + " message in case of success + " + if l:currentbuffer == bufname("%") + let s:C_HlMessage = " CodeCheck --- no warnings for : ".l:currentbuffer + endif +endfunction " ---------- end of function C_CodeCheck ---------- +" +"------------------------------------------------------------------------------ +" C_Indent : run indent(1) {{{1 +"------------------------------------------------------------------------------ +" +function! C_Indent ( mode ) + if !executable("indent") + let s:C_HlMessage = ' indent is not executable or not installed! ' + return + endif + let l:currentbuffer=bufname("%") + if &filetype != "c" && &filetype != "cpp" + let s:C_HlMessage = ' "'.l:currentbuffer.'" seems not to be a C/C++ file ' + return + endif + let s:C_HlMessage = "" + + if a:mode=="a" + if C_Input("indent whole file [y/n/Esc] : ", "y" ) != "y" + return + endif + exe ":update" + if has("MSWIN") + silent exe ":%!indent" + else + silent exe ":%!indent 2> ".s:C_IndentErrorLog + endif + let s:C_HlMessage = ' File "'.l:currentbuffer.'" reformatted.' + endif + + if a:mode=="v" + if has("MSWIN") + silent exe ":'<,'>!indent" + else + silent exe ":'<,'>!indent 2> ".s:C_IndentErrorLog + endif + let s:C_HlMessage = ' File "'.l:currentbuffer.'" (lines '.line("'<").'-'.line("'>").') reformatted. ' + endif + + if v:shell_error != 0 + let s:C_HlMessage = ' Indent reported an error when processing file "'.l:currentbuffer.'". ' + endif + +endfunction " ---------- end of function C_Indent ---------- +" +"------------------------------------------------------------------------------ +" C_HlMessage : indent message {{{1 +"------------------------------------------------------------------------------ +function! C_HlMessage () + echohl Search + echo s:C_HlMessage + echohl None +endfunction " ---------- end of function C_HlMessage ---------- +" +"------------------------------------------------------------------------------ +" C_Settings : settings {{{1 +"------------------------------------------------------------------------------ +function! C_Settings () + let txt = " C/C++-Support settings\n\n" + let txt = txt.' author : "'.s:C_Macro['|AUTHOR|']."\"\n" + let txt = txt.' initials : "'.s:C_Macro['|AUTHORREF|']."\"\n" + let txt = txt.' email : "'.s:C_Macro['|EMAIL|']."\"\n" + let txt = txt.' company : "'.s:C_Macro['|COMPANY|']."\"\n" + let txt = txt.' project : "'.s:C_Macro['|PROJECT|']."\"\n" + let txt = txt.' copyright holder : "'.s:C_Macro['|COPYRIGHTHOLDER|']."\"\n" + let txt = txt.' C / C++ compiler : '.s:C_CCompiler.' / '.s:C_CplusCompiler."\n" + let txt = txt.' C file extension : "'.s:C_CExtension.'" (everything else is C++)'."\n" + let txt = txt.' extension for objects : "'.s:C_ObjExtension."\"\n" + let txt = txt.'extension for executables : "'.s:C_ExeExtension."\"\n" + let txt = txt.' compiler flags : "'.s:C_CFlags."\"\n" + let txt = txt.' linker flags : "'.s:C_LFlags."\"\n" + let txt = txt.' libraries : "'.s:C_Libs."\"\n" + let txt = txt.' code snippet directory : '.s:C_CodeSnippets."\n" + if s:installation == 'system' + let txt = txt.'global template directory : '.s:C_GlobalTemplateDir."\n" + if filereadable( s:C_LocalTemplateFile ) + let txt = txt.' local template directory : '.s:C_LocalTemplateDir."\n" + endif + else + let txt = txt.' local template directory : '.s:C_GlobalTemplateDir."\n" + endif + if !s:MSWIN + let txt = txt.' xterm defaults : '.s:C_XtermDefaults."\n" + endif + " ----- dictionaries ------------------------ + if g:C_Dictionary_File != "" + let ausgabe= substitute( g:C_Dictionary_File, ",", ",\n + ", "g" ) + let txt = txt." dictionary file(s) : ".ausgabe."\n" + endif + let txt = txt.' current output dest. : '.s:C_OutputGvim."\n" + " ----- splint ------------------------------ + if s:C_SplintIsExecutable==1 + if exists("b:C_SplintCmdLineArgs") + let ausgabe = b:C_SplintCmdLineArgs + else + let ausgabe = "" + endif + let txt = txt." splint options(s) : ".ausgabe."\n" + endif + " ----- code check -------------------------- + if s:C_CodeCheckIsExecutable==1 + if exists("b:C_CodeCheckCmdLineArgs") + let ausgabe = b:C_CodeCheckCmdLineArgs + else + let ausgabe = s:C_CodeCheckOptions + endif + let txt = txt."CodeCheck (TM) options(s) : ".ausgabe."\n" + endif + let txt = txt."\n" + let txt = txt."__________________________________________________________________________\n" + let txt = txt." C/C++-Support, Version ".g:C_Version." / Dr.-Ing. Fritz Mehner / mehner@fh-swf.de\n\n" + echo txt +endfunction " ---------- end of function C_Settings ---------- +" +"------------------------------------------------------------------------------ +" C_Hardcopy : hardcopy {{{1 +" MSWIN : a printer dialog is displayed +" other : print PostScript to file +"------------------------------------------------------------------------------ +function! C_Hardcopy (arg1) + let Sou = expand("%") + if Sou == "" + redraw + echohl WarningMsg | echo " no file name " | echohl None + return + endif + let Sou = escape(Sou,s:escfilename) " name of the file in the current buffer + let old_printheader=&printheader + exe ':set printheader='.s:C_Printheader + " ----- normal mode ---------------- + if a:arg1=="n" + silent exe "hardcopy > ".Sou.".ps" + if !s:MSWIN + echo "file \"".Sou."\" printed to \"".Sou.".ps\"" + endif + endif + " ----- visual mode ---------------- + if a:arg1=="v" + silent exe "*hardcopy > ".Sou.".ps" + if !s:MSWIN + echo "file \"".Sou."\" (lines ".line("'<")."-".line("'>").") printed to \"".Sou.".ps\"" + endif + endif + exe ':set printheader='.escape( old_printheader, ' %' ) +endfunction " ---------- end of function C_Hardcopy ---------- +" +"------------------------------------------------------------------------------ +" C_HelpCsupport : help csupport {{{1 +"------------------------------------------------------------------------------ +function! C_HelpCsupport () + try + :help csupport + catch + exe ':helptags '.s:plugin_dir.'doc' + :help csupport + endtry +endfunction " ---------- end of function C_HelpCsupport ---------- + +"------------------------------------------------------------------------------ +" C_CreateGuiMenus {{{1 +"------------------------------------------------------------------------------ +let s:C_MenuVisible = 0 " state variable controlling the C-menus +" +function! C_CreateGuiMenus () + if s:C_MenuVisible != 1 + aunmenu <silent> &Tools.Load\ C\ Support + amenu <silent> 40.1000 &Tools.-SEP100- : + amenu <silent> 40.1030 &Tools.Unload\ C\ Support <C-C>:call C_RemoveGuiMenus()<CR> + call C_InitMenus() + let s:C_MenuVisible = 1 + endif +endfunction " ---------- end of function C_CreateGuiMenus ---------- + +"------------------------------------------------------------------------------ +" C_ToolMenu {{{1 +"------------------------------------------------------------------------------ +function! C_ToolMenu () + amenu <silent> 40.1000 &Tools.-SEP100- : + amenu <silent> 40.1030 &Tools.Load\ C\ Support <C-C>:call C_CreateGuiMenus()<CR> +endfunction " ---------- end of function C_ToolMenu ---------- + +"------------------------------------------------------------------------------ +" C_RemoveGuiMenus {{{1 +"------------------------------------------------------------------------------ +function! C_RemoveGuiMenus () + if s:C_MenuVisible == 1 + if s:C_Root == "" + aunmenu <silent> Comments + aunmenu <silent> Statements + aunmenu <silent> Preprocessor + aunmenu <silent> Idioms + aunmenu <silent> Snippets + aunmenu <silent> C++ + aunmenu <silent> Run + else + exe "aunmenu <silent> ".s:C_Root + endif + " + aunmenu <silent> &Tools.Unload\ C\ Support + call C_ToolMenu() + " + let s:C_MenuVisible = 0 + endif +endfunction " ---------- end of function C_RemoveGuiMenus ---------- + +"------------------------------------------------------------------------------ +" C_RebuildTemplates +" rebuild commands and the menu from the (changed) template file +"------------------------------------------------------------------------------ +function! C_RebuildTemplates () + let s:C_Template = {} + let s:C_FileVisited = [] + call C_ReadTemplates(s:C_GlobalTemplateFile) + echomsg "templates rebuilt from '".s:C_GlobalTemplateFile."'" + " + if s:installation == 'system' && filereadable( s:C_LocalTemplateFile ) + call C_ReadTemplates( s:C_LocalTemplateFile ) + echomsg " and from '".s:C_LocalTemplateFile."'" + endif +endfunction " ---------- end of function C_RebuildTemplates ---------- + +"------------------------------------------------------------------------------ +" C_ReadTemplates +" read the template file(s), build the macro and the template dictionary +" +"------------------------------------------------------------------------------ +function! C_ReadTemplates ( templatefile ) + + if !filereadable( a:templatefile ) + echohl WarningMsg + echomsg "C/C++ template file '".a:templatefile."' does not exist or is not readable" + echohl None + return + endif + + let skipmacros = 0 + let s:C_FileVisited += [a:templatefile] + + "------------------------------------------------------------------------------ + " read template file, start with an empty template dictionary + "------------------------------------------------------------------------------ + + let item = '' + for line in readfile( a:templatefile ) + " if not a comment : + if line !~ '^\$' + " + " macros and file includes + " + + let string = matchlist( line, s:C_MacroLineRegex ) + if !empty(string) && skipmacros == 0 + let key = '|'.string[1].'|' + let val = string[2] + let val = substitute( val, '\s\+$', '', '' ) + let val = substitute( val, "[\"\']$", '', '' ) + let val = substitute( val, "^[\"\']", '', '' ) + " + if key == '|includefile|' && count( s:C_FileVisited, val ) == 0 + let path = fnamemodify( a:templatefile, ":p:h" ) + call C_ReadTemplates( path.'/'.val ) " recursive call + else + let s:C_Macro[key] = val + endif + continue " next line + endif + " + " template header + " + let name = matchstr( line, s:C_TemplateLineRegex ) + " + if name != '' + let part = split( name, '\s*==\s*') + let item = part[0] + if has_key( s:C_Template, item ) && s:C_TemplateOverwrittenMsg == 'yes' + echomsg "existing C/C++ template '".item."' overwritten" + endif + let s:C_Template[item] = '' + let skipmacros = 1 + " + let s:C_Attribute[item] = 'below' + if has_key( s:Attribute, get( part, 1, 'NONE' ) ) + let s:C_Attribute[item] = part[1] + endif + else + if item != '' + let s:C_Template[item] = s:C_Template[item].line."\n" + endif + endif + endif + endfor + + call C_SetSmallCommentStyle() +endfunction " ---------- end of function C_ReadTemplates ---------- + +"------------------------------------------------------------------------------ +" C_InsertTemplate +" insert a template from the template dictionary +" do macro expansion +"------------------------------------------------------------------------------ +function! C_InsertTemplate ( key, ... ) + + if !has_key( s:C_Template, a:key ) + echomsg "Template '".a:key."' not found. Please check your template file in '".s:C_GlobalTemplateDir."'" + return + endif + + "------------------------------------------------------------------------------ + " insert the user macros + "------------------------------------------------------------------------------ + + " use internal formatting to avoid conficts when using == below + " + let equalprg_save = &equalprg + set equalprg= + + let mode = s:C_Attribute[a:key] + + " remove <SPLIT> and insert the complete macro + " + if a:0 == 0 + let val = C_ExpandUserMacros (a:key) + if val == "" + return + endif + let val = C_ExpandSingleMacro( val, '<SPLIT>', '' ) + + if mode == 'below' + let pos1 = line(".")+1 + put =val + let pos2 = line(".") + " proper indenting + exe ":".pos1 + let ins = pos2-pos1+1 + exe "normal ".ins."==" + endif + + if mode == 'above' + let pos1 = line(".") + put! =val + let pos2 = line(".") + " proper indenting + exe ":".pos1 + let ins = pos2-pos1+1 + exe "normal ".ins."==" + endif + + if mode == 'start' + normal gg + let pos1 = 1 + put! =val + let pos2 = line(".") + " proper indenting + exe ":".pos1 + let ins = pos2-pos1+1 + exe "normal ".ins."==" + endif + + if mode == 'append' + let pos1 = line(".") + put =val + let pos2 = line(".")-1 + exe ":".pos1 + :join! + endif + + if mode == 'insert' + let val = substitute( val, '\n$', '', '' ) + let pos1 = line(".") + let pos2 = pos1 + count( split(val,'\zs'), "\n" ) + exe "normal a".val + endif + " + else + " + " ===== visual mode =============================== + " + if a:1 == 'v' + let val = C_ExpandUserMacros (a:key) + if val == "" + return + endif + + let part = split( val, '<SPLIT>' ) + if len(part) < 2 + let part = [ "" ] + part + echomsg 'SPLIT missing in template '.a:key + endif + + if mode == 'below' + + :'<put! =part[0] + :'>put =part[1] + + let pos1 = line("'<") - len(split(part[0], '\n' )) + let pos2 = line("'>") + len(split(part[1], '\n' )) + "" echo part[0] part[1] pos1 pos2 + " " proper indenting + exe ":".pos1 + let ins = pos2-pos1+1 + exe "normal ".ins."==" + endif + + " + endif + endif + + " restore formatter programm + let &equalprg = equalprg_save + + "------------------------------------------------------------------------------ + " position the cursor + "------------------------------------------------------------------------------ + exe ":".pos1 + let mtch = search( '<CURSOR>', "c", pos2 ) + if mtch != 0 + if matchend( getline(mtch) ,'<CURSOR>') == match( getline(mtch) ,"$" ) + normal 8x + :startinsert! + else + normal 8x + :startinsert + endif + else + " to the end of the block; needed for repeated inserts + if mode == 'below' + exe ":".pos2 + endif + endif + +endfunction " ---------- end of function C_InsertTemplate ---------- + +"------------------------------------------------------------------------------ +" C_ExpandUserMacros +"------------------------------------------------------------------------------ +function! C_ExpandUserMacros ( key ) + + let template = s:C_Template[ a:key ] + let s:C_ExpansionCounter = {} " reset the expansion counter + + "------------------------------------------------------------------------------ + " renew the predefined macros and expand them + " can be replaced, with e.g. |?DATE| + "------------------------------------------------------------------------------ + let s:C_Macro['|BASENAME|'] = toupper(expand("%:t:r")) + let s:C_Macro['|DATE|'] = C_InsertDateAndTime('d') + let s:C_Macro['|FILENAME|'] = expand("%:t") + let s:C_Macro['|PATH|'] = expand("%:p:h") + let s:C_Macro['|SUFFIX|'] = expand("%:e") + let s:C_Macro['|TIME|'] = C_InsertDateAndTime('t') + let s:C_Macro['|YEAR|'] = C_InsertDateAndTime('y') + + "------------------------------------------------------------------------------ + " look for replacements + "------------------------------------------------------------------------------ + while match( template, s:C_ExpansionRegex ) != -1 + let macro = matchstr( template, s:C_ExpansionRegex ) + let replacement = substitute( macro, '?', '', '' ) + let template = substitute( template, macro, replacement, "g" ) + + let match = matchlist( macro, s:C_ExpansionRegex ) + + if match[1] != '' + let macroname = '|'.match[1].'|' + " + " notify flag action, if any + let flagaction = '' + if has_key( s:C_MacroFlag, match[2] ) + let flagaction = ' (-> '.s:C_MacroFlag[ match[2] ].')' + endif + " + " ask for a replacement + if has_key( s:C_Macro, macroname ) + let name = C_Input( match[1].flagaction.' : ', C_ApplyFlag( s:C_Macro[macroname], match[2] ) ) + else + let name = C_Input( match[1].flagaction.' : ', '' ) + endif + if name == "" + return "" + endif + " + " keep the modified name + let s:C_Macro[macroname] = C_ApplyFlag( name, match[2] ) + endif + endwhile + + "------------------------------------------------------------------------------ + " do the actual macro expansion + " loop over the macros found in the template + "------------------------------------------------------------------------------ + while match( template, s:C_NonExpansionRegex ) != -1 + + let macro = matchstr( template, s:C_NonExpansionRegex ) + let match = matchlist( macro, s:C_NonExpansionRegex ) + + if match[1] != '' + let macroname = '|'.match[1].'|' + + if has_key( s:C_Macro, macroname ) + "------------------------------------------------------------------------------- + " check for recursion + "------------------------------------------------------------------------------- + if has_key( s:C_ExpansionCounter, macroname ) + let s:C_ExpansionCounter[macroname] += 1 + else + let s:C_ExpansionCounter[macroname] = 0 + endif + if s:C_ExpansionCounter[macroname] >= s:C_ExpansionLimit + echomsg " recursion terminated for recursive macro ".macroname + return template + endif + "------------------------------------------------------------------------------- + " replace + "------------------------------------------------------------------------------- + let replacement = C_ApplyFlag( s:C_Macro[macroname], match[2] ) + let template = substitute( template, macro, replacement, "g" ) + else + " + " macro not yet defined + let s:C_Macro['|'.match[1].'|'] = '' + endif + endif + + endwhile + + return template +endfunction " ---------- end of function C_ExpandUserMacros ---------- + +"------------------------------------------------------------------------------ +" C_ApplyFlag +"------------------------------------------------------------------------------ +function! C_ApplyFlag ( val, flag ) + " + " l : lowercase + if a:flag == ':l' + return tolower(a:val) + end + " + " u : uppercase + if a:flag == ':u' + return toupper(a:val) + end + " + " c : capitalize + if a:flag == ':c' + return toupper(a:val[0]).a:val[1:] + end + " + " L : legalized name + if a:flag == ':L' + return C_LegalizeName(a:val) + end + " + " flag not valid + return a:val +endfunction " ---------- end of function C_ApplyFlag ---------- +" +"------------------------------------------------------------------------------ +" C_ExpandSingleMacro +"------------------------------------------------------------------------------ +function! C_ExpandSingleMacro ( val, macroname, replacement ) + return substitute( a:val, escape(a:macroname, '$' ), a:replacement, "g" ) +endfunction " ---------- end of function C_ExpandSingleMacro ---------- + +"------------------------------------------------------------------------------ +" C_SetSmallCommentStyle +"------------------------------------------------------------------------------ +function! C_SetSmallCommentStyle () + if has_key( s:C_Template, 'comment.end-of-line-comment' ) + if match( s:C_Template['comment.end-of-line-comment'], '^\s*/\*' ) != -1 + let s:C_Com1 = '/*' " C-style : comment start + let s:C_Com2 = '*/' " C-style : comment end + else + let s:C_Com1 = '//' " C++style : comment start + let s:C_Com2 = '' " C++style : comment end + endif + endif +endfunction " ---------- end of function C_SetSmallCommentStyle ---------- + +"------------------------------------------------------------------------------ +" C_InsertMacroValue +"------------------------------------------------------------------------------ +function! C_InsertMacroValue ( key ) + if col(".") > 1 + exe 'normal a'.s:C_Macro['|'.a:key.'|'] + else + exe 'normal i'.s:C_Macro['|'.a:key.'|'] + end +endfunction " ---------- end of function C_InsertMacroValue ---------- + +"------------------------------------------------------------------------------ +" date and time +"------------------------------------------------------------------------------ +function! C_InsertDateAndTime ( format ) + if a:format == 'd' + return strftime( s:C_FormatDate ) + end + if a:format == 't' + return strftime( s:C_FormatTime ) + end + if a:format == 'dt' + return strftime( s:C_FormatDate ).' '.strftime( s:C_FormatTime ) + end + if a:format == 'y' + return strftime( s:C_FormatYear ) + end +endfunction " ---------- end of function C_InsertDateAndTime ---------- + +"------------------------------------------------------------------------------ +" show / hide the c-support menus +" define key mappings (gVim only) +"------------------------------------------------------------------------------ +" +if has("gui_running") + " + call C_ToolMenu() + " + if s:C_LoadMenus == 'yes' + call C_CreateGuiMenus() + endif + " + nmap <unique> <silent> <Leader>lcs :call C_CreateGuiMenus()<CR> + nmap <unique> <silent> <Leader>ucs :call C_RemoveGuiMenus()<CR> + " +endif + +"------------------------------------------------------------------------------ +" Automated header insertion +" Local settings for the quickfix window +"------------------------------------------------------------------------------ +if has("autocmd") + " + " Automated header insertion (suffixes from the gcc manual) + " + autocmd BufNewFile * if (&filetype=='cpp' || &filetype=='c') | + \ call C_InsertTemplate("comment.file-description") | endif + " + " *.h has filetype 'cpp' by default; this can be changed to 'c' : + " + if s:C_TypeOfH=='c' + autocmd BufNewFile,BufEnter *.h :set filetype=c + endif + " + " C/C++ source code files which should not be preprocessed. + " + autocmd BufNewFile,BufRead *.i :set filetype=c + autocmd BufNewFile,BufRead *.ii :set filetype=cpp + " + " Wrap error descriptions in the quickfix window. + " + autocmd BufReadPost quickfix setlocal wrap | setlocal linebreak + " +endif " has("autocmd") +" +"------------------------------------------------------------------------------ +" READ THE TEMPLATE FILES +"------------------------------------------------------------------------------ +call C_ReadTemplates(s:C_GlobalTemplateFile) +if s:installation == 'system' && filereadable( s:C_LocalTemplateFile ) + call C_ReadTemplates( s:C_LocalTemplateFile ) +endif + +" +"===================================================================================== +" vim: tabstop=2 shiftwidth=2 foldmethod=marker diff --git a/dot_vim/plugin/filebrowser.vim b/dot_vim/plugin/filebrowser.vim new file mode 100644 index 0000000..e9de049 --- /dev/null +++ b/dot_vim/plugin/filebrowser.vim @@ -0,0 +1,251 @@ +" filebrowser.vim: utility file for vim 6.2+ +" +" Copyright: Srinath Avadhanula <srinath AT fastmail DOT fm> +" Parts of this file are taken from explorer.vim which is a plugin file +" distributed with vim under the Vim charityware license. +" License: distributed under the Vim charityware license. +" +" Settings: +" FB_CallBackFunction: the function name which gets called when the user +" presses <cr> on a file-name in the file browser. +" FB_AllowRegexp: A filename has to match this regexp to be displayed. +" FB_RejectRegexp: If a filename matches this regexp, then its not displayed. +" (Both these regexps are '' by default which means no filtering is +" done). + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +"====================================================================== +" Globally visible functions (API) +"====================================================================== +" FB_OpenFileBrowser: opens a new buffer and displays the file list {{{ +" Description: +function! FB_OpenFileBrowser(dir) + if !isdirectory(a:dir) + return + endif + if exists('s:FB_BufferNumber') + if bufwinnr(s:FB_BufferNumber) != -1 + execute bufwinnr(s:FB_BufferNumber).' wincmd w' + return + endif + execute 'aboveleft split #'.s:FB_BufferNumber + else + aboveleft split __Choose_File__ + let s:FB_BufferNumber = bufnr('%') + endif + call FB_DisplayFiles(a:dir) +endfunction " }}} +" FB_DisplayFiles: displays the files in a given directory {{{ +" Description: +" Call this function only when the cursor is in a temporary buffer +function! FB_DisplayFiles(dir) + if !isdirectory(a:dir) + return + endif + call s:FB_SetSilentSettings() + " make this a "scratch" buffer + call s:FB_SetScratchSettings() + + let allowRegexp = s:FB_GetVar('FB_AllowRegexp', '') + let rejectRegexp = s:FB_GetVar('FB_RejectRegexp', '') + + " change to the directory to make processing simpler. + execute "lcd ".a:dir + " delete everything in the buffer. + " IMPORTANT: we need to be in a scratch buffer + 0,$ d_ + + let allFilenames = glob('*') + let dispFiles = "" + let subDirs = "../\n" + + let i = 1 + while 1 + let filename = s:FB_Strntok(allFilenames, "\n", i) + if filename == '' + break + endif + if isdirectory(filename) + let subDirs = subDirs.filename."/\n" + else + if allowRegexp != '' && filename !~ allowRegexp + elseif rejectRegexp != '' && filename =~ rejectRegexp + else + let dispFiles = dispFiles.filename."\n" + endif + endif + let i = i + 1 + endwhile + 0put!=dispFiles + 0put!=subDirs + " delte the last empty line resulting from the put + $ d_ + + call s:FB_SetHighlighting() + call s:FB_DisplayHelp() + call s:FB_SetMaps() + + " goto the first file/directory + 0 + call search('^"=', 'w') + normal! j:<bs> + + set nomodified nomodifiable + + call s:FB_ResetSilentSettings() +endfunction " }}} +" FB_SetVar: sets script local variables from outside this script {{{ +" Description: +function! FB_SetVar(varname, value) + let s:{a:varname} = a:value +endfunction " }}} + +" FB_SetHighlighting: sets syntax highlighting for the buffer {{{ +" Description: +" Origin: from explorer.vim in vim +function! <SID>FB_SetHighlighting() + " Set up syntax highlighting + " Something wrong with the evaluation of the conditional though... + if has("syntax") && exists("g:syntax_on") && !has("syntax_items") + syn match browseSynopsis "^\"[ -].*" + syn match browseDirectory "[^\"].*/ " + syn match browseDirectory "[^\"].*/$" + syn match browseCurDir "^\"= .*$" + syn match browseSortBy "^\" Sorted by .*$" contains=browseSuffixInfo + syn match browseSuffixInfo "(.*)$" contained + syn match browseFilter "^\" Not Showing:.*$" + syn match browseFiletime "«\d\+$" + + "hi def link browseSynopsis PreProc + hi def link browseSynopsis Special + hi def link browseDirectory Directory + hi def link browseCurDir Statement + hi def link browseSortBy String + hi def link browseSuffixInfo Type + hi def link browseFilter String + hi def link browseFiletime Ignore + hi def link browseSuffixes Type + endif +endfunction " }}} +" FB_SetMaps: sets buffer local maps {{{ +" Description: +function! <SID>FB_SetMaps() + nnoremap <buffer> <silent> q :bdelete<cr> + nnoremap <buffer> <silent> C :call FB_DisplayFiles(getcwd())<CR> + nnoremap <buffer> <silent> <esc> :bdelete<cr> + nnoremap <buffer> <silent> <CR> :call <SID>FB_EditEntry()<CR> + nnoremap <buffer> <silent> ? :call <SID>FB_ToggleHelp()<CR> + + " lock the user in this window + nnoremap <buffer> <C-w> <nop> +endfunction " }}} +" FB_SetSilentSettings: some settings which make things silent {{{ +" Description: +" Origin: from explorer.vim distributed with vim. +function! <SID>FB_SetSilentSettings() + let s:save_report=&report + let s:save_showcmd = &sc + set report=10000 noshowcmd +endfunction +" FB_ResetSilentSettings: reset settings set by FB_SetSilentSettings +" Description: +function! <SID>FB_ResetSilentSettings() + let &report=s:save_report + let &showcmd = s:save_showcmd +endfunction " }}} +" FB_SetScratchSettings: makes the present buffer a scratch buffer {{{ +" Description: +function! <SID>FB_SetScratchSettings() + " Turn off the swapfile, set the buffer type so that it won't get + " written, and so that it will get deleted when it gets hidden. + setlocal noreadonly modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + " Don't wrap around long lines + setlocal nowrap +endfunction + +" }}} +" FB_ToggleHelp: toggles verbosity of help {{{ +" Description: +function! <SID>FB_ToggleHelp() + let s:FB_VerboseHelp = 1 - s:FB_GetVar('FB_VerboseHelp', 0) + + call FB_DisplayFiles('.') +endfunction " }}} +" FB_DisplayHelp: displays a helpful header {{{ +" Description: +function! <SID>FB_DisplayHelp() + let verboseHelp = s:FB_GetVar('FB_VerboseHelp', 0) + if verboseHelp + let txt = + \ "\" <cr>: on file, choose the file and quit\n" + \ ."\" on dir, enter directory\n" + \ ."\" q/<esc>: quit without choosing\n" + \ ."\" C: change directory to getcwd()\n" + \ ."\" ?: toggle help verbosity\n" + \ ."\"= ".getcwd() + else + let txt = "\" ?: toggle help verbosity\n" + \ ."\"= ".getcwd() + endif + 0put!=txt +endfunction " }}} + +" Handles various actions in the file-browser +" FB_EditEntry: handles the user pressing <enter> on a line {{{ +" Description: +function! <SID>FB_EditEntry() + let line = getline('.') + + if isdirectory(line) + call FB_DisplayFiles(line) + endif + + " If the user has a call back function defined on choosing a file, handle + " it. + let cbf = s:FB_GetVar('FB_CallBackFunction', '') + if cbf != '' && line !~ '^" ' && filereadable(line) + let fname = fnamemodify(line, ':p') + bdelete + + let arguments = s:FB_GetVar('FB_CallBackFunctionArgs', '') + if arguments != '' + let arguments = ','.arguments + endif + call Tex_Debug('arguments = '.arguments, 'fb') + call Tex_Debug("call ".cbf."('".fname."'".arguments.')', 'fb') + exec "call ".cbf."('".fname."'".arguments.')' + endif +endfunction " }}} + +" FB_Strntok (string, tok, n) {{{ +" extract the n^th token from s seperated by tok. +" example: FB_Strntok('1,23,3', ',', 2) = 23 +fun! <SID>FB_Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun " }}} +" FB_GetVar: gets the most local value of a variable {{{ +function! <SID>FB_GetVar(name, default) + if exists('s:'.a:name) + return s:{a:name} + elseif exists('w:'.a:name) + return w:{a:name} + elseif exists('b:'.a:name) + return b:{a:name} + elseif exists('g:'.a:name) + return g:{a:name} + else + return a:default + endif +endfunction + +" }}} + +let &cpo = s:save_cpo + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/dot_vim/plugin/gnupg.vim b/dot_vim/plugin/gnupg.vim new file mode 100644 index 0000000..e2e7665 --- /dev/null +++ b/dot_vim/plugin/gnupg.vim @@ -0,0 +1,1226 @@ +" Name: gnupg.vim +" Last Change: 2011 Nov 23 +" Maintainer: James McCoy <vega.james@gmail.com> +" Original Author: Markus Braun <markus.braun@krawel.de> +" Summary: Vim plugin for transparent editing of gpg encrypted files. +" License: This program is free software; you can redistribute it and/or +" modify it under the terms of the GNU General Public License +" as published by the Free Software Foundation; either version +" 2 of the License, or (at your option) any later version. +" See http://www.gnu.org/copyleft/gpl-2.0.txt +" +" Section: Documentation {{{1 +" +" Description: {{{2 +" +" This script implements transparent editing of gpg encrypted files. The +" filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening such +" a file the content is decrypted, when opening a new file the script will +" ask for the recipients of the encrypted file. The file content will be +" encrypted to all recipients before it is written. The script turns off +" viminfo and swapfile to increase security. +" +" Installation: {{{2 +" +" Copy the gnupg.vim file to the $HOME/.vim/plugin directory. +" Refer to ':help add-plugin', ':help add-global-plugin' and ':help +" runtimepath' for more details about Vim plugins. +" +" From "man 1 gpg-agent": +" +" ... +" You should always add the following lines to your .bashrc or whatever +" initialization file is used for all shell invocations: +" +" GPG_TTY=`tty` +" export GPG_TTY +" +" It is important that this environment variable always reflects the out†+" put of the tty command. For W32 systems this option is not required. +" ... +" +" Most distributions provide software to ease handling of gpg and gpg-agent. +" Examples are keychain or seahorse. +" +" Commands: {{{2 +" +" :GPGEditRecipients +" Opens a scratch buffer to change the list of recipients. Recipients that +" are unknown (not in your public key) are highlighted and have +" a prepended "!". Closing the buffer makes the changes permanent. +" +" :GPGViewRecipients +" Prints the list of recipients. +" +" :GPGEditOptions +" Opens a scratch buffer to change the options for encryption (symmetric, +" asymmetric, signing). Closing the buffer makes the changes permanent. +" WARNING: There is no check of the entered options, so you need to know +" what you are doing. +" +" :GPGViewOptions +" Prints the list of options. +" +" Variables: {{{2 +" +" g:GPGExecutable +" If set used as gpg executable, otherwise the system chooses what is run +" when "gpg" is called. Defaults to "gpg". +" +" g:GPGUseAgent +" If set to 0 a possible available gpg-agent won't be used. Defaults to 1. +" +" g:GPGPreferSymmetric +" If set to 1 symmetric encryption is preferred for new files. Defaults to 0. +" +" g:GPGPreferArmor +" If set to 1 armored data is preferred for new files. Defaults to 0 +" unless a "*.asc" file is being edited. +" +" g:GPGPreferSign +" If set to 1 signed data is preferred for new files. Defaults to 0. +" +" g:GPGDefaultRecipients +" If set, these recipients are used as defaults when no other recipient is +" defined. This variable is a Vim list. Default is unset. +" +" g:GPGUsePipes +" If set to 1, use pipes instead of temporary files when interacting with +" gnupg. When set to 1, this can cause terminal-based gpg agents to not +" display correctly when prompting for passwords. Defaults to 0. +" +" Known Issues: {{{2 +" +" In some cases gvim can't decrypt files + +" This is caused by the fact that a running gvim has no TTY and thus gpg is +" not able to ask for the passphrase by itself. This is a problem for Windows +" and Linux versions of gvim and could not be solved unless a "terminal +" emulation" is implemented for gvim. To circumvent this you have to use any +" combination of gpg-agent and a graphical pinentry program: +" +" - gpg-agent only: +" you need to provide the passphrase for the needed key to gpg-agent +" in a terminal before you open files with gvim which require this key. +" +" - pinentry only: +" you will get a popup window every time you open a file that needs to +" be decrypted. +" +" - gpgagent and pinentry: +" you will get a popup window the first time you open a file that +" needs to be decrypted. +" +" Credits: {{{2 +" +" - Mathieu Clabaut for inspirations through his vimspell.vim script. +" - Richard Bronosky for patch to enable ".pgp" suffix. +" - Erik Remmelzwaal for patch to enable windows support and patient beta +" testing. +" - Lars Becker for patch to make gpg2 working. +" - Thomas Arendsen Hein for patch to convert encoding of gpg output. +" - Karl-Heinz Ruskowski for patch to fix unknown recipients and trust model +" and patient beta testing. +" - Giel van Schijndel for patch to get GPG_TTY dynamically. +" - Sebastian Luettich for patch to fix issue with symmetric encryption an set +" recipients. +" - Tim Swast for patch to generate signed files. +" - James Vega for patches for better '*.asc' handling, better filename +" escaping and better handling of multiple keyrings. +" +" Section: Plugin header {{{1 + +" guard against multiple loads {{{2 +if (exists("g:loaded_gnupg") || &cp || exists("#BufReadCmd*.\(gpg\|asc\|pgp\)")) + finish +endif +let g:loaded_gnupg = '2.3' +let s:GPGInitRun = 0 + +" check for correct vim version {{{2 +if (v:version < 702) + echohl ErrorMsg | echo 'plugin gnupg.vim requires Vim version >= 7.2' | echohl None + finish +endif + +" Section: Autocmd setup {{{1 + +augroup GnuPG + autocmd! + + " do the decryption + autocmd BufReadCmd,FileReadCmd *.\(gpg\|asc\|pgp\) call s:GPGInit() + autocmd BufReadCmd,FileReadCmd *.\(gpg\|asc\|pgp\) call s:GPGDecrypt() + autocmd BufReadCmd *.\(gpg\|asc\|pgp\) call s:GPGBufReadPost() + + " convert all text to encrypted text before writing + autocmd BufWriteCmd,FileWriteCmd *.\(gpg\|asc\|pgp\) call s:GPGInit() + autocmd BufWriteCmd,FileWriteCmd *.\(gpg\|asc\|pgp\) call s:GPGEncrypt() + + " cleanup on leaving vim + autocmd VimLeave *.\(gpg\|asc\|pgp\) call s:GPGCleanup() +augroup END + +" Section: Constants {{{1 + +let s:GPGMagicString = "\t \t" + +" Section: Highlight setup {{{1 + +highlight default link GPGWarning WarningMsg +highlight default link GPGError ErrorMsg +highlight default link GPGHighlightUnknownRecipient ErrorMsg + +" Section: Functions {{{1 + +" Function: s:GPGInit() {{{2 +" +" initialize the plugin +" +function s:GPGInit() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGInit()") + + " we don't want a swap file, as it writes unencrypted data to disk + setl noswapfile + + " if persistent undo is present, disable it for this buffer + if exists('+undofile') + setl noundofile + endif + + " the rest only has to be run once + if s:GPGInitRun + return + endif + + " first make sure nothing is written to ~/.viminfo while editing + " an encrypted file. + set viminfo= + + " check what gpg command to use + if (!exists("g:GPGExecutable")) + let g:GPGExecutable = "gpg --trust-model always" + endif + + " check if gpg-agent is allowed + if (!exists("g:GPGUseAgent")) + let g:GPGUseAgent = 1 + endif + + " check if symmetric encryption is preferred + if (!exists("g:GPGPreferSymmetric")) + let g:GPGPreferSymmetric = 0 + endif + + " check if armored files are preferred + if (!exists("g:GPGPreferArmor")) + " .asc files should be armored as that's what the extension is used for + if expand('<afile>') =~ '\.asc$' + let g:GPGPreferArmor = 1 + else + let g:GPGPreferArmor = 0 + endif + endif + + " check if signed files are preferred + if (!exists("g:GPGPreferSign")) + let g:GPGPreferSign = 0 + endif + + " start with empty default recipients if none is defined so far + if (!exists("g:GPGDefaultRecipients")) + let g:GPGDefaultRecipients = [] + endif + + " prefer not to use pipes since it can garble gpg agent display + if (!exists("g:GPGUsePipes")) + let g:GPGUsePipes = 0 + endif + + " allow alternate gnupg homedir + if (!exists('g:GPGHomedir')) + let g:GPGHomedir = '' + endif + + " print version + call s:GPGDebug(1, "gnupg.vim ". g:loaded_gnupg) + + " determine if gnupg can use the gpg-agent + if (exists("$GPG_AGENT_INFO") && g:GPGUseAgent == 1) + if (!exists("$GPG_TTY") && !has("gui_running")) + let $GPG_TTY = system("tty") + if (v:shell_error) + let $GPG_TTY = "" + echohl GPGError + echom "The GPG_TTY is not set and no TTY could be found using the `tty` command!" + echom "gpg-agent might not work." + echohl None + endif + endif + let s:GPGCommand = g:GPGExecutable . " --use-agent" + else + let s:GPGCommand = g:GPGExecutable . " --no-use-agent" + endif + + " don't use tty in gvim except for windows: we get their a tty for free. + " FIXME find a better way to avoid an error. + " with this solution only --use-agent will work + if (has("gui_running") && !has("gui_win32")) + let s:GPGCommand = s:GPGCommand . " --no-tty" + endif + + " setup shell environment for unix and windows + let s:shellredirsave = &shellredir + let s:shellsave = &shell + let s:shelltempsave = &shelltemp + " noshelltemp isn't currently supported on Windows, but it doesn't cause any + " errors and this future proofs us against requiring changes if Windows + " gains noshelltemp functionality + let s:shelltemp = !g:GPGUsePipes + if (has("unix")) + " unix specific settings + let s:shellredir = ">%s 2>&1" + let s:shell = '/bin/sh' + let s:stderrredirnull = '2>/dev/null' + let s:GPGCommand = "LANG=C LC_ALL=C " . s:GPGCommand + else + " windows specific settings + let s:shellredir = '>%s' + let s:shell = &shell + let s:stderrredirnull = '2>nul' + endif + + call s:GPGDebug(3, "shellredirsave: " . s:shellredirsave) + call s:GPGDebug(3, "shellsave: " . s:shellsave) + call s:GPGDebug(3, "shelltempsave: " . s:shelltempsave) + + call s:GPGDebug(3, "shell: " . s:shell) + call s:GPGDebug(3, "shellcmdflag: " . &shellcmdflag) + call s:GPGDebug(3, "shellxquote: " . &shellxquote) + call s:GPGDebug(3, "shellredir: " . s:shellredir) + call s:GPGDebug(3, "stderrredirnull: " . s:stderrredirnull) + + call s:GPGDebug(3, "shell implementation: " . resolve(s:shell)) + + " find the supported algorithms + let output = s:GPGSystem({ 'level': 2, 'args': '--version' }) + + let s:GPGPubkey = substitute(output, ".*Pubkey: \\(.\\{-}\\)\n.*", "\\1", "") + let s:GPGCipher = substitute(output, ".*Cipher: \\(.\\{-}\\)\n.*", "\\1", "") + let s:GPGHash = substitute(output, ".*Hash: \\(.\\{-}\\)\n.*", "\\1", "") + let s:GPGCompress = substitute(output, ".*Compress.\\{-}: \\(.\\{-}\\)\n.*", "\\1", "") + + call s:GPGDebug(2, "public key algorithms: " . s:GPGPubkey) + call s:GPGDebug(2, "cipher algorithms: " . s:GPGCipher) + call s:GPGDebug(2, "hashing algorithms: " . s:GPGHash) + call s:GPGDebug(2, "compression algorithms: " . s:GPGCompress) + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGInit()") + let s:GPGInitRun = 1 +endfunction + +" Function: s:GPGCleanup() {{{2 +" +" cleanup on leaving vim +" +function s:GPGCleanup() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGCleanup()") + + " wipe out screen + new +only + redraw! + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGCleanup()") +endfunction + +" Function: s:GPGDecrypt() {{{2 +" +" decrypt the buffer and find all recipients of the encrypted file +" +function s:GPGDecrypt() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGDecrypt()") + + " get the filename of the current buffer + let filename = expand("<afile>:p") + + " clear GPGRecipients and GPGOptions + let b:GPGRecipients = g:GPGDefaultRecipients + let b:GPGOptions = [] + + " File doesn't exist yet, so nothing to decrypt + if empty(glob(filename)) + return + endif + + " Only let this if the file actually exists, otherwise GPG functionality + " will be disabled when editing a buffer that doesn't yet have a backing + " file + let b:GPGEncrypted = 0 + + " find the recipients of the file + let cmd = { 'level': 3 } + let cmd.args = '--verbose --decrypt --list-only --dry-run --batch --no-use-agent --logger-fd 1 ' . shellescape(filename) + let output = s:GPGSystem(cmd) + + let asymmPattern = 'gpg: public key is \%(0x\)\=[[:xdigit:]]\{8,16}' + " check if the file is symmetric/asymmetric encrypted + if (match(output, "gpg: encrypted with [[:digit:]]\\+ passphrase") >= 0) + " file is symmetric encrypted + let b:GPGEncrypted = 1 + call s:GPGDebug(1, "this file is symmetric encrypted") + + let b:GPGOptions += ["symmetric"] + + " find the used cipher algorithm + let cipher = substitute(output, ".*gpg: \\([^ ]\\+\\) encrypted data.*", "\\1", "") + if (match(s:GPGCipher, "\\<" . cipher . "\\>") >= 0) + let b:GPGOptions += ["cipher-algo " . cipher] + call s:GPGDebug(1, "cipher-algo is " . cipher) + else + echohl GPGWarning + echom "The cipher " . cipher . " is not known by the local gpg command. Using default!" + echo + echohl None + endif + elseif (match(output, asymmPattern) >= 0) + " file is asymmetric encrypted + let b:GPGEncrypted = 1 + call s:GPGDebug(1, "this file is asymmetric encrypted") + + let b:GPGOptions += ["encrypt"] + + " find the used public keys + let start = match(output, asymmPattern) + while (start >= 0) + let start = start + strlen("gpg: public key is ") + let recipient = matchstr(output, '[[:xdigit:]]\{8,16}', start) + call s:GPGDebug(1, "recipient is " . recipient) + let name = s:GPGNameToID(recipient) + if (strlen(name) > 0) + let b:GPGRecipients += [name] + call s:GPGDebug(1, "name of recipient is " . name) + else + let b:GPGRecipients += [recipient] + echohl GPGWarning + echom "The recipient \"" . recipient . "\" is not in your public keyring!" + echohl None + end + let start = match(output, asymmPattern, start) + endwhile + else + " file is not encrypted + let b:GPGEncrypted = 0 + call s:GPGDebug(1, "this file is not encrypted") + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + silent exe '.r ' . fnameescape(filename) + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()") + return + endif + + " check if the message is armored + if (match(output, "gpg: armor header") >= 0) + call s:GPGDebug(1, "this file is armored") + let b:GPGOptions += ["armor"] + endif + + " finally decrypt the buffer content + " since even with the --quiet option passphrase typos will be reported, + " we must redirect stderr (using shell temporarily) + call s:GPGDebug(1, "decrypting file") + let cmd = { 'level': 1, 'ex': 'r !' } + let cmd.args = '--quiet --decrypt ' . shellescape(filename, 1) + call s:GPGExecute(cmd) + + if (v:shell_error) " message could not be decrypted + echohl GPGError + let blackhole = input("Message could not be decrypted! (Press ENTER)") + echohl None + silent bwipeout! + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()") + return + endif + + " refresh screen + redraw! + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()") +endfunction + +function s:GPGBufReadPost() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGBufReadPost()") + silent 1delete + " call the autocommand for the file minus .gpg$ + execute ':doautocmd BufReadPost ' . fnameescape(expand('<afile>:r')) + call s:GPGDebug(2, 'called autocommand for ' . fnameescape(expand('<afile>:r'))) + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGBufReadPost()") +endfunction + +" Function: s:GPGEncrypt() {{{2 +" +" encrypts the buffer to all previous recipients +" +function s:GPGEncrypt() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGEncrypt()") + + " store encoding and switch to a safe one + if (&fileencoding != &encoding) + let s:GPGEncoding = &encoding + let &encoding = &fileencoding + call s:GPGDebug(2, "encoding was \"" . s:GPGEncoding . "\", switched to \"" . &encoding . "\"") + else + let s:GPGEncoding = "" + call s:GPGDebug(2, "encoding and fileencoding are the same (\"" . &encoding . "\"), not switching") + endif + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGError + let blackhole = input("Message could not be encrypted! (Press ENTER)") + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEncrypt()") + return + endif + + " initialize GPGOptions if not happened before + if (!exists("b:GPGOptions") || len(b:GPGOptions) == 0) + let b:GPGOptions = [] + if (exists("g:GPGPreferSymmetric") && g:GPGPreferSymmetric == 1) + let b:GPGOptions += ["symmetric"] + let b:GPGRecipients = [] + else + let b:GPGOptions += ["encrypt"] + endif + if (exists("g:GPGPreferArmor") && g:GPGPreferArmor == 1) + let b:GPGOptions += ["armor"] + endif + if (exists("g:GPGPreferSign") && g:GPGPreferSign == 1) + let b:GPGOptions += ["sign"] + endif + call s:GPGDebug(1, "no options set, so using default options: " . string(b:GPGOptions)) + endif + + " built list of options + let options = "" + for option in b:GPGOptions + let options = options . " --" . option . " " + endfor + + if (!exists('b:GPGRecipients')) + let b:GPGRecipients = [] + endif + + " check here again if all recipients are available in the keyring + let [ recipients, unknownrecipients ] = s:GPGCheckRecipients(b:GPGRecipients) + + " check if there are unknown recipients and warn + if (len(unknownrecipients) > 0) + echohl GPGWarning + echom "Please use GPGEditRecipients to correct!!" + echo + echohl None + + " Let user know whats happend and copy known_recipients back to buffer + let dummy = input("Press ENTER to quit") + endif + + " built list of recipients + if (len(recipients) > 0) + for gpgid in recipients + let options = options . " -r " . gpgid + endfor + endif + + " encrypt the buffer + let destfile = tempname() + let cmd = { 'level': 1, 'ex': "'[,']w !" } + let cmd.args = '--quiet --no-encrypt-to ' . options + let cmd.redirect = '>' . shellescape(destfile, 1) + call s:GPGExecute(cmd) + + " restore encoding + if (s:GPGEncoding != "") + let &encoding = s:GPGEncoding + call s:GPGDebug(2, "restored encoding \"" . &encoding . "\"") + endif + + if (v:shell_error) " message could not be encrypted + " Command failed, so clean up the tempfile + call delete(destfile) + echohl GPGError + let blackhole = input("Message could not be encrypted! (Press ENTER)") + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEncrypt()") + return + endif + + call rename(destfile, resolve(expand('<afile>'))) + setl nomodified + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEncrypt()") +endfunction + +" Function: s:GPGViewRecipients() {{{2 +" +" echo the recipients +" +function s:GPGViewRecipients() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGViewRecipients()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGViewRecipients()") + return + endif + + let [ recipients, unknownrecipients ] = s:GPGCheckRecipients(b:GPGRecipients) + + echo 'This file has following recipients (Unknown recipients have a prepended "!"):' + " echo the recipients + for name in recipients + let name = s:GPGIDToName(name) + echo name + endfor + + " echo the unknown recipients + echohl GPGWarning + for name in unknownrecipients + let name = "!" . name + echo name + endfor + echohl None + + " check if there is any known recipient + if (len(recipients) == 0) + echohl GPGError + echom 'There are no known recipients!' + echohl None + endif + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGViewRecipients()") +endfunction + +" Function: s:GPGEditRecipients() {{{2 +" +" create a scratch buffer with all recipients to add/remove recipients +" +function s:GPGEditRecipients() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGEditRecipients()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEditRecipients()") + return + endif + + " only do this if it isn't already a GPGRecipients_* buffer + if (match(bufname("%"), "^\\(GPGRecipients_\\|GPGOptions_\\)") != 0 && match(bufname("%"), "\.\\(gpg\\|asc\\|pgp\\)$") >= 0) + + " save buffer name + let buffername = bufname("%") + let editbuffername = "GPGRecipients_" . buffername + + " check if this buffer exists + if (!bufexists(editbuffername)) + " create scratch buffer + execute 'silent! split ' . fnameescape(editbuffername) + + " add a autocommand to regenerate the recipients after a write + autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishRecipientsBuffer() + else + if (bufwinnr(editbuffername) >= 0) + " switch to scratch buffer window + execute 'silent! ' . bufwinnr(editbuffername) . "wincmd w" + else + " split scratch buffer window + execute 'silent! sbuffer ' . fnameescape(editbuffername) + + " add a autocommand to regenerate the recipients after a write + autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishRecipientsBuffer() + endif + + " empty the buffer + silent %delete + endif + + " Mark the buffer as a scratch buffer + setlocal buftype=acwrite + setlocal bufhidden=hide + setlocal noswapfile + setlocal nowrap + setlocal nobuflisted + setlocal nonumber + + " so we know for which other buffer this edit buffer is + let b:GPGCorrespondingTo = buffername + + " put some comments to the scratch buffer + silent put ='GPG: ----------------------------------------------------------------------' + silent put ='GPG: Please edit the list of recipients, one recipient per line.' + silent put ='GPG: Unknown recipients have a prepended \"!\".' + silent put ='GPG: Lines beginning with \"GPG:\" are removed automatically.' + silent put ='GPG: Data after recipients between and including \"(\" and \")\" is ignored.' + silent put ='GPG: Closing this buffer commits changes.' + silent put ='GPG: ----------------------------------------------------------------------' + + " get the recipients + let [ recipients, unknownrecipients ] = s:GPGCheckRecipients(getbufvar(b:GPGCorrespondingTo, "GPGRecipients")) + + " if there are no known or unknown recipients, use the default ones + if (len(recipients) == 0 && len(unknownrecipients) == 0) + if (type(g:GPGDefaultRecipients) == type([])) + let [ recipients, unknownrecipients ] = s:GPGCheckRecipients(g:GPGDefaultRecipients) + else + echohl GPGWarning + echom "g:GPGDefaultRecipients is not a Vim list, please correct this in your vimrc!" + echohl None + endif + endif + + " put the recipients in the scratch buffer + for name in recipients + let name = s:GPGIDToName(name) + silent put =name + endfor + + " put the unknown recipients in the scratch buffer + let syntaxPattern = "\\(nonexxistinwordinthisbuffer" + for name in unknownrecipients + let name = "!" . name + let syntaxPattern = syntaxPattern . "\\|" . fnameescape(name) + silent put =name + endfor + let syntaxPattern = syntaxPattern . "\\)" + + " define highlight + if (has("syntax") && exists("g:syntax_on")) + execute 'syntax match GPGUnknownRecipient "' . syntaxPattern . '"' + highlight clear GPGUnknownRecipient + highlight link GPGUnknownRecipient GPGHighlightUnknownRecipient + + syntax match GPGComment "^GPG:.*$" + execute 'syntax match GPGComment "' . s:GPGMagicString . '.*$"' + highlight clear GPGComment + highlight link GPGComment Comment + endif + + " delete the empty first line + silent 1delete + + " jump to the first recipient + silent $ + + endif + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEditRecipients()") +endfunction + +" Function: s:GPGFinishRecipientsBuffer() {{{2 +" +" create a new recipient list from RecipientsBuffer +" +function s:GPGFinishRecipientsBuffer() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGFinishRecipientsBuffer()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGFinishRecipientsBuffer()") + return + endif + + " go to buffer before doing work + if (bufnr("%") != expand("<abuf>")) + " switch to scratch buffer window + execute 'silent! ' . bufwinnr(expand("<afile>")) . "wincmd w" + endif + + " delete the autocommand + autocmd! * <buffer> + + + " get the recipients from the scratch buffer + let recipients = [] + let lines = getline(1,"$") + for recipient in lines + " delete all text after magic string + let recipient = substitute(recipient, s:GPGMagicString . ".*$", "", "") + + " delete all spaces at beginning and end of the recipient + " also delete a '!' at the beginning of the recipient + let recipient = substitute(recipient, "^[[:space:]!]*\\(.\\{-}\\)[[:space:]]*$", "\\1", "") + + " delete comment lines + let recipient = substitute(recipient, "^GPG:.*$", "", "") + + " only do this if the line is not empty + if (strlen(recipient) > 0) + let gpgid = s:GPGNameToID(recipient) + if (strlen(gpgid) > 0) + if (match(recipients, gpgid) < 0) + let recipients += [gpgid] + endif + else + if (match(recipients, recipient) < 0) + let recipients += [recipient] + echohl GPGWarning + echom "The recipient \"" . recipient . "\" is not in your public keyring!" + echohl None + endif + endif + endif + endfor + + " write back the new recipient list to the corresponding buffer and mark it + " as modified. Buffer is now for sure a encrypted buffer. + call setbufvar(b:GPGCorrespondingTo, "GPGRecipients", recipients) + call setbufvar(b:GPGCorrespondingTo, "&mod", 1) + call setbufvar(b:GPGCorrespondingTo, "GPGEncrypted", 1) + + " check if there is any known recipient + if (len(recipients) == 0) + echohl GPGError + echom 'There are no known recipients!' + echohl None + endif + + " reset modified flag + setl nomodified + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGFinishRecipientsBuffer()") +endfunction + +" Function: s:GPGViewOptions() {{{2 +" +" echo the recipients +" +function s:GPGViewOptions() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGViewOptions()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGViewOptions()") + return + endif + + if (exists("b:GPGOptions")) + echo 'This file has following options:' + " echo the options + for option in b:GPGOptions + echo option + endfor + endif + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGViewOptions()") +endfunction + +" Function: s:GPGEditOptions() {{{2 +" +" create a scratch buffer with all recipients to add/remove recipients +" +function s:GPGEditOptions() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGEditOptions()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEditOptions()") + return + endif + + " only do this if it isn't already a GPGOptions_* buffer + if (match(bufname("%"), "^\\(GPGRecipients_\\|GPGOptions_\\)") != 0 && match(bufname("%"), "\.\\(gpg\\|asc\\|pgp\\)$") >= 0) + + " save buffer name + let buffername = bufname("%") + let editbuffername = "GPGOptions_" . buffername + + " check if this buffer exists + if (!bufexists(editbuffername)) + " create scratch buffer + execute 'silent! split ' . fnameescape(editbuffername) + + " add a autocommand to regenerate the options after a write + autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishOptionsBuffer() + else + if (bufwinnr(editbuffername) >= 0) + " switch to scratch buffer window + execute 'silent! ' . bufwinnr(editbuffername) . "wincmd w" + else + " split scratch buffer window + execute 'silent! sbuffer ' . fnameescape(editbuffername) + + " add a autocommand to regenerate the options after a write + autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishOptionsBuffer() + endif + + " empty the buffer + silent %delete + endif + + " Mark the buffer as a scratch buffer + setlocal buftype=nofile + setlocal noswapfile + setlocal nowrap + setlocal nobuflisted + setlocal nonumber + + " so we know for which other buffer this edit buffer is + let b:GPGCorrespondingTo = buffername + + " put some comments to the scratch buffer + silent put ='GPG: ----------------------------------------------------------------------' + silent put ='GPG: THERE IS NO CHECK OF THE ENTERED OPTIONS!' + silent put ='GPG: YOU NEED TO KNOW WHAT YOU ARE DOING!' + silent put ='GPG: IF IN DOUBT, QUICKLY EXIT USING :x OR :bd.' + silent put ='GPG: Please edit the list of options, one option per line.' + silent put ='GPG: Please refer to the gpg documentation for valid options.' + silent put ='GPG: Lines beginning with \"GPG:\" are removed automatically.' + silent put ='GPG: Closing this buffer commits changes.' + silent put ='GPG: ----------------------------------------------------------------------' + + " put the options in the scratch buffer + let options = getbufvar(b:GPGCorrespondingTo, "GPGOptions") + + for option in options + silent put =option + endfor + + " delete the empty first line + silent 1delete + + " jump to the first option + silent $ + + " define highlight + if (has("syntax") && exists("g:syntax_on")) + syntax match GPGComment "^GPG:.*$" + highlight clear GPGComment + highlight link GPGComment Comment + endif + endif + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGEditOptions()") +endfunction + +" Function: s:GPGFinishOptionsBuffer() {{{2 +" +" create a new option list from OptionsBuffer +" +function s:GPGFinishOptionsBuffer() + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGFinishOptionsBuffer()") + + " guard for unencrypted files + if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0) + echohl GPGWarning + echom "File is not encrypted, all GPG functions disabled!" + echohl None + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGFinishOptionsBuffer()") + return + endif + + " go to buffer before doing work + if (bufnr("%") != expand("<abuf>")) + " switch to scratch buffer window + execute 'silent! ' . bufwinnr(expand("<afile>")) . "wincmd w" + endif + + " clear options and unknownOptions + let options = [] + let unknownOptions = [] + + " delete the autocommand + autocmd! * <buffer> + + " get the options from the scratch buffer + let lines = getline(1, "$") + for option in lines + " delete all spaces at beginning and end of the option + " also delete a '!' at the beginning of the option + let option = substitute(option, "^[[:space:]!]*\\(.\\{-}\\)[[:space:]]*$", "\\1", "") + " delete comment lines + let option = substitute(option, "^GPG:.*$", "", "") + + " only do this if the line is not empty + if (strlen(option) > 0 && match(options, option) < 0) + let options += [option] + endif + endfor + + " write back the new option list to the corresponding buffer and mark it + " as modified + call setbufvar(b:GPGCorrespondingTo, "GPGOptions", options) + call setbufvar(b:GPGCorrespondingTo, "&mod", 1) + + " reset modified flag + setl nomodified + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGFinishOptionsBuffer()") +endfunction + +" Function: s:GPGCheckRecipients(tocheck) {{{2 +" +" check if recipients are known +" Returns: two lists recipients and unknownrecipients +" +function s:GPGCheckRecipients(tocheck) + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGCheckRecipients()") + + let recipients = [] + let unknownrecipients = [] + + if (type(a:tocheck) == type([])) + for recipient in a:tocheck + let gpgid = s:GPGNameToID(recipient) + if (strlen(gpgid) > 0) + if (match(recipients, gpgid) < 0) + let recipients += [gpgid] + endif + else + if (match(unknownrecipients, recipient) < 0) + let unknownrecipients += [recipient] + echohl GPGWarning + echom "The recipient \"" . recipient . "\" is not in your public keyring!" + echohl None + endif + end + endfor + endif + + call s:GPGDebug(2, "recipients are: " . string(recipients)) + call s:GPGDebug(2, "unknown recipients are: " . string(unknownrecipients)) + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGCheckRecipients()") + return [ recipients, unknownrecipients ] +endfunction + +" Function: s:GPGNameToID(name) {{{2 +" +" find GPG key ID corresponding to a name +" Returns: ID for the given name +" +function s:GPGNameToID(name) + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGNameToID()") + + " ask gpg for the id for a name + let cmd = { 'level': 2 } + let cmd.args = '--quiet --with-colons --fixed-list-mode --list-keys ' . shellescape(a:name) + let output = s:GPGSystem(cmd) + + " when called with "--with-colons" gpg encodes its output _ALWAYS_ as UTF-8, + " so convert it, if necessary + if (&encoding != "utf-8") + let output = iconv(output, "utf-8", &encoding) + endif + let lines = split(output, "\n") + + " parse the output of gpg + let pubseen = 0 + let counter = 0 + let gpgids = [] + let duplicates = {} + let choices = "The name \"" . a:name . "\" is ambiguous. Please select the correct key:\n" + for line in lines + + " check if this line has already been processed + if !has_key(duplicates, line) + let duplicates[line] = 1 + + let fields = split(line, ":") + " search for the next uid + if (pubseen == 1) + if (fields[0] == "uid") + let choices = choices . " " . fields[9] . "\n" + else + let pubseen = 0 + endif + endif + + " search for the next pub + if (pubseen == 0) + if (fields[0] == "pub") + let identity = fields[4] + let gpgids += [identity] + if exists("*strftime") + let choices = choices . counter . ": ID: 0x" . identity . " created at " . strftime("%c", fields[5]) . "\n" + else + let choices = choices . counter . ": ID: 0x" . identity . "\n" + endif + let counter = counter+1 + let pubseen = 1 + endif + endif + endif + + endfor + + " counter > 1 means we have more than one results + let answer = 0 + if (counter > 1) + let choices = choices . "Enter number: " + let answer = input(choices, "0") + while (answer == "") + let answer = input("Enter number: ", "0") + endwhile + endif + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGNameToID()") + return get(gpgids, answer, "") +endfunction + +" Function: s:GPGIDToName(identity) {{{2 +" +" find name corresponding to a GPG key ID +" Returns: Name for the given ID +" +function s:GPGIDToName(identity) + call s:GPGDebug(3, ">>>>>>>> Entering s:GPGIDToName()") + + " TODO is the encryption subkey really unique? + + " ask gpg for the id for a name + let cmd = { 'level': 2 } + let cmd.args = '--quiet --with-colons --fixed-list-mode --list-keys ' . a:identity + let output = s:GPGSystem(cmd) + + " when called with "--with-colons" gpg encodes its output _ALWAYS_ as UTF-8, + " so convert it, if necessary + if (&encoding != "utf-8") + let output = iconv(output, "utf-8", &encoding) + endif + let lines = split(output, "\n") + + " parse the output of gpg + let pubseen = 0 + let uid = "" + for line in lines + let fields = split(line, ":") + if (pubseen == 0) " search for the next pub + if (fields[0] == "pub") + let pubseen = 1 + endif + else " search for the next uid + if (fields[0] == "uid") + let pubseen = 0 + if exists("*strftime") + let uid = fields[9] . s:GPGMagicString . "(ID: 0x" . a:identity . " created at " . strftime("%c", fields[5]) . ")" + else + let uid = fields[9] . s:GPGMagicString . "(ID: 0x" . a:identity . ")" + endif + break + endif + endif + endfor + + call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGIDToName()") + return uid +endfunction + +function s:GPGPreCmd() + let &shellredir = s:shellredir + let &shell = s:shell + let &shelltemp = s:shelltemp +endfunction + +function s:GPGPostCmd() + let &shellredir = s:shellredirsave + let &shell = s:shellsave + let &shelltemp = s:shelltempsave +endfunction + +" Function: s:GPGSystem(dict) {{{2 +" +" run g:GPGCommand using system(), logging the commandline and output +" Recognized keys are: +" level - Debug level at which the commandline and output will be logged +" args - Arguments to be given to g:GPGCommand +" +" Returns: command output +" +function s:GPGSystem(dict) + let commandline = printf('%s %s', s:GPGCommand, a:dict.args) + if (!empty(g:GPGHomedir)) + let commandline .= ' --homedir ' . shellescape(g:GPGHomedir) + endif + let commandline .= ' ' . s:stderrredirnull + call s:GPGDebug(a:dict.level, "command: ". commandline) + + call s:GPGPreCmd() + let output = system(commandline) + call s:GPGPostCmd() + + call s:GPGDebug(a:dict.level, "output: ". output) + return output +endfunction + +" Function: s:GPGExecute(dict) {{{2 +" +" run g:GPGCommand using :execute, logging the commandline +" Recognized keys are: +" level - Debug level at which the commandline will be logged +" args - Arguments to be given to g:GPGCommand +" ex - Ex command which will be :executed +" redirect - Shell redirect to use, if needed +" +function s:GPGExecute(dict) + let commandline = printf('%s%s %s', a:dict.ex, s:GPGCommand, a:dict.args) + if (!empty(g:GPGHomedir)) + let commandline .= ' --homedir ' . shellescape(g:GPGHomedir, 1) + endif + if (has_key(a:dict, 'redirect')) + let commandline .= ' ' . a:dict.redirect + endif + let commandline .= ' ' . s:stderrredirnull + call s:GPGDebug(a:dict.level, "command: " . commandline) + + call s:GPGPreCmd() + execute commandline + call s:GPGPostCmd() +endfunction + +" Function: s:GPGDebug(level, text) {{{2 +" +" output debug message, if this message has high enough importance +" only define function if GPGDebugLevel set at all +" +function s:GPGDebug(level, text) + if exists("g:GPGDebugLevel") && g:GPGDebugLevel >= a:level + if exists("g:GPGDebugLog") + execute "redir >> " . g:GPGDebugLog + echom "GnuPG: " . a:text + redir END + else + echom "GnuPG: " . a:text + endif + endif +endfunction + +" Section: Commands {{{1 + +command! GPGViewRecipients call s:GPGViewRecipients() +command! GPGEditRecipients call s:GPGEditRecipients() +command! GPGViewOptions call s:GPGViewOptions() +command! GPGEditOptions call s:GPGEditOptions() + +" Section: Menu {{{1 + +if (has("menu")) + amenu <silent> Plugin.GnuPG.View\ Recipients :GPGViewRecipients<CR> + amenu <silent> Plugin.GnuPG.Edit\ Recipients :GPGEditRecipients<CR> + amenu <silent> Plugin.GnuPG.View\ Options :GPGViewOptions<CR> + amenu <silent> Plugin.GnuPG.Edit\ Options :GPGEditOptions<CR> +endif + +" vim600: set foldmethod=marker foldlevel=0 : diff --git a/dot_vim/plugin/imaps.vim b/dot_vim/plugin/imaps.vim new file mode 100644 index 0000000..d871aa1 --- /dev/null +++ b/dot_vim/plugin/imaps.vim @@ -0,0 +1,831 @@ +" File: imaps.vim +" Authors: Srinath Avadhanula <srinath AT fastmail.fm> +" Benji Fisher <benji AT member.AMS.org> +" +" WWW: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/vimfiles/plugin/imaps.vim?only_with_tag=MAIN +" +" Description: insert mode template expander with cursor placement +" while preserving filetype indentation. +" +" $Id: imaps.vim 997 2006-03-20 09:45:45Z srinathava $ +" +" Documentation: {{{ +" +" Motivation: +" this script provides a way to generate insert mode mappings which do not +" suffer from some of the problem of mappings and abbreviations while allowing +" cursor placement after the expansion. It can alternatively be thought of as +" a template expander. +" +" Consider an example. If you do +" +" imap lhs something +" +" then a mapping is set up. However, there will be the following problems: +" 1. the 'ttimeout' option will generally limit how easily you can type the +" lhs. if you type the left hand side too slowly, then the mapping will not +" be activated. +" 2. if you mistype one of the letters of the lhs, then the mapping is +" deactivated as soon as you backspace to correct the mistake. +" +" If, in order to take care of the above problems, you do instead +" +" iab lhs something +" +" then the timeout problem is solved and so is the problem of mistyping. +" however, abbreviations are only expanded after typing a non-word character. +" which causes problems of cursor placement after the expansion and invariably +" spurious spaces are inserted. +" +" Usage Example: +" this script attempts to solve all these problems by providing an emulation +" of imaps wchich does not suffer from its attendant problems. Because maps +" are activated without having to press additional characters, therefore +" cursor placement is possible. furthermore, file-type specific indentation is +" preserved, because the rhs is expanded as if the rhs is typed in literally +" by the user. +" +" The script already provides some default mappings. each "mapping" is of the +" form: +" +" call IMAP (lhs, rhs, ft) +" +" Some characters in the RHS have special meaning which help in cursor +" placement. +" +" Example One: +" +" call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") +" +" This effectively sets up the map for "bit`" whenever you edit a latex file. +" When you type in this sequence of letters, the following text is inserted: +" +" \begin{itemize} +" \item * +" \end{itemize}<++> +" +" where * shows the cursor position. The cursor position after inserting the +" text is decided by the position of the first "place-holder". Place holders +" are special characters which decide cursor placement and movement. In the +" example above, the place holder characters are <+ and +>. After you have typed +" in the item, press <C-j> and you will be taken to the next set of <++>'s. +" Therefore by placing the <++> characters appropriately, you can minimize the +" use of movement keys. +" +" NOTE: Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. +" Set +" g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd +" to something else if you want different place holder characters. +" Also, b:Imap_PlaceHolderStart and b:Imap_PlaceHolderEnd override the values +" of g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd respectively. This is +" useful for setting buffer specific place hoders. +" +" Example Two: +" You can use the <C-r> command to insert dynamic elements such as dates. +" call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') +" +" sets up the map for date` to insert the current date. +" +"--------------------------------------%<-------------------------------------- +" Bonus: This script also provides a command Snip which puts tearoff strings, +" '----%<----' above and below the visually selected range of lines. The +" length of the string is chosen to be equal to the longest line in the range. +" Recommended Usage: +" '<,'>Snip +"--------------------------------------%<-------------------------------------- +" }}} + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +" ============================================================================== +" Script Options / Variables +" ============================================================================== +" Options {{{ +if !exists('g:Imap_StickyPlaceHolders') + let g:Imap_StickyPlaceHolders = 1 +endif +if !exists('g:Imap_DeleteEmptyPlaceHolders') + let g:Imap_DeleteEmptyPlaceHolders = 1 +endif +" }}} +" Variables {{{ +" s:LHS_{ft}_{char} will be generated automatically. It will look like +" s:LHS_tex_o = 'fo\|foo\|boo' and contain all mapped sequences ending in "o". +" s:Map_{ft}_{lhs} will be generated automatically. It will look like +" s:Map_c_foo = 'for(<++>; <++>; <++>)', the mapping for "foo". +" +" }}} + +" ============================================================================== +" functions for easy insert mode mappings. +" ============================================================================== +" IMAP: Adds a "fake" insert mode mapping. {{{ +" For example, doing +" IMAP('abc', 'def' ft) +" will mean that if the letters abc are pressed in insert mode, then +" they will be replaced by def. If ft != '', then the "mapping" will be +" specific to the files of type ft. +" +" Using IMAP has a few advantages over simply doing: +" imap abc def +" 1. with imap, if you begin typing abc, the cursor will not advance and +" long as there is a possible completion, the letters a, b, c will be +" displayed on on top of the other. using this function avoids that. +" 2. with imap, if a backspace or arrow key is pressed before completing +" the word, then the mapping is lost. this function allows movement. +" (this ofcourse means that this function is only limited to +" left-hand-sides which do not have movement keys or unprintable +" characters) +" It works by only mapping the last character of the left-hand side. +" when this character is typed in, then a reverse lookup is done and if +" the previous characters consititute the left hand side of the mapping, +" the previously typed characters and erased and the right hand side is +" inserted + +" IMAP: set up a filetype specific mapping. +" Description: +" "maps" the lhs to rhs in files of type 'ft'. If supplied with 2 +" additional arguments, then those are assumed to be the placeholder +" characters in rhs. If unspecified, then the placeholder characters +" are assumed to be '<+' and '+>' These placeholder characters in +" a:rhs are replaced with the users setting of +" [bg]:Imap_PlaceHolderStart and [bg]:Imap_PlaceHolderEnd settings. +" +function! IMAP(lhs, rhs, ft, ...) + + " Find the place holders to save for IMAP_PutTextWithMovement() . + if a:0 < 2 + let phs = '<+' + let phe = '+>' + else + let phs = a:1 + let phe = a:2 + endif + + let hash = s:Hash(a:lhs) + let s:Map_{a:ft}_{hash} = a:rhs + let s:phs_{a:ft}_{hash} = phs + let s:phe_{a:ft}_{hash} = phe + + " Add a:lhs to the list of left-hand sides that end with lastLHSChar: + let lastLHSChar = a:lhs[strlen(a:lhs)-1] + let hash = s:Hash(lastLHSChar) + if !exists("s:LHS_" . a:ft . "_" . hash) + let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') + else + let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') .'\|'. s:LHS_{a:ft}_{hash} + endif + + " map only the last character of the left-hand side. + if lastLHSChar == ' ' + let lastLHSChar = '<space>' + end + exe 'inoremap <silent>' + \ escape(lastLHSChar, '|') + \ '<C-r>=<SID>LookupCharacter("' . + \ escape(lastLHSChar, '\|"') . + \ '")<CR>' +endfunction + +" }}} +" IMAP_list: list the rhs and place holders corresponding to a:lhs {{{ +" +" Added mainly for debugging purposes, but maybe worth keeping. +function! IMAP_list(lhs) + let char = a:lhs[strlen(a:lhs)-1] + let charHash = s:Hash(char) + if exists("s:LHS_" . &ft ."_". charHash) && a:lhs =~ s:LHS_{&ft}_{charHash} + let ft = &ft + elseif exists("s:LHS__" . charHash) && a:lhs =~ s:LHS__{charHash} + let ft = "" + else + return "" + endif + let hash = s:Hash(a:lhs) + return "rhs = " . s:Map_{ft}_{hash} . " place holders = " . + \ s:phs_{ft}_{hash} . " and " . s:phe_{ft}_{hash} +endfunction +" }}} +" LookupCharacter: inserts mapping corresponding to this character {{{ +" +" This function extracts from s:LHS_{&ft}_{a:char} or s:LHS__{a:char} +" the longest lhs matching the current text. Then it replaces lhs with the +" corresponding rhs saved in s:Map_{ft}_{lhs} . +" The place-holder variables are passed to IMAP_PutTextWithMovement() . +function! s:LookupCharacter(char) + if IMAP_GetVal('Imap_FreezeImap', 0) == 1 + return a:char + endif + let charHash = s:Hash(a:char) + + " The line so far, including the character that triggered this function: + let text = strpart(getline("."), 0, col(".")-1) . a:char + " Prefer a local map to a global one, even if the local map is shorter. + " Is this what we want? Do we care? + " Use '\V' (very no-magic) so that only '\' is special, and it was already + " escaped when building up s:LHS_{&ft}_{charHash} . + if exists("s:LHS_" . &ft . "_" . charHash) + \ && text =~ "\\C\\V\\(" . s:LHS_{&ft}_{charHash} . "\\)\\$" + let ft = &ft + elseif exists("s:LHS__" . charHash) + \ && text =~ "\\C\\V\\(" . s:LHS__{charHash} . "\\)\\$" + let ft = "" + else + " If this is a character which could have been used to trigger an + " abbreviation, check if an abbreviation exists. + if a:char !~ '\k' + let lastword = matchstr(getline('.'), '\k\+$', '') + call IMAP_Debug('getting lastword = ['.lastword.']', 'imap') + if lastword != '' + " An extremeley wierd way to get around the fact that vim + " doesn't have the equivalent of the :mapcheck() function for + " abbreviations. + let _a = @a + exec "redir @a | silent! iab ".lastword." | redir END" + let abbreviationRHS = matchstr(@a."\n", "\n".'i\s\+'.lastword.'\s\+@\?\zs.*\ze'."\n") + + call IMAP_Debug('getting abbreviationRHS = ['.abbreviationRHS.']', 'imap') + + if @a =~ "No abbreviation found" || abbreviationRHS == "" + let @a = _a + return a:char + endif + + let @a = _a + let abbreviationRHS = escape(abbreviationRHS, '\<"') + exec 'let abbreviationRHS = "'.abbreviationRHS.'"' + + let lhs = lastword.a:char + let rhs = abbreviationRHS.a:char + let phs = IMAP_GetPlaceHolderStart() + let phe = IMAP_GetPlaceHolderEnd() + else + return a:char + endif + else + return a:char + endif + endif + " Find the longest left-hand side that matches the line so far. + " matchstr() returns the match that starts first. This automatically + " ensures that the longest LHS is used for the mapping. + if !exists('lhs') || !exists('rhs') + let lhs = matchstr(text, "\\C\\V\\(" . s:LHS_{ft}_{charHash} . "\\)\\$") + let hash = s:Hash(lhs) + let rhs = s:Map_{ft}_{hash} + let phs = s:phs_{ft}_{hash} + let phe = s:phe_{ft}_{hash} + endif + + if strlen(lhs) == 0 + return a:char + endif + " enough back-spaces to erase the left-hand side; -1 for the last + " character typed: + let bs = substitute(strpart(lhs, 1), ".", "\<bs>", "g") + return bs . IMAP_PutTextWithMovement(rhs, phs, phe) +endfunction + +" }}} +" IMAP_PutTextWithMovement: returns the string with movement appended {{{ +" Description: +" If a:str contains "placeholders", then appends movement commands to +" str in a way that the user moves to the first placeholder and enters +" insert or select mode. If supplied with 2 additional arguments, then +" they are assumed to be the placeholder specs. Otherwise, they are +" assumed to be '<+' and '+>'. These placeholder chars are replaced +" with the users settings of [bg]:Imap_PlaceHolderStart and +" [bg]:Imap_PlaceHolderEnd. +function! IMAP_PutTextWithMovement(str, ...) + + " The placeholders used in the particular input string. These can be + " different from what the user wants to use. + if a:0 < 2 + let phs = '<+' + let phe = '+>' + else + let phs = escape(a:1, '\') + let phe = escape(a:2, '\') + endif + + let text = a:str + + " The user's placeholder settings. + let phsUser = IMAP_GetPlaceHolderStart() + let pheUser = IMAP_GetPlaceHolderEnd() + + " Problem: depending on the setting of the 'encoding' option, a character + " such as "\xab" may not match itself. We try to get around this by + " changing the encoding of all our strings. At the end, we have to + " convert text back. + let phsEnc = s:Iconv(phs, "encode") + let pheEnc = s:Iconv(phe, "encode") + let phsUserEnc = s:Iconv(phsUser, "encode") + let pheUserEnc = s:Iconv(pheUser, "encode") + let textEnc = s:Iconv(text, "encode") + if textEnc != text + let textEncoded = 1 + else + let textEncoded = 0 + endif + + let pattern = '\V\(\.\{-}\)' .phs. '\(\.\{-}\)' .phe. '\(\.\*\)' + " If there are no placeholders, just return the text. + if textEnc !~ pattern + call IMAP_Debug('Not getting '.phs.' and '.phe.' in '.textEnc, 'imap') + return text + endif + " Break text up into "initial <+template+> final"; any piece may be empty. + let initialEnc = substitute(textEnc, pattern, '\1', '') + let templateEnc = substitute(textEnc, pattern, '\2', '') + let finalEnc = substitute(textEnc, pattern, '\3', '') + + " If the user does not want to use placeholders, then remove all but the + " first placeholder. + " Otherwise, replace all occurences of the placeholders here with the + " user's choice of placeholder settings. + if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders + let finalEnc = substitute(finalEnc, '\V'.phs.'\.\{-}'.phe, '', 'g') + else + let finalEnc = substitute(finalEnc, '\V'.phs.'\(\.\{-}\)'.phe, + \ phsUserEnc.'\1'.pheUserEnc, 'g') + endif + + " The substitutions are done, so convert back, if necessary. + if textEncoded + let initial = s:Iconv(initialEnc, "decode") + let template = s:Iconv(templateEnc, "decode") + let final = s:Iconv(finalEnc, "decode") + else + let initial = initialEnc + let template = templateEnc + let final = finalEnc + endif + + " Build up the text to insert: + " 1. the initial text plus an extra character; + " 2. go to Normal mode with <C-\><C-N>, so it works even if 'insertmode' + " is set, and mark the position; + " 3. replace the extra character with tamplate and final; + " 4. back to Normal mode and restore the cursor position; + " 5. call IMAP_Jumpfunc(). + let template = phsUser . template . pheUser + " Old trick: insert and delete a character to get the same behavior at + " start, middle, or end of line and on empty lines. + let text = initial . "X\<C-\>\<C-N>:call IMAP_Mark('set')\<CR>\"_s" + let text = text . template . final + let text = text . "\<C-\>\<C-N>:call IMAP_Mark('go')\<CR>" + let text = text . "i\<C-r>=IMAP_Jumpfunc('', 1)\<CR>" + + call IMAP_Debug('IMAP_PutTextWithMovement: text = ['.text.']', 'imap') + return text +endfunction + +" }}} +" IMAP_Jumpfunc: takes user to next <+place-holder+> {{{ +" Author: Luc Hermitte +" Arguments: +" direction: flag for the search() function. If set to '', search forwards, +" if 'b', then search backwards. See the {flags} argument of the +" |search()| function for valid values. +" inclusive: In vim, the search() function is 'exclusive', i.e we always goto +" next cursor match even if there is a match starting from the +" current cursor position. Setting this argument to 1 makes +" IMAP_Jumpfunc() also respect a match at the current cursor +" position. 'inclusive'ness is necessary for IMAP() because a +" placeholder string can occur at the very beginning of a map which +" we want to select. +" We use a non-zero value only in special conditions. Most mappings +" should use a zero value. +function! IMAP_Jumpfunc(direction, inclusive) + + " The user's placeholder settings. + let phsUser = IMAP_GetPlaceHolderStart() + let pheUser = IMAP_GetPlaceHolderEnd() + + let searchString = '' + " If this is not an inclusive search or if it is inclusive, but the + " current cursor position does not contain a placeholder character, then + " search for the placeholder characters. + if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V\^'.phsUser + let searchString = '\V'.phsUser.'\_.\{-}'.pheUser + endif + + " If we didn't find any placeholders return quietly. + if searchString != '' && !search(searchString, a:direction) + return '' + endif + + " Open any closed folds and make this part of the text visible. + silent! foldopen! + + " Calculate if we have an empty placeholder or if it contains some + " description. + let template = + \ matchstr(strpart(getline('.'), col('.')-1), + \ '\V\^'.phsUser.'\zs\.\{-}\ze\('.pheUser.'\|\$\)') + let placeHolderEmpty = !strlen(template) + + " If we are selecting in exclusive mode, then we need to move one step to + " the right + let extramove = '' + if &selection == 'exclusive' + let extramove = 'l' + endif + + " Select till the end placeholder character. + let movement = "\<C-o>v/\\V".pheUser."/e\<CR>".extramove + + " First remember what the search pattern was. s:RemoveLastHistoryItem will + " reset @/ to this pattern so we do not create new highlighting. + let g:Tex_LastSearchPattern = @/ + + " Now either goto insert mode or select mode. + if placeHolderEmpty && g:Imap_DeleteEmptyPlaceHolders + " delete the empty placeholder into the blackhole. + return movement."\"_c\<C-o>:".s:RemoveLastHistoryItem."\<CR>" + else + return movement."\<C-\>\<C-N>:".s:RemoveLastHistoryItem."\<CR>gv\<C-g>" + endif + +endfunction + +" }}} +" Maps for IMAP_Jumpfunc {{{ +" +" These mappings use <Plug> and thus provide for easy user customization. When +" the user wants to map some other key to jump forward, he can do for +" instance: +" nmap ,f <plug>IMAP_JumpForward +" etc. + +" jumping forward and back in insert mode. +imap <silent> <Plug>IMAP_JumpForward <c-r>=IMAP_Jumpfunc('', 0)<CR> +imap <silent> <Plug>IMAP_JumpBack <c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" jumping in normal mode +nmap <silent> <Plug>IMAP_JumpForward i<c-r>=IMAP_Jumpfunc('', 0)<CR> +nmap <silent> <Plug>IMAP_JumpBack i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" deleting the present selection and then jumping forward. +vmap <silent> <Plug>IMAP_DeleteAndJumpForward "_<Del>i<c-r>=IMAP_Jumpfunc('', 0)<CR> +vmap <silent> <Plug>IMAP_DeleteAndJumpBack "_<Del>i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" jumping forward without deleting present selection. +vmap <silent> <Plug>IMAP_JumpForward <C-\><C-N>i<c-r>=IMAP_Jumpfunc('', 0)<CR> +vmap <silent> <Plug>IMAP_JumpBack <C-\><C-N>`<i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" }}} +" Default maps for IMAP_Jumpfunc {{{ +" map only if there is no mapping already. allows for user customization. +" NOTE: Default mappings for jumping to the previous placeholder are not +" provided. It is assumed that if the user will create such mappings +" hself if e so desires. +if !hasmapto('<Plug>IMAP_JumpForward', 'i') + imap <C-J> <Plug>IMAP_JumpForward +endif +if !hasmapto('<Plug>IMAP_JumpForward', 'n') + nmap <C-J> <Plug>IMAP_JumpForward +endif +if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders + if !hasmapto('<Plug>IMAP_JumpForward', 'v') + vmap <C-J> <Plug>IMAP_JumpForward + endif +else + if !hasmapto('<Plug>IMAP_DeleteAndJumpForward', 'v') + vmap <C-J> <Plug>IMAP_DeleteAndJumpForward + endif +endif +" }}} + +nmap <silent> <script> <plug><+SelectRegion+> `<v`> + +" ============================================================================== +" enclosing selected region. +" ============================================================================== +" VEnclose: encloses the visually selected region with given arguments {{{ +" Description: allows for differing action based on visual line wise +" selection or visual characterwise selection. preserves the +" marks and search history. +function! VEnclose(vstart, vend, VStart, VEnd) + + " its characterwise if + " 1. characterwise selection and valid values for vstart and vend. + " OR + " 2. linewise selection and invalid values for VStart and VEnd + if (visualmode() == 'v' && (a:vstart != '' || a:vend != '')) || (a:VStart == '' && a:VEnd == '') + + let newline = "" + let _r = @r + + let normcmd = "normal! \<C-\>\<C-n>`<v`>\"_s" + + exe "normal! \<C-\>\<C-n>`<v`>\"ry" + if @r =~ "\n$" + let newline = "\n" + let @r = substitute(@r, "\n$", '', '') + endif + + " In exclusive selection, we need to select an extra character. + if &selection == 'exclusive' + let movement = 8 + else + let movement = 7 + endif + let normcmd = normcmd. + \ a:vstart."!!mark!!".a:vend.newline. + \ "\<C-\>\<C-N>?!!mark!!\<CR>v".movement."l\"_s\<C-r>r\<C-\>\<C-n>" + + " this little if statement is because till very recently, vim used to + " report col("'>") > length of selected line when `> is $. on some + " systems it reports a -ve number. + if col("'>") < 0 || col("'>") > strlen(getline("'>")) + let lastcol = strlen(getline("'>")) + else + let lastcol = col("'>") + endif + if lastcol - col("'<") != 0 + let len = lastcol - col("'<") + else + let len = '' + endif + + " the next normal! is for restoring the marks. + let normcmd = normcmd."`<v".len."l\<C-\>\<C-N>" + + " First remember what the search pattern was. s:RemoveLastHistoryItem + " will reset @/ to this pattern so we do not create new highlighting. + let g:Tex_LastSearchPattern = @/ + + silent! exe normcmd + " this is to restore the r register. + let @r = _r + " and finally, this is to restore the search history. + execute s:RemoveLastHistoryItem + + else + + exec 'normal! `<O'.a:VStart."\<C-\>\<C-n>" + exec 'normal! `>o'.a:VEnd."\<C-\>\<C-n>" + if &indentexpr != '' + silent! normal! `<kV`>j= + endif + silent! normal! `> + endif +endfunction + +" }}} +" ExecMap: adds the ability to correct an normal/visual mode mapping. {{{ +" Author: Hari Krishna Dara <hari_vim@yahoo.com> +" Reads a normal mode mapping at the command line and executes it with the +" given prefix. Press <BS> to correct and <Esc> to cancel. +function! ExecMap(prefix, mode) + " Temporarily remove the mapping, otherwise it will interfere with the + " mapcheck call below: + let myMap = maparg(a:prefix, a:mode) + exec a:mode."unmap ".a:prefix + + " Generate a line with spaces to clear the previous message. + let i = 1 + let clearLine = "\r" + while i < &columns + let clearLine = clearLine . ' ' + let i = i + 1 + endwhile + + let mapCmd = a:prefix + let foundMap = 0 + let breakLoop = 0 + echon "\rEnter Map: " . mapCmd + while !breakLoop + let char = getchar() + if char !~ '^\d\+$' + if char == "\<BS>" + let mapCmd = strpart(mapCmd, 0, strlen(mapCmd) - 1) + endif + else " It is the ascii code. + let char = nr2char(char) + if char == "\<Esc>" + let breakLoop = 1 + else + let mapCmd = mapCmd . char + if maparg(mapCmd, a:mode) != "" + let foundMap = 1 + let breakLoop = 1 + elseif mapcheck(mapCmd, a:mode) == "" + let mapCmd = strpart(mapCmd, 0, strlen(mapCmd) - 1) + endif + endif + endif + echon clearLine + echon "\rEnter Map: " . mapCmd + endwhile + if foundMap + if a:mode == 'v' + " use a plug to select the region instead of using something like + " `<v`> to avoid problems caused by some of the characters in + " '`<v`>' being mapped. + let gotoc = "\<plug><+SelectRegion+>" + else + let gotoc = '' + endif + exec "normal ".gotoc.mapCmd + endif + exec a:mode.'noremap '.a:prefix.' '.myMap +endfunction + +" }}} + +" ============================================================================== +" helper functions +" ============================================================================== +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" s:RemoveLastHistoryItem: removes last search item from search history {{{ +" Description: Execute this string to clean up the search history. +let s:RemoveLastHistoryItem = ':call histdel("/", -1)|let @/=g:Tex_LastSearchPattern' + +" }}} +" s:Hash: Return a version of a string that can be used as part of a variable" {{{ +" name. +" Converts every non alphanumeric character into _{ascii}_ where {ascii} is +" the ASCII code for that character... +fun! s:Hash(text) + return substitute(a:text, '\([^[:alnum:]]\)', + \ '\="_".char2nr(submatch(1))."_"', 'g') +endfun +"" }}} +" IMAP_GetPlaceHolderStart and IMAP_GetPlaceHolderEnd: "{{{ +" return the buffer local placeholder variables, or the global one, or the default. +function! IMAP_GetPlaceHolderStart() + if exists("b:Imap_PlaceHolderStart") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderStart + elseif exists("g:Imap_PlaceHolderStart") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderStart + else + return "<+" +endfun +function! IMAP_GetPlaceHolderEnd() + if exists("b:Imap_PlaceHolderEnd") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderEnd + elseif exists("g:Imap_PlaceHolderEnd") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderEnd + else + return "+>" +endfun +" }}} +" s:Iconv: a wrapper for iconv()" {{{ +" Problem: after +" let text = "\xab" +" (or using the raw 8-bit ASCII character in a file with 'fenc' set to +" "latin1") if 'encoding' is set to utf-8, then text does not match itself: +" echo text =~ text +" returns 0. +" Solution: When this happens, a re-encoded version of text does match text: +" echo iconv(text, "latin1", "utf8") =~ text +" returns 1. In this case, convert text to utf-8 with iconv(). +" TODO: Is it better to use &encoding instead of "utf8"? Internally, vim +" uses utf-8, and can convert between latin1 and utf-8 even when compiled with +" -iconv, so let's try using utf-8. +" Arguments: +" a:text = text to be encoded or decoded +" a:mode = "encode" (latin1 to utf8) or "decode" (utf8 to latin1) +" Caution: do not encode and then decode without checking whether the text +" has changed, becuase of the :if clause in encoding! +function! s:Iconv(text, mode) + if a:mode == "decode" + return iconv(a:text, "utf8", "latin1") + endif + if a:text =~ '\V\^' . escape(a:text, '\') . '\$' + return a:text + endif + let textEnc = iconv(a:text, "latin1", "utf8") + if textEnc !~ '\V\^' . escape(a:text, '\') . '\$' + call IMAP_Debug('Encoding problems with text '.a:text.' ', 'imap') + endif + return textEnc +endfun +"" }}} +" IMAP_Debug: interface to Tex_Debug if available, otherwise emulate it {{{ +" Description: +" Do not want a memory leak! Set this to zero so that imaps always +" starts out in a non-debugging mode. +if !exists('g:Imap_Debug') + let g:Imap_Debug = 0 +endif +function! IMAP_Debug(string, pattern) + if !g:Imap_Debug + return + endif + if exists('*Tex_Debug') + call Tex_Debug(a:string, a:pattern) + else + if !exists('s:debug_'.a:pattern) + let s:debug_{a:pattern} = a:string + else + let s:debug_{a:pattern} = s:debug_{a:pattern}.a:string + endif + endif +endfunction " }}} +" IMAP_DebugClear: interface to Tex_DebugClear if avaialable, otherwise emulate it {{{ +" Description: +function! IMAP_DebugClear(pattern) + if exists('*Tex_DebugClear') + call Tex_DebugClear(a:pattern) + else + let s:debug_{a:pattern} = '' + endif +endfunction " }}} +" IMAP_PrintDebug: interface to Tex_DebugPrint if avaialable, otherwise emulate it {{{ +" Description: +function! IMAP_PrintDebug(pattern) + if exists('*Tex_PrintDebug') + call Tex_PrintDebug(a:pattern) + else + if exists('s:debug_'.a:pattern) + echo s:debug_{a:pattern} + endif + endif +endfunction " }}} +" IMAP_Mark: Save the cursor position (if a:action == 'set') in a" {{{ +" script-local variable; restore this position if a:action == 'go'. +let s:Mark = "(0,0)" +let s:initBlanks = '' +function! IMAP_Mark(action) + if a:action == 'set' + let s:Mark = "(" . line(".") . "," . col(".") . ")" + let s:initBlanks = matchstr(getline('.'), '^\s*') + elseif a:action == 'go' + execute "call cursor" s:Mark + let blanksNow = matchstr(getline('.'), '^\s*') + if strlen(blanksNow) > strlen(s:initBlanks) + execute 'silent! normal! '.(strlen(blanksNow) - strlen(s:initBlanks)).'l' + elseif strlen(blanksNow) < strlen(s:initBlanks) + execute 'silent! normal! '.(strlen(s:initBlanks) - strlen(blanksNow)).'h' + endif + endif +endfunction "" }}} +" IMAP_GetVal: gets the value of a variable {{{ +" Description: first checks window local, then buffer local etc. +function! IMAP_GetVal(name, ...) + if a:0 > 0 + let default = a:1 + else + let default = '' + endif + if exists('w:'.a:name) + return w:{a:name} + elseif exists('b:'.a:name) + return b:{a:name} + elseif exists('g:'.a:name) + return g:{a:name} + else + return default + endif +endfunction " }}} + +" ============================================================================== +" A bonus function: Snip() +" ============================================================================== +" Snip: puts a scissor string above and below block of text {{{ +" Desciption: +"-------------------------------------%<------------------------------------- +" this puts a the string "--------%<---------" above and below the visually +" selected block of lines. the length of the 'tearoff' string depends on the +" maximum string length in the selected range. this is an aesthetically more +" pleasing alternative instead of hardcoding a length. +"-------------------------------------%<------------------------------------- +function! <SID>Snip() range + let i = a:firstline + let maxlen = -2 + " find out the maximum virtual length of each line. + while i <= a:lastline + exe i + let length = virtcol('$') + let maxlen = (length > maxlen ? length : maxlen) + let i = i + 1 + endwhile + let maxlen = (maxlen > &tw && &tw != 0 ? &tw : maxlen) + let half = maxlen/2 + exe a:lastline + " put a string below + exe "norm! o\<esc>".(half - 1)."a-\<esc>A%<\<esc>".(half - 1)."a-" + " and above. its necessary to put the string below the block of lines + " first because that way the first line number doesnt change... + exe a:firstline + exe "norm! O\<esc>".(half - 1)."a-\<esc>A%<\<esc>".(half - 1)."a-" +endfunction + +com! -nargs=0 -range Snip :<line1>,<line2>call <SID>Snip() +" }}} + +let &cpo = s:save_cpo + +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap diff --git a/dot_vim/plugin/libList.vim b/dot_vim/plugin/libList.vim new file mode 100644 index 0000000..7d72c3e --- /dev/null +++ b/dot_vim/plugin/libList.vim @@ -0,0 +1,249 @@ +" File: libList.vim +" Last Change: 2001 Dec 10 +" Maintainer: Gontran BAERTS <gbcreation@free.fr> +" Version: 0.1 +" +" Please don't hesitate to correct my english :) +" Send corrections to <gbcreation@free.fr> +" +"----------------------------------------------------------------------------- +" Description: libList.vim is a set of functions to work with lists or one +" level arrays. +" +"----------------------------------------------------------------------------- +" To Enable: Normally, this file will reside in your plugins directory and be +" automatically sourced. +" +"----------------------------------------------------------------------------- +" Usage: Lists are strings variable with values separated by g:listSep +" character (comma" by default). You may redefine g:listSep variable as you +" wish. +" +" Here are available functions : +" +" - AddListItem( array, newItem, index ) : +" Add item "newItem" to array "array" at "index" position +" - GetListItem( array, index ) : +" Return item at "index" position in array "array" +" - GetListMatchItem( array, pattern ) : +" Return item matching "pattern" in array "array" +" - GetListCount( array ) : +" Return the number of items in array "array" +" - RemoveListItem( array, index ) : +" Remove item at "index" position from array "array" +" - ReplaceListItem( array, index, item ) : +" Remove item at "index" position by "item" in array "array" +" - ExchangeListItems( array, item1Index, item2Index ) : +" Exchange item "item1Index" with item "item2Index" in array "array" +" - QuickSortList( array, beg, end ) : +" Return array "array" with items between "beg" and "end" sorted +" +" Example: +" let mylist="" +" echo GetListCount( mylist ) " --> 0 +" let mylist = AddListItem( mylist, "One", 0 ) " mylist == "One" +" let mylist = AddListItem( mylist, "Three", 1 ) " mylist == "One,Three" +" let mylist = AddListItem( mylist, "Two", 1 ) " mylist == "One,Two,Three" +" echo GetListCount( mylist ) " --> 3 +" echo GetListItem( mylist, 2 ) " --> Three +" echo GetListMatchItem( mylist, "w" ) " --> two +" echo GetListMatchItem( mylist, "e" ) " --> One +" let mylist = RemoveListItem( mylist, 2 ) " mylist == "One,Two" +" echo GetListCount( mylist ) " --> 2 +" let mylist = ReplaceListItem( mylist, 0, "Three" ) " mylist == "Three,Two" +" let mylist = ExchangeListItems( mylist, 0, 1 ) " mylist == "Two,Three" +" let mylist = AddListItem( mylist, "One", 0 ) " mylist == "One,Two,Three" +" let mylist = QuickSortList( mylist, 0, GetListCount(mylist)-1 ) +" " mylist == "One,Three,Two" +" +"----------------------------------------------------------------------------- +" Updates: +" in version 0.1 +" - First version + +" Has this already been loaded ? +if exists("loaded_libList") + finish +endif +let loaded_libList=1 + +"** +" Separator: +" You may change the separator character et any time. +"** +let g:listSep = "," + +"** +"AddListItem: +" Add new item at given position. +" First item index is 0 (zero). +"Parameters: +" - array : Array/List (string of values) which receives the new item. +" - newItem : String containing the item value to add. +" - index : Integer indicating the position at which the new item is added. +" It must be greater than or equals to 0 (zero). +"Return: +"String containing array values, including newItem. +"** +function AddListItem( array, newItem, index ) + if a:index == 0 + if a:array == "" + return a:newItem + endif + return a:newItem . g:listSep . a:array + endif + return substitute( a:array, '\(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}', '\0' . g:listSep . a:newItem , "" ) +endfunction + +"** +"GetListItem: +" Get item at given position. +"Parameters: +" - array : Array/List (string of values). +" - index : Integer indicating the position of item to return. +" It must be greater than or equals to 0 (zero). +"Return: +"String representing the item. +"** +function GetListItem( array, index ) + if a:index == 0 + return matchstr( a:array, '^[^' . g:listSep . ']\+' ) + else + return matchstr( a:array, "[^" . g:listSep . "]\\+", matchend( a:array, '\(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}' . g:listSep ) ) + endif +endfunction + +"** +"GetListMatchItem: +" Get the first item matching given pattern. +"Parameters: +" - array : Array/List (string of values). +" - pattern : Regular expression to match with items. +" Avoid to use ^, $ and listSep characters in pattern, unless you +" know what you do. +"Return: +"String representing the first item that matches the pattern. +"** +function GetListMatchItem( array, pattern ) + return matchstr( a:array, '[^' . g:listSep . ']*' . a:pattern . '[^' . g:listSep . ']*' ) +endfunction + +"** +"ReplaceListItem: +" Replace item at given position by a new one. +"Parameters: +" - array : Array/List (string of values). +" - index : Integer indicating the position of item to replace. +" It must be greater than or equals to 0 (zero). +" - item : String containing the new value of the replaced item. +"Return: +"String containing array values. +"** +function ReplaceListItem( array, index, item ) + if a:index == 0 + return substitute( a:array, '^[^' .g:listSep. ']\+', a:item, "" ) + else + return substitute( a:array, '\(\%(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}\)' . g:listSep . '[^' . g:listSep . ']\+', '\1' . g:listSep . a:item , "" ) + endif +endfunction + +"** +"RemoveListItem: +" Remove item at given position. +"Parameters: +" - array : Array/List (string of values) from which remove an item. +" - index : Integer indicating the position of item to remove. +" It must be greater than or equals to 0 (zero). +"Return: +"String containing array values, except the removed one. +"** +function RemoveListItem( array, index ) + if a:index == 0 + return substitute( a:array, '^[^' .g:listSep. ']\+\(' . g:listSep . '\|$\)', "", "" ) + else + return substitute( a:array, '\(\%(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}\)' . g:listSep . '[^' . g:listSep . ']\+', '\1', "" ) + endif +endfunction + +"** +"ExchangeListItems: +" Exchange item at position item1Index with item at position item2Index. +"Parameters: +" - array : Array/List (string of values). +" - item1index : Integer indicating the position of the first item to exchange. +" It must be greater than or equals to 0 (zero). +" - item2index : Integer indicating the position of the second item to +" exchange. It must be greater than or equals to 0 (zero). +"Return: +"String containing array values. +"** +function ExchangeListItems( array, item1Index, item2Index ) + let item1 = GetListItem( a:array, a:item1Index ) + let array = ReplaceListItem( a:array, a:item1Index, GetListItem( a:array, a:item2Index ) ) + return ReplaceListItem( array, a:item2Index, item1 ) +endfunction + +"** +"GetListCount: +" Number of items in array. +"Parameters: +" - array : Array/List (string of values). +"Return: +"Integer representing the number of items in array. +"Index of last item is GetListCount(array)-1. +"** +function GetListCount( array ) + if a:array == "" | return 0 | endif + let pos = 0 + let cnt = 0 + while pos != -1 + let pos = matchend( a:array, g:listSep, pos ) + let cnt = cnt + 1 + endwhile + return cnt +endfunction + +"** +"QuickSortList: +" Sort array. +"Parameters: +" - array : Array/List (string of values). +" - beg : Min index of the range of items to sort. +" - end : Max index of the range of items to sort. +"Return: +"String containing array values with indicated range of items sorted. +"** +function QuickSortList( array, beg, end ) + let array = a:array + let pivot = GetListItem( array, a:beg ) + let l = a:beg + let r = a:end + while l < r + while GetListItem( array, r ) > pivot + let r = r - 1 + endwhile + if l != r + let array = ReplaceListItem( array, l, GetListItem( array, r ) ) + let array = ReplaceListItem( array, r, pivot ) + let l = l + 1 + endif + + while GetListItem( array, l ) < pivot + let l = l + 1 + endwhile + if l != r + let array = ReplaceListItem( array, r, GetListItem( array, l ) ) + let array = ReplaceListItem( array, l, pivot ) + let r = r - 1 + endif + endwhile + if a:beg < l-1 + let array = QuickSortList( array, a:beg, l-1 ) + endif + if a:end > l+1 + let array = QuickSortList( array, l+1, a:end ) + endif + return array +endfunction + + diff --git a/dot_vim/plugin/minibufexpl.vim b/dot_vim/plugin/minibufexpl.vim new file mode 100644 index 0000000..4e78063 --- /dev/null +++ b/dot_vim/plugin/minibufexpl.vim @@ -0,0 +1,1838 @@ +" Mini Buffer Explorer <minibufexpl.vim> +" +" HINT: Type zR if you don't know how to use folds +" +" Script Info and Documentation {{{ +"============================================================================= +" Copyright: Copyright (C) 2002 & 2003 Bindu Wavell +" 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, +" minibufexplorer.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. +" +" Name Of File: minibufexpl.vim +" Description: Mini Buffer Explorer Vim Plugin +" Maintainer: Bindu Wavell <bindu@wavell.net> +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=159 +" Last Change: Sunday, June 21, 2004 +" Version: 6.3.2 +" Derived from Jeff Lanzarotta's bufexplorer.vim version 6.0.7 +" Jeff can be reached at (jefflanzarotta@yahoo.com) and the +" original plugin can be found at: +" http://lanzarotta.tripod.com/vim/plugin/6/bufexplorer.vim.zip +" +" Usage: Normally, this file should reside in the plugins +" directory and be automatically sourced. If not, you must +" manually source this file using ':source minibufexplorer.vim'. +" +" You may use the default keymappings of +" +" <Leader>mbe - Opens MiniBufExplorer +" +" or you may want to add something like the following +" key mapping to your _vimrc/.vimrc file. +" +" map <Leader>b :MiniBufExplorer<cr> +" +" However, in most cases you won't need any key-bindings at all. +" +" <Leader> is usually backslash so type "\mbe" (quickly) to open +" the -MiniBufExplorer- window. +" +" Other keymappings include: <Leader>mbc to close the Explorer +" window, <Leader>mbu to force the Explorer to Update and +" <Leader>mbt to toggle the Explorer window; it will open if +" closed or close if open. Each of these key bindings can be +" overridden (see the notes on <Leader>mbe above.) +" +" You can map these additional commands as follows: +" +" map <Leader>c :CMiniBufExplorer<cr> +" map <Leader>u :UMiniBufExplorer<cr> +" map <Leader>t :TMiniBufExplorer<cr> +" +" NOTE: you can change the key binding used in these mappings +" so that they fit with your configuration of vim. +" +" You can also call each of these features by typing the +" following in command mode: +" +" :MiniBufExplorer " Open and/or goto Explorer +" :CMiniBufExplorer " Close the Explorer if it's open +" :UMiniBufExplorer " Update Explorer without navigating +" :TMiniBufExplorer " Toggle the Explorer window open and +" closed. +" +" To control where the new split window goes relative to the +" current window, use the setting: +" +" let g:miniBufExplSplitBelow=0 " Put new window above +" " current or on the +" " left for vertical split +" let g:miniBufExplSplitBelow=1 " Put new window below +" " current or on the +" " right for vertical split +" +" The default for this is read from the &splitbelow VIM option. +" +" By default we are now (as of 6.0.2) forcing the -MiniBufExplorer- +" window to open up at the edge of the screen. You can turn this +" off by setting the following variable in your .vimrc: +" +" let g:miniBufExplSplitToEdge = 0 +" +" If you would like a vertical explorer you can assign the column +" width (in characters) you want for your explorer window with the +" following .vimrc variable (this was introduced in 6.3.0): +" +" let g:miniBufExplVSplit = 20 " column width in chars +" +" IN HORIZONTAL MODE: +" It is now (as of 6.1.1) possible to set a maximum height for +" the -MiniBufExplorer- window. You can set the max height by +" letting the following variable in your .vimrc: +" +" let g:miniBufExplMaxSize = <max lines: defualt 0> +" +" setting this to 0 will mean the window gets as big as +" needed to fit all your buffers. +" +" NOTE: This was g:miniBufExplMaxHeight before 6.3.0; the old +" setting is backwards compatible if you don't use MaxSize. +" +" As of 6.2.2 it is possible to set a minimum height for the +" -MiniBufExplorer- window. You can set the min height by +" letting the following variable in your .vimrc: +" +" let g:miniBufExplMinSize = <min height: default 1> +" +" NOTE: This was g:miniBufExplMinHeight before 6.3.0; the old +" setting is backwards compatible if you don't use MinSize. +" +" IN VERTICAL MODE: (as of 6.3.0) +" By default the vertical explorer has a fixed width. If you put: +" +" let g:miniBufExplMaxSize = <max width: default 0> +" +" into your .vimrc then MBE will attempt to set the width of the +" MBE window to be as wide as your widest tab. The width will not +" exceed MaxSize even if you have wider tabs. +" +" Accepting the default value of 0 for this will give you a fixed +" width MBE window. +" +" You can specify a MinSize for the vertical explorer window by +" putting the following in your .vimrc: +" +" let g:miniBufExplMinSize = <min width: default 1> +" +" This will have no effect unless you also specivy MaxSize. +" +" By default we are now (as of 6.0.1) turning on the MoreThanOne +" option. This stops the -MiniBufExplorer- from opening +" automatically until more than one eligible buffer is available. +" You can turn this feature off by setting the following variable +" in your .vimrc: +" +" let g:miniBufExplorerMoreThanOne=1 +" +" (The following enhancement is as of 6.2.2) +" Setting this to 0 will cause the MBE window to be loaded even +" if no buffers are available. Setting it to 1 causes the MBE +" window to be loaded as soon as an eligible buffer is read. You +" can also set it to larger numbers. So if you set it to 4 for +" example the MBE window wouldn't auto-open until 4 eligibles +" buffers had been loaded. This is nice for folks that don't +" want an MBE window unless they are editing more than two or +" three buffers. +" +" To enable the optional mapping of Control + Vim Direction Keys +" [hjkl] to window movement commands, you can put the following into +" your .vimrc: +" +" let g:miniBufExplMapWindowNavVim = 1 +" +" To enable the optional mapping of Control + Arrow Keys to window +" movement commands, you can put the following into your .vimrc: +" +" let g:miniBufExplMapWindowNavArrows = 1 +" +" To enable the optional mapping of <C-TAB> and <C-S-TAB> to a +" function that will bring up the next or previous buffer in the +" current window, you can put the following into your .vimrc: +" +" let g:miniBufExplMapCTabSwitchBufs = 1 +" +" To enable the optional mapping of <C-TAB> and <C-S-TAB> to mappings +" that will move to the next and previous (respectively) window, you +" can put the following into your .vimrc: +" +" let g:miniBufExplMapCTabSwitchWindows = 1 +" +" +" NOTE: If you set the ...TabSwitchBufs AND ...TabSwitchWindows, +" ...TabSwitchBufs will be enabled and ...TabSwitchWindows +" will not. +" +" As of MBE 6.3.0, you can put the following into your .vimrc: +" +" let g:miniBufExplUseSingleClick = 1 +" +" If you would like to single click on tabs rather than double +" clicking on them to goto the selected buffer. +" +" NOTE: If you use the single click option in taglist.vim you may +" need to get an updated version that includes a patch I +" provided to allow both explorers to provide single click +" buffer selection. +" +" It is possible to customize the the highlighting for the tabs in +" the MBE by configuring the following highlighting groups: +" +" MBENormal - for buffers that have NOT CHANGED and +" are NOT VISIBLE. +" MBEChanged - for buffers that HAVE CHANGED and are +" NOT VISIBLE +" MBEVisibleNormal - buffers that have NOT CHANGED and are +" VISIBLE +" MBEVisibleChanged - buffers that have CHANGED and are VISIBLE +" +" You can either link to an existing highlighting group by +" adding a command like: +" +" hi link MBEVisibleChanged Error +" +" to your .vimrc or you can specify exact foreground and background +" colors using the following syntax: +" +" hi MBEChanged guibg=darkblue ctermbg=darkblue termbg=white +" +" NOTE: If you set a colorscheme in your .vimrc you should do it +" BEFORE updating the MBE highlighting groups. +" +" If you use other explorers like TagList you can (As of 6.2.8) put: +" +" let g:miniBufExplModSelTarget = 1 +" +" into your .vimrc in order to force MBE to try to place selected +" buffers into a window that does not have a nonmodifiable buffer. +" The upshot of this should be that if you go into MBE and select +" a buffer, the buffer should not show up in a window that is +" hosting an explorer. +" +" There is a VIM bug that can cause buffers to show up without +" their highlighting. The following setting will cause MBE to +" try and turn highlighting back on (introduced in 6.3.1): +" +" let g:miniBufExplForceSyntaxEnable = 1 +" +" MBE has had a basic debugging capability for quite some time. +" However, it has not been very friendly in the past. As of 6.0.8, +" you can put one of each of the following into your .vimrc: +" +" let g:miniBufExplorerDebugLevel = 0 " MBE serious errors output +" let g:miniBufExplorerDebugLevel = 4 " MBE all errors output +" let g:miniBufExplorerDebugLevel = 10 " MBE reports everything +" +" You can also set a DebugMode to cause output to be target as +" follows (default is mode 3): +" +" let g:miniBufExplorerDebugMode = 0 " Errors will show up in +" " a vim window +" let g:miniBufExplorerDebugMode = 1 " Uses VIM's echo function +" " to display on the screen +" let g:miniBufExplorerDebugMode = 2 " Writes to a file +" " MiniBufExplorer.DBG +" let g:miniBufExplorerDebugMode = 3 " Store output in global: +" " g:miniBufExplorerDebugOutput +" +" Or if you are able to start VIM, you might just perform these +" at a command prompt right before you do the operation that is +" failing. +" +" History: Moved to end of file +" +" Known Issues: When debugging is turned on and set to output to a window, there +" are some cases where the window is opened more than once, there +" are other cases where an old debug window can be lost. +" +" Several MBE commands can break the window history so <C-W>[pnw] +" might not take you to the expected window. +" +" Todo: Add the ability to specify a regexp for eligible buffers +" allowing the ability to filter out certain buffers that +" you don't want to control from MBE +" +"============================================================================= +" }}} + +" Startup Check +" +" Has this plugin already been loaded? {{{ +" +if exists('loaded_minibufexplorer') + finish +endif +let loaded_minibufexplorer = 1 +" }}} + +" Mappings and Commands +" +" MBE Keyboard Mappings {{{ +" If we don't already have keyboard mappings for MBE then create them +" +if !hasmapto('<Plug>MiniBufExplorer') + map <unique> <Leader>mbe <Plug>MiniBufExplorer +endif +if !hasmapto('<Plug>CMiniBufExplorer') + map <unique> <Leader>mbc <Plug>CMiniBufExplorer +endif +if !hasmapto('<Plug>UMiniBufExplorer') + map <unique> <Leader>mbu <Plug>UMiniBufExplorer +endif +if !hasmapto('<Plug>TMiniBufExplorer') + map <unique> <Leader>mbt <Plug>TMiniBufExplorer +endif + +" }}} +" MBE <Script> internal map {{{ +" +noremap <unique> <script> <Plug>MiniBufExplorer :call <SID>StartExplorer(1, -1)<CR>:<BS> +noremap <unique> <script> <Plug>CMiniBufExplorer :call <SID>StopExplorer(1)<CR>:<BS> +noremap <unique> <script> <Plug>UMiniBufExplorer :call <SID>AutoUpdate(-1)<CR>:<BS> +noremap <unique> <script> <Plug>TMiniBufExplorer :call <SID>ToggleExplorer()<CR>:<BS> + +" }}} +" MBE commands {{{ +" +if !exists(':MiniBufExplorer') + command! MiniBufExplorer call <SID>StartExplorer(1, -1) +endif +if !exists(':CMiniBufExplorer') + command! CMiniBufExplorer call <SID>StopExplorer(1) +endif +if !exists(':UMiniBufExplorer') + command! UMiniBufExplorer call <SID>AutoUpdate(-1) +endif +if !exists(':TMiniBufExplorer') + command! TMiniBufExplorer call <SID>ToggleExplorer() +endif +if !exists(':MBEbn') + command! MBEbn call <SID>CycleBuffer(1) +endif +if !exists(':MBEbp') + command! MBEbp call <SID>CycleBuffer(0) +endif " }}} + +" Global Configuration Variables +" +" Debug Level {{{ +" +" 0 = no logging +" 1=5 = errors ; 1 is the most important +" 5-9 = info ; 5 is the most important +" 10 = Entry/Exit +if !exists('g:miniBufExplorerDebugLevel') + let g:miniBufExplorerDebugLevel = 0 +endif + +" }}} +" Debug Mode {{{ +" +" 0 = debug to a window +" 1 = use vim's echo facility +" 2 = write to a file named MiniBufExplorer.DBG +" in the directory where vim was started +" THIS IS VERY SLOW +" 3 = Write into g:miniBufExplorerDebugOutput +" global variable [This is the default] +if !exists('g:miniBufExplorerDebugMode') + let g:miniBufExplorerDebugMode = 3 +endif + +" }}} +" Allow auto update? {{{ +" +" We start out with this off for startup, but once vim is running we +" turn this on. +if !exists('g:miniBufExplorerAutoUpdate') + let g:miniBufExplorerAutoUpdate = 0 +endif + +" }}} +" MoreThanOne? {{{ +" Display Mini Buf Explorer when there are 'More Than One' eligible buffers +" +if !exists('g:miniBufExplorerMoreThanOne') + let g:miniBufExplorerMoreThanOne = 2 +endif + +" }}} +" Split below/above/left/right? {{{ +" When opening a new -MiniBufExplorer- window, split the new windows below or +" above the current window? 1 = below, 0 = above. +" +if !exists('g:miniBufExplSplitBelow') + let g:miniBufExplSplitBelow = &splitbelow +endif + +" }}} +" Split to edge? {{{ +" When opening a new -MiniBufExplorer- window, split the new windows to the +" full edge? 1 = yes, 0 = no. +" +if !exists('g:miniBufExplSplitToEdge') + let g:miniBufExplSplitToEdge = 1 +endif + +" }}} +" MaxHeight (depreciated) {{{ +" When sizing the -MiniBufExplorer- window, assign a maximum window height. +" 0 = size to fit all buffers, otherwise the value is number of lines for +" buffer. [Depreciated use g:miniBufExplMaxSize] +" +if !exists('g:miniBufExplMaxHeight') + let g:miniBufExplMaxHeight = 0 +endif + +" }}} +" MaxSize {{{ +" Same as MaxHeight but also works for vertical splits if specified with a +" vertical split then vertical resizing will be performed. If left at 0 +" then the number of columns in g:miniBufExplVSplit will be used as a +" static window width. +if !exists('g:miniBufExplMaxSize') + let g:miniBufExplMaxSize = g:miniBufExplMaxHeight +endif + +" }}} +" MinHeight (depreciated) {{{ +" When sizing the -MiniBufExplorer- window, assign a minumum window height. +" the value is minimum number of lines for buffer. Setting this to zero can +" cause strange height behavior. The default value is 1 [Depreciated use +" g:miniBufExplMinSize] +" +if !exists('g:miniBufExplMinHeight') + let g:miniBufExplMinHeight = 1 +endif + +" }}} +" MinSize {{{ +" Same as MinHeight but also works for vertical splits. For vertical splits, +" this is ignored unless g:miniBufExplMax(Size|Height) are specified. +if !exists('g:miniBufExplMinSize') + let g:miniBufExplMinSize = g:miniBufExplMinHeight +endif + +" }}} +" Horizontal or Vertical explorer? {{{ +" For folks that like vertical explorers, I'm caving in and providing for +" veritcal splits. If this is set to 0 then the current horizontal +" splitting logic will be run. If however you want a vertical split, +" assign the width (in characters) you wish to assign to the MBE window. +" +if !exists('g:miniBufExplVSplit') + let g:miniBufExplVSplit = 0 +endif + +" }}} +" TabWrap? {{{ +" By default line wrap is used (possibly breaking a tab name between two +" lines.) Turning this option on (setting it to 1) can take more screen +" space, but will make sure that each tab is on one and only one line. +" +if !exists('g:miniBufExplTabWrap') + let g:miniBufExplTabWrap = 0 +endif + +" }}} +" Extended window navigation commands? {{{ +" Global flag to turn extended window navigation commands on or off +" enabled = 1, dissabled = 0 +" +if !exists('g:miniBufExplMapWindowNav') + " This is for backwards compatibility and may be removed in a + " later release, please use the ...NavVim and/or ...NavArrows + " settings. + let g:miniBufExplMapWindowNav = 0 +endif +if !exists('g:miniBufExplMapWindowNavVim') + let g:miniBufExplMapWindowNavVim = 0 +endif +if !exists('g:miniBufExplMapWindowNavArrows') + let g:miniBufExplMapWindowNavArrows = 0 +endif +if !exists('g:miniBufExplMapCTabSwitchBufs') + let g:miniBufExplMapCTabSwitchBufs = 0 +endif +" Notice: that if CTabSwitchBufs is turned on then +" we turn off CTabSwitchWindows. +if g:miniBufExplMapCTabSwitchBufs == 1 || !exists('g:miniBufExplMapCTabSwitchWindows') + let g:miniBufExplMapCTabSwitchWindows = 0 +endif + +" +" If we have enabled control + vim direction key remapping +" then perform the remapping +" +" Notice: I left g:miniBufExplMapWindowNav in for backward +" compatibility. Eventually this mapping will be removed so +" please use the newer g:miniBufExplMapWindowNavVim setting. +if g:miniBufExplMapWindowNavVim || g:miniBufExplMapWindowNav + noremap <C-J> <C-W>j + noremap <C-K> <C-W>k + noremap <C-H> <C-W>h + noremap <C-L> <C-W>l +endif + +" +" If we have enabled control + arrow key remapping +" then perform the remapping +" +if g:miniBufExplMapWindowNavArrows + noremap <C-Down> <C-W>j + noremap <C-Up> <C-W>k + noremap <C-Left> <C-W>h + noremap <C-Right> <C-W>l +endif + +" If we have enabled <C-TAB> and <C-S-TAB> to switch buffers +" in the current window then perform the remapping +" +if g:miniBufExplMapCTabSwitchBufs + noremap <C-TAB> :call <SID>CycleBuffer(1)<CR>:<BS> + noremap <C-S-TAB> :call <SID>CycleBuffer(0)<CR>:<BS> +endif + +" +" If we have enabled <C-TAB> and <C-S-TAB> to switch windows +" then perform the remapping +" +if g:miniBufExplMapCTabSwitchWindows + noremap <C-TAB> <C-W>w + noremap <C-S-TAB> <C-W>W +endif + +" }}} +" Modifiable Select Target {{{ +" +if !exists('g:miniBufExplModSelTarget') + let g:miniBufExplModSelTarget = 0 +endif + +"}}} +" Force Syntax Enable {{{ +" +if !exists('g:miniBufExplForceSyntaxEnable') + let g:miniBufExplForceSyntaxEnable = 0 +endif + +" }}} +" Single/Double Click? {{{ +" flag that can be set to 1 in a users .vimrc to allow +" single click switching of tabs. By default we use +" double click for tab selection. +" +if !exists('g:miniBufExplUseSingleClick') + let g:miniBufExplUseSingleClick = 0 +endif + +" +" attempt to perform single click mapping, it would be much +" nicer if we could nnoremap <buffer> ... however vim does +" not fire the <buffer> <leftmouse> when you use the mouse +" to enter a buffer. +" +if g:miniBufExplUseSingleClick == 1 + let s:clickmap = ':if bufname("%") == "-MiniBufExplorer-" <bar> call <SID>MBEClick() <bar> endif <CR>' + if maparg('<LEFTMOUSE>', 'n') == '' + " no mapping for leftmouse + exec ':nnoremap <silent> <LEFTMOUSE> <LEFTMOUSE>' . s:clickmap + else + " we have a mapping + let g:miniBufExplDoneClickSave = 1 + let s:m = ':nnoremap <silent> <LEFTMOUSE> <LEFTMOUSE>' + let s:m = s:m . substitute(substitute(maparg('<LEFTMOUSE>', 'n'), '|', '<bar>', 'g'), '\c^<LEFTMOUSE>', '', '') + let s:m = s:m . s:clickmap + exec s:m + endif +endif " }}} + +" Variables used internally +" +" Script/Global variables {{{ +" Global used to store the buffer list so we don't update the +" UI unless the list has changed. +if !exists('g:miniBufExplBufList') + let g:miniBufExplBufList = '' +endif + +" Variable used as a mutex so that we don't do lots +" of AutoUpdates at the same time. +if !exists('g:miniBufExplInAutoUpdate') + let g:miniBufExplInAutoUpdate = 0 +endif + +" In debug mode 3 this variable will hold the debug output +if !exists('g:miniBufExplorerDebugOutput') + let g:miniBufExplorerDebugOutput = '' +endif + +" In debug mode 3 this variable will hold the debug output +if !exists('g:miniBufExplForceDisplay') + let g:miniBufExplForceDisplay = 0 +endif + +" Variable used to pass maxTabWidth info between functions +let s:maxTabWidth = 0 + +" Variable used to count debug output lines +let s:debugIndex = 0 + + +" }}} +" Setup an autocommand group and some autocommands {{{ +" that keep our explorer updated automatically. +" +augroup MiniBufExplorer +autocmd MiniBufExplorer BufDelete * call <SID>DEBUG('-=> BufDelete AutoCmd', 10) |call <SID>AutoUpdate(expand('<abuf>')) +autocmd MiniBufExplorer BufEnter * call <SID>DEBUG('-=> BufEnter AutoCmd', 10) |call <SID>AutoUpdate(-1) +autocmd MiniBufExplorer VimEnter * call <SID>DEBUG('-=> VimEnter AutoCmd', 10) |let g:miniBufExplorerAutoUpdate = 1 |call <SID>AutoUpdate(-1) +" }}} + +" Functions +" +" StartExplorer - Sets up our explorer and causes it to be displayed {{{ +" +function! <SID>StartExplorer(sticky, delBufNum) + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering StartExplorer()' ,10) + call <SID>DEBUG('===========================',10) + + if a:sticky == 1 + let g:miniBufExplorerAutoUpdate = 1 + endif + + " Store the current buffer + let l:curBuf = bufnr('%') + + " Prevent a report of our actions from showing up. + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + call <SID>FindCreateWindow('-MiniBufExplorer-', -1, 1, 1) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('StartExplorer called in invalid window',1) + let &report = l:save_rep + let &showcmd = l:save_sc + return + endif + + " !!! We may want to make the following optional -- Bindu + " New windows don't cause all windows to be resized to equal sizes + set noequalalways + " !!! We may want to make the following optional -- Bindu + " We don't want the mouse to change focus without a click + set nomousefocus + + " If folks turn numbering and columns on by default we will turn + " them off for the MBE window + setlocal foldcolumn=0 + setlocal nonumber + + if has("syntax") + syn clear + syn match MBENormal '\[[^\]]*\]' + syn match MBEChanged '\[[^\]]*\]+' + syn match MBEVisibleNormal '\[[^\]]*\]\*+\=' + syn match MBEVisibleChanged '\[[^\]]*\]\*+' + + if !exists("g:did_minibufexplorer_syntax_inits") + let g:did_minibufexplorer_syntax_inits = 1 + hi def link MBENormal Comment + hi def link MBEChanged String + hi def link MBEVisibleNormal Special + hi def link MBEVisibleChanged Special + endif + endif + + " If you press return in the -MiniBufExplorer- then try + " to open the selected buffer in the previous window. + nnoremap <buffer> <CR> :call <SID>MBESelectBuffer()<CR>:<BS> + " If you DoubleClick in the -MiniBufExplorer- then try + " to open the selected buffer in the previous window. + nnoremap <buffer> <2-LEFTMOUSE> :call <SID>MBEDoubleClick()<CR>:<BS> + " If you press d in the -MiniBufExplorer- then try to + " delete the selected buffer. + nnoremap <buffer> d :call <SID>MBEDeleteBuffer()<CR>:<BS> + " If you press w in the -MiniBufExplorer- then switch back + " to the previous window. + nnoremap <buffer> p :wincmd p<CR>:<BS> + " The following allow us to use regular movement keys to + " scroll in a wrapped single line buffer + nnoremap <buffer> j gj + nnoremap <buffer> k gk + nnoremap <buffer> <down> gj + nnoremap <buffer> <up> gk + " The following allows for quicker moving between buffer + " names in the [MBE] window it also saves the last-pattern + " and restores it. + nnoremap <buffer> <TAB> :call search('\[[0-9]*:[^\]]*\]')<CR>:<BS> + nnoremap <buffer> <S-TAB> :call search('\[[0-9]*:[^\]]*\]','b')<CR>:<BS> + + call <SID>DisplayBuffers(a:delBufNum) + + if (l:curBuf != -1) + call search('\['.l:curBuf.':'.expand('#'.l:curBuf.':t').'\]') + else + call <SID>DEBUG('No current buffer to search for',9) + endif + + let &report = l:save_rep + let &showcmd = l:save_sc + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed StartExplorer()' ,10) + call <SID>DEBUG('===========================',10) + +endfunction + +" }}} +" StopExplorer - Looks for our explorer and closes the window if it is open {{{ +" +function! <SID>StopExplorer(sticky) + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering StopExplorer()' ,10) + call <SID>DEBUG('===========================',10) + + if a:sticky == 1 + let g:miniBufExplorerAutoUpdate = 0 + endif + + let l:winNum = <SID>FindWindow('-MiniBufExplorer-', 1) + + if l:winNum != -1 + exec l:winNum.' wincmd w' + silent! close + wincmd p + endif + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed StopExplorer()' ,10) + call <SID>DEBUG('===========================',10) + +endfunction + +" }}} +" ToggleExplorer - Looks for our explorer and opens/closes the window {{{ +" +function! <SID>ToggleExplorer() + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering ToggleExplorer()' ,10) + call <SID>DEBUG('===========================',10) + + let g:miniBufExplorerAutoUpdate = 0 + + let l:winNum = <SID>FindWindow('-MiniBufExplorer-', 1) + + if l:winNum != -1 + call <SID>StopExplorer(1) + else + call <SID>StartExplorer(1, -1) + wincmd p + endif + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed ToggleExplorer()' ,10) + call <SID>DEBUG('===========================',10) + +endfunction + +" }}} +" FindWindow - Return the window number of a named buffer {{{ +" If none is found then returns -1. +" +function! <SID>FindWindow(bufName, doDebug) + if a:doDebug + call <SID>DEBUG('Entering FindWindow()',10) + endif + + " Try to find an existing window that contains + " our buffer. + let l:bufNum = bufnr(a:bufName) + if l:bufNum != -1 + if a:doDebug + call <SID>DEBUG('Found buffer ('.a:bufName.'): '.l:bufNum,9) + endif + let l:winNum = bufwinnr(l:bufNum) + else + let l:winNum = -1 + endif + + return l:winNum + +endfunction + +" }}} +" FindCreateWindow - Attempts to find a window for a named buffer. {{{ +" +" If it is found then moves there. Otherwise creates a new window and +" configures it and moves there. +" +" forceEdge, -1 use defaults, 0 below, 1 above +" isExplorer, 0 no, 1 yes +" doDebug, 0 no, 1 yes +" +function! <SID>FindCreateWindow(bufName, forceEdge, isExplorer, doDebug) + if a:doDebug + call <SID>DEBUG('Entering FindCreateWindow('.a:bufName.')',10) + endif + + " Save the user's split setting. + let l:saveSplitBelow = &splitbelow + + " Set to our new values. + let &splitbelow = g:miniBufExplSplitBelow + + " Try to find an existing explorer window + let l:winNum = <SID>FindWindow(a:bufName, a:doDebug) + + " If found goto the existing window, otherwise + " split open a new window. + if l:winNum != -1 + if a:doDebug + call <SID>DEBUG('Found window ('.a:bufName.'): '.l:winNum,9) + endif + exec l:winNum.' wincmd w' + let l:winFound = 1 + else + + if g:miniBufExplSplitToEdge == 1 || a:forceEdge >= 0 + + let l:edge = &splitbelow + if a:forceEdge >= 0 + let l:edge = a:forceEdge + endif + + if l:edge + if g:miniBufExplVSplit == 0 + exec 'bo sp '.a:bufName + else + exec 'bo vsp '.a:bufName + endif + else + if g:miniBufExplVSplit == 0 + exec 'to sp '.a:bufName + else + exec 'to vsp '.a:bufName + endif + endif + else + if g:miniBufExplVSplit == 0 + exec 'sp '.a:bufName + else + " &splitbelow doesn't affect vertical splits + " so we have to do this explicitly.. ugh. + if &splitbelow + exec 'rightb vsp '.a:bufName + else + exec 'vsp '.a:bufName + endif + endif + endif + + let g:miniBufExplForceDisplay = 1 + + " Try to find an existing explorer window + let l:winNum = <SID>FindWindow(a:bufName, a:doDebug) + if l:winNum != -1 + if a:doDebug + call <SID>DEBUG('Created and then found window ('.a:bufName.'): '.l:winNum,9) + endif + exec l:winNum.' wincmd w' + else + if a:doDebug + call <SID>DEBUG('FindCreateWindow failed to create window ('.a:bufName.').',1) + endif + return + endif + + if a:isExplorer + " Turn off the swapfile, set the buffer type so that it won't get written, + " and so that it will get deleted when it gets hidden and turn on word wrap. + setlocal noswapfile + setlocal buftype=nofile + setlocal bufhidden=delete + if g:miniBufExplVSplit == 0 + setlocal wrap + else + setlocal nowrap + exec('setlocal winwidth='.g:miniBufExplMinSize) + endif + endif + + if a:doDebug + call <SID>DEBUG('Window ('.a:bufName.') created: '.winnr(),9) + endif + + endif + + " Restore the user's split setting. + let &splitbelow = l:saveSplitBelow + +endfunction + +" }}} +" DisplayBuffers - Wrapper for getting MBE window shown {{{ +" +" Makes sure we are in our explorer, then erases the current buffer and turns +" it into a mini buffer explorer window. +" +function! <SID>DisplayBuffers(delBufNum) + call <SID>DEBUG('Entering DisplayBuffers()',10) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('DisplayBuffers called in invalid window',1) + return + endif + + " We need to be able to modify the buffer + setlocal modifiable + + call <SID>ShowBuffers(a:delBufNum) + call <SID>ResizeWindow() + + normal! zz + + " Prevent the buffer from being modified. + setlocal nomodifiable + set nobuflisted + +endfunction + +" }}} +" Resize Window - Set width/height of MBE window {{{ +" +" Makes sure we are in our explorer, then sets the height/width for our explorer +" window so that we can fit all of our information without taking extra lines. +" +function! <SID>ResizeWindow() + call <SID>DEBUG('Entering ResizeWindow()',10) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('ResizeWindow called in invalid window',1) + return + endif + + let l:width = winwidth('.') + + " Horizontal Resize + if g:miniBufExplVSplit == 0 + + if g:miniBufExplTabWrap == 0 + let l:length = strlen(getline('.')) + let l:height = 0 + if (l:width == 0) + let l:height = winheight('.') + else + let l:height = (l:length / l:width) + " handle truncation from div + if (l:length % l:width) != 0 + let l:height = l:height + 1 + endif + endif + else + exec("setlocal textwidth=".l:width) + normal gg + normal gq} + normal G + let l:height = line('.') + normal gg + endif + + " enforce max window height + if g:miniBufExplMaxSize != 0 + if g:miniBufExplMaxSize < l:height + let l:height = g:miniBufExplMaxSize + endif + endif + + " enfore min window height + if l:height < g:miniBufExplMinSize || l:height == 0 + let l:height = g:miniBufExplMinSize + endif + + call <SID>DEBUG('ResizeWindow to '.l:height.' lines',9) + + exec('resize '.l:height) + + " Vertical Resize + else + + if g:miniBufExplMaxSize != 0 + let l:newWidth = s:maxTabWidth + if l:newWidth > g:miniBufExplMaxSize + let l:newWidth = g:miniBufExplMaxSize + endif + if l:newWidth < g:miniBufExplMinSize + let l:newWidth = g:miniBufExplMinSize + endif + else + let l:newWidth = g:miniBufExplVSplit + endif + + if l:width != l:newWidth + call <SID>DEBUG('ResizeWindow to '.l:newWidth.' columns',9) + exec('vertical resize '.l:newWidth) + endif + + endif + +endfunction + +" }}} +" ShowBuffers - Clear current buffer and put the MBE text into it {{{ +" +" Makes sure we are in our explorer, then adds a list of all modifiable +" buffers to the current buffer. Special marks are added for buffers that +" are in one or more windows (*) and buffers that have been modified (+) +" +function! <SID>ShowBuffers(delBufNum) + call <SID>DEBUG('Entering ShowBuffers()',10) + + let l:ListChanged = <SID>BuildBufferList(a:delBufNum, 1) + + if (l:ListChanged == 1 || g:miniBufExplForceDisplay) + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + " Delete all lines in buffer. + 1,$d _ + + " Goto the end of the buffer put the buffer list + " and then delete the extra trailing blank line + $ + put! =g:miniBufExplBufList + $ d _ + + let g:miniBufExplForceDisplay = 0 + + let &report = l:save_rep + let &showcmd = l:save_sc + else + call <SID>DEBUG('Buffer list not update since there was no change',9) + endif + +endfunction + +" }}} +" Max - Returns the max of two numbers {{{ +" +function! <SID>Max(argOne, argTwo) + if a:argOne > a:argTwo + return a:argOne + else + return a:argTwo + endif +endfunction + +" }}} +" BuildBufferList - Build the text for the MBE window {{{ +" +" Creates the buffer list string and returns 1 if it is different than +" last time this was called and 0 otherwise. +" +function! <SID>BuildBufferList(delBufNum, updateBufList) + call <SID>DEBUG('Entering BuildBufferList()',10) + + let l:NBuffers = bufnr('$') " Get the number of the last buffer. + let l:i = 0 " Set the buffer index to zero. + + let l:fileNames = '' + let l:maxTabWidth = 0 + + " Loop through every buffer less than the total number of buffers. + while(l:i <= l:NBuffers) + let l:i = l:i + 1 + + " If we have a delBufNum and it is the current + " buffer then ignore the current buffer. + " Otherwise, continue. + if (a:delBufNum == -1 || l:i != a:delBufNum) + " Make sure the buffer in question is listed. + if(getbufvar(l:i, '&buflisted') == 1) + " Get the name of the buffer. + let l:BufName = bufname(l:i) + " Check to see if the buffer is a blank or not. If the buffer does have + " a name, process it. + if(strlen(l:BufName)) + " Only show modifiable buffers (The idea is that we don't + " want to show Explorers) + if (getbufvar(l:i, '&modifiable') == 1 && BufName != '-MiniBufExplorer-') + + " Get filename & Remove []'s & ()'s + let l:shortBufName = fnamemodify(l:BufName, ":t") + let l:shortBufName = substitute(l:shortBufName, '[][()]', '', 'g') + let l:tab = '['.l:i.':'.l:shortBufName.']' + + " If the buffer is open in a window mark it + if bufwinnr(l:i) != -1 + let l:tab = l:tab . '*' + endif + + " If the buffer is modified then mark it + if(getbufvar(l:i, '&modified') == 1) + let l:tab = l:tab . '+' + endif + + let l:maxTabWidth = <SID>Max(strlen(l:tab), l:maxTabWidth) + let l:fileNames = l:fileNames.l:tab + + " If horizontal and tab wrap is turned on we need to add spaces + if g:miniBufExplVSplit == 0 + if g:miniBufExplTabWrap != 0 + let l:fileNames = l:fileNames.' ' + endif + " If not horizontal we need a newline + else + let l:fileNames = l:fileNames . "\n" + endif + endif + endif + endif + endif + endwhile + + if (g:miniBufExplBufList != l:fileNames) + if (a:updateBufList) + let g:miniBufExplBufList = l:fileNames + let s:maxTabWidth = l:maxTabWidth + endif + return 1 + else + return 0 + endif + +endfunction + +" }}} +" HasEligibleBuffers - Are there enough MBE eligible buffers to open the MBE window? {{{ +" +" Returns 1 if there are any buffers that can be displayed in a +" mini buffer explorer. Otherwise returns 0. If delBufNum is +" any non -1 value then don't include that buffer in the list +" of eligible buffers. +" +function! <SID>HasEligibleBuffers(delBufNum) + call <SID>DEBUG('Entering HasEligibleBuffers()',10) + + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + let l:NBuffers = bufnr('$') " Get the number of the last buffer. + let l:i = 0 " Set the buffer index to zero. + let l:found = 0 " No buffer found + + if (g:miniBufExplorerMoreThanOne > 1) + call <SID>DEBUG('More Than One mode turned on',6) + endif + let l:needed = g:miniBufExplorerMoreThanOne + + " Loop through every buffer less than the total number of buffers. + while(l:i <= l:NBuffers && l:found < l:needed) + let l:i = l:i + 1 + + " If we have a delBufNum and it is the current + " buffer then ignore the current buffer. + " Otherwise, continue. + if (a:delBufNum == -1 || l:i != a:delBufNum) + " Make sure the buffer in question is listed. + if (getbufvar(l:i, '&buflisted') == 1) + " Get the name of the buffer. + let l:BufName = bufname(l:i) + " Check to see if the buffer is a blank or not. If the buffer does have + " a name, process it. + if (strlen(l:BufName)) + " Only show modifiable buffers (The idea is that we don't + " want to show Explorers) + if ((getbufvar(l:i, '&modifiable') == 1) && (BufName != '-MiniBufExplorer-')) + + let l:found = l:found + 1 + + endif + endif + endif + endif + endwhile + + let &report = l:save_rep + let &showcmd = l:save_sc + + call <SID>DEBUG('HasEligibleBuffers found '.l:found.' eligible buffers of '.l:needed.' needed',6) + + return (l:found >= l:needed) + +endfunction + +" }}} +" Auto Update - Function called by auto commands for auto updating the MBE {{{ +" +" IF auto update is turned on AND +" we are in a real buffer AND +" we have enough eligible buffers THEN +" Update our explorer and get back to the current window +" +" If we get a buffer number for a buffer that +" is being deleted, we need to make sure and +" remove the buffer from the list of eligible +" buffers in case we are down to one eligible +" buffer, in which case we will want to close +" the MBE window. +" +function! <SID>AutoUpdate(delBufNum) + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering AutoUpdate('.a:delBufNum.') : '.bufnr('%').' : '.bufname('%'),10) + call <SID>DEBUG('===========================',10) + + if (g:miniBufExplInAutoUpdate == 1) + call <SID>DEBUG('AutoUpdate recursion stopped',9) + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Terminated AutoUpdate()' ,10) + call <SID>DEBUG('===========================',10) + return + else + let g:miniBufExplInAutoUpdate = 1 + endif + + " Don't bother autoupdating the MBE window + if (bufname('%') == '-MiniBufExplorer-') + " If this is the only buffer left then toggle the buffer + if (winbufnr(2) == -1) + call <SID>CycleBuffer(1) + call <SID>DEBUG('AutoUpdate does not run for cycled windows', 9) + else + call <SID>DEBUG('AutoUpdate does not run for the MBE window', 9) + endif + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Terminated AutoUpdate()' ,10) + call <SID>DEBUG('===========================',10) + + let g:miniBufExplInAutoUpdate = 0 + return + + endif + + if (a:delBufNum != -1) + call <SID>DEBUG('AutoUpdate will make sure that buffer '.a:delBufNum.' is not included in the buffer list.', 5) + endif + + " Only allow updates when the AutoUpdate flag is set + " this allows us to stop updates on startup. + if g:miniBufExplorerAutoUpdate == 1 + " Only show MiniBufExplorer if we have a real buffer + if ((g:miniBufExplorerMoreThanOne == 0) || (bufnr('%') != -1 && bufname('%') != "")) + if <SID>HasEligibleBuffers(a:delBufNum) == 1 + " if we don't have a window then create one + let l:bufnr = <SID>FindWindow('-MiniBufExplorer-', 0) + if (l:bufnr == -1) + call <SID>DEBUG('About to call StartExplorer (Create MBE)', 9) + call <SID>StartExplorer(0, a:delBufNum) + else + " otherwise only update the window if the contents have + " changed + let l:ListChanged = <SID>BuildBufferList(a:delBufNum, 0) + if (l:ListChanged) + call <SID>DEBUG('About to call StartExplorer (Update MBE)', 9) + call <SID>StartExplorer(0, a:delBufNum) + endif + endif + + " go back to the working buffer + if (bufname('%') == '-MiniBufExplorer-') + wincmd p + endif + else + call <SID>DEBUG('Failed in eligible check', 9) + call <SID>StopExplorer(0) + endif + + " VIM sometimes turns syntax highlighting off, + " we can force it on, but this may cause weird + " behavior so this is an optional hack to force + " syntax back on when we enter a buffer + if g:miniBufExplForceSyntaxEnable + call <SID>DEBUG('Enable Syntax', 9) + exec 'syntax enable' + endif + + else + call <SID>DEBUG('No buffers loaded...',9) + endif + else + call <SID>DEBUG('AutoUpdates are turned off, terminating',9) + endif + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed AutoUpdate()' ,10) + call <SID>DEBUG('===========================',10) + + let g:miniBufExplInAutoUpdate = 0 + +endfunction + +" }}} +" GetSelectedBuffer - From the MBE window, return the bufnum for buf under cursor {{{ +" +" If we are in our explorer window then return the buffer number +" for the buffer under the cursor. +" +function! <SID>GetSelectedBuffer() + call <SID>DEBUG('Entering GetSelectedBuffer()',10) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('GetSelectedBuffer called in invalid window',1) + return -1 + endif + + let l:save_reg = @" + let @" = "" + normal ""yi[ + if @" != "" + let l:retv = substitute(@",'\([0-9]*\):.*', '\1', '') + 0 + let @" = l:save_reg + return l:retv + else + let @" = l:save_reg + return -1 + endif + +endfunction + +" }}} +" MBESelectBuffer - From the MBE window, open buffer under the cursor {{{ +" +" If we are in our explorer, then we attempt to open the buffer under the +" cursor in the previous window. +" +function! <SID>MBESelectBuffer() + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering MBESelectBuffer()' ,10) + call <SID>DEBUG('===========================',10) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('MBESelectBuffer called in invalid window',1) + return + endif + + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + let l:bufnr = <SID>GetSelectedBuffer() + let l:resize = 0 + + if(l:bufnr != -1) " If the buffer exists. + + let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate + let g:miniBufExplorerAutoUpdate = 0 + " Switch to the previous window + wincmd p + + " If we are in the buffer explorer or in a nonmodifiable buffer with + " g:miniBufExplModSelTarget set then try another window (a few times) + if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) + wincmd w + if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) + wincmd w + if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) + wincmd w + " The following handles the case where -MiniBufExplorer- + " is the only window left. We need to resize so we don't + " end up with a 1 or two line buffer. + if bufname('%') == '-MiniBufExplorer-' + let l:resize = 1 + endif + endif + endif + endif + + exec('b! '.l:bufnr) + if (l:resize) + resize + endif + let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate + call <SID>AutoUpdate(-1) + + endif + + let &report = l:save_rep + let &showcmd = l:save_sc + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed MBESelectBuffer()',10) + call <SID>DEBUG('===========================',10) + +endfunction + +" }}} +" MBEDeleteBuffer - From the MBE window, delete selected buffer from list {{{ +" +" After making sure that we are in our explorer, This will delete the buffer +" under the cursor. If the buffer under the cursor is being displayed in a +" window, this routine will attempt to get different buffers into the +" windows that will be affected so that windows don't get removed. +" +function! <SID>MBEDeleteBuffer() + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Entering MBEDeleteBuffer()' ,10) + call <SID>DEBUG('===========================',10) + + " Make sure we are in our window + if bufname('%') != '-MiniBufExplorer-' + call <SID>DEBUG('MBEDeleteBuffer called in invalid window',1) + return + endif + + let l:curLine = line('.') + let l:curCol = virtcol('.') + let l:selBuf = <SID>GetSelectedBuffer() + let l:selBufName = bufname(l:selBuf) + + if l:selBufName == 'MiniBufExplorer.DBG' && g:miniBufExplorerDebugLevel > 0 + call <SID>DEBUG('MBEDeleteBuffer will not delete the debug window, when debugging is turned on.',1) + return + endif + + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + + if l:selBuf != -1 + + " Don't want auto updates while we are processing a delete + " request. + let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate + let g:miniBufExplorerAutoUpdate = 0 + + " Save previous window so that if we show a buffer after + " deleting. The show will come up in the correct window. + wincmd p + let l:prevWin = winnr() + let l:prevWinBuf = winbufnr(winnr()) + + call <SID>DEBUG('Previous window: '.l:prevWin.' buffer in window: '.l:prevWinBuf,5) + call <SID>DEBUG('Selected buffer is <'.l:selBufName.'>['.l:selBuf.']',5) + + " If buffer is being displayed in a window then + " move window to a different buffer before + " deleting this one. + let l:winNum = (bufwinnr(l:selBufName) + 0) + " while we have windows that contain our buffer + while l:winNum != -1 + call <SID>DEBUG('Buffer '.l:selBuf.' is being displayed in window: '.l:winNum,5) + + " move to window that contains our selected buffer + exec l:winNum.' wincmd w' + + call <SID>DEBUG('We are now in window: '.winnr().' which contains buffer: '.bufnr('%').' and should contain buffer: '.l:selBuf,5) + + let l:origBuf = bufnr('%') + call <SID>CycleBuffer(1) + let l:curBuf = bufnr('%') + + call <SID>DEBUG('Window now contains buffer: '.bufnr('%').' which should not be: '.l:selBuf,5) + + if l:origBuf == l:curBuf + " we wrapped so we are going to have to delete a buffer + " that is in an open window. + let l:winNum = -1 + else + " see if we have anymore windows with our selected buffer + let l:winNum = (bufwinnr(l:selBufName) + 0) + endif + endwhile + + " Attempt to restore previous window + call <SID>DEBUG('Restoring previous window to: '.l:prevWin,5) + exec l:prevWin.' wincmd w' + + " Try to get back to the -MiniBufExplorer- window + let l:winNum = bufwinnr(bufnr('-MiniBufExplorer-')) + if l:winNum != -1 + exec l:winNum.' wincmd w' + call <SID>DEBUG('Got to -MiniBufExplorer- window: '.winnr(),5) + else + call <SID>DEBUG('Unable to get to -MiniBufExplorer- window',1) + endif + + " Delete the buffer selected. + call <SID>DEBUG('About to delete buffer: '.l:selBuf,5) + exec('silent! bd '.l:selBuf) + + let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate + call <SID>DisplayBuffers(-1) + call cursor(l:curLine, l:curCol) + + endif + + let &report = l:save_rep + let &showcmd = l:save_sc + + call <SID>DEBUG('===========================',10) + call <SID>DEBUG('Completed MBEDeleteBuffer()',10) + call <SID>DEBUG('===========================',10) + +endfunction + +" }}} +" MBEClick - Handle mouse double click {{{ +" +function! s:MBEClick() + call <SID>DEBUG('Entering MBEClick()',10) + call <SID>MBESelectBuffer() +endfunction + +" +" MBEDoubleClick - Double click with the mouse. +" +function! s:MBEDoubleClick() + call <SID>DEBUG('Entering MBEDoubleClick()',10) + call <SID>MBESelectBuffer() +endfunction + +" }}} +" CycleBuffer - Cycle Through Buffers {{{ +" +" Move to next or previous buffer in the current window. If there +" are no more modifiable buffers then stay on the current buffer. +" can be called with no parameters in which case the buffers are +" cycled forward. Otherwise a single argument is accepted, if +" it's 0 then the buffers are cycled backwards, otherwise they +" are cycled forward. +" +function! <SID>CycleBuffer(forward) + + " The following hack handles the case where we only have one + " window open and it is too small + let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate + if (winbufnr(2) == -1) + resize + let g:miniBufExplorerAutoUpdate = 0 + endif + + " Change buffer (keeping track of before and after buffers) + let l:origBuf = bufnr('%') + if (a:forward == 1) + bn! + else + bp! + endif + let l:curBuf = bufnr('%') + + " Skip any non-modifiable buffers, but don't cycle forever + " This should stop us from stopping in any of the [Explorers] + while getbufvar(l:curBuf, '&modifiable') == 0 && l:origBuf != l:curBuf + if (a:forward == 1) + bn! + else + bp! + endif + let l:curBuf = bufnr('%') + endwhile + + let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate + if (l:saveAutoUpdate == 1) + call <SID>AutoUpdate(-1) + endif + +endfunction + +" }}} +" DEBUG - Display debug output when debugging is turned on {{{ +" +" Thanks to Charles E. Campbell, Jr. PhD <cec@NgrOyphSon.gPsfAc.nMasa.gov> +" for Decho.vim which was the inspiration for this enhanced debugging +" capability. +" +function! <SID>DEBUG(msg, level) + + if g:miniBufExplorerDebugLevel >= a:level + + " Prevent a report of our actions from showing up. + let l:save_rep = &report + let l:save_sc = &showcmd + let &report = 10000 + set noshowcmd + + " Debug output to a buffer + if g:miniBufExplorerDebugMode == 0 + " Save the current window number so we can come back here + let l:prevWin = winnr() + wincmd p + let l:prevPrevWin = winnr() + wincmd p + + " Get into the debug window or create it if needed + call <SID>FindCreateWindow('MiniBufExplorer.DBG', 1, 0, 0) + + " Make sure we really got to our window, if not we + " will display a confirm dialog and turn debugging + " off so that we won't break things even more. + if bufname('%') != 'MiniBufExplorer.DBG' + call confirm('Error in window debugging code. Dissabling MiniBufExplorer debugging.', 'OK') + let g:miniBufExplorerDebugLevel = 0 + endif + + " Write Message to DBG buffer + let res=append("$",s:debugIndex.':'.a:level.':'.a:msg) + norm G + "set nomodified + + " Return to original window + exec l:prevPrevWin.' wincmd w' + exec l:prevWin.' wincmd w' + " Debug output using VIM's echo facility + elseif g:miniBufExplorerDebugMode == 1 + echo s:debugIndex.':'.a:level.':'.a:msg + " Debug output to a file -- VERY SLOW!!! + " should be OK on UNIX and Win32 (not the 95/98 variants) + elseif g:miniBufExplorerDebugMode == 2 + if has('system') || has('fork') + if has('win32') && !has('win95') + let l:result = system("cmd /c 'echo ".s:debugIndex.':'.a:level.':'.a:msg." >> MiniBufExplorer.DBG'") + endif + if has('unix') + let l:result = system("echo '".s:debugIndex.':'.a:level.':'.a:msg." >> MiniBufExplorer.DBG'") + endif + else + call confirm('Error in file writing version of the debugging code, vim not compiled with system or fork. Dissabling MiniBufExplorer debugging.', 'OK') + let g:miniBufExplorerDebugLevel = 0 + endif + elseif g:miniBufExplorerDebugMode == 3 + let g:miniBufExplorerDebugOutput = g:miniBufExplorerDebugOutput."\n".s:debugIndex.':'.a:level.':'.a:msg + endif + let s:debugIndex = s:debugIndex + 1 + + let &report = l:save_rep + let &showcmd = l:save_sc + + endif + +endfunc " }}} + +" MBE Script History {{{ +"============================================================================= +" +" History: 6.3.2 o For some reason there was still a call to StopExplorer +" with 2 params. Very old bug. I know I fixed before, +" any way many thanks to Jason Mills for reporting this! +" 6.3.1 o Include folds in source so that it's easier to +" navigate. +" o Added g:miniBufExplForceSyntaxEnable setting for folks +" that want a :syntax enable to be called when we enter +" buffers. This can resolve issues caused by a vim bug +" where buffers show up without highlighting when another +" buffer has been closed, quit, wiped or deleted. +" 6.3.0 o Added an option to allow single click (rather than +" the default double click) to select buffers in the +" MBE window. This feature was requested by AW Law +" and was inspired by taglist.vim. Note that you will +" need the latest version of taglist.vim if you want to +" use MBE and taglist both with singleclick turned on. +" Also thanks to AW Law for pointing out that you can +" make an Explorer not be listed in a standard :ls. +" o Added the ability to have your tabs show up in a +" vertical window rather than the standard horizontal +" one. Just let g:miniBufExplVSplit = <width> in your +" .vimrc and your will get this functionality. +" o If you use the vertical explorer and you want it to +" autosize then let g:miniBufExplMaxSize = <max width> +" in your .vimrc. You may use the MinSize letting in +" addition to the MaxLetting if you don't want a super +" thin window. +" o g:miniBufExplMaxHeight was renamed g:miniBufExplMaxSize +" g:miniBufExplMinHeight was renamed g:miniBufExplMinSize +" the old settings are backwards compatible if you don't +" use the new settings, but they are depreciated. +" 6.2.8 o Add an option to stop MBE from targeting non-modifiable +" buffers when switching buffers. Thanks to AW Law for +" the inspiration for this. This may not work if a user +" has lots of explorer/help windows open. +" 6.2.7 o Very minor bug fix for people who want to set +" loaded_minibufexplorer in their .vimrc in order to +" stop MBE from loading. 99.99% of users do not need +" this update. +" 6.2.6 o Moved history to end of source file +" o Updated highlighting documentation +" o Created global commands MBEbn and MBEbp that can be +" used in mappings if folks want to cycle buffers while +" skipping non-eligible buffers. +" 6.2.5 o Added <Leader>mbt key mapping which will toggle +" the MBE window. I map this to F3 in my .vimrc +" with "map <F3> :TMiniBufExplorer<CR>" which +" means I can easily close the MBE window when I'm +" not using it and get it back when I want it. +" o Changed default debug mode to 3 (write to global +" g:miniBufExplorerDebugOutput) +" o Made a pass through the documentation to clarify +" serveral issues and provide more complete docs +" for mappings and commands. +" 6.2.4 o Because of the autocommand switch (see 6.2.0) it +" was possible to remove the restriction on the +" :set hidden option. It is now possible to use +" this option with MBE. +" 6.2.3 o Added miniBufExplTabWrap option. It is turned +" off by default. When turned on spaces are added +" between tabs and gq} is issued to perform line +" formatting. This won't work very well if filenames +" contain spaces. It would be pretty easy to write +" my own formatter, but I'm too lazy, so if someone +" really needs that feature I'll add it :) +" 6.2.2 o Changed the way the g:miniBufExplorerMoreThanOne +" global is handled. You can set this to the number +" of eligible buffers you want to be loaded before +" the MBE window is loaded. Setting it to 0 causes +" the MBE window to be opened even if there are no +" buffers. Setting it to 4 causes the window to stay +" closed until the 4th eligible buffer is loaded. +" o Added a MinHeight option. This is nice if you want +" the MBE window to always take the same amount of +" space. For example set MaxSize and MinSize to 2 +" and set MoreThanOne to 0 and you will always have +" a 2 row (plus the ruler :) MBE window. +" NOTE: in 6.3.0 we started using MinSize instead of +" Minheight. This will still work if MinSize is not +" specified, but it is depreciated. Use MinSize instead. +" o I now setlocal foldcomun=0 and nonumber in the MBE +" window. This is for those of you that like to have +" these options turned on locally. I'm assuming noone +" outthere wants foldcolumns and line numbers in the +" MBE window? :) +" o Fixed a bug where an empty MBE window was taking half +" of the screen (partly why the MinHeight option was +" added.) +" 6.2.1 o If MBE is the only window (because of :bd for example) +" and there are still eligible buffers then one of them +" will be displayed. +" o The <Leader>mbe mapping now highlights the buffer from +" the current window. +" o The delete ('d') binding in the MBE window now restors +" the cursor position, which can help if you want to +" delete several buffers in a row that are not at the +" beginning of the buffer list. +" o Added a new key binding ('p') in the MBE window to +" switch to the previous window (last edit window) +" 6.2.0 o Major overhaul of autocommand and list updating code, +" we now have much better handling of :bd (which is the +" most requested feature.) As well as resolving other +" issues where the buffer list would not be updated +" automatically. The old version tried to trap specific +" events, this one just updates frequently, but it keeps +" track and only changes the screen if there has been +" a change. +" o Added g:miniBufExplMaxHeight variable so you can keep +" the -MiniBufExplorer- window small when you have lots +" of buffers (or buffers with long names :) +" NOTE: in 6.3.0 we started using MaxSize instead of +" MaxHeight. This will still work if MaxSize is not +" specified, but it is depreciated. Use MaxSize instead. +" o Improvement to internal syntax highlighting code +" I renamed the syntax group names. Anyone who has +" figured out how to use them already shouldn't have +" any trouble with the new Nameing :) +" o Added debug mode 3 which writes to a global variable +" this is fast and doesn't mess with the buffer/window +" lists. +" 6.1.0 o <Leader>mbc was failing because I was calling one of +" my own functions with the wrong number of args. :( +" Thanks to Gerry Patterson for finding this! +" This code is very stable (although it has some +" idiocyncracies.) +" 6.0.9 o Double clicking tabs was overwriting the cliboard +" register on MS Windows. Thanks to Shoeb Bhinderwala +" for reporting this issue. +" 6.0.8 o Apparently some VIM builds are having a hard time with +" line continuation in scripts so the few that were here +" have been removed. +" o Generalized FindExplorer and FindCreateExplorer so +" that they can be used for the debug window. Renaming +" to FindWindow and FindCreateWindow. +" o Updated debugging code so that debug output is put into +" a buffer which can then be written to disk or emailed +" to me when someone is having a major issue. Can also +" write directly to a file (VERY SLOWLY) on UNIX or Win32 +" (not 95 or 98 at the moment) or use VIM's echo function +" to display the output to the screen. +" o Several people have had issues when the hidden option +" is turned on. So I have put in several checks to make +" sure folks know this if they try to use MBE with this +" option set. +" 6.0.7 o Handling BufDelete autocmd so that the UI updates +" properly when using :bd (rather than going through +" the MBE UI.) +" o The AutoUpdate code will now close the MBE window when +" there is a single eligible buffer available. +" This has the usefull side effect of stopping the MBE +" window from blocking the VIM session open when you close +" the last buffer. +" o Added functions, commands and maps to close & update +" the MBE window (<leader>mbc and <leader>mbu.) +" o Made MBE open/close state be sticky if set through +" StartExplorer(1) or StopExplorer(1), which are +" called from the standard mappings. So if you close +" the mbe window with \mbc it won't be automatically +" opened again unless you do a \mbe (or restart VIM). +" o Removed spaces between "tabs" (even more mini :) +" o Simplified MBE tab processing +" 6.0.6 o Fixed register overwrite bug found by Sébastien Pierre +" 6.0.5 o Fixed an issue with window sizing when we run out of +" buffers. +" o Fixed some weird commenting bugs. +" o Added more optional fancy window/buffer navigation: +" o You can turn on the capability to use control and the +" arrow keys to move between windows. +" o You can turn on the ability to use <C-TAB> and +" <C-S-TAB> to open the next and previous (respectively) +" buffer in the current window. +" o You can turn on the ability to use <C-TAB> and +" <C-S-TAB> to switch windows (forward and backwards +" respectively.) +" 6.0.4 o Added optional fancy window navigation: +" o Holding down control and pressing a vim direction +" [hjkl] will switch windows in the indicated direction. +" 6.0.3 o Changed buffer name to -MiniBufExplorer- to resolve +" Issue in filename pattern matching on Windows. +" 6.0.2 o 2 Changes requested by Suresh Govindachar: +" o Added SplitToEdge option and set it on by default +" o Added tab and shift-tab mappings in [MBE] window +" 6.0.1 o Added MoreThanOne option and set it on by default +" MiniBufExplorer will not automatically open until +" more than one eligible buffers are opened. This +" reduces cluter when you are only working on a +" single file. +" NOTE: See change log for 6.2.2 for more details about +" this feature +" 6.0.0 o Initial Release on November 20, 2001 +" +"============================================================================= +" }}} +" vim:ft=vim:fdm=marker:ff=unix:nowrap:tabstop=4:shiftwidth=4:softtabstop=4:smarttab:shiftround:expandtab diff --git a/dot_vim/plugin/openssl.vim b/dot_vim/plugin/openssl.vim new file mode 100644 index 0000000..2e2db44 --- /dev/null +++ b/dot_vim/plugin/openssl.vim @@ -0,0 +1,201 @@ +" openssl.vim version 3.2 2008 Noah Spurrier <noah@noah.org> +" +" == Edit OpenSSL encrypted files and turn Vim into a Password Safe! == +" +" This plugin enables reading and writing of files encrypted using OpenSSL. +" The file must have the extension of one of the ciphers used by OpenSSL. For +" example: +" +" .des3 .aes .bf .bfa .idea .cast .rc2 .rc4 .rc5 (.bfa is base64 ASCII +" encoded blowfish.) +" +" This will turn off the swap file and the .viminfo log. The `openssl` command +" line tool must be in the path. +" +" == Install == +" +" Put this in your plugin directory and Vim will automatically load it: +" +" ~/.vim/plugin/openssl.vim +" +" You can start by editing an empty unencrypted file. Give it one of the +" extensions above. When you write the file you will be asked to give it a new +" password. +" +" == Simple Vim Password Safe == +" +" If you edit any file named '.auth.bfa' (that's the full name, not just the +" extension) then this plugin will add folding features and an automatic quit +" timeout. +" +" Vim will quit automatically after 5 minutes of no typing activity (unless +" the file has been changed). +" +" This plugin will fold on wiki-style headlines in the following format: +" +" == This is a headline == +" +" Any notes under the headline will be inside the fold until the next headline +" is reached. The SPACE key will toggle a fold open and closed. The q key will +" quit Vim. Create the following example file named ~/.auth.bfa: +" +" == Colo server == +" +" username: maryjane password: esydpm +" +" == Office server == +" +" username: peter password: 4m4z1ng +" +" Then create this bash alias: +" +" alias auth='view ~/.auth.bfa' +" +" Now you can view your password safe by typing 'auth'. When Vim starts all +" the password information will be hidden under the headlines. To view the +" password information put the cursor on the headline and press SPACE. When +" you write an encrypted file a backup will automatically be made. +" +" This plugin can also make a backup of an encrypted file before writing +" changes. This helps guard against the situation where you may edit a file +" and write changes with the wrong password. You can still go back to the +" previous backup version. The backup file will have the same name as the +" original file with .bak before the original extension. For example: +" +" .auth.bfa --> .auth.bak.bfa +" +" To turn on backups put the following global definition in your .vimrc file: +" +" let g:openssl_backup = 1 +" +" Thanks to Tom Purl for the original des3 tip. +" +" I release all copyright claims. This code is in the public domain. +" Permission is granted to use, copy modify, distribute, and sell this +" software for any purpose. I make no guarantee about the suitability of this +" software for any purpose and I am not liable for any damages resulting from +" its use. Further, I am under no obligation to maintain or extend this +" software. It is provided on an 'as is' basis without any expressed or +" implied warranty. +" +" $Id: openssl.vim 189 2008-01-28 20:44:44Z root $ + +augroup openssl_encrypted +if exists("openssl_encrypted_loaded") + finish +endif +let openssl_encrypted_loaded = 1 +autocmd! + +function! s:OpenSSLReadPre() + set cmdheight=3 + set viminfo= + set noswapfile + set shell=/bin/sh + set bin +endfunction + +function! s:OpenSSLReadPost() + let l:cipher = expand("%:e") + if l:cipher == "aes" + let l:cipher = "aes-256-cbc" + endif + if l:cipher == "bfa" + let l:cipher = "bf" + let l:expr = "0,$!openssl " . l:cipher . " -d -a -salt" + else + let l:expr = "0,$!openssl " . l:cipher . " -d -salt" + endif + + silent! execute l:expr + if v:shell_error + silent! 0,$y + silent! undo + echo "COULD NOT DECRYPT USING EXPRESSION: " . expr + echo "Note that your version of openssl may not have the given cipher engine built-in" + echo "even though the engine may be documented in the openssl man pages." + echo "ERROR FROM OPENSSL:" + echo @" + echo "COULD NOT DECRYPT" + return + endif + set nobin + set cmdheight& + set shell& + execute ":doautocmd BufReadPost ".expand("%:r") + redraw! +endfunction + +function! s:OpenSSLWritePre() + set cmdheight=3 + set shell=/bin/sh + set bin + + if !exists("g:openssl_backup") + let g:openssl_backup=0 + endif + if (g:openssl_backup) + silent! execute '!cp % %:r.bak.%:e' + endif + + let l:cipher = expand("<afile>:e") + if l:cipher == "aes" + let l:cipher = "aes-256-cbc" + endif + if l:cipher == "bfa" + let l:cipher = "bf" + let l:expr = "0,$!openssl " . l:cipher . " -e -a -salt" + else + let l:expr = "0,$!openssl " . l:cipher . " -e -salt" + endif + + silent! execute l:expr + if v:shell_error + silent! 0,$y + silent! undo + echo "COULD NOT ENCRYPT USING EXPRESSION: " . expr + echo "Note that your version of openssl may not have the given cipher engine built in" + echo "even though the engine may be documented in the openssl man pages." + echo "ERROR FROM OPENSSL:" + echo @" + echo "COULD NOT ENCRYPT" + return + endif +endfunction + +function! s:OpenSSLWritePost() + silent! undo + set nobin + set shell& + set cmdheight& + redraw! +endfunction + +autocmd BufReadPre,FileReadPre *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*.rc2,*.rc4,*.rc5,*.desx call s:OpenSSLReadPre() +autocmd BufReadPost,FileReadPost *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*.rc2,*.rc4,*.rc5,*.desx call s:OpenSSLReadPost() +autocmd BufWritePre,FileWritePre *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*.rc2,*.rc4,*.rc5,*.desx call s:OpenSSLWritePre() +autocmd BufWritePost,FileWritePost *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*.rc2,*.rc4,*.rc5,*.desx call s:OpenSSLWritePost() + +" The following implements a simple password safe for any file named +" '.auth.bfa'. The file is encrypted with Blowfish and base64 encoded. +" Folding is supported for == headlines == style lines. + +function! HeadlineDelimiterExpression(lnum) + if a:lnum == 1 + return ">1" + endif + return (getline(a:lnum)=~"^\\s*==.*==\\s*$") ? ">1" : "=" +endfunction +autocmd BufReadPost,FileReadPost .auth.bfa set foldexpr=HeadlineDelimiterExpression(v:lnum) +autocmd BufReadPost,FileReadPost .auth.bfa set foldlevel=0 +autocmd BufReadPost,FileReadPost .auth.bfa set foldcolumn=0 +autocmd BufReadPost,FileReadPost .auth.bfa set foldmethod=expr +autocmd BufReadPost,FileReadPost .auth.bfa set foldtext=getline(v:foldstart) +autocmd BufReadPost,FileReadPost .auth.bfa nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR> +autocmd BufReadPost,FileReadPost .auth.bfa nnoremap <silent>q :q<CR> +autocmd BufReadPost,FileReadPost .auth.bfa highlight Folded ctermbg=red ctermfg=black +autocmd BufReadPost,FileReadPost .auth.bfa set updatetime=300000 +autocmd CursorHold .auth.bfa quit + +augroup END + diff --git a/dot_vim/plugin/remoteOpen.vim b/dot_vim/plugin/remoteOpen.vim new file mode 100644 index 0000000..cb550ff --- /dev/null +++ b/dot_vim/plugin/remoteOpen.vim @@ -0,0 +1,163 @@ +" File: remoteOpen.vim +" Author: Srinath Avadhanula <srinath AT fastmail DOT fm> +" $Id: remoteOpen.vim 997 2006-03-20 09:45:45Z srinathava $ +" +" Description: +" Often times, an external program needs to open a file in gvim from the +" command line. However, it will not know if the file is already opened in a +" previous vim session. It is not sufficient to simply specify +" +" gvim --remote-silent <filename> +" +" because this simply opens up <filename> in the first remote gvim session it +" sees. This script provides a command RemoteOpen which is meant to be used +" from the command line as follows: +" +" gvim -c ":RemoteOpen +<lnum> <filename>" +" +" where <lnum> is the line-number you wish <filename> to open to. What will +" happen is that a new gvim will start up and enquire from all previous +" sessions if <filename> is already open in any of them. If it is, then it +" will edit the file in that session and bring it to the foreground and itself +" quit. Otherwise, it will not quit and instead open up the file for editing +" at <lnum>. +" +" This was mainly created to be used with Yap (the dvi previewer in miktex), +" so you can specify the program for "inverse search" as specified above. +" This ensures that the inverse search uses the correct gvim each time. +" +" Ofcourse, this requires vim with +clientserver. If not, then RemoteOpen just +" opens in the present session. + +" Enclose <args> in single quotes so it can be passed as a function argument. +com -nargs=1 RemoteOpen :call RemoteOpen('<args>') +com -nargs=? RemoteInsert :call RemoteInsert('<args>') + +" RemoteOpen: open a file remotely (if possible) {{{ +" Description: checks all open vim windows to see if this file has been opened +" anywhere and if so, opens it there instead of in this session. +function! RemoteOpen(arglist) + + " First construct line number and filename from argument. a:arglist is of + " the form: + " +10 c:\path\to\file + " or just + " c:\path\to\file + if a:arglist =~ '^\s*+\d\+' + let linenum = matchstr(a:arglist, '^\s*+\zs\d\+\ze') + let filename = matchstr(a:arglist, '^\s*+\d\+\s*\zs.*\ze') + else + let linenum = 1 + let filename = matchstr(a:arglist, '^\s*\zs.*\ze') + endif + let filename = escape(filename, ' ') + call Tex_Debug("linenum = ".linenum.', filename = '.filename, "ropen") + + " If there is no clientserver functionality, then just open in the present + " session and return + if !has('clientserver') + call Tex_Debug("-clientserver, opening locally and returning", "ropen") + exec "e ".filename + exec linenum + normal! zv + return + endif + + " Otherwise, loop through all available servers + let servers = serverlist() + " If there are no servers, open file locally. + if servers == '' + call Tex_Debug("no open servers, opening locally", "ropen") + exec "e ".filename + exec linenum + let g:Remote_Server = 1 + normal! zv + return + endif + + let i = 1 + let server = s:Strntok(servers, "\n", i) + let targetServer = v:servername + + while server != '' + " Find out if there was any server which was used by remoteOpen before + " this. If a new gvim session was ever started via remoteOpen, then + " g:Remote_Server will be set. + if remote_expr(server, 'exists("g:Remote_Server")') + let targetServer = server + endif + + " Ask each server if that file is being edited by them. + let bufnum = remote_expr(server, "bufnr('".filename."')") + " If it is... + if bufnum != -1 + " ask the server to edit that file and come to the foreground. + " set a variable g:Remote_Server to indicate that this server + " session has at least one file opened via RemoteOpen + let targetServer = server + break + end + + let i = i + 1 + let server = s:Strntok(servers, "\n", i) + endwhile + + " If none of the servers have the file open, then open this file in the + " first server. This has the advantage if yap tries to make vim open + " multiple vims, then at least they will all be opened by the same gvim + " server. + call remote_send(targetServer, + \ "\<C-\>\<C-n>". + \ ":let g:Remote_Server = 1\<CR>". + \ ":drop ".filename."\<CR>". + \ ":".linenum."\<CR>zv" + \ ) + call remote_foreground(targetServer) + " quit this vim session + if v:servername != targetServer + q + endif +endfunction " }}} +" RemoteInsert: inserts a \cite'ation remotely (if possible) {{{ +" Description: +function! RemoteInsert(...) + + let citation = matchstr(argv(0), "\\[InsText('.cite{\\zs.\\{-}\\ze}');\\]") + if citation == "" + q + endif + + " Otherwise, loop through all available servers + let servers = serverlist() + + let i = 1 + let server = s:Strntok(servers, "\n", i) + let targetServer = v:servername + + while server != '' + if remote_expr(server, 'exists("g:Remote_WaitingForCite")') + call remote_send(server, citation . "\<CR>") + call remote_foreground(server) + if v:servername != server + q + else + return + endif + endif + + let i = i + 1 + let server = s:Strntok(servers, "\n", i) + endwhile + + q + +endfunction " }}} +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} + +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap diff --git a/dot_vim/plugin/taglist.vim b/dot_vim/plugin/taglist.vim new file mode 100644 index 0000000..59901f6 --- /dev/null +++ b/dot_vim/plugin/taglist.vim @@ -0,0 +1,4546 @@ +" File: taglist.vim +" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) +" Version: 4.5 +" Last Modified: September 21, 2007 +" Copyright: Copyright (C) 2002-2007 Yegappan Lakshmanan +" 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, +" 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. +" +" The "Tag List" plugin is a source code browser plugin for Vim and provides +" an overview of the structure of the programming language files and allows +" you to efficiently browse through source code files for different +" programming languages. You can visit the taglist plugin home page for more +" information: +" +" http://vim-taglist.sourceforge.net +" +" You can subscribe to the taglist mailing list to post your questions +" or suggestions for improvement or to report bugs. Visit the following +" page for subscribing to the mailing list: +" +" http://groups.yahoo.com/group/taglist/ +" +" For more information about using this plugin, after installing the +" taglist plugin, use the ":help taglist" command. +" +" Installation +" ------------ +" 1. Download the taglist.zip file and unzip the files to the $HOME/.vim +" or the $HOME/vimfiles or the $VIM/vimfiles directory. This should +" unzip 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', 'add-global-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. +" 3. If the exuberant ctags utility is not present in your PATH, 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. +" +" ****************** Do not modify after this line ************************ + +" Line continuation used here +let s:cpo_save = &cpo +set cpo&vim + +if !exists('loaded_taglist') + " First time loading the taglist plugin + " + " To speed up the loading of Vim, the taglist plugin uses autoload + " mechanism to load the taglist functions. + " Only define the configuration variables, user commands and some + " auto-commands and finish sourcing the file + + " The taglist plugin requires the built-in Vim system() function. If this + " function is not available, then don't load the plugin. + if !exists('*system') + echomsg 'Taglist: Vim system() built-in function is not available. ' . + \ 'Plugin is not loaded.' + let loaded_taglist = 'no' + let &cpo = s:cpo_save + finish + endif + + " Location of the exuberant ctags tool + if !exists('Tlist_Ctags_Cmd') + if executable('exuberant-ctags') + " On Debian Linux, exuberant ctags is installed + " as exuberant-ctags + let Tlist_Ctags_Cmd = 'exuberant-ctags' + elseif executable('exctags') + " On Free-BSD, exuberant ctags is installed as exctags + let Tlist_Ctags_Cmd = 'exctags' + elseif executable('ctags') + let Tlist_Ctags_Cmd = 'ctags' + elseif executable('ctags.exe') + let Tlist_Ctags_Cmd = 'ctags.exe' + elseif executable('tags') + let Tlist_Ctags_Cmd = 'tags' + else + echomsg 'Taglist: Exuberant ctags (http://ctags.sf.net) ' . + \ 'not found in PATH. Plugin is not loaded.' + " Skip loading the plugin + let loaded_taglist = 'no' + let &cpo = s:cpo_save + finish + endif + endif + + + " Automatically open the taglist window on Vim startup + if !exists('Tlist_Auto_Open') + let Tlist_Auto_Open = 0 + endif + + " When the taglist window is toggle opened, move the cursor to the + " taglist window + if !exists('Tlist_GainFocus_On_ToggleOpen') + let Tlist_GainFocus_On_ToggleOpen = 0 + endif + + " Process files even when the taglist window is not open + if !exists('Tlist_Process_File_Always') + let Tlist_Process_File_Always = 0 + endif + + if !exists('Tlist_Show_Menu') + let Tlist_Show_Menu = 0 + endif + + " Tag listing sort type - 'name' or 'order' + if !exists('Tlist_Sort_Type') + let Tlist_Sort_Type = 'order' + endif + + " Tag listing window split (horizontal/vertical) control + if !exists('Tlist_Use_Horiz_Window') + let Tlist_Use_Horiz_Window = 0 + endif + + " Open the vertically split taglist window on the left or on the right + " side. This setting is relevant only if Tlist_Use_Horiz_Window is set to + " zero (i.e. only for vertically split windows) + if !exists('Tlist_Use_Right_Window') + let Tlist_Use_Right_Window = 0 + endif + + " Increase Vim window width to display vertically split taglist window. + " For MS-Windows version of Vim running in a MS-DOS window, this must be + " set to 0 otherwise the system may hang due to a Vim limitation. + if !exists('Tlist_Inc_Winwidth') + if (has('win16') || has('win95')) && !has('gui_running') + let Tlist_Inc_Winwidth = 0 + else + let Tlist_Inc_Winwidth = 1 + endif + endif + + " Vertically split taglist window width setting + if !exists('Tlist_WinWidth') + let Tlist_WinWidth = 30 + endif + + " Horizontally split taglist window height setting + if !exists('Tlist_WinHeight') + let Tlist_WinHeight = 10 + endif + + " Display tag prototypes or tag names in the taglist window + if !exists('Tlist_Display_Prototype') + let Tlist_Display_Prototype = 0 + endif + + " Display tag scopes in the taglist window + if !exists('Tlist_Display_Tag_Scope') + let Tlist_Display_Tag_Scope = 1 + endif + + " Use single left mouse click to jump to a tag. By default this is disabled. + " Only double click using the mouse will be processed. + if !exists('Tlist_Use_SingleClick') + let Tlist_Use_SingleClick = 0 + endif + + " Control whether additional help is displayed as part of the taglist or + " not. Also, controls whether empty lines are used to separate the tag + " tree. + if !exists('Tlist_Compact_Format') + let Tlist_Compact_Format = 0 + endif + + " Exit Vim if only the taglist window is currently open. By default, this is + " set to zero. + if !exists('Tlist_Exit_OnlyWindow') + let Tlist_Exit_OnlyWindow = 0 + endif + + " Automatically close the folds for the non-active files in the taglist + " window + if !exists('Tlist_File_Fold_Auto_Close') + let Tlist_File_Fold_Auto_Close = 0 + endif + + " Close the taglist window when a tag is selected + if !exists('Tlist_Close_On_Select') + let Tlist_Close_On_Select = 0 + endif + + " Automatically update the taglist window to display tags for newly + " edited files + if !exists('Tlist_Auto_Update') + let Tlist_Auto_Update = 1 + endif + + " Automatically highlight the current tag + if !exists('Tlist_Auto_Highlight_Tag') + let Tlist_Auto_Highlight_Tag = 1 + endif + + " Automatically highlight the current tag on entering a buffer + if !exists('Tlist_Highlight_Tag_On_BufEnter') + let Tlist_Highlight_Tag_On_BufEnter = 1 + endif + + " Enable fold column to display the folding for the tag tree + if !exists('Tlist_Enable_Fold_Column') + let Tlist_Enable_Fold_Column = 1 + endif + + " Display the tags for only one file in the taglist window + if !exists('Tlist_Show_One_File') + let Tlist_Show_One_File = 0 + endif + + if !exists('Tlist_Max_Submenu_Items') + let Tlist_Max_Submenu_Items = 20 + endif + + if !exists('Tlist_Max_Tag_Length') + let Tlist_Max_Tag_Length = 10 + endif + + " Do not change the name of the taglist title variable. The winmanager + " plugin relies on this name to determine the title for the taglist + " plugin. + let TagList_title = "__Tag_List__" + + " Taglist debug messages + let s:tlist_msg = '' + + " Define the taglist autocommand to automatically open the taglist window + " on Vim startup + if g:Tlist_Auto_Open + autocmd VimEnter * nested call s:Tlist_Window_Check_Auto_Open() + endif + + " Refresh the taglist + if g:Tlist_Process_File_Always + autocmd BufEnter * call s:Tlist_Refresh() + endif + + if g:Tlist_Show_Menu + autocmd GUIEnter * call s:Tlist_Menu_Init() + endif + + " When the taglist buffer is created when loading a Vim session file, + " the taglist buffer needs to be initialized. The BufFilePost event + " is used to handle this case. + autocmd BufFilePost __Tag_List__ call s:Tlist_Vim_Session_Load() + + " Define the user commands to manage the taglist window + command! -nargs=0 -bar TlistToggle call s:Tlist_Window_Toggle() + command! -nargs=0 -bar TlistOpen call s:Tlist_Window_Open() + " For backwards compatiblity define the Tlist command + command! -nargs=0 -bar Tlist TlistToggle + command! -nargs=+ -complete=file TlistAddFiles + \ call s:Tlist_Add_Files(<f-args>) + command! -nargs=+ -complete=dir TlistAddFilesRecursive + \ call s:Tlist_Add_Files_Recursive(<f-args>) + command! -nargs=0 -bar TlistClose call s:Tlist_Window_Close() + command! -nargs=0 -bar TlistUpdate call s:Tlist_Update_Current_File() + command! -nargs=0 -bar TlistHighlightTag call s:Tlist_Window_Highlight_Tag( + \ fnamemodify(bufname('%'), ':p'), line('.'), 2, 1) + " For backwards compatiblity define the TlistSync command + command! -nargs=0 -bar TlistSync TlistHighlightTag + command! -nargs=* -complete=buffer TlistShowPrototype + \ echo Tlist_Get_Tag_Prototype_By_Line(<f-args>) + command! -nargs=* -complete=buffer TlistShowTag + \ echo Tlist_Get_Tagname_By_Line(<f-args>) + command! -nargs=* -complete=file TlistSessionLoad + \ call s:Tlist_Session_Load(<q-args>) + command! -nargs=* -complete=file TlistSessionSave + \ call s:Tlist_Session_Save(<q-args>) + command! -bar TlistLock let Tlist_Auto_Update=0 + command! -bar TlistUnlock let Tlist_Auto_Update=1 + + " Commands for enabling/disabling debug and to display debug messages + command! -nargs=? -complete=file -bar TlistDebug + \ call s:Tlist_Debug_Enable(<q-args>) + command! -nargs=0 -bar TlistUndebug call s:Tlist_Debug_Disable() + command! -nargs=0 -bar TlistMessages call s:Tlist_Debug_Show() + + " Define autocommands to autoload the taglist plugin when needed. + + " Trick to get the current script ID + map <SID>xx <SID>xx + let s:tlist_sid = substitute(maparg('<SID>xx'), '<SNR>\(\d\+_\)xx$', + \ '\1', '') + unmap <SID>xx + + exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_* source ' . + \ escape(expand('<sfile>'), ' ') + exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Window_* source ' . + \ escape(expand('<sfile>'), ' ') + exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Menu_* source ' . + \ escape(expand('<sfile>'), ' ') + exe 'autocmd FuncUndefined Tlist_* source ' . + \ escape(expand('<sfile>'), ' ') + exe 'autocmd FuncUndefined TagList_* source ' . + \ escape(expand('<sfile>'), ' ') + + let loaded_taglist = 'fast_load_done' + + if g:Tlist_Show_Menu && has('gui_running') + call s:Tlist_Menu_Init() + endif + + " restore 'cpo' + let &cpo = s:cpo_save + finish +endif + +if !exists('s:tlist_sid') + " Two or more versions of taglist plugin are installed. Don't + " load this version of the plugin. + finish +endif + +unlet! s:tlist_sid + +if loaded_taglist != 'fast_load_done' + " restore 'cpo' + let &cpo = s:cpo_save + finish +endif + +" Taglist plugin functionality is available +let loaded_taglist = 'available' + +"------------------- end of user configurable options -------------------- + +" Default language specific settings for supported file types and tag types +" +" Variable name format: +" +" s:tlist_def_{vim_ftype}_settings +" +" vim_ftype - Filetype detected by Vim +" +" Value format: +" +" <ctags_ftype>;<flag>:<name>;<flag>:<name>;... +" +" ctags_ftype - File type supported by exuberant ctags +" flag - Flag supported by exuberant ctags to generate a tag type +" name - Name of the tag type used in the taglist window to display the +" tags of this type +" + +" assembly language +let s:tlist_def_asm_settings = 'asm;d:define;l:label;m:macro;t:type' + +" aspperl language +let s:tlist_def_aspperl_settings = 'asp;f:function;s:sub;v:variable' + +" aspvbs language +let s:tlist_def_aspvbs_settings = 'asp;f:function;s:sub;v:variable' + +" awk language +let s:tlist_def_awk_settings = 'awk;f:function' + +" beta language +let s:tlist_def_beta_settings = 'beta;f:fragment;s:slot;v:pattern' + +" c language +let s:tlist_def_c_settings = 'c;d:macro;g:enum;s:struct;u:union;t:typedef;' . + \ 'v:variable;f:function' + +" c++ language +let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' . + \ 'c:class;g:enum;s:struct;u:union;f:function' + +" c# language +let s:tlist_def_cs_settings = 'c#;d:macro;t:typedef;n:namespace;c:class;' . + \ 'E:event;g:enum;s:struct;i:interface;' . + \ 'p:properties;m:method' + +" cobol language +let s:tlist_def_cobol_settings = 'cobol;d:data;f:file;g:group;p:paragraph;' . + \ 'P:program;s:section' + +" eiffel language +let s:tlist_def_eiffel_settings = 'eiffel;c:class;f:feature' + +" erlang language +let s:tlist_def_erlang_settings = 'erlang;d:macro;r:record;m:module;f:function' + +" expect (same as tcl) language +let s:tlist_def_expect_settings = 'tcl;c:class;f:method;p:procedure' + +" fortran language +let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' . + \ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' . + \ 'n:namelist;t:derived;v:variable;f:function;s:subroutine' + +" HTML language +let s:tlist_def_html_settings = 'html;a:anchor;f:javascript function' + +" java language +let s:tlist_def_java_settings = 'java;p:package;c:class;i:interface;' . + \ 'f:field;m:method' + +" javascript language +let s:tlist_def_javascript_settings = 'javascript;f:function' + +" lisp language +let s:tlist_def_lisp_settings = 'lisp;f:function' + +" lua language +let s:tlist_def_lua_settings = 'lua;f:function' + +" makefiles +let s:tlist_def_make_settings = 'make;m:macro' + +" pascal language +let s:tlist_def_pascal_settings = 'pascal;f:function;p:procedure' + +" perl language +let s:tlist_def_perl_settings = 'perl;c:constant;l:label;p:package;s:subroutine' + +" php language +let s:tlist_def_php_settings = 'php;c:class;d:constant;v:variable;f:function' + +" python language +let s:tlist_def_python_settings = 'python;c:class;m:member;f:function' + +" rexx language +let s:tlist_def_rexx_settings = 'rexx;s:subroutine' + +" ruby language +let s:tlist_def_ruby_settings = 'ruby;c:class;f:method;F:function;' . + \ 'm:singleton method' + +" scheme language +let s:tlist_def_scheme_settings = 'scheme;s:set;f:function' + +" shell language +let s:tlist_def_sh_settings = 'sh;f:function' + +" C shell language +let s:tlist_def_csh_settings = 'sh;f:function' + +" Z shell language +let s:tlist_def_zsh_settings = 'sh;f:function' + +" slang language +let s:tlist_def_slang_settings = 'slang;n:namespace;f:function' + +" sml language +let s:tlist_def_sml_settings = 'sml;e:exception;c:functor;s:signature;' . + \ 'r:structure;t:type;v:value;f:function' + +" sql language +let s:tlist_def_sql_settings = 'sql;c:cursor;F:field;P:package;r:record;' . + \ 's:subtype;t:table;T:trigger;v:variable;f:function;p:procedure' + +" tcl language +let s:tlist_def_tcl_settings = 'tcl;c:class;f:method;m:method;p:procedure' + +" vera language +let s:tlist_def_vera_settings = 'vera;c:class;d:macro;e:enumerator;' . + \ 'f:function;g:enum;m:member;p:program;' . + \ 'P:prototype;t:task;T:typedef;v:variable;' . + \ 'x:externvar' + +"verilog language +let s:tlist_def_verilog_settings = 'verilog;m:module;c:constant;P:parameter;' . + \ 'e:event;r:register;t:task;w:write;p:port;v:variable;f:function' + +" vim language +let s:tlist_def_vim_settings = 'vim;a:autocmds;v:variable;f:function' + +" yacc language +let s:tlist_def_yacc_settings = 'yacc;l:label' + +"------------------- end of language specific options -------------------- + +" Vim window size is changed by the taglist plugin or not +let s:tlist_winsize_chgd = -1 +" Taglist window is maximized or not +let s:tlist_win_maximized = 0 +" Name of files in the taglist +let s:tlist_file_names='' +" Number of files in the taglist +let s:tlist_file_count = 0 +" Number of filetypes supported by taglist +let s:tlist_ftype_count = 0 +" Is taglist part of other plugins like winmanager or cream? +let s:tlist_app_name = "none" +" Are we displaying brief help text +let s:tlist_brief_help = 1 +" List of files removed on user request +let s:tlist_removed_flist = "" +" Index of current file displayed in the taglist window +let s:tlist_cur_file_idx = -1 +" Taglist menu is empty or not +let s:tlist_menu_empty = 1 + +" An autocommand is used to refresh the taglist window when entering any +" buffer. We don't want to refresh the taglist window if we are entering the +" file window from one of the taglist functions. The 'Tlist_Skip_Refresh' +" variable is used to skip the refresh of the taglist window and is set +" and cleared appropriately. +let s:Tlist_Skip_Refresh = 0 + +" Tlist_Window_Display_Help() +function! s:Tlist_Window_Display_Help() + if s:tlist_app_name == "winmanager" + " To handle a bug in the winmanager plugin, add a space at the + " last line + call setline('$', ' ') + endif + + if s:tlist_brief_help + " Add the brief help + call append(0, '" Press <F1> to display help text') + else + " Add the extensive help + call append(0, '" <enter> : Jump to tag definition') + call append(1, '" o : Jump to tag definition in new window') + call append(2, '" p : Preview the tag definition') + call append(3, '" <space> : Display tag prototype') + call append(4, '" u : Update tag list') + call append(5, '" s : Select sort field') + call append(6, '" d : Remove file from taglist') + call append(7, '" x : Zoom-out/Zoom-in taglist window') + call append(8, '" + : Open a fold') + call append(9, '" - : Close a fold') + call append(10, '" * : Open all folds') + call append(11, '" = : Close all folds') + call append(12, '" [[ : Move to the start of previous file') + call append(13, '" ]] : Move to the start of next file') + call append(14, '" q : Close the taglist window') + call append(15, '" <F1> : Remove help text') + endif +endfunction + +" Tlist_Window_Toggle_Help_Text() +" Toggle taglist plugin help text between the full version and the brief +" version +function! s:Tlist_Window_Toggle_Help_Text() + if g:Tlist_Compact_Format + " In compact display mode, do not display help + return + endif + + " Include the empty line displayed after the help text + let brief_help_size = 1 + let full_help_size = 16 + + setlocal modifiable + + " Set report option to a huge value to prevent informational messages + " while deleting the lines + let old_report = &report + set report=99999 + + " Remove the currently highlighted tag. Otherwise, the help text + " might be highlighted by mistake + match none + + " Toggle between brief and full help text + if s:tlist_brief_help + let s:tlist_brief_help = 0 + + " Remove the previous help + exe '1,' . brief_help_size . ' delete _' + + " Adjust the start/end line numbers for the files + call s:Tlist_Window_Update_Line_Offsets(0, 1, full_help_size - brief_help_size) + else + let s:tlist_brief_help = 1 + + " Remove the previous help + exe '1,' . full_help_size . ' delete _' + + " Adjust the start/end line numbers for the files + call s:Tlist_Window_Update_Line_Offsets(0, 0, full_help_size - brief_help_size) + endif + + call s:Tlist_Window_Display_Help() + + " Restore the report option + let &report = old_report + + setlocal nomodifiable +endfunction + +" Taglist debug support +let s:tlist_debug = 0 + +" File for storing the debug messages +let s:tlist_debug_file = '' + +" Tlist_Debug_Enable +" Enable logging of taglist debug messages. +function! s:Tlist_Debug_Enable(...) + let s:tlist_debug = 1 + + " Check whether a valid file name is supplied. + if a:1 != '' + let s:tlist_debug_file = fnamemodify(a:1, ':p') + + " Empty the log file + exe 'redir! > ' . s:tlist_debug_file + redir END + + " Check whether the log file is present/created + if !filewritable(s:tlist_debug_file) + call s:Tlist_Warning_Msg('Taglist: Unable to create log file ' + \ . s:tlist_debug_file) + let s:tlist_debug_file = '' + endif + endif +endfunction + +" Tlist_Debug_Disable +" Disable logging of taglist debug messages. +function! s:Tlist_Debug_Disable(...) + let s:tlist_debug = 0 + let s:tlist_debug_file = '' +endfunction + +" Tlist_Debug_Show +" Display the taglist debug messages in a new window +function! s:Tlist_Debug_Show() + if s:tlist_msg == '' + call s:Tlist_Warning_Msg('Taglist: No debug messages') + return + endif + + " Open a new window to display the taglist debug messages + new taglist_debug.txt + " Delete all the lines (if the buffer already exists) + silent! %delete _ + " Add the messages + silent! put =s:tlist_msg + " Move the cursor to the first line + normal! gg +endfunction + +" Tlist_Log_Msg +" Log the supplied debug message along with the time +function! s:Tlist_Log_Msg(msg) + if s:tlist_debug + if s:tlist_debug_file != '' + exe 'redir >> ' . s:tlist_debug_file + silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n" + redir END + else + " Log the message into a variable + " Retain only the last 3000 characters + let len = strlen(s:tlist_msg) + if len > 3000 + let s:tlist_msg = strpart(s:tlist_msg, len - 3000) + endif + let s:tlist_msg = s:tlist_msg . strftime('%H:%M:%S') . ': ' . + \ a:msg . "\n" + endif + endif +endfunction + +" Tlist_Warning_Msg() +" Display a message using WarningMsg highlight group +function! s:Tlist_Warning_Msg(msg) + echohl WarningMsg + echomsg a:msg + echohl None +endfunction + +" Last returned file index for file name lookup. +" Used to speed up file lookup +let s:tlist_file_name_idx_cache = -1 + +" Tlist_Get_File_Index() +" Return the index of the specified filename +function! s:Tlist_Get_File_Index(fname) + if s:tlist_file_count == 0 || a:fname == '' + return -1 + endif + + " If the new filename is same as the last accessed filename, then + " return that index + if s:tlist_file_name_idx_cache != -1 && + \ s:tlist_file_name_idx_cache < s:tlist_file_count + if s:tlist_{s:tlist_file_name_idx_cache}_filename == a:fname + " Same as the last accessed file + return s:tlist_file_name_idx_cache + endif + endif + + " First, check whether the filename is present + let s_fname = a:fname . "\n" + let i = stridx(s:tlist_file_names, s_fname) + if i == -1 + let s:tlist_file_name_idx_cache = -1 + return -1 + endif + + " Second, compute the file name index + let nl_txt = substitute(strpart(s:tlist_file_names, 0, i), "[^\n]", '', 'g') + let s:tlist_file_name_idx_cache = strlen(nl_txt) + return s:tlist_file_name_idx_cache +endfunction + +" Last returned file index for line number lookup. +" Used to speed up file lookup +let s:tlist_file_lnum_idx_cache = -1 + +" Tlist_Window_Get_File_Index_By_Linenum() +" Return the index of the filename present in the specified line number +" Line number refers to the line number in the taglist window +function! s:Tlist_Window_Get_File_Index_By_Linenum(lnum) + call s:Tlist_Log_Msg('Tlist_Window_Get_File_Index_By_Linenum (' . a:lnum . ')') + + " First try to see whether the new line number is within the range + " of the last returned file + if s:tlist_file_lnum_idx_cache != -1 && + \ s:tlist_file_lnum_idx_cache < s:tlist_file_count + if a:lnum >= s:tlist_{s:tlist_file_lnum_idx_cache}_start && + \ a:lnum <= s:tlist_{s:tlist_file_lnum_idx_cache}_end + return s:tlist_file_lnum_idx_cache + endif + endif + + let fidx = -1 + + if g:Tlist_Show_One_File + " Displaying only one file in the taglist window. Check whether + " the line is within the tags displayed for that file + if s:tlist_cur_file_idx != -1 + if a:lnum >= s:tlist_{s:tlist_cur_file_idx}_start + \ && a:lnum <= s:tlist_{s:tlist_cur_file_idx}_end + let fidx = s:tlist_cur_file_idx + endif + + endif + else + " Do a binary search in the taglist + let left = 0 + let right = s:tlist_file_count - 1 + + while left < right + let mid = (left + right) / 2 + + if a:lnum >= s:tlist_{mid}_start && a:lnum <= s:tlist_{mid}_end + let s:tlist_file_lnum_idx_cache = mid + return mid + endif + + if a:lnum < s:tlist_{mid}_start + let right = mid - 1 + else + let left = mid + 1 + endif + endwhile + + if left >= 0 && left < s:tlist_file_count + \ && a:lnum >= s:tlist_{left}_start + \ && a:lnum <= s:tlist_{left}_end + let fidx = left + endif + endif + + let s:tlist_file_lnum_idx_cache = fidx + + return fidx +endfunction + +" Tlist_Exe_Cmd_No_Acmds +" Execute the specified Ex command after disabling autocommands +function! s:Tlist_Exe_Cmd_No_Acmds(cmd) + let old_eventignore = &eventignore + set eventignore=all + exe a:cmd + let &eventignore = old_eventignore +endfunction + +" Tlist_Skip_File() +" Check whether tag listing is supported for the specified file +function! s:Tlist_Skip_File(filename, ftype) + " Skip buffers with no names and buffers with filetype not set + if a:filename == '' || a:ftype == '' + return 1 + endif + + " Skip files which are not supported by exuberant ctags + " First check whether default settings for this filetype are available. + " If it is not available, then check whether user specified settings are + " available. If both are not available, then don't list the tags for this + " filetype + let var = 's:tlist_def_' . a:ftype . '_settings' + if !exists(var) + let var = 'g:tlist_' . a:ftype . '_settings' + if !exists(var) + return 1 + endif + endif + + " Skip files which are not readable or files which are not yet stored + " to the disk + if !filereadable(a:filename) + return 1 + endif + + return 0 +endfunction + +" Tlist_User_Removed_File +" Returns 1 if a file is removed by a user from the taglist +function! s:Tlist_User_Removed_File(filename) + return stridx(s:tlist_removed_flist, a:filename . "\n") != -1 +endfunction + +" Tlist_Update_Remove_List +" Update the list of user removed files from the taglist +" add == 1, add the file to the removed list +" add == 0, delete the file from the removed list +function! s:Tlist_Update_Remove_List(filename, add) + if a:add + let s:tlist_removed_flist = s:tlist_removed_flist . a:filename . "\n" + else + let idx = stridx(s:tlist_removed_flist, a:filename . "\n") + let text_before = strpart(s:tlist_removed_flist, 0, idx) + let rem_text = strpart(s:tlist_removed_flist, idx) + let next_idx = stridx(rem_text, "\n") + let text_after = strpart(rem_text, next_idx + 1) + + let s:tlist_removed_flist = text_before . text_after + endif +endfunction + +" Tlist_FileType_Init +" Initialize the ctags arguments and tag variable for the specified +" file type +function! s:Tlist_FileType_Init(ftype) + call s:Tlist_Log_Msg('Tlist_FileType_Init (' . a:ftype . ')') + " If the user didn't specify any settings, then use the default + " ctags args. Otherwise, use the settings specified by the user + let var = 'g:tlist_' . a:ftype . '_settings' + if exists(var) + " User specified ctags arguments + let settings = {var} . ';' + else + " Default ctags arguments + let var = 's:tlist_def_' . a:ftype . '_settings' + if !exists(var) + " No default settings for this file type. This filetype is + " not supported + return 0 + endif + let settings = s:tlist_def_{a:ftype}_settings . ';' + endif + + let msg = 'Taglist: Invalid ctags option setting - ' . settings + + " Format of the option that specifies the filetype and ctags arugments: + " + " <language_name>;flag1:name1;flag2:name2;flag3:name3 + " + + " Extract the file type to pass to ctags. This may be different from the + " file type detected by Vim + let pos = stridx(settings, ';') + if pos == -1 + call s:Tlist_Warning_Msg(msg) + return 0 + endif + let ctags_ftype = strpart(settings, 0, pos) + if ctags_ftype == '' + call s:Tlist_Warning_Msg(msg) + return 0 + endif + " Make sure a valid filetype is supplied. If the user didn't specify a + " valid filetype, then the ctags option settings may be treated as the + " filetype + if ctags_ftype =~ ':' + call s:Tlist_Warning_Msg(msg) + return 0 + endif + + " Remove the file type from settings + let settings = strpart(settings, pos + 1) + if settings == '' + call s:Tlist_Warning_Msg(msg) + return 0 + endif + + " Process all the specified ctags flags. The format is + " flag1:name1;flag2:name2;flag3:name3 + let ctags_flags = '' + let cnt = 0 + while settings != '' + " Extract the flag + let pos = stridx(settings, ':') + if pos == -1 + call s:Tlist_Warning_Msg(msg) + return 0 + endif + let flag = strpart(settings, 0, pos) + if flag == '' + call s:Tlist_Warning_Msg(msg) + return 0 + endif + " Remove the flag from settings + let settings = strpart(settings, pos + 1) + + " Extract the tag type name + let pos = stridx(settings, ';') + if pos == -1 + call s:Tlist_Warning_Msg(msg) + return 0 + endif + let name = strpart(settings, 0, pos) + if name == '' + call s:Tlist_Warning_Msg(msg) + return 0 + endif + let settings = strpart(settings, pos + 1) + + let cnt = cnt + 1 + + let s:tlist_{a:ftype}_{cnt}_name = flag + let s:tlist_{a:ftype}_{cnt}_fullname = name + let ctags_flags = ctags_flags . flag + endwhile + + let s:tlist_{a:ftype}_ctags_args = '--language-force=' . ctags_ftype . + \ ' --' . ctags_ftype . '-types=' . ctags_flags + let s:tlist_{a:ftype}_count = cnt + let s:tlist_{a:ftype}_ctags_flags = ctags_flags + + " Save the filetype name + let s:tlist_ftype_{s:tlist_ftype_count}_name = a:ftype + let s:tlist_ftype_count = s:tlist_ftype_count + 1 + + return 1 +endfunction + +" Tlist_Detect_Filetype +" Determine the filetype for the specified file using the filetypedetect +" autocmd. +function! s:Tlist_Detect_Filetype(fname) + " Ignore the filetype autocommands + let old_eventignore = &eventignore + set eventignore=FileType + + " Save the 'filetype', as this will be changed temporarily + let old_filetype = &filetype + + " Run the filetypedetect group of autocommands to determine + " the filetype + exe 'doautocmd filetypedetect BufRead ' . a:fname + + " Save the detected filetype + let ftype = &filetype + + " Restore the previous state + let &filetype = old_filetype + let &eventignore = old_eventignore + + return ftype +endfunction + +" Tlist_Get_Buffer_Filetype +" Get the filetype for the specified buffer +function! s:Tlist_Get_Buffer_Filetype(bnum) + let buf_ft = getbufvar(a:bnum, '&filetype') + + if bufloaded(a:bnum) + " For loaded buffers, the 'filetype' is already determined + return buf_ft + endif + + " For unloaded buffers, if the 'filetype' option is set, return it + if buf_ft != '' + return buf_ft + endif + + " Skip non-existent buffers + if !bufexists(a:bnum) + return '' + endif + + " For buffers whose filetype is not yet determined, try to determine + " the filetype + let bname = bufname(a:bnum) + + return s:Tlist_Detect_Filetype(bname) +endfunction + +" Tlist_Discard_TagInfo +" Discard the stored tag information for a file +function! s:Tlist_Discard_TagInfo(fidx) + call s:Tlist_Log_Msg('Tlist_Discard_TagInfo (' . + \ s:tlist_{a:fidx}_filename . ')') + let ftype = s:tlist_{a:fidx}_filetype + + " Discard information about the tags defined in the file + let i = 1 + while i <= s:tlist_{a:fidx}_tag_count + let fidx_i = 's:tlist_' . a:fidx . '_' . i + unlet! {fidx_i}_tag + unlet! {fidx_i}_tag_name + unlet! {fidx_i}_tag_type + unlet! {fidx_i}_ttype_idx + unlet! {fidx_i}_tag_proto + unlet! {fidx_i}_tag_searchpat + unlet! {fidx_i}_tag_linenum + let i = i + 1 + endwhile + + let s:tlist_{a:fidx}_tag_count = 0 + + " Discard information about tag type groups + let i = 1 + while i <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{i}_name + if s:tlist_{a:fidx}_{ttype} != '' + let fidx_ttype = 's:tlist_' . a:fidx . '_' . ttype + let {fidx_ttype} = '' + let {fidx_ttype}_offset = 0 + let cnt = {fidx_ttype}_count + let {fidx_ttype}_count = 0 + let j = 1 + while j <= cnt + unlet! {fidx_ttype}_{j} + let j = j + 1 + endwhile + endif + let i = i + 1 + endwhile + + " Discard the stored menu command also + let s:tlist_{a:fidx}_menu_cmd = '' +endfunction + +" Tlist_Window_Update_Line_Offsets +" Update the line offsets for tags for files starting from start_idx +" and displayed in the taglist window by the specified offset +function! s:Tlist_Window_Update_Line_Offsets(start_idx, increment, offset) + let i = a:start_idx + + while i < s:tlist_file_count + if s:tlist_{i}_visible + " Update the start/end line number only if the file is visible + if a:increment + let s:tlist_{i}_start = s:tlist_{i}_start + a:offset + let s:tlist_{i}_end = s:tlist_{i}_end + a:offset + else + let s:tlist_{i}_start = s:tlist_{i}_start - a:offset + let s:tlist_{i}_end = s:tlist_{i}_end - a:offset + endif + endif + let i = i + 1 + endwhile +endfunction + +" Tlist_Discard_FileInfo +" Discard the stored information for a file +function! s:Tlist_Discard_FileInfo(fidx) + call s:Tlist_Log_Msg('Tlist_Discard_FileInfo (' . + \ s:tlist_{a:fidx}_filename . ')') + call s:Tlist_Discard_TagInfo(a:fidx) + + let ftype = s:tlist_{a:fidx}_filetype + + let i = 1 + while i <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{i}_name + unlet! s:tlist_{a:fidx}_{ttype} + unlet! s:tlist_{a:fidx}_{ttype}_offset + unlet! s:tlist_{a:fidx}_{ttype}_count + let i = i + 1 + endwhile + + unlet! s:tlist_{a:fidx}_filename + unlet! s:tlist_{a:fidx}_sort_type + unlet! s:tlist_{a:fidx}_filetype + unlet! s:tlist_{a:fidx}_mtime + unlet! s:tlist_{a:fidx}_start + unlet! s:tlist_{a:fidx}_end + unlet! s:tlist_{a:fidx}_valid + unlet! s:tlist_{a:fidx}_visible + unlet! s:tlist_{a:fidx}_tag_count + unlet! s:tlist_{a:fidx}_menu_cmd +endfunction + +" Tlist_Window_Remove_File_From_Display +" Remove the specified file from display +function! s:Tlist_Window_Remove_File_From_Display(fidx) + call s:Tlist_Log_Msg('Tlist_Window_Remove_File_From_Display (' . + \ s:tlist_{a:fidx}_filename . ')') + " If the file is not visible then no need to remove it + if !s:tlist_{a:fidx}_visible + return + endif + + " Remove the tags displayed for the specified file from the window + let start = s:tlist_{a:fidx}_start + " Include the empty line after the last line also + if g:Tlist_Compact_Format + let end = s:tlist_{a:fidx}_end + else + let end = s:tlist_{a:fidx}_end + 1 + endif + + setlocal modifiable + exe 'silent! ' . start . ',' . end . 'delete _' + setlocal nomodifiable + + " Correct the start and end line offsets for all the files following + " this file, as the tags for this file are removed + call s:Tlist_Window_Update_Line_Offsets(a:fidx + 1, 0, end - start + 1) +endfunction + +" Tlist_Remove_File +" Remove the file under the cursor or the specified file index +" user_request - User requested to remove the file from taglist +function! s:Tlist_Remove_File(file_idx, user_request) + let fidx = a:file_idx + + if fidx == -1 + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) + if fidx == -1 + return + endif + endif + call s:Tlist_Log_Msg('Tlist_Remove_File (' . + \ s:tlist_{fidx}_filename . ', ' . a:user_request . ')') + + let save_winnr = winnr() + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + " Taglist window is open, remove the file from display + + if save_winnr != winnum + let old_eventignore = &eventignore + set eventignore=all + exe winnum . 'wincmd w' + endif + + call s:Tlist_Window_Remove_File_From_Display(fidx) + + if save_winnr != winnum + exe save_winnr . 'wincmd w' + let &eventignore = old_eventignore + endif + endif + + let fname = s:tlist_{fidx}_filename + + if a:user_request + " As the user requested to remove the file from taglist, + " add it to the removed list + call s:Tlist_Update_Remove_List(fname, 1) + endif + + " Remove the file name from the taglist list of filenames + let idx = stridx(s:tlist_file_names, fname . "\n") + let text_before = strpart(s:tlist_file_names, 0, idx) + let rem_text = strpart(s:tlist_file_names, idx) + let next_idx = stridx(rem_text, "\n") + let text_after = strpart(rem_text, next_idx + 1) + let s:tlist_file_names = text_before . text_after + + call s:Tlist_Discard_FileInfo(fidx) + + " Shift all the file variables by one index + let i = fidx + 1 + + while i < s:tlist_file_count + let j = i - 1 + + let s:tlist_{j}_filename = s:tlist_{i}_filename + let s:tlist_{j}_sort_type = s:tlist_{i}_sort_type + let s:tlist_{j}_filetype = s:tlist_{i}_filetype + let s:tlist_{j}_mtime = s:tlist_{i}_mtime + let s:tlist_{j}_start = s:tlist_{i}_start + let s:tlist_{j}_end = s:tlist_{i}_end + let s:tlist_{j}_valid = s:tlist_{i}_valid + let s:tlist_{j}_visible = s:tlist_{i}_visible + let s:tlist_{j}_tag_count = s:tlist_{i}_tag_count + let s:tlist_{j}_menu_cmd = s:tlist_{i}_menu_cmd + + let k = 1 + while k <= s:tlist_{j}_tag_count + let s:tlist_{j}_{k}_tag = s:tlist_{i}_{k}_tag + let s:tlist_{j}_{k}_tag_name = s:tlist_{i}_{k}_tag_name + let s:tlist_{j}_{k}_tag_type = s:Tlist_Get_Tag_Type_By_Tag(i, k) + let s:tlist_{j}_{k}_ttype_idx = s:tlist_{i}_{k}_ttype_idx + let s:tlist_{j}_{k}_tag_proto = s:Tlist_Get_Tag_Prototype(i, k) + let s:tlist_{j}_{k}_tag_searchpat = s:Tlist_Get_Tag_SearchPat(i, k) + let s:tlist_{j}_{k}_tag_linenum = s:Tlist_Get_Tag_Linenum(i, k) + let k = k + 1 + endwhile + + let ftype = s:tlist_{i}_filetype + + let k = 1 + while k <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{k}_name + let s:tlist_{j}_{ttype} = s:tlist_{i}_{ttype} + let s:tlist_{j}_{ttype}_offset = s:tlist_{i}_{ttype}_offset + let s:tlist_{j}_{ttype}_count = s:tlist_{i}_{ttype}_count + if s:tlist_{j}_{ttype} != '' + let l = 1 + while l <= s:tlist_{j}_{ttype}_count + let s:tlist_{j}_{ttype}_{l} = s:tlist_{i}_{ttype}_{l} + let l = l + 1 + endwhile + endif + let k = k + 1 + endwhile + + " As the file and tag information is copied to the new index, + " discard the previous information + call s:Tlist_Discard_FileInfo(i) + + let i = i + 1 + endwhile + + " Reduce the number of files displayed + let s:tlist_file_count = s:tlist_file_count - 1 + + if g:Tlist_Show_One_File + " If the tags for only one file is displayed and if we just + " now removed that file, then invalidate the current file idx + if s:tlist_cur_file_idx == fidx + let s:tlist_cur_file_idx = -1 + endif + endif +endfunction + +" Tlist_Window_Goto_Window +" Goto the taglist window +function! s:Tlist_Window_Goto_Window() + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + if winnr() != winnum + call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') + endif + endif +endfunction + +" Tlist_Window_Create +" Create a new taglist window. If it is already open, jump to it +function! s:Tlist_Window_Create() + call s:Tlist_Log_Msg('Tlist_Window_Create()') + " If the window is open, jump to it + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + " Jump to the existing window + if winnr() != winnum + exe winnum . 'wincmd w' + endif + return + endif + + " If used with winmanager don't open windows. Winmanager will handle + " the window/buffer management + if s:tlist_app_name == "winmanager" + return + endif + + " Create a new window. If user prefers a horizontal window, then open + " a horizontally split window. Otherwise open a vertically split + " window + if g:Tlist_Use_Horiz_Window + " Open a horizontally split window + let win_dir = 'botright' + " Horizontal window height + let win_size = g:Tlist_WinHeight + else + if s:tlist_winsize_chgd == -1 + " Open a vertically split window. Increase the window size, if + " needed, to accomodate the new window + if g:Tlist_Inc_Winwidth && + \ &columns < (80 + g:Tlist_WinWidth) + " Save the original window position + let s:tlist_pre_winx = getwinposx() + let s:tlist_pre_winy = getwinposy() + + " one extra column is needed to include the vertical split + let &columns= &columns + g:Tlist_WinWidth + 1 + + let s:tlist_winsize_chgd = 1 + else + let s:tlist_winsize_chgd = 0 + endif + endif + + if g:Tlist_Use_Right_Window + " Open the window at the rightmost place + let win_dir = 'botright vertical' + else + " Open the window at the leftmost place + let win_dir = 'topleft vertical' + endif + let win_size = g:Tlist_WinWidth + endif + + " If the tag listing temporary buffer already exists, then reuse it. + " Otherwise create a new buffer + let bufnum = bufnr(g:TagList_title) + if bufnum == -1 + " Create a new buffer + let wcmd = g:TagList_title + else + " Edit the existing buffer + let wcmd = '+buffer' . bufnum + endif + + " Create the taglist window + exe 'silent! ' . win_dir . ' ' . win_size . 'split ' . wcmd + + " Save the new window position + let s:tlist_winx = getwinposx() + let s:tlist_winy = getwinposy() + + " Initialize the taglist window + call s:Tlist_Window_Init() +endfunction + +" Tlist_Window_Zoom +" Zoom (maximize/minimize) the taglist window +function! s:Tlist_Window_Zoom() + if s:tlist_win_maximized + " Restore the window back to the previous size + if g:Tlist_Use_Horiz_Window + exe 'resize ' . g:Tlist_WinHeight + else + exe 'vert resize ' . g:Tlist_WinWidth + endif + let s:tlist_win_maximized = 0 + else + " Set the window size to the maximum possible without closing other + " windows + if g:Tlist_Use_Horiz_Window + resize + else + vert resize + endif + let s:tlist_win_maximized = 1 + endif +endfunction + +" Tlist_Ballon_Expr +" When the mouse cursor is over a tag in the taglist window, display the +" tag prototype (balloon) +function! Tlist_Ballon_Expr() + " Get the file index + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(v:beval_lnum) + if fidx == -1 + return '' + endif + + " Get the tag output line for the current tag + let tidx = s:Tlist_Window_Get_Tag_Index(fidx, v:beval_lnum) + if tidx == 0 + return '' + endif + + " Get the tag search pattern and display it + return s:Tlist_Get_Tag_Prototype(fidx, tidx) +endfunction + +" Tlist_Window_Check_Width +" Check the width of the taglist window. For horizontally split windows, the +" 'winfixheight' option is used to fix the height of the window. For +" vertically split windows, Vim doesn't support the 'winfixwidth' option. So +" need to handle window width changes from this function. +function! s:Tlist_Window_Check_Width() + let tlist_winnr = bufwinnr(g:TagList_title) + if tlist_winnr == -1 + return + endif + + let width = winwidth(tlist_winnr) + if width != g:Tlist_WinWidth + call s:Tlist_Log_Msg("Tlist_Window_Check_Width: Changing window " . + \ "width from " . width . " to " . g:Tlist_WinWidth) + let save_winnr = winnr() + if save_winnr != tlist_winnr + call s:Tlist_Exe_Cmd_No_Acmds(tlist_winnr . 'wincmd w') + endif + exe 'vert resize ' . g:Tlist_WinWidth + if save_winnr != tlist_winnr + call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') + endif + endif +endfunction + +" Tlist_Window_Exit_Only_Window +" If the 'Tlist_Exit_OnlyWindow' option is set, then exit Vim if only the +" taglist window is present. +function! s:Tlist_Window_Exit_Only_Window() + " Before quitting Vim, delete the taglist buffer so that + " the '0 mark is correctly set to the previous buffer. + if v:version < 700 + if winbufnr(2) == -1 + bdelete + quit + endif + else + if winbufnr(2) == -1 + if tabpagenr('$') == 1 + " Only one tag page is present + bdelete + quit + else + " More than one tab page is present. Close only the current + " tab page + close + endif + endif + endif +endfunction + +" Tlist_Window_Init +" Set the default options for the taglist window +function! s:Tlist_Window_Init() + call s:Tlist_Log_Msg('Tlist_Window_Init()') + + " The 'readonly' option should not be set for the taglist buffer. + " If Vim is started as "view/gview" or if the ":view" command is + " used, then the 'readonly' option is set for all the buffers. + " Unset it for the taglist buffer + setlocal noreadonly + + " Set the taglist buffer filetype to taglist + setlocal filetype=taglist + + " Define taglist window element highlighting + syntax match TagListComment '^" .*' + syntax match TagListFileName '^[^" ].*$' + syntax match TagListTitle '^ \S.*$' + syntax match TagListTagScope '\s\[.\{-\}\]$' + + " Define the highlighting only if colors are supported + if has('gui_running') || &t_Co > 2 + " Colors to highlight various taglist window elements + " If user defined highlighting group exists, then use them. + " Otherwise, use default highlight groups. + if hlexists('MyTagListTagName') + highlight link TagListTagName MyTagListTagName + else + highlight default link TagListTagName Search + endif + " Colors to highlight comments and titles + if hlexists('MyTagListComment') + highlight link TagListComment MyTagListComment + else + highlight clear TagListComment + highlight default link TagListComment Comment + endif + if hlexists('MyTagListTitle') + highlight link TagListTitle MyTagListTitle + else + highlight clear TagListTitle + highlight default link TagListTitle Title + endif + if hlexists('MyTagListFileName') + highlight link TagListFileName MyTagListFileName + else + highlight clear TagListFileName + highlight default TagListFileName guibg=Grey ctermbg=darkgray + \ guifg=white ctermfg=white + endif + if hlexists('MyTagListTagScope') + highlight link TagListTagScope MyTagListTagScope + else + highlight clear TagListTagScope + highlight default link TagListTagScope Identifier + endif + else + highlight default TagListTagName term=reverse cterm=reverse + endif + + " Folding related settings + setlocal foldenable + setlocal foldminlines=0 + setlocal foldmethod=manual + setlocal foldlevel=9999 + if g:Tlist_Enable_Fold_Column + setlocal foldcolumn=3 + else + setlocal foldcolumn=0 + endif + setlocal foldtext=v:folddashes.getline(v:foldstart) + + if s:tlist_app_name != "winmanager" + " Mark buffer as scratch + silent! setlocal buftype=nofile + if s:tlist_app_name == "none" + silent! setlocal bufhidden=delete + endif + silent! setlocal noswapfile + " Due to a bug in Vim 6.0, the winbufnr() function fails for unlisted + " buffers. So if the taglist buffer is unlisted, multiple taglist + " windows will be opened. This bug is fixed in Vim 6.1 and above + if v:version >= 601 + silent! setlocal nobuflisted + endif + endif + + silent! setlocal nowrap + + " If the 'number' option is set in the source window, it will affect the + " taglist window. So forcefully disable 'number' option for the taglist + " window + silent! setlocal nonumber + + " Use fixed height when horizontally split window is used + if g:Tlist_Use_Horiz_Window + if v:version >= 602 + set winfixheight + endif + endif + if !g:Tlist_Use_Horiz_Window && v:version >= 700 + set winfixwidth + endif + + " Setup balloon evaluation to display tag prototype + if v:version >= 700 && has('balloon_eval') + setlocal balloonexpr=Tlist_Ballon_Expr() + set ballooneval + endif + + " Setup the cpoptions properly for the maps to work + let old_cpoptions = &cpoptions + set cpoptions&vim + + " Create buffer local mappings for jumping to the tags and sorting the list + nnoremap <buffer> <silent> <CR> + \ :call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR> + nnoremap <buffer> <silent> o + \ :call <SID>Tlist_Window_Jump_To_Tag('newwin')<CR> + nnoremap <buffer> <silent> p + \ :call <SID>Tlist_Window_Jump_To_Tag('preview')<CR> + nnoremap <buffer> <silent> P + \ :call <SID>Tlist_Window_Jump_To_Tag('prevwin')<CR> + if v:version >= 700 + nnoremap <buffer> <silent> t + \ :call <SID>Tlist_Window_Jump_To_Tag('checktab')<CR> + nnoremap <buffer> <silent> <C-t> + \ :call <SID>Tlist_Window_Jump_To_Tag('newtab')<CR> + endif + nnoremap <buffer> <silent> <2-LeftMouse> + \ :call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR> + nnoremap <buffer> <silent> s + \ :call <SID>Tlist_Change_Sort('cmd', 'toggle', '')<CR> + nnoremap <buffer> <silent> + :silent! foldopen<CR> + nnoremap <buffer> <silent> - :silent! foldclose<CR> + nnoremap <buffer> <silent> * :silent! %foldopen!<CR> + nnoremap <buffer> <silent> = :silent! %foldclose<CR> + nnoremap <buffer> <silent> <kPlus> :silent! foldopen<CR> + nnoremap <buffer> <silent> <kMinus> :silent! foldclose<CR> + nnoremap <buffer> <silent> <kMultiply> :silent! %foldopen!<CR> + nnoremap <buffer> <silent> <Space> :call <SID>Tlist_Window_Show_Info()<CR> + nnoremap <buffer> <silent> u :call <SID>Tlist_Window_Update_File()<CR> + nnoremap <buffer> <silent> d :call <SID>Tlist_Remove_File(-1, 1)<CR> + nnoremap <buffer> <silent> x :call <SID>Tlist_Window_Zoom()<CR> + nnoremap <buffer> <silent> [[ :call <SID>Tlist_Window_Move_To_File(-1)<CR> + nnoremap <buffer> <silent> <BS> :call <SID>Tlist_Window_Move_To_File(-1)<CR> + nnoremap <buffer> <silent> ]] :call <SID>Tlist_Window_Move_To_File(1)<CR> + nnoremap <buffer> <silent> <Tab> :call <SID>Tlist_Window_Move_To_File(1)<CR> + nnoremap <buffer> <silent> <F1> :call <SID>Tlist_Window_Toggle_Help_Text()<CR> + nnoremap <buffer> <silent> q :close<CR> + + " Insert mode mappings + inoremap <buffer> <silent> <CR> + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR> + " Windows needs return + inoremap <buffer> <silent> <Return> + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR> + inoremap <buffer> <silent> o + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('newwin')<CR> + inoremap <buffer> <silent> p + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('preview')<CR> + inoremap <buffer> <silent> P + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('prevwin')<CR> + if v:version >= 700 + inoremap <buffer> <silent> t + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('checktab')<CR> + inoremap <buffer> <silent> <C-t> + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('newtab')<CR> + endif + inoremap <buffer> <silent> <2-LeftMouse> + \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR> + inoremap <buffer> <silent> s + \ <C-o>:call <SID>Tlist_Change_Sort('cmd', 'toggle', '')<CR> + inoremap <buffer> <silent> + <C-o>:silent! foldopen<CR> + inoremap <buffer> <silent> - <C-o>:silent! foldclose<CR> + inoremap <buffer> <silent> * <C-o>:silent! %foldopen!<CR> + inoremap <buffer> <silent> = <C-o>:silent! %foldclose<CR> + inoremap <buffer> <silent> <kPlus> <C-o>:silent! foldopen<CR> + inoremap <buffer> <silent> <kMinus> <C-o>:silent! foldclose<CR> + inoremap <buffer> <silent> <kMultiply> <C-o>:silent! %foldopen!<CR> + inoremap <buffer> <silent> <Space> <C-o>:call + \ <SID>Tlist_Window_Show_Info()<CR> + inoremap <buffer> <silent> u + \ <C-o>:call <SID>Tlist_Window_Update_File()<CR> + inoremap <buffer> <silent> d <C-o>:call <SID>Tlist_Remove_File(-1, 1)<CR> + inoremap <buffer> <silent> x <C-o>:call <SID>Tlist_Window_Zoom()<CR> + inoremap <buffer> <silent> [[ <C-o>:call <SID>Tlist_Window_Move_To_File(-1)<CR> + inoremap <buffer> <silent> <BS> <C-o>:call <SID>Tlist_Window_Move_To_File(-1)<CR> + inoremap <buffer> <silent> ]] <C-o>:call <SID>Tlist_Window_Move_To_File(1)<CR> + inoremap <buffer> <silent> <Tab> <C-o>:call <SID>Tlist_Window_Move_To_File(1)<CR> + inoremap <buffer> <silent> <F1> <C-o>:call <SID>Tlist_Window_Toggle_Help_Text()<CR> + inoremap <buffer> <silent> q <C-o>:close<CR> + + " Map single left mouse click if the user wants this functionality + if g:Tlist_Use_SingleClick == 1 + " Contributed by Bindu Wavell + " attempt to perform single click mapping, it would be much + " nicer if we could nnoremap <buffer> ... however vim does + " not fire the <buffer> <leftmouse> when you use the mouse + " to enter a buffer. + let clickmap = ':if bufname("%") =~ "__Tag_List__" <bar> ' . + \ 'call <SID>Tlist_Window_Jump_To_Tag("useopen") ' . + \ '<bar> endif <CR>' + if maparg('<leftmouse>', 'n') == '' + " no mapping for leftmouse + exe ':nnoremap <silent> <leftmouse> <leftmouse>' . clickmap + else + " we have a mapping + let mapcmd = ':nnoremap <silent> <leftmouse> <leftmouse>' + let mapcmd = mapcmd . substitute(substitute( + \ maparg('<leftmouse>', 'n'), '|', '<bar>', 'g'), + \ '\c^<leftmouse>', '', '') + let mapcmd = mapcmd . clickmap + exe mapcmd + endif + endif + + " Define the taglist autocommands + augroup TagListAutoCmds + autocmd! + " Display the tag prototype for the tag under the cursor. + autocmd CursorHold __Tag_List__ call s:Tlist_Window_Show_Info() + " Highlight the current tag periodically + autocmd CursorHold * silent call s:Tlist_Window_Highlight_Tag( + \ fnamemodify(bufname('%'), ':p'), line('.'), 1, 0) + + " Adjust the Vim window width when taglist window is closed + autocmd BufUnload __Tag_List__ call s:Tlist_Post_Close_Cleanup() + " Close the fold for this buffer when leaving the buffer + if g:Tlist_File_Fold_Auto_Close + autocmd BufEnter * silent + \ call s:Tlist_Window_Open_File_Fold(expand('<abuf>')) + endif + " Exit Vim itself if only the taglist window is present (optional) + if g:Tlist_Exit_OnlyWindow + autocmd BufEnter __Tag_List__ nested + \ call s:Tlist_Window_Exit_Only_Window() + endif + if s:tlist_app_name != "winmanager" && + \ !g:Tlist_Process_File_Always && + \ (!has('gui_running') || !g:Tlist_Show_Menu) + " Auto refresh the taglist window + autocmd BufEnter * call s:Tlist_Refresh() + endif + + if !g:Tlist_Use_Horiz_Window + if v:version < 700 + autocmd WinEnter * call s:Tlist_Window_Check_Width() + endif + endif + if v:version >= 700 + autocmd TabEnter * silent call s:Tlist_Refresh_Folds() + endif + augroup end + + " Restore the previous cpoptions settings + let &cpoptions = old_cpoptions +endfunction + +" Tlist_Window_Refresh +" Display the tags for all the files in the taglist window +function! s:Tlist_Window_Refresh() + call s:Tlist_Log_Msg('Tlist_Window_Refresh()') + " Set report option to a huge value to prevent informational messages + " while deleting the lines + let old_report = &report + set report=99999 + + " Mark the buffer as modifiable + setlocal modifiable + + " Delete the contents of the buffer to the black-hole register + silent! %delete _ + + " As we have cleared the taglist window, mark all the files + " as not visible + let i = 0 + while i < s:tlist_file_count + let s:tlist_{i}_visible = 0 + let i = i + 1 + endwhile + + if g:Tlist_Compact_Format == 0 + " Display help in non-compact mode + call s:Tlist_Window_Display_Help() + endif + + " Mark the buffer as not modifiable + setlocal nomodifiable + + " Restore the report option + let &report = old_report + + " If the tags for only one file should be displayed in the taglist + " window, then no need to add the tags here. The bufenter autocommand + " will add the tags for that file. + if g:Tlist_Show_One_File + return + endif + + " List all the tags for the previously processed files + " Do this only if taglist is configured to display tags for more than + " one file. Otherwise, when Tlist_Show_One_File is configured, + " tags for the wrong file will be displayed. + let i = 0 + while i < s:tlist_file_count + call s:Tlist_Window_Refresh_File(s:tlist_{i}_filename, + \ s:tlist_{i}_filetype) + let i = i + 1 + endwhile + + if g:Tlist_Auto_Update + " Add and list the tags for all buffers in the Vim buffer list + let i = 1 + let last_bufnum = bufnr('$') + while i <= last_bufnum + if buflisted(i) + let fname = fnamemodify(bufname(i), ':p') + let ftype = s:Tlist_Get_Buffer_Filetype(i) + " If the file doesn't support tag listing, skip it + if !s:Tlist_Skip_File(fname, ftype) + call s:Tlist_Window_Refresh_File(fname, ftype) + endif + endif + let i = i + 1 + endwhile + endif + + " If Tlist_File_Fold_Auto_Close option is set, then close all the folds + if g:Tlist_File_Fold_Auto_Close + " Close all the folds + silent! %foldclose + endif + + " Move the cursor to the top of the taglist window + normal! gg +endfunction + +" Tlist_Post_Close_Cleanup() +" Close the taglist window and adjust the Vim window width +function! s:Tlist_Post_Close_Cleanup() + call s:Tlist_Log_Msg('Tlist_Post_Close_Cleanup()') + " Mark all the files as not visible + let i = 0 + while i < s:tlist_file_count + let s:tlist_{i}_visible = 0 + let i = i + 1 + endwhile + + " Remove the taglist autocommands + silent! autocmd! TagListAutoCmds + + " Clear all the highlights + match none + + silent! syntax clear TagListTitle + silent! syntax clear TagListComment + silent! syntax clear TagListTagScope + + " Remove the left mouse click mapping if it was setup initially + if g:Tlist_Use_SingleClick + if hasmapto('<LeftMouse>') + nunmap <LeftMouse> + endif + endif + + if s:tlist_app_name != "winmanager" + if g:Tlist_Use_Horiz_Window || g:Tlist_Inc_Winwidth == 0 || + \ s:tlist_winsize_chgd != 1 || + \ &columns < (80 + g:Tlist_WinWidth) + " No need to adjust window width if using horizontally split taglist + " window or if columns is less than 101 or if the user chose not to + " adjust the window width + else + " If the user didn't manually move the window, then restore the window + " position to the pre-taglist position + if s:tlist_pre_winx != -1 && s:tlist_pre_winy != -1 && + \ getwinposx() == s:tlist_winx && + \ getwinposy() == s:tlist_winy + exe 'winpos ' . s:tlist_pre_winx . ' ' . s:tlist_pre_winy + endif + + " Adjust the Vim window width + let &columns= &columns - (g:Tlist_WinWidth + 1) + endif + endif + + let s:tlist_winsize_chgd = -1 + + " Reset taglist state variables + if s:tlist_app_name == "winmanager" + let s:tlist_app_name = "none" + endif + let s:tlist_window_initialized = 0 +endfunction + +" Tlist_Window_Refresh_File() +" List the tags defined in the specified file in a Vim window +function! s:Tlist_Window_Refresh_File(filename, ftype) + call s:Tlist_Log_Msg('Tlist_Window_Refresh_File (' . a:filename . ')') + " First check whether the file already exists + let fidx = s:Tlist_Get_File_Index(a:filename) + if fidx != -1 + let file_listed = 1 + else + let file_listed = 0 + endif + + if !file_listed + " Check whether this file is removed based on user request + " If it is, then don't display the tags for this file + if s:Tlist_User_Removed_File(a:filename) + return + endif + endif + + if file_listed && s:tlist_{fidx}_visible + " Check whether the file tags are currently valid + if s:tlist_{fidx}_valid + " Goto the first line in the file + exe s:tlist_{fidx}_start + + " If the line is inside a fold, open the fold + if foldclosed('.') != -1 + exe "silent! " . s:tlist_{fidx}_start . "," . + \ s:tlist_{fidx}_end . "foldopen!" + endif + return + endif + + " Discard and remove the tags for this file from display + call s:Tlist_Discard_TagInfo(fidx) + call s:Tlist_Window_Remove_File_From_Display(fidx) + endif + + " Process and generate a list of tags defined in the file + if !file_listed || !s:tlist_{fidx}_valid + let ret_fidx = s:Tlist_Process_File(a:filename, a:ftype) + if ret_fidx == -1 + return + endif + let fidx = ret_fidx + endif + + " Set report option to a huge value to prevent informational messages + " while adding lines to the taglist window + let old_report = &report + set report=99999 + + if g:Tlist_Show_One_File + " Remove the previous file + if s:tlist_cur_file_idx != -1 + call s:Tlist_Window_Remove_File_From_Display(s:tlist_cur_file_idx) + let s:tlist_{s:tlist_cur_file_idx}_visible = 0 + let s:tlist_{s:tlist_cur_file_idx}_start = 0 + let s:tlist_{s:tlist_cur_file_idx}_end = 0 + endif + let s:tlist_cur_file_idx = fidx + endif + + " Mark the buffer as modifiable + setlocal modifiable + + " Add new files to the end of the window. For existing files, add them at + " the same line where they were previously present. If the file is not + " visible, then add it at the end + if s:tlist_{fidx}_start == 0 || !s:tlist_{fidx}_visible + if g:Tlist_Compact_Format + let s:tlist_{fidx}_start = line('$') + else + let s:tlist_{fidx}_start = line('$') + 1 + endif + endif + + let s:tlist_{fidx}_visible = 1 + + " Goto the line where this file should be placed + if g:Tlist_Compact_Format + exe s:tlist_{fidx}_start + else + exe s:tlist_{fidx}_start - 1 + endif + + let txt = fnamemodify(s:tlist_{fidx}_filename, ':t') . ' (' . + \ fnamemodify(s:tlist_{fidx}_filename, ':p:h') . ')' + if g:Tlist_Compact_Format == 0 + silent! put =txt + else + silent! put! =txt + " Move to the next line + exe line('.') + 1 + endif + let file_start = s:tlist_{fidx}_start + + " Add the tag names grouped by tag type to the buffer with a title + let i = 1 + let ttype_cnt = s:tlist_{a:ftype}_count + while i <= ttype_cnt + let ttype = s:tlist_{a:ftype}_{i}_name + " Add the tag type only if there are tags for that type + let fidx_ttype = 's:tlist_' . fidx . '_' . ttype + let ttype_txt = {fidx_ttype} + if ttype_txt != '' + let txt = ' ' . s:tlist_{a:ftype}_{i}_fullname + if g:Tlist_Compact_Format == 0 + let ttype_start_lnum = line('.') + 1 + silent! put =txt + else + let ttype_start_lnum = line('.') + silent! put! =txt + endif + silent! put =ttype_txt + + let {fidx_ttype}_offset = ttype_start_lnum - file_start + + " create a fold for this tag type + let fold_start = ttype_start_lnum + let fold_end = fold_start + {fidx_ttype}_count + exe fold_start . ',' . fold_end . 'fold' + + " Adjust the cursor position + if g:Tlist_Compact_Format == 0 + exe ttype_start_lnum + {fidx_ttype}_count + else + exe ttype_start_lnum + {fidx_ttype}_count + 1 + endif + + if g:Tlist_Compact_Format == 0 + " Separate the tag types by a empty line + silent! put ='' + endif + endif + let i = i + 1 + endwhile + + if s:tlist_{fidx}_tag_count == 0 + if g:Tlist_Compact_Format == 0 + silent! put ='' + endif + endif + + let s:tlist_{fidx}_end = line('.') - 1 + + " Create a fold for the entire file + exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold' + exe 'silent! ' . s:tlist_{fidx}_start . ',' . + \ s:tlist_{fidx}_end . 'foldopen!' + + " Goto the starting line for this file, + exe s:tlist_{fidx}_start + + if s:tlist_app_name == "winmanager" + " To handle a bug in the winmanager plugin, add a space at the + " last line + call setline('$', ' ') + endif + + " Mark the buffer as not modifiable + setlocal nomodifiable + + " Restore the report option + let &report = old_report + + " Update the start and end line numbers for all the files following this + " file + let start = s:tlist_{fidx}_start + " include the empty line after the last line + if g:Tlist_Compact_Format + let end = s:tlist_{fidx}_end + else + let end = s:tlist_{fidx}_end + 1 + endif + call s:Tlist_Window_Update_Line_Offsets(fidx + 1, 1, end - start + 1) + + " Now that we have updated the taglist window, update the tags + " menu (if present) + if g:Tlist_Show_Menu + call s:Tlist_Menu_Update_File(1) + endif +endfunction + +" Tlist_Init_File +" Initialize the variables for a new file +function! s:Tlist_Init_File(filename, ftype) + call s:Tlist_Log_Msg('Tlist_Init_File (' . a:filename . ')') + " Add new files at the end of the list + let fidx = s:tlist_file_count + let s:tlist_file_count = s:tlist_file_count + 1 + " Add the new file name to the taglist list of file names + let s:tlist_file_names = s:tlist_file_names . a:filename . "\n" + + " Initialize the file variables + let s:tlist_{fidx}_filename = a:filename + let s:tlist_{fidx}_sort_type = g:Tlist_Sort_Type + let s:tlist_{fidx}_filetype = a:ftype + let s:tlist_{fidx}_mtime = -1 + let s:tlist_{fidx}_start = 0 + let s:tlist_{fidx}_end = 0 + let s:tlist_{fidx}_valid = 0 + let s:tlist_{fidx}_visible = 0 + let s:tlist_{fidx}_tag_count = 0 + let s:tlist_{fidx}_menu_cmd = '' + + " Initialize the tag type variables + let i = 1 + while i <= s:tlist_{a:ftype}_count + let ttype = s:tlist_{a:ftype}_{i}_name + let s:tlist_{fidx}_{ttype} = '' + let s:tlist_{fidx}_{ttype}_offset = 0 + let s:tlist_{fidx}_{ttype}_count = 0 + let i = i + 1 + endwhile + + return fidx +endfunction + +" Tlist_Get_Tag_Type_By_Tag +" Return the tag type for the specified tag index +function! s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) + let ttype_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_type' + + " Already parsed and have the tag name + if exists(ttype_var) + return {ttype_var} + endif + + let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag + let {ttype_var} = s:Tlist_Extract_Tagtype(tag_line) + + return {ttype_var} +endfunction + +" Tlist_Get_Tag_Prototype +function! s:Tlist_Get_Tag_Prototype(fidx, tidx) + let tproto_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_proto' + + " Already parsed and have the tag prototype + if exists(tproto_var) + return {tproto_var} + endif + + " Parse and extract the tag prototype + let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag + let start = stridx(tag_line, '/^') + 2 + let end = stridx(tag_line, '/;"' . "\t") + if tag_line[end - 1] == '$' + let end = end -1 + endif + let tag_proto = strpart(tag_line, start, end - start) + let {tproto_var} = substitute(tag_proto, '\s*', '', '') + + return {tproto_var} +endfunction + +" Tlist_Get_Tag_SearchPat +function! s:Tlist_Get_Tag_SearchPat(fidx, tidx) + let tpat_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_searchpat' + + " Already parsed and have the tag search pattern + if exists(tpat_var) + return {tpat_var} + endif + + " Parse and extract the tag search pattern + let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag + let start = stridx(tag_line, '/^') + 2 + let end = stridx(tag_line, '/;"' . "\t") + if tag_line[end - 1] == '$' + let end = end -1 + endif + let {tpat_var} = '\V\^' . strpart(tag_line, start, end - start) . + \ (tag_line[end] == '$' ? '\$' : '') + + return {tpat_var} +endfunction + +" Tlist_Get_Tag_Linenum +" Return the tag line number, given the tag index +function! s:Tlist_Get_Tag_Linenum(fidx, tidx) + let tline_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_linenum' + + " Already parsed and have the tag line number + if exists(tline_var) + return {tline_var} + endif + + " Parse and extract the tag line number + let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag + let start = strridx(tag_line, 'line:') + 5 + let end = strridx(tag_line, "\t") + if end < start + let {tline_var} = strpart(tag_line, start) + 0 + else + let {tline_var} = strpart(tag_line, start, end - start) + 0 + endif + + return {tline_var} +endfunction + +" Tlist_Parse_Tagline +" Parse a tag line from the ctags output. Separate the tag output based on the +" tag type and store it in the tag type variable. +" The format of each line in the ctags output is: +" +" tag_name<TAB>file_name<TAB>ex_cmd;"<TAB>extension_fields +" +function! s:Tlist_Parse_Tagline(tag_line) + if a:tag_line == '' + " Skip empty lines + return + endif + + " Extract the tag type + let ttype = s:Tlist_Extract_Tagtype(a:tag_line) + + " Make sure the tag type is a valid and supported one + if ttype == '' || stridx(s:ctags_flags, ttype) == -1 + " Line is not in proper tags format or Tag type is not supported + return + endif + + " Update the total tag count + let s:tidx = s:tidx + 1 + + " The following variables are used to optimize this code. Vim is slow in + " using curly brace names. To reduce the amount of processing needed, the + " curly brace variables are pre-processed here + let fidx_tidx = 's:tlist_' . s:fidx . '_' . s:tidx + let fidx_ttype = 's:tlist_' . s:fidx . '_' . ttype + + " Update the count of this tag type + let ttype_idx = {fidx_ttype}_count + 1 + let {fidx_ttype}_count = ttype_idx + + " Store the ctags output for this tag + let {fidx_tidx}_tag = a:tag_line + + " Store the tag index and the tag type index (back pointers) + let {fidx_ttype}_{ttype_idx} = s:tidx + let {fidx_tidx}_ttype_idx = ttype_idx + + " Extract the tag name + let tag_name = strpart(a:tag_line, 0, stridx(a:tag_line, "\t")) + + " Extract the tag scope/prototype + if g:Tlist_Display_Prototype + let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(s:fidx, s:tidx) + else + let ttxt = ' ' . tag_name + + " Add the tag scope, if it is available and is configured. Tag + " scope is the last field after the 'line:<num>\t' field + if g:Tlist_Display_Tag_Scope + let tag_scope = s:Tlist_Extract_Tag_Scope(a:tag_line) + if tag_scope != '' + let ttxt = ttxt . ' [' . tag_scope . ']' + endif + endif + endif + + " Add this tag to the tag type variable + let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" + + " Save the tag name + let {fidx_tidx}_tag_name = tag_name +endfunction + +" Tlist_Process_File +" Get the list of tags defined in the specified file and store them +" in Vim variables. Returns the file index where the tags are stored. +function! s:Tlist_Process_File(filename, ftype) + call s:Tlist_Log_Msg('Tlist_Process_File (' . a:filename . ', ' . + \ a:ftype . ')') + " Check whether this file is supported + if s:Tlist_Skip_File(a:filename, a:ftype) + return -1 + endif + + " If the tag types for this filetype are not yet created, then create + " them now + let var = 's:tlist_' . a:ftype . '_count' + if !exists(var) + if s:Tlist_FileType_Init(a:ftype) == 0 + return -1 + endif + endif + + " If this file is already processed, then use the cached values + let fidx = s:Tlist_Get_File_Index(a:filename) + if fidx == -1 + " First time, this file is loaded + let fidx = s:Tlist_Init_File(a:filename, a:ftype) + else + " File was previously processed. Discard the tag information + call s:Tlist_Discard_TagInfo(fidx) + endif + + let s:tlist_{fidx}_valid = 1 + + " Exuberant ctags arguments to generate a tag list + let ctags_args = ' -f - --format=2 --excmd=pattern --fields=nks ' + + " Form the ctags argument depending on the sort type + if s:tlist_{fidx}_sort_type == 'name' + let ctags_args = ctags_args . '--sort=yes' + else + let ctags_args = ctags_args . '--sort=no' + endif + + " Add the filetype specific arguments + let ctags_args = ctags_args . ' ' . s:tlist_{a:ftype}_ctags_args + + " Ctags command to produce output with regexp for locating the tags + let ctags_cmd = g:Tlist_Ctags_Cmd . ctags_args + let ctags_cmd = ctags_cmd . ' "' . a:filename . '"' + + if &shellxquote == '"' + " Double-quotes within double-quotes will not work in the + " command-line.If the 'shellxquote' option is set to double-quotes, + " then escape the double-quotes in the ctags command-line. + let ctags_cmd = escape(ctags_cmd, '"') + endif + + " In Windows 95, if not using cygwin, disable the 'shellslash' + " option. Otherwise, this will cause problems when running the + " ctags command. + if has('win95') && !has('win32unix') + let old_shellslash = &shellslash + set noshellslash + endif + + if has('win32') && !has('win32unix') && !has('win95') + \ && (&shell =~ 'cmd.exe') + " Windows does not correctly deal with commands that have more than 1 + " set of double quotes. It will strip them all resulting in: + " 'C:\Program' is not recognized as an internal or external command + " operable program or batch file. To work around this, place the + " command inside a batch file and call the batch file. + " Do this only on Win2K, WinXP and above. + " Contributed by: David Fishburn. + let s:taglist_tempfile = fnamemodify(tempname(), ':h') . + \ '\taglist.cmd' + exe 'redir! > ' . s:taglist_tempfile + silent echo ctags_cmd + redir END + + call s:Tlist_Log_Msg('Cmd inside batch file: ' . ctags_cmd) + let ctags_cmd = '"' . s:taglist_tempfile . '"' + endif + + call s:Tlist_Log_Msg('Cmd: ' . ctags_cmd) + + " Run ctags and get the tag list + let cmd_output = system(ctags_cmd) + + " Restore the value of the 'shellslash' option. + if has('win95') && !has('win32unix') + let &shellslash = old_shellslash + endif + + if exists('s:taglist_tempfile') + " Delete the temporary cmd file created on MS-Windows + call delete(s:taglist_tempfile) + endif + + " Handle errors + if v:shell_error + let msg = "Taglist: Failed to generate tags for " . a:filename + call s:Tlist_Warning_Msg(msg) + if cmd_output != '' + call s:Tlist_Warning_Msg(cmd_output) + endif + return fidx + endif + + " Store the modification time for the file + let s:tlist_{fidx}_mtime = getftime(a:filename) + + " No tags for current file + if cmd_output == '' + call s:Tlist_Log_Msg('No tags defined in ' . a:filename) + return fidx + endif + + call s:Tlist_Log_Msg('Generated tags information for ' . a:filename) + + if v:version > 601 + " The following script local variables are used by the + " Tlist_Parse_Tagline() function. + let s:ctags_flags = s:tlist_{a:ftype}_ctags_flags + let s:fidx = fidx + let s:tidx = 0 + + " Process the ctags output one line at a time. The substitute() + " command is used to parse the tag lines instead of using the + " matchstr()/stridx()/strpart() functions for performance reason + call substitute(cmd_output, "\\([^\n]\\+\\)\n", + \ '\=s:Tlist_Parse_Tagline(submatch(1))', 'g') + + " Save the number of tags for this file + let s:tlist_{fidx}_tag_count = s:tidx + + " The following script local variables are no longer needed + unlet! s:ctags_flags + unlet! s:tidx + unlet! s:fidx + else + " Due to a bug in Vim earlier than version 6.1, + " we cannot use substitute() to parse the ctags output. + " Instead the slow str*() functions are used + let ctags_flags = s:tlist_{a:ftype}_ctags_flags + let tidx = 0 + + while cmd_output != '' + " Extract one line at a time + let idx = stridx(cmd_output, "\n") + let one_line = strpart(cmd_output, 0, idx) + " Remove the line from the tags output + let cmd_output = strpart(cmd_output, idx + 1) + + if one_line == '' + " Line is not in proper tags format + continue + endif + + " Extract the tag type + let ttype = s:Tlist_Extract_Tagtype(one_line) + + " Make sure the tag type is a valid and supported one + if ttype == '' || stridx(ctags_flags, ttype) == -1 + " Line is not in proper tags format or Tag type is not + " supported + continue + endif + + " Update the total tag count + let tidx = tidx + 1 + + " The following variables are used to optimize this code. Vim is + " slow in using curly brace names. To reduce the amount of + " processing needed, the curly brace variables are pre-processed + " here + let fidx_tidx = 's:tlist_' . fidx . '_' . tidx + let fidx_ttype = 's:tlist_' . fidx . '_' . ttype + + " Update the count of this tag type + let ttype_idx = {fidx_ttype}_count + 1 + let {fidx_ttype}_count = ttype_idx + + " Store the ctags output for this tag + let {fidx_tidx}_tag = one_line + + " Store the tag index and the tag type index (back pointers) + let {fidx_ttype}_{ttype_idx} = tidx + let {fidx_tidx}_ttype_idx = ttype_idx + + " Extract the tag name + let tag_name = strpart(one_line, 0, stridx(one_line, "\t")) + + " Extract the tag scope/prototype + if g:Tlist_Display_Prototype + let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(fidx, tidx) + else + let ttxt = ' ' . tag_name + + " Add the tag scope, if it is available and is configured. Tag + " scope is the last field after the 'line:<num>\t' field + if g:Tlist_Display_Tag_Scope + let tag_scope = s:Tlist_Extract_Tag_Scope(one_line) + if tag_scope != '' + let ttxt = ttxt . ' [' . tag_scope . ']' + endif + endif + endif + + " Add this tag to the tag type variable + let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" + + " Save the tag name + let {fidx_tidx}_tag_name = tag_name + endwhile + + " Save the number of tags for this file + let s:tlist_{fidx}_tag_count = tidx + endif + + call s:Tlist_Log_Msg('Processed ' . s:tlist_{fidx}_tag_count . + \ ' tags in ' . a:filename) + + return fidx +endfunction + +" Tlist_Update_File +" Update the tags for a file (if needed) +function! Tlist_Update_File(filename, ftype) + call s:Tlist_Log_Msg('Tlist_Update_File (' . a:filename . ')') + " If the file doesn't support tag listing, skip it + if s:Tlist_Skip_File(a:filename, a:ftype) + return + endif + + " Convert the file name to a full path + let fname = fnamemodify(a:filename, ':p') + + " First check whether the file already exists + let fidx = s:Tlist_Get_File_Index(fname) + + if fidx != -1 && s:tlist_{fidx}_valid + " File exists and the tags are valid + " Check whether the file was modified after the last tags update + " If it is modified, then update the tags + if s:tlist_{fidx}_mtime == getftime(fname) + return + endif + else + " If the tags were removed previously based on a user request, + " as we are going to update the tags (based on the user request), + " remove the filename from the deleted list + call s:Tlist_Update_Remove_List(fname, 0) + endif + + " If the taglist window is opened, update it + let winnum = bufwinnr(g:TagList_title) + if winnum == -1 + " Taglist window is not present. Just update the taglist + " and return + call s:Tlist_Process_File(fname, a:ftype) + else + if g:Tlist_Show_One_File && s:tlist_cur_file_idx != -1 + " If tags for only one file are displayed and we are not + " updating the tags for that file, then no need to + " refresh the taglist window. Otherwise, the taglist + " window should be updated. + if s:tlist_{s:tlist_cur_file_idx}_filename != fname + call s:Tlist_Process_File(fname, a:ftype) + return + endif + endif + + " Save the current window number + let save_winnr = winnr() + + " Goto the taglist window + call s:Tlist_Window_Goto_Window() + + " Save the cursor position + let save_line = line('.') + let save_col = col('.') + + " Update the taglist window + call s:Tlist_Window_Refresh_File(fname, a:ftype) + + " Restore the cursor position + if v:version >= 601 + call cursor(save_line, save_col) + else + exe save_line + exe 'normal! ' . save_col . '|' + endif + + if winnr() != save_winnr + " Go back to the original window + call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') + endif + endif + + " Update the taglist menu + if g:Tlist_Show_Menu + call s:Tlist_Menu_Update_File(1) + endif +endfunction + +" Tlist_Window_Close +" Close the taglist window +function! s:Tlist_Window_Close() + call s:Tlist_Log_Msg('Tlist_Window_Close()') + " Make sure the taglist window exists + let winnum = bufwinnr(g:TagList_title) + if winnum == -1 + call s:Tlist_Warning_Msg('Error: Taglist window is not open') + return + endif + + if winnr() == winnum + " Already in the taglist window. Close it and return + if winbufnr(2) != -1 + " If a window other than the taglist window is open, + " then only close the taglist window. + close + endif + else + " Goto the taglist window, close it and then come back to the + " original window + let curbufnr = bufnr('%') + exe winnum . 'wincmd w' + close + " Need to jump back to the original window only if we are not + " already in that window + let winnum = bufwinnr(curbufnr) + if winnr() != winnum + exe winnum . 'wincmd w' + endif + endif +endfunction + +" Tlist_Window_Mark_File_Window +" Mark the current window as the file window to use when jumping to a tag. +" Only if the current window is a non-plugin, non-preview and non-taglist +" window +function! s:Tlist_Window_Mark_File_Window() + if getbufvar('%', '&buftype') == '' && !&previewwindow + let w:tlist_file_window = "yes" + endif +endfunction + +" Tlist_Window_Open +" Open and refresh the taglist window +function! s:Tlist_Window_Open() + call s:Tlist_Log_Msg('Tlist_Window_Open()') + " If the window is open, jump to it + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + " Jump to the existing window + if winnr() != winnum + exe winnum . 'wincmd w' + endif + return + endif + + if s:tlist_app_name == "winmanager" + " Taglist plugin is no longer part of the winmanager app + let s:tlist_app_name = "none" + endif + + " Get the filename and filetype for the specified buffer + let curbuf_name = fnamemodify(bufname('%'), ':p') + let curbuf_ftype = s:Tlist_Get_Buffer_Filetype('%') + let cur_lnum = line('.') + + " Mark the current window as the desired window to open a file when a tag + " is selected. + call s:Tlist_Window_Mark_File_Window() + + " Open the taglist window + call s:Tlist_Window_Create() + + call s:Tlist_Window_Refresh() + + if g:Tlist_Show_One_File + " Add only the current buffer and file + " + " If the file doesn't support tag listing, skip it + if !s:Tlist_Skip_File(curbuf_name, curbuf_ftype) + call s:Tlist_Window_Refresh_File(curbuf_name, curbuf_ftype) + endif + endif + + if g:Tlist_File_Fold_Auto_Close + " Open the fold for the current file, as all the folds in + " the taglist window are closed + let fidx = s:Tlist_Get_File_Index(curbuf_name) + if fidx != -1 + exe "silent! " . s:tlist_{fidx}_start . "," . + \ s:tlist_{fidx}_end . "foldopen!" + endif + endif + + " Highlight the current tag + call s:Tlist_Window_Highlight_Tag(curbuf_name, cur_lnum, 1, 1) +endfunction + +" Tlist_Window_Toggle() +" Open or close a taglist window +function! s:Tlist_Window_Toggle() + call s:Tlist_Log_Msg('Tlist_Window_Toggle()') + " If taglist window is open then close it. + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + call s:Tlist_Window_Close() + return + endif + + call s:Tlist_Window_Open() + + " Go back to the original window, if Tlist_GainFocus_On_ToggleOpen is not + " set + if !g:Tlist_GainFocus_On_ToggleOpen + call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') + endif + + " Update the taglist menu + if g:Tlist_Show_Menu + call s:Tlist_Menu_Update_File(0) + endif +endfunction + +" Tlist_Process_Filelist +" Process multiple files. Each filename is separated by "\n" +" Returns the number of processed files +function! s:Tlist_Process_Filelist(file_names) + let flist = a:file_names + + " Enable lazy screen updates + let old_lazyredraw = &lazyredraw + set lazyredraw + + " Keep track of the number of processed files + let fcnt = 0 + + " Process one file at a time + while flist != '' + let nl_idx = stridx(flist, "\n") + let one_file = strpart(flist, 0, nl_idx) + + " Remove the filename from the list + let flist = strpart(flist, nl_idx + 1) + + if one_file == '' + continue + endif + + " Skip directories + if isdirectory(one_file) + continue + endif + + let ftype = s:Tlist_Detect_Filetype(one_file) + + echon "\r " + echon "\rProcessing tags for " . fnamemodify(one_file, ':p:t') + + let fcnt = fcnt + 1 + + call Tlist_Update_File(one_file, ftype) + endwhile + + " Clear the displayed informational messages + echon "\r " + + " Restore the previous state + let &lazyredraw = old_lazyredraw + + return fcnt +endfunction + +" Tlist_Process_Dir +" Process the files in a directory matching the specified pattern +function! s:Tlist_Process_Dir(dir_name, pat) + let flist = glob(a:dir_name . '/' . a:pat) . "\n" + + let fcnt = s:Tlist_Process_Filelist(flist) + + let len = strlen(a:dir_name) + if a:dir_name[len - 1] == '\' || a:dir_name[len - 1] == '/' + let glob_expr = a:dir_name . '*' + else + let glob_expr = a:dir_name . '/*' + endif + let all_files = glob(glob_expr) . "\n" + + while all_files != '' + let nl_idx = stridx(all_files, "\n") + let one_file = strpart(all_files, 0, nl_idx) + + let all_files = strpart(all_files, nl_idx + 1) + if one_file == '' + continue + endif + + " Skip non-directory names + if !isdirectory(one_file) + continue + endif + + echon "\r " + echon "\rProcessing files in directory " . fnamemodify(one_file, ':t') + let fcnt = fcnt + s:Tlist_Process_Dir(one_file, a:pat) + endwhile + + return fcnt +endfunction + +" Tlist_Add_Files_Recursive +" Add files recursively from a directory +function! s:Tlist_Add_Files_Recursive(dir, ...) + let dir_name = fnamemodify(a:dir, ':p') + if !isdirectory(dir_name) + call s:Tlist_Warning_Msg('Error: ' . dir_name . ' is not a directory') + return + endif + + if a:0 == 1 + " User specified file pattern + let pat = a:1 + else + " Default file pattern + let pat = '*' + endif + + echon "\r " + echon "\rProcessing files in directory " . fnamemodify(dir_name, ':t') + let fcnt = s:Tlist_Process_Dir(dir_name, pat) + + echon "\rAdded " . fcnt . " files to the taglist" +endfunction + +" Tlist_Add_Files +" Add the specified list of files to the taglist +function! s:Tlist_Add_Files(...) + let flist = '' + let i = 1 + + " Get all the files matching the file patterns supplied as argument + while i <= a:0 + let flist = flist . glob(a:{i}) . "\n" + let i = i + 1 + endwhile + + if flist == '' + call s:Tlist_Warning_Msg('Error: No matching files are found') + return + endif + + let fcnt = s:Tlist_Process_Filelist(flist) + echon "\rAdded " . fcnt . " files to the taglist" +endfunction + +" Tlist_Extract_Tagtype +" Extract the tag type from the tag text +function! s:Tlist_Extract_Tagtype(tag_line) + " The tag type is after the tag prototype field. The prototype field + " ends with the /;"\t string. We add 4 at the end to skip the characters + " in this special string.. + let start = strridx(a:tag_line, '/;"' . "\t") + 4 + let end = strridx(a:tag_line, 'line:') - 1 + let ttype = strpart(a:tag_line, start, end - start) + + return ttype +endfunction + +" Tlist_Extract_Tag_Scope +" Extract the tag scope from the tag text +function! s:Tlist_Extract_Tag_Scope(tag_line) + let start = strridx(a:tag_line, 'line:') + let end = strridx(a:tag_line, "\t") + if end <= start + return '' + endif + + let tag_scope = strpart(a:tag_line, end + 1) + let tag_scope = strpart(tag_scope, stridx(tag_scope, ':') + 1) + + return tag_scope +endfunction + +" Tlist_Refresh() +" Refresh the taglist +function! s:Tlist_Refresh() + call s:Tlist_Log_Msg('Tlist_Refresh (Skip_Refresh = ' . + \ s:Tlist_Skip_Refresh . ', ' . bufname('%') . ')') + " If we are entering the buffer from one of the taglist functions, then + " no need to refresh the taglist window again. + if s:Tlist_Skip_Refresh + " We still need to update the taglist menu + if g:Tlist_Show_Menu + call s:Tlist_Menu_Update_File(0) + endif + return + endif + + " If part of the winmanager plugin and not configured to process + " tags always and not configured to display the tags menu, then return + if (s:tlist_app_name == 'winmanager') && !g:Tlist_Process_File_Always + \ && !g:Tlist_Show_Menu + return + endif + + " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help + if &buftype != '' + return + endif + + let filename = fnamemodify(bufname('%'), ':p') + let ftype = s:Tlist_Get_Buffer_Filetype('%') + + " If the file doesn't support tag listing, skip it + if s:Tlist_Skip_File(filename, ftype) + return + endif + + let tlist_win = bufwinnr(g:TagList_title) + + " If the taglist window is not opened and not configured to process + " tags always and not displaying the tags menu, then return + if tlist_win == -1 && !g:Tlist_Process_File_Always && !g:Tlist_Show_Menu + return + endif + + let fidx = s:Tlist_Get_File_Index(filename) + if fidx == -1 + " Check whether this file is removed based on user request + " If it is, then don't display the tags for this file + if s:Tlist_User_Removed_File(filename) + return + endif + + " If the taglist should not be auto updated, then return + if !g:Tlist_Auto_Update + return + endif + endif + + let cur_lnum = line('.') + + if fidx == -1 + " Update the tags for the file + let fidx = s:Tlist_Process_File(filename, ftype) + else + let mtime = getftime(filename) + if s:tlist_{fidx}_mtime != mtime + " Invalidate the tags listed for this file + let s:tlist_{fidx}_valid = 0 + + " Update the taglist and the window + call Tlist_Update_File(filename, ftype) + + " Store the new file modification time + let s:tlist_{fidx}_mtime = mtime + endif + endif + + " Update the taglist window + if tlist_win != -1 + " Disable screen updates + let old_lazyredraw = &lazyredraw + set nolazyredraw + + " Save the current window number + let save_winnr = winnr() + + " Goto the taglist window + call s:Tlist_Window_Goto_Window() + + if !g:Tlist_Auto_Highlight_Tag || !g:Tlist_Highlight_Tag_On_BufEnter + " Save the cursor position + let save_line = line('.') + let save_col = col('.') + endif + + " Update the taglist window + call s:Tlist_Window_Refresh_File(filename, ftype) + + " Open the fold for the file + exe "silent! " . s:tlist_{fidx}_start . "," . + \ s:tlist_{fidx}_end . "foldopen!" + + if g:Tlist_Highlight_Tag_On_BufEnter && g:Tlist_Auto_Highlight_Tag + if g:Tlist_Show_One_File && s:tlist_cur_file_idx != fidx + " If displaying tags for only one file in the taglist + " window and about to display the tags for a new file, + " then center the current tag line for the new file + let center_tag_line = 1 + else + let center_tag_line = 0 + endif + + " Highlight the current tag + call s:Tlist_Window_Highlight_Tag(filename, cur_lnum, 1, center_tag_line) + else + " Restore the cursor position + if v:version >= 601 + call cursor(save_line, save_col) + else + exe save_line + exe 'normal! ' . save_col . '|' + endif + endif + + " Jump back to the original window + if save_winnr != winnr() + call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') + endif + + " Restore screen updates + let &lazyredraw = old_lazyredraw + endif + + " Update the taglist menu + if g:Tlist_Show_Menu + call s:Tlist_Menu_Update_File(0) + endif +endfunction + +" Tlist_Change_Sort() +" Change the sort order of the tag listing +" caller == 'cmd', command used in the taglist window +" caller == 'menu', taglist menu +" action == 'toggle', toggle sort from name to order and vice versa +" action == 'set', set the sort order to sort_type +function! s:Tlist_Change_Sort(caller, action, sort_type) + call s:Tlist_Log_Msg('Tlist_Change_Sort (caller = ' . a:caller . + \ ', action = ' . a:action . ', sort_type = ' . a:sort_type . ')') + if a:caller == 'cmd' + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) + if fidx == -1 + return + endif + + " Remove the previous highlighting + match none + elseif a:caller == 'menu' + let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) + if fidx == -1 + return + endif + endif + + if a:action == 'toggle' + let sort_type = s:tlist_{fidx}_sort_type + + " Toggle the sort order from 'name' to 'order' and vice versa + if sort_type == 'name' + let s:tlist_{fidx}_sort_type = 'order' + else + let s:tlist_{fidx}_sort_type = 'name' + endif + else + let s:tlist_{fidx}_sort_type = a:sort_type + endif + + " Invalidate the tags listed for this file + let s:tlist_{fidx}_valid = 0 + + if a:caller == 'cmd' + " Save the current line for later restoration + let curline = '\V\^' . getline('.') . '\$' + + call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, + \ s:tlist_{fidx}_filetype) + + exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' + + " Go back to the cursor line before the tag list is sorted + call search(curline, 'w') + + call s:Tlist_Menu_Update_File(1) + else + call s:Tlist_Menu_Remove_File() + + call s:Tlist_Refresh() + endif +endfunction + +" Tlist_Update_Current_File() +" Update taglist for the current buffer by regenerating the tag list +" Contributed by WEN Guopeng. +function! s:Tlist_Update_Current_File() + call s:Tlist_Log_Msg('Tlist_Update_Current_File()') + if winnr() == bufwinnr(g:TagList_title) + " In the taglist window. Update the current file + call s:Tlist_Window_Update_File() + else + " Not in the taglist window. Update the current buffer + let filename = fnamemodify(bufname('%'), ':p') + let fidx = s:Tlist_Get_File_Index(filename) + if fidx != -1 + let s:tlist_{fidx}_valid = 0 + endif + let ft = s:Tlist_Get_Buffer_Filetype('%') + call Tlist_Update_File(filename, ft) + endif +endfunction + +" Tlist_Window_Update_File() +" Update the tags displayed in the taglist window +function! s:Tlist_Window_Update_File() + call s:Tlist_Log_Msg('Tlist_Window_Update_File()') + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) + if fidx == -1 + return + endif + + " Remove the previous highlighting + match none + + " Save the current line for later restoration + let curline = '\V\^' . getline('.') . '\$' + + let s:tlist_{fidx}_valid = 0 + + " Update the taglist window + call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, + \ s:tlist_{fidx}_filetype) + + exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' + + " Go back to the tag line before the list is updated + call search(curline, 'w') +endfunction + +" Tlist_Window_Get_Tag_Type_By_Linenum() +" Return the tag type index for the specified line in the taglist window +function! s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) + let ftype = s:tlist_{a:fidx}_filetype + + " Determine to which tag type the current line number belongs to using the + " tag type start line number and the number of tags in a tag type + let i = 1 + while i <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{i}_name + let start_lnum = + \ s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset + let end = start_lnum + s:tlist_{a:fidx}_{ttype}_count + if a:lnum >= start_lnum && a:lnum <= end + break + endif + let i = i + 1 + endwhile + + " Current line doesn't belong to any of the displayed tag types + if i > s:tlist_{ftype}_count + return '' + endif + + return ttype +endfunction + +" Tlist_Window_Get_Tag_Index() +" Return the tag index for the specified line in the taglist window +function! s:Tlist_Window_Get_Tag_Index(fidx, lnum) + let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(a:fidx, a:lnum) + + " Current line doesn't belong to any of the displayed tag types + if ttype == '' + return 0 + endif + + " Compute the index into the displayed tags for the tag type + let ttype_lnum = s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset + let tidx = a:lnum - ttype_lnum + if tidx == 0 + return 0 + endif + + " Get the corresponding tag line and return it + return s:tlist_{a:fidx}_{ttype}_{tidx} +endfunction + +" Tlist_Window_Highlight_Line +" Highlight the current line +function! s:Tlist_Window_Highlight_Line() + " Clear previously selected name + match none + + " Highlight the current line + if g:Tlist_Display_Prototype == 0 + let pat = '/\%' . line('.') . 'l\s\+\zs.*/' + else + let pat = '/\%' . line('.') . 'l.*/' + endif + + exe 'match TagListTagName ' . pat +endfunction + +" Tlist_Window_Open_File +" Open the specified file in either a new window or an existing window +" and place the cursor at the specified tag pattern +function! s:Tlist_Window_Open_File(win_ctrl, filename, tagpat) + call s:Tlist_Log_Msg('Tlist_Window_Open_File (' . a:filename . ',' . + \ a:win_ctrl . ')') + let prev_Tlist_Skip_Refresh = s:Tlist_Skip_Refresh + let s:Tlist_Skip_Refresh = 1 + + if s:tlist_app_name == "winmanager" + " Let the winmanager edit the file + call WinManagerFileEdit(a:filename, a:win_ctrl == 'newwin') + else + + if a:win_ctrl == 'newtab' + " Create a new tab + exe 'tabnew ' . escape(a:filename, ' ') + " Open the taglist window in the new tab + call s:Tlist_Window_Open() + endif + + if a:win_ctrl == 'checktab' + " Check whether the file is present in any of the tabs. + " If the file is present in the current tab, then use the + " current tab. + if bufwinnr(a:filename) != -1 + let file_present_in_tab = 1 + let i = tabpagenr() + else + let i = 1 + let bnum = bufnr(a:filename) + let file_present_in_tab = 0 + while i <= tabpagenr('$') + if index(tabpagebuflist(i), bnum) != -1 + let file_present_in_tab = 1 + break + endif + let i += 1 + endwhile + endif + + if file_present_in_tab + " Goto the tab containing the file + exe 'tabnext ' . i + else + " Open a new tab + exe 'tabnew ' . escape(a:filename, ' ') + + " Open the taglist window + call s:Tlist_Window_Open() + endif + endif + + let winnum = -1 + if a:win_ctrl == 'prevwin' + " Open the file in the previous window, if it is usable + let cur_win = winnr() + wincmd p + if &buftype == '' && !&previewwindow + exe "edit " . escape(a:filename, ' ') + let winnum = winnr() + else + " Previous window is not usable + exe cur_win . 'wincmd w' + endif + endif + + " Goto the window containing the file. If the window is not there, open a + " new window + if winnum == -1 + let winnum = bufwinnr(a:filename) + endif + + if winnum == -1 + " Locate the previously used window for opening a file + let fwin_num = 0 + let first_usable_win = 0 + + let i = 1 + let bnum = winbufnr(i) + while bnum != -1 + if getwinvar(i, 'tlist_file_window') == 'yes' + let fwin_num = i + break + endif + if first_usable_win == 0 && + \ getbufvar(bnum, '&buftype') == '' && + \ !getwinvar(i, '&previewwindow') + " First non-taglist, non-plugin and non-preview window + let first_usable_win = i + endif + let i = i + 1 + let bnum = winbufnr(i) + endwhile + + " If a previously used window is not found, then use the first + " non-taglist window + if fwin_num == 0 + let fwin_num = first_usable_win + endif + + if fwin_num != 0 + " Jump to the file window + exe fwin_num . "wincmd w" + + " If the user asked to jump to the tag in a new window, then split + " the existing window into two. + if a:win_ctrl == 'newwin' + split + endif + exe "edit " . escape(a:filename, ' ') + else + " Open a new window + if g:Tlist_Use_Horiz_Window + exe 'leftabove split ' . escape(a:filename, ' ') + else + if winbufnr(2) == -1 + " Only the taglist window is present + if g:Tlist_Use_Right_Window + exe 'leftabove vertical split ' . + \ escape(a:filename, ' ') + else + exe 'rightbelow vertical split ' . + \ escape(a:filename, ' ') + endif + + " Go to the taglist window to change the window size to + " the user configured value + call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') + if g:Tlist_Use_Horiz_Window + exe 'resize ' . g:Tlist_WinHeight + else + exe 'vertical resize ' . g:Tlist_WinWidth + endif + " Go back to the file window + call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') + else + " A plugin or help window is also present + wincmd w + exe 'leftabove split ' . escape(a:filename, ' ') + endif + endif + endif + " Mark the window, so that it can be reused. + call s:Tlist_Window_Mark_File_Window() + else + if v:version >= 700 + " If the file is opened in more than one window, then check + " whether the last accessed window has the selected file. + " If it does, then use that window. + let lastwin_bufnum = winbufnr(winnr('#')) + if bufnr(a:filename) == lastwin_bufnum + let winnum = winnr('#') + endif + endif + exe winnum . 'wincmd w' + + " If the user asked to jump to the tag in a new window, then split the + " existing window into two. + if a:win_ctrl == 'newwin' + split + endif + endif + endif + + " Jump to the tag + if a:tagpat != '' + " Add the current cursor position to the jump list, so that user can + " jump back using the ' and ` marks. + mark ' + silent call search(a:tagpat, 'w') + + " Bring the line to the middle of the window + normal! z. + + " If the line is inside a fold, open the fold + if foldclosed('.') != -1 + .foldopen + endif + endif + + " If the user selects to preview the tag then jump back to the + " taglist window + if a:win_ctrl == 'preview' + " Go back to the taglist window + let winnum = bufwinnr(g:TagList_title) + exe winnum . 'wincmd w' + else + " If the user has selected to close the taglist window, when a + " tag is selected, close the taglist window + if g:Tlist_Close_On_Select + call s:Tlist_Window_Goto_Window() + close + + " Go back to the window displaying the selected file + let wnum = bufwinnr(a:filename) + if wnum != -1 && wnum != winnr() + call s:Tlist_Exe_Cmd_No_Acmds(wnum . 'wincmd w') + endif + endif + endif + + let s:Tlist_Skip_Refresh = prev_Tlist_Skip_Refresh +endfunction + +" Tlist_Window_Jump_To_Tag() +" Jump to the location of the current tag +" win_ctrl == useopen - Reuse the existing file window +" win_ctrl == newwin - Open a new window +" win_ctrl == preview - Preview the tag +" win_ctrl == prevwin - Open in previous window +" win_ctrl == newtab - Open in new tab +function! s:Tlist_Window_Jump_To_Tag(win_ctrl) + call s:Tlist_Log_Msg('Tlist_Window_Jump_To_Tag(' . a:win_ctrl . ')') + " Do not process comment lines and empty lines + let curline = getline('.') + if curline =~ '^\s*$' || curline[0] == '"' + return + endif + + " If inside a closed fold, then use the first line of the fold + " and jump to the file. + let lnum = foldclosed('.') + if lnum == -1 + " Jump to the selected tag or file + let lnum = line('.') + else + " Open the closed fold + .foldopen! + endif + + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) + if fidx == -1 + return + endif + + " Get the tag output for the current tag + let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) + if tidx != 0 + let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, tidx) + + " Highlight the tagline + call s:Tlist_Window_Highlight_Line() + else + " Selected a line which is not a tag name. Just edit the file + let tagpat = '' + endif + + call s:Tlist_Window_Open_File(a:win_ctrl, s:tlist_{fidx}_filename, tagpat) +endfunction + +" Tlist_Window_Show_Info() +" Display information about the entry under the cursor +function! s:Tlist_Window_Show_Info() + call s:Tlist_Log_Msg('Tlist_Window_Show_Info()') + + " Clear the previously displayed line + echo + + " Do not process comment lines and empty lines + let curline = getline('.') + if curline =~ '^\s*$' || curline[0] == '"' + return + endif + + " If inside a fold, then don't display the prototype + if foldclosed('.') != -1 + return + endif + + let lnum = line('.') + + " Get the file index + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) + if fidx == -1 + return + endif + + if lnum == s:tlist_{fidx}_start + " Cursor is on a file name + let fname = s:tlist_{fidx}_filename + if strlen(fname) > 50 + let fname = fnamemodify(fname, ':t') + endif + echo fname . ', Filetype=' . s:tlist_{fidx}_filetype . + \ ', Tag count=' . s:tlist_{fidx}_tag_count + return + endif + + " Get the tag output line for the current tag + let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) + if tidx == 0 + " Cursor is on a tag type + let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) + if ttype == '' + return + endif + + let ttype_name = '' + + let ftype = s:tlist_{fidx}_filetype + let i = 1 + while i <= s:tlist_{ftype}_count + if ttype == s:tlist_{ftype}_{i}_name + let ttype_name = s:tlist_{ftype}_{i}_fullname + break + endif + let i = i + 1 + endwhile + + echo 'Tag type=' . ttype_name . + \ ', Tag count=' . s:tlist_{fidx}_{ttype}_count + return + endif + + " Get the tag search pattern and display it + echo s:Tlist_Get_Tag_Prototype(fidx, tidx) +endfunction + +" Tlist_Find_Nearest_Tag_Idx +" Find the tag idx nearest to the supplied line number +" Returns -1, if a tag couldn't be found for the specified line number +function! s:Tlist_Find_Nearest_Tag_Idx(fidx, linenum) + let sort_type = s:tlist_{a:fidx}_sort_type + + let left = 1 + let right = s:tlist_{a:fidx}_tag_count + + if sort_type == 'order' + " Tags sorted by order, use a binary search. + " The idea behind this function is taken from the ctags.vim script (by + " Alexey Marinichev) available at the Vim online website. + + " If the current line is the less than the first tag, then no need to + " search + let first_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, 1) + + if a:linenum < first_lnum + return -1 + endif + + while left < right + let middle = (right + left + 1) / 2 + let middle_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, middle) + + if middle_lnum == a:linenum + let left = middle + break + endif + + if middle_lnum > a:linenum + let right = middle - 1 + else + let left = middle + endif + endwhile + else + " Tags sorted by name, use a linear search. (contributed by Dave + " Eggum). + " Look for a tag with a line number less than or equal to the supplied + " line number. If multiple tags are found, then use the tag with the + " line number closest to the supplied line number. IOW, use the tag + " with the highest line number. + let closest_lnum = 0 + let final_left = 0 + while left <= right + let lnum = s:Tlist_Get_Tag_Linenum(a:fidx, left) + + if lnum < a:linenum && lnum > closest_lnum + let closest_lnum = lnum + let final_left = left + elseif lnum == a:linenum + let closest_lnum = lnum + let final_left = left + break + else + let left = left + 1 + endif + endwhile + if closest_lnum == 0 + return -1 + endif + if left >= right + let left = final_left + endif + endif + + return left +endfunction + +" Tlist_Window_Highlight_Tag() +" Highlight the current tag +" cntx == 1, Called by the taglist plugin itself +" cntx == 2, Forced by the user through the TlistHighlightTag command +" center = 1, move the tag line to the center of the taglist window +function! s:Tlist_Window_Highlight_Tag(filename, cur_lnum, cntx, center) + " Highlight the current tag only if the user configured the + " taglist plugin to do so or if the user explictly invoked the + " command to highlight the current tag. + if !g:Tlist_Auto_Highlight_Tag && a:cntx == 1 + return + endif + + if a:filename == '' + return + endif + + " Make sure the taglist window is present + let winnum = bufwinnr(g:TagList_title) + if winnum == -1 + call s:Tlist_Warning_Msg('Error: Taglist window is not open') + return + endif + + let fidx = s:Tlist_Get_File_Index(a:filename) + if fidx == -1 + return + endif + + " If the file is currently not displayed in the taglist window, then retrn + if !s:tlist_{fidx}_visible + return + endif + + " If there are no tags for this file, then no need to proceed further + if s:tlist_{fidx}_tag_count == 0 + return + endif + + " Ignore all autocommands + let old_ei = &eventignore + set eventignore=all + + " Save the original window number + let org_winnr = winnr() + + if org_winnr == winnum + let in_taglist_window = 1 + else + let in_taglist_window = 0 + endif + + " Go to the taglist window + if !in_taglist_window + exe winnum . 'wincmd w' + endif + + " Clear previously selected name + match none + + let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, a:cur_lnum) + if tidx == -1 + " Make sure the current tag line is visible in the taglist window. + " Calling the winline() function makes the line visible. Don't know + " of a better way to achieve this. + let lnum = line('.') + + if lnum < s:tlist_{fidx}_start || lnum > s:tlist_{fidx}_end + " Move the cursor to the beginning of the file + exe s:tlist_{fidx}_start + endif + + if foldclosed('.') != -1 + .foldopen + endif + + call winline() + + if !in_taglist_window + exe org_winnr . 'wincmd w' + endif + + " Restore the autocommands + let &eventignore = old_ei + return + endif + + " Extract the tag type + let ttype = s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) + + " Compute the line number + " Start of file + Start of tag type + offset + let lnum = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset + + \ s:tlist_{fidx}_{tidx}_ttype_idx + + " Goto the line containing the tag + exe lnum + + " Open the fold + if foldclosed('.') != -1 + .foldopen + endif + + if a:center + " Move the tag line to the center of the taglist window + normal! z. + else + " Make sure the current tag line is visible in the taglist window. + " Calling the winline() function makes the line visible. Don't know + " of a better way to achieve this. + call winline() + endif + + " Highlight the tag name + call s:Tlist_Window_Highlight_Line() + + " Go back to the original window + if !in_taglist_window + exe org_winnr . 'wincmd w' + endif + + " Restore the autocommands + let &eventignore = old_ei + return +endfunction + +" Tlist_Get_Tag_Prototype_By_Line +" Get the prototype for the tag on or before the specified line number in the +" current buffer +function! Tlist_Get_Tag_Prototype_By_Line(...) + if a:0 == 0 + " Arguments are not supplied. Use the current buffer name + " and line number + let filename = bufname('%') + let linenr = line('.') + elseif a:0 == 2 + " Filename and line number are specified + let filename = a:1 + let linenr = a:2 + if linenr !~ '\d\+' + " Invalid line number + return "" + endif + else + " Sufficient arguments are not supplied + let msg = 'Usage: Tlist_Get_Tag_Prototype_By_Line <filename> ' . + \ '<line_number>' + call s:Tlist_Warning_Msg(msg) + return "" + endif + + " Expand the file to a fully qualified name + let filename = fnamemodify(filename, ':p') + if filename == '' + return "" + endif + + let fidx = s:Tlist_Get_File_Index(filename) + if fidx == -1 + return "" + endif + + " If there are no tags for this file, then no need to proceed further + if s:tlist_{fidx}_tag_count == 0 + return "" + endif + + " Get the tag text using the line number + let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) + if tidx == -1 + return "" + endif + + return s:Tlist_Get_Tag_Prototype(fidx, tidx) +endfunction + +" Tlist_Get_Tagname_By_Line +" Get the tag name on or before the specified line number in the +" current buffer +function! Tlist_Get_Tagname_By_Line(...) + if a:0 == 0 + " Arguments are not supplied. Use the current buffer name + " and line number + let filename = bufname('%') + let linenr = line('.') + elseif a:0 == 2 + " Filename and line number are specified + let filename = a:1 + let linenr = a:2 + if linenr !~ '\d\+' + " Invalid line number + return "" + endif + else + " Sufficient arguments are not supplied + let msg = 'Usage: Tlist_Get_Tagname_By_Line <filename> <line_number>' + call s:Tlist_Warning_Msg(msg) + return "" + endif + + " Make sure the current file has a name + let filename = fnamemodify(filename, ':p') + if filename == '' + return "" + endif + + let fidx = s:Tlist_Get_File_Index(filename) + if fidx == -1 + return "" + endif + + " If there are no tags for this file, then no need to proceed further + if s:tlist_{fidx}_tag_count == 0 + return "" + endif + + " Get the tag name using the line number + let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) + if tidx == -1 + return "" + endif + + return s:tlist_{fidx}_{tidx}_tag_name +endfunction + +" Tlist_Window_Move_To_File +" Move the cursor to the beginning of the current file or the next file +" or the previous file in the taglist window +" dir == -1, move to start of current or previous function +" dir == 1, move to start of next function +function! s:Tlist_Window_Move_To_File(dir) + if foldlevel('.') == 0 + " Cursor is on a non-folded line (it is not in any of the files) + " Move it to a folded line + if a:dir == -1 + normal! zk + else + " While moving down to the start of the next fold, + " no need to do go to the start of the next file. + normal! zj + return + endif + endif + + let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) + if fidx == -1 + return + endif + + let cur_lnum = line('.') + + if a:dir == -1 + if cur_lnum > s:tlist_{fidx}_start + " Move to the beginning of the current file + exe s:tlist_{fidx}_start + return + endif + + if fidx != 0 + " Move to the beginning of the previous file + let fidx = fidx - 1 + else + " Cursor is at the first file, wrap around to the last file + let fidx = s:tlist_file_count - 1 + endif + + exe s:tlist_{fidx}_start + return + else + " Move to the beginning of the next file + let fidx = fidx + 1 + + if fidx >= s:tlist_file_count + " Cursor is at the last file, wrap around to the first file + let fidx = 0 + endif + + if s:tlist_{fidx}_start != 0 + exe s:tlist_{fidx}_start + endif + return + endif +endfunction + +" Tlist_Session_Load +" Load a taglist session (information about all the displayed files +" and the tags) from the specified file +function! s:Tlist_Session_Load(...) + if a:0 == 0 || a:1 == '' + call s:Tlist_Warning_Msg('Usage: TlistSessionLoad <filename>') + return + endif + + let sessionfile = a:1 + + if !filereadable(sessionfile) + let msg = 'Taglist: Error - Unable to open file ' . sessionfile + call s:Tlist_Warning_Msg(msg) + return + endif + + " Mark the current window as the file window + call s:Tlist_Window_Mark_File_Window() + + " Source the session file + exe 'source ' . sessionfile + + let new_file_count = g:tlist_file_count + unlet! g:tlist_file_count + + let i = 0 + while i < new_file_count + let ftype = g:tlist_{i}_filetype + unlet! g:tlist_{i}_filetype + + if !exists('s:tlist_' . ftype . '_count') + if s:Tlist_FileType_Init(ftype) == 0 + let i = i + 1 + continue + endif + endif + + let fname = g:tlist_{i}_filename + unlet! g:tlist_{i}_filename + + let fidx = s:Tlist_Get_File_Index(fname) + if fidx != -1 + let s:tlist_{fidx}_visible = 0 + let i = i + 1 + continue + else + " As we are loading the tags from the session file, if this + " file was previously deleted by the user, now we need to + " add it back. So remove the file from the deleted list. + call s:Tlist_Update_Remove_List(fname, 0) + endif + + let fidx = s:Tlist_Init_File(fname, ftype) + + let s:tlist_{fidx}_filename = fname + + let s:tlist_{fidx}_sort_type = g:tlist_{i}_sort_type + unlet! g:tlist_{i}_sort_type + + let s:tlist_{fidx}_filetype = ftype + let s:tlist_{fidx}_mtime = getftime(fname) + + let s:tlist_{fidx}_start = 0 + let s:tlist_{fidx}_end = 0 + + let s:tlist_{fidx}_valid = 1 + + let s:tlist_{fidx}_tag_count = g:tlist_{i}_tag_count + unlet! g:tlist_{i}_tag_count + + let j = 1 + while j <= s:tlist_{fidx}_tag_count + let s:tlist_{fidx}_{j}_tag = g:tlist_{i}_{j}_tag + let s:tlist_{fidx}_{j}_tag_name = g:tlist_{i}_{j}_tag_name + let s:tlist_{fidx}_{j}_ttype_idx = g:tlist_{i}_{j}_ttype_idx + unlet! g:tlist_{i}_{j}_tag + unlet! g:tlist_{i}_{j}_tag_name + unlet! g:tlist_{i}_{j}_ttype_idx + let j = j + 1 + endwhile + + let j = 1 + while j <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{j}_name + + if exists('g:tlist_' . i . '_' . ttype) + let s:tlist_{fidx}_{ttype} = g:tlist_{i}_{ttype} + unlet! g:tlist_{i}_{ttype} + let s:tlist_{fidx}_{ttype}_offset = 0 + let s:tlist_{fidx}_{ttype}_count = g:tlist_{i}_{ttype}_count + unlet! g:tlist_{i}_{ttype}_count + + let k = 1 + while k <= s:tlist_{fidx}_{ttype}_count + let s:tlist_{fidx}_{ttype}_{k} = g:tlist_{i}_{ttype}_{k} + unlet! g:tlist_{i}_{ttype}_{k} + let k = k + 1 + endwhile + else + let s:tlist_{fidx}_{ttype} = '' + let s:tlist_{fidx}_{ttype}_offset = 0 + let s:tlist_{fidx}_{ttype}_count = 0 + endif + + let j = j + 1 + endwhile + + let i = i + 1 + endwhile + + " If the taglist window is open, then update it + let winnum = bufwinnr(g:TagList_title) + if winnum != -1 + let save_winnr = winnr() + + " Goto the taglist window + call s:Tlist_Window_Goto_Window() + + " Refresh the taglist window + call s:Tlist_Window_Refresh() + + " Go back to the original window + if save_winnr != winnr() + call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') + endif + endif +endfunction + +" Tlist_Session_Save +" Save a taglist session (information about all the displayed files +" and the tags) into the specified file +function! s:Tlist_Session_Save(...) + if a:0 == 0 || a:1 == '' + call s:Tlist_Warning_Msg('Usage: TlistSessionSave <filename>') + return + endif + + let sessionfile = a:1 + + if s:tlist_file_count == 0 + " There is nothing to save + call s:Tlist_Warning_Msg('Warning: Taglist is empty. Nothing to save.') + return + endif + + if filereadable(sessionfile) + let ans = input('Do you want to overwrite ' . sessionfile . ' (Y/N)?') + if ans !=? 'y' + return + endif + + echo "\n" + endif + + let old_verbose = &verbose + set verbose&vim + + exe 'redir! > ' . sessionfile + + silent! echo '" Taglist session file. This file is auto-generated.' + silent! echo '" File information' + silent! echo 'let tlist_file_count = ' . s:tlist_file_count + + let i = 0 + + while i < s:tlist_file_count + " Store information about the file + silent! echo 'let tlist_' . i . "_filename = '" . + \ s:tlist_{i}_filename . "'" + silent! echo 'let tlist_' . i . '_sort_type = "' . + \ s:tlist_{i}_sort_type . '"' + silent! echo 'let tlist_' . i . '_filetype = "' . + \ s:tlist_{i}_filetype . '"' + silent! echo 'let tlist_' . i . '_tag_count = ' . + \ s:tlist_{i}_tag_count + " Store information about all the tags + let j = 1 + while j <= s:tlist_{i}_tag_count + let txt = escape(s:tlist_{i}_{j}_tag, '"\\') + silent! echo 'let tlist_' . i . '_' . j . '_tag = "' . txt . '"' + silent! echo 'let tlist_' . i . '_' . j . '_tag_name = "' . + \ s:tlist_{i}_{j}_tag_name . '"' + silent! echo 'let tlist_' . i . '_' . j . '_ttype_idx' . ' = ' . + \ s:tlist_{i}_{j}_ttype_idx + let j = j + 1 + endwhile + + " Store information about all the tags grouped by their type + let ftype = s:tlist_{i}_filetype + let j = 1 + while j <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{j}_name + if s:tlist_{i}_{ttype}_count != 0 + let txt = escape(s:tlist_{i}_{ttype}, '"\') + let txt = substitute(txt, "\n", "\\\\n", 'g') + silent! echo 'let tlist_' . i . '_' . ttype . ' = "' . + \ txt . '"' + silent! echo 'let tlist_' . i . '_' . ttype . '_count = ' . + \ s:tlist_{i}_{ttype}_count + let k = 1 + while k <= s:tlist_{i}_{ttype}_count + silent! echo 'let tlist_' . i . '_' . ttype . '_' . k . + \ ' = ' . s:tlist_{i}_{ttype}_{k} + let k = k + 1 + endwhile + endif + let j = j + 1 + endwhile + + silent! echo + + let i = i + 1 + endwhile + + redir END + + let &verbose = old_verbose +endfunction + +" Tlist_Buffer_Removed +" A buffer is removed from the Vim buffer list. Remove the tags defined +" for that file +function! s:Tlist_Buffer_Removed(filename) + call s:Tlist_Log_Msg('Tlist_Buffer_Removed (' . a:filename . ')') + + " Make sure a valid filename is supplied + if a:filename == '' + return + endif + + " Get tag list index of the specified file + let fidx = s:Tlist_Get_File_Index(a:filename) + if fidx == -1 + " File not present in the taglist + return + endif + + " Remove the file from the list + call s:Tlist_Remove_File(fidx, 0) +endfunction + +" When a buffer is deleted, remove the file from the taglist +autocmd BufDelete * silent call s:Tlist_Buffer_Removed(expand('<afile>:p')) + +" Tlist_Window_Open_File_Fold +" Open the fold for the specified file and close the fold for all the +" other files +function! s:Tlist_Window_Open_File_Fold(acmd_bufnr) + call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_bufnr . ')') + + " Make sure the taglist window is present + let winnum = bufwinnr(g:TagList_title) + if winnum == -1 + call s:Tlist_Warning_Msg('Taglist: Error - Taglist window is not open') + return + endif + + " Save the original window number + let org_winnr = winnr() + if org_winnr == winnum + let in_taglist_window = 1 + else + let in_taglist_window = 0 + endif + + if in_taglist_window + " When entering the taglist window, no need to update the folds + return + endif + + " Go to the taglist window + if !in_taglist_window + call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') + endif + + " Close all the folds + silent! %foldclose + + " Get tag list index of the specified file + let fname = fnamemodify(bufname(a:acmd_bufnr + 0), ':p') + if filereadable(fname) + let fidx = s:Tlist_Get_File_Index(fname) + if fidx != -1 + " Open the fold for the file + exe "silent! " . s:tlist_{fidx}_start . "," . + \ s:tlist_{fidx}_end . "foldopen" + endif + endif + + " Go back to the original window + if !in_taglist_window + call s:Tlist_Exe_Cmd_No_Acmds(org_winnr . 'wincmd w') + endif +endfunction + +" Tlist_Window_Check_Auto_Open +" Open the taglist window automatically on Vim startup. +" Open the window only when files present in any of the Vim windows support +" tags. +function! s:Tlist_Window_Check_Auto_Open() + let open_window = 0 + + let i = 1 + let buf_num = winbufnr(i) + while buf_num != -1 + let filename = fnamemodify(bufname(buf_num), ':p') + let ft = s:Tlist_Get_Buffer_Filetype(buf_num) + if !s:Tlist_Skip_File(filename, ft) + let open_window = 1 + break + endif + let i = i + 1 + let buf_num = winbufnr(i) + endwhile + + if open_window + call s:Tlist_Window_Toggle() + endif +endfunction + +" Tlist_Refresh_Folds +" Remove and create the folds for all the files displayed in the taglist +" window. Used after entering a tab. If this is not done, then the folds +" are not properly created for taglist windows displayed in multiple tabs. +function! s:Tlist_Refresh_Folds() + let winnum = bufwinnr(g:TagList_title) + if winnum == -1 + return + endif + + let save_wnum = winnr() + exe winnum . 'wincmd w' + + " First remove all the existing folds + normal! zE + + " Create the folds for each in the tag list + let fidx = 0 + while fidx < s:tlist_file_count + let ftype = s:tlist_{fidx}_filetype + + " Create the folds for each tag type in a file + let j = 1 + while j <= s:tlist_{ftype}_count + let ttype = s:tlist_{ftype}_{j}_name + if s:tlist_{fidx}_{ttype}_count + let s = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset + let e = s + s:tlist_{fidx}_{ttype}_count + exe s . ',' . e . 'fold' + endif + let j = j + 1 + endwhile + + exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold' + exe 'silent! ' . s:tlist_{fidx}_start . ',' . + \ s:tlist_{fidx}_end . 'foldopen!' + let fidx = fidx + 1 + endwhile + + exe save_wnum . 'wincmd w' +endfunction + +function! s:Tlist_Menu_Add_Base_Menu() + call s:Tlist_Log_Msg('Adding the base menu') + + " Add the menu + anoremenu <silent> T&ags.Refresh\ menu :call <SID>Tlist_Menu_Refresh()<CR> + anoremenu <silent> T&ags.Sort\ menu\ by.Name + \ :call <SID>Tlist_Change_Sort('menu', 'set', 'name')<CR> + anoremenu <silent> T&ags.Sort\ menu\ by.Order + \ :call <SID>Tlist_Change_Sort('menu', 'set', 'order')<CR> + anoremenu T&ags.-SEP1- : + + if &mousemodel =~ 'popup' + anoremenu <silent> PopUp.T&ags.Refresh\ menu + \ :call <SID>Tlist_Menu_Refresh()<CR> + anoremenu <silent> PopUp.T&ags.Sort\ menu\ by.Name + \ :call <SID>Tlist_Change_Sort('menu', 'set', 'name')<CR> + anoremenu <silent> PopUp.T&ags.Sort\ menu\ by.Order + \ :call <SID>Tlist_Change_Sort('menu', 'set', 'order')<CR> + anoremenu PopUp.T&ags.-SEP1- : + endif +endfunction + +let s:menu_char_prefix = + \ '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + +" Tlist_Menu_Get_Tag_Type_Cmd +" Get the menu command for the specified tag type +" fidx - File type index +" ftype - File Type +" add_ttype_name - To add or not to add the tag type name to the menu entries +" ttype_idx - Tag type index +function! s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, ttype_idx) + " Curly brace variable name optimization + let ftype_ttype_idx = a:ftype . '_' . a:ttype_idx + + let ttype = s:tlist_{ftype_ttype_idx}_name + if a:add_ttype_name + " If the tag type name contains space characters, escape it. This + " will be used to create the menu entries. + let ttype_fullname = escape(s:tlist_{ftype_ttype_idx}_fullname, ' ') + endif + + " Curly brace variable name optimization + let fidx_ttype = a:fidx . '_' . ttype + + " Number of tag entries for this tag type + let tcnt = s:tlist_{fidx_ttype}_count + if tcnt == 0 " No entries for this tag type + return '' + endif + + let mcmd = '' + + " Create the menu items for the tags. + " Depending on the number of tags of this type, split the menu into + " multiple sub-menus, if needed. + if tcnt > g:Tlist_Max_Submenu_Items + let j = 1 + while j <= tcnt + let final_index = j + g:Tlist_Max_Submenu_Items - 1 + if final_index > tcnt + let final_index = tcnt + endif + + " Extract the first and last tag name and form the + " sub-menu name + let tidx = s:tlist_{fidx_ttype}_{j} + let first_tag = s:tlist_{a:fidx}_{tidx}_tag_name + + let tidx = s:tlist_{fidx_ttype}_{final_index} + let last_tag = s:tlist_{a:fidx}_{tidx}_tag_name + + " Truncate the names, if they are greater than the + " max length + let first_tag = strpart(first_tag, 0, g:Tlist_Max_Tag_Length) + let last_tag = strpart(last_tag, 0, g:Tlist_Max_Tag_Length) + + " Form the menu command prefix + let m_prefix = 'anoremenu <silent> T\&ags.' + if a:add_ttype_name + let m_prefix = m_prefix . ttype_fullname . '.' + endif + let m_prefix = m_prefix . first_tag . '\.\.\.' . last_tag . '.' + + " Character prefix used to number the menu items (hotkey) + let m_prefix_idx = 0 + + while j <= final_index + let tidx = s:tlist_{fidx_ttype}_{j} + + let tname = s:tlist_{a:fidx}_{tidx}_tag_name + + let mcmd = mcmd . m_prefix . '\&' . + \ s:menu_char_prefix[m_prefix_idx] . '\.' . + \ tname . ' :call <SID>Tlist_Menu_Jump_To_Tag(' . + \ tidx . ')<CR>|' + + let m_prefix_idx = m_prefix_idx + 1 + let j = j + 1 + endwhile + endwhile + else + " Character prefix used to number the menu items (hotkey) + let m_prefix_idx = 0 + + let m_prefix = 'anoremenu <silent> T\&ags.' + if a:add_ttype_name + let m_prefix = m_prefix . ttype_fullname . '.' + endif + let j = 1 + while j <= tcnt + let tidx = s:tlist_{fidx_ttype}_{j} + + let tname = s:tlist_{a:fidx}_{tidx}_tag_name + + let mcmd = mcmd . m_prefix . '\&' . + \ s:menu_char_prefix[m_prefix_idx] . '\.' . + \ tname . ' :call <SID>Tlist_Menu_Jump_To_Tag(' . tidx + \ . ')<CR>|' + + let m_prefix_idx = m_prefix_idx + 1 + let j = j + 1 + endwhile + endif + + return mcmd +endfunction + +" Update the taglist menu with the tags for the specified file +function! s:Tlist_Menu_File_Refresh(fidx) + call s:Tlist_Log_Msg('Refreshing the tag menu for ' . s:tlist_{a:fidx}_filename) + " The 'B' flag is needed in the 'cpoptions' option + let old_cpoptions = &cpoptions + set cpoptions&vim + + exe s:tlist_{a:fidx}_menu_cmd + + " Update the popup menu (if enabled) + if &mousemodel =~ 'popup' + let cmd = substitute(s:tlist_{a:fidx}_menu_cmd, ' T\\&ags\.', + \ ' PopUp.T\\\&ags.', "g") + exe cmd + endif + + " The taglist menu is not empty now + let s:tlist_menu_empty = 0 + + " Restore the 'cpoptions' settings + let &cpoptions = old_cpoptions +endfunction + +" Tlist_Menu_Update_File +" Add the taglist menu +function! s:Tlist_Menu_Update_File(clear_menu) + if !has('gui_running') + " Not running in GUI mode + return + endif + + call s:Tlist_Log_Msg('Updating the tag menu, clear_menu = ' . a:clear_menu) + + " Remove the tags menu + if a:clear_menu + call s:Tlist_Menu_Remove_File() + + endif + + " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help + if &buftype != '' + return + endif + + let filename = fnamemodify(bufname('%'), ':p') + let ftype = s:Tlist_Get_Buffer_Filetype('%') + + " If the file doesn't support tag listing, skip it + if s:Tlist_Skip_File(filename, ftype) + return + endif + + let fidx = s:Tlist_Get_File_Index(filename) + if fidx == -1 || !s:tlist_{fidx}_valid + " Check whether this file is removed based on user request + " If it is, then don't display the tags for this file + if s:Tlist_User_Removed_File(filename) + return + endif + + " Process the tags for the file + let fidx = s:Tlist_Process_File(filename, ftype) + if fidx == -1 + return + endif + endif + + let fname = escape(fnamemodify(bufname('%'), ':t'), '.') + if fname != '' + exe 'anoremenu T&ags.' . fname . ' <Nop>' + anoremenu T&ags.-SEP2- : + endif + + if !s:tlist_{fidx}_tag_count + return + endif + + if s:tlist_{fidx}_menu_cmd != '' + " Update the menu with the cached command + call s:Tlist_Menu_File_Refresh(fidx) + + return + endif + + " We are going to add entries to the tags menu, so the menu won't be + " empty + let s:tlist_menu_empty = 0 + + let cmd = '' + + " Determine whether the tag type name needs to be added to the menu + " If more than one tag type is present in the taglisting for a file, + " then the tag type name needs to be present + let add_ttype_name = -1 + let i = 1 + while i <= s:tlist_{ftype}_count && add_ttype_name < 1 + let ttype = s:tlist_{ftype}_{i}_name + if s:tlist_{fidx}_{ttype}_count + let add_ttype_name = add_ttype_name + 1 + endif + let i = i + 1 + endwhile + + " Process the tags by the tag type and get the menu command + let i = 1 + while i <= s:tlist_{ftype}_count + let mcmd = s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, i) + if mcmd != '' + let cmd = cmd . mcmd + endif + + let i = i + 1 + endwhile + + " Cache the menu command for reuse + let s:tlist_{fidx}_menu_cmd = cmd + + " Update the menu + call s:Tlist_Menu_File_Refresh(fidx) +endfunction + +" Tlist_Menu_Remove_File +" Remove the tags displayed in the tags menu +function! s:Tlist_Menu_Remove_File() + if !has('gui_running') || s:tlist_menu_empty + return + endif + + call s:Tlist_Log_Msg('Removing the tags menu for a file') + + " Cleanup the Tags menu + silent! unmenu T&ags + if &mousemodel =~ 'popup' + silent! unmenu PopUp.T&ags + endif + + " Add a dummy menu item to retain teared off menu + noremenu T&ags.Dummy l + + silent! unmenu! T&ags + if &mousemodel =~ 'popup' + silent! unmenu! PopUp.T&ags + endif + + call s:Tlist_Menu_Add_Base_Menu() + + " Remove the dummy menu item + unmenu T&ags.Dummy + + let s:tlist_menu_empty = 1 +endfunction + +" Tlist_Menu_Refresh +" Refresh the taglist menu +function! s:Tlist_Menu_Refresh() + call s:Tlist_Log_Msg('Refreshing the tags menu') + let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) + if fidx != -1 + " Invalidate the cached menu command + let s:tlist_{fidx}_menu_cmd = '' + endif + + " Update the taglist, menu and window + call s:Tlist_Update_Current_File() +endfunction + +" Tlist_Menu_Jump_To_Tag +" Jump to the selected tag +function! s:Tlist_Menu_Jump_To_Tag(tidx) + let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) + if fidx == -1 + return + endif + + let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, a:tidx) + if tagpat == '' + return + endif + + " Add the current cursor position to the jump list, so that user can + " jump back using the ' and ` marks. + mark ' + + silent call search(tagpat, 'w') + + " Bring the line to the middle of the window + normal! z. + + " If the line is inside a fold, open the fold + if foldclosed('.') != -1 + .foldopen + endif +endfunction + +" Tlist_Menu_Init +" Initialize the taglist menu +function! s:Tlist_Menu_Init() + call s:Tlist_Menu_Add_Base_Menu() + + " Automatically add the tags defined in the current file to the menu + augroup TagListMenuCmds + autocmd! + + if !g:Tlist_Process_File_Always + autocmd BufEnter * call s:Tlist_Refresh() + endif + autocmd BufLeave * call s:Tlist_Menu_Remove_File() + augroup end + + call s:Tlist_Menu_Update_File(0) +endfunction + +" Tlist_Vim_Session_Load +" Initialize the taglist window/buffer, which is created when loading +" a Vim session file. +function! s:Tlist_Vim_Session_Load() + call s:Tlist_Log_Msg('Tlist_Vim_Session_Load') + + " Initialize the taglist window + call s:Tlist_Window_Init() + + " Refresh the taglist window + call s:Tlist_Window_Refresh() +endfunction + +" Tlist_Set_App +" Set the name of the external plugin/application to which taglist +" belongs. +" Taglist plugin is part of another plugin like cream or winmanager. +function! Tlist_Set_App(name) + if a:name == "" + return + endif + + let s:tlist_app_name = a:name +endfunction + +" Winmanager integration + +" Initialization required for integration with winmanager +function! TagList_Start() + " If current buffer is not taglist buffer, then don't proceed + if bufname('%') != '__Tag_List__' + return + endif + + call Tlist_Set_App('winmanager') + + " Get the current filename from the winmanager plugin + let bufnum = WinManagerGetLastEditedFile() + if bufnum != -1 + let filename = fnamemodify(bufname(bufnum), ':p') + let ftype = s:Tlist_Get_Buffer_Filetype(bufnum) + endif + + " Initialize the taglist window, if it is not already initialized + if !exists('s:tlist_window_initialized') || !s:tlist_window_initialized + call s:Tlist_Window_Init() + call s:Tlist_Window_Refresh() + let s:tlist_window_initialized = 1 + endif + + " Update the taglist window + if bufnum != -1 + if !s:Tlist_Skip_File(filename, ftype) && g:Tlist_Auto_Update + call s:Tlist_Window_Refresh_File(filename, ftype) + endif + endif +endfunction + +function! TagList_IsValid() + return 0 +endfunction + +function! TagList_WrapUp() + return 0 +endfunction + +" restore 'cpo' +let &cpo = s:cpo_save +unlet s:cpo_save + diff --git a/dot_vim/syntax/beluga.vim b/dot_vim/syntax/beluga.vim new file mode 100644 index 0000000..e12ba8d --- /dev/null +++ b/dot_vim/syntax/beluga.vim @@ -0,0 +1,121 @@ +" Vim syntax file +" Language: bel +" Filenames: *.bel +" Maintainers: Vincent Aravantinos <vincent.aravantinos@gmail.com> +" Last Change: 2012 Jun 28 - Added new syntax +" TODO see what the Twelf vim file does + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") && b:current_syntax == "beluga" + finish +endif + +" bel is not case sensitive. +"syn case match + +"syn match belError "\S" +syn match belComment containedin=ALL "%.*" extend + +syn match belId contained "[[:lower:]][[:lower:][:digit:]']*" +syn keyword belTermOp contained "\(type\|ctype\|datatype\)" +syn match belTermOp contained "\(->\|<-\|\\\|\.\|_\|:\)" +syn region belTerm contained contains=@belTermClu matchgroup=belTermOp start="(" end=")" +syn region belTerm contained contains=belId,belColonType,@belTermClu matchgroup=belTermOp start="{" end="}" +syn match belColType contained ":" +syn cluster belTermClu contains=belTerm,belTermOp +syn region belLf_decl contains=belColType,@belTermClu start="[[:lower:]&][[:lower:][:digit:]']*\_s*:" matchgroup=belDot end="\." +syn region belLf_decl matchgroup=belStmt start="%name\>" matchgroup=belDot end="\." +syn match belEq contained "=" +syn match belColDecl contained ":" +syn region belDecl contained contains=@belCTermClu,belColDecl matchgroup=belBlockBraces start="{" end="}" +syn region belBlock contained contains=belDecl matchgroup=belStmt start="\<block\>" end=";" +syn region belSomeCtnt contained contains=belS_decl matchgroup=belSomeBrackets start="\[" end="]" +syn region belCTermPar contained contains=@belCTermClu matchgroup=belCTerm start="(" end=")" +syn match belCTerm contained "\.\s*[[:digit:]]\+" +syn match belCTerm contained "\(#\|\.\.\|\<_\>\)" +syn keyword belCTerm contained sigma +syn match belS_decl contained "\(:\|,\)" +syn region belCTermBck contained contains=belS_decl matchgroup=belCTerm start="\<block\>" end="\." +syn cluster belCTermClu contains=belCTerm,belCTermBck,belCTermPar +syn region belSome contained contains=belBlock,belSomeCtnt matchgroup=belC_typOp start="\<some\>" end=";" +syn region belSchDef contained contains=belSome,@belCTermClu matchgroup=belEq start="=" end=";" +syn region belC_decl contains=belSchDef matchgroup=belStmt start="\<schema\>" matchgroup=belDot end=";" keepend +syn region belExp contained contains=@belExpClu matchgroup=belExpOp start="(" end=")" +syn match belCtx contained "\(:\|,\|\<block\>\)" +syn match belCtxExp contained "\(:\|,\|\<block\>\|\.\)" +syn region belExp contained contains=belCtxExp,@belCTermClu matchgroup=belExpOp start="\[" end="]" +syn keyword belExpOp contained FN fn mlam let in case of +syn match belBindDot contained "\." +syn region belDepApp contained contains=belCtxExp,belBindDot,@belCTermClu matchgroup=belExpOp start="<" end=">" +syn match belExpOp contained "\(=>\||\|:\|=\|\\\|\.\|<<\)" +syn region belLetDef contained contains=@belExpClu matchgroup=belEq start="=" end=";" +syn cluster belExpClu contains=belExp,@belC_typExp,belExpOp,@belCTermClu,belDepApp +syn match belC_typOp contained "->" +syn match belCols contained ":" +"syn region belCtypCtx contained contains=belCtx,@belCTermClu matchgroup=belC_typOp start="\[" end="]" +syn region belCtypCtx contained contains=belCtx matchgroup=belC_typOp start="\[" end="]" +syn region belC_typBr contained contains=belCols,@belCTermClu,belCtypCtx,belKleeneGr matchgroup=belC_typOp start="{" end="}" +syn region belKleeneGr contained contains=@belC_typ matchgroup=belKleene start="(" end=")\*\?" +"syn cluster belC_typ contains=belC_typOp,belC_typBr,belSome,belKleeneGr,belCtypCtx,@belCTermClu +syn cluster belC_typ contains=belC_typOp,belC_typBr,belSome,belKleeneGr,belCtypCtx + +syn region belCtypCtxExp contained contains=belCtxExp,@belCTermClu matchgroup=belC_typOpExp start="\[" end="]" +syn match belColsExp contained ":" +syn region belKleeneExpGr contained contains=@belC_typExp matchgroup=belKleeneExp start="(" end=")\*\?" +syn region belCtypCtxExp contained contains=belCtxExp,@belCTermClu matchgroup=belC_typOpExp start="\[" end="]" +syn region belC_typBrExp contained contains=belColsExp,@belCTermClu,belCtypCtxExp matchgroup=belC_typOpExp start="{" end="}" +syn match belC_typOpExp contained "->" +syn cluster belC_typExp contains=@belCTermClu,belC_typOpExp,belC_typBrExp,belSome,belCtypCtxExp + +syn region belLetSpec contained contains=belLetDef,@belC_typ matchgroup=belEq start=":" end=";" +syn region belC_decl contains=belLetDef,belLetSpec matchgroup=belStmt start="\<let\>" matchgroup=belDot end=";" keepend +syn region belRecDef contained contains=@belExpClu matchgroup=belEq start="=" end="\(;\|and\)" +syn region belRecSpec contained contains=belRecDef,@belC_typ matchgroup=belEq start=":" end="\(;\|and\)" +syn region belC_decl contains=belRecDef,belRecSpec matchgroup=belStmt start="\<rec\>" matchgroup=belDot end=";" keepend + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_bel_syntax_inits") + if version < 508 + let did_beluga_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink belError Error + HiLink belComment Comment + HiLink belKwd PreProc + HiLink belCtxt Type + HiLink belTypeKwd Keyword + HiLink belOperators Constant + HiLink belTermOp Type + HiLink belStmt PreProc + HiLink belDot belStmt + HiLink belEq belStmt + HiLink belColType belStmt + HiLink belSomeBrackets belC_typOp + HiLink belCTerm belExpOp + HiLink belS_decl belC_typOp + HiLink belBlockBraces belSomeBrackets + HiLink belColDecl belBlockBraces + HiLink belExpOp Keyword + HiLink belBindDot belExpOp + HiLink belC_typOp Type + HiLink belC_typOpExp belExpOp + HiLink belKleene belC_typOp + HiLink belKleeneExp belExpOp + HiLink belCols belC_typOp + HiLink belColsExp belExpOp + HiLink belCtx belC_typOp + HiLink belCtxExp belExpOp + + delcommand HiLink +endif + +let b:current_syntax = "belgua" diff --git a/dot_vim/syntax/daylog.vim b/dot_vim/syntax/daylog.vim new file mode 100644 index 0000000..693a8ba --- /dev/null +++ b/dot_vim/syntax/daylog.vim @@ -0,0 +1,60 @@ +" Vim syntax file +" Language: Daylog (Debian Changelogs) +" Maintainer: Ryan Kavanagh <rak@debian.org> +" Former Maintainers: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> +" Gerfried Fuchs <alfie@ist.org> +" Wichert Akkerman <wakkerma@debian.org> +" Last Change: 2011 June 01 +" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim + +" Standard syntax initialization +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Case doesn't matter for us +syn case ignore + +" Define some common expressions we can use later on +syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " +syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" +syn match debchangelogTarget contained "\v %(summer20.*|fall20.*|winter20.*|spring20.*)=" +syn match debchangelogVersion contained "(.\{-})" +syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" +syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" +syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" +syn match debchangelogEmail contained "<.\{-}>" + +" Define the entries that make up the changelog +syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline +syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline +syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline + +" Associate our matches and regions with pretty colours +if version >= 508 || !exists("did_debchangelog_syn_inits") + if version < 508 + let did_debchangelog_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink debchangelogHeader Error + HiLink debchangelogFooter Identifier + HiLink debchangelogEntry Normal + HiLink debchangelogCloses Statement + HiLink debchangelogLP Statement + HiLink debchangelogUrgency Identifier + HiLink debchangelogName Comment + HiLink debchangelogVersion Identifier + HiLink debchangelogTarget Identifier + HiLink debchangelogEmail Special + + delcommand HiLink +endif + +let b:current_syntax = "debchangelog" + +" vim: ts=8 sw=2 diff --git a/dot_vim/syntax/django.vim b/dot_vim/syntax/django.vim new file mode 100644 index 0000000..3ad4816 --- /dev/null +++ b/dot_vim/syntax/django.vim @@ -0,0 +1,93 @@ +" Vim syntax file +" Language: Django template +" Maintainer: Dave Hodder <dmh@dmh.org.uk> +" Last Change: 2007 Apr 21 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syntax case match + +" Mark illegal characters +syn match djangoError "%}\|}}\|#}" + +" Django template built-in tags and parameters +" 'comment' doesn't appear here because it gets special treatment +syn keyword djangoStatement contained and as block endblock by cycle debug else +syn keyword djangoStatement contained extends filter endfilter firstof for +syn keyword djangoStatement contained endfor if endif ifchanged endifchanged +syn keyword djangoStatement contained ifequal endifequal ifnotequal +syn keyword djangoStatement contained endifnotequal in include load not now or +syn keyword djangoStatement contained parsed regroup reversed spaceless +syn keyword djangoStatement contained endspaceless ssi templatetag openblock +syn keyword djangoStatement contained closeblock openvariable closevariable +syn keyword djangoStatement contained openbrace closebrace opencomment +syn keyword djangoStatement contained closecomment widthratio url with endwith +syn keyword djangoStatement contained get_current_language trans noop blocktrans +syn keyword djangoStatement contained endblocktrans get_available_languages +syn keyword djangoStatement contained get_current_language_bidi plural + +" Django templete built-in filters +syn keyword djangoFilter contained add addslashes capfirst center cut date +syn keyword djangoFilter contained default default_if_none dictsort +syn keyword djangoFilter contained dictsortreversed divisibleby escape +syn keyword djangoFilter contained filesizeformat first fix_ampersands +syn keyword djangoFilter contained floatformat get_digit join length length_is +syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust +syn keyword djangoFilter contained lower make_list phone2numeric pluralize +syn keyword djangoFilter contained pprint random removetags rjust slice slugify +syn keyword djangoFilter contained stringformat striptags +syn keyword djangoFilter contained time timesince timeuntil title +syn keyword djangoFilter contained truncatewords unordered_list upper urlencode +syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno + +" Keywords to highlight within comments +syn keyword djangoTodo contained TODO FIXME XXX + +" Django template constants (always surrounded by double quotes) +syn region djangoArgument contained start=/"/ skip=/\\"/ end=/"/ + +" Mark illegal characters within tag and variables blocks +syn match djangoTagError contained "#}\|{{\|[^%]}}\|[<>!&#]" +syn match djangoVarError contained "#}\|{%\|%}\|[<>!&#%]" + +" Django template tag and variable blocks +syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display +syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display + +" Django template 'comment' tag and comment block +syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=djangoTodo +syn region djangoComBlock start="{#" end="#}" contains=djangoTodo + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_django_syn_inits") + if version < 508 + let did_django_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink djangoTagBlock PreProc + HiLink djangoVarBlock PreProc + HiLink djangoStatement Statement + HiLink djangoFilter Identifier + HiLink djangoArgument Constant + HiLink djangoTagError Error + HiLink djangoVarError Error + HiLink djangoError Error + HiLink djangoComment Comment + HiLink djangoComBlock Comment + HiLink djangoTodo Todo + + delcommand HiLink +endif + +let b:current_syntax = "django" diff --git a/dot_vim/syntax/htmldjango.vim b/dot_vim/syntax/htmldjango.vim new file mode 100644 index 0000000..4b13863 --- /dev/null +++ b/dot_vim/syntax/htmldjango.vim @@ -0,0 +1,34 @@ +" Vim syntax file +" Language: Django HTML template +" Maintainer: Dave Hodder <dmh@dmh.org.uk> +" Last Change: 2007 Jan 26 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'html' +endif + +if version < 600 + so <sfile>:p:h/django.vim + so <sfile>:p:h/html.vim +else + runtime! syntax/django.vim + runtime! syntax/html.vim + unlet b:current_syntax +endif + +syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock + +syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks +syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks +syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks +syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks + +let b:current_syntax = "htmldjango" diff --git a/dot_vim/syntax/prolog.vim b/dot_vim/syntax/prolog.vim new file mode 100644 index 0000000..58de71f --- /dev/null +++ b/dot_vim/syntax/prolog.vim @@ -0,0 +1,119 @@ +" Vim syntax file +" Language: PROLOG +" Maintainers: Thomas Koehler <jean-luc@picard.franken.de> +" Last Change: 2009 Dec 04 +" URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/prolog.vim + +" There are two sets of highlighting in here: +" If the "prolog_highlighting_clean" variable exists, it is rather sparse. +" Otherwise you get more highlighting. + +" Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Prolog is case sensitive. +syn case match + +" Very simple highlighting for comments, clause heads and +" character codes. It respects prolog strings and atoms. + +syn region prologCComment start=+/\*+ end=+\*/+ +syn match prologComment +%.*+ + +syn keyword prologKeyword module meta_predicate multifile dynamic +syn match prologCharCode +0'\\\=.+ +syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn region prologAtom start=+'+ skip=+\\\\\|\\'+ end=+'+ +syn region prologClauseHead start=+^[a-z][^(]*(+ skip=+\.[^ ]+ end=+:-\|\.$\|\.[ ]\|-->+ contains=prologComment,prologCComment,prologString + +if !exists("prolog_highlighting_clean") + + " some keywords + " some common predicates are also highlighted as keywords + " is there a better solution? + syn keyword prologKeyword abolish current_output peek_code + syn keyword prologKeyword append current_predicate put_byte + syn keyword prologKeyword arg current_prolog_flag put_char + syn keyword prologKeyword asserta fail put_code + syn keyword prologKeyword assertz findall read + syn keyword prologKeyword at_end_of_stream float read_term + syn keyword prologKeyword atom flush_output repeat + syn keyword prologKeyword atom_chars functor retract + syn keyword prologKeyword atom_codes get_byte set_input + syn keyword prologKeyword atom_concat get_char set_output + syn keyword prologKeyword atom_length get_code set_prolog_flag + syn keyword prologKeyword atomic halt set_stream_position + syn keyword prologKeyword bagof integer setof + syn keyword prologKeyword call is stream_property + syn keyword prologKeyword catch nl sub_atom + syn keyword prologKeyword char_code nonvar throw + syn keyword prologKeyword char_conversion number true + syn keyword prologKeyword clause number_chars unify_with_occurs_check + syn keyword prologKeyword close number_codes var + syn keyword prologKeyword compound once write + syn keyword prologKeyword copy_term op write_canonical + syn keyword prologKeyword current_char_conversion open write_term + syn keyword prologKeyword current_input peek_byte writeq + syn keyword prologKeyword current_op peek_char + + syn match prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|<\|>\|=" + syn match prologAsIs "===\|\\===\|<=\|=>" + + syn match prologNumber "\<[0123456789]*\>'\@!" + syn match prologCommentError "\*/" + syn match prologSpecialCharacter ";" + syn match prologSpecialCharacter "!" + syn match prologQuestion "?-.*\." contains=prologNumber + + +endif + +syn sync maxlines=50 + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_prolog_syn_inits") + if version < 508 + let did_prolog_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + " The default highlighting. + HiLink prologComment Comment + HiLink prologCComment Comment + HiLink prologCharCode Special + + if exists ("prolog_highlighting_clean") + + HiLink prologKeyword Statement + HiLink prologClauseHead Statement + + else + + HiLink prologKeyword Keyword + HiLink prologClauseHead Constant + HiLink prologQuestion PreProc + HiLink prologSpecialCharacter Special + HiLink prologNumber Number + HiLink prologAsIs Normal + HiLink prologCommentError Error + HiLink prologAtom String + HiLink prologString String + HiLink prologOperator Operator + + endif + + delcommand HiLink +endif + +let b:current_syntax = "prolog" + +" vim: ts=8 diff --git a/dot_vim/syntax/rnc.vim b/dot_vim/syntax/rnc.vim new file mode 100644 index 0000000..411046f --- /dev/null +++ b/dot_vim/syntax/rnc.vim @@ -0,0 +1,59 @@ +" Vim syntax file +" Language: RELAX NG Compact Syntax +" Maintainer: Hans Fugal <hans@fugal.net> +" Last Change: $Date: 2003/06/22 03:32:14 $ +" $Id: rnc.vim,v 1.7 2003/06/22 03:32:14 fugalh Exp $ + +if version < 600 + syntax clear +elseif exists ("b:current_syntax") + finish +endif + +" add the character '-' and '.' to iskeyword. +set iskeyword+=45,46 + +" Comments +syn match Comment /^\s*#[^#].*$/ +syn match Documentation /^\s*##.*$/ + +" Literals +syn region literalSegment start=/"/ end=/"/ + +syn match patternSpecial /[,&|?*+\\]/ +syn match Identifier /\k\+\s*\(&=\|=\||=\)\@=/ nextgroup=assignMethod +syn match assignMethod /&=\|=\||=/ +syn match namespace /\k\+\(:\(\k\|\*\)\)\@=/ +syn region Annotation excludenl start=/\[/ end=/\]/ contains=ALLBUT,Identifier,patternName + +" named patterns (element and attribute) +syn keyword patternKeyword element attribute nextgroup=patternName skipwhite skipempty +syn match patternName /\k\+/ contained + +" Keywords +syn keyword patternKeyword list mixed parent empty text notAllowed externalRef grammar +syn keyword grammarContentKeyword div include +syn keyword startKeyword start +syn keyword datatypeNameKeyword string token +syn keyword namespaceUriKeyword inherit +syn keyword inheritKeyword inherit +syn keyword declKeyword namespace default datatypes + +" Links +hi link patternKeyword keyword +hi link patternName Identifier +hi link grammarContentKeyword keyword +hi link startKeyword keyword +hi link datatypeNameKeyword keyword +hi link namespaceUriKeyword keyword +hi link inheritKeyword keyword +hi link declKeyword keyword + +hi link literalSegment String +hi link Documentation Comment + +hi link patternSpecial Special +hi link namespace Type + +let b:current_syntax = "rnc" +" vim: ts=8 sw=4 smarttab diff --git a/dot_vim/syntax/syntax-r.vim b/dot_vim/syntax/syntax-r.vim new file mode 100644 index 0000000..a4548a4 --- /dev/null +++ b/dot_vim/syntax/syntax-r.vim @@ -0,0 +1,621 @@ +" Vim syntax file +" Language: R (GNU S) +" Maintainer: Tom Payne <tom@tompayne.org> +" Last Change: 2003 May 11 +" Filenames: *.r +" URL: http://www.tompayne.org/vim/syntax/r.vim +" +" Modified by Jeremy Stephens and Will Gray. +" +" Options: +" You can set these options in your vimrc file. +" +" For set option do: let OPTION_NAME = 1 +" For clear option do: let OPTION_NAME = 0 +" +" For highlighting internal/primitive functions: +" r_package_internal +" +" For highlighting package 'base' functions: +" r_package_base +" +" For highlighting package 'graphics' functions: +" r_package_graphics +" +" For highlighting package 'stats' functions: +" r_package_stats +" +" For highlighting package 'tools' functions: +" r_package_tools +" +" For highlighting package 'methods' functions: +" r_package_methods +" +" For highlighting package 'utils' functions: +" r_package_utils +" +" If you want all possible R package highlighting: +" r_package_all + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if version >= 600 + setlocal iskeyword=@,48-57,_,. +else + set iskeyword=@,48-57,_,. +endif + +if !exists("r_package_all") + let r_package_all = 1 +endif +if exists("r_package_all") && r_package_all != 0 + if !exists("r_package_internal") + let r_package_internal = 1 + endif + if !exists("r_package_base") + let r_package_base = 1 + endif + if !exists("r_package_methods") + let r_package_methods = 1 + endif + if !exists("r_package_graphics") + let r_package_graphics = 1 + endif + if !exists("r_package_stats") + let r_package_stats = 1 + endif + if !exists("r_package_utils") + let r_package_utils = 1 + endif + if !exists("r_package_tools") + let r_package_tools = 1 + endif +endif + +syn case match + +" Comment +syn match rComment /\#.*/ + +" Constant +" string enclosed in double quotes +syn region rString matchgroup=rStringDelimiter start=/"/ skip=/\\\\\|\\"/ end=/"/ +" string enclosed in single quotes +syn region rString matchgroup=rStringDelimiter start=/'/ skip=/\\\\\|\\'/ end=/'/ +" number with no fractional part or exponent +syn match rNumber /\d\+/ +" floating point number with integer and fractional parts and optional exponent +syn match rFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/ +" floating point number with no integer part and optional exponent +syn match rFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/ +" floating point number with no fractional part and optional exponent +syn match rFloat /\d\+[Ee][-+]\=\d\+/ + +" Identifier +" identifier with leading letter and optional following keyword characters +syn match rIdentifier /\a\k*/ +" identifier with leading period, one or more digits, and at least one non-digit keyword character +syn match rIdentifier /\.\d*\K\k*/ + +syn match rFunction /\a\k*(/me=e-1 nextgroup=rParenRegion + +" Statement +syn keyword rStatement break next return +syn keyword rConditional if else +syn keyword rRepeat for in repeat while + +" Constant +syn keyword rConstant LETTERS letters month.ab month.name pi +syn keyword rConstant NULL +syn keyword rBoolean FALSE TRUE +syn keyword rNumber NA + +syn match rArrow /<\{1,2}-/ +syn match rArrow /->\{1,2}/ + +" Type +syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame + +" internal/primitive functions (probably has some duplicates) +if exists("r_package_internal") && r_package_internal != 0 + syn keyword rPrimitiveStatement stop warning gettext ngettext bindtextdomain .addCondHands + syn keyword rPrimitiveStatement .resetCondHands .signalCondition .dfltStop .dfltWarn .addRestart + syn keyword rPrimitiveStatement .getRestart .invokeRestart .addTryHandlers geterrmessage restart + syn keyword rPrimitiveStatement function as.function.default .subset switch browser debug undebug + syn keyword rPrimitiveStatement .primTrace .primUntrace .Internal on.exit Recall delay delayedAssign + syn keyword rPrimitiveStatement .Primitive identical crossprod all any vector complex matrix length row + syn keyword rPrimitiveStatement col c unlist cbind rbind drop oldClass class unclass names dimnames + syn keyword rPrimitiveStatement all.names dim attributes attr comment get mget exists assign remove + syn keyword rPrimitiveStatement duplicated unique which.min which.max match pmatch charmatch match.call + syn keyword rPrimitiveStatement complete.cases attach detach search round atan log signif abs floor + syn keyword rPrimitiveStatement ceiling sqrt sign trunc exp cos sin tan acos asin cosh sinh tanh acosh + syn keyword rPrimitiveStatement asinh atanh lgamma gamma digamma trigamma pentagamma gammaCody lbeta + syn keyword rPrimitiveStatement beta lchoose choose dchisq pchisq qchisq dexp pexp qexp dgeom pgeom + syn keyword rPrimitiveStatement qgeom dpois ppois qpois dt pt qt dsignrank psignrank qsignrank besselJ + syn keyword rPrimitiveStatement besselY psigamma Re Im Mod Arg Conj dbeta pbeta qbeta dbinom pbinom + syn keyword rPrimitiveStatement qbinom dcauchy pcauchy qcauchy df pf qf dgamma pgamma qgamma dlnorm + syn keyword rPrimitiveStatement plnorm qlnorm dlogis plogis qlogis dnbinom pnbinom qnbinom dnorm pnorm + syn keyword rPrimitiveStatement qnorm dunif punif qunif dweibull pweibull qweibull dnchisq pnchisq + syn keyword rPrimitiveStatement qnchisq dnt pnt qnt dwilcox pwilcox qwilcox besselI besselK dhyper + syn keyword rPrimitiveStatement phyper qhyper dnbeta pnbeta qnbeta dnf pnf qnf dtukey ptukey qtukey + syn keyword rPrimitiveStatement rchisq rexp rgeom rpois rt rsignrank rbeta rbinom rcauchy rf rgamma + syn keyword rPrimitiveStatement rlnorm rlogis rnbinom rnchisq rnorm runif rweibull rwilcox rhyper + syn keyword rPrimitiveStatement rmultinom sample RNGkind set.seed sum min max prod range cov cor cumsum + syn keyword rPrimitiveStatement cumprod cummax cummin as.character as.vector paste format format.info + syn keyword rPrimitiveStatement cat call do.call as.call type.convert as.environment nchar substr + syn keyword rPrimitiveStatement substrgets strsplit abbreviate make.names grep sub gsub regexpr + syn keyword rPrimitiveStatement grep.perl sub.perl gsub.perl regexpr.perl agrep tolower toupper chartr + syn keyword rPrimitiveStatement sprintf make.unique charToRaw rawToChar rawShift intToBits rawToBits + syn keyword rPrimitiveStatement packBits encodeString iconv strtrim is.null is.logical is.integer + syn keyword rPrimitiveStatement is.real is.double is.complex is.character is.symbol is.environment + syn keyword rPrimitiveStatement is.list is.pairlist is.expression is.object is.numeric is.matrix + syn keyword rPrimitiveStatement is.array is.atomic is.recursive is.call is.language is.function + syn keyword rPrimitiveStatement is.single is.vector is.na is.nan is.finite is.infinite proc.time gc.time + syn keyword rPrimitiveStatement Version machine commandArgs int.unzip system system unlink help.start + syn keyword rPrimitiveStatement show.help.item flush.console win.version shell.exec winDialog + syn keyword rPrimitiveStatement winDialogString winMenuNames winMenuItems winMenuAdd winMenuDel + syn keyword rPrimitiveStatement memory.size DLL.version bringToTop select.list readClipboard + syn keyword rPrimitiveStatement writeClipboard chooseFiles getIdentification getWindowHandle + syn keyword rPrimitiveStatement getWindowTitle setWindowTitle wsbrowser pkgbrowser data.manager + syn keyword rPrimitiveStatement package.manager flush.console hsbrowser select.list aqua.custom.print + syn keyword rPrimitiveStatement parse save saveToConn load loadFromConn serializeToConn + syn keyword rPrimitiveStatement unserializeFromConn deparse dput dump substitute quote quit interactive + syn keyword rPrimitiveStatement readline menu print.default prmatrix invisible gc gcinfo gctorture + syn keyword rPrimitiveStatement memory.profile rep list split symbol.C symbol.For is.loaded .C .Fortran + syn keyword rPrimitiveStatement .External .Call .External.graphics .Call.graphics recordGraphics + syn keyword rPrimitiveStatement dyn.load dyn.unload ls typeof eval eval.with.vis expression sys.parent + syn keyword rPrimitiveStatement sys.call sys.frame sys.nframe sys.calls sys.frames sys.on.exit + syn keyword rPrimitiveStatement sys.parents sys.function parent.frame sort is.unsorted psort qsort + syn keyword rPrimitiveStatement radixsort order rank missing nargs scan count.fields readTableHead + syn keyword rPrimitiveStatement t.default aperm builtins edit dataentry args formals body bodyCode + syn keyword rPrimitiveStatement globalenv environment reg.finalizer options sink sink.number lib.fixup + syn keyword rPrimitiveStatement pos.to.env eapply lapply apply colSums colMeans rowSums rowMeans Rprof + syn keyword rPrimitiveStatement object.size mem.limits merge capabilities new.env parent.env visibleflag + syn keyword rPrimitiveStatement file.show file.edit file.create file.remove file.rename file.append + syn keyword rPrimitiveStatement codeFiles.append file.symlink list.files file.exists file.choose + syn keyword rPrimitiveStatement file.info file.access dir.create tempfile tempdir R.home date + syn keyword rPrimitiveStatement index.search getenv putenv getwd setwd basename dirname Sys.info + syn keyword rPrimitiveStatement Sys.sleep getlocale setlocale localeconv path.expand getpid + syn keyword rPrimitiveStatement normalizePath fft mvfft nextn polyroot dev.control dev.copy dev.cur + syn keyword rPrimitiveStatement device dev.next dev.off dev.prev dev.set rgb hsv hcl gray colors palette + syn keyword rPrimitiveStatement plot.new plot.window axis plot.xy text mtext title abline box rect + syn keyword rPrimitiveStatement polygon par readonly.pars segments arrows layout locator identify + syn keyword rPrimitiveStatement strheight strwidth contour contourLines image dend dend.window replay + syn keyword rPrimitiveStatement erase persp filledcontour getGPar playDL setGPar getSnapshot + syn keyword rPrimitiveStatement playSnapshot symbols getGraphicsEvent inherits UseMethod NextMethod + syn keyword rPrimitiveStatement standardGeneric nlm fmin zeroin optim optimhess terms.formula + syn keyword rPrimitiveStatement update.formula model.frame model.matrix D deriv.default loadhistory + syn keyword rPrimitiveStatement savehistory Sys.time as.POSIXct as.POSIXlt format.POSIXlt strptime + syn keyword rPrimitiveStatement mkCode bcClose is.builtin.internal disassemble bcVersion load.from.file + syn keyword rPrimitiveStatement save.to.file putconst stdin stdout stderr readLines writeLines readBin + syn keyword rPrimitiveStatement writeBin readChar writeChar open isOpen isIncomplete isSeekable close + syn keyword rPrimitiveStatement flush file url pipe fifo gzfile unz bzfile seek truncate pushBack + syn keyword rPrimitiveStatement clearPushBackLength pushBackLength textConnection socketConnection + syn keyword rPrimitiveStatement sockSelect getAllConnections summary.connection download nsl gzcon + syn keyword rPrimitiveStatement readDCF getNumRtoCConverters getRtoCConverterDescriptions + syn keyword rPrimitiveStatement getRtoCConverterStatus setToCConverterActiveStatus + syn keyword rPrimitiveStatement removeToCConverterActiveStatus lockEnvironment environmentIsLocked + syn keyword rPrimitiveStatement lockBinding unlockBinding bindingIsLocked makeActiveBinding + syn keyword rPrimitiveStatement bindingIsActive mkUnbound isNamespaceEnv registerNamespace + syn keyword rPrimitiveStatement unregisterNamespace getRegisteredNamespace getNamespaceRegistry + syn keyword rPrimitiveStatement importIntoEnv write.table +endif + +" base functions +if exists("r_package_base") && r_package_base != 0 + syn keyword rBaseStatement gammaCody besselI besselK besselJ besselY .Defunct Version provide getenv + syn keyword rBaseStatement read.table.url scan.url source.url httpclient parse.dcf .Alias reshapeWide + syn keyword rBaseStatement reshapeLong piechart machine Machine Platform restart printNoClass print.coefmat + syn keyword rBaseStatement codes codes.factor codes.ordered anovalist.lm lm.fit.null lm.wfit.null glm.fit.null + syn keyword rBaseStatement print.atomic La.eigen tetragamma pentagamma package.description .Deprecated loadURL + syn keyword rBaseStatement delay La.svd La.chol geterrmessage try comment round signif logb beta lbeta gamma + syn keyword rBaseStatement lgamma digamma trigamma psigamma factorial lfactorial choose lchoose R.Version + syn keyword rBaseStatement commandArgs args cbind rbind .deparseOpts deparse do.call drop format.info gc gcinfo + syn keyword rBaseStatement gctorture is.unsorted mem.limits nchar polyroot readline search searchpaths sprintf + syn keyword rBaseStatement t.default typeof memory.profile capabilities inherits NextMethod data.class + syn keyword rBaseStatement is.numeric.factor is.integer.factor encodeString RNGkind set.seed RNGversion .Script + syn keyword rBaseStatement all.equal all.equal.default all.equal.numeric all.equal.character all.equal.factor + syn keyword rBaseStatement all.equal.formula all.equal.language all.equal.list attr.all.equal all.names all.vars + syn keyword rBaseStatement aperm append apply array slice.index as.logical as.logical.default as.integer + syn keyword rBaseStatement as.integer.default as.double as.double.default as.complex as.complex.default + syn keyword rBaseStatement as.single as.single.default as.character.default as.expression as.expression.default + syn keyword rBaseStatement as.list as.list.default as.list.data.frame as.list.environment as.vector as.matrix + syn keyword rBaseStatement as.matrix.default as.null as.null.default as.function as.function.default as.array + syn keyword rBaseStatement as.symbol as.numeric assign attach detach ls autoload autoloader bquote forwardsolve + syn keyword rBaseStatement backsolve lockEnvironment environmentIsLocked lockBinding bindingIsLocked + syn keyword rBaseStatement makeActiveBinding bindingIsActive unlockBinding builtins by by.default by.data.frame + syn keyword rBaseStatement print.by cat strsplit substr substring abbreviate make.names make.unique chartr + syn keyword rBaseStatement tolower toupper casefold sQuote dQuote chol colSums colMeans rowSums rowMeans + syn keyword rBaseStatement tryCatch withCallingHandlers suppressWarnings simpleCondition simpleError + syn keyword rBaseStatement simpleWarning conditionMessage conditionCall conditionMessage.condition + syn keyword rBaseStatement conditionCall.condition print.condition as.character.condition as.character.error + syn keyword rBaseStatement signalCondition restartDescription restartFormals print.restart isRestart findRestart + syn keyword rBaseStatement computeRestarts invokeRestart invokeRestartInteractively withRestarts + syn keyword rBaseStatement .signalSimpleWarning .handleSimpleError conflicts stdin stdout stderr readLines + syn keyword rBaseStatement writeLines open open.connection isOpen isIncomplete isSeekable close close.connection + syn keyword rBaseStatement flush flush.connection file pipe fifo url gzfile unz bzfile socketConnection + syn keyword rBaseStatement textConnection seek seek.connection truncate truncate.connection pushBack + syn keyword rBaseStatement pushBackLength print.connection summary.connection showConnections getAllConnections + syn keyword rBaseStatement getConnection closeAllConnections readBin writeBin readChar writeChar gzcon + syn keyword rBaseStatement socketSelect contributors getNumCConverters getCConverterDescriptions + syn keyword rBaseStatement getCConverterStatus setCConverterStatus removeCConverter cut cut.default data.matrix + syn keyword rBaseStatement row.names row.names.data.frame row.names.default is.na.data.frame is.data.frame I + syn keyword rBaseStatement print.AsIs t.data.frame dim.data.frame dimnames.data.frame as.data.frame + syn keyword rBaseStatement as.data.frame.default as.data.frame.data.frame as.data.frame.list + syn keyword rBaseStatement as.data.frame.vector as.data.frame.ts as.data.frame.character as.data.frame.matrix + syn keyword rBaseStatement as.data.frame.model.matrix as.data.frame.array as.data.frame.AsIs data.frame + syn keyword rBaseStatement xpdrows.data.frame cbind.data.frame rbind.data.frame print.data.frame + syn keyword rBaseStatement as.matrix.data.frame Math.data.frame Ops.data.frame Summary.data.frame Sys.Date + syn keyword rBaseStatement as.Date as.Date.POSIXct as.Date.POSIXlt as.Date.factor as.Date.character + syn keyword rBaseStatement as.Date.default as.Date.date as.Date.dates format.Date print.Date summary.Date + syn keyword rBaseStatement Ops.Date Math.Date Summary.Date as.character.Date c.Date mean.Date seq.Date cut.Date + syn keyword rBaseStatement julian.Date weekdays.Date months.Date quarters.Date round.Date trunc.Date rep.Date + syn keyword rBaseStatement diff.Date Sys.time Sys.timezone as.POSIXlt as.POSIXct as.POSIXct.Date as.POSIXct.date + syn keyword rBaseStatement as.POSIXct.dates as.POSIXct.POSIXlt as.POSIXct.default format.POSIXlt strptime + syn keyword rBaseStatement format.POSIXct print.POSIXct print.POSIXlt summary.POSIXct summary.POSIXlt Ops.POSIXt + syn keyword rBaseStatement Math.POSIXt Summary.POSIXct Summary.POSIXlt as.character.POSIXt str.POSIXt + syn keyword rBaseStatement is.na.POSIXlt c.POSIXct c.POSIXlt all.equal.POSIXct ISOdatetime ISOdate + syn keyword rBaseStatement as.matrix.POSIXlt mean.POSIXct mean.POSIXlt difftime as.difftime print.difftime + syn keyword rBaseStatement round.difftime Ops.difftime Math.difftime mean.difftime Summary.difftime seq.POSIXt + syn keyword rBaseStatement cut.POSIXt julian julian.POSIXt weekdays weekdays.POSIXt months months.POSIXt + syn keyword rBaseStatement quarters quarters.POSIXt trunc.POSIXt round.POSIXt as.data.frame.POSIXlt rep.POSIXct + syn keyword rBaseStatement rep.POSIXlt diff.POSIXt read.dcf write.dcf delayedAssign diag diff diff.default dput + syn keyword rBaseStatement dget dump duplicated duplicated.default duplicated.data.frame duplicated.matrix + syn keyword rBaseStatement unique unique.default unique.data.frame unique.matrix dyn.load dyn.unload + syn keyword rBaseStatement getNativeSymbolInfo getLoadedDLLs getDLLRegisteredRoutines + syn keyword rBaseStatement getDLLRegisteredRoutines.character getDLLRegisteredRoutines.DLLInfo + syn keyword rBaseStatement print.NativeRoutineList print.DLLRegisteredRoutines getCallingDLL print.DLLInfo + syn keyword rBaseStatement print.DLLInfoList eapply eigen environment .GlobalEnv eval eval.parent evalq new.env + syn keyword rBaseStatement parent.env local Recall with with.default force exists expand.grid factor is.factor + syn keyword rBaseStatement as.factor category levels nlevels as.vector.factor as.character.factor print.factor + syn keyword rBaseStatement Math.factor Summary.factor Ops.factor ordered is.ordered as.ordered Ops.ordered + syn keyword rBaseStatement R.home file.show file.append file.remove file.rename list.files file.path file.exists + syn keyword rBaseStatement file.create file.choose file.copy file.symlink file.info file.access dir.create + syn keyword rBaseStatement format.octmode print.octmode system.file getwd setwd basename dirname Sys.info + syn keyword rBaseStatement Sys.sleep path.expand findInterval formals body alist format format.default + syn keyword rBaseStatement format.char format.pval formatC format.factor format.data.frame format.AsIs prettyNum + syn keyword rBaseStatement subset.data.frame subset subset.default subset.matrix transform.data.frame transform + syn keyword rBaseStatement transform.default stack.data.frame stack stack.default unstack.data.frame unstack + syn keyword rBaseStatement unstack.default get mget Sys.getenv Sys.putenv Sys.getpid gl grep sub gsub regexpr + syn keyword rBaseStatement agrep identical isTRUE ifelse interaction is.vector is.primitive jitter kappa + syn keyword rBaseStatement kappa.lm kappa.default kappa.qr kappa.tri kronecker labels labels.default lapply + syn keyword rBaseStatement lapply lazyLoad testPlatformEquivalence library print.libraryIQR library.dynam + syn keyword rBaseStatement library.dynam.unload require .packages .path.package .find.package print.packageInfo + syn keyword rBaseStatement manglePackageName .getRequiredPackages licence load save save.image sys.load.image + syn keyword rBaseStatement sys.save.image Sys.getlocale Sys.setlocale Sys.localeconv lower.tri mapply match + syn keyword rBaseStatement match match.call pmatch match.arg charmatch char.expand match.fun matrix nrow ncol + syn keyword rBaseStatement NROW NCOL rownames colnames row col crossprod t t.data.frame max.col mean + syn keyword rBaseStatement mean.default mean.data.frame merge merge.default merge.data.frame simpleMessage + syn keyword rBaseStatement suppressMessages message trace untrace .isMethodsDispatchOn tracingState mode + syn keyword rBaseStatement storage.mode names names.default getNamespace loadedNamespaces getNamespaceName + syn keyword rBaseStatement getNamespaceVersion getNamespaceExports getNamespaceImports getNamespaceUsers + syn keyword rBaseStatement getExportedValue attachNamespace loadNamespace loadingNamespaceInfo + syn keyword rBaseStatement saveNamespaceImage topenv unloadNamespace .Import .ImportFrom .Export isNamespace + syn keyword rBaseStatement isBaseNamespace getNamespaceInfo setNamespaceInfo asNamespace namespaceImport + syn keyword rBaseStatement namespaceImportFrom namespaceImportClasses namespaceImportMethods importIntoEnv + syn keyword rBaseStatement namespaceExport .mergeExportMethods packageHasNamespace parseNamespaceFile + syn keyword rBaseStatement .NotYetImplemented .NotYetUsed options getOption outer getRversion as.pairlist + syn keyword rBaseStatement pairlist parse paste pmax pmin pretty print print.default prmatrix noquote + syn keyword rBaseStatement as.matrix.noquote c.noquote print.noquote print.listof print.simple.list is.qr qr + syn keyword rBaseStatement qr.coef qr.qy qr.qty qr.resid qr.fitted qr.Q qr.R qr.X quit q range.default rank raw + syn keyword rBaseStatement as.raw charToRaw rawToChar rawShift rawToBits intToBits packBits count.fields + syn keyword rBaseStatement type.convert read.table read.csv read.delim rep rep.default rep.int replace replicate + syn keyword rBaseStatement rev rev.default rle print.rle inverse.rle rm remove rowsum.default rowsum.data.frame + syn keyword rBaseStatement sample sapply scale scale.default scan seq seq.default sequence .saveRDS .readRDS + syn keyword rBaseStatement serialize unserialize union intersect setdiff setequal is.element sink sink.number + syn keyword rBaseStatement solve.qr solve.default solve qr.solve sort order sort.list source sys.source split + syn keyword rBaseStatement split.default split.data.frame unsplit stop stopifnot warning gettext bindtextdomain + syn keyword rBaseStatement ngettext gettextf strtrim strwrap formatDL sum min max prod all any summary + syn keyword rBaseStatement summary.default summary.factor summary.matrix summary.data.frame svd sweep switch + syn keyword rBaseStatement sys.call sys.calls sys.frame sys.function sys.frames sys.nframe sys.parent + syn keyword rBaseStatement sys.parents sys.status sys.on.exit table print.table summary.table + syn keyword rBaseStatement print.summary.table as.data.frame.table is.table as.table as.table.default prop.table + syn keyword rBaseStatement margin.table tabulate tapply addTaskCallback removeTaskCallback getTaskCallbackNames + syn keyword rBaseStatement taskCallbackManager tempfile tempdir system.time date toString toString.default + syn keyword rBaseStatement traceback system unix unlink zip.file.extract unlist unname upper.tri packageEvent + syn keyword rBaseStatement getHook setHook mat.or.vec is.R shQuote vector logical character integer double + syn keyword rBaseStatement complex single warnings which which.min which.max write write.table write.csv xor + syn keyword rBaseStatement zapsmall is.na c +endif + +" graphics functions +if exists("r_package_graphics") && r_package_graphics != 0 + syn keyword rGraphicsStatement abline arrows assocplot axis axTicks barplot barplot.default box boxplot + syn keyword rGraphicsStatement boxplot.default boxplot.formula boxplot.stats bxp chull contourLines contour + syn keyword rGraphicsStatement contour.default co.intervals panel.smooth coplot curve axis.POSIXct plot.POSIXct + syn keyword rGraphicsStatement plot.POSIXlt hist.POSIXt axis.Date plot.Date hist.Date dotchart filled.contour + syn keyword rGraphicsStatement fourfoldplot grid hist hist.default plot.histogram lines.histogram nclass.Sturges + syn keyword rGraphicsStatement nclass.scott nclass.FD identify identify.default image image.default lcm layout + syn keyword rGraphicsStatement layout.show legend lines lines.default locator matpoints matlines matplot mosaicplot + syn keyword rGraphicsStatement mosaicplot.default mosaicplot.formula mtext pairs pairs.formula pairs.default par + syn keyword rGraphicsStatement persp persp.default pie xy.coords plot plot.function plot.default plot.factor + syn keyword rGraphicsStatement plot.table plot.formula lines.formula points.formula plot.xy plot.new plot.window + syn keyword rGraphicsStatement plot.data.frame .newplot.hook plot.design points points.default polygon rect rug + syn keyword rGraphicsStatement .SSget .SSexists .SSassign split.screen screen erase.screen close.screen segments + syn keyword rGraphicsStatement stars stem stripchart strwidth strheight sunflowerplot symbols text text.default + syn keyword rGraphicsStatement title xinch yinch xyinch xyz.coords +endif + +" stats functions +if exists("r_package_stats") && r_package_stats != 0 + syn keyword rStatsStatement AIC AIC.logLik AIC.default ARMAacf ARMAtoMA C HoltWinters predict.HoltWinters + syn keyword rStatsStatement residuals.HoltWinters plot.HoltWinters print.HoltWinters decompose plot.decomposed.ts + syn keyword rStatsStatement KalmanLike KalmanRun KalmanForecast KalmanSmooth StructTS print.StructTS + syn keyword rStatsStatement predict.StructTS tsdiag.StructTS tsSmooth tsSmooth.StructTS TukeyHSD TukeyHSD.aov + syn keyword rStatsStatement print.TukeyHSD plot.TukeyHSD acf pacf pacf.default plot.acf ccf print.acf add.scope + syn keyword rStatsStatement drop.scope factor.scope step extractAIC extractAIC.coxph extractAIC.survreg + syn keyword rStatsStatement extractAIC.glm extractAIC.lm extractAIC.negbin addmargins aggregate aggregate.default + syn keyword rStatsStatement aggregate.data.frame aggregate.ts printCoefmat print.anova ansari.test + syn keyword rStatsStatement ansari.test.default ansari.test.formula aov print.aov summary.aov print.summary.aov + syn keyword rStatsStatement coef.aov alias alias.formula alias.lm print.aovlist summary.aovlist + syn keyword rStatsStatement print.summary.aovlist coef.listof se.contrast se.contrast.aov se.contrast.aovlist + syn keyword rStatsStatement approx approxfun findInterval ar ar.yw ar.yw.default print.ar predict.ar ar.burg + syn keyword rStatsStatement ar.burg.default ar.mle ar.ols arima print.Arima predict.Arima makeARIMA coef.Arima + syn keyword rStatsStatement vcov.Arima logLik.Arima tsdiag.Arima tsdiag ave bw.nrd bw.SJ bw.ucv bw.bcv + syn keyword rStatsStatement bartlett.test bartlett.test.default bartlett.test.formula binom.test biplot + syn keyword rStatsStatement biplot.default biplot.princomp biplot.prcomp qbirthday pbirthday cancor chisq.test + syn keyword rStatsStatement cmdscale complete.cases confint confint.lm confint.glm confint.nls confint.default + syn keyword rStatsStatement constrOptim contr.poly poly predict.poly makepredictcall.poly polym contrasts + syn keyword rStatsStatement contr.helmert contr.treatment contr.sum contr.SAS cor cov var cor.test + syn keyword rStatsStatement cor.test.default cor.test.formula cov.wt cpgram cutree as.dendrogram + syn keyword rStatsStatement as.dendrogram.hclust .memberDend .midDend midcache.dendrogram print.dendrogram + syn keyword rStatsStatement str.dendrogram plot.dendrogram plotNode plotNodeLimit cut.dendrogram is.leaf + syn keyword rStatsStatement order.dendrogram reorder reorder.dendrogram rev.dendrogram labels.dendrogram + syn keyword rStatsStatement dendrapply heatmap density plot.density print.density D deriv deriv.formula + syn keyword rStatsStatement deriv.default diffinv diffinv.vector diffinv.default diffinv.ts toeplitz dist + syn keyword rStatsStatement format.dist as.matrix.dist as.dist as.dist.default print.dist dexp pexp qexp rexp + syn keyword rStatsStatement dunif punif qunif runif dnorm pnorm qnorm rnorm dcauchy pcauchy qcauchy rcauchy + syn keyword rStatsStatement dgamma pgamma qgamma rgamma dlnorm plnorm qlnorm rlnorm dlogis plogis qlogis rlogis + syn keyword rStatsStatement dweibull pweibull qweibull rweibull dbeta pbeta qbeta rbeta dbinom pbinom qbinom + syn keyword rStatsStatement rbinom dmultinom rmultinom dchisq pchisq qchisq rchisq df pf qf rf dgeom pgeom qgeom + syn keyword rStatsStatement rgeom dhyper phyper qhyper rhyper dnbinom pnbinom qnbinom rnbinom dpois ppois qpois + syn keyword rStatsStatement rpois dt pt qt rt ptukey qtukey dwilcox pwilcox qwilcox rwilcox dsignrank psignrank + syn keyword rStatsStatement qsignrank rsignrank dummy.coef dummy.coef.lm dummy.coef.aovlist ecdf print.ecdf + syn keyword rStatsStatement summary.ecdf plot.ecdf embed expand.model.frame factanal factanal.fit.mle + syn keyword rStatsStatement print.loadings print.factanal varimax promax family print.family power make.link + syn keyword rStatsStatement poisson quasipoisson gaussian binomial quasibinomial Gamma inverse.gaussian quasi fft + syn keyword rStatsStatement mvfft nextn convolve filter fisher.test fivenum fligner.test fligner.test.default + syn keyword rStatsStatement fligner.test.formula friedman.test friedman.test.default friedman.test.formula ftable + syn keyword rStatsStatement ftable.default ftable.formula as.table.ftable write.ftable print.ftable read.ftable + syn keyword rStatsStatement glm glm.control glm.fit print.glm anova.glm anova.glmlist stat.anova summary.glm + syn keyword rStatsStatement print.summary.glm deviance.glm effects.glm family.glm residuals.glm model.frame.glm + syn keyword rStatsStatement weights.glm formula.glm hclust plot.hclust plclust as.hclust as.hclust.default + syn keyword rStatsStatement as.hclust.twins print.hclust cophenetic cophenetic.default cophenetic.dendrogram + syn keyword rStatsStatement print.htest rect.hclust identify.hclust integrate print.integrate interaction.plot + syn keyword rStatsStatement isoreg fitted.isoreg residuals.isoreg print.isoreg plot.isoreg kernel print.tskernel + syn keyword rStatsStatement plot.tskernel df.kernel bandwidth.kernel is.tskernel kernapply kernapply.vector + syn keyword rStatsStatement kernapply.default kernapply.ts kernapply.tskernel kmeans print.kmeans kruskal.test + syn keyword rStatsStatement kruskal.test.default kruskal.test.formula ks.test ksmooth lag lag.default lag.plot lm + syn keyword rStatsStatement lm.fit lm.wfit print.lm summary.lm print.summary.lm residuals.lm weights.default + syn keyword rStatsStatement deviance.lm formula.lm family.lm model.frame.lm variable.names.lm case.names.lm + syn keyword rStatsStatement anova.lm anova.lmlist predict.lm effects.lm model.matrix.lm predict.mlm labels.lm hat + syn keyword rStatsStatement weighted.residuals lm.influence influence influence.lm influence.glm hatvalues + syn keyword rStatsStatement hatvalues.lm rstandard rstandard.lm rstandard.glm rstudent rstudent.lm rstudent.glm + syn keyword rStatsStatement dffits dfbeta dfbeta.lm dfbetas dfbetas.lm covratio cooks.distance cooks.distance.lm + syn keyword rStatsStatement cooks.distance.glm influence.measures print.infl summary.infl loess loess.control + syn keyword rStatsStatement simpleLoess predict.loess predLoess pointwise print.loess summary.loess + syn keyword rStatsStatement print.summary.loess scatter.smooth loess.smooth anova.loess logLik print.logLik + syn keyword rStatsStatement str.logLik as.data.frame.logLik logLik.glm logLik.lm loglin lowess lsfit ls.diag + syn keyword rStatsStatement ls.print mad mahalanobis manova summary.manova print.summary.manova mantelhaen.test + syn keyword rStatsStatement mcnemar.test median medpolish print.medpolish plot.medpolish summary.mlm SSD estVar + syn keyword rStatsStatement SSD.mlm estVar.SSD estVar.mlm Tr proj.matrix Rank Thin.row Thin.col mauchley.test + syn keyword rStatsStatement mauchley.test.mlm mauchley.test.SSD sphericity anova.mlm Pillai Wilks HL Roy + syn keyword rStatsStatement anova.mlmlist deviance.mlm plot.mlm model.tables model.tables.aov se.aov + syn keyword rStatsStatement model.tables.aovlist se.aovlist make.tables.aovproj make.tables.aovprojlist + syn keyword rStatsStatement replications eff.aovlist model.frame.aovlist print.mtable formula formula.default + syn keyword rStatsStatement formula.formula formula.terms formula.data.frame print.formula as.formula terms + syn keyword rStatsStatement terms.default terms.terms print.terms labels.terms delete.response reformulate + syn keyword rStatsStatement drop.terms terms.formula coef coef.default residuals residuals.default deviance + syn keyword rStatsStatement deviance.default fitted fitted.default anova effects weights df.residual + syn keyword rStatsStatement df.residual.default variable.names variable.names.default case.names + syn keyword rStatsStatement case.names.default offset .checkMFClasses .MFclass model.frame model.frame.default + syn keyword rStatsStatement model.weights model.offset model.matrix model.matrix.default model.response + syn keyword rStatsStatement model.extract preplot update is.empty.model makepredictcall makepredictcall.default + syn keyword rStatsStatement .getXlevels monthplot monthplot.StructTS monthplot.stl monthplot.ts monthplot.default + syn keyword rStatsStatement mood.test mood.test.default mood.test.formula na.contiguous na.contiguous.default + syn keyword rStatsStatement na.pass na.action na.action.default na.fail na.fail.default na.omit na.omit.default + syn keyword rStatsStatement na.omit.data.frame na.exclude na.exclude.default na.exclude.data.frame naresid + syn keyword rStatsStatement naresid.default naresid.exclude naprint naprint.default naprint.exclude napredict + syn keyword rStatsStatement napredict.default napredict.exclude nlm optimize uniroot profiler profiler.nls + syn keyword rStatsStatement profile.nls plot.profile.nls numericDeriv nlsModel.plinear nlsModel nls.control nls + syn keyword rStatsStatement coef.nls print.nls summary.nls print.summary.nls coef.summary.nls weights.nls + syn keyword rStatsStatement predict.nls fitted.nls formula.nls residuals.nls logLik.nls df.residual.nls + syn keyword rStatsStatement deviance.nls vcov.nls anova.nls anovalist.nls asOneSidedFormula setNames clearNames + syn keyword rStatsStatement oneway.test optim p.adjust pairwise.t.test pairwise.wilcox.test pairwise.prop.test + syn keyword rStatsStatement pairwise.table print.pairwise.htest plot.lm power.t.test power.prop.test + syn keyword rStatsStatement print.power.htest power.anova.test ppoints ppr ppr.formula ppr.default print.ppr + syn keyword rStatsStatement summary.ppr print.summary.ppr plot.ppr predict.ppr prcomp prcomp.default + syn keyword rStatsStatement prcomp.formula plot.prcomp print.prcomp summary.prcomp print.summary.prcomp + syn keyword rStatsStatement predict.prcomp predict predict.default predict.glm predict.princomp summary.princomp + syn keyword rStatsStatement print.summary.princomp plot.princomp screeplot loadings princomp princomp.formula + syn keyword rStatsStatement princomp.default print.princomp profile proj proj.default proj.lm proj.aov + syn keyword rStatsStatement proj.aovlist terms.aovlist prop.test prop.trend.test qqnorm qqnorm.default qqline + syn keyword rStatsStatement qqplot quade.test quade.test.default quade.test.formula quantile quantile.default IQR + syn keyword rStatsStatement relevel relevel.default relevel.ordered relevel.factor reorder.factor reshape runmed + syn keyword rStatsStatement smoothEnds sd selfStart selfStart.default selfStart.formula getInitial + syn keyword rStatsStatement getInitial.formula getInitial.selfStart getInitial.default sortedXyData + syn keyword rStatsStatement sortedXyData.default NLSstClosestX NLSstClosestX.sortedXyData NLSstRtAsymptote + syn keyword rStatsStatement NLSstRtAsymptote.sortedXyData NLSstLfAsymptote NLSstLfAsymptote.sortedXyData + syn keyword rStatsStatement NLSstAsymptotic NLSstAsymptotic.sortedXyData shapiro.test smooth print.tukeysmooth + syn keyword rStatsStatement summary.tukeysmooth smooth.spline print.smooth.spline predict.smooth.spline + syn keyword rStatsStatement predict.smooth.spline.fit supsmu spectrum spec.taper spec.ar spec.pgram plot.spec + syn keyword rStatsStatement plot.spec.coherency plot.spec.phase spline splinefun stepfun is.stepfun as.stepfun + syn keyword rStatsStatement as.stepfun.default knots knots.stepfun print.stepfun summary.stepfun plot.stepfun + syn keyword rStatsStatement lines.stepfun as.stepfun.isoreg stl print.stl summary.stl plot.stl symnum t.test + syn keyword rStatsStatement t.test.default t.test.formula termplot Box.test PP.test start end frequency time + syn keyword rStatsStatement window cycle deltat ts tsp hasTsp is.ts as.ts as.ts.default .cbind.ts .makeNamesTs + syn keyword rStatsStatement Ops.ts cbind.ts ts.union ts.intersect diff.ts na.omit.ts is.mts start.default + syn keyword rStatsStatement end.default frequency.default deltat.default time.default time.ts cycle.default + syn keyword rStatsStatement cycle.ts print.ts plot.ts lines.ts window.default window.ts t.ts ts.plot arima.sim + syn keyword rStatsStatement line update.default update.formula var.test var.test.default var.test.formula vcov + syn keyword rStatsStatement vcov.glm vcov.lm vcov.mlm vcov.gls vcov.lme weighted.mean wilcox.test + syn keyword rStatsStatement wilcox.test.default wilcox.test.formula xtabs print.xtabs SSasymp SSgompertz + syn keyword rStatsStatement SSweibull .onLoad .onUnload +endif + +" tools functions +if exists("r_package_tools") && r_package_tools != 0 + syn keyword rToolsStatement undoc print.undoc codoc print.codoc codocClasses print.codocClasses codocData + syn keyword rToolsStatement print.codocData checkDocFiles print.checkDocFiles checkDocStyle print.checkDocStyle + syn keyword rToolsStatement checkFF print.checkFF checkReplaceFuns print.checkReplaceFuns checkTnF print.checkTnF + syn keyword rToolsStatement as.alist.call as.alist.symbol Rdinfo Rdcontents Rdindex checkVignettes + syn keyword rToolsStatement print.checkVignettes pkgVignettes buildVignettes vignetteMetaRE vignetteInfo + syn keyword rToolsStatement .writeVignetteHtmlIndex vignetteDepends getVigDepMtrx makeLazyLoadDB makeLazyLoading + syn keyword rToolsStatement package.dependencies pkgDepends getDepList isSatisfied buildDepList getDepMtrx + syn keyword rToolsStatement getRemotePkgDepends installedDepends foundDepends compareDependsPkgVersion + syn keyword rToolsStatement reduceDepends depMtrxToStrings installFoundDepends filePathAsAbsolute filePathSansExt + syn keyword rToolsStatement fileTest listFilesWithExts listFilesWithType delimMatch .OStype xgettext + syn keyword rToolsStatement print.xgettext print.xngettext xngettext .onUnload +endif + +" methods functions +if exists("r_package_methods") && r_package_methods != 0 + syn keyword rMethodsStatement .InitBasicClassMethods .BasicFunsList .addBasicGeneric genericForPrimitive + syn keyword rMethodsStatement setGenericForPrimitive .findBasicFuns .InitExtensions .simpleExtCoerce + syn keyword rMethodsStatement .simpleIsCoerce .simpleExtTest .simpleExtReplace .InhSlotNames .dataPartReplace + syn keyword rMethodsStatement .ErrorReplace .objectSlotNames makeExtends .findAll .InitClassUnion setClassUnion + syn keyword rMethodsStatement isClassUnion setGeneric isGeneric removeGeneric getMethods getMethodsForDispatch + syn keyword rMethodsStatement .setIfBase .getMethodsForDispatch .setMethodsForDispatch cacheMethod setMethod + syn keyword rMethodsStatement removeMethod findMethod getMethod dumpMethod selectMethod hasMethod existsMethod + syn keyword rMethodsStatement dumpMethods signature showMethods removeMethodsObject removeMethods resetGeneric + syn keyword rMethodsStatement setReplaceMethod setGroupGeneric isGroup callGeneric initMethodDispatch + syn keyword rMethodsStatement isSealedMethod .lockedForMethods MethodsList makeMethodsList SignatureMethod + syn keyword rMethodsStatement insertMethod MethodsListSelect emptyMethodsList insertMethodInEmptyList + syn keyword rMethodsStatement finalDefaultMethod inheritedSubMethodLists matchSignature showMlist promptMethods + syn keyword rMethodsStatement linearizeMlist print.MethodsList listFromMlist .insertCachedMethods .addMethodFrom + syn keyword rMethodsStatement asMethodDefinition .InitMethodsListClass .InitMethodDefinitions .MakeSignature + syn keyword rMethodsStatement .findNextMethod .hasCallNextMethod callNextMethod loadMethod .doSubNextCall + syn keyword rMethodsStatement testVirtual makePrototypeFromClassDef newEmptyObject completeClassDefinition + syn keyword rMethodsStatement .completeClassSlots .uncompleteClassDefinition .isIndirectExtension .mergeSlots + syn keyword rMethodsStatement getAllSuperClasses superClassDepth isVirtualClass assignClassDef .InitClassDefinition + syn keyword rMethodsStatement .initClassSupport newBasic defaultPrototype reconcilePropertiesAndPrototype tryNew + syn keyword rMethodsStatement empty.dump isClassDef showClass showExtends print.classRepresentation possibleExtends + syn keyword rMethodsStatement .possibleExtends completeExtends completeSubclasses .walkClassGraph classMetaName + syn keyword rMethodsStatement methodsPackageMetaName requireMethods .missingMethod getSlots validSlotNames + syn keyword rMethodsStatement getDataPart setDataPart .validDataPartClass .mergeAttrs .newExternalptr + syn keyword rMethodsStatement .transitiveExtends .transitiveSubclasses .combineExtends .simpleCoerceExpr + syn keyword rMethodsStatement .simpleReplaceExpr newClassRepresentation .tempClassDef .newClassRepresentation + syn keyword rMethodsStatement .insertExpr substituteFunctionArgs .makeValidityMethod .mergeClassDefSlots + syn keyword rMethodsStatement ..mergeClassDefSlots .gblEnv ..isPrototype .isPrototype .className .requirePackage + syn keyword rMethodsStatement ..requirePackage .classDefEnv .asEnvironmentPackage .classEnv ..classEnv .genEnv + syn keyword rMethodsStatement .makeGeneric makeGeneric makeStandardGeneric generic.skeleton defaultDumpName + syn keyword rMethodsStatement getAllMethods mergeMethods doPrimitiveMethod conformMethod rematchDefinition + syn keyword rMethodsStatement unRematchDefinition getGeneric .getGeneric getGroup getMethodsMetaData + syn keyword rMethodsStatement assignMethodsMetaData mlistMetaName getGenerics .getGenerics cacheMetaData + syn keyword rMethodsStatement cacheGenericsMetaData setPrimitiveMethods findUnique MethodAddCoerce missingArg + syn keyword rMethodsStatement balanceMethodsList sigToEnv .methodSignatureMatrix .valueClassTest + syn keyword rMethodsStatement .getOrMakeMethodsList .makeCallString .ValidateValueClass .asGroupArgument + syn keyword rMethodsStatement metaNameUndo .recursiveCallTest .NonstandardGenericTest .GenericInPrimitiveMethods + syn keyword rMethodsStatement .signatureString .ChangeFormals .envSearch .genericName .genericEnv + syn keyword rMethodsStatement .externalCallerEnv .parentEnvList .genericAssign .derivedDefaultMethod .identC + syn keyword rMethodsStatement .matchBasic matchDefaults getGroupMembers deletePrimMethods setClass representation + syn keyword rMethodsStatement prototype .prototype makeClassRepresentation getClassDef getClass slot + syn keyword rMethodsStatement checkSlotAssignment slotNames .slotNames removeClass isClass new getClasses + syn keyword rMethodsStatement validObject setValidity resetClass initialize findClass isSealedClass sealClass + syn keyword rMethodsStatement sessionData traceOn traceOff browseAll functionBody .ff allNames getFunction el + syn keyword rMethodsStatement elNamed formalArgs findFunction existsFunction Quote .message hasArg as + syn keyword rMethodsStatement .quickCoerceSelect .asFromReplace setAs .setCoerceGeneric .basicCoerceMethod + syn keyword rMethodsStatement .makeAsMethod .removePreviousCoerce is extends setIs .validExtends languageEl + syn keyword rMethodsStatement isGrammarSymbol .makeBasicFuns .InitSubsetMethods setOldClass .oldTestFun + syn keyword rMethodsStatement .oldCoerceFun .oldReplaceFun .setOldIs getPackageName setPackageName packageSlot + syn keyword rMethodsStatement .makeCallString showDefault show .InitShowMethods classLabel substituteDirect + syn keyword rMethodsStatement .TraceWithMethods .makeTracedFunction .untracedFunction .InitTraceFunctions + syn keyword rMethodsStatement .doTracePrint .traceClassName trySilent .assignOverBinding .setMethodOverBinding + syn keyword rMethodsStatement .searchNamespaceNames .findFunEnvAndName ..First.lib .onLoad .onUnload .onAttach + syn keyword rMethodsStatement .Last.lib .Last.lib +endif + +" utils functions +if exists("r_package_utils") && r_package_utils != 0 + syn keyword rUtilsStatement RSiteSearch Rprof Sweave SweaveReadFile SweaveGetSyntax SweaveSyntConv + syn keyword rUtilsStatement SweaveParseOptions SweaveHooks RweaveLatex RweaveLatexSetup RweaveLatexRuncode + syn keyword rUtilsStatement RweaveLatexWritedoc RweaveLatexFinish RweaveLatexOptions RweaveChunkPrefix + syn keyword rUtilsStatement RweaveEvalWithOpt RweaveTryStop Stangle Rtangle RtangleSetup RtangleRuncode + syn keyword rUtilsStatement RtangleWritedoc RtangleFinish alarm apropos find citEntry citHeader citFooter + syn keyword rUtilsStatement readCitationFile print.citation print.citationList person as.person as.person.default + syn keyword rUtilsStatement personList as.personList as.personList.person as.personList.default + syn keyword rUtilsStatement as.character.person as.character.personList toBibtex.person toBibtex.personList + syn keyword rUtilsStatement toBibtex.citation toBibtex.citationList citation data browseEnv wsbrowser de.ncols + syn keyword rUtilsStatement de.setup de.restore de data.entry dump.frames debugger limitedLabels recover demo + syn keyword rUtilsStatement dataentry edit edit.default edit.data.frame edit.matrix file.edit vi emacs xemacs + syn keyword rUtilsStatement xedit pico example head head.default head.data.frame head.function tail tail.default + syn keyword rUtilsStatement tail.data.frame tail.matrix tail.function help help.search print.hsearch + syn keyword rUtilsStatement printhsearchInternal loadhistory savehistory history iconv iconvlist localeToCharset + syn keyword rUtilsStatement packageDescription print.packageDescription index.search print.packageIQR menu + syn keyword rUtilsStatement getCRANmirrors checkCRAN object.size findGeneric methods print.MethodsFunction + syn keyword rUtilsStatement getFromNamespace assignInNamespace fixInNamespace getAnywhere print.getAnywhere + syn keyword rUtilsStatement package.skeleton packageStatus summary.packageStatus print.packageStatus + syn keyword rUtilsStatement update.packageStatus upgrade upgrade.packageStatus available.packages CRAN.packages + syn keyword rUtilsStatement simplifyRepos update.packages old.packages new.packages installed.packages + syn keyword rUtilsStatement remove.packages download.packages contrib.url chooseCRANmirror setRepositories + syn keyword rUtilsStatement normalizePath compareVersion install.packages page prompt prompt.default + syn keyword rUtilsStatement prompt.data.frame promptData topicName .helpForCall .tryHelp read.fortran read.fwf + syn keyword rUtilsStatement url.show sessionInfo print.sessionInfo toLatex.sessionInfo print.socket make.socket + syn keyword rUtilsStatement close.socket read.socket write.socket str str.data.frame str.default ls.str lsf.str + syn keyword rUtilsStatement summaryRprof toBibtex print.Bibtex toLatex print.Latex bug.report download.file nsl + syn keyword rUtilsStatement help.start browseURL make.packages.html link.html.help package.contents vignette + syn keyword rUtilsStatement print.vignette edit.vignette select.list flush.console +endif + +" Special +syn match rDelimiter /[,;:]/ + +" Error +syn region rParenRegion matchgroup=rParenDelimiter start=/(/ end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError +syn region rCurlyRegion matchgroup=rCurlyDelimiter start=/{/ end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold +syn region rBraceRegion matchgroup=rBraceDelimiter start=/\[/ end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError +syn match rError /[)\]}]/ +syn match rBraceError /[)}]/ contained +syn match rCurlyError /[)\]]/ contained +syn match rParenError /[\]}]/ contained + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_r_syn_inits") + if version < 508 + let did_r_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + HiLink rComment Comment + HiLink rConstant Constant + HiLink rString String + HiLink rNumber Number + HiLink rBoolean Boolean + HiLink rFloat Float + HiLink rStatement Statement + HiLink rBaseStatement Statement + HiLink rStatsStatement Statement + HiLink rGraphicsStatement Statement + HiLink rToolsStatement Statement + HiLink rMethodsStatement Statement + HiLink rUtilsStatement Statement + HiLink rPrimitiveStatement Statement + HiLink rConditional Conditional + HiLink rRepeat Repeat + HiLink rIdentifier Identifier + HiLink rFunction Function + HiLink rArrow Statement + HiLink rType Type + HiLink rDelimiter Delimiter + HiLink rStringDelimiter Delimiter + HiLink rParenDelimiter Delimiter + HiLink rCurlyDelimiter Delimiter + HiLink rBraceDelimiter Delimiter + HiLink rError Error + HiLink rParenError Error + HiLink rCurlyError Error + HiLink rBraceError Error + delcommand HiLink +endif + +let b:current_syntax="r" +" vim: ts=8 sw=2 diff --git a/dot_vim/syntax/tex.vim b/dot_vim/syntax/tex.vim new file mode 100644 index 0000000..675a390 --- /dev/null +++ b/dot_vim/syntax/tex.vim @@ -0,0 +1 @@ +set textwidth=80 |