This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'luigi-fork/feature/module-architecture'…
… into custom-module-architecture # Conflicts: # lua/doom/modules/annotations/binds.lua # lua/doom/modules/annotations/init.lua # lua/doom/modules/annotations/packages.lua # lua/doom/modules/comment/binds.lua # lua/doom/modules/comment/init.lua # lua/doom/modules/comment/packages.lua # lua/doom/modules/lua/config.lua
- Loading branch information
Showing
21 changed files
with
125 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
local binds = { | ||
{ "<leader>c", name = '+code', { | ||
{ 'g', ':lua require("neogen").generate()<CR>', name = 'Generate annotations'} | ||
} }, | ||
{ | ||
"<leader>", | ||
name = "+prefix", | ||
{ | ||
{ | ||
"c", | ||
name = "+code", | ||
{ | ||
{ "g", require("neogen").generate, name = "Generate annotations" }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
return binds |
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
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 |
---|---|---|
@@ -1,7 +1,31 @@ | ||
local binds = { | ||
{ 'gcc', '<CMD>lua require("Comment.api").call("toggle_current_linewise_op")<CR>g@$', name = 'Comment Line' }, | ||
{ 'gc', '<CMD>lua require("Comment.api").call("toggle_linewise_op")<CR>g@', name = 'Comment Motion' }, | ||
{ 'gcA', '<CMD>lua require("Comment.api").insert_linewise_eol(cfg)<CR>', name = 'Comment end of line' }, | ||
{ 'gc', '<ESC><CMD>lua require("Comment.api").toggle_blockwise_op(vim.fn.visualmode())<CR>', name = 'Comment Line (Visual)', mode = 'v' }, | ||
{ | ||
"gc", | ||
[[<cmd>lua require("Comment.api").call("toggle_linewise_op")<CR>g@]], | ||
name = "Comment motion", | ||
}, | ||
{ | ||
"gc", | ||
[[<Esc><cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>]], | ||
name = "Comment line", | ||
mode = "v", | ||
}, | ||
{ | ||
"gb", | ||
[[<Esc><cmd>lua require("Comment.api").toggle_blockwise_op(vim.fn.visualmode())<CR>]], | ||
name = "Comment block", | ||
mode = "v", | ||
}, | ||
{ | ||
"gcc", | ||
[[<cmd>lua require("Comment.api").call("toggle_current_linewise_op")<CR>g@$]], | ||
name = "Comment line", | ||
}, | ||
{ | ||
"gcA", | ||
[[<cmd>lua require("Comment.api").insert_linewise_eol()<CR>]], | ||
name = "Comment end of line", | ||
}, | ||
} | ||
|
||
return binds |
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 |
---|---|---|
@@ -1,57 +1,58 @@ | ||
local comment = {} | ||
|
||
comment.defaults = { | ||
---Add a space b/w comment and the line | ||
---@type boolean | ||
padding = true, | ||
|
||
---Whether the cursor should stay at its position | ||
---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat | ||
---@type boolean | ||
sticky = true, | ||
|
||
---Lines to be ignored while comment/uncomment. | ||
---Could be a regex string or a function that returns a regex string. | ||
---Example: Use '^$' to ignore empty lines | ||
---@type string|fun():string | ||
ignore = nil, | ||
--- Add a space b/w comment and the line | ||
--- @type boolean | ||
padding = true, | ||
|
||
--- Whether the cursor should stay at its position | ||
--- NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat | ||
--- @type boolean | ||
sticky = true, | ||
|
||
--- Lines to be ignored while comment/uncomment. | ||
--- Could be a regex string or a function that returns a regex string. | ||
--- Example: Use '^$' to ignore empty lines | ||
--- @type string|fun():string | ||
ignore = nil, | ||
|
||
--- Passes to ts-context-commentstring to get commentstring in JSX | ||
pre_hook = function(ctx) | ||
-- Only calculate commentstring for tsx filetypes | ||
if vim.bo.filetype == "typescriptreact" then | ||
local comment_utils = require("Comment.utils") | ||
|
||
-- Detemine whether to use linewise or blockwise commentstring | ||
local type = ctx.ctype == comment_utils.ctype.line and "__default" or "__multiline" | ||
|
||
-- Determine the location where to calculate commentstring from | ||
local location = nil | ||
if ctx.ctype == comment_utils.ctype.block then | ||
location = require("ts_context_commentstring.utils").get_cursor_location() | ||
elseif ctx.cmotion == comment_utils.cmotion.v or ctx.cmotion == comment_utils.cmotion.V then | ||
location = require("ts_context_commentstring.utils").get_visual_start_location() | ||
end | ||
|
||
return require("ts_context_commentstring.internal").calculate_commentstring({ | ||
key = type, | ||
location = location, | ||
}) | ||
end | ||
end, | ||
} | ||
|
||
comment.packer_config = {} | ||
comment.packer_config['comment'] = function() | ||
local config = vim.tbl_extend('force', doom.comment, { | ||
comment.packer_config["Comment.nvim"] = function() | ||
local config = vim.tbl_extend("force", doom.comment, { | ||
-- Disable mappings as we'll handle it in binds.lua | ||
mappings = { | ||
basic = false, | ||
extra = false, | ||
extended = false, | ||
}, | ||
-- Passes to ts-context-commentstring to get commentstring in JSX | ||
pre_hook = function(ctx) | ||
-- Only calculate commentstring for tsx filetypes | ||
if vim.bo.filetype == 'typescriptreact' then | ||
local U = require('Comment.utils') | ||
|
||
-- Detemine whether to use linewise or blockwise commentstring | ||
local type = ctx.ctype == U.ctype.line and '__default' or '__multiline' | ||
|
||
-- Determine the location where to calculate commentstring from | ||
local location = nil | ||
if ctx.ctype == U.ctype.block then | ||
location = require('ts_context_commentstring.utils').get_cursor_location() | ||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then | ||
location = require('ts_context_commentstring.utils').get_visual_start_location() | ||
end | ||
|
||
return require('ts_context_commentstring.internal').calculate_commentstring({ | ||
key = type, | ||
location = location, | ||
}) | ||
end | ||
end | ||
}) | ||
|
||
require('Comment').setup(config) | ||
require("Comment").setup(config) | ||
end | ||
|
||
return comment |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
return { | ||
["comment"] = { | ||
["Comment.nvim"] = { | ||
"numToStr/Comment.nvim", | ||
commit = "90df2f87c0b17193d073d1f72cea2e528e5b162d", | ||
module = "Comment", | ||
}, | ||
} |
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
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
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
Oops, something went wrong.