Neovim: Difference between revisions

From wikinotes
Line 33: Line 33:
|}
|}
</blockquote><!-- Notes -->
</blockquote><!-- Notes -->
= Configuration =
<blockquote>
<source lang="vim">
" ~/.config/nvim/init.vim
" source vimrc from init.vim
set rtp^=HOME/.vim
so ~/.vimrc
</source>
</blockquote><!-- configuration -->


= Features =
= Features =

Revision as of 02:47, 26 December 2021

Neovim is a rewrite of vim with some new/alternative features.

Documentation

:help https://neovim.io/doc/user/

Locations

~/.config/nvim/init.vim nvim's vimrc
~/.config/nvim/ginit.vim GUI nvim's vimrc

Notes

neovim install
neovim configuration
neovim features
neovim guis

Features

Terminal

Neovim has it's own embedded terminal!

:terminal        " open terminal in current tab
<c-leader><c-n>  " escape terminal mode into normal-mode
tnoremap  <c-a>  " keybind namespace for within terminal mode

<c-leader><c-n> (move cursor to filename) gf   "open file in nvim

" ex:  (perhaps bind this to a key)
cd /path/to/src
realpath file.py
<c-leader><c-n>
k
gf

GUI

neovim-qt

Essentially gvim for neovim, and it's beautiful.

:GuiFont DejaVu Sans Mono:h11    " change font/size

Extensions

neovim-remote

Start a neovim-server, neovim connects to this, adding files to the same session.

Common Issues

strange global variable behaviour

neovim saves global variables in ~/.local/share/nvim/shada/main.shada.
If you encountering wonky results when changing your vimrc, delete this file and try again.

neovim crashes terminal

Your terminal probably needs to be recompiled.

scrolling panes is broken in xterm

You may be using xterm, not xterm-256color.
Try export TERM= or export TERM=xterm.