dandavison/iterm2-dwim là dự án mã nguồn mở trên GitHub với 22 sao, viết chủ yếu bằng Python. iTerm2 click handler
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.
iterm2-dwim is a click handler for iTerm2. The aim is that you
command-click on any file path, relative or absolute, and it opens the
file in your editor. If there was a line number, your editor goes to
that line. So, compiler/linter output, tracebacks, git output, etc.
Currently Emacs, PyCharm, VS Code and Sublime are supported. To choose which
editor to use, see settings.py.
The following path-like patterns are supported. For the ones with line
numbers, the file will be opened at that line.
1. Clone this repo and run ``python setup.py develop``.
2. In ``settings.py``, set the absolute path to the command-line utility
that opens files in youe text editor / IDE. For PyCharm this is
called ``charm``, for Sublime this is called ``subl`` and for Emacs
this is called ``emacsclient``.
3. Find the absolute path to the ``iterm2-dwim`` executable, by running
the command ``which iterm2-dwim``. For example, on my system, this is
``/usr/local/bin/iterm2-dwim``.
4. Open iTerm2 settings, click on "Profiles", select your profile, click
on the "Advanced" tab for that profile, and do two things:
5. In the "Smart Selection" section, click "Edit", click "+" to add a new rule, and enter the
following values in the 3 rule fields:
- Notes: ``Compiler/Linter output``
- Regular Expression: ``(\~?/?([[:letter:][:number:]._-]+/+)+[[:letter:][:number:]._-]+/?)(:.+)``
- Precision: ``Very High``
Now click "Edit Actions", click "+" to add an action, choose "Run
Command" and enter ``/absolute/path/to/iterm2-dwim \1 \3`` as the
"Parameter".
6. In the "Semantic History" section, choose "Run command" and enter
``/absolute/path/to/iterm2-dwim \1 \4``.
7. Make sure you didn't literally enter ``/absolute/path/to/`` anywhere!
The path should be the path from step (3), given by ``which iterm2-dwim``.
8. (Optional, but relative paths won't be resolved without it):
configure your shell prompt so that the current directory is written
to a file named ``/tmp/cwd`` every time the prompt is displayed. For
example, put this line in your ``~/.bashrc``:
.. code:: sh
export PROMPT_COMMAND='echo $PWD > /tmp/cwd'
9. ⌘-click on things!
Your iTerm2 settings should look something like this:
Optional configuration
^^^^^^^^^^^^^^^^^^^^^^
1. To get error message alerts, run ``brew install terminal-notifier``
and check it's working with ``terminal-notifier -message hello``.
**For Emacs users:**
1. Make sure that you are starting the emacs server
in your emacs config file:
.. code:: emacs-lisp
(require 'server)
(unless (server-running-p) (server-start))
Debugging
~~~~~~~~~
This is under development and you will encounter problems initially.
Probably, you'll command click on something and nothing will happen.
You can't use ``ipdb`` to debug it: the python process is started by
iTerm2 and is not attached to your terminal's standard input/output.
Similarly, note that the python process inherits its environment from
the iTerm2 process and thus does not have access to environment
modifications made in your shell config file.
It writes a log: run ``tail -f /tmp/iterm2-dwim.log``.
If nothing happens and nothing is written to the log, another trick is
just to run it from the command line and see the traceback:
::
$ iterm2-dwim /some/file.py 'the text that comes after the file path'
dandavison/iterm2-dwim có 22 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/dandavison/iterm2-dwim. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
dandavison/iterm2-dwim có những chủ đề gì?
GitHub topics của dandavison/iterm2-dwim: "debug", "development-environment", "emacs", "error-messages", "iterm2", "pycharm", "sublime". TopGit xếp repo vào nhóm mã nguồn mở.
dandavison/iterm2-dwim có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho dandavison/iterm2-dwim. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
dandavison/iterm2-dwim còn đang phát triển không?
Commit gần nhất trên dandavison/iterm2-dwim là 6.4 năm trước (theo timestamp GitHub). Repo có 3 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
dandavison/iterm2-dwim viết bằng ngôn ngữ gì?
dandavison/iterm2-dwim 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 thêm về dandavison/iterm2-dwim ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/dandavison/iterm2-dwim là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
iterm2-dwim có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về iterm2-dwim.