Compare commits
26 Commits
51ccb26c4b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 48feb223f1 | |||
| 9dfd55ada4 | |||
| 2b0ca519c6 | |||
| 2973596913 | |||
| 7344512c3a | |||
| c534cc12bb | |||
| 7209b28ab8 | |||
| 61f1b88d27 | |||
| 6b3b3200ba | |||
| 0cdb39c77b | |||
| 8a8cacdeba | |||
| ca58e6726c | |||
| 71d134f1ea | |||
| 9b874e216f | |||
| c85cc3e30c | |||
| 8a4cb11fe2 | |||
| d723fdc625 | |||
| 3a67bbb607 | |||
| 1800015afa | |||
| 192a6f721e | |||
| f43323b8f1 | |||
| c390cfaf10 | |||
| 29c549d541 | |||
| 3859972b60 | |||
| cd54ba5eb9 | |||
| 40bfd1cdf6 |
@@ -3,7 +3,9 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
pushd $SCRIPT_DIR/../nix &> /dev/null
|
||||
home-manager switch --flake ".#std"
|
||||
if which doom; then
|
||||
doom env
|
||||
|
||||
if which home-manager &> /dev/null; then
|
||||
home-manager switch --flake ".#std"
|
||||
else
|
||||
nix run home-manager/master -- switch --flake ".#std"
|
||||
fi
|
||||
|
||||
3
emacs/.gitignore
vendored
3
emacs/.gitignore
vendored
@@ -2,7 +2,8 @@
|
||||
!.gitignore
|
||||
!*.org
|
||||
!*.el
|
||||
!reset.sh
|
||||
!.gitkeep
|
||||
!snippets/
|
||||
!snippets/**
|
||||
flycheck_init.el
|
||||
flycheck_init.el
|
||||
|
||||
136
emacs/init.el
136
emacs/init.el
@@ -63,6 +63,9 @@
|
||||
(use-package seq :ensure `(seq :build ,(+elpaca-seq-build-steps)))
|
||||
(use-package transient :ensure t)
|
||||
|
||||
;; Required for magit, but Elpaca seems unable to find it by default
|
||||
(use-package cond-let :ensure (:host github :repo "tarsius/cond-let"))
|
||||
|
||||
;;; OS-specific tweaks
|
||||
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
||||
(defconst ON-MAC (eq system-type 'darwin))
|
||||
@@ -107,8 +110,11 @@
|
||||
("C-o 1" . delete-other-windows)
|
||||
("C-o t" . tab-bar-new-tab)
|
||||
("C-o ]" . tab-bar-switch-to-next-tab)
|
||||
("M-)" . tab-bar-switch-to-next-tab)
|
||||
("M-(" . tab-bar-switch-to-prev-tab)
|
||||
("C-o [" . tab-bar-switch-to-prev-tab)
|
||||
("C-o T" . tab-bar-close-tab)
|
||||
("C-o T" . tab-bar-undo-close-tab)
|
||||
("C-o w" . tab-bar-close-tab)
|
||||
;; TODO C-/ for undo window state change
|
||||
("C-o z" . my/zoom-window)
|
||||
;; TODO other-window scrolling
|
||||
@@ -132,7 +138,34 @@
|
||||
;; Use right-option as regular option on Mac
|
||||
(setq ns-alternate-modifier 'meta)
|
||||
(setq ns-right-alternate-modifier 'none)
|
||||
(setq ns-right-command-modifier 'meta)
|
||||
(setq ns-command-modifier 'meta)
|
||||
(setq ns-right-command-modifier 'super)
|
||||
|
||||
;;;;; Training wheels
|
||||
(defun cmd-key-reminder (keybind emacs-alternative)
|
||||
"Display a beep and reminder message for macOS muscle memory keys.
|
||||
KEYBIND is the key combination pressed (e.g., 'Cmd-S').
|
||||
EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
(beep)
|
||||
(message "Muscle memory! Use %s instead of %s" emacs-alternative keybind))
|
||||
|
||||
;; Define reminders for common macOS shortcuts
|
||||
(global-set-key (kbd "s-s") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-S" "C-x C-s (save-buffer)")))
|
||||
(global-set-key (kbd "s-z") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-Z" "C-/ (undo)")))
|
||||
(global-set-key (kbd "s-x") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-X" "C-w (kill-region)")))
|
||||
(global-set-key (kbd "s-c") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-C" "M-w (copy-region-as-kill)")))
|
||||
(global-set-key (kbd "s-v") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-V" "C-y (yank)")))
|
||||
(global-set-key (kbd "s-a") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-A" "C-x h (mark-whole-buffer)")))
|
||||
(global-set-key (kbd "s-0") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-0" "C-x 0 (text-scale-adjust)")))
|
||||
(global-set-key (kbd "s-t") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-T" "C-o t (tab-bar-new-tab)")))
|
||||
|
||||
;;; Editing
|
||||
;;;; MWIM
|
||||
@@ -240,7 +273,12 @@
|
||||
(use-package outli
|
||||
:ensure (:host github :repo "jdtsmith/outli")
|
||||
:bind (:map outli-mode-map
|
||||
("C-c C-p" . (lambda () (interactive) (outline-back-to-heading))))
|
||||
("C-c C-p" . (lambda () (interactive) (outline-back-to-heading)))
|
||||
;; Stop outline navigation from capturing C-p and C-n, which makes it
|
||||
;; difficult to navigate into a section
|
||||
:map outline-navigation-repeat-map
|
||||
("C-p" . nil)
|
||||
("C-n" . nil))
|
||||
:hook ((prog-mode . outli-mode)
|
||||
(text-mode . outli-mode)))
|
||||
|
||||
@@ -437,7 +475,7 @@
|
||||
(modify-all-frames-parameters '((alpha 99 99)
|
||||
(top . 50)
|
||||
(left . 100)
|
||||
(width . 120)
|
||||
(width . 190)
|
||||
(height . 60)))
|
||||
|
||||
;;;; Fonts
|
||||
@@ -655,6 +693,7 @@
|
||||
|
||||
;;;; Hyperbole
|
||||
(use-package hyperbole
|
||||
:if nil
|
||||
:ensure (:repo "https://git.savannah.gnu.org/git/hyperbole.git" :tag "hyperbole-9.0.1")
|
||||
:bind (("C-o h" . hyperbole)
|
||||
("C-o w" . hycontrol-windows)
|
||||
@@ -679,11 +718,16 @@
|
||||
:bind (("C-c j" . justl-exec-default-recipe)
|
||||
("C-c J" . justl)))
|
||||
|
||||
;;;; Manually Enabled Commands
|
||||
;; Enable narrow-to-region (C-x n n)
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
;;; Org-mode
|
||||
(use-package org
|
||||
:bind (("C-c o ," . my/org-clear-all)
|
||||
("C-c o s" . org-screenshot)
|
||||
("C-c SPC" . org-table-blank-field)
|
||||
("C-o a" . org-agenda)
|
||||
("C-o d" . my/org-agenda-today)
|
||||
;; Unbind to make room for avy and mwim
|
||||
:map org-mode-map
|
||||
("C-j" . nil)
|
||||
@@ -693,13 +737,30 @@
|
||||
("C-c C-c" . org-edit-src-exit))
|
||||
:hook ((org-mode . visual-line-mode))
|
||||
:custom
|
||||
(org-agenda-files '("~/Seafile/Notes/TODO.org"))
|
||||
(org-special-ctrl-a/e 'reversed)
|
||||
(org-hide-emphasis-markers t)
|
||||
(org-use-speed-commands t)
|
||||
(add-to-list 'org-speed-commands '("h" . org-fold-hide-sublevels))
|
||||
(org-use-fast-todo-selection 'expert)
|
||||
(org-todo-keywords '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)")))
|
||||
(org-image-actual-width '(800)))
|
||||
(org-use-property-inheritance '("STYLE"))
|
||||
(org-image-actual-width '(800))
|
||||
(org-agenda-custom-commands
|
||||
'(("d" "Today's agenda and unscheduled TODOs"
|
||||
((agenda "" ((org-agenda-span 1)))
|
||||
(todo "TODO" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline))))))))
|
||||
:config
|
||||
(defun my/org-agenda-today ()
|
||||
"Show org agenda for today only."
|
||||
(interactive)
|
||||
(org-agenda nil "d"))
|
||||
|
||||
(add-hook 'org-after-todo-state-change-hook #'org-save-all-org-buffers))
|
||||
|
||||
(use-package org-agenda
|
||||
:bind (:map org-agenda-mode-map
|
||||
("C-x C-s" . org-save-all-org-buffers)))
|
||||
|
||||
(use-package org-bullets
|
||||
:ensure t
|
||||
@@ -823,6 +884,13 @@
|
||||
(setq major-mode-remap-alist
|
||||
'((python-mode . python-ts-mode)))
|
||||
|
||||
(use-package lsp-pyright
|
||||
:ensure t
|
||||
:custom (lsp-pyright-langserver-command "basedpyright")
|
||||
:hook (python-ts-mode . (lambda ()
|
||||
(require 'lsp-pyright)
|
||||
(lsp))))
|
||||
|
||||
(setq lsp-pylsp-plugins-flake8-ignore '("D100" "D101" "D102"))
|
||||
|
||||
|
||||
@@ -916,21 +984,16 @@
|
||||
:ensure t
|
||||
:hook emacs-lisp-mode))
|
||||
|
||||
;;;; PHP
|
||||
;;;; Web
|
||||
;;;;; PHP
|
||||
(use-package php-mode
|
||||
:ensure t)
|
||||
;;;; Aider
|
||||
(use-package aider
|
||||
:ensure t
|
||||
:if (file-exists-p "~/.gemini")
|
||||
:config
|
||||
(setq aider-args
|
||||
'("--model" "gemini/gemini-2.5-flash-preview-05-20"))
|
||||
(setenv "GEMINI_API_KEY"
|
||||
(with-temp-buffer
|
||||
(insert-file-contents "~/.gemini")
|
||||
(buffer-string)))
|
||||
(global-set-key (kbd "C-c a") 'aider-transient-menu))
|
||||
;;;;; Svelte
|
||||
(use-package svelte-mode
|
||||
:ensure t)
|
||||
|
||||
(use-package typescript-mode
|
||||
:ensure t)
|
||||
;;; Eshell
|
||||
;;;; Eshell
|
||||
(require 'cl-lib)
|
||||
@@ -1047,40 +1110,7 @@ any directory proffered by `consult-dir'."
|
||||
(eshell/cd (substring-no-properties
|
||||
(consult-dir--pick "Switch directory: ")))))
|
||||
(t (eshell/cd (if regexp (eshell-find-previous-directory regexp)
|
||||
(completing-read "cd: " eshell-dirs)))))))
|
||||
|
||||
(defun eshell/mkenv (&rest args)
|
||||
"Initialize a devenv environment or configure its .envrc.
|
||||
|
||||
With optional argument --here or -h, forces execution in the
|
||||
current directory instead of the project root."
|
||||
(interactive)
|
||||
(let* ((here-flag (or (member "--here" args) (member "-h" args)))
|
||||
(project-root
|
||||
;; Use Projectile to find the root if available, otherwise fallback to git.
|
||||
(cond
|
||||
((fboundp 'project-root) (project-root (project-current)))
|
||||
((shell-command-to-string "git rev-parse --is-inside-work-tree")
|
||||
(string-trim (shell-command-to-string "git rev-parse --show-toplevel")))))
|
||||
(target-dir
|
||||
(if (or here-flag (not project-root))
|
||||
default-directory
|
||||
project-root))
|
||||
;; Localize all file operations to the target directory
|
||||
(default-directory target-dir))
|
||||
|
||||
(if (not (file-exists-p "devenv.nix"))
|
||||
;; If it doesn't exist, we assume this is a new project.
|
||||
(call-process "devenv" nil 0 nil "init"))
|
||||
|
||||
(when (not (file-exists-p ".envrc"))
|
||||
;; If .envrc is missing, create and configure it for devenv.
|
||||
(with-temp-file ".envrc"
|
||||
(insert "eval \"$(devenv direnvrc)\"")))
|
||||
|
||||
(if (file-exists-p "devenv.nix")
|
||||
(find-file (expand-file-name "devenv.nix" target-dir))
|
||||
(message "Could not open devenv.nix as it was not created.")))))
|
||||
(completing-read "cd: " eshell-dirs))))))))
|
||||
|
||||
(use-package eshell
|
||||
:bind (:map eshell-hist-mode-map
|
||||
@@ -1095,7 +1125,7 @@ current directory instead of the project root."
|
||||
`(rxt-elisp-to-pcre (rx ,@rx-sexp))))
|
||||
|
||||
(use-package eshell-p10k
|
||||
:ensure (:host github :repo "elken/eshell-p10k")
|
||||
:ensure (:host github :repo "elken/eshell-p10k" :ref "fce701187de408e7b23884169ea597a49a2d3205")
|
||||
:config
|
||||
(eshell-p10k-def-segment time
|
||||
""
|
||||
|
||||
12
emacs/reset.sh
Executable file
12
emacs/reset.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# See https://stackoverflow.com/a/246128/3561275
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
pushd $DIR &>/dev/null && rm -rf eln-cache elpa elpaca elpaca.lock && popd &> /dev/null
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: bang
|
||||
# name: shebang
|
||||
# key: !
|
||||
# --
|
||||
#!/usr/bin/env bash
|
||||
$0
|
||||
$0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: the currently executing/sourced script's directory
|
||||
# key: script-dir
|
||||
# name: current script's directory
|
||||
# key: sdir
|
||||
# --
|
||||
# See https://stackoverflow.com/a/246128/3561275
|
||||
SOURCE="\${BASH_SOURCE[0]}"
|
||||
@@ -11,4 +11,4 @@ while [ -h "\$SOURCE" ]; do # resolve \$SOURCE until the file is no longer a sym
|
||||
done
|
||||
DIR="\$( cd -P "\$( dirname "\$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
$0
|
||||
$0
|
||||
|
||||
1
emacs/snippets/sh-ts-mode/.yas-parents
Normal file
1
emacs/snippets/sh-ts-mode/.yas-parents
Normal file
@@ -0,0 +1 @@
|
||||
sh-mode
|
||||
18
nix/flake.lock
generated
18
nix/flake.lock
generated
@@ -7,11 +7,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740725613,
|
||||
"narHash": "sha256-j6HoX1k4+alRX35/Z/K+kfqfWytNLcO+eBOnyoh42iw=",
|
||||
"lastModified": 1744007427,
|
||||
"narHash": "sha256-eccCwW7GQVSk/WOCxt5izY5VdVknheI3oAXa0Xg9k9U=",
|
||||
"owner": "slotThe",
|
||||
"repo": "emacs-lsp-booster-flake",
|
||||
"rev": "007bdf3f48a28f611fdfe0b480534cc110637043",
|
||||
"rev": "8229947cf6d2f565a9aa882b7946c643099e1ef0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -27,11 +27,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743136572,
|
||||
"narHash": "sha256-uwaVrKgi6g1TUq56247j6QvvFtYHloCkjCrEpGBvV54=",
|
||||
"lastModified": 1759702766,
|
||||
"narHash": "sha256-011pCUbIq/fhCiZ20AzqJYNjLzQ1oYkzYEgzcUYVTBg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "1efd2503172016a6742c87b47b43ca2c8145607d",
|
||||
"rev": "5b45dcf4790bb94fec7e550d2915fc2540a3cdd6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -42,11 +42,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1743076231,
|
||||
"narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=",
|
||||
"lastModified": 1759632233,
|
||||
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6c5963357f3c1c840201eda129a99d455074db04",
|
||||
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -21,19 +21,17 @@
|
||||
duf
|
||||
# Better top
|
||||
htop
|
||||
ncdu
|
||||
# ncdu_1 because ncdu is incompatible with older MacOS versions due to some Zig bug
|
||||
ncdu_1
|
||||
ripgrep
|
||||
nerd-fonts.fira-code
|
||||
roboto-mono
|
||||
aider-chat
|
||||
sops
|
||||
just
|
||||
devenv
|
||||
];
|
||||
|
||||
imports = [
|
||||
./modules/fish
|
||||
./modules/nushell
|
||||
./modules/fish.nix
|
||||
./modules/kitty
|
||||
./modules/git.nix
|
||||
./modules/direnv.nix
|
||||
|
||||
182
nix/modules/fish.nix
Normal file
182
nix/modules/fish.nix
Normal file
@@ -0,0 +1,182 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let tide_conf = builtins.readFile ./tide_config.fish; in
|
||||
{
|
||||
programs.zoxide.enableFishIntegration = true;
|
||||
programs.kitty.shellIntegration.enableFishIntegration = true;
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = false;
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
palettes.thoom = {
|
||||
directory_bg = "#3465A4";
|
||||
directory_fg = "#E4E4E4";
|
||||
git_bg = "#4E9A06";
|
||||
git_fg = "#000000";
|
||||
prog_bg = "#212736";
|
||||
prog_fg = "#769ff0";
|
||||
duration_bg = "#C4A000";
|
||||
duration_fg = "#000000";
|
||||
user_bg = "#394260";
|
||||
user_fg = "";
|
||||
time_bg = "#D3D7CF";
|
||||
time_fg = "#000000";
|
||||
prompt_fg = "#00ff00";
|
||||
prompt_bg = "none";
|
||||
};
|
||||
|
||||
palette = "thoom";
|
||||
|
||||
format = lib.concatStrings [
|
||||
"[](fg:directory_bg)"
|
||||
"$directory"
|
||||
"[](fg:directory_bg bg:git_bg)"
|
||||
"$git_branch"
|
||||
"$git_status"
|
||||
"[](fg:git_bg bg:prog_bg)"
|
||||
"$nodejs"
|
||||
"$rust"
|
||||
"[](fg:prog_bg)"
|
||||
"$fill"
|
||||
"[](fg:duration_bg bg:none)"
|
||||
"$cmd_duration"
|
||||
"[](bg:duration_bg fg:user_bg)"
|
||||
"$username"
|
||||
"$hostname"
|
||||
"[](bg:user_bg fg:time_bg)"
|
||||
"$time"
|
||||
"[](fg:time_bg bg: none)"
|
||||
"$line_break"
|
||||
"$character"
|
||||
];
|
||||
|
||||
directory = {
|
||||
style = "fg:directory_fg bg:directory_bg";
|
||||
format = "[ $path( $read_only) ]($style)";
|
||||
truncation_length = 5;
|
||||
truncation_symbol = "…/";
|
||||
substitutions = {
|
||||
"Documents" = "";
|
||||
"Downloads" = "";
|
||||
};
|
||||
};
|
||||
|
||||
git_branch = {
|
||||
symbol = "";
|
||||
style = "fg:git_fg bg:git_bg";
|
||||
format = "[ $symbol $branch ]($style)";
|
||||
};
|
||||
|
||||
git_status = {
|
||||
style = "fg:git_fg bg:git_bg";
|
||||
format = "[($all_status$ahead_behind )]($style)";
|
||||
};
|
||||
|
||||
nodejs = {
|
||||
symbol = "";
|
||||
style = "bg:prog_bg fg:prog_fg";
|
||||
format = "[ $symbol ($version) ]($style)";
|
||||
};
|
||||
|
||||
rust = {
|
||||
symbol = "";
|
||||
style = "fg:prog_fg bg:prog_bg";
|
||||
format = "[ $symbol ($version) ]($style)";
|
||||
};
|
||||
|
||||
cmd_duration = {
|
||||
min_time = 5000; # Show for commands taking > 5 seconds
|
||||
style = "bg:duration_bg fg:duration_fg";
|
||||
format = "[ took $duration ]($style)";
|
||||
};
|
||||
|
||||
username = {
|
||||
show_always = false;
|
||||
style_user = "bg:user_bg";
|
||||
style_root = "bg:user_bg";
|
||||
format = "[ $user@]($style)";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
hostname = {
|
||||
ssh_only = true;
|
||||
style = "bg:user_bg";
|
||||
format = "[$hostname ]($style)";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
time = {
|
||||
disabled = false;
|
||||
time_format = "%r";
|
||||
style = "fg:time_fg bg:time_bg";
|
||||
format = "[ $time ]($style)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
plugins = [
|
||||
{
|
||||
# https://github.com/lilyball/nix-env.fish
|
||||
name = "nix-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lilyball";
|
||||
repo = "nix-env.fish";
|
||||
rev = "7b65bd228429e852c8fdfa07601159130a818cfa";
|
||||
sha256 = "sha256-RG/0rfhgq6aEKNZ0XwIqOaZ6K5S4+/Y5EEMnIdtfPhk=";
|
||||
};
|
||||
|
||||
}
|
||||
{
|
||||
# https://github.com/PatrickF1/fzf.fish
|
||||
name = "fzf";
|
||||
src = pkgs.fishPlugins.fzf-fish.src;
|
||||
}
|
||||
];
|
||||
|
||||
shellInit = ''
|
||||
# Undo stupid home-manager behavior of refusing to let the init file be re-sourced
|
||||
set -e __fish_home_manager_config_sourced
|
||||
|
||||
set --universal fish_greeting
|
||||
set -g -x EDITOR "emacsclient -a \"emacs -nw\""
|
||||
set -g -x ALTERNATE_EDITOR "vim"
|
||||
set -g -x TERMINAL "kitty"
|
||||
set -g -x LESS "--ignore-case --QUIET --RAW-CONTROL-CHARS"
|
||||
set -g -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
set -g -x MANROFFOPT "-c"
|
||||
set -g -x BAT_THEME "ansi"
|
||||
|
||||
fish_add_path --path ~/.dotfiles/bin ~/.local/bin ~/bin
|
||||
|
||||
# If running under kitty, fake the term for ssh to avoid
|
||||
# having to install terminfo on remote machine
|
||||
function ssh --wraps ssh
|
||||
if test $TERM = xterm-kitty
|
||||
set --function --export TERM xterm-256color
|
||||
end
|
||||
command ssh $argv
|
||||
end
|
||||
|
||||
if test -f $HOME/.cargo/env.fish
|
||||
source "$HOME/.cargo/env.fish"
|
||||
end
|
||||
|
||||
if test -f $HOME/.local.fish
|
||||
source $HOME/.local.fish
|
||||
end
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
ec = "emacsclient -n --alternate-editor=\"emacs -nw\"";
|
||||
src = "source $HOME/.config/fish/config.fish";
|
||||
pubip = "curl icanhazip.com";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let tide_conf = builtins.readFile ./tide_config.fish; in
|
||||
{
|
||||
programs.zoxide.enableFishIntegration = true;
|
||||
programs.kitty.shellIntegration.enableFishIntegration = true;
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = false;
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
plugins = [
|
||||
{
|
||||
# https://github.com/lilyball/nix-env.fish
|
||||
name = "nix-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lilyball";
|
||||
repo = "nix-env.fish";
|
||||
rev = "7b65bd228429e852c8fdfa07601159130a818cfa";
|
||||
sha256 = "sha256-RG/0rfhgq6aEKNZ0XwIqOaZ6K5S4+/Y5EEMnIdtfPhk=";
|
||||
};
|
||||
|
||||
}
|
||||
{
|
||||
# https://github.com/IlanCosman/tide
|
||||
name = "tide";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "IlanCosman";
|
||||
repo = "tide";
|
||||
rev = "13fa55ef109009e04e6e5fabda0d0e662b4e6315";
|
||||
sha256 = "sha256-+6LdcFLqDzUcCmBoKO4LDH5+5odqVqUb1NmEVNMEMjs=";
|
||||
};
|
||||
}
|
||||
{
|
||||
# https://github.com/PatrickF1/fzf.fish
|
||||
name = "fzf";
|
||||
src = pkgs.fishPlugins.fzf-fish.src;
|
||||
}
|
||||
];
|
||||
|
||||
shellInit = ''
|
||||
# Undo stupid home-manager behavior of refusing to let the init file be re-sourced
|
||||
set -e __fish_home_manager_config_sourced
|
||||
|
||||
set --universal fish_greeting
|
||||
set -g -x EDITOR "emacsclient -a \"emacs -nw\""
|
||||
set -g -x ALTERNATE_EDITOR "vim"
|
||||
set -g -x TERMINAL "kitty"
|
||||
set -g -x LESS "--ignore-case --QUIET --RAW-CONTROL-CHARS"
|
||||
set -g -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
set -g -x MANROFFOPT "-c"
|
||||
set -g -x BAT_THEME "ansi"
|
||||
|
||||
fish_add_path --path ~/.dotfiles/bin ~/.local/bin ~/bin
|
||||
|
||||
# If running under kitty, fake the term for ssh to avoid
|
||||
# having to install terminfo on remote machine
|
||||
function ssh --wraps ssh
|
||||
if test $TERM = xterm-kitty
|
||||
set --function --export TERM xterm-256color
|
||||
end
|
||||
command ssh $argv
|
||||
end
|
||||
|
||||
function mkenv --description "Initialize a devenv environment or configure its .envrc"
|
||||
argparse --name=mkenv h/here -- $argv
|
||||
or return 1 # Exit if parsing fails
|
||||
|
||||
# Default target directory is the current directory.
|
||||
set -l target_dir "."
|
||||
|
||||
# Check if we are inside a Git repository's working tree.
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1
|
||||
if not set -q _flag_here; and not test -f devenv.nix
|
||||
set target_dir (git rev-parse --show-toplevel)
|
||||
end
|
||||
end
|
||||
|
||||
pushd "$target_dir"
|
||||
|
||||
# Check for the existence of the primary devenv configuration file.
|
||||
if not test -f "devenv.nix"
|
||||
devenv init
|
||||
else
|
||||
# If devenv.nix exists, check for the direnv configuration file.
|
||||
if not test -f ".envrc"
|
||||
echo 'eval "$(devenv direnvrc)"' > .envrc
|
||||
direnv allow
|
||||
end
|
||||
end
|
||||
|
||||
if test -f "devenv.nix"
|
||||
emacsclient devenv.nix
|
||||
else
|
||||
echo -e "\e[31mCould not open devenv.nix as it was not created.\e[0m"
|
||||
end
|
||||
end
|
||||
|
||||
if test -f $HOME/.cargo/env.fish
|
||||
source "$HOME/.cargo/env.fish"
|
||||
end
|
||||
|
||||
if test -f $HOME/.local.fish
|
||||
source $HOME/.local.fish
|
||||
end
|
||||
|
||||
${builtins.readFile ./tide_config.fish}
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
ec = "emacsclient -n --alternate-editor=\"emacs -nw\"";
|
||||
src = "source $HOME/.config/fish/config.fish";
|
||||
pubip = "curl icanhazip.com";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
set --universal tide_character_color 5FD700
|
||||
set --universal tide_character_color_failure FF0000
|
||||
set --universal tide_character_icon \u276f
|
||||
set --universal tide_character_vi_icon_default \u276e
|
||||
set --universal tide_character_vi_icon_replace \u25b6
|
||||
set --universal tide_character_vi_icon_visual V
|
||||
set --universal tide_cmd_duration_bg_color C4A000
|
||||
set --universal tide_cmd_duration_color 000000
|
||||
set --universal tide_cmd_duration_decimals 0
|
||||
set --universal tide_cmd_duration_icon \x1d
|
||||
set --universal tide_cmd_duration_threshold 3000
|
||||
set --universal tide_context_always_display false
|
||||
set --universal tide_context_bg_color 444444
|
||||
set --universal tide_context_color_default D7AF87
|
||||
set --universal tide_context_color_root D7AF00
|
||||
set --universal tide_context_color_ssh D7AF87
|
||||
set --universal tide_crystal_bg_color FFFFFF
|
||||
set --universal tide_crystal_color 000000
|
||||
set --universal tide_crystal_icon \u2b22
|
||||
set --universal tide_docker_bg_color 2496ED
|
||||
set --universal tide_docker_color 000000
|
||||
set --universal tide_docker_default_contexts default\x1ecolima
|
||||
set --universal tide_docker_icon \uf308
|
||||
set --universal tide_git_bg_color 4E9A06
|
||||
set --universal tide_git_bg_color_unstable C4A000
|
||||
set --universal tide_git_bg_color_urgent CC0000
|
||||
set --universal tide_git_color_branch 000000
|
||||
set --universal tide_git_color_conflicted 000000
|
||||
set --universal tide_git_color_dirty 000000
|
||||
set --universal tide_git_color_operation 000000
|
||||
set --universal tide_git_color_staged 000000
|
||||
set --universal tide_git_color_stash 000000
|
||||
set --universal tide_git_color_untracked 000000
|
||||
set --universal tide_git_color_upstream 000000
|
||||
set --universal tide_git_icon \x1d
|
||||
set --universal tide_git_truncation_length 24
|
||||
set --universal tide_go_bg_color 00ACD7
|
||||
set --universal tide_go_color 000000
|
||||
set --universal tide_go_icon \ue627
|
||||
set --universal tide_java_bg_color ED8B00
|
||||
set --universal tide_java_color 000000
|
||||
set --universal tide_java_icon \ue256
|
||||
set --universal tide_jobs_bg_color 444444
|
||||
set --universal tide_jobs_color 4E9A06
|
||||
set --universal tide_jobs_icon \uf013
|
||||
set --universal tide_kubectl_bg_color 326CE5
|
||||
set --universal tide_kubectl_color 000000
|
||||
set --universal tide_kubectl_icon \u2388
|
||||
set --universal tide_left_prompt_frame_enabled false
|
||||
set --universal tide_left_prompt_items pwd\x1egit\x1enewline\x1echaracter
|
||||
set --universal tide_left_prompt_prefix \ue0b6
|
||||
set --universal tide_left_prompt_separator_diff_color \ue0b0
|
||||
set --universal tide_left_prompt_separator_same_color \ue0b1
|
||||
set --universal tide_left_prompt_suffix \ue0b0
|
||||
set --universal tide_nix_shell_bg_color 7EBAE4
|
||||
set --universal tide_nix_shell_color 000000
|
||||
set --universal tide_nix_shell_icon \uf313
|
||||
set --universal tide_node_bg_color 44883E
|
||||
set --universal tide_node_color 000000
|
||||
set --universal tide_node_icon \u2b22
|
||||
set --universal tide_os_bg_color 333333
|
||||
set --universal tide_os_color D6D6D6
|
||||
set --universal tide_os_icon \uf179
|
||||
set --universal tide_php_bg_color 617CBE
|
||||
set --universal tide_php_color 000000
|
||||
set --universal tide_php_icon \ue608
|
||||
set --universal tide_private_mode_bg_color F1F3F4
|
||||
set --universal tide_private_mode_color 000000
|
||||
set --universal tide_private_mode_icon \ufaf8
|
||||
set --universal tide_prompt_add_newline_before true
|
||||
set --universal tide_prompt_color_frame_and_connection 6C6C6C
|
||||
set --universal tide_prompt_color_separator_same_color 949494
|
||||
set --universal tide_prompt_icon_connection \x20
|
||||
set --universal tide_prompt_min_cols 34
|
||||
set --universal tide_prompt_pad_items true
|
||||
set --universal tide_pwd_bg_color 3465A4
|
||||
set --universal tide_pwd_color_anchors E4E4E4
|
||||
set --universal tide_pwd_color_dirs E4E4E4
|
||||
set --universal tide_pwd_color_truncated_dirs BCBCBC
|
||||
set --universal tide_pwd_icon \x1d
|
||||
set --universal tide_pwd_icon_home \x1d
|
||||
set --universal tide_pwd_icon_unwritable \uf023
|
||||
set --universal tide_pwd_markers \x2ebzr\x1e\x2ecitc\x1e\x2egit\x1e\x2ehg\x1e\x2enode\x2dversion\x1e\x2epython\x2dversion\x1e\x2eruby\x2dversion\x1e\x2eshorten_folder_marker\x1e\x2esvn\x1e\x2eterraform\x1eCargo\x2etoml\x1ecomposer\x2ejson\x1eCVS\x1ego\x2emod\x1epackage\x2ejson
|
||||
set --universal tide_right_prompt_frame_enabled false
|
||||
set --universal tide_right_prompt_items status\x1ecmd_duration\x1econtext\x1ejobs\x1enode\x1evirtual_env\x1erustc\x1ejava\x1ephp\x1echruby\x1ego\x1ekubectl\x1etoolbox\x1eterraform\x1eaws\x1enix_shell\x1ecrystal\x1etime
|
||||
set --universal tide_right_prompt_prefix \ue0b2
|
||||
set --universal tide_right_prompt_separator_diff_color \ue0b2
|
||||
set --universal tide_right_prompt_separator_same_color \ue0b3
|
||||
set --universal tide_right_prompt_suffix \ue0b4
|
||||
set --universal tide_rustc_bg_color F74C00
|
||||
set --universal tide_rustc_color 000000
|
||||
set --universal tide_rustc_icon \ue7a8
|
||||
set --universal tide_shlvl_bg_color 808000
|
||||
set --universal tide_shlvl_color 000000
|
||||
set --universal tide_shlvl_icon \uf120
|
||||
set --universal tide_shlvl_threshold 1
|
||||
set --universal tide_status_bg_color 2E3436
|
||||
set --universal tide_status_bg_color_failure CC0000
|
||||
set --universal tide_status_color 4E9A06
|
||||
set --universal tide_status_color_failure FFFF00
|
||||
set --universal tide_status_icon \u2714
|
||||
set --universal tide_status_icon_failure \u2718
|
||||
set --universal tide_time_bg_color D3D7CF
|
||||
set --universal tide_time_color 000000
|
||||
set --universal tide_time_format \x25r
|
||||
set --universal tide_toolbox_bg_color 613583
|
||||
set --universal tide_toolbox_color 000000
|
||||
set --universal tide_toolbox_icon \u2b22
|
||||
set --universal tide_vi_mode_bg_color_default 949494
|
||||
set --universal tide_vi_mode_bg_color_insert 87AFAF
|
||||
set --universal tide_vi_mode_bg_color_replace 87AF87
|
||||
set --universal tide_vi_mode_bg_color_visual FF8700
|
||||
set --universal tide_vi_mode_color_default 000000
|
||||
set --universal tide_vi_mode_color_insert 000000
|
||||
set --universal tide_vi_mode_color_replace 000000
|
||||
set --universal tide_vi_mode_color_visual 000000
|
||||
set --universal tide_vi_mode_icon_default D
|
||||
set --universal tide_vi_mode_icon_insert I
|
||||
set --universal tide_vi_mode_icon_replace R
|
||||
set --universal tide_vi_mode_icon_visual V
|
||||
set --universal tide_virtual_env_bg_color 444444
|
||||
set --universal tide_virtual_env_color 00AFAF
|
||||
set --universal tide_virtual_env_icon \ue73c
|
||||
@@ -1,14 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
programs.zoxide.enableNushellIntegration = true;
|
||||
programs.direnv.enableNushellIntegration = true;
|
||||
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
|
||||
shellAliases = {
|
||||
ec = "emacsclient -n --alternate-editor=emacs";
|
||||
pubip = "curl icanhazip.com";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user