diff --git a/themes/powerline-multiline/README.md b/themes/powerline-multiline/README.md index 856c2261..23e7b079 100644 --- a/themes/powerline-multiline/README.md +++ b/themes/powerline-multiline/README.md @@ -11,6 +11,8 @@ A colorful multiline theme, where the first line shows information about your sh * Current time * Current shell level * Current dirstack level (`pushd` / `popd`) +* Current history number +* Current command number * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor @@ -69,6 +71,8 @@ The contents of both prompt sides can be "reordered", all the "segments" (every hierarchy, only the directory you're currently in. * `shlvl` - Show the current shell level (based on `SHLVL` environment variable), but only if you are not in root shell * `dirstack` - Show the current dirstack level (based on `DIRSTACK` environment variable), but only if the stack is not empty +* `history_number` - Show current history number +* `command_number` - Show current command number Two variables can be defined to set the order of the prompt segments: diff --git a/themes/powerline-naked/README.md b/themes/powerline-naked/README.md index bc64ad66..b1ab2d69 100644 --- a/themes/powerline-naked/README.md +++ b/themes/powerline-naked/README.md @@ -11,6 +11,8 @@ A colorful theme, where shows a lot information about your shell session. * Current time * Current shell level * Current dirstack level (`pushd` / `popd`) +* Current history number +* Current command number * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor @@ -63,6 +65,8 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o hierarchy, only the directory you're currently in. * `shlvl` - Show the current shell level (based on `SHLVL` environment variable), but only if you are not in root shell * `dirstack` - Show the current dirstack level (based on `DIRSTACK` environment variable), but only if the stack is not empty +* `history_number` - Show current history number +* `command_number` - Show current command number A variable can be defined to set the order of the prompt segments: diff --git a/themes/powerline-plain/README.md b/themes/powerline-plain/README.md index 71939323..f5da2095 100644 --- a/themes/powerline-plain/README.md +++ b/themes/powerline-plain/README.md @@ -9,6 +9,8 @@ A colorful theme, where shows a lot information about your shell session. * Current time * Current shell level * Current dirstack level (`pushd` / `popd`) +* Current history number +* Current command number * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor @@ -61,6 +63,8 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o hierarchy, only the directory you're currently in. * `shlvl` - Show the current shell level (based on `SHLVL` environment variable), but only if you are not in root shell * `dirstack` - Show the current dirstack level (based on `DIRSTACK` environment variable), but only if the stack is not empty +* `history_number` - Show current history number +* `command_number` - Show current command number A variable can be defined to set the order of the prompt segments: diff --git a/themes/powerline/README.md b/themes/powerline/README.md index 43447fe7..481806ec 100644 --- a/themes/powerline/README.md +++ b/themes/powerline/README.md @@ -13,6 +13,8 @@ A colorful theme, where shows a lot information about your shell session. * Current time * Current shell level * Current dirstack level (`pushd` / `popd`) +* Current history number +* Current command number * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor @@ -69,6 +71,8 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o hierarchy, only the directory you're currently in. * `shlvl` - Show the current shell level (based on `SHLVL` environment variable), but only if you are not in root shell * `dirstack` - Show the current dirstack level (based on `DIRSTACK` environment variable), but only if the stack is not empty +* `history_number` - Show current history number +* `command_number` - Show current command number A variable can be defined to set the order of the prompt segments: diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index d33b71c2..eeead59b 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -181,6 +181,14 @@ function __powerline_dirstack_prompt { fi } +function __powerline_history_number_prompt { + echo "${HISTORY_NUMBER_THEME_PROMPT_CHAR}\!|${HISTORY_NUMBER_THEME_PROMPT_COLOR}" +} + +function __powerline_command_number_prompt { + echo "${COMMAND_NUMBER_THEME_PROMPT_CHAR}\#|${COMMAND_NUMBER_THEME_PROMPT_COLOR}" +} + function __powerline_left_segment { local OLD_IFS="${IFS}"; IFS="|" local params=( $1 ) diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index 310ffb55..a6de0003 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -67,6 +67,12 @@ SHLVL_THEME_PROMPT_CHAR=${POWERLINE_SHLVL_CHAR:="§"} DIRSTACK_THEME_PROMPT_COLOR=${POWERLINE_DIRSTACK_COLOR:=${CWD_THEME_PROMPT_COLOR}} DIRSTACK_THEME_PROMPT_CHAR=${POWERLINE_DIRSTACK_CHAR:="←"} +HISTORY_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_HISTORY_NUMBER_COLOR:="0"} +HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"} + +COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=0} +COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"} + POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"} safe_append_prompt_command __powerline_prompt_command