-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6176ba
commit d806ff8
Showing
7 changed files
with
182 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
---@type LazyPlugin[] | ||
return { | ||
-- Section: Plugin to create docstrings and annotations for functions, classes, etc. | ||
{ | ||
"danymat/neogen", | ||
event = { "LspAttach" }, -- For some reason, the plugin doesn't work without this event | ||
config = function() | ||
local neogen = require("neogen") | ||
local keymap = KEYMAPS.comments.generate_annotation | ||
|
||
neogen.setup({ | ||
{ | ||
snippet_engine = "luasnip", | ||
languages = { | ||
python = { | ||
template = { | ||
annotation_convention = "google_docstrings", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
KEYMAPS:set(keymap, neogen.generate) | ||
end, | ||
}, | ||
|
||
-- Section: Highlights comments when starting with correct keywards (like `TODO`, `FIXME`, etc.) | ||
{ | ||
"folke/todo-comments.nvim", | ||
event = { "BufRead" }, | ||
dependencies = { "nvim-lua/plenary.nvim" }, | ||
opts = { | ||
keywords = { | ||
FIX = { | ||
icon = " ", -- icon used for the sign, and in search results | ||
color = "error", -- can be a hex color, or a named color (see below) | ||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords | ||
-- signs = false, -- configure signs for some keywords individually | ||
}, | ||
TODO = { icon = " ", color = "info", alt = { "FIXME" } }, | ||
HACK = { icon = " ", color = "warning" }, | ||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, | ||
SECTION = { icon = " ", alt = { "SEC", "Section" } }, | ||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, | ||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, | ||
}, | ||
}, | ||
}, | ||
-- Section: Comment plugin, support for treesitter, dot-repeats, left-right-up-down motions and hooks. | ||
{ | ||
"numToStr/Comment.nvim", | ||
event = { "BufRead" }, | ||
config = function() | ||
local keys = KEYMAPS.comments | ||
|
||
require("Comment").setup( | ||
---@type CommentConfig | ||
{ | ||
mappings = { | ||
-- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` | ||
basic = true, | ||
|
||
-- Extra mapping; `gco`, `gcO`, `gcA` | ||
extra = true, | ||
}, | ||
|
||
toggler = { | ||
line = keys.toggle_comment_line.key, | ||
block = keys.toggle_comment_block.key, | ||
}, | ||
|
||
opleader = { | ||
line = KEYMAPS:key_without_leader(keys.operator_pending_line), | ||
block = KEYMAPS:key_without_leader(keys.operator_pending_block), | ||
}, | ||
|
||
extra = { | ||
above = keys.comment_above.key, | ||
below = keys.comment_below.key, | ||
eol = keys.comment_end_of_line.key, | ||
}, | ||
} | ||
) | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
---@type LazyPlugin[] | ||
return { | ||
-- Section: Plugin overloads h and l to fold/unfold if the cursor is at the start of the line, otherwise it moves the cursor | ||
-- as usual. Very natural, and small plugin. | ||
{ | ||
"chrisgrieser/nvim-origami", | ||
event = { "VeryLazy" }, | ||
opts = {}, -- needed even when using default config | ||
}, | ||
-- Section: Adds some nicer folding capabilities, like folding based on treesitter or indent. | ||
-- Also offers fold all and unfold all commands. | ||
{ | ||
"kevinhwang91/nvim-ufo", | ||
dependencies = { | ||
"kevinhwang91/promise-async", | ||
}, | ||
event = { "LspAttach" }, | ||
config = function() | ||
local ufo = require("ufo") | ||
local keys = KEYMAPS.fold | ||
|
||
ufo.setup({ | ||
provider_selector = function(_, _, _) | ||
return { "treesitter", "indent" } | ||
end, | ||
}) | ||
KEYMAPS:set_many({ | ||
{ keys.open_fold, "zo" }, -- "zo" is default we are "mapping" to | ||
{ keys.close_fold, "zc" }, -- "zc" is default we are "mapping" to | ||
{ keys.open_all_folds, ufo.openAllFolds }, | ||
{ keys.close_all_folds, ufo.closeAllFolds }, | ||
}) | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters