883 links
  • thican's links | thican.net
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
1 results tagged ZSH x
  • [ZSH] Gathering information from version control systems | User Contributions
    In case it might help someone, when developping with VCS.

    Copied/pasted from QuickStart:
    --------------------------------
    To get this feature working quickly (including colors), you can do the following (assuming, you loaded vcs_info properly - see above):

    zstyle ':vcs_info:*' actionformats \
        '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
    zstyle ':vcs_info:*' formats       \
        '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
    zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
    precmd () { vcs_info }
    PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# '

    Obviously, the last two lines are there for demonstration. You need to call vcs_info from your precmd function. Once that is done you need a single quoted '${vcs_info_msg_0_}' in your prompt.

    To be able to use '${vcs_info_msg_0_}' directly in your prompt like this, you will need to have the PROMPT_SUBST option enabled.
    --------------------------------
    August 30, 2018 at 10:03:05 AM GMT+2 * - permalink -
    QRCode
    - http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information
    Git GNU/Linux Mercurial todo ZSH
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, clarity, bookmarking service by the Shaarli community - Help/documentation