AWK Support Vim Plug-In | |||||||||
|
|
|
root menu |
AWK Support - Vim Plug-In( version 1.3 )View the ReadmeRead the AWK Support Help File The key mappings of this plugin (PDF) What's new? Customizable file skeletons Jul 2017 New Plug-in Versions Released Jul/Aug 2016 |
|
Features |
---|
Speed-up the development of AWK scripts:
|
Menus | Explanation | ||
---|---|---|---|
Menu Comments : insert commentsA lot of the menu entries are defined in a so-called template library. The library defines the menu entries, maps and the inserted text. The personal information can also be configured there. A file description can be inserted into each new file:
#!/usr/bin/awk -f
#===============================================================================
#
# File: somescript.awk
#
# Description:
#
# VIM Version: 7.0+
# Author: Wolfgang Mehner (WM), wolfgang-mehner@web.de
# Organization:
# Version: 1.0
# Created: 23.03.2016 10:45
# Revision: ---
# License: Copyright (c) 2016, Wolfgang Mehner
#===============================================================================
This prolog is generated from the template shown below. This template file can easily be changed by the user.
Tags (like == Comments.file description == start, map:ch == #!/usr/bin/awk -f #=============================================================================== # # File: |FILENAME| # # Description: <CURSOR> # # VIM Version: 7.0+ # Author: |AUTHOR| (|AUTHORREF|), |EMAIL| # Organization: |ORGANIZATION| # Version: 1.0 # Created: |DATE| |TIME| # Revision: --- # License: |COPYRIGHT| #=============================================================================== == ENDTEMPLATE == The entry keyword comments ➞ todo generates a special end-of-line comment. These comments are easily locatable by their keywords (e.g. :TODO:). Date and author reference name are inserted by the editor.
# :TODO:29.02.2015 12:34:WM:
These comments are not for the final version of a script, of course. |
|||
Menu Statements : insert statementsInsert statements with jump tags for convenient editing, using the entry if block else or via the map \sife: if ( | ) { <-IF_PART-> } else { <-ELSE_PART-> } The cursor is positioned after the "if". Use CTRL+J to jump to the tags and start editing. A lot of menu entires have a special behavior in visual mode. Select some lines in visual mode ... match ( str, "Name: ([[:alpha:]]+)", a ) printf ( a[1] ) then use the entry if block. The text is inserted around the selected lines and they are indented: match ( str, "Name: ([[:alpha:]]+)", a ) if ( | ) { printf ( a[1] ) } |
|||
Menu Idioms : insert frequently used statementsInsert an empty function using function. You will be asks for the name of the function and the following lines will be inserted: function brain_function ( | ) { <-FUNCTION_BODY-> } # ----- end of function brain_function ----- |
|||
|
|||
|
|||
Menu Snippets : insert code snippets and manage templatesThe plug-in comes with a facility to extract, manage and insert often used code snippets. Visually select a few lines and use the menu entry write code snippet to write these lines into a file. The code snippet can then be edited and inserted again using read code snippet. (See :help awksupport-snippets) The templates which define the behavior of most of the menu entries are also manage here. Use templates setup wizard to create a personalization file with your personal details for the comments. The templates support different coding styles. Use the entry choose style to switch between them. |
|||
Menu Run : run script, check syntax, do lint check, ...Run the script, the output is redirected to the AWK-Output buffer: Check the syntax. In case of errors a quickfix window will be opened to show the current list of errors: Run lint check: |
|||
Menu Help : call helpHelp is quickly accessible through the Help menu. Use the entry or the map \hm to display the AWK man-page. It contains the documentation of the statements, functions, data structures, ... The same works for any word in the English language. Placing the cursor on a word and hitting \he opens a dictionary for the word. |
Page updated: October 23 2018 / Mail to: Wolfgang Mehner