Skip to content

Commit

Permalink
refactor: normalize mappings and make them dependent on the plugin th…
Browse files Browse the repository at this point in the history
…at provides the functionality
  • Loading branch information
mehalter committed Nov 23, 2023
1 parent dab4db2 commit 62eb528
Show file tree
Hide file tree
Showing 46 changed files with 740 additions and 913 deletions.
22 changes: 12 additions & 10 deletions lua/astrocommunity/color/ccc-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
return {
{
"AstroNvim/astrocore",
opts = {
mappings = {
["<leader>uC"] = { "<cmd>CccHighlighterToggle<cr>", desc = "Toggle colorizer" },
["<leader>zc"] = { "<cmd>CccConvert<cr>", desc = "Convert color" },
["<leader>zp"] = { "<cmd>CccPick<cr>", desc = "Pick Color" },
},
},
},
{ "NvChad/nvim-colorizer.lua", enabled = false },
{
"uga-rosa/ccc.nvim",
event = { "User AstroFile", "InsertEnter" },
cmd = { "CccPick", "CccConvert", "CccHighlighterEnable", "CccHighlighterDisable", "CccHighlighterToggle" },
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
["<Leader>uC"] = { "<CMD>CccHighlighterToggle<CR>", desc = "Toggle colorizer" },
["<Leader>zc"] = { "<CMD>CccConvert<CR>", desc = "Convert color" },
["<Leader>zp"] = { "<CMD>CccPick<CR>", desc = "Pick Color" },
},
},
},
},
opts = {
highlighter = {
auto_enable = true,
Expand Down
93 changes: 46 additions & 47 deletions lua/astrocommunity/color/transparent-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
local prefix = "<leader>u"
return {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
[prefix .. "T"] = { desc = "Toggle transparency" },
"xiyaowong/transparent.nvim",
lazy = false,
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>uT"] = { desc = "Toggle transparency" },
},
},
},
},
},
{
"xiyaowong/transparent.nvim",
lazy = false,
opts = {
-- table: default groups
groups = {
"Normal",
"NormalNC",
"Comment",
"Constant",
"Special",
"Identifier",
"Statement",
"PreProc",
"Type",
"Underlined",
"Todo",
"String",
"Function",
"Conditional",
"Repeat",
"Operator",
"Structure",
"LineNr",
"NonText",
"SignColumn",
"CursorLineNr",
"CursorLine",
"EndOfBuffer",
},
-- table: additional groups that should be cleared
extra_groups = {
"NormalFloat",
"NvimTreeNormal",
"NeoTreeNormal",
"NeoTreeFloatBorder",
"NeoTreeNormalNC",
},
-- table: groups you don't want to clear
exclude_groups = {},
opts = {
-- table: default groups
groups = {
"Normal",
"NormalNC",
"Comment",
"Constant",
"Special",
"Identifier",
"Statement",
"PreProc",
"Type",
"Underlined",
"Todo",
"String",
"Function",
"Conditional",
"Repeat",
"Operator",
"Structure",
"LineNr",
"NonText",
"SignColumn",
"CursorLineNr",
"CursorLine",
"EndOfBuffer",
},
-- table: additional groups that should be cleared
extra_groups = {
"NormalFloat",
"NvimTreeNormal",
"NeoTreeNormal",
"NeoTreeFloatBorder",
"NeoTreeNormalNC",
},
-- table: groups you don't want to clear
exclude_groups = {},
},
}
24 changes: 12 additions & 12 deletions lua/astrocommunity/color/twilight-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
return {
{
"Astronvim/astrocore",
opts = {
mappings = {
["<leader>uT"] = { "<cmd>Twilight<cr>", desc = "Toggle Twilight" },
"folke/twilight.nvim",
dependencies = {
{
"Astronvim/astrocore",
opts = {
mappings = {
["<Leader>uT"] = { "<CMD>Twilight<CR>", desc = "Toggle Twilight" },
},
},
},
},
{
"folke/twilight.nvim",
cmd = {
"Twilight",
"TwilightEnable",
"TwilightDisable",
},
cmd = {
"Twilight",
"TwilightEnable",
"TwilightDisable",
},
}
32 changes: 16 additions & 16 deletions lua/astrocommunity/color/vim-highlighter/init.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
return {
{
"AstroNvim/astrocore",
opts = {
mappings = {
{ "f<Enter>", desc = "Highlight" },
{ "f<BS>", desc = "Remove Highlight" },
{ "f<C-L>", desc = "Clear Highlight" },
{ "f<Tab>", desc = "Find Highlight (similar to Telescope grep)" },
{ "nn", "<cmd>Hi><CR>", desc = "Next Recently Set Highlight" },
{ "ng", "<cmd>Hi<<CR>", desc = "Previous Recently Set Highlight" },
{ "n[", "<cmd>Hi{<CR>", desc = "Next Nearest Highlight" },
{ "n]", "<cmd>Hi}<CR>", desc = "Previous Nearest Highlight" },
"azabiong/vim-highlighter",
lazy = false, -- Not Lazy by default
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
{ "f<Enter>", desc = "Highlight" },
{ "f<BS>", desc = "Remove Highlight" },
{ "f<C-L>", desc = "Clear Highlight" },
{ "f<Tab>", desc = "Find Highlight (similar to Telescope grep)" },
{ "nn", "<CMD>Hi><CR>", desc = "Next Recently Set Highlight" },
{ "ng", "<CMD>Hi<<CR>", desc = "Previous Recently Set Highlight" },
{ "n[", "<CMD>Hi{<CR>", desc = "Next Nearest Highlight" },
{ "n]", "<CMD>Hi}<CR>", desc = "Previous Nearest Highlight" },
},
},
},
},
{
"azabiong/vim-highlighter",
lazy = false, -- Not Lazy by default
},
}
2 changes: 1 addition & 1 deletion lua/astrocommunity/completion/codeium-vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Basic setup for codeium

`i` `<C-x>`: clear suggestions

`n` `<leader>;` toggle on/off Codeium
`n` `<Leader>;` toggle on/off Codeium


_Note_: You need to auth first before usage
2 changes: 1 addition & 1 deletion lua/astrocommunity/completion/codeium-vim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ return {
vim.keymap.set("i", "<c-;>", function() return vim.fn["codeium#CycleCompletions"](1) end, { expr = true })
vim.keymap.set("i", "<c-,>", function() return vim.fn["codeium#CycleCompletions"](-1) end, { expr = true })
vim.keymap.set("i", "<c-x>", function() return vim.fn["codeium#Clear"]() end, { expr = true })
vim.keymap.set("n", "<leader>;", function()
vim.keymap.set("n", "<Leader>;", function()
if vim.g.codeium_enabled == true then
vim.cmd "CodeiumDisable"
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ return {
end,
keys = {
{
"<leader>db",
"<Leader>db",
function() require("persistent-breakpoints.api").toggle_breakpoint() end,
{ silent = true },
desc = "Toggle Breakpoint",
},
{
"<leader>dB",
"<Leader>dB",
function() require("persistent-breakpoints.api").clear_all_breakpoints() end,
{ silent = true },
desc = "Clear Breakpoints",
},
{
"<leader>dC",
"<Leader>dC",
function() require("persistent-breakpoints.api").set_conditional_breakpoint() end,
{ silent = true },
desc = "Conditional Breakpoint",
Expand Down
60 changes: 30 additions & 30 deletions lua/astrocommunity/debugging/telescope-dap-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
local prefix = "<leader>fd"
local prefix = "<Leader>fd"

return {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
[prefix .. "c"] = {
"<cmd>lua require('telescope').extensions.dap.commands()<cr>",
desc = "Telescope DAP commands",
},
[prefix .. "f"] = {
"<cmd>lua require('telescope').extensions.dap.frames()<cr>",
desc = "Telescope DAP frames",
},
[prefix .. "g"] = {
"<cmd>lua require('telescope').extensions.dap.configurations()<cr>",
desc = "Telescope DAP configurations",
},
[prefix .. "l"] = {
"<cmd>lua require('telescope').extensions.dap.list_breakpoints()<cr>",
desc = "Telescope DAP list breakpoints",
},
[prefix .. "v"] = {
"<cmd>lua require('telescope').extensions.dap.variables()<cr>",
desc = "Telescope DAP variables",
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-telescope/telescope-dap.nvim",
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
[prefix .. "c"] = {
"<CMD>lua require('telescope').extensions.dap.commands()<CR>",
desc = "Telescope DAP commands",
},
[prefix .. "f"] = {
"<CMD>lua require('telescope').extensions.dap.frames()<CR>",
desc = "Telescope DAP frames",
},
[prefix .. "g"] = {
"<CMD>lua require('telescope').extensions.dap.configurations()<CR>",
desc = "Telescope DAP configurations",
},
[prefix .. "l"] = {
"<CMD>lua require('telescope').extensions.dap.list_breakpoints()<CR>",
desc = "Telescope DAP list breakpoints",
},
[prefix .. "v"] = {
"<CMD>lua require('telescope').extensions.dap.variables()<CR>",
desc = "Telescope DAP variables",
},
},
},
},
},
},
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-telescope/telescope-dap.nvim" },
opts = function() require("telescope").load_extension "dap" end,
},
opts = function() require("telescope").load_extension "dap" end,
}
36 changes: 18 additions & 18 deletions lua/astrocommunity/diagnostics/lsp_lines-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
return {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<leader>uD"] = { function() require("lsp_lines").toggle() end, desc = "Toggle virtual diagnostic lines" },
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>uD"] = { function() require("lsp_lines").toggle() end, desc = "Toggle virtual diagnostic lines" },
},
},
},
},
},
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
opts = {},
config = function(_, opts)
-- disable diagnostic virtual text
local lsp_utils = require "astrolsp"
opts = {},
config = function(_, opts)
-- disable diagnostic virtual text
local lsp_utils = require "astrolsp"

lsp_utils.diagnostics[3].virtual_text = false
vim.diagnostic.config(lsp_utils.diagnostics[vim.g.diagnostics_mode])
require("lsp_lines").setup(opts)
end,
},
lsp_utils.diagnostics[3].virtual_text = false
vim.diagnostic.config(lsp_utils.diagnostics[vim.g.diagnostics_mode])
require("lsp_lines").setup(opts)
end,
}
Loading

0 comments on commit 62eb528

Please sign in to comment.