How can I make "whereis" automatically open the file on Nvim when it is the only result?

mrbig
2019-10-16T12:08:02Z

EDIT: SOLVED

It looks like it was much simple than I thought and someone solved it on Reddit already. I won't delete, just leave the link if someone is interested.

Runtime Environment

OS: MX Linux 18

Result of Y: 4.19.0-5-amd64

dotfiles

i3 version: 4.13

~/.config/i3

GNU Emacs: 27.0.50

~/.emacs.d

Issue

Sometimes I use "whereis" (aliased for "wh", but it doesn't make any difference...) for my own scripts.

I usually copy their paths manually (using tmux) and paste to the command line resulting in something like this:

nvim /home/my_username/my_scripts_folder/my_script

Could I make that into a single command?

Thanks in advance!

Comments URL: https://tildes.net/~comp/ihz/how_can_i_make_whereis_automatically_open_the_file_on_nvim_when_it_is_the_only_result

Votes: 3

Comments: 5