tmux: repeat last command when no arguments given to :t
This commit is contained in:
parent
468313b809
commit
16c1156119
1 changed files with 5 additions and 8 deletions
|
@ -33,15 +33,18 @@
|
||||||
(narf/tmux-cd-to-project)
|
(narf/tmux-cd-to-project)
|
||||||
(narf/tmux-cd-to-here)))
|
(narf/tmux-cd-to-here)))
|
||||||
|
|
||||||
|
(defvar narf-tmux-last-command nil "The last command sent to tmux")
|
||||||
;;;###autoload (autoload 'narf:tmux "module-tmux" nil t)
|
;;;###autoload (autoload 'narf:tmux "module-tmux" nil t)
|
||||||
(evil-define-operator narf:tmux (&optional command bang)
|
(evil-define-operator narf:tmux (&optional command bang)
|
||||||
"Sends input to tmux. Use `bang' to append to tmux"
|
"Sends input to tmux. Use `bang' to append to tmux"
|
||||||
:type inclusive
|
:type inclusive
|
||||||
:repeat t
|
|
||||||
(interactive "<term><!>")
|
(interactive "<term><!>")
|
||||||
|
(unless command
|
||||||
|
(setq command narf-tmux-last-command))
|
||||||
(if (not command)
|
(if (not command)
|
||||||
(os-switch-to-term)
|
(os-switch-to-term)
|
||||||
(tmux command bang)
|
(tmux command (not bang))
|
||||||
|
(setq narf-tmux-last-command command)
|
||||||
(when (evil-ex-p)
|
(when (evil-ex-p)
|
||||||
(message "[Tmux] %s" command))))
|
(message "[Tmux] %s" command))))
|
||||||
|
|
||||||
|
@ -60,11 +63,5 @@
|
||||||
(interactive)
|
(interactive)
|
||||||
(narf/tmux-cd-to-here (narf/project-root)))
|
(narf/tmux-cd-to-here (narf/project-root)))
|
||||||
|
|
||||||
;;;;;;;;;;
|
|
||||||
|
|
||||||
;; TODO
|
|
||||||
;; (defun narf/window (direction)
|
|
||||||
;; )
|
|
||||||
|
|
||||||
(provide 'module-tmux)
|
(provide 'module-tmux)
|
||||||
;;; module-tmux.el ends here
|
;;; module-tmux.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue