Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Neogen, Dial, spectre and neodim #31

Merged
merged 5 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lua/astrocommunity/editing-support/dial-nvim/dial-nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
return {
"monaqa/dial.nvim",
keys = {
{ "<C-a>", function() return require("dial.map").inc_normal() end, expr = true, desc = "Increment" },
{ "<C-x>", function() return require("dial.map").dec_normal() end, expr = true, desc = "Decrement" },
},
config = function()
local augend = require "dial.augend"
require("dial.config").augends:register_group {
default = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
augend.constant.alias.bool,
augend.semver.alias.semver,
},
}
end,
}
21 changes: 21 additions & 0 deletions lua/astrocommunity/editing-support/neogen/neogen.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local prefix = "<leader>a"
return {
"danymat/neogen",
cmd = "Neogen",
opts = {
snippet_engine = "luasnip",
languages = {
lua = { template = { annotation_convention = "ldoc" } },
typescript = { template = { annotation_convention = "tsdoc" } },
typescriptreact = { template = { annotation_convention = "tsdoc" } },
},
},
keys = {
{ prefix, desc = "Annotation" },
{ prefix .. "<cr>", function() require("neogen").generate { type = "current" } end, desc = "Current" },
{ prefix .. "c", function() require("neogen").generate { type = "class" } end, desc = "Class" },
{ prefix .. "f", function() require("neogen").generate { type = "func" } end, desc = "Function" },
{ prefix .. "t", function() require("neogen").generate { type = "type" } end, desc = "Type" },
{ prefix .. "F", function() require("neogen").generate { type = "file" } end, desc = "File" },
},
}
6 changes: 6 additions & 0 deletions lua/astrocommunity/editing-support/treej/treej.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"Wansmer/treesj",
keys = { { "<leader>m", "<CMD>TSJToggle<CR>", desc = "Toggle Treesitter Join" } },
cmd = { "TSJToggle", "TSJSplit", "TSJJoin" },
opts = { use_default_keymaps = false },
}
30 changes: 30 additions & 0 deletions lua/astrocommunity/project/nvim-spectre/nvim-spectre.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local prefix = "<leader>s"
return {
"nvim-pack/nvim-spectre",
cmd = "Spectre",
keys = {
{ prefix, desc = "Search / Replace", mode = { "n", "x" } },
{ prefix .. "s", function() require("spectre").open() end, desc = "Spectre" },
{
prefix .. "w",
mode = "x",
function() require("spectre").open_visual { select_word = true } end,
desc = "Spectre (current word)",
},
{ prefix .. "f", function() require("spectre").open_file_search() end, desc = "Spectre (current file)" },
},

opts = function()
return {
mapping = {
send_to_qf = { map = "q" },
replace_cmd = { map = "c" },
show_option_menu = { map = "o" },
run_current_replace = { map = "C" },
run_replace = { map = "R" },
change_view_mode = { map = "v" },
resume_last_search = { map = "l" },
},
}
end,
}
17 changes: 17 additions & 0 deletions lua/astrocommunity/utility/neodim/neodim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
return {
"zbirenbaum/neodim",
event = "LspAttach",
opts = {
alpha = 0.75,
blend_color = "#000000",
update_in_insert = {
enable = true,
delay = 100,
},
hide = {
virtual_text = true,
signs = true,
underline = true,
},
},
}