nvim: use icons consistently
This commit is contained in:
parent
0f6e9fc070
commit
80a3ba49ef
25 changed files with 145 additions and 89 deletions
|
@ -1,7 +1,5 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local icons = require("fschauen.util.icons")
|
|
||||||
|
|
||||||
-- Show/navigate warning and errors by default.
|
-- Show/navigate warning and errors by default.
|
||||||
M.severity = vim.diagnostic.severity.WARN
|
M.severity = vim.diagnostic.severity.WARN
|
||||||
|
|
||||||
|
@ -77,6 +75,8 @@ M.select_virtual_text_severity = function()
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local icons = require("fschauen.util.icons")
|
||||||
|
|
||||||
---Customize nvim's diagnostics display.
|
---Customize nvim's diagnostics display.
|
||||||
M.setup = function()
|
M.setup = function()
|
||||||
vim.diagnostic.config {
|
vim.diagnostic.config {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Comment
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tpope/vim-commentary",
|
"tpope/vim-commentary",
|
||||||
|
|
||||||
|
@ -5,9 +7,9 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "gc", "<Plug>Commentary", mode = {"n", "x", "o"}, desc = "Comment in/out" },
|
{ "gc", "<Plug>Commentary", mode = {"n", "x", "o"}, desc = icon.." Comment in/out" },
|
||||||
{ "gcc", "<Plug>CommentaryLine", desc = "Comment in/out line" },
|
{ "gcc", "<Plug>CommentaryLine", desc = icon.." Comment in/out line" },
|
||||||
{ "gcu", "<Plug>Commentary<Plug>Commentary", desc = "Undo comment in/out" },
|
{ "gcu", "<Plug>Commentary<Plug>Commentary", desc = icon.." Undo comment in/out" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local icons = require("fschauen.util.icons")
|
|
||||||
|
|
||||||
local make_keymap = function(cmp)
|
local make_keymap = function(cmp)
|
||||||
local if_visible = function(yes, no)
|
local if_visible = function(yes, no)
|
||||||
no = no or function(fallback)
|
no = no or function(fallback)
|
||||||
|
@ -90,7 +88,7 @@ return {
|
||||||
formatting = {
|
formatting = {
|
||||||
format = require("lspkind").cmp_format {
|
format = require("lspkind").cmp_format {
|
||||||
mode = "symbol_text",
|
mode = "symbol_text",
|
||||||
symbol_map = icons.kind,
|
symbol_map = require("fschauen.util.icons").kind,
|
||||||
menu = {
|
menu = {
|
||||||
buffer = "buf",
|
buffer = "buf",
|
||||||
nvim_lsp = "LSP",
|
nvim_lsp = "LSP",
|
||||||
|
|
|
@ -9,7 +9,7 @@ local dial_cmd = function(cmd, suffix)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---Make a new augent that cycles over the given elements.
|
---Make a new augend that cycles over the given elements.
|
||||||
---@param elements string[]: the elements to cycle.
|
---@param elements string[]: the elements to cycle.
|
||||||
---@return table: @see `dial.types.Augend`
|
---@return table: @see `dial.types.Augend`
|
||||||
local cyclic_augend = function(elements)
|
local cyclic_augend = function(elements)
|
||||||
|
@ -34,19 +34,22 @@ local weekdays_short = vim.tbl_map(function(s)
|
||||||
return s:sub(1, 3)
|
return s:sub(1, 3)
|
||||||
end, weekdays)
|
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 = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<c-a>", dial_cmd("inc_normal"), expr = true, desc = " Increment" },
|
{ "<c-a>", dial_cmd("inc_normal"), expr = true, desc = inc.." Increment" },
|
||||||
{ "<c-x>", dial_cmd("dec_normal"), expr = true, desc = " Decrement" },
|
{ "<c-x>", dial_cmd("dec_normal"), expr = true, desc = dec.." Decrement" },
|
||||||
|
|
||||||
{ "<c-a>", dial_cmd("inc_visual", "gv"), expr = true, desc = " Increment", mode = "v" },
|
{ "<c-a>", dial_cmd("inc_visual", "gv"), expr = true, desc = inc.." Increment", mode = "v" },
|
||||||
{ "<c-x>", dial_cmd("dec_visual", "gv"), expr = true, desc = " Decrement", 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 = " Increment", 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 = " Decrement", mode = "v" },
|
{ "g<c-x>", dial_cmd("dec_gvisual", "gv"), expr = true, desc = dec.." Decrement", mode = "v" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ local toggle_format_on_write = (function()
|
||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
|
local icon = require("fschauen.util.icons").ui.Format
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
|
|
||||||
|
@ -53,9 +55,9 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>FT", toggle_format_on_write, desc = " [F]ormat on write [T]oggle" },
|
{ "<leader>FT", toggle_format_on_write, desc = icon.." [F]ormat on write [T]oggle" },
|
||||||
{ "<leader>FF", "<cmd>Format<cr>", desc = " [F]ormat [F]ile" },
|
{ "<leader>FF", "<cmd>Format<cr>", desc = icon.." [F]ormat [F]ile" },
|
||||||
{ "<c-f>", "<cmd>Format<cr>", mode = "i", desc = " [f]ormat file" },
|
{ "<c-f>", "<cmd>Format<cr>", mode = "i", desc = icon.." [f]ormat file" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
|
|
||||||
|
@ -5,8 +7,8 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>gS", "<cmd>tab Git<cr>", desc = " [S]status with fugitive" },
|
{ "<leader>gS", "<cmd>tab Git<cr>", desc = icon.." [S]status (fugitive)" },
|
||||||
{ "<leader>gb", "<cmd>Git blame<cr>", desc = " [b]lame" },
|
{ "<leader>gb", "<cmd>Git blame<cr>", desc = icon.." [b]lame (fugitive)" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
return {
|
return {
|
||||||
"rhysd/git-messenger.vim",
|
"rhysd/git-messenger.vim",
|
||||||
|
|
||||||
|
@ -5,7 +6,7 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = " open [m]essenger" },
|
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = icon.." [g]it [m]essenger" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ local clipboard = function(mode)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local icon = require("fschauen.util.icons").ui.Git
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ruifm/gitlinker.nvim",
|
"ruifm/gitlinker.nvim",
|
||||||
|
|
||||||
|
@ -27,11 +29,11 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>gr", open_repo, desc = " open [r]epository in browser" },
|
{ "<leader>gr", open_repo, desc = icon.." open [r]epository in browser" },
|
||||||
{ "<leader>gl", clipboard("n"), desc = " copy perma[l]ink to clipboard" },
|
{ "<leader>gl", clipboard("n"), desc = icon.." copy perma[l]ink to clipboard" },
|
||||||
{ "<leader>gl", clipboard("v"), desc = " copy perma[l]ink to clipboard", mode = "v" },
|
{ "<leader>gl", clipboard("v"), desc = icon.." copy perma[l]ink to clipboard", mode = "v" },
|
||||||
{ "<leader>gL", browser("n"), desc = " open perma[L]ink in browser" },
|
{ "<leader>gL", browser("n"), desc = icon.." open perma[L]ink in browser" },
|
||||||
{ "<leader>gL", browser("v"), desc = " open perma[L]ink in browser", mode = "v" },
|
{ "<leader>gL", browser("v"), desc = icon.." open perma[L]ink in browser", mode = "v" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local icons = require("fschauen.util.icons")
|
local ui = require("fschauen.util.icons").ui
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
@ -14,8 +14,8 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>si", "<cmd>IBLToggle<cr>", desc = icons.ui.Toggle .. " toggle indent lines" },
|
{ "<leader>si", "<cmd>IBLToggle<cr>", desc = ui.Toggle.." toggle indent lines" },
|
||||||
{ "<leader>so", "<cmd>IBLToggleScope<cr>", desc = icons.ui.Toggle .. " toggle indent line scope" },
|
{ "<leader>so", "<cmd>IBLToggleScope<cr>", desc = ui.Toggle.." toggle indent line scope" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ return {
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
return vim.tbl_deep_extend("force", opts or {}, {
|
return vim.tbl_deep_extend("force", opts or {}, {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
indent = { char = icons.ui.LineLeft },
|
indent = { char = ui.LineLeft },
|
||||||
scope = {
|
scope = {
|
||||||
char = icons.ui.LineLeftBold,
|
char = ui.LineLeftBold,
|
||||||
enabled = false,
|
enabled = false,
|
||||||
show_start = false,
|
show_start = false,
|
||||||
show_end = false,
|
show_end = false,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
local M = { 'nvim-lualine/lualine.nvim' }
|
local M = { 'nvim-lualine/lualine.nvim' }
|
||||||
|
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
|
local ui = icons.ui
|
||||||
|
|
||||||
local orange = '#d65d0e'
|
local orange = '#d65d0e'
|
||||||
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
||||||
|
|
||||||
|
@ -70,7 +72,7 @@ M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||||
}
|
}
|
||||||
|
|
||||||
function C:update_status(is_focused)
|
function C:update_status(is_focused)
|
||||||
if not is_focused then return ' ' .. icons.ui.Sleep end
|
if not is_focused then return ' ' .. ui.Sleep end
|
||||||
|
|
||||||
local code = vim.api.nvim_get_mode().mode:lower()
|
local code = vim.api.nvim_get_mode().mode:lower()
|
||||||
local symbol = C.map[code:sub(1, 2)] or C.map[code:sub(1, 1)] or code
|
local symbol = C.map[code:sub(1, 2)] or C.map[code:sub(1, 1)] or code
|
||||||
|
@ -101,7 +103,7 @@ M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||||
if next(count) == nil then return '' end
|
if next(count) == nil then return '' end
|
||||||
|
|
||||||
local denominator = count.total > count.maxcount and '' or string.format('%d', count.total)
|
local denominator = count.total > count.maxcount and '' or string.format('%d', count.total)
|
||||||
return string.format(icons.ui.Search .. '%d/%s', count.current, denominator)
|
return string.format(ui.Search .. '%d/%s', count.current, denominator)
|
||||||
end
|
end
|
||||||
|
|
||||||
return C
|
return C
|
||||||
|
@ -141,7 +143,7 @@ M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||||
local lineno = vim.fn.search(trailing, 'nwc')
|
local lineno = vim.fn.search(trailing, 'nwc')
|
||||||
if lineno == 0 then return '' end
|
if lineno == 0 then return '' end
|
||||||
|
|
||||||
local result = icons.ui.Attention .. lineno
|
local result = ui.Attention .. lineno
|
||||||
|
|
||||||
local total = vim.fn.searchcount({ pattern = trailing }).total
|
local total = vim.fn.searchcount({ pattern = trailing }).total
|
||||||
if total > 1 then result = result .. string.format(' (%d total)', total) end
|
if total > 1 then result = result .. string.format(' (%d total)', total) end
|
||||||
|
@ -157,7 +159,7 @@ M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||||
}
|
}
|
||||||
|
|
||||||
local paste = {
|
local paste = {
|
||||||
colored_if_focused(function(has_focus) return has_focus and icons.ui.Paste or ' ' end),
|
colored_if_focused(function(has_focus) return has_focus and ui.Paste or ' ' end),
|
||||||
color = {
|
color = {
|
||||||
bg = orange,
|
bg = orange,
|
||||||
},
|
},
|
||||||
|
@ -167,8 +169,8 @@ M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||||
local status = {
|
local status = {
|
||||||
colored_if_focused(function(_)
|
colored_if_focused(function(_)
|
||||||
local status = ''
|
local status = ''
|
||||||
if vim.bo.modified then status = status .. icons.ui.Modified end
|
if vim.bo.modified then status = status .. ui.Modified end
|
||||||
if vim.bo.readonly or not vim.bo.modifiable then status = status .. icons.ui.ReadOnly end
|
if vim.bo.readonly or not vim.bo.modifiable then status = status .. ui.ReadOnly end
|
||||||
return status
|
return status
|
||||||
end),
|
end),
|
||||||
color = {
|
color = {
|
||||||
|
|
|
@ -24,13 +24,18 @@ return {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
local group = vim.api.nvim_create_augroup("fschauen.markdown", { clear = true })
|
local icon = require("fschauen.util.icons").ui.Markdown
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
desc = "Create key map to toggle markdown preview.",
|
desc = "Create key map to toggle markdown preview.",
|
||||||
group = group,
|
group = vim.api.nvim_create_augroup("fschauen.markdown", { clear = true }),
|
||||||
pattern = "markdown",
|
pattern = "markdown",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.keymap.set("n", "<leader>P", "<cmd>MarkdownPreviewToggle<cr>", { buffer = true })
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<leader>P",
|
||||||
|
"<cmd>MarkdownPreviewToggle<cr>",
|
||||||
|
{ buffer = true, desc = icon .. " toggle [P]review" }
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local icons = require("fschauen.util.icons")
|
local ui = require("fschauen.util.icons").ui
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"NeogitOrg/neogit",
|
"NeogitOrg/neogit",
|
||||||
|
@ -8,7 +8,7 @@ return {
|
||||||
dependencies = "nvim-lua/plenary.nvim",
|
dependencies = "nvim-lua/plenary.nvim",
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>gs", "<cmd>Neogit<cr>", desc = " [s]tatus with neogit" },
|
{ "<leader>gs", "<cmd>Neogit<cr>", desc = ui.Git .. " [s]tatus (Neogit)" },
|
||||||
},
|
},
|
||||||
|
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
@ -17,16 +17,16 @@ return {
|
||||||
disable_hint = true,
|
disable_hint = true,
|
||||||
signs = {
|
signs = {
|
||||||
section = {
|
section = {
|
||||||
icons.ui.Folder,
|
ui.Folder,
|
||||||
icons.ui.EmptyFolderOpen,
|
ui.EmptyFolderOpen,
|
||||||
},
|
},
|
||||||
item = {
|
item = {
|
||||||
icons.ui.ChevronRight,
|
ui.ChevronRight,
|
||||||
icons.ui.ChevronDown,
|
ui.ChevronDown,
|
||||||
},
|
},
|
||||||
hunk = {
|
hunk = {
|
||||||
icons.ui.ChevronSmallRight,
|
ui.ChevronSmallRight,
|
||||||
icons.ui.ChevronSmallDown,
|
ui.ChevronSmallDown,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Lint
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
|
|
||||||
|
@ -7,7 +9,7 @@ return {
|
||||||
function()
|
function()
|
||||||
require("lint").try_lint()
|
require("lint").try_lint()
|
||||||
end,
|
end,
|
||||||
desc = " [L]int file",
|
desc = icon .. " [L]int file",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ local on_attach = function(buffer)
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local icon = require("fschauen.util.icons").ui.FileTree
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
|
||||||
|
@ -29,8 +31,8 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>tt", "<cmd>NvimTreeToggle<cr>", desc = " [t]oggle [t]ree" },
|
{ "<leader>tt", "<cmd>NvimTreeToggle<cr>", desc = icon.." [t]oggle [t]ree" },
|
||||||
{ "<leader>tf", "<cmd>NvimTreeFindFile<cr>", desc = " Open [t]ree to current [f]ile " },
|
{ "<leader>tf", "<cmd>NvimTreeFindFile<cr>", desc = icon.." Open [t]ree to current [f]ile " },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Web
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tyru/open-browser.vim",
|
"tyru/open-browser.vim",
|
||||||
|
|
||||||
|
@ -11,7 +13,7 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>o",
|
"<leader>o",
|
||||||
"<Plug>(openbrowser-smart-search)",
|
"<Plug>(openbrowser-smart-search)",
|
||||||
desc = " [o]pen URL under cursor or search the web",
|
desc = icon .. " [o]pen URL under cursor or search the web",
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Graph
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"weirongxu/plantuml-previewer.vim",
|
"weirongxu/plantuml-previewer.vim",
|
||||||
|
|
||||||
|
@ -31,7 +33,12 @@ return {
|
||||||
group = group,
|
group = group,
|
||||||
pattern = "plantuml",
|
pattern = "plantuml",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.keymap.set("n", "<leader>P", "<cmd>PlantumlToggle<cr>", { buffer = true })
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<leader>P",
|
||||||
|
"<cmd>PlantumlToggle<cr>",
|
||||||
|
{ buffer = true, desc = icon .. " toggle PlantUML [P]review" }
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
local util = require("fschauen.util")
|
local ui = require("fschauen.util.icons").ui
|
||||||
local icons = require("fschauen.util.icons")
|
|
||||||
|
|
||||||
---Create the left hand side for a Telescope keymap.
|
---Create the left hand side for a Telescope keymap.
|
||||||
local lhs = function(keys)
|
local lhs = function(keys)
|
||||||
|
@ -8,7 +7,7 @@ end
|
||||||
|
|
||||||
---Create the description for a Telescope keymap.
|
---Create the description for a Telescope keymap.
|
||||||
local desc = function(text)
|
local desc = function(text)
|
||||||
return icons.ui.Telescope .. " Telescope " .. text
|
return ui.Telescope .. " Telescope " .. text
|
||||||
end
|
end
|
||||||
|
|
||||||
local builtin_picker = function(name, opts)
|
local builtin_picker = function(name, opts)
|
||||||
|
@ -33,7 +32,7 @@ local pickers = setmetatable({
|
||||||
dotfiles = builtin_picker("find_files", { cwd = "~/.dotfiles", hidden = true }),
|
dotfiles = builtin_picker("find_files", { cwd = "~/.dotfiles", hidden = true }),
|
||||||
selection = function(title)
|
selection = function(title)
|
||||||
return function()
|
return function()
|
||||||
local text = util.get_selected_text()
|
local text = require("fschauen.util").get_selected_text()
|
||||||
return require("telescope.builtin").grep_string {
|
return require("telescope.builtin").grep_string {
|
||||||
prompt_title = string.format(title .. ": %s ", text),
|
prompt_title = string.format(title .. ": %s ", text),
|
||||||
search = text,
|
search = text,
|
||||||
|
@ -146,10 +145,10 @@ return {
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = { i = mappings, n = mappings },
|
mappings = { i = mappings, n = mappings },
|
||||||
|
|
||||||
prompt_prefix = " " .. icons.ui.Telescope .. " ",
|
prompt_prefix = " " .. ui.Telescope .. " ",
|
||||||
selection_caret = icons.ui.Play .. " ",
|
selection_caret = ui.Play .. " ",
|
||||||
|
|
||||||
multi_icon = icons.ui.Checkbox .. " ",
|
multi_icon = ui.Checkbox .. " ",
|
||||||
scroll_strategy = "limit", -- Don't wrap around in results.
|
scroll_strategy = "limit", -- Don't wrap around in results.
|
||||||
|
|
||||||
dynamic_preview_title = true,
|
dynamic_preview_title = true,
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
local description = " [c]hange text [c]ase"
|
local icon = require("fschauen.util.icons").ui.Text
|
||||||
|
local description = icon .." [c]hange text [c]ase"
|
||||||
|
|
||||||
local theme = function()
|
local theme = function()
|
||||||
return require("telescope.themes").get_cursor()
|
return require("telescope.themes").get_cursor()
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Tree
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
|
||||||
|
@ -15,9 +17,9 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>Tp", "<cmd>TSPlaygroundToggle<cr>", desc = " [T]reesitter [p]layground (toggle)" },
|
{ "<leader>Tp", "<cmd>TSPlaygroundToggle<cr>", desc = icon.." [T]reesitter [p]layground (toggle)" },
|
||||||
{ "<leader>Th", "<cmd>TSHighlightCapturesUnderCursor<cr>", desc = " [T]reesitter [h]ighlights" },
|
{ "<leader>Th", "<cmd>TSHighlightCapturesUnderCursor<cr>", desc = icon.." [T]reesitter [h]ighlights" },
|
||||||
{ "<leader>Tn", "<cmd>TSNodeUnderCursor<cr>", desc = " [T]reesitter [n]ode under cursor" },
|
{ "<leader>Tn", "<cmd>TSNodeUnderCursor<cr>", desc = icon.." [T]reesitter [n]ode under cursor" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.TrafficLight
|
||||||
return {
|
return {
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
|
|
||||||
|
@ -5,9 +6,9 @@ return {
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
{ "<leader>lt", "<cmd>TroubleToggle<cr>", desc = " trouble [t]toggle" },
|
{ "<leader>lt", "<cmd>TroubleToggle<cr>", desc = icon.." trouble [t]toggle" },
|
||||||
{ "<leader>lw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = " trouble [w]orkspace" },
|
{ "<leader>lw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = icon.." trouble [w]orkspace" },
|
||||||
{ "<leader>ld", "<cmd>TroubleToggle document_diagnostics<cr>", desc = " trouble [d]ocument" },
|
{ "<leader>ld", "<cmd>TroubleToggle document_diagnostics<cr>", desc = icon.." trouble [d]ocument" },
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Undo
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
|
|
||||||
|
@ -12,6 +14,6 @@ return {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>" },
|
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = icon .. " toggle [u]ndo tree" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ local toggle_colorcolumn = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local icons = require("fschauen.util.icons")
|
local ui = require("fschauen.util.icons").ui
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"lukas-reineke/virt-column.nvim",
|
"lukas-reineke/virt-column.nvim",
|
||||||
|
@ -14,12 +14,12 @@ return {
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>sc", toggle_colorcolumn, desc = icons.ui.Toggle .. " toggle virtual colunn" },
|
{ "<leader>sc", toggle_colorcolumn, desc = ui.Toggle .. " toggle virtual colunn" },
|
||||||
},
|
},
|
||||||
|
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
return vim.tbl_deep_extend("force", opts or {}, {
|
return vim.tbl_deep_extend("force", opts or {}, {
|
||||||
char = icons.ui.LineMiddle,
|
char = ui.LineMiddle,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local icon = require("fschauen.util.icons").ui.Whitespace
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ntpeters/vim-better-whitespace",
|
"ntpeters/vim-better-whitespace",
|
||||||
|
|
||||||
|
@ -14,9 +16,11 @@ return {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>ww", "<cmd>ToggleWhitespace<cr>" },
|
-- stylua: ignore start
|
||||||
{ "<leader>wj", "<cmd>NextTrailingWhitespace<cr>" },
|
{ "<leader>ww", "<cmd>ToggleWhitespace<cr>", desc = icon.." toggle whitespace" },
|
||||||
{ "<leader>wk", "<cmd>PrevTrailingWhitespace<cr>" },
|
{ "<leader>wj", "<cmd>NextTrailingWhitespace<cr>", desc = icon.." next whitespace" },
|
||||||
{ "<leader>W", "<cmd>StripWhitespace<cr>" },
|
{ "<leader>wk", "<cmd>PrevTrailingWhitespace<cr>", desc = icon.." previous whitespace" },
|
||||||
|
{ "<leader>W", "<cmd>StripWhitespace<cr>", desc = icon.." strip whitespace" },
|
||||||
|
-- stylua: ignore end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,27 +99,37 @@ M.ui = {
|
||||||
ChevronDown = "", --
|
ChevronDown = "", --
|
||||||
ChevronLeft = "", --
|
ChevronLeft = "", --
|
||||||
ChevronRight = "", --
|
ChevronRight = "", --
|
||||||
ChevronUp = "", --
|
|
||||||
ChevronSmallDown = "",
|
ChevronSmallDown = "",
|
||||||
ChevronSmallLeft = "",
|
ChevronSmallLeft = "",
|
||||||
ChevronSmallRight = "",
|
ChevronSmallRight = "",
|
||||||
ChevronSmallUp = "",
|
ChevronSmallUp = "",
|
||||||
|
ChevronUp = "", --
|
||||||
Circle = "●",
|
Circle = "●",
|
||||||
|
Comment = "",
|
||||||
|
Comments = "",
|
||||||
|
Decrement = "",
|
||||||
Diagnostic = "",
|
Diagnostic = "",
|
||||||
EmptyFolder = "",
|
EmptyFolder = "",
|
||||||
EmptyFolderOpen = "",
|
EmptyFolderOpen = "",
|
||||||
File = "", --
|
File = "", --
|
||||||
FileSymlink = "", --
|
FileSymlink = "", --
|
||||||
|
FileTree = "",
|
||||||
Files = "",
|
Files = "",
|
||||||
Fire = "", --
|
Fire = "", --
|
||||||
Folder = "",
|
Folder = "",
|
||||||
FolderOpen = "",
|
FolderOpen = "",
|
||||||
FolderSymlink = "",
|
FolderSymlink = "",
|
||||||
|
Format = "",
|
||||||
Gauge = "", --
|
Gauge = "", --
|
||||||
|
Git = " ",
|
||||||
|
Graph = "",
|
||||||
|
Increment = "",
|
||||||
LineLeft = "▏",
|
LineLeft = "▏",
|
||||||
LineLeftBold = "▎",
|
LineLeftBold = "▎",
|
||||||
LineMiddle = "│",
|
LineMiddle = "│",
|
||||||
LineMiddleBold = "┃",
|
LineMiddleBold = "┃",
|
||||||
|
Lint = "",
|
||||||
|
Markdown = "",
|
||||||
Modified = "",
|
Modified = "",
|
||||||
Note = "", --
|
Note = "", --
|
||||||
Paste = "",
|
Paste = "",
|
||||||
|
@ -129,8 +139,14 @@ M.ui = {
|
||||||
Sleep = "",
|
Sleep = "",
|
||||||
Telescope = "",
|
Telescope = "",
|
||||||
TestTube = "", --
|
TestTube = "", --
|
||||||
|
Text = "",
|
||||||
Toggle = "",
|
Toggle = "",
|
||||||
|
TrafficLight = "",
|
||||||
|
Tree = "",
|
||||||
|
Undo = "",
|
||||||
Warning = "",
|
Warning = "",
|
||||||
|
Web = "",
|
||||||
|
Whitespace = "",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
|
|
Loading…
Add table
Reference in a new issue