Skip to content

Instantly share code, notes, and snippets.

@josefaidt
Created February 26, 2019 20:21
Show Gist options
  • Save josefaidt/b106c1cdc230ffcd05693a2b8f9bda7e to your computer and use it in GitHub Desktop.
Save josefaidt/b106c1cdc230ffcd05693a2b8f9bda7e to your computer and use it in GitHub Desktop.
Ranger command: Open in VSCode
from ranger.api.commands import Command
class code(Command):
"""
:code
Opens current directory in VSCode
"""
def execute(self):
dirname = self.fm.thisdir.path
codecmd = ["code", dirname]
self.fm.execute_command(codecmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment