From dc8cb523963dd5af05268f3dede962b57dac3a8c Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 15 Sep 2022 22:55:03 +0200 Subject: [PATCH] Many changes after Aurora migration --- emacs/.config/doom/config.el | 187 ++++++++++++++++++++++++++++ emacs/.config/doom/config.org | 1 + emacs/.config/doom/init.el | 1 + emacs/.config/doom/org-agenda-files | 1 + emacs/.config/doom/packages.el | 1 + emacs/doom/config.org | 4 +- emacs/doom/init.el | 2 +- i3/i3/config | 80 +++--------- polybar/config.ini | 2 +- zsh/.zshrc | 2 +- 10 files changed, 211 insertions(+), 70 deletions(-) create mode 100644 emacs/.config/doom/config.el create mode 120000 emacs/.config/doom/config.org create mode 120000 emacs/.config/doom/init.el create mode 120000 emacs/.config/doom/org-agenda-files create mode 120000 emacs/.config/doom/packages.el diff --git a/emacs/.config/doom/config.el b/emacs/.config/doom/config.el new file mode 100644 index 0000000..2e82262 --- /dev/null +++ b/emacs/.config/doom/config.el @@ -0,0 +1,187 @@ +;; Here are some additional functions/macros that could help you configure Doom: +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. + +;; Some functionality uses this to identify you, e.g. GPG configuration, email +;; clients, file templates and snippets. +(setq user-full-name "Julian Mutter" + user-mail-address "julian.mutter@comumail.de") + +;; Doom exposes five (optional) variables for controlling fonts in Doom. Here +;; are the three important ones: +;; +;; + `doom-font' +;; + `doom-variable-pitch-font' +;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; +;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd +;; font string. You generally only need these two: +;; (setq doom-font (font-spec :family "monospace" :size 13 :weight 'semi-light) +;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) +(setq doom-font (font-spec :family "Source Code Pro" :size 14)) + +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. This is the default: +(setq doom-theme 'doom-one) + +;; This determines the style of line numbers in effect. If set to `nil', line +;; numbers are disabled. For relative line numbers, set this to `relative'. +(setq display-line-numbers-type 'relative) + +;; Open external terminal +(map! :leader :desc "Open external terminal" "o t" (cmd! (call-process-shell-command "xfce4-terminal &" nil 0))) + +;; Remap font scaling keybindings to make more sense +(map! :desc "Increase font size" :n "C-+" #'text-scale-increase) +(map! :desc "Decrease font size" :n "C--" #'text-scale-decrease) +(map! :desc "Reset font size" :n "C-=" #'doom/reset-font-size) + +(map! :desc "Flycheck next error" :nv "g n" #'flycheck-next-error) +(map! :desc "Flycheck previous error" :nv "g N" #'flycheck-previous-error) + +(map! :desc "Format and save" :nvi "C-s" #'fd-format-and-save) +(map! :leader "w 1" #'delete-other-windows) + +(setq-default evil-escape-key-sequence "kj") + +(defun fd-format-and-save() + (interactive) + (company-abort) + (evil-force-normal-state) + (+format/buffer) + (save-buffer)) + +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq org-directory "~/org" + org-roam-directory "~/org/roam") + +;; (setq org-agenda-files (list "~/org")) +;; (custom-set-variables +;; '(org-directory "~/org") +;; '(org-agenda-files (list org-directory))) + +;; (add-to-list 'org-agenda-files "~/org/anothertest.org" 'append) + +;; Adding my org-agenda files +(after! org + (setq org-agenda-files (expand-file-name "org-agenda-files" doom-private-dir))) + +(setq org-export-allow-bind-keywords t) + +;; (map! :nv "SPC r" "SPC n r") + +(map! :map org-mode-map :nvi "C-k" #'org-backward-element) +(map! :map org-mode-map :nvi "C-j" #'org-forward-element) +(map! :map org-mode-map :nvi "C-h" #'org-up-element) +(map! :map org-mode-map :nvi "C-l" #'org-down-element) + +;; Spell checking settings +;; TODO make toggling of spell checking ('SPC t s') use flyspell-mode in text modesm and flyspell-prog-mode in programming modes (see hooks below) +;; Removing hooks for automatic spell checking set here: https://github.com/hlissner/doom-emacs/blob/develop/modules/checkers/spell/config.el +(remove-hook! '(org-mode-hook + markdown-mode-hook + TeX-mode-hook + rst-mode-hook + mu4e-compose-mode-hook + message-mode-hook + git-commit-mode-hook) + #'flyspell-mode) + +(remove-hook! '(yaml-mode-hook + conf-mode-hook + prog-mode-hook) + #'flyspell-prog-mode) + +(setq ispell-dictionary "english") + +(map! :map doom-leader-toggle-map :desc "Toggle dictionary" "d" #'fd-switch-dictionary) + +(defun fd-switch-dictionary() + (interactive) + (let* ((dic ispell-current-dictionary) + (change (if (string= dic "german") "english" "german"))) + (ispell-change-dictionary change) + (message "Dictionary switched from %s to %s" dic change) + )) + +(setq lsp-dart-flutter-sdk-dir "/home/julian/snap/flutter/common/flutter") + +;; Make sniping simpler for german keyboard +(setq evil-snipe-scope 'visible) +(map! :map evil-snipe-override-mode-map :m "," #'evil-snipe-repeat) +(map! :map evil-snipe-override-mode-map :m ";" #'evil-snipe-repeat-reverse) +(map! :map evil-snipe-parent-transient-map "," #'evil-snipe-repeat) +(map! :map evil-snipe-parent-transient-map ";" #'evil-snipe-repeat-reverse) + +;; (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t) +;; (add-to-list +;; 'auto-mode-alist +;; '("\\.m$" . matlab-mode)) +;; (setq matlab-indent-function t) +;; (setq matlab-shell-command "/urs/local/bin/matlab") + +(map! :desc "Toggle case of word" :nv "g C" #'toggle-word-case) + +(defun toggle-word-case () + "Toggle the case of current word or text selection." + + (interactive) + (let ( + (deactivate-mark nil) + $p1 $p2) + (if (use-region-p) + (setq $p1 (region-beginning) $p2 (region-end)) + (save-excursion + (skip-chars-backward "[:alpha:]") + (setq $p1 (point)) + (skip-chars-forward "[:alpha:]") + (setq $p2 (point)))) + (let ((first-char-prop (get-char-code-property (char-after $p1) 'general-category))) + (cond ((string= "Ll" first-char-prop) ; Lower case + (upcase-region $p1 (+ $p1 1))) + ((string= "Lu" first-char-prop) ; Upper case + (downcase-region $p1 (+ $p1 1))) + (t (message "Word does not start with a alphabetic character")))))) + +(add-hook 'tetris-mode-hook #'turn-off-evil-mode) + +;; Add company-quickhelp +(company-quickhelp-mode) + +(map! :map company-active-map "TAB" nil) +(map! :map company-active-map "" nil) + +(defun fd-pretty-print-dirty-json() + (interactive) + (let ((new-buffer-contents (shell-command-to-string (format "echo '%s' | newliner" (buffer-string))))) + (erase-buffer) + (insert new-buffer-contents) + (evil-indent (buffer-end -1) (buffer-end +1))) + ) + +;; Python settings +;; (add-hook 'python-mode-hook (lambda () +;; (setq flycheck-checker 'python-pylint))) + +;; (add-hook 'pyhon-mode-local-vars-hook +;; (lambda () +;; (when (flycheck-may-enable-checker 'lsp) +;; (flycheck-select-checker 'python-pylint)))) + +(set-docsets! 'haskell-mode "Haskell") diff --git a/emacs/.config/doom/config.org b/emacs/.config/doom/config.org new file mode 120000 index 0000000..23e556b --- /dev/null +++ b/emacs/.config/doom/config.org @@ -0,0 +1 @@ +/home/julian/.dotfiles/emacs/doom/config.org \ No newline at end of file diff --git a/emacs/.config/doom/init.el b/emacs/.config/doom/init.el new file mode 120000 index 0000000..620951e --- /dev/null +++ b/emacs/.config/doom/init.el @@ -0,0 +1 @@ +/home/julian/.dotfiles/emacs/doom/init.el \ No newline at end of file diff --git a/emacs/.config/doom/org-agenda-files b/emacs/.config/doom/org-agenda-files new file mode 120000 index 0000000..f5628a9 --- /dev/null +++ b/emacs/.config/doom/org-agenda-files @@ -0,0 +1 @@ +/home/julian/.dotfiles/emacs/doom/org-agenda-files \ No newline at end of file diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el new file mode 120000 index 0000000..0a461bc --- /dev/null +++ b/emacs/.config/doom/packages.el @@ -0,0 +1 @@ +/home/julian/.dotfiles/emacs/doom/packages.el \ No newline at end of file diff --git a/emacs/doom/config.org b/emacs/doom/config.org index 297d70b..b2778a5 100644 --- a/emacs/doom/config.org +++ b/emacs/doom/config.org @@ -86,8 +86,8 @@ ;; If you use `org' and don't want your org files in the default location below, ;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/Nextcloud/org" - org-roam-directory "~/Nextcloud/org-roam") +(setq org-directory "~/org" + org-roam-directory "~/org/roam") ;; (setq org-agenda-files (list "~/org")) ;; (custom-set-variables diff --git a/emacs/doom/init.el b/emacs/doom/init.el index 818ab87..4e87e92 100644 --- a/emacs/doom/init.el +++ b/emacs/doom/init.el @@ -152,7 +152,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 + (org +dragndrop +pandoc +pretty +roam2) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional diff --git a/i3/i3/config b/i3/i3/config index 961ad56..dcb58d3 100644 --- a/i3/i3/config +++ b/i3/i3/config @@ -40,7 +40,6 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU floating_modifier $mod # start a terminal -# bindsym $mod+Return exec xfce4-terminal bindsym $mod+Return exec alacritty # kill focused window @@ -72,20 +71,20 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+h exec i3l move left -bindsym $mod+Shift+j exec i3l move down -bindsym $mod+Shift+k exec i3l move up -bindsym $mod+Shift+l exec i3l move right +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right # alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left exec i3l move left -bindsym $mod+Shift+Down exec i3l move down -bindsym $mod+Shift+Up exec i3l move up -bindsym $mod+Shift+Right exec i3l move right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right # split in horizontal / vertical orientation -# bindsym $mod+Shift+v split h -# bindsym $mod+v split v +bindsym $mod+Shift+v split h +bindsym $mod+v split v # enter fullscreen mode for the focused container bindsym $mod+f fullscreen toggle @@ -123,17 +122,6 @@ set $ws8 "8" set $ws9 "9" set $ws10 "10" -set $i3l vstack to workspace $ws1 -set $i3l vstack to workspace $ws2 -set $i3l vstack to workspace $ws3 -set $i3l vstack to workspace $ws4 -set $i3l vstack to workspace $ws5 -set $i3l vstack to workspace $ws6 -set $i3l vstack to workspace $ws7 -set $i3l vstack to workspace $ws8 -set $i3l vstack to workspace $ws9 -set $i3l vstack to workspace $ws10 - # switch to workspace bindsym $mod+1 workspace number $ws1 bindsym $mod+2 workspace number $ws2 @@ -266,50 +254,20 @@ mode "$mode_screenshot_clipboard" { } bindsym $mod+Print mode "$mode_screenshot_clipboard" -set $mode_choose_layout Layout (h) vstack-left, (l) vstack-right, (k) hstack-top, (j) hstack-bottom, (c) 2columns -mode "$mode_choose_layout" { - bindsym h exec i3l vstack 0.5 right, mode "default" - bindsym l exec i3l vstack 0.5 left, mode "default" - bindsym j exec i3l hstack 0.5 up, mode "default" - bindsym k exec i3l hstack 0.5 down, mode "default" - bindsym c exec i3l 2columns left, mode "default" - - # back to normal: Escape - bindsym Escape mode "default" -} -bindsym $mod+G mode "$mode_choose_layout" - -bindsym $mod+Ctrl+h exec i3l vstack 0.5 right, mode "default" -bindsym $mod+Ctrl+l exec i3l vstack 0.5 left, mode "default" -bindsym $mod+Ctrl+j exec i3l hstack 0.5 up, mode "default" -bindsym $mod+Ctrl+k exec i3l hstack 0.5 down, mode "default" - -bindsym $mod+Ctrl+Left exec i3l vstack 0.5 right, mode "default" -bindsym $mod+Ctrl+Right exec i3l vstack 0.5 left, mode "default" -bindsym $mod+Ctrl+Down exec i3l hstack 0.5 up, mode "default" -bindsym $mod+Ctrl+Up exec i3l hstack 0.5 down, mode "default" - #bindsym $mod+Ctrl+Right move workspace to output right #bindsym $mod+Ctrl+Left move workspace to output right #bindsym $mod+c exec xfce4-terminal --role floating --hide-scrollbar --title Calculator -e qalc bindsym $mod+c exec qalculate-gtk -# bindsym $mod+p exec xwacomcalibrate -# bindsym $mod+t exec thunar -bindsym $mod+t exec krusader +bindsym $mod+p exec xwacomcalibrate +bindsym $mod+t exec thunar +# bindsym $mod+t exec krusader #bindsym $mod+m exec xfce4-terminal -x mc bindsym $mod+Shift+c exec $scripts/jupyter-calculator bindsym $mod+b exec firefox #bindsym $mod+s exec pavucontrol bindsym $mod+u exec pamac-manager -bindsym $mod+p [con_mark="i3l::previous"] focus -bindsym $mod+m [con_mark="i3l:[^:]+:main" workspace="__focused__"] focus -# bindsym $mod+Shift+m [con_mark="i3l:[^:]+:main" workspace="__focused__"] focus; exec i3l swap container with mark "i3l::previous" -#exec $scripts/i3l-swap-master -# bindsym $mod+Shift+m exec i3l [con_mark="i3l:[^:]+:main" workspace="__focused__"] swap container with mark "i3l::current" -# bindsym $mod+Shift+m exec i3l swap container with mark "__focused__:main" - # read 1 character and mark the current window with this character # bindsym $mod+m exec i3-input -F 'mark %s' -l 1 -P 'Mark: ' # read 1 character and go to the window with the character @@ -368,7 +326,6 @@ exec firefox #exec element-desktop no_focus #exec telegram-desktop no_focus -exec_always --no-startup-id i3-layouts # Rightclick menu exec_always --no-startup-id ~/.config/polybar/startup.sh exec --no-startup-id jgmenu --at-pointer --hide-on-startup @@ -388,16 +345,9 @@ exec --no-startup-id start-pulseaudio-x11 #exec --no-startup-id feh --randomize --bg-fill /home/julian/Pictures/Hintergrundbilder/* exec --no-startup-id feh --bg-fill /home/julian/Bilder/background.jpg # Notifications -# exec --no-startup-id dunst -config /home/julian/.config/dunst/dunstrc -exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd +exec --no-startup-id dunst -config /home/julian/.config/dunst/dunstrc +# exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd # Default workspaces at startup (no need because autostart applications get always focused) #exec --no-startup-id i3-msg workspace $ws1 #exec --no-startup-id i3-msg workspace $ws10 - -#bindsym $mod+Ctrl+q exec i3l 'vstack right' && notify-send 'Layout vstack right' -#bindsym $mod+Ctrl+w exec i3l 'vstack left' && notify-send 'Layout vstack left' -#bindsym $mod+Ctrl+e exec 'i3l hstack down' && notify-send 'Layout hstack down' -#bindsym $mod+Ctrl+r exec 'i3l hstack up' && notify-send 'Layout hstack up' -#bindsym $mod+Ctrl+t exec i3l 3columns right && notify-send 'Layout 3columns' -#bindsym $mod+Ctrl+z exec i3l 2columns left && notify-send 'Layout 2columns' diff --git a/polybar/config.ini b/polybar/config.ini index 94e85f4..45e4b76 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -115,7 +115,7 @@ label-empty-padding = 1 type = internal/fs interval = 25 -mount-0 = / +mount-0 = /home label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% diff --git a/zsh/.zshrc b/zsh/.zshrc index 8ab99bd..c844c35 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -84,7 +84,7 @@ plugins=( # make it behave like fish zsh-autosuggestions - zsh-history-substring-search + history-substring-search zsh-syntax-highlighting )