18

I wanna custom my zsh theme ,but i don't known what does the %F and %K mean

such like

RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{white}"$'\ue0b2'"%k%F{black}%K{white} $POWERLINE_RIGHT_B %f%F{240}"$'\ue0b2'"%f%k%K{240}%F{255} $POWERLINE_RIGHT_A %f%k"

And i don't understand what is the %f%k 。。

Do you have any documentiions about how to custom oh my zsh theme ?

WensonSmith
  • 185
  • 1
  • 1
  • 6

1 Answers1

26

The ZSH documentation is very good. Learn to use the man pages: specifically, man zshmisc. You want the section on SIMPLE PROMPT ESCAPES:

%F (%f)
Start (stop) using a different foreground colour, if supported by the terminal. The colour may be specified two ways: either as a numeric argument, as normal, or by a sequence in braces following the %F, for example %F{red}. In the latter case the values allowed are as described for the fg zle_highlight attribute; see Character Highlighting in zshzle(1). This means that numeric colours are allowed in the second format also.

%K (%k)
Start (stop) using a different bacKground colour. The syntax is identical to that for %F and %f.

You've asked:

Do you have any documentation about how to custom oh my zsh theme ?

There are lots of example themes bundled with oh-my-zsh. Look in the themes directory. Look at the forks on github. Read related zsh questions, or this one, or this one.

For my prompt, I borrowed a lot from this.

And, as always, read the man pages, or the zsh users guide.

Community
  • 1
  • 1
simont
  • 68,704
  • 18
  • 117
  • 136
  • Thank you a lot ! I have googled custom zsh theme and read these themes in themes fold before i ask this question . I rarely use Shell,so i can't understand some codes. I have learned shell programming today, but i find there is no %F %K such keywords... Thank you for teaching me the way to solve questions .I really appreciate it – WensonSmith Nov 11 '13 at 15:20
  • 3
    @simont, just found your answer via google, so don't be so negative about the question, there is a good reason why comments like yours are frowned upon in the stackoverflow community. Thanks for the answer anyways :) – jupp0r Apr 20 '15 at 11:40
  • How does this differ from the %fg style I've been seeing also? – Chris Nov 08 '19 at 12:52