1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

add nnn prompt segment; see #342

This commit is contained in:
romkatv 2020-01-02 18:59:19 +01:00
parent a9620d7dca
commit acb6b68a37
5 changed files with 36 additions and 0 deletions

View File

@ -75,6 +75,7 @@
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
vim_shell # vim shell indicator (:sh)
# midnight_commander # midnight commander shell (https://midnight-commander.org/)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
@ -530,6 +531,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=72
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34

View File

@ -75,6 +75,7 @@
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
vim_shell # vim shell indicator (:sh)
# midnight_commander # midnight commander shell (https://midnight-commander.org/)
# vpn_ip # virtual private network indicator
@ -523,6 +524,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=72
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34

View File

@ -75,6 +75,7 @@
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
vim_shell # vim shell indicator (:sh)
# midnight_commander # midnight commander shell (https://midnight-commander.org/)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
@ -529,6 +530,13 @@
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
# typeset -g POWERLEVEL9K_NNN_FOREGROUND=0
# typeset -g POWERLEVEL9K_NNN_BACKGROUND=6
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
# typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0

View File

@ -122,6 +122,7 @@ function _p9k_init_icons() {
GCLOUD_ICON 'G'
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
)
;;
'awesome-fontconfig')
@ -231,6 +232,7 @@ function _p9k_init_icons() {
GCLOUD_ICON 'G'
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
)
;;
'awesome-mapped-fontconfig')
@ -344,6 +346,7 @@ function _p9k_init_icons() {
GCLOUD_ICON 'G'
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
)
;;
'nerdfont-complete'|'nerdfont-fontconfig')
@ -454,6 +457,7 @@ function _p9k_init_icons() {
GCLOUD_ICON '\uF7B7' # 
LUA_ICON '\uE620' # 
PERL_ICON '\uE769' # 
NNN_ICON 'nnn'
)
;;
*)
@ -563,6 +567,7 @@ function _p9k_init_icons() {
GCLOUD_ICON 'G'
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
)
;;
esac

View File

@ -3678,6 +3678,15 @@ function instant_prompt_midnight_commander() {
_p9k_prompt_segment prompt_midnight_commander $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '$MC_TMPDIR' ''
}
function prompt_nnn() {
[[ $NNNLVL == (0|) ]] && return
_p9k_prompt_segment $0 6 $_p9k_color1 NNN_ICON 0 '' $NNNLVL
}
function instant_prompt_nnn() {
_p9k_prompt_segment prompt_nnn 6 $_p9k_color1 NNN_ICON 1 '${NNNLVL:#0}' '$NNNLVL'
}
function prompt_vim_shell() {
[[ -n $VIMRUNTIME ]] || return
_p9k_prompt_segment $0 green $_p9k_color1 VIM_ICON 0 '' ''