What’s NeoVim? πŸ‡³

It is an open source project, a fork of the modal text editor known as Vim. I prefer to refer to it as modern Vim, because they removed the old features and added new ones. As of this writing, the total number of stars on NeoVim’s repository is 55.6k. This means that programmers love this modal text editor.


Installation Guide πŸ“‹

Windows

(note: windows 8 or later are the only supported versions)

There are several methods for installing NeoVim on Windows. If you’re using Windows, simply follow one of the procedures listed below. I prefer using a package manager in the terminal to install apps and packages.

Winget

  • Release: winget install NeoVim.NeoVim

Chocolatey

  • Release: choco install neovim
  • Developement (pre-release): choco install neovim --pre

Scoop

scoop bucket add extras
scoop install vcredist2022
  • Release: snoop install neovim
  • Development:
scoop bucket add versions
scoop install neovim-nightly

Linux

There are different ways to install NeoVim in every linux distribution depending on which package manager is being used.

Debian

  • sudo apt-get install neovim

Fedora

  • sudo dnf install -y neovim python3-neovim

Ubuntu

  • sudo apt install neovim

Configuration πŸ”§

My configuration guide is only for Linux because I don’t use Windows and am unsure if it is the same on Windows, just use notepad++ if you are on Windows (just kidding).

Setting up the configuration file

  • Create a directory /home/<user>/.config/nvim/ and create a file inside and name it init.vim.
  • Copy and paste my configuration and modify it based on your preferences.

My complete configuration

:set number #Shows a number in every lines at the left side of the text editor
:set autoindent #Activates auto indent feature
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a #Allow mouse pointer usage inside the text editor.

call plug#begin("~/.vim/plugged")
Plug 'preservim/nerdtree'
Plug 'arcticicestudio/nord-vim'
Plug 'navarasu/onedark.nvim'
Plug 'ryanoasis/vim-devicons'
Plug 'tiagovla/tokyodark.nvim'
call plug#end()

nnoremap <C-n>	:NERDTree<CR>
nnoremap <C-t>	:NERDTreeToggle<CR>

"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
    "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
    let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif

set encoding=UTF-8
syntax on
let g:onedark_config = {
    \ 'style': 'darker',
\}
colorscheme onedark
  • Execute to install vim-plug:

This command automates the whole installation proces for the vim-plug plugin manager.

  sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

Download the plug-ins

  • Fire up your terminal and run nvim.
  • Press the colon key : on your keyboard inside neovim.
  • Input PlugInstall and press enter.
  • It will download the plugins listed in our config file init.vim that are enclosed with:
call plug#begin("~/.vim/plugged")
// <plugins>
call plug#end()

What does my configuration look like?

If you are unfamiliar with NeoVim…

  • Press : inside NeoVim and input help, which would add up to :help and press enter.
  • On the terminal, it would look something like this:
  • Use the arrow keys to navigate.

Wrap things up! πŸ“¦

Please feel free to use my configuration if you liked it. If you have any questions about my neovim configuration, please contact me via email. I will do my best to respond to your questions. Please stay tuned for my next blog.


#NeoVim #Vim