I think I finally figured out the terminal key stuff

This commit is contained in:
Benson Chu 2025-08-08 15:03:16 -05:00
parent 358ca792f5
commit acfd8f5e72
3 changed files with 17 additions and 13 deletions

View file

@ -1038,6 +1038,6 @@
#+end_src
* Terminal compatibility
#+begin_src emacs-lisp
(global-set-key (kbd "M-[ emacs-C-SPC") #'set-mark-command)
(global-set-key (kbd "M-[ emacs-C-/") #'undo)
(when (null window-system)
(require 'term-compat))
#+end_src

View file

@ -139,11 +139,9 @@
(setq projectile-require-project-root t)
(setq projectile-indexing-method 'hybrid)
(setq projectile-auto-update-cache nil)
(if (and (not (daemonp))
(null window-system))
(global-set-key (kbd "C-c M-[ emacs-C-.") 'projectile-command-map)
(global-set-key (kbd "C-c C-.") 'projectile-command-map)
(global-set-key (kbd "C-c M-[ emacs-C-.") 'projectile-command-map)))
(global-set-key (kbd "C-c C-.") 'projectile-command-map)
(global-set-key (kbd "C-c M-[ emacs-C-.") 'projectile-command-map))
:config
(projectile-mode)
(add-to-list 'projectile-globally-ignored-directories

View file

@ -24,16 +24,22 @@
;;; Code:
(global-set-key (kbd "M-[ emacs-C-SPC") #'set-mark-command)
(global-set-key (kbd "M-[ emacs-M-SPC") #'cycle-spacing)
(global-set-key (kbd "M-[ emacs-C-/") #'undo)
(require 'term/xterm)
(xterm--init-modify-other-keys)
(xterm-mouse-mode 1)
;; (global-set-key (kbd "M-[ emacs-C-SPC") #'set-mark-command)
;; (global-set-key (kbd "M-[ emacs-M-SPC") #'cycle-spacing)
;; (global-set-key (kbd "M-[ emacs-C-/") #'undo)
(global-set-key (kbd "M-[ emacs-C-<backspace>") #'backward-kill-word)
(with-eval-after-load 'org
(define-key org-mode-map (kbd "C-c M-[ emacs-C-,") #'org-insert-structure-template)
(define-key org-mode-map (kbd "M-[ emacs-C-<return>") #'org-insert-heading-respect-content)
;; (define-key org-mode-map (kbd "C-c M-[ emacs-C-,") #'org-insert-structure-template)
;; (define-key org-mode-map (kbd "M-[ emacs-C-<return>") #'org-insert-heading-respect-content)
(define-key org-mode-map (kbd "M-[ emacs-M-S-<return>") #'org-insert-todo-heading)
(define-key org-mode-map (kbd "M-[ emacs-C-S-<return>") #'org-insert-todo-heading-respect-content))
;; (define-key org-mode-map (kbd "M-[ emacs-C-S-<return>") #'org-insert-todo-heading-respect-content)
)
(with-eval-after-load 'vterm
(define-key vterm-mode-map (kbd "M-[ emacs-C-<backspace>")