n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
94 stars 12 forks source link

Feature request - Add function or command for setting the selected issue #39

Closed jestinjht closed 3 years ago

jestinjht commented 4 years ago

There's a function for getting the selected issue, but not one for setting it. This would be helpful for writing commands and scripts that automatically select the issue based on other criteria. For example, my current team has the policy of naming our git feature branches the Jira issue number. It would be very useful to set the issue based on my git branch name every time I open my editor.

n0v1c3 commented 4 years ago

I think this is easily agreed with. Make more ways for the vim power users to use it as their own tool.

We have one issue related but it is simply to start making a list of useful external calls this is now at the top.

I have also started thinking we want many outputs from Vira as I do not want to write or remember anything. Versions are on my list as well as I like them on my master branch.

n0v1c3 commented 3 years ago

@jestinjht Just to update you. I have not forgotten about you. A random ability arrived from our code to set the current issue through the g:vira_active_issue can be used in most case to set the issue from and outside source.

Example for connect to Current Git Branch

:let g:vira_active_issue = execute("Git branch --show-current > echo") 

I have not directly added it to the code as this will be potentially unique for each user although, I will update the README with it.

n0v1c3 commented 3 years ago

@jestinjht I added this function for myself and to the README (will make it to master shortly).

function! s:Vira_GitActiveIssue()
    let g:vira_active_issue = execute("Git branch --show-current > echo")
    ViraReport
endfunction

nnoremap <silent> <leader>vgi :call Vira_GitActiveIssue()<cr>