Doom updates

This commit is contained in:
i.ortega 2020-04-21 00:01:51 +02:00
parent 9e3718968c
commit 604f05995a
4 changed files with 508 additions and 326 deletions

View File

@ -1,13 +1,6 @@
(setq user-full-name "inigoortega"
user-mail-address "inigoortega@tutanota.com")
;; -*- lexical-binding: t -*-
(add-to-list 'load-path "/usr/share/emacs/site-lisp/ebuild-mode")
(require 'ebuild-mode)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/color-theme")
(require 'color-theme)
;; (add-to-list 'auto-mode-alist '("\\.conf$" . shell-script-mode)) ;Configuration files.
;; (load-directory (file-expand-wildcards "/usr/share/emacs/site-lisp/ebuild-mode"))
(setq doom-font (font-spec :family "monospace" :width 'normal :size 17)
doom-variable-pitch-font (font-spec :family "monospace"))
(setq doom-theme 'doom-gruvbox)
@ -18,8 +11,7 @@
ln mkdir rm ssh sleep source ps bash python perl Rscript wget
bunzip2 bzip2 zip unzip gzip gunzip find ls cat egrep grep mv cp
chmod tar stty export spark-shell spark-submit hadoop pyspark aws
dash xdotool xprop 7z p7z zsh fish expr command disown pv alias head
eselect equery qlist emerge
dash xdotool xprop 7z p7z zsh fish expr command disown pv alias
))
(setq prelude-symbols
@ -43,37 +35,6 @@
getLine getContents interact readFile writeFile appendFile readIO readLn
ioError userError))
(setq key-commands '(("i !" "(insert! \"i!\")")
("i \\\"" "(insert! (format \"i%c\" 34))")
("i SPC" "(insert! \"i \")")
("i ESC" "(insert! \"i\") (evil-normal-state)")
("i RET" "(insert! \"i\") (execute-kbd-macro (kbd \"RET\"))")
("i \\\\" "(insert! \"i\\\\\")")
("i DEL" "(insert! \"\")")
("i TAB" "(insert! \"i\")
(execute-kbd-macro (kbd \"TAB\"))")
("i C-n" "(insert! \"i\") (evil-complete-next)")
("i <f1>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f1>\"))")
("i <f2>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f2>\"))")
("i <f3>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f3>\"))")
("i <f4>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f4>\"))")
("i <f5>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f5>\"))")
("i <f6>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f6>\"))")
("i <f7>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f7>\"))")
("i <f8>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f8>\"))")
("i <f9>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f9>\"))")
("i <f10>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f10>\"))")
("i <f11>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f11>\"))")
("i <f12>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f12>\"))")
("i <Scroll_Lock>" "(insert! \"i\") (execute-kbd-macro (kbd \"<Scroll_Lock>\"))")
("i <insert>" "(insert! \"i\") (execute-kbd-macro (kbd \"<insert>\"))")
("i <deletechar>" "(insert! \"i\") (execute-kbd-macro (kbd \"<deletechar>\"))")
("i <home>" "(insert! \"i\") (execute-kbd-macro (kbd \"<home>\"))")
("i <end>" "(insert! \"i\") (execute-kbd-macro (kbd \"<end>\"))")
("i <prior>" "(insert! \"i\") (execute-kbd-macro (kbd \"<prior>\"))")
("i <next>" "(insert! \"i\") (execute-kbd-macro (kbd \"<next>\"))")
))
(setq path-to-ctags "/usr/bin/ctags")
(setq i-keys (mapcar
@ -119,81 +80,209 @@
(shell-command
(format "%s -f TAGS -e -R %s" path-to-ctags (directory-file-name dir-name)))
)
(map! :map org-mode-map
:n "z M" (lambda () (interactive) (org-shifttab) (+fold/close-all)))
;; (map! :map org-mode-map
;; :n "z m" (lambda () (interactive) (org-shifttab) (+fold/close-all)))
(map! :n "g r" #'evil-replace-with-register)
(add-hook! 'org-mode-hook #'evil-replace-with-register)
(map! :n "SPC w D" #'delete-other-windows)
(defvar my-term-shell "/bin/zsh")
(defadvice ansi-term (before force-bash)
(interactive (list my-term-shell)))
(ad-activate 'ansi-term)
(setq ii-maps '(evil-org-mode-map text-mode-map prog-mode-map))
(mapcar
(lambda (command)
(eval-string
(format "(map!
:map %s
:map text-mode-map
:map prog-mode-map
:map org-mode-map
:i \"%s\" (lambda() (interactive) (insert! \"%s\")))"
ii-maps command command))) i-keys)
command command))) i-keys)
(mapcar
(lambda (key-command)
(eval-string
(format
"
(map! :map %s
:i \"%s\" (lambda()
;; Exceptions
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i !" (lambda()
(interactive)
%s
))
"
ii-maps (nth 0 key-command) (nth 1 key-command)))) key-commands)
(insert! "i!")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i \"" (lambda()
(interactive)
(insert! (format "i%c" 34))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i SPC" (lambda()
(interactive)
(insert! "i ")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i ESC" (lambda()
(interactive)
(insert! "i") (evil-normal-state)))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i RET" (lambda()
(interactive)
(insert! "i")
(execute-kbd-macro (kbd "RET"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i \\" (lambda()
(interactive)
(insert! "i\\")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i DEL" (lambda()
(interactive)
(insert! "")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i TAB" (lambda()
(interactive)
(insert! "i")
(execute-kbd-macro (kbd "TAB"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i C-n" (lambda()
(interactive)
(insert! "i") (evil-complete-next)))
;; F keys
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f1>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f1>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f2>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f2>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f3>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f3>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f4>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f4>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f5>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f5>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f6>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f6>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f7>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f7>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f8>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f8>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f9>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f9>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f10>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f10>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f11>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f11>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f12>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f12>"))))
;; Other special keys
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <pause>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<pause>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <Scroll_Lock>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<Scroll_Lock>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <insert>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<insert>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <deletechar>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<deletechar>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <home>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<home>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <end>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<end>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <prior>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<prior>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <next>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<next>"))))
;; i i
(eval-string
(format
"(map! :map %s
:i \"i i\" #'evil-normal-state)" ii-maps))
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(require 'ox-html)
(require 'ox-latex)
;; Path for pygments or command name
(defvar pygments-path "pygmentize")
;; (setq org-latex-listings 'minted)
;; (setq org-latex-packages-alist nil)
;; (add-to-list 'org-latex-packages-alist '("cache=false" "newfloat" "minted"))
;; inside .emacs file
(setq org-latex-listings 'minted
org-latex-packages-alist '(("newfloat" "minted"))
org-latex-minted-options
'(("frame" "single")
;; ("frame" "lines")
("linenos" "true")
)
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
;; (add-to-list 'org-latex-packages-alist '("babel" t ("pdflatex")))
;; (setq org-latex-pdf-process nil)
;; (add-to-list 'org-latex-pdf-process
;; "pdflatex -interaction nonstopmode --shell-escape -output-directory %o %f")
(setq )
(setq org-export-latex-listings 'minted)
(setq org-export-latex-packages-alist nil)
(add-to-list 'org-export-latex-packages-alist '("newfloat" "minted"))
;; (setq org-latex-packages-alist nil)
(add-to-list 'org-latex-packages-alist
'("AUTO" "babel" t ("pdflatex") "minted"))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i i" #'evil-normal-state)
(setq dired-dwim-target t)
(show-paren-mode 1)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
@ -211,23 +300,41 @@ ii-maps (nth 0 key-command) (nth 1 key-command)))) key-commands)
(global-visual-line-mode)
(global-evil-surround-mode t)
(vimish-fold-global-mode 1)
(add-hook 'prog-mode-hook
(lambda ()
(if (or (derived-mode-p 'python-mode) (derived-mode-p 'haskell-mode))
(progn
(yafolding-mode)
(yafolding-hide-all)
)
(+fold/close-all)
)))
(add-hook 'prog-mode-hook
(lambda ()
(if (or (derived-mode-p 'python-mode) (derived-mode-p 'haskell-mode))
(progn
(yafolding-mode)
(yafolding-hide-all)
)
(+fold/close-all)
)))
(defun yafolding-hide-rec ()
(interactive)
(setq level (yafolding-get-indent-level))
(while (> level 0)
(yafolding-go-parent-element)
(setq level (- level 1)))
(yafolding-hide-element))
(while (or (current-line-empty-p) (> level 0))
(if (current-line-empty-p)
(progn
(re-search-backward "^.")
(setq level (yafolding-get-indent-level))
(message (number-to-string level))
)
(progn
(yafolding-go-parent-element)
(setq level (- level 1))
)
))
(yafolding-hide-element)
)
(defun current-line-empty-p ()
;; Spaces not included
(string-match-p "\\`$" (thing-at-point 'line)))
(defun current-line-empty2-p ()
;; Spaces included
(string-match-p "\\`\\s-*$" (thing-at-point 'line)))
(map! :map 'hs-minor-mode-map
:n "z o" #'hs-show-block
@ -238,7 +345,6 @@ ii-maps (nth 0 key-command) (nth 1 key-command)))) key-commands)
:n "z c" #'yafolding-hide-parent-element
:n "z C" #'yafolding-hide-rec
:n "z o" #'yafolding-show-element
:n "z O" #'yafolding-show-element
:n "z m" #'yafolding-hide-all
:n "z r" #'yafolding-show-all
)
@ -285,22 +391,22 @@ ii-maps (nth 0 key-command) (nth 1 key-command)))) key-commands)
(setq org-babel-load-languages '((emacs-lisp . t) (ein . t)))
(elpy-enable)
;; Following disabled due to high CPU usage
;;; Use IPython for REPL
(setq python-shell-interpreter "jupyter"
python-shell-interpreter-args "console --simple-prompt"
python-shell-prompt-detect-failure-warning nil)
(add-to-list 'python-shell-completion-native-disabled-interpreters
"jupyter")
(add-hook 'python-mode-hook
(lambda ()
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default python-indent 4)))
(highlight-words-on-mode 'sh-mode sh-symbols)
(map! :map 'pdf-links-minor-mode-map
:n "f" #'pdf-links-action-perform
)
;; (setq python-shell-interpreter "jupyter"
;; python-shell-interpreter-args "console --simple-prompt"
;; python-shell-prompt-detect-failure-warning nil)
;; (add-to-list 'python-shell-completion-native-disabled-interpreters
;; "jupyter")
;; (setq python-shell-interpreter "ipython"
;; python-shell-interpreter-args "-i --simple-prompt")
(map! :map 'pdf-view-mode-map
:n "C d" #'pdf-links-action-perform
)
(setq blacken-line-length 80)
(add-hook 'python-mode-hook
(lambda ()
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(blacken-mode)
(setq-default python-indent 4)))
(highlight-words-on-mode 'sh-mode sh-symbols)

View File

@ -19,16 +19,6 @@ some email clients, file templates and snippets.
user-mail-address "inigoortega@tutanota.com")
#+END_SRC
* Gentoo
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/usr/share/emacs/site-lisp/ebuild-mode")
(require 'ebuild-mode)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/color-theme")
(require 'color-theme)
;; (add-to-list 'auto-mode-alist '("\\.conf$" . shell-script-mode)) ;Configuration files.
;; (load-directory (file-expand-wildcards "/usr/share/emacs/site-lisp/ebuild-mode"))
#+END_SRC
* Style
** Fonts
Doom exposes five (optional) variables for controlling fonts in Doom. Here
@ -74,8 +64,7 @@ If you intend to use org, it is recommended you change this!
ln mkdir rm ssh sleep source ps bash python perl Rscript wget
bunzip2 bzip2 zip unzip gzip gunzip find ls cat egrep grep mv cp
chmod tar stty export spark-shell spark-submit hadoop pyspark aws
dash xdotool xprop 7z p7z zsh fish expr command disown pv alias head
eselect equery qlist emerge
dash xdotool xprop 7z p7z zsh fish expr command disown pv alias
))
(setq prelude-symbols
@ -99,37 +88,6 @@ If you intend to use org, it is recommended you change this!
getLine getContents interact readFile writeFile appendFile readIO readLn
ioError userError))
(setq key-commands '(("i !" "(insert! \"i!\")")
("i \\\"" "(insert! (format \"i%c\" 34))")
("i SPC" "(insert! \"i \")")
("i ESC" "(insert! \"i\") (evil-normal-state)")
("i RET" "(insert! \"i\") (execute-kbd-macro (kbd \"RET\"))")
("i \\\\" "(insert! \"i\\\\\")")
("i DEL" "(insert! \"\")")
("i TAB" "(insert! \"i\")
(execute-kbd-macro (kbd \"TAB\"))")
("i C-n" "(insert! \"i\") (evil-complete-next)")
("i <f1>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f1>\"))")
("i <f2>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f2>\"))")
("i <f3>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f3>\"))")
("i <f4>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f4>\"))")
("i <f5>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f5>\"))")
("i <f6>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f6>\"))")
("i <f7>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f7>\"))")
("i <f8>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f8>\"))")
("i <f9>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f9>\"))")
("i <f10>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f10>\"))")
("i <f11>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f11>\"))")
("i <f12>" "(insert! \"i\") (execute-kbd-macro (kbd \"<f12>\"))")
("i <Scroll_Lock>" "(insert! \"i\") (execute-kbd-macro (kbd \"<Scroll_Lock>\"))")
("i <insert>" "(insert! \"i\") (execute-kbd-macro (kbd \"<insert>\"))")
("i <deletechar>" "(insert! \"i\") (execute-kbd-macro (kbd \"<deletechar>\"))")
("i <home>" "(insert! \"i\") (execute-kbd-macro (kbd \"<home>\"))")
("i <end>" "(insert! \"i\") (execute-kbd-macro (kbd \"<end>\"))")
("i <prior>" "(insert! \"i\") (execute-kbd-macro (kbd \"<prior>\"))")
("i <next>" "(insert! \"i\") (execute-kbd-macro (kbd \"<next>\"))")
))
(setq path-to-ctags "/usr/bin/ctags")
(setq i-keys (mapcar
@ -182,18 +140,9 @@ If you intend to use org, it is recommended you change this!
#+END_SRC
* Custom keybindings
** Org
#+BEGIN_SRC emacs-lisp
(map! :map org-mode-map
:n "z M" (lambda () (interactive) (org-shifttab) (+fold/close-all)))
;; (map! :map org-mode-map
;; :n "z m" (lambda () (interactive) (org-shifttab) (+fold/close-all)))
#+END_SRC
** General
Replace with Regiser:
#+BEGIN_SRC emacs-lisp
(map! :n "g r" #'evil-replace-with-register)
(add-hook! 'org-mode-hook #'evil-replace-with-register)
#+END_SRC
Delete other windows:
@ -211,79 +160,206 @@ zsh as ansi-term shell
** 'ii' in INSERT mode to escape to NORMAL mode:
#+BEGIN_SRC emacs-lisp
(setq ii-maps '(evil-org-mode-map text-mode-map prog-mode-map))
(mapcar
(lambda (command)
(eval-string
(format "(map!
:map %s
:map text-mode-map
:map prog-mode-map
:map org-mode-map
:i \"%s\" (lambda() (interactive) (insert! \"%s\")))"
ii-maps command command))) i-keys)
command command))) i-keys)
(mapcar
(lambda (key-command)
(eval-string
(format
"
(map! :map %s
:i \"%s\" (lambda()
;; Exceptions
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i !" (lambda()
(interactive)
%s
))
"
ii-maps (nth 0 key-command) (nth 1 key-command)))) key-commands)
(insert! "i!")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i \"" (lambda()
(interactive)
(insert! (format "i%c" 34))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i SPC" (lambda()
(interactive)
(insert! "i ")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i ESC" (lambda()
(interactive)
(insert! "i") (evil-normal-state)))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i RET" (lambda()
(interactive)
(insert! "i")
(execute-kbd-macro (kbd "RET"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i \\" (lambda()
(interactive)
(insert! "i\\")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i DEL" (lambda()
(interactive)
(insert! "")))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i TAB" (lambda()
(interactive)
(insert! "i")
(execute-kbd-macro (kbd "TAB"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i C-n" (lambda()
(interactive)
(insert! "i") (evil-complete-next)))
;; F keys
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f1>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f1>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f2>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f2>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f3>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f3>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f4>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f4>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f5>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f5>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f6>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f6>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f7>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f7>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f8>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f8>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f9>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f9>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f10>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f10>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f11>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f11>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <f12>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<f12>"))))
;; Other special keys
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <pause>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<pause>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <Scroll_Lock>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<Scroll_Lock>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <insert>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<insert>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <deletechar>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<deletechar>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <home>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<home>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <end>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<end>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <prior>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<prior>"))))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i <next>" (lambda()
(interactive)
(insert! "i") (execute-kbd-macro (kbd "<next>"))))
;; i i
(eval-string
(format
"(map! :map %s
:i \"i i\" #'evil-normal-state)" ii-maps))
(map! :map text-mode-map
:map prog-mode-map
:map org-mode-map
:i "i i" #'evil-normal-state)
#+END_SRC
* Custom configuration
** Org
#+BEGIN_SRC emacs-lisp
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
#+END_SRC
*** Org-latex
#+BEGIN_SRC emacs-lisp
(require 'ox-html)
(require 'ox-latex)
;; Path for pygments or command name
(defvar pygments-path "pygmentize")
;; (setq org-latex-listings 'minted)
;; (setq org-latex-packages-alist nil)
;; (add-to-list 'org-latex-packages-alist '("cache=false" "newfloat" "minted"))
;; inside .emacs file
(setq org-latex-listings 'minted
org-latex-packages-alist '(("newfloat" "minted"))
org-latex-minted-options
'(("frame" "single")
;; ("frame" "lines")
("linenos" "true")
)
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
;; (add-to-list 'org-latex-packages-alist '("babel" t ("pdflatex")))
;; (setq org-latex-pdf-process nil)
;; (add-to-list 'org-latex-pdf-process
;; "pdflatex -interaction nonstopmode --shell-escape -output-directory %o %f")
(setq )
(setq org-export-latex-listings 'minted)
(setq org-export-latex-packages-alist nil)
(add-to-list 'org-export-latex-packages-alist '("newfloat" "minted"))
;; (setq org-latex-packages-alist nil)
(add-to-list 'org-latex-packages-alist
'("AUTO" "babel" t ("pdflatex") "minted"))
#+END_SRC
** Dired
#+BEGIN_SRC emacs-lisp
(setq dired-dwim-target t)
@ -332,23 +408,41 @@ Evil-surround work everywhere:
Folding:
#+BEGIN_SRC emacs-lisp
(vimish-fold-global-mode 1)
(add-hook 'prog-mode-hook
(lambda ()
(if (or (derived-mode-p 'python-mode) (derived-mode-p 'haskell-mode))
(progn
(yafolding-mode)
(yafolding-hide-all)
)
(+fold/close-all)
)))
(add-hook 'prog-mode-hook
(lambda ()
(if (or (derived-mode-p 'python-mode) (derived-mode-p 'haskell-mode))
(progn
(yafolding-mode)
(yafolding-hide-all)
)
(+fold/close-all)
)))
(defun yafolding-hide-rec ()
(interactive)
(setq level (yafolding-get-indent-level))
(while (> level 0)
(yafolding-go-parent-element)
(setq level (- level 1)))
(yafolding-hide-element))
(while (or (current-line-empty-p) (> level 0))
(if (current-line-empty-p)
(progn
(re-search-backward "^.")
(setq level (yafolding-get-indent-level))
(message (number-to-string level))
)
(progn
(yafolding-go-parent-element)
(setq level (- level 1))
)
))
(yafolding-hide-element)
)
(defun current-line-empty-p ()
;; Spaces not included
(string-match-p "\\`$" (thing-at-point 'line)))
(defun current-line-empty2-p ()
;; Spaces included
(string-match-p "\\`\\s-*$" (thing-at-point 'line)))
(map! :map 'hs-minor-mode-map
:n "z o" #'hs-show-block
@ -359,11 +453,10 @@ Folding:
:n "z c" #'yafolding-hide-parent-element
:n "z C" #'yafolding-hide-rec
:n "z o" #'yafolding-show-element
:n "z O" #'yafolding-show-element
:n "z m" #'yafolding-hide-all
:n "z r" #'yafolding-show-all
)
#+END_SRC
#+END_SRC
IRC (not working):
#+BEGIN_SRC emacs-lisp
@ -449,17 +542,24 @@ Highlight predule:
#+BEGIN_SRC emacs-lisp
(elpy-enable)
;; Following disabled due to high CPU usage
;;; Use IPython for REPL
(setq python-shell-interpreter "jupyter"
python-shell-interpreter-args "console --simple-prompt"
python-shell-prompt-detect-failure-warning nil)
(add-to-list 'python-shell-completion-native-disabled-interpreters
"jupyter")
;; (setq python-shell-interpreter "jupyter"
;; python-shell-interpreter-args "console --simple-prompt"
;; python-shell-prompt-detect-failure-warning nil)
;; (add-to-list 'python-shell-completion-native-disabled-interpreters
;; "jupyter")
;; (setq python-shell-interpreter "ipython"
;; python-shell-interpreter-args "-i --simple-prompt")
(setq blacken-line-length 80)
(add-hook 'python-mode-hook
(lambda ()
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default python-indent 4)))
(lambda ()
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(blacken-mode)
(setq-default python-indent 4)))
#+END_SRC
** Shell script
@ -467,16 +567,6 @@ Highlight predule:
(highlight-words-on-mode 'sh-mode sh-symbols)
#+END_SRC
** PDF
#+BEGIN_SRC emacs-lisp
(map! :map 'pdf-links-minor-mode-map
:n "f" #'pdf-links-action-perform
)
(map! :map 'pdf-view-mode-map
:n "C d" #'pdf-links-action-perform
)
#+END_SRC
* Doom info
Here are some additional functions/macros that could help you configure Doom:

View File

@ -37,10 +37,8 @@
nav-flash ; blink the current line after jumping
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix
+defaults) ; default popup rules
;;pretty-code ; replace bits of code with pretty symbols
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;pretty-code ; ligatures or substitute text with pretty symbols
;;tabs ; an tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
@ -57,7 +55,7 @@
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
multiple-cursors ; editing in many places at once
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
rotate-text ; cycle region at point between text candidates
@ -67,14 +65,15 @@
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
ibuffer ; interactive buffer management
ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; a consistent, cross-platform shell (WIP)
shell ; a terminal REPL for Emacs
;;term ; terminals in Emacs
;;vterm ; another terminals in Emacs
eshell ; the elisp shell that works everywhere
shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
@ -87,12 +86,11 @@
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;; ein ; tame Jupyter notebooks with emacs
ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
(lookup ; helps you navigate your code and documentation
+docsets) ; ...or in Dash docsets locally
;;lsp
lookup ; navigate your code and its documentation
lsp
;;macos ; MacOS-specific commands
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
@ -114,6 +112,7 @@
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
@ -122,7 +121,7 @@
;;faust ; dsp, but you get to keep your soul
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
go ; the hipster dialect
(go +lsp) ; the hipster dialect
(haskell +dante) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ;
@ -139,13 +138,7 @@
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org ; organize your plain life in plain text
+dragndrop ; drag & drop files/images into org buffers
;;+hugo ; use Emacs for hugo blogging
+jupyter ; ipython/jupyter support for babel
;;+pandoc ; export-with-pandoc support
;;+pomodoro ; be fruitful with the tomato technique
+present) ; using org-mode for presentations
org ; organize your plain life in plain text
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
@ -155,11 +148,12 @@
;;racket ; a DSL for DSLs
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;scheme ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.

View File

@ -1,39 +1,22 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; This is where you install packages, by declaring them with the `package!'
;; macro, then running 'doom refresh' on the command line. You'll need to
;; restart Emacs for your changes to take effect! Or at least, run M-x
;; `doom/reload'.
;;
;; WARNING: Don't disable core packages listed in ~/.emacs.d/core/packages.el.
;; Doom requires these, and disabling them may have terrible side effects.
;;
;; Here are a couple examples:
;; To install a package with Doom you must declare them here, run 'doom sync' on
;; the command line, then restart Emacs for the changes to take effect.
;; Alternatively, use M-x doom/reload.
;; All of Doom's packages are pinned to a specific commit, and updated from
;; release to release. To un-pin all packages and live on the edge, do:
;(setq doom-pinned-packages nil)
;; ...but to unpin a single package:
;(package! pinned-package :pin nil)
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
; Python
(package! elpy)
(package! blacken)
; (package! ein)
(package! evil-replace-with-register)
(package! hindent)
(package! highlight-operators)
(package! highlight)
(package! yafolding)
(package! ox-pandoc)
;; (package! jupyter)
;; To install a package directly from a particular repo, you'll need to specify
;; a `:recipe'. You'll find documentation on what `:recipe' accepts here:
@ -62,3 +45,12 @@
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see raxod502/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
(package! elpy)
(package! blacken)
(package! evil-replace-with-register)
(package! hindent)
(package! highlight-operators)
(package! highlight)
(package! yafolding)