KRL-Syntax : Syntax, indent and more for Kuka industrial robots
| script karma
Downloaded by 943
Comments, bugs, improvements
script versions (upload new version)
|Now available on github: https://github.com/KnoP-01/krl-for-vim
KRL for Vim (7.4 or later) is a collection of Vim scripts to help programing
KUKA industrial robots.
* syntax highlighting,
* auto indention,
* folding (case sensitive),
* mappings and settings to navigate through code in a backup folder structure
* mappings to insert a body of a new DEF, DEFFCT and DEFDAT based on user
defined templates or hopefully sane defaults.
Most of this is optional, though some things are default on. Have a look in
the krl-options section in the help for more details.
Maybe the most confusing thing which is default on is the inclusion of $, #
and & into 'iskeyword'. This makes e.g. $ov_pro, #initmov and &comment a
"word" for commands like `w`, `e` and the like. This was probably a bad design
decision, but it is as it is now. It's optional (g:krlNoKeyWord) anyway. Maybe
in the next major release the default will change.
KRL for Vim supports VKRC files. Folding will get optimized for VKRC. Also try
the gd mapping on a fold line with SPSMAKRO, UP or Marker. Editing is still
almost impossible, this is moslty useful for viewing.
Note: Keep your files to be edited in one folder or in a regular robot
backup folder structure. KRL for Vim modifies 'path' by default accordingly.
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.
## Content description
You may use all these independently from one another. Just don't mix versions
of different releases. Some features may work better when all files are loaded.
Help file. This should help you to use these plugins to your best advantage.
You may want to look into the help prior to installation.
Detects KRL files based on their file name ending .src, .dat and .sub. To not
interfere with other file types, .dat files are checked for the presence of a
DEFDAT line or any &HEADER.
Sets various vim options and provides key mappings and folding. It supports
commentary [vimscript #3695] and matchit [vimscript #39]. All key
mappings are optional.
:filetype plugin on
Sets indent related vim options. Sets indention to 2 spaces by default,
:filetype indent on
Does make life more colorful. Unfortunately some features of the other files
may work better with syntax on. This should not stop you from trying syntax
off if you like.
Q: Why so many options?
A: I try not to interfere with user settings to much. So I made most of the
settings that get changed optional.
Q: I'm here to feed my kids, not to read. Do you have a quick suggestion on
krl settings for my |.vimrc|?
A: Yes: >
let g:krlMoveAroundKeyMap=1 " [[, ]],  and ][ jumps around DEF/DEFFCT..
let g:krlGoDefinitionKeyMap=1 " gd shows the declaration of curr. word
let g:krlListDefKeyMap=1 " <leader>f shows all DEF/DEFFCT.. in curr. file
let g:krlListUsageKeyMap=1 " <leader>u shows all appearance of curr. word
let g:krlAutoFormKeyMap=1 " <leader>n inserts a body for a new DEF etc
let g:krlShowError=1 " shows some syntax errors
let g:krlRhsQuickfix=1 " open quickfix window on the right hand side
let g:qf_window_bottom=0 " if qf.vim exists and you use g:krlRhsQuickfix
" if you want all folds to close (case sensitiv)...
let g:krlCloseFolds=1 " switch folding to all
" or else if you don't like any closed folds use:
" let g:krlCloseFolds=2 " switch folding off
" let g:krlNoVerbose=1 " get rid of the messages
" if you use colorscheme tortus use:
" let g:krlNoHighLink=1 " even more colors
" don't forget
" filetype plugin indent on
## Self promotion
If you like this plugin please rate it. If you don't but you
think it could be useful if this or that would be different, don't hesitate to
email me or even better open an issue on github. With a little luck and good
timing you may find me on irc://irc.freenode.net/#vim as KnoP in case you have any
If you need assistance with your robot project visit http://www.graeff.de
|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.
To fully use these scripts put >
filetype plugin indent on
in your .vimrc
You may have to run >
to use the help within Vim after installation.
Click on the package to download.
ip used for rating: 22.214.171.124
||* 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
||* 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
||* 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
||* 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 chName() )
||* fixed bug in matchit (vimscript #39) support
||* 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
||* changes in help file
||* 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
||* 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
||* added option (g:krlShowError) to highlight some misuses of =, ==, <= and >=
* added ENABLE/DISABLE (interrupt enable ..) to keywords
||* added help
* added file type detect
* added file type plugin
* added indent file
* made the script configurable by options
* minor changes in syntax file
||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.
* 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