Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
65bbd24e
Unverified
Commit
65bbd24e
authored
Dec 29, 2021
by
bretello
Committed by
GitHub
Dec 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(vi-mode): add `INSERT_MODE_INDICATOR` (#9732)
Co-authored-by:
bretello
<
bretello@distruzione.org
>
parent
3bb23e8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
README.md
plugins/vi-mode/README.md
+10
-5
vi-mode.plugin.zsh
plugins/vi-mode/vi-mode.plugin.zsh
+2
-2
No files found.
plugins/vi-mode/README.md
View file @
65bbd24e
...
...
@@ -32,16 +32,21 @@ plugins=(... vi-mode)
- `MODE_INDICATOR`: controls the string displayed when the shell is in normal mode.
See [Mode indicator](#mode-indicator) for details.
## Mode indicator
- `INSERT_MODE_INDICATOR`: controls the string displayed when the shell is in insert mode.
See [Mode indicator](#mode-indicator) for details.
## Mode indicators
*Normal mode* is indicated with a red `<<<` mark at the right prompt, when it
hasn'
t been defined by theme.
hasn'
t been defined by theme
,
*
Insert mode
*
is not displayed by default
.
You can change this indicator by setting the
`
MODE_INDICATOR
`
variable. This setting
supports Prompt Expansion sequences. For example:
You can change these indicators by setting the
`
MODE_INDICATOR
`
(
*
Normal mode
*
)
and
`
INSERT_MODE_INDICATORS
`
(
*
Insert mode
*
)
variables.
This settings support Prompt Expansion sequences. For example:
```
zsh
MODE_INDICATOR="%F{yellow}+%f"
MODE_INDICATOR="%F{white}+%f"
INSERT_MODE_INDICATOR="%F{yellow}+%f"
```
You can also use the `vi_mode_prompt_info` function in your prompt, which will display
...
...
plugins/vi-mode/vi-mode.plugin.zsh
View file @
65bbd24e
...
...
@@ -123,7 +123,7 @@ wrap_clipboard_widgets copy vi-yank vi-yank-eol vi-backward-kill-word vi-change-
wrap_clipboard_widgets
paste
vi-put-
{
before,after
}
unfunction wrap_clipboard_widgets
# if mode indicator wasn't setup by theme, define default
# if mode indicator wasn't setup by theme, define default
, we'll leave INSERT_MODE_INDICATOR empty by default
if
[[
-z
"
$MODE_INDICATOR
"
]]
;
then
MODE_INDICATOR
=
'%B%F{red}<%b<<%f'
fi
...
...
@@ -136,7 +136,7 @@ function vi_mode_prompt_info() {
# set RPS1/RPROMPT to something else in their custom config.
:
"
${
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE
:
=true
}
"
echo
"
${${
VI_KEYMAP
/vicmd/
$MODE_INDICATOR
}
/(main|viins)/
}
"
echo
"
${${
VI_KEYMAP
/vicmd/
$MODE_INDICATOR
}
/(main|viins)/
$INSERT_MODE_INDICATOR
}
"
}
# define right prompt, if it wasn't defined by a theme
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment