I'm using fish 2.0 on Linux, but this might be an installation error, since my ~/.config/fish/config.fish is empty.
Asked
Active
Viewed 1.9k times
14
Philipp Ludwig
- 95
- 6
SuperCheezGi
- 255
- 1
- 3
- 7
-
Which operating system you are using Ubuntu, CentOS, etc etc...? – max Jun 04 '13 at 11:56
-
@max CrunchBang (#!) C: – SuperCheezGi Jun 06 '13 at 16:02
3 Answers
19
~/.config/fish/config.fish is empty by default. To create a custom prompt create a file ~/.config/fish/functions/fish_prompt.fish and fill it with your prompt.
Basic example
function fish_prompt
echo (pwd) '> '
end
-
6Is there a way to save multiple prompts, or add to the list of available prompts that are displayed when you run fish_config? – Chris Rasys Sep 12 '13 at 13:19
0
I make a alternative prompt if starship prompt dosen't exist.
# default prompt
function fish_prompt
echo ''
set_color cyan; echo (pwd)
set_color green; echo '> '
end
# starship prompt
if type -q starship
starship init fish | source
else
fish_prompt
end
user2385294
- 1
- 1
-2
This worked for me:
~/.local/share/omf/init.fish
function fish_prompt
echo (pwd) '> '
end
Gaff
- 18,569
- 15
- 57
- 68
-
Although this may help to solve the problem, it doesn't explain _why_ and/or _how_ it addresses the issue. Providing this additional context would significantly improve its long-term educational value. Please [edit] your answer to add explanation, including what limitations and assumptions apply. – Toby Speight Sep 21 '16 at 08:24
-
2This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill Oct 27 '16 at 08:20
-
1Please don't add "thank you" as an answer. Once you have sufficient [reputation](http://superuser.com/help/whats-reputation), you will be able to [vote up questions and answers](http://superuser.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/low-quality-posts/587724) – DavidPostill Oct 27 '16 at 08:20
-
Welcome to superuser: While this may or may not answer the question, it would be a better answer if you could provide some explanation you feel why it does so. Detail on why and when you should do something with as easy to follow instructions. If you feel your answer is correct do these things and reedit. Please take a couple of minutes and read:- http://superuser.com/help .Answering: http://superuser.com/help/how-to-answer, again welcome to superuser.Thankyou – mic84 Oct 27 '16 at 15:16
-
@DavidPostill I have said the location of the config file that works for me i don't see the same location in any above answers so kindly do not over estimate yourself and do not miss use you reputation. – praveen cruz Oct 28 '16 at 04:39
-
The other answer says which is the file to edit to create a custom prompt: ~/.config/fish/functions/fish_prompt.fish. – apaderno Jan 15 '20 at 16:57