반응형

Updates: November 6, 2024
Contents: Steps to install vim-plug on Linux including Ubuntu

Set Up Environment for NVim Installation

Before installing plugins, ensure that NVim or Vim is installed on your system.

Install vim-plug

vim-plug is a minimalist Vim plugin manager that supports parallel installation of plugins.

  • For NVim:
    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'
  • For Vim:
    curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Download Result

 

Configure Plugins

After installing vim-plug, configure your plugins by editing the appropriate configuration file.

  • For NVim:
    nvim ~/.config/nvim/init.vim
  • For Vim:
    vim ~/.vimrc

In the configuration file, add the following lines to initialize vim-plug and specify your desired plugins:

" in init.nvim or .vimrc
call plug#begin('~/.vim/plugged')

" List your plugins here
Plug 'tpope/vim-sensible'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }

call plug#end()
 

Install Plugins

After saving the configuration file, install the specified plugins:

  1. Open NVim or Vim.
  2. Run the command:
    :PlugInstall

    This command will download and install all the plugins listed in your configuration file.

Managing Plugins with vim-plug

After installing vim-plug, you can manage your plugins using the following commands:

  • :PlugInstall to install the plugins
  • :PlugUpdate to install or update the plugins
  • :PlugDiff to review the changes from the last update
  • :PlugClean to remove plugins no longer in the list

In WSL or WSL2 on Windows, the plugged folder is located at ~/.local/share/nvim/plugged

 

References

 

GitHub - junegunn/vim-plug: :hibiscus: Minimalist Vim Plugin Manager

:hibiscus: Minimalist Vim Plugin Manager. Contribute to junegunn/vim-plug development by creating an account on GitHub.

github.com

 

반응형

+ Recent posts