Skip to content

qq88976321/vscode-for-tig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use Visual Studio Code as the tig editor

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.

Requirement

Note

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.

Preface

gnome-terminal.mp4
vscode-terminal.mp4

Installation

Manual

  1. Download the vscode-for-tig and put it into your $PATH.
  2. Edit your ~/.bashrc or ~/.zshrc and add export TIG_EDITOR=vscode-for-tig

Zsh Plugin

oh-my-zsh

If you're using oh-my-zsh:

  1. 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
  2. Add vscode-for-tig to the plugins array in your .zshrc file

    plugins=(... vscode-for-tig)

Reference

tigrc document

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