nvim: define variables in the narrowest possible scope
This commit is contained in:
parent
e1adca48e0
commit
f6e6a319a5
19 changed files with 290 additions and 268 deletions
|
@ -1,15 +1,16 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Comment
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tpope/vim-commentary",
|
"tpope/vim-commentary",
|
||||||
|
|
||||||
cmd = "Commentary",
|
cmd = "Commentary",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.Comment
|
||||||
{ "gc", "<Plug>Commentary", mode = {"n", "x", "o"}, desc = icon.." Comment in/out" },
|
return {
|
||||||
{ "gcc", "<Plug>CommentaryLine", desc = icon.." Comment in/out line" },
|
-- stylua: ignore start
|
||||||
{ "gcu", "<Plug>Commentary<Plug>Commentary", desc = icon.." Undo comment in/out" },
|
{ "gc", "<Plug>Commentary", mode = {"n", "x", "o"}, desc = icon.." Comment in/out" },
|
||||||
-- stylua: ignore end
|
{ "gcc", "<Plug>CommentaryLine", desc = icon.." Comment in/out line" },
|
||||||
},
|
{ "gcu", "<Plug>Commentary<Plug>Commentary", desc = icon.." Undo comment in/out" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +1,57 @@
|
||||||
---Create a right hand side for `dial` key maps.
|
|
||||||
---@param cmd string: name of a function from `dial.map`.
|
|
||||||
---@param suffix? string: keys to add after `dial`s mapping.
|
|
||||||
---@return function
|
|
||||||
local dial_cmd = function(cmd, suffix)
|
|
||||||
suffix = suffix or ""
|
|
||||||
return function() return require("dial.map")[cmd]() .. suffix end
|
|
||||||
end
|
|
||||||
|
|
||||||
---Make a new augend that cycles over the given elements.
|
|
||||||
---@param elements string[]: the elements to cycle.
|
|
||||||
---@return table: @see `dial.types.Augend`
|
|
||||||
local cyclic_augend = function(elements)
|
|
||||||
return require("dial.augend").constant.new {
|
|
||||||
elements = elements,
|
|
||||||
word = true,
|
|
||||||
cyclic = true,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local weekdays = {
|
|
||||||
"Monday",
|
|
||||||
"Tuesday",
|
|
||||||
"Wednesday",
|
|
||||||
"Thursday",
|
|
||||||
"Friday",
|
|
||||||
"Saturday",
|
|
||||||
"Sunday",
|
|
||||||
}
|
|
||||||
|
|
||||||
local weekdays_short = vim.tbl_map(function(s) return s:sub(1, 3) end, weekdays)
|
|
||||||
|
|
||||||
local ui = require("fschauen.util.icons").ui
|
|
||||||
local inc, dec = ui.Increment, ui.Decrement
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"monaqa/dial.nvim",
|
"monaqa/dial.nvim",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
---Create a right hand side for `dial` key maps.
|
||||||
{ "<c-a>", dial_cmd("inc_normal"), expr = true, desc = inc.." Increment" },
|
---@param cmd string: name of a function from `dial.map`.
|
||||||
{ "<c-x>", dial_cmd("dec_normal"), expr = true, desc = dec.." Decrement" },
|
---@param suffix? string: keys to add after `dial`s mapping.
|
||||||
|
---@return function
|
||||||
|
local dial_cmd = function(cmd, suffix)
|
||||||
|
suffix = suffix or ""
|
||||||
|
return function() return require("dial.map")[cmd]() .. suffix end
|
||||||
|
end
|
||||||
|
|
||||||
{ "<c-a>", dial_cmd("inc_visual", "gv"), expr = true, desc = inc.." Increment", mode = "v" },
|
local icons = require("fschauen.util.icons")
|
||||||
{ "<c-x>", dial_cmd("dec_visual", "gv"), expr = true, desc = dec.." Decrement", mode = "v" },
|
local inc, dec = icons.ui.Increment, icons.ui.Decrement
|
||||||
|
|
||||||
{ "g<c-a>", dial_cmd("inc_gvisual", "gv"), expr = true, desc = inc.." Increment", mode = "v" },
|
return {
|
||||||
{ "g<c-x>", dial_cmd("dec_gvisual", "gv"), expr = true, desc = dec.." Decrement", mode = "v" },
|
-- stylua: ignore start
|
||||||
-- stylua: ignore end
|
{ "<c-a>", dial_cmd("inc_normal"), expr = true, desc = inc.." Increment" },
|
||||||
},
|
{ "<c-x>", dial_cmd("dec_normal"), expr = true, desc = dec.." Decrement" },
|
||||||
|
|
||||||
|
{ "<c-a>", dial_cmd("inc_visual", "gv"), expr = true, desc = inc.." Increment", mode = "v" },
|
||||||
|
{ "<c-x>", dial_cmd("dec_visual", "gv"), expr = true, desc = dec.." Decrement", mode = "v" },
|
||||||
|
|
||||||
|
{ "g<c-a>", dial_cmd("inc_gvisual", "gv"), expr = true, desc = inc.." Increment", mode = "v" },
|
||||||
|
{ "g<c-x>", dial_cmd("dec_gvisual", "gv"), expr = true, desc = dec.." Decrement", mode = "v" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
|
---Make a new augend that cycles over the given elements.
|
||||||
|
---@param elements string[]: the elements to cycle.
|
||||||
|
---@return table: @see `dial.types.Augend`
|
||||||
|
local cycle = function(elements)
|
||||||
|
return require("dial.augend").constant.new {
|
||||||
|
elements = elements,
|
||||||
|
word = true,
|
||||||
|
cyclic = true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local weekdays = {
|
||||||
|
"Monday",
|
||||||
|
"Tuesday",
|
||||||
|
"Wednesday",
|
||||||
|
"Thursday",
|
||||||
|
"Friday",
|
||||||
|
"Saturday",
|
||||||
|
"Sunday",
|
||||||
|
}
|
||||||
|
|
||||||
|
local weekdays_short = vim.tbl_map(function(s) return s:sub(1, 3) end, weekdays)
|
||||||
|
|
||||||
local augend = require("dial.augend")
|
local augend = require("dial.augend")
|
||||||
require("dial.config").augends:register_group {
|
require("dial.config").augends:register_group {
|
||||||
default = {
|
default = {
|
||||||
|
@ -61,8 +63,8 @@ return {
|
||||||
augend.date.alias["%Y-%m-%d"],
|
augend.date.alias["%Y-%m-%d"],
|
||||||
augend.date.alias["%d/%m/%Y"],
|
augend.date.alias["%d/%m/%Y"],
|
||||||
augend.date.alias["%d.%m.%Y"],
|
augend.date.alias["%d.%m.%Y"],
|
||||||
cyclic_augend(weekdays),
|
cycle(weekdays),
|
||||||
cyclic_augend(weekdays_short),
|
cycle(weekdays_short),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Git
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
|
|
||||||
cmd = { "G", "Git" },
|
cmd = { "G", "Git" },
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
{ "<leader>gS", "<cmd>tab Git<cr>", desc = icon.." [S]status (fugitive)" },
|
return {
|
||||||
{ "<leader>gb", "<cmd>Git blame<cr>", desc = icon.." [b]lame (fugitive)" },
|
-- stylua: ignore start
|
||||||
-- stylua: ignore end
|
{ "<leader>gS", "<cmd>tab Git<cr>", desc = icon.." [S]status (fugitive)" },
|
||||||
},
|
{ "<leader>gb", "<cmd>Git blame<cr>", desc = icon.." [b]lame (fugitive)" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Git
|
|
||||||
return {
|
return {
|
||||||
"rhysd/git-messenger.vim",
|
"rhysd/git-messenger.vim",
|
||||||
|
|
||||||
cmd = "GitMessenger",
|
cmd = "GitMessenger",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = icon.." [g]it [m]essenger" },
|
return {
|
||||||
-- stylua: ignore end
|
-- stylua: ignore start
|
||||||
},
|
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = icon.." [g]it [m]essenger" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
init = function()
|
init = function()
|
||||||
-- Disable default mappings, as I have my own for lazy-loading.
|
-- Disable default mappings, as I have my own for lazy-loading.
|
||||||
|
|
|
@ -1,41 +1,42 @@
|
||||||
local open_repo = function()
|
|
||||||
require("gitlinker").get_repo_url {
|
|
||||||
action_callback = require("gitlinker.actions").open_in_browser,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local browser = function(mode)
|
|
||||||
return function()
|
|
||||||
require("gitlinker").get_buf_range_url(mode, {
|
|
||||||
action_callback = require("gitlinker.actions").open_in_browser,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local clipboard = function(mode)
|
|
||||||
return function()
|
|
||||||
require("gitlinker").get_buf_range_url(mode, {
|
|
||||||
action_callback = require("gitlinker.actions").copy_to_clipboard,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local icon = require("fschauen.util.icons").ui.Git
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ruifm/gitlinker.nvim",
|
"ruifm/gitlinker.nvim",
|
||||||
|
|
||||||
dependencies = "nvim-lua/plenary.nvim",
|
dependencies = "nvim-lua/plenary.nvim",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local open_repo = function()
|
||||||
{ "<leader>gr", open_repo, desc = icon.." open [r]epository in browser" },
|
require("gitlinker").get_repo_url {
|
||||||
{ "<leader>gl", clipboard("n"), desc = icon.." copy perma[l]ink to clipboard" },
|
action_callback = require("gitlinker.actions").open_in_browser,
|
||||||
{ "<leader>gl", clipboard("v"), desc = icon.." copy perma[l]ink to clipboard", mode = "v" },
|
}
|
||||||
{ "<leader>gL", browser("n"), desc = icon.." open perma[L]ink in browser" },
|
end
|
||||||
{ "<leader>gL", browser("v"), desc = icon.." open perma[L]ink in browser", mode = "v" },
|
|
||||||
-- stylua: ignore end
|
local browser = function(mode)
|
||||||
},
|
return function()
|
||||||
|
require("gitlinker").get_buf_range_url(mode, {
|
||||||
|
action_callback = require("gitlinker.actions").open_in_browser,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local clipboard = function(mode)
|
||||||
|
return function()
|
||||||
|
require("gitlinker").get_buf_range_url(mode, {
|
||||||
|
action_callback = require("gitlinker.actions").copy_to_clipboard,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
|
return {
|
||||||
|
-- stylua: ignore start
|
||||||
|
{ "<leader>gr", open_repo, desc = icon.." open [r]epository in browser" },
|
||||||
|
{ "<leader>gl", clipboard("n"), desc = icon.." copy perma[l]ink to clipboard" },
|
||||||
|
{ "<leader>gl", clipboard("v"), desc = icon.." copy perma[l]ink to clipboard", mode = "v" },
|
||||||
|
{ "<leader>gL", browser("n"), desc = icon.." open perma[L]ink in browser" },
|
||||||
|
{ "<leader>gL", browser("v"), desc = icon.." open perma[L]ink in browser", mode = "v" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
-- This really does need to be a function, because we need to defer requiring
|
-- This really does need to be a function, because we need to defer requiring
|
||||||
-- the `gitlinker.hosts` module until after the plugin is loaded.
|
-- the `gitlinker.hosts` module until after the plugin is loaded.
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
local helper = require("fschauen.plugins.telescope").keymap_helper
|
|
||||||
local lhs, desc = helper.lhs, helper.description
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"2kabhishek/nerdy.nvim",
|
"2kabhishek/nerdy.nvim",
|
||||||
|
|
||||||
|
@ -11,7 +8,11 @@ return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
},
|
},
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{ lhs("i"), "<cmd>Nerdy<cr>", desc = desc("Nerd [i]cons") },
|
local helper = require("fschauen.plugins.telescope").keymap_helper
|
||||||
},
|
local lhs, desc = helper.lhs, helper.description
|
||||||
|
return {
|
||||||
|
{ lhs("i"), "<cmd>Nerdy<cr>", desc = desc("Nerd [i]cons") },
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Lint
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{
|
return {
|
||||||
"<leader>L",
|
{
|
||||||
function() require("lint").try_lint() end,
|
"<leader>L",
|
||||||
desc = icon .. " [L]int file",
|
function() require("lint").try_lint() end,
|
||||||
},
|
desc = require("fschauen.util.icons").ui.Lint .. " [L]int file",
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require("lint").linters_by_ft = {
|
require("lint").linters_by_ft = {
|
||||||
|
|
|
@ -1,32 +1,34 @@
|
||||||
local helper = require("fschauen.plugins.telescope").keymap_helper
|
|
||||||
local lhs, desc = helper.lhs, helper.description
|
|
||||||
|
|
||||||
local telescope_notifications = function()
|
|
||||||
local telescope = vim.F.npcall(require, "telescope")
|
|
||||||
if not telescope then
|
|
||||||
vim.notify("Telescope is not installed!", vim.log.levels.WARN)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local theme = require("telescope.themes").get_dropdown {
|
|
||||||
results_title = " Results ",
|
|
||||||
prompt_title = " Notifications ",
|
|
||||||
}
|
|
||||||
telescope.load_extension("notify").notify(theme)
|
|
||||||
end
|
|
||||||
|
|
||||||
local dismiss_notifications = function() require("notify").dismiss() end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local telescope_notifications = function()
|
||||||
{ "<leader>n", "<cmd>Notifications<cr>", desc = "Display notification history" },
|
local telescope = vim.F.npcall(require, "telescope")
|
||||||
{ "<c-q>", dismiss_notifications, desc = "Dismiss notifications" },
|
if not telescope then
|
||||||
{ lhs("n"), telescope_notifications, desc = desc("[n]otifications") },
|
vim.notify("Telescope is not installed!", vim.log.levels.WARN)
|
||||||
-- stylua: ignore end
|
return
|
||||||
},
|
end
|
||||||
|
|
||||||
|
local theme = require("telescope.themes").get_dropdown {
|
||||||
|
results_title = " Results ",
|
||||||
|
prompt_title = " Notifications ",
|
||||||
|
}
|
||||||
|
telescope.load_extension("notify").notify(theme)
|
||||||
|
end
|
||||||
|
|
||||||
|
local dismiss_notifications = function() require("notify").dismiss() end
|
||||||
|
|
||||||
|
local helper = require("fschauen.plugins.telescope").keymap_helper
|
||||||
|
local lhs, desc = helper.lhs, helper.description
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- stylua: ignore start
|
||||||
|
{ "<leader>n", "<cmd>Notifications<cr>", desc = "Display notification history" },
|
||||||
|
{ "<c-q>", dismiss_notifications, desc = "Dismiss notifications" },
|
||||||
|
{ lhs("n"), telescope_notifications, desc = desc("[n]otifications") },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Web
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tyru/open-browser.vim",
|
"tyru/open-browser.vim",
|
||||||
|
|
||||||
|
@ -9,14 +7,17 @@ return {
|
||||||
"OpenBrowserSmartSearch",
|
"OpenBrowserSmartSearch",
|
||||||
},
|
},
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{
|
local icon = require("fschauen.util.icons").ui.Web
|
||||||
"<leader>o",
|
return {
|
||||||
"<Plug>(openbrowser-smart-search)",
|
{
|
||||||
desc = icon .. " [o]pen URL under cursor or search the web",
|
"<leader>o",
|
||||||
mode = { "n", "v" },
|
"<Plug>(openbrowser-smart-search)",
|
||||||
},
|
desc = icon .. " [o]pen URL under cursor or search the web",
|
||||||
},
|
mode = { "n", "v" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
init = function() vim.g.openbrowser_default_search = "duckduckgo" end,
|
init = function() vim.g.openbrowser_default_search = "duckduckgo" end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Graph
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"weirongxu/plantuml-previewer.vim",
|
"weirongxu/plantuml-previewer.vim",
|
||||||
|
|
||||||
|
@ -25,6 +23,7 @@ return {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
|
local icon = require("fschauen.util.icons").ui.Graph
|
||||||
local group = vim.api.nvim_create_augroup("fschauen.plantuml", { clear = true })
|
local group = vim.api.nvim_create_augroup("fschauen.plantuml", { clear = true })
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
desc = "Create key map to toggle plantuml preview.",
|
desc = "Create key map to toggle plantuml preview.",
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
local helper = require("fschauen.plugins.telescope").keymap_helper
|
|
||||||
local lhs, desc = helper.lhs, helper.description
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
|
||||||
dependencies = "nvim-telescope/telescope.nvim",
|
dependencies = "nvim-telescope/telescope.nvim",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{
|
local helper = require("fschauen.plugins.telescope").keymap_helper
|
||||||
lhs("B"),
|
local lhs, desc = helper.lhs, helper.description
|
||||||
"<cmd>Telescope file_browser theme=ivy<cr>",
|
return {
|
||||||
desc = desc("file [B]rowser"),
|
{
|
||||||
},
|
lhs("B"),
|
||||||
},
|
"<cmd>Telescope file_browser theme=ivy<cr>",
|
||||||
|
desc = desc("file [B]rowser"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
config = function() require("telescope").load_extension("file_browser") end,
|
config = function() require("telescope").load_extension("file_browser") end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Text
|
|
||||||
local description = icon .. " [c]hange text [c]ase"
|
|
||||||
|
|
||||||
local theme = function() return require("telescope.themes").get_cursor() end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"johmsalas/text-case.nvim",
|
"johmsalas/text-case.nvim",
|
||||||
|
|
||||||
|
@ -15,38 +10,44 @@ return {
|
||||||
"TextCaseStartReplacingCommand",
|
"TextCaseStartReplacingCommand",
|
||||||
},
|
},
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{
|
local icon = require("fschauen.util.icons").ui.Text
|
||||||
"<leader>cc",
|
local description = icon .. " [c]hange text [c]ase"
|
||||||
function() require("telescope").extensions.textcase.normal_mode(theme()) end,
|
local theme = function() return require("telescope.themes").get_cursor() end
|
||||||
mode = "n",
|
|
||||||
desc = description,
|
|
||||||
},
|
|
||||||
|
|
||||||
--[[
|
return {
|
||||||
|
{
|
||||||
|
"<leader>cc",
|
||||||
|
function() require("telescope").extensions.textcase.normal_mode(theme()) end,
|
||||||
|
mode = "n",
|
||||||
|
desc = description,
|
||||||
|
},
|
||||||
|
|
||||||
Ideally this would be the mapping for visual mode, but it doesn't work
|
--[[
|
||||||
due to bugs in textcase.
|
|
||||||
|
|
||||||
{
|
Ideally this would be the mapping for visual mode, but it doesn't work
|
||||||
"<leader>cc",
|
due to bugs in textcase.
|
||||||
function()
|
|
||||||
require("telescope").extensions.textcase.visual_mode(theme())
|
|
||||||
end,
|
|
||||||
mode = "v",
|
|
||||||
desc = description,
|
|
||||||
},
|
|
||||||
|
|
||||||
The mapping below works, but I can't set the theme to `cursor`.
|
{
|
||||||
|
"<leader>cc",
|
||||||
|
function()
|
||||||
|
require("telescope").extensions.textcase.visual_mode(theme())
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = description,
|
||||||
|
},
|
||||||
|
|
||||||
--]]
|
The mapping below works, but I can't set the theme to `cursor`.
|
||||||
{
|
|
||||||
"<leader>cc",
|
--]]
|
||||||
"<cmd>TextCaseOpenTelescope<cr>",
|
{
|
||||||
mode = "v",
|
"<leader>cc",
|
||||||
desc = description,
|
"<cmd>TextCaseOpenTelescope<cr>",
|
||||||
},
|
mode = "v",
|
||||||
},
|
desc = description,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require("textcase").setup {
|
require("textcase").setup {
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
local ui = require("fschauen.util.icons").ui
|
|
||||||
|
|
||||||
local helper = require("fschauen.plugins.telescope").keymap_helper
|
|
||||||
local lhs, desc = helper.lhs, helper.description
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
|
|
||||||
|
@ -13,25 +8,32 @@ return {
|
||||||
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{ lhs("t"), "<cmd>TodoTelescope<cr>", desc = desc("[t]odos") },
|
local helper = require("fschauen.plugins.telescope").keymap_helper
|
||||||
},
|
local lhs, desc = helper.lhs, helper.description
|
||||||
|
return {
|
||||||
|
{ lhs("t"), "<cmd>TodoTelescope<cr>", desc = desc("[t]odos") },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
opts = {
|
opts = function()
|
||||||
keywords = {
|
local ui = require("fschauen.util.icons").ui
|
||||||
TODO = { icon = ui.Checkbox },
|
return {
|
||||||
FIX = { icon = ui.Bug },
|
keywords = {
|
||||||
HACK = { icon = ui.Fire },
|
TODO = { icon = ui.Checkbox },
|
||||||
WARN = { icon = ui.Warning },
|
FIX = { icon = ui.Bug },
|
||||||
PERF = { icon = ui.Gauge },
|
HACK = { icon = ui.Fire },
|
||||||
NOTE = { icon = ui.Note },
|
WARN = { icon = ui.Warning },
|
||||||
TEST = { icon = ui.TestTube },
|
PERF = { icon = ui.Gauge },
|
||||||
},
|
NOTE = { icon = ui.Note },
|
||||||
gui_style = { fg = "bold" },
|
TEST = { icon = ui.TestTube },
|
||||||
highlight = {
|
},
|
||||||
multiline = false,
|
gui_style = { fg = "bold" },
|
||||||
keyword = "wide_fg",
|
highlight = {
|
||||||
after = "",
|
multiline = false,
|
||||||
},
|
keyword = "wide_fg",
|
||||||
},
|
after = "",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Tree
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
|
||||||
|
@ -15,13 +13,17 @@ return {
|
||||||
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.Tree
|
||||||
{ "<leader>Tp", "<cmd>TSPlaygroundToggle<cr>", desc = icon.." [T]reesitter [p]layground (toggle)" },
|
|
||||||
{ "<leader>Th", "<cmd>TSHighlightCapturesUnderCursor<cr>", desc = icon.." [T]reesitter [h]ighlights" },
|
return {
|
||||||
{ "<leader>Tn", "<cmd>TSNodeUnderCursor<cr>", desc = icon.." [T]reesitter [n]ode under cursor" },
|
-- stylua: ignore start
|
||||||
-- stylua: ignore end
|
{ "<leader>Tp", "<cmd>TSPlaygroundToggle<cr>", desc = icon.." [T]reesitter [p]layground (toggle)" },
|
||||||
},
|
{ "<leader>Th", "<cmd>TSHighlightCapturesUnderCursor<cr>", desc = icon.." [T]reesitter [h]ighlights" },
|
||||||
|
{ "<leader>Tn", "<cmd>TSNodeUnderCursor<cr>", desc = icon.." [T]reesitter [n]ode under cursor" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
local icon = require("fschauen.util.icons").ui.TrafficLight
|
|
||||||
return {
|
return {
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
|
|
||||||
dependencies = "nvim-tree/nvim-web-devicons",
|
dependencies = "nvim-tree/nvim-web-devicons",
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.TrafficLight
|
||||||
{ "<leader>lt", "<cmd>TroubleToggle<cr>", desc = icon.." trouble [t]toggle" },
|
return {
|
||||||
{ "<leader>lw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = icon.." trouble [w]orkspace" },
|
-- stylua: ignore start
|
||||||
{ "<leader>ld", "<cmd>TroubleToggle document_diagnostics<cr>", desc = icon.." trouble [d]ocument" },
|
{ "<leader>lt", "<cmd>TroubleToggle<cr>", desc = icon.." trouble [t]toggle" },
|
||||||
-- stylua: ignore end
|
{ "<leader>lw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = icon.." trouble [w]orkspace" },
|
||||||
},
|
{ "<leader>ld", "<cmd>TroubleToggle document_diagnostics<cr>", desc = icon.." trouble [d]ocument" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
padding = false, -- don't add an extra new line of top of the list
|
padding = false, -- don't add an extra new line of top of the list
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Undo
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
|
|
||||||
|
@ -13,7 +11,10 @@ return {
|
||||||
vim.g.undotree_TreeReturnShape = "╲"
|
vim.g.undotree_TreeReturnShape = "╲"
|
||||||
end,
|
end,
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = icon .. " toggle [u]ndo tree" },
|
local icon = require("fschauen.util.icons").ui.Undo
|
||||||
},
|
return {
|
||||||
|
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = icon .. " toggle [u]ndo tree" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
local toggle_colorcolumn = function()
|
|
||||||
if vim.o.colorcolumn == "" then
|
|
||||||
vim.o.colorcolumn = "+1" -- one after 'textwidth'
|
|
||||||
else
|
|
||||||
vim.o.colorcolumn = "" -- none
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local ui = require("fschauen.util.icons").ui
|
local ui = require("fschauen.util.icons").ui
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -13,9 +5,19 @@ return {
|
||||||
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
{ "<leader>sc", toggle_colorcolumn, desc = ui.Toggle .. " toggle virtual colunn" },
|
local toggle_colorcolumn = function()
|
||||||
},
|
if vim.o.colorcolumn == "" then
|
||||||
|
vim.o.colorcolumn = "+1" -- one after 'textwidth'
|
||||||
|
else
|
||||||
|
vim.o.colorcolumn = "" -- none
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{ "<leader>sc", toggle_colorcolumn, desc = ui.Toggle .. " toggle virtual colunn" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
char = ui.LineMiddle,
|
char = ui.LineMiddle,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icon = require("fschauen.util.icons").ui.Whitespace
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ntpeters/vim-better-whitespace",
|
"ntpeters/vim-better-whitespace",
|
||||||
|
|
||||||
|
@ -15,12 +13,15 @@ return {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
keys = {
|
keys = function()
|
||||||
-- stylua: ignore start
|
local icon = require("fschauen.util.icons").ui.Whitespace
|
||||||
{ "<leader>ww", "<cmd>ToggleWhitespace<cr>", desc = icon.." toggle whitespace" },
|
return {
|
||||||
{ "<leader>wj", "<cmd>NextTrailingWhitespace<cr>", desc = icon.." next whitespace" },
|
-- stylua: ignore start
|
||||||
{ "<leader>wk", "<cmd>PrevTrailingWhitespace<cr>", desc = icon.." previous whitespace" },
|
{ "<leader>ww", "<cmd>ToggleWhitespace<cr>", desc = icon.." toggle whitespace" },
|
||||||
{ "<leader>W", "<cmd>StripWhitespace<cr>", desc = icon.." strip whitespace" },
|
{ "<leader>wj", "<cmd>NextTrailingWhitespace<cr>", desc = icon.." next whitespace" },
|
||||||
-- stylua: ignore end
|
{ "<leader>wk", "<cmd>PrevTrailingWhitespace<cr>", desc = icon.." previous whitespace" },
|
||||||
},
|
{ "<leader>W", "<cmd>StripWhitespace<cr>", desc = icon.." strip whitespace" },
|
||||||
|
-- stylua: ignore end
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ M.ui = {
|
||||||
Circle = "●",
|
Circle = "●",
|
||||||
Comment = "",
|
Comment = "",
|
||||||
Comments = "",
|
Comments = "",
|
||||||
Decrement = "",
|
Decrement = "", --
|
||||||
Diagnostic = "",
|
Diagnostic = "",
|
||||||
EmptyFolder = "",
|
EmptyFolder = "",
|
||||||
EmptyFolderOpen = "",
|
EmptyFolderOpen = "",
|
||||||
|
@ -104,7 +104,7 @@ M.ui = {
|
||||||
Gauge = "", --
|
Gauge = "", --
|
||||||
Git = " ",
|
Git = " ",
|
||||||
Graph = "",
|
Graph = "",
|
||||||
Increment = "",
|
Increment = "", --
|
||||||
LineLeft = "▏",
|
LineLeft = "▏",
|
||||||
LineLeftBold = "▎",
|
LineLeftBold = "▎",
|
||||||
LineMiddle = "│",
|
LineMiddle = "│",
|
||||||
|
|
Loading…
Add table
Reference in a new issue