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-here)))
|
||||
|
||||
(defvar narf-tmux-last-command nil "The last command sent to tmux")
|
||||
;;;###autoload (autoload 'narf:tmux "module-tmux" nil t)
|
||||
(evil-define-operator narf:tmux (&optional command bang)
|
||||
"Sends input to tmux. Use `bang' to append to tmux"
|
||||
:type inclusive
|
||||
:repeat t
|
||||
(interactive "<term><!>")
|
||||
(unless command
|
||||
(setq command narf-tmux-last-command))
|
||||
(if (not command)
|
||||
(os-switch-to-term)
|
||||
(tmux command bang)
|
||||
(tmux command (not bang))
|
||||
(setq narf-tmux-last-command command)
|
||||
(when (evil-ex-p)
|
||||
(message "[Tmux] %s" command))))
|
||||
|
||||
|
@ -60,11 +63,5 @@
|
|||
(interactive)
|
||||
(narf/tmux-cd-to-here (narf/project-root)))
|
||||
|
||||
;;;;;;;;;;
|
||||
|
||||
;; TODO
|
||||
;; (defun narf/window (direction)
|
||||
;; )
|
||||
|
||||
(provide 'module-tmux)
|
||||
;;; module-tmux.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue