Skip to content

hasit/vscode-gi

Repository files navigation

vscode-icon

gi version gi installs gi ratings

Build Status

gi stands for 'gitignore'. It is an extension for generating .gitignore files from inside Visual Studio Code. gi uses the gitignore.io API to keep the list of operating systems, IDEs and programming languages updated.

Usage of gi

Install

Press Cmd+P for MacOS and Ctrl+P for Linux/Windows to launch VS Code Quick Open, paste the following command, and press enter.

ext install gi

Usage

Once you install and reload Visual Studio Code, you can run the extension by launching the Command Palette with Shift+Cmd+P for MacOS and Shift+Ctrl+P for Linux/Windows. Type in the following into the command palette.

gi

Launch gi from Command Palette

Once you press enter, gi will load a list of operating systems, IDEs, and programming lanuages. This might take a second so bear with it.

List presented by gi

You can search for (yay showQuickPick()!) the operating system, IDE, or programming lanuage you want to generate a .gitignore file for. Even though I would like you (the user) to be able to pick multiple items from the list, it is currenly not supported by vscode namespace API. I have put in a feature request here, but it seems that it has been on the todo list for quite some time now here.

gi will show the result of your actions in two places depending on importance.

  1. InformationMessage - InformationMessage is the toast that slides down and requires an action from you. High level details such as '.gitignore created' are shown here.
  2. StatusBarMessage - Status bar (View -> Toggle Status Bar) is at the bottom of the window. Low level details such as 'You picked node.' are shown here.

At any moment you can press the Escape - <esc> key to stop gi.

Todo

  • Add tests.
  • Add multi-select support to list.

Contributing

This is my very first extension for Visual Studio Code. If you find the code to be bug ridden, with mistakes or just plain old amazing, send in a word. You are welcome to comment/ask questions/post issues/send PRs on the Github page.

Note

gi uses the API exposed by gitignore.io. I made this extension as a learning experience.

I would like to thank Joe Blau for this work on gitignore.io's API and Jason Long for his help with creating the awesome icon used by gi.