On GitHub, dandavison/open-in-editor has picked up 77 stars, Python. Open a local file from a URL at a line number in an editor/IDE
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Open a local file from a URL at a line number in an editor/IDE.
The idea is that you would register this application as a handler for certain URLs in your system.
--
Please note that VSCode, IntelliJ, and Pycharm all install their own URL handlers for opening files: use these instead of this project! They open the files much more quickly and avoid all the hassle of configuring this project. For VSCode see docs, but the TL;DR is:
The URL must be structured like a file URL, but it may optionally have a :<line>:<column> suffix. If the line is present, the editor will open the file at that line. (Column is currently only implemented for vim.)
The URL scheme (protocol) is ignored. For example, you could use standard file:// URLs, or you could use a custom URL scheme that only exists in your system. In either case, you must register open-in-editor (or the provided MacOS application) with your OS as the handler for that URL scheme.
Examples
# Using the standard "file://" scheme
open-in-editor 'file:///a/b/myfile.txt'
open-in-editor 'file:///a/b/myfile.txt:7'
open-in-editor 'file:///a/b/myfile.txt:7:77'
open-in-editor 'file://localhost/a/b/myfile.txt:7:77'
# Example of a custom URL scheme:
open-in-editor 'file-line-column:///a/b/myfile.txt'
open-in-editor 'file-line-column:///a/b/myfile.txt:7:77'
Installation
Download the open-in-editor file from this repo and make it executable.
Ensure that one of the environment variables OPEN_IN_EDITOR or EDITOR contains a path to an executable that open-in-editor is going to recognize. This environment variable must be set system-wide, not just in your shell process. For example, in MacOS, one does this with launchctl setenv EDITOR /path/to/my/editor/executable.
open-in-editor looks for any of the following substrings in the path: emacsclient (emacs), subl (sublime), charm (pycharm), vim (vim) or o (o). For example, any of the following values would work:
If your editor/IDE isn't supported, then please open an issue. If your editor/IDE is supported, but the above logic needs to be made more sophisticated, then either (a) open an issue, or (b) create a symlink that complies with the above rules.
Next, you need to register open-in-editor with your OS to act as the handler for the URL schemes you are going to use:
MacOS
For MacOS, an application bundle OpenInEditor.app is provided.
Use duti (brew install duti) to register the MacOS application (org.dandavison.OpenInEditor) as the handler for the URL schemes you want it to handle. For example, to make open-in-editor handle URLs of the form file-line-column:///a/b/myfile.txt:7:77, you would do:
On a system that complies with the XDG shared MIME-info DB specification, you can follow the steps below. This should apply to the majority of current GNU/Linux installations - if you're unsure, run type -P xdg-mime and check that it returns a file path.
Create the directory ~/.local/share/applications/, if it doesn't exist already.
Create the file ~/.local/share/applications/augmented-open.desktop and add the following contents to it:
[Desktop Entry]
Type=Application
Name=AugmentedOpen
GenericName=Open a file at a certain position
Comment=Opens URLs of the type file-line-column://<path>[:<line>[:<column>]] in the configured editor and positions the cursor
Icon=text-editor
Exec=open-in-editor %U
Categories=Utility;Core;
StartupNotify=false
MimeType=x-scheme-handler/file-line-column
This registers the augmented-open.desktop handler as the default handler for URLs using the file-line-column:// protocol.
The string used for the URL protocol is up to you: if you want to use open-in-editor to handle file:// URLs, then replace file-line-column with file in the above instructions.
If you want to register the URL handler system-wide (i.e. for every user) then create the file at /usr/local/... instead of ~/.local/.... You will need to use sudo to perform the commands since they will need root permissions.
Remember to define the EDITOR or OPEN_IN_EDITOR environment variable, if you haven't already done so.
You can now use these URLs by clicking on them in applications just like you would with a web link. From the command line, use xdg-open file[-line-column]://<path>[:line[:column]].
TopGit's last sync did not record any GitHub topics for dandavison/open-in-editor. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on dandavison/open-in-editor?
The most recent commit recorded on dandavison/open-in-editor was 3.4 years ago, based on the GitHub push timestamp. The repository has 11 forks — one of the better signals of community interest.
How many stars does dandavison/open-in-editor have?
dandavison/open-in-editor has 77 GitHub stars — refresh the page for the live number, or check github.com/dandavison/open-in-editor. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What is dandavison/open-in-editor?
dandavison/open-in-editor (dandavison/open-in-editor) is a Python project on GitHub. From the project's own README: Open a local file from a URL at a line number in an editor/IDE
What language is dandavison/open-in-editor written in?
dandavison/open-in-editor is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
Read full README in the tab above.
Is open-in-editor worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of open-in-editor.