Neovim

Features

Requirements

Installation (install.sh now is obsolete, and need to update)

  • Download above applications which has "Binary prebuild" tag and put it into tools directory.
  • Create a neovim directory like below.
/path/to/your/
└── dotfiles ($dotfiles)
    ├── install.sh
    ├── config/ ($config)
    │   ├── mason/                  # Storing lSP
    │   │   ├── bin/
    │   │   │   └── pack.tar.bz2             
    │   │   └── packages/
    │   │       ├── pack_1.tar.bz2 
    │   │       ├── pack_2.tar.bz2   
    │   │       └── pack_3.tar.bz2  
    │   ├── nvim/                   # Storing neovim configuration
    │   │   ├── init.lua
    │   │   └── lua/user/*.lua
    │   ├── pack/pack.tar.bz2       # Storing neovim plugins
    │   ├── tmux/pack.tar.bz2       # Storing tmux plugins and configuration
    │   └── zsh/pack.tar.bz2        # Storing zsh plugins and configuration
    └── tools ($tool)
        └── <package>.tar.bz2
  • Run install.sh and wait.
cd /path/to/your/dotfiles
./install.sh
  • If you need to install manually, follow these below instruction.
  • Extract all below compressed files.
# Assume that your neovim path like this: /home/kietpham/dotfiles/
dotfiles=/home/kietpham/dotfiles/
config=$neovim/config
tool=$neovim/tools

# Setup tools
cd $tool
tar -xf <package>.tar.bz2
rm -rf <package>.tar.bz2

# Language Server
cd $config/mason/bin
tar -xf pack.tar.bz2
cd $config/mason/packages
tar -xf pack_1.tar.bz2
tar -xf pack_2.tar.bz2

# After that, you can remove compressed files.
  • Export binary file to $PATH, add these lines to your ~/.bashrc.
# Some SW have src/bin dir, some doesn't have, some even doesn't have a src dir.
export PATH=$TOOLS:$PATH
export PATH=$TOOLS/<softwares>:$PATH
export PATH=$TOOLS/<softwares>/bin:$PATH

# Add neovim --remote to your .bashrc and .zshrc (depend on your favorite shell)
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
    alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe'
fi

if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
    export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'"
    export EDITOR="nvr -cc split --remote-wait +'set bufhidden=wipe'"
else
    export VISUAL="nvim"
    export EDITOR="nvim"
fi
  • At home direcory, do some stuffs.
# Assume that your neovim path like this: /home/kietpham/dotfiles/
# Link your config file to home
cd $home
ln -s /home/kietpham/dotfiles/config/nvim .

# Add pynvim and nvr provider to local lib
mv /home/kietpham/dotfiles/tools/pynvim_package/* $home/.local

# Move tmux packages to home
cd $config
mv tmux/* $home

# Move zsh packages to home
cd $config
mv zsh/* $home
  • Modify path in some lua config file.
-- Assume that your neovim path like this: /home/kietpham/dotfiles/
-- File $home/.config/nvim/init.lua
let g:python3_host_prog = '/home/kietpham/dotfiles/tools/python-3.10.7/bin/python3'
let g:node_host_prog = '/home/kietpham/dotfiles/tools/node-v16.17.1/lib/node_modules/neovim/bin/cli.js'

-- File $home.config/nvim/lua/user/packer.lua
g.nvim_profile_path = "/home/kietpham/dotfiles/config/nvim"

-- File $home.config/nvim/lua/user/mason.lua
install_root_dir = "/home/kietpham/dotfiles/config/mason"

-- File $home/.config/mason/packages/lua-language-server
exec "/home/kietpham/dotfiles/config/mason/packages/..."
  • After installation, run nvim will have some errors.
-- Open a blank workspace
nvim
-- Type below commands
:PackerLoad noice.nvim
:UpdateRemotePlugins
:PackerCompile