Skip to content

Commit 72f2155

Browse files
authored
Docs: Various minor improvements (#445)
1 parent aebdaf4 commit 72f2155

File tree

3 files changed

+37
-45
lines changed

3 files changed

+37
-45
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Thank you for taking time to contribute to this plugin! Please follow these step
66

77
It's possible that the feature you want is already implemented, or does not belong in `gitlab.nvim` at all. By creating an issue first you can have a conversation with the maintainers about the functionality first. While this is not strictly necessary, it greatly increases the likelihood that your merge request will be accepted.
88

9-
2. Fork the repository, and create a new feature branch for your desired functionality. Make your changes.
9+
2. Fork the repository, and create a new feature branch off the `develop` branch for your desired functionality. Make your changes.
1010

1111
If you are using Lazy as a plugin manager, the easiest way to work on changes is by setting a specific path for the plugin that points to your repository locally. This is what I do:
1212

README.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,47 +35,48 @@ For more detailed information about the Lua APIs please run `:h gitlab.nvim.api`
3535
With <a href="https://github.com/folke/lazy.nvim">Lazy</a>:
3636

3737
```lua
38-
return {
38+
{
3939
"harrisoncramer/gitlab.nvim",
4040
dependencies = {
4141
"MunifTanjim/nui.nvim",
4242
"nvim-lua/plenary.nvim",
4343
"sindrets/diffview.nvim",
4444
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
45-
"nvim-tree/nvim-web-devicons" -- Recommended but not required. Icons in discussion tree.
45+
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
4646
},
47-
enabled = true,
4847
build = function () require("gitlab.server").build(true) end, -- Builds the Go binary
4948
config = function()
5049
require("gitlab").setup()
5150
end,
5251
}
5352
```
5453

55-
And with Packer:
54+
And with <a href="https://github.com/lewis6991/pckr.nvim">pckr.nvim</a>:
5655

5756
```lua
58-
use {
59-
"harrisoncramer/gitlab.nvim",
60-
requires = {
61-
"MunifTanjim/nui.nvim",
62-
"nvim-lua/plenary.nvim",
63-
"sindrets/diffview.nvim"
64-
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
65-
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
66-
},
67-
build = function()
68-
require("gitlab.server").build()
69-
end,
70-
branch = "develop",
71-
config = function()
72-
require("diffview") -- We require some global state from diffview
73-
local gitlab = require("gitlab")
74-
gitlab.setup()
75-
end,
76-
}
57+
{
58+
"harrisoncramer/gitlab.nvim",
59+
requires = {
60+
"MunifTanjim/nui.nvim",
61+
"nvim-lua/plenary.nvim",
62+
"sindrets/diffview.nvim",
63+
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
64+
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
65+
},
66+
run = function() require("gitlab.server").build() end, -- Builds the Go binary
67+
config = function()
68+
require("diffview") -- We require some global state from diffview
69+
require("gitlab").setup()
70+
end,
71+
}
7772
```
7873

74+
Add `branch = "develop",` to your configuration if you want to use the (possibly unstable) development version of `gitlab.nvim`.
75+
76+
## Contributing
77+
78+
Contributions to the plugin are welcome. Please read [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md) before you start working on a pull request.
79+
7980
## Connecting to Gitlab
8081

8182
This plugin requires an <a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token">auth token</a> to connect to Gitlab. The token can be set in the root directory of the project in a `.gitlab.nvim` environment file, or can be set via a shell environment variable called `GITLAB_TOKEN` instead. If both are present, the `.gitlab.nvim` file will take precedence.
@@ -121,7 +122,3 @@ For a list of all these settings please run `:h gitlab.nvim.configuring-the-plug
121122
The plugin sets up a number of useful keybindings in the special buffers it creates, and some global keybindings as well. Refer to the relevant section of the manual `:h gitlab.nvim.keybindings` for more details.
122123

123124
For more information about each of these commands, and about the APIs in general, run `:h gitlab.nvim.api`
124-
125-
## Contributing
126-
127-
Contributions to the plugin are welcome. Please read [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md) before you start working on a pull request.

doc/gitlab.nvim.txt

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,24 @@ INSTALLATION *gitlab.nvim.installation*
5959

6060
With Lazy:
6161
>lua
62-
return {
62+
{
6363
"harrisoncramer/gitlab.nvim",
6464
dependencies = {
6565
"MunifTanjim/nui.nvim",
6666
"nvim-lua/plenary.nvim",
6767
"sindrets/diffview.nvim",
6868
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
69-
"nvim-tree/nvim-web-devicons" -- Recommended but not required. Icons in discussion tree.
69+
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
7070
},
71-
enabled = true,
7271
build = function () require("gitlab.server").build(true) end, -- Builds the Go binary
7372
config = function()
7473
require("gitlab").setup()
7574
end,
7675
}
7776
<
78-
And with Packer:
77+
And with pckr.nvim:
7978
>lua
80-
use {
79+
{
8180
"harrisoncramer/gitlab.nvim",
8281
requires = {
8382
"MunifTanjim/nui.nvim",
@@ -86,14 +85,10 @@ And with Packer:
8685
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
8786
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
8887
},
89-
build = function()
90-
require("gitlab.server").build()
91-
end,
92-
branch = "develop",
88+
run = function() require("gitlab.server").build() end, -- Builds the Go binary
9389
config = function()
9490
require("diffview") -- We require some global state from diffview
95-
local gitlab = require("gitlab")
96-
gitlab.setup()
91+
require("gitlab").setup()
9792
end,
9893
}
9994
<
@@ -200,7 +195,7 @@ you call this function with no values the defaults will be used:
200195
next_field = "<Tab>", -- Cycle to the next field. Accepts |count|.
201196
prev_field = "<S-Tab>", -- Cycle to the previous field. Accepts |count|.
202197
perform_action = "ZZ", -- Once in normal mode, does action (like saving comment or applying description edit, etc)
203-
perform_linewise_action = "ZA", -- Once in normal mode, does the linewise action (see logs for this job, etc)
198+
perform_linewise_action, = "ZA", -- Once in normal mode, does the linewise action (see logs for this job, etc)
204199
discard_changes = "ZQ", -- Quit the popup discarding changes, the popup content is not saved to the `temp_registers` (see `:h gitlab.nvim.temp-registers`)
205200
},
206201
discussion_tree = {
@@ -254,14 +249,14 @@ you call this function with no values the defaults will be used:
254249
discussion_tree = { -- The discussion tree that holds all comments
255250
expanders = { -- Discussion tree icons
256251
expanded = " ", -- Icon for expanded discussion thread
257-
collapsed = " ", -- Icon for collapsed discussion thread
252+
collapsed = " ", -- Icon for collapsed discussion thread
258253
indentation = " ", -- Indentation Icon
259254
},
260255
spinner_chars = { "/", "|", "\\", "-" }, -- Characters for the refresh animation
261256
auto_open = true, -- Automatically open when the reviewer is opened
262-
default_view = "discussions" -- Show "discussions" or "notes" by default
257+
default_view = "discussions", -- Show "discussions" or "notes" by default
263258
blacklist = {}, -- List of usernames to remove from tree (bots, CI, etc)
264-
sort_by = "latest_reply" -- Sort discussion tree by the "latest_reply", or by "original_comment", see `:h gitlab.nvim.toggle_sort_method`
259+
sort_by = "latest_reply", -- Sort discussion tree by the "latest_reply", or by "original_comment", see `:h gitlab.nvim.toggle_sort_method`
265260
keep_current_open = false, -- If true, current discussion stays open even if it should otherwise be closed when toggling
266261
position = "bottom", -- "top", "right", "bottom" or "left"
267262
size = "20%", -- Size of split
@@ -272,7 +267,7 @@ you call this function with no values the defaults will be used:
272267
draft = "✎", -- Symbol to show next to draft comments/notes
273268
tree_type = "simple", -- Type of discussion tree - "simple" means just list of discussions, "by_file_name" means file tree with discussions under file
274269
draft_mode = false, -- Whether comments are posted as drafts as part of a review
275-
winbar = nil -- Custom function to return winbar title, should return a string. Provided with WinbarTable (defined in annotations.lua)
270+
winbar = nil, -- Custom function to return winbar title, should return a string. Provided with WinbarTable (defined in annotations.lua)
276271
-- If using lualine, please add "gitlab" to disabled file types, otherwise you will not see the winbar.
277272
},
278273
emojis = {
@@ -339,7 +334,7 @@ you call this function with no values the defaults will be used:
339334
squash = false, -- Whether the commits will be marked for squashing
340335
fork = {
341336
enabled = false, -- If making an MR from a fork
342-
forked_project_id = nil -- The ID of the project you are merging into. If nil, will be prompted.
337+
forked_project_id = nil, -- The ID of the project you are merging into. If nil, will be prompted.
343338
},
344339
title_input = { -- Default settings for MR title input window
345340
width = 40,

0 commit comments

Comments
 (0)