1
Fork 0

feat: tmux and fish config and whatnot

This commit is contained in:
Matei Adriel 2022-03-09 02:15:44 +02:00
parent b091a87904
commit 3b0950e88b
6 changed files with 170 additions and 78 deletions

View file

@ -1,7 +1,12 @@
# Make normal mode the default set fish_cursor_default block # Set the normal and visual mode cursors to a block
set vi_mode_default vi_mode_normal set fish_cursor_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore
function vi_mode_user_key_bindings function fish_user_key_bindings
echo "Added keybinds (hopefully)" # Use the vim keybinds
bind jj 'commandline -f backward-char; vi_mode_normal' fish_vi_key_bindings
# Use jj to exit insert mode
bind -e -M insert \e # unbinds esc
bind -M insert -m default jj 'commandline -f repaint'
end end

View file

@ -3,6 +3,10 @@ set -g prefix C-a
unbind C-b unbind C-b
bind C-a send-prefix bind C-a send-prefix
# More colors
set-option -g default-terminal "tmux-256color"
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# force a reload of the config file (I don't think this works on nixos) # force a reload of the config file (I don't think this works on nixos)
unbind r unbind r
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf

View file

@ -1,21 +1,5 @@
{ {
"nodes": { "nodes": {
"agnoster": {
"flake": false,
"locked": {
"lastModified": 1641807476,
"narHash": "sha256-qi4G08yA21iKsTGR8qBlYp36xflW2UqNYlCjn+vRfLc=",
"owner": "oh-my-fish",
"repo": "theme-agnoster",
"rev": "1ffca413bfbc8941c28982eea97c1e1fa3612d57",
"type": "github"
},
"original": {
"owner": "oh-my-fish",
"repo": "theme-agnoster",
"type": "github"
}
},
"easy-dhall-nix": { "easy-dhall-nix": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -48,19 +32,67 @@
"type": "github" "type": "github"
} }
}, },
"fish-plugin-vi-mode": { "fish-plugin-z": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1613331590, "lastModified": 1626157139,
"narHash": "sha256-kRYWbTVT+eV5t5ZvV8abL2zIUnOZMbc2Gk+hDhX6hPM=", "narHash": "sha256-pWkEhjbcxXduyKz1mAFo90IuQdX7R8bLCQgb0R+hXs4=",
"owner": "jethrokuan",
"repo": "z",
"rev": "45a9ff6d0932b0e9835cbeb60b9794ba706eef10",
"type": "github"
},
"original": {
"owner": "jethrokuan",
"repo": "z",
"type": "github"
}
},
"fish-theme-agnoster": {
"flake": false,
"locked": {
"lastModified": 1641807476,
"narHash": "sha256-qi4G08yA21iKsTGR8qBlYp36xflW2UqNYlCjn+vRfLc=",
"owner": "oh-my-fish", "owner": "oh-my-fish",
"repo": "plugin-vi-mode", "repo": "theme-agnoster",
"rev": "2655a7253077faefd2f0a57b799dee687344d4fb", "rev": "1ffca413bfbc8941c28982eea97c1e1fa3612d57",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oh-my-fish", "owner": "oh-my-fish",
"repo": "plugin-vi-mode", "repo": "theme-agnoster",
"type": "github"
}
},
"fish-theme-dangerous": {
"flake": false,
"locked": {
"lastModified": 1547694252,
"narHash": "sha256-OnbS1X/FQaEyVIlgR7YOJlAUu3bgnm2UWk5vm80Cvvc=",
"owner": "oh-my-fish",
"repo": "theme-dangerous",
"rev": "3cdfc82060ba280b44f1f0c6616675f36a275467",
"type": "github"
},
"original": {
"owner": "oh-my-fish",
"repo": "theme-dangerous",
"type": "github"
}
},
"fish-theme-harleen": {
"flake": false,
"locked": {
"lastModified": 1631660209,
"narHash": "sha256-DHGjy7UGzy+vuzHrw49KP0nePKvx7sMMMrPj2mbGoJA=",
"owner": "aneveux",
"repo": "theme-harleen",
"rev": "caf53d792038e78faa7b6b6b98669abc171c5e64",
"type": "github"
},
"original": {
"owner": "aneveux",
"repo": "theme-harleen",
"type": "github" "type": "github"
} }
}, },
@ -272,21 +304,39 @@
"type": "github" "type": "github"
} }
}, },
"oh-my-fish": {
"flake": false,
"locked": {
"lastModified": 1646778488,
"narHash": "sha256-7mBxP5F81U+V0ahrsXL0vGPivTbKMnqYE5vgG/IOBe8=",
"owner": "oh-my-fish",
"repo": "oh-my-fish",
"rev": "ab05441000531d0bc9aaea23b8d4db59b2828a31",
"type": "github"
},
"original": {
"owner": "oh-my-fish",
"repo": "oh-my-fish",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agnoster": "agnoster",
"easy-dhall-nix": "easy-dhall-nix", "easy-dhall-nix": "easy-dhall-nix",
"easy-purescript-nix": "easy-purescript-nix", "easy-purescript-nix": "easy-purescript-nix",
"fish-plugin-vi-mode": "fish-plugin-vi-mode", "fish-plugin-z": "fish-plugin-z",
"fish-theme-agnoster": "fish-theme-agnoster",
"fish-theme-dangerous": "fish-theme-dangerous",
"fish-theme-harleen": "fish-theme-harleen",
"githubNvimTheme": "githubNvimTheme", "githubNvimTheme": "githubNvimTheme",
"home-manager": "home-manager", "home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nixos-unstable": "nixos-unstable", "nixos-unstable": "nixos-unstable",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"oh-my-fish": "oh-my-fish",
"telescope-file-browser-nvim": "telescope-file-browser-nvim", "telescope-file-browser-nvim": "telescope-file-browser-nvim",
"vim-extra-plugins": "vim-extra-plugins", "vim-extra-plugins": "vim-extra-plugins"
"z": "z"
} }
}, },
"telescope-file-browser-nvim": { "telescope-file-browser-nvim": {
@ -324,22 +374,6 @@
"repo": "nixpkgs-vim-extra-plugins", "repo": "nixpkgs-vim-extra-plugins",
"type": "github" "type": "github"
} }
},
"z": {
"flake": false,
"locked": {
"lastModified": 1626157139,
"narHash": "sha256-pWkEhjbcxXduyKz1mAFo90IuQdX7R8bLCQgb0R+hXs4=",
"owner": "jethrokuan",
"repo": "z",
"rev": "45a9ff6d0932b0e9835cbeb60b9794ba706eef10",
"type": "github"
},
"original": {
"owner": "jethrokuan",
"repo": "z",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -9,17 +9,27 @@
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; #### Nvim stuff
neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs"; neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
vim-extra-plugins.url = "github:m15a/nixpkgs-vim-extra-plugins"; vim-extra-plugins.url = "github:m15a/nixpkgs-vim-extra-plugins";
# Git repo fetching # Create / delete files within telescope
telescope-file-browser-nvim = { telescope-file-browser-nvim = {
url = "github:nvim-telescope/telescope-file-browser.nvim"; url = "github:nvim-telescope/telescope-file-browser.nvim";
flake = false; flake = false;
}; };
# Github inspired theme for a bunch of stuff
githubNvimTheme = {
url = "github:projekt0n/github-nvim-theme";
flake = false;
};
#### Purescript stuff
easy-dhall-nix = { easy-dhall-nix = {
url = "github:justinwoo/easy-dhall-nix"; url = "github:justinwoo/easy-dhall-nix";
flake = false; flake = false;
@ -30,23 +40,29 @@
flake = false; flake = false;
}; };
z = { #### Fish stuff
fish-plugin-z = {
url = "github:jethrokuan/z"; url = "github:jethrokuan/z";
flake = false; flake = false;
}; };
fish-plugin-vi-mode = { fish-theme-agnoster = {
url = "github:oh-my-fish/plugin-vi-mode";
flake = false;
};
agnoster = {
url = "github:oh-my-fish/theme-agnoster"; url = "github:oh-my-fish/theme-agnoster";
flake = false; flake = false;
}; };
githubNvimTheme = { fish-theme-harleen = {
url = "github:projekt0n/github-nvim-theme"; url = "github:aneveux/theme-harleen";
flake = false;
};
fish-theme-dangerous = {
url = "github:oh-my-fish/theme-dangerous";
flake = false;
};
oh-my-fish = {
url = "github:oh-my-fish/oh-my-fish";
flake = false; flake = false;
}; };
}; };

