Install Vim for Local User
2019-06-05
A short post showing how to install vim for local user. For my own record
Why do I need to install vim for local user?
Sometimes I ssh to other servers to develop code. The server is shared with many other people. If you update the vim using sudo, other people’s .vimrc may encounter problems. So we install our own version, and keep the environment clean.
Steps
Basically I follow this website: Is it possible to install vim for a user? - StackOverflow.
- Download
vim. Currently the version is 8.1 (the machine version is 7.2).
1
2
git clone https://github.com/vim/vim.git
cd vim/src
- Change the “prefix” in
src/MakeFileto$HOME/.local. - Install
ncurses-develif you haven’t done so. This actually requiressudopermission. Note: the package name varies with the OS distribution, please check this. - In the
srcfolder, runmake. - If no error occurs, run
make install. - You will see
binandshareunder your$HOME/.local/folder. - Add the alias in your
.bashrcor.zshrc.
1
alias vim="$HOME/.local/bin/vim"
Note: I tried to add $HOME/.local/bin to $PATH but failed. The vim is still the old version. The alias works for me.
End
Now there is no “Unknown option: relativenumber” error showing up when I open vim.
- ← Older-Emacs Editable Dired Mode Demo
- Globally Change Footprint Reference Visibility in KiCad-Newer →