Open mistercanderson opened 1 year ago
I would love to have a copy path on click too
Would be great to have this feature 👍
If not, has somebody looked into either forking this extension or hijacking the vscode url scheme and/or using https://github.com/dandavison/open-in-editor to open the file in Vim?
I think I got it working with a bit of fiddling.
vim-open://${projectPath}${filePath}:${line}
vim-open.sh
Executable and in bin
/ on PATH
.
#!/usr/bin/env bash
if [[ "$1" == "vim-open:"* ]]; then
ref=${1#vim-open://}
file=""${ref%:*}
line=${ref#*:}
st -e vim +$line $file
fi
Create a script to open a terminal, open vim with the current file and line. I'm using st
but it can be changed to adapted or changed to copying something in the clipboard, if you prefer.
vim-open.desktop
Create a file in e.g. ~/.local/share/applications
.
[Desktop Entry]
Type=Application
Name=VimOpen
GenericName=Open File in Vim
Icon=text-editor
Exec=vim-open.sh %u
Categories=Utility;Core;
MimeType=x-scheme-handler/vim-open
Terminal=true
xdg-mime default vim-open.desktop x-scheme-handler/vim-open
To me it's not a viable solution, I would love to have an universal option like copy to the clipboard path to be able to use any editor. But thanks for the workaround
Update
I think I got it working with a bit of fiddling.
LocatorJS
vim-open://${projectPath}${filePath}:${line}
vim-open.sh
Executable and in
bin
/ onPATH
.#!/usr/bin/env bash if [[ "$1" == "vim-open:"* ]]; then ref=${1#vim-open://} file=""${ref%:*} line=${ref#*:} st -e vim +$line $file fi
Create a script to open a terminal, open vim with the current file and line. I'm using
st
but it can be changed to adapted or changed to copying something in the clipboard, if you prefer.
vim-open.desktop
Create a file in e.g.
~/.local/share/applications
.[Desktop Entry] Type=Application Name=VimOpen GenericName=Open File in Vim Icon=text-editor Exec=vim-open.sh %u Categories=Utility;Core; MimeType=x-scheme-handler/vim-open Terminal=true
Register URL scheme
xdg-mime default vim-open.desktop x-scheme-handler/vim-open
Any news on this? Would be a really appreciated feature.
Is your feature request related to a problem? Please describe.
I can't use the "click to component" feature with neovim as my primary editor since the default click behavior is set to open links, it would be nice to have an alternative option to copy the link path to the clipboard on click.
I found that by setting up a custom path of
e +${line} ${filePath}
in the project settings, I can copy the link preview in the bottom of the settings popup and enter it as a vim command that takes me to the correct location/line of the component being inspected. However, it's difficult to use because with the preview settings open, the "link preview" result changes to the last hovered item.Describe the solution you'd like to see
It would be great to have an alternative option to copy the link path on click instead of the default behavior to open a link. I would specifically not want anything open on click when this option is selected.
Desribe alternate solutions
I've tried adjusting different configurations of the custom path to try and automatically open the file through my terminal and neovim, but nothing I've tried has worked.
Additional information
Using Neovim 0.8.0 and Chrome 107.0.5304.110