Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomtom/vimform_vim
Simple text-based forms for vim
https://github.com/tomtom/vimform_vim
forms tui ui user-interface vim vim-plugin
Last synced: 10 days ago
JSON representation
Simple text-based forms for vim
- Host: GitHub
- URL: https://github.com/tomtom/vimform_vim
- Owner: tomtom
- License: gpl-3.0
- Created: 2010-04-08T17:35:12.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T14:35:27.000Z (over 7 years ago)
- Last Synced: 2023-04-12T15:32:57.057Z (over 1 year ago)
- Topics: forms, tui, ui, user-interface, vim, vim-plugin
- Language: Vim script
- Homepage: http://vim.sourceforge.net/scripts/script.php?script_id=3051
- Size: 66.4 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE.TXT
Awesome Lists containing this project
README
Example: >
let form = vimform#New()
let form.name = "Test Form"
let form.fields = [
\ ['Name'],
\ ['Address', {'join': "\n"}],
\ ['Planet', {'value': 'Earth'}],
\ ['Phone', {'validate': '%s =~ ''^[0-9()+-]*$''',
\ 'message': 'Must be a phone number'}],
\ ['E-Mail', {'validate': '%s =~ ''^\([a-zA-Z.]\+@[a-zA-Z]\+\.[a-zA-Z.]\+\)\?$''',
\ 'message': 'Must be an e-mail'}],
\ ['Private', {'value': 0, 'type': 'checkbox'}],
\ ['Business', {'value': 1, 'type': 'checkbox'}],
\ ]
function! form.Do_Submit() dict "{{{3
echom "Test: ". self.name
for [field, value] in items(self.values)
echom "Field" field value
endfor
endfcall form.Split()
This will create a form, which looks like this: >
<<&Submit>> <<&Cancel>>
Name:
Address:
Planet: Earth
Phone:
E-Mail:
Private: [ ]
Business: [X]Check out further examples on:
http://github.com/tomtom/vimform_vim/tree/master/test/The following field types are currently supported:
- text fields
- check boxes
- single choice/drop-down lists*vimform-keys*
The following key maps can be used to navigate through forms:"Press" a button. If the cursor, is not over a button,
the form will be submitted, i.e. the Do_Submit() method
is called.c Abandon/close/cancel the form.
Redraw the form.
Jump to the next field (this will also save the current
field's value so that it doesn't get lost when redrawing
a form)Jump to the previous field
Invoke the completion menu if a completion function is
defined for the current field.`[LETTER] Accelerator keys are prefixed with an ampersand (&).
Those letters are defined as |mark|s. Jump to a button
with |`|.If the cursor is located over a checkbox, toggle that
check box. If the cursor is over a drop-down list, open the
list.a
i Switch to insert mode.
Navigate drop-down lists. See also |ins-completion|.-----------------------------------------------------------------------
Install~In order to install the vba, open the vba file in VIM and type: >
:so %
See :help vimball for details.
Also available via git: http://github.com/tomtom/vimform_vim/
License: GPLv3 or later
Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
See http://github.com/tomtom for related plugins.