New answers tagged

1

Sure, just add something like this to your init file: (defun oleg/compile-lua () "use love2d to compile my lua code" (interactive) (compile "love2d /home/huseyin/Documents/Programming/Lua/")) (global-set-key (kbd "<f5>") #'oleg/compile-lua) You can name the function whatever you prefer, and bind it to whichever key ...


1

I would write it that way. (use-package esh-mode :bind (:map eshell-mode-map ("C-<backspace>" . my-eshell-mode-func)) :config (defun my-eshell-mode-func () (interactive) (func "arg"))) For two reasons: eshell-mode-map is provided by feature esh-mode (not eshell) see end of this file ...


1

You can create commands to achieve the job you want and link them to the key you like. (defun italic-word () "your comment" (interactive) (easy-mark) (TeX-font nil 9)) (defun bold-word () "your comment" (interactive) (easy-mark) (TeX-font nil 2)) (bind-key (kbd "M-o i") #'italic-word LaTeX-mode-map) (bind-key (...


0

You can use use-package to force your keybinding. (use-package org-journal :ensure t :defer t :config (setq org-journal-dir "~/org/journal/" org-journal-date-format "%A, %d %B %Y" org-journal-time-format "%I:%M %p") :bind* ("C-c C-j" . org-journal-new-entry))


0

Setting RCtrl::F24 in Autohotkey Configuration, then setting (setq w32-pass-rwindow-to-system nil) (setq w32-rwindow-modifier 'super) ; Right Windows key (w32-register-hot-key [s-]) (setq w32-apps-modifier 'super) ; Microsoft Surface App Key (bind-key "<f24>" 'event-apply-alt-modifier function-key-map) in init.el solved most of my problems....


0

You need to set a prefix command. Generally said this can be used to combine key bindings that fit together. You will probably have already experienced that in specific modes. Projectile for example has C-c p ... where ... can be a lot of possible commands related to projectile. Another Example would be Yasnippet with C-c & ... where ... could be C-n, C-...


0

I found myself having a similar problem with binding M-x in doom emacs. It appears that something like (map! "M-x" 'helm-M-x) does not work, but when you try to see how this binding is setup, you realize that it is setup within the map general-override-mode-map. So the solution is to do instead: (map! :map general-override-mode-map "M-x" '...


0

event-apply-meta-modifier is only to be used in translation keymaps. You should try (define-key key-translation-map "'" 'event-apply-meta-modifier) (define-key key-translation-map ";" 'event-apply-control-modifier) This will also make it possible to use these keys in the middle of a key sequence. If you want the keys to only work in ...


1

The potential difference is that esc-map and ctl-x-map can be bound to keys other than ESC and C-x. If you don't do that, then the two approaches are effectively the same.


1

I have two suggestions, one, not using any non-default packages, very closely based on the definition of text-scale-adjust and one using hydra. Self-contained ;; -*- lexical-binding: t -*- ;; the previous line needs to be the first in the given file. (require 'python) ;; alternatively use an appropriate `use-package` declaration (defun python-indent-adjust ...


2

The concat function takes a list of SEQs and returns a string. To get the string that describes your key sequence, you would simply write (concat "C-" keypress) Use the kbd function to return the actual key representation. I think you may end up with something like the following (defun my/keypress-definer (keypress) (define-key my-key-map (...


Top 50 recent answers are included