diff --git a/init.el b/init.el index 4100424..420e1db 100644 --- a/init.el +++ b/init.el @@ -22,9 +22,9 @@ (setq user-emacs-directory (expand-file-name "~/.cache/emacs/") url-history-file (expand-file-name "url/history" user-emacs-directory)) ;; Use no-littering to automatically set common paths to the new user-emacs-directory -;; (use-package no-littering) +(use-package no-littering) (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) - +(load-file custom-file) ;; custom-file not loaded with fancy home variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install org-mode diff --git a/myconfig.org b/myconfig.org index 1fd4e69..7f0848c 100644 --- a/myconfig.org +++ b/myconfig.org @@ -8,6 +8,17 @@ - [[https://github.com/daviwil/emacs-from-scratch/blob/master/Emacs.org][System Crafters emacs-from-scratch]] - [[https://github.com/SystemCrafters/crafter-configs][System Crafters configs compilation]] +* Before this file loads +** =early-init.el= has been loaded. +This file inhibits package.el for loading packages +** =init.el= has been loaded +This file: +- Set all that it's needed for =straight.el= working as package manager +- **IMPORTANT** Changes the =user-emacs-directory= from =~/.emacs.d= to =~/.cache/emacs=. This can be really important in case you change something fundamental in emacs configuration +- Load the =no-littering= package (see [[https://github.com/emacscollective/no-littering][doc]]) This package sets out to fix this by changing the values of path variables to put configuration files in =no-littering-etc-directory= (this will be =~/.cache/emacs/etc/= for this configuration) and persistent data files in =no-littering-var-directory= (for me: =~/.cache/emacs/var/=), and by using descriptive file names and subdirectories when appropriate. This is similar to a color-theme; a "path-theme" if you will. +- Tries to install =org-mode= just to be sure to have the last release +- Loads the newer of this two files: =myconfig.org= and =myconfig.el=. In other words, if there are no new changes in =myconfig.org= it loads =myconfig.el= (it's faster) + * use-package tips Some notes about *use-package* - *:ensure* if true will install the package if not installed @@ -32,27 +43,34 @@ que queremos cargar de inmediato - *:diminish* and *:delight* changes minormode display in status line +* Personal info +#+begin_src elisp +(setq user-full-name "Sergio Alvariño" + user-mail-address "salvari@protonmail.com") +#+end_src * Interface tweaks ** Some GUI optimizations #+begin_src emacs-lisp - (setq inhibit-x-resources t) ; avoid problems with emacs daemon and cursor colors + ;; sets default font (set-face-attribute 'default nil :family "Mensch" :foundry "PfEd" :height 158) - (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 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) - (setq sentence-end-double-space nil) + (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 @@ -133,7 +151,7 @@ (define-key own-map (kbd "e") 'aya-expand) #+end_src -** General (a new binding system) +** 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) @@ -152,12 +170,12 @@ #+begin_src emacs-lisp ;;------------------------------------------------------------ ;; Kill current buffer with C-Supr - (defun geosoft-kill-buffer () + (defun slv-kill-buffer () ;; Kill default buffer without the extra emacs questions (interactive) (kill-buffer (buffer-name)) (set-name)) - (global-set-key [C-delete] 'geosoft-kill-buffer) + (global-set-key [C-delete] 'slv-kill-buffer) #+end_src ** rainbow-delimiters @@ -219,7 +237,7 @@ ;; (use-package modus-operandi-theme) (use-package modus-themes) ;; (load-theme 'modus-operandi t) - (load-theme 'modus-vivendi t) + ;; (load-theme 'modus-vivendi t) (use-package doom-themes :config @@ -404,11 +422,13 @@ ("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top") ("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom") ("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle") + ("s" (lambda () (interactive)(beginning-of-buffer)) "begin") ("e" (lambda () (interactive)(end-of-buffer)) "end") ("c" recenter-top-bottom "recenter") ("n" next-line "down") ("p" (lambda () (interactive) (forward-line -1)) "up") ("g" goto-line "goto-line") + ("q" nil "quit") ) ) #+end_src