yank and put not vmapping in debian stretch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

yank and put not vmapping in debian stretch

tom arnall
i can't get yank or put to map to a kb shortcut in visual mode. i'm
running debian stretch.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

Tony Mechelynck
On Mon, Jul 23, 2018 at 3:40 AM, tom arnall <[hidden email]> wrote:
> i can't get yank or put to map to a kb shortcut in visual mode. i'm
> running debian stretch.

This problem description is so vague that I can't even begin to try to
reproduce it. Please include the following:

1. Which Vim version, patchlevel, and featureset? (Please paste the
first lines of the output of the :version command, up to and including
the one which ends in "Features included (+) or not (-)"). How to get
that into a file or into the clipboard is explained at ":help :redir".

2. Please describe in detail what you do (as a "recipe": 1. do this,
2. do that) using clear and simple language, so that even someone only
half-proficient in English can understand it.

3. At the end, or after the important steps of the procedure at 2
above, please say what you see ("Actual result") and what you expected
("Expected result").

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

tom arnall
will do. thanks very much for your offer of help.

On 7/22/18, Tony Mechelynck <[hidden email]> wrote:

> On Mon, Jul 23, 2018 at 3:40 AM, tom arnall <[hidden email]> wrote:
>> i can't get yank or put to map to a kb shortcut in visual mode. i'm
>> running debian stretch.
>
> This problem description is so vague that I can't even begin to try to
> reproduce it. Please include the following:
>
> 1. Which Vim version, patchlevel, and featureset? (Please paste the
> first lines of the output of the :version command, up to and including
> the one which ends in "Features included (+) or not (-)"). How to get
> that into a file or into the clipboard is explained at ":help :redir".
>
> 2. Please describe in detail what you do (as a "recipe": 1. do this,
> 2. do that) using clear and simple language, so that even someone only
> half-proficient in English can understand it.
>
> 3. At the end, or after the important steps of the procedure at 2
> above, please say what you see ("Actual result") and what you expected
> ("Expected result").
>
> Best regards,
> Tony.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

tom arnall
In reply to this post by Tony Mechelynck
Tony,

Here is (I hope) the presentation which you have requested.

Here is output of 'version':

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
Included patches: 1-197, 322, 377-378, 550, 703, 706-707
Modified by [hidden email]
Compiled by [hidden email]
Huge version without GUI.  Features included (+) or not (-):

Here is my procedure for mapping "+y:

1. enter ':vmap <c-i> "+y<cr>' (to map the visual mode yank)

2. in blank screen, hit 'i' key (for insert mode)

3. enter 'now is the time<cr>'.

4. hit <esc> key

5. hit 'v' key (for visual mode)

6. hit 'k' key to select the text

7. do <c-i>  ( actual result is that editor stays in visual mode;
expected that it would return to normal mode)

8. hit 'v' key to exit visual mode

9. hit 'j' key to move to next line

10. hit 'p' key to put the selected text (actual result is no change;
expected that editor would put 'now is the time' in the document)

Thanks again for your help,

Tom Arnall



On 7/22/18, Tony Mechelynck <[hidden email]> wrote:

> On Mon, Jul 23, 2018 at 3:40 AM, tom arnall <[hidden email]> wrote:
>> i can't get yank or put to map to a kb shortcut in visual mode. i'm
>> running debian stretch.
>
> This problem description is so vague that I can't even begin to try to
> reproduce it. Please include the following:
>
> 1. Which Vim version, patchlevel, and featureset? (Please paste the
> first lines of the output of the :version command, up to and including
> the one which ends in "Features included (+) or not (-)"). How to get
> that into a file or into the clipboard is explained at ":help :redir".
>
> 2. Please describe in detail what you do (as a "recipe": 1. do this,
> 2. do that) using clear and simple language, so that even someone only
> half-proficient in English can understand it.
>
> 3. At the end, or after the important steps of the procedure at 2
> above, please say what you see ("Actual result") and what you expected
> ("Expected result").
>
> Best regards,
> Tony.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

Tony Mechelynck
On Tue, Jul 24, 2018 at 4:42 AM, tom arnall <[hidden email]> wrote:

