Skip to content
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

Visual mode marker erroneously reintroduced in the namespacing example (grep operators part three) #106

Open
timmyjose opened this issue Jun 11, 2020 · 1 comment

Comments

@timmyjose
Copy link

Link: https://learnvimscriptthehardway.stevelosh.com/chapters/34.html

@ghburdie
Copy link

Movement to `] is exclusive

I am using (g)Vim 9.0 and the GrepOperator function of chapter 34, first script doesn't work properly with a yank movement (line 10 of the script): This movement to `] is exclusive in my Vim application. Thus, it doesn't contain the last character of the target of the movement.

Toggling exclusive movement to inclusive

I don't know whether there is an option to switch it permanently to an inclusive movement, but I fixed the issue with inserting a v after the yank:

" My fix in line 10 of GrepOperator function:
normal! `[yv`]

The v toggles a normally exclusive movement to an inclusive one (see: :help o_v in Vim).

Thanks!

And by the way: Thank you for publishing that tutorial! After 30 years of using Vim occasionally with only knowing a few commands, I will now become a professional (hopefully). It is incredible how long it lasts sometimes to learn something important fundamentally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants