Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while making symbolic links for nvim

Tags:

unix

zsh

So I was making a symbolic links for nvim so that if i use vim command it opens nvim.

So I used this code

ln -s (which nvim) /usr/local/bin/vim

but when i ran the command it showed this error

zsh: unknown file attribute: h

so plz tell me my mistake and solution for that

like image 444
Shiven Sharma Avatar asked Oct 18 '25 17:10

Shiven Sharma


2 Answers

You need to put the path to nvim as the first parameter, i.e.

ln -s =nvim /usr/local/bin/vim

In general, =foo expands to the absolute path of the command foo (by using PATH search).

like image 61
user1934428 Avatar answered Oct 22 '25 01:10

user1934428


You might have both vim and nvim symlink in homebrew. If so, remove the symlink of vim and then re-create it.

brew unlink vim --> it should be showing this message if successfully Unlinking /opt/homebrew/Cellar/vim/9.0.1400... 187 symlinks removed.

Then, add the symlink to vim again: ln -s $(which nvim) /opt/homebrew/bin/vim

like image 37
Duy Nguyen Avatar answered Oct 22 '25 00:10

Duy Nguyen