https://github.com/gee19/vim-gbone
Small, extensible wrapper around vim-tbone.
https://github.com/gee19/vim-gbone
tmux vim
Last synced: 8 months ago
JSON representation
Small, extensible wrapper around vim-tbone.
- Host: GitHub
- URL: https://github.com/gee19/vim-gbone
- Owner: Gee19
- Created: 2021-04-25T18:57:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-06T06:43:38.000Z (about 4 years ago)
- Last Synced: 2025-02-09T03:42:04.696Z (over 1 year ago)
- Topics: tmux, vim
- Language: Vim script
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-gbone
Small, extensible wrapper around [vim-tbone](https://github.com/tpope/vim-tbone).
Transform vim + tmux into a fully customizable test runner, language agnostic REPL, or whatever your heart desires.
Does NOT replace `vim-tbone`, `vim-dispatch`, `AsyncRun.vim` or `vim-test`.
## Installation
### Using [vim-plug](https://github.com/junegunn/vim-plug)
```vim
Plug 'tpope/vim-tbone'
Plug 'Gee19/vim-gbone'
Plug 'tyru/current-func-info.vim' " Optional
```
### Run Usage
- Send pre-defined run command to a tmux pane in *any direction*
- Appends full buffer path
### REPL Usage
- Sends the current line (or visually selected lines) to a tmux pane in *any direction*, with *smart indent level support*.
- Automatically sends the `Enter` key after each line.
### Test Runner Usage
- Sends your pre-defined test command to a tmux pane in *any direction*.
- Appends the full buffer path.
- Optionally, appends the current line number, class or class & function.
| Strategy | Description | Example |
| :---------- | :--------------------------------------------------------------| :--------------------------------------------- |
| **smart** | Test specific func, class or file depending on cursor location | `pytest /path/to/file{::className}{::funcName}`|
| **line** | Append line number to test command | `mix test /path/to/file.exs:12` |
Note:
- *Remembers the last two panes used for each function, until you restart vim.*
- `smart` strategy *requires* `current-func-info.vim`.
- Supports: `C, Go, Perl, PHP, Python, Ruby, VimL, PL/SQL, sh, Bash, Zsh, Elixir`
## Configuration
```vim
let g:gbone_run_mapping = 'x'
let g:gbone_run_ft_map = {
\ 'python': 'python3.8',
\ 'javascript': 'node',
\ }
let g:gbone_repl_mapping = 'rl'
let g:gbone_test_mapping = 't'
let g:gbone_ft_map = {
\ 'python': 'pytest -vvv',
\ 'javascript': 'yarn test',
\ 'elixir': 'mix test',
\ 'spec': 'npx cypress run --browser firefox --spec'
\ }
let g:gbone_ft_strategy = {
\ 'python': 'smart',
\ 'elixir': 'line',
\ }
```
## TODO
- BUG: fix visual mode mapping sending full lines?
- ENHANCEMENT: capture input for direction if last pane doesn't exist
- localleader might be the move
- write help text
## Credit
- [tpope](https://github.com/tpope) for [vim-tbone](https://github.com/tpope/vim-tbone).
- [tyru](https://github.com/tyru) for [current-func-info](https://github.com/tyru/current-func-info.vim).