Ok, so this is my emacs config wiki
I use a us keyboard layout, so C-=
is nicely reachable and a
suitable prefix key.
On a terminal using putty, sadly, C-=
doesn’t work, so I use <f12>
instead. <f5>
is free, too. <f9>
I use for “compiling” or similar
stuff. (that was the binding in turbo-c and still seems to be used by
some IDEs).
(global-set-key (kbd "C-= d") 'find-name-dired)
(global-set-key (kbd "C-= l") 'find-lisp-find-dired)
(global-set-key (kbd "C-= g") 'find-grep-dired) # or find-grep.
;; recent files
(recentf-mode)
(global-set-key (kbd "C-= f") 'recentf-open-files)
start a server if there isn’t already one running:
(require 'server)
(unless (and (fboundp #'server-running-p) (server-running-p))
(server-start))
I think MCs are cool but I don’t use them much. I neither pretend these are the best bindings nor do I claim completeness.
If you’re in a terminal check what key is sent by the key
combination. I think it was C-^
instead of C-"
. Adjust
accordingly.
;; multiple cursors
(global-set-key (kbd "C-\" a") 'mc/mark-all-like-this-dwim)
(global-set-key (kbd "C-\" l") 'mc/mark-next-lines)
(global-set-key (kbd "C-\" m") 'mc/mark-next-like-this)
(global-set-key (kbd "C-\" s") 'mc/mark-next-like-this-symbol)
(global-set-key (kbd "C-\" w") 'mc/mark-next-like-this-word)
(global-set-key (kbd "C-\" r") 'mc/mark-all-in-region)
(global-set-key (kbd "C-\" R") 'mc/mark-all-in-region-regexp)
see: https://github.com/mokrates/json-simple-flymake
(load "~/.emacs.d/tomlcheck.el")
(add-hook 'conf-toml-mode-hook 'flymake-tomlcheck-setup)
(add-hook 'conf-toml-mode-hook 'flymake-mode)
(add-hook 'conf-toml-mode-hook 'trailing-whitespace-mode)
;; if you want to add this automatically to .conf.j2 files
(add-to-list 'auto-mode-alist '("\\.conf\\.j2\\'" . conf-toml-mode))
(load "~/.emacs.d/flymake-yamllint.el")
(add-hook 'yaml-mode-hook 'flymake-yamllint-setup)
(add-hook 'yaml-mode-hook 'flymake-mode)
(add-hook 'yaml-mode-hook 'trailing-whitespace-mode)
https://github.com/shaohme/flymake-yamllint
see https://github.com/mokrates/flymaker
For flymaker, see flymake
;;;;;;;; python
(require 'auto-complete)
(require 'jedi)
;; these seem to be neccessary because of GUI/CUI, idk.
(define-key jedi-mode-map (kbd "C-c <tab>") 'jedi:complete)
(define-key jedi-mode-map (kbd "C-c TAB") 'jedi:complete)
(add-hook 'python-mode-hook 'jedi:setup)
;; don't show this when idle. Don't do anything if I don't ask you!
;; M-" to show info. (how it is shown: defined in customize)
;; this is a monkey patch. may break with a new emacs version (currently working: 28.2)
(defun jedi:get-in-function-call-when-idle () ())
(define-key jedi-mode-map (kbd "M-\"") 'jedi:get-in-function-call)
;; golang
(add-hook 'go-mode-hook #'eglot-ensure)