Coder Social home page Coder Social logo

rpgle.vim's Introduction

rpgle.vim

What does it contain?

Free-Form ILE RPG bundle for vim, which contains syntax highlighting, syntax folds, auto indent, more match words and a few sensible keys is remapped.

Indent

One should modify g:rpgle_indentStart to adjust initial indentation level, see :help g:rpgle_indentStart for more information.

There is support for automatic indentation. An example is:

dcl-proc myProc;
    _

The cursor is located at _ and the indent was inserted automatic when pressing enter after dcl-proc. When typing end-proc; the indentation will be decreased.

With procedure interfaces indentation will only happen if the procedure takes an argument:

dcl-pi myProc;
    _

If one type end-pi; the result will automatic become:

dcl-pi myProc;
end-pi;

select-when-other-endsl will be indented like this:

select;
    when;
        a();
    when;
        b();
    other;
        c();
        _

As soon as endsl is typed it will be aligned with the initial select;.

if-elseif-else-endif will be indented like this:

if a = 1;
    a();
elseif b = 1;
    b();
else;
    c();
    _

When typing endif the indentation will be decreased.

Currently proper SQL indentation is missing:

exec sql
select *
from a
order by 1 desc;

See :help ft-rpgle-indent

Syntax

Keywords, procedures and built-in functions will all be highlighted.

See :help ft-rpgle-syntax

Syntax Folds

The following folds are supported:

- if       -> endif
- dow      -> enddo
- dou      -> enddo
- for      -> endfor
- select   -> endsl
- dcl-proc -> end-proc
- begsr    -> endsr

See :help ft-rpgle-fold

Match Words

The following match words are supported:

- select   -> when     -> other   -> endsl
- if       -> elseif   -> else    -> endif
- dow      -> iter     -> leave   -> enddo
- dou      -> iter     -> leave   -> enddo
- begsr    -> endsr
- dcl-proc -> return   -> endproc
- dcl-pi   -> end-pi
- monitor  -> on-error -> endmon

See :help ft-rpgle-match-words

Movements

rpgle.vim takes the liberty to bind [[, ]], [], ][, gd, [{ and ]} and tried to make them useful for ILE RPG programming.

[[ and ]] will jump to the previous or next dcl-proc while ][ and [] will jump to the previous or next end-proc.

gd will search for the word under the cursor from the previous dcl-proc.

[{ and ]} will jump to the associated block opener, i.e. standing inside an if statement and pressing [{ will bring you to the if, pressing ]} will bring you to the endif.

See :help ft-rpgle-movements

Omni Completion

rpgle.vim provides a naive omni completion that will attempt to suggest completion for compiler directives and header, declaration, calculation and procedure specifications.

Calculation specification completion requires generated generated tags.

See :h ft-rpgle-omni

Contributing

Make a pull request or issue

Self-Promotion

Like rpgle.vim? Then you might also like:

  • rpglectags which creates tags files from ILE RPG,
  • rpgleman which provides man pages for built-in functions keywords and more,
  • and rpglefmt which will format Free Form ILE RPG programs.

License

Distributed under the same terms as Vim itself. See :help license

rpgle.vim's People

Contributors

andlrc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpgle.vim's Issues

Proper indent for SQL.

Consider the following A1:

exec sql
  select a, b, c
  from table1
  join table2 on a = b;

Currently indent will be A2:

exec sql
select a, b, c
from table1
join table2 on a = b;

Also consider this B1:

exec sql
  select
    a, b,
    c, d
  from
    table1
  join
    table2
  on
    a = b;

Which again will be indented as B2:

exec sql
select
a, b,
c, d
from
table1
join
table2
on
a = b;

I would like A1 and B1 to be possible.

One might need to use the indentexpr from SQL as it's done with the syntax. But how
to use multiply in a proper way? We will need more indentkeys?

De indent comments before certain keywords

Comments before when, other, elseif, else and on-error should be indented
to align with the keyword, i.e:

if a = 1;
    b = 2;

// Comment
else;
    b = 3;
endif;

Currently the comment will be indended the same as b = 2;

Fold dcl-xx

Create fold over dcl-s, dcl-c, and dcl-ds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.