dotfiles.nix/hm-configs/fish.nix

73 lines
2.2 KiB
Nix
Raw Normal View History

2021-01-11 03:59:20 +00:00
{ pkgs, ... }: {
enable = true;
package = pkgs.fish;
interactiveShellInit = ''
echo '(´) welcome (´)'
if not functions -q fisher
set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
fish -c fisher
end
fish_vi_key_bindings
set VIRTUAL_ENV_DISABLE_PROMPT true
alias cat=bat
alias br=broot
alias tree=br
alias ack=rg
alias ag=rg
alias grep=rg
alias sys="sudo systemctl"
alias rebuild="sudo nixos-rebuild switch"
alias rebuildd="sudo nixos-rebuild switch; and systemctl restart display-manager"
alias upgrade="sudo rm -rf /root/.cache/nix/tarballs; and sudo nix-channel --update; and sudo nixos-rebuild switch --upgrade"
alias clip="xclip -selection c"
alias cxuse="sudo cachix use -d ~/dotfiles.nix"
alias cxpsh="nix-shell --command exit; nix-store -qR --include-outputs (nix-instantiate shell.nix) | cachix push"
alias cxpush=cxpsh
function config -a file
if test -z "$file"
set file configuration
end
vim ~/dotfiles.nix/$file.nix +'cd %:p:h'
end
alias vims="vim -S Session.vim"
alias bigscreen="xrandr --output eDP1 --off --output HDMI2 --auto"
alias smallscreen="xrandr --output eDP1 --auto --output HDMI2 --off"
function tmux-ssh -a user -a host
set target "$user@$host"
set session "$user-$host"
env TERM=tmux-256color ssh $target -t "tmux -2 attach -t $session || tmux -2 new -s $session"
end
alias pi="tmux-ssh pi pi"
alias mir="tmux-ssh mat mir"
alias drop=mir
alias soviet="tmux-ssh mat soviet"
alias gagarin="tmux-ssh mat gagarin"
alias yuri=gagarin
alias gaga=gagarin
alias wifi="nmcli r w off; nmcli r w on"
alias nixops=~/dev/nixops/result/bin/nixops
bind \cr 'fzy_select_history (commandline -b)'
bind -M insert \cr 'fzy_select_history (commandline -b)'
bind \cf 'fzy_select_directory'
bind -M insert \cf 'fzy_select_directory'
bind -M insert ! __history_previous_command
bind -M insert '$' __history_previous_command_arguments
'';
}