summaryrefslogtreecommitdiffstats
path: root/common/commandline
diff options
context:
space:
mode:
Diffstat (limited to 'common/commandline')
-rw-r--r--common/commandline/fish.fish16
-rw-r--r--common/commandline/fish.nix62
2 files changed, 78 insertions, 0 deletions
diff --git a/common/commandline/fish.fish b/common/commandline/fish.fish
new file mode 100644
index 0000000..294849c
--- /dev/null
+++ b/common/commandline/fish.fish
@@ -0,0 +1,16 @@
1# Disable greeting
2set fish_greeting
3set -g fish_key_bindings fish_vi_key_bindings
4
5bind -M insert ctrl-Z 'fg ; commandline -f repaint'
6
7function ssht
8 ssh -t "$argv" "tmux new-session -A -s 'ssh-$HOST'"
9end
10
11function cdt
12 builtin cd (mktemp -d)
13 builtin pwd
14end
15
16# TODO: sll
diff --git a/common/commandline/fish.nix b/common/commandline/fish.nix
index a371a1d..6e67865 100644
--- a/common/commandline/fish.nix
+++ b/common/commandline/fish.nix
@@ -1,9 +1,71 @@
1{ pkgs, ... }:
1{ 2{
2 programs.fish = { 3 programs.fish = {
3 enable = true; 4 enable = true;
4 useBabelfish = true; 5 useBabelfish = true;
6
7 interactiveShellInit = builtins.readFile ./fish.fish;
8
9 shellAbbrs = {
10 o = "xdg-open";
11 cpr = "rsync -ah --inplace --info=progress2";
12
13 # Git
14 # ===
15
16 g = "git";
17 gc = "git commit";
18 gca = "git commit --all";
19
20 gcs = "git show";
21
22 gco = "git switch";
23
24 # Fetch (f)
25 gf = "git fetch";
26 gfc = "git clone";
27 gfm = "git pull";
28
29 # Index (i)
30 gia = "git add";
31 gid = "git diff --cached";
32
33 # Log (l)
34 gl = "git log --topo-order";
35 glc = "git shortlog --summary --numbered";
36 glg = "git log --topo-order --graph --oneline --all";
37 glo = "git log --topo-order --oneline";
38
39 # Merge (m)
40 gm = "git merge";
41 gmt = "git mergetool";
42
43 # Push (p)
44 gp = "git push";
45 gpf = "git push --force-with-lease";
46 gpt = "git push --tags";
47
48 # Rebase (r)
49 gr = "git rebase";
50
51 # Stash (s)
52 gs = "git stash";
53
54 # Working Copy (w)
55 gws = "git status";
56 gwd = "git diff";
57 gwdt = "GIT_EXTERNAL_DIFF=difft git diff";
58 gwD = "git diff --word-diff";
59 };
5 }; 60 };
6 61
62 environment.systemPackages = [
63 pkgs.fishPlugins.fish-bd
64 pkgs.fishPlugins.grc
65 pkgs.fishPlugins.puffer
66 pkgs.grc
67 ];
68
7 home-manager.sharedModules = [ 69 home-manager.sharedModules = [
8 { 70 {
9 programs.fish.enable = true; 71 programs.fish.enable = true;