Skip to content

Instantly share code, notes, and snippets.

@Chobbes
Created November 16, 2018 03:03
Show Gist options
  • Select an option

  • Save Chobbes/74fa13cf7ad38f799f5b7cf1c388dcdc to your computer and use it in GitHub Desktop.

Select an option

Save Chobbes/74fa13cf7ad38f799f5b7cf1c388dcdc to your computer and use it in GitHub Desktop.
emacs tmux
(define-prefix-command 'tmux-map)
(global-set-key (kbd "C-o") 'tmux-map)
(defun split-window-right-and-focus ()
(interactive)
(select-window (split-window-right)))
(defun split-window-below-and-focus ()
(interactive)
(select-window (split-window-below)))
(defun open-eshell-right ()
(interactive)
(split-window-right-and-focus)
(eshell t))
(defun open-eshell-below ()
(interactive)
(split-window-below-and-focus)
(eshell t))
(define-key tmux-map (kbd "%") 'split-window-right-and-focus)
(define-key tmux-map (kbd "\"") 'split-window-right-and-focus)
(define-key tmux-map (kbd "x") 'delete-window)
(define-key tmux-map (kbd "C-o") 'persp-switch-last)
(define-key tmux-map (kbd "c") 'persp-switch)
(define-key tmux-map (kbd ",") 'persp-rename)
;; Make these hydras?
(define-key tmux-map (kbd "<right>") 'windmove-right)
(define-key tmux-map (kbd "<left>") 'windmove-left)
(define-key tmux-map (kbd "<up>") 'windmove-up)
(define-key tmux-map (kbd "<down>") 'windmove-down)
(windmove-default-keybindings)
@Chobbes

Chobbes commented Nov 16, 2018

Copy link
Copy Markdown
Author

Slightly tmuxy emacs bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment