Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pocke/tnite.vim
Apply action to output of :terminal. It's simple.
https://github.com/pocke/tnite.vim
Last synced: 3 days ago
JSON representation
Apply action to output of :terminal. It's simple.
- Host: GitHub
- URL: https://github.com/pocke/tnite.vim
- Owner: pocke
- Created: 2019-06-07T06:12:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-15T06:55:49.000Z (over 5 years ago)
- Last Synced: 2024-11-06T13:01:37.520Z (about 2 months ago)
- Language: Vim script
- Homepage:
- Size: 7.81 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
tnite.vim
===Apply action to output of `:terminal`.
It's simple.Usage
---Call `tnite#start(command, action, option)`.
Command
---String or List.
Tnite executes the command, and pass the output to action.
Actions
---* `edit`: Open a file in current buffer.
* `tabedit`: Open files with a new tab.
* `switch`: Switch to a window that opens the specified file if it is opened. If not, fallback to `edit` action.
* `switchtab`: Same as `switch` action, but it fallback to `tabedit`.
* `jump`: Jump to the line number.See `g:tnite#actions` for more information.
Options
----### `jump_to_line`
Default: false
Jump to specified line number. Format is `file_name:lineno`.
Example: `autoload/tnite.vim:42`Example
---```vim
" Find a file from git with peco, and open it in a new tab.
nnoremap f :call tnite#start(["sh", "-c", "git ls-files \| peco --initial-filter Fuzzy"], "tabedit", {})" Grep with word under the cursor.
nnoremap g :call tnite#start(["sh", "-c", "git grep --line-number " . shellescape(expand('')) . " \| peco --initial-filter Fuzzy \| cut -d : -f 1,2"], "tabedit", { "jump-to_line": v:true })" Grep the current buffer and jump to the specified line.
nnoremap j :call tnite#start(["sh", "-c", "nl -b a -w1 -s ':\t' " . shellescape(expand('%:p')) . "\| peco \| cut -d : -f 1"], "jump", {})
```