├── .gitignore ├── README.md ├── autoload ├── mmtemplates │ ├── config.vim │ ├── core.vim │ └── wizard.vim ├── mmtoolbox │ ├── bash │ │ └── bashdb.vim │ ├── cmake.vim │ ├── doxygen.vim │ ├── helloworld.vim │ ├── make.vim │ ├── tools.vim │ └── worldview.vim ├── perlsupportprofiling.vim └── perlsupportregex.vim ├── awk-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── month-array │ └── rule-file-not-found ├── doc │ ├── ChangeLog │ └── awk-hotkeys.tex ├── rc │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.gvimrc │ ├── customization.vimrc │ └── personal.templates ├── scripts │ └── wrapper.sh ├── templates │ ├── Templates │ ├── comments.templates │ ├── functions.templates │ ├── idioms.templates │ ├── regex.templates │ ├── specvar.templates │ └── statements.templates └── wordlists │ └── awk-keywords.list ├── bash-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── _trap_DEBUG │ ├── _trap_ERR │ ├── _trap_EXIT │ ├── _trap_RETURN │ ├── basename+pathname │ ├── check-for-signed-integer │ ├── check-for-unsigned-integer │ ├── check-number-of-command-line-arguments │ ├── create-tempfile │ ├── create-tempfile-in-secure-manner │ ├── create-tempfile-with-trap │ ├── debugging │ │ ├── _debug_PS4 │ │ ├── _debug_assert │ │ ├── _debug_function.noindent │ │ ├── _debug_print_pos_param │ │ └── _debug_timestamp.noindent │ ├── free-software-comment │ ├── timestamp │ ├── usage-and-command-line-arguments.noindent │ ├── use-file-descriptor-read │ ├── use-file-descriptor-write │ └── well-behaved-script ├── doc │ ├── ChangeLog │ └── bash-hotkeys.tex ├── rc │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.bashrc │ ├── customization.gvimrc │ ├── customization.vimrc │ ├── personal.templates │ └── sh.vim ├── scripts │ └── wrapper.sh ├── templates │ ├── Templates │ ├── builtins.templates │ ├── comments.templates │ ├── environment.templates │ ├── io-redirection.templates │ ├── paramsub.templates │ ├── patternmatching.templates │ ├── regexp.templates │ ├── set.templates │ ├── shelloptions.templates │ ├── specialparams.templates │ ├── statements.templates │ └── tests.templates └── wordlists │ └── bash-keywords.list ├── c-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── Makefile │ ├── Makefile.multi-target.template │ ├── Makefile.pro │ ├── calloc_double_matrix.c │ ├── calloc_int_matrix.c │ ├── main.c │ ├── main.cc │ ├── print_array.cc.noindent │ ├── print_double_array.c.noindent │ └── print_int_array.c.noindent ├── doc │ ├── ChangeLog │ └── c-hotkeys.tex ├── rc │ ├── c.vim │ ├── cpp.vim │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.ctags │ ├── customization.gvimrc │ ├── customization.indent.pro │ ├── customization.vimrc │ ├── make.vim │ ├── personal.templates │ └── project │ │ └── in.vim ├── scripts │ └── wrapper.sh ├── templates │ ├── Templates │ ├── c.comments.template │ ├── c.cpp.template │ ├── c.idioms.template │ ├── c.preprocessor.template │ ├── c.statements.template │ ├── cpp.comments.template │ ├── cpp.cpp.template │ ├── cpp.idioms.template │ ├── cpp.preprocessor.template │ ├── cpp.statements.template │ ├── doxygen.template │ ├── help.template │ └── snippets.template └── wordlists │ ├── c-c++-keywords.list │ ├── k+r.list │ └── stl_index.list ├── checkversion.sh ├── doc ├── awksupport.txt ├── bashdbintegration.txt ├── bashsupport.txt ├── csupport.txt ├── internal │ └── templateinternal.txt ├── latexsupport.txt ├── luaref51.txt ├── luaref52.txt ├── luaref53.txt ├── luasupport.txt ├── perlsupport.txt ├── templatesupport.txt ├── toolbox.txt ├── toolboxcmake.txt ├── toolboxdoxygen.txt ├── toolboxmake.txt └── vimsupport.txt ├── ftdetect └── template.vim ├── ftplugin ├── bashhelp.vim └── template.vim ├── latex-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── beamer │ │ ├── toc-at-begin-sections.tex │ │ └── toc-at-begin-subsections.tex │ ├── listings-basic-settings.tex │ └── vim-modeline.tex ├── doc │ ├── ChangeLog │ └── latex-hotkeys.tex ├── rc │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.ctags │ ├── customization.gvimrc │ ├── customization.vimrc │ ├── make.vim │ ├── personal.templates │ └── tex.vim ├── templates │ ├── Templates │ ├── beamer.templates │ ├── bibtex.templates │ ├── comments.templates │ ├── document.templates │ ├── environments.templates │ ├── math.templates │ ├── resources.templates │ ├── text.templates │ └── wizard.templates └── wordlists │ └── latex-keywords.list ├── lua-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── choose_loader_func.lua │ ├── load_in_env.lua │ ├── package_config.lua │ ├── print_cmdline_arguments.lua │ ├── print_table.lua │ ├── randomseed.lua │ ├── script_with_options.lua │ └── set_c_locale.lua ├── doc │ └── ChangeLog ├── html2doc │ └── html2vim.lua ├── lua-doc │ ├── library_5_1.txt │ ├── library_5_2.txt │ └── library_5_3.txt ├── rc │ ├── additions.gvimrc │ ├── additions.vimrc │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.gvimrc │ ├── customization.vimrc │ ├── lua.vim │ └── personal.templates ├── templates-c-api │ ├── Templates │ ├── library_5_2.templates │ └── lua.templates └── templates │ ├── Templates │ ├── comments.templates │ ├── files.templates │ ├── idioms.templates │ ├── library_5_1.templates │ ├── library_5_2.templates │ ├── library_5_3.templates │ ├── objects.templates │ ├── regex.templates │ └── statements.templates ├── perl-support ├── README.md ├── README.standalone.md ├── codesnippets │ ├── RegularExpressions │ │ ├── numeric-range-0-127 │ │ └── numeric-range-0-255 │ ├── SmallProf-variables.pl │ ├── dot.SmallProf │ ├── free-software-comment │ ├── module-interface.pl │ ├── new.pl │ ├── pod-template-application.pl │ ├── pod-template-module.pl │ ├── print-data-structure-with-Dumper.pl │ ├── print-hash-sorted.pl │ ├── print-hash.pl │ ├── process-all-files-in-a-directory-recursively.pl │ └── slurp-file.pl ├── doc │ ├── ChangeLog │ ├── perl-hot-keys.tex │ └── pmdesc3.text ├── modules │ └── perl-modules.list ├── rc │ ├── custom.templates │ ├── custom_with_personal.templates │ ├── customization.ctags │ ├── customization.gvimrc │ ├── customization.perltidyrc │ ├── customization.smallprof │ ├── customization.vimrc │ ├── make.vim │ ├── perl.vim │ ├── personal.templates │ ├── pod.vim │ └── qf.vim ├── scripts │ ├── csv2err.pl │ ├── pmdesc3.pl │ └── wrapper.sh ├── templates │ ├── Templates │ ├── comments.templates │ ├── filetests.templates │ ├── idioms.templates │ ├── pod.templates │ ├── regex.templates │ ├── snippets.templates │ ├── specvar.templates │ └── statements.templates └── wordlists │ └── perl.list ├── plugin ├── awk-support.vim ├── bash-support.vim ├── c.vim ├── latex-support.vim ├── lua-support.vim ├── perl-support.vim ├── template-support.vim └── vim-support.vim ├── project ├── TODO.txt ├── filter-vimtags.pl ├── make-html.sh ├── maps_overview.txt ├── options_buffers.txt ├── release.lua ├── scripts │ ├── check_repos.sh │ ├── get_cmake_policies.sh │ ├── update_repos.sh │ └── vim-doc-ref.pl ├── tool_menu_priorities.txt ├── vim2html.pl └── vim_org │ ├── awk-support.txt │ ├── bash-support.txt │ ├── c-support.txt │ ├── latex-support.txt │ ├── lua-support.txt │ ├── perl-support.txt │ └── vim-support.txt ├── syntax ├── bashhelp.vim └── template.vim ├── template-support ├── README.md └── templates │ ├── Templates │ ├── comments.templates │ ├── functions.templates │ ├── list.templates │ └── templ.templates └── vim-support ├── README.md ├── README.standalone.md ├── codesnippets └── plugin-start.vim ├── doc ├── ChangeLog └── vim-hotkeys.tex ├── rc ├── custom.templates ├── custom_with_personal.templates ├── customization.gvimrc ├── customization.vimrc ├── personal.templates └── vim.vim └── templates ├── Templates ├── comments.templates ├── documentation.templates ├── functions.templates ├── idioms.templates ├── perl.templates ├── regex.templates └── statements.templates /.gitignore: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------- 2 | # various generated files 3 | #----------------------------------------------------------------------- 4 | 5 | # generated by the release scripts 6 | /*.zip 7 | 8 | # generated by project/make-html.sh 9 | /doc/tags 10 | /doc-html/ 11 | 12 | # markdown output 13 | /README.html 14 | /*-support/README.html 15 | /*-support/README.standalone.html 16 | 17 | # generated by git-support/git-doc/compile_changelog.lua 18 | /git-support/git-doc/changelog.txt.gz 19 | -------------------------------------------------------------------------------- /awk-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/awksupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | -------------------------------------------------------------------------------- 12 | 13 | -------------------------------------------------------------------------------- /awk-support/codesnippets/month-array: -------------------------------------------------------------------------------- 1 | split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", month ) 2 | -------------------------------------------------------------------------------- /awk-support/codesnippets/rule-file-not-found: -------------------------------------------------------------------------------- 1 | BEGINFILE { 2 | if ( ERRNO != "" ) { 3 | printf "file not found: %s", FILENAME 4 | nextfile 5 | } 6 | } # ----- end BEGINFILE ----- 7 | -------------------------------------------------------------------------------- /awk-support/doc/ChangeLog: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------------- 2 | RELEASE NOTES FOR VERSION 1.3 3 | --------------------------------------------------------------------------------------- 4 | - Add 'g:Awk_CustomTemplateFile'. 5 | - Add template personalization file and setup wizard. 6 | - Change the way lines of code are turned into comments 7 | (insert no space after the hash). 8 | - Change the map for 'comment -> code' to '\co' for consistency with the other 9 | plug-ins. The old map '\cu' still works, however. 10 | - Minor corrections and improvements. 11 | 12 | --------------------------------------------------------------------------------------- 13 | RELEASE NOTES FOR VERSION 1.2 14 | --------------------------------------------------------------------------------------- 15 | - Bugfix: Setup of local templates in case of global installation. 16 | - 'Run -> make script executable' (\re) is now a toggle. 17 | - The Awk executable can now be configured. 18 | - Adjusting end-of-line comments improved. 19 | - Minor corrections and improvements. 20 | 21 | --------------------------------------------------------------------------------------- 22 | RELEASE NOTES FOR VERSION 1.1 23 | --------------------------------------------------------------------------------------- 24 | - Map renamed: \rt -> \rx . 25 | - Wrapper-script missing. 26 | - Resolve home for linked home directories. 27 | - Footer did not appear in doc/awk-hotkeys.pdf 28 | - Bugfix: mapleader issues fixed. 29 | 30 | --------------------------------------------------------------------------------------- 31 | RELEASE NOTES FOR VERSION 1.0 32 | --------------------------------------------------------------------------------------- 33 | - Initial public release. 34 | 35 | 36 | -------------------------------------------------------------------------------- /awk-support/rc/custom.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Custom Templates 3 | § ============================================================= 4 | 5 | § set the template style used after loading the library 6 | SetStyle( 'default' ) 7 | 8 | § used by the template "Comments.shebang": 9 | SetMacro( 'AWK_INTERPRETER', '/usr/bin/awk' ) 10 | 11 | § templates automatically included into new files 12 | § set the property to an empty string to disable the insertion 13 | §SetProperty ( 'Awk::FileSkeleton::Script', 'Comments.shebang;Comments.file description; ;Skeleton.script-start' ) 14 | 15 | § ------------------------------------------------------------- 16 | § A template definition is build like this: 17 | § == Menu.some name == == 18 | § 19 | § == Menu.other name == == 20 | § 21 | § == ENDTEMPLATE == 22 | § A template ends with the line "== ENDTEMPLATE ==" or with 23 | § the start of a new template. 24 | § ------------------------------------------------------------- 25 | 26 | § ------------------------------------------------------------- 27 | § Inserted when creating a new script. 28 | § See configuration variable 'g:Awk_InsertFileHeader' 29 | § and template property 'Awk::FileSkeleton::Script'. 30 | § 31 | § - option 'nomenu': this will not create a menu entry 32 | § ------------------------------------------------------------- 33 | 34 | § uncomment and edit to customize 35 | 36 | §== Skeleton.script-start == nomenu, below == 37 | §BEGIN { 38 | §} # ----- end BEGIN ----- 39 | §== ENDTEMPLATE == 40 | 41 | § ------------------------------------------------------------- 42 | § Statements 43 | § ------------------------------------------------------------- 44 | 45 | § uncomment and edit to customize 46 | 47 | §== Statements.switch == map:ss, shortcut:s == 48 | §switch ( ) { 49 | § case <-LABEL->: 50 | § break 51 | § 52 | § case <-LABEL->: 53 | § break 54 | § 55 | § case <-LABEL->: 56 | § break 57 | § 58 | § default: 59 | § break 60 | §} # ----- end switch ----- 61 | §== ENDTEMPLATE == 62 | 63 | § ------------------------------------------------------------- 64 | § Function Definition 65 | § ------------------------------------------------------------- 66 | 67 | § uncomment and edit to customize 68 | 69 | §== Idioms.function == map:if, sc:f == 70 | §function |?FUNCTION_NAME| ( ) 71 | §{ 72 | §<-FUNCTION_BODY-> 73 | §} # ----- end of function |FUNCTION_NAME| ----- 74 | §== ENDTEMPLATE == 75 | 76 | -------------------------------------------------------------------------------- /awk-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /awk-support/scripts/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #=============================================================================== 3 | # FILE: wrapper.sh 4 | # USAGE: ./wrapper.sh scriptname [cmd-line-args] 5 | # DESCRIPTION: Wraps the execution of a programm or script. 6 | # Use with xterm: xterm -e wrapper.sh scriptname cmd-line-args 7 | # This script is used by the Vim plugin bash-support.vim 8 | # OPTIONS: --- 9 | # REQUIREMENTS: --- 10 | # BUGS: --- 11 | # NOTES: --- 12 | # AUTHOR: Dr.-Ing. Fritz Mehner (fgm), mehner.fritz@web.de 13 | # CREATED: 23.11.2004 18:04:01 CET 14 | # REVISION: $Id: wrapper.sh,v 1.5 2009/06/04 17:14:02 mehner Exp $ 15 | #=============================================================================== 16 | 17 | scriptname="${1}" # name of the script to execute 18 | returncode=0 # default return code 19 | 20 | if [ ${#} -ge 1 ] ; then 21 | if [ -x "$scriptname" ] ; then # start an executable script? 22 | "${@}" 23 | else 24 | awk -f "${@}" # start a script which is not executable 25 | fi 26 | returncode=$? 27 | [ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n" 28 | else 29 | printf "\n!! ${0} : no argument(s) !!\n" 30 | fi 31 | 32 | read -p "... press return key ... " dummy 33 | exit $returncode 34 | -------------------------------------------------------------------------------- /awk-support/templates/idioms.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Idioms 3 | § ============================================================= 4 | 5 | == Idioms.function == map:if, sc:f == 6 | function |?FUNCTION_NAME| ( ) 7 | { 8 | <-FUNCTION_BODY-> 9 | } # ----- end of function |FUNCTION_NAME| ----- 10 | == ENDTEMPLATE == 11 | 12 | -------------------------------------------------------------------------------- /awk-support/templates/regex.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Regex 3 | § ============================================================= 4 | 5 | == LIST: POSIX_CharClasses == list == 6 | 'alnum', 7 | 'alpha', 8 | 'blank', 9 | 'cntrl', 10 | 'digit', 11 | 'graph', 12 | 'lower', 13 | 'print', 14 | 'punct', 15 | 'space', 16 | 'upper', 17 | 'xdigit', 18 | == ENDLIST == 19 | 20 | == Regex.POSIX classes == expandmenu, insert, sc:p, map:xpc == 21 | |PickList( 'POSIX char. classes', 'POSIX_CharClasses' )| 22 | [:|PICK|:] 23 | == ENDTEMPLATE == 24 | 25 | == LIST: regex_operators == hash == 26 | 'whitespace' : '\s', 27 | 'non-whitespace' : '\S', 28 | 'word char.' : '\w', 29 | 'non-word char.' : '\W', 30 | 'begin of a word' : '\<', 31 | 'end of a word' : '\>', 32 | 'word boundary' : '\y', 33 | 'not word boundary' : '\B', 34 | 'beginning of buffer' : '\`', 35 | 'end of buffer' : "'", 36 | == ENDLIST == 37 | 38 | == Regex.Regexp Operators == expandmenu, expandleft:key, expandright:value, insert, sc:o, map:xro == 39 | |PickList( 'Regexp Operators', 'regex_operators' )| 40 | |PICK| 41 | == ENDTEMPLATE == 42 | 43 | § ------------------------------------------------------------- 44 | § Templates 45 | § ------------------------------------------------------------- 46 | 47 | == Regex.grouping == insert, map:xg, sc:g == 48 | () 49 | == Regex.alternation == insert, map:xa, sc:a == 50 | (|) 51 | == Regex.character list == insert, map:xl, sc:l == 52 | [] 53 | == Regex.word == insert, map:xw, sc:w == 54 | \<\> 55 | == ENDTEMPLATE == 56 | 57 | -------------------------------------------------------------------------------- /awk-support/templates/specvar.templates: -------------------------------------------------------------------------------- 1 | 2 | == LIST: autoset == list == 3 | 'ARGC', 4 | 'ARGV', 5 | 'ARGIND', 6 | 'ENVIRON', 7 | 'ERRNO', 8 | 'FILENAME', 9 | 'FNR', 10 | 'NF', 11 | 'NR', 12 | 'PROCINFO', 13 | 'RLENGTH', 14 | 'RSTART', 15 | 'RT', 16 | == ENDLIST == 17 | 18 | == Special Variables.auto-set == expandmenu, insert, sc:a, map:va == 19 | |PickList( 'autoset', 'autoset' )| 20 | |PICK| 21 | == ENDTEMPLATE == 22 | 23 | == LIST: modifiable == list == 24 | 'BINMODE', 25 | 'CONVFMT', 26 | 'FIELDWIDTHS', 27 | 'FS', 28 | 'IGNORECASE', 29 | 'LINT', 30 | 'OFMT', 31 | 'OFS', 32 | 'ORS', 33 | 'RS', 34 | 'SUBSEP', 35 | 'TEXTDOMAIN', 36 | == ENDLIST == 37 | 38 | == Special Variables.user modifiable == expandmenu, insert, sc:m, map:vm == 39 | |PickList( 'modifiable', 'modifiable' )| 40 | |PICK| 41 | == ENDTEMPLATE == 42 | 43 | -------------------------------------------------------------------------------- /awk-support/templates/statements.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements 3 | § ============================================================= 4 | 5 | == Statements.do while == map:sd, shortcut:d == 6 | do { 7 | } while ( ) # ----- end do-while ----- 8 | == Statements.for == map:sf, shortcut:o == 9 | for ( ; ; ) 10 | § 11 | § The names INIT, CONDITION, INCREMENT, and 'for block' are used by the main 12 | § plugin plugin/c.vim . Please do not change. 13 | § 14 | == Statements.for block == map:sfo, shortcut:r == 15 | |DefaultMacro( 'CONDITION', '{+CONDITION+}' )| 16 | |DefaultMacro( 'INCREMENT', '{+INCREMENT+}' )| 17 | for ( |INIT|; |CONDITION|; |INCREMENT| ) { 18 | } 19 | == Statements.for in == map:sfi, shortcut:i == 20 | for ( in <-ARRAY-> ) { 21 | } 22 | == Statements.if == map:si, shortcut:i == 23 | if ( ) 24 | == Statements.if block == map:sif, shortcut:f == 25 | if ( ) { 26 | <-IF_PART-> 27 | } 28 | == Statements.if else == map:sie, shortcut:e == 29 | if ( ) 30 | else 31 | == Statements.if block else == map:sife, shortcut:l == 32 | if ( ) { 33 | <-IF_PART-> 34 | } 35 | else { 36 | <-ELSE_PART-> 37 | } 38 | == Statements.while == map:sw, shortcut:w == 39 | while ( ) 40 | == Statements.while block == map:swh, shortcut:h == 41 | while ( ) { 42 | } 43 | == Statements.switch == map:ss, shortcut:s == 44 | switch ( ) { 45 | case <-LABEL->: 46 | break 47 | 48 | case <-LABEL->: 49 | break 50 | 51 | case <-LABEL->: 52 | break 53 | 54 | default: 55 | break 56 | } # ----- end switch ----- 57 | == Statements.case == map:sc, shortcut:c == 58 | case : 59 | break 60 | 61 | == Statements.BEGIN == map:sb, shortcut:b == 62 | BEGIN { 63 | 64 | } # ----- end BEGIN ----- 65 | == Statements.END == map:se, shortcut:e == 66 | END { 67 | 68 | } # ----- end END ----- 69 | == ENDTEMPLATE == 70 | -------------------------------------------------------------------------------- /awk-support/wordlists/awk-keywords.list: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGINFILE 3 | 4 | else 5 | while 6 | for 7 | switch 8 | case 9 | default 10 | break 11 | continue 12 | next 13 | nextfile 14 | exit 15 | 16 | BINMODE 17 | CONVFMT 18 | FIELDWIDTHS 19 | FPAT 20 | FS 21 | IGNORECASE 22 | LINT 23 | OFMT 24 | OFS 25 | ORS 26 | RS 27 | SUBSEP 28 | TEXTDOMAIN 29 | 30 | ARGC 31 | ARGV 32 | ARGIND 33 | ENVIRON 34 | ERRNO 35 | FILENAME 36 | FNR 37 | NF 38 | NR 39 | PROCINFO 40 | RLENGTH 41 | RSTART 42 | RT 43 | 44 | atan2 45 | cos 46 | exp 47 | int 48 | log 49 | rand 50 | sin 51 | sqrt 52 | srand 53 | 54 | asort 55 | asorti 56 | gensub 57 | gsub 58 | index 59 | length 60 | match 61 | patsplit 62 | split 63 | sprintf 64 | strtonum 65 | sub 66 | substr 67 | tolower 68 | toupper 69 | close 70 | fflush 71 | system 72 | mktime 73 | strftime 74 | systime 75 | and 76 | compl 77 | lshift 78 | rshift 79 | xor 80 | isarray 81 | bindtextdomain 82 | dcgettext 83 | dcngettext 84 | -------------------------------------------------------------------------------- /bash-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/bashsupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | Preview Version 12 | ================================================================================ 13 | 14 | ___This is a preview version!___ 15 | 16 | Notable new features: 17 | 18 | - Call the Bash interpreter via the command-line: `:Bash `. You can use it 19 | to pass arguments to the script. 20 | - Run Bash in a terminal window directly inside the editor. 21 | - The template library now has shell options and variables for BASH Version 4.4. 22 | - The debugger integration has been move into the toolbox, and comes with 23 | extended functionality. 24 | 25 | The terminal window relies on the new `+terminal` feature, which becomes 26 | available with a patch level of approx. `8.0.1000`. 27 | 28 | _Please read the release notes below._ 29 | 30 | 31 | -------------------------------------------------------------------------------- 32 | 33 | -------------------------------------------------------------------------------- /bash-support/codesnippets/_trap_DEBUG: -------------------------------------------------------------------------------- 1 | #=== FUNCTION ================================================================ 2 | # NAME: _trap_DEBUG 3 | # DESCRIPTION: Trap code for the pseudo-signal DEBUG. Generate a message. 4 | # The DEBUG trap is not inherited by functions. 5 | # Use 'set -o functrace' 6 | # PARAMETERS: 1) identification (e.g. line number $LINENO) 7 | # 2) variable name(s) to be tracked 8 | #=============================================================================== 9 | function _trap_DEBUG () 10 | { 11 | declare identification=$1; 12 | while [ ${#} -gt 1 ]; do 13 | shift 14 | echo -e "DEBUG [$identification] ${1} = '${!1}'" 15 | done 16 | } # ---------- end of function _trap_DEBUG ---------- 17 | 18 | trap '_trap_DEBUG $LINENO <-variable names->' DEBUG # trap DEBUG 19 | 20 | #trap - DEBUG # reset the DEBUG trap 21 | 22 | -------------------------------------------------------------------------------- /bash-support/codesnippets/_trap_ERR: -------------------------------------------------------------------------------- 1 | #=== FUNCTION ================================================================ 2 | # NAME: _trap_ERROR 3 | # DESCRIPTION: Trap code for the pseudo-signal ERR (A command returning a 4 | # non-zero exit status). Generates an error message. 5 | # PARAMETERS: The current line number given by $LINENO . 6 | #=============================================================================== 7 | function _trap_ERROR () 8 | { 9 | echo -e "\nERROR line ${1}: Command exited with status ${?}" 10 | } # ---------- end of function _trap_ERROR ---------- 11 | 12 | trap '_trap_ERROR $LINENO' ERR # trap ERR 13 | 14 | #trap - ERR # reset the ERR trap 15 | 16 | -------------------------------------------------------------------------------- /bash-support/codesnippets/_trap_EXIT: -------------------------------------------------------------------------------- 1 | #=== FUNCTION ================================================================ 2 | # NAME: _trap_EXIT 3 | # DESCRIPTION: Trap code for the pseudo-signal EXIT. Generates an message. 4 | # PARAMETERS: The current line number given by $LINENO . 5 | #=============================================================================== 6 | function _trap_EXIT () 7 | { 8 | echo -e "\nEXIT line ${1}: Script exited with status ${?}" 9 | } # ---------- end of function ---------- 10 | 11 | trap '_trap_EXIT $LINENO' EXIT # trap EXIT 12 | 13 | #trap - EXIT # reset the EXIT trap 14 | 15 | -------------------------------------------------------------------------------- /bash-support/codesnippets/_trap_RETURN: -------------------------------------------------------------------------------- 1 | #=== FUNCTION ================================================================ 2 | # NAME: _trap_RETURN 3 | # DESCRIPTION: Trap code for the pseudo-signal RETURN. Generates a message. 4 | # The RETURN trap is not inherited by functions. 5 | # Use 'set -o functrace' 6 | # PARAMETERS: The current line number given by $LINENO . 7 | # variable(s) to be tracked 8 | #=============================================================================== 9 | function _trap_RETURN () 10 | { 11 | echo -e "\nRETURN line ${1}: " 12 | } # ---------- end of functionn _trap_RETURN ---------- 13 | 14 | trap '_trap_RETURN $LINENO' RETURN # trap RETURN 15 | 16 | #trap - RETURN # reset the RETURN trap 17 | 18 | -------------------------------------------------------------------------------- /bash-support/codesnippets/basename+pathname: -------------------------------------------------------------------------------- 1 | basename=${pathname##*/} 2 | dirname=${pathname%/*} 3 | filename=${basename%%.*} 4 | lastextension=${basename##*.} 5 | allextensions=${basename#*.} 6 | -------------------------------------------------------------------------------- /bash-support/codesnippets/check-for-signed-integer: -------------------------------------------------------------------------------- 1 | if [[ $number =~ ^[+-]?[0-9]+$ ]] ; then 2 | echo -e "match found : (signed) integer\n" 3 | fi 4 | -------------------------------------------------------------------------------- /bash-support/codesnippets/check-for-unsigned-integer: -------------------------------------------------------------------------------- 1 | if [[ $number =~ ^[0-9]+$ ]] ; then 2 | echo -e "match found : integer\n" 3 | fi 4 | -------------------------------------------------------------------------------- /bash-support/codesnippets/check-number-of-command-line-arguments: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------- 2 | # Check number of command line arguments 3 | #----------------------------------------------------------------------- 4 | [ $# -lt 1 ] && { echo -e "\n\tUsage: ${0##/*/} File\n"; exit 1; } 5 | 6 | -------------------------------------------------------------------------------- /bash-support/codesnippets/create-tempfile: -------------------------------------------------------------------------------- 1 | TMPFILE=$( mktemp /tmp/example.XXXXXXXXXX ) || exit 1 2 | 3 | rm --force $TMPFILE 4 | -------------------------------------------------------------------------------- /bash-support/codesnippets/create-tempfile-in-secure-manner: -------------------------------------------------------------------------------- 1 | 2 | TMPDIR=${TMPDIR:-/tmp} # defaults to /tmp if unset 3 | 4 | #------------------------------------------------------------------------------- 5 | # Creates a particular temporary directory inside $TMPDIR. 6 | #------------------------------------------------------------------------------- 7 | TEMPORARY_DIR=$(mktemp -d "$TMPDIR/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") || \ 8 | { echo "ERROR creating a temporary file"; exit 1; } 9 | 10 | #------------------------------------------------------------------------------- 11 | # When the program exits, it tries to remove the temporary folder. 12 | # This code is executed even if the process receives a signal 1,2,3 or 15. 13 | #------------------------------------------------------------------------------- 14 | trap '[ "$TEMPORARY_DIR" ] && rm --recursive --force "$TEMPORARY_DIR"' 0 15 | 16 | touch $TEMPORARY_DIR/tempfile # new tempfile inside folder 17 | 18 | -------------------------------------------------------------------------------- /bash-support/codesnippets/create-tempfile-with-trap: -------------------------------------------------------------------------------- 1 | 2 | #----------------------------------------------------------------------- 3 | # cleanup temporary file in case of a keyboard interrupt (SIGINT) 4 | # or a termination signal (SIGTERM) 5 | #----------------------------------------------------------------------- 6 | function cleanup_temp 7 | { 8 | [ -e $tmpfile ] && rm --force $tmpfile 9 | exit 0 10 | } 11 | 12 | trap cleanup_temp SIGHUP SIGINT SIGPIPE SIGTERM 13 | 14 | tmpfile=$(mktemp) || { echo "$0: creation of temporary file failed!"; exit 1; } 15 | 16 | # use tmpfile ... 17 | 18 | rm --force $tmpfile 19 | 20 | -------------------------------------------------------------------------------- /bash-support/codesnippets/debugging/_debug_PS4: -------------------------------------------------------------------------------- 1 | # PS4 : timestamp; the current time in 24-hour HH:MM:SS format 2 | PS4='+[\t] ' 3 | 4 | # PS4 : timestamp; 'seconds.nanoseconds' since 1970-01-01 00:00:00 UT 5 | PS4='+[$(date "+%s.%N")] ' 6 | 7 | # PS4 : position, line number, function name 8 | # The following line avoids error messages due to an unset FUNCNAME[0] : 9 | # set +o nounset # Treat unset variables as an error 10 | # 11 | PS4='+|${BASH_SOURCE##*/} ${LINENO}${FUNCNAME[0]:+ ${FUNCNAME[0]}}| ' 12 | 13 | # PS4 : position, line number, function name, subshell information 14 | # The following line avoids error messages due to an unset FUNCNAME[0] : 15 | # set +o nounset # Treat unset variables as an error 16 | # 17 | PS4='+(${BASH_SOURCE##*/}: ${LINENO}) : ${FUNCNAME[0]} - [level ${SHLVL}, ' 18 | PS4=$PS4'subshell ${BASH_SUBSHELL}, return code $?]\n ' 19 | 20 | # PS4 : default prompt 21 | PS4='+ ' 22 | 23 | -------------------------------------------------------------------------------- /bash-support/codesnippets/debugging/_debug_assert: -------------------------------------------------------------------------------- 1 | #=== FUNCTION ================================================================ 2 | # NAME: _assert 3 | # DESCRIPTION: Abort the script if assertion is false. 4 | # PARAMETERS: 1) expression used as test inside brackets 5 | # 2) optional information, e.g. $LINENO 6 | # RETURNS: 0 / 99 assertion is true / false 7 | #=============================================================================== 8 | function _assert () 9 | { 10 | if [ ! $1 ]; then 11 | echo "${0##*/}${2:+:$2}: assertion '$1' failed." 12 | exit 99 13 | fi 14 | return 0 15 | } 16 | 17 | -------------------------------------------------------------------------------- /bash-support/codesnippets/debugging/_debug_function.noindent: -------------------------------------------------------------------------------- 1 | 2 | DEBUG=${DEBUG:-0} # 0 = no debug output, 1 = show debug output, 3 | # or enable debug with: DEBUG=1 script.sh 4 | 5 | #=== FUNCTION ================================================================ 6 | # NAME: _debug 7 | # DESCRIPTION: echo debug output controlled by a global variable 8 | # PARAMETERS: list, e.g.; "$LINENO: x=$x" 9 | # RETURNS: always 0 10 | #=============================================================================== 11 | _debug () 12 | { 13 | [ ${DEBUG} -ne 0 ] && echo -e "${@}" 14 | return 0 15 | } # ---------- end of function _debug ---------- 16 | -------------------------------------------------------------------------------- /bash-support/codesnippets/debugging/_debug_print_pos_param: -------------------------------------------------------------------------------- 1 | # print the positional parameters 2 | printf "'%b'\n" "$0" "$@" | nl -v0 -s': ' 3 | 4 | -------------------------------------------------------------------------------- /bash-support/codesnippets/debugging/_debug_timestamp.noindent: -------------------------------------------------------------------------------- 1 | 2 | DEBUG=${DEBUG:-0} # 0 = no debug output, 1 = show debug output, 3 | # or enable debug with: DEBUG=1 script.sh 4 | 5 | #=== FUNCTION ================================================================ 6 | # NAME: _debug_timestamp 7 | # DESCRIPTION: timestamp + optional information 8 | # timestamp: {seconds since 1970-01-01 00:00:00}.{nanoseconds} 9 | # PARAMETERS: identification, e.g. $LINENO (optional) 10 | # RETURNS: always 0 11 | #=============================================================================== 12 | _debug_timestamp () 13 | { 14 | [ ${DEBUG} -ne 0 ] && echo -e "[ $(date "+%s.%N") ]${@:+ -- ${@}}" 15 | return 0 16 | } # ---------- end of function _debug_timestamp ---------- 17 | -------------------------------------------------------------------------------- /bash-support/codesnippets/free-software-comment: -------------------------------------------------------------------------------- 1 | # 2 | #========================================================================== 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | #========================================================================== 8 | # 9 | -------------------------------------------------------------------------------- /bash-support/codesnippets/timestamp: -------------------------------------------------------------------------------- 1 | 2 | timestamp=$(date +"%Y%m%d-%H%M%S") # generate timestamp : YYYYMMDD-hhmmss 3 | 4 | -------------------------------------------------------------------------------- /bash-support/codesnippets/usage-and-command-line-arguments.noindent: -------------------------------------------------------------------------------- 1 | 2 | ScriptVersion="1.0" 3 | 4 | #=== FUNCTION ================================================================ 5 | # NAME: usage 6 | # DESCRIPTION: Display usage information. 7 | #=============================================================================== 8 | function usage () 9 | { 10 | cat <<- EOT 11 | 12 | Usage : ${0##/*/} [options] [--] 13 | 14 | Options: 15 | -h|help Display this message 16 | -v|version Display script version 17 | 18 | EOT 19 | } # ---------- end of function usage ---------- 20 | 21 | #----------------------------------------------------------------------- 22 | # Handle command line arguments 23 | #----------------------------------------------------------------------- 24 | 25 | while getopts ":hv" opt 26 | do 27 | case $opt in 28 | 29 | h|help ) usage; exit 0 ;; 30 | 31 | v|version ) echo "$0 -- Version $ScriptVersion"; exit 0 ;; 32 | 33 | \? ) echo -e "\n Option does not exist : $OPTARG\n" 34 | usage; exit 1 ;; 35 | 36 | esac # --- end of case --- 37 | done 38 | shift $(($OPTIND-1)) 39 | 40 | -------------------------------------------------------------------------------- /bash-support/codesnippets/use-file-descriptor-read: -------------------------------------------------------------------------------- 1 | 2 | infilename="" # input filename 3 | 4 | exec 3<"$infilename" 5 | if [ $? -ne 0 ] ; then 6 | echo -e "Could not link file descriptor with file '$infilename'\n" 7 | exit 1 8 | fi 9 | 10 | while read line <&3 ; do 11 | echo -e "$line" 12 | done 13 | 14 | exec 3<&- # close file descriptor 15 | 16 | -------------------------------------------------------------------------------- /bash-support/codesnippets/use-file-descriptor-write: -------------------------------------------------------------------------------- 1 | 2 | outfilename="" # output filename 3 | 4 | exec 4>"$outfilename" 5 | if [ $? -ne 0 ] ; then 6 | echo -e "Could not link file descriptor with file '$outfilename'\n" 7 | exit 1 8 | fi 9 | 10 | echo -e "text" >&4 11 | 12 | exec 4>&- # close file descriptor 13 | 14 | -------------------------------------------------------------------------------- /bash-support/codesnippets/well-behaved-script: -------------------------------------------------------------------------------- 1 | set -o nounset # treat unset variables as errors 2 | 3 | #=============================================================================== 4 | # GLOBAL DECLARATIONS 5 | #=============================================================================== 6 | declare -rx SCRIPT=${0##*/} # the name of this script 7 | declare -rx mkdir='/bin/mkdir' # the mkdir(1) command 8 | 9 | #=============================================================================== 10 | # SANITY CHECKS 11 | #=============================================================================== 12 | if [ -z "$BASH" ] ; then 13 | printf "$SCRIPT:$LINENO: run this script with the BASH shell\n" >&2 14 | exit 192 15 | fi 16 | 17 | if [ ! -x "$mkdir" ] ; then 18 | printf "$SCRIPT:$LINENO: command '$mkdir' not available - aborting\n" >&2 19 | exit 192 20 | fi 21 | 22 | #=============================================================================== 23 | # MAIN SCRIPT 24 | #=============================================================================== 25 | 26 | #=============================================================================== 27 | # STATISTICS / CLEANUP 28 | #=============================================================================== 29 | exit 0 30 | -------------------------------------------------------------------------------- /bash-support/rc/custom.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Custom Templates 3 | § ============================================================= 4 | 5 | § set the template style used after loading the library 6 | SetStyle( 'default' ) 7 | 8 | § used by the template "Comments.shebang": 9 | SetMacro( 'BASH_INTERPRETER', '/bin/bash' ) 10 | 11 | § templates automatically included into new files 12 | § set the property to an empty string to disable the insertion 13 | §SetProperty ( 'Bash::FileSkeleton::Script', 'Comments.shebang;Comments.file header; ;Skeleton.script-set' ) 14 | 15 | § ------------------------------------------------------------- 16 | § A template definition is build like this: 17 | § == Menu.some name == == 18 | § 19 | § == Menu.other name == == 20 | § 21 | § == ENDTEMPLATE == 22 | § A template ends with the line "== ENDTEMPLATE ==" or with 23 | § the start of a new template. 24 | § ------------------------------------------------------------- 25 | 26 | § ------------------------------------------------------------- 27 | § Inserted when creating a new script. 28 | § See configuration variable 'g:BASH_InsertFileHeader' 29 | § and template property 'Bash::FileSkeleton::Script'. 30 | § 31 | § - option 'nomenu': this will not create a menu entry 32 | § ------------------------------------------------------------- 33 | 34 | § uncomment and edit to customize 35 | 36 | §== Skeleton.script-set == nomenu, below == 37 | §set -o nounset # Treat unset variables as an error 38 | §shopt -s extglob # Extended pattern matching 39 | §== ENDTEMPLATE == 40 | 41 | § ------------------------------------------------------------- 42 | § Statements 43 | § ------------------------------------------------------------- 44 | 45 | § uncomment and edit to customize 46 | 47 | §== Statements.case == map:sc, shortcut:c == 48 | §case in 49 | § ) 50 | § ;; 51 | § 52 | § ) 53 | § ;; 54 | § 55 | § *) 56 | § ;; 57 | § 58 | §esac # --- end of case --- 59 | §== ENDTEMPLATE == 60 | 61 | §== Statements.function == map:sfu, shortcut:f == 62 | §|?FUNCTION_NAME| () 63 | §{ 64 | § 65 | §} # ---------- end of function |FUNCTION_NAME| ---------- 66 | §== ENDTEMPLATE == 67 | 68 | -------------------------------------------------------------------------------- /bash-support/rc/customization.bashrc: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------- 2 | # set Bash prompts 3 | # PS4 shows the function name when execution is inside a function and 4 | # the xtrace option is set. 5 | #----------------------------------------------------------------------- 6 | export PS2='continue> ' 7 | export PS3='choose: ' 8 | export PS4='|${BASH_SOURCE} ${LINENO}${FUNCNAME[0]:+ ${FUNCNAME[0]}()}| ' 9 | 10 | -------------------------------------------------------------------------------- /bash-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /bash-support/scripts/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #=============================================================================== 3 | # FILE: wrapper.sh 4 | # USAGE: ./wrapper.sh scriptname [cmd-line-args] 5 | # DESCRIPTION: Wraps the execution of a programm or script. 6 | # Use with xterm: xterm -e wrapper.sh scriptname cmd-line-args 7 | # This script is used by the Vim plugin bash-support.vim 8 | # OPTIONS: --- 9 | # REQUIREMENTS: --- 10 | # BUGS: --- 11 | # NOTES: --- 12 | # AUTHOR: Dr.-Ing. Fritz Mehner (fgm), mehner.fritz@web.de 13 | # CREATED: 23.11.2004 18:04:01 CET 14 | # REVISION: --- 15 | #=============================================================================== 16 | 17 | scriptname="${1}" # name of the script to execute 18 | returncode=0 # default return code 19 | 20 | if [ ${#} -ge 1 ] ; then 21 | if [ -x "$scriptname" ] ; then # start an executable script? 22 | "${@}" 23 | else 24 | $SHELL "${@}" # start a script which is not executable 25 | fi 26 | returncode=$? 27 | [ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n" 28 | else 29 | printf "\n!! ${0} : no argument(s) !!\n" 30 | fi 31 | 32 | read -p "... press return key ... " dummy 33 | exit $returncode 34 | -------------------------------------------------------------------------------- /bash-support/templates/builtins.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Builtins 3 | § ============================================================= 4 | 5 | § This list is used by the menu entry 'Help->help (Bash builtins)' 6 | § for tab-completion. Please do not change the name. 7 | == LIST: builtins == list == 8 | 'alias', 9 | 'bg', 10 | 'bind', 11 | 'break', 12 | 'builtin', 13 | 'caller', 14 | 'cd', 15 | 'command', 16 | 'compgen', 17 | 'complete', 18 | 'continue', 19 | 'compopt', 20 | 'declare', 21 | 'dirs', 22 | 'disown', 23 | 'echo', 24 | 'enable', 25 | 'eval', 26 | 'exec', 27 | 'exit', 28 | 'export', 29 | 'false', 30 | 'fc', 31 | 'fg', 32 | 'getopts', 33 | 'hash', 34 | 'help', 35 | 'history', 36 | 'jobs', 37 | 'kill', 38 | 'let', 39 | 'local', 40 | 'logout', 41 | 'mapfile', 42 | 'popd', 43 | 'printf', 44 | 'pushd', 45 | 'pwd', 46 | 'read', 47 | 'readarray', 48 | 'readonly', 49 | 'return', 50 | 'set', 51 | 'shift', 52 | 'shopt', 53 | 'source', 54 | 'suspend', 55 | 'test', 56 | 'times', 57 | 'trap', 58 | 'true', 59 | 'type', 60 | 'typeset', 61 | 'ulimit', 62 | 'umask', 63 | 'unalias', 64 | 'unset', 65 | 'wait', 66 | == ENDLIST == 67 | 68 | == Builtins == expandmenu, insert, map:bbu, sc:b == 69 | |PickList( 'Builtins', 'builtins' )| 70 | |PICK| 71 | == ENDTEMPLATE == 72 | 73 | -------------------------------------------------------------------------------- /bash-support/templates/environment.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Environment 3 | § ============================================================= 4 | 5 | == LIST: environment == list == 6 | 'BASH', 7 | 'BASH_ALIASES', 8 | 'BASH_ARGC', 9 | 'BASH_ARGV', 10 | 'BASH_ARGV0', 11 | 'BASH_CMDS', 12 | 'BASH_COMMAND', 13 | 'BASH_COMPAT', 14 | 'BASH_ENV', 15 | 'BASH_EXECUTION_STRING', 16 | 'BASH_LINENO', 17 | 'BASH_LOADABLES_PATH', 18 | 'BASHOPTS', 19 | 'BASHPID', 20 | 'BASH_REMATCH', 21 | 'BASH_SOURCE', 22 | 'BASH_SUBSHELL', 23 | 'BASH_VERSINFO', 24 | 'BASH_VERSION', 25 | 'BASH_XTRACEFD', 26 | 'CDPATH', 27 | 'CHILD_MAX', 28 | 'COLUMNS', 29 | 'COMP_CWORD', 30 | 'COMP_KEY', 31 | 'COMP_LINE', 32 | 'COMP_POINT', 33 | 'COMPREPLY', 34 | 'COMP_TYPE', 35 | 'COMP_WORDBREAKS', 36 | 'COMP_WORDS', 37 | 'COPROC', 38 | 'DIRSTACK', 39 | 'EMACS', 40 | 'ENV', 41 | 'EPOCHREALTIME', 42 | 'EPOCHSECONDS', 43 | 'EUID', 44 | 'EXECIGNORE', 45 | 'FCEDIT', 46 | 'FIGNORE', 47 | 'FUNCNAME', 48 | 'FUNCNEST', 49 | 'GLOBIGNORE', 50 | 'GROUPS', 51 | 'HISTCMD', 52 | 'HISTCONTROL', 53 | 'HISTFILE', 54 | 'HISTFILESIZE', 55 | 'HISTIGNORE', 56 | 'HISTSIZE', 57 | 'HISTTIMEFORMAT', 58 | 'HOME', 59 | 'HOSTFILE', 60 | 'HOSTNAME', 61 | 'HOSTTYPE', 62 | 'IFS', 63 | 'IGNOREEOF', 64 | 'INPUTRC', 65 | 'INSIDE_EMACS', 66 | 'LANG', 67 | 'LC_ALL', 68 | 'LC_COLLATE', 69 | 'LC_CTYPE', 70 | 'LC_MESSAGES', 71 | 'LC_NUMERIC', 72 | 'LC_TIME', 73 | 'LINENO', 74 | 'LINES', 75 | 'MACHTYPE', 76 | 'MAIL', 77 | 'MAILCHECK', 78 | 'MAILPATH', 79 | 'MAPFILE', 80 | 'OLDPWD', 81 | 'OPTARG', 82 | 'OPTERR', 83 | 'OPTIND', 84 | 'OSTYPE', 85 | 'PATH', 86 | 'PIPESTATUS', 87 | 'POSIXLY_CORRECT', 88 | 'PPID', 89 | 'PROMPT_COMMAND', 90 | 'PROMPT_DIRTRIM', 91 | 'PS0', 92 | 'PS1', 93 | 'PS2', 94 | 'PS3', 95 | 'PS4', 96 | 'PWD', 97 | 'RANDOM', 98 | 'READLINE_LINE', 99 | 'READLINE_POINT', 100 | 'REPLY', 101 | 'SECONDS', 102 | 'SHELL', 103 | 'SHELLOPTS', 104 | 'SHLVL', 105 | 'TIMEFORMAT', 106 | 'TMOUT', 107 | 'TMPDIR', 108 | 'UID', 109 | == ENDLIST == 110 | 111 | == Environment == expandmenu, insert, map:ben, sc:e == 112 | |PickList( 'Environment', 'environment' )| 113 | |PICK| 114 | == ENDTEMPLATE == 115 | 116 | -------------------------------------------------------------------------------- /bash-support/templates/io-redirection.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § IO Redirection 3 | § ============================================================= 4 | 5 | == LIST: IORedirection == hash == 6 | 'append STDOUT and STDERR' : ' &>> ', 7 | 'close input from file descr n' : ' <&- ', 8 | 'close output from file descr n' : ' >&- ', 9 | 'close STDIN' : ' <&- ', 10 | 'close STDOUT' : ' >&- ', 11 | 'direct file descr n to file, append' : ' >> ', 12 | 'direct file descr n to file' : ' > ', 13 | 'direct STDERR to STDOUT' : ' 2>&1', 14 | 'direct STDOUT and STDERR to file' : ' &> ', 15 | 'direct STDOUT to file, append' : ' >> ', 16 | 'direct STDOUT to file' : ' > ', 17 | 'direct STDOUT to STDERR' : ' >&2', 18 | 'duplicate STDIN from file descr n' : ' <& ', 19 | 'duplicate STDOUT to file descr n' : ' >& ', 20 | 'take file descr n from file' : ' < ', 21 | 'take STDIN from file' : ' < ', 22 | == ENDLIST == 23 | 24 | == IO-Redir.redir == expandmenu, expandright:value-notags, insert, sc:r, map:ior == 25 | |PickList( 'IO-Redir', 'IORedirection' )| 26 | |VALUE| 27 | == ENDTEMPLATE == 28 | 29 | == IO-Redir.here-document == insert, sc:h, map:ioh == 30 | <<-EOF 31 | 32 | EOF 33 | == ENDTEMPLATE == 34 | -------------------------------------------------------------------------------- /bash-support/templates/paramsub.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Parameter Substitution 3 | § ============================================================= 4 | 5 | == LIST: ParameterSubstitution == hash == 6 | 'all lower to upper' : '${^^<+pattern+>}', 7 | 'all upper to lower' : '${,,<+pattern+>}', 8 | 'assign default value' : '${:=<+word+>}', 9 | 'display error' : '${:?<+word+>}', 10 | 'first lower to upper' : '${^<+pattern+>}', 11 | 'first upper to lower' : '${,<+pattern+>}', 12 | 'indirect parameter expansion' : '${!}', 13 | 'names matching prefix' : '${!*}', 14 | 'parameter length' : '${#}', 15 | 'parameter transformation' : '${@<+operator+>}', 16 | 'pattern substitution all' : '${//<+pattern+>/<+string+>}', 17 | 'pattern substitution begin' : '${/#<+pattern+>/<+string+>}', 18 | 'pattern substitution' : '${/<+pattern+>/<+string+>}', 19 | 'pattern substitution end' : '${/%<+pattern+>/<+string+>}', 20 | 'remove all matching prefix pattern' : '${##<+word+>}', 21 | 'remove all matching suffix pattern' : '${%%<+word+>}', 22 | 'remove matching prefix pattern' : '${#<+word+>}', 23 | 'remove matching suffix pattern' : '${%<+word+>}', 24 | 'substitution' : '${}', 25 | 'substring expansion' : '${:<+offset+>:<+length+>}', 26 | 'use alternate value' : '${:+<+word+>}', 27 | 'use default value' : '${:-<+word+>}', 28 | == ENDLIST == 29 | 30 | == ParamSub == expandmenu, expandright:value-whitetags, insert, sc:p, map:bps == 31 | |PickList( 'Parameter Substitution', 'ParameterSubstitution' )| 32 | |VALUE| 33 | == ENDTEMPLATE == 34 | 35 | -------------------------------------------------------------------------------- /bash-support/templates/patternmatching.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § RegExp 3 | § ============================================================= 4 | 5 | == PatternMatching.zero or one == insert, map:pzo, sc:z == 6 | ?(|) 7 | == PatternMatching.zero or more == insert, map:pzm, sc:z == 8 | *(|) 9 | == PatternMatching.one or more == insert, map:pom, sc:o == 10 | +(|) 11 | == PatternMatching.exactly one == insert, map:peo, sc:e == 12 | @(|) 13 | == PatternMatching.anything except == insert, map:pae, sc:a == 14 | !(|) 15 | == ENDTEMPLATE == 16 | 17 | == SEP: PatternMatching.sep1 == 18 | 19 | == LIST: POSIX_CharClasses == list == 20 | 'alnum', 21 | 'alpha', 22 | 'ascii', 23 | 'blank', 24 | 'cntrl', 25 | 'digit', 26 | 'graph', 27 | 'lower', 28 | 'print', 29 | 'punct', 30 | 'space', 31 | 'upper', 32 | 'word', 33 | 'xdigit', 34 | == ENDLIST == 35 | 36 | == PatternMatching.POSIX classes == expandmenu, insert, sc:p, map:ppc == 37 | |PickList( 'POSIX char. classes', 'POSIX_CharClasses' )| 38 | [:|PICK|:] 39 | == ENDTEMPLATE == 40 | 41 | == LIST: BashRematch == list == 42 | '${BASH_REMATCH[0]}', 43 | '${BASH_REMATCH[1]}', 44 | '${BASH_REMATCH[2]}', 45 | '${BASH_REMATCH[3]}', 46 | == ENDLIST == 47 | 48 | == PatternMatching.BASH_REMATCH == expandmenu, insert, sc:b, map:pbr == 49 | |PickList( 'BASH_REMATCH', 'BashRematch' )| 50 | |PICK| 51 | == ENDTEMPLATE == 52 | -------------------------------------------------------------------------------- /bash-support/templates/regexp.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § RegExp 3 | § ============================================================= 4 | 5 | == Regexp.zero or one == insert, map:xzo, sc:z == 6 | ?(|) 7 | == Regexp.zero or more == insert, map:xzm, sc:z == 8 | *(|) 9 | == Regexp.one or more == insert, map:xom, sc:o == 10 | +(|) 11 | == Regexp.exactly one == insert, map:xeo, sc:e == 12 | @(|) 13 | == Regexp.anything except == insert, map:xae, sc:a == 14 | !(|) 15 | == ENDTEMPLATE == 16 | 17 | == SEP: Regexp.sep1 == 18 | 19 | == LIST: POSIX_CharClasses == list == 20 | 'alnum', 21 | 'alpha', 22 | 'ascii', 23 | 'blank', 24 | 'cntrl', 25 | 'digit', 26 | 'graph', 27 | 'lower', 28 | 'print', 29 | 'punct', 30 | 'space', 31 | 'upper', 32 | 'word', 33 | 'xdigit', 34 | == ENDLIST == 35 | 36 | == Regexp.POSIX classes == expandmenu, insert, sc:p, map:xpc == 37 | |PickList( 'POSIX char. classes', 'POSIX_CharClasses' )| 38 | [:|PICK|:] 39 | == ENDTEMPLATE == 40 | 41 | == LIST: BashRematch == list == 42 | '${BASH_REMATCH[0]}', 43 | '${BASH_REMATCH[1]}', 44 | '${BASH_REMATCH[2]}', 45 | '${BASH_REMATCH[3]}', 46 | == ENDLIST == 47 | 48 | == Regexp.BASH_REMATCH == expandmenu, insert, sc:b, map:xbr == 49 | |PickList( 'BASH_REMATCH', 'BashRematch' )| 50 | |PICK| 51 | == ENDTEMPLATE == 52 | -------------------------------------------------------------------------------- /bash-support/templates/set.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Set 3 | § ============================================================= 4 | 5 | == LIST: set == list == 6 | 'allexport', 7 | 'braceexpand', 8 | 'emacs', 9 | 'errexit', 10 | 'errtrace', 11 | 'functrace', 12 | 'hashall', 13 | 'histexpand', 14 | 'history', 15 | 'ignoreeof', 16 | 'keyword', 17 | 'monitor', 18 | 'noclobber', 19 | 'noexec', 20 | 'noglob', 21 | 'notify', 22 | 'nounset', 23 | 'onecmd', 24 | 'physical', 25 | 'pipefail', 26 | 'posix', 27 | 'privileged', 28 | 'verbose', 29 | 'vi', 30 | 'xtrace', 31 | == ENDLIST == 32 | 33 | == Set == expandmenu, map:bse, sc:s == 34 | |PickList( 'set option', 'set' )| 35 | set -o |PICK| 36 | == ENDTEMPLATE == 37 | -------------------------------------------------------------------------------- /bash-support/templates/shelloptions.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Shell Options 3 | § ============================================================= 4 | 5 | == LIST: shopt == list == 6 | 'assoc_expand_once', 7 | 'autocd', 8 | 'cdable_vars', 9 | 'cdspell', 10 | 'checkhash', 11 | 'checkjobs', 12 | 'checkwinsize', 13 | 'cmdhist', 14 | 'compat31', 15 | 'compat32', 16 | 'compat40', 17 | 'compat41', 18 | 'compat42', 19 | 'compat43', 20 | 'compat44', 21 | 'complete_fullquote', 22 | 'direxpand', 23 | 'dirspell', 24 | 'dotglob', 25 | 'execfail', 26 | 'expand_aliases', 27 | 'extdebug', 28 | 'extglob', 29 | 'extquote', 30 | 'failglob', 31 | 'force_fignore', 32 | 'globalasciiranges', 33 | 'globstar', 34 | 'gnu_errfmt', 35 | 'histappend', 36 | 'histreedit', 37 | 'histverify', 38 | 'hostcomplete', 39 | 'huponexit', 40 | 'inherit_errexit', 41 | 'interactive_comments', 42 | 'lastpipe', 43 | 'lithist', 44 | 'localvar_inherit', 45 | 'localvar_unset', 46 | 'login_shell', 47 | 'mailwarn', 48 | 'no_empty_cmd_completion', 49 | 'nocaseglob', 50 | 'nocasematch', 51 | 'nullglob', 52 | 'progcomp', 53 | 'progcomp_alias', 54 | 'promptvars', 55 | 'restricted_shell', 56 | 'shift_verbose', 57 | 'sourcepath', 58 | 'xpg_echo', 59 | == ENDLIST == 60 | 61 | == Shopts == expandmenu, insert, map:bso, sc:o == 62 | |PickList( 'Shopts', 'shopt' )| 63 | shopt -s |PICK| 64 | == ENDTEMPLATE == 65 | -------------------------------------------------------------------------------- /bash-support/templates/specialparams.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Special Parameters 3 | § ============================================================= 4 | 5 | == LIST: SpecialParameters == hash == 6 | 'number of posit. param.' : '#', 7 | 'all posit. param. (quoted spaces)' : '*', 8 | 'all posit. param. (unquoted spaces)' : '@', 9 | 'number of posit. parameters' : '#@', 10 | 'return code of last command' : '?', 11 | 'PID of this shell' : '$', 12 | 'flags set' : '-', 13 | 'last argument of prev. command' : '_', 14 | 'PID of last background command' : '!', 15 | == ENDLIST == 16 | 17 | == SpecParams == expandmenu, insert, sc:p, map:bsp == 18 | |PickList( 'Special Parameters', 'SpecialParameters' )| 19 | ${|VALUE|} 20 | == ENDTEMPLATE == 21 | 22 | SetExpansion ( 'SpecParams', '|KEY|', '$|VALUE|' ) 23 | 24 | -------------------------------------------------------------------------------- /bash-support/templates/statements.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements 3 | § ============================================================= 4 | 5 | == Statements.case == map:sc, shortcut:c == 6 | case in 7 | ) 8 | ;; 9 | 10 | ) 11 | ;; 12 | 13 | *) 14 | ;; 15 | 16 | esac # --- end of case --- 17 | == Statements.elif == map:sei, shortcut:e == 18 | elif ; then 19 | == Statements.for-in == map:sf, shortcut:f == 20 | for in ; do 21 | <-LOOP_BODY-> 22 | done 23 | == Statements.for == map:sfo, shortcut:f == 24 | for (( CNTR=0; CNTR<0; CNTR+=1 )); do 25 | <-LOOP_BODY-> 26 | done 27 | == Statements.if == map:si, shortcut:i == 28 | if ; then 29 | <-IF_PART-> 30 | fi 31 | == Statements.if-else == map:sie, shortcut:i == 32 | if ; then 33 | <-IF_PART-> 34 | else 35 | <+ELSE_PART+> 36 | fi 37 | == Statements.select == map:ss, shortcut:s == 38 | select in ; do 39 | done 40 | == Statements.until == map:su, shortcut:u == 41 | until ; do 42 | done 43 | == Statements.while == map:sw, shortcut:w == 44 | while ; do 45 | done 46 | == Statements.function == map:sfu, shortcut:f == 47 | |?FUNCTION_NAME| () 48 | { 49 | 50 | } # ---------- end of function |FUNCTION_NAME| ---------- 51 | == ENDTEMPLATE == 52 | 53 | § ------------------------------------------------------------- 54 | 55 | == SEP: Statements.sep-print == 56 | 57 | == Statements.echo == insert, map:se, shortcut:e == 58 | echo -e "" 59 | == Statements.printf == insert, map:sp, shortcut:p == 60 | printf "%s\n" 61 | == ENDTEMPLATE == 62 | 63 | § ------------------------------------------------------------- 64 | 65 | == SEP: Statements.sep-array == 66 | 67 | == Statements.array element == insert, map:sae, shortcut:a == 68 | ${[]} 69 | == Statements.array elements, all == insert, map:saa, shortcut:a == 70 | ${[@]} 71 | == Statements.array elements, string == insert, map:sas, shortcut:s == 72 | ${[*]} 73 | == Statements.subarray == insert, map:ssa, shortcut:s == 74 | ${[@]::} 75 | == Statements.no of element == insert, map:san, shortcut:n == 76 | ${#[@]} 77 | == Statements.array indices== insert, map:sai, shortcut:i == 78 | ${![@]} 79 | == ENDTEMPLATE == 80 | 81 | -------------------------------------------------------------------------------- /c-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/csupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | -------------------------------------------------------------------------------- 12 | 13 | -------------------------------------------------------------------------------- /c-support/codesnippets/Makefile.multi-target.template: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # 3 | # File: Makefile 4 | # Description: 5 | # 6 | # Usage: make (generate executable(s) ) 7 | # make clean (remove objects, executables ) 8 | # make tarball (generate compressed archive ) 9 | # make zip (generate compressed archive ) 10 | # 11 | # Author: Dr.-Ing. Fritz Mehner 12 | # Email: mehner.fritz@web.de 13 | # Created: 03.04.2012 14 | # 15 | #=============================================================================== 16 | 17 | TARGETS = target1 target2 18 | 19 | CC = gcc 20 | CCP = g++ 21 | CFLAGS = -c -g -Wall 22 | LFLAGS = -g 23 | SYS_LIBS = -lm 24 | TARBALL_INCLUDE = *.{c,h,cc,hh} Makefile 25 | ZIP_INCLUDE = $(TARBALL_INCLUDE) 26 | 27 | 28 | #---------- targets -------------------------------------- 29 | all: $(TARGETS) 30 | 31 | %.o: %.c 32 | $(CC) $(CFLAGS) $*.c 33 | 34 | %.o: %.cc 35 | $(CCP) $(CFLAGS) $*.cc 36 | 37 | #---------- target 1 ------------------------------------- 38 | # ----- C target 39 | target1: target1.o 40 | $(CC) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) 41 | 42 | #---------- target 2 ------------------------------------- 43 | # ----- C++ target 44 | target2: target2.o 45 | $(CCP) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) 46 | 47 | #---------- tarball -------------------------------------- 48 | tarball: 49 | @lokaldir=`pwd`; lokaldir=$${lokaldir##*/};\ 50 | rm --force $$lokaldir.tar.gz; \ 51 | tar --create \ 52 | --gzip \ 53 | --verbose \ 54 | --file $$lokaldir.tar.gz \ 55 | $(TARBALL_INCLUDE) 56 | 57 | #---------- zip ------------------------------------------ 58 | zip: 59 | @lokaldir=`pwd`; lokaldir=$${lokaldir##*/};\ 60 | zip -r $$lokaldir.zip $(ZIP_INCLUDE) 61 | 62 | #---------- clear up ------------------------------------- 63 | clean: 64 | rm --force $(TARGETS) *.o 65 | 66 | -------------------------------------------------------------------------------- /c-support/codesnippets/Makefile.pro: -------------------------------------------------------------------------------- 1 | #======================================================================================= 2 | # 3 | # Filename: Makefile.pro 4 | # Description: qmake project file 5 | # 6 | # Usage: qmake 7 | # 8 | # Version: 1.0 9 | # Created: 10 | # Revision: --- 11 | # Author: 12 | # Company: 13 | # Email: 14 | #======================================================================================= 15 | 16 | TEMPLATE = app 17 | CONFIG = debug warn_on 18 | SOURCES += 19 | HEADERS += 20 | TARGET = 21 | 22 | -------------------------------------------------------------------------------- /c-support/codesnippets/calloc_double_matrix.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * === FUNCTION ====================================================================== 4 | * Name: calloc_double_matrix 5 | * Description: Allocate a dynamic double-matrix of size rows*columns; 6 | * return a pointer. 7 | * ===================================================================================== 8 | */ 9 | double** 10 | calloc_double_matrix ( int rows, int columns ) 11 | { 12 | int i; 13 | double **m; 14 | m = calloc ( rows, sizeof(double*) ); /* allocate pointer array */ 15 | assert( m != NULL ); /* abort if allocation failed */ 16 | m[0] = calloc ( rows*columns, sizeof(double) );/* allocate data array */ 17 | assert(*m != NULL ); /* abort if allocation failed */ 18 | for ( i=1; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | * === FUNCTION ====================================================================== 9 | * Name: main 10 | * Description: main function 11 | * ===================================================================================== 12 | */ 13 | int 14 | main ( int argc, char *argv[] ) 15 | { 16 | printf ("\nProgram %s\n\n", argv[0] ); 17 | 18 | return EXIT_SUCCESS; 19 | } /* ---------- end of function main ---------- */ 20 | 21 | -------------------------------------------------------------------------------- /c-support/codesnippets/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | // === FUNCTION ====================================================================== 9 | // Name: main 10 | // Description: main function 11 | // ===================================================================================== 12 | int 13 | main ( int argc, char *argv[] ) 14 | { 15 | cout << "\nProgram " << argv[0] << endl << endl; 16 | 17 | return EXIT_SUCCESS; 18 | } // ---------- end of function main ---------- 19 | 20 | -------------------------------------------------------------------------------- /c-support/codesnippets/print_array.cc.noindent: -------------------------------------------------------------------------------- 1 | // === FUNCTION ====================================================================== 2 | // Name: print_array 3 | // Description: Print an array with one dimension. 4 | // Use 5 | // print_array( *matrix, n1*n2, n2, "matrix" ); 6 | // for 7 | // T matrix[n1][n2]; 8 | // ===================================================================================== 9 | template < class T, unsigned width, unsigned precision > 10 | void print_array ( T *array, // array to print 11 | int n, // number of elements to print 12 | int nrow, // number of elements per row 13 | string arrayname // array name 14 | ) 15 | { 16 | string line(" index | content\n ------+-"); 17 | 18 | cout << "\n\n array \"" << arrayname << "\", length " << n << endl << endl; 19 | cout << line.append(width*nrow, '-'); 20 | for ( int i=0; i 9 | " (formerly Fritz Mehner ) 10 | " 11 | " ------------------------------------------------------------------------------ 12 | 13 | " Only do this when not done yet for this buffer 14 | if exists("b:did_c_support_ftplugin") 15 | finish 16 | endif 17 | let b:did_c_support_ftplugin = 1 18 | 19 | " ---------- complete a classical C comment ---------------------------------- 20 | " '/*' => '/* | */' (and surround selected area in visual mode) 21 | "inoremap /* /**/ 22 | "vnoremap /* s/**/p 23 | 24 | " ---------- complete a classical C multi-line comment ----------------------- 25 | " '/*' => /* 26 | " * | 27 | " */ 28 | "inoremap /* /*/kA 29 | 30 | " ---------- { always opens a block -------------------------------------- 31 | "inoremap { {}O 32 | "vnoremap { S{}Pk=iB 33 | 34 | " ---------- Set "maplocalleader" as configured using "g:C_MapLeader" -------- 35 | call C_SetMapLeader () 36 | 37 | " ---------- Maps for the Make tool ------------------------------------------ 38 | noremap rm :Make 39 | inoremap rm :Make 40 | noremap rmc :Make clean 41 | inoremap rmc :Make clean 42 | noremap rmd :Make doc 43 | inoremap rmd :Make doc 44 | noremap rma :MakeCmdlineArgs 45 | inoremap rma :MakeCmdlineArgs 46 | noremap rcm :MakeFile 47 | inoremap rcm :MakeFile 48 | 49 | " ---------- Reset "maplocalleader" ------------------------------------------ 50 | call C_ResetMapLeader () 51 | 52 | -------------------------------------------------------------------------------- /c-support/rc/cpp.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : C++ 6 | " Plugin : c.vim 7 | " Revision : 03.10.2017 8 | " Maintainer : Wolfgang Mehner 9 | " 10 | " ------------------------------------------------------------------------------ 11 | 12 | " Only do this when not done yet for this buffer 13 | if exists("b:did_c_support_ftplugin") 14 | finish 15 | endif 16 | let b:did_c_support_ftplugin = 1 17 | 18 | " ---------- C++ I/O (speeds up typing) -------------------------------------- 19 | "inoremap >> >> 20 | "inoremap << << 21 | "inoremap <<" << "" 22 | "inoremap <<; << "\n"; 23 | 24 | " ---------- Set "maplocalleader" as configured using "g:C_MapLeader" -------- 25 | call C_SetMapLeader () 26 | 27 | " ---------- Maps for the Make tool ------------------------------------------ 28 | noremap rm :Make 29 | inoremap rm :Make 30 | noremap rmc :Make clean 31 | inoremap rmc :Make clean 32 | noremap rmd :Make doc 33 | inoremap rmd :Make doc 34 | noremap rma :MakeCmdlineArgs 35 | inoremap rma :MakeCmdlineArgs 36 | noremap rcm :MakeFile 37 | inoremap rcm :MakeFile 38 | 39 | " ---------- Reset "maplocalleader" ------------------------------------------ 40 | call C_ResetMapLeader () 41 | 42 | -------------------------------------------------------------------------------- /c-support/rc/customization.ctags: -------------------------------------------------------------------------------- 1 | 2 | --regex-make=/^[[:space:]]*([[:alnum:]_]+)[[:space:]]*:?=/\1/v,variables/ 3 | --regex-make=/^([^:# \t]+)[ \t]*:[[:space:]]*([^=]?.*)/\1: \2/t,targets/ 4 | --regex-make=/^include[ \t]+(.+)/\1/i,includes/ 5 | 6 | --langdef=qmake 7 | --langmap=qmake:+.pro 8 | --regex-qmake=/^([[:upper:]_]+)/\1/t,SystemVariables/ 9 | 10 | -------------------------------------------------------------------------------- /c-support/rc/customization.gvimrc: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: customization.gvimrc 4 | " 5 | " Description: suggestion for a personal configuration file ~/.vimrc 6 | " 7 | " VIM Version: 7.0+ 8 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 9 | " Dr. Fritz Mehner (fgm), mehner.fritz@web.de 10 | " Revision: 16.04.2019 11 | " License: Copyright (c) 2009-2018, Dr. Fritz Mehner 12 | " Copyright (c) 2019, Wolfgang Mehner 13 | "=============================================================================== 14 | 15 | "=============================================================================== 16 | " GENERAL SETTINGS 17 | "=============================================================================== 18 | 19 | set cmdheight=2 " Make command line two lines high 20 | set mousehide " Hide the mouse when typing text 21 | 22 | highlight Normal guibg=grey90 23 | highlight Cursor guibg=Blue guifg=NONE 24 | highlight lCursor guibg=Cyan guifg=NONE 25 | highlight NonText guibg=grey80 26 | highlight Constant gui=NONE guibg=grey95 27 | highlight Special gui=NONE guibg=grey95 28 | 29 | let c_comment_strings=1 " highlight strings inside C comments 30 | 31 | "------------------------------------------------------------------------------- 32 | " Moving cursor to other windows 33 | " 34 | " shift-down : change window focus to lower one (cyclic) 35 | " shift-up : change window focus to upper one (cyclic) 36 | " shift-left : change window focus to one on left 37 | " shift-right : change window focus to one on right 38 | "------------------------------------------------------------------------------- 39 | nnoremap w 40 | nnoremap W 41 | nnoremap h 42 | nnoremap l 43 | 44 | "------------------------------------------------------------------------------- 45 | " Some additional hot keys 46 | " 47 | " shift-F3 : call gvim file browser 48 | "------------------------------------------------------------------------------- 49 | noremap :silent browse confirm e 50 | inoremap :silent browse confirm e 51 | 52 | "------------------------------------------------------------------------------- 53 | " toggle insert mode <--> normal mode with the -key 54 | "------------------------------------------------------------------------------- 55 | 56 | nnoremap 57 | inoremap 58 | 59 | "------------------------------------------------------------------------------- 60 | " use font with clearly distinguishable brackets: ()[]{} 61 | "------------------------------------------------------------------------------- 62 | "set guifont=Luxi\ Mono\ 14 63 | -------------------------------------------------------------------------------- /c-support/rc/customization.indent.pro: -------------------------------------------------------------------------------- 1 | --blank-lines-after-procedures 2 | --brace-indent0 3 | --comment-indentation49 4 | --declaration-comment-column49 5 | --declaration-indentation10 6 | --space-after-parentheses 7 | --swallow-optional-blank-lines 8 | --tab-size2 9 | -------------------------------------------------------------------------------- /c-support/rc/make.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : Make 6 | " Plugin : c.vim / latex-support.vim / ... 7 | " Revision : 03.10.2017 8 | " Maintainer : Wolfgang Mehner 9 | " (formerly Fritz Mehner ) 10 | " 11 | " ------------------------------------------------------------------------------ 12 | 13 | " Only do this when not done yet for this buffer 14 | if exists("b:did_c_support_make") 15 | finish 16 | endif 17 | let b:did_c_support_make = 1 18 | 19 | " ---------- Set "maplocalleader" as configured using "g:C_MapLeader" -------- 20 | "call C_SetMapLeader () 21 | 22 | " ---------- Maps for the Make tool ------------------------------------------ 23 | noremap rm :Make 24 | inoremap rm :Make 25 | noremap rmc :Make clean 26 | inoremap rmc :Make clean 27 | noremap rmd :Make doc 28 | inoremap rmd :Make doc 29 | noremap rma :MakeCmdlineArgs 30 | inoremap rma :MakeCmdlineArgs 31 | noremap rcm :MakeFile 32 | inoremap rcm :MakeFile 33 | 34 | " ---------- Reset "maplocalleader" ------------------------------------------ 35 | "call C_ResetMapLeader () 36 | 37 | -------------------------------------------------------------------------------- /c-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /c-support/rc/project/in.vim: -------------------------------------------------------------------------------- 1 | "------------------------------------------------------------------------------- 2 | " example for using the C/C++ toolbox together with the project plug-in's "in=" 3 | " option (a file like this one can be used as the script set by the "in=" 4 | " option): 5 | " :help project.txt 6 | " :help project-syntax 7 | " :help toolbox-cmake 8 | " :help toolbox-doxygen 9 | " :help toolbox-make 10 | "------------------------------------------------------------------------------- 11 | 12 | let s:project_name = 'TODO' 13 | 14 | "------------------------------------------------------------------------------- 15 | " Project 16 | "------------------------------------------------------------------------------- 17 | if ! exists ( 'g:did_project_in_vim' ) || g:did_project_in_vim != s:project_name 18 | 19 | let g:did_project_in_vim = s:project_name 20 | 21 | " in.vim is located in the project's top-level directory: 22 | let s:mypath = expand ( ':p:h' ).'/' 23 | 24 | " --- OR --- 25 | 26 | " " in.vim is located in a directory below the top-level directory 27 | " " (e.g. project/in.vim): 28 | " let s:mypath = expand ( ':p:h:h' ).'/' 29 | 30 | " " C: path for 'project_include' 31 | " call mmtemplates#core#Resource ( g:C_Templates, 'set', 'path', 32 | " \ 'project_include', s:mypath ) 33 | 34 | " " C: set style 35 | " call mmtemplates#core#ChooseStyle ( g:C_Templates, "DOXYGEN" ) 36 | 37 | " " CMake: directories 38 | " " - the build is located in a sub-directory build/ 39 | " call mmtoolbox#cmake#Property ( 'set', 'project-dir', s:mypath ) 40 | " call mmtoolbox#cmake#Property ( 'set', 'build-dir', s:mypath.'build' ) 41 | 42 | " " Doxygen: files 43 | " " - the "Doxyfile" is located in the top-level directory 44 | " " - The setting for "log-file" is actually the default 45 | " " - the "WARN_LOGFILE" option is the in Doxyfile: 46 | " " WARN_LOGFILE = "doxy_warnings.txt" 47 | " call mmtoolbox#doxygen#Property ( 'set', 'config-file', s:mypath.'Doxyfile' ) 48 | " call mmtoolbox#doxygen#Property ( 'set', 'log-file', s:mypath.'.doxygen.log' ) 49 | " call mmtoolbox#doxygen#Property ( 'set', 'error-file', s:mypath.'doxy_warnings.txt' ) 50 | 51 | " " Make: files 52 | " " - the "Makefile" is located in the top-level directory 53 | " call mmtoolbox#make#Property ( 'set', 'makefile', s:mypath.'Makefile' ) 54 | 55 | endif 56 | 57 | "------------------------------------------------------------------------------- 58 | " File 59 | "------------------------------------------------------------------------------- 60 | if ! exists ( 'b:did_project_in_vim' ) 61 | 62 | let b:did_project_in_vim = 1 63 | 64 | " " Option: spelling 65 | " set spl=en spell 66 | 67 | " " Option: filetype (additional Doxygen documentation) 68 | " if bufname('%') =~ '\V.docu\$' 69 | " set filetype=c 70 | " endif 71 | 72 | endif 73 | -------------------------------------------------------------------------------- /c-support/scripts/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #=============================================================================== 3 | # FILE: wrapper.sh 4 | # USAGE: ./wrapper.sh executable [cmd-line-args] 5 | # DESCRIPTION: Wraps the execution of a programm or script. 6 | # Use with xterm: xterm -e wrapper.sh executable cmd-line-args 7 | # This script is used by the plugins c.vim 8 | # OPTIONS: --- 9 | # REQUIREMENTS: --- 10 | # BUGS: --- 11 | # NOTES: --- 12 | # AUTHOR: Dr.-Ing. Fritz Mehner (fgm), mehner.fritz@web.de 13 | # CREATED: 23.11.2004 18:04:01 CET 14 | #=============================================================================== 15 | 16 | executable="${1}" # name of the executable 17 | 18 | if [ ${#} -ge 1 ] && [ -x "$executable" ] 19 | then 20 | "${@}" 21 | returncode=$? 22 | [ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n" 23 | else 24 | printf "\n !! file \"${executable}\" does not exist or is not executable !!\n" 25 | returncode=126 # command invoked cannot execute 26 | fi 27 | read -p " ... press return key ... " dummy 28 | exit $returncode 29 | -------------------------------------------------------------------------------- /c-support/templates/Templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Interface Version 3 | § 4 | § enable advanced features 5 | § ============================================================= 6 | 7 | InterfaceVersion ( '1.0' ) 8 | 9 | § ========================================================== 10 | § Settings 11 | § ========================================================== 12 | 13 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 14 | SetMacro( 'AUTHORREF', '' ) 15 | SetMacro( 'EMAIL', '' ) 16 | SetMacro( 'ORGANIZATION', '' ) 17 | SetMacro( 'COMPANY', '' ) 18 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 19 | SetMacro( 'LICENSE', 'GNU General Public License' ) 20 | 21 | SetFormat( 'DATE', '%x' ) 22 | SetFormat( 'TIME', '%X' ) 23 | SetFormat( 'YEAR', '%Y' ) 24 | 25 | SetStyle( 'C' ) 26 | 27 | § templates automatically included into new files 28 | § set the property to an empty string to disable the insertion 29 | SetProperty ( 'C::FileSkeleton::Header', 'Comments.file description header' ) 30 | SetProperty ( 'C::FileSkeleton::Source', 'Comments.file description impl' ) 31 | SetProperty ( 'Cpp::FileSkeleton::Header', 'Comments.file description header' ) 32 | SetProperty ( 'Cpp::FileSkeleton::Source', 'Comments.file description impl' ) 33 | 34 | § ========================================================== 35 | § File Includes and Shortcuts 36 | § ========================================================== 37 | 38 | MenuShortcut( 'Comments', 'c' ) 39 | MenuShortcut( 'Statements', 's' ) 40 | MenuShortcut( 'Idioms', 'i' ) 41 | MenuShortcut( 'Preprocessor', 'p' ) 42 | MenuShortcut( 'Snippets', 'n' ) 43 | MenuShortcut( 'C++', 'c' ) 44 | MenuShortcut( 'Help', 'h' ) 45 | 46 | IncludeFile( 'snippets.template' ) 47 | 48 | § different comments for styles "C", "CPP" and "Doxygen": 49 | 50 | == USE STYLES : C == 51 | IncludeFile( 'c.comments.template' ) 52 | == ENDSTYLES == 53 | 54 | == USE STYLES : CPP == 55 | IncludeFile( 'cpp.comments.template' ) 56 | == ENDSTYLES == 57 | 58 | § the rest of the templates are the same for the two styles "C" and "Doxygen"; 59 | § you may also group "Doxygen" and "CPP" if you like this better: 60 | 61 | == USE STYLES : C, Doxygen == 62 | IncludeFile( 'c.statements.template' ) 63 | IncludeFile( 'c.idioms.template' ) 64 | IncludeFile( 'c.preprocessor.template' ) 65 | IncludeFile( 'c.cpp.template' ) 66 | == ENDSTYLES == 67 | 68 | == USE STYLES : CPP == 69 | IncludeFile( 'cpp.statements.template' ) 70 | IncludeFile( 'cpp.idioms.template' ) 71 | IncludeFile( 'cpp.preprocessor.template' ) 72 | IncludeFile( 'cpp.cpp.template' ) 73 | == ENDSTYLES == 74 | 75 | § ============================================================= 76 | § Help 77 | § ============================================================= 78 | 79 | IncludeFile( 'help.template' ) 80 | 81 | -------------------------------------------------------------------------------- /c-support/templates/c.statements.template: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements (C) 3 | § ============================================================= 4 | 5 | § 6 | § The names INIT, CONDITION, INCREMENT, and 'for block' are used by the main 7 | § plugin plugin/c.vim . Please do not change. 8 | § 9 | == Statements.for block == nomenu == 10 | |Insert( 'Statements.for', '' )| 11 | == Statements.for == map:sfo, shortcut:f == 12 | |DefaultMacro( 'CONDITION', '{+CONDITION+}' )| 13 | |DefaultMacro( 'INCREMENT', '{+INCREMENT+}' )| 14 | for ( |INIT|; |CONDITION|; |INCREMENT| ) { 15 | } 16 | == Statements.range-based for == map:sfr, shortcut:a == 17 | for ( : <-EXPRESSION-> ) { 18 | } 19 | == Statements.do while == map:sd, shortcut:d == 20 | do { 21 | } while ( ); /* ----- end do-while ----- */ 22 | == Statements.while == map:sw, shortcut:w == 23 | while ( ) { 24 | } 25 | == ENDTEMPLATE == 26 | 27 | == SEP: Statements.sep-if == 28 | 29 | == Statements.if == map:sif, shortcut:i == 30 | if ( ) { 31 | <-IF_PART-> 32 | } 33 | == Statements.if + else == map:sie, shortcut:i == 34 | if ( ) { 35 | <-IF_PART-> 36 | } 37 | else { 38 | <-ELSE_PART-> 39 | } 40 | == Statements.else if == map:sei, shortcut:e == 41 | else if ( ) { 42 | <-IF_PART-> 43 | } 44 | == Statements.else == map:sel, shortcut:e == 45 | else { 46 | 47 | } 48 | == ENDTEMPLATE == 49 | 50 | == SEP: Statements.sep-switch == 51 | 52 | == Statements.switch == map:ss, shortcut:s == 53 | switch ( ) { 54 | case <-LABEL->: 55 | break; 56 | 57 | case <-LABEL->: 58 | break; 59 | 60 | case <-LABEL->: 61 | break; 62 | 63 | default: 64 | break; 65 | } /* ----- end switch ----- */ 66 | == Statements.case == map:sc, shortcut:c == 67 | case : 68 | break; 69 | == ENDTEMPLATE == 70 | 71 | == SEP: Statements.sep-block == 72 | 73 | == Statements.block == map:sb, shortcut:b == 74 | { 75 | 76 | } 77 | == ENDTEMPLATE == 78 | -------------------------------------------------------------------------------- /c-support/templates/cpp.statements.template: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements (C++) 3 | § ============================================================= 4 | 5 | § 6 | § The names INIT, CONDITION, INCREMENT, and 'for block' are used by the main 7 | § plugin plugin/c.vim . Please do not change. 8 | § 9 | == Statements.for block == nomenu == 10 | |Insert( 'Statements.for', '' )| 11 | == Statements.for == map:sfo, shortcut:f == 12 | |DefaultMacro( 'CONDITION', '{+CONDITION+}' )| 13 | |DefaultMacro( 'INCREMENT', '{+INCREMENT+}' )| 14 | for ( |INIT|; |CONDITION|; |INCREMENT| ) { 15 | } 16 | == Statements.range-based for == map:sfr, shortcut:a == 17 | for ( : <-EXPRESSION-> ) { 18 | } 19 | == Statements.do while == map:sd, shortcut:d == 20 | do { 21 | } while ( ); // ----- end do-while ----- 22 | == Statements.while == map:sw, shortcut:w == 23 | while ( ) { 24 | } 25 | == ENDTEMPLATE == 26 | 27 | == Statements.if == map:sif, shortcut:i == 28 | if ( ) { 29 | <-IF_PART-> 30 | } 31 | == Statements.if + else == map:sie, shortcut:i == 32 | if ( ) { 33 | <-IF_PART-> 34 | } 35 | else { 36 | <-ELSE_PART-> 37 | } 38 | == Statements.else if == map:sei, shortcut:e == 39 | else if ( ) { 40 | <-IF_PART-> 41 | } 42 | == Statements.else == map:sel, shortcut:e == 43 | else { 44 | 45 | } 46 | == ENDTEMPLATE == 47 | 48 | == Statements.switch == map:ss, shortcut:s == 49 | switch ( ) { 50 | case <-LABEL->: 51 | break; 52 | 53 | case <-LABEL->: 54 | break; 55 | 56 | case <-LABEL->: 57 | break; 58 | 59 | default: 60 | break; 61 | } // ----- end switch ----- 62 | == Statements.case == map:sc, shortcut:c == 63 | case : 64 | break; 65 | == ENDTEMPLATE == 66 | 67 | == Statements.block == map:sb, shortcut:b == 68 | { 69 | 70 | } 71 | == ENDTEMPLATE == 72 | -------------------------------------------------------------------------------- /c-support/templates/help.template: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Help 3 | § 4 | § every time a help template is used, it opens an URL in the 5 | § browser, which follows this general format: 6 | § |HelpPathXYZ| 7 | § 8 | § use g:Templates_InternetBrowserExec to set the browser 9 | § 10 | § help English: 11 | § - pick up the word under the cursor 12 | § - delete non-word characters before calling the help 13 | § - the word is always included in the URL in lowercase, 14 | § which seems to work better 15 | § ============================================================= 16 | 17 | SetMacro( 'HelpPathEnglish', 'http://en.wiktionary.org/wiki/' ) 18 | 19 | == HELP: Help.English == map:he, sc:e == 20 | |Word( '' )| 21 | |Substitute( '\W', '', 'g' )| 22 | |Browser( '|HelpPathEnglish||PICK:l|' )| 23 | == ENDTEMPLATE == 24 | -------------------------------------------------------------------------------- /c-support/templates/snippets.template: -------------------------------------------------------------------------------- 1 | == LIST: snippets_jumptags == hash == 2 | 'less-plus' : '<++>', 3 | 'less-minus' : '<-->', 4 | 'brace-plus' : '{++}', 5 | 'brace-minus' : '{--}', 6 | 'optional-plus' : '[++]', 7 | 'optional-minus' : '[--]', 8 | == ENDLIST == 9 | 10 | == Snippets.jump tags == expandmenu, insert, map:njt, shortcut:m == 11 | |PickList( 'jumptags', 'snippets_jumptags' )| 12 | |PICK| 13 | == ENDTEMPLATE == 14 | -------------------------------------------------------------------------------- /c-support/wordlists/k+r.list: -------------------------------------------------------------------------------- 1 | address 2 | allocator 3 | allocation 4 | argument 5 | arithmetic 6 | array 7 | assignement 8 | bitwise 9 | block 10 | character 11 | command 12 | condition 13 | conditional 14 | constant 15 | conversion 16 | declaration 17 | decrement 18 | defined 19 | definition 20 | descriptor 21 | description 22 | dimension 23 | evaluation 24 | expression 25 | external 26 | format 27 | formatted 28 | function 29 | global 30 | handling 31 | identifier 32 | implementation 33 | increment 34 | initialization 35 | input 36 | interface 37 | label 38 | lexical 39 | local 40 | logical 41 | lookup 42 | loop 43 | lvalue 44 | miscellaneous 45 | notation 46 | numerical 47 | operator 48 | operation 49 | output 50 | pointer 51 | precedence 52 | preprocessor 53 | preprocessing 54 | program 55 | random 56 | recursion 57 | recursive 58 | reference 59 | referential 60 | relational 61 | scope 62 | standard 63 | statement 64 | string 65 | structure 66 | system 67 | undefined 68 | variable 69 | 70 | abstract 71 | algorithm 72 | alignment 73 | application 74 | assignment 75 | asynchronous 76 | binary 77 | buffer 78 | component 79 | constructor 80 | container 81 | destructor 82 | difference 83 | enumeration 84 | exception 85 | floating-point 86 | horizontal 87 | inheritance 88 | instantiation 89 | integer 90 | internal 91 | invariant 92 | iterator 93 | localization 94 | overflow 95 | overload 96 | override 97 | overwrite 98 | polymorphic 99 | portability 100 | position 101 | postcondition 102 | precision 103 | precondition 104 | prototype 105 | subscript 106 | underflow 107 | vertical 108 | whitespace 109 | -------------------------------------------------------------------------------- /checkversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash - 2 | #=============================================================================== 3 | # 4 | # FILE: checkversion.sh 5 | # 6 | # USAGE: ./checkversion.sh plugin [major version number] 7 | # 8 | # DESCRIPTION: 9 | # 10 | # OPTIONS: --- 11 | # REQUIREMENTS: --- 12 | # BUGS: --- 13 | # NOTES: --- 14 | # AUTHOR: Dr. Fritz Mehner (fgm), mehner.fritz@web.de 15 | # CREATED: 11.08.2013 10:02 16 | # REVISION: --- 17 | #=============================================================================== 18 | 19 | set -o nounset # Treat unset variables as an error 20 | 21 | #=== FUNCTION ================================================================ 22 | # NAME: usage 23 | # DESCRIPTION: Display usage information. 24 | #=============================================================================== 25 | function usage () 26 | { 27 | cat <<- EOT 28 | 29 | Usage : ${0##/*/} plugin [major version number] 30 | 31 | EOT 32 | } # ---------- end of function usage ---------- 33 | 34 | [ ${#} -lt 1 ] && usage && exit 0 35 | 36 | major=${2:-[[:digit:]]+} # major version number or digits 37 | regex='version[^[:digit:]]+'$major 38 | 39 | case $1 in 40 | awk) 41 | echo -e "-- check awk --" 42 | egrep -Rin "$regex" awk-support plugin/awk-support.vim doc/awksupport.txt 43 | ;; 44 | 45 | bash) 46 | echo -e "-- check bash --" 47 | egrep -Rin "$regex" bash-support plugin/bash-support.vim doc/bashsupport.txt 48 | ;; 49 | 50 | c) 51 | echo -e "-- check c --" 52 | egrep -Rin "$regex" c-support plugin/c.vim doc/csupport.txt 53 | ;; 54 | 55 | latex) 56 | echo -e "-- check latex --" 57 | egrep -Rin "$regex" latex-support plugin/latex.vim doc/latexsupport.txt 58 | ;; 59 | 60 | perl) 61 | echo -e "-- check perl --" 62 | egrep -Rin "$regex" perl-support plugin/perl-support.vim doc/perlsupport.txt 63 | ;; 64 | 65 | vim) 66 | echo -e "-- check vim --" 67 | egrep -Rin "$regex" vim-support plugin/vim-support.vim doc/vimsupport.txt 68 | ;; 69 | 70 | *) 71 | echo -e "** no plugin with name '$1' **" 72 | ;; 73 | 74 | esac # --- end of case --- 75 | 76 | -------------------------------------------------------------------------------- /ftdetect/template.vim: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: template.vim 4 | " 5 | " Description: Filetype detection for templates. 6 | " 7 | " Straight out of the documentation: 8 | " - do not overwrite the filetype if it has already been set 9 | " 10 | " VIM Version: 7.0+ 11 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 12 | " Organization: 13 | " Version: 1.0 14 | " Created: 07.06.2015 15 | " Revision: --- 16 | " License: Copyright (c) 2015, Wolfgang Mehner 17 | "=============================================================================== 18 | 19 | autocmd BufNewFile,BufRead *.template,*.templates,Templates setfiletype template 20 | -------------------------------------------------------------------------------- /ftplugin/bashhelp.vim: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: bashhelp.vim 4 | " 5 | " Description: Filetype plugin for Bash's built-in help. 6 | " 7 | " Some settings have been taken from Neovim's filetype plug-in 8 | " for 'man'. 9 | " 10 | " VIM Version: 7.4+ 11 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 12 | " Organization: 13 | " Version: 1.0 14 | " Created: 16.11.2017 15 | " Revision: --- 16 | "=============================================================================== 17 | 18 | " only do this when not done yet for this buffer 19 | if exists("b:did_BashHelp_ftplugin") 20 | finish 21 | endif 22 | let b:did_BashHelp_ftplugin = 1 23 | 24 | setlocal noexpandtab 25 | setlocal tabstop=8 26 | setlocal softtabstop=8 27 | setlocal shiftwidth=8 28 | 29 | setlocal nonumber 30 | setlocal norelativenumber 31 | setlocal foldcolumn=0 32 | setlocal colorcolumn=0 33 | setlocal nolist 34 | setlocal nofoldenable 35 | -------------------------------------------------------------------------------- /ftplugin/template.vim: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: template.vim 4 | " 5 | " Description: Filetype plugin for templates. 6 | " 7 | " VIM Version: 7.0+ 8 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 9 | " Organization: 10 | " Version: 1.0 11 | " Created: 30.08.2011 12 | " Revision: 04.01.2016 13 | " License: Copyright (c) 2012-2016, Wolfgang Mehner 14 | " This program is free software; you can redistribute it and/or 15 | " modify it under the terms of the GNU General Public License as 16 | " published by the Free Software Foundation, version 2 of the 17 | " License. 18 | " This program is distributed in the hope that it will be 19 | " useful, but WITHOUT ANY WARRANTY; without even the implied 20 | " warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 21 | " PURPOSE. 22 | " See the GNU General Public License version 2 for more details. 23 | "=============================================================================== 24 | 25 | " only do this when not done yet for this buffer 26 | if exists("b:did_Template_ftplugin") 27 | finish 28 | endif 29 | let b:did_Template_ftplugin = 1 30 | 31 | "------------------------------------------------------------------------------- 32 | " Editing: repeat comments, ... 33 | "------------------------------------------------------------------------------- 34 | 35 | " default: -something- 36 | setlocal comments=sO:§\ -,mO:§\ \ ,eO:§§,:§ 37 | " default: tcq 38 | " - remove auto-wrap text 39 | " - keep autowrap comments 40 | " - add insertion of comment leader after hitting , o, O 41 | " - add do not break lines which were already to long 42 | setlocal formatoptions-=t 43 | setlocal formatoptions+=rol 44 | 45 | -------------------------------------------------------------------------------- /latex-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/latexsupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | Preview Version 12 | ================================================================================ 13 | 14 | ___This is a preview version!___ 15 | 16 | Notable new features: 17 | 18 | - Call external tools via the command-line: `:Latex`, `:LatexCheck`, 19 | `:LatexMakeindex`, `:LatexBibtex`, `:LatexView`. 20 | - Change the typesetter during runtime using `:LatexTypesetter`. 21 | - Background processing, enable via `:LatexProcessing`. 22 | - View errors from background processing in quickfix using `:LatexErrors`. 23 | - Add maps for BibTeX buffers. The maps for the Comment, Text, and BibTeX 24 | templates now are available when editing BibTeX. 25 | 26 | The background processing relies on the new `+job` feature, which becomes 27 | available with a patch level of approx. `7.4.2000`. 28 | 29 | _Please read the release notes below._ 30 | 31 | 32 | -------------------------------------------------------------------------------- 33 | 34 | -------------------------------------------------------------------------------- /latex-support/codesnippets/beamer/toc-at-begin-sections.tex: -------------------------------------------------------------------------------- 1 | % ToC at beginning of sections 2 | \AtBeginSection[] 3 | { 4 | \begin{frame}{Contents} 5 | \tableofcontents[currentsection] 6 | \end{frame} 7 | } 8 | -------------------------------------------------------------------------------- /latex-support/codesnippets/beamer/toc-at-begin-subsections.tex: -------------------------------------------------------------------------------- 1 | % ToC at beginning of subsections 2 | \AtBeginSubsection[] 3 | { 4 | \begin{frame}{Contents} 5 | \tableofcontents[currentsection,currentsubsection] 6 | \end{frame} 7 | } 8 | -------------------------------------------------------------------------------- /latex-support/codesnippets/listings-basic-settings.tex: -------------------------------------------------------------------------------- 1 | 2 | %%---------------------------------------------------------------------- 3 | %% Settings for the package listings 4 | %% \usepackage[scaled]{luximono} 5 | %%---------------------------------------------------------------------- 6 | \usepackage{listings} 7 | 8 | \lstset{basicstyle={\ttfamily\small}} 9 | \lstset{commentstyle=\itshape} 10 | \lstset{extendedchars=true} 11 | \lstset{frame=none} 12 | \lstset{framesep=2mm} 13 | \lstset{identifierstyle=\ttfamily} 14 | \lstset{keywordstyle=\bfseries} 15 | \lstset{language=C} 16 | \lstset{linewidth=155mm} 17 | \lstset{numbers=left} 18 | \lstset{numberstyle=\tiny} 19 | \lstset{showstringspaces=false} 20 | \lstset{stepnumber=1} 21 | \lstset{tabsize=2} 22 | % Replace German Umlauts ( literate={replace}{replacement text}{length} ... ) 23 | \lstset{literate= 24 | {ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 25 | {Ä}{{\"A}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 26 | {ß}{{\ss}}1 27 | } 28 | 29 | \lstdefinestyle{ANSI}{language=C} 30 | \lstdefinestyle{C++}{alsolanguage=C++} 31 | 32 | -------------------------------------------------------------------------------- /latex-support/codesnippets/vim-modeline.tex: -------------------------------------------------------------------------------- 1 | % vim: foldmethod=marker foldmarker=[[[,]]] 2 | -------------------------------------------------------------------------------- /latex-support/doc/ChangeLog: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------------- 2 | RELEASE NOTES FOR VERSION 1.2 3 | --------------------------------------------------------------------------------------- 4 | - Add 'g:Latex_CustomTemplateFile'. 5 | - Add template personalization file and setup wizard. 6 | - Change some templates. 7 | - Add maps to bibtex buffers. 8 | 9 | --------------------------------------------------------------------------------------- 10 | RELEASE NOTES FOR VERSION 1.1.1 11 | --------------------------------------------------------------------------------------- 12 | - Added some new templates. 13 | - Added 'Latex_SetMapLeader' and 'Latex_ResetMapLeader'. 14 | - Bugfix: Resetting maplocalleader in filetype plug-in after setting it to the value of 15 | g:Latex_MapLeader. 16 | - Bugfix: Better compatibility with custom mappings 17 | (use "normal!" and "noremap" consistently). 18 | - Bugfix: Setup of local templates in case of global installation. 19 | - Bugfix: Renamed function which were named "g:*". 20 | - Always load the newest version of the template engine available on 'runtimepath'. 21 | 22 | --------------------------------------------------------------------------------------- 23 | RELEASE NOTES FOR VERSION 1.1 24 | --------------------------------------------------------------------------------------- 25 | - Beamer templates and snippets added. 26 | - Template added. 27 | - Integration of Make moved into the toolbox. 28 | - New map \rc to start a converter. 29 | - Bugfix: Setup of local templates in case of global installation. 30 | - Bugfix: Map and menu entry 'Snippets->edit global templates'. 31 | - Bugfix: Starting an external viewer now works under Windows. 32 | - Minor bugfixes and improvements. 33 | 34 | --------------------------------------------------------------------------------------- 35 | RELEASE NOTES FOR VERSION 1.0 36 | --------------------------------------------------------------------------------------- 37 | - Initial public release. 38 | 39 | -------------------------------------------------------------------------------- /latex-support/rc/customization.ctags: -------------------------------------------------------------------------------- 1 | 2 | --langdef=latex 3 | --langmap=latex:.tex 4 | 5 | --regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/PART \2/s,section/ 6 | --regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/PART \1/s,section/ 7 | 8 | --regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/CHAP \2/s,section/ 9 | --regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/CHAP \1/s,section/ 10 | 11 | --regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/. \2/s,section/ 12 | --regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/. \1/s,section/ 13 | 14 | --regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/.. \2/s,section/ 15 | --regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/.. \1/s,section/ 16 | 17 | --regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/... \2/s,section/ 18 | --regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/... \1/s,section/ 19 | 20 | --regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{[[:space:]]*([^}]+)[[:space:]]*\}/\3/g,graphics/ 21 | --regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{[[:space:]]*([^}]+)[[:space:]]*\}/\3/i,listings/ 22 | 23 | --regex-latex=/\\frametitle[[:space:]]*\{([^}]+)\}/ # \1/s,section/ 24 | --regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/ 25 | --regex-latex=/\\bibitem[[:space:]]*\[([^]]*)\]\{([^}]+)\}/\1 \2/b,bibitem/ 26 | 27 | --langdef=bibtex 28 | --langmap=bibtex:.bib 29 | --regex-bibtex=/@string\{([^ "#%')(,=}{]+)/\1/s,BibTeX-Strings/i 30 | --regex-bibtex=/@(article|book|booklet|inbook|incollection|inproceedings|manual|masterthesis|misc|phdthesis|proceedings|techreport|unpublished)\{([^,]+),/\2 [\1]/e,BibTeX-Entries/i 31 | --regex-bibtex=/[[:space:]]*author[[:space:]]*=[[:space:]]*("([^"]+)"|\{([^\}]+)\})[[:space:]]*,?[[:space:]]*$/\2\3/a,BibTeX-Authors/i 32 | --regex-bibtex=/[[:space:]]*title[[:space:]]*=[[:space:]]*["\{](\{[:word:]+\}.+|.+)(["}][[:space:]]*,[[:space:]]*$|$)/\1/t,BibTeX-Titles/i 33 | 34 | -------------------------------------------------------------------------------- /latex-support/rc/make.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : Make 6 | " Plugin : c.vim / latex-support.vim / ... 7 | " Revision : 03.10.2017 8 | " Maintainer : Wolfgang Mehner 9 | " (formerly Fritz Mehner ) 10 | " 11 | " ------------------------------------------------------------------------------ 12 | 13 | " Only do this when not done yet for this buffer 14 | if exists("b:did_c_support_make") 15 | finish 16 | endif 17 | let b:did_c_support_make = 1 18 | 19 | " ---------- Set "maplocalleader" as configured using "g:C_MapLeader" -------- 20 | "call C_SetMapLeader () 21 | 22 | " ---------- Maps for the Make tool ------------------------------------------ 23 | noremap rm :Make 24 | inoremap rm :Make 25 | noremap rmc :Make clean 26 | inoremap rmc :Make clean 27 | noremap rmd :Make doc 28 | inoremap rmd :Make doc 29 | noremap rma :MakeCmdlineArgs 30 | inoremap rma :MakeCmdlineArgs 31 | noremap rcm :MakeFile 32 | inoremap rcm :MakeFile 33 | 34 | " ---------- Reset "maplocalleader" ------------------------------------------ 35 | "call C_ResetMapLeader () 36 | 37 | -------------------------------------------------------------------------------- /latex-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /latex-support/rc/tex.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : LaTeX 6 | " Plugin : latex-support.vim 7 | " Revision : 29.07.2017 8 | " Maintainer : Wolfgang Mehner 9 | " 10 | " ------------------------------------------------------------------------------ 11 | 12 | " Only do this when not done yet for this buffer 13 | if exists("b:did_latex_support_ftplugin") 14 | finish 15 | endif 16 | let b:did_latex_support_ftplugin = 1 17 | 18 | " ---------- Add to the keyword characters ----------------------------------- 19 | " useful for searching labels which use special characters 20 | "setlocal iskeyword+=_ 21 | "setlocal iskeyword+=: 22 | 23 | " ---------- Key mappings --------------------------------------------------- 24 | " double '$', surround marked expression with '$ ... $' 25 | "inoremap $ $$ 26 | "vnoremap $ s$$P 27 | 28 | " ---------- Set "maplocalleader" as configured using "g:Latex_MapLeader" ---- 29 | call Latex_SetMapLeader () 30 | 31 | " ---------- Maps for running Latex et al. ----------------------------------- 32 | nnoremap :Latex 33 | inoremap :Latex 34 | vnoremap :Latex 35 | nnoremap :LatexView 36 | inoremap :LatexView 37 | vnoremap :LatexView 38 | 39 | " ---------- Maps for the Make tool ------------------------------------------ 40 | noremap rm :Make 41 | inoremap rm :Make 42 | noremap rmc :Make clean 43 | inoremap rmc :Make clean 44 | noremap rmd :Make doc 45 | inoremap rmd :Make doc 46 | noremap rma :MakeCmdlineArgs 47 | inoremap rma :MakeCmdlineArgs 48 | noremap rcm :MakeFile 49 | inoremap rcm :MakeFile 50 | 51 | " ---------- Reset "maplocalleader" ------------------------------------------ 52 | call Latex_ResetMapLeader () 53 | 54 | -------------------------------------------------------------------------------- /latex-support/templates/comments.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Comments 3 | § ============================================================= 4 | 5 | == Comments.end-of-line comment == append, nomenu == 6 | % 7 | == ENDTEMPLATE == 8 | 9 | § ------------------------------------------------------------- 10 | 11 | == Comments.frame 1 == map:cfr1, below == 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | %% 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | == Comments.frame 2 == map:cfr2, below == 16 | %%====================================================================== 17 | %% 18 | %%====================================================================== 19 | == Comments.frame 3 == map:cfr3, below == 20 | %%---------------------------------------------------------------------- 21 | %% 22 | %%---------------------------------------------------------------------- 23 | == Comments.file prolog == noindent, start, map:cp, sc:p == 24 | %%===================================================================================== 25 | %% 26 | %% Filename: |FILENAME| 27 | %% 28 | %% Description: 29 | %% 30 | %% Version: 1.0 31 | %% Created: |DATE| 32 | %% Revision: none 33 | %% 34 | %% Author: |AUTHOR| (|AUTHORREF|), |EMAIL| 35 | %% Organization: |ORGANIZATION| 36 | %% Copyright: |COPYRIGHT| 37 | %% 38 | %% Notes: 39 | %% 40 | %%===================================================================================== 41 | == ENDTEMPLATE == 42 | 43 | § ------------------------------------------------------------- 44 | 45 | == LIST: comments_macros == hash == 46 | 'author' : '|AUTHOR|', 47 | 'author ref' : '|AUTHORREF|', 48 | 'organization' : '|ORGANIZATION|', 49 | 'copyright' : '|COPYRIGHT|', 50 | 'email' : '|EMAIL|', 51 | 52 | 'path' : '|PATH|', 53 | 'filename' : '|FILENAME|', 54 | 'basename' : '|BASENAME|', 55 | 'basename:u' : '|BASENAME:u|', 56 | 'suffix' : '|SUFFIX|', 57 | 58 | 'date' : '|DATE|', 59 | 'time' : '|TIME|', 60 | 'year' : '|YEAR|', 61 | == ENDLIST == 62 | 63 | § ------------------------------------------------------------- 64 | 65 | == Comments.macros == expandmenu, insert, map:cm, sc:m == 66 | |PickList( 'macro', 'comments_macros' )| 67 | |PICK| 68 | == Comments.date == insert, map:cd, sc:d == 69 | |DATE| 70 | == Comments.date time == insert, map:ct, sc:t == 71 | |DATE| |TIME| 72 | == ENDTEMPLATE == 73 | 74 | -------------------------------------------------------------------------------- /latex-support/templates/environments.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Environments 3 | § ============================================================= 4 | 5 | == LIST: environment_list == list, bare == 6 | align 7 | aligned 8 | array 9 | center 10 | description 11 | document 12 | doublespace 13 | enumerate 14 | eqnarray 15 | equation 16 | figure 17 | floatingfigure 18 | floatingtable 19 | flushleft 20 | flushright 21 | itemize 22 | list 23 | lstlisting 24 | luacode 25 | minipage 26 | picture 27 | onehalfspace 28 | quotation 29 | quote 30 | singlespace 31 | spacing 32 | tabbing 33 | table 34 | tabular 35 | thebibliography 36 | theorem 37 | titlepage 38 | verbatim 39 | verse 40 | wrapfigure 41 | == ENDLIST == 42 | 43 | -------------------------------------------------------------------------------- /latex-support/templates/resources.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Resources 3 | § ============================================================= 4 | 5 | == LIST: bibliography_style_list == list, bare == 6 | abbrv 7 | alpha 8 | plain 9 | unsrt 10 | == ENDLIST == 11 | 12 | == LIST: common_units == hash == 13 | 'point' : 'pt', 14 | 'millimeter' : 'mm', 15 | 'centimeter' : 'cm', 16 | 'inch' : 'in', 17 | 'height of x' : 'ex', 18 | 'height of M' : 'em', 19 | == ENDLIST == 20 | -------------------------------------------------------------------------------- /lua-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/luasupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | Preview Version 12 | ================================================================================ 13 | 14 | ___This is a preview version!___ 15 | 16 | Notable new feature: 17 | 18 | - Run Lua in a terminal window directly inside the editor. 19 | - Fully enabled for Neovim. 20 | 21 | The terminal window relies on the new `+terminal` feature, which becomes 22 | available with a patch level of approx. `8.0.1000`. 23 | 24 | _Please read the release notes below._ 25 | 26 | 27 | -------------------------------------------------------------------------------- 28 | 29 | -------------------------------------------------------------------------------- /lua-support/codesnippets/choose_loader_func.lua: -------------------------------------------------------------------------------- 1 | local func = assert ( package.loadlib ( 'LIB_PATH/lib.so', 'luaopen_MODULE_SUBMODULE' ) ) 2 | package.preload [ 'MODULE_NAME' ] = func 3 | local module = require ( 'MODULE_NAME' ) 4 | -------------------------------------------------------------------------------- /lua-support/codesnippets/load_in_env.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------ 2 | -- Name: load_in_env 3 | -- Purpose: Load a file in an environment and run it. 4 | -- Description: Load the file in the provided environment and run the 5 | -- resulting chunk. The success is indicated by two return 6 | -- arguments, thus you can write: 7 | -- 8 | -- assert ( load_in_env ( filename, env ) ) 9 | -- 10 | -- Parameters: filename - name of the file (string) 11 | -- loading_env - environment to use (table) 12 | -- Returns: success - true, if loading was successful (boolean) 13 | -- message - error message, if unsuccessful (string) 14 | ------------------------------------------------------------------------ 15 | 16 | function load_in_env ( filename, loading_env ) 17 | 18 | if not filename then 19 | return false, 'No filename given.' 20 | end 21 | 22 | -- load and check 23 | local chunk, msg = loadfile ( filename, 'bt', loading_env ) 24 | 25 | if not chunk then 26 | return false, 'Could not read the data "'..filename..'":\n'..msg 27 | end 28 | 29 | -- run in loading_env 30 | local success, msg = pcall ( chunk ) 31 | 32 | if not success then 33 | return false, 'Could not read the data "'..filename..'":\n'..msg 34 | end 35 | 36 | return true 37 | 38 | end ----- end of function load_in_env ----- 39 | -------------------------------------------------------------------------------- /lua-support/codesnippets/package_config.lua: -------------------------------------------------------------------------------- 1 | local dir_sep, path_templ_sep, templ_sub_point, win_exe_dir, luaopen_ignore = string.match ( package.config, '(.+)\n(.+)\n(.+)\n(.+)\n(.+)' ) 2 | -------------------------------------------------------------------------------- /lua-support/codesnippets/print_cmdline_arguments.lua: -------------------------------------------------------------------------------- 1 | -- echo command line arguments 2 | 3 | for idx, val in ipairs ( { ... } ) do 4 | print ( idx, val ) 5 | end 6 | -------------------------------------------------------------------------------- /lua-support/codesnippets/print_table.lua: -------------------------------------------------------------------------------- 1 | function print_table ( t, prefix, done ) 2 | prefix = prefix or '' 3 | done = done or { [t] = true } 4 | for key, val in pairs ( t ) do 5 | if type ( val ) == 'table' then 6 | if not done[val] then 7 | done[val] = true 8 | print ( prefix..tostring( key ), tostring( val )..': ...' ) 9 | print_table ( val, prefix..'\t', done ) 10 | else 11 | print ( prefix..tostring( key ), tostring( val )..': -already printed-' ) 12 | end 13 | else 14 | print ( prefix..tostring( key ), val ) 15 | end 16 | end 17 | end ----- end of function print_table ----- 18 | -------------------------------------------------------------------------------- /lua-support/codesnippets/randomseed.lua: -------------------------------------------------------------------------------- 1 | math.randomseed ( os.time () ) 2 | -------------------------------------------------------------------------------- /lua-support/codesnippets/script_with_options.lua: -------------------------------------------------------------------------------- 1 | -- script name, version and help text 2 | local script_name = 'TODO' 3 | local script_version = '1.0' 4 | 5 | local help_text_short = script_name..' [options]' 6 | 7 | local help_text = help_text_short..'\n\n'..[[ 8 | Options: 9 | --str set a string 10 | 11 | --lit a switch 12 | 13 | -h, --help print this help 14 | -v, --version print version information 15 | ]] 16 | 17 | -- check for "--help" and "--version", exit 18 | for idx, arg in ipairs ( arg ) do 19 | if arg == '-h' or arg == '--help' then 20 | print ( help_text ) 21 | return 22 | elseif arg == '-v' or arg == '--version' then 23 | print ( 'version '..script_version ) 24 | return 25 | end 26 | end 27 | 28 | local options = { 29 | lit = false, 30 | str = 'qwertzu', 31 | } 32 | 33 | -- go through arguments 34 | local idx = 1 35 | 36 | while idx <= #arg do 37 | 38 | if arg[idx] == '--lit' then 39 | options.lit = true 40 | idx = idx + 1 41 | elseif arg[idx] == '--str' then 42 | options.str = arg[idx+1] 43 | idx = idx + 2 44 | elseif arg[idx] == '-h' or arg[idx] == '--help' or arg[idx] == '-v' or arg[idx] == '--version' then 45 | -- noop 46 | idx = idx + 1 47 | else 48 | print ( 'Unknown option: '..arg[idx] ) 49 | print ( '' ) 50 | return 51 | end 52 | 53 | end 54 | 55 | -------------------------------------------------------------------------------- /lua-support/codesnippets/set_c_locale.lua: -------------------------------------------------------------------------------- 1 | assert ( os.setlocale ( 'C' ), 'could not set locale' ) 2 | -------------------------------------------------------------------------------- /lua-support/doc/ChangeLog: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------------- 2 | RELEASE NOTES FOR VERSION 1.0 3 | --------------------------------------------------------------------------------------- 4 | - The default style used by the template library is now 'Lua_52'. 5 | You can change it in the template customization file (see below). 6 | The jump to the online help is also set up for Lua 5.2. 7 | - Rename 'g:Lua_GlbTemplateFile' into 'g:Lua_GlobalTemplateFile'. 8 | - Rename 'g:Lua_LclTemplateFile' into 'g:Lua_LocalTemplateFile'. 9 | - Add optional custom templates 'g:Lua_CustomTemplateFile'. 10 | - Add template personalization file and setup wizard. 11 | - Add Lua's reference manual in Vim's help format. 12 | - Add maps and menu entries to jump to it conveniently. 13 | - New and improved templates, add Lua 5.3. 14 | - Add Lua C-API templates. 15 | - Fix running and compiling scripts under Windows. 16 | - Minor improvements. 17 | 18 | --------------------------------------------------------------------------------------- 19 | RELEASE NOTES FOR VERSION 0.9 20 | --------------------------------------------------------------------------------------- 21 | - Added: Inserting and removing long comments ( --[[ --]] ). 22 | - Added: Hardcopy to postscript. 23 | - Added: Direct run, run executable scripts directly, using their shebang. 24 | - Added: Make script executable/not exec. 25 | - Added: The contents of the buffer "Lua Output" can be loaded into the quickfix 26 | list even if the interpreter did not terminate with an error. 27 | - Added: Toolbox for make integration. 28 | - Changed: Better error recognition while running scripts. 29 | - Fixed: Setup of local templates in case of global installation. 30 | - New templates and codesnippets. 31 | - Minor improvements. 32 | 33 | --------------------------------------------------------------------------------------- 34 | RELEASE NOTES FOR VERSION 0.8 35 | --------------------------------------------------------------------------------------- 36 | - Initial release. 37 | 38 | -------------------------------------------------------------------------------- /lua-support/rc/additions.gvimrc: -------------------------------------------------------------------------------- 1 | "------------------------------------------------------------------------------- 2 | " Moving cursor to other windows 3 | " 4 | " shift-down : change window focus to lower one (cyclic) 5 | " shift-up : change window focus to upper one (cyclic) 6 | " shift-left : change window focus to one on left 7 | " shift-right : change window focus to one on right 8 | "------------------------------------------------------------------------------- 9 | nnoremap w 10 | nnoremap W 11 | nnoremap h 12 | nnoremap l 13 | 14 | "------------------------------------------------------------------------------- 15 | " Some additional hot keys 16 | " 17 | " shift-F3 : call gvim file browser 18 | "------------------------------------------------------------------------------- 19 | noremap :silent browse confirm e 20 | inoremap :silent browse confirm e 21 | 22 | "------------------------------------------------------------------------------- 23 | " toggle insert mode <--> normal mode with the -key 24 | "------------------------------------------------------------------------------- 25 | 26 | nnoremap 27 | inoremap 28 | 29 | "------------------------------------------------------------------------------- 30 | " use font with clearly distinguishable brackets: ()[]{} 31 | "------------------------------------------------------------------------------- 32 | "set guifont=Luxi\ Mono\ 14 33 | -------------------------------------------------------------------------------- /lua-support/rc/additions.vimrc: -------------------------------------------------------------------------------- 1 | "------------------------------------------------------------------------------- 2 | " Lua-Support 3 | " 4 | " the settings are documented here: 5 | " :help luasupport-configuration 6 | "------------------------------------------------------------------------------- 7 | 8 | "let g:Lua_LoadMenus = 'auto' 9 | "let g:Lua_RootMenu = '&Lua' 10 | "let g:Lua_MapLeader = '\' 11 | 12 | "let g:Lua_InsertFileHeader = 'no' 13 | 14 | "let g:Lua_OutputMethod = 'terminal' 15 | 16 | "let g:Lua_BinPath = '/path/to/lua/exe' 17 | "let g:Lua_Executable = 'lua' 18 | "let g:Lua_CompilerExec = 'luac' 19 | "let g:Lua_CompiledExtension = 'luac' 20 | -------------------------------------------------------------------------------- /lua-support/rc/custom.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Custom Templates 3 | § ============================================================= 4 | 5 | § insert code for this Lua version (Lua_51, Lua_52, or Lua_53) 6 | SetStyle( 'Lua_52' ) 7 | 8 | § used by the template "Comments.shebang": 9 | SetMacro( 'LUA_INTERPRETER', '/usr/bin/env lua' ) 10 | 11 | § used by the template "Idioms.add to path, local modules": 12 | SetMacro( 'LUA_LOCAL_MODULES', $HOME.'/lib/lua/5.2' ) 13 | 14 | § templates automatically included into new files 15 | § set the property to an empty string to disable the insertion 16 | §SetProperty ( 'Lua::FileSkeleton::Script', 'Comments.file description' ) 17 | 18 | § ------------------------------------------------------------- 19 | § A template definition is build like this: 20 | § == Menu.some name == == 21 | § 22 | § == Menu.other name == == 23 | § 24 | § == ENDTEMPLATE == 25 | § A template ends with the line "== ENDTEMPLATE ==" or with 26 | § the start of a new template. 27 | § ------------------------------------------------------------- 28 | 29 | § ------------------------------------------------------------- 30 | § Function Definition 31 | § ------------------------------------------------------------- 32 | 33 | § uncomment and edit to customize 34 | 35 | §== Idioms.function definition == below, map:if, sc:f == 36 | §function |?FUNCTION_NAME| ( |PARAMETER_LIST| ) 37 | § {-FUNCTION_BODY-} 38 | §end ----- end of function |FUNCTION_NAME| ----- 39 | §== ENDTEMPLATE == 40 | § 41 | §== Idioms.inline function definition == insert, map:in, sc:n == 42 | §function ( ) {-BODY-} return {+RETURN+} end 43 | §== ENDTEMPLATE == 44 | 45 | -------------------------------------------------------------------------------- /lua-support/rc/custom_with_personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Template Customization 3 | § ============================================================= 4 | 5 | § ============================================================= 6 | § Personal Information 7 | § 8 | § - overwrites the information in the template personalization 9 | § file, because these commands are read later 10 | § ============================================================= 11 | 12 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 13 | SetMacro( 'AUTHORREF', '' ) 14 | SetMacro( 'EMAIL', '' ) 15 | SetMacro( 'ORGANIZATION', '' ) 16 | SetMacro( 'COMPANY', '' ) 17 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 18 | SetMacro( 'LICENSE', 'GNU General Public License' ) 19 | 20 | § ============================================================= 21 | § Date and Time Format 22 | § ============================================================= 23 | 24 | §SetFormat( 'DATE', '%x' ) 25 | §SetFormat( 'TIME', '%H:%M' ) 26 | §SetFormat( 'YEAR', '%Y' ) 27 | 28 | § ============================================================= 29 | § Custom Templates 30 | § ============================================================= 31 | 32 | § insert code for this Lua version (Lua_51, Lua_52, or Lua_53) 33 | SetStyle( 'Lua_52' ) 34 | 35 | § used by the template "Comments.shebang": 36 | SetMacro( 'LUA_INTERPRETER', '/usr/bin/env lua' ) 37 | 38 | § used by the template "Idioms.add to path, local modules": 39 | SetMacro( 'LUA_LOCAL_MODULES', $HOME.'/lib/lua/5.2' ) 40 | 41 | § templates automatically included into new files 42 | § set the property to an empty string to disable the insertion 43 | §SetProperty ( 'Lua::FileSkeleton::Script', 'Comments.file description' ) 44 | 45 | § ------------------------------------------------------------- 46 | § A template definition is build like this: 47 | § == Menu.some name == == 48 | § 49 | § == Menu.other name == == 50 | § 51 | § == ENDTEMPLATE == 52 | § A template ends with the line "== ENDTEMPLATE ==" or with 53 | § the start of a new template. 54 | § ------------------------------------------------------------- 55 | 56 | § ------------------------------------------------------------- 57 | § Function Definition 58 | § ------------------------------------------------------------- 59 | 60 | § uncomment and edit to customize 61 | 62 | §== Idioms.function definition == below, map:if, sc:f == 63 | §function |?FUNCTION_NAME| ( |PARAMETER_LIST| ) 64 | § {-FUNCTION_BODY-} 65 | §end ----- end of function |FUNCTION_NAME| ----- 66 | §== ENDTEMPLATE == 67 | § 68 | §== Idioms.inline function definition == insert, map:in, sc:n == 69 | §function ( ) {-BODY-} return {+RETURN+} end 70 | §== ENDTEMPLATE == 71 | 72 | -------------------------------------------------------------------------------- /lua-support/rc/lua.vim: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: lua.vim 4 | " 5 | " Description: Filetype plugin for Lua. 6 | " 7 | " VIM Version: 7.0+ 8 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 9 | " Organization: 10 | " Version: 1.0 11 | " Created: 26.03.2014 12 | " Revision: 01.08.2017 13 | " License: Copyright (c) 2014-2017, Wolfgang Mehner 14 | " This program is free software; you can redistribute it and/or 15 | " modify it under the terms of the GNU General Public License as 16 | " published by the Free Software Foundation, version 2 of the 17 | " License. 18 | " This program is distributed in the hope that it will be 19 | " useful, but WITHOUT ANY WARRANTY; without even the implied 20 | " warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 21 | " PURPOSE. 22 | " See the GNU General Public License version 2 for more details. 23 | "=============================================================================== 24 | 25 | " Only do this when not done yet for this buffer 26 | if exists("b:did_lua_support_ftplugin") 27 | finish 28 | endif 29 | let b:did_lua_support_ftplugin = 1 30 | 31 | "------------------------------------------------------------------------------- 32 | " set "maplocalleader" as configured using "g:Lua_MapLeader" 33 | "------------------------------------------------------------------------------- 34 | call Lua_SetMapLeader () 35 | 36 | " maps defined here will use "g:Lua_MapLeader" as 37 | " example: 38 | "map eg :echo "Example Map :)" 39 | 40 | "------------------------------------------------------------------------------- 41 | " run, compile, code checker 42 | "------------------------------------------------------------------------------- 43 | 44 | nnoremap :Lua 45 | inoremap :Lua 46 | 47 | nnoremap :LuaCompile 48 | inoremap :LuaCompile 49 | 50 | nnoremap :LuaCheck 51 | inoremap :LuaCheck 52 | 53 | "------------------------------------------------------------------------------- 54 | " reset "maplocalleader" 55 | "------------------------------------------------------------------------------- 56 | call Lua_ResetMapLeader () 57 | 58 | -------------------------------------------------------------------------------- /lua-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /lua-support/templates-c-api/Templates: -------------------------------------------------------------------------------- 1 | § ========================================================== 2 | § Lua 3 | § ========================================================== 4 | 5 | SetMacro( 'LUA_STATE', 'L' ) 6 | 7 | MenuShortcut( 'Lua', 'l' ) 8 | 9 | IncludeFile ( 'lua.templates' ) 10 | 11 | § ============================================================= 12 | § Help 13 | § ============================================================= 14 | 15 | SetMacro( 'HelpPathLua', 'http://www.lua.org/manual/5.2/' ) 16 | 17 | == HELP: Help.Lua function, browser == map:hl, sc:l == 18 | |Word( '' )| 19 | |Substitute( '\W', '', 'g' )| 20 | |Browser( '|HelpPathLua|manual.html#|PICK|', '|HelpPathLua|contents.html#index' )| 21 | == HELP: Help.Lua 51 function, Vim help == map:h1, sc:1 == 22 | |Word( '' )| 23 | |Substitute( '\W', '', 'g' )| 24 | |Vim( ':help lua51-|PICK|', ':help lua51' )| 25 | == HELP: Help.Lua 52 function, Vim help == map:h2, sc:2 == 26 | |Word( '' )| 27 | |Substitute( '\W', '', 'g' )| 28 | |Vim( ':help lua52-|PICK|', ':help lua52' )| 29 | == HELP: Help.Lua 53 function, Vim help == map:h3, sc:3 == 30 | |Word( '' )| 31 | |Substitute( '\W', '', 'g' )| 32 | |Vim( ':help lua53-|PICK|', ':help lua53' )| 33 | == ENDTEMPLATE == 34 | -------------------------------------------------------------------------------- /lua-support/templates-c-api/lua.templates: -------------------------------------------------------------------------------- 1 | § ========================================================== 2 | § Lua 3 | § ========================================================== 4 | 5 | IncludeFile( 'library_5_2.templates' ) 6 | 7 | == Lua.function == below, map:lf, sc:f == 8 | static int 9 | |?FUNCTION_NAME| ( lua_State *|LUA_STATE| ) 10 | { 11 | {CURSOR} 12 | return 0; 13 | } // ----- end of function |FUNCTION_NAME| ----- 14 | == ENDTEMPLATE == 15 | 16 | == Lua.library list == below, map:lll, sc:l == 17 | static const struct luaL_Reg |?LIST_NAME| [] = { 18 | { "", {+FUNCTION+} }, 19 | 20 | { 0, 0 } 21 | }; 22 | == Lua.loader function == below, map:llf, sc:f == 23 | |Prompt( 'MODULE_NAME', '' )| 24 | int 25 | luaopen_|MODULE_NAME:L| ( lua_State *|LUA_STATE| ) 26 | { 27 | {CURSOR} 28 | 29 | luaL_newlib ( |LUA_STATE|, |?LIST_NAME| ); 30 | 31 | return 1; 32 | } // ----- end of function luaopen_|MODULE_NAME:L| ----- 33 | == ENDTEMPLATE == 34 | 35 | == SEP: Lua.sep_lib == 36 | 37 | == Lua.library functions == insert, map:ll, sc:l == 38 | |PickList( 'Lua function', 'lua_api_5_2_func' )| 39 | |KEY| ( |VALUE| ) 40 | == Lua.operation names == expandmenu, expandright:value, insert, map:lo, sc:o == 41 | |PickList( 'Lua op. name', 'lua_api_5_2_op_names' )| 42 | |VALUE| 43 | == Lua.type names == expandmenu, expandright:value, insert, map:lt, sc:t == 44 | |PickList( 'Lua type name', 'lua_api_5_2_type_names' )| 45 | |VALUE| 46 | == Lua.buffer functions == expandmenu, insert, map:lb, sc:b == 47 | |PickList( 'Lua function', 'lua_api_5_2_buffer' )| 48 | |Prompt( 'BUFFER', '' )| 49 | |KEY| ( |VALUE| ) 50 | == ENDTEMPLATE == 51 | 52 | == SEP: Lua.sep_debug == 53 | 54 | == Lua.debug functions == expandmenu, insert, map:ldf, sc:d == 55 | |PickList( 'Lua function', 'lua_api_5_2_debug_func' )| 56 | |KEY| ( |VALUE| ) 57 | == Lua.debug constants == expandmenu, insert, map:ldc, sc:d == 58 | |PickList( 'Lua function', 'lua_api_5_2_debug_names' )| 59 | |VALUE| 60 | == ENDTEMPLATE == 61 | 62 | -------------------------------------------------------------------------------- /lua-support/templates/files.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Files 3 | § ============================================================= 4 | 5 | == USE STYLES : Lua_51 == 6 | 7 | == Files.module == below, map:fm, sc:m == 8 | local module_name = ... 9 | 10 | module ( module_name, package.seeall ) 11 | 12 | 13 | == ENDTEMPLATE == 14 | 15 | == ENDSTYLES == 16 | 17 | == USE STYLES : default, Lua_52, Lua_53 == 18 | 19 | == Files.module == below, map:fm, sc:m == 20 | local module_name = ... 21 | 22 | local |BASENAME| = {} 23 | 24 | 25 | 26 | return |BASENAME| 27 | == ENDTEMPLATE == 28 | 29 | == ENDSTYLES == 30 | 31 | -------------------------------------------------------------------------------- /lua-support/templates/objects.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Objects 3 | § ============================================================= 4 | 5 | == Objects.class metatable == below, map:ot, sc:t == 6 | local |?CLASSNAME|_mt = { 7 | type = '|CLASSNAME|', 8 | } 9 | 10 | |CLASSNAME|_mt.__index = |CLASSNAME|_mt -- get indices from the table 11 | |CLASSNAME|_mt.__metatable = |CLASSNAME|_mt -- protect the metatable 12 | 13 | == Objects.class, constructor == below, map:oc, sc:c == 14 | function create_|?CLASSNAME| ( ) 15 | 16 | local obj = {} 17 | 18 | {-FUNCTION_BODY-} 19 | 20 | return setmetatable ( obj, |CLASSNAME|_mt ) 21 | end ----- end of function create_|CLASSNAME| ----- 22 | 23 | == Objects.class, is object == below, map:ois, sc:i == 24 | function is_|?CLASSNAME| ( obj ) 25 | return getmetatable ( obj ) == |CLASSNAME|_mt 26 | end ----- end of function is_|CLASSNAME| ----- 27 | 28 | == Objects.method == below, map:om, sc:m == 29 | function |?CLASSNAME|_mt:|?METHOD| ( |PARAMETER_LIST| ) 30 | {-FUNCTION_BODY-} 31 | end ----- end of function |CLASSNAME|_mt:|METHOD| ----- 32 | 33 | == ENDTEMPLATE == 34 | 35 | -------------------------------------------------------------------------------- /lua-support/templates/regex.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Regex 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § Resources 7 | § ------------------------------------------------------------- 8 | 9 | == LIST: regex_character_classes_5_1 == hash == 10 | 'letters' : '%a', 11 | 'control char.' : '%c', 12 | 'digits' : '%d', 13 | 'printable char. (except space)' : '', 14 | 'lowercase char.' : '%l', 15 | 'punctuation char.' : '%p', 16 | 'space char.' : '%s', 17 | 'uppercase char.' : '%u', 18 | 'alphanumeric char.' : '%w', 19 | 'hexadecimal digits' : '%x', 20 | 'embedded zero' : '%z', 21 | 'identifier char.' : '[%w_]', 22 | == LIST: regex_character_classes_5_2 == hash == 23 | 'letters' : '%a', 24 | 'control char.' : '%c', 25 | 'digits' : '%d', 26 | 'printable char. (except space)' : '%g', 27 | 'lowercase char.' : '%l', 28 | 'punctuation char.' : '%p', 29 | 'space char.' : '%s', 30 | 'uppercase char.' : '%u', 31 | 'alphanumeric char.' : '%w', 32 | 'hexadecimal digits' : '%x', 33 | 'embedded zero' : '\0', 34 | 'identifier char.' : '[%w_]', 35 | == ENDLIST == 36 | 37 | § ------------------------------------------------------------- 38 | § Templates 39 | § ------------------------------------------------------------- 40 | 41 | == Regex.capture == insert, map:xca, sc:c == 42 | () 43 | == Regex.collection == insert, map:xco, sc:c == 44 | [] 45 | == Regex.balanced brackets == insert, sc:b == 46 | %b{+LEFT+}{+RIGHT+} 47 | == Regex.frontier pattern, zero-width == insert, sc:f == 48 | %f[] 49 | == ENDTEMPLATE == 50 | 51 | § :TODO:29.03.2014 19:53:WM: name "brackets", "braces", ...? 52 | 53 | == USE STYLES : Lua_51 == 54 | 55 | == Regex.character classes == expandmenu:regex_character_classes_5_2, expandright:value, insert, map:xcl, sc:l == 56 | |PickList( 'character class', 'regex_character_classes_5_1' )| 57 | |PICK| 58 | == ENDTEMPLATE == 59 | 60 | == ENDSTYLES == 61 | 62 | == USE STYLES : default, Lua_52, Lua_53 == 63 | 64 | == Regex.character classes == expandmenu:regex_character_classes_5_2, expandright:value, insert, map:xcl, sc:l == 65 | |PickList( 'character class', 'regex_character_classes_5_2' )| 66 | |PICK| 67 | == ENDTEMPLATE == 68 | 69 | == ENDSTYLES == 70 | 71 | -------------------------------------------------------------------------------- /lua-support/templates/statements.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § Loops 7 | § ------------------------------------------------------------- 8 | 9 | == Statements.for, range == below, map:sfr, sc:f == 10 | for = {+A+}, {+B+} do 11 | {-LOOP_BODY-} 12 | end 13 | == Statements.for, in == below, map:sfi, sc:f == 14 | for in {+ITERATOR+} do 15 | {-LOOP_BODY-} 16 | end 17 | == Statements.while == below, map:sw, sc:w == 18 | while do 19 | {-LOOP_BODY-} 20 | end 21 | == Statements.repeat == below, map:sr, sc:r == 22 | repeat 23 | {-LOOP_BODY-} 24 | until 25 | == ENDTEMPLATE == 26 | 27 | § ------------------------------------------------------------- 28 | § If-Then-Else 29 | § ------------------------------------------------------------- 30 | 31 | == SEP: Statements.sep_if == 32 | 33 | == Statements.if, end == below, map:sif, sc:i == 34 | if then 35 | {-IF_PART-} 36 | end 37 | == Statements.if, else == below, map:sie, sc:i == 38 | if then 39 | {-IF_PART-} 40 | else 41 | {+ELSE_PART+} 42 | end 43 | == Statements.elseif == below, map:sei, sc:e == 44 | elseif then 45 | {+ELSE_PART+} 46 | == Statements.else == below, map:sel, sc:e == 47 | else 48 | 49 | == ENDTEMPLATE == 50 | 51 | § ------------------------------------------------------------- 52 | § Block 53 | § ------------------------------------------------------------- 54 | 55 | == SEP: Statements.sep_block == 56 | 57 | == Statements.do block == below, map:sb, sc:b == 58 | do 59 | 60 | end 61 | == ENDTEMPLATE == 62 | -------------------------------------------------------------------------------- /perl-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/perlsupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | -------------------------------------------------------------------------------- 12 | 13 | -------------------------------------------------------------------------------- /perl-support/codesnippets/RegularExpressions/numeric-range-0-127: -------------------------------------------------------------------------------- 1 | # 2 | # DESCRIPTION: numeric range: 0[00] ... 127 3 | # 4 | ^(0?[0-9]?[0-9]|1[0-1][0-9]|12[0-7])$ 5 | # 6 | # EXAMPLES: 7 | # 8 | 0 9 | 00 10 | 000 11 | 2 12 | 02 13 | 002 14 | 020 15 | 127 16 | 128 17 | -------------------------------------------------------------------------------- /perl-support/codesnippets/RegularExpressions/numeric-range-0-255: -------------------------------------------------------------------------------- 1 | # 2 | # DESCRIPTION: numeric range: 0[00] ... 255 3 | # 4 | ^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$ 5 | # 6 | # EXAMPLES: 7 | # 8 | 0 9 | 00 10 | 000 11 | 2 12 | 02 13 | 002 14 | 020 15 | 255 16 | 256 17 | # 18 | -------------------------------------------------------------------------------- /perl-support/codesnippets/SmallProf-variables.pl: -------------------------------------------------------------------------------- 1 | # 2 | # Devel::SmallProf : variables which can be used to affect what gets profiled. 3 | # 4 | use Devel::SmallProf; 5 | 6 | $DB::drop_zeros = 0; # Do not show lines which were never called: 1 7 | $DB::grep_format = 0; # Output on a format similar to grep : 1 8 | $DB::profile = 1; # Turn off profiling for a time: 0 9 | %DB::packages = ('main'=>1); # Only profile code in a certain package. 10 | 11 | -------------------------------------------------------------------------------- /perl-support/codesnippets/dot.SmallProf: -------------------------------------------------------------------------------- 1 | # 2 | # Devel::SmallProf : variables which can be used to affect what gets profiled. 3 | # 4 | $DB::drop_zeros = 0; # Do not show lines which were never called: 1 5 | $DB::grep_format = 0; # Output on a format similar to grep : 1 6 | $DB::profile = 1; # Turn off profiling for a time: 0 7 | %DB::packages = ('main'=>1); # Only profile code in a certain package. 8 | 9 | -------------------------------------------------------------------------------- /perl-support/codesnippets/free-software-comment: -------------------------------------------------------------------------------- 1 | # 2 | #========================================================================== 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | #========================================================================== 8 | # 9 | -------------------------------------------------------------------------------- /perl-support/codesnippets/module-interface.pl: -------------------------------------------------------------------------------- 1 | 2 | package PackageName; 3 | 4 | use strict; 5 | use warnings; 6 | 7 | #======================================================================= 8 | # MODULE INTERFACE 9 | #======================================================================= 10 | 11 | use version; our $VERSION = qv('0.2.0'); 12 | 13 | use base qw(Exporter); 14 | 15 | # Symbols to be exported by default 16 | our @EXPORT = qw(); 17 | 18 | # Symbols to be exported on request 19 | our @EXPORT_OK = qw(); 20 | 21 | # Define names for sets of symbols 22 | our %EXPORT_TAGS = ( 23 | TAG1 => [ qw() ], 24 | TAG2 => [ qw() ], 25 | ); 26 | 27 | #======================================================================= 28 | # EXPORTED PACKAGE GLOBALS (listed in @EXPORT_OK) 29 | #======================================================================= 30 | 31 | #======================================================================= 32 | # NON=EXPORTED PACKAGE GLOBALS 33 | #======================================================================= 34 | 35 | #======================================================================= 36 | # MODULE IMPLEMENTATION 37 | #======================================================================= 38 | 39 | END { } # module clean-up code 40 | 41 | 1; 42 | -------------------------------------------------------------------------------- /perl-support/codesnippets/new.pl: -------------------------------------------------------------------------------- 1 | 2 | sub new { 3 | my $class = shift; 4 | my $self = { 5 | _name1 => $_[0], 6 | _name2 => $_[1], 7 | }; 8 | bless( $self, $class ); 9 | return $self; 10 | } # ---------- end of subroutine new ---------- 11 | -------------------------------------------------------------------------------- /perl-support/codesnippets/print-data-structure-with-Dumper.pl: -------------------------------------------------------------------------------- 1 | 2 | use Data::Dumper; 3 | print Dumper(\reference); 4 | 5 | -------------------------------------------------------------------------------- /perl-support/codesnippets/print-hash-sorted.pl: -------------------------------------------------------------------------------- 1 | 2 | #---------------------------------------------------------------------- 3 | # subroutine : print_hash_sorted 4 | #---------------------------------------------------------------------- 5 | sub print_hash_sorted { 6 | my $hashref = shift; # 1. parameter : hash reference 7 | print "\n"; 8 | foreach my $key ( sort keys %$hashref ) { 9 | print "'$key'\t=>\t'$$hashref{$key}'\n"; 10 | } # ----- end foreach ----- 11 | } # ---------- end of subroutine print_hash_sorted ---------- 12 | 13 | -------------------------------------------------------------------------------- /perl-support/codesnippets/print-hash.pl: -------------------------------------------------------------------------------- 1 | 2 | #---------------------------------------------------------------------- 3 | # subroutine : print_hash 4 | #---------------------------------------------------------------------- 5 | sub print_hash { 6 | my $hashref = shift; # 1. parameter : hash reference 7 | print "\n"; 8 | while ( my ( $key, $value ) = each %$hashref ) { 9 | print "'$key'\t=>\t'$value'\n"; 10 | } # ----- end while ----- 11 | } # ---------- end of subroutine print_hash ---------- 12 | 13 | -------------------------------------------------------------------------------- /perl-support/codesnippets/process-all-files-in-a-directory-recursively.pl: -------------------------------------------------------------------------------- 1 | 2 | use File::Find; # File::Find - Traverse a directory tree 3 | 4 | my @directory_list = ( '.' ); # directory_list used by File::Find::find() 5 | 6 | my $files_processed = 0; # counts the files processed by process_file() 7 | 8 | #----------------------------------------------------------------------- 9 | # Process a single file in a directory 10 | #----------------------------------------------------------------------- 11 | sub process_file { 12 | my $filename = $_; # filename without directory 13 | my $filename_full = $File::Find::name; # filename with directory 14 | my $directory = $File::Find::dir; # directory only 15 | 16 | # print "$directory : $filename : $filename_full\n"; 17 | 18 | $files_processed++; 19 | 20 | return ; 21 | } # ---------- end of subroutine process_file ---------- 22 | 23 | 24 | #----------------------------------------------------------------------- 25 | # Process all files in a directory recursively 26 | #----------------------------------------------------------------------- 27 | find( \&process_file, @directory_list ); 28 | 29 | print "\nfiles processed : $files_processed\n"; 30 | 31 | -------------------------------------------------------------------------------- /perl-support/codesnippets/slurp-file.pl: -------------------------------------------------------------------------------- 1 | 2 | my $filecontent = do{ 3 | local $/ = undef; # input record separator undefined 4 | <$INFILE> 5 | }; 6 | -------------------------------------------------------------------------------- /perl-support/doc/pmdesc3.text: -------------------------------------------------------------------------------- 1 | NAME 2 | pmdesc3 - List name, version, and description of all installed perl 3 | modules and PODs 4 | 5 | SYNOPSIS 6 | pmdesc3.pl 7 | 8 | pmdesc3.pl ~/perllib 9 | 10 | DESCRIPTION 11 | pmdesc3.pl [-h] [-s] [-t ddd] [-v dd] [--] [dir [dir [dir [...]]]] 12 | 13 | OPTIONS: -h : print help message; show search path 14 | -s : sort output (not under Windows) 15 | -t ddd : name column has width ddd (1-3 digits); default 36 16 | -v dd : version column has width dd (1-2 digits); default 10 17 | 18 | Find name, version and description of all installed Perl modules and 19 | PODs. If no directories given, searches @INC . The first column of the 20 | output (see below) can be used as module name or FAQ-name for perldoc. 21 | 22 | Some modules are split into a pm-file and an accompanying pod-file. The 23 | version number is always taken from the pm-file. 24 | 25 | The description found will be cut down to a length of at most 150 26 | characters (prevents slurping in big amount of faulty docs). 27 | 28 | Output 29 | The output looks like this: 30 | 31 | ... 32 | IO::Socket (1.28) Object interface to socket communications 33 | IO::Socket::INET (1.27) Object interface for AF_INET domain sockets 34 | IO::Socket::UNIX (1.21) Object interface for AF_UNIX domain sockets 35 | IO::Stty (n/a) 36 | IO::Tty (1.02) Low-level allocate a pseudo-Tty, import constants. 37 | IO::Tty::Constant (n/a) Terminal Constants (autogenerated) 38 | ... 39 | 40 | The three parts module name, version and description are separated by at 41 | least one blank. 42 | 43 | REQUIREMENTS 44 | ExtUtils::MakeMaker, File::Find, Getopt::Std 45 | 46 | BUGS AND LIMITATIONS 47 | The command line switch -s (sort) is not available under non-UNIX 48 | operating systems. An additional shell sort command can be used. 49 | 50 | There are no known bugs in this module. 51 | 52 | Please report problems to Fritz Mehner, mehner.fritz@web.de . 53 | 54 | AUTHORS 55 | Tom Christiansen, tchrist@perl.com (pmdesc) 56 | Aristotle, http://qs321.pair.com/~monkads/ (pmdesc2) 57 | Fritz Mehner, mehner.fritz@web.de (pmdesc3.pl) 58 | 59 | NOTES 60 | pmdesc3.pl is based on pmdesc2 (Aristotle, 61 | http://qs321.pair.com/~monkads/). pmdesc3.pl adds extensions and 62 | bugfixes. 63 | 64 | pmdesc2 is based on pmdesc (Perl Cookbook, 1. Ed., recipe 12.19). 65 | pmdesc2 is at least one magnitude faster than pmdesc. 66 | 67 | VERSION 68 | 1.2.3 69 | 70 | -------------------------------------------------------------------------------- /perl-support/modules/perl-modules.list: -------------------------------------------------------------------------------- 1 | <---------- please generate your own Perl module list ----------> 2 | gVim : menu item Perl->Run->'generate Perl module list' 3 | Vim : hotkey \rg out of a buffer with filetype 'perl'. 4 | -------------------------------------------------------------------------------- /perl-support/rc/customization.ctags: -------------------------------------------------------------------------------- 1 | 2 | --langmap=perl:+.pod 3 | --regex-perl=/^=head1[[:space:]]*(.+)/\1/o,pod/ 4 | --regex-perl=/^=head2[[:space:]]*(.+)$/. \1/o,pod/ 5 | --regex-perl=/^=head3[[:space:]]*(.+)$/.. \1/o,pod/ 6 | --regex-perl=/^=head4[[:space:]]*(.+)$/... \1/o,pod/ 7 | --regex-perl=/^=for[[:space:]]+([^:]+):(.*)$/*\1:\2/o,pod/ 8 | --regex-perl=/^__(DATA|END)__$/__\1__/l,labels/ 9 | --regex-perl=/# :([[:upper:]]+\s*):([^[:space:]]+) ([^[:space:]]+):(.*)$/\1 \2/k,comments/ 10 | 11 | -------------------------------------------------------------------------------- /perl-support/rc/customization.perltidyrc: -------------------------------------------------------------------------------- 1 | --quiet 2 | --continuation-indentation=4 3 | --indent-columns=4 4 | --maximum-line-length=96 5 | --nooutdent-long-lines 6 | --nospace-for-semicolon 7 | --fixed-position-side-comment=49 8 | --closing-side-comments 9 | --closing-side-comment-list="sub : BEGIN END" 10 | --closing-side-comment-prefix="## ---------- end" 11 | -------------------------------------------------------------------------------- /perl-support/rc/customization.smallprof: -------------------------------------------------------------------------------- 1 | # 2 | # Devel::SmallProf : variables which can be used to affect what gets profiled. 3 | # 4 | $DB::drop_zeros = 0; # Do not show lines which were never called: 1 5 | $DB::grep_format = 0; # Output on a format similar to grep : 1 6 | $DB::profile = 1; # Turn off profiling for a time: 0 7 | %DB::packages = ('main'=>1); # Only profile code in a certain package. 8 | 9 | -------------------------------------------------------------------------------- /perl-support/rc/make.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : Make 6 | " Plugin : c.vim / latex-support.vim / ... 7 | " Revision : 03.10.2017 8 | " Maintainer : Wolfgang Mehner 9 | " (formerly Fritz Mehner ) 10 | " 11 | " ------------------------------------------------------------------------------ 12 | 13 | " Only do this when not done yet for this buffer 14 | if exists("b:did_c_support_make") 15 | finish 16 | endif 17 | let b:did_c_support_make = 1 18 | 19 | " ---------- Set "maplocalleader" as configured using "g:C_MapLeader" -------- 20 | "call C_SetMapLeader () 21 | 22 | " ---------- Maps for the Make tool ------------------------------------------ 23 | noremap rm :Make 24 | inoremap rm :Make 25 | noremap rmc :Make clean 26 | inoremap rmc :Make clean 27 | noremap rmd :Make doc 28 | inoremap rmd :Make doc 29 | noremap rma :MakeCmdlineArgs 30 | inoremap rma :MakeCmdlineArgs 31 | noremap rcm :MakeFile 32 | inoremap rcm :MakeFile 33 | 34 | " ---------- Reset "maplocalleader" ------------------------------------------ 35 | "call C_ResetMapLeader () 36 | 37 | -------------------------------------------------------------------------------- /perl-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /perl-support/rc/pod.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : Perl (POD) 6 | " Plugin : perl-support.vim 7 | " Revision : 26.06.2019 8 | " Maintainer : Wolfgang Mehner 9 | " (formerly Fritz Mehner ) 10 | " 11 | " ---------------------------------------------------------------------------- 12 | 13 | " Only do this when not done yet for this buffer 14 | if exists("b:did_perl_support_pod") 15 | finish 16 | endif 17 | let b:did_perl_support_pod = 1 18 | 19 | " ---------- tabulator / shiftwidth ------------------------------------------ 20 | " Set tabulator and shift width to 4 conforming to the Perl Style Guide. 21 | " Uncomment the next two lines to force these settings for all files with 22 | " filetype 'perl' . 23 | setlocal tabstop=4 24 | setlocal shiftwidth=4 25 | 26 | " ---------- Add ':' to the keyword characters ------------------------------- 27 | " Tokens like 'File::Find' are recognized as 28 | " one keyword 29 | setlocal iskeyword+=: 30 | 31 | " ---------- Set "maplocalleader" as configured using "g:Perl_MapLeader" ----- 32 | call Perl_SetMapLeader () 33 | 34 | " Alt-F9: run syntax check 35 | noremap :PerlCheck 36 | inoremap :PerlCheck 37 | 38 | " Shift-F1: read Perl documentation 39 | noremap :PerlDoc 40 | inoremap :PerlDoc 41 | 42 | " ---------- Maps for the Make tool ------------------------------------------ 43 | noremap rm :Make 44 | inoremap rm :Make 45 | noremap rmc :Make clean 46 | inoremap rmc :Make clean 47 | noremap rma :MakeCmdlineArgs 48 | inoremap rma :MakeCmdlineArgs 49 | noremap rcm :MakeFile 50 | inoremap rcm :MakeFile 51 | 52 | " ---------- Reset "maplocalleader" ------------------------------------------ 53 | call Perl_ResetMapLeader () 54 | 55 | -------------------------------------------------------------------------------- /perl-support/rc/qf.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " This creates additional maps to sort the output of the profilers 6 | " 7 | " Language : Perl (quickfix) 8 | " Plugin : perl-support.vim 9 | " Revision : 15.04.2017 10 | " Maintainer : Wolfgang Mehner 11 | " (formerly Fritz Mehner ) 12 | " 13 | " ---------------------------------------------------------------------------- 14 | 15 | " Only do this when not done yet for this buffer 16 | if exists("b:did_perl_support_quickfix") 17 | finish 18 | endif 19 | let b:did_perl_support_quickfix = 1 20 | 21 | noremap rpss :call perlsupportprofiling#Perl_SmallProfSortInput() 22 | noremap rpfs :call perlsupportprofiling#Perl_FastProfSortInput() 23 | noremap rpns :call perlsupportprofiling#Perl_NYTProfSortInput() 24 | -------------------------------------------------------------------------------- /perl-support/scripts/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #=============================================================================== 3 | # FILE: wrapper.sh 4 | # USAGE: ./wrapper.sh scriptname [cmd-line-args] 5 | # DESCRIPTION: Wraps the execution of a programm or script. 6 | # Use with xterm: xterm -e wrapper.sh scriptname cmd-line-args 7 | # This script is used by the Vim plugin perl-support.vim 8 | # OPTIONS: --- 9 | # REQUIREMENTS: --- 10 | # BUGS: --- 11 | # NOTES: --- 12 | # AUTHOR: Dr.-Ing. Fritz Mehner (fgm), mehner.fritz@web.de 13 | # CREATED: 23.11.2004 18:04:01 CET 14 | # REVISION: 12.01.2014 15 | #=============================================================================== 16 | 17 | returncode=0 # default return code 18 | 19 | if [ ${#} -ge 1 ] ; then 20 | "${@}" 21 | returncode=$? 22 | [ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n" 23 | else 24 | printf "\n!! ${0} : no argument(s) !!\n" 25 | fi 26 | 27 | read -p "... press return key ... " dummy 28 | exit $returncode 29 | -------------------------------------------------------------------------------- /perl-support/templates/filetests.templates: -------------------------------------------------------------------------------- 1 | 2 | == LIST: FileTests == hash == 3 | 'exists' : '-e', 4 | 'has zero size' : '-z', 5 | 'has nonzero size' : '-s', 6 | 'plain file' : '-f', 7 | 'directory' : '-d', 8 | 'symbolic link' : '-l', 9 | 'named pipe' : '-p', 10 | 'socket' : '-S', 11 | 'block special file' : '-b', 12 | 'character special file' : '-c', 13 | 'readable by eff UID-GID' : '-r', 14 | 'writable by eff UID-GID' : '-w', 15 | 'executable by eff UID-GID' : '-x', 16 | 'owned by eff UID' : '-o', 17 | 'readable by real UID-GID' : '-R', 18 | 'writable by real UID-GID' : '-W', 19 | 'executable by real UID-GID' : '-X', 20 | 'owned by real UID' : '-O', 21 | 'setuid bit set' : '-u', 22 | 'setgid bit set' : '-g', 23 | 'sticky bit set' : '-k', 24 | 'age since modification' : '-M', 25 | 'age since last access' : '-A', 26 | 'age since inode change' : '-C', 27 | 'text file' : '-T', 28 | 'binary file' : '-B', 29 | 'handle opened to a tty' : '-t', 30 | == ENDLIST == 31 | 32 | == File Tests == expandmenu, expandright:value, insert, sc:f, map:ft == 33 | |PickList( 'File Tests', 'FileTests' )| 34 | |PICK| 35 | == ENDTEMPLATE == 36 | -------------------------------------------------------------------------------- /perl-support/templates/idioms.templates: -------------------------------------------------------------------------------- 1 | == Idioms.scalar == map:id, sc:s, insert == 2 | my $; 3 | == Idioms.scalar+assignment == map:ida, sc:s, insert == 4 | my $ = <+val+>; 5 | == Idioms.scalar_list == map:idd, sc:s, insert == 6 | my ( $, $<+name+> ); 7 | == Idioms.array == map:ia, sc:a, insert == 8 | my @; 9 | == Idioms.array+assignment == map:iaa, sc:a, insert == 10 | my @ = ( <+val+>, <+val+>, ); 11 | == Idioms.hash == map:ih, sc:h == 12 | my %; 13 | == Idioms.hash+assignment == map:iha, sc:h, insert == 14 | my % = ( 15 | <+key1+> => <+val1+>, 16 | <+key2+> => <+val2+>, 17 | ); 18 | == ENDTEMPLATE == 19 | 20 | == SEP: Idioms.sep_data == 21 | 22 | == Idioms.regex == map:ir, sc:r, insert == 23 | my $rgx_ = qr/<+regexp+>/; 24 | == Idioms.match == map:im, sc:m, insert == 25 | $ =~ m/<+regexp+>/xm 26 | == Idioms.substitute == map:is, sc:s, insert == 27 | $ =~ s/<+pattern+>/<+replacement+>/xm 28 | == Idioms.translate == map:it, sc:t, insert == 29 | $ =~ tr/<+searchlist+>/<+replacementlist+>/ 30 | == ENDTEMPLATE == 31 | 32 | == SEP: Idioms.sep_regex == 33 | 34 | == Idioms.subroutine == map:isu, sc:s == 35 | sub |?FUNCTION_NAME| { 36 | my ( $par1 ) = @_; 37 | return ; 38 | } ## --- end sub |FUNCTION_NAME| 39 | == ENDTEMPLATE == 40 | 41 | == SEP: Idioms.sep_io == 42 | 43 | == Idioms.print == map:ip, sc:p, insert == 44 | print "\n"; 45 | == Idioms.open input file == map:ii, sc:i == 46 | my $|?FILEPOINTER|_file_name = ''; # input file name 47 | 48 | open my $|FILEPOINTER|, '<', $|FILEPOINTER|_file_name 49 | or die "$0 : failed to open input file '$|FILEPOINTER|_file_name' : $!\n"; 50 | 51 | {-continue_here-} 52 | close $|FILEPOINTER| 53 | or warn "$0 : failed to close input file '$|FILEPOINTER|_file_name' : $!\n"; 54 | 55 | == Idioms.open output file == map:io, sc:o == 56 | my $|?FILEPOINTER|_file_name = ''; # output file name 57 | 58 | open my $|FILEPOINTER|, '>', $|FILEPOINTER|_file_name 59 | or die "$0 : failed to open output file '$|FILEPOINTER|_file_name' : $!\n"; 60 | 61 | {-continue_here-} 62 | close $|FILEPOINTER| 63 | or warn "$0 : failed to close output file '$|FILEPOINTER|_file_name' : $!\n"; 64 | 65 | == Idioms.open pipe == map:ipi, sc:p == 66 | my $|?PIPE|_command = " | "; # pipe command 67 | 68 | open my $|PIPE|, $|PIPE|_command 69 | or die "$0 : failed to open pipe '$|PIPE|_command' : $!\n"; 70 | 71 | {-continue_here-} 72 | close $|PIPE| 73 | or warn "$0 : failed to close pipe '$|PIPE|_command' : $!\n"; 74 | 75 | == Idioms.STDIN == sc:i, insert, map:isi == 76 | 77 | == Idioms.STDOUT == sc:o, insert, map:iso == 78 | 79 | == Idioms.STDERR == sc:e, insert, map:ise == 80 | 81 | -------------------------------------------------------------------------------- /perl-support/templates/pod.templates: -------------------------------------------------------------------------------- 1 | == POD.pod, cut == map:ppc, sc:p == 2 | 3 | =pod 4 | 5 | 6 | 7 | =cut 8 | 9 | == POD.for, cut == map:pfc, sc:f == 10 | 11 | =for 12 | 13 | 14 | 15 | =cut 16 | 17 | == POD.begin html, end == map:pbh, sc:h == 18 | 19 | =begin html 20 | 21 | 22 | 23 | =end html 24 | 25 | == POD.begin man, end == map:pbm, sc:m == 26 | 27 | =begin man 28 | 29 | 30 | 31 | =end man 32 | 33 | == POD.begin text, end == map:pbt, sc:t == 34 | 35 | =begin text 36 | 37 | 38 | 39 | =end text 40 | 41 | == POD.head1 == map:ph1, sc:1 == 42 | 43 | =head1 44 | 45 | == POD.head2 == map:ph2, sc:2 == 46 | 47 | =head2 48 | 49 | == POD.head3 == map:ph3, sc:3 == 50 | 51 | =head3 52 | 53 | == POD.over, back == map:pob, sc:o == 54 | 55 | =over 2 56 | 57 | =item * 58 | 59 | 60 | 61 | =item * 62 | 63 | 64 | 65 | =back 66 | 67 | == POD.item == map:pi, sc:i == 68 | 69 | =item * 70 | 71 | 72 | 73 | == POD.invisible POD.Improvement == 74 | 75 | =for Improvement: |?KEYWORD| 76 | 77 | 78 | =cut 79 | 80 | == POD.invisible POD.Optimization == 81 | 82 | =for Optimization: |?KEYWORD| 83 | 84 | 85 | =cut 86 | 87 | == POD.invisible POD.Rationale == 88 | 89 | =for Rationale: |?KEYWORD| 90 | 91 | 92 | =cut 93 | 94 | == POD.invisible POD.Workaround == 95 | 96 | =for Workaround: |?KEYWORD| 97 | 98 | 99 | =cut 100 | 101 | == ENDTEMPLATE == 102 | 103 | == LIST: POD_markup == hash == 104 | 'bold' : 'B', 105 | 'literal' : 'C', 106 | 'escape' : 'E', 107 | 'filename' : 'F', 108 | 'italic' : 'I', 109 | 'link' : 'L', 110 | 'nonbr. spaces': 'S', 111 | 'index' : 'X', 112 | 'zero-width' : 'Z' 113 | == ENDLIST == 114 | 115 | == POD.markup sequences == expandmenu, expandright:value, insert, map:pm, sc:m == 116 | |PickList( 'Markup', 'POD_markup' )| 117 | |PICK|<> 118 | == ENDTEMPLATE == 119 | 120 | -------------------------------------------------------------------------------- /perl-support/templates/snippets.templates: -------------------------------------------------------------------------------- 1 | == LIST: snippets_jumptags == hash == 2 | 'less-plus' : '<++>', 3 | 'less-minus' : '<-->', 4 | 'brace-plus' : '{++}', 5 | 'brace-minus' : '{--}', 6 | 'optional-plus' : '[++]', 7 | 'optional-minus' : '[--]', 8 | == ENDLIST == 9 | 10 | == Snippets.jump tags == expandmenu, expandright:value, insert, map:njt, sc:m == 11 | |PickList( 'jumptags', 'snippets_jumptags' )| 12 | |VALUE| 13 | == ENDTEMPLATE == 14 | 15 | == Snippets.regex == map:nxs, sc:x == 16 | # 17 | # DESCRIPTION: 18 | # 19 | {-REGEX-} 20 | # 21 | # EXAMPLES: 22 | # 23 | == ENDTEMPLATE == 24 | -------------------------------------------------------------------------------- /perl-support/templates/statements.templates: -------------------------------------------------------------------------------- 1 | == Statements.do-while == map:sd, sc:d == 2 | do { 3 | } while ( ); # ----- end do-while ----- 4 | == Statements.for == map:sf, sc:f == 5 | for ( my $; ; ) { 6 | } 7 | == Statements.foreach == map:sfe, sc:f == 8 | foreach my $ ( ) { 9 | } 10 | == Statements.if == map:si, sc:i == 11 | if ( ) { 12 | <-IF_PART-> 13 | } 14 | == Statements.else == map:se, sc:e == 15 | else { 16 | } 17 | == Statements.elsif == map:sei, sc:e == 18 | elsif ( ) { 19 | } 20 | == Statements.if-else == map:sie, sc:i == 21 | if ( ) { 22 | <-IF_PART-> 23 | } 24 | else { 25 | <-ELSE_PART-> 26 | } 27 | == Statements.unless == map:su, sc:u == 28 | unless ( ) { 29 | } 30 | == Statements.unless-else == map:sue, sc:u == 31 | unless ( ) { 32 | } 33 | else { 34 | <-ELSE_PART-> 35 | } 36 | == Statements.until == map:st, sc:t == 37 | until ( ) { 38 | } 39 | == Statements.while == map:sw, sc:w == 40 | while ( ) { 41 | } 42 | == Statements.given == map:sg, sc:g == 43 | given ( ) { 44 | when () {} 45 | when () {} 46 | default {} 47 | } 48 | == Statements.when == map:swh, sc:w == 49 | when () {} 50 | == ENDTEMPLATE == 51 | -------------------------------------------------------------------------------- /project/filter-vimtags.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #=============================================================================== 3 | # 4 | # FILE: filter-vimtags.pl 5 | # 6 | # USAGE: filter-vimtags.pl [-i input file] [-o output file] 7 | # 8 | # DESCRIPTION: more remove stars from vim-doc labels, such as: 9 | # *csupport-run* 10 | # 11 | # OPTIONS: --- 12 | # REQUIREMENTS: --- 13 | # BUGS: --- 14 | # NOTES: --- 15 | # AUTHOR: Dr. Fritz Mehner (fgm), mehner@web.de 16 | # VERSION: 1.0 17 | # CREATED: 20.03.2009 18 | # REVISION: 15.11.2014 19 | #=============================================================================== 20 | 21 | use strict; 22 | use warnings; 23 | use Getopt::Std; # Process single-character switches 24 | 25 | our($opt_i, $opt_o); # declare package variables 26 | 27 | getopts('i:o:'); # 28 | 29 | $opt_i = '-' unless defined $opt_i; # if not set, set output to STDIN 30 | $opt_o = '-' unless defined $opt_o; # if not set, set output to STDOUT 31 | 32 | open STDIN, "< $opt_i" 33 | or die "$0 : failed to open input file '$opt_i' : $!\n"; 34 | 35 | my $rgx_vimtag = q/\*/; 36 | my $line; 37 | my @lines = ; 38 | 39 | close STDIN 40 | or warn "$0 : failed to close input file '$opt_i' : $!\n"; 41 | 42 | open STDOUT, "+> $opt_o" 43 | or die "$0 : failed to open output file '$opt_o' : $!\n"; 44 | 45 | foreach my $line ( @lines ) { 46 | if ( $line =~ m/$rgx_vimtag/ ) { 47 | $line =~ s/(class="vimtag">)\*/$1/g; 48 | $line =~ s#\*##g; 49 | } 50 | print $line; 51 | } 52 | 53 | close STDOUT 54 | or warn "$0 : failed to close output file '$opt_o' : $!\n"; 55 | 56 | -------------------------------------------------------------------------------- /project/make-html.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash - 2 | #=============================================================================== 3 | # 4 | # FILE: make-html.sh 5 | # 6 | # USAGE: ./make-html.sh 7 | # 8 | # DESCRIPTION: performs these steps: 9 | # - switch to the ./doc directory 10 | # - do the helptags there 11 | # - run "vim2html.pl" 12 | # 13 | # OPTIONS: --- 14 | # REQUIREMENTS: --- 15 | # BUGS: --- 16 | # NOTES: --- 17 | # AUTHOR: Wolfgang Mehner 18 | # Fritz Mehner 19 | # VERSION: 1.0 20 | # CREATED: 20.03.2009 21 | # REVISION: 15.11.2014 22 | #=============================================================================== 23 | 24 | set -o nounset # Treat unset variables as an error 25 | 26 | PROJECT_BASE_DIR=$(git rev-parse --show-toplevel) 27 | 28 | # go to doc/ 29 | cd $PROJECT_BASE_DIR/doc 30 | 31 | # redo the helptags 32 | echo -e "producing the helptags ..." 33 | vim -c ':helptags . | q' 34 | 35 | # run vim2html on all files 36 | if [ -r tags ]; then 37 | echo -e "running vim2html ..." 38 | $PROJECT_BASE_DIR/project/vim2html.pl tags *.txt 39 | else 40 | echo -e "tag file not found, aborting" 41 | exit 1 42 | fi 43 | 44 | # move all the produced files to doc-html/ 45 | echo -e "moving results to doc-html/ ..." 46 | mkdir -p $PROJECT_BASE_DIR/doc-html 47 | mv *.css *.html $PROJECT_BASE_DIR/doc-html 48 | -------------------------------------------------------------------------------- /project/maps_overview.txt: -------------------------------------------------------------------------------- 1 | 2 | Awk Bash C LaTeX Lua Perl Vim 3 | 4 | Run 5 | ------------------------------------------------------------------ 6 | typesetter rr 7 | lacheck rla 8 | convert rc 9 | set main doc rmd 10 | ------------------------------------------------------------------ 11 | compile rc rc 12 | link rl - 13 | ------------------------------------------------------------------ 14 | run rr rr rr rr rr 15 | exec. to run - - re - - 16 | syntax check rs>rk rk - rk rs>rk 17 | s.c. options - rso - - - 18 | lint check rl - - - - 19 | debugger - - rd - rd 20 | script args ra rsa ra - ra 21 | interp. args raa ria - rw 22 | output dest. ro ro ro - ro ro - 23 | ex. process - - - rp - - - 24 | direct run - rd - - rd - - 25 | set exec. - rse - - rse - - 26 | set compiler - - - - rsc - - 27 | xterm size rx rx rx - - rx - 28 | ------------------------------------------------------------------ 29 | make exec. re re - - re re - 30 | hardcopy rh rh rh rh rh rh rh 31 | timestamped - - - - - rt - 32 | ------------------------------------------------------------------ 33 | settings rse>rs rs rs rs rs rk>rs rs 34 | ------------------------------------------------------------------ 35 | Help 36 | ------------------------------------------------------------------ 37 | plug-in hp hp hp hp hs hp hp 38 | ------------------------------------------------------------------ 39 | 40 | # vim: tabstop=8 41 | -------------------------------------------------------------------------------- /project/options_buffers.txt: -------------------------------------------------------------------------------- 1 | 'bufhidden' 'bh' string (default: "") 2 | local to buffer 3 | This option specifies what happens when a buffer is no longer 4 | displayed in a window: 5 | 'buflisted' 'bl' boolean (default: on) 6 | local to buffer 7 | When this option is set, the buffer shows up in the buffer list. 8 | 'buftype' 'bt' string (default: "") 9 | local to buffer 10 | The value of this option specifies the type of a buffer: 11 | 'hidden' 'hid' boolean (default off) 12 | global 13 | When off a buffer is unloaded when it is abandoned. When on a 14 | buffer becomes hidden when it is abandoned. 15 | 'modifiable' 'ma' boolean (default on) 16 | local to buffer 17 | When off the buffer contents cannot be changed. 18 | 'modified' 'mod' boolean (default off) 19 | local to buffer 20 | When on, the buffer is considered to be modified. 21 | 'swapfile' 'swf' boolean (default on) 22 | local to buffer 23 | Use a swapfile for the buffer. This option can be reset when a 24 | swapfile is not wanted for a specific buffer. 25 | -------------------------------------------------------------------------------- /project/scripts/check_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash - 2 | #=============================================================================== 3 | # 4 | # FILE: check_repos.sh 5 | # 6 | # USAGE: ./check_repos.sh 7 | # 8 | # DESCRIPTION: Short status of standalone repos. 9 | # 10 | # OPTIONS: --- 11 | # REQUIREMENTS: --- 12 | # BUGS: --- 13 | # NOTES: --- 14 | # AUTHOR: Wolfgang Mehner (WM), wolfgang-mehner@web.de 15 | # ORGANIZATION: 16 | # CREATED: 18.10.2017 22:30 17 | # REVISION: --- 18 | #=============================================================================== 19 | 20 | set -o nounset # Treat unset variables as an error 21 | 22 | LIST=" 23 | Awk 24 | Bash 25 | C 26 | Git 27 | Latex 28 | Lua 29 | Perl 30 | Vim 31 | " 32 | 33 | for NAME in $LIST; do 34 | cd $NAME"Support" 35 | 36 | if [ ${?} -ne 0 ] ; then 37 | continue 38 | fi 39 | 40 | printf "%-6s : %s (%s )\n" $NAME "$(git log -n1 --date=short --pretty=format:"%ad : %s")" "$(git diff --shortstat HEAD)" 41 | cd .. 42 | done | sort -k 2 43 | -------------------------------------------------------------------------------- /project/scripts/get_cmake_policies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash - 2 | #=============================================================================== 3 | # 4 | # FILE: get_cmake_policies.sh 5 | # 6 | # USAGE: ./get_cmake_policies.sh 7 | # 8 | # DESCRIPTION: 9 | # 10 | # OPTIONS: --- 11 | # REQUIREMENTS: --- 12 | # BUGS: --- 13 | # NOTES: --- 14 | # AUTHOR: Wolfgang Mehner (WM), wolfgang-mehner@web.de 15 | # ORGANIZATION: 16 | # CREATED: 16.10.2017 17 | # REVISION: --- 18 | #=============================================================================== 19 | 20 | set -o nounset # Treat unset variables as an hrror 21 | shopt -s extglob 22 | 23 | CMAKE_VERSION="3.10" 24 | POLICY_MIN=0 25 | POLICY_MAX=71 26 | 27 | DOC_URL="https://cmake.org/cmake/help/v$CMAKE_VERSION/policy/CMP%04d.html" 28 | 29 | for (( POLICY=POLICY_MIN; POLICY<=POLICY_MAX; POLICY+=1 )); do 30 | #printf "processing policy CMP%04d\n" $POLICY 31 | 32 | printf -v URL $DOC_URL $POLICY 33 | 34 | TEXT=$( wget -O - $URL 2> /dev/null ) 35 | 36 | #

CMP0027

37 | #

Conditionally linked imported targets with missing include directories.

38 | # 39 | #

CMP0030

40 | #

The use_mangled_mesa() command should not be called.

41 | 42 | HEAD=${TEXT#*<\/span>

} 43 | HEAD=${HEAD%%<\/p>*} 44 | 45 | P_NAME=${HEAD%%} 47 | 48 | P_DESC=$( echo $P_DESC | tr -d \\n ) 49 | 50 | P_VERSION=${TEXT#*This policy was introduced in CMake version } 51 | P_VERSION=${P_VERSION%%.[^[:digit:]]*} 52 | 53 | #echo $HEAD 54 | #echo $P_NAME 55 | #echo $P_DESC 56 | #echo $P_VERSION 57 | 58 | printf "\\ [ '%s', '%s', '%s' ],\n" "$P_NAME" "$P_DESC" "$P_VERSION" 59 | done 60 | 61 | -------------------------------------------------------------------------------- /project/scripts/update_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash - 2 | #=============================================================================== 3 | # 4 | # FILE: update_repos.sh 5 | # 6 | # USAGE: ./update_repos.sh 7 | # 8 | # DESCRIPTION: Update information on standalone repos. 9 | # 10 | # OPTIONS: --- 11 | # REQUIREMENTS: --- 12 | # BUGS: --- 13 | # NOTES: --- 14 | # AUTHOR: Wolfgang Mehner (WM), wolfgang-mehner@web.de 15 | # ORGANIZATION: 16 | # CREATED: 18.10.2017 22:29 17 | # REVISION: --- 18 | #=============================================================================== 19 | 20 | set -o nounset # Treat unset variables as an error 21 | shopt -s extglob 22 | 23 | LIST=" 24 | Awk 25 | Bash 26 | C 27 | Git 28 | Latex 29 | Lua 30 | Perl 31 | Vim 32 | " 33 | 34 | for NAME in $LIST; do 35 | echo $NAME"Support" 36 | cd $NAME"Support" 37 | 38 | if [ ${?} -ne 0 ] ; then 39 | echo "" 40 | continue 41 | fi 42 | 43 | git fetch 44 | 45 | echo "" 46 | cd .. 47 | done 48 | 49 | for NAME in $LIST; do 50 | echo $NAME"Support" 51 | cd $NAME"Support" 52 | 53 | if [ ${?} -ne 0 ] ; then 54 | echo "" 55 | continue 56 | fi 57 | 58 | SHORT_STAT=$(git diff --shortstat) 59 | SHA_MASTER=$(git for-each-ref --format='%(objectname)' refs/heads/master) 60 | SHA_ORIGIN=$(git for-each-ref --format='%(objectname)' refs/remotes/origin/master) 61 | 62 | if [ "$SHORT_STAT" != "" ] ; then 63 | echo " requires commit: $SHORT_STAT" 64 | fi 65 | if [ $SHA_MASTER != $SHA_ORIGIN ] ; then 66 | SHA_BASE=$(git merge-base $SHA_MASTER $SHA_ORIGIN) 67 | 68 | if [ $SHA_MASTER == $SHA_BASE ] ; then 69 | echo " requires merge" 70 | elif [ $SHA_ORIGIN == $SHA_BASE ] ; then 71 | echo " requires push" 72 | else 73 | echo " OUT OF DATE" 74 | fi 75 | fi 76 | 77 | COMMIT_MSG=$(git log -n1) 78 | SHA_ORIGINAL=${COMMIT_MSG##*commit\/} 79 | 80 | cd .. 81 | 82 | cd ../VimPlugins/ 83 | 84 | TAG_NAME="_repos_/"${NAME,,}"-support" 85 | 86 | SHA_TAG=$(git for-each-ref --format='%(objectname)' refs/tags/$TAG_NAME) 87 | 88 | if [ "$SHA_TAG" != "$SHA_ORIGINAL" ] ; then 89 | if [ "$SHA_TAG" == "" ] ; then 90 | echo " tag not set" 91 | else 92 | echo " tag outdated" 93 | fi 94 | 95 | read -p "Update tag? [y/n] " ANSWER 96 | 97 | if [ "${ANSWER,,}" == 'y' ] ; then 98 | echo " setting tag .." 99 | git tag -f $TAG_NAME $SHA_ORIGINAL 100 | fi 101 | fi 102 | 103 | echo "" 104 | cd ../VimRepos/ 105 | done 106 | -------------------------------------------------------------------------------- /project/tool_menu_priorities.txt: -------------------------------------------------------------------------------- 1 | 2 | Priorities of the tool menu entries "Load Support"/"Unload Support": 3 | 4 | Entry Priority 5 | 6 | Tools.-SEP100- 40.1000 7 | Tools.Awk 40.1010 8 | Tools.Bash 40.1020 9 | Tools.C 40.1030 10 | Tools.Git 40.1080 11 | Tools.Latex 40.1110 12 | Tools.Lua 40.1122 13 | Tools.Perl 40.1160 14 | Tools.Python 40.1162 15 | Tools.Verilog 40.1168 16 | Tools.Vim 40.1170 17 | 18 | Tools.Filter 40.1210 ??? 19 | 20 | 21 | vim: tabstop=8 22 | -------------------------------------------------------------------------------- /project/vim_org/bash-support.txt: -------------------------------------------------------------------------------- 1 | ================================================================================ 2 | ===== summary 3 | ================================================================================ 4 | Bash IDE -- Insert code snippets, run, check and debug the code and look up help 5 | ================================================================================ 6 | ===== detailed description 7 | ================================================================================ 8 | Write Bash-scripts by inserting comments, statements, tests, variables, built-ins, etc.. 9 | Speed up writing new scripts considerably. 10 | Write code und comments with a professional appearance from the beginning. 11 | 12 | Some screen shots : https://wolfgangmehner.github.io/vim-plugins/bashsupport.html 13 | 14 | For plug-in managers : https://github.com/WolfgangMehner/bash-support 15 | 16 | The help file online : https://wolfgangmehner.github.io/vim-plugins/doc/bashsupport.html 17 | 18 | The key mappings of this plug-in : https://wolfgangmehner.github.io/vim-plugins/bashsupport/bash-hotkeys.pdf 19 | 20 | The installation explained : "Make Vim as Your Bash-IDE Using bash-support Plugin" 21 | (http://www.thegeekstuff.com/2009/02/make-vim-as-your-bash-ide-using-bash-support-plugin) 22 | 23 | Plug-in featured in the linux.com article 'Turn Vim into a bash IDE' : http://www.linux.com/articles/114359 24 | 25 | DOCUMENTATION 26 | -------------------------------------------------------- 27 | This plug-in comes with a help file (bashsupport.txt). Read it with 28 | 29 | :help bashsupport 30 | 31 | ** PLEASE READ THE DOCUMENTATION ** 32 | 33 | Editing actions differ for different modes! There are a lot of features which 34 | can be configured or customized to match your needs. 35 | 36 | GitHub 37 | -------------------------------------------------------- 38 | Bash-Support is on GitHub. We are happy to receive your questions, suggestions, and bug reports here: 39 | 40 | https://github.com/WolfgangMehner/vim-plugins 41 | 42 | (Please help us keep track of all the issues and name your report/request "Bash-Support: ") 43 | ================================================================================ 44 | ===== install details 45 | ================================================================================ 46 | Copy the zip archive bash-support.zip to $HOME/.vim/ or $VIM/vimfiles 47 | (on the Windows platforms) and run 48 | unzip bash-support.zip 49 | If you have already an older version of this plugin and you have modified the 50 | template files you may want to save your templates first or copy the files from 51 | the archive by hand. See also the file README.md within the zip file. 52 | ================================================================================ 53 | ===== end 54 | ================================================================================ 55 | -------------------------------------------------------------------------------- /project/vim_org/vim-support.txt: -------------------------------------------------------------------------------- 1 | ================================================================================ 2 | ===== summary 3 | ================================================================================ 4 | VimScript IDE -- Insert code snippets, quickly comment the code and look up help 5 | ================================================================================ 6 | ===== detailed description 7 | ================================================================================ 8 | Vim-Support implements a Vim Script-IDE for Vim/gVim. It has been written to 9 | considerably speed up writing code in a consistent style. This is done by 10 | inserting complete statements, comments, idioms, and code snippets. 11 | 12 | Some screen shots : https://wolfgangmehner.github.io/vim-plugins/vimsupport.html 13 | 14 | For plug-in managers : https://github.com/WolfgangMehner/vim-support 15 | 16 | The help file online : https://wolfgangmehner.github.io/vim-plugins/doc/vimsupport.html 17 | 18 | The key mappings of this plug-in : https://wolfgangmehner.github.io/vim-plugins/vimsupport/vim-hotkeys.pdf 19 | 20 | DOCUMENTATION 21 | -------------------------------------------------------- 22 | This plug-in comes with a help file (vimsupport.txt). Read it with 23 | 24 | :help vimsupport 25 | 26 | ** PLEASE READ THE DOCUMENTATION ** 27 | 28 | Editing actions differ for different modes! There are a lot of features which 29 | can be configured or customized to match your needs. 30 | 31 | GitHub 32 | -------------------------------------------------------- 33 | Vim-Support is on GitHub. We are happy to receive your questions, suggestions, and bug reports here: 34 | 35 | https://github.com/WolfgangMehner/vim-plugins 36 | 37 | (Please help us keep track of all the issues and name your report/request "Vim-Support: <title>") 38 | ================================================================================ 39 | ===== install details 40 | ================================================================================ 41 | Copy the zip archive vim-support.zip to $HOME/.vim/ or $VIM/vimfiles 42 | (on the Windows platforms) and run 43 | unzip vim-support.zip 44 | If you have already an older version of this plug-in and you have modified the 45 | template files you may want to save your templates first or copy the files from 46 | the archive by hand. See also the file README.md within the zip file. 47 | ================================================================================ 48 | ===== end 49 | ================================================================================ 50 | -------------------------------------------------------------------------------- /syntax/bashhelp.vim: -------------------------------------------------------------------------------- 1 | "=============================================================================== 2 | " 3 | " File: bashhelp.vim 4 | " 5 | " Description: Syntax for Bash's built-in help. 6 | " 7 | " Import man page syntax. 8 | " 9 | " VIM Version: 7.4+ 10 | " Author: Wolfgang Mehner, wolfgang-mehner@web.de 11 | " Organization: 12 | " Version: 1.0 13 | " Created: 16.11.2017 14 | " Revision: --- 15 | " License: Copyright (c) 2017, Wolfgang Mehner 16 | "=============================================================================== 17 | 18 | runtime! syntax/man.vim 19 | 20 | " nothing noteworthy will happen in Vim 21 | " save in Neovim, because filetype is not "man" 22 | -------------------------------------------------------------------------------- /template-support/README.md: -------------------------------------------------------------------------------- 1 | README for template-support.vim (Version 1.0) / January 08 2016 2 | ================================================================================ 3 | 4 | With this plug-in, you can configure a template library for arbitrary filetypes. 5 | 6 | For writing your own template files, see the documentation of the template 7 | engine: 8 | 9 | :help template-support 10 | 11 | Also have a look at the template libraries of the other plug-ins for 12 | inspiration, if you like. 13 | 14 | Add Template Files 15 | ---------------------------------------------------------------------- 16 | 17 | Add a template file for a certain filetype in your `.vimrc`, e.g.: 18 | 19 | call mmtemplates#config#Add ( 'html', $HOME.'/somepath/html-templates/Templates', 'local', 'ntl' ) 20 | 21 | The arguments are as follows: 22 | 23 | 1. filetype: Has to be the name Vim uses for the filetype. 24 | 2. template file: The template file to load for the filetype. 25 | 3. name (_optional_): The symbolic name of the template file. 26 | 4. map (_optional_): The map which will be created for editing this template 27 | file. Will be preceded by the mapleader, the map will be `\ntl` in this 28 | example. 29 | 30 | Mapleader 31 | ---------------------------------------------------------------------- 32 | 33 | The mapleader used for the created maps can also be set in the `.vimrc`, e.g.: 34 | 35 | let g:Templates_MapLeader = '#' 36 | 37 | Commenting 38 | ---------------------------------------------------------------------- 39 | 40 | Maps for turning code into comment and vice versa can also be created for the 41 | corresponding filetype. The maps will be `\cc` and `\co`, but using the chosen 42 | mapleader. 43 | 44 | To configure them, the template files have to contain the following settings. 45 | E.g., for HTML: 46 | 47 | SetProperty ( 'Comments::LinePrefix', '<!--' ) 48 | SetProperty ( 'Comments::LinePostfix', '-->' ) 49 | 50 | Lines which are turned into comments will be prefixed with `<!--` and postfixed 51 | with `-->`. 52 | 53 | Or, for config files (filetype `conf`): 54 | 55 | SetProperty ( 'Comments::LinePrefix', '#' ) 56 | 57 | The property `Comments::LinePostfix` does not have to be set. 58 | 59 | Included Template Libraries 60 | ---------------------------------------------------------------------- 61 | 62 | Templates for writing template files are already included. Find out the path 63 | where the plug-in is installed (`<PATH_TO_PLUG>/plugin/template-support.vim`) 64 | and add this line to the `.vimrc`: 65 | 66 | call mmtemplates#config#Add ( 'template', '<PATH_TO_PLUG>/template-support/templates/Templates', 'local', 'ntl' ) 67 | 68 | -------------------------------------------------------------------------------- /template-support/templates/Templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Interface Version 3 | § ============================================================= 4 | 5 | InterfaceVersion ( '1.0' ) 6 | 7 | § ============================================================= 8 | § Settings 9 | § ============================================================= 10 | 11 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 12 | SetMacro( 'AUTHORREF', '' ) 13 | SetMacro( 'EMAIL', '' ) 14 | SetMacro( 'ORGANIZATION', '' ) 15 | SetMacro( 'COMPANY', '' ) 16 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 17 | SetMacro( 'LICENSE', 'GNU General Public License' ) 18 | 19 | SetFormat( 'DATE', '%x' ) 20 | SetFormat( 'TIME', '%X' ) 21 | SetFormat( 'YEAR', '%Y' ) 22 | 23 | § set a comment prefix, so the maps \cc, ... are created 24 | 25 | SetProperty ( 'Comments::LinePrefix', '§' ) 26 | 27 | § we use these macros, so the templates can be loaded correctly, without confusing the parser: 28 | § CMT : comment : § COMMENT! 29 | § DELIM : delimiter : == <template-name> == <options> == 30 | § M_S : macro, start 31 | § M_E : macro, end : |AUTHOR| 32 | § M_S : tag, start 33 | § M_E : tag, end : <CURSOR> 34 | 35 | SetMacro( 'CMT', '§' ) 36 | SetMacro( 'DELIM', '==' ) 37 | SetMacro( 'M_S', '|' ) 38 | SetMacro( 'M_E', '|' ) 39 | SetMacro( 'T_S', '<' ) 40 | SetMacro( 'T_E', '>' ) 41 | 42 | § ============================================================= 43 | § File Includes and Shortcuts 44 | § ============================================================= 45 | 46 | MenuShortcut( 'Comments', 'c' ) 47 | MenuShortcut( 'Templates', 't' ) 48 | MenuShortcut( 'Lists', 'l' ) 49 | MenuShortcut( 'Functions', 'f' ) 50 | MenuShortcut( 'Help', 'h' ) 51 | 52 | IncludeFile( 'comments.templates' ) 53 | IncludeFile( 'templ.templates' ) 54 | IncludeFile( 'list.templates' ) 55 | IncludeFile( 'functions.templates' ) 56 | 57 | § ============================================================= 58 | § Help 59 | § ============================================================= 60 | 61 | SetMacro( 'HelpPathEnglish', 'http://en.wiktionary.org/wiki/' ) 62 | 63 | == HELP: Help.English == map:he, sc:e == 64 | |Word( '' )| 65 | |Substitute( '\W', '', 'g' )| 66 | |Browser( '|HelpPathEnglish||PICK:l|', '|HelpPathEnglish|' )| 67 | == HELP: Help.templates == map:ht, sc:h == 68 | |Pattern( '\w\+\%(\s*(\)\?' )| 69 | |Substitute( '\s*(', '()', '' )| 70 | |Vim( ':help template-support-|PICK|', ':help template-support' )| 71 | == ENDTEMPLATE == 72 | -------------------------------------------------------------------------------- /template-support/templates/comments.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Comments 3 | § ============================================================= 4 | 5 | == Comments.frame comment, big == below, map:cfb, sc:b == 6 | |CMT| ============================================================= 7 | |CMT| <CURSOR> 8 | |CMT| ============================================================= 9 | == Comments.frame comment, small == below, map:cfs, sc:s == 10 | |CMT| ------------------------------------------------------------- 11 | |CMT| <CURSOR> 12 | |CMT| ------------------------------------------------------------- 13 | == Comments.separator == below, map:cs == 14 | |CMT| ------------------------------------------------------------- 15 | == ENDTEMPLATE == 16 | 17 | § ------------------------------------------------------------- 18 | 19 | == Comments.date == insert, map:cd, sc:d == 20 | |DATE| 21 | == Comments.date, time == insert, sc:t == 22 | |DATE| |TIME| 23 | == ENDTEMPLATE == 24 | 25 | § ------------------------------------------------------------- 26 | § Keywords, Special and Macros 27 | § ------------------------------------------------------------- 28 | 29 | == LIST: comments_keywords == hash == 30 | 'bug' : ':BUG:|DATE| |TIME|:|AUTHORREF|: <CURSOR>', 31 | 'todo' : ':TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR>', 32 | 'tricky' : ':TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR>', 33 | 'warning' : ':WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR>', 34 | 'workaround' : ':WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR>', 35 | 'new keyword' : ':<CURSOR>:|DATE| |TIME|:|AUTHORREF|: {+COMMENT+}', 36 | == LIST: comments_macros == hash == 37 | 'author' : '|AUTHOR|', 38 | 'author ref' : '|AUTHORREF|', 39 | 'organization' : '|ORGANIZATION|', 40 | 'copyright' : '|COPYRIGHT|', 41 | 'email' : '|EMAIL|', 42 | 43 | 'path' : '|PATH|', 44 | 'filename' : '|FILENAME|', 45 | 'basename' : '|BASENAME|', 46 | 'basename:u' : '|BASENAME:u|', 47 | 'suffix' : '|SUFFIX|', 48 | 49 | 'date' : '|DATE|', 50 | 'time' : '|TIME|', 51 | 'year' : '|YEAR|', 52 | == ENDLIST == 53 | 54 | == Comments.keyword comment == expandmenu, below, map:ck, sc:k == 55 | |PickList( 'keyword', 'comments_keywords' )| 56 | |CMT| |PICK| 57 | == Comments.macros == expandmenu, insert, map:cm, sc:m == 58 | |PickList( 'macro', 'comments_macros' )| 59 | |PICK|<CURSOR> 60 | == ENDTEMPLATE == 61 | 62 | -------------------------------------------------------------------------------- /template-support/templates/functions.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Functions 3 | § ============================================================= 4 | 5 | == LIST: functions_commands == hash == 6 | 'IncludeFile' : "'<+path+>'", 7 | 'MenuShortcut' : "'<+menu+>', '<+shortcut+>'", 8 | 'SetFormat' : "'<+name+>', '<+format+>'", 9 | 'SetMacro' : "'<+name+>', '<+text+>'", 10 | 'SetMap' : "'<+templ+>', '<+map+>'", 11 | 'SetMenuEntry' : "'<+templ+>', '<+entry+>'", 12 | 'SetPath' : "'<+name+>', '<+path+>'", 13 | 'SetProperty' : "'<+name+>', '<+value+>'", 14 | 'SetShortcut' : "'<+templ+>', '<+sc+>'", 15 | 'SetStyle' : "'<+style+>'", 16 | == LIST: functions_template == hash == 17 | 'DefaultMacro' : "'<+name+>', '<+text+>'", 18 | 'PickFile' : "'<+prompt+>', '<+path+>'", 19 | 'PickList' : "'<+prompt+>', '<+list+>'", 20 | 'Prompt' : "'<+name+>', '<+flag+>'", 21 | == ENDLIST == 22 | 23 | == Functions.command function == expandmenu, below, map:fc, sc:c == 24 | |PickList( 'function', 'functions_commands' )| 25 | |KEY|( <CURSOR>|VALUE| ) 26 | == Functions.template function == expandmenu, below, map:ft, sc:t == 27 | |PickList( 'function', 'functions_template' )| 28 | |M_S||KEY|( <CURSOR>|VALUE| )|M_E| 29 | == ENDTEMPLATE == 30 | 31 | -------------------------------------------------------------------------------- /template-support/templates/list.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Lists 3 | § ============================================================= 4 | 5 | == Lists.hash == below, noindent, map:lha, sc:h == 6 | |DELIM| LIST: <CURSOR> |DELIM| hash |DELIM| 7 | '{+KEY+}' : '{+VALUE+}', 8 | |DELIM| ENDLIST |DELIM| 9 | == Lists.list == below, noindent, map:lli, sc:l == 10 | |DELIM| LIST: <CURSOR> |DELIM| list |DELIM| 11 | '{+ENTRY+}', 12 | |DELIM| ENDLIST |DELIM| 13 | == ENDTEMPLATE == 14 | 15 | == Lists.hash entry == below, noindent, map:lhe == 16 | '<CURSOR>' : '{+VALUE+}', 17 | == Lists.list entry == below, noindent, map:lle == 18 | '<CURSOR>', 19 | == ENDTEMPLATE == 20 | 21 | -------------------------------------------------------------------------------- /template-support/templates/templ.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Templates 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § Options 7 | § ------------------------------------------------------------- 8 | 9 | == LIST: template_options == list == 10 | 'start', 11 | 'above', 12 | 'below', 13 | 'insert', 14 | 'append', 15 | 16 | 'visual', 17 | 'novisual', 18 | 'indent', 19 | 'noindent', 20 | 21 | 'nomenu', 22 | 'map:', 23 | 'shortcut:', 24 | 'sc:', 25 | 'expandmenu', 26 | 'expandleft:', 27 | 'expandright:', 28 | == ENDLIST == 29 | 30 | == Templates.option == expandmenu, insert, map:to, sc:o == 31 | |PickList( 'template option', 'template_options' )| 32 | |PICK|<CURSOR> 33 | == ENDTEMPLATE == 34 | 35 | § ------------------------------------------------------------- 36 | § Templates 37 | § ------------------------------------------------------------- 38 | 39 | == Templates.template == below, noindent, map:tt, sc:t == 40 | |DELIM| <CURSOR> |DELIM| {+OPTIONS+} |DELIM| 41 | <SPLIT>{-TEXT-} 42 | |DELIM| ENDTEMPLATE |DELIM| 43 | == ENDTEMPLATE == 44 | 45 | == Templates.file picker == below, noindent, map:tf, sc:f == 46 | |DELIM| <CURSOR> |DELIM| {+OPTIONS+} |DELIM| 47 | |M_S|PickFile( '{+PROMPT+}', '{+PATH+}' )|M_E| 48 | <SPLIT>{-TEXT-} 49 | |DELIM| ENDTEMPLATE |DELIM| 50 | == ENDTEMPLATE == 51 | 52 | == Templates.list picker == below, noindent, map:tl, sc:l == 53 | |DELIM| <CURSOR> |DELIM| {+OPTIONS+} |DELIM| 54 | |M_S|PickList( '{+PROMPT+}', '{+LIST+}' )|M_E| 55 | <SPLIT>{-TEXT-} 56 | |DELIM| ENDTEMPLATE |DELIM| 57 | == ENDTEMPLATE == 58 | 59 | == Templates.help template == below, noindent, map:th, sc:h == 60 | |PickList( 'help call method', [ 'Browser', 'System', 'Vim' ] )| 61 | |DELIM| HELP: <CURSOR> |DELIM| {+OPTIONS+} |DELIM| 62 | |M_S|Word( '' )|M_E| 63 | |M_S||PICK|( '{+PATH+}|M_S|PICK|M_E|', '{+DEFAULT+}' )|M_E| 64 | |DELIM| ENDTEMPLATE |DELIM| 65 | == ENDTEMPLATE == 66 | 67 | == Templates.menu separator == below, noindent, map:ts, sc:s == 68 | |DELIM| SEP: <CURSOR> |DELIM| 69 | == ENDTEMPLATE == 70 | -------------------------------------------------------------------------------- /vim-support/README.standalone.md: -------------------------------------------------------------------------------- 1 | Preface 2 | ================================================================================ 3 | 4 | This repository is mainly for the use with plug-in managers. 5 | 6 | Have a look at the [Screenshot Page](https://wolfgangmehner.github.io/vim-plugins/vimsupport.html). 7 | 8 | The development happens in [WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins). 9 | 10 | 11 | -------------------------------------------------------------------------------- 12 | 13 | -------------------------------------------------------------------------------- /vim-support/codesnippets/plugin-start.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Prevent duplicate loading: 3 | " 4 | if exists("g:PLUGIN_Version") || &cp 5 | finish 6 | endif 7 | let g:PLUGIN_Version= "0.1" " version number of this script; do not change 8 | " 9 | if v:version < 700 10 | echohl WarningMsg | echo 'plugin PLUGIN.vim needs Vim version >= 7'| echohl None 11 | endif 12 | -------------------------------------------------------------------------------- /vim-support/doc/ChangeLog: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------------- 2 | RELEASE NOTES FOR VERSION 2.4 3 | --------------------------------------------------------------------------------------- 4 | - Add 'g:Vim_CustomTemplateFile'. 5 | - Add template personalization file and setup wizard. 6 | - Change the map for 'comment -> code' to '\co' for consistency with the other 7 | plug-ins. The old map '\cu' still works, however. 8 | - New and reworked templates. 9 | - Minor changes. 10 | 11 | --------------------------------------------------------------------------------------- 12 | RELEASE NOTES FOR VERSION 2.3 13 | --------------------------------------------------------------------------------------- 14 | + Change the way lines of code are turned into comments 15 | (insert no space after the quote). 16 | + Bugfix: Better compatibility with custom mappings 17 | (use "normal!", "noremap" and "noremenu" consistently). 18 | + Bugfix: Setup of local templates in case of global installation. 19 | + Bugfix: Renamed function which were named "g:*". 20 | + Always load the newest version of the template engine available on 'runtimepath'. 21 | 22 | --------------------------------------------------------------------------------------- 23 | RELEASE NOTES FOR VERSION 2.2 24 | --------------------------------------------------------------------------------------- 25 | + Map "adjust end-of-line com." now works in visual mode. 26 | + Map "function description (auto)" now works in visual mode. 27 | + Automatic function description now considers scopes. 28 | + Improved "adjust end-of-line comment". 29 | + Fixed template "Comments.function". 30 | + Added "Help -> english". 31 | 32 | --------------------------------------------------------------------------------------- 33 | RELEASE NOTES FOR VERSION 2.1 34 | --------------------------------------------------------------------------------------- 35 | + Menus generated in correct order. 36 | + Menus show the correct mapleader. 37 | + Maps are created for modifiable help buffers, depending on the option "g:Vim_CreateMapsForHelp". 38 | + Changed map for Vim keyword help: \h -> \hk 39 | + Map creation is triggered by the "FileType" event. 40 | + New hotkey \hp. 41 | + Minor changes and bugfixes. 42 | 43 | --------------------------------------------------------------------------------------- 44 | RELEASE NOTES FOR VERSION 2.0 45 | --------------------------------------------------------------------------------------- 46 | + Initial public release. 47 | 48 | -------------------------------------------------------------------------------- /vim-support/rc/custom.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Custom Templates 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § A template definition is build like this: 7 | § == Menu.some name == <options> == 8 | § <inserted code> 9 | § == Menu.other name == <options> == 10 | § <inserted code> 11 | § == ENDTEMPLATE == 12 | § A template ends with the line "== ENDTEMPLATE ==" or with 13 | § the start of a new template. 14 | § ------------------------------------------------------------- 15 | 16 | § ------------------------------------------------------------- 17 | § Function Description 18 | § ------------------------------------------------------------- 19 | 20 | § uncomment and edit to customize 21 | 22 | §== Comments.function == map:cfu, sc:f == 23 | §"=== FUNCTION ================================================================ 24 | §" NAME: |?FUNCTION_NAME| {{{1 25 | §" DESCRIPTION: <CURSOR> 26 | §" PARAMETERS: -|PARAMETERS:EMPTY| 27 | §" PARAMETERS: |PARAMETERS:FIRST| - {+DESCRIPTION+} 28 | §" |PARAMETERS:ENTRY| - {+DESCRIPTION+} 29 | §" RETURNS: 30 | §"=============================================================================== 31 | §== ENDTEMPLATE == 32 | 33 | § ------------------------------------------------------------- 34 | § Function Definition 35 | § ------------------------------------------------------------- 36 | 37 | § uncomment and edit to customize 38 | 39 | §== Idioms.function == map:if, sc:f == 40 | §function! |?FUNCTION_NAME| (<CURSOR>) 41 | § <SPLIT><-FUNCTION_BODY-> 42 | § return 43 | §endfunction " ---------- end of function |FUNCTION_NAME| ---------- 44 | §== ENDTEMPLATE == 45 | 46 | -------------------------------------------------------------------------------- /vim-support/rc/custom_with_personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Template Customization 3 | § ============================================================= 4 | 5 | § ============================================================= 6 | § Personal Information 7 | § 8 | § - overwrites the information in the template personalization 9 | § file, because these commands are read later 10 | § ============================================================= 11 | 12 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 13 | SetMacro( 'AUTHORREF', '' ) 14 | SetMacro( 'EMAIL', '' ) 15 | SetMacro( 'ORGANIZATION', '' ) 16 | SetMacro( 'COMPANY', '' ) 17 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 18 | SetMacro( 'LICENSE', 'GNU General Public License' ) 19 | 20 | § ============================================================= 21 | § Date and Time Format 22 | § ============================================================= 23 | 24 | §SetFormat( 'DATE', '%x' ) 25 | §SetFormat( 'TIME', '%H:%M' ) 26 | §SetFormat( 'YEAR', '%Y' ) 27 | 28 | § ============================================================= 29 | § Custom Templates 30 | § ============================================================= 31 | 32 | § ------------------------------------------------------------- 33 | § A template definition is build like this: 34 | § == Menu.some name == <options> == 35 | § <inserted code> 36 | § == Menu.other name == <options> == 37 | § <inserted code> 38 | § == ENDTEMPLATE == 39 | § A template ends with the line "== ENDTEMPLATE ==" or with 40 | § the start of a new template. 41 | § ------------------------------------------------------------- 42 | 43 | § ------------------------------------------------------------- 44 | § Function Description 45 | § ------------------------------------------------------------- 46 | 47 | § uncomment and edit to customize 48 | 49 | §== Comments.function == map:cfu, sc:f == 50 | §"=== FUNCTION ================================================================ 51 | §" NAME: |?FUNCTION_NAME| {{{1 52 | §" DESCRIPTION: <CURSOR> 53 | §" PARAMETERS: -|PARAMETERS:EMPTY| 54 | §" PARAMETERS: |PARAMETERS:FIRST| - {+DESCRIPTION+} 55 | §" |PARAMETERS:ENTRY| - {+DESCRIPTION+} 56 | §" RETURNS: 57 | §"=============================================================================== 58 | §== ENDTEMPLATE == 59 | 60 | § ------------------------------------------------------------- 61 | § Function Definition 62 | § ------------------------------------------------------------- 63 | 64 | § uncomment and edit to customize 65 | 66 | §== Idioms.function == map:if, sc:f == 67 | §function! |?FUNCTION_NAME| (<CURSOR>) 68 | § <SPLIT><-FUNCTION_BODY-> 69 | § return 70 | §endfunction " ---------- end of function |FUNCTION_NAME| ---------- 71 | §== ENDTEMPLATE == 72 | 73 | -------------------------------------------------------------------------------- /vim-support/rc/personal.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Personal Information 3 | § ============================================================= 4 | 5 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 6 | SetMacro( 'AUTHORREF', '' ) 7 | SetMacro( 'EMAIL', '' ) 8 | SetMacro( 'ORGANIZATION', '' ) 9 | SetMacro( 'COMPANY', '' ) 10 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 11 | SetMacro( 'LICENSE', 'GNU General Public License' ) 12 | 13 | § ============================================================= 14 | § Date and Time Format 15 | § ============================================================= 16 | 17 | §SetFormat( 'DATE', '%x' ) 18 | §SetFormat( 'TIME', '%H:%M' ) 19 | §SetFormat( 'YEAR', '%Y' ) 20 | 21 | -------------------------------------------------------------------------------- /vim-support/rc/vim.vim: -------------------------------------------------------------------------------- 1 | " ------------------------------------------------------------------------------ 2 | " 3 | " Vim filetype plugin file 4 | " 5 | " Language : VimL / VimScript 6 | " Plugin : vim-support.vim 7 | " Revision : 12.10.2017 8 | " Maintainer : Wolfgang Mehner <wolfgang-mehner@web.de> 9 | " 10 | " ------------------------------------------------------------------------------ 11 | 12 | " Only do this when not done yet for this buffer 13 | if exists("b:did_vim_support_ftplugin") 14 | finish 15 | endif 16 | let b:did_vim_support_ftplugin = 1 17 | 18 | " ---------- Set "maplocalleader" as configured using "g:Vim_MapLeader" ----- 19 | call Vim_SetMapLeader () 20 | 21 | " maps defined here will use "g:Vim_MapLeader" as <LocalLeader> 22 | " example: 23 | "map <buffer> <LocalLeader>eg :echo "Example Map :)"<CR> 24 | 25 | " ---------- Keyword help ---------------------------------------------------- 26 | 27 | if has( 'gui_running' ) 28 | nmap <buffer> <S-F1> <Plug>VimSupportKeywordHelp 29 | imap <buffer> <S-F1> <Plug>VimSupportKeywordHelp 30 | else 31 | " <SHIFT-F1> is problematic in the terminal 32 | nmap <buffer> <F1> <Plug>VimSupportKeywordHelp 33 | imap <buffer> <F1> <Plug>VimSupportKeywordHelp 34 | endif 35 | " these maps have to remap, do not use nnoremap 36 | 37 | " ---------- Reset "maplocalleader" ------------------------------------------ 38 | call Vim_ResetMapLeader () 39 | 40 | -------------------------------------------------------------------------------- /vim-support/templates/Templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Interface Version 3 | § 4 | § enable advanced features 5 | § ============================================================= 6 | 7 | InterfaceVersion ( '1.0' ) 8 | 9 | § ============================================================= 10 | § Settings 11 | § ============================================================= 12 | 13 | SetMacro( 'AUTHOR', 'YOUR NAME' ) 14 | SetMacro( 'AUTHORREF', '' ) 15 | SetMacro( 'EMAIL', '' ) 16 | SetMacro( 'ORGANIZATION', '' ) 17 | SetMacro( 'COMPANY', '' ) 18 | SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' ) 19 | SetMacro( 'LICENSE', 'GNU General Public License' ) 20 | 21 | SetFormat( 'DATE', '%x' ) 22 | SetFormat( 'TIME', '%X' ) 23 | SetFormat( 'YEAR', '%Y' ) 24 | 25 | § pretty dates: 26 | § - DATE_PRETTY1 is a nicer date formatting, such as "January 06 2016" 27 | § - DATE_PRETTY2 is a shorter version, such as "Jan 06 2016" 28 | SetFormat( 'DATE_PRETTY1', '%B %d %Y' ) 29 | SetFormat( 'DATE_PRETTY2', '%b %d %Y' ) 30 | 31 | SetStyle( 'default' ) 32 | 33 | § ============================================================= 34 | § File Includes and Shortcuts 35 | § ============================================================= 36 | 37 | MenuShortcut( 'Comments', 'c' ) 38 | MenuShortcut( 'Statements', 's' ) 39 | MenuShortcut( 'Idioms', 'i' ) 40 | MenuShortcut( 'Regex', 'x' ) 41 | MenuShortcut( 'Perl', 'p' ) 42 | MenuShortcut( 'Documentation', 'd' ) 43 | 44 | IncludeFile( 'comments.templates' ) 45 | IncludeFile( 'statements.templates' ) 46 | IncludeFile( 'idioms.templates' ) 47 | IncludeFile( 'regex.templates' ) 48 | IncludeFile( 'perl.templates' ) 49 | IncludeFile( 'documentation.templates' ) 50 | 51 | § ============================================================= 52 | § Help 53 | § ============================================================= 54 | 55 | SetMacro( 'HelpPathEnglish', 'http://en.wiktionary.org/wiki/' ) 56 | 57 | == HELP: Help.English == map:he, sc:e == 58 | |Word( '' )| 59 | |Substitute( '\W', '', 'g' )| 60 | |Browser( '|HelpPathEnglish||PICK:l|' )| 61 | == ENDTEMPLATE == 62 | -------------------------------------------------------------------------------- /vim-support/templates/idioms.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Idioms 3 | § ============================================================= 4 | 5 | IncludeFile( 'functions.templates' ) 6 | 7 | == LIST: idioms_iterators == hash == 8 | 'dict, keys' : 'key in keys( <+DICT+> )', 9 | 'dict, key+val' : '[ key, val ] in items( <+DICT+> )', 10 | 'dict, values' : 'val in values( <+DICT+> )', 11 | 'file' : 'line in readfile( <+NAME+> )', 12 | 'list' : 'val in <+LIST+>', 13 | 'range' : 'i in range( <+A+>, <+B+> )', 14 | 'string, split' : 'part in split( <+STRING+>, <+SEP+> )', 15 | == ENDLIST == 16 | 17 | == Idioms.builtin functions == insert, map:ib, sc:b == 18 | |PickList( 'builtin function', 'builtin_functions' )| 19 | <CURSOR>|KEY| ( |VALUE| ) 20 | == Idioms.iterators == expandmenu, map:ii, sc:i == 21 | |PickList( 'iterate over', 'idioms_iterators' )| 22 | for <CURSOR>|PICK| 23 | <SPLIT><-LOOP_BODY-> 24 | endfor 25 | == Idioms.function == map:if, sc:f == 26 | function! |?FUNCTION_NAME| (<CURSOR>) 27 | <SPLIT><-FUNCTION_BODY-> 28 | return 29 | endfunction " ---------- end of function |FUNCTION_NAME| ---------- 30 | == ENDTEMPLATE == 31 | 32 | -------------------------------------------------------------------------------- /vim-support/templates/perl.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Perl 3 | § ============================================================= 4 | 5 | == Perl.Perl snippet == below, noindent, map:ps, sc:s == 6 | perl << EOF 7 | # ========== Perl-Code Begin =============================================== 8 | <CURSOR> 9 | # ========== Perl-Code End =============================================== 10 | EOF 11 | == Perl.VIM DoCommand == map:pd, sc:d == 12 | VIM::DoCommand( <CURSOR> ); 13 | == Perl.VIM Eval == map:pe, sc:e == 14 | ( $success, $<CURSOR> ) = VIM::Eval( '<+VIM_EXPRESSION+>' ); 15 | == Perl.VIM Msg == map:pm, sc:m == 16 | VIM::Msg( "<CURSOR>" ); 17 | == Perl.VIM Msg-Comment == map:pmc, sc:c == 18 | VIM::Msg( "<CURSOR>", "Comment" ); 19 | == Perl.VIM Msg-ErrorMsg == map:pme, sc:e == 20 | VIM::Msg( "<CURSOR>", "ErrorMsg" ); 21 | == Perl.VIM Msg-Warning == map:pmw, sc:w == 22 | VIM::Msg( "<CURSOR>", "Warning" ); 23 | == ENDTEMPLATE == 24 | 25 | § ------------------------------------------------------------- 26 | § Buffer and Window 27 | § ------------------------------------------------------------- 28 | 29 | == SEP: Perl.sep1 == 30 | 31 | == Perl.curbuf Count == insert, sc:c == 32 | $curbuf->Count() 33 | == Perl.curbuf Name == insert, sc:n == 34 | $curbuf->Name() 35 | == Perl.curbuf Number == insert, sc:n == 36 | $curbuf->Number() 37 | == Perl.curbuf Append == insert, sc:a == 38 | $curbuf->Append( <CURSOR><+LINE_NUMBER+>, <+SCALAR_OR_ARRAY+> ) 39 | == Perl.curbuf Delete == insert, sc:d == 40 | $curbuf->Delete( <CURSOR><+LINE_NUMBER+>, <+LAST_LINE+> ) 41 | == Perl.curbuf Get == insert, sc:g == 42 | $curbuf->Get( <CURSOR><+LINE_NUMBER+> ) 43 | == Perl.curbuf Set == insert, sc:s == 44 | $curbuf->Set( <CURSOR><+LINE_NUMBER+>, <+SCALAR_OR_ARRAY+> ) 45 | == Perl.curwin Cursor get == insert, sc:c == 46 | ( $row, $col ) = $curwin->Cursor(); 47 | == Perl.curwin Cursor set == insert, sc:c == 48 | $curwin->Cursor( $row, $col ); 49 | == ENDTEMPLATE == 50 | 51 | -------------------------------------------------------------------------------- /vim-support/templates/regex.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Regex 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § Resource 7 | § ------------------------------------------------------------- 8 | 9 | == LIST: regex_character_classes == hash == 10 | 'identifier char.' : '\i', 11 | 'keyword char.' : '\k', 12 | 'filename char.' : '\f', 13 | 'printable char.' : '\p', 14 | 'whitespace' : '\s', 15 | 'digit' : '\d', 16 | 'digit, hex' : '\x', 17 | 'digit, octal' : '\o', 18 | 'word char.' : '\w', 19 | 'word char., head of word' : '\h', 20 | 'alphabetic char.' : '\a', 21 | 'lowercase char.' : '\l', 22 | 'uppercase char.' : '\u', 23 | == LIST: regex_switches == hash == 24 | 'very magic' : '\v', 25 | 'magic' : '\m', 26 | 'nomagic' : '\M', 27 | 'very nomagic' : '\V', 28 | 'ignore case' : '\c', 29 | 'match case' : '\C', 30 | == ENDLIST == 31 | 32 | § ------------------------------------------------------------- 33 | § Templates 34 | § ------------------------------------------------------------- 35 | 36 | == Regex.capture == insert, map:xc, sc:c == 37 | \(<SPLIT><CURSOR>\) 38 | == Regex.branch == insert, map:xbc, sc:b == 39 | \(<SPLIT><CURSOR>\|\) 40 | == Regex.branch, no capture == insert, map:xbn, sc:b == 41 | \%(<SPLIT><CURSOR>\|\) 42 | == Regex.collection == insert == 43 | [<CURSOR>] 44 | == ENDTEMPLATE == 45 | 46 | == Regex.word == insert, map:xw, sc:w == 47 | \<<SPLIT><CURSOR>\> 48 | == ENDTEMPLATE == 49 | 50 | == Regex.character classes == expandmenu, expandright:value, insert, map:xcc, sc:l == 51 | |PickList( 'character class', 'regex_character_classes' )| 52 | |PICK|<CURSOR> 53 | == Regex.switches == expandmenu, expandright:value, insert, map:xs, sc:s == 54 | |PickList( 'switch', 'regex_switches' )| 55 | |PICK|<CURSOR> 56 | == ENDTEMPLATE == 57 | 58 | -------------------------------------------------------------------------------- /vim-support/templates/statements.templates: -------------------------------------------------------------------------------- 1 | § ============================================================= 2 | § Statements 3 | § ============================================================= 4 | 5 | § ------------------------------------------------------------- 6 | § Assignment 7 | § ------------------------------------------------------------- 8 | 9 | == Statements.let variable == map:sv, sc:v == 10 | let <CURSOR> = <+VAL+> 11 | == Statements.let list == map:sl, sc:l == 12 | let <CURSOR> = [ <+VAL+>, <+VAL+> ] 13 | == Statements.let dictionary == map:sd, sc:d == 14 | let <CURSOR> = { 15 | \ <+KEY+> : <+VAL+>, 16 | \ <+KEY+> : <+VAL+>, 17 | \ <+KEY+> : <+VAL+>, 18 | \ } 19 | == ENDTEMPLATE == 20 | 21 | § ------------------------------------------------------------- 22 | § Control 23 | § ------------------------------------------------------------- 24 | 25 | == SEP: Statements.sep1 == 26 | 27 | == Statements.for == map:sf, sc:f == 28 | for <CURSOR> in <+LIST+> 29 | <SPLIT><-LOOP_BODY-> 30 | endfor 31 | == Statements.if, end == map:sif, sc:i == 32 | if <CURSOR> 33 | <SPLIT><-IF_PART-> 34 | endif 35 | == Statements.if, else == map:sie, sc:i == 36 | if <CURSOR> 37 | <SPLIT><-IF_PART-> 38 | else 39 | <+ELSE_PART+> 40 | endif 41 | == Statements.elseif == map:sei, sc:e == 42 | elseif <CURSOR> 43 | <+ELSEIF_PART+> 44 | == Statements.else == map:sel, sc:e == 45 | else 46 | <CURSOR> 47 | == Statements.while == map:sw, sc:w == 48 | while <CURSOR> 49 | <SPLIT><-LOOP_BODY-> 50 | endwhile 51 | == ENDTEMPLATE == 52 | 53 | § ------------------------------------------------------------- 54 | § Exception Handling 55 | § ------------------------------------------------------------- 56 | 57 | == Statements.try, catch == map:st, sc:t == 58 | try 59 | <CURSOR><SPLIT> 60 | catch // 61 | catch /.*/ 62 | echo "Internal error (" . v:exception . ")" 63 | echo " - occurred at " . v:throwpoint 64 | finally 65 | endtry 66 | == ENDTEMPLATE == 67 | 68 | --------------------------------------------------------------------------------