aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2019-09-16 16:52:51 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2019-09-16 16:56:53 +0200
commita7a96a40351676f37cdef12fb46d5646db207dcf (patch)
tree399279983384ffa897d7d5c343c38ad7a504f4bb
parentfbba092672efe81cf7d3fd583d7903446ff07900 (diff)
downloaddotfiles-a7a96a40351676f37cdef12fb46d5646db207dcf.tar.gz
dotfiles-a7a96a40351676f37cdef12fb46d5646db207dcf.zip
emacs: added abbrev into the mix
I'm also including some other packages such as dired-x. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
-rw-r--r--.emacs.d/README.org4
-rw-r--r--.emacs.d/abbrevs.el6
-rw-r--r--.emacs.d/init.org34
3 files changed, 36 insertions, 8 deletions
diff --git a/.emacs.d/README.org b/.emacs.d/README.org
index 70ccec8..c93ecaf 100644
--- a/.emacs.d/README.org
+++ b/.emacs.d/README.org
@@ -57,8 +57,8 @@ want to do it manually:
- Copy the =init.el= into the =~/.emacs.d= directory. This is the only file that
should be copied instead of linked because it will get replaced on the first run
by =org-babel=.
-- Link the =init.org=, =custom.el= and =gtkrc= files into the =~/.emacs.d=
- directory.
+- Link the =init.org=, =custom.el=, =abbrevs.el= and =gtkrc= files into the
+ =~/.emacs.d= directory.
- Create the =~/.emacs.d/lisp= subdirectory and link the =lisp/g.el= file there.
- Clone the [[https://github.com/mssola/soria][soria]] project and link the =soria-theme.el= file into the
=~/.emacs.d= directory.
diff --git a/.emacs.d/abbrevs.el b/.emacs.d/abbrevs.el
new file mode 100644
index 0000000..4d5502d
--- /dev/null
+++ b/.emacs.d/abbrevs.el
@@ -0,0 +1,6 @@
+(define-abbrev-table 'global-abbrev-table '(
+ ("abbout" "about" nil 0)
+ ("afaict" "as far as I can tell" nil 0)
+ ("btw" "by the way" nil 0)
+ ("diba" "Diputació de Barcelona" nil 0)
+ ))
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 20552e9..12c6abb 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -189,11 +189,10 @@ modes.
Relative line numbers support is builtin since GNU Emacs 26.1:
#+BEGIN_SRC elisp
-(if (>= emacs-major-version 26)
- (progn
- (add-hook 'prog-mode-hook 'display-line-numbers-mode)
- (setq display-line-numbers-type 'relative)
- (global-set-key (kbd "C-c L") 'display-line-numbers-mode)))
+(when (>= emacs-major-version 26)
+ (add-hook 'prog-mode-hook 'display-line-numbers-mode)
+ (setq display-line-numbers-type 'relative)
+ (global-set-key (kbd "C-c L") 'display-line-numbers-mode))
#+END_SRC
** Basic editing configuration
@@ -239,6 +238,22 @@ Some editing tweaks like tabs vs spaces, maximum column width, etc.
(show-paren-mode 1)
#+END_SRC
+** Abbreviations
+
+Basic abbreviation settings:
+
+#+BEGIN_SRC elisp
+(setq abbrev-file-name "~/.emacs.d/abbrevs.el"
+ save-abbrevs 'silent)
+#+END_SRC
+
+Automatically enable abbreviation mode for some modes:
+
+#+BEGIN_SRC elisp
+(dolist (hook '(erc-mode-hook org-mode-hook text-mode-hook))
+ (add-hook hook #'abbrev-mode))
+#+END_SRC
+
** Font and theme
I'm using "Droid Sans Mono" simply because I've grown used to it.
@@ -787,6 +802,12 @@ I also extend =dired= with some handy tweaks.
delete-old-versions t)
#+END_SRC
+Enable =dired-x= for cool stuff like =dired-jump=:
+
+#+BEGIN_SRC elisp
+(require 'dired-x)
+#+END_SRC
+
And now instruct dired mode how to attach files when using mu4e. This is taken
from the [[https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html#Dired][mu4e documentation]], and it's available by typing
@@html:<kbd>C-c RET C-a</kbd>@@.
@@ -1015,7 +1036,8 @@ mainly from the documentation, plus some cool remarks on Reddit. This
configuration makes quite some assumptions. Read the =emacs/README.org= file as
provided in my [[https://github.com/mssola/dotfiles][dotfiles]] project to get more details.
-I'm using an RPM that I've built on [[https://build.opensuse.org/package/show/home:mssola/mu][OBS]] which installs mu4e globally.
+I'm using [[https://build.opensuse.org/package/show/server:mail/maildir-utils][this package from OBS]] to install =mu= and =mu4e=, which installs
+things globally:
#+BEGIN_SRC elisp
(unless (file-directory-p "/usr/share/emacs/site-lisp/mu4e")