Delete or backup ~/.config/nvim/
, ~/.local/share/nvim/
and ~/.local/state/nvim/
:
# delete
rm -rf ~/.config/nvim/*
rm -rf ~/.local/share/nvim/*
rm -rf ~/.local/state/nvim/*
# backup
mv ~/.config/nvim{,.bak}
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
Paste this nvim
file to ~/.config/
and start nvim
:
# assume nvim exist in current directory
cp ./nvim ~/.config
- Download
We can go to the Nerd Fonts releases page to download the font we want.
For example, we can download Hack
Nerd Font using the following command:
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.0/Hack.zip
- Unzip and Create local fonts directory
Unzip the downloaded fonts archive:
unzip Hack.zip -d Hack
Create local fonts directory
mkdir -p ~/.local/share/fonts
- Move the fonts to the local fonts directory
mv Hack/*.ttf ~/.local/share/fonts
- Update the fonts cache
fc-cache -fv
- Verify Installation
fc-list | grep "Hack"
Telescope live_grep
relies on ripgrep
for searching, we can install it using:
sudo apt-get install ripgrep
Telescope find_files
relies on fd-find
for searching, we can install it using:
sudo apt-get install fd-find
Installing tpm as packages manager:
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
Note that we install it into ~/.config/
, instead default directory ~/.tmux/
.
cp -r ./tmux ~/.config/
In order to yank or paste content in tmux, we musl install xclip first:
sudo apt-get install xclip
Now that, in tmux, we can press prefix + [
to enter copy mode, and press y
to yank something you want. To paste in tmux, press prefix + ]
.
The content we choosed in copy mode will be automatically copy to system clipboard, so we can directly press Ctrl + v
to paste it in another plases.
Instruction for installing zsh is here
Run the following command to install ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
If you are using svn and want to enter diff mode of nvim when executing svn diff
, we can:
# copy the script to /bin
cp ./diff/svn-diff /bin
# grants execute mode to it
chmod +x /bin/svn-diff
# edit you global subversion configure file
nvim ~/.subversion/config
Set the value of key diff-cmd
to svn-diff
:
diff-cmd = svn-diff
Note that you can consult this answer for more information.
# copy the script to /bin
cp ./diff/nvim-diff /bin
# grants execute mode to it
chmod +x /bin/nvim-diff
Using git config
to let git knows this external script:
# by default, when executes `gid diff`, it will enter interactive mode(e.g. it will automatically enter less)
# if you want to print contents from `git diff` to terminal and don't enter interactive mode, you can execute `git --no-pager diff`
# so, we must set pager of git to cat, let `git diff` just print its content to terminal
git config --global pager.diff "cat"
git config --global diff.external /bin/nvim-diff