by raverbashing · 8y ago · 0 comments
A lot of things "just work". Still, it still uses vim plumbing so it's quirky.
set clipboard+=unnamedplus
More details on that here: https://neovim.io/doc/user/provider.html#provider-clipboardA couple of small things I really like:
:set inccommand=nosplit
... this gives you a live view of substitutions as you type out a replacement e.g :%s/foo/bar/ :term
:vs term://bash
... these gives you a proper embedded terminal window inside vim.Also, I think vim8 has it as well, but something people might not realise is you can use truecolor gui color schemes (not limited to 256 color) in the terminal with
:set termguicolors
It also has a guicursor option for making the cursor display as a block or bar in the terminal depending on which mode you're in: https://neovim.io/doc/user/options.html#'guicursor'Other than that, there's a more thorough list of differences here: https://neovim.io/doc/user/vim_diff.html
:set inccommand=split
It's pretty cool, but I just prefer the nosplit way since it's less obtrusive. :)It ends up being similar in use to how many modern editors have multiple cursors.
Having an interactive bash/ipython/repl session where you can use vim keys to navigate and yank lines from your scrollback is pure bliss.
I like to run builds and be able to see, yank, open files from the errors all inside vim.
You can do something like this with the :grep or :make commands with the resulting preview window. Even if you were to do something like :r !make, you can view the errors by moving your cursor to the file name and pressing ctrl-w ctrl-f (to open in a new split window) or ctrl-w gf (to open it in a new tab).
To be honest, I don't really like having a 'terminal' in vim. It makes more sense to just use the terminal, which is like, right there, one ctrl-z away.
- Vim is not a shell or an Operating System. You will not be able to run a shell inside Vim or use it to control a debugger. This should work the other way around: Use Vim as a component from a shell or in an IDE. A satirical way to say this: "Unlike Emacs, Vim does not attempt to include everything but the kitchen sink, but some people say that you can clean one with it. ;-)"
In summary, it took it so long to get it because it explicitly goes against the original design (and I kind of think it was the right choice. Emacs already exists).
1. I don't want to learn a bunch of new key bindings to switch between terminal and editor windows. With nvim, I can use the same process that I use to switch between buffers, to switch to a terminal window.
2. I can use the same process to copy to/from terminal/buffer windows, and use the full range of vim registers in the process.
3. I can name terminal buffers in the same way I name editor windows, and use the names to switch to the terminal window.
"In [terminal] mode all keys except <C-\><C-N> are sent to the underlying program. Use <C-\><C-N> to return to normal-mode."
:help terminal-emulator-inputSo, for example, if you have autosave enabled, it won’t block the UI while it’s writing to disk.
IIRC, neovim implementation was first proposed as a vim PR before the fork happened. The mess following it was one of the main reason behind the fork.
https://robots.thoughtbot.com/how-to-copy-and-paste-with-tmu...
Otherwise the "+y / "+p commands should yank and paste system clipboard correctly.
I rarely notice any difference whatsoever in terms of behaviour.
That gives you MacVim's native Cocoa GUI while also using its console version as the system-wide vim.
For copy/paste in the terminal and vim, I usually have vim in a tmux session, and that has a few helpers to work with system clipboards. Not perfect, but better than vanilla vim's copy/paste.
set mouse=""
and/or have a ~/.vimrc