https://github.com/simonrw/vim-tslime-input
Repeat commands for tslime
https://github.com/simonrw/vim-tslime-input
Last synced: 5 months ago
JSON representation
Repeat commands for tslime
- Host: GitHub
- URL: https://github.com/simonrw/vim-tslime-input
- Owner: simonrw
- License: mit
- Created: 2013-07-11T13:19:28.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-15T18:06:44.000Z (almost 13 years ago)
- Last Synced: 2025-07-12T03:51:26.364Z (12 months ago)
- Language: VimL
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tslime-input.vim
This plugin is a simple convenience wrapper around tslime to enable repeat
commands to be run from vim.
I tried vimux for running commands in a tmux window, but I like the way tslime prompts for user input on commands. I also liked the way you could repeat commands with vimux. I've created this plugin to merge the two functionalities I liked from both plugins, and now my workflow is very simple.
## Example
I have the two important functions mapped to `a` for running the command, and `R` for resetting the behaviour. I usually have a narrow pane open to the right of my vim window for running things. I can quickly set this up by running
* `a`
* inputting my command and watching my tests run, or my main script to run
* calling `a` as many times as I want to run the same command again
* should I need a new command, I run `R` `a` and input my new command.
## Commands
Three functions are made available:
`TslimeAskForCommand`
This function prompts for user input the first time it's run, and on subsequent
runs it repeats the last command.
The command autocompletes any previous commands run.
`TslimeResetLastCommand`
This resets the previously last run command if set. This also calls `TslimeResetTslimeSettings`.
`TslimeResetTslimeSettings`
This function resets the internal tslime settings variable, which contains the tmux session/window/pane to use.
## Key mappings
The user is responsible for setting their own keyboard mappings, but an example
can be
``` vim
nmap a :call TslimeAskForCommand()
nmap R :call TslimeResetLastCommand()
```