Archived
1
0
Fork 0

reconcile keybinds with tmux and ake things a lot more consistent between the two

This commit is contained in:
KemoNine 2024-09-01 13:02:33 -04:00
parent 30b62b66c9
commit 7a731787c8

View file

@ -228,8 +228,6 @@
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(global-set-key (kbd "M-g") 'keyboard-quit)
(global-set-key (kbd "M-m") 'menu-bar-open)
(global-set-key (kbd "C-M-n") 'make-frame)
(global-set-key (kbd "C-M-k") 'delete-frame)
(global-set-key (kbd "C-x C-z") nil)
(global-set-key (kbd "C-g") 'goto-line)
@ -250,11 +248,42 @@
)
)
(global-set-key (kbd "M-k") 'delete-window)
; tmux keybind compatibility
(setq windmove-wrap-around t) ; tmux does wraparound for window movements, enable for emacs
(define-key global-map (kbd "C-b") (make-sparse-keymap))
(global-set-key (kbd "C-b n") 'make-frame)
; prevent ardux typos w/ window sizing
(global-set-key (kbd "C-<up>") nil)
(global-set-key (kbd "C-<down>") nil)
(global-set-key (kbd "C-<right>") nil)
(global-set-key (kbd "C-<left>") nil)
; main tmux key binds
; *remember* C-b b in tmux sends a single C-b to the underlying tty
(global-set-key (kbd "C-b c") (lambda () (interactive)
(let ((frame (make-frame))
; yes, this is silly
; need a name for the buffer and emacs always re-uses buffers based on name
; to keep w/ tmux, use an arbitrary, 'unique' name of the new buffer
(buffer (get-buffer-create (format-time-string "%Y-%m-%d %H:%M:%S" (current-time)))))
(select-frame-set-input-focus frame)
(display-buffer buffer)
(switch-to-buffer buffer)
(delete-other-windows)
)))
(global-set-key (kbd "C-b &") 'delete-frame)
(global-set-key (kbd "C-b \"") 'split-window-below)
(global-set-key (kbd "C-b %") 'split-window-right)
(global-set-key (kbd "C-b x") 'delete-window)
(global-set-key (kbd "C-b <up>") 'windmove-up)
(global-set-key (kbd "C-b <down>") 'windmove-down)
(global-set-key (kbd "C-b <left>") 'windmove-left)
(global-set-key (kbd "C-b <right>") 'windmove-right)
(global-set-key (kbd "C-b !") 'make-frame)
(global-set-key (kbd "C-b C-<up>") 'enlarge-window)
(global-set-key (kbd "C-b C-<down>") 'shrink-window)
(global-set-key (kbd "C-b C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "C-b C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "C-b :") 'helm-M-x)
(global-set-key (kbd "C-b SPC") 'zoom-mode) ; use 'balance-windows function if not using zoom.el or golden-ratio
;; Lookup the current symbol at point. C-c C-d is a common keybinding
;; for this in lisp modes.