View file

@ -1,18 +1,43 @@
{ pkgs, ... }: { lib, pkgs, ... }:
let let
shellAliases = import ./aliases.nix; shellAliases = import ./aliases.nix;
common = import ./common.nix; common = import ./common.nix;
theme = "dangerous";
themePackage = builtins.getAttr theme pkgs.myFishPlugins.themes; # Dynamically pick the theme path
in in
{ {
home-manager.users.adrielus.programs.fish = { home-manager.users.adrielus = {
# Source every file in the theme
xdg.configFile."fish/conf.d/plugin-${theme}.fish".text = lib.mkAfter ''
for f in $plugin_dir/*.fish
source $f
end
'';
programs.fish = {
inherit shellAliases; inherit shellAliases;
shellInit = ''
source ${../../../dotfiles/fish/fish.conf}
'' ++ common.shellInit;
plugins = with pkgs; [ myFishPlugins.z myFishPlugins.vi-mode myFishPlugins.themes.agnoster ];
enable = true; enable = true;
plugins = with pkgs; [
myFishPlugins.z # jump around the file system with ease (might replace with autojump)
themePackage # theme
];
shellInit = ''
source ${../../../dotfiles/fish/config.fish}
# Source the entire oh-my-fish lib
for f in ${pkgs.myFishPlugins.oh-my-fish}/lib/git/**/*.fish
source $f
end
# if [ "${theme}" = "dangerous" ]
set dangerous_colors 000000 333333 666666 ff4ff0 0088ff ff6600 ff0000 ff0033 3300ff 0000ff 00ffff 00ff00
# end
${common.shellInit}
'';
};
}; };
} }

