Add key macro

This commit is contained in:
Tom Willemse 2017-12-29 10:53:03 -08:00
parent 67848f995f
commit a494677ab2

View file

@ -1,5 +1,6 @@
#+TITLE: Tom-Emacs Interface #+TITLE: Tom-Emacs Interface
#+STARTUP: content #+STARTUP: content
#+MACRO: key @@html:<kbd>$1</kbd>@@@@ascii:`$1'@@
This is my personal Emacs configuration. The name was inspired by This is my personal Emacs configuration. The name was inspired by
"Ghost in the Shell 2: Man-Machine Interface" and Ryan Rix's "Complete "Ghost in the Shell 2: Man-Machine Interface" and Ryan Rix's "Complete
@ -338,12 +339,13 @@ Computing Environment".
*** Suspend *** Suspend
The =C-z= key in a terminal suspends the current application to The {{{key(C-z)}}} key in a terminal suspends the current
the background and lets you do other things on the command line application to the background and lets you do other things on the
without having to fully close the application. In GUI Emacs this command line without having to fully close the application. In GUI
minimizes the current frame. I have no place for it to minimize to Emacs this minimizes the current frame. I have no place for it to
(no task bar or anything), so this just freezes my frame. To minimize to (no task bar or anything), so this just freezes my
prevent this from happening I unbind the =C-z= key. frame. To prevent this from happening I unbind the {{{key(C-z)}}}
key.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(global-unset-key (kbd "C-z")) (global-unset-key (kbd "C-z"))
@ -444,7 +446,7 @@ Computing Environment".
* Counsel * Counsel
Counsel is a group of functions that use Ivy to specialize on Counsel is a group of functions that use Ivy to specialize on
certain built-in commands, such as M-x. certain built-in commands, such as {{{key(M-x)}}}.
Since I enable Counsel mode immediately, there's no point in leaving Since I enable Counsel mode immediately, there's no point in leaving
it to be autoloaded. Requiring it keeps the byte-compiler happy. it to be autoloaded. Requiring it keeps the byte-compiler happy.
@ -468,7 +470,8 @@ Computing Environment".
#+END_SRC #+END_SRC
Don't show that counsel is enabled in the mode-line. It's enabled Don't show that counsel is enabled in the mode-line. It's enabled
globally and I'll notice whenever I press M-x for example. globally and I'll notice whenever I press {{{key(M-x)}}} for
example.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(diminish 'counsel-mode) (diminish 'counsel-mode)
@ -642,17 +645,17 @@ Computing Environment".
** Electric indent mode ** Electric indent mode
By default `electric-indent-mode' is enabled globally, but I prefer By default ~electric-indent-mode~ is enabled globally, but I prefer
to enable it locally where I need it. to enable it locally where I need it.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(electric-indent-mode -1) (electric-indent-mode -1)
#+END_SRC #+END_SRC
Since Emacs 24 `electric-indent-mode' switches the behavior of the Since Emacs 24 ~electric-indent-mode~ switches the behavior of the
C-j and RET keys. I prefer the original situation because my {{{key(C-j)}}} and {{{key(RET)}}} keys. I prefer the original
muscle-memory still remembers to use C-j for newline-and-indent situation because my muscle-memory still remembers to use
behaviour. {{{key(C-j)}}} for newline-and-indent behaviour.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun oni:switch-newline-keys () (defun oni:switch-newline-keys ()