diff --git a/core/core-os-osx.el b/core/core-os-osx.el index c75291d89..9e028c2b6 100644 --- a/core/core-os-osx.el +++ b/core/core-os-osx.el @@ -76,12 +76,5 @@ (narf:tmux-chdir nil t) (narf-switch-to-iterm)) -(defun narf-send-to-iterm (command &optional dont-run) - (when dont-run - (setq command (concat command " "))) - (do-applescript - (format "tell app \"iTerm\" to tell current session of current tab of first window to write text \"%s\"" - (s-replace "\"" "\\\"" command)))) - (provide 'core-os-osx) ;;; core-os-osx.el ends here diff --git a/core/lib/defuns-term.el b/core/lib/defuns-term.el index b6bbe34c0..a7741125d 100644 --- a/core/lib/defuns-term.el +++ b/core/lib/defuns-term.el @@ -12,19 +12,10 @@ (evil-define-command narf:send-to-tmux (command &optional bang) "Sends input to tmux. Use `bang' to append to tmux" (interactive "") - (narf--send-to-tmux (format (if bang "C-u %s Enter" "%s") + (narf--send-to-tmux (format (if bang "%s" "C-u %s Enter") (shell-quote-argument command))) (when (evil-ex-p) (message "[Tmux] %s" command))) -;;;###autoload (autoload 'narf:send-to-iterm "defuns-term" nil t) -(when IS-MAC - (evil-define-command narf:send-to-iterm (command &optional bang) - "Sends input to tmux. Use `bang' to append to tmux" - (interactive "") - (narf-send-to-iterm command bang) - (when (evil-ex-p) - (message "[iTerm] %s" command)))) - (provide 'defuns-tmux) ;;; defuns-tmux.el ends here diff --git a/private/my-commands.el b/private/my-commands.el index 0bb33903e..6f976135b 100644 --- a/private/my-commands.el +++ b/private/my-commands.el @@ -45,6 +45,9 @@ (exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!] (exmap "x" 'narf:scratch-buffer) +(exmap "t[mux]" 'narf:send-to-tmux) +(exmap "tcd" (λ (narf:send-to-tmux (format "cd '%s'" default-directory)))) + (after! flycheck (exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))) @@ -62,15 +65,5 @@ (exmap "k[ill]w" 'wg-kill-workgroup) (exmap "k[ill]ow" 'narf:kill-other-workgroups)) -(cond (IS-MAC - (exmap "t[erm]" 'narf:send-to-iterm) - (exmap "tcd" (λ (narf:send-to-iterm (format "cd '%s'" default-directory))))) - (IS-LINUX - (exmap "t[mux]" 'narf:send-to-tmux) - (exmap "tcd" (λ (narf:send-to-tmux (format "cd '%s'" default-directory))))) - (IS-WINDOWS - ;; TODO Eshell integration - )) - (provide 'my-commands) ;;; my-commands.el ends here