View file

@ -5,9 +5,11 @@
, nixos-unstable , nixos-unstable
, easy-purescript-nix , easy-purescript-nix
, easy-dhall-nix , easy-dhall-nix
, z , fish-plugin-z
, fish-plugin-vi-mode , fish-theme-harleen
, agnoster , fish-theme-agnoster
, fish-theme-dangerous
, oh-my-fish
, githubNvimTheme , githubNvimTheme
, vim-extra-plugins , vim-extra-plugins
, telescope-file-browser-nvim , telescope-file-browser-nvim
@ -30,24 +32,30 @@ in
easy-dhall-nix = self.callPackage easy-dhall-nix { }; easy-dhall-nix = self.callPackage easy-dhall-nix { };
myFishPlugins = { myFishPlugins = {
inherit oh-my-fish;
z = { z = {
src = z; src = fish-plugin-z;
name = "z"; name = "z";
}; };
vi-mode = {
src = fish-plugin-vi-mode;
name = "vi-mode";
};
themes = { themes = {
agnoster = { agnoster = {
src = agnoster; src = fish-theme-agnoster;
name = "agnoster"; name = "agnoster";
}; };
};
dangerous = {
src = fish-theme-dangerous;
name = "dangerous";
}; };
harleen = {
src = fish-theme-harleen;
name = "harleen";
};
};
};
githubNvimTheme = githubNvimTheme; githubNvimTheme = githubNvimTheme;