Initial commit
This commit is contained in:
commit
29daecb0ce
23 changed files with 3745 additions and 0 deletions
10
fish/functions/cd.fish
Normal file
10
fish/functions/cd.fish
Normal 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
|
||||
7
fish/functions/fish_prompt.fish
Normal file
7
fish/functions/fish_prompt.fish
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
function fish_prompt
|
||||
printf "\e[37m%s\e[96m%s" (hostname) (prompt_pwd)
|
||||
if test $VIRTUAL_ENV
|
||||
printf " \e[37m(%s)" (basename $VIRTUAL_ENV)
|
||||
end
|
||||
printf " \e[91m<3\e[0m "
|
||||
end
|
||||
7
fish/functions/fish_right_prompt.fish
Normal file
7
fish/functions/fish_right_prompt.fish
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
function fish_right_prompt
|
||||
set stat $status
|
||||
if test $stat -ne 0
|
||||
printf "\e[91m(%d) " $stat
|
||||
end
|
||||
printf "\e[37m%s\e[0m" (__fish_git_prompt "%s")
|
||||
end
|
||||
5
fish/functions/fish_user_key_bindings.fish
Normal file
5
fish/functions/fish_user_key_bindings.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
function fish_user_key_bindings
|
||||
bind \co sudo-execute
|
||||
bind \cv foreground-vi
|
||||
bind \cq quote-word
|
||||
end
|
||||
3
fish/functions/foreground-vi.fish
Normal file
3
fish/functions/foreground-vi.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function foreground-vi
|
||||
fg %vi >/dev/null
|
||||
end
|
||||
4
fish/functions/md.fish
Normal file
4
fish/functions/md.fish
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
function md
|
||||
mkdir "$argv"
|
||||
cd "$argv"
|
||||
end
|
||||
4
fish/functions/quote-word.fish
Normal file
4
fish/functions/quote-word.fish
Normal 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
fish/functions/sa.fish
Normal file
3
fish/functions/sa.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function sa
|
||||
ssh-add "$HOME/.ssh/id_rsa.$argv"
|
||||
end
|
||||
5
fish/functions/sudo-execute.fish
Normal file
5
fish/functions/sudo-execute.fish
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue