You are not logged in.
So in order to have vim replace vi with vim globally (ie. for when I'm using sudo vi) I did the following:
mv /usr/bin/vi /usr/bin/vi.old
ln -s /usr/bin/vim /usr/bin/vi
And similarly with the rename command:
mv /usr/bin/rename /usr/bin/rename.old
ln -s /usr/bin/file-rename /usr/bin/rename
This was broken by an update to core-utils, and I was wondering if there's any way around this? I don't want to stop updating, and obviously it's not a huge issue to run those four commands again, but just wanted to know if there's anything I can do to either automate these commands after an update to core-utils, or stop the binary being replaced?
Last edited by billodwyer (2017-03-08 16:51:34)
Offline
Put the symlink in /usr/local/bin
Offline
There is also vi-vim-symlink in the AUR, which replaces core/vi
Out of interest though, why are you doing "sudo vi" if you mean "sudo vim"? Habit? Or do you want vim to behave like vi?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
@arojas! Oh my God, I'm a moron. Thank you!
@WorMzy It's mostly just force of habit at this point, when I was using Ubuntu sudo vi didn't behave like vanilla vi does (it was close to, but not exactly vim), and I got used to it. Pretty lazy at this point I know, but I'm set in my ways
Offline
Offline
Why not just use aliases, that's what I do.
$ alias ll='ls -l'
$ ll
total 48K
drwxr-xr-x 38 ayekat ayekat 4.0K 2017-03-07 22:57 dev
drwxr-xr-x 8 ayekat ayekat 4.0K 2017-03-01 08:46 media
drwxr-xr-x 5 ayekat ayekat 4.0K 2016-07-29 19:32 nodes
drwxr-xr-x 13 ayekat ayekat 4.0K 2016-11-28 09:27 rl
drwxr-xr-x 5 ayekat ayekat 24K 2017-03-08 00:09 tmp
$ sudo ll
[sudo] password for ayekat:
sudo: ll: command not found
Offline
I have roots ~/.bash_aliases symlinked to my own users so the above works in my case.
Last edited by Slithery (2017-03-08 20:22:22)
Offline
I have roots ~/.bash_aliases symlinked to my own users so the above works in my case.
Although... we are talking about putting stuff into /usr/local to work around one user not wanting to adapt and type `sudo vim` instead of `sudo vi`, so I guess this is about a single-user setup anyway.
For general (multi-user) setups, the cleanest approach would probably be a user-specific directory (e.g. ~/.local/bin) added to `$PATH`, and putting the symlink in there. Works with sudo, too. And has the nice benefit of only affecting your own user.
Offline
In a similar case, I have replaced /bin/sh with a symlink to dash.
I ensure it survives updates to bash, using a pacman hook as I documented on the ArchWiki dash page.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline