aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/custom.el2
-rw-r--r--emacs/init.org124
2 files changed, 81 insertions, 45 deletions
diff --git a/emacs/custom.el b/emacs/custom.el
index b92366a..d91ac51 100644
--- a/emacs/custom.el
+++ b/emacs/custom.el
@@ -15,7 +15,7 @@
'(markdown-command "/usr/bin/markdown-calibre")
'(package-selected-packages
(quote
- (debbugs async-await request emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag))))
+ (move-text git-timemachine debbugs async-await request emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/emacs/init.org b/emacs/init.org
index f666c77..6e35352 100644
--- a/emacs/init.org
+++ b/emacs/init.org
@@ -90,6 +90,50 @@ User name and email.
user-mail-address "mikisabate@gmail.com")
#+END_SRC
+* Lisp packages
+** Custom packages
+
+Compile the =g.el= script and bind it to @@html:<kbd>M-g</kbd>@@.
+
+#+BEGIN_SRC elisp
+ (byte-compile-file (concat user-emacs-directory "lisp/g.el") t)
+ (global-set-key (kbd "M-g") 'g)
+#+END_SRC
+
+** use-package
+
+Initialize package.
+
+#+BEGIN_SRC elisp
+ (require 'package)
+
+ (add-to-list 'package-archives
+ '("melpa" . "http://melpa.milkbox.net/packages/") t)
+ (add-to-list 'package-archives
+ '("melpa-stable" . "https://stable.melpa.org/packages/") t)
+
+ (package-initialize)
+#+END_SRC
+
+I'm using use-package to handle my installed packages. I don't know if it's
+the best option or what because I haven't tested all the package managers
+for Emacs out there. After trying some custom functions to handle
+package-install, I decided on use-package because I feel more well-organized.
+
+#+BEGIN_SRC elisp
+ (unless (package-installed-p 'use-package)
+ (package-refresh-contents)
+ (package-install 'use-package))
+#+END_SRC
+
+Some =use-package= calls require =diminish.el= to be available. So, let's
+require it here on the very top.
+
+#+BEGIN_SRC elisp
+(use-package diminish
+ :ensure t)
+#+END_SRC
+
* General
** GUI
@@ -140,6 +184,14 @@ Relative line numbers support is builtin since GNU Emacs 26.1:
(global-set-key (kbd "C-c L") 'display-line-numbers-mode)))
#+END_SRC
+Highlight the current line:
+
+#+BEGIN_SRC elisp
+(use-package hl-line
+ :config
+ (global-hl-line-mode +1))
+#+END_SRC
+
** Basic editing configuration
Use UTF-8 *always*.
@@ -342,6 +394,12 @@ Save custom-variables somewhere else.
(load custom-file))
#+END_SRC
+Disable audio notifications.
+
+#+BEGIN_SRC elisp
+(setq ring-bell-function 'ignore)
+#+END_SRC
+
* Calendar
We catalans start our weeks on Monday.
@@ -407,50 +465,6 @@ Sometimes I want to debug my initialization time.
(message "%.3fs" init-time)))
#+END_SRC
-* Lisp packages
-** Custom packages
-
-Compile the =g.el= script and bind it to @@html:<kbd>M-g</kbd>@@.
-
-#+BEGIN_SRC elisp
- (byte-compile-file (concat user-emacs-directory "lisp/g.el") t)
- (global-set-key (kbd "M-g") 'g)
-#+END_SRC
-
-** use-package
-
-Initialize package.
-
-#+BEGIN_SRC elisp
- (require 'package)
-
- (add-to-list 'package-archives
- '("melpa" . "http://melpa.milkbox.net/packages/") t)
- (add-to-list 'package-archives
- '("melpa-stable" . "https://stable.melpa.org/packages/") t)
-
- (package-initialize)
-#+END_SRC
-
-I'm using use-package to handle my installed packages. I don't know if it's
-the best option or what because I haven't tested all the package managers
-for Emacs out there. After trying some custom functions to handle
-package-install, I decided on use-package because I feel more well-organized.
-
-#+BEGIN_SRC elisp
- (unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
-#+END_SRC
-
-Some =use-package= calls require =diminish.el= to be available. So, let's
-require it here on the very top.
-
-#+BEGIN_SRC elisp
-(use-package diminish
- :ensure t)
-#+END_SRC
-
* Project
First of all, load the silver searcher, which is a convenient and fast searcher.
@@ -727,6 +741,18 @@ remember some of these snippets, I've mapped @@html:<kbd>, h</kbd>@@ to
(global-set-key (kbd "C-c b") 'bool-flip-do-flip))
#+END_SRC
+=move-text= is a small package that allows you to move lines with a
+keybinding. This might be feasible with Evil mode, but still this might help
+when you want to move lines and keep the default registry empty:
+
+#+BEGIN_SRC elisp
+(use-package move-text
+ :ensure t
+ :bind
+ (("M-k" . move-text-up)
+ ("M-j" . move-text-down)))
+#+END_SRC
+
* Dired
I use dired mode mainly for attaching document into emails. That being said,
@@ -971,6 +997,16 @@ And repair some key bindings from Evil mode.
"\M-p" 'helm-projectile-switch-project))))
#+END_SRC
+=git-timemachine= is a package that goes hand-in-hand with Magit, and it
+provides a very easy way to go through the history of a file (while providing
+ways of jumping into Magit):
+
+#+BEGIN_SRC elisp
+(use-package git-timemachine
+ :ensure t
+ :bind (("C-x t m" . git-timemachine)))
+#+END_SRC
+
* mu4e
I use [[http://www.djcbsoftware.nl/code/mu/][mu]] and [[http://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]] to manage my email. The configuration for this has been taken