Install NeoVim + Vim-Plug (macOS)

Tanin Srivaraphong
1 min readNov 8, 2019

วิธีการลง NeoVim กับ Vim Plugin Manager (vim-plug) แบบจับมือทำ บน Catalina 10.15.1

1. Install NeoVim

อันนี้ลงผ่าน HomeBrew นะ ใครลงไม่เป็นก็ไปอ่าน https://brew.sh

brew install neovim

2. Install vim-plug

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

3. Find configuration file location

คิดว่ามันคือ .vimrc แต่เป็นของ neovim นั่นเอง

เข้าไปที่ nvim จากนั้นก็พิมพ์ :help vimrc ก็จะเจอ manual ข้อความยาวยืด ใจความก็ตัดลงมาสั้นๆ ตามข้างล่างนี้

Unix            ~/.config/nvim/init.vim
Windows ~/AppData/Local/nvim/init.vim

4. Open “init.vim”

คิดไม่ออกก็ใส่ลงไปตามข้างล่างนี้

if &compatible
set nocompatible " Be iMproved
endif
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')
" Solarized Theme
Plug 'altercation/vim-colors-solarized'
" Use release branch (Recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Syntastic is a syntax checking plugin for Vim created by Martin Grenfell
Plug 'scrooloose/syntastic'
" Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support
Plug 'w0rp/ale'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
" Theme Configuration
syntax enable
set background=dark
colorscheme solarized
let g:solarized_termcolors=256

5. Reload configuration

ก็เปิดเข้า nvim เข้าไปใหม่ ไม่ต้องใส่ชื่อไฟล์อะไรก็ได้ แล้วพิมพ์ข้างล่างนี้เพื่อทำการลง Plugin ต่างๆ

:PlugInstall

จบแล้ว

One more thing

https://vimawesome.com — แหล่งรวม Vim plugin ทั้งหลายทั้งมวล

--

--