reformat and added vinix and nrs functions
This commit is contained in:
@@ -30,58 +30,64 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
packages = {
|
packages = {
|
||||||
zsh = inputs.wrappers.wrappers.zsh.wrap {
|
zsh = let
|
||||||
inherit pkgs;
|
flakeLocation = builtins.getEnv "PWD";
|
||||||
runtimePkgs = [pkgs.carapace pkgs.fzf];
|
in
|
||||||
zshAliases = {
|
assert flakeLocation != "";
|
||||||
ls = "${lib.getExe pkgs.lsd} -l";
|
inputs.wrappers.wrappers.zsh.wrap {
|
||||||
v = lib.getExe self'.packages.nvim;
|
inherit pkgs;
|
||||||
cat = lib.getExe pkgs.bat;
|
runtimePkgs = [pkgs.carapace pkgs.fzf];
|
||||||
lg = lib.getExe pkgs.lazygit;
|
zshAliases = {
|
||||||
devenv = lib.getExe pkgs.devenv;
|
ls = "${lib.getExe pkgs.lsd} -l";
|
||||||
carapace = lib.getExe pkgs.carapace;
|
v = lib.getExe self'.packages.nvim;
|
||||||
man = "man -P \"${lib.getExe pkgs.bat} -p\"";
|
cat = lib.getExe pkgs.bat;
|
||||||
nsh = "nix-shell -p";
|
lg = lib.getExe pkgs.lazygit;
|
||||||
};
|
devenv = lib.getExe pkgs.devenv;
|
||||||
zshrc.content = ''
|
carapace = lib.getExe pkgs.carapace;
|
||||||
if (( ''${+terminfo[smkx]} )) && (( ''${+terminfo[rmkx]} )); then
|
man = "man -P \"${lib.getExe pkgs.bat} -p\"";
|
||||||
function zle-line-init() { echoti smkx }
|
nsh = "nix-shell -p";
|
||||||
function zle-line-finish() { echoti rmkx }
|
nrs = "( cd ${flakeLocation} && sudo nixos-rebuild switch --impure --flake . )";
|
||||||
zle -N zle-line-init
|
vinix = "nvim --cmd 'cd ${flakeLocation}'";
|
||||||
zle -N zle-line-finish
|
};
|
||||||
fi
|
zshrc.content = ''
|
||||||
autoload -U compinit && compinit
|
if (( ''${+terminfo[smkx]} )) && (( ''${+terminfo[rmkx]} )); then
|
||||||
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
|
function zle-line-init() { echoti smkx }
|
||||||
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
|
function zle-line-finish() { echoti rmkx }
|
||||||
source <(${lib.getExe pkgs.carapace} _carapace)
|
zle -N zle-line-init
|
||||||
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
zle -N zle-line-finish
|
||||||
|
fi
|
||||||
|
autoload -U compinit && compinit
|
||||||
|
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
|
||||||
|
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
|
||||||
|
source <(${lib.getExe pkgs.carapace} _carapace)
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||||
|
|
||||||
autoload -U select-word-style
|
autoload -U select-word-style
|
||||||
select-word-style bash
|
select-word-style bash
|
||||||
|
|
||||||
autoload -U up-line-or-beginning-search down-line-or-beginning-search
|
autoload -U up-line-or-beginning-search down-line-or-beginning-search
|
||||||
zle -N up-line-or-beginning-search
|
zle -N up-line-or-beginning-search
|
||||||
zle -N down-line-or-beginning-search
|
zle -N down-line-or-beginning-search
|
||||||
bindkey "^[OA" up-line-or-beginning-search
|
bindkey "^[OA" up-line-or-beginning-search
|
||||||
bindkey "^[OB" down-line-or-beginning-search
|
bindkey "^[OB" down-line-or-beginning-search
|
||||||
|
|
||||||
bindkey "^[[1;5C" forward-word
|
bindkey "^[[1;5C" forward-word
|
||||||
bindkey "^[[1;5D" backward-word
|
bindkey "^[[1;5D" backward-word
|
||||||
bindkey "^[[3;5~" kill-word
|
bindkey "^[[3;5~" kill-word
|
||||||
bindkey "^H" backward-kill-word
|
bindkey "^H" backward-kill-word
|
||||||
|
|
||||||
source <(${lib.getExe pkgs.fzf} --zsh)
|
source <(${lib.getExe pkgs.fzf} --zsh)
|
||||||
|
|
||||||
setopt NO_CASE_GLOB
|
setopt NO_CASE_GLOB
|
||||||
|
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
|
||||||
eval "$(${lib.getExe pkgs.devenv} hook zsh)"
|
eval "$(${lib.getExe pkgs.devenv} hook zsh)"
|
||||||
eval "$(${lib.getExe self'.packages.ohMyPosh} init zsh)"
|
eval "$(${lib.getExe self'.packages.ohMyPosh} init zsh)"
|
||||||
|
|
||||||
${lib.getExe pkgs.any-nix-shell} zsh --info-right | source /dev/stdin
|
${lib.getExe pkgs.any-nix-shell} zsh --info-right | source /dev/stdin
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
ohMyPosh = inputs.wrappers.wrappers.oh-my-posh.wrap {
|
ohMyPosh = inputs.wrappers.wrappers.oh-my-posh.wrap {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
configFile = ./config.toml;
|
configFile = ./config.toml;
|
||||||
|
|||||||
Reference in New Issue
Block a user