Made to help you reference Pivotal Tracker issues in your git commit messages.
Plug 'jonsmithers/pivotal-tracker-fzf.vim'
Plug 'junegunn/fzf' " mandatory dependency
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.
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"'
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 = ''
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
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.