Skip to content

Signal tmux (to run the previously run command in respective pane) from nvim! Uses Telescope!

License

Notifications You must be signed in to change notification settings

burntfalafel/signaltmux.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

signaltmux.nvim

Ever have this problem of remotely triggering commands to a tmux session from your nvim? Surely you would have faced with this problem if you use 2 or more screens. Otherwise you're a single-screen poor soydev, and this plugin has nothing to do with you.

Put Plug burntfalafel/signaltmux in your nvim config (or whatever plugin manager you're using)

Now run Telescope signaltmux interface

You also need -

# Variable to hold the last command
export LAST_COMMAND=""

# Function to capture the last command
capture_last_command() {
    LAST_COMMAND="$1"
}

# Hook into the command execution
preexec() {
    capture_last_command "$1"
}

in your ~/.zshrc. Or whatever shell you're using.

Reason for more bloat in your shell init?

Ideally zsh -c 'fc -ln -1' should've done the trick, but I was getting this error - zsh:fc:1: no such event: 0. I think this is expected as tmux is running zsh inside it.

Also, history files and any commands referencing that file are useless. We want history PER tmux pane, not the global history captured by zsh.

TODO:

About

Signal tmux (to run the previously run command in respective pane) from nvim! Uses Telescope!

Topics

Resources

License

Stars

Watchers

Forks

Languages