-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make M go to middle line of window #1136
Comments
That looks like an ancient bug. I believe it should be
Does that make more sense? |
For me, it seems
I don't know if |
Based on that it seems that To me |
I did not realize that So Do you think it makes more sense to have |
To me having Also not exactly related, but I feel weird that we have In vis, it is I know vis does not have to be fully compliant with vim, but for "matching/related" motions such as those quoted here, I find the behaviour in vis rather inconsistent not only with vim, but also by nature. |
I can see the argument for using
It seems like |
I am also interested in hearing more about other people's opinions on the topic. I personally think that the basic editing features should be as consistent as possible with vim, and that vis should add up those extra features around multi-cursors and sam expressions. This is an ideal statement of course, and in practice, there are use cases with clashes where decisions should be taken. What makes vim popular is the style of editing. So for me, this has to be strongly applied in vis so that people are directly familiar. And then, they can learn about those superpowers that vis brings, while staying a minimalist and well-scoped editor. Otherwise, I just want to mention that in vim, Let me start with the latter. Both However, the small difference is for visual mode. No changes for So if you want to visually select until the end of the line without catching the end-of-line, you should use Now for All those differences seem subtle but for an old accustomed vim user, they are burnt in memory and if they are not the same in vis, they will be painful to revert mentally. Vim is an established language and changing the language is a risky bet in my opinion. And this is what differentiates vis with kakoune for example (which decided to create its own brand new language). I also have comments about how text-object motions are executed in vis when the cursor is outside matching objects. But the topic is a bit different so I think I will create another issue to keep them focused. |
I would also rebound on this. While I can totally understand your statement, maybe it is important to bring some history and design choices of vim about Disclaimer, I feel like vis took inspiration from Kakoune for If I want to select all lines within those brackets:
I can first select inside the brackets with Vis inherits more from vim's design. And in vim, See this comment: https://github.com/neovim/neovim/blob/af7d317f3ff31d5ac5d8724b5057a422e1451b54/src/nvim/normal.c#L5865
See also this thread which explains why Many people say that So I think vis should either decide to follow vim with this model and implement all the "linewise" behaviors, or drop it and make it clear why in the docs (but this is dropping well-established vim workflow). And of course, if those do not exist, we should make sure that what they do can be replaced by something else in vis. In this occasion, |
About using `M` for going to the middle of the window. I don't consider
this a particularly important motion so 2 characters for this seems OK
to me. `gM` would be consistent with `gm`. I certainly think "restore
selections" is a more important feature of vis so it seems right to
prioritize it's keybinding. It's true that this is inconsistent with `L`
and `H`, but I'd rather change those.
About `g_`. As rnpnr said, we used to just have `^` and `$` so we were
free to use `_` for stripping. Not sure why we'd have `g_`. I'd prefer
to have something for 'go to previous non-blank character' as a more
basic motion, and leave people free to bind `g_` to that if they want,
or use `$<previous-non-blank>` with whatever we pick for it. Especially
if you also have a next-non-blank, so `^` could be a combination of
basic motions, too.
Over all, I think we have quite different feelings about what 'basic
editing features' are. For me, the modes, `hjkl` together with `webfdr`
and the counts about cover 'basic editing features'.
vis does not aim at vim compatibility, and personally I think it's OK if
deep vim powerusers aren't comfortable using it. Rather I consider it a
refreshing and light alternative which was inspired by the basic ideas
of vi and other nice editors.
|
I am not sure to follow you here. Isn't that Otherwise, vis is inspired by vim. It does not have to follow it precisely, but to me it is a really hard task to draw the line about what to include and what not. If you include too few, people will always ask for the addition of xxx feature which is missing. And you will never have a concrete reason about not including except: this is my personal feeling as a maintainer (or user of vis). And of course you are biased regarding which vim features you were using frequently vs which you did not use. All the vim emulation modes out there in editors or in vim clones are living the same story. They are lacking feature either because they decided so, or because they have technical reasons that prevent them from implementing the feature correctly. And this makes a poor vim experience and people end up retiring from using the tool. I think that choices should be driven by concrete reason, and not about feelings. Of course we can disagree here, and including just whatever you feel like including is a strategy. But regarding the future longevity of this piece of software, I think it is precarious. Vim is clearly lacking a precise specification about its editing mode (not talking about other features of vim outside of edition such as arglist, quickfix, tabs, mappings, api, vimscript or other bits). But to me, it feels to be a better strategy to stay as close as possible to vim, and exclude features if there are clashing, or judged to be mistakes that we want to correct. But in either cases, this should be solidly argued and documented, so that it does not emanate from feelings. Neovim did that, but also did a lot more and it's codebase has grown up a lot, making it less and less lightweight and focused. Vis in comparison has got good grounds and a solid design on paper. |
Loric Brevet ***@***.***> wrote:
> I'd prefer to have something for 'go to previous non-blank character' as a more basic motion
I am not sure to follow you here. Isn't that `B`?
No, `B` would go to the character before the previous blank character. E.g. in the string `a Bird _` a cursor on the `_` would go to `B` on `B` but to the `d` on the motion I suggested.
I agree that "I don't feel like adding this" is a bad reply. For me, I prefer not to add things to vis that can already be achieved by combining existing feature. This makes "go to the middle line" something I would consider. A `3_` seems less interesting because that's `2j^`. Perhaps we should work on a configuration on the wiki which would add (most) vim bindings we're missing via aliases and some lua functions?
|
Sounds like a good solution to me with the caveat that any mapping that changes a core vis binding needs to be clearly indicated. I think I should apply the 2 line patch making |
This is also what I saw in the doc, but I was not sure how I was supposed to go into |
It a side effect of how the keybindings are defined. See here: Lines 315 to 316 in aa18162
It just happens that M is already assigned as something else in all modes besides OPERATOR_PENDING
|
Makes sense. If we choose |
I am reading vis' documentation again and maybe there is something that I don't understand, but here is the part of the doc that explains marks:
It seems it works the opposite way of vim. In vim, you set a mark at (by the way, if you have an explanation of why it is inverted, I am curious ^^). So those Hence, can we say that |
Yes that is by design. Marks are kind of like addresses for interactive modes. Once set they can also be used as addresses in commands (but that might have some limitations).
No because there is an implicit default mark ( |
Understood. |
So, what remains here as an actionable issue? Or should this be closed? |
Nothing has been done or acted upon since the beginning of this issue. So in that regard, I don't see how it could be closed. Possible changes that could be implemented here are actionable the the sense of being small and relatively easy. But we don't have a clear consensus and questions are yet to be answered. Here is a summary.
It has been commented that I then asked this question:
I am not particularly content about doing this, but still, the question was not answered. I understand that vis does not aim for vim compatibility and I respect this, but not having But again, I was just trying to make a proposition for consistency and because it "makes sense to me". But I am no maintainer here and I respect the choice of maintainers if they want to go in a separate direction.
Kind of the same thing, nothing has been decided. And it is pretty much the same story. This is basic POSIX vi behavior that is not present in vis. To remove the inconsistency, there was this proposition.
I don't know what should be the last decision on those two ideas. I leave people running the project decide about the outcome. And according to what has been decided and after having clearly explained why, I am not against closing this. |
Hello,
I know that
M
doesRestore selections from mark
. But it replaces in my opinion an important motion of vim which is to go to the middle line of window.I find it weird that
vis
hasL
,H
but notM
. It is not really consistent in my opinion.Also, in the docs (
:help
) in theOPERATOR-PENDING
section, it is still written:So it seems the doc has not been updated in this section. Or otherwise, it is that I don't understand what
M
means in the context of "operator-pending".I don't have a better replacement for
restore selections from mark
at the moment. And I understand that it resonates withm
being attributed to marks globally in vim. But I still it is worth exploring if something better could be found.The text was updated successfully, but these errors were encountered: