[vim/vim] runtime(doc): improve :write-plugin to make it more beginner-friendly (PR #20411)

2 views
Skip to first unread message

nyngwang

unread,
12:43 AM (20 hours ago) 12:43 AM
to vim/vim, Subscribed

Problem: Some important info is missing in :write-plugin.
Solution: Provide more links in appropriate places; also make some text more consistent.

Context:

  1. For a beginner, it might not be apparent that :noremap will remap <Plug>.... It's pointed out by nickspoons. I also found it confusing when I first learned it from vi.stackexchange, answered by romainl.
  2. For a beginner, it might be confusing on why the same summary item noremap <script> is described differently between :plugin-special and :ftplugin-special.

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20411

Commit Summary

  • 546c7ee runtime(doc): improve :write-plugin to make it more beginner-friendly

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411@github.com>

Christian Brabandt

unread,
1:26 PM (7 hours ago) 1:26 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20411)

I am not quite sure for the first part:

Note: when appears in the {rhs} of a mapping, this part is
always applied even if remapping is disallowed. |:nore|

First of all, this is the second Note: following each other, so, I think we can drop it. Then, what means applied in that context? And third, it is not anywhere but the {rhs} must start with <Plug>
So I'd rather say it like this:

When starts the {rhs} of a mapping, the {rhs} is always recursively resolved even if remapping is explicitly disallowed.

The second part of the diff is fine I'd say.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411/c4605111052@github.com>

nyngwang

unread,
1:55 PM (6 hours ago) 1:55 PM
to vim/vim, Subscribed
nyngwang left a comment (vim/vim#20411)

Yes, I believe that your version is better. I was not quite sure about wording so I ended up picking what is written in |:nore|. (I also found applied a bit strange to me, but since it was already used.)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411/c4605500221@github.com>

nyngwang

unread,
2:20 PM (6 hours ago) 2:20 PM
to vim/vim, Subscribed
nyngwang left a comment (vim/vim#20411)

OK, it seems that I might not get this part:

And third, it is not anywhere but the {rhs} must start with <Plug>

For example, I tried:

nnoremap <leader>ff WW<Plug>(aa)
nnoremap <Plug>(aa) :echom "from <Plug>(aa)"<CR>

and triggering the first map seems to still print from <Plug>(aa). What did I miss in this case?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411/c4605753859@github.com>

Christian Brabandt

unread,
2:30 PM (6 hours ago) 2:30 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20411)

Hm, maybe it does apply always, I remember wrong then.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411/c4605845884@github.com>

nyngwang

unread,
3:21 PM (5 hours ago) 3:21 PM
to vim/vim, Subscribed
nyngwang left a comment (vim/vim#20411)

Maybe your memory is correct. I did check the first PR https://github.com/vim/vim/pull/9879/changes, which indeed used the wording "starts with <Plug>". But the current version is somehow different, as in :h :nore:

			Note: When <Plug> appears in the {rhs} this part is
			always applied even if remapping is disallowed.

Do we need to update "applied" there too? (if so, in this or another PR?)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20411/c4606238679@github.com>

Reply all
Reply to author
Forward
0 new messages