nvim-rpgle/doc/rpgle.txt

180 lines
5.1 KiB
Plaintext
Raw Normal View History

2023-07-31 09:22:36 +02:00
*rpgle.txt* Free-Form ILE RPG
Author: Andreas Louv <andreas@louv.dk>
License: Same terms as Vim itself (see |license|)
INTRODUCTION *ft-rpgle*
This bundle provides syntax highlighting, syntax folds, auto indent, more
match words as well as mapping a few sensible keys.
VARIABLES *ft-rpgle-variables*
*g:rpgle_indentStart*
`g:rpgle_indentStart` Set the number of leading spaces that should be used
when no previous line is to be accounted for.
*g:rpgle_skipMapping*
`g:rpgle_skipMapping` Set to |v:true| to disable mappings defined in
|ft-rpgle-movements|, |ft-rpgle-operator-pending|
*g:rpgle_spellString*
`g:rpgle_spellString` Set to |v:false| to disable spell checking in string
constants.
FILETYPE DETECT *ft-rpgle-detect*
File ending with ".rpgle" and ".rpgleinc" are detected as ILE RPG files.
INDENT *ft-rpgle-indent*
Enable by adding the following to your |vimrc| >
:filetype indent on
<
SYNTAX *ft-rpgle-syntax*
Enable by adding the following to your |vimrc| >
:syntax enable
<
SYNTAX FOLDS *ft-rpgle-fold*
Settings |foldmethod| to 'syntax' to enable the following folds: >
if -> endif
dow -> enddo
dou -> enddo
for -> endfor
select -> endsl
dcl-proc -> end-proc
begsr -> endsr
<
MATCH WORDS *ft-rpgle-match-words*
Enable by adding the following to your |vimrc| >
:packadd! matchit
<
The following match words is supported: >
select -> when -> other -> endsl
if -> elseif -> else -> endif
dow -> iter -> leave -> enddo
dou -> iter -> leave -> enddo
for -> iter -> leave -> endfor
begsr -> endsr
dcl-proc -> return -> end-proc
dcl-pi -> end-pi
dcl-pr -> end-pr
monitor -> on-error -> endmon
<
MOVEMENTS *ft-rpgle-movements*
Enable by adding the following to your |vimrc| >
:filetype on
<
*ft-rpgle-[[*
[[ Jump to previous dcl-proc keyword
*ft-rpgle-]]*
]] Jump to next dcl-proc keyword
*ft-rpgle-[]*
[] Jump to previous end-proc keyword
*ft-rpgle-][*
][ Jump to next end-proc keyword
*ft-rpgle-gd*
gd Goto local Declaration. When the cursor is on a local
variable, this command will jump to its declaration.
Use |gD| to goto global declaration.
*ft-rpgle-[{*
[{ Jump back to the block opener at the start of the
current code block, i.e. pressing |[{| inside an
if-statement will jump to the if keyword.
*ft-rpgle-]}*
]} Jump forward to the block closer at the end of the
current code block, i.e. pressing |]}| inside an
if-statement will jump to the endif keyword.
OPERATOR PENDING *ft-rpgle-operator-pending*
Enable by adding the following to your |vimrc| >
:filetype on
<
a} *ft-rpgle-a}* *ft-rpgle-a{*
a{ *ft-rpgle-aB*
aB See |aB|
i} *ft-rpgle-i}* *ft-rpgle-i{*
i{ *ft-rpgle-iB*
iB See |iB|
INCLUDE *ft-rpgle-include*
'include' is set to match "/include" and "/copy". ".rpgle" and ".rpgleinc" is
added when following files with |gf|, or when searching included files with
|[I| and friends.
'includeexpr' is set to replace a "," with ".file/" i.e. >
/include myfile,mymbr -> myfile.file/mymbr.rpgleinc
<
It can be beneficial to setup 'path' accordantly: >
setlocal path=~/.cache/rpgleinc/qrpglesrc.file,~/.cache/rpgleinc
< And then download all headers to the respective directories inside
"~/.cache/rpgleinc".
I.e the header called "myhdr" located in "qrpglesrc" should be saved as
"~/.cache/rpgleinc/qrpglesrc.file/myhdr.rpgle".
One can use dd to download the files, i.e: >
$ dd if=/mnt_dir/QSYS.LIB/MY_LIB.LIB/QRPGLESRC.FILE/MYHDR.MBR \
of=~/.cache/rpgleinc/qrpglesrc.file/myhdr.rpgleinc \
bs=120 \
cbs=120 \
conv=ascii
<
Where 120 is the width of the header.
OMNI COMPLETION *ft-rpgle-omni*
Omni completion for compiler directives and header, declaration, calculation
and procedure specifications.
Omni completion can be called with |i_CTRL-X_CTRL-O|
OMNI COMPILER DIRECTIVES *ft-rpgle-omni-compdir*
A file found via 'path' will be suggested for "/copy" and "/include".
Only files ending with ".rpgleinc" and ".mbr" will be suggested.
Directories ending in ".file" will be preserved, with the exception of a
directory called "qrpglesrc.file" which will be removed. >
directory.file/file.mbr -> directory,file
qrpglesrc.file/file.mbr -> file
<
See |ft-rpgle-inclue| for a solution to downloading ILE RPG header files.
OMNI HEADER SPECIFICATION *ft-rpgle-omni-hspec*
Keywords like "bnddir" and "copyright" will be suggested.
An example would be: >
ctl-opt bnd<TAB> -> ctl-opt bnddir(
<
OMNI DECLARATION SPECIFICATION *ft-rpgle-omni-dspec*
Keywords like "static" and "dim" and types like "varchar" and "ind" will be
suggested for constants, standalone, data-structures, procedure-interfaces and
prototypes.
An example would be: >
dcl-s name var<TAB> -> dcl-s name varchar(
dcl-s name vargraph(
dcl-s name varucs2(
dcl-ds name qual<TAB> -> dcl-ds name qualified
<
OMNI PROCEDURE SPECIFICATION *ft-rpgle-omni-pspec*
Keywords like "export" will be suggested.
An example would be: >
dcl-proc name ex<TAB> -> export
-> export(
<
vim:tw=78:ts=8:ft=help:norl: