Initial commit

This commit is contained in:
jaseg 2022-08-15 18:31:22 +02:00
commit 16a7b26fd5
13 changed files with 106 additions and 0 deletions

4
aliases.fish Normal file
View file

@ -0,0 +1,4 @@
function mkae; make; end
function vim; command nvim -p $argv; end
function rm; command rm -I $argv; end
function mux; command tmuxinator $argv; end

10
config.fish Normal file
View file

@ -0,0 +1,10 @@
set -x GREP_OPTIONS
set fish_greeting ""
set -x ncpus (grep -c "^processor" /proc/cpuinfo)
set -x EDITOR vim
set -x PAGER less
set -x VIRTUAL_ENV_DISABLE_PROMPT 1
source ~/.config/fish/aliases.fish

34
fish_variables Normal file

File diff suppressed because one or more lines are too long

10
functions/cd.fish Normal file
View file

@ -0,0 +1,10 @@
# Modified cd that also displays the directory's contents if the listing is less than 5 lines long
function cd
if test -n "$argv"
if test -e $argv -a ! -d (realpath $argv)
set argv (dirname $argv)
end
end
builtin cd $argv
and test (ls -C -w $COLUMNS |wc -l) -le 5; and ls
end

View file

@ -0,0 +1,7 @@
function fish_prompt
printf "\e[37m%s\e[38;5;123m%s" (hostname) (prompt_pwd)
if test $VIRTUAL_ENV
printf " \e[37m(%s)" (basename $VIRTUAL_ENV)
end
printf " \e[38;5;212m<3\e[0m "
end

View file

@ -0,0 +1,10 @@
function fish_right_prompt
set stat $status
printf "\e[38;5;244m%s\e[0m " (date +%H:%M)
if test $stat -ne 0
printf "\e[91m(%d) " $stat
end
printf "\e[37m%s\e[0m" (__fish_git_prompt "%s")
end

View file

@ -0,0 +1,5 @@
function fish_user_key_bindings
bind \co sudo-execute
bind \cv foreground-vi
bind \cq quote-word
end

View file

@ -0,0 +1,3 @@
function foreground-vi
fg %vi >/dev/null
end

4
functions/md.fish Normal file
View file

@ -0,0 +1,4 @@
function md
mkdir "$argv"
cd "$argv"
end

View file

@ -0,0 +1,4 @@
function quote-word -d "Command line editor function that cycles between 'quoting' \"styles\" for the current word"
commandline -t (commandline -t|sed 's/^\'\(.*\)\'$/\1/;t;s/^"\(.*\)"$/\'\1\'/;t;s/^\(.*\)$/"\1"/')
commandline -f repaint
end

3
functions/sa.fish Normal file
View file

@ -0,0 +1,3 @@
function sa
ssh-add "$HOME/.ssh/id_rsa.$argv"
end

View file

@ -0,0 +1,5 @@
function sudo-execute -d "Command line editor function that prepends the current commandline with \"sudo\" and executes it afterwards"
commandline sudo\ (commandline | sed 's/^\W*sudo\?\W*//')
commandline -f repaint
commandline -f execute
end

7
prompt_settings.fish Normal file
View file

@ -0,0 +1,7 @@
set -g __fish_git_prompt_showuntrackedfiles ""
set -g __fish_git_prompt_showdirtystate ""
set -g __fish_git_prompt_showupstream "auto"
set -g __fish_git_prompt_char_upstream_ahead "↑"
set -g __fish_git_prompt_char_upstream_behind "↓"
set -g __fish_git_prompt_char_upstream_prefix ""