77 sao GitHub và vẫn tăng — dandavison/open-in-editor là dự án Python mà TopGit đang theo dõi trên nền tảng. Open a local file from a URL at a line number in an editor/IDE
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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]].
dandavison/open-in-editor có 77 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/dandavison/open-in-editor. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
dandavison/open-in-editor có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho dandavison/open-in-editor. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
dandavison/open-in-editor còn đang phát triển không?
Commit gần nhất trên dandavison/open-in-editor là 3.4 năm trước (theo timestamp GitHub). Repo có 11 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
dandavison/open-in-editor là gì?
dandavison/open-in-editor (dandavison/open-in-editor) là dự án Python trên GitHub. Theo mô tả gốc: Open a local file from a URL at a line number in an editor/IDE
dandavison/open-in-editor viết bằng ngôn ngữ gì?
dandavison/open-in-editor chủ yếu viết bằng Python. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về open-in-editor?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về open-in-editor.