mirror of
https://github.com/vale981/dotfiles
synced 2025-03-04 17:11:39 -05:00
various updates
This commit is contained in:
parent
eb6ead9d95
commit
560e70d764
9 changed files with 379 additions and 230 deletions
|
@ -4,9 +4,11 @@ ETH_DEV="enp0s31f6"
|
|||
MAIN_NET=$WIFI_DEV
|
||||
BATTERIES=(BAT0 BAT1)
|
||||
MAIN_FONT="Source Code Pro 8"
|
||||
SCREEN_LAYOUT="xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off --output DP-2-1 --off --output DP-2-2 --off --output DP-2-3 --off"
|
||||
SCREEN_LAYOUT_DOCKED="xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off --output DP-2-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output DP-2-2 --mode 1280x1024 --pos 3840x0 --rotate normal --output DP-2-3 --off"
|
||||
MONITORS=(eDP-1 DP-2-2 DP-2-1)
|
||||
MAIN_MONITOR=eDP-1
|
||||
SCREEN_LAYOUT="xrandr --output HDMI-2 --off --output HDMI-1 --off --output DP-1 --off --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-2 --off"
|
||||
#MONITORS=(VGA-0 DVI-D-0)
|
||||
BAR_POS="bottom"
|
||||
SIDE_MONITORS=($(xrandr | rg -i "\sconnected" | rg -v eDP | cut -d" " -f1 | grep -v $MAIN_MONITOR))
|
||||
BAR_POS="top"
|
||||
LAPTOP=1
|
||||
TERM_FONT_SIZE=6
|
||||
|
|
|
@ -11,24 +11,25 @@ bspc config gapless_monocle true
|
|||
bspc config focus_follows_pointer true
|
||||
bspc config pointer_follows_focus true
|
||||
|
||||
bspc rule -a Chromium desktop='II'
|
||||
bspc rule -a Firefox desktop='II'
|
||||
bspc rule -a Emacs desktop='I' state=tiled
|
||||
bspc rule -a Evince desktop='IV'
|
||||
bspc rule -a Chromium desktop='2'
|
||||
bspc rule -a Firefox desktop='2'
|
||||
bspc rule -a Emacs desktop='1' state=tiled
|
||||
bspc rule -a Evince desktop='4'
|
||||
bspc rule -a mplayer2 state=floating
|
||||
bspc rule -a TelegramDesktop desktop='X'
|
||||
bspc rule -a Thunderbird desktop='X'
|
||||
bspc rule -a Skype desktop='X'
|
||||
bspc rule -a Anki desktop='^V'
|
||||
bspc rule -a zoom desktop='^VII'
|
||||
bspc rule -a .obs-wrapped desktop='VIII'
|
||||
bspc rule -a Zeal desktop='IX'
|
||||
bspc rule -a Xournal desktop='VI'
|
||||
bspc rule -a TelegramDesktop desktop='0'
|
||||
bspc rule -a Thunderbird desktop='0'
|
||||
bspc rule -a Skype desktop='0'
|
||||
bspc rule -a Anki desktop='^5'
|
||||
bspc rule -a zoom desktop='^7'
|
||||
bspc rule -a .obs-wrapped desktop='8'
|
||||
bspc rule -a Zeal desktop='9'
|
||||
bspc rule -a Xournal desktop='6'
|
||||
bspc rule -a Pavucontrol state=floating
|
||||
|
||||
xsetroot -cursor_name left_ptr
|
||||
bspc config remove_unplugged_monitors true
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Scripts #
|
||||
###############################################################################
|
||||
|
|
|
@ -3,21 +3,26 @@
|
|||
###############################################################################
|
||||
|
||||
declare -A workspaces
|
||||
workspaces[2]="I V VI VIII IX"
|
||||
workspaces[0]="II IV VII"
|
||||
workspaces[1]="III IX X"
|
||||
workspaces[2]="1 5 6 8"
|
||||
workspaces[0]="2 4 7"
|
||||
workspaces[1]="3 9 0"
|
||||
|
||||
MONITORS=({{ MONITORS[@] }})
|
||||
|
||||
|
||||
move_to_monitor() {
|
||||
for D in $(echo $1 | tr " " "\n"); do
|
||||
bspc desktop $D --to-monitor $2
|
||||
a=("$@")
|
||||
((last_idx=${#a[@]} - 1))
|
||||
b=${a[last_idx]}
|
||||
unset a[last_idx]
|
||||
for D in "${a[@]}"; do
|
||||
bspc desktop `bspc query -D -d $D` -m $b
|
||||
done
|
||||
}
|
||||
|
||||
I=0
|
||||
for MONITOR in ${MONITORS[@]}; do
|
||||
bspc monitor $MONITOR -d ${workspaces[${I}]}
|
||||
move_to_monitor ${workspaces[${I}]} $MONITOR
|
||||
((I=I+1))
|
||||
# move_to_monitor "${workspaces[${I}]}" $MONITOR
|
||||
done
|
||||
|
|
|
@ -1,29 +1,38 @@
|
|||
###############################################################################
|
||||
# External Monitor #
|
||||
###############################################################################
|
||||
source ~/dotfiles/config.sh
|
||||
|
||||
workspaces=(I II III V VI VIII IX X IV VII)
|
||||
mon_1=(I II III V VI VIII IX X)
|
||||
mon_2=(IV VII)
|
||||
# This script should only run when X is running.
|
||||
# Exit immediately if X isn't running.
|
||||
pgrep X > /dev/null || exit 0
|
||||
|
||||
bspc monitor eDP-1 -d ${workspaces[*]}
|
||||
all_workspaces="1 2 3 4 5 6 7 8 9 0"
|
||||
declare -A workspaces
|
||||
|
||||
MONITOR=$(xrandr | rg -i "\sconnected" | rg -v eDP | cut -d" " -f1)
|
||||
workspaces[0]="1 5 8"
|
||||
workspaces[1]="3 9 0"
|
||||
workspaces[2]="2 4 7 6"
|
||||
|
||||
# move_to_monitor() {
|
||||
# local -n workspaces=$1
|
||||
# for D in "${workspaces[@]}"; do
|
||||
# bspc desktop $D --to-monitor $2
|
||||
# done
|
||||
# }
|
||||
move_to_monitor() {
|
||||
for D in $1; do
|
||||
bspc desktop $D --to-monitor $2
|
||||
done
|
||||
}
|
||||
|
||||
if [ -n "$MONITOR" ]; then
|
||||
bspc monitor HDMI-2 -d IV VII
|
||||
bspc query -D --names | rg 1 || bspc monitor $MAIN_MONITOR -d $all_workspaces
|
||||
if [[ $SIDE_MONITORS != "" ]]; then
|
||||
echo "DOCKED"
|
||||
eval $SCREEN_LAYOUT_DOCKED
|
||||
move_to_monitor "$all_workspaces" $MAIN_MONITOR
|
||||
|
||||
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x1080\
|
||||
--rotate normal --output DP-1 --off --output HDMI-2 --off\
|
||||
--output DP-2 --off --output $MONITOR --mode 1920x1080i --pos 0x0\
|
||||
--rotate normal
|
||||
|
||||
# move_to_monitor $mon_1 $MONITOR
|
||||
for i in "${!SIDE_MONITORS[@]}"; do
|
||||
move_to_monitor "${workspaces[$i]}" "${SIDE_MONITORS[$i]}"
|
||||
done
|
||||
else
|
||||
eval $SCREEN_LAYOUT
|
||||
move_to_monitor "$all_workspaces" $MAIN_MONITOR
|
||||
fi
|
||||
|
||||
~/.scripts/wallp
|
||||
sleep 1 && ~/.config/polybar/launch.sh
|
||||
|
|
|
@ -53,6 +53,10 @@ including all that emacs gruft in ~.gitignore~ files.
|
|||
`((".*" "~/.emacs-saves/" t)))
|
||||
#+end_src
|
||||
|
||||
*** Disable Annoying Comp Warnings
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(setq warning-suppress-log-types '((comp)))
|
||||
#+end_src
|
||||
** Hacks
|
||||
*** Speed up Cursor Movement
|
||||
:PROPERTIES:
|
||||
|
@ -62,21 +66,6 @@ Taken from https://github.com/Atman50/emacs-config.
|
|||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(setq auto-window-vscroll nil)
|
||||
#+END_SRC
|
||||
|
||||
*** Tune GC
|
||||
:PROPERTIES:
|
||||
:ID: b0006909-45b3-4282-b297-0fe8ac7a4aa3
|
||||
:END:
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(defun my-minibuffer-setup-hook ()
|
||||
(setq gc-cons-threshold (* 100 1024 1024)))
|
||||
|
||||
(defun my-minibuffer-exit-hook ()
|
||||
(setq gc-cons-threshold 800000))
|
||||
|
||||
(add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
|
||||
(add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
|
||||
#+end_src
|
||||
*** Read more data from child processes
|
||||
:PROPERTIES:
|
||||
:ID: 2073371e-adda-493d-b8c9-373bcf1302bd
|
||||
|
@ -166,9 +155,9 @@ HL line mode is nonsensical in term.
|
|||
(turn-off-boon-mode)
|
||||
(setq global-hl-line-mode nil)))
|
||||
|
||||
(use-package eterm-256color
|
||||
:config
|
||||
(add-hook 'term-mode-hook #'eterm-256color-mode))
|
||||
;; (use-package eterm-256color
|
||||
;; :config
|
||||
;; (add-hook 'term-mode-hook #'eterm-256color-mode))
|
||||
#+end_src
|
||||
|
||||
*** VTerm
|
||||
|
@ -177,8 +166,7 @@ HL line mode is nonsensical in term.
|
|||
:END:
|
||||
VTerm has a ~c~ core and is faster + more compatible. We install this through nix.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
;; (use-package vterm
|
||||
;; :ensure t)
|
||||
(use-package vterm)
|
||||
(add-hook 'vterm-mode-hook
|
||||
(lambda ()
|
||||
(setq cursor-type 'bar)
|
||||
|
@ -302,7 +290,8 @@ We use the doom theme.
|
|||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
(load-theme 'doom-solarized-light t)
|
||||
(doom-themes-treemacs-config)
|
||||
(doom-themes-org-config))
|
||||
;; (doom-themes-org-config)
|
||||
)
|
||||
|
||||
(use-package doom-modeline
|
||||
:ensure t
|
||||
|
@ -507,71 +496,6 @@ Color code matching delimiters.
|
|||
(setq flyspell-correct-interface #'flyspell-correct-ivy))
|
||||
#+end_src
|
||||
|
||||
*** Abbrev
|
||||
:PROPERTIES:
|
||||
:ID: 28c3f70a-568c-4ccb-9314-0056fc0c59bd
|
||||
:END:
|
||||
Use abbrev for greek input.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(define-abbrev-table 'global-abbrev-table
|
||||
'(
|
||||
;; Greek small letters
|
||||
("8al" "α")
|
||||
("8be" "β")
|
||||
("8ga" "γ")
|
||||
("8de" "δ")
|
||||
("8ep" "ε")
|
||||
("8ze" "ζ")
|
||||
("8et" "η")
|
||||
("8th" "θ")
|
||||
("8io" "ι")
|
||||
("8ka" "κ")
|
||||
("8la" "λ")
|
||||
("8mu" "μ")
|
||||
("8nu" "ν")
|
||||
("8xi" "ξ")
|
||||
("8oi" "ο") ;; omicron
|
||||
("8pi" "π")
|
||||
("8ro" "ρ")
|
||||
("8si" "σ")
|
||||
("8ta" "τ")
|
||||
("8up" "υ")
|
||||
("8ph" "φ")
|
||||
("8ch" "χ")
|
||||
("8ps" "ψ")
|
||||
("8oe" "ω") ;; omega
|
||||
|
||||
;; Greek capital letters
|
||||
("8Al" "Α")
|
||||
("8Be" "Β")
|
||||
("8Ga" "Γ")
|
||||
("8De" "Δ")
|
||||
("8Ep" "Ε")
|
||||
("8Ze" "Ζ")
|
||||
("8Et" "Η")
|
||||
("8Th" "Θ")
|
||||
("8Io" "Ι")
|
||||
("8Ka" "Κ")
|
||||
("8La" "Λ")
|
||||
("8Mu" "Μ")
|
||||
("8Nu" "Ν")
|
||||
("8Xi" "Ξ")
|
||||
("8Oi" "Ο") ;; Omicron
|
||||
("8Pi" "Π")
|
||||
("8Ro" "Ρ")
|
||||
("8Si" "Σ")
|
||||
("8Ta" "Τ")
|
||||
("8Up" "Υ")
|
||||
("8Ph" "Φ")
|
||||
("8Ch" "Χ")
|
||||
("8Ps" "Ψ")
|
||||
("8Oe" "Ω") ;; Omega
|
||||
))
|
||||
|
||||
(setq save-abbrevs nil)
|
||||
(setq-default abbrev-mode t)
|
||||
#+end_src
|
||||
|
||||
*** Hydra
|
||||
:PROPERTIES:
|
||||
:ID: b4a81a76-c3ec-44eb-8beb-664fcb218311
|
||||
|
@ -618,11 +542,18 @@ Indenting wherever we can!
|
|||
#+end_src
|
||||
*** PDF Tools
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(require 'pdf-tools)
|
||||
(use-package pdf-tools
|
||||
:config
|
||||
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
|
||||
TeX-source-correlate-start-server t)
|
||||
|
||||
;; Update PDF buffers after successful LaTeX runs
|
||||
(add-hook 'TeX-after-compilation-finished-functions
|
||||
#'TeX-revert-document-buffer)
|
||||
(pdf-tools-install)
|
||||
(add-hook 'pdf-view-mode-hook
|
||||
'pdf-view-auto-slice-minor-mode)
|
||||
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
|
||||
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward))
|
||||
#+end_src
|
||||
*** Return to Minibuffer
|
||||
Taken from [[https://emacs.stackexchange.com/questions/42287/set-focus-to-minibuffer-window][stackoverlow]]. Returns the focus to the minibuffer.
|
||||
|
@ -749,8 +680,8 @@ Set up the company backends: (maybe do it the other way around...)
|
|||
For fuzzy completion matching.
|
||||
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package hotfuzz
|
||||
:config (setq completion-styles '(hotfuzz)))
|
||||
;; (use-package hotfuzz
|
||||
;; :config (setq completion-styles '(hotfuzz)))
|
||||
#+end_src
|
||||
|
||||
*** Lisp
|
||||
|
@ -884,9 +815,30 @@ Multiple major modes in one buffer.
|
|||
(setq org-treat-S-cursor-todo-selection-as-state-change nil)
|
||||
(setq org-clock-persist 'history)
|
||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||
(add-hook 'org-mode-hook (lambda () (setq-local yas-indent-line 'fixed)))
|
||||
(org-clock-persistence-insinuate)
|
||||
(setq org-id-link-to-org-use-id 'create-if-interactive)
|
||||
#+END_SRC
|
||||
**** Bars
|
||||
Add pretty bars to the org indent.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package org-bars
|
||||
:straight (:host github :repo "tonyaldon/org-bars")
|
||||
:hook (org-mode . org-bars-mode)
|
||||
:config
|
||||
(setq org-bars-color-options '(:desaturate-level-faces 30 :darken-level-faces 15)))
|
||||
#+end_src
|
||||
|
||||
And disable the ellipsis.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(defun org-no-ellipsis-in-headlines ()
|
||||
"Remove use of ellipsis in headlines.
|
||||
See `buffer-invisibility-spec'."
|
||||
(remove-from-invisibility-spec '(outline . t))
|
||||
(add-to-invisibility-spec 'outline))
|
||||
|
||||
(add-hook 'org-mode-hook 'org-no-ellipsis-in-headlines)
|
||||
#+end_src
|
||||
|
||||
**** Refile
|
||||
:PROPERTIES:
|
||||
|
@ -1012,29 +964,6 @@ Buff the agenda to use Groups.
|
|||
(define-key org-mode-map (kbd "C-S-<return>") 'org-insert-todo-heading)
|
||||
#+END_SRC
|
||||
|
||||
**** Bullets
|
||||
:PROPERTIES:
|
||||
:ID: 3dfd3886-edd6-4c15-9c9d-3f0dea822d26
|
||||
:END:
|
||||
For headings.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package org-bullets
|
||||
:custom
|
||||
(org-bullets-bullet-list '("◉" "○" "✸" "✿" "✜" "◆"))
|
||||
(org-ellipsis "↬")
|
||||
:hook (org-mode . org-bullets-mode))
|
||||
#+end_src
|
||||
|
||||
And for normal lists.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(font-lock-add-keywords 'org-mode
|
||||
'(("^ *\\([-]\\) "
|
||||
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
|
||||
(font-lock-add-keywords 'org-mode
|
||||
'(("^ *\\([+]\\) "
|
||||
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "◦"))))))
|
||||
#+end_src
|
||||
|
||||
**** Numbers in Heading
|
||||
:PROPERTIES:
|
||||
:ID: 25dbd121-47df-4035-8978-598034404cce
|
||||
|
@ -1173,7 +1102,7 @@ For =ox-hugo=.
|
|||
;; It is assumed that below file is present in `org-directory'
|
||||
;; and that it has a "Blog Ideas" heading. It can even be a
|
||||
;; symlink pointing to the actual location of all-posts.org!
|
||||
(file+olp "content.org" "Blog""Uncategorized")
|
||||
(file+olp "content.org" "Blog" "Uncategorized")
|
||||
(function org-hugo-new-subtree-post-capture-template)))
|
||||
#+end_src
|
||||
|
||||
|
@ -1218,6 +1147,17 @@ Automatically tangle on save.
|
|||
(lambda ()
|
||||
(add-hook 'after-save-hook 'org-babel-tangle nil 'make-it-local)))
|
||||
#+end_src
|
||||
|
||||
Format python code with black.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
;; (define-advice org-edit-src-exit (:before (&rest _args) format-python)
|
||||
;; "Run `python-black-buffer' on Python code."
|
||||
;; (when (and (local-variable-if-set-p 'org-src-mode)
|
||||
;; (eq major-mode 'python-mode))
|
||||
;; (message "Formatting python code...")
|
||||
;; (python-black-buffer)))
|
||||
|
||||
#+end_src
|
||||
**** Evince for PDF, Xournal for xoj
|
||||
:PROPERTIES:
|
||||
:ID: d9b3dab5-4e9f-4ab2-a40f-40f1268a1670
|
||||
|
@ -1320,12 +1260,15 @@ Ox-hugo allows to export org mode to hugo for my [[https://protagon.space][websi
|
|||
:ID: 7f5826e2-ac3d-4f59-a8f0-1e8810d6d177
|
||||
:END:
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package citeproc)
|
||||
(use-package org-ref
|
||||
:after (citeproc)
|
||||
:config
|
||||
(setq org-ref-bibliography-notes "~/bibliography/notes.org"
|
||||
org-ref-default-bibliography '("~/bibliography/references.bib")
|
||||
org-ref-pdf-directory "~/bibliography/bibtex-pdfs/")
|
||||
(require 'org-ref-ivy))
|
||||
;; (require 'org-ref-ivy)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
We add scihub as a pdf source.
|
||||
|
@ -1841,32 +1784,35 @@ Syntax checking and linting.
|
|||
:END:
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
;; Installed through nix
|
||||
;; (use-package elpy
|
||||
;; :init
|
||||
;; (elpy-enable)
|
||||
;; :config
|
||||
;; (add-hook 'elpy-mode-hook (lambda ()
|
||||
;; (add-hook 'before-save-hook
|
||||
;; 'elpy-black-fix-code nil t)))
|
||||
;; (when (load "flycheck" t t)
|
||||
;; (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
|
||||
;; (add-hook 'elpy-mode-hook 'flycheck-mode))
|
||||
|
||||
;; (add-to-list 'python-shell-completion-native-disabled-interpreters
|
||||
;; "jupyter"))
|
||||
(use-package elpy
|
||||
:init
|
||||
(elpy-enable)
|
||||
;; (add-hook 'elpy-mode-hook (lambda ()
|
||||
;; (add-hook 'before-save-hook
|
||||
;; 'elpy-black-fix-code nil t)))
|
||||
:config
|
||||
(add-hook 'elpy-mode-hook (lambda ()
|
||||
(add-hook 'before-save-hook
|
||||
'elpy-black-fix-code nil t)))
|
||||
(setq elpy-project-root-finder-functions '(elpy-project-find-git-root elpy-project-find-python-root elpy-project-find-hg-root elpy-project-find-svn-root))
|
||||
(setq elpy-rpc-backend "jedi")
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt")
|
||||
|
||||
(when (load "flycheck" t t)
|
||||
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
|
||||
(add-hook 'elpy-mode-hook 'flycheck-mode))
|
||||
|
||||
(setq elpy-project-root-finder-functions '(elpy-project-find-git-root elpy-project-find-python-root elpy-project-find-hg-root elpy-project-find-svn-root))
|
||||
(setq elpy-rpc-backend "jedi")
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt")
|
||||
(add-to-list 'python-shell-completion-native-disabled-interpreters
|
||||
"jupyter"))
|
||||
;; (add-hook 'elpy-mode-hook (lambda ()
|
||||
;; (add-hook 'before-save-hook
|
||||
;; 'elpy-black-fix-code nil t)))
|
||||
|
||||
#+end_src
|
||||
**** Black
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package python-black
|
||||
:demand t
|
||||
:after python
|
||||
:hook (python-mode . python-black-on-save-mode-enable-dwim))
|
||||
#+end_src
|
||||
**** Tree Sitter
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
|
@ -1884,6 +1830,7 @@ Syntax checking and linting.
|
|||
:config
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(jupyter-repl-mode . python))
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(inferior-python-mode . python))
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(inferior-python-mode . bash))
|
||||
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
|
||||
#+end_src
|
||||
|
||||
|
@ -1956,6 +1903,204 @@ Support for sphinx style docstrings.
|
|||
:init (setq xref-show-definitions-function #'ivy-xref-show-defs))
|
||||
#+END_SRC
|
||||
|
||||
*** Auto expanding snippets
|
||||
Very useful for TeX. Expand automatically.
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(setq greek-letters '(";al" "α"
|
||||
";be" "β"
|
||||
";ga" "γ"
|
||||
";de" "δ"
|
||||
";ep" "ε"
|
||||
";ze" "ζ"
|
||||
";et" "η"
|
||||
";th" "θ"
|
||||
";io" "ι"
|
||||
";ka" "κ"
|
||||
";la" "λ"
|
||||
";mu" "μ"
|
||||
";nu" "ν"
|
||||
";xi" "ξ"
|
||||
";oi" "ο" ;; omicron
|
||||
";pi" "π"
|
||||
";ro" "ρ"
|
||||
";si" "σ"
|
||||
";ta" "τ"
|
||||
";up" "υ"
|
||||
";ph" "φ"
|
||||
";ch" "χ"
|
||||
";ps" "ψ"
|
||||
";oe" "ω" ;; omega
|
||||
|
||||
;; Greek capital letters
|
||||
";Al" "Α"
|
||||
";Be" "Β"
|
||||
";Ga" "Γ"
|
||||
";De" "Δ"
|
||||
";Ep" "Ε"
|
||||
";Ze" "Ζ"
|
||||
";Et" "Η"
|
||||
";Th" "Θ"
|
||||
";Io" "Ι"
|
||||
";Ka" "Κ"
|
||||
";La" "Λ"
|
||||
";Mu" "Μ"
|
||||
";Nu" "Ν"
|
||||
";Xi" "Ξ"
|
||||
";Oi" "Ο" ;; Omicron
|
||||
";Pi" "Π"
|
||||
";Ro" "Ρ"
|
||||
";Si" "Σ"
|
||||
";Ta" "Τ"
|
||||
";Up" "Υ"
|
||||
";Ph" "Φ"
|
||||
";Ch" "Χ"
|
||||
";Ps" "Ψ"
|
||||
";Oe" "Ω" ;; Omega
|
||||
)
|
||||
greek-latex '(";al" "\\alpha"
|
||||
";be" "\\beta"
|
||||
";ga" "\\gamma"
|
||||
";de" "\\delta"
|
||||
";ep" "ε"
|
||||
";ze" "ζ"
|
||||
";et" "η"
|
||||
";th" "θ"
|
||||
";io" "ι"
|
||||
";ka" "κ"
|
||||
";la" "λ"
|
||||
";mu" "μ"
|
||||
";nu" "ν"
|
||||
";xi" "ξ"
|
||||
";oi" "ο" ;; omicron
|
||||
";pi" "π"
|
||||
";ro" "ρ"
|
||||
";si" "σ"
|
||||
";ta" "τ"
|
||||
";up" "υ"
|
||||
";ph" "φ"
|
||||
";ch" "χ"
|
||||
";ps" "ψ"
|
||||
";oe" "ω" ;; omega
|
||||
|
||||
;; Greek capital letters
|
||||
";Al" "Α"
|
||||
";Be" "Β"
|
||||
";Ga" "Γ"
|
||||
";De" "Δ"
|
||||
";Ep" "Ε"
|
||||
";Ze" "Ζ"
|
||||
";Et" "Η"
|
||||
";Th" "Θ"
|
||||
";Io" "Ι"
|
||||
";Ka" "Κ"
|
||||
";La" "Λ"
|
||||
";Mu" "Μ"
|
||||
";Nu" "Ν"
|
||||
";Xi" "Ξ"
|
||||
";Oi" "Ο" ;; Omicron
|
||||
";Pi" "Π"
|
||||
";Ro" "Ρ"
|
||||
";Si" "Σ"
|
||||
";Ta" "Τ"
|
||||
";Up" "Υ"
|
||||
";Ph" "Φ"
|
||||
";Ch" "Χ"
|
||||
";Ps" "Ψ"
|
||||
";Oe" "Ω" ;; Omega
|
||||
))
|
||||
(use-package aas
|
||||
:hook (LaTeX-mode . aas-activate-for-major-mode)
|
||||
:hook (org-mode . aas-activate-for-major-mode)
|
||||
:hook (python-mode . aas-activate-for-major-mode)
|
||||
:hook (jupyter-repl-mode . (lambda ()
|
||||
(aas-mode 1)
|
||||
(aas-activate-keymap 'greek-letters)))
|
||||
:hook (minibuffer-setup . (lambda ()
|
||||
(aas-mode 1)
|
||||
(aas-activate-keymap 'greek-letters)))
|
||||
:hook (minibuffer-exit . (lambda ()
|
||||
(aas-mode 0)
|
||||
(aas-activate-keymap 'greek-letters)))
|
||||
:config
|
||||
(apply #'aas-set-snippets 'text-mode greek-letters)
|
||||
(apply #'aas-set-snippets 'greek-letters greek-letters)
|
||||
(apply #'aas-set-snippets 'python-mode greek-letters)
|
||||
(apply #'aas-set-snippets 'jupyter-repl-mode greek-letters)
|
||||
(aas-set-snippets 'latex-mode
|
||||
;; set condition!
|
||||
:cond #'texmathp ; expand only while in math
|
||||
"supp" "\\supp"
|
||||
"On" "O(n)"
|
||||
"O1" "O(1)"
|
||||
"Olog" "O(\\log n)"
|
||||
"Olon" "O(n \\log n)"
|
||||
"dag" "^\\dag"
|
||||
"conj" "^\\ast"
|
||||
"/cal" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\mathcal{$1}$0"))
|
||||
"/dot" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\dot{$1}$0"))
|
||||
"/ev" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\ev{$1}$0"))
|
||||
;; bind to functions!
|
||||
"//" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\frac{$1}{$2}$0"))
|
||||
"dv" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\dv{$1}{$2}$0"))
|
||||
"Span" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\Span($1)$0"))
|
||||
"!=" "\\neq"
|
||||
"!>" "\\mapsto"
|
||||
"**" "\\cdot"
|
||||
"+-" "\\pm"
|
||||
"-+" "\\mp"
|
||||
"->" "\\to"
|
||||
"..." "\\dots"
|
||||
"<<" "\\ll"
|
||||
"<=" "\\leq"
|
||||
"<>" "\\diamond"
|
||||
"=<" "\\impliedby"
|
||||
"==" "&="
|
||||
"=>" "\\implies"
|
||||
">=" "\\geq"
|
||||
">>" "\\gg"
|
||||
"AA" "\\forall"
|
||||
"EE" "\\exists"
|
||||
"cb" "^3"
|
||||
"iff" "\\iff"
|
||||
"inn" "\\in"
|
||||
"notin" "\\not\\in"
|
||||
"sr" "^2"
|
||||
"xx" "\\times"
|
||||
"|->" "\\mapsto"
|
||||
"|=" "\\models"
|
||||
"||" "\\mid"
|
||||
"~=" "\\approx"
|
||||
"~~" "\\sim"
|
||||
"arccos" "\\arccos"
|
||||
"arccot" "\\arccot"
|
||||
"arccot" "\\arccot"
|
||||
"arccsc" "\\arccsc"
|
||||
"arcsec" "\\arcsec"
|
||||
"arcsin" "\\arcsin"
|
||||
"arctan" "\\arctan"
|
||||
"cos" "\\cos"
|
||||
"cot" "\\cot"
|
||||
"csc" "\\csc"
|
||||
"exp" "\\exp"
|
||||
"ln" "\\ln"
|
||||
"log" "\\log"
|
||||
"perp" "\\perp"
|
||||
"sin" "\\sin"
|
||||
"star" "\\star"
|
||||
"gcd" "\\gcd"
|
||||
"min" "\\min"
|
||||
"max" "\\max"
|
||||
";'" "\\prime"
|
||||
";." "\\cdot"
|
||||
))
|
||||
#+end_src
|
||||
|
||||
*** Fish
|
||||
:PROPERTIES:
|
||||
:ID: 8f702ee5-59b7-4056-b76e-f9cd13414657
|
||||
|
@ -2217,12 +2362,12 @@ Hooking into aggressive indent.
|
|||
#+end_src
|
||||
*** Languagetool LSP
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
(use-package lsp-ltex
|
||||
:after (lsp-mode)
|
||||
:hook (latex-mode . (lambda ()
|
||||
(require 'lsp-ltex)
|
||||
(lsp)))
|
||||
:config (setq lsp-ltex-language "en-GB"))
|
||||
;; (use-package lsp-ltex
|
||||
;; :after (lsp-mode)
|
||||
;; :hook (latex-mode . (lambda ()
|
||||
;; (require 'lsp-ltex)
|
||||
;; (lsp)))
|
||||
;; :config (setq lsp-ltex-language "en-GB"))
|
||||
#+end_src
|
||||
** Applications
|
||||
*** Ank
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
(eval-print-last-sexp)))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
(straight-use-package 'use-package)
|
||||
(straight-use-package 'org)
|
||||
;(straight-use-package 'org)
|
||||
(org-babel-load-file "~/.emacs.d/emacs.org")
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
!keycode 18 = 9 parenleft 9 parenleft
|
||||
!keycode 19 = 0 parenright 0 parenright
|
||||
keycode 18 = 9 bracketleft 9 bracketleft
|
||||
|
|
|
@ -23,7 +23,7 @@ linecolor = ${colors.linecolor}
|
|||
border-bottom-size = 2
|
||||
border-bottom-color = ${colors.bordercolor}
|
||||
|
||||
font-0 = Fira Code:size=10;2
|
||||
font-0 = JetBrains Mono:size=10;2
|
||||
font-1 = FontAwesome:size=10;2
|
||||
|
||||
# {{ #LAPTOP }}
|
||||
|
@ -75,16 +75,16 @@ enable-scroll = true
|
|||
reverse-scroll = true
|
||||
|
||||
label-focused-background = ${colors.bordercolor}
|
||||
ws-icon-0 = "IV;"
|
||||
ws-icon-1 = "VII;7"
|
||||
ws-icon-2 = "I;"
|
||||
ws-icon-3 = "II;"
|
||||
ws-icon-4 = "III;"
|
||||
ws-icon-5 = "V;"
|
||||
ws-icon-6 = "VI;6"
|
||||
ws-icon-7 = "VIII;8"
|
||||
ws-icon-8 = "IX;"
|
||||
ws-icon-9 = "X;"
|
||||
ws-icon-0 = "4;"
|
||||
ws-icon-1 = "7;7"
|
||||
ws-icon-2 = "1;"
|
||||
ws-icon-3 = "2;"
|
||||
ws-icon-4 = "3;"
|
||||
ws-icon-5 = "5;"
|
||||
ws-icon-6 = "6;6"
|
||||
ws-icon-7 = "8;8"
|
||||
ws-icon-8 = "9;"
|
||||
ws-icon-9 = "0;"
|
||||
|
||||
label-focused = %icon%
|
||||
label-focused-padding = 1
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
# terminal emulator
|
||||
super + Return
|
||||
alacritty
|
||||
WINIT_X11_SCALE_FACTOR=1.6666666666666667 alacritty
|
||||
|
||||
# emacs
|
||||
super + alt + p
|
||||
super + j
|
||||
bash /home/hiro/.scripts/ec -c
|
||||
|
||||
# launcher
|
||||
|
@ -23,7 +23,7 @@ super + q
|
|||
pkill -USR1 -x sxhkd
|
||||
|
||||
# screenshot
|
||||
super + {control,shift} + s
|
||||
super + {control,shift} + v
|
||||
xfce4-screenshooter -c {-f,-r}
|
||||
|
||||
super + y
|
||||
|
@ -79,7 +79,7 @@ super + shift + Return
|
|||
#
|
||||
|
||||
# set the window state
|
||||
super + {t,shift + t,s,f}
|
||||
super + {t,shift + t,alt + s,f}
|
||||
bspc node -t {tiled,pseudo_tiled,floating,fullscreen} || bspc node -t tiled
|
||||
|
||||
# set the node flags
|
||||
|
@ -107,7 +107,7 @@ super + bracket{left,right}
|
|||
bspc desktop -f {prev,next}.local
|
||||
|
||||
# focus the last node/desktop
|
||||
super + {grave,Tab}
|
||||
super + {Tab,Escape}
|
||||
bspc {node,desktop} -f last
|
||||
|
||||
# focus the older or newer node in the focus history
|
||||
|
@ -118,59 +118,45 @@ super + {_,shift +}c
|
|||
|
||||
# focus or send to the given desktop
|
||||
super + {_,shift +}{1-9,0}
|
||||
bspc {desktop -f,node -d} {I,II,III,IV,V,VI,VII,VIII,IX,X}
|
||||
bspc {desktop -f,node -d} {1,2,3,4,5,6,7,8,9,0} --follow
|
||||
|
||||
# move desktop to next monitor
|
||||
super + shift + m
|
||||
super + alt + m
|
||||
bspc desktop focused -m next --follow
|
||||
|
||||
super + shift + m
|
||||
bspc node -n last.!automatic
|
||||
|
||||
#
|
||||
# preselect
|
||||
#
|
||||
|
||||
# preselect the direction
|
||||
super + ctrl + {e,p,u,o}
|
||||
super + shift + s : {e,p,u,o}
|
||||
bspc node -p {west,south,north,east}
|
||||
|
||||
# preselect the ratio
|
||||
super + ctrl + {1-9}
|
||||
super + shift + s : {1-9}
|
||||
bspc node -o 0.{1-9}
|
||||
|
||||
# cancel the preselection for the focused node
|
||||
super + ctrl + space
|
||||
super + shift + s : space
|
||||
bspc node -p cancel
|
||||
|
||||
# cancel the preselection for the focused desktop
|
||||
super + ctrl + shift + space
|
||||
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
|
||||
|
||||
#
|
||||
# move/resize
|
||||
#
|
||||
|
||||
# expand a window by moving one of its side outward
|
||||
super + alt + {e,p,u,o}
|
||||
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
|
||||
|
||||
# contract a window by moving one of its side inward
|
||||
super + alt + shift + {e,p,u,o}
|
||||
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
|
||||
# Expand/contract a window by moving one of its side outward/inward
|
||||
super + s : {e,p,u,o}
|
||||
STEP=20; SELECTION={1,2,3,4}; \
|
||||
bspc node -z $(echo "left -$STEP 0,bottom 0 $STEP,top 0 -$STEP,right $STEP 0" | cut -d',' -f$SELECTION) || \
|
||||
bspc node -z $(echo "right -$STEP 0,top 0 $STEP,bottom 0 -$STEP,left $STEP 0" | cut -d',' -f$SELECTION)
|
||||
|
||||
# move a floating window
|
||||
super + {Left,Down,Up,Right}
|
||||
bspc node -v {-20 0,0 20,0 -20,20 0}
|
||||
|
||||
# Smart resize, will grow or shrink depending on location.
|
||||
# Will always grow for floating nodes.
|
||||
super + alt + {e,p,u,o}
|
||||
n=10; \
|
||||
{ d1=left; d2=right; dx=-$n; dy=0; \
|
||||
, d1=bottom; d2=top; dx=0; dy=$n; \
|
||||
, d1=top; d2=bottom; dx=0; dy=-$n; \
|
||||
, d1=right; d2=left; dx=$n; dy=0; \
|
||||
} \
|
||||
bspc node --resize $d1 $dx $dy || bspc node --resize $d2 $dx $dy
|
||||
|
||||
# rotate tree
|
||||
super + shift + {d,a}
|
||||
bspc node @/ -C {forward,backward}
|
||||
|
|
Loading…
Add table
Reference in a new issue