> Tony,
>
> Here is (I hope) the presentation which you have requested.
>
> Here is output of 'version':
>
> :version
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
> Included patches: 1-197, 322, 377-378, 550, 703, 706-707
> Modified by [hidden email]
> Compiled by [hidden email]
> Huge version without GUI.  Features included (+) or not (-):

As you can see, this Vim executable was compiled almost ten months
ago. Since then, Vim 8.0 went up to patchlevel 1850, Vim 8.1 was
released on 18 May 2018, and its patch level is (as of this writing)
at 209 (and counting). I've tried to reproduce your problem with a Big
build of Vim 8.1.209 on 64-bit openSUSE Linux 15.0 but I couldn't;
you'll see below the tests I did and what happened to me.

One possibility, unlikely as it may seem, is that the problem you got
might be due to the changes from Bram Moolenaar's original sources,
summarized by «Modified by
[hidden email]». Another possibility is
that the problem was fixed, either in one of the 1352 patchlevels
published after the source for your Vim was downloaded, or maybe even
in one or more of Vim 8.0 patches 198-321, 379-549, 551-702, 704-705,
(a total of 449 of 707 patches, or 63.5% — almost two-thirds) which
the Debian maintainers did not apply to their source even though they
were available to them when they downloaded it.

I build my Vim executables myself using Bram's original sources, and I
apply all patches, though if they are Windows-only patches ot
tests-only patches I don't build a binary until a patch comes along
which looks relevant to me. I've written up how I do it and uploaded
it online at:
https://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
I'm told that other people have since then uploaded simplified HowTo
pages for the more common usecases, but I tried to be complete and the
above two llinks are the result.

Could you please compile "your own Vim 8.1" from the latest sources
and tell us if the problem happens again?

Now here are the results of my tests (on a Vim whose first lines of
the ":version" output are further down). I followed your "steps to
reproduce".

After step 7, I saw --VISUAL-- go away near bottom left of my Vim
screen. After step 10, there was a second line identical to the first
one.

So I did it again, neutralizing my vimrc, by invoking Vim as: vim --clean
Then I noticed that I had been typing <C-I> in capitals when defining
the mapping, so I closed Vim down and restarted it, this time defining
the mapping with a {lhs} in all lowercase.

In all cases I got the same result: I am unable to reproduce your problem.

I was doing all this in a konsole terminal, so I hit Ctrl-Alt-F2 and
did it again in the text-only Linux console. Same result as above, so
I came back with Ctrl-Alt-F7.

Here is how my Vim version identifies itself:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul 24 2018 05:49:23)
Included patches: 1-209
Compiled by [hidden email]
Big version with GTK2 GUI.  Features included (+) or not (-):

>
> Here is my procedure for mapping "+y:
>
> 1. enter ':vmap <c-i> "+y<cr>' (to map the visual mode yank)
>
> 2. in blank screen, hit 'i' key (for insert mode)
>
> 3. enter 'now is the time<cr>'.
>
> 4. hit <esc> key
>
> 5. hit 'v' key (for visual mode)
>
> 6. hit 'k' key to select the text
>
> 7. do <c-i>  ( actual result is that editor stays in visual mode;
> expected that it would return to normal mode)
>
> 8. hit 'v' key to exit visual mode
>
> 9. hit 'j' key to move to next line
>
> 10. hit 'p' key to put the selected text (actual result is no change;
> expected that editor would put 'now is the time' in the document)
>
> Thanks again for your help,
>
> Tom Arnall
>
>
>
> On 7/22/18, Tony Mechelynck <[hidden email]> wrote:
>> On Mon, Jul 23, 2018 at 3:40 AM, tom arnall <[hidden email]> wrote:
>>> i can't get yank or put to map to a kb shortcut in visual mode. i'm
>>> running debian stretch.
>>
>> This problem description is so vague that I can't even begin to try to
>> reproduce it. Please include the following:
>>
>> 1. Which Vim version, patchlevel, and featureset? (Please paste the
>> first lines of the output of the :version command, up to and including
>> the one which ends in "Features included (+) or not (-)"). How to get
>> that into a file or into the clipboard is explained at ":help :redir".
>>
>> 2. Please describe in detail what you do (as a "recipe": 1. do this,
>> 2. do that) using clear and simple language, so that even someone only
>> half-proficient in English can understand it.
>>
>> 3. At the end, or after the important steps of the procedure at 2
>> above, please say what you see ("Actual result") and what you expected
>> ("Expected result").
>>
>> Best regards,
>> Tony.
>>
>> --
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "vim_use" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

