DEV Community

loading...

Write github reviews comments from vim

mafflerbach
・1 min read

Critiq is a neovim plugin to review github pull requests.

To setup Critic you have to set environment variables in your shell.
Be aware - if you want to use it in a corporate field, you access token should authorized the sso from your organization.

Usually you are doing it in exporting this in you shell rc file.
In my case it is the ~/.zshrc in bash it is in the ~/.bashrc

export GH_PASS="Your github token generated [here](https://github.com/settings/tokens)"
export GH_USER="YourGithubUsername"
Enter fullscreen mode Exit fullscreen mode

With :Critiq you get an separated buffer with all the open pull requests.

With enter, you will open the diff which belongs to the pr.
With :CritiqCommentLine you can right away commenting on the line. It will open a separated split buffer. With :CritiqSubmitComment
it will post your comment on github.

In the case that you are satisfied with the PR, you can also use CritiqApprove to approve the request.

Sadly this extension is not touched for a long time. It will still do the work, but occasionally you will facing some error, if you want to open a pr. But in general you are able to work with that extension.

This are the main feature in my opinion.

But there are a lot more possibilities if we take a look on the Commands:

:CritiqApprove
:CritiqBrowsePr
:CritiqCheckout
:CritiqComment
:CritiqCommentLine
:CritiqDeleteBranch
:CritiqEditLabels
:CritiqListComments
:CritiqListCommits
:CritiqLoadMorePrs
:CritiqMerge
:CritiqOpenFile
:CritiqOpenPr
:CritiqPull
:CritiqRequestChanges
:CritiqSubmitComment
:CritiqSubmitReview
:CritiqToggleLabel
Enter fullscreen mode Exit fullscreen mode

I will try to adapt my workflow and figuring out if this will feel comfortable, but it looks promising.

Discussion (3)

Collapse
evilcel3ri profile image
chris

Hi! The link to critiq doesn't work :(

Collapse
mafflerbach profile image
mafflerbach Author

Here is a fork of it github.com/AGhost-7/critiq.vim

Collapse
evilcel3ri profile image
chris

Thanks!