Add no-littering and some notes

main
Sergio Alvariño 3 years ago
parent c4ba614e63
commit 00c019ddaf

@ -22,9 +22,9 @@
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/") (setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
url-history-file (expand-file-name "url/history" user-emacs-directory)) 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 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)) (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 ;; Install org-mode

@ -8,6 +8,17 @@
- [[https://github.com/daviwil/emacs-from-scratch/blob/master/Emacs.org][System Crafters emacs-from-scratch]] - [[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]] - [[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 * use-package tips
Some notes about *use-package* Some notes about *use-package*
- *:ensure* if true will install the package if not installed - *:ensure* if true will install the package if not installed
@ -32,27 +43,34 @@
que queremos cargar de inmediato que queremos cargar de inmediato
- *:diminish* and *:delight* changes minormode display in status line - *: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 * Interface tweaks
** Some GUI optimizations ** Some GUI optimizations
#+begin_src emacs-lisp #+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) (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 inhibit-x-resources t) ; avoid problems with emacs daemon and cursor colors
(setq visible-bell t) ; Flash instead of beep (setq inhibit-startup-message t) ; Eliminate FSF startup msg
(set-scroll-bar-mode 'right) ; Scrollbar placement (setq frame-title-format "%b") ; Put filename in titlebar
(show-paren-mode t) ; Blinking cursor shows matching parentheses (setq visible-bell t) ; Flash instead of beep
(electric-pair-mode t) ; electric-pair-mode on (set-scroll-bar-mode 'right) ; Scrollbar placement
(setq column-number-mode t) ; Show column number of current cursor location (show-paren-mode t) ; Blinking cursor shows matching parentheses
(mouse-wheel-mode t) ; wheel-mouse support (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 fill-column 78)
(setq auto-fill-mode t) ; Set line width to 78 columns... (setq auto-fill-mode t) ; Set line width to 78 columns...
(setq-default indent-tabs-mode nil) ; Insert spaces instead of tabs (setq-default indent-tabs-mode nil) ; Insert spaces instead of tabs
(setq-default tab-width 4) ; set default tab 4 spaces (setq-default tab-width 4) ; set default tab 4 spaces
(global-set-key "\r" 'newline-and-indent) ; turn autoindenting on (global-set-key "\r" 'newline-and-indent) ; turn autoindenting on
;(set-default 'truncate-lines t) ; Truncate lines for all buffers ;(set-default 'truncate-lines t) ; Truncate lines for all buffers
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p) ; shorter messages
(setq sentence-end-double-space nil) (setq sentence-end-double-space nil) ; only one space
; delete trailing whitespace before saving ; delete trailing whitespace before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace) (add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Enable line numbers for some modes ;; Enable line numbers for some modes
@ -133,7 +151,7 @@
(define-key own-map (kbd "e") 'aya-expand) (define-key own-map (kbd "e") 'aya-expand)
#+end_src #+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]] Have a look at [[https://github.com/noctuid/general.el#key-features][doc]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; (use-package general) ;; (use-package general)
@ -152,12 +170,12 @@
#+begin_src emacs-lisp #+begin_src emacs-lisp
;;------------------------------------------------------------ ;;------------------------------------------------------------
;; Kill current buffer with C-Supr ;; Kill current buffer with C-Supr
(defun geosoft-kill-buffer () (defun slv-kill-buffer ()
;; Kill default buffer without the extra emacs questions ;; Kill default buffer without the extra emacs questions
(interactive) (interactive)
(kill-buffer (buffer-name)) (kill-buffer (buffer-name))
(set-name)) (set-name))
(global-set-key [C-delete] 'geosoft-kill-buffer) (global-set-key [C-delete] 'slv-kill-buffer)
#+end_src #+end_src
** rainbow-delimiters ** rainbow-delimiters
@ -219,7 +237,7 @@
;; (use-package modus-operandi-theme) ;; (use-package modus-operandi-theme)
(use-package modus-themes) (use-package modus-themes)
;; (load-theme 'modus-operandi t) ;; (load-theme 'modus-operandi t)
(load-theme 'modus-vivendi t) ;; (load-theme 'modus-vivendi t)
(use-package doom-themes (use-package doom-themes
:config :config
@ -404,11 +422,13 @@
("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top") ("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top")
("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom") ("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom")
("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle") ("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle")
("s" (lambda () (interactive)(beginning-of-buffer)) "begin")
("e" (lambda () (interactive)(end-of-buffer)) "end") ("e" (lambda () (interactive)(end-of-buffer)) "end")
("c" recenter-top-bottom "recenter") ("c" recenter-top-bottom "recenter")
("n" next-line "down") ("n" next-line "down")
("p" (lambda () (interactive) (forward-line -1)) "up") ("p" (lambda () (interactive) (forward-line -1)) "up")
("g" goto-line "goto-line") ("g" goto-line "goto-line")
("q" nil "quit")
) )
) )
#+end_src #+end_src

Loading…
Cancel
Save