Install Neovim As IDE

Setup neovim in ubuntu/mac

Posted by Wilson on April 3, 2022

Prerequisites

Ubuntu 18.04 Mac

Step 1: Install nvim

ubuntu:
apt-get install software-properties-common
add-apt-repository ppa:neovim-ppa/stable
apt-get update
apt-get --assume-yes install curl
apt-get install neovim

mac:
brew install neovim

image

Step 2: Install Latest Node

ubuntu:
apt-get install npm
mac:
brew install npm
npm install n -g
n latest

Step 3: Clone my nvim config

git clone https://github.com/caiwenhn2008/vimrc.git
mkdir -p ~/.config/nvimc
cd ~/.config/nvim
mkdir snips
ln -s ~/vimrc/init.vim init.vim
ln -s ~/vimrc/coc-settings.json coc-settings.json
ln -s ~/vimrc/coc.vim coc.vim
ln -s ~/vimrc/which_key.vim which_key.vim

Step 4: Install Plug 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.v

install plug image

Step 5: Fzf installation

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
source ~/.bashrc # bash

Step 6: Install fd

ubuntu:
apt-get install cargo
cargo install fd-find
# Add below to profile for respecting cargo build path
export PATH="/root/.cargo/bin:$PATH"

mac: brew install fd

Step 7: Python en(only required for python development)

ubuntu:
apt-get install python3-pip
apt-get install python3-env

pip3 install ipdb pdbpp autopep8 wheel
python3 -m pip install --user --upgrade pynvim

Py-right workflow: https://github.com/fannheyward/coc-pyright
create venv in project: python3 -m venv .venv
source .venv/bin/activate
install modules with pip and work with Pyright
deactivate

Step 8: Profile config

alias vi='nvim'
alias vim='nvim'
export EDITOR=vim
export $EDITOR=vim
alias tn='tmux new -s '
alias ta='tmux a -t '
alias use_proxy='. ~/proxy.sh'
alias vims='vim $(fzf)'
alias lg='lazygit'
export FZF_DEFAULT_OPTS='--ansi --height 40% --layout=reverse --border'
alias sf='find * -type f | fzf > selected'
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
Export PATH="/root/.cargo/bin:$PATH"
source ~/.bashrc

Step 9: Tmux config

https://github.com/gpakosz/.tmux

image

git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local