From fd2001cd614dfa0d55ec820b7c358a1795d3ea27 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Tue, 14 Dec 2021 11:42:41 -0500 Subject: Simplify vim configuration --- dot_vim/doc/csupport.txt | 1577 --------------- dot_vim/doc/haskellmode.txt | 456 ----- dot_vim/doc/imaps.txt | 116 -- dot_vim/doc/latex-suite-quickstart.txt | 448 ----- dot_vim/doc/latex-suite.txt | 3418 -------------------------------- dot_vim/doc/latexhelp.txt | 2430 ----------------------- dot_vim/doc/ps_color.txt | 585 ------ dot_vim/doc/taglist.txt | 1501 -------------- dot_vim/doc/tags | 1138 ----------- 9 files changed, 11669 deletions(-) delete mode 100644 dot_vim/doc/csupport.txt delete mode 100644 dot_vim/doc/haskellmode.txt delete mode 100644 dot_vim/doc/imaps.txt delete mode 100644 dot_vim/doc/latex-suite-quickstart.txt delete mode 100644 dot_vim/doc/latex-suite.txt delete mode 100644 dot_vim/doc/latexhelp.txt delete mode 100644 dot_vim/doc/ps_color.txt delete mode 100755 dot_vim/doc/taglist.txt delete mode 100644 dot_vim/doc/tags (limited to 'dot_vim/doc') diff --git a/dot_vim/doc/csupport.txt b/dot_vim/doc/csupport.txt deleted file mode 100644 index 266b8db..0000000 --- a/dot_vim/doc/csupport.txt +++ /dev/null @@ -1,1577 +0,0 @@ -*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 - -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 :cp - map :cn -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=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 - ---------------------------------------------------------------------------- - The cursor position after insertion of a template - 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 -). - - 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: - * Description: - * ====================================================================== - */ - -The definition of a template ends at the next head line or at the end of the -file. - -Templates for the visual mode can use . The text before will -than be inserted above the marked area, the text after will be -inserted behind the marked area. An example: - - == statements.if-block-else == - if ( ) { - } else { - } - -If applied to the marked block - - xxxxxxxxxxx - xxxxxxxxxxx - -this template yields - - if ( ) { - xxxxxxxxxxx - xxxxxxxxxxx - } else { - } - -The templates with a visual mode are shown in the table under -|csupport-templates-names|. - -5.3.3 Template expansion *csupport-templates-expansion* - -There are additional ways to control the expansion of a template. - -USER INPUT ----------- -If the usage of a yet undefined user macro starts with a question mark the -user will be asked for the replacement first, e.g. with the following template - - == idioms.function == - void - *|?FUNCTION_NAME|* ( ) - { - return ; - } /* ----- end of function*|FUNCTION_NAME|* ----- */ - -The can specify the function name which then will be applied twice. If the -macro was already in use the old value will be suggested as default. - -MACRO MANIPULATION ------------------- - -A macro expansion can be controlled by the following attributes - - :l change macro text to lowercase - :u change macro text to uppercase - :c capitalize macro text - :L legalize name - -The include guard template is an example for the use of ':L' : - - == preprocessor.ifndef-def-endif == - #ifndef *|?BASENAME:L|_INC* - #define *|BASENAME|_INC* - - #endif // ----- #ifndef*|BASENAME|_INC* ----- - -The base name of the file shall be used as part of the include guard name. -The predefined macro*|BASENAME|* is used to ask for this part because this -macro has already a defined value. That value can accepted or replaced by the -user. For the filename 'test test++test.h' the legalized base name -'TEST_TEST_TEST' will be suggested. - -Legalization means: - - replace all whitespaces by underscores - - replace all non-word characters by underscores - - replace '+' and '-' by underscore - - -============================================================================== -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 :Tlist - inoremap :Tlist - - 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 deleted file mode 100644 index 905349c..0000000 --- a/dot_vim/doc/haskellmode.txt +++ /dev/null @@ -1,456 +0,0 @@ -*haskellmode.txt* Haskell Mode Plugins 23/04/2009 - -Authors: - Claus Reinke ~ - -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 ()' for id under cursor -|_im| add 'import ' for id under cursor -|_iq| add 'import qualified ()' for id under cursor -|_iqm| add 'import qualified ' 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||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] ()' - 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] ' 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 ' 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 deleted file mode 100644 index 087b3db..0000000 --- a/dot_vim/doc/imaps.txt +++ /dev/null @@ -1,116 +0,0 @@ - IMAP -- A fluid replacement for :imap - *imaps.txt* - Srinath Avadhanula - - - - 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 map to for all files of type . - -Some characters in the 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}\\\item <++>\\\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 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 command to insert dynamic elements such as -dates. > - call IMAP ('date`', "\=strftime('%b %d %Y')\", '') - - - -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 deleted file mode 100644 index 8c18b72..0000000 --- a/dot_vim/doc/latex-suite-quickstart.txt +++ /dev/null @@ -1,448 +0,0 @@ - A (very) quick introduction to Latex-Suite - *latex-suite-quickstart.txt* - Srinath Avadhanula - - - - 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 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 . 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 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 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 -. (Remember: is very useful!) This time, the line will change to: > - \begin{eqnarray} - \label{}<++> - \end{eqnarray}<++> -. 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 . 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 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 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 -. The line which you were editing will change to: > - This is a reference to (\ref{eqn:euler}) - 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 - 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 deleted file mode 100644 index a44cd9b..0000000 --- a/dot_vim/doc/latex-suite.txt +++ /dev/null @@ -1,3418 +0,0 @@ - Latex-Suite Reference - *latex-suite.txt* - Srinath Avadhanula - Mikolaj Machowski - - - - 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 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 (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 *ls_3_1_1_1* *ls_a_bh* - *inserting-env-f5* - -If you press 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 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 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 - *ls_3_1_1_2* *ls_a_bi* - *inserting-env-shift-f1* - -The shifted function keys, to 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 *ls_3_1_2_1* *ls_a_bl* - *enclosing-env-f5* - -You can also select a portion of text visually and press 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 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 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 in normal mode has the same effect as pressing 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 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 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 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 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 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. > - + expands to \v{} - = expands to \'{} -where 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 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 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 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 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 key. - -NOTE: By default, typing Alt- in Vim takes focus to the menu bar if a menu - with the hotkey 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 keys, (some European - users need to use the key to enter diacritics), you can change these - maps to other keys as described in the section Customizing Alt-key maps - [|ls_a_cx|]. - - - - - *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{<++>}<++>. - - - *ls_3_10_2* *ls_a_bC* *Alt-B* - -This insert-mode mapping encloses the previous character in \mathbf{}. - - - *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{} - - - *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, has styles -defined forthe following environments: - -Environment Style~ -itemize \item -enumerate \item -theindex \item -thebibliography \item[<+biblabel+>]{<+bibkey+>} <++> -description \item[<+label+>] <++> - - 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 - % will insert "\item[<+label+>] <++>" if - % used here - \end{description} - \item third item - % will insert "\item " when if used here. - \end{itemize} - % will insert nothing ("") if used here -< - -The style used by 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 etc. - To do this, you will need to specify the second argument in - double-quotes as follows: > - :call IMAP('EFE', "\\begin{figure}\<++>\\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', "\=MyFoonction()\", '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', "\=AskVimFunc()\", '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 = '' - else - let sidstr = '' - endif - return IMAP_PutTextWithMovement( - \ "\" ".name.": <+short description+> \" . - \ "Description: <+long description+>\" . - \ "\function! ".name."(<+arguments+>)<++>\" . - \ "<+function body+>\" . - \ "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 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 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 > Options - -TeX-Suite > Packages > Commands - -where 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 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 -[|ls_a_bh|] or [|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_ *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_ *ls_4_4_2* *ls_a_bQ* - - > - - g:TeX_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[<