nnoremap <End> <S-A> " line comment
Pressing End key then produces the desired effect but vim also appends
" line comment to the end of the line!
Is there any way to kinda let vim know where nnoremap directive ends?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
This is a common pitfall. After
:map, everything is taken as the right-hand side. I would recommend to place the comment on a separate line:
" line comment nnoremap <End> <S-A>
But if you really want to stick with the trailing comments, you can employ the default command separation (with
|, with in a mapping has to be either escaped
\| or written as
<Bar>) to append a separate comment "command":
nnoremap <End> <S-A>| " line comment
PS: Instead of
<S-A>, you can simply write