aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/prompt_pwd.fish
blob: 991b007b7f3ab65c263c63cc67c4dbc64b441e9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
switch (uname)
case Darwin
	function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
		echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\([^/.]\)[^/]*/-\1/-g'
	end
case 'CYGWIN_*'
	function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
		echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/cygdrive/\(.\)|\1/:|' -e 's-\([^/.]\)[^/]*/-\1/-g' -e 's-^\([^/]\)/:/\?-\u\1:/-'
	end
case '*'
	function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
		echo $PWD | sed -e "s|^$HOME|~|" -e 's-\([^/.]\)[^/]*/-\1/-g'
	end
end