Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upvi bindings #92
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dumblob
commented
Oct 3, 2015
|
+1 the patch looks fine |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eggsyntax
commented
Jan 22, 2016
|
Any blocks to merging this? It'd be reeeaaaaaalllly nice to have. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dumblob
commented
Jun 25, 2016
|
@saysjonathan do you plan to resolve the merge conflicts any time soon? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lethosor
Jun 28, 2016
FWIW, I think the algorithm in #64 is closer to vim's behavior (and readline's, for that matter). Few implementations I've seen consider only spaces to be word boundaries.
lethosor
commented
Jun 28, 2016
|
FWIW, I think the algorithm in #64 is closer to vim's behavior (and readline's, for that matter). Few implementations I've seen consider only spaces to be word boundaries. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dumblob
commented
Apr 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lethosor
Apr 14, 2017
Sorry, that branch changed a lot since I mentioned it - I was referring to just the first 3 commits in that PR.
lethosor
commented
Apr 14, 2017
|
Sorry, that branch changed a lot since I mentioned it - I was referring to just the first 3 commits in that PR. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
wingeng
Apr 14, 2017
@dumblob Wow, been a long time since I saw this code. Sorry about the massive changes to the code-base, the style was driving me nuts. I don't have much time now-a-days to work on this... but I may in a couple of weeks as some current work projects may allow me to revisit this.
BTW, did you just want the fixes to the word boundaries navigation? That was done prior to the C++ switch over.
wingeng
commented
Apr 14, 2017
|
@dumblob Wow, been a long time since I saw this code. Sorry about the massive changes to the code-base, the style was driving me nuts. I don't have much time now-a-days to work on this... but I may in a couple of weeks as some current work projects may allow me to revisit this. BTW, did you just want the fixes to the word boundaries navigation? That was done prior to the C++ switch over. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
antirez
Apr 14, 2017
Owner
The code looks well written and does not change radically the linenoise code base in order to add such a support, however the question is if it's a fit for a small library to add such a mode. The code complexity will get a bit bigger but the concept of ANSI-C single file remains. Not sure... Btw I'm a vim user myself and I use the vim mode in zsh sometimes, but vim modes in the end tend to be very limited, naturally, so it is never a great experience. But still I use it in order to immediately move across the line. Any hint?
|
The code looks well written and does not change radically the linenoise code base in order to add such a support, however the question is if it's a fit for a small library to add such a mode. The code complexity will get a bit bigger but the concept of ANSI-C single file remains. Not sure... Btw I'm a vim user myself and I use the vim mode in zsh sometimes, but vim modes in the end tend to be very limited, naturally, so it is never a great experience. But still I use it in order to immediately move across the line. Any hint? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dumblob
Apr 15, 2017
...the vim mode in zsh sometimes, but vim modes in the end tend to be very limited, naturally, so it is never a great experience. But still I use it in order to immediately move across the line. Any hint?
Well, it is not the best experience (compared to (n)vim, whose feature set can't be even reached because of the shell semantics), but on my side it saves me a huge amount of time (and saves me from swearing "how slow and error-prone it is to work with pure POSIX shell" and thus makes me way more comfortable) when it comes to a command line work. I actually use in shell (mostly Bash) nearly all the commands from the original vi, so I can say the set -o vi mode is powerful and very handy.
Do you @antirez also use the full power of set -o vi in zsh or rather really just "immediate moving across the line"? Could you also please elaborate what exactly you mean with the question "Any hint?"?
dumblob
commented
Apr 15, 2017
Well, it is not the best experience (compared to (n)vim, whose feature set can't be even reached because of the shell semantics), but on my side it saves me a huge amount of time (and saves me from swearing "how slow and error-prone it is to work with pure POSIX shell" and thus makes me way more comfortable) when it comes to a command line work. I actually use in shell (mostly Bash) nearly all the commands from the original vi, so I can say the Do you @antirez also use the full power of |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michael-776
Jul 22, 2017
Having a vi mode is a serious accessibility issue for people for whom repeated keyboard chording causes physical pain (e.g. http://ergoemacs.org/emacs/emacs_kb_shortcuts_pain.html). I use vi emulation in Emacs for this reason. So I hope you will please merge the vi bindings.
michael-776
commented
Jul 22, 2017
|
Having a vi mode is a serious accessibility issue for people for whom repeated keyboard chording causes physical pain (e.g. http://ergoemacs.org/emacs/emacs_kb_shortcuts_pain.html). I use vi emulation in Emacs for this reason. So I hope you will please merge the vi bindings. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Sonophoto
Jul 25, 2017
@michael-776 You know you can fork the linenoise repo and mod it to your hearts content? Right? I use a customized linenoise with changes specific to my needs/tastes: https://github.com/Sonophoto/linenoise/commits/master/linenoise.c I haven't used the "official" linenoise in years...
Sonophoto
commented
Jul 25, 2017
|
@michael-776 You know you can fork the linenoise repo and mod it to your hearts content? Right? I use a customized linenoise with changes specific to my needs/tastes: https://github.com/Sonophoto/linenoise/commits/master/linenoise.c I haven't used the "official" linenoise in years... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michael-776
Jul 25, 2017
@Sonophoto RE: "you know you can fork the linenoise repo and mod it to your hearts content?"
I do know, yes, thanks for the suggestion. But I'm not a C programmer, and lots of other people aren't either. I was just throwing my two cents in on the usefulness of having a vi mode. Well.. and making a plea for help, I admit :)
michael-776
commented
Jul 25, 2017
•
|
@Sonophoto RE: "you know you can fork the linenoise repo and mod it to your hearts content?" I do know, yes, thanks for the suggestion. But I'm not a C programmer, and lots of other people aren't either. I was just throwing my two cents in on the usefulness of having a vi mode. Well.. and making a plea for help, I admit :) |
saysjonathan commentedMay 3, 2015
This change introduces vi bindings while maintaining the original API. A shim function was created that enables vi mode then passes off to the normal API, linenoise().
A few additional functions were created to support common key actions, including:
The bindings are not meant to be comprehensive but to provide basic functionality by implementing the most common actions.
example.cwas also updated to introduce a new flag that enables vi bindings.