sponsor Vim development Vim logo Vim Book Ad

KRL-Syntax : Syntax, indent and more for Kuka industrial robots

 script karma  Rating 75/24, Downloaded by 6070  Comments, bugs, improvements  Vim wiki

created by
Patrick Meiser-Knosowski
script type
KRL for Vim (7.4 to 8.x) is a collection of Vim scripts to help programing KUKA industrial robots (https://www.kuka.com/en-de/products/robot-systems/industrial-robots).

It provides

*    syntax highlighting,
*    indenting,
*    folding,
*    support for commentary vimscript #3695, matchit vimscript #39 and matchup vimscript #5624,
*    mappings and settings to navigate through code in a backup folder structure,
*    text objects for functions and folds,
*    optimized folding and concealing for viewing VRKC and
*    completion of words from known or custom global files like $config.dat,
*    mappings to insert a body of a new DEF, DEFFCT or DEFDAT based on user defined templates or hopefully sane defaults.

Note: Keep your files to be edited in one folder or in a regular robot backup folder structure. KRL for Vim modifies 'path' accordingly. Since version 2.0.0 KRC1 backups are supported too.
Note to Linux users: Keep your files to be edited on a FAT file system. Some features need the case insensitive file system to work properly.

See https://github.com/KnoP-01/krl-for-vim#FAQ on how to use more than just highlight and indent.
install details
### Installation with vim-plug:  ~
Put this in your .vimrc:  >

    call plug#begin('~/.vim/plugged')
      Plug 'KnoP-01/krl-for-vim'
    call plug#end()
    syntax off                        " undo what plug#begin() did to syntax
    filetype plugin indent off  " undo what plugin#begin() did to filetype
    syntax on                        " syntax and filetype on in that order
    filetype plugin indent on  " syntax and filetype on in that order

For the first installation run: >


Update every once in a while with: >


### Manual installation:  ~
Extract the most recent release and copy the folders `/doc`, `/ftdetect`, `/ftplugin`, `/indent` and `/syntax`  into your `~/.vim/` or `%USERPROFILE%\vimfiles\` directory. Overwrite krl.* files from older installation.
Put the following in your .vimrc: >

    syntax on                        " syntax and filetype on in that order
    filetype plugin indent on  " syntax and filetype on in that order

You may have to run >

    :helptags ~/.vim/doc/

or >

    :helptags ~/vimfiles/doc/

to use the help within Vim after installation. >

    :help krl

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
krl-for-vim-2.2.9.zip v2.2.9 2023-01-11 7.4 Patrick Meiser-Knosowski * List use on enum name skipped enum declaration and some more minor fixes
krl-for-vim-2.2.6.zip v2.2.6 2022-01-05 7.4 Patrick Meiser-Knosowski * Fix: Catch E479
* Add 'bin' and 'binin' to be highlighted in folds
krl-for-vim-2.2.5.zip v2.2.5 2021-12-24 7.4 Patrick Meiser-Knosowski * Fix g:krlKeyWord usage
* Make Go Definition for vkrc binin case insensitive
* Use quickfixtextfunc instead of temp file
* Raise chars of shortened path in quickfix window from 3 to 5 for
* Use argument for bufnr(), compatiblity with vim <=8.1
* Add missing safe robot build in functions
* Refactor 'path' generation
* Enable spell checking only for comments and strings
* Highlight more stuff in fold lines, especially, but not only, for Vkrc
* Fix integer highlight
krl-for-vim-2.2.2.zip v2.2.2 2020-12-16 7.4 Patrick Meiser-Knosowski * Fix BRAKE highlight
* Fix setlocal foldmethod=marker if syntax is off
* Fix Indent and Auto Form: Accept $ as first character of DEF names
* Fix Auto Form: Don't add GLOBAL if new body starts at line 1
* Fix case sensitivity of file name extentions
* Fix bug in Fold Text Object
* Feature for folding mappings: Enable those mappings (default F2-F4)
  also if g:krlFoldLevel is equal to 0
* Feature for Endwise: Automatically detect upper/lower case
  (abandoning g:krlEndwiseUpperCase)
* Feature for List Usage: List ENUM values in their declaration
* Feature for Go To Definition: Make look up for definition on ENUM
  values possible
krl-for-vim-2.1.2.zip 2.1.2 2020-01-17 7.4 Patrick Meiser-Knosowski * fix bug where gd does not always work on global def/deffct (appeared in Vim version 8.2)
krl-for-vim-2.1.1.zip 2.1.1 2019-12-14 7.4 Patrick Meiser-Knosowski *    add missing KSS functions
*    add $config.dat etc to 'complete', customizable (see :help krl-complete)
krl-for-vim-2.0.1.zip 2.0.1 2019-10-22 7.3 Patrick Meiser-Knosowski * Fix bug where unnamed buffers are created for each use of gd, <leader>f and <leader>u
* Fix fold text object
* Clarifications and fixes in documentation
krl-for-vim-2.0.0.zip 2.0.0 2019-04-29 7.4 Patrick Meiser-Knosowski * enable most features by default
* change default fold method to syntax to make it case insensitive
* add text objects for DEF/DEFFCT, folds and comment blocks
* [[, [], ... work in operator pending mode
* add support of KRC1 archives
krl-for-vim-1.5.5.zip 1.5.5 2017-12-08 7.4 Patrick Meiser-Knosowski * added more spline instructions
* added kss functions and data types
* highlight of vars and funcs >24 chars as error
* highlight of "interrupt <prio> on" as error
* fixed minor highlight bug
krl-for-vim-1.5.2.zip 1.5.2 2017-11-04 7.4 Patrick Meiser-Knosowski * changed highlight to highlight default in syntax file
* added channel to data types for gd
* fixed bug in ftdetext where a defdat was not recognized when there where two spaces between defdat and the name
* made KrlFormatComments() global again
* changes in help file
krl_for_vim_v151_20170813.zip 1.5.1 2017-08-13 7.4 Patrick Meiser-Knosowski * better path generation
* better temp file handling. Sorry to all linux/unix users for inconvenience with this one.
* made this script compatible to romainls vim-qf (vimscript#5211)
* fixed some minor bugs
krl_for_vim_v150_20170624.zip 1.5.0 2017-06-24 7.0 Patrick Meiser-Knosowski * improved vkrc support:
  * Go Definition now works on UP\d+, SPSMAKRO\d+ and M\d+ in fold lines
  * improved List Usage for vkrc
* fixed Go Definition for comma separated none value declarations in *.dat files
* fixed e6pos return var name in Auto Form
* fixed array function in Auto Form (e.g. deffct char[24] chName() )
krl_for_vim_v145_20170215.zip 1.4.5 2017-02-15 7.0 Patrick Meiser-Knosowski * fixed bug in matchit (vimscript #39) support
krl_for_vim_v144_20161128.zip 1.4.4 2016-11-28 7.0 Patrick Meiser-Knosowski * divided up mappings for <leader>f and gd into 2 options: g:krlListDefKeyMap and g:krlGoDefinitionKeyMap
* added option to influence where <leader>f and gd open the quickfix window: g:krlRhsQuickfix and g:krlLhsQuickfix
* added <plug> mappings as an alternative to the configuration variables for mappings
* minor changes in syntax file
* added auto form feature. Insert a body for a new deffct with a few key strokes. See help for more details on this
* added mapping <leader>u to list all appearances of the word under the cursor if g:krlListUsageKeyMap is set
krl_for_vim_v138_20161008.zip 1.3.8 2016-10-09 7.0 Patrick Meiser-Knosowski * changes in help file
krl_for_vim_v138_20161005.zip 1.3.8 2016-10-06 7.0 Patrick Meiser-Knosowski * set proper b:undo_indent and b:undo_ftplugin
* added matchit support (vimscript #39)
* added mappings for [[, ]], ... and gd if g:krlGoDefinitionKeyMap is set
* added 'path', 'suffixes' and 'suffixesadd' settings for :find or gf
* added 'iskeyword' to match $-variables and #-enums
* changed option name from g:krlNoHighlight to g:krlNoHighLink (the old one does still work for compatibility)
From 1.3.6 to 1.3.8
* reorganized 'path' for better search results of gd, :find ...
* optimized KrlGoDefinition()
* made embedded $ chars in variable names possible for gd. Embedded $ chars in DEF or DEFFCT names do still not work
* less noise if g:krlNoVerbose is set
* additions to syntax
* added mapping of <leader>f to list all DEF and DEFFCT of the current file if g:krlGoDefinitionKeyMap is set
krl_for_vim_v124_20160727.zip 1.2.4 2016-07-27 7.0 Patrick Meiser-Knosowski * fixed a bug where this script caused an error message about a missing function in some installations of vim
* added new highlight group Continue to be able to highlight continue instructions separately if g:krlNoHighlight is set
* this script now setlocal commentstring=;%s for easy use of commentary (vimscript #3695)
* restructured code
krl_for_vim_v120_20160604.zip 1.2.0 2016-06-03 7.0 Patrick Meiser-Knosowski * added option (g:krlShowError) to highlight some misuses of =, ==, <= and >=
* added ENABLE/DISABLE (interrupt enable ..) to keywords
krl_for_vim_v113_20160524.zip 1.1.3 2016-05-24 7.0 Patrick Meiser-Knosowski * added help
* added file type detect
* added file type plugin
* added indent file
* made the script configurable by options
* minor changes in syntax file
krl.vim 1.1.1 2016-04-15 7.0 Patrick Meiser-Knosowski I think I'm getting closer to how a syntax file is supposed to be done. I changed to much to list here. Depending on your colorscheme it might not look very different.
Main changes:
* fixed false highlighting for structure component names
* added more predefined enums and structures, also from some basic tech packages (BasisTech, GripperTech, SpotTech...)
* enum values are now considered Constant (no need for "highlight Enum ..." any more)
* devided stuff into sub groups
* added some missing build in functions
krl.vim 0.9 2016-03-07 7.0 Patrick Meiser-Knosowski Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.