From eb27c2978424c6787f777579b627182112b38318 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 9 Mar 2019 17:52:33 +0100 Subject: [PATCH] Reorganized fish shell configuration --- links.list | 2 +- shells/fish/conf.d/abbr.fish | 31 ++++++ shells/fish/conf.d/alias.fish | 36 +++++++ shells/fish/conf.d/debian.fish | 37 +++++++ shells/fish/conf.d/emacs.fish | 25 +++++ shells/fish/conf.d/env.fish | 48 +++++++++ shells/fish/conf.d/nix.fish | 25 +++++ shells/fish/conf.d/pure.fish | 70 +++++++++++++ shells/fish/conf.d/x.fish | 32 ++++++ shells/fish/config.fish | 135 ------------------------- shells/fish/functions/.gitignore | 10 ++ shells/fish/functions/cdl.fish | 22 +++- shells/fish/functions/diff.fish | 27 +++++ shells/fish/functions/fish_prompt.fish | 1 - shells/fish/functions/fish_title.fish | 12 --- shells/fish/functions/g.fish | 27 ----- shells/fish/functions/haha.fish | 5 - shells/fish/functions/sbcl.fish | 27 +++++ shells/fish/functions/upgrade.fish | 8 -- shells/fish/functions/vim.fish | 3 - 20 files changed, 390 insertions(+), 193 deletions(-) create mode 100644 shells/fish/conf.d/abbr.fish create mode 100644 shells/fish/conf.d/alias.fish create mode 100644 shells/fish/conf.d/debian.fish create mode 100644 shells/fish/conf.d/emacs.fish create mode 100644 shells/fish/conf.d/env.fish create mode 100644 shells/fish/conf.d/nix.fish create mode 100644 shells/fish/conf.d/pure.fish create mode 100644 shells/fish/conf.d/x.fish delete mode 100644 shells/fish/config.fish create mode 100644 shells/fish/functions/diff.fish delete mode 120000 shells/fish/functions/fish_prompt.fish delete mode 100644 shells/fish/functions/fish_title.fish delete mode 100644 shells/fish/functions/g.fish delete mode 100644 shells/fish/functions/haha.fish create mode 100644 shells/fish/functions/sbcl.fish delete mode 100644 shells/fish/functions/upgrade.fish delete mode 100644 shells/fish/functions/vim.fish diff --git a/links.list b/links.list index 0649429..1f20e13 100644 --- a/links.list +++ b/links.list @@ -12,7 +12,7 @@ redshift/redshift .config/redshift.conf screen/screenrc .screenrc shells/bashrc .bashrc shells/zshrc .zshrc -shells/fish/config.fish .config/fish/ +shells/fish/conf.d .config/fish/ shells/fish/functions .config/fish/ stumpwm/stumpwmrc .stumpwmrc x/xinitrc .xinitrc diff --git a/shells/fish/conf.d/abbr.fish b/shells/fish/conf.d/abbr.fish new file mode 100644 index 0000000..dc787d5 --- /dev/null +++ b/shells/fish/conf.d/abbr.fish @@ -0,0 +1,31 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Fish Abbrevations +# Those are expanded before execution +# See: https://fishshell.com/docs/current/commands.html#abbr + +if status --is-interactive + abbr --add --global l ls + abbr --add --global ping ping -c 3 mmk2410.org + abbr --add --global pingtest ping -c 3 mmk2410.org + abbr --add --global e eval $EDITOR + abbr --add --global g git +end diff --git a/shells/fish/conf.d/alias.fish b/shells/fish/conf.d/alias.fish new file mode 100644 index 0000000..6aaa659 --- /dev/null +++ b/shells/fish/conf.d/alias.fish @@ -0,0 +1,36 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if status --is-interactive + alias grep='grep --color=auto' + alias df='df -h' + alias du='du -c -h' + alias mkdir='mkdir -p -v' + alias ln='ln -i' + alias chown='chown --preserve-root' + alias chmod='chmod --preserve-root' + alias chgrp='chgrp --preserve-root' + alias ps='ps aux k%cpu' + alias q=' exit' + alias Q=' exit' + alias x=' exit' + alias o='xdg-open' + alias vim="nvim" +end diff --git a/shells/fish/conf.d/debian.fish b/shells/fish/conf.d/debian.fish new file mode 100644 index 0000000..61b9684 --- /dev/null +++ b/shells/fish/conf.d/debian.fish @@ -0,0 +1,37 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Debian Packaging + +# quilt +alias dquilt="quilt --quiltrc=$HOME/.quiltrc-dpkg" + +# Variables +set -x DEBUILD_DPKG_BUILDPACKAGE_OPTS "-i -I -us -uc" +set -x DEBUILD_LINTIAN_OPTS "-i -I --show-overrides" +set -x DEBSIGN_KEYID "9FE01C39F74551D434116394CADE6F0C09F21B09" + +if test -z $DEBFULLNAME + set -Ux DEBFULLNAME "Marcel Kapfer" +end + +if test -z $DEBEMAIL + set -Ux DEBEMAIL "opensource@mmk2410.org" +end diff --git a/shells/fish/conf.d/emacs.fish b/shells/fish/conf.d/emacs.fish new file mode 100644 index 0000000..c8735df --- /dev/null +++ b/shells/fish/conf.d/emacs.fish @@ -0,0 +1,25 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Run zsh when using emacs +# Current problem with fish seems to be the theme +if test $TERM = "eterm-color" + exec zsh +end diff --git a/shells/fish/conf.d/env.fish b/shells/fish/conf.d/env.fish new file mode 100644 index 0000000..73bb4b3 --- /dev/null +++ b/shells/fish/conf.d/env.fish @@ -0,0 +1,48 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -x ARCHFLAGS -arch_x86_64 + +set -e GPG_TTY +set -Ux GPG_TTY (tty) + +if test -z $EDITOR + set -Ux EDITOR es +end + +if test -z $VISUAL + set -Ux VISUAL es +end + +if test -z $GIT_EDITOR + set -Ux GIT_EDITOR es +end + +if test -z $GOPATH + set -Ux GOPATH ~/.go +end + +if test -z $XDG_CURRENT_DESKTOP + set -Ux XDG_CURRENT_DESKTOP GNOME +end + +if test -z $QT_STYLE_OVERRIDE + set -Ux QT_STYLE_OVERRIDE kvantum +end diff --git a/shells/fish/conf.d/nix.fish b/shells/fish/conf.d/nix.fish new file mode 100644 index 0000000..eac59e9 --- /dev/null +++ b/shells/fish/conf.d/nix.fish @@ -0,0 +1,25 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Source the Nix profile, if it exists. +set -l NIX_PROFILE $HOME/.nix-profile/etc/profile.d/nix.fish +if test -e $NIX_PROFILE + source $NIX_PROFILE +end diff --git a/shells/fish/conf.d/pure.fish b/shells/fish/conf.d/pure.fish new file mode 100644 index 0000000..1bf429e --- /dev/null +++ b/shells/fish/conf.d/pure.fish @@ -0,0 +1,70 @@ +set --universal pure_version 2.1.1 # used for bug report + +# Base colors +_pure_set_default pure_color_primary (set_color blue) +_pure_set_default pure_color_info (set_color cyan) +_pure_set_default pure_color_mute (set_color brblack) +_pure_set_default pure_color_success (set_color magenta) +_pure_set_default pure_color_normal (set_color normal) +_pure_set_default pure_color_danger (set_color red) +_pure_set_default pure_color_light (set_color white) +_pure_set_default pure_color_warning (set_color yellow) +_pure_set_default pure_color_dark (set_color black) + +# Prompt +_pure_set_default pure_symbol_prompt "❯" +_pure_set_default pure_symbol_reverse_prompt "❮" # used for VI mode +_pure_set_default pure_color_prompt_on_error $pure_color_danger +_pure_set_default pure_color_prompt_on_success $pure_color_success + +# Current Working Directory +_pure_set_default pure_color_current_directory $pure_color_primary + +# Git +_pure_set_default pure_symbol_git_unpulled_commits "⇣" +_pure_set_default pure_symbol_git_unpushed_commits "⇡" +_pure_set_default pure_symbol_git_dirty "*" +_pure_set_default pure_color_git_unpulled_commits $pure_color_info +_pure_set_default pure_color_git_unpushed_commits $pure_color_info +_pure_set_default pure_color_git_branch $pure_color_mute +_pure_set_default pure_color_git_dirty $pure_color_mute + +# SSH info +_pure_set_default pure_color_ssh_hostname $pure_color_mute +_pure_set_default pure_color_ssh_separator $pure_color_mute +_pure_set_default pure_color_ssh_user_normal $pure_color_mute +_pure_set_default pure_color_ssh_user_root $pure_color_light + +# Virtualenv for Pyhon +_pure_set_default pure_color_virtualenv $pure_color_mute +# Deactivate the default virtualenv prompt so that we can add our own +set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 + +# Print current working directory at the beginning of prompt +# true (default): current directory, git, user@hostname (ssh-only), command duration +# false: user@hostname (ssh-only), current directory, git, command duration +_pure_set_default pure_begin_prompt_with_current_directory true + +# Show exit code of last command as a separate prompt character (cf. https://github.com/sindresorhus/pure/wiki#show-exit-code-of-last-command-as-a-separate-prompt-character) +# false - single prompt character, default +# true - separate prompt character +_pure_set_default pure_separate_prompt_on_error false + +# Max execution time of a process before its run time is shown when it exits +_pure_set_default pure_threshold_command_duration 5 +_pure_set_default pure_color_command_duration $pure_color_warning + +# Right Prompt variables +_pure_set_default pure_right_prompt "" +_pure_set_default pure_color_right_prompt $pure_color_normal + +# VI mode indicator +# true (default): indicate a non-insert mode by reversing the prompt symbol (❮) +# false: indicate vi mode with [I], [N], [V] +_pure_set_default pure_reverse_prompt_symbol_in_vimode true + +# Title +_pure_set_default pure_symbol_title_bar_separator "—" + +# Whether or not is a fresh session +set --global _pure_fresh_session true diff --git a/shells/fish/conf.d/x.fish b/shells/fish/conf.d/x.fish new file mode 100644 index 0000000..71cdc4b --- /dev/null +++ b/shells/fish/conf.d/x.fish @@ -0,0 +1,32 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Automatically start X at login +# source: https://wiki.archlinux.org/index.php/Fish#Start_X_at_login +# This must be at the bottom of this file +if status --is-login + if test -z "$DISPLAY" -a $XDG_VTNR = 1 + # Unlock GPG keyring befor starting X. + # This makes some things easier. + echo "gpg unlock" | gpg -se -r me@mmk2410.org > /dev/null + pulseaudio -D # start pulseaudio before X is started + exec startx -- -keeptty + end +end diff --git a/shells/fish/config.fish b/shells/fish/config.fish deleted file mode 100644 index e04a471..0000000 --- a/shells/fish/config.fish +++ /dev/null @@ -1,135 +0,0 @@ -set -x ARCHFLAGS -arch_x86_64 - -set -e GPG_TTY -set -Ux GPG_TTY (tty) - -eval (thefuck --alias | tr '\n' ';') -alias l="ls" -alias diff='colordiff' -alias grep='grep --color=auto' -alias more='less' -alias df='df -h' -alias du='du -c -h' -alias mkdir='mkdir -p -v' -alias nano='nano -w' -alias ping='ping -c 3' -alias pingtest='ping -c 3 marcel-kapfer.de' -alias dmesg='dmesg -HL' -alias da='date "+%A, %B %d, %Y [%T]"' -alias du1='du --max-depth=1' -alias hist='history | grep' # requires an argument -alias openports='ss --all --numeric --processes --ipv4 --ipv6' -alias pgg='ps -Af | grep' # requires an argument -alias ln='ln -i' -alias chown='chown --preserve-root' -alias chmod='chmod --preserve-root' -alias chgrp='chgrp --preserve-root' -alias cls=' echo -ne "\033c"' -alias ps='ps aux k%cpu' -alias new='touch' -alias re='/sbin/reboot' -alias off='/sbin/poweroff' -alias vol='alsamixer' -alias q=' exit' -alias Q=' exit' -alias x=' exit' -alias cd..='cd ..' -alias sbcl='rlwrap sbcl' -alias o='xdg-open' -alias nemo='nemo --no-desktop' - -alias mmk2410='~/.mmk2410' - -# Debian Packaging - -# quilt -alias dquilt="quilt --quiltrc=$HOME/.quiltrc-dpkg" - -# Variables -set -x DEBUILD_DPKG_BUILDPACKAGE_OPTS "-i -I -us -uc" -set -x DEBUILD_LINTIAN_OPTS "-i -I --show-overrides" -set -x DEBSIGN_KEYID "9FE01C39F74551D434116394CADE6F0C09F21B09" - -# if [ -z $SSH_CLIENT ] -# ~/.mmk2410 -# end - -if [ -z $EDITOR ] - set -Ux EDITOR es -end - -if [ -z $VISUAL ] - set -Ux VISUAL es -end - -if [ -z $GIT_EDITOR ] - set -Ux GIT_EDITOR es -end - -if [ -z $GOPATH ] - set -Ux GOPATH ~/.go -end - -if test -z $DEBFULLNAME - set -Ux DEBFULLNAME "Marcel Kapfer" -end - -if test -z $DEBEMAIL - set -Ux DEBEMAIL "opensource@mmk2410.org" -end - -if test -z $XDG_CURRENT_DESKTOP - set -Ux XDG_CURRENT_DESKTOP GNOME -end - -if test -z $QT_STYLE_OVERRIDE - set -Ux QT_STYLE_OVERRIDE kvantum -end - -# Attach the autoscreen screen session if StumpWM is running -# and it's not already in use. -# if test \( -n $DESKTOP_SESSION \) -a \( $DESKTOP_SESSION = "stumpwm" \) -# if screen -list | grep -q "No Sockets" -# screen -dmS autoscreen -# exec screen -r -# else if screen -list | grep -Eq "\.autoscreen.*Detached" -# exec screen -r -# end -# end - -# gpg-agent as SSH agent -# set -e SSH_AGENT_PID -# set -e SSH_AUTH_SOCK -# if test -z $gnupg_SSH_AUTH_SOCK_by -# set gnupg_SSH_AUTH_SOCK_by 0 -# end -# if test $gnupg_SSH_AUTH_SOCK_by -ne %self -# set UID (id -u) -# set -Ux SSH_AUTH_SOCK "/run/user/$UID/gnupg/S.gpg-agent.ssh" -# end -# gpg-connect-agent updatestartuptty /bye > /dev/null - -# Source the Nix profile, if it exists. -set -l NIX_PROFILE $HOME/.nix-profile/etc/profile.d/nix.fish -if test -e $NIX_PROFILE - source $NIX_PROFILE -end - -# Run zsh when using emacs -# Current problem with fish seems to be the theme -if test $TERM = "eterm-color" - exec zsh -end - -# Automatically start X at login -# source: https://wiki.archlinux.org/index.php/Fish#Start_X_at_login -# This must be at the bottom of this file -if status --is-login - if test -z "$DISPLAY" -a $XDG_VTNR = 1 - # Unlock GPG keyring befor starting X. - # This makes some things easier. - echo "gpg unlock" | gpg -se -r me@mmk2410.org > /dev/null - pulseaudio -D # start pulseaudio before X is started - exec startx -- -keeptty - end -end diff --git a/shells/fish/functions/.gitignore b/shells/fish/functions/.gitignore index 49074af..643eb47 100644 --- a/shells/fish/functions/.gitignore +++ b/shells/fish/functions/.gitignore @@ -22,3 +22,13 @@ set_color_custom.fish vcs.name.fish vcs.present.fish fisher.fish +fin.fish +fish_greeting.fish +fish_mode_prompt.fish +host_info.fish +last_job_id.fish +pwd_info.fish +pwd_is_home.fish +_* +fish_prompt.fish +fish_title.fish diff --git a/shells/fish/functions/cdl.fish b/shells/fish/functions/cdl.fish index e529f41..9618302 100644 --- a/shells/fish/functions/cdl.fish +++ b/shells/fish/functions/cdl.fish @@ -1,4 +1,24 @@ -function cdl +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function cdl --wraps cd --description "Switch directory and show content" cd $argv l end diff --git a/shells/fish/functions/diff.fish b/shells/fish/functions/diff.fish new file mode 100644 index 0000000..eae0167 --- /dev/null +++ b/shells/fish/functions/diff.fish @@ -0,0 +1,27 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function diff --wraps diff --description "Use colordiff instead of diff, if available" + if type -q colordiff + colordiff $argv + else + diff $argv + end +end diff --git a/shells/fish/functions/fish_prompt.fish b/shells/fish/functions/fish_prompt.fish deleted file mode 120000 index f1f0416..0000000 --- a/shells/fish/functions/fish_prompt.fish +++ /dev/null @@ -1 +0,0 @@ -/home/marcel/.config/fisherman/eco/functions/fish_prompt.fish \ No newline at end of file diff --git a/shells/fish/functions/fish_title.fish b/shells/fish/functions/fish_title.fish deleted file mode 100644 index f1646ed..0000000 --- a/shells/fish/functions/fish_title.fish +++ /dev/null @@ -1,12 +0,0 @@ -# Defined in /tmp/fish.au862c/fish_title.fish @ line 2 -function fish_title - if test -z $EMACS - if test $_ = 'fish' - echo (prompt_pwd) - else - echo $_ - end - else - true - end -end diff --git a/shells/fish/functions/g.fish b/shells/fish/functions/g.fish deleted file mode 100644 index 8abc055..0000000 --- a/shells/fish/functions/g.fish +++ /dev/null @@ -1,27 +0,0 @@ -function g - git $argv -end - -function gst - git status $argv -end - -function gcom - git commit $argv -end - -function gad - git add $argv -end - -function gup - git push $argv -end - -function gdo - git pull $argv -end - -function gdif - git diff $argv -end diff --git a/shells/fish/functions/haha.fish b/shells/fish/functions/haha.fish deleted file mode 100644 index 4c69ff1..0000000 --- a/shells/fish/functions/haha.fish +++ /dev/null @@ -1,5 +0,0 @@ -function haha - for x in (seq 10) - echo hahahahahahahahahahahahahahahahahaha - end -end diff --git a/shells/fish/functions/sbcl.fish b/shells/fish/functions/sbcl.fish new file mode 100644 index 0000000..1724e14 --- /dev/null +++ b/shells/fish/functions/sbcl.fish @@ -0,0 +1,27 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function sbcl --wraps sbcl --description "Wrap SBCL with rlwrap (readline support)" + if type -q rlwrap + rlwrap sbcl $argv + else + sbcl $argv + end +end diff --git a/shells/fish/functions/upgrade.fish b/shells/fish/functions/upgrade.fish deleted file mode 100644 index e714f92..0000000 --- a/shells/fish/functions/upgrade.fish +++ /dev/null @@ -1,8 +0,0 @@ -function upgrade --description "Upgrade the system" - sudo apt update - and sudo apt upgrade - and sudo apt full-upgrade - and sudo apt autoremove - sudo tlmgr update --self --all - sudo npm update -g -end diff --git a/shells/fish/functions/vim.fish b/shells/fish/functions/vim.fish deleted file mode 100644 index f0a542e..0000000 --- a/shells/fish/functions/vim.fish +++ /dev/null @@ -1,3 +0,0 @@ -function vim - nvim $argv -end