Bash script to set Visual Studio Code as default editor for tig
. It works on arbitrary terminal, including vscode's integrated terminal.
If you use tig
in a remote ssh session, I would recommend using it with this code-connect, which can help you opening files in locally running vscode instance from arbitrary terminal connections.
- tig >= 2.5.4
You may need to build tig
from source because the required version is relatively new. Please follow the installation instruction on how to build and install tig
.
gnome-terminal.mp4
vscode-terminal.mp4
- Download the vscode-for-tig and put it into your
$PATH
. - Edit your
~/.bashrc
or~/.zshrc
and addexport TIG_EDITOR=vscode-for-tig
If you're using oh-my-zsh:
-
Clones the repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)git clone https://github.com/qq88976321/vscode-for-tig $ZSH_CUSTOM/plugins/vscode-for-tig
-
Add
vscode-for-tig
to the plugins array in your.zshrc
fileplugins=(... vscode-for-tig)
core.editor
The editor command. Can be overridden by setting TIG_EDITOR or GIT_EDITOR.
editor-line-number (bool)
Whether to pass the selected line number to the editor command. The line number is passed as +<line-number> in front of the file name. Example: vim +10 tig.c