Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Neovim path to .config

Tags:

ubuntu

neovim

I just started with this from Neovim and Ubuntu and I don't know why when I install Neovim it is not in .config.

Executing the command which nvim in the terminal tells me that it is in /usr/bin/nvim. In order to add the configuration I need it to be in .config.

like image 781
PACO PEPE Avatar asked Apr 07 '26 08:04

PACO PEPE


2 Answers

General answer

As @iokanuon mentioned, neovim (and many other applications) doesn't touch your ~/.config/ directory per default. You just need to create the nvim directory with

mkdir -p ~/.config/nvim

and create the ~/.config/nvim/init.vim file like that:

echo "echo 'Created init.vim successfully!'" > ~/.config/nvim/init.vim

(or just simply touch ~/.config/nvim/init.vim).

vim-plug

You can give vim-plug the path where you want to store the plugins as mentioned in the README.md file:

" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" ...
call plug#end()

So in this case, all plugins are stored in the ~/.vim/plugged directory. You can adapt it to your needs!

like image 50
TornaxO7 Avatar answered Apr 08 '26 21:04

TornaxO7


If you install nvim via your package manager, the nvim executable file will be placed in somewhere like /usr/bin/nvim or /usr/local/bin/nvim based on your system.

The nvim configuration file is named init.vim, and it should be put under directory $HOME/.config/nvim/. If this directory does not exist, just create it yourself.

mkdir $HOME/.config/nvim
mv init.vim $HOME/.config/nvim
like image 26
jdhao Avatar answered Apr 08 '26 22:04

jdhao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!