Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Vi-mode Feature Implementation #103

Merged
merged 8 commits into from
Nov 18, 2018
Merged

Vi-mode Feature Implementation #103

merged 8 commits into from
Nov 18, 2018

Conversation

kulabun
Copy link
Contributor

@kulabun kulabun commented Nov 16, 2018

Vi-mode Feature Implementation

Description

Implements Vi-Mode Feature. There are some difference with zsh's spaceship implementation:

  • fishshell also allows to handle VISUAL and REPLACE_ONE modes and it use dedicated symbols for them in default fish_default_mode_prompt. So I add them too.
  • Zsh's spaceship also provide two methods to enable/disable vim mode(actually its implementation just switch it from emacs to vim). For fishshell same methods already exists out of box: fish_vi_key_bindings and fish_default_key_bindings.

Also I have overridden default fish_mode_prompt to avoid duplication. I think it better to have it all out of box.

Motivation and Context

#74

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux

Checklist:

  • I have checked that no other PR duplicates mine
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

Copy link
Owner

@matchai matchai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kulabun! 👋

Glad to see another contribution from you!
This PR is looking great! I just have a few quick comments before we can get it merged in. 😁

functions/__sf_section_vi_mode.fish Show resolved Hide resolved
functions/__sf_section_vi_mode.fish Outdated Show resolved Hide resolved
functions/__sf_section_vi_mode.fish Outdated Show resolved Hide resolved
tests/__sf_section_vi_mode.test.fish Outdated Show resolved Hide resolved
@kulabun
Copy link
Contributor Author

kulabun commented Nov 18, 2018

Hey @matchai ,
Thanks for your time spent to review this PR. Fixed it all.

@kulabun
Copy link
Contributor Author

kulabun commented Nov 18, 2018

Wow, that's interesting. After my commit CI start failing with this:

not ok 142 Prints section when fish_vi_key_bindigs is set

operator: =
expected: ' [I] '
received: ' [N] '
...

Unfortunately right after running fish_vi_key_bindings CI have fish_bind_mode in 'normal' state instead of 'insert'.

Fixed it.

Copy link
Owner

@matchai matchai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍
Thank you for the contribution @kulabun!

@matchai matchai merged commit 5949954 into matchai:master Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants