Compare commits
No commits in common. "d1e0aa51d0dec0e356fe59fc0466eeed20e4dabd" and "b620c0a997b12289258c950a3d94aabb41483cf7" have entirely different histories.
d1e0aa51d0
...
b620c0a997
63 changed files with 155 additions and 152 deletions
|
@ -1 +1 @@
|
|||
require("util.options").set_gitcommit_buffer_options()
|
||||
require("fschauen.util.options").set_gitcommit_buffer_options()
|
||||
|
|
|
@ -1 +1 @@
|
|||
require("util.options").set_gitcommit_buffer_options()
|
||||
require("fschauen.util.options").set_gitcommit_buffer_options()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
vim.bo.tabstop = 2
|
||||
|
||||
local lua = require("util.lua")
|
||||
local lua = require("fschauen.util.lua")
|
||||
local map = vim.keymap.set
|
||||
local opts = function(desc) return { desc = desc, buffer = true, silent = true } end
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
if vim.loader then vim.loader.enable() end
|
||||
|
||||
require("config")
|
||||
require("fschauen")
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
return {
|
||||
"ntpeters/vim-better-whitespace",
|
||||
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
|
||||
init = function()
|
||||
vim.g.better_whitespace_filetypes_blacklist = {
|
||||
"diff",
|
||||
"fugitive",
|
||||
"git",
|
||||
"gitcommit",
|
||||
"help",
|
||||
}
|
||||
end,
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Whitespace
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "]w", "<cmd>NextTrailingWhitespace<cr>", desc = icon.." next whitespace" },
|
||||
{ "[w", "<cmd>PrevTrailingWhitespace<cr>", desc = icon.." previous whitespace" },
|
||||
{ "<leader>w", "<cmd>ToggleWhitespace<cr>", desc = icon.." toggle whitespace" },
|
||||
{ "<leader>W", "<cmd>StripWhitespace<cr>", desc = icon.." strip whitespace" },
|
||||
-- stylua: ignore end
|
||||
}
|
||||
end,
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
local group = vim.api.nvim_create_augroup("custom", { clear = true })
|
||||
local group = vim.api.nvim_create_augroup("fschauen", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Briefly highlight yanked text.",
|
|
@ -19,7 +19,7 @@ end
|
|||
---@param bufnr integer|nil: Buffer number (0 for current buffer, nil for all buffers.
|
||||
M.hide = function(bufnr) vim.diagnostic.hide(nil, bufnr or 0) end
|
||||
|
||||
local icons = require("util.icons")
|
||||
local icons = require("fschauen.util.icons")
|
||||
|
||||
---Use `Telescope` to set a new diagnostic severity.
|
||||
M.set_severity = function()
|
|
@ -8,12 +8,12 @@ R = function(module)
|
|||
return require(module)
|
||||
end
|
||||
|
||||
require("config.options").setup()
|
||||
require("config.keymap").setup()
|
||||
require("config.diagnostic").setup()
|
||||
require("config.autocmd").setup()
|
||||
require("config.filetype").setup()
|
||||
require("config.lazy").setup()
|
||||
require("fschauen.options").setup()
|
||||
require("fschauen.keymap").setup()
|
||||
require("fschauen.diagnostic").setup()
|
||||
require("fschauen.autocmd").setup()
|
||||
require("fschauen.filetype").setup()
|
||||
require("fschauen.lazy").setup()
|
||||
|
||||
local colorscheme = vim.env.NVIM_COLORSCHEME or "gruvbox"
|
||||
vim.cmd("silent! colorscheme " .. colorscheme)
|
|
@ -36,7 +36,7 @@ M.setup = function()
|
|||
-- disable highlight until next search
|
||||
vim.keymap.set("n", "<leader>h", "<cmd>nohlsearch<cr>")
|
||||
|
||||
local window = require("util.window")
|
||||
local window = require("fschauen.util.window")
|
||||
|
||||
-- window resizing
|
||||
vim.keymap.set("n", "<s-Up>", window.resize_up(2), { desc = "Resize window upward" })
|
||||
|
@ -79,8 +79,8 @@ M.setup = function()
|
|||
-- don't loose the original yanked contents when pasting in visual mode
|
||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||
|
||||
local diagnostic = require("config.diagnostic")
|
||||
local ui = require("util.icons").ui
|
||||
local diagnostic = require("fschauen.diagnostic")
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
|
||||
-- navigate diagnostics
|
||||
vim.keymap.set("n", "<leader>dd", diagnostic.toggle, { desc = ui.Diagnostic.." [d]iagnostic enable/[d]isable" })
|
||||
|
@ -92,7 +92,7 @@ M.setup = function()
|
|||
vim.keymap.set("n", "<leader>q", window.toggle_quickfix, { desc = ui.Toggle.." toggle quickfix" })
|
||||
vim.keymap.set("n", "<localleader>q", window.toggle_loclist, { desc = ui.Toggle.." toggle loclist" })
|
||||
|
||||
local options = require("util.options")
|
||||
local options = require("fschauen.util.options")
|
||||
|
||||
-- toggle options
|
||||
vim.keymap.set("n", "<leader>sn", options.toggle_number, { desc = ui.Toggle.." toggle 'number'" })
|
|
@ -33,7 +33,7 @@ M.setup = function()
|
|||
end
|
||||
|
||||
lazy.setup {
|
||||
spec = "config.plugins",
|
||||
spec = "fschauen.plugins",
|
||||
dev = {
|
||||
path = dev_path(),
|
||||
fallback = true,
|
|
@ -7,7 +7,7 @@ return {
|
|||
{
|
||||
"<leader>gb",
|
||||
"<cmd>BlameToggle<cr>",
|
||||
desc = require("util.icons").ui.Git .. " [g]it [b]lame (blame.nvim)",
|
||||
desc = require("fschauen.util.icons").ui.Git .. " [g]it [b]lame (blame.nvim)",
|
||||
},
|
||||
},
|
||||
|
|
@ -4,7 +4,7 @@ return {
|
|||
cmd = "Commentary",
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Comment
|
||||
local icon = require("fschauen.util.icons").ui.Comment
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "gc", "<Plug>Commentary", mode = {"n", "x", "o"}, desc = icon.." Comment in/out" },
|
|
@ -85,7 +85,7 @@ return {
|
|||
formatting = {
|
||||
format = require("lspkind").cmp_format {
|
||||
mode = "symbol_text",
|
||||
symbol_map = require("util.icons").kind,
|
||||
symbol_map = require("fschauen.util.icons").kind,
|
||||
menu = {
|
||||
buffer = "buf",
|
||||
nvim_lsp = "LSP",
|
|
@ -11,7 +11,7 @@ return {
|
|||
return function() return require("dial.map")[cmd]() .. suffix end
|
||||
end
|
||||
|
||||
local icons = require("util.icons")
|
||||
local icons = require("fschauen.util.icons")
|
||||
local inc, dec = icons.ui.Increment, icons.ui.Decrement
|
||||
|
||||
return {
|
|
@ -1,3 +1,5 @@
|
|||
local icons = require("fschauen.util.icons")
|
||||
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
|
||||
|
@ -7,7 +9,7 @@ return {
|
|||
|
||||
opts = {
|
||||
text = {
|
||||
done = require("util.icons").ui.Checkmark,
|
||||
done = icons.ui.Checkmark,
|
||||
spinner = {
|
||||
"▱▱▱▱▱▱▱",
|
||||
"▰▱▱▱▱▱▱",
|
|
@ -32,11 +32,11 @@ return {
|
|||
},
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Format
|
||||
local icon = require("fschauen.util.icons").ui.Format
|
||||
return {
|
||||
{
|
||||
"<leader>F",
|
||||
require("util.autoformat").toggle,
|
||||
require("fschauen.util.autoformat").toggle,
|
||||
desc = icon .. " Toggle auto [F]ormat on write",
|
||||
},
|
||||
{
|
|
@ -4,7 +4,7 @@ return {
|
|||
cmd = { "G", "Git" },
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Git
|
||||
local icon = require("fschauen.util.icons").ui.Git
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "<leader>gS", "<cmd>tab Git<cr>", desc = icon.." [g]it [S]status (fugitive)" },
|
|
@ -4,7 +4,7 @@ return {
|
|||
cmd = "GitMessenger",
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Git
|
||||
local icon = require("fschauen.util.icons").ui.Git
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = icon.." [g]it [m]essenger" },
|
|
@ -26,7 +26,7 @@ return {
|
|||
end
|
||||
end
|
||||
|
||||
local icon = require("util.icons").ui.Git
|
||||
local icon = require("fschauen.util.icons").ui.Git
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "<leader>gr", open_repo, desc = icon.." open [r]epository in browser" },
|
|
@ -1,4 +1,4 @@
|
|||
local ui = require("util.icons").ui
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
|
@ -4,10 +4,10 @@ return {
|
|||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
|
||||
opts = function()
|
||||
local icons = require("util.icons")
|
||||
local colored_when_focused = require("util.lualine").colored_when_focused
|
||||
local indicator = require("util.lualine").indicator
|
||||
local window = require("util.window")
|
||||
local icons = require("fschauen.util.icons")
|
||||
local dynamic_color = require("fschauen.util.lualine").dynamic_color
|
||||
local indicator = require("fschauen.util.lualine").indicator
|
||||
local window = require("fschauen.util.window")
|
||||
local orange = "#d65d0e"
|
||||
|
||||
local is_diagnostics_enabled = function(bufnr)
|
||||
|
@ -20,7 +20,7 @@ return {
|
|||
|
||||
local autoformat = indicator {
|
||||
icon = icons.ui.Format,
|
||||
cond = require("util.autoformat").is_enabled,
|
||||
cond = require("fschauen.util.autoformat").is_enabled,
|
||||
}
|
||||
local branch = {
|
||||
"branch",
|
||||
|
@ -28,7 +28,7 @@ return {
|
|||
cond = window.is_medium,
|
||||
}
|
||||
local diagnostics = {
|
||||
colored_when_focused("diagnostics"),
|
||||
dynamic_color("diagnostics"),
|
||||
cond = is_diagnostics_enabled,
|
||||
}
|
||||
local diag_status = indicator {
|
||||
|
@ -39,24 +39,24 @@ return {
|
|||
"fileformat",
|
||||
cond = window.is_medium,
|
||||
}
|
||||
local filename = "custom.filename"
|
||||
local filename = "fschauen.filename"
|
||||
local filetype = {
|
||||
colored_when_focused("filetype"),
|
||||
dynamic_color("filetype"),
|
||||
cond = window.is_medium,
|
||||
}
|
||||
local mode = "custom.mode"
|
||||
local searchcount = "custom.searchcount"
|
||||
local mode = "fschauen.mode"
|
||||
local searchcount = "fschauen.searchcount"
|
||||
local spell = indicator {
|
||||
icon = icons.ui.SpellCheck,
|
||||
cond = function() return vim.o.spell end,
|
||||
}
|
||||
local status = {
|
||||
colored_when_focused("custom.status"),
|
||||
dynamic_color("fschauen.status"),
|
||||
color = { fg = orange },
|
||||
padding = 0,
|
||||
}
|
||||
local whitespace = {
|
||||
colored_when_focused("custom.whitespace"),
|
||||
dynamic_color("fschauen.whitespace"),
|
||||
cond = window.is_wide,
|
||||
}
|
||||
local wrap = indicator {
|
|
@ -22,10 +22,10 @@ return {
|
|||
end,
|
||||
|
||||
config = function()
|
||||
local icon = require("util.icons").ui.Markdown
|
||||
local icon = require("fschauen.util.icons").ui.Markdown
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
desc = "Create key map to toggle markdown preview.",
|
||||
group = vim.api.nvim_create_augroup("custom.markdown", { clear = true }),
|
||||
group = vim.api.nvim_create_augroup("fschauen.markdown", { clear = true }),
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.keymap.set(
|
|
@ -6,7 +6,7 @@ return {
|
|||
event = { "BufReadPre", "BufNewFile" },
|
||||
|
||||
config = function()
|
||||
local icons = require("util.icons")
|
||||
local icons = require("fschauen.util.icons")
|
||||
|
||||
require("mason").setup {
|
||||
ui = {
|
|
@ -2,7 +2,7 @@ return {
|
|||
"danymat/neogen",
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Annotation
|
||||
local icon = require("fschauen.util.icons").ui.Annotation
|
||||
return {
|
||||
{
|
||||
"<leader>aa",
|
|
@ -1,4 +1,4 @@
|
|||
local ui = require("util.icons").ui
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
|
||||
return {
|
||||
"NeogitOrg/neogit",
|
|
@ -1,4 +1,4 @@
|
|||
local keymap = require("config.plugins.telescope").keymap
|
||||
local keymap = require("fschauen.plugins.telescope").keymap
|
||||
|
||||
return {
|
||||
"2kabhishek/nerdy.nvim",
|
|
@ -6,7 +6,7 @@ return {
|
|||
{
|
||||
"<leader>L",
|
||||
function() require("lint").try_lint() end,
|
||||
desc = require("util.icons").ui.Lint .. " [L]int file",
|
||||
desc = require("fschauen.util.icons").ui.Lint .. " [L]int file",
|
||||
},
|
||||
}
|
||||
end,
|
|
@ -18,7 +18,7 @@ return {
|
|||
|
||||
local dismiss_notifications = function() require("notify").dismiss() end
|
||||
|
||||
local keymap = require("config.plugins.telescope").keymap
|
||||
local keymap = require("fschauen.plugins.telescope").keymap
|
||||
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
|
@ -33,7 +33,7 @@ return {
|
|||
|
||||
config = function()
|
||||
local notify = require("notify")
|
||||
local icons = require("util.icons")
|
||||
local icons = require("fschauen.util.icons")
|
||||
|
||||
notify.setup {
|
||||
icons = {
|
|
@ -22,7 +22,7 @@ local on_attach = function(buffer)
|
|||
-- stylua: ignore end
|
||||
end
|
||||
|
||||
local icons = require("util.icons")
|
||||
local icons = require("fschauen.util.icons")
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
|
@ -8,7 +8,7 @@ return {
|
|||
},
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Web
|
||||
local icon = require("fschauen.util.icons").ui.Web
|
||||
return {
|
||||
{
|
||||
"<leader>o",
|
|
@ -17,14 +17,14 @@ return {
|
|||
local cmdline = [[which plantuml | xargs cat | grep plantuml.jar]]
|
||||
local regex = [[\v\s['"]?(\S+/plantuml\.jar)]]
|
||||
local jar = vim.fn.matchlist(vim.fn.system(cmdline), regex)[2]
|
||||
if jar and vim.uv.fs_stat(jar) then
|
||||
if jar and vim.loop.fs_stat(jar) then
|
||||
vim.g["plantuml_previewer#plantuml_jar_path"] = jar
|
||||
end
|
||||
end,
|
||||
|
||||
config = function()
|
||||
local icon = require("util.icons").ui.Graph
|
||||
local group = vim.api.nvim_create_augroup("custom.plantuml", { clear = true })
|
||||
local icon = require("fschauen.util.icons").ui.Graph
|
||||
local group = vim.api.nvim_create_augroup("fschauen.plantuml", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
desc = "Create key map to toggle plantuml preview.",
|
||||
group = group,
|
|
@ -1,4 +1,4 @@
|
|||
local keymap = require("config.plugins.telescope").keymap
|
||||
local keymap = require("fschauen.plugins.telescope").keymap
|
||||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
|
||||
|
@ -12,5 +12,5 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
config = function() require("config.plugins.telescope").load_extension("file_browser") end,
|
||||
config = function() require("telescope").load_extension("file_browser") end,
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
local ui = require("util.icons").ui
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
|
||||
local builtin = function(name, opts)
|
||||
return function(title)
|
||||
|
@ -23,10 +23,9 @@ local pickers = setmetatable({
|
|||
colorscheme = builtin("colorscheme", { enable_preview = true }),
|
||||
diagnostics = builtin("diagnostics", { bufnr = 0 }),
|
||||
dotfiles = builtin("find_files", { cwd = "~/.dotfiles", hidden = true }),
|
||||
plugins = builtin("find_files", { cwd = vim.fn.stdpath("data") .. "/lazy" }),
|
||||
selection = function(title)
|
||||
return function()
|
||||
local text = require("util").get_selected_text()
|
||||
local text = require("fschauen.util").get_selected_text()
|
||||
return require("telescope.builtin").grep_string {
|
||||
prompt_title = string.format(title .. ": %s ", text),
|
||||
search = text,
|
||||
|
@ -58,20 +57,7 @@ local keymap = function(spec)
|
|||
})
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release "
|
||||
.. "&& cmake --build build --config Release "
|
||||
.. "&& cmake --install build --prefix build",
|
||||
},
|
||||
|
||||
cmd = "Telescope",
|
||||
|
||||
keys = vim
|
||||
.iter({
|
||||
local keys = {
|
||||
-- stylua: ignore start
|
||||
{ "a", pickers.autocommands " Autocommands" , desc = "[a]utocommands" },
|
||||
{ "b", pickers.buffers " Buffers" , desc = "[b]uffers" },
|
||||
|
@ -95,7 +81,7 @@ return {
|
|||
{ "m", pickers.all_man_pages " Man pages" , desc = "[m]an pages" },
|
||||
--"n" used in vim-notify
|
||||
{ "o", pickers.vim_options " Vim options" , desc = "[o]ptions" },
|
||||
{ "p", pickers.plugins " Installed Plugins" , desc = "[p]lugins" },
|
||||
--"p"
|
||||
{ "q", pickers.quickfix " Quickfix" , desc = "[q]uickfix" },
|
||||
{ "r", pickers.lsp_references " References" , desc = "[r]eferences" },
|
||||
{ "R", pickers.registers " Registers" , desc = "[R]registers" },
|
||||
|
@ -115,9 +101,22 @@ return {
|
|||
{ "/", pickers.search_history " Search history" , desc = "[/]search history" },
|
||||
{ " ", pickers.resume " Resume" , desc = "Resume " },
|
||||
-- stylua: ignore end
|
||||
})
|
||||
:map(keymap)
|
||||
:totable(),
|
||||
}
|
||||
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release "
|
||||
.. "&& cmake --build build --config Release "
|
||||
.. "&& cmake --install build --prefix build",
|
||||
},
|
||||
|
||||
cmd = "Telescope",
|
||||
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
keys = vim.iter(keys):map(keymap):totable(),
|
||||
|
||||
-- Export this function so we can use in other plugins.
|
||||
keymap = keymap,
|
||||
|
@ -198,7 +197,7 @@ return {
|
|||
require("telescope").load_extension("fzf")
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
desc = "Enable line number in Telescope previewers.",
|
||||
group = vim.api.nvim_create_augroup("custom.telescope", { clear = true }),
|
||||
group = vim.api.nvim_create_augroup("fschauen.telescope", { clear = true }),
|
||||
pattern = "TelescopePreviewerLoaded",
|
||||
command = "setlocal number",
|
||||
})
|
|
@ -13,14 +13,14 @@ return {
|
|||
dev = true,
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Text
|
||||
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 {
|
||||
{
|
||||
"<leader>cc",
|
||||
function() require("config.plugins.telescope").extensions.textcase.normal_mode(theme()) end,
|
||||
function() require("telescope").extensions.textcase.normal_mode(theme()) end,
|
||||
mode = "n",
|
||||
desc = description,
|
||||
},
|
||||
|
@ -55,6 +55,6 @@ return {
|
|||
require("textcase").setup {
|
||||
default_keymappings_enabled = false,
|
||||
}
|
||||
require("config.plugins.telescope").load_extension("textcase")
|
||||
require("telescope").load_extension("textcase")
|
||||
end,
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
local keymap = require("config.plugins.telescope").keymap
|
||||
local keymap = require("fschauen.plugins.telescope").keymap
|
||||
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
|
@ -15,7 +15,7 @@ return {
|
|||
},
|
||||
|
||||
opts = function()
|
||||
local ui = require("util.icons").ui
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
return {
|
||||
keywords = {
|
||||
TODO = { icon = ui.Checkbox },
|
|
@ -14,7 +14,7 @@ return {
|
|||
event = "VeryLazy",
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Tree
|
||||
local icon = require("fschauen.util.icons").ui.Tree
|
||||
|
||||
return {
|
||||
-- stylua: ignore start
|
|
@ -6,7 +6,7 @@ return {
|
|||
cmd = "Trouble",
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.TrafficLight
|
||||
local icon = require("fschauen.util.icons").ui.TrafficLight
|
||||
local key = function(lhs, rhs, desc) return { lhs, rhs, desc = icon .. " " .. desc } end
|
||||
return {
|
||||
-- stylua: ignore start
|
|
@ -12,7 +12,7 @@ return {
|
|||
end,
|
||||
|
||||
keys = function()
|
||||
local icon = require("util.icons").ui.Undo
|
||||
local icon = require("fschauen.util.icons").ui.Undo
|
||||
return {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = icon .. " toggle [u]ndo tree" },
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
local ui = require("util.icons").ui
|
||||
local ui = require("fschauen.util.icons").ui
|
||||
|
||||
return {
|
||||
"lukas-reineke/virt-column.nvim",
|
27
config/nvim/lua/fschauen/plugins/whitespace.lua
Normal file
27
config/nvim/lua/fschauen/plugins/whitespace.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
"ntpeters/vim-better-whitespace",
|
||||
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
|
||||
init = function()
|
||||
vim.g.better_whitespace_filetypes_blacklist = {
|
||||
"diff",
|
||||
"fugitive",
|
||||
"git",
|
||||
"gitcommit",
|
||||
"help",
|
||||
}
|
||||
end,
|
||||
|
||||
keys = function()
|
||||
local icon = require("fschauen.util.icons").ui.Whitespace
|
||||
return {
|
||||
-- stylua: ignore start
|
||||
{ "<leader>ww", "<cmd>ToggleWhitespace<cr>", desc = icon.." toggle whitespace" },
|
||||
{ "<leader>wj", "<cmd>NextTrailingWhitespace<cr>", desc = icon.." next whitespace" },
|
||||
{ "<leader>wk", "<cmd>PrevTrailingWhitespace<cr>", desc = icon.." previous whitespace" },
|
||||
{ "<leader>W", "<cmd>StripWhitespace<cr>", desc = icon.." strip whitespace" },
|
||||
-- stylua: ignore end
|
||||
}
|
||||
end,
|
||||
}
|
|
@ -23,7 +23,7 @@ M.enable = function()
|
|||
return
|
||||
end
|
||||
|
||||
M._augroup = vim.api.nvim_create_augroup("custom.autoformat", { clear = true })
|
||||
M._augroup = vim.api.nvim_create_augroup("fschauen.autoformat", { clear = true })
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
desc = "Format files on write.",
|
||||
group = M._augroup,
|
|
@ -1,5 +1,8 @@
|
|||
local M = {}
|
||||
|
||||
local util = require("fschauen.util")
|
||||
local exists = util.exists
|
||||
|
||||
---Find lua module source.
|
||||
---@param modname string Module name.
|
||||
---@return table results List of source files in the runtime path that implement
|
||||
|
@ -9,8 +12,6 @@ local find_module_sources = function(modname)
|
|||
local base = "lua/" .. modname:gsub("%.", "/")
|
||||
local candidates = { base .. ".lua", base .. "/init.lua" }
|
||||
|
||||
local exists = require("util").exists
|
||||
|
||||
local results = {}
|
||||
for _, directory in ipairs(vim.opt.runtimepath:get()) do
|
||||
for _, candidate in ipairs(candidates) do
|
||||
|
@ -28,7 +29,8 @@ end
|
|||
M.execute_lines = function(first, last)
|
||||
first = first or vim.fn.line(".")
|
||||
last = last or first
|
||||
local code = vim.iter(vim.fn.getline(first, last)):join("\n")
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
local code = vim.fn.join(vim.fn.getline(first, last), "\n")
|
||||
loadstring(code)()
|
||||
end
|
||||
|
|
@ -3,7 +3,7 @@ local M = {}
|
|||
---Make a lualine component that is colored only when focused.
|
||||
---@param base table|string Either a lualine component or a component name.
|
||||
---@return table component
|
||||
M.colored_when_focused = function(base)
|
||||
M.dynamic_color = function(base)
|
||||
local component = {}
|
||||
|
||||
if type(base) == "string" then
|
||||
|
@ -19,14 +19,14 @@ M.colored_when_focused = function(base)
|
|||
self,
|
||||
vim.tbl_deep_extend("keep", options or {}, {
|
||||
colored = true,
|
||||
colored_when_focused = true,
|
||||
dynamic_color = true,
|
||||
})
|
||||
)
|
||||
self.saved_highlight = self.options.color_highlight
|
||||
end
|
||||
|
||||
function component:update_status(is_focused)
|
||||
if self.options.colored_when_focused then self.options.colored = is_focused end
|
||||
if self.options.dynamic_color then self.options.colored = is_focused end
|
||||
return component.super.update_status(self, is_focused)
|
||||
end
|
||||
|
|
@ -23,7 +23,7 @@ function M:update_status(is_focused)
|
|||
|
||||
local path = vim.fn.expand("%:~:.")
|
||||
|
||||
local window = require("util.window")
|
||||
local window = require("fschauen.util.window")
|
||||
if window.is_wide() then
|
||||
return path
|
||||
elseif window.is_medium() then
|
Loading…
Add table
Reference in a new issue