Sure, just add something like this to your init file:
(defun oleg/compile-lua ()
"use love2d to compile my lua code"
(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 ...
I would write it that way.
:bind (:map eshell-mode-map
("C-<backspace>" . my-eshell-mode-func))
:config (defun my-eshell-mode-func ()
For two reasons:
eshell-mode-map is provided by feature esh-mode (not eshell) see end of this file
You can create commands to achieve the job you want and link them to the key you like.
(defun italic-word ()
(easy-mark) (TeX-font nil 9))
(defun bold-word ()
(easy-mark) (TeX-font nil 2))
(bind-key (kbd "M-o i") #'italic-word LaTeX-mode-map)
You can use use-package to force your keybinding.
(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))
in Autohotkey Configuration, then setting
(setq w32-pass-rwindow-to-system nil)
(setq w32-rwindow-modifier 'super) ; Right Windows key
(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....
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-...
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" '...
event-apply-meta-modifier is only to be used in translation keymaps. You
(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 ...
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.
;; -*- 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 ...
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)