Compare commits

...

9 Commits

Author SHA1 Message Date
Lucien Cartier-Tilet b598891ad7
[Git] Add Email credentials, change default editor, remove autocrlf 2021-04-17 12:56:45 +02:00
Lucien Cartier-Tilet 0b2ba3eaa0
[Emacs] Automatic, Nord-themed dark mode for PDFs 2021-04-17 12:56:44 +02:00
Lucien Cartier-Tilet e6ea1aecbb
[Emacs] Better shortcut for terminals, remove reduntant ones
Shortcut `SPC o '' now launches `eshell-new' instead of just plain
`eshell', a new shortcut invokes `vterm', and the shortcut for
`helm-man-woman' is removed in favor of the default one in Spacemacs
2021-04-17 12:56:37 +02:00
Lucien Cartier-Tilet e53e019306
[Bin] Reorganize and re-enable some scripts
Due to EXWM being disabled for the time being and switching back to
AwesomeWM, some scripts are re-enabled. The execution order is also
modified.
2021-04-17 12:56:25 +02:00
Lucien Cartier-Tilet 98720ace22
[Emacs] Add ignored directories and files to recentf 2021-04-17 12:56:23 +02:00
Lucien Cartier-Tilet 8c640f4118
[Emacs] Add TODO to Eshell banner 2021-04-17 12:56:23 +02:00
Lucien Cartier-Tilet a7d14158dc
[Emacs] Whitespace, move header up 2021-04-17 12:56:23 +02:00
Lucien Cartier-Tilet 1bc386e012
[Emacs] Disable EXWM for now 2021-04-17 12:56:17 +02:00
Lucien Cartier-Tilet 8eaa12e619
[Emacs] Apparently this is buggy
EXWM does not work properly if this is used, instead of different
workspaces EXWM will create various frames on top of each other.
2021-04-17 12:56:17 +02:00
4 changed files with 142 additions and 107 deletions

View File

@ -3,10 +3,9 @@
name = Lucien Cartier-Tilet
signingkey = BD7789E705CB8DCA
[core]
# editor = vim
editor = emacsclient -c -a emacs
whitespace = fix,-indent-with-non-tab,trailing-space
excludesfile = /home/phundrak/dotfiles/.gitignore_global
autocrlf = false
[web]
browser = firefox
[color]
@ -73,6 +72,11 @@
####
u = reset --
unstage = reset --
[sendemail]
smtpserver = mail.phundrak.com
smtpuser = lucien@phundrak.com
smtpencryption = tls
smtpserverport = 587
[magithub]
online = true
[magithub "status"]

View File

@ -77,8 +77,8 @@ This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
(require 'exwm)
(exwm-enable)
;;(require 'exwm)
;;(exwm-enable)
(load phundrak--dotspacemacs-uc))
(defun dotspacemacs/emacs-custom-settings ()
@ -122,7 +122,7 @@ This function is called at the very end of Spacemacs initialization."
'(objed-cursor-color "#ff6c6b")
'(org-export-headline-levels 4)
'(package-selected-packages
'(org-appear yasnippet-snippets yapfify yaml-mode xkcd x86-lookup wttrin xterm-color ws-butler wrap-region winum which-key web-mode web-beautify volatile-highlights vmd-mode visual-fill-column vi-tilde-fringe uuidgen use-package unfill undo-tree twittering-mode toml-mode toc-org tide typescript-mode tagedit systemd stickyfunc-enhance srefactor spaceline smeargle slim-mode sicp shell-pop selectric-mode scss-mode sass-mode restclient-helm restart-emacs rainbow-mode rainbow-identifiers rainbow-delimiters racer pyvenv pytest pyenv-mode py-isort pug-mode pony-mode plantuml-mode pip-requirements pinentry persp-mode pcre2el paradox spinner ox-ssh ox-reveal ox-gfm outorg orgit org-tree-slide org-sidebar org-ql peg ov org-super-agenda ts org-ref pdf-tools key-chord ivy org-projectile org-category-capture org-present org-pomodoro org-mime org-download org-bullets open-junk-file ob-restclient ob-latex-as-png ob-http nginx-mode neotree nasm-mode mwim multi-term mu4e-maildirs-extension mu4e-alert ht alert log4e gntp move-text mmm-mode markdown-toc magit-gitflow magit-popup magit macrostep lua-mode lorem-ipsum livid-mode skewer-mode live-py-mode linum-relative link-hint js2-refactor multiple-cursors js2-mode js-doc insert-shebang info-colors indent-guide imenu-list ibuffer-projectile hydra lv hy-mode dash-functional hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-themes helm-swoop helm-pydoc helm-projectile projectile helm-mode-manager helm-make helm-gitignore request helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-bibtex bibtex-completion parsebib helm-ag haml-mode graphviz-dot-mode google-translate golden-ratio gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-commit with-editor gh-md geiser fuzzy flyspell-correct-helm flyspell-correct flycheck-rust flycheck-pos-tip flycheck pkg-info epl flx-ido flx fish-mode fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist highlight evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg eval-sexp-fu eshell-z eshell-syntax-highlighting eshell-prompt-extras esh-help emmet-mode elisp-slime-nav elfeed-web simple-httpd elfeed-org elfeed-goodies ace-jump-mode noflet powerline popwin elfeed elcord edit-indirect dumb-jump dockerfile-mode docker transient tablist json-mode docker-tramp json-snatcher json-reformat disaster diredfl dired-git-info diminish define-word cython-mode csv-mode company-web web-completion-data company-statistics company-shell company-restclient restclient know-your-http-well company-quickhelp pos-tip company-emacs-eclim eclim company-c-headers company-auctex company-anaconda company column-enforce-mode color-identifiers-mode coffee-mode cmake-mode clean-aindent-mode clang-format cargo markdown-mode rust-mode caddyfile-mode loop bind-map bind-key biblio biblio-core auto-yasnippet yasnippet auto-highlight-symbol auto-dictionary auto-compile packed auctex anaconda-mode pythonic f dash s aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core async ac-ispell auto-complete popup nord-theme))
'(org-appear yasnippet-snippets yapfify yaml-mode xkcd x86-lookup wttrin xterm-color ws-butler wrap-region winum which-key web-mode web-beautify volatile-highlights vmd-mode visual-fill-column vi-tilde-fringe uuidgen use-package unfill undo-tree twittering-mode toml-mode toc-org tide typescript-mode tagedit systemd stickyfunc-enhance srefactor spaceline smeargle slim-mode sicp shell-pop selectric-mode scss-mode sass-mode restclient-helm restart-emacs rainbow-mode rainbow-identifiers rainbow-delimiters racer pyvenv pytest pyenv-mode py-isort pug-mode pony-mode plantuml-mode pip-requirements pinentry persp-mode pcre2el paradox spinner ox-ssh ox-reveal ox-gfm outorg orgit org-tree-slide org-sidebar org-ql peg ov org-super-agenda ts key-chord ivy org-projectile org-category-capture org-present org-pomodoro org-mime org-download org-bullets open-junk-file ob-restclient ob-latex-as-png ob-http nginx-mode neotree nasm-mode mwim multi-term mu4e-maildirs-extension mu4e-alert ht alert log4e gntp move-text mmm-mode markdown-toc magit-gitflow magit-popup magit macrostep lua-mode lorem-ipsum livid-mode skewer-mode live-py-mode linum-relative link-hint js2-refactor multiple-cursors js2-mode js-doc insert-shebang info-colors indent-guide imenu-list ibuffer-projectile hydra lv hy-mode dash-functional hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-themes helm-swoop helm-pydoc helm-projectile projectile helm-mode-manager helm-make helm-gitignore request helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-bibtex bibtex-completion parsebib helm-ag haml-mode graphviz-dot-mode google-translate golden-ratio gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-commit with-editor gh-md geiser fuzzy flyspell-correct-helm flyspell-correct flycheck-rust flycheck-pos-tip flycheck pkg-info epl flx-ido flx fish-mode fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist highlight evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg eval-sexp-fu eshell-z eshell-syntax-highlighting eshell-prompt-extras esh-help emmet-mode elisp-slime-nav elfeed-web simple-httpd elfeed-org elfeed-goodies ace-jump-mode noflet powerline popwin elfeed elcord edit-indirect dumb-jump dockerfile-mode docker transient tablist json-mode docker-tramp json-snatcher json-reformat disaster diredfl dired-git-info diminish define-word cython-mode csv-mode company-web web-completion-data company-statistics company-shell company-restclient restclient know-your-http-well company-quickhelp pos-tip company-emacs-eclim eclim company-c-headers company-auctex company-anaconda company column-enforce-mode color-identifiers-mode coffee-mode cmake-mode clean-aindent-mode clang-format cargo markdown-mode rust-mode caddyfile-mode loop bind-map bind-key biblio biblio-core auto-yasnippet yasnippet auto-highlight-symbol auto-dictionary auto-compile packed auctex anaconda-mode pythonic f dash s aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core async ac-ispell auto-complete popup nord-theme))
'(pdf-view-midnight-colors '("#655370" . "#fbf8ef"))
'(safe-local-variable-values
'((org-confirm-babel-evaluate)

View File

@ -30,16 +30,16 @@ of said command running.
#+NAME: autostart-table
| Command | Arguments | Run once? |
|---------------+---------------------------------------+-----------|
| ~xrdb~ | ~-merge $HOME/.Xresources~ | no |
| ~mpc~ | ~stop~ | no |
| ~set-screens~ | | no |
| ~picom~ | | yes |
| ~set-screens~ | | no |
| ~numlockx~ | ~on~ | yes |
| ~pumopm~ | | yes |
| ~xfce-polkit~ | | yes |
| ~nm-applet~ | | yes |
| ~numlockx~ | ~on~ | yes |
| ~xwallpaper~ | ~--zoom (cat $HOME/.cache/wallpaper)~ | no |
# | ~xss-lock~ | ~plock~ | yes |
| ~xss-lock~ | ~plock~ | yes |
| ~xrdb~ | ~-merge $HOME/.Xresources~ | no |
#+NAME: autostart-gen
#+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes

View File

@ -508,7 +508,7 @@ programming language, so here it is.
In this category, only the ~epub~ and ~pdf~ layers are enabled without any
special configuration, so I can read these files from Emacs directly.
#+BEGIN_SRC emacs-lisp
epub pdf
epub pdf
#+END_SRC
**** Elfeed
@ -611,8 +611,7 @@ tools.
conlanging
(exwm :variables
exwm-enable-systray t
exwm-custom-init (lambda ()
(exwm/autostart-process "autostart"))
exwm-install-logind-lock-handler t
exwm-locking-command "plock")
#+END_SRC
@ -1444,6 +1443,93 @@ in Elisp code.
Almost all of my code snippets will be prefixed by either my name or the name of
the package or layer they are part of, unless they are an explicit overwrite of
a function that already exists.
*** Elisp Utilities and Predicates
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Predicates-5598df46
:END:
**** ~phundrak-filter~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Elisp-Utilities-and-Predicates-phundrak-filter-2d3c5a5b
:END:
#+name: elisp-phundrak-filter
#+BEGIN_SRC emacs-lisp
(defun phundrak-filter (fn list)
"Filter `LIST' according to the predicate `FN'.
All elements from `LIST' that do not satisfy the predicate `FN'
will be left out of the result, while all elements that do
satisfy it will be included in the resulting list. This function
also preserves the relative position between elements that
satisfy the predicate."
(declare (pure t) (side-effect-free t))
(when list
(let ((rest (phundrak-filter fn
(cdr list))))
(if (funcall fn
(car list))
(cons (car list) rest)
rest))))
#+END_SRC
**** ~phundrak-all?~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-phundrak-all-0655600c
:END:
This function is inspired by dashs ~-all?~ function: it will test all the
elements of the list ~seq~ against the predicate ~fn~ which should return either
~t~ or ~nil~. If all of them return something else than ~nil~, then it is a
success, otherwise it is a failure. Note that empty lists will always return
~t~.
#+BEGIN_SRC emacs-lisp
(defun phundrak-all? (fn seq)
"Check if all members of `SEQ' satisfy predicate `FN'. Note that
it will return t if `SEQ' is nil."
(declare (pure t) (side-effect-free t))
(if seq
(and (funcall fn (car seq))
(phundrak-all? fn (cdr seq)))
t))
#+END_SRC
**** ~phundrak-none?~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-phundrak-none-463dee26
:END:
In the same vein as ~phundrak-all?~, ~phundrak-none?~ checks if all elements of
~seq~ do not satify the predicate ~fn~. Again, if the list is empty, it will
return ~t~.
#+name: elisp-phundrak-none
#+BEGIN_SRC emacs-lisp
(defun phundrak-none? (fn seq)
"Check if all members of `SEQ' do not satisfy predicate `FN'.
Note that it will return t if `SEQ' is nil."
(declare (pure t) (side-effect-free t))
(if seq
(and (not (funcall fn (car seq)))
(phundrak-none? fn (cdr seq)))
t))
#+END_SRC
**** ~phundrak-zip~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Elisp-Utilities-and-Predicates-phundrak-zip-8a49b20f
:END:
#+name: elisp-phundrak-zip
#+BEGIN_SRC emacs-lisp
(defun phundrak-zip (&rest lists)
"Zip `LISTS' together.
Be aware only the amount of elements of the smallest list will be zipped."
(declare (pure t) (side-effect-free t))
(when lists
(let ((lists (if (= 1 (length lists)) ; only one element => a list of lists was passed
(car lists)
lists)))
(when (phundrak-none? 'null lists)
(cons (mapcar 'car lists)
(phundrak-zip (mapcar 'cdr lists)))))))
#+END_SRC
*** Eshell Prompt-Related Functions
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Eshell-prompt-related-functions-79d07f21
@ -1746,93 +1832,6 @@ argument. Here is how it is implemented:
`(propertize ,$str 'face (list ,@$properties)))
#+END_SRC
*** Elisp Utilities and Predicates
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Predicates-5598df46
:END:
**** ~phundrak-filter~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Elisp-Utilities-and-Predicates-phundrak-filter-2d3c5a5b
:END:
#+name: elisp-phundrak-filter
#+BEGIN_SRC emacs-lisp
(defun phundrak-filter (fn list)
"Filter `LIST' according to the predicate `FN'.
All elements from `LIST' that do not satisfy the predicate `FN'
will be left out of the result, while all elements that do
satisfy it will be included in the resulting list. This function
also preserves the relative position between elements that
satisfy the predicate."
(declare (pure t) (side-effect-free t))
(when list
(let ((rest (phundrak-filter fn
(cdr list))))
(if (funcall fn
(car list))
(cons (car list) rest)
rest))))
#+END_SRC
**** ~phundrak-all?~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-phundrak-all-0655600c
:END:
This function is inspired by dashs ~-all?~ function: it will test all the
elements of the list ~seq~ against the predicate ~fn~ which should return either
~t~ or ~nil~. If all of them return something else than ~nil~, then it is a
success, otherwise it is a failure. Note that empty lists will always return
~t~.
#+BEGIN_SRC emacs-lisp
(defun phundrak-all? (fn seq)
"Check if all members of `SEQ' satisfy predicate `FN'. Note that
it will return t if `SEQ' is nil."
(declare (pure t) (side-effect-free t))
(if seq
(and (funcall fn (car seq))
(phundrak-all? fn (cdr seq)))
t))
#+END_SRC
**** ~phundrak-none?~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-phundrak-none-463dee26
:END:
In the same vein as ~phundrak-all?~, ~phundrak-none?~ checks if all elements of
~seq~ do not satify the predicate ~fn~. Again, if the list is empty, it will
return ~t~.
#+name: elisp-phundrak-none
#+BEGIN_SRC emacs-lisp
(defun phundrak-none? (fn seq)
"Check if all members of `SEQ' do not satisfy predicate `FN'.
Note that it will return t if `SEQ' is nil."
(declare (pure t) (side-effect-free t))
(if seq
(and (not (funcall fn (car seq)))
(phundrak-none? fn (cdr seq)))
t))
#+END_SRC
**** ~phundrak-zip~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-Elisp-Utilities-and-Predicates-phundrak-zip-8a49b20f
:END:
#+name: elisp-phundrak-zip
#+BEGIN_SRC emacs-lisp
(defun phundrak-zip (&rest lists)
"Zip `LISTS' together.
Be aware only the amount of elements of the smallest list will be zipped."
(declare (pure t) (side-effect-free t))
(when lists
(let ((lists (if (= 1 (length lists)) ; only one element => a list of lists was passed
(car lists)
lists)))
(when (phundrak-none? 'null lists)
(cons (mapcar 'car lists)
(phundrak-zip (mapcar 'cdr lists)))))))
#+END_SRC
*** ~phundrak-blog-publish~
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Custom-functions-macros-and-variables-phundrak-blog-publish-99c96b2d
@ -2554,6 +2553,14 @@ Finally, lets enable some fish-like syntax highlighting:
(eshell-syntax-highlighting-global-mode +1)
#+END_SRC
***** TODO Add battery level to banner :noexport:
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Emacs-builtins-Eshell-Eshell-theme-and-prompt-Add-battery-level-to-banner-7ef9bd5a
:END:
Add battery level to banner if computer is a laptop, and display if it is
charging or discharging. See [[https://tecosaur.github.io/emacs-config/config.html#simple-settings][Tecosaurs config]] for a way to detect if a battery
is present or not (basically use the function ~battery~).
**** Visual commands
:PROPERTIES:
:CUSTOM_ID: User_Configuration-Eshell-Visual_commands-2b15e0dc
@ -4087,10 +4094,12 @@ user. Unfortunately, a lot of these files are just noise I dont care about, b
fortunately we can ignore files with the variable ~recentf-exclude~. So, I will
ignore these paths:
#+name: recentf-ignored-paths
| =~/.authinfo.gpg= |
| =~/.mail/= |
| =~/.emacs.d/= |
| =~/.config/emacs/= |
| =~/.elfeed/index= |
| =~/Documents/mu4e= |
| =/tmp/= |
#+name: recentf-ignored-paths-gen
@ -4166,19 +4175,18 @@ As this is a new category, lets declare its prefix:
Now, lets also declare the keybindings in this category. ~oac~ will invoke
Emacs calculator, while ~oac~ invokes the calendar, ~oae~ invokes the Eww web
browser, ~oaw~ invokes ~woman~ (actually ~helm-man-woman~), and ~oaW~ invokes
the weather forecast. Lastly, the apostrophe in ~o'~ will invoke Eshell
directly, without any popup window as with ~,'~ while ~oan~ will open a new
eshell buffer if another one already exists.
browser, and ~oaw~ invokes the weather forecast. Lastly, the apostrophe in ~o'~
will invoke Eshell directly, without any popup window as with ~SPC '~ while
~oan~ will open a new eshell buffer if another one already exists. ~ov~ will
also open a vterm terminal.
#+BEGIN_SRC emacs-lisp
(spacemacs/set-leader-keys
"o'" 'eshell
"o'" 'eshell-new
"ov" 'vterm
"oac" 'calc
"oaC" 'calendar
"oae" 'eww
"oan" 'eshell-new
"oaw" 'helm-man-woman
"oaW" 'wttrin)
"oaw" 'wttrin)
#+END_SRC
**** Image mode
@ -4937,6 +4945,29 @@ XDG-compliant directories), so lets also ignore that.
(add-to-list 'projectile-globally-ignored-directories "node_modules")
#+END_SRC
** Readers
:PROPERTIES:
:CUSTOM_ID: User-Configuration-Readers-aacb14d4
:END:
Thanks to Discord user shanks, I discovered pdf-tools gives us access to a very
interesting minor mode: ~pdf-view-midnight-minor-mode~. And this is exactly what
I missed in my Emacs PDF reader from Zathura! I still think Zathura is a
fantastic tool, but now my PDF reader in Emacs is almost perfect! I just need to
adjust some colors:
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'pdf-view
(setq pdf-view-midnight-colors '("#d8dee9" . "#2e3440")))
#+END_SRC
Lets also enable dark mode automatically:
#+BEGIN_SRC emacs-lisp
(add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode)
#+END_SRC
And there we go! A beautiful, dark-mode PDF reader inside Emacs! And with
Spacemacs, I can enable or disable this minor mode anytime with the shortcut
~, n~.
** Security
:PROPERTIES:
:CUSTOM_ID: User_Configuration-Security-21d88555