custom zsh prompt, rename gsearch to s, fix web alias

This commit is contained in:
willemml 2023-03-13 10:37:50 -07:00
parent 9ca9189554
commit 65180292fd
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
2 changed files with 10 additions and 11 deletions

View file

@ -68,6 +68,7 @@ in
clang-tools clang-tools
cmake cmake
comma comma
coreutils-full
curl curl
docker docker
docker-compose docker-compose

View file

@ -82,20 +82,13 @@
''; '';
}; };
starship = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
package = pkgs.starship;
};
zoxide = { zoxide = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;
enableZshIntegration = true; enableZshIntegration = true;
}; };
zsh = { zsh = rec {
enable = true; enable = true;
autocd = true; autocd = true;
@ -118,8 +111,8 @@
# -*-sh-*- # -*-sh-*-
export GPG_TTY=$(tty) export GPG_TTY=$(tty)
eval $(gpg-agent --daemon -q 2>/dev/null) eval $(gpg-agent --daemon -q 2>/dev/null)
function gsearch() { function s() {
web "https://google.com/search?q=$(echo $@ | sed -e 's/ /%20/g')" ${shellAliases.web} "https://google.com/search?q=$(echo $@ | sed -e 's/ /%20/g')"
} }
nixify() { nixify() {
if [ ! -e ./.envrc ]; then if [ ! -e ./.envrc ]; then
@ -167,6 +160,11 @@
} }
''; '';
localVariables = {
PROMPT = "\n%B%F{blue}%~\n%F{green}$ %f%b";
RPROMPT = "%B%F{red}%*%f%b";
};
shellAliases = rec { shellAliases = rec {
cd = "z"; cd = "z";
discord = "${web} https://discord.com/channels/@me"; discord = "${web} https://discord.com/channels/@me";
@ -182,7 +180,7 @@
spotify = "${web} https://open.spotify.com/"; spotify = "${web} https://open.spotify.com/";
ubc = "cd ${config.home.sessionVariables.UBCDIR} "; ubc = "cd ${config.home.sessionVariables.UBCDIR} ";
ubcmail = "${web} https://webmail.student.ubc.ca"; ubcmail = "${web} https://webmail.student.ubc.ca";
web = "${config.programs.firefox.package}/bin/firefox"; web = "${pkgs.coreutils-full}/bin/nohup ${config.programs.firefox.package}/bin/firefox &> ${config.home.homeDirectory}/.firefox.log";
} // (if pkgs.stdenv.isLinux then { } // (if pkgs.stdenv.isLinux then {
nbs = "sudo nixos-rebuild build --flake ${config.home.sessionVariables.DOTDIR}#"; nbs = "sudo nixos-rebuild build --flake ${config.home.sessionVariables.DOTDIR}#";
nrs = "sudo nixos-rebuild switch --flake ${config.home.sessionVariables.DOTDIR}#"; nrs = "sudo nixos-rebuild switch --flake ${config.home.sessionVariables.DOTDIR}#";