Neovim
Jump to navigation
Jump to search
References
Install
See the guide Installing Neovim.
On Ubuntu, we install from repository:
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt-get update
sudo apt-get install neovim
Default ini files are located at ~/.config/nvim/init.vim. To import Vim settings (FAQ :help nvim-from-vim)
mkdir ~/.config
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
Configure nvim as default vim alternative:
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
sudo update-alternatives --config vi
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
sudo update-alternatives --config vim
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
sudo update-alternatives --config editor
Ruby support
Must install neovim rubygem:
sudo apt install ruby-dev
sudo gem install neovim
Python support
sudo pip install neovim
Plugin manager
We install vim-plug:
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Plugins
- https://github.com/junegunn/vim-easy-align
- https://github.com/tpope/vim-sensible (on vim.org)
- https://github.com/tpope/vim-sleuth (on vim.org)
- https://github.com/easymotion/vim-easymotion
- https://github.com/scrooloose/nerdtree.git
Content of ~/.config/nvim/init.vim:
Reload the init script and install plugins:
:so $MYVIMRC
"... or ':so %' if it is current file
:PlugInstall
To update plugins:
:PlugUpdate
- To test
- vim-airline, vs powerline, vs vim-bufferline
- Color theme solarized.
NeoVim GUI
There is no equivalent to gvim
for neovim so far. The best I could do so far is to create a script gnvim
that uses gnome-terminal as window, sets title to NeoVim, and sets icon using xseticon.
To install gnvim
:
- Build and install xseticon.
- Copy neovim icon to /usr/local/icons/neovim.png. For instance, there is an icon in neovim-qt.git:
git clone https://github.com/equalsraf/neovim-qt.git sudo mkdir -p /usr/local/icons sudo cp neovim-qt/third-party/neovim.png /usr/local/icons
- Create file gnvim, and make it executable:
#! /bin/bash
# We add a sleep 1 because of race condition between xseticon and echo
gnome-terminal --geometry 132x50 --hide-menubar -x bash -c "echo -ne '\033]0;NeoVim\007'; ((sleep 1; xseticon -name NeoVim /usr/local/icons/neovim.png)&); exec nvim $*"
- To add NeoVim GUI as a desktop application, create the file ~/.local/share/applications/neovim.desktop:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/peetersm/bin/ngvim
Name=NeoVim
Comment=The future of Vim
Icon=/usr/local/icons/neovim.png
Then
chmod a+x ~/.local/share/applications/neovim.desktop
Troubleshooting
True color and italic support
See xterm.
To Do
- True color
- Gui
- Color scheme
- Solarized
- gruvbox
- Linters
- neomake
- syntactics