Jürgen Krämer-4
In reply to this post by tom arnall
Hi,

tom arnall schrieb am 24.07.2018 um 04:42:

>
> Here is (I hope) the presentation which you have requested.
>
> Here is output of 'version':
>
> :version
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
> Included patches: 1-197, 322, 377-378, 550, 703, 706-707
> Modified by [hidden email]
> Compiled by [hidden email]
> Huge version without GUI.  Features included (+) or not (-):
>
> Here is my procedure for mapping "+y:
>
> 1. enter ':vmap <c-i> "+y<cr>' (to map the visual mode yank)

you are using the clipboard register in a non-GUI version. Are you sure
the clipboard register is available? What do

  :echo has('x11')

and

  :echo has('clipboard')

output? Does your mapping work with a different register, e.g.

  :vmap <c-i> "ay

?

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

Timothy Rice
This seems to be the source of the confusion right here:

> ... (to map the visual mode yank)

Visual mode doesn't need a separate form of yank. Just use the regular
yank:

:vmap <c-i> y

No <cr> required. When you're in visual mode and then hit y, it yanks the
text and exits visual mode immediately. The <c-i> map then inherits that
behaviour.

As Jürgen says, if you really do want to use the X11 clipboard, you'll need
something like vim-gtk from your package manager, something that ships with
"+X11" (when you check `vim --version`).

If you do end up with a version that has +X11 and you want mappings to work
with the clipboard, you might find something like the following useful:

"""
if has('x11')
    nnoremap + :let @+=@0<CR>
    nnoremap <silent> <C-c> :set opfunc=YankCB<CR>g@
    vnoremap <silent> <C-c> :<C-U>call YankCB(visualmode(), 1)<CR>
    function! YankCB(type, ...)
        let l:sel_save = &selection
        let &selection = 'inclusive'
        if a:0  " Invoked from Visual mode, use gv command.
            silent exe "normal! gv\"+y"
        elseif a:type ==# 'line'
            silent exe "normal! '[V']\"+y"
        else
            silent exe "normal! `[v`]\"+y"
        endif
        let &selection = l:sel_save
    endfunction

    nnoremap * :let @*=@0<CR>
    nnoremap <silent> <leader>c :set opfunc=YankPS<CR>g@
    vnoremap <silent> <leader>c :<C-U>call YankPS(visualmode(), 1)<CR>
    function! YankPS(type, ...)
        let l:sel_save = &selection
        let &selection = 'inclusive'
        if a:0  " Invoked from Visual mode, use gv command.
            silent exe "normal! gv\"*y"
        elseif a:type ==# 'line'
            silent exe "normal! '[V']\"*y"
        else
            silent exe "normal! `[v`]\"*y"
        endif
        let &selection = l:sel_save
    endfunction
endif
"""

This sets up operations that act like the familiar old yank, but sends it
to clipboard or primary selection respectively.


~ Tim

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: yank and put not vmapping in debian stretch

Christian Brabandt
In reply to this post by tom arnall

On Mo, 23 Jul 2018, tom arnall wrote:

> Here is output of 'version':
>
> :version
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
> Included patches: 1-197, 322, 377-378, 550, 703, 706-707
> Modified by [hidden email]
> Compiled by [hidden email]
> Huge version without GUI.  Features included (+) or not (-):

Missing output....

>
> Here is my procedure for mapping "+y:
>
> 1. enter ':vmap <c-i> "+y<cr>' (to map the visual mode yank)
>
> 2. in blank screen, hit 'i' key (for insert mode)
>
> 3. enter 'now is the time<cr>'.
>
> 4. hit <esc> key
>
> 5. hit 'v' key (for visual mode)
>
> 6. hit 'k' key to select the text
>
> 7. do <c-i>  ( actual result is that editor stays in visual mode;
> expected that it would return to normal mode)

I guess it beep? I second the guess, that your Vim/Terminal is unable to
access your clipboard. Please check the detail :version output and try
again with a different register. Also to reproduce, make sure to start
with vim -i NONE -u NONE -N (or use --clean, however that might not be
available on older Vims)


Mit freundlichen Grüßen
Christian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.