diff options
Diffstat (limited to 'emacs/init.org')
| -rw-r--r-- | emacs/init.org | 124 |
1 files changed, 80 insertions, 44 deletions
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 |
