Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
060c7303
Commit
060c7303
authored
Jun 10, 2014
by
Bruno
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #167 from syl20bnr/add-support-native-vi-mode-support
Add support for upcoming fish shell native vi mode
parents
07789b76
2c6cde92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
themes/syl20bnr/README.md
themes/syl20bnr/README.md
+2
-1
themes/syl20bnr/fish_prompt.fish
themes/syl20bnr/fish_prompt.fish
+20
-1
No files found.
themes/syl20bnr/README.md
View file @
060c7303
...
@@ -71,7 +71,8 @@ In a sub-directory of the repository:
...
@@ -71,7 +71,8 @@ In a sub-directory of the repository:
### vi-mode
### vi-mode
This segment display the current
`vi-mode`
if the plugin is used.
This segment display the current
`vi-mode`
if the fish native vi mode or
the oh-my-fish vi-mode plugin is used.
See the
`[n]`
in the previous screenshots.
See the
`[n]`
in the previous screenshots.
### end
### end
...
...
themes/syl20bnr/fish_prompt.fish
View file @
060c7303
...
@@ -40,6 +40,21 @@ function __syl20bnr_unpushed_commit_count -d "Return the number of unpushed comm
...
@@ -40,6 +40,21 @@ function __syl20bnr_unpushed_commit_count -d "Return the number of unpushed comm
git status -s -b ^/dev/null | grep -E -o "ahead\ [0-9]+" | awk '{print $2}'
git status -s -b ^/dev/null | grep -E -o "ahead\ [0-9]+" | awk '{print $2}'
end
end
function fish_vi_prompt_cm --description "Displays the current mode"
switch $fish_bind_mode
case default
set_color --bold --background red white
echo "[N]"
case insert
set_color --bold --background green white
echo "[I]"
case visual
set_color --bold --background magenta white
echo "[V]"
end
set_color normal
end
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Aliases
# Aliases
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
...
@@ -129,11 +144,15 @@ function fish_prompt -d "Write out the left prompt of the syl20bnr theme"
...
@@ -129,11 +144,15 @@ function fish_prompt -d "Write out the left prompt of the syl20bnr theme"
end
end
# vi mode
# vi mode
# If vi_mode plugin is activated then print the vi mode in the prompt.
# If vi_mode plugin or native vi mode is activated then print the vi mode
# in the prompt.
set -l ps_vi ""
set -l ps_vi ""
if test -n "$vi_mode"
if test -n "$vi_mode"
set ps_vi $colnormal"["$vi_mode$colnormal"]"
set ps_vi $colnormal"["$vi_mode$colnormal"]"
end
end
if test "$fish_key_bindings" = "fish_vi_key_bindings"
set ps_vi (fish_vi_prompt_cm)
end
# end of prompt
# end of prompt
# The color of the end of the prompt depends on the $status value of the
# The color of the end of the prompt depends on the $status value of the
...
...
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