From 0cb1beeaa7e8c3629aa383f868ad8f8b13511953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Alvari=C3=B1o?= Date: Mon, 18 Apr 2022 10:28:31 +0200 Subject: [PATCH] Fix some indent --- myconfig.org | 770 +++++++++++++++++++++++++-------------------------- 1 file changed, 385 insertions(+), 385 deletions(-) diff --git a/myconfig.org b/myconfig.org index 902ff4a..e8c9405 100644 --- a/myconfig.org +++ b/myconfig.org @@ -64,121 +64,121 @@ Some notes about [[https://github.com/jwiegley/use-package][use-package]] * Interface tweaks ** Some GUI optimizations - #+begin_src emacs-lisp - ;; sets default font - (set-face-attribute 'default nil :family "Mensch" :foundry "PfEd" :height 158) - - (setq inhibit-x-resources t) ; avoid problems with emacs daemon and cursor colors - (setq inhibit-startup-message t) ; Eliminate FSF startup msg - (setq frame-title-format "%b") ; Put filename in titlebar - (setq visible-bell t) ; Flash instead of beep - (set-scroll-bar-mode 'right) ; Scrollbar placement - (show-paren-mode t) ; Blinking cursor shows matching parentheses - (electric-pair-mode t) ; electric-pair-mode on - (setq column-number-mode t) ; Show column number of current cursor location - (mouse-wheel-mode t) ; wheel-mouse support - (setq fill-column 78) - (setq auto-fill-mode t) ; Set line width to 78 columns... - (setq-default indent-tabs-mode nil) ; Insert spaces instead of tabs - (setq-default tab-width 4) ; set default tab 4 spaces - (global-set-key "\r" 'newline-and-indent) ; turn autoindenting on - ;(set-default 'truncate-lines t) ; Truncate lines for all buffers - (fset 'yes-or-no-p 'y-or-n-p) ; shorter messages - (setq sentence-end-double-space nil) ; only one space - ; delete trailing whitespace before saving - (add-hook 'before-save-hook 'delete-trailing-whitespace) - ;; Enable line numbers for some modes - (dolist (mode '(;;text-mode-hook - prog-mode-hook - conf-mode-hook)) - (add-hook mode (lambda () (display-line-numbers-mode 1)))) - - ;; Override some modes which derive from the above - (dolist (mode '(org-mode-hook)) - (add-hook mode (lambda () (display-line-numbers-mode 0)))) - #+end_src +#+begin_src emacs-lisp + ;; sets default font + (set-face-attribute 'default nil :family "Mensch" :foundry "PfEd" :height 158) + + (setq inhibit-x-resources t) ; avoid problems with emacs daemon and cursor colors + (setq inhibit-startup-message t) ; Eliminate FSF startup msg + (setq frame-title-format "%b") ; Put filename in titlebar + (setq visible-bell t) ; Flash instead of beep + (set-scroll-bar-mode 'right) ; Scrollbar placement + (show-paren-mode t) ; Blinking cursor shows matching parentheses + (electric-pair-mode t) ; electric-pair-mode on + (setq column-number-mode t) ; Show column number of current cursor location + (mouse-wheel-mode t) ; wheel-mouse support + (setq fill-column 78) + (setq auto-fill-mode t) ; Set line width to 78 columns... + (setq-default indent-tabs-mode nil) ; Insert spaces instead of tabs + (setq-default tab-width 4) ; set default tab 4 spaces + (global-set-key "\r" 'newline-and-indent) ; turn autoindenting on + ;(set-default 'truncate-lines t) ; Truncate lines for all buffers + (fset 'yes-or-no-p 'y-or-n-p) ; shorter messages + (setq sentence-end-double-space nil) ; only one space + ; delete trailing whitespace before saving + (add-hook 'before-save-hook 'delete-trailing-whitespace) + ;; Enable line numbers for some modes + (dolist (mode '(;;text-mode-hook + prog-mode-hook + conf-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 1)))) + + ;; Override some modes which derive from the above + (dolist (mode '(org-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 0)))) +#+end_src ** Set encoding - Use utf-8 please - #+begin_src emacs-lisp - ;; Set encoding - (prefer-coding-system 'utf-8) - #+end_src +Use utf-8 please +#+begin_src emacs-lisp + ;; Set encoding + (prefer-coding-system 'utf-8) +#+end_src ** Some shortcuts - Useful shortcuts: - - Revert buffer (recargar) - - fichero org de configuración de emacs - - fichero org ppal, aquí está todo - - journal org file - - org para el blog público, ideas para el blog - - org para el blog privado - - org notes file: para tomar una nota rápida, no lo uso mucho - - phone org file: por si tomo notas en el teléfono, no lo uso mucho - #+begin_src emacs-lisp - (global-set-key (kbd "") 'revert-buffer) - ;; emacs configuration org file - (global-set-key - (kbd "\e\ec") - (lambda () (interactive) (find-file "~/.emacs.d/myconfig.org"))) - ;; Main org file - (global-set-key - (kbd "\e\ei") - (lambda () (interactive) (find-file "~/Dropbox/orgfiles/i.org"))) - ;; journal org file - (global-set-key - (kbd "\e\ej") - (lambda () (interactive) (find-file "~/Dropbox/orgfiles/journal.org"))) - ;; Notes file - (global-set-key - (kbd "\e\en") - (lambda () (interactive) (find-file "~/Dropbox/orgfiles/notes.org"))) - ;; public blog org file - (global-set-key - (kbd "\e\eb") - (lambda () (interactive) (find-file "~/Dropbox/orgfiles/b.org"))) - ;; private blog file - (global-set-key - (kbd "\e\ep") - (lambda () (interactive) (find-file "~/work/repos/Personal/blog/comacero_priv/content-org/blog_privado.org"))) - ;; phone org file - (global-set-key - (kbd "\e\eh") - (lambda () (interactive) (find-file "~/share/Mob_orgzly/phone.org"))) - - (global-set-key [C-tab] 'hippie-expand) ; expand - (global-set-key [C-kp-subtract] 'undo) ; [Undo] - ;; (global-set-key [C-kp-multiply] 'goto-line) ; old goto line - (global-set-key [C-kp-multiply] 'consult-goto-line) ; goto line - (global-set-key [C-kp-add] 'toggle-truncate-lines) ; truncate lines - (global-set-key [C-kp-divide] 'delete-trailing-whitespace) ; delete trailing whitespace - (global-set-key [C-kp-decimal] 'completion-at-point) ; complete at point - (global-set-key [C-M-prior] 'previous-buffer) ; previous-buffer - (global-set-key [C-M-next] 'next-buffer) ; next-buffer - #+end_src +Useful shortcuts: +- Revert buffer (recargar) +- fichero org de configuración de emacs +- fichero org ppal, aquí está todo +- journal org file +- org para el blog público, ideas para el blog +- org para el blog privado +- org notes file: para tomar una nota rápida, no lo uso mucho +- phone org file: por si tomo notas en el teléfono, no lo uso mucho +#+begin_src emacs-lisp + (global-set-key (kbd "") 'revert-buffer) + ;; emacs configuration org file + (global-set-key + (kbd "\e\ec") + (lambda () (interactive) (find-file "~/.emacs.d/myconfig.org"))) + ;; Main org file + (global-set-key + (kbd "\e\ei") + (lambda () (interactive) (find-file "~/Dropbox/orgfiles/i.org"))) + ;; journal org file + (global-set-key + (kbd "\e\ej") + (lambda () (interactive) (find-file "~/Dropbox/orgfiles/journal.org"))) + ;; Notes file + (global-set-key + (kbd "\e\en") + (lambda () (interactive) (find-file "~/Dropbox/orgfiles/notes.org"))) + ;; public blog org file + (global-set-key + (kbd "\e\eb") + (lambda () (interactive) (find-file "~/Dropbox/orgfiles/b.org"))) + ;; private blog file + (global-set-key + (kbd "\e\ep") + (lambda () (interactive) (find-file "~/work/repos/Personal/blog/comacero_priv/content-org/blog_privado.org"))) + ;; phone org file + (global-set-key + (kbd "\e\eh") + (lambda () (interactive) (find-file "~/share/Mob_orgzly/phone.org"))) + + (global-set-key [C-tab] 'hippie-expand) ; expand + (global-set-key [C-kp-subtract] 'undo) ; [Undo] + ;; (global-set-key [C-kp-multiply] 'goto-line) ; old goto line + (global-set-key [C-kp-multiply] 'consult-goto-line) ; goto line + (global-set-key [C-kp-add] 'toggle-truncate-lines) ; truncate lines + (global-set-key [C-kp-divide] 'delete-trailing-whitespace) ; delete trailing whitespace + (global-set-key [C-kp-decimal] 'completion-at-point) ; complete at point + (global-set-key [C-M-prior] 'previous-buffer) ; previous-buffer + (global-set-key [C-M-next] 'next-buffer) ; next-buffer +#+end_src ** Own map - Defines own key map - #+begin_src emacs-lisp - (define-prefix-command 'own-map) - (global-set-key (kbd "C-ñ") 'own-map) - (define-key own-map (kbd "y") 'aya-create) - (define-key own-map (kbd "e") 'aya-expand) - #+end_src +Defines own key map +#+begin_src emacs-lisp + (define-prefix-command 'own-map) + (global-set-key (kbd "C-ñ") 'own-map) + (define-key own-map (kbd "y") 'aya-create) + (define-key own-map (kbd "e") 'aya-expand) +#+end_src ** General (a new binding system) - Have a look at [[https://github.com/noctuid/general.el#key-features][doc]] - #+begin_src emacs-lisp - ;; (use-package general) - #+end_src +Have a look at [[https://github.com/noctuid/general.el#key-features][doc]] +#+begin_src emacs-lisp + ;; (use-package general) +#+end_src ** Syntax highlight - Set maximum colors - #+begin_src emacs-lisp - (cond ((fboundp 'global-font-lock-mode) ; Turn on font-lock (syntax highlighting) - (global-font-lock-mode t) ; in all modes that support it - (setq font-lock-maximum-decoration t))) ; Maximum colors - #+end_src +Set maximum colors +#+begin_src emacs-lisp + (cond ((fboundp 'global-font-lock-mode) ; Turn on font-lock (syntax highlighting) + (global-font-lock-mode t) ; in all modes that support it + (setq font-lock-maximum-decoration t))) ; Maximum colors +#+end_src ** Kill buffer quick Kill current buffer without questions @@ -208,43 +208,43 @@ See colors in emacs #+end_src ** which-key - Some help with composed hotkeys - #+begin_src emacs-lisp - (use-package which-key - :diminish - :config - (which-key-mode) - (setq which-key-idle-delay 0.3) - ) - #+end_src +Some help with composed hotkeys +#+begin_src emacs-lisp + (use-package which-key + :diminish + :config + (which-key-mode) + (setq which-key-idle-delay 0.3) + ) +#+end_src ** ace-windows - To jump to different windows easily - #+begin_src emacs-lisp - (use-package ace-window - :init - (global-set-key [remap other-window] 'ace-window) - (custom-set-faces - '(aw-leading-char-face - ((t (:inherit ace-jump-face-foreground :height 3.0))))) - ) - #+end_src +To jump to different windows easily +#+begin_src emacs-lisp + (use-package ace-window + :init + (global-set-key [remap other-window] 'ace-window) + (custom-set-faces + '(aw-leading-char-face + ((t (:inherit ace-jump-face-foreground :height 3.0))))) + ) +#+end_src ** PCRE2el - Perl Compatible Regexes - #+begin_src emacs-lisp - (use-package pcre2el - :config - (pcre-mode +1)) - #+end_src +Perl Compatible Regexes +#+begin_src emacs-lisp + (use-package pcre2el + :config + (pcre-mode +1)) +#+end_src ** Enable narrowing (DANGER) - C-x n ... - #+begin_src emacs-lisp - (put 'narrow-to-defun 'disabled nil) - (put 'narrow-to-page 'disabled nil) - (put 'narrow-to-region 'disabled nil) - #+end_src +C-x n ... +#+begin_src emacs-lisp + (put 'narrow-to-defun 'disabled nil) + (put 'narrow-to-page 'disabled nil) + (put 'narrow-to-region 'disabled nil) +#+end_src ** Insert-date #+begin_src emacs-lisp @@ -267,21 +267,21 @@ See colors in emacs #+end_src * doom-modeline - A fancy modeline. Remember to execute =M-x all-the-icons-install-fonts= - See [[http://sodaware.sdf.org/notes/emacs-daemon-doom-modeline-icons/][this]] for fixing icons in terminal +A fancy modeline. Remember to execute =M-x all-the-icons-install-fonts= +See [[http://sodaware.sdf.org/notes/emacs-daemon-doom-modeline-icons/][this]] for fixing icons in terminal - #+begin_src emacs-lisp - (use-package all-the-icons - ) - (use-package doom-modeline - :init - (doom-modeline-mode 1) - (setq doom-modeline-icon 1) ;; this fixes icons in emacs-client - :custom - (doom-modeline-height 15) - ;;(doom-modeline-icon (display-graphic-p)) - ) - #+end_src +#+begin_src emacs-lisp + (use-package all-the-icons + ) + (use-package doom-modeline + :init + (doom-modeline-mode 1) + (setq doom-modeline-icon 1) ;; this fixes icons in emacs-client + :custom + (doom-modeline-height 15) + ;;(doom-modeline-icon (display-graphic-p)) + ) +#+end_src * color-theme Get some colour in your life @@ -328,219 +328,219 @@ Try =M-x consult-theme= * Completion systems ** Vertico (the choosed one) - Have a look [[https://github.com/minad/vertico][here]] - #+begin_src emacs-lisp - (use-package vertico - :init - (vertico-mode +1) - :config - ;; Different scroll margin - ;; (setq vertico-scroll-margin 0) - - ;; Show more candidates - ;; (setq vertico-count 20) - - ;; Grow and shrink the Vertico minibuffer - ;; (setq vertico-resize t) - - ;; Optionally enable cycling for `vertico-next' and `vertico-previous'. - (setq vertico-cycle t) - ) - #+end_src +Have a look [[https://github.com/minad/vertico][here]] +#+begin_src emacs-lisp + (use-package vertico + :init + (vertico-mode +1) + :config + ;; Different scroll margin + ;; (setq vertico-scroll-margin 0) + + ;; Show more candidates + ;; (setq vertico-count 20) + + ;; Grow and shrink the Vertico minibuffer + ;; (setq vertico-resize t) + + ;; Optionally enable cycling for `vertico-next' and `vertico-previous'. + (setq vertico-cycle t) + ) +#+end_src *** Orderless - Have a look at [[https://github.com/oantolin/orderless][repo]] - #+begin_src emacs-lisp - (use-package orderless - :init - (icomplete-mode) - :custom - (completion-styles '(orderless)) - (completion-category-defaults nil) - (completion-category-overrides '((file (styles partial-completion)))) - ) - #+end_src +Have a look at [[https://github.com/oantolin/orderless][repo]] +#+begin_src emacs-lisp + (use-package orderless + :init + (icomplete-mode) + :custom + (completion-styles '(orderless)) + (completion-category-defaults nil) + (completion-category-overrides '((file (styles partial-completion)))) + ) +#+end_src *** Marginalia - Check the [[https://github.com/minad/marginalia][doc]] - #+begin_src emacs-lisp - (use-package marginalia - :init - (marginalia-mode +1) - :bind - (; ("M-A" . marginalia-cycle) ;; Uncomment for global bind - :map minibuffer-local-map - ("M-A" . marginalia-cycle)) - ) - #+end_src +Check the [[https://github.com/minad/marginalia][doc]] +#+begin_src emacs-lisp + (use-package marginalia + :init + (marginalia-mode +1) + :bind + (; ("M-A" . marginalia-cycle) ;; Uncomment for global bind + :map minibuffer-local-map + ("M-A" . marginalia-cycle)) + ) +#+end_src * Consult and Embark Consult is a collection of programs using emacs =completing-read= You must read [[https://github.com/minad/consult][the doc]]! - #+begin_src emacs-lisp - (use-package consult - :bind (("C-c h" . consult-history) - ("C-c m" . consult-mode-command) - ("C-c k" . consult-kmacro) - ;; C-x bindings (ctl-x-map) - ("C-s" . consult-line) ; orig. isearch-forward - ("C-c j" . consult-imenu) - ("C-x M-:" . consult-complex-command) ; orig. repeat-complex-command - ("C-x b" . consult-buffer) ; orig. switch-to-buffer - :map minibuffer-local-map - ("C-r" . consult-history) - ) - ) - #+end_src + #+begin_src emacs-lisp + (use-package consult + :bind (("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-s" . consult-line) ; orig. isearch-forward + ("C-c j" . consult-imenu) + ("C-x M-:" . consult-complex-command) ; orig. repeat-complex-command + ("C-x b" . consult-buffer) ; orig. switch-to-buffer + :map minibuffer-local-map + ("C-r" . consult-history) + ) + ) + #+end_src ** Embark [[https://github.com/oantolin/embark][The doc]] - #+begin_src emacs-lisp - (use-package embark - :bind - (("C-+" . embark-act) ;; pick some comfortable binding - ("C-;" . embark-dwim) ;; good alternative: M-. - ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' + #+begin_src emacs-lisp + (use-package embark + :bind + (("C-+" . embark-act) ;; pick some comfortable binding + ("C-;" . embark-dwim) ;; good alternative: M-. + ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' - :init + :init - ;; Optionally replace the key help with a completing-read interface - (setq prefix-help-command #'embark-prefix-help-command) + ;; Optionally replace the key help with a completing-read interface + (setq prefix-help-command #'embark-prefix-help-command) - :config + :config - ;; Hide the mode line of the Embark live/completions buffers - (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" - nil - (window-parameters (mode-line-format . none)))) - ) + ;; Hide the mode line of the Embark live/completions buffers + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none)))) + ) - ;; Consult users will also want the embark-consult package. - (use-package embark-consult - :after (embark consult) - :demand t ; only necessary if you have the hook below - ;; if you want to have consult previews as you move around an - ;; auto-updating embark collect buffer - :hook - (embark-collect-mode . consult-preview-at-point-mode)) - #+end_src + ;; Consult users will also want the embark-consult package. + (use-package embark-consult + :after (embark consult) + :demand t ; only necessary if you have the hook below + ;; if you want to have consult previews as you move around an + ;; auto-updating embark collect buffer + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + #+end_src * Editor Enhancements ** ace-windows - To jump to different windows easily - #+begin_src emacs-lisp - (use-package ace-window - :ensure t - :init - (global-set-key [remap other-window] 'ace-window) - (custom-set-faces - '(aw-leading-char-face - ((t (:inherit ace-jump-face-foreground :height 3.0))))) - ) - #+end_src +To jump to different windows easily +#+begin_src emacs-lisp + (use-package ace-window + :ensure t + :init + (global-set-key [remap other-window] 'ace-window) + (custom-set-faces + '(aw-leading-char-face + ((t (:inherit ace-jump-face-foreground :height 3.0))))) + ) +#+end_src ** ripgrep - [[https://github.com/dajva/rg.el][rg repo]] - #+begin_src emacs-lisp - (use-package rg - :bind - ("C-c s" . rg-menu)) - #+end_src +[[https://github.com/dajva/rg.el][rg repo]] +#+begin_src emacs-lisp + (use-package rg + :bind + ("C-c s" . rg-menu)) +#+end_src ** Buffer management - [[https://github.com/alphapapa/bufler.el][Bufler repo]] - #+begin_src emacs-lisp - (use-package bufler - ) - (defun slv/bufler-one-window (&optional force-refresh) - (interactive "P") - (bufler-list) - (delete-other-windows) - ) +[[https://github.com/alphapapa/bufler.el][Bufler repo]] +#+begin_src emacs-lisp + (use-package bufler + ) + (defun slv/bufler-one-window (&optional force-refresh) + (interactive "P") + (bufler-list) + (delete-other-windows) + ) - (global-set-key (kbd "C-x C-b") 'slv/bufler-one-window) - #+end_src + (global-set-key (kbd "C-x C-b") 'slv/bufler-one-window) +#+end_src ** Hydra - [[https://github.com/abo-abo/hydra][Hydra repo]] - See [[https://readingworldmagazine.com/emacs/2020-02-27-emacs-hydra-set-up-code/][this]] someday - #+begin_src emacs-lisp - (use-package hydra) - #+end_src +[[https://github.com/abo-abo/hydra][Hydra repo]] +See [[https://readingworldmagazine.com/emacs/2020-02-27-emacs-hydra-set-up-code/][this]] someday +#+begin_src emacs-lisp + (use-package hydra) +#+end_src *** Hydra for toggle - #+begin_src emacs-lisp - (global-set-key - (kbd " t") - (defhydra hydra-toggle (:color pink) - " - _a_ abbrev-mode: %`abbrev-mode - _d_ debug-on-error: %`debug-on-error - _f_ auto-fill-mode: %`auto-fill-function - _l_ disp-line-num %`display-line-numbers-mode - _s_ flyspell-mode: %`flyspell-mode - _t_ truncate-lines: %`truncate-lines - _w_ whitespace-mode: %`global-whitespace-mode - " - ("a" abbrev-mode nil) - ("d" toggle-debug-on-error nil) - ("f" auto-fill-mode nil) - ("l" display-line-numbers-mode nil) - ("s" flyspell-mode nil) - ("t" toggle-truncate-lines nil) - ("w" whitespace-mode nil) - ("q" nil "quit")) - ) - #+end_src +#+begin_src emacs-lisp + (global-set-key + (kbd " t") + (defhydra hydra-toggle (:color pink) + " + _a_ abbrev-mode: %`abbrev-mode + _d_ debug-on-error: %`debug-on-error + _f_ auto-fill-mode: %`auto-fill-function + _l_ disp-line-num %`display-line-numbers-mode + _s_ flyspell-mode: %`flyspell-mode + _t_ truncate-lines: %`truncate-lines + _w_ whitespace-mode: %`global-whitespace-mode + " + ("a" abbrev-mode nil) + ("d" toggle-debug-on-error nil) + ("f" auto-fill-mode nil) + ("l" display-line-numbers-mode nil) + ("s" flyspell-mode nil) + ("t" toggle-truncate-lines nil) + ("w" whitespace-mode nil) + ("q" nil "quit")) + ) +#+end_src *** Hydra for navigation - #+begin_src emacs-lisp - (global-set-key - (kbd " j") - (defhydra gotoline - (:pre (linum-mode 1) - :post (linum-mode -1)) - "goto" - ("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top" :column "Window") - ("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom") - ("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle") - ("c" recenter-top-bottom "recenter") - ("s" (lambda () (interactive)(beginning-of-buffer)) "begin" :column "Buffer") - ("e" (lambda () (interactive)(end-of-buffer)) "end") - ("n" next-line "down" :column "Line") - ("p" (lambda () (interactive) (forward-line -1)) "up") - ("g" goto-line "consult-goto-line") - ("i" consult-imenu "cons-imenu" :column "Header") - ("o" consult-org-heading "cons-org-head") - ("q" nil "quit") - ) - ) - #+end_src +#+begin_src emacs-lisp + (global-set-key + (kbd " j") + (defhydra gotoline + (:pre (linum-mode 1) + :post (linum-mode -1)) + "goto" + ("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top" :column "Window") + ("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom") + ("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle") + ("c" recenter-top-bottom "recenter") + ("s" (lambda () (interactive)(beginning-of-buffer)) "begin" :column "Buffer") + ("e" (lambda () (interactive)(end-of-buffer)) "end") + ("n" next-line "down" :column "Line") + ("p" (lambda () (interactive) (forward-line -1)) "up") + ("g" goto-line "consult-goto-line") + ("i" consult-imenu "cons-imenu" :column "Header") + ("o" consult-org-heading "cons-org-head") + ("q" nil "quit") + ) + ) +#+end_src ** avy Quick navigation to words - #+begin_src emacs-lisp - (use-package avy - :config - (avy-setup-default) - :bind( - :map own-map - ("jj" . avy-goto-char) - ("j2" . avy-goto-char-2) - ("jw" . avy-goto-word-1) - ("jl" . avy-goto-line) - ) - ) - #+end_src +#+begin_src emacs-lisp + (use-package avy + :config + (avy-setup-default) + :bind( + :map own-map + ("jj" . avy-goto-char) + ("j2" . avy-goto-char-2) + ("jw" . avy-goto-word-1) + ("jl" . avy-goto-line) + ) + ) +#+end_src ** iedit - [[https://github.com/victorhge/iedit][iedit]]: Interactive edition of all ocurrences of X - #+begin_src emacs-lisp - (use-package iedit - :bind - ("C-ç" . iedit-mode)) - #+end_src +[[https://github.com/victorhge/iedit][iedit]]: Interactive edition of all ocurrences of X +#+begin_src emacs-lisp + (use-package iedit + :bind + ("C-ç" . iedit-mode)) +#+end_src * Project management with projectile - [[https://github.com/bbatsov/projectile][Projectile in github]] @@ -560,70 +560,70 @@ Quick navigation to words - [[https://github.com/magit/magit][magit]] interface to git from emacs (there are a lot of tutos) - [[https://github.com/emacsorphanage/git-gutter][git-gutter]] See lines changed in buffer edited - [[https://github.com/emacsmirror/git-timemachine][git-time-machine]] Visit previous git versions of edited buffer - #+begin_src emacs-lisp - ;; dirty hack to avoid problem when pushing - (setenv "SSH_AUTH_SOCK" "/run/user/1000/keyring/ssh") - - (use-package magit - :bind - ("C-x g" . magit-status) - :config - (setq magit-status-margin - '(t "%Y-%m-%d %H:%M " magit-log-margin-width t 18)) - ) +#+begin_src emacs-lisp + ;; dirty hack to avoid problem when pushing + (setenv "SSH_AUTH_SOCK" "/run/user/1000/keyring/ssh") - (use-package git-gutter - :init - (global-git-gutter-mode +1) - ) - (defhydra hydra-git-gutter (:body-pre (git-gutter-mode 1) - :hint nil) - " - Git gutter: - _j_: next hunk _s_tage hunk _q_uit - _k_: previous hunk _r_evert hunk _Q_uit and deactivate git-gutter - ^ ^ _p_opup hunk - _h_: first hunk - _l_: last hunk set start _R_evision - " - ("j" git-gutter:next-hunk) - ("k" git-gutter:previous-hunk) - ("h" (progn (goto-char (point-min)) - (git-gutter:next-hunk 1))) - ("l" (progn (goto-char (point-min)) - (git-gutter:previous-hunk 1))) - ("s" git-gutter:stage-hunk) - ("r" git-gutter:revert-hunk) - ("p" git-gutter:popup-hunk) - ("R" git-gutter:set-start-revision) - ("q" nil :color blue) - ("Q" (progn (git-gutter-mode -1) - ;; git-gutter-fringe doesn't seem to - ;; clear the markup right away - (sit-for 0.1) - (git-gutter:clear)) - :color blue)) - (global-set-key (kbd "M-g M-g") 'hydra-git-gutter/body) - - (use-package git-timemachine - ) - #+end_src + (use-package magit + :bind + ("C-x g" . magit-status) + :config + (setq magit-status-margin + '(t "%Y-%m-%d %H:%M " magit-log-margin-width t 18)) + ) + + (use-package git-gutter + :init + (global-git-gutter-mode +1) + ) + (defhydra hydra-git-gutter (:body-pre (git-gutter-mode 1) + :hint nil) + " + Git gutter: + _j_: next hunk _s_tage hunk _q_uit + _k_: previous hunk _r_evert hunk _Q_uit and deactivate git-gutter + ^ ^ _p_opup hunk + _h_: first hunk + _l_: last hunk set start _R_evision + " + ("j" git-gutter:next-hunk) + ("k" git-gutter:previous-hunk) + ("h" (progn (goto-char (point-min)) + (git-gutter:next-hunk 1))) + ("l" (progn (goto-char (point-min)) + (git-gutter:previous-hunk 1))) + ("s" git-gutter:stage-hunk) + ("r" git-gutter:revert-hunk) + ("p" git-gutter:popup-hunk) + ("R" git-gutter:set-start-revision) + ("q" nil :color blue) + ("Q" (progn (git-gutter-mode -1) + ;; git-gutter-fringe doesn't seem to + ;; clear the markup right away + (sit-for 0.1) + (git-gutter:clear)) + :color blue)) + (global-set-key (kbd "M-g M-g") 'hydra-git-gutter/body) + + (use-package git-timemachine + ) +#+end_src * yasnippet - [[https://github.com/joaotavora/yasnippet][yasnippet]] (there are many tutorials) - [[https://github.com/abo-abo/auto-yasnippet][auto-yasnippet]] (disposable snippets) - [[https://github.com/AndreaCrotti/yasnippet-snippets][yasnippets-snippets]] Place your own snippets on =~/.cache/emacs/etc/yasnippet/snippets= - #+begin_src emacs-lisp - (use-package yasnippet - :init - (yas-global-mode 1) - ) - (use-package auto-yasnippet - ) - (use-package yasnippet-snippets - ) - #+end_src +#+begin_src emacs-lisp + (use-package yasnippet + :init + (yas-global-mode 1) + ) + (use-package auto-yasnippet + ) + (use-package yasnippet-snippets + ) +#+end_src * company Autocompletion with [[https://company-mode.github.io/][company]]