topaxi / gh-actions.nvim

See status of workflows and dispatch runs directly in neovim
116 stars 4 forks source link

Feature request: toggle Github Actions split window #12

Closed utensil closed 1 week ago

utensil commented 1 week ago

So far gh-actions.nvim provides command :GhActions and a key mapping <leader>+gh, which is nice. But it seems that I have to focus the split window then :q to close it. Similar plugins will provide a toggle command to turn it on and off, and use the same key mapping.

Is this a desirable feature to implement? 😄

topaxi commented 1 week ago

Seems like this would be a common pattern and desired feature, yes!

I'd be open for a PR which implements this with an explicit vim command.

One of these two ways I'd gladly accept:

In the meantime, if you use lazy, you should be able to implement this in your plugin spec like this:

{
  'topaxi/gh-actions.nvim',
  keys = {
    { '<leader>gh', '<cmd>GhActions<cr>', desc = 'Open Github Actions' },
    { '<leader>gc', function() require('gh-actions').close() end, desc = 'Close Github Actions' },
  },
  opts = {},
},
utensil commented 1 week ago

Ah, nice! I didn't realize how to get the window (i.e. require('gh-actions')) for closing.

I've set this to <leader>gq as gc conflicts with my telescope git commit search, and it seems to work!

topaxi commented 1 week ago

I added subcommands to the GhActions command to toggle/open/close.

See the README for usage.