JavaScript IDE - NeoVim

Official website:


NeoVim installation in Ubuntu 20

Step 0. Install Packages

Nodejs should be installed

Install Golang (some plugins need golang) (Optional)

Step 1. Setup

$ mkdir ~/apps && cd ~/apps
$ curl -LO

$ sudo mkdir /opt/nvim

$ mv nvim.appimage nvim
$ chmod u+x nvim

$ sudo mv nvim /opt/nvim

$ sudo vi /etc/profile.d/

#### NVIM #######################

export NVIM_HOME=/opt/nvim

alias vi='nvim'
alias vim='nvim'
export EDITOR='nvim'

#### NVIM #######################

$ sudo chmod +x /etc/profile.d/
$ source /etc/profile.d/

// I also decided to add aliases in the bottom of file
$ sudo vi /etc/bash.bashrc
alias vi='nvim'
alias vim='nvim'

$ vi --version
NVIM v0.4.4

Install Additional fonts and icons


$ cd ~/tmp
$ git clone --depth 1
$ cd nerd-fonts
$ ./

Install package manager for neovim (Vim Plugins)

$ mkdir -p ~/.config/nvim/ && cd ~/.config/nvim/
$ mkdir autoload && cd autoload
$ curl -o plug.vim

$ mkdir -p ~/.config/nvim/plugged
$ vi ~/.config/nvim/init.vim

set number
set scrolloff=8
set list
set listchars=tab:→\ ,space:·,nbsp:,trail:,eol:,precedes:«,extends:»
set wildignore+=*/tmp/*,*/dist/*,*/node_modules/*,*.so,*.swp,*.zip,package-lock.json

" show existing tab with 2 spaces width
set tabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 2 spaces
set expandtab

call plug#begin('~/.config/nvim/plugged')

Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'

Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'ctrlpvim/ctrlp.vim'
Plug 'ryanoasis/vim-devicons'

" Automatic close parens
Plug 'jiangmiao/auto-pairs'

" Colorscheme
Plug 'morhetz/gruvbox'
Plug 'crusoexia/vim-monokai'

" Emmet
Plug 'mattn/emmet-vim'

" highlight colors
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }

" css3 syntax highlight
Plug 'hail2u/vim-css3-syntax'

" Syntax hightlight for .js
Plug 'pangloss/vim-javascript'

" Syntax highlight for .ts
Plug 'HerringtonDarkholme/yats.vim', { 'for': 'typescript' }

" Syntax highlight for .tsx
Plug 'ianks/vim-tsx', { 'for': 'typescript.tsx' }

" Syntax hightlight for Vue.js
Plug 'posva/vim-vue'

"Plug 'iamcco/coc-angular', {'branch': 'release'}
Plug 'airblade/vim-gitgutter'

" Syntax hightlight for .jsx
Plug 'mxw/vim-jsx'

Plug 'preservim/nerdcommenter'

Plug 'vim-airline/vim-airline'

Plug 'iamcco/coc-tailwindcss',  {'do': 'yarn install --frozen-lockfile && yarn run build'}

Plug 'jparise/vim-graphql'

call plug#end()

syntax on
colorscheme gruvbox

filetype plugin indent on

let g:NERDTreeWinPos = "right"
let g:NERDTreeIgnore = ['^node_modules$']

let g:ctrlp_use_caching = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = '\v[\/]\.(git)$'
let g:ctrlp_custom_ignore = 'node_modules\|dist\'

" coc config
let g:coc_global_extensions = [
  \ 'coc-snippets',
  \ 'coc-pairs',
  \ 'coc-tsserver',
  \ 'coc-eslint',
  \ 'coc-prettier',
  \ 'coc-json',
  \ 'coc-html',
  \ 'coc-css',
  \ 'coc-vetur',
  \ ]

map <C-n> :NERDTreeToggle<CR>

"block Ctrl + Z
nnoremap <c-z> <nop>

"block arrows
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>

"block mouse coursor
set mouse=

"Insert a newline without entering in insert mode, vim
nmap oo o<Esc>k
nmap OO O<Esc>j

"CTRL + S to save
nmap <c-s> :w<CR>
vmap <c-s> <Esc><c-s>gv
imap <c-s> <Esc><c-s>

"CTRL + Z to undo
nnoremap <c-z> :u<CR>      " Avoid using this**
inoremap <c-z> <c-o>:u<CR>

nmap <F2> :update<CR>
vmap <F2> <Esc><F2>gv
imap <F2> <c-o><F2>

noremap <F3> :set invnumber<CR>
inoremap <F3> <C-O>:set invnumber<CR>

nmap <silent> gd <Plug>(coc-definition)

" Use `:ORGANIZE` for organize import of current buffer
command! -nargs=0 ORGANIZE :call CocAction('runCommand', 'tsserver.organizeImports')

" Use `:Prettier` command for coc
command! -nargs=0 Prettier :CocCommand prettier.formatFile

" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')

" Pre Save
autocmd BufWritePre *.js :ORGANIZE
autocmd BufWritePre *.ts :ORGANIZE


Emmet cheat sheet

Commenter settings:




$ vi ~/.config/nvim/coc-settings.json
  "javascript.preferences.importModuleSpecifier": "non-relative",
  "javascript.preferences.quoteStyle": "single",
  "typescript.preferences.importModuleSpecifier": "non-relative",
  "typescript.preferences.quoteStyle": "single",
  "suggest.noselect": false,
  "coc.preferences.formatOnSaveFiletypes": [
  "eslint.autoFixOnSave": true

Some issues on start

vim-hexokinase needs updating. Run make hexokinase in project root.

On message in vim console:

vim-hexokinase needs updating. Run make hexokinase in project root. See :h he xokinase-v1-migration for more info.

$ cd ~/.config/nvim/plugged/vim-hexokinase/
$ git pull
$ make hexokinase

$ sudo apt install -y xclip

$ sudo apt install -y python3-pip
$ pip3 install --upgrade neovim

$ npm install -g neovim

Possible can be helpful

[Ben Awad] How to Configure Vim like VSCode [ENG, 2019]


$ vi ~/.config/nvim/init.vim



$ vi ~/.config/nvim/coc-settings.json

[Oleksandr Kocherhin] Neovim configs

$ cd ~/.config/nvim
$ rm -rf *
$ git clone .

$ mkdir autoload && cd autoload
$ curl -o plug.vim

$ mkdir -p ~/.config/nvim/plugged
$ nvim ~/.config/nvim/init.vim


Frontend Masters repo from course about vim

Additional Materials

[Snowfoundry Media] Command Line: Neovim Installation and Configuration [ENG, 2020]