|
|
Log in / Subscribe / Register

New features in Neovim 0.5

New features in Neovim 0.5

Posted Aug 5, 2021 2:01 UTC (Thu) by Ranguvar (subscriber, #56734)
In reply to: New features in Neovim 0.5 by flussence
Parent article: New features in Neovim 0.5

Do you mind elaborating why this matters to yu?

I admit I never really saw the point of GVim compared to terminal vim.


to post comments

New features in Neovim 0.5

Posted Aug 5, 2021 13:34 UTC (Thu) by jond (subscriber, #37669) [Link]

I used to use gvim from time to time. In my case I think it was that sometimes it was quite convenient to interact with the tool/menu bar. I moved exclusively to terminal some time prior to switching to neovim, so the lack of drop-in replacement for gvim hasn't bothered me personally.

New features in Neovim 0.5

Posted Aug 5, 2021 14:50 UTC (Thu) by flussence (guest, #85566) [Link] (2 responses)

On the rare occasion I need to move a lot of text back and forth between other GUI programs, it's a lot easier when text selection and middle click DWIM. nvim gets the paste side correct, but whether it sets the X selection from a mouse drag movement is very hit or miss. Even console vim is more reliable in that regard.

New features in Neovim 0.5

Posted Aug 5, 2021 15:05 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (1 responses)

Hmm. When selecting text in vim for middle-click paste, I get all kinds of padding spaces and such mixed in with the copy that I have to fix on the other side (which, inevitably, is missing useful editing tools and is a manual process to fix). I've started getting into the habit of using visual selection and then `:w!xsel -i -p` to send it to the clipboard. Are you using `:set mouse` (I have it off in tmux as well as vim/neovim)?

New features in Neovim 0.5

Posted Aug 7, 2021 12:24 UTC (Sat) by mgedmin (guest, #34497) [Link]

There are multiple ways of using copy/paste with vim in the console. Either you let vim talk to your display server (:set mouse=a, plus vim needs to be built with X11 support and the clipboard feature), in which case MiddleMouse will paste from the selection register. This becomes more complicated if you use Vim remotely (over ssh, which would need ssh's X11 forwarding enabled), especially if you also use screen/tmux (when you reattach an older session, $DISPLAY value may be wrong).

The other way is you let the terminal handle the pasting (if you use :set mouse=a, for most terminal emulators you can override it by holding down shift when middle-clicking). Recent versions of Vim support xterm's bracketed paste, so the paste should gets detected and work fine. Older versions of Vim see a bunch of keypresses, so you need to go into insert mode before pasting, and disable things like autoindent -- for which there's a handy :set pastetoggle=..., so you can hit a key, paste, then hit the key again.

For copying, there's no equivalent to xterm's bracketed paste, so you either need to use the clipboard feature and yank into the "* register, or you need to hold down shift while selecting text (which is hard if you use vertical splits or if the lines are longer than the width of the window, or if you want to preserve tabs).

New features in Neovim 0.5

Posted Aug 5, 2021 21:25 UTC (Thu) by karkhaz (subscriber, #99844) [Link] (2 responses)

On some distros, the 'gvim' package also provides a vim binary that is compiled with more options than the more minimal vim package. So you can continue running terminal vim, but with more features.

For example, on Arch, the vim package does not depend on Xorg or Wayland, while the gvim package transitively does. This means that gvim's vim binary integrates with the system clipboard, while regular vim does not.

If your vim can't talk to the clipboard, you have to copy text by selecting it with the mouse and middle-clicking elsewhere, which is probably not what you want if you prefer using the terminal. With X11 support, you can copy the visual selection onto the clipboard with Ctrl-C, and paste from the system clipboard with Ctrl-D, as follows:

nnoremap <C-d> :set paste<Return>"+p:set nopaste<Return><Esc>a
inoremap <C-d> <Esc>:set paste<Return>"+p:set nopaste<Return>a
vnoremap <C-c> "+y<Esc>

You could even remap the usual yank and put commands to copy and paste to the system clipboard, though I personally like the vim clipboard be separate from the system one.

Of course, you don't need to install gvim for all this if you just want clipboard support; an alternative would be to just compile vim with the right flags, and then you don't need to drag in gtk3 and other various libraries.

New features in Neovim 0.5

Posted Aug 5, 2021 22:15 UTC (Thu) by mathstuf (subscriber, #69389) [Link]

On Fedora, there is `vim-enhanced` which has these things enabled (though I haven't used them myself as I'm content with selecting and middle click pasting).

New features in Neovim 0.5

Posted Aug 6, 2021 3:18 UTC (Fri) by jamessan (subscriber, #12612) [Link]

On some distros, the 'gvim' package also provides a vim binary that is compiled with more options than the more minimal vim package. So you can continue running terminal vim, but with more features.
None of that is needed with Neovim, since all features are always built in.

New features in Neovim 0.5

Posted Aug 14, 2021 5:30 UTC (Sat) by Seirdy (guest, #137326) [Link]

One of the nice things about GVim was that it had surprisingly low typing latency, for users who like instantaneous feedback. One person I know went out of her way to tune her compositor to minimize input delay, and she exclusively used GVim.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds