Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 2.39 KB

readme.md

File metadata and controls

86 lines (60 loc) · 2.39 KB

PivotalTracker logo

Made to help you reference Pivotal Tracker issues in your git commit messages.

Demonstration

Demonstration

Installation

Plug 'jonsmithers/pivotal-tracker-fzf.vim'
Plug 'junegunn/fzf' " mandatory dependency

Usage

Make sure the following environment variables are defined:

variable source
$PIVOTAL_TRACKER_PROJECT_ID Can be obtained from project url
$PIVOTAL_TRACKER_TOKEN Can be obtained from user profile

Then, while in insert mode, press Ctrl-X Ctrl-I to open the fzf prompt, and make your selection.

Customization

Filtering

You can customize which stories are displayed using the query syntax described in Pivotal Tracker's advanced search docs:

let g:pivotaltracker.filter = 'state:started has:owner -label:"rebel scum"'

Formatting

The following variables can be changed to configure how issue ids are formatted:

let g:pivotaltracker.delimiter   = ','
let g:pivotaltracker.prefix      = '['
let g:pivotaltracker.suffix      = ']'
let g:pivotaltracker.prefix_each = '#'
let g:pivotaltracker.suffix_each = ''

Mappings

The default mapping is Ctrl-X Ctrl-I (from insert mode), but you can map a custom keybinding to <Plug>pivotaltracker-insert-ids:

nmap    <Leader>p <Plug>pivotaltracker-insert-ids
iabbrev @P        <Plug>pivotaltracker-insert-ids

Environment Variables 101

You can set environment variables from within vim:

:let $PIVOTAL_TRACKER_PROJECT_ID='...'
:let $PIVOTAL_TRACKER_TOKEN='...'

Or you can set them from the terminal:

export PIVOTAL_TRACKER_TOKEN=<token>
export PIVOTAL_TRACKER_PROJECT_ID=<id>
vim
PIVOTAL_TRACKER_TOKEN=<token> PIVOTAL_TRACKER_PROJECT_ID=<id> vim

Or you can set them automatically with a handy tool such as direnv or vim-dotenv.