I'm using neovim on mac os, in case that information is of use.
In the shell I have some aliases such as
alias g='open HTTP://google.com
For sites that I access regularly, I would like to be able to have a similar shortcut available within vim, but I'm not sure how to go about this. I'm on mac os (which is why the command is usually
I have tried:
:! open https://vi.stackexchange.com/
Which does open stack exchange in a new tab (which is good), but it also puts some output into my vim command pallette which is not wanted.
:! open https://vi.stackexchange.com/ [No write since last change] Press ENTER or type command to continue
The above is in the command pallette, which makes me think that there's likely a better approach.
Perhaps the following is the correct approach:
:silent exec "!open https://vi.stackexchange.com/"
The following is an example of something that doesn't work unless it's quoted:
:silent !open https://www.youtube.com/watch?v=XA2WjJbmmoM&feature=youtu.be&t=2578
:silent !open 'https://www.youtube.com/watch?v=XA2WjJbmmoM&feature=youtu.be&t=2578'