add config.fish

This commit is contained in:
Alice Gaudon 2023-04-16 09:46:51 +00:00
parent 8748916cd7
commit e689665674
1 changed files with 56 additions and 0 deletions

56
config.fish Executable file
View File

@ -0,0 +1,56 @@
# Put system-wide fish configuration entries here
# or in .fish files in conf.d/
# Files in conf.d can be overridden by the user
# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d
# This file is run by all fish instances.
# To include configuration only for login shells, use
# if status is-login
# ...
# end
# To include configuration only for interactive shells, use
# if status is-interactive
# ...
# end
set fish_greeting ''
## Aliases ##
alias l='ls -la'
alias dotgit='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
alias syslog="sudo journalctl -f | ccze -A"
function journal -w 'systemctl status'
if test (count $argv) -eq 0
journalctl -f | ccze -A
else if test (count $argv) -eq 1
and [ "$argv[1]" != "--all" ]
journalctl -f -u $argv | ccze -A
else
tmux new-session -d 'journal'
if [ "$argv[1]" = "--all" ]
set services (cat /.motd.services)
else
set services $argv
end
set firstService $services[1]
tmux send-keys "journal $firstService" C-m
for i in (seq 2 (count $services))
set service $services[$i]
tmux split-window -v "journal $service"
end
tmux select-layout tiled
tmux attach
end
end
alias nano=micro
set -x EDITOR micro
set -x VISUAL $EDITOR
## Motd ##
if status is-login
/motd.sh
end