mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
chore: remove unneeded Emacs packages
This commit is contained in:
parent
b3c492d11b
commit
7e6d7fea84
15 changed files with 1724 additions and 3029 deletions
1339
SwarselSystems.org
1339
SwarselSystems.org
File diff suppressed because it is too large
Load diff
49
flake.nix
49
flake.nix
|
|
@ -6,119 +6,78 @@
|
|||
"https://nix-community.cachix.org"
|
||||
"https://cache.ngi0.nixos.org/"
|
||||
];
|
||||
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
|
||||
];
|
||||
};
|
||||
|
||||
inputs = {
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
|
||||
systems.url = "github:nix-systems/default-linux";
|
||||
|
||||
# user-level configuration
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# overlay to access bleeding edge emacs
|
||||
emacs-overlay = {
|
||||
url = "github:nix-community/emacs-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# nix user repository
|
||||
# i use this mainly to not have to build all firefox extensions
|
||||
# myself as well as for the emacs-init package (tbd)
|
||||
nur.url = "github:nix-community/NUR";
|
||||
|
||||
# provides GL to non-NixOS hosts
|
||||
nixgl.url = "github:guibou/nixGL";
|
||||
|
||||
# manages all theming using Home-Manager
|
||||
stylix.url = "github:danth/stylix";
|
||||
|
||||
# nix secrets management
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
|
||||
# enable secure boot on NixOS
|
||||
lanzaboote.url = "github:nix-community/lanzaboote";
|
||||
|
||||
# nix for android
|
||||
nix-on-droid = {
|
||||
url = "github:nix-community/nix-on-droid/release-24.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# generate NixOS images
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# hardware quirks on nix
|
||||
nixos-hardware = {
|
||||
url = "github:NixOS/nixos-hardware/master";
|
||||
};
|
||||
|
||||
# dynamic library loading
|
||||
nix-alien = {
|
||||
url = "github:thiagokokada/nix-alien";
|
||||
};
|
||||
|
||||
# automatic nintendo switch payload injection
|
||||
nswitch-rcm-nix = {
|
||||
url = "github:Swarsel/nswitch-rcm-nix";
|
||||
};
|
||||
|
||||
# weekly updated nix-index database
|
||||
nix-index-database = {
|
||||
url = "github:nix-community/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
zjstatus = {
|
||||
url = "github:dj95/zjstatus";
|
||||
};
|
||||
|
||||
fw-fanctrl = {
|
||||
url = "github:TamtamHero/fw-fanctrl/packaging/nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-darwin = {
|
||||
url = "github:lnl7/nix-darwin";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-secrets = {
|
||||
url = "git+ssh://git@github.com/Swarsel/nix-secrets.git?ref=main&shallow=1";
|
||||
flake = false;
|
||||
inputs = { };
|
||||
};
|
||||
|
||||
nix-topology.url = "github:oddlama/nix-topology";
|
||||
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{ self
|
||||
, nixpkgs
|
||||
|
|
@ -215,10 +174,8 @@
|
|||
import ./checks { inherit self inputs system pkgs; }
|
||||
);
|
||||
|
||||
|
||||
nixosConfigurations =
|
||||
lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "nixos") "nixos";
|
||||
|
||||
homeConfigurations =
|
||||
|
||||
# "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
|
|
@ -230,11 +187,8 @@
|
|||
# };
|
||||
|
||||
lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "home") "home" lib.swarselsystems.pkgsFor.x86_64-linux;
|
||||
|
||||
|
||||
darwinConfigurations =
|
||||
lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "darwin") "darwin";
|
||||
|
||||
nixOnDroidConfigurations =
|
||||
|
||||
# magicant = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
|
|
@ -246,8 +200,6 @@
|
|||
|
||||
lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "android" lib.swarselsystems.pkgsFor.aarch64-linux;
|
||||
|
||||
|
||||
|
||||
topology =
|
||||
|
||||
lib.swarselsystems.forEachSystem (pkgs: import inputs.nix-topology {
|
||||
|
|
@ -259,6 +211,5 @@
|
|||
];
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
20
justfile
20
justfile
|
|
@ -1,27 +1,27 @@
|
|||
default:
|
||||
@just --list
|
||||
@just --list
|
||||
|
||||
check:
|
||||
nix flake check --keep-going
|
||||
nix flake check --keep-going
|
||||
|
||||
check-trace:
|
||||
nix flake check --show-trace
|
||||
nix flake check --show-trace
|
||||
|
||||
update:
|
||||
nix flake update
|
||||
nix flake update
|
||||
|
||||
iso:
|
||||
rm -rf result
|
||||
nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
|
||||
rm -rf result
|
||||
nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
|
||||
|
||||
iso-flake FLAKE SYSTEM="x86_64" FORMAT="iso":
|
||||
nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
|
||||
nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
|
||||
|
||||
iso-install DRIVE: iso
|
||||
sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
|
||||
sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
|
||||
|
||||
dd DRIVE ISO:
|
||||
sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
|
||||
sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
|
||||
|
||||
sync USER HOST:
|
||||
rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
|
||||
rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{ self, lib, config, pkgs, ... }:
|
||||
{
|
||||
stylix = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
|
||||
enable = true;
|
||||
base16Scheme = "${self}/wallpaper/swarsel.yaml";
|
||||
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
|
||||
|
|
@ -25,7 +24,6 @@
|
|||
# name = "FiraCode Nerd Font Propo";
|
||||
# name = "Montserrat";
|
||||
};
|
||||
|
||||
sansSerif = {
|
||||
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
|
||||
package = pkgs.cantarell-fonts;
|
||||
|
|
@ -34,19 +32,15 @@
|
|||
# name = "FiraCode Nerd Font Propo";
|
||||
# name = "Montserrat";
|
||||
};
|
||||
|
||||
monospace = {
|
||||
package = pkgs.nerd-fonts.fira-mono; # has overrides
|
||||
|
||||
name = "FiraCode Nerd Font Mono";
|
||||
};
|
||||
|
||||
emoji = {
|
||||
package = pkgs.noto-fonts-emoji;
|
||||
name = "Noto Color Emoji";
|
||||
};
|
||||
};
|
||||
|
||||
image = config.swarselsystems.wallpaper;
|
||||
targets = {
|
||||
emacs.enable = false;
|
||||
|
|
|
|||
|
|
@ -264,8 +264,8 @@ in
|
|||
"
|
||||
exec_always autotiling
|
||||
set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
|
||||
mode $exit {
|
||||
|
||||
mode $exit {
|
||||
bindsym --to-code {
|
||||
s exec \"systemctl suspend\", mode \"default\"
|
||||
l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
|
||||
|
|
@ -284,7 +284,6 @@ in
|
|||
|
||||
|
||||
${swayfxSettings}
|
||||
|
||||
";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,34 +91,6 @@
|
|||
zle -N my-backward-delete-whole-word
|
||||
# bind this new widget to `ctrl+alt+w`
|
||||
bindkey '^W' my-backward-delete-whole-word
|
||||
|
||||
vterm_printf() {
|
||||
if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then
|
||||
# Tell tmux to pass the escape sequences through
|
||||
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
|
||||
elif [ "''${TERM%%-*}" = "screen" ]; then
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
printf "\eP\e]%s\007\e\\" "$1"
|
||||
else
|
||||
printf "\e]%s\e\\" "$1"
|
||||
fi
|
||||
}
|
||||
vterm_prompt_end() {
|
||||
vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
|
||||
}
|
||||
setopt PROMPT_SUBST
|
||||
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
||||
|
||||
vterm_cmd() {
|
||||
local vterm_elisp
|
||||
vterm_elisp=""
|
||||
while [ $# -gt 0 ]; do
|
||||
vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")"
|
||||
shift
|
||||
done
|
||||
vterm_printf "51;E$vterm_elisp"
|
||||
}
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,15 +45,15 @@ in
|
|||
WIREGUARDPUB=${config.sops.placeholder.wireguardpub}
|
||||
WIREGUARDENDPOINT=${config.sops.placeholder.wireguardendpoint}
|
||||
'';
|
||||
".authinfo" = {
|
||||
owner = "swarsel";
|
||||
path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
|
||||
content = ''
|
||||
machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
|
||||
machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
|
||||
machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
|
||||
'';
|
||||
};
|
||||
# ".authinfo" = {
|
||||
# owner = "swarsel";
|
||||
# path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
|
||||
# content = ''
|
||||
# machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
|
||||
# machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
|
||||
# machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
|
||||
# '';
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{ self, pkgs, home-manager, config, ... }:
|
||||
{
|
||||
stylix = {
|
||||
|
||||
enable = true;
|
||||
base16Scheme = "${self}/wallpaper/swarsel.yaml";
|
||||
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
|
||||
|
|
@ -25,7 +24,6 @@
|
|||
# name = "FiraCode Nerd Font Propo";
|
||||
# name = "Montserrat";
|
||||
};
|
||||
|
||||
sansSerif = {
|
||||
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
|
||||
package = pkgs.cantarell-fonts;
|
||||
|
|
@ -34,19 +32,15 @@
|
|||
# name = "FiraCode Nerd Font Propo";
|
||||
# name = "Montserrat";
|
||||
};
|
||||
|
||||
monospace = {
|
||||
package = pkgs.nerd-fonts.fira-mono; # has overrides
|
||||
|
||||
name = "FiraCode Nerd Font Mono";
|
||||
};
|
||||
|
||||
emoji = {
|
||||
package = pkgs.noto-fonts-emoji;
|
||||
name = "Noto Color Emoji";
|
||||
};
|
||||
};
|
||||
|
||||
targets.grub.enable = false; # the styling makes grub more ugly
|
||||
image = config.swarselsystems.wallpaper;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
(progn
|
||||
;; (setq gc-cons-threshold (* 1000 1000 8)
|
||||
;; (setq gc-cons-threshold #x40000000
|
||||
(setq gc-cons-threshold (* 32 1024 1024)
|
||||
gc-cons-percentage 0.1
|
||||
jit-lock-defer-time 0.05
|
||||
|
|
|
|||
|
|
@ -157,14 +157,7 @@ create a new one."
|
|||
[C-backspace] #'up-directory)
|
||||
|
||||
(defun swarsel/org-mode-setup ()
|
||||
;; (org-indent-mode)
|
||||
(variable-pitch-mode 1)
|
||||
;;(auto-fill-mode 0)
|
||||
;; (setq display-line-numbers-type 'relative
|
||||
;; display-line-numbers-current-absolute 1
|
||||
;; display-line-numbers-width-start nil
|
||||
;; display-line-numbers-width 6
|
||||
;; display-line-numbers-grow-only 1)
|
||||
(add-hook 'org-tab-first-hook 'org-end-of-line)
|
||||
(visual-line-mode 1))
|
||||
|
||||
|
|
@ -178,7 +171,7 @@ create a new one."
|
|||
(let ((default-directory (expand-file-name "~/.dotfiles")))
|
||||
(shell-command "nixpkgs-fmt . > /dev/null")))
|
||||
|
||||
(defun swarsel/org-babel-tangle-config ()
|
||||
(defun swarsel/org-babel-tangle-config ()
|
||||
(interactive)
|
||||
(when (string-equal (buffer-file-name)
|
||||
swarsel-swarsel-org-filepath)
|
||||
|
|
@ -189,9 +182,9 @@ create a new one."
|
|||
(swarsel/run-formatting)
|
||||
)))
|
||||
|
||||
(setq org-html-htmlize-output-type nil)
|
||||
(setq org-html-htmlize-output-type nil)
|
||||
|
||||
;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
|
||||
;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
|
||||
|
||||
(defun org-fold-outer ()
|
||||
(interactive)
|
||||
|
|
@ -217,35 +210,6 @@ create a new one."
|
|||
(corfu-quit)
|
||||
(evil-next-visual-line))
|
||||
|
||||
;; run the python inferior shell immediately upon entering a python buffer
|
||||
;; (add-hook 'python-mode-hook 'swarsel/run-python)
|
||||
|
||||
;; (defun swarsel/run-python ()
|
||||
;; (save-selected-window
|
||||
;; (switch-to-buffer-other-window (process-buffer (python-shell-get-or-create-process (python-shell-parse-command))))))
|
||||
|
||||
;; reload python shell automatically
|
||||
(defun my-python-shell-run ()
|
||||
(interactive)
|
||||
(when (get-buffer-process "*Python*")
|
||||
(set-process-query-on-exit-flag (get-buffer-process "*Python*") nil)
|
||||
(kill-process (get-buffer-process "*Python*"))
|
||||
;; Uncomment If you want to clean the buffer too.
|
||||
;;(kill-buffer "*Python*")
|
||||
;; Not so fast!
|
||||
(sleep-for 0.5))
|
||||
(run-python (python-shell-parse-command) nil nil)
|
||||
(python-shell-send-buffer)
|
||||
;; Pop new window only if shell isnt visible
|
||||
;; in any frame.
|
||||
(unless (get-buffer-window "*Python*" t)
|
||||
(python-shell-switch-to-shell)))
|
||||
|
||||
(defun my-python-shell-run-region ()
|
||||
(interactive)
|
||||
(python-shell-send-region (region-beginning) (region-end))
|
||||
(python-shell-switch-to-shell))
|
||||
|
||||
(defun swarsel/prefix-block (start end)
|
||||
(interactive "r")
|
||||
(save-excursion
|
||||
|
|
@ -273,7 +237,7 @@ create a new one."
|
|||
(call-interactively 'nixpkgs-fmt-region))
|
||||
|
||||
|
||||
(defun swarsel/org-nixpkgs-fmt-block ()
|
||||
(defun swarsel/org-nixpkgs-fmt-block ()
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(let* ((element (org-element-at-point))
|
||||
|
|
@ -302,10 +266,10 @@ create a new one."
|
|||
(add-hook 'minibuffer-exit-hook #'swarsel/minibuffer-exit-hook)
|
||||
|
||||
;; Make ESC quit prompts
|
||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||
|
||||
;; Set up general keybindings
|
||||
(use-package general
|
||||
;; Set up general keybindings
|
||||
(use-package general
|
||||
:config
|
||||
(general-create-definer swarsel/leader-keys
|
||||
:keymaps '(normal insert visual emacs)
|
||||
|
|
@ -345,22 +309,12 @@ create a new one."
|
|||
"oe" '(org-html-export-to-html :which-key "export to html")
|
||||
"c" '(:ignore c :which-key "capture")
|
||||
"ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
|
||||
;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
|
||||
;; "cs" '(markdown-download-screenshot :which-key "screenshot")
|
||||
"l" '(:ignore l :which-key "links")
|
||||
"lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
|
||||
"le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
|
||||
"ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
|
||||
"ls" '((lambda () (interactive) (find-file "/smb:Swarsel@winters:")) :which-key "Server")
|
||||
"lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
|
||||
;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
|
||||
;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
|
||||
"lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
|
||||
"lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
|
||||
;; "a" '(:ignore a :which-key "anki")
|
||||
;; "ap" '(anki-editor-push-tree :which-key "push new cards")
|
||||
;; "an" '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
|
||||
;; "as" '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
|
||||
"h" '(:ignore h :which-key "help")
|
||||
"hy" '(yas-describe-tables :which-key "yas tables")
|
||||
"hb" '(embark-bindings :which-key "current key bindings")
|
||||
|
|
@ -393,24 +347,20 @@ create a new one."
|
|||
"wu" 'winner-undo
|
||||
"wr" 'winner-redo
|
||||
"w/" 'evil-window-vsplit
|
||||
"w\\" 'evil-window-vsplit
|
||||
"w\\" 'evil-window-vsplit
|
||||
"w-" 'evil-window-split
|
||||
"wm" '(delete-other-windows :wk "maximize")
|
||||
"<right>" 'up-list
|
||||
"<left>" 'down-list
|
||||
))
|
||||
|
||||
;; General often used hotkeys
|
||||
(general-define-key
|
||||
;; General often used hotkeys
|
||||
(general-define-key
|
||||
"C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
|
||||
;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
|
||||
;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
|
||||
;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
|
||||
"C-c d" 'crux-duplicate-current-line-or-region
|
||||
"C-c D" 'crux-duplicate-and-comment-current-line-or-region
|
||||
"<DUMMY-m>" 'swarsel/last-buffer
|
||||
"M-\\" 'indent-region
|
||||
"C-<f9>" 'my-python-shell-run
|
||||
"<Paste>" 'yank
|
||||
"<Cut>" 'kill-region
|
||||
"<Copy>" 'kill-ring-save
|
||||
|
|
@ -423,38 +373,15 @@ create a new one."
|
|||
)
|
||||
|
||||
;; set Nextcloud directory for journals etc.
|
||||
(setq swarsel-sync-directory "~/Nextcloud"
|
||||
(setq
|
||||
swarsel-emacs-directory "~/.emacs.d"
|
||||
swarsel-dotfiles-directory "~/.dotfiles"
|
||||
swarsel-projects-directory "~/Documents/GitHub")
|
||||
|
||||
(setq swarsel-emacs-org-filepath (expand-file-name "Emacs.org" swarsel-dotfiles-directory)
|
||||
swarsel-nix-org-filepath (expand-file-name "Nix.org" swarsel-dotfiles-directory)
|
||||
swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
|
||||
)
|
||||
|
||||
|
||||
;; set Emacs main configuration .org names
|
||||
(setq swarsel-emacs-org-file "Emacs.org"
|
||||
swarsel-anki-org-file "Anki.org"
|
||||
swarsel-tasks-org-file "Tasks.org"
|
||||
swarsel-archive-org-file "Archive.org"
|
||||
swarsel-org-folder-name "Org"
|
||||
swarsel-obsidian-daily-folder-name "⭐ Personal/Journal"
|
||||
swarsel-obsidian-folder-name "Obsidian"
|
||||
swarsel-obsidian-vault-name "Main")
|
||||
|
||||
|
||||
;; set directory paths
|
||||
(setq swarsel-org-directory (expand-file-name swarsel-org-folder-name swarsel-sync-directory)) ; path to org folder
|
||||
(setq swarsel-obsidian-directory (expand-file-name swarsel-obsidian-folder-name swarsel-sync-directory)) ; path to obsidian
|
||||
(setq swarsel-obsidian-vault-directory (expand-file-name swarsel-obsidian-vault-name swarsel-obsidian-directory)) ; path to obsidian vault
|
||||
(setq swarsel-obsidian-daily-directory (expand-file-name swarsel-obsidian-daily-folder-name swarsel-obsidian-vault-directory)) ; path to obsidian daily folder
|
||||
|
||||
;; filepaths to certain documents
|
||||
(setq swarsel-org-anki-filepath (expand-file-name swarsel-anki-org-file swarsel-org-directory) ; path to anki export file
|
||||
swarsel-org-tasks-filepath (expand-file-name swarsel-tasks-org-file swarsel-org-directory)
|
||||
swarsel-org-archive-filepath (expand-file-name swarsel-archive-org-file swarsel-org-directory))
|
||||
swarsel-work-projects-directory "~/Documents/Work"
|
||||
swarsel-private-projects-directory "~/Documents/Private"
|
||||
)
|
||||
|
||||
;; Change the user-emacs-directory to keep unwanted things out of ~/.emacs.d
|
||||
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
|
||||
|
|
@ -555,7 +482,7 @@ create a new one."
|
|||
(lambda ()
|
||||
;; (message "Garbage Collector has run for %.06fsec"
|
||||
(k-time (garbage-collect)))))
|
||||
;; )
|
||||
;; )
|
||||
|
||||
(setq-default indent-tabs-mode nil
|
||||
tab-width 2)
|
||||
|
|
@ -660,6 +587,9 @@ create a new one."
|
|||
:config
|
||||
(global-evil-surround-mode 1))
|
||||
|
||||
(use-package evil-visual-mark-mode
|
||||
:config (evil-visual-mark-mode))
|
||||
|
||||
;; set the NixOS wordlist by hand
|
||||
(setq ispell-alternate-dictionary (getenv "WORDLIST"))
|
||||
|
||||
|
|
@ -676,8 +606,6 @@ create a new one."
|
|||
:weight 'regular
|
||||
:height 1.06)
|
||||
|
||||
;; these settings used to be in custom.el
|
||||
|
||||
(use-package solaire-mode
|
||||
:custom
|
||||
(solaire-global-mode +1))
|
||||
|
|
@ -900,7 +828,7 @@ create a new one."
|
|||
(setq-default indicate-buffer-boundaries t)
|
||||
|
||||
;; (setq auth-sources '( "~/.emacs.d/.caldav" "~/.emacs.d/.authinfo.gpg")
|
||||
;; auth-source-cache-expiry nil) ; default is 2h
|
||||
;; auth-source-cache-expiry nil) ; default is 2h
|
||||
|
||||
(setq auth-sources '( "~/.emacs.d/.authinfo")
|
||||
auth-source-cache-expiry nil)
|
||||
|
|
@ -918,109 +846,23 @@ create a new one."
|
|||
(setq org-startup-folded t)
|
||||
(setq org-support-shift-select t)
|
||||
|
||||
;; (setq org-agenda-start-with-log-mode t)
|
||||
;; (setq org-log-done 'time)
|
||||
;; (setq org-log-into-drawer t)
|
||||
(setq org-agenda-start-with-log-mode t)
|
||||
(setq org-log-done 'time)
|
||||
(setq org-log-into-drawer t)
|
||||
(setq org-startup-with-inline-images t)
|
||||
(setq org-export-headline-levels 6)
|
||||
(setq org-image-actual-width nil)
|
||||
(setq org-format-latex-options '(:foreground "White" :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
|
||||
|
||||
(setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
|
||||
(setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
|
||||
"/home/swarsel/Nextcloud/Org/Archive.org"
|
||||
"/home/swarsel/Nextcloud/Org/Anki.org"
|
||||
"/home/swarsel/Calendars/leon_cal.org"))
|
||||
))
|
||||
|
||||
(setq org-refile-targets
|
||||
(setq org-refile-targets
|
||||
'((swarsel-archive-org-file :maxlevel . 1)
|
||||
(swarsel-anki-org-file :maxlevel . 1)
|
||||
(swarsel-tasks-org-file :maxlevel . 1)))
|
||||
|
||||
(setq org-todo-keywords
|
||||
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
|
||||
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
|
||||
|
||||
|
||||
;; Configure custom agenda views
|
||||
(setq org-agenda-custom-commands
|
||||
'(("d" "Dashboard"
|
||||
((agenda "" ((org-deadline-warning-days 7)))
|
||||
(todo "NEXT"
|
||||
((org-agenda-overriding-header "Next Tasks")))
|
||||
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
|
||||
|
||||
("n" "Next Tasks"
|
||||
((todo "NEXT"
|
||||
((org-agenda-overriding-header "Next Tasks")))))
|
||||
|
||||
("W" "Work Tasks" tags-todo "+work-email")
|
||||
|
||||
|
||||
("w" "Workflow Status"
|
||||
((todo "WAIT"
|
||||
((org-agenda-overriding-header "Waiting on External")
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "REVIEW"
|
||||
((org-agenda-overriding-header "In Review")
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "PLAN"
|
||||
((org-agenda-overriding-header "In Planning")
|
||||
(org-agenda-todo-list-sublevels nil)
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "BACKLOG"
|
||||
((org-agenda-overriding-header "Project Backlog")
|
||||
(org-agenda-todo-list-sublevels nil)
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "READY"
|
||||
((org-agenda-overriding-header "Ready for Work")
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "ACTIVE"
|
||||
((org-agenda-overriding-header "Active Projects")
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "COMPLETED"
|
||||
((org-agenda-overriding-header "Completed Projects")
|
||||
(org-agenda-files org-agenda-files)))
|
||||
(todo "CANC"
|
||||
((org-agenda-overriding-header "Cancelled Projects")
|
||||
(org-agenda-files org-agenda-files)))))))
|
||||
|
||||
(setq org-capture-templates
|
||||
`(
|
||||
("a" "Anki basic"
|
||||
entry
|
||||
(file+headline swarsel-org-anki-filepath "Dispatch")
|
||||
(function swarsel-anki-make-template-string))
|
||||
|
||||
("A" "Anki cloze"
|
||||
entry
|
||||
(file+headline org-swarsel-anki-file "Dispatch")
|
||||
"* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: 🦁 All::01 ❤️ Various::00 ✨ Allgemein\n:END:\n** Text\n%?\n** Extra\n")
|
||||
("t" "Tasks / Projects")
|
||||
("tt" "Task" entry (file+olp swarsel-org-tasks-filepath "Inbox")
|
||||
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
|
||||
))
|
||||
)
|
||||
|
||||
;; Set faces for heading levels
|
||||
(with-eval-after-load 'org-faces (dolist (face '((org-level-1 . 1.1)
|
||||
(org-level-2 . 0.9)
|
||||
(org-level-3 . 0.9)
|
||||
(org-level-4 . 0.9)
|
||||
(org-level-5 . 0.9)
|
||||
(org-level-6 . 0.9)
|
||||
(org-level-7 . 0.9)
|
||||
(org-level-8 . 0.9)))
|
||||
(set-face-attribute (car face) nil :font swarsel-alt-font :weight 'medium :height (cdr face)))
|
||||
|
||||
;; Ensure that anything that should be fixed-pitch in Org files appears that way
|
||||
(set-face-attribute 'org-block nil :inherit 'fixed-pitch)
|
||||
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
|
||||
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
|
||||
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
|
||||
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
|
||||
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
|
||||
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
|
||||
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
|
||||
)
|
||||
|
||||
(use-package org-appear
|
||||
:hook (org-mode . org-appear-mode)
|
||||
|
|
@ -1037,7 +879,7 @@ create a new one."
|
|||
|
||||
(setq org-src-preserve-indentation nil)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((emacs-lisp . t)
|
||||
(python . t)
|
||||
|
|
@ -1045,10 +887,23 @@ create a new one."
|
|||
(shell . t)
|
||||
))
|
||||
|
||||
(push '("conf-unix" . conf-unix) org-src-lang-modes)
|
||||
(push '("conf-unix" . conf-unix) org-src-lang-modes)
|
||||
|
||||
(setq org-export-with-broken-links 'mark)
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
(setq org-export-with-broken-links 'mark)
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
||||
;; tangle is too slow, try to speed it up
|
||||
(defadvice org-babel-tangle-single-block (around inhibit-redisplay activate protect compile)
|
||||
"inhibit-redisplay and inhibit-message to avoid flicker."
|
||||
(let ((inhibit-redisplay t)
|
||||
(inhibit-message t))
|
||||
ad-do-it))
|
||||
|
||||
(defadvice org-babel-tangle (around time-it activate compile)
|
||||
"Display the execution time"
|
||||
(let ((tim (current-time)))
|
||||
ad-do-it
|
||||
(message "org-tangle took %f sec" (float-time (time-subtract (current-time) tim)))))
|
||||
|
||||
(require 'org-tempo)
|
||||
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
||||
|
|
@ -1071,20 +926,7 @@ create a new one."
|
|||
(setq TeX-electric-sub-and-superscript t)
|
||||
;; (setq reftex-plug-into-AUCTeX t)
|
||||
|
||||
(use-package org-download
|
||||
:after org
|
||||
:defer nil
|
||||
:custom
|
||||
(org-download-method 'directory)
|
||||
(org-download-image-dir "./images")
|
||||
(org-download-heading-lvl 0)
|
||||
(org-download-timestamp "org_%Y%m%d-%H%M%S_")
|
||||
;;(org-image-actual-width 500)
|
||||
(org-download-screenshot-method "grim -g \"$(slurp)\" %s")
|
||||
:bind
|
||||
("C-M-y" . org-download-screenshot)
|
||||
:config
|
||||
(require 'org-download))
|
||||
|
||||
|
||||
(use-package org-fragtog)
|
||||
(add-hook 'org-mode-hook 'org-fragtog-mode)
|
||||
|
|
@ -1246,11 +1088,6 @@ create a new one."
|
|||
(local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding)
|
||||
))
|
||||
|
||||
(use-package olivetti
|
||||
:init
|
||||
(setq olivetti-body-width 100)
|
||||
(setq olivetti-recall-visual-line-mode-entry-state t))
|
||||
|
||||
(use-package elfeed)
|
||||
|
||||
(use-package elfeed-goodies)
|
||||
|
|
@ -1279,10 +1116,6 @@ create a new one."
|
|||
(define-key elfeed-search-mode-map (kbd "k") 'previous-line)
|
||||
(define-key elfeed-show-mode-map (kbd "S-SPC") 'scroll-down-command)
|
||||
|
||||
(use-package darkroom
|
||||
:init
|
||||
(setq darkroom-text-scale-increase 3))
|
||||
|
||||
(use-package rg)
|
||||
|
||||
(use-package emacs
|
||||
|
|
@ -1329,8 +1162,6 @@ create a new one."
|
|||
:config
|
||||
(setq avy-all-windows 'all-frames))
|
||||
|
||||
(use-package crdt)
|
||||
|
||||
(use-package devdocs)
|
||||
|
||||
(add-hook 'python-mode-hook
|
||||
|
|
@ -1359,14 +1190,13 @@ create a new one."
|
|||
:init
|
||||
;; NOTE: Set this to the folder where you keep your Git repos!
|
||||
(when (file-directory-p swarsel-projects-directory)
|
||||
(setq projectile-project-search-path (list swarsel-projects-directory)))
|
||||
(setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory)))
|
||||
(setq projectile-switch-project-action #'magit-status))
|
||||
|
||||
(use-package magit
|
||||
:config
|
||||
(setq magit-repository-directories `((,swarsel-projects-directory . 1)
|
||||
(,swarsel-emacs-directory . 0)
|
||||
(,swarsel-obsidian-directory . 0)
|
||||
(setq magit-repository-directories `((,swarsel-work-projects-directory . 1)
|
||||
(,swarsel-private-projects-directory . 1)
|
||||
("~/.dotfiles/" . 0)))
|
||||
:custom
|
||||
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) ; stay in the same window
|
||||
|
|
@ -1383,10 +1213,7 @@ create a new one."
|
|||
|
||||
(with-eval-after-load 'forge
|
||||
(add-to-list 'forge-alist
|
||||
'("sgit.iue.tuwien.ac.at"
|
||||
"sgit.iue.tuwien.ac.at/api/v1"
|
||||
"sgit.iue.tuwien.ac.at"
|
||||
forge-gitea-repository)))
|
||||
))
|
||||
|
||||
(use-package git-timemachine
|
||||
:hook (git-time-machine-mode . evil-normalize-keymaps)
|
||||
|
|
@ -1417,12 +1244,6 @@ create a new one."
|
|||
(use-package rainbow-mode
|
||||
:config (rainbow-mode))
|
||||
|
||||
;; (use-package corfu
|
||||
;; :custom
|
||||
;; (corfu-cycle t)
|
||||
;; :init
|
||||
;; (global-corfu-mode))
|
||||
|
||||
(use-package corfu
|
||||
:init
|
||||
(global-corfu-mode)
|
||||
|
|
@ -1431,7 +1252,7 @@ create a new one."
|
|||
:custom
|
||||
(corfu-auto t)
|
||||
(corfu-auto-prefix 3)
|
||||
(corfu-auto-delay 0.3)
|
||||
(corfu-auto-delay 1)
|
||||
(corfu-cycle t)
|
||||
(corfu-quit-no-match 'separator)
|
||||
(corfu-separator ?\s)
|
||||
|
|
@ -1483,22 +1304,6 @@ create a new one."
|
|||
("C-z ^" . cape-tex)
|
||||
("C-z &" . cape-sgml)
|
||||
("C-z r" . cape-rfc1345)
|
||||
;; Add to the global default value of `completion-at-point-functions' which is
|
||||
;; used by `completion-at-point'. The order of the functions matters, the
|
||||
;; first function returning a result wins. Note that the list of buffer-local
|
||||
;; completion functions takes precedence over the global list.
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-file)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-elisp-block)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-history)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-keyword)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-tex)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-sgml)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-rfc1345)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-abbrev)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-dict)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol)
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-line)
|
||||
)
|
||||
|
||||
(use-package rustic
|
||||
|
|
@ -1549,60 +1354,6 @@ create a new one."
|
|||
(use-package evil-nerd-commenter
|
||||
:bind ("M-/" . evilnc-comment-or-uncomment-lines))
|
||||
|
||||
(use-package yasnippet
|
||||
:init (yas-global-mode 1)
|
||||
:config
|
||||
(yas-reload-all))
|
||||
|
||||
(setq wtf/latex-mathbb-prefix "''")
|
||||
(setq swarsel/latex-mathcal-prefix "``")
|
||||
|
||||
(use-package yasnippet
|
||||
:config
|
||||
|
||||
(setq wtf/english-alphabet
|
||||
'("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"))
|
||||
|
||||
(dolist (elem wtf/english-alphabet)
|
||||
(when (string-equal elem (downcase elem))
|
||||
(add-to-list 'wtf/english-alphabet (upcase elem))))
|
||||
|
||||
|
||||
(yas-define-snippets
|
||||
'latex-mode
|
||||
(mapcar
|
||||
(lambda (elem)
|
||||
(list (concat wtf/latex-mathbb-prefix elem) (concat "\\mathbb{" elem "}") (concat "Mathbb letter " elem)))
|
||||
wtf/english-alphabet))
|
||||
|
||||
(yas-define-snippets
|
||||
'latex-mode
|
||||
(mapcar
|
||||
(lambda (elem)
|
||||
(list (concat swarsel/latex-mathcal-prefix elem) (concat "\\mathcal{" elem "}") (concat "Mathcal letter " elem)))
|
||||
wtf/english-alphabet))
|
||||
|
||||
(setq swtf/latex-math-symbols
|
||||
'(("x" . "\\times")
|
||||
("*" . "\\cdot")
|
||||
("." . "\\ldots")
|
||||
("op" . "\\operatorname{$1}$0")
|
||||
("o" . "\\circ")
|
||||
("V" . "\\forall")
|
||||
("v" . "\\vee")
|
||||
("w" . "\\wedge")
|
||||
("q" . "\\quad")
|
||||
("f" . "\\frac{$1}{$2}$0")
|
||||
("s" . "\\sum_{$1}^{$2}$0")
|
||||
("p" . "\\prod_{$1}^{$2}$0")
|
||||
("e" . "\\exists")
|
||||
("i" . "\\int_{$1}^{$2}$0")
|
||||
("c" . "\\cap")
|
||||
("u" . "\\cup")
|
||||
("0" . "\\emptyset")))
|
||||
|
||||
)
|
||||
|
||||
(use-package eglot
|
||||
:config
|
||||
(add-to-list 'eglot-server-programs
|
||||
|
|
@ -1651,10 +1402,6 @@ create a new one."
|
|||
; 'line to show errors on the current line
|
||||
(setq sideline-backends-right '(sideline-flymake)))
|
||||
|
||||
(use-package breadcrumb
|
||||
;; :config (breadcrumb-mode)
|
||||
)
|
||||
|
||||
(setq backup-by-copying-when-linked t)
|
||||
|
||||
(use-package dirvish
|
||||
|
|
@ -1708,14 +1455,6 @@ create a new one."
|
|||
("M-e" . dirvish-emerge-menu)
|
||||
("M-j" . dirvish-fd-jump)))
|
||||
|
||||
;; (use-package pdf-tools
|
||||
;; :init
|
||||
;; (if (not (boundp 'pdf-tools-directory))
|
||||
;; (pdf-tools-install))
|
||||
;; :mode ("\\.pdf" . pdf-view-mode))
|
||||
|
||||
(use-package ein)
|
||||
|
||||
(use-package undo-tree
|
||||
:init (global-undo-tree-mode)
|
||||
:bind (:map undo-tree-visualizer-mode-map
|
||||
|
|
@ -1726,11 +1465,6 @@ create a new one."
|
|||
:config
|
||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))))
|
||||
|
||||
;; (add-hook 'prog-mode-hook 'undo-tree-mode)
|
||||
;; (add-hook 'text-mode-hook 'undo-tree-mode)
|
||||
;; (add-hook 'org-mode-hook 'undo-tree-mode)
|
||||
;; (add-hook 'latex-mode-hook 'undo-tree-mode)
|
||||
|
||||
(use-package hydra)
|
||||
|
||||
;; change the text size of the current buffer
|
||||
|
|
@ -1740,103 +1474,6 @@ create a new one."
|
|||
("k" text-scale-decrease "out")
|
||||
("f" nil "finished" :exit t))
|
||||
|
||||
;; (use-package obsidian
|
||||
;; :ensure t
|
||||
;; :demand t
|
||||
;; :config
|
||||
;; (obsidian-specify-path swarsel-obsidian-vault-directory)
|
||||
;; (global-obsidian-mode t)
|
||||
;; :custom
|
||||
;; ;; This directory will be used for `obsidian-capture' if set.
|
||||
;; (obsidian-inbox-directory "Inbox")
|
||||
;; (bind-key (kbd "C-c M-o") 'obsidian-hydra/body 'obsidian-mode-map)
|
||||
;; :bind (:map obsidian-mode-map
|
||||
;; ;; Replace C-c C-o with Obsidian.el's implementation. It's ok to use another key binding.
|
||||
;; ("C-c C-o" . obsidian-follow-link-at-point)
|
||||
;; ;; Jump to backlinks
|
||||
;; ("C-c C-b" . obsidian-backlink-jump)
|
||||
;; ;; If you prefer you can use `obsidian-insert-link'
|
||||
;; ("C-c C-l" . obsidian-insert-wikilink)))
|
||||
|
||||
;; (use-package anki-editor
|
||||
;; :after org
|
||||
;; :bind (:map org-mode-map
|
||||
;; ("<f12>" . anki-editor-cloze-region-auto-incr)
|
||||
;; ("<f11>" . anki-editor-cloze-region-dont-incr)
|
||||
;; ("<f10>" . anki-editor-reset-cloze-number)
|
||||
;; ("<f9>" . anki-editor-push-tree))
|
||||
;; :hook (org-capture-after-finalize . anki-editor-reset-cloze-number) ; Reset cloze-number after each capture.
|
||||
;; :config
|
||||
;; (setq anki-editor-create-decks t ;; Allow anki-editor to create a new deck if it doesn't exist
|
||||
;; anki-editor-org-tags-as-anki-tags t)
|
||||
|
||||
;; (defun anki-editor-cloze-region-auto-incr (&optional arg)
|
||||
;; "Cloze region without hint and increase card number."
|
||||
;; (interactive)
|
||||
;; (anki-editor-cloze-region swarsel-anki-editor-cloze-number "")
|
||||
;; (setq swarsel-anki-editor-cloze-number (1+ swarsel-anki-editor-cloze-number))
|
||||
;; (forward-sexp))
|
||||
;; (defun anki-editor-cloze-region-dont-incr (&optional arg)
|
||||
;; "Cloze region without hint using the previous card number."
|
||||
;; (interactive)
|
||||
;; (anki-editor-cloze-region (1- swarsel-anki-editor-cloze-number) "")
|
||||
;; (forward-sexp))
|
||||
;; (defun anki-editor-reset-cloze-number (&optional arg)
|
||||
;; "Reset cloze number to ARG or 1"
|
||||
;; (interactive)
|
||||
;; (setq swarsel-anki-editor-cloze-number (or arg 1)))
|
||||
;; (defun anki-editor-push-tree ()
|
||||
;; "Push all notes under a tree."
|
||||
;; (interactive)
|
||||
;; (anki-editor-push-notes '(4))
|
||||
;; (anki-editor-reset-cloze-number))
|
||||
;; ;; Initialize
|
||||
;; (anki-editor-reset-cloze-number)
|
||||
;; )
|
||||
|
||||
;; (require 'anki-editor)
|
||||
|
||||
;; (defvar swarsel-anki-deck nil)
|
||||
;; (defvar swarsel-anki-notetype nil)
|
||||
;; (defvar swarsel-anki-fields nil)
|
||||
|
||||
;; (defun swarsel-anki-set-deck-and-notetype ()
|
||||
;; (interactive)
|
||||
;; (setq swarsel-anki-deck (completing-read "Choose a deck: "
|
||||
;; (sort (anki-editor-deck-names) #'string-lessp)))
|
||||
;; (setq swarsel-anki-notetype (completing-read "Choose a note type: "
|
||||
;; (sort (anki-editor-note-types) #'string-lessp)))
|
||||
;; (setq swarsel-anki-fields (progn
|
||||
;; (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,swarsel-anki-notetype)))))
|
||||
;; )
|
||||
|
||||
;; (defun swarsel-anki-make-template-string ()
|
||||
;; (if (not swarsel-anki-deck)
|
||||
;; (call-interactively 'swarsel-anki-set-deck-and-notetype))
|
||||
;; (setq swarsel-temp swarsel-anki-fields)
|
||||
;; (concat (concat "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: " swarsel-anki-notetype "\n:ANKI_DECK: " swarsel-anki-deck "\n:END:\n** ")(pop swarsel-temp) "\n%?\n** " (mapconcat 'identity swarsel-temp "\n\n** ") "\n\n"))
|
||||
|
||||
;; (defun swarsel-today()
|
||||
;; (format-time-string "%Y-%m-%d"))
|
||||
|
||||
;; (defun swarsel-obsidian-daily ()
|
||||
;; (interactive)
|
||||
;; (if (not (file-exists-p (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
|
||||
;; (write-region "" nil (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory))
|
||||
;; )
|
||||
;; (find-file (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
|
||||
|
||||
;; (let ((mu4epath
|
||||
;; (concat
|
||||
;; (f-dirname
|
||||
;; (file-truename
|
||||
;; (executable-find "mu")))
|
||||
;; "/../share/emacs/site-lisp/mu4e")))
|
||||
;; (when (and
|
||||
;; (string-prefix-p "/nix/store/" mu4epath)
|
||||
;; (file-directory-p mu4epath))
|
||||
;; (add-to-list 'load-path mu4epath)))
|
||||
|
||||
(use-package mu4e
|
||||
:ensure nil
|
||||
;; :load-path "/usr/share/emacs/site-lisp/mu4e/"
|
||||
|
|
@ -2004,112 +1641,9 @@ create a new one."
|
|||
(use-package vterm
|
||||
:ensure t)
|
||||
|
||||
(defun sudo-find-file (file-name)
|
||||
"Like find file, but opens the file as root."
|
||||
(interactive "FSudo Find File: ")
|
||||
(let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
|
||||
(find-file tramp-file-name)))
|
||||
;;; vterm/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Original functions overwrites tramp path with a guessed path.
|
||||
;; However it breaks if remote fqdn/hostname is not resolvale by local machine
|
||||
;; could also break on port forwarding, multihops,
|
||||
;; custom protocol such as: docker, vagrant, ...
|
||||
;; *if* you try to shell-side configure them.
|
||||
;; Easily testable with vagrant ssh port on localhost.
|
||||
;; My workflow is to open a tramp dired on / of the remote to get a
|
||||
;; "foothold" then open vterms from there.
|
||||
(defun vterm--get-directory (path)
|
||||
"[OVERLOADED] Get normalized directory to PATH."
|
||||
(when path
|
||||
(let (directory)
|
||||
(if (string-match "^\\(.*?\\)@\\(.*?\\):\\(.*?\\)$" path)
|
||||
(progn
|
||||
(let ((user (match-string 1 path))
|
||||
(host (match-string 2 path))
|
||||
(dir (match-string 3 path)))
|
||||
(if (and (string-equal user user-login-name)
|
||||
(string-equal host (system-name)))
|
||||
(progn
|
||||
(when (file-directory-p dir)
|
||||
(setq directory (file-name-as-directory dir))))
|
||||
(setq directory
|
||||
;; Bellow is what i altered
|
||||
(file-name-as-directory (concat (file-remote-p default-directory) dir))))))
|
||||
(when (file-directory-p path)
|
||||
(setq directory (file-name-as-directory path))))
|
||||
directory)))
|
||||
;; Injects the payload to the vterm buffer.
|
||||
(defun me/vterm-load-config ()
|
||||
"Pass local configuration files to vterm.
|
||||
|
||||
Allows remote vterm to be shell-side configured,
|
||||
without altering remote config.
|
||||
Also adds my personal configuration that does not rely
|
||||
too much on external packages.
|
||||
Prints a reasuring message to proove good faith."
|
||||
(interactive)
|
||||
(let (;; Bellow messages to reassure other users that look at history
|
||||
(reasuring-message (format "Configuring shell of user %s to be emacs comptible"
|
||||
user-full-name))
|
||||
(reasuring-notice "This action is shell local, it will not affect other shells")
|
||||
;; Bellow lies my configuration
|
||||
(basic-func-script (f-read-text (concat (getenv "HOME")
|
||||
"/.emacs.d/shells/sources/functions.sh")))
|
||||
;; Bellow lies the vterm shell-side configuration
|
||||
;; Must be sourced last
|
||||
(vterm-func-script (f-read-text (concat
|
||||
(file-name-directory (find-library-name "vterm"))
|
||||
"/etc/emacs-vterm-bash.sh"))))
|
||||
(vterm-insert (format "# START: %s\n" reasuring-message))
|
||||
(vterm-insert (format "# %s\n" reasuring-notice))
|
||||
;; Create one single block in history
|
||||
(vterm-insert "{\n")
|
||||
(vterm-insert basic-func-script)
|
||||
(vterm-insert vterm-func-script)
|
||||
(vterm-insert "}\n")
|
||||
;; End the single block in history
|
||||
(vterm-insert (format "# %s\n" reasuring-notice))
|
||||
(vterm-insert (format "# STOP: %s\n" reasuring-message))
|
||||
)
|
||||
)
|
||||
|
||||
;; find-file-other-window does not works great on remote:
|
||||
;; if given an absolute path on a remote host,
|
||||
;; the path will be understood as a local file since no
|
||||
;; tramp prefix is present, and bash does not care
|
||||
;; about tramp prefixes.
|
||||
;; Bellow we solve context before sending it to
|
||||
;; ffow
|
||||
(defun me/vterm--find-file-other-window-wrapper (file)
|
||||
"Help vterm find a FILE."
|
||||
(find-file-other-window (me/vterm--ffow-resolver file)))
|
||||
(defun me/vterm--ffow-resolver (file)
|
||||
"Help vterm resolve FILE."
|
||||
(cond
|
||||
;; "/sudo::"
|
||||
;; doom--sudo-file-path do the trick for us
|
||||
((s-starts-with-p "/sudo::" file)
|
||||
(sudo-find-file
|
||||
(concat (file-remote-p default-directory)
|
||||
(substring-no-properties file 7))))
|
||||
;; "/" means we want the "Relative root"
|
||||
;; try appending the remote prefix if relevent
|
||||
((s-starts-with-p "/" file)
|
||||
(concat (file-remote-p default-directory) file))
|
||||
;; we got a relative path
|
||||
;; we don't need to help ffow to find it
|
||||
(t
|
||||
file)))
|
||||
|
||||
;; The variable vterm-eval-cmds is a SERIOUSLY SENSIBLE variable !
|
||||
;; Do not be the guy that adds RCE into their config !
|
||||
|
||||
;; Allow customed ffow to be called from vterm
|
||||
;; ffow should be as safe as find-file which is already trusted
|
||||
;; we append our resolver that only manipulate strings,
|
||||
;; Proove me wrong but i think it's safe.
|
||||
(add-to-list 'vterm-eval-cmds '("find-file-other-window"
|
||||
me/vterm--find-file-other-window-wrapper))
|
||||
|
||||
(use-package multiple-cursors)
|
||||
|
||||
(setq mu4e--log-max-size 1000)
|
||||
(setq message-log-max 30)
|
||||
(setq comint-buffer-maximum-size 50)
|
||||
(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[32m~SwarselSystems~[0m
|
||||
IP of primary interface: [31m\4[0m
|
||||
The Password for all users & root is '[31msetup[0m'.
|
||||
Install the system remotely by running '[33mbootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> [0m' on a machine with deployed secrets.
|
||||
Alternatively, run '[33mswarsel-install -n <CONFIGURATION_NAME>[0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
|
||||
IP of primary interface: [31m\4[0m
|
||||
The Password for all users & root is '[31msetup[0m'.
|
||||
Install the system remotely by running '[33mbootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> [0m' on a machine with deployed secrets.
|
||||
Alternatively, run '[33mswarsel-install -n <CONFIGURATION_NAME>[0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
@define-color background-critical blue;
|
||||
|
||||
|
||||
* {
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
disabled = [
|
||||
"repeated_keys"
|
||||
"repeated_keys"
|
||||
]
|
||||
nix_version = '2.4'
|
||||
ignore = ['.direnv']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue