sponsor Vim development Vim logo Vim Book Ad

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

 script karma  Rating 16/4, Downloaded by 881    Comments, bugs, improvements  Vim wiki

created by
Patrick Meiser-Knosowski
 
script type
syntax
 
description
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.

It provides

* syntax highlighting,
* auto indention,
* folding (case sensitive),
* mappings and settings to navigate through code in a backup folder structure
  and
* mappings to insert a body of a new def(fct?) 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.

It supports VKRC files. Folding will get optimized for VKRC. Also try the gd
mapping on a fold line with SPSMAKRO, UP or Marker.

Note: Keep your files to be edited below the `KRC/` folder if you plan to edit
lots of files. This folder will be the root for 'path'.
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

    ~/.vim/doc/krl.txt
    ~/.vim/ftdetect/krl.vim
    ~/.vim/ftplugin/krl.vim
    ~/.vim/indent/krl.vim
    ~/.vim/syntax/krl.vim

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.

#### ~/.vim/doc/krl.txt
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.  
Requires >

    :helptags ~/.vim/doc
  
  
#### ~/.vim/ftdetect/krl.vim
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.  
Requires >

    :filetype on
  
  
#### ~/.vim/ftplugin/krl.vim
Sets various vim options and provides key mappings and folding. It supports
commentary [vimscript #3695][7] and matchit [vimscript #39][8]. All key
mappings are optional.  
Requires >

    :filetype plugin on
  
  
#### ~/.vim/indent/krl.vim
Sets indent related vim options. Sets indention to 2 spaces by default,
optional.  
Requires >

    :filetype indent on
  
  
#### ~/.vim/syntax/krl.vim
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.  
Requires >

    :syntax on
  
  
## tl:dr

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 if you have any
questions.
If you need assistance with your robot project visit http://www.graeff.de
 
install details
Extract the most recent release archive into your `~/.vim/` or
`%USERPROFILE%\vimfiles\` directory (depending on your System) keeping the
folder structure. Overwrite krl.\* files from older installation.

To fully use these scripts put >

    filetype plugin indent on
    syntax on

in your .vimrc

You may have to run >

    :helptags ~/.vim/doc/

or >

    :helptags ~/vimfiles/doc/

to use the help within Vim after installation.
 

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-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: 54.162.139.105

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.
   
SourceForge.net Logo