In windows, we have an option: adding "open with code" action to context menu, this allows us to open any file or folder with vscode, is there any way to add this feature in Ubuntu?
In windows, we have an option: adding "open with code" action to context menu, this allows us to open any file or folder with vscode, is there any way to add this feature in Ubuntu?
Just run this in your terminal and it will add open with VSCode in context menu for Ubuntu 18.04 LTS. Source: Crazy0's GitHub Repository
Edit 1: Works for Ubuntu 20.04 LTS as well.
Edit 2: Works for Ubuntu 20.10 LTS as well.
What you need to do is install Nautilus Actions
and add new action :
Path:
code
Parameters:%B
NOTE ❗ ❗ Modern version of Nautilus Actions (nautilus-actions package in trusty (14.04 LTS), xenial (16.04 LTS), artful (17.10)) are named as FileManager Actions (filemanager-actions package, it is not yet packaged in Debian and Ubuntu - see at repology.org).
NOTE 2 As of Ubuntu 19.04, the package is filemanager-actions.
orginal post askubuntu.com/a/1031746/843203
I was able to find this vscode extension for nautilus written by Crazy0 that lets you do this.
The steps can be found in that github gist, which are:
And do the following (also found in the head section of that gist):
~/.local/share/nautilus-python/extensions/
, restrart Nautilus, and enjoy :)mkdir -p ~/.local/share/nautilus-python/extensions && cp -f VSCodeExtension.py ~/.local/share/nautilus-python/extensions/VSCodeExtension.py && nautilus -q
Just tested on Ubuntu Bionic and it works great.
If you're on 20.10 and you're running this script:
You'll need to install
python3-nautilus
becausepython-nautilus
isn't in non-LTS versions of Ubuntu.Simply install the python3 version of python-nautilus
sudo apt install python3-nautilus
Then restart nautilus (this will close all nautilus folders)
nautilus -q && nautilus &
And it should work should work.
1.Create a file ~/.local/share/nautilus/scripts/open-in-code.sh with this content:
2.Add execution permission to the file:
3.Restart Nautilius.
4.Right-click on a file or directory, you will see this:
Source: https://help.ubuntu.com/community/NautilusScriptsHowto
Just Run this command on your terminal:
Source: itectec.com