Some fish shell configuration changes
This commit is contained in:
parent
e20ae0c561
commit
147d3d7514
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
fish/fishd.*
|
||||
terminal/fish/fishd.*
|
||||
|
@ -1,8 +1,8 @@
|
||||
set -x DOTFILES /Users/thomas/dotfiles
|
||||
set -x DOTFILES $HOME/dotfiles
|
||||
# The definition of $DOTFILES MUST be the first line of this file
|
||||
# Don't change it!
|
||||
|
||||
if test "$SHLVL" -le 1
|
||||
if test -z "$FISH_SETUP_PATH"
|
||||
# Homebrew path
|
||||
set -x PATH /usr/local/bin /usr/local/sbin $PATH
|
||||
# Personal scripts
|
||||
@ -20,4 +20,6 @@ set -x LC_ALL sv_SE.UTF-8
|
||||
set -x EDITOR vim
|
||||
alias v vim
|
||||
|
||||
eval (python3 -m virtualfish)
|
||||
if not is_ssh_agent_running
|
||||
ssh_agent_start
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ function fish_prompt
|
||||
end
|
||||
|
||||
# Hostname with unique color
|
||||
set_color (hostname -s | md5 | cut -c-6)
|
||||
set_color (hostname -s | md5sum | cut -c-6)
|
||||
echo -sn (hostname -s)
|
||||
|
||||
# A yellow separator
|
||||
|
12
terminal/fish/functions/is_ssh_agent_running.fish
Normal file
12
terminal/fish/functions/is_ssh_agent_running.fish
Normal file
@ -0,0 +1,12 @@
|
||||
function is_ssh_agent_running
|
||||
if begin; test -f ~/.ssh/env; and test -z "$SSH_AGENT_PID"; end
|
||||
source ~/.ssh/env > /dev/null
|
||||
end
|
||||
|
||||
if test -z "$SSH_AGENT_PID"
|
||||
return 1
|
||||
end
|
||||
|
||||
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep -q ssh-agent
|
||||
return $status
|
||||
end
|
5
terminal/fish/functions/ssh_agent_start.fish
Normal file
5
terminal/fish/functions/ssh_agent_start.fish
Normal file
@ -0,0 +1,5 @@
|
||||
function ssh_agent_start
|
||||
ssh-agent -c | sed 's/^echo/#echo/' > ~/.ssh/env
|
||||
chmod 600 ~/.ssh/env
|
||||
source ~/.ssh/env > /dev/null
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user