Skip to content

Instantly share code, notes, and snippets.

@roman-yagodin
Last active July 30, 2021 10:38
Show Gist options
  • Save roman-yagodin/9d4ad8a99d5b7649b66f to your computer and use it in GitHub Desktop.
Save roman-yagodin/9d4ad8a99d5b7649b66f to your computer and use it in GitHub Desktop.
Nemo action to open folder in VSCode (somewhat obsolete)
[Nemo Action]
# https://wiki.archlinux.org/index.php/Nemo
# https://github.com/linuxmint/nemo/blob/master/files/usr/share/nemo/actions/sample.nemo_action
Name=Open in VS Code
Name[ru]=Открыть в VS Code
Comment=Open current folder in Visual Studio Code
Comment[ru]=Открыть текущую папку в Visual Studio Code
Icon-Name=com.visualstudio.code
Selection=none
Extensions=any;
#Quote=double
EscapeSpaces=true
Exec=code %P
Dependencies=code;
[Nemo Action]
# https://wiki.archlinux.org/index.php/Nemo
# https://github.com/linuxmint/nemo/blob/master/files/usr/share/nemo/actions/sample.nemo_action
Name=Open in VS Code
Name[ru]=Открыть в VS Code
Comment=Open selected folder in Visual Studio Code
Comment[ru]=Открыть выбранную папку в Visual Studio Code
Icon-Name=com.visualstudio.code
Selection=s
Extensions=dir;
#Quote=double
EscapeSpaces=true
Exec=code %P/%f
Dependencies=code;
@roman-yagodin
Copy link
Author

roman-yagodin commented Nov 1, 2019

It could be also visual-studio-code or visual-studio-code-insiders for Insiders build right now.

I should also note that where is no real need to have Nemo action to open folder in VSCode now, as it is already a recommended application to open folders:

From the /usr/share/applications/code.desktop:

MimeType=text/plain;inode/directory;

@coppolat1
Copy link

You're right I didn't think of that. Although it is an extra click (or hover) to get to it: Right Click on a folder -> Open With -> Visual Studio Code If you check out my fork, I also added another nemo action so that you can right click in a directory and it will open that directory as a folder in VSCode.

@roman-yagodin
Copy link
Author

roman-yagodin commented Nov 1, 2019

Yes, two actions would be better for this case, than just one - currently there is no way to combine different types of selections in one action, AFAIK.

Updated gist, also simplified Exec lines - looks like /bin/sh part is not necessary now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment