all repos — nixfiles @ a1e7e0bc3e2cf040d24580ecfe3f73899b358aa1

System and user configuration, managed by nix and home-manager

fish: port functions and more aliases

Alan Pearce
commit

a1e7e0bc3e2cf040d24580ecfe3f73899b358aa1

parent

a0c89188898a79599f83a83297946631fb78bf9b

M user/emacs/init.eluser/emacs/init.el
@@ -763,6 +763,11 @@ sh-basic-offset 2)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) +(use-package fish-mode + :mode (("\\.fish\\'" . fish-mode)) + :config (progn + (setq fish-enable-auto-indent t))) + ;;;; make (general-add-hook 'makefile-mode-hook (lambda ()
M user/nanopi.nixuser/nanopi.nix
@@ -4,6 +4,7 @@ imports = [
./modules/tabnine.nix ./settings/base.nix ./settings/development/base.nix + ./settings/fish.nix ./settings/git.nix ./settings/nix.nix ./settings/nixos.nix
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -140,6 +140,7 @@ evil-space
evil-surround evil-textobj-tree-sitter eyebrowse + fish-mode format-all flycheck general
M user/settings/fish.nixuser/settings/fish.nix
@@ -27,5 +27,12 @@ ];
interactiveShellInit = '' bind \es __ghq_repository_search ''; + functions = { + ds = "du -hd1 $argv[1] | sort -h"; + }; + }; + xdg.configFile."fish/functions" = { + recursive = true; + source = ./fish/functions; }; }
A user/settings/fish/functions/delink.fish
@@ -0,0 +1,10 @@
+function delink + if test ! -L $argv[1] + echo "$argv[1] is not a symlink" + return 1 + end + set -l src (readlink $argv[1]) + rm $argv[1] + cp $src $argv[1] + chmod u+w $argv[1] +end
A user/settings/fish/functions/ecpenv.fish
@@ -0,0 +1,3 @@
+function ecpenv + esetenv $argv[1] $$argv[1] +end
A user/settings/fish/functions/esetenv.fish
@@ -0,0 +1,3 @@
+function esetenv + emacsclient -e "(setenv \"$argv[1]\" \"$argv[2]\")" +end
A user/settings/fish/functions/field.fish
@@ -0,0 +1,3 @@
+function field + awk "{ print \$$argv[1]}" +end
A user/settings/fish/functions/help.fish
@@ -0,0 +1,3 @@
+function help + $argv --help 2>&1 | bat --plan --language=help +end
A user/settings/fish/functions/tere.fish
@@ -0,0 +1,6 @@
+function tere + set -f result $(command tere $argv) + if test -n $result + cd $result + end +end
M user/settings/shell.nixuser/settings/shell.nix
@@ -57,6 +57,7 @@ di = "docker image";
dj = "docker pull"; dk = "docker push"; + dc = "docker-compose"; dcb = "dc build"; dcd = "dc down"; dcj = "dc pull";