https://github.com/mityu/vital-scripter
A vital.vim module for scripting key types and function calls.
https://github.com/mityu/vital-scripter
neovim vim vital-vim
Last synced: 2 months ago
JSON representation
A vital.vim module for scripting key types and function calls.
- Host: GitHub
- URL: https://github.com/mityu/vital-scripter
- Owner: mityu
- License: zlib
- Created: 2024-03-26T08:23:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-27T13:53:03.000Z (about 2 years ago)
- Last Synced: 2025-06-08T14:04:24.371Z (about 1 year ago)
- Topics: neovim, vim, vital-vim
- Language: Vim Script
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vital-Scripter
[](https://github.com/vim-jp/vital.vim)
[](https://github.com/mityu/vital-scripter/actions/workflows/ci.yml)
A vital.vim module that make it easy to feed key types and call functions between the key types.
## Usage
```vim
let s:Scripter = vital#vital#import('Vim.Scripter')
call s:Scripter.new()
\.call({-> assert_equal('n', mode())})
\.feedkeys('ifoobar')
\.call({-> assert_equal('i', mode())})
\.call({-> assert_equal('foobar', getline('.'))})
\.feedkeys("\")
\.call({-> assert_equal('n', mode())})
\.run()
inoremap (test-mapping) (rhs-test-mapping)
call s:Scripter.new()
\.feedkeys('i')
\.feedkeys_remap("\(test-mapping)")
\.call({-> assert_equal('(rhs-test-mapping)', getline('.'))})
\.set_auto_replace_termcodes(1)
\.feedkeys_remap('(test-mapping)')
\.call({-> assert_equal('(rhs-test-mapping)(rhs-test-mapping)', getline('.'))})
\.feedkeys('')
\.run()
```