Sunday, November 6, 2011

Installing tag for abap in gVim in windows

Hurrah! At last finished installing taglist in Vim for ABAP language, but still very minimal tag recognition (for windows).

Here is the steps:

  1. Download taglist plugin from: taglist plugin
  2. Download exuberant ctags utility from: ctags
  3. Extract taglist to your vim /plugin dir. For pathogen user, please see the pathogen documentation.
  4. Extract exuberant ctags binary/exe to a folder that the folder path didn't consist any space (i run into problem when I copy it into Program Files folder -- will look the workaround later)
  5. Create "ctags.cnf" file in your %UserProfile% folder or read wikipedia for more info
  6. Edit the "ctags.cnf" file and add code:
    --langdef=abap
    --langmap=abap:.abap
    --regex-abap=/^[dD][eE][fF][iI][nN][eE][ \t]*([a-zA-Z0-9_]+)/\1/d,define/
    --regex-abap=/^[cC][lL][aA][sS][sS][ \t]*([a-zA-Z0-9_]+)/\1/c,class/
    --regex-abap=/^[mM][oO][dD][uU][lL][eE][ \t]*([a-zA-Z0-9_]+)/\1/m,module/
    --regex-abap=/^[fF][oO][rR][mM][ \t]*([a-zA-Z0-9_]+)/\1/f,form/
    
  7. SAVE
  8. Open up _vimrc file that reside in your vim folder and add several lines:
    filetype on
    let Tlist_Ctags_Cmd = 'c:\utility\ctags58\ctags.exe' "example folder name, change it necessary
    let tlist_abap_settings='abap;d:define;c:class;m:module;f:form'
    
  9. SAVE
  10. Open up your Vim (or gVim), load up your source code, set syntax to abap (i download abap.vim syntax highlighter though)
  11. Run :TlistToggle" to open up (or close if you open it) taglist function list windows, and voila, it done!
Note: The tag recognization is not perfect tho, as i am not an regex expert. Need to find out ways to scan tags more efficient.

No comments:

Post a Comment