1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-01-29 15:17:53 +01:00
parent 677125cbe1
commit bcee7e3b07
38 changed files with 2330 additions and 1772 deletions

View file

@ -1,64 +1,64 @@
local autocmds = {
{ -- Handles the automatic line numeration changes
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{
pattern = "*",
command = "if &nu && mode() != \"i\" | set rnu | endif"
}
},
{ -- Handles the automatic line numeration changes
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{
pattern = "*",
command = "if &nu | set nornu | endif"
}
},
{ -- Use 'q' to quit from common plugins
'FileType',
{
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
callback = function()
vim.cmd [[
{ -- Handles the automatic line numeration changes
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{
pattern = "*",
command = 'if &nu && mode() != "i" | set rnu | endif',
},
},
{ -- Handles the automatic line numeration changes
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{
pattern = "*",
command = "if &nu | set nornu | endif",
},
},
{ -- Use 'q' to quit from common plugins
"FileType",
{
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
callback = function()
vim.cmd([[
nnoremap <silent> <buffer> q :close<CR>
set nobuflisted
]]
end
}
},
{
'Filetype',
{
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.spell = true
end,
}
},
{ -- Fix auto comment
'BufWinEnter',
{
command = "set formatoptions-=cro"
}
},
{ -- Highlight yanked text
'TextYankPost',
{
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end
}
}
]])
end,
},
},
{
"Filetype",
{
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.spell = true
end,
},
},
{ -- Fix auto comment
"BufWinEnter",
{
command = "set formatoptions-=cro",
},
},
{ -- Highlight yanked text
"TextYankPost",
{
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end,
},
},
}
vim.api.nvim_create_augroup('user_config', { clear = true })
vim.api.nvim_create_augroup("user_config", { clear = true })
for _, entry in ipairs(autocmds) do
local event = entry[1]
local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then
vim.api.nvim_create_augroup(opts.group, {})
end
end
vim.api.nvim_create_autocmd(event, opts)
local event = entry[1]
local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then
vim.api.nvim_create_augroup(opts.group, {})
end
end
vim.api.nvim_create_autocmd(event, opts)
end

View file

@ -1,24 +1,24 @@
local ansible_test = function(path, bufnr)
local find = { 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars', 'ansible.cfg', '.ansible-lint' }
local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path }
if (next(vim.fs.find(find, opts)) ~= nil) then
return 'yaml.ansible'
else
return 'yaml'
end
local find = { "tasks", "roles", "handlers", "group_vars", "host_vars", "ansible.cfg", ".ansible-lint" }
local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path }
if next(vim.fs.find(find, opts)) ~= nil then
return "yaml.ansible"
else
return "yaml"
end
end
local filetypes = {
extension = {
yml = ansible_test,
yaml = ansible_test,
},
filename = {
["Xresources"] = "xdefaults",
["Xdefaults"] = "xdefaults",
["xresources"] = "xdefaults",
["xdefaults"] = "xdefaults",
},
extension = {
yml = ansible_test,
yaml = ansible_test,
},
filename = {
["Xresources"] = "xdefaults",
["Xdefaults"] = "xdefaults",
["xresources"] = "xdefaults",
["xdefaults"] = "xdefaults",
},
}
vim.filetype.add(filetypes)

View file

@ -1,81 +1,81 @@
return {
Diagnostic = "󰭷",
Error = "󰅗",
Hint = "󰌵",
Info = "󰋼",
Warn = "󰀦",
Bug = "󰠭",
True = "󰸞",
Pending = "󰁪",
False = "󱎘",
Close = "󱎘",
Selected = "󰅂",
Console = "󰆍",
Gear = "󰒓",
Event = "󱐋",
File = "󰈔",
NewFile = "󰝒",
FileTree = "󰙅",
Import = "󰈠",
Keyboard = "󰌌",
Sleep = "󰒲",
Package = "󰏗",
Runtime = "",
Source = "󰈮",
Code = "",
Start = "",
Task = "󰱒",
Buffer = "󰧭",
Search = "",
Speed = "󰾆",
Test = "",
Flame = "",
Leave = "",
Git = "󰊢",
Loaded = "󰜄",
Unloaded = "󰛲",
Added = "󰜄",
Modified = "󱗝",
Removed = "󰛲",
Untracked = "",
ChangeDelete = "󰅘",
Truncate = "",
Note = "",
lspkind = {
Array = "󰅪",
Boolean = "",
Class = "󰌗",
Color = "",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "󰈔",
Folder = "󰉋",
Function = "",
Interface = "",
Key = "󰌆",
Keyword = "",
Method = "",
Module = "",
Namespace = "󰅪",
Null = "󰟢",
Number = "",
Object = "󰀚",
Operator = "",
Package = "󰏗",
Property = "",
Reference = "",
Snippet = "󰆐",
String = "󰀬",
Struct = "",
Text = "",
TypeParameter = "󰊄",
Unit = "",
Value = "",
Variable = "",
},
-- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" },
Diagnostic = "󰭷",
Error = "󰅗",
Hint = "󰌵",
Info = "󰋼",
Warn = "󰀦",
Bug = "󰠭",
True = "󰸞",
Pending = "󰁪",
False = "󱎘",
Close = "󱎘",
Selected = "󰅂",
Console = "󰆍",
Gear = "󰒓",
Event = "󱐋",
File = "󰈔",
NewFile = "󰝒",
FileTree = "󰙅",
Import = "󰈠",
Keyboard = "󰌌",
Sleep = "󰒲",
Package = "󰏗",
Runtime = "",
Source = "󰈮",
Code = "",
Start = "",
Task = "󰱒",
Buffer = "󰧭",
Search = "",
Speed = "󰾆",
Test = "",
Flame = "",
Leave = "",
Git = "󰊢",
Loaded = "󰜄",
Unloaded = "󰛲",
Added = "󰜄",
Modified = "󱗝",
Removed = "󰛲",
Untracked = "",
ChangeDelete = "󰅘",
Truncate = "",
Note = "",
lspkind = {
Array = "󰅪",
Boolean = "",
Class = "󰌗",
Color = "",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "󰈔",
Folder = "󰉋",
Function = "",
Interface = "",
Key = "󰌆",
Keyword = "",
Method = "",
Module = "",
Namespace = "󰅪",
Null = "󰟢",
Number = "",
Object = "󰀚",
Operator = "",
Package = "󰏗",
Property = "",
Reference = "",
Snippet = "󰆐",
String = "󰀬",
Struct = "",
Text = "",
TypeParameter = "󰊄",
Unit = "",
Value = "",
Variable = "",
},
-- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" },
}

View file

@ -5,17 +5,17 @@ local icons = require("config.icons")
local maps = f.empty_map_table()
M.sections = {
p = { desc = icons.Package .. " Packages" },
b = { desc = icons.Buffer .. " Buffers" },
bs = { desc = "Sort Buffers" },
d = { desc = icons.Bug .. " Debugger" },
g = { desc = icons.Git .. " Git" },
f = { desc = icons.Search .. " Find" },
l = { desc = icons.Code .. " LSP" },
t = { desc = icons.Console .. " Terminal" },
u = { desc = icons.Gear .. " Utility" },
n = { desc = icons.Note .. " Notes" },
e = { desc = icons.FileTree .. " File Manager" },
p = { desc = icons.Package .. " Packages" },
b = { desc = icons.Buffer .. " Buffers" },
bs = { desc = "Sort Buffers" },
d = { desc = icons.Bug .. " Debugger" },
g = { desc = icons.Git .. " Git" },
f = { desc = icons.Search .. " Find" },
l = { desc = icons.Code .. " LSP" },
t = { desc = icons.Console .. " Terminal" },
u = { desc = icons.Gear .. " Utility" },
n = { desc = icons.Note .. " Notes" },
e = { desc = icons.FileTree .. " File Manager" },
}
-- Standard --
@ -39,34 +39,40 @@ maps.i["<C-h>"] = { "<C-W>" }
-- Utility --
if f.is_available("nvim-colorizer.lua") then
maps.n["<Leader>u"] = M.sections.u
maps.n["<Leader>uc"] = { "<Cmd>ColorizerToggle<CR>", desc = "Toggle colorizer" }
maps.n["<Leader>u"] = M.sections.u
maps.n["<Leader>uc"] = { "<Cmd>ColorizerToggle<CR>", desc = "Toggle colorizer" }
end
-- Notes --
if f.is_available("zk-nvim") then
maps.n["<Leader>n"] = M.sections.n
maps.v["<Leader>n"] = maps.n["<Leader>n"]
maps.n["<Leader>nn"] = {
function() require("zk").new({ notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }) end,
desc = "New Note"
}
maps.v["<Leader>nnt"] = {
":ZkNewFromTitleSelection { notebook_path = vim.g.wikidir }<CR>",
desc = "New Note (Selection as title)"
}
maps.v["<Leader>nnc"] = {
":ZkNewFromContentSelection { notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }<CR>",
desc = "New Note (Selection as content)"
}
maps.n["<Leader>no"] = {
function() require("zk").edit({ notebook_path = vim.g.wikidir }) end,
desc = "Open Note"
}
maps.n["<Leader>ni"] = {
function() require("zk").index({ notebook_path = vim.g.wikidir }) end,
desc = "Index Notes"
}
maps.n["<Leader>n"] = M.sections.n
maps.v["<Leader>n"] = maps.n["<Leader>n"]
maps.n["<Leader>nn"] = {
function()
require("zk").new({ notebook_path = vim.g.wikidir, title = vim.fn.input("Title: ") })
end,
desc = "New Note",
}
maps.v["<Leader>nnt"] = {
":ZkNewFromTitleSelection { notebook_path = vim.g.wikidir }<CR>",
desc = "New Note (Selection as title)",
}
maps.v["<Leader>nnc"] = {
":ZkNewFromContentSelection { notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }<CR>",
desc = "New Note (Selection as content)",
}
maps.n["<Leader>no"] = {
function()
require("zk").edit({ notebook_path = vim.g.wikidir })
end,
desc = "Open Note",
}
maps.n["<Leader>ni"] = {
function()
require("zk").index({ notebook_path = vim.g.wikidir })
end,
desc = "Index Notes",
}
end
-- Window Navigation --
@ -85,238 +91,656 @@ maps.t["<C-l>"] = { "<Cmd>wincmd l<cr>", desc = "Terminal right window navigatio
-- Plugin Manager --
maps.n["<Leader>p"] = M.sections.p
maps.n["<Leader>ph"] = { function() require("lazy").home() end, desc = "Home" }
maps.n["<Leader>pi"] = { function() require("lazy").install() end, desc = "Install" }
maps.n["<Leader>pu"] = { function() require("lazy").update() end, desc = "Update" }
maps.n["<Leader>ps"] = { function() require("lazy").sync() end, desc = "Sync" }
maps.n["<Leader>px"] = { function() require("lazy").clean() end, desc = "Clean" }
maps.n["<Leader>pc"] = { function() require("lazy").check() end, desc = "Check" }
maps.n["<Leader>pl"] = { function() require("lazy").log() end, desc = "Log" }
maps.n["<Leader>pr"] = { function() require("lazy").restore() end, desc = "Restore" }
maps.n["<Leader>pp"] = { function() require("lazy").profile() end, desc = "Profile" }
maps.n["<Leader>pd"] = { function() require("lazy").debug() end, desc = "Debug" }
maps.n["<Leader>p?"] = { function() require("lazy").help() end, desc = "Help" }
maps.n["<Leader>ph"] = {
function()
require("lazy").home()
end,
desc = "Home",
}
maps.n["<Leader>pi"] = {
function()
require("lazy").install()
end,
desc = "Install",
}
maps.n["<Leader>pu"] = {
function()
require("lazy").update()
end,
desc = "Update",
}
maps.n["<Leader>ps"] = {
function()
require("lazy").sync()
end,
desc = "Sync",
}
maps.n["<Leader>px"] = {
function()
require("lazy").clean()
end,
desc = "Clean",
}
maps.n["<Leader>pc"] = {
function()
require("lazy").check()
end,
desc = "Check",
}
maps.n["<Leader>pl"] = {
function()
require("lazy").log()
end,
desc = "Log",
}
maps.n["<Leader>pr"] = {
function()
require("lazy").restore()
end,
desc = "Restore",
}
maps.n["<Leader>pp"] = {
function()
require("lazy").profile()
end,
desc = "Profile",
}
maps.n["<Leader>pd"] = {
function()
require("lazy").debug()
end,
desc = "Debug",
}
maps.n["<Leader>p?"] = {
function()
require("lazy").help()
end,
desc = "Help",
}
if f.is_available("bufferline.nvim") then
maps.n["<S-l>"] = { function() require("bufferline").cycle(1) end, desc = "Switch to next buffer" }
maps.n["<S-h>"] = { function() require("bufferline").cycle(-1) end, desc = "Switch to previous buffer" }
maps.n["<A-l>"] = { function() require("bufferline").move(1) end, desc = "Move buffer to next" }
maps.n["<A-h>"] = { function() require("bufferline").move(-1) end, desc = "Move buffer to previous" }
maps.n["<Leader>b"] = M.sections.b
maps.n["<Leader>bc"] = { function() require("bufferline").close_others() end, desc = "Close other buffers" }
maps.n["<Leader>bl"] = {
function() require("bufferline").close_in_direction("left") end,
desc = "Close lefthand buffers"
}
maps.n["<Leader>br"] = {
function() require("bufferline").close_in_direction("right") end,
desc = "Close righthand buffers"
}
maps.n["<Leader>bs"] = M.sections.bs
maps.n["<Leader>bse"] = { function() require("bufferline").sort_by("extension") end, desc = "By extension" }
maps.n["<Leader>bsd"] = { function() require("bufferline").sort_by("directory") end, desc = "By directory" }
maps.n["<Leader>bsr"] = {
function() require("bufferline").sort_by("relative_directory") end,
desc = "By relative directory"
}
maps.n["<Leader>bst"] = { function() require("bufferline").sort_by("tabs") end, desc = "By tabs" }
maps.n["<S-l>"] = {
function()
require("bufferline").cycle(1)
end,
desc = "Switch to next buffer",
}
maps.n["<S-h>"] = {
function()
require("bufferline").cycle(-1)
end,
desc = "Switch to previous buffer",
}
maps.n["<A-l>"] = {
function()
require("bufferline").move(1)
end,
desc = "Move buffer to next",
}
maps.n["<A-h>"] = {
function()
require("bufferline").move(-1)
end,
desc = "Move buffer to previous",
}
maps.n["<Leader>b"] = M.sections.b
maps.n["<Leader>bc"] = {
function()
require("bufferline").close_others()
end,
desc = "Close other buffers",
}
maps.n["<Leader>bl"] = {
function()
require("bufferline").close_in_direction("left")
end,
desc = "Close lefthand buffers",
}
maps.n["<Leader>br"] = {
function()
require("bufferline").close_in_direction("right")
end,
desc = "Close righthand buffers",
}
maps.n["<Leader>bs"] = M.sections.bs
maps.n["<Leader>bse"] = {
function()
require("bufferline").sort_by("extension")
end,
desc = "By extension",
}
maps.n["<Leader>bsd"] = {
function()
require("bufferline").sort_by("directory")
end,
desc = "By directory",
}
maps.n["<Leader>bsr"] = {
function()
require("bufferline").sort_by("relative_directory")
end,
desc = "By relative directory",
}
maps.n["<Leader>bst"] = {
function()
require("bufferline").sort_by("tabs")
end,
desc = "By tabs",
}
end
if f.is_available("Comment.nvim") then
maps.n["<Leader>/"] = {
function() require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) end,
desc = "Toggle comment line",
}
maps.v["<Leader>/"] = {
"<esc><Cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
desc = "Toggle comment for selection",
}
maps.n["<Leader>/"] = {
function()
require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1)
end,
desc = "Toggle comment line",
}
maps.v["<Leader>/"] = {
"<esc><Cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
desc = "Toggle comment for selection",
}
end
if f.is_available("gitsigns.nvim") then
maps.n["<Leader>g"] = M.sections.g
maps.n["]g"] = { function() require("gitsigns").next_hunk() end, desc = "Next Git hunk" }
maps.n["[g"] = { function() require("gitsigns").prev_hunk() end, desc = "Previous Git hunk" }
maps.n["<Leader>gl"] = { function() require("gitsigns").blame_line() end, desc = "View Git blame" }
maps.n["<Leader>gL"] = { function() require("gitsigns").blame_line { full = true } end, desc = "View full Git blame" }
maps.n["<Leader>gp"] = { function() require("gitsigns").preview_hunk() end, desc = "Preview Git hunk" }
maps.n["<Leader>gh"] = { function() require("gitsigns").reset_hunk() end, desc = "Reset Git hunk" }
maps.n["<Leader>gr"] = { function() require("gitsigns").reset_buffer() end, desc = "Reset Git buffer" }
maps.n["<Leader>gs"] = { function() require("gitsigns").stage_hunk() end, desc = "Stage Git hunk" }
maps.n["<Leader>gS"] = { function() require("gitsigns").stage_buffer() end, desc = "Stage Git buffer" }
maps.n["<Leader>gu"] = { function() require("gitsigns").undo_stage_hunk() end, desc = "Unstage Git hunk" }
maps.n["<Leader>gd"] = { function() require("gitsigns").diffthis() end, desc = "View Git diff" }
maps.n["<Leader>g"] = M.sections.g
maps.n["]g"] = {
function()
require("gitsigns").next_hunk()
end,
desc = "Next Git hunk",
}
maps.n["[g"] = {
function()
require("gitsigns").prev_hunk()
end,
desc = "Previous Git hunk",
}
maps.n["<Leader>gl"] = {
function()
require("gitsigns").blame_line()
end,
desc = "View Git blame",
}
maps.n["<Leader>gL"] = {
function()
require("gitsigns").blame_line({ full = true })
end,
desc = "View full Git blame",
}
maps.n["<Leader>gp"] = {
function()
require("gitsigns").preview_hunk()
end,
desc = "Preview Git hunk",
}
maps.n["<Leader>gh"] = {
function()
require("gitsigns").reset_hunk()
end,
desc = "Reset Git hunk",
}
maps.n["<Leader>gr"] = {
function()
require("gitsigns").reset_buffer()
end,
desc = "Reset Git buffer",
}
maps.n["<Leader>gs"] = {
function()
require("gitsigns").stage_hunk()
end,
desc = "Stage Git hunk",
}
maps.n["<Leader>gS"] = {
function()
require("gitsigns").stage_buffer()
end,
desc = "Stage Git buffer",
}
maps.n["<Leader>gu"] = {
function()
require("gitsigns").undo_stage_hunk()
end,
desc = "Unstage Git hunk",
}
maps.n["<Leader>gd"] = {
function()
require("gitsigns").diffthis()
end,
desc = "View Git diff",
}
end
if f.is_available("taolf") then
maps.n["<Leader>e"] = M.sections.e
maps.n["E"] = { function() require("taolf").start({ dir = "fd" }) end, desc = "File manager" }
maps.n["gE"] = { "<Noop>" }
maps.n["<Leader>ee"] = { function() require("taolf").start() end, desc = "File manager" }
maps.n["<Leader>eg"] = { function() require("taolf").start({ dir = "gwd" }) end, desc = "File manager in git working directory" }
maps.n["<Leader>ef"] = { function() require("taolf").start({ dir = "fd" }) end, desc = "File manager in open file's working directory" }
maps.n["<Leader>e"] = M.sections.e
maps.n["E"] = {
function()
require("taolf").start({ dir = "fd" })
end,
desc = "File manager",
}
maps.n["gE"] = { "<Noop>" }
maps.n["<Leader>ee"] = {
function()
require("taolf").start()
end,
desc = "File manager",
}
maps.n["<Leader>eg"] = {
function()
require("taolf").start({ dir = "gwd" })
end,
desc = "File manager in git working directory",
}
maps.n["<Leader>ef"] = {
function()
require("taolf").start({ dir = "fd" })
end,
desc = "File manager in open file's working directory",
}
end
if f.is_available("mason.nvim") then
maps.n["<Leader>pm"] = { "<Cmd>Mason<cr>", desc = "Mason" }
maps.n["<Leader>pm"] = { "<Cmd>Mason<cr>", desc = "Mason" }
end
if f.is_available "aerial.nvim" then
maps.n["<leader>l"] = M.sections.l
maps.n["<leader>lS"] = { function() require("aerial").toggle() end, desc = "Symbols outline" }
if f.is_available("aerial.nvim") then
maps.n["<leader>l"] = M.sections.l
maps.n["<leader>lS"] = {
function()
require("aerial").toggle()
end,
desc = "Symbols outline",
}
end
if f.is_available("telescope.nvim") then
maps.n["<Leader>f"] = M.sections.f
maps.n["<Leader>g"] = M.sections.g
maps.n["<Leader>gb"] = {
function() require("telescope.builtin").git_branches { use_file_path = true } end,
desc = "Git branches"
}
maps.n["<Leader>gc"] = {
function() require("telescope.builtin").git_commits { use_file_path = true } end,
desc = "Git commits (repository)",
}
maps.n["<Leader>gC"] = {
function() require("telescope.builtin").git_bcommits { use_file_path = true } end,
desc = "Git commits (current file)",
}
maps.n["<Leader>gt"] = {
function() require("telescope.builtin").git_status { use_file_path = true } end,
desc = "Git status"
}
maps.n["<Leader>f<CR>"] = { function() require("telescope.builtin").resume() end, desc = "Resume previous search" }
maps.n["<Leader>f'"] = { function() require("telescope.builtin").marks() end, desc = "Find marks" }
maps.n["<Leader>f/"] = {
function() require("telescope.builtin").current_buffer_fuzzy_find() end,
desc = "Find words in current buffer"
}
maps.n["<Leader>fc"] = { function() require("telescope.builtin").grep_string() end, desc = "Find word under cursor" }
maps.n["<Leader>fC"] = { function() require("telescope.builtin").commands() end, desc = "Find commands" }
maps.n["<Leader>ff"] = { function() require("telescope.builtin").find_files() end, desc = "Find files" }
maps.n["<Leader>fF"] = {
function() require("telescope.builtin").find_files({ hidden = true, no_ignore = true }) end,
desc = "Find all files",
}
maps.n["<Leader>fh"] = { function() require("telescope.builtin").help_tags() end, desc = "Find help" }
maps.n["<Leader>fk"] = { function() require("telescope.builtin").keymaps() end, desc = "Find keymaps" }
maps.n["<Leader>fm"] = { function() require("telescope.builtin").man_pages() end, desc = "Find man" }
maps.n["<Leader>fo"] = { function() require("telescope.builtin").oldfiles() end, desc = "Find history" }
maps.n["<Leader>fr"] = { function() require("telescope.builtin").registers() end, desc = "Find registers" }
maps.n["<Leader>fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Find words" }
-- maps.n["<Leader>fb"] = { function() require("telescope.builtin").buffers() end, desc = "Find buffers" }
maps.n["<Leader>ft"] = {
function() require("telescope").extensions["todo-comments"].todo() end,
desc =
"Find buffers"
}
maps.n["<Leader>fW"] = {
function()
require("telescope.builtin").live_grep({
additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end,
})
end,
desc = "Find words in all files",
}
maps.n["<Leader>l"] = M.sections.l
maps.n["<Leader>ls"] = {
function()
local aerial_avail, _ = pcall(require, "aerial")
if aerial_avail then
require("telescope").extensions.aerial.aerial()
else
require("telescope.builtin").lsp_document_symbols()
end
end,
desc = "Search symbols",
}
maps.n["<Leader>f"] = M.sections.f
maps.n["<Leader>g"] = M.sections.g
maps.n["<Leader>gb"] = {
function()
require("telescope.builtin").git_branches({ use_file_path = true })
end,
desc = "Git branches",
}
maps.n["<Leader>gc"] = {
function()
require("telescope.builtin").git_commits({ use_file_path = true })
end,
desc = "Git commits (repository)",
}
maps.n["<Leader>gC"] = {
function()
require("telescope.builtin").git_bcommits({ use_file_path = true })
end,
desc = "Git commits (current file)",
}
maps.n["<Leader>gt"] = {
function()
require("telescope.builtin").git_status({ use_file_path = true })
end,
desc = "Git status",
}
maps.n["<Leader>f<CR>"] = {
function()
require("telescope.builtin").resume()
end,
desc = "Resume previous search",
}
maps.n["<Leader>f'"] = {
function()
require("telescope.builtin").marks()
end,
desc = "Find marks",
}
maps.n["<Leader>f/"] = {
function()
require("telescope.builtin").current_buffer_fuzzy_find()
end,
desc = "Find words in current buffer",
}
maps.n["<Leader>fc"] = {
function()
require("telescope.builtin").grep_string()
end,
desc = "Find word under cursor",
}
maps.n["<Leader>fC"] = {
function()
require("telescope.builtin").commands()
end,
desc = "Find commands",
}
maps.n["<Leader>ff"] = {
function()
require("telescope.builtin").find_files()
end,
desc = "Find files",
}
maps.n["<Leader>fF"] = {
function()
require("telescope.builtin").find_files({ hidden = true, no_ignore = true })
end,
desc = "Find all files",
}
maps.n["<Leader>fh"] = {
function()
require("telescope.builtin").help_tags()
end,
desc = "Find help",
}
maps.n["<Leader>fk"] = {
function()
require("telescope.builtin").keymaps()
end,
desc = "Find keymaps",
}
maps.n["<Leader>fm"] = {
function()
require("telescope.builtin").man_pages()
end,
desc = "Find man",
}
maps.n["<Leader>fo"] = {
function()
require("telescope.builtin").oldfiles()
end,
desc = "Find history",
}
maps.n["<Leader>fr"] = {
function()
require("telescope.builtin").registers()
end,
desc = "Find registers",
}
maps.n["<Leader>fw"] = {
function()
require("telescope.builtin").live_grep()
end,
desc = "Find words",
}
-- maps.n["<Leader>fb"] = { function() require("telescope.builtin").buffers() end, desc = "Find buffers" }
maps.n["<Leader>ft"] = {
function()
require("telescope").extensions["todo-comments"].todo()
end,
desc = "Find buffers",
}
maps.n["<Leader>fW"] = {
function()
require("telescope.builtin").live_grep({
additional_args = function(args)
return vim.list_extend(args, { "--hidden", "--no-ignore" })
end,
})
end,
desc = "Find words in all files",
}
maps.n["<Leader>l"] = M.sections.l
maps.n["<Leader>ls"] = {
function()
local aerial_avail, _ = pcall(require, "aerial")
if aerial_avail then
require("telescope").extensions.aerial.aerial()
else
require("telescope.builtin").lsp_document_symbols()
end
end,
desc = "Search symbols",
}
end
if f.is_available("toggleterm.nvim") then
maps.n["<leader>t"] = M.sections.t
if vim.fn.executable "lazygit" == 1 then
maps.n["<leader>g"] = M.sections.g
maps.n["<leader>gg"] = {
function()
local worktree = f.file_worktree()
local flags = worktree
and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir)
or ""
f.toggle_term_cmd("lazygit " .. flags)
end,
desc = "ToggleTerm lazygit",
}
maps.n["<leader>tl"] = maps.n["<leader>gg"]
end
if vim.fn.executable "node" == 1 then
maps.n["<leader>tn"] = { function() f.toggle_term_cmd "node" end, desc = "ToggleTerm node" }
end
if vim.fn.executable("gdu") == 1 then
maps.n["<leader>tu"] = { function() f.toggle_term_cmd("gdu") end, desc = "ToggleTerm gdu" }
end
if vim.fn.executable "btm" == 1 then
maps.n["<leader>tt"] = { function() f.toggle_term_cmd "btm" end, desc = "ToggleTerm btm" }
end
local python = vim.fn.executable "python" == 1 and "python" or vim.fn.executable "python3" == 1 and "python3"
if python then maps.n["<leader>tp"] = { function() f.toggle_term_cmd(python) end, desc = "ToggleTerm python" } end
maps.n["<leader>tf"] = { "<Cmd>ToggleTerm direction=float<cr>", desc = "ToggleTerm float" }
maps.n["<leader>th"] = { "<Cmd>ToggleTerm direction=horizontal<cr>", desc = "ToggleTerm horizontal split" }
maps.n["<C-z>"] = { "<Cmd>ToggleTerm<cr>", desc = "Toggle terminal" }
maps.t["<C-z>"] = maps.n["<F7>"]
maps.n["<leader>t"] = M.sections.t
if vim.fn.executable("lazygit") == 1 then
maps.n["<leader>g"] = M.sections.g
maps.n["<leader>gg"] = {
function()
local worktree = f.file_worktree()
local flags = worktree and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir)
or ""
f.toggle_term_cmd("lazygit " .. flags)
end,
desc = "ToggleTerm lazygit",
}
maps.n["<leader>tl"] = maps.n["<leader>gg"]
end
if vim.fn.executable("node") == 1 then
maps.n["<leader>tn"] = {
function()
f.toggle_term_cmd("node")
end,
desc = "ToggleTerm node",
}
end
if vim.fn.executable("gdu") == 1 then
maps.n["<leader>tu"] = {
function()
f.toggle_term_cmd("gdu")
end,
desc = "ToggleTerm gdu",
}
end
if vim.fn.executable("btm") == 1 then
maps.n["<leader>tt"] = {
function()
f.toggle_term_cmd("btm")
end,
desc = "ToggleTerm btm",
}
end
local python = vim.fn.executable("python") == 1 and "python" or vim.fn.executable("python3") == 1 and "python3"
if python then
maps.n["<leader>tp"] = {
function()
f.toggle_term_cmd(python)
end,
desc = "ToggleTerm python",
}
end
maps.n["<leader>tf"] = { "<Cmd>ToggleTerm direction=float<cr>", desc = "ToggleTerm float" }
maps.n["<leader>th"] = { "<Cmd>ToggleTerm direction=horizontal<cr>", desc = "ToggleTerm horizontal split" }
maps.n["<C-z>"] = { "<Cmd>ToggleTerm<cr>", desc = "Toggle terminal" }
maps.t["<C-z>"] = maps.n["<F7>"]
end
if f.is_available "nvim-dap" then
local conditional_breakpoint = function()
vim.ui.input({ prompt = "Condition: " }, function(condition)
if condition then require("dap").set_breakpoint(condition) end
end)
end
maps.n["<leader>d"] = M.sections.d
maps.v["<leader>d"] = M.sections.d
maps.n["<F5>"] = { function() require("dap").continue() end, desc = "Debugger: Start" }
maps.n["<S-F5>"] = { function() require("dap").terminate() end, desc = "Debugger: Stop" }
maps.n["<S-F9>"] = { conditional_breakpoint, desc = "Debugger: Conditional Breakpoint" }
maps.n["<C-F5>"] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" }
maps.n["<F6>"] = { function() require("dap").pause() end, desc = "Debugger: Pause" }
maps.n["<F9>"] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" }
maps.n["<F10>"] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" }
maps.n["<F11>"] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" }
maps.n["<S-F11>"] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" }
maps.n["<leader>db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" }
maps.n["<leader>dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" }
maps.n["<leader>dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" }
maps.n["<leader>dC"] = { conditional_breakpoint, desc = "Conditional Breakpoint (S-F9)" }
maps.n["<leader>di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" }
maps.n["<leader>do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" }
maps.n["<leader>dO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" }
maps.n["<leader>dq"] = { function() require("dap").close() end, desc = "Close Session" }
maps.n["<leader>dQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" }
maps.n["<leader>dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" }
maps.n["<leader>dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" }
maps.n["<leader>dR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" }
maps.n["<leader>ds"] = { function() require("dap").run_to_cursor() end, desc = "Run To Cursor" }
if f.is_available("nvim-dap") then
local conditional_breakpoint = function()
vim.ui.input({ prompt = "Condition: " }, function(condition)
if condition then
require("dap").set_breakpoint(condition)
end
end)
end
maps.n["<leader>d"] = M.sections.d
maps.v["<leader>d"] = M.sections.d
maps.n["<F5>"] = {
function()
require("dap").continue()
end,
desc = "Debugger: Start",
}
maps.n["<S-F5>"] = {
function()
require("dap").terminate()
end,
desc = "Debugger: Stop",
}
maps.n["<S-F9>"] = { conditional_breakpoint, desc = "Debugger: Conditional Breakpoint" }
maps.n["<C-F5>"] = {
function()
require("dap").restart_frame()
end,
desc = "Debugger: Restart",
}
maps.n["<F6>"] = {
function()
require("dap").pause()
end,
desc = "Debugger: Pause",
}
maps.n["<F9>"] = {
function()
require("dap").toggle_breakpoint()
end,
desc = "Debugger: Toggle Breakpoint",
}
maps.n["<F10>"] = {
function()
require("dap").step_over()
end,
desc = "Debugger: Step Over",
}
maps.n["<F11>"] = {
function()
require("dap").step_into()
end,
desc = "Debugger: Step Into",
}
maps.n["<S-F11>"] = {
function()
require("dap").step_out()
end,
desc = "Debugger: Step Out",
}
maps.n["<leader>db"] = {
function()
require("dap").toggle_breakpoint()
end,
desc = "Toggle Breakpoint (F9)",
}
maps.n["<leader>dB"] = {
function()
require("dap").clear_breakpoints()
end,
desc = "Clear Breakpoints",
}
maps.n["<leader>dc"] = {
function()
require("dap").continue()
end,
desc = "Start/Continue (F5)",
}
maps.n["<leader>dC"] = { conditional_breakpoint, desc = "Conditional Breakpoint (S-F9)" }
maps.n["<leader>di"] = {
function()
require("dap").step_into()
end,
desc = "Step Into (F11)",
}
maps.n["<leader>do"] = {
function()
require("dap").step_over()
end,
desc = "Step Over (F10)",
}
maps.n["<leader>dO"] = {
function()
require("dap").step_out()
end,
desc = "Step Out (S-F11)",
}
maps.n["<leader>dq"] = {
function()
require("dap").close()
end,
desc = "Close Session",
}
maps.n["<leader>dQ"] = {
function()
require("dap").terminate()
end,
desc = "Terminate Session (S-F5)",
}
maps.n["<leader>dp"] = {
function()
require("dap").pause()
end,
desc = "Pause (F6)",
}
maps.n["<leader>dr"] = {
function()
require("dap").restart_frame()
end,
desc = "Restart (C-F5)",
}
maps.n["<leader>dR"] = {
function()
require("dap").repl.toggle()
end,
desc = "Toggle REPL",
}
maps.n["<leader>ds"] = {
function()
require("dap").run_to_cursor()
end,
desc = "Run To Cursor",
}
if f.is_available "nvim-dap-ui" then
maps.n["<leader>dE"] = {
function()
vim.ui.input({ prompt = "Expression: " }, function(expr)
if expr then require("dapui").eval(expr, { enter = true }) end
end)
end,
desc = "Evaluate Input",
}
maps.v["<leader>dE"] = { function() require("dapui").eval() end, desc = "Evaluate Input" }
maps.n["<leader>du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" }
maps.n["<leader>dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" }
end
if f.is_available("nvim-dap-ui") then
maps.n["<leader>dE"] = {
function()
vim.ui.input({ prompt = "Expression: " }, function(expr)
if expr then
require("dapui").eval(expr, { enter = true })
end
end)
end,
desc = "Evaluate Input",
}
maps.v["<leader>dE"] = {
function()
require("dapui").eval()
end,
desc = "Evaluate Input",
}
maps.n["<leader>du"] = {
function()
require("dapui").toggle()
end,
desc = "Toggle Debugger UI",
}
maps.n["<leader>dh"] = {
function()
require("dap.ui.widgets").hover()
end,
desc = "Debugger Hover",
}
end
end
if f.is_available "nvim-ufo" then
maps.n["zR"] = { function() require("ufo").openAllFolds() end, desc = "Open all folds" }
maps.n["zM"] = { function() require("ufo").closeAllFolds() end, desc = "Close all folds" }
maps.n["zr"] = { function() require("ufo").openFoldsExceptKinds() end, desc = "Fold less" }
maps.n["zm"] = { function() require("ufo").closeFoldsWith() end, desc = "Fold more" }
maps.n["zp"] = { function() require("ufo").peekFoldedLinesUnderCursor() end, desc = "Peek fold" }
if f.is_available("nvim-ufo") then
maps.n["zR"] = {
function()
require("ufo").openAllFolds()
end,
desc = "Open all folds",
}
maps.n["zM"] = {
function()
require("ufo").closeAllFolds()
end,
desc = "Close all folds",
}
maps.n["zr"] = {
function()
require("ufo").openFoldsExceptKinds()
end,
desc = "Fold less",
}
maps.n["zm"] = {
function()
require("ufo").closeFoldsWith()
end,
desc = "Fold more",
}
maps.n["zp"] = {
function()
require("ufo").peekFoldedLinesUnderCursor()
end,
desc = "Peek fold",
}
end
M.maps = maps

View file

@ -1,22 +1,22 @@
local conf = { handlers = {}, required = {} }
conf.handlers["intelephense"] = {
init_options = {
storagePath = os.getenv('XDG_CACHE_HOME') .. '/intelephense',
globalStoragePath = os.getenv('XDG_CONFIG_HOME') .. '/intelephense',
licenceKey = os.getenv('XDG_CONFIG_HOME') .. '/intelephense/license.txt',
}
init_options = {
storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",
globalStoragePath = os.getenv("XDG_CONFIG_HOME") .. "/intelephense",
licenceKey = os.getenv("XDG_CONFIG_HOME") .. "/intelephense/license.txt",
},
}
conf.handlers["bashls"] = {
settings = {
bashIde = {
shellcheckPath = vim.fn.stdpath "data" .. "mason/bin/shellcheck"
}
}
settings = {
bashIde = {
shellcheckPath = vim.fn.stdpath("data") .. "mason/bin/shellcheck",
},
},
}
conf.required = { "lua_ls", "zk" }
conf.required = { "lua_ls", "zk", "bashls" }
conf.ignore = { "rust_analyzer" } -- This will be setup by rustacean.nvim
return conf

View file

@ -1,53 +1,53 @@
local g = vim.g
local o = vim.opt
local d = vim.diagnostic.config
local g = vim.g
local o = vim.opt
local d = vim.diagnostic.config
g.wikidir = os.getenv("XDG_DOCUMENTS_DIR") .. "/wiki"
g.mapleader = " "
g.maplocalleader = " "
g.wikidir = os.getenv("XDG_DOCUMENTS_DIR") .. "/wiki"
g.mapleader = " "
g.maplocalleader = " "
g.vim_json_conceal = 0
g.git_worktrees = {
{ toplevel = vim.env.HOME, gitdir = vim.env.XDG_DATA_HOME .. "/dots" },
g.git_worktrees = {
{ toplevel = vim.env.HOME, gitdir = vim.env.XDG_DATA_HOME .. "/dots" },
}
g.max_lines = 1000
g.max_size = 1024 * 100
g.max_lines = 1000
g.max_size = 1024 * 100
o.undodir = vim.fn.stdpath "cache" .. "/undo"
o.clipboard = "unnamedplus"
o.conceallevel = 0
o.numberwidth = 3
o.hlsearch = true
o.ignorecase = true
o.showmode = false
o.smartindent = true
o.splitbelow = true
o.splitbelow = true
o.splitbelow = true
o.updatetime = 250
o.writebackup = false
o.expandtab = true
o.shiftwidth = 4
o.tabstop = 4
o.cursorline = true
o.signcolumn = "yes"
o.wrap = false
o.scrolloff = 8
o.sidescrolloff = 8
o.undofile = true
o.title = true
o.mouse = ""
o.backspace = "indent,eol,start"
o.termguicolors = true
o.timeoutlen = 500
o.foldenable = true
o.foldmethod = "expr"
o.foldlevelstart = 99
o.foldexpr = "nvim_treesitter#foldexpr()"
o.number = true
o.relativenumber = true
o.laststatus = 3
o.modeline = true
o.modelines = 3
o.listchars = "eol:$,tab:>-,trail:~,extends:>,precedes:<"
o.undodir = vim.fn.stdpath("cache") .. "/undo"
o.clipboard = "unnamedplus"
o.conceallevel = 0
o.numberwidth = 3
o.hlsearch = true
o.ignorecase = true
o.showmode = false
o.smartindent = true
o.splitbelow = true
o.splitbelow = true
o.splitbelow = true
o.updatetime = 250
o.writebackup = false
o.expandtab = true
o.shiftwidth = 4
o.tabstop = 4
o.cursorline = true
o.signcolumn = "yes"
o.wrap = false
o.scrolloff = 8
o.sidescrolloff = 8
o.undofile = true
o.title = true
o.mouse = ""
o.backspace = "indent,eol,start"
o.termguicolors = true
o.timeoutlen = 500
o.foldenable = true
o.foldmethod = "expr"
o.foldlevelstart = 99
o.foldexpr = "nvim_treesitter#foldexpr()"
o.number = true
o.relativenumber = true
o.laststatus = 3
o.modeline = true
o.modelines = 3
o.listchars = "eol:$,tab:>-,trail:~,extends:>,precedes:<"
d({ virtual_text = false })

View file

@ -2,461 +2,569 @@ local M = {}
local icons = require("config.icons")
function M.set_title()
local title = " %t"
local f = io.popen([[zsh -c '
local title = " %t"
local f = io.popen([[zsh -c '
source $XDG_CONFIG_HOME/zsh/configs/autogenerated/hashes
print -Pn "$USER@$HOST [%3~] "
']])
if f ~= nil then
title = f:read("*a") or ""
title = title .. " %t"
f:close()
end
vim.opt.titlestring = title
if f ~= nil then
title = f:read("*a") or ""
title = title .. " %t"
f:close()
end
vim.opt.titlestring = title
end
function M.buf_close(bufnr, force)
local kill_command = "bd"
local kill_command = "bd"
local bo = vim.bo
local api = vim.api
local fnamemodify = vim.fn.fnamemodify
local bo = vim.bo
local api = vim.api
local fnamemodify = vim.fn.fnamemodify
if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf()
end
if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf()
end
local bufname = api.nvim_buf_get_name(bufnr)
local bufname = api.nvim_buf_get_name(bufnr)
if not force then
local warning
if bo[bufnr].modified then
warning = string.format([[No write since last change for (%s)]], fnamemodify(bufname, ":t"))
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
warning = string.format([[Terminal %s will be killed]], bufname)
end
if warning then
vim.ui.input({
prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning),
}, function(choice)
if choice:match "ye?s?" then force = true end
end)
if not force then return end
end
end
if not force then
local warning
if bo[bufnr].modified then
warning = string.format([[No write since last change for (%s)]], fnamemodify(bufname, ":t"))
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
warning = string.format([[Terminal %s will be killed]], bufname)
end
if warning then
vim.ui.input({
prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning),
}, function(choice)
if choice:match("ye?s?") then
force = true
end
end)
if not force then
return
end
end
end
-- Get list of window IDs with the buffer to close
local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins())
-- Get list of window IDs with the buffer to close
local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins())
if #windows == 0 then return end
if #windows == 0 then
return
end
if force then
kill_command = kill_command .. "!"
end
if force then
kill_command = kill_command .. "!"
end
-- Get list of active buffers
local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs())
-- Get list of active buffers
local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs())
-- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 then
for i, v in ipairs(buffers) do
if v == bufnr then
local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1)
local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer)
end
end
end
else
vim.cmd('q!')
end
-- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 then
for i, v in ipairs(buffers) do
if v == bufnr then
local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1)
local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer)
end
end
end
else
vim.cmd("q!")
end
-- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr))
end
-- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr))
end
end
function M.is_available(plugin)
local lazy_config_avail, lazy_config = pcall(require, "lazy.core.config")
return lazy_config_avail and lazy_config.spec.plugins[plugin] ~= nil
local lazy_config_avail, lazy_config = pcall(require, "lazy.core.config")
return lazy_config_avail and lazy_config.spec.plugins[plugin] ~= nil
end
function M.empty_map_table()
local maps = {}
for _, mode in ipairs { "", "n", "v", "x", "s", "o", "!", "i", "l", "c", "t" } do
maps[mode] = {}
end
-- TODO: Check this on 0.10.0 release
if vim.fn.has "nvim-0.10.0" == 1 then
for _, abbr_mode in ipairs { "ia", "ca", "!a" } do
maps[abbr_mode] = {}
end
end
return maps
local maps = {}
for _, mode in ipairs({ "", "n", "v", "x", "s", "o", "!", "i", "l", "c", "t" }) do
maps[mode] = {}
end
-- TODO: Check this on 0.10.0 release
if vim.fn.has("nvim-0.10.0") == 1 then
for _, abbr_mode in ipairs({ "ia", "ca", "!a" }) do
maps[abbr_mode] = {}
end
end
return maps
end
function M.toggle_term_cmd(opts)
if not vim.g.user_terminals then
vim.g.user_terminals = {}
end
local terms = vim.g.user_terminals
if type(opts) == "string" then opts = { cmd = opts, hidden = true } end
local num = vim.v.count > 0 and vim.v.count or 1
if not terms[opts.cmd] then terms[opts.cmd] = {} end
if not terms[opts.cmd][num] then
if not opts.count then opts.count = vim.tbl_count(terms) * 100 + num end
if not opts.on_exit then opts.on_exit = function() terms[opts.cmd][num] = nil end end
terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts)
end
terms[opts.cmd][num]:toggle()
if not vim.g.user_terminals then
vim.g.user_terminals = {}
end
local terms = vim.g.user_terminals
if type(opts) == "string" then
opts = { cmd = opts, hidden = true }
end
local num = vim.v.count > 0 and vim.v.count or 1
if not terms[opts.cmd] then
terms[opts.cmd] = {}
end
if not terms[opts.cmd][num] then
if not opts.count then
opts.count = vim.tbl_count(terms) * 100 + num
end
if not opts.on_exit then
opts.on_exit = function()
terms[opts.cmd][num] = nil
end
end
terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts)
end
terms[opts.cmd][num]:toggle()
end
function M.cmd(cmd, show_error)
if type(cmd) == "string" then cmd = { cmd } end
local result = vim.fn.system(cmd)
local success = vim.api.nvim_get_vvar "shell_error" == 0
if not success and (show_error == nil or show_error) then
vim.api.nvim_err_writeln(("Error running command %s\nError message:\n%s"):format(table.concat(cmd, " "), result))
end
return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil
if type(cmd) == "string" then
cmd = { cmd }
end
local result = vim.fn.system(cmd)
local success = vim.api.nvim_get_vvar("shell_error") == 0
if not success and (show_error == nil or show_error) then
vim.api.nvim_err_writeln(
("Error running command %s\nError message:\n%s"):format(table.concat(cmd, " "), result)
)
end
return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil
end
function M.file_worktree(file, worktrees)
worktrees = worktrees or vim.g.git_worktrees
file = file or vim.fn.expand "%"
for _, worktree in ipairs(worktrees) do
if
M.cmd({
"git",
"--work-tree",
worktree.toplevel,
"--git-dir",
worktree.gitdir,
"ls-files",
"--error-unmatch",
file,
}, false)
then
return worktree
end
end
worktrees = worktrees or vim.g.git_worktrees
file = file or vim.fn.expand("%")
for _, worktree in ipairs(worktrees) do
if
M.cmd({
"git",
"--work-tree",
worktree.toplevel,
"--git-dir",
worktree.gitdir,
"ls-files",
"--error-unmatch",
file,
}, false)
then
return worktree
end
end
end
function M.which_key_register()
if M.which_key_queue then
local wk_avail, wk = pcall(require, "which-key")
if wk_avail then
for mode, registration in pairs(M.which_key_queue) do
wk.register(registration, { mode = mode })
end
M.which_key_queue = nil
end
end
if M.which_key_queue then
local wk_avail, wk = pcall(require, "which-key")
if wk_avail then
for mode, registration in pairs(M.which_key_queue) do
wk.register(registration, { mode = mode })
end
M.which_key_queue = nil
end
end
end
function M.set_maps(map_table, base)
base = base or {}
for mode, maps in pairs(map_table) do
for keymap, options in pairs(maps) do
if options then
local cmd = options
local keymap_opts = base
if type(options) == "table" then
cmd = options[1]
keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options)
keymap_opts[1] = nil
end
if not cmd or keymap_opts.name then -- which-key mapping
if not keymap_opts.name then keymap_opts.name = keymap_opts.desc end
if not M.which_key_queue then M.which_key_queue = {} end
if not M.which_key_queue[mode] then M.which_key_queue[mode] = {} end
M.which_key_queue[mode][keymap] = keymap_opts
else -- not which-key mapping
vim.keymap.set(mode, keymap, cmd, keymap_opts)
end
end
end
end
if package.loaded["which-key"] then M.which_key_register() end
base = base or {}
for mode, maps in pairs(map_table) do
for keymap, options in pairs(maps) do
if options then
local cmd = options
local keymap_opts = base
if type(options) == "table" then
cmd = options[1]
keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options)
keymap_opts[1] = nil
end
if not cmd or keymap_opts.name then -- which-key mapping
if not keymap_opts.name then
keymap_opts.name = keymap_opts.desc
end
if not M.which_key_queue then
M.which_key_queue = {}
end
if not M.which_key_queue[mode] then
M.which_key_queue[mode] = {}
end
M.which_key_queue[mode][keymap] = keymap_opts
else -- not which-key mapping
vim.keymap.set(mode, keymap, cmd, keymap_opts)
end
end
end
end
if package.loaded["which-key"] then
M.which_key_register()
end
end
local function del_buffer_autocmd(augroup, bufnr)
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
if cmds_found then vim.tbl_map(function(cmd) vim.api.nvim_del_autocmd(cmd.id) end, cmds) end
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
if cmds_found then
vim.tbl_map(function(cmd)
vim.api.nvim_del_autocmd(cmd.id)
end, cmds)
end
end
local function add_buffer_autocmd(augroup, bufnr, autocmds)
if not vim.tbl_islist(autocmds) then autocmds = { autocmds } end
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
if not cmds_found or vim.tbl_isempty(cmds) then
vim.api.nvim_create_augroup(augroup, { clear = false })
for _, autocmd in ipairs(autocmds) do
local events = autocmd.events
autocmd.events = nil
autocmd.group = augroup
autocmd.buffer = bufnr
vim.api.nvim_create_autocmd(events, autocmd)
end
end
if not vim.tbl_islist(autocmds) then
autocmds = { autocmds }
end
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
if not cmds_found or vim.tbl_isempty(cmds) then
vim.api.nvim_create_augroup(augroup, { clear = false })
for _, autocmd in ipairs(autocmds) do
local events = autocmd.events
autocmd.events = nil
autocmd.group = augroup
autocmd.buffer = bufnr
vim.api.nvim_create_autocmd(events, autocmd)
end
end
end
local function has_capability(capability, filter)
for _, client in ipairs(vim.lsp.get_active_clients(filter)) do
if client.supports_method(capability) then return true end
end
return false
for _, client in ipairs(vim.lsp.get_active_clients(filter)) do
if client.supports_method(capability) then
return true
end
end
return false
end
-- NOTE: LSP Keymaps here
function M.lsp_on_attach(client, bufnr)
local lsp_mappings = M.empty_map_table()
local lsp_mappings = M.empty_map_table()
lsp_mappings.n["<Leader>ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }
lsp_mappings.n["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" }
lsp_mappings.n["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" }
lsp_mappings.n["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }
lsp_mappings.n["<Leader>ld"] = {
function()
vim.diagnostic.open_float()
end,
desc = "Hover diagnostics",
}
lsp_mappings.n["[d"] = {
function()
vim.diagnostic.goto_prev()
end,
desc = "Previous diagnostic",
}
lsp_mappings.n["]d"] = {
function()
vim.diagnostic.goto_next()
end,
desc = "Next diagnostic",
}
lsp_mappings.n["gl"] = {
function()
vim.diagnostic.open_float()
end,
desc = "Hover diagnostics",
}
if M.is_available("telescope.nvim") then
lsp_mappings.n["<Leader>lD"] = {
function() require("telescope.builtin").diagnostics() end,
desc = "Search diagnostics",
}
end
if M.is_available("telescope.nvim") then
lsp_mappings.n["<Leader>lD"] = {
function()
require("telescope.builtin").diagnostics()
end,
desc = "Search diagnostics",
}
end
if M.is_available("mason-lspconfig.nvim") then
lsp_mappings.n["<Leader>li"] = { "<cmd>LspInfo<cr>", desc = "LSP information" }
end
if M.is_available("mason-lspconfig.nvim") then
lsp_mappings.n["<Leader>li"] = { "<cmd>LspInfo<cr>", desc = "LSP information" }
end
if M.is_available("none-ls.nvim") then
lsp_mappings.n["<Leader>lI"] = { "<cmd>NullLsInfo<cr>", desc = "Null-ls information" }
end
if M.is_available("none-ls.nvim") then
lsp_mappings.n["<Leader>lI"] = { "<cmd>NullLsInfo<cr>", desc = "Null-ls information" }
end
if client.supports_method("textDocument/codeAction") then
lsp_mappings.n["<Leader>la"] = {
function() vim.lsp.buf.code_action() end,
desc = "Code action",
}
lsp_mappings.v["<Leader>la"] = lsp_mappings.n["<Leader>la"]
end
if client.supports_method("textDocument/codeAction") then
lsp_mappings.n["<Leader>la"] = {
function()
vim.lsp.buf.code_action()
end,
desc = "Code action",
}
lsp_mappings.v["<Leader>la"] = lsp_mappings.n["<Leader>la"]
end
if client.supports_method("textDocument/codeLens") then
vim.lsp.codelens.refresh()
lsp_mappings.n["<Leader>ll"] = {
function() vim.lsp.codelens.refresh() end,
desc = "Refresh CodeLens",
}
lsp_mappings.n["<Leader>lL"] = {
function() vim.lsp.codelens.run() end,
desc = "Run CodeLens",
}
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uL"] = {
function() vim.lsp.codelens.clear() end,
desc = "Toggle CodeLens"
}
end
if client.supports_method("textDocument/codeLens") then
vim.lsp.codelens.refresh()
lsp_mappings.n["<Leader>ll"] = {
function()
vim.lsp.codelens.refresh()
end,
desc = "Refresh CodeLens",
}
lsp_mappings.n["<Leader>lL"] = {
function()
vim.lsp.codelens.run()
end,
desc = "Run CodeLens",
}
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uL"] = {
function()
vim.lsp.codelens.clear()
end,
desc = "Toggle CodeLens",
}
end
if client.supports_method("textDocument/definition") then
lsp_mappings.n["gd"] = {
function() vim.lsp.buf.definition() end,
desc = "Go to definition",
}
end
if client.supports_method("textDocument/definition") then
lsp_mappings.n["gd"] = {
function()
vim.lsp.buf.definition()
end,
desc = "Go to definition",
}
end
if client.supports_method "textDocument/typeDefinition" then
lsp_mappings.n["gy"] = {
function() vim.lsp.buf.type_definition() end,
desc = "Go to type definition",
}
end
if client.supports_method("textDocument/typeDefinition") then
lsp_mappings.n["gy"] = {
function()
vim.lsp.buf.type_definition()
end,
desc = "Go to type definition",
}
end
if client.supports_method("textDocument/declaration") then
lsp_mappings.n["gD"] = {
function() vim.lsp.buf.declaration() end,
desc = "Go to declaration",
}
end
if client.supports_method("textDocument/declaration") then
lsp_mappings.n["gD"] = {
function()
vim.lsp.buf.declaration()
end,
desc = "Go to declaration",
}
end
if client.supports_method("textDocument/implementation") then
lsp_mappings.n["gI"] = {
function() vim.lsp.buf.implementation() end,
desc = "List implementations",
}
end
if client.supports_method("textDocument/implementation") then
lsp_mappings.n["gI"] = {
function()
vim.lsp.buf.implementation()
end,
desc = "List implementations",
}
end
if client.supports_method("textDocument/references") then
lsp_mappings.n["gr"] = {
function() vim.lsp.buf.references() end,
desc = "List references",
}
end
if client.supports_method("textDocument/references") then
lsp_mappings.n["gr"] = {
function()
vim.lsp.buf.references()
end,
desc = "List references",
}
end
if client.supports_method "workspace/symbol" then
lsp_mappings.n["<Leader>lG"] = {
function() vim.lsp.buf.workspace_symbol() end,
desc = "List symbols"
}
end
if client.supports_method("workspace/symbol") then
lsp_mappings.n["<Leader>lG"] = {
function()
vim.lsp.buf.workspace_symbol()
end,
desc = "List symbols",
}
end
if client.supports_method "textDocument/rename" then
lsp_mappings.n["<Leader>lr"] = {
function() vim.lsp.buf.rename() end,
desc = "Rename symbol",
}
end
if client.supports_method("textDocument/rename") then
lsp_mappings.n["<Leader>lr"] = {
function()
vim.lsp.buf.rename()
end,
desc = "Rename symbol",
}
end
-- TODO: Check this on 0.10.0 release
if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then
vim.b[bufnr].semantic_tokens_enabled = true
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uY"] = {
function()
vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled
for _, active_client in ipairs(vim.lsp.get_active_clients { bufnr = bufnr }) do
if active_client.server_capabilities.semanticTokensProvider then
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens_enabled and "start" or "stop"](bufnr,
active_client.id)
end
end
end,
desc = "Toggle LSP semantic highlight (buffer)",
}
end
-- TODO: Check this on 0.10.0 release
if client.supports_method("textDocument/semanticTokens/full") and vim.lsp.semantic_tokens then
vim.b[bufnr].semantic_tokens_enabled = true
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uY"] = {
function()
vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled
for _, active_client in ipairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do
if active_client.server_capabilities.semanticTokensProvider then
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens_enabled and "start" or "stop"](
bufnr,
active_client.id
)
end
end
end,
desc = "Toggle LSP semantic highlight (buffer)",
}
end
if client.supports_method("textDocument/formatting") then
lsp_mappings.n["<Leader>lf"] = {
function()
vim.lsp.buf.format({
filter = function(c)
local filetype = vim.bo.filetype
local n = require "null-ls"
local s = require "null-ls.sources"
local method = n.methods.FORMATTING
local available_formatters = s.get_available(filetype, method)
if #available_formatters > 0 then
return c.name == "null-ls"
end
return true
end
})
end,
desc = "Format buffer",
}
lsp_mappings.v["<Leader>lf"] = lsp_mappings.n["<Leader>lf"]
end
if client.supports_method("textDocument/formatting") then
lsp_mappings.n["<Leader>lf"] = {
function()
vim.lsp.buf.format({
filter = function(c)
local filetype = vim.bo.filetype
local n = require("null-ls")
local s = require("null-ls.sources")
local method = n.methods.FORMATTING
local available_formatters = s.get_available(filetype, method)
if #available_formatters > 0 then
return c.name == "null-ls"
end
return true
end,
})
end,
desc = "Format buffer",
}
lsp_mappings.v["<Leader>lf"] = lsp_mappings.n["<Leader>lf"]
end
if client.supports_method("textDocument/documentHighlight") then
add_buffer_autocmd("lsp_document_highlight", bufnr, {
{
events = { "CursorHold", "CursorHoldI" },
desc = "highlight references when cursor holds",
callback = function()
if not has_capability("textDocument/documentHighlight", { bufnr = bufnr }) then
del_buffer_autocmd("lsp_document_highlight", bufnr)
return
end
vim.lsp.buf.document_highlight()
end,
},
{
events = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "clear references when cursor moves",
callback = function() vim.lsp.buf.clear_references() end,
},
})
end
if client.supports_method("textDocument/documentHighlight") then
add_buffer_autocmd("lsp_document_highlight", bufnr, {
{
events = { "CursorHold", "CursorHoldI" },
desc = "highlight references when cursor holds",
callback = function()
if not has_capability("textDocument/documentHighlight", { bufnr = bufnr }) then
del_buffer_autocmd("lsp_document_highlight", bufnr)
return
end
vim.lsp.buf.document_highlight()
end,
},
{
events = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "clear references when cursor moves",
callback = function()
vim.lsp.buf.clear_references()
end,
},
})
end
if client.supports_method("textDocument/hover") then
-- TODO: Check this on 0.10.0 release
if vim.fn.has "nvim-0.10" == 0 then
lsp_mappings.n["K"] = {
function() vim.lsp.buf.hover() end,
desc = "Hover symbol",
}
end
end
if client.supports_method("textDocument/hover") then
-- TODO: Check this on 0.10.0 release
if vim.fn.has("nvim-0.10") == 0 then
lsp_mappings.n["K"] = {
function()
vim.lsp.buf.hover()
end,
desc = "Hover symbol",
}
end
end
if client.supports_method("textDocument/inlayHint") then
if vim.b.inlay_hints_enabled == nil then vim.b.inlay_hints_enabled = true end
-- TODO: Check this on 0.10.0 release
if vim.lsp.inlay_hint then
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint.enable(bufnr, true) end
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uH"] = {
function()
vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled)
end
end,
desc = "Toggle inlay hints",
}
end
end
if client.supports_method("textDocument/inlayHint") then
if vim.b.inlay_hints_enabled == nil then
vim.b.inlay_hints_enabled = true
end
-- TODO: Check this on 0.10.0 release
if vim.lsp.inlay_hint then
if vim.b.inlay_hints_enabled then
vim.lsp.inlay_hint.enable(bufnr, true)
end
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uH"] = {
function()
vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled)
end
end,
desc = "Toggle inlay hints",
}
end
end
if client.supports_method "textDocument/signatureHelp" then
lsp_mappings.n["<Leader>lh"] = {
function() vim.lsp.buf.signature_help() end,
desc = "Signature help",
}
end
if client.supports_method("textDocument/signatureHelp") then
lsp_mappings.n["<Leader>lh"] = {
function()
vim.lsp.buf.signature_help()
end,
desc = "Signature help",
}
end
if M.is_available "telescope.nvim" then
if lsp_mappings.n.gd then
lsp_mappings.n.gd[1] = function() require("telescope.builtin").lsp_definitions() end
end
if lsp_mappings.n.gI then
lsp_mappings.n.gI[1] = function() require("telescope.builtin").lsp_implementations() end
end
if lsp_mappings.n.gr then
lsp_mappings.n.gr[1] = function() require("telescope.builtin").lsp_references() end
end
if lsp_mappings.n["<Leader>lR"] then
lsp_mappings.n["<Leader>lR"][1] = function() require("telescope.builtin").lsp_references() end
end
if lsp_mappings.n.gy then
lsp_mappings.n.gy[1] = function() require("telescope.builtin").lsp_type_definitions() end
end
if lsp_mappings.n["<Leader>lG"] then
lsp_mappings.n["<Leader>lG"][1] = function()
vim.ui.input({ prompt = "Symbol Query: (leave empty for word under cursor)" }, function(query)
if query then
-- word under cursor if given query is empty
if query == "" then query = vim.fn.expand "<cword>" end
require("telescope.builtin").lsp_workspace_symbols {
query = query,
prompt_title = ("Find word (%s)"):format(query),
}
end
end)
end
end
end
if M.is_available("telescope.nvim") then
if lsp_mappings.n.gd then
lsp_mappings.n.gd[1] = function()
require("telescope.builtin").lsp_definitions()
end
end
if lsp_mappings.n.gI then
lsp_mappings.n.gI[1] = function()
require("telescope.builtin").lsp_implementations()
end
end
if lsp_mappings.n.gr then
lsp_mappings.n.gr[1] = function()
require("telescope.builtin").lsp_references()
end
end
if lsp_mappings.n["<Leader>lR"] then
lsp_mappings.n["<Leader>lR"][1] = function()
require("telescope.builtin").lsp_references()
end
end
if lsp_mappings.n.gy then
lsp_mappings.n.gy[1] = function()
require("telescope.builtin").lsp_type_definitions()
end
end
if lsp_mappings.n["<Leader>lG"] then
lsp_mappings.n["<Leader>lG"][1] = function()
vim.ui.input({ prompt = "Symbol Query: (leave empty for word under cursor)" }, function(query)
if query then
-- word under cursor if given query is empty
if query == "" then
query = vim.fn.expand("<cword>")
end
require("telescope.builtin").lsp_workspace_symbols({
query = query,
prompt_title = ("Find word (%s)"):format(query),
})
end
end)
end
end
end
if not vim.tbl_isempty(lsp_mappings.v) then
if lsp_mappings.v["<Leader>l"] then lsp_mappings.v["<Leader>l"] = { desc = icons.Code .. " LSP" } end
if lsp_mappings.v["<Leader>u"] then lsp_mappings.v["<Leader>u"] = { desc = icons.Code .. " LSP" } end
end
if not vim.tbl_isempty(lsp_mappings.v) then
if lsp_mappings.v["<Leader>l"] then
lsp_mappings.v["<Leader>l"] = { desc = icons.Code .. " LSP" }
end
if lsp_mappings.v["<Leader>u"] then
lsp_mappings.v["<Leader>u"] = { desc = icons.Code .. " LSP" }
end
end
M.set_maps(lsp_mappings, { buffer = bufnr })
M.set_maps(lsp_mappings, { buffer = bufnr })
end
function M.has_value(table, value)
for _, v in ipairs(table) do
if v == value then
return true
end
end
return false
for _, v in ipairs(table) do
if v == value then
return true
end
end
return false
end
return M

View file

@ -1,13 +1,13 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", require("plugins.lazy").opts)

View file

@ -1,104 +1,110 @@
local M = { "hrsh7th/nvim-cmp" }
M.dependencies = {
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
}
M.event = "InsertEnter"
M.opts = function()
local cmp = require "cmp"
local snip_status_ok, luasnip = pcall(require, "luasnip")
local lspkind_status_ok, lspkind = pcall(require, "lspkind")
if not snip_status_ok then return end
local cmp = require("cmp")
local snip_status_ok, luasnip = pcall(require, "luasnip")
local lspkind_status_ok, lspkind = pcall(require, "lspkind")
if not snip_status_ok then
return
end
local border_opts = {
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
}
local border_opts = {
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
}
local function has_words_before()
local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
end
local function has_words_before()
local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
return {
enabled = function()
local dap_prompt = require("funcs").is_available("cmp-dap")
and vim.tbl_contains({ "dap-repl", "dapui_watches", "dapui_hover" },
vim.api.nvim_get_option_value("filetype", { buf = 0 }))
if vim.api.nvim_get_option_value("buftype", { buf = 0 }) == "prompt" and not dap_prompt then
return false
end
return true
end,
preselect = cmp.PreselectMode.None,
formatting = {
fields = { "kind", "abbr", "menu" },
format = lspkind_status_ok and lspkind.cmp_format(require("plugins.misc.lspkind").opts) or nil,
},
snippet = {
expand = function(args) luasnip.lsp_expand(args.body) end,
},
duplicates = {
nvim_lsp = 1,
luasnip = 1,
cmp_tabnine = 1,
buffer = 1,
path = 1,
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
completion = cmp.config.window.bordered(border_opts),
documentation = cmp.config.window.bordered(border_opts),
},
mapping = {
["<Up>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
["<Down>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select },
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
["<C-k>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
["<C-j>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable,
["<C-e>"] = cmp.mapping { i = cmp.mapping.abort(), c = cmp.mapping.close() },
["<CR>"] = cmp.mapping.confirm { select = false },
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
},
}
return {
enabled = function()
local dap_prompt = require("funcs").is_available("cmp-dap")
and vim.tbl_contains(
{ "dap-repl", "dapui_watches", "dapui_hover" },
vim.api.nvim_get_option_value("filetype", { buf = 0 })
)
if vim.api.nvim_get_option_value("buftype", { buf = 0 }) == "prompt" and not dap_prompt then
return false
end
return true
end,
preselect = cmp.PreselectMode.None,
formatting = {
fields = { "kind", "abbr", "menu" },
format = lspkind_status_ok and lspkind.cmp_format(require("plugins.misc.lspkind").opts) or nil,
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
duplicates = {
nvim_lsp = 1,
luasnip = 1,
cmp_tabnine = 1,
buffer = 1,
path = 1,
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
completion = cmp.config.window.bordered(border_opts),
documentation = cmp.config.window.bordered(border_opts),
},
mapping = {
["<Up>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<Down>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable,
["<C-e>"] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
}),
}
end
return M

View file

@ -2,11 +2,11 @@ local M = { "rcarriga/cmp-dap" }
M.dependencies = { "nvim-dap" }
M.config = function()
require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = {
{ name = "dap" },
},
})
require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = {
{ name = "dap" },
},
})
end
return M

View file

@ -1,5 +1,5 @@
return {
require('plugins.cmp.cmp'),
require('plugins.cmp.dap'),
require('plugins.cmp.luasnip'),
require("plugins.cmp.cmp"),
require("plugins.cmp.dap"),
require("plugins.cmp.luasnip"),
}

View file

@ -7,14 +7,16 @@ M.build = "make install_jsregexp"
M.dependencies = { "rafamadriz/friendly-snippets" }
M.opts = {
history = true,
delete_check_events = "TextChanged",
region_check_events = "CursorMoved",
history = true,
delete_check_events = "TextChanged",
region_check_events = "CursorMoved",
}
M.config = function(_, opts)
require("luasnip").config.setup(opts)
vim.tbl_map(function(type) require("luasnip.loaders.from_" .. type).lazy_load() end, { "vscode", "snipmate", "lua" })
require("luasnip").config.setup(opts)
vim.tbl_map(function(type)
require("luasnip.loaders.from_" .. type).lazy_load()
end, { "vscode", "snipmate", "lua" })
end
return M

View file

@ -3,15 +3,21 @@ local M = { "rcarriga/nvim-dap-ui" }
M.dependencies = { "nvim-dap" }
M.opts = {
floating = { border = "rounded" },
floating = { border = "rounded" },
}
M.config = function(_, opts)
local dap, dapui = require "dap", require "dapui"
dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end
dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end
dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end
dapui.setup(opts)
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
dapui.setup(opts)
end
return M

View file

@ -1,5 +1,5 @@
return {
require('plugins.dap.dap'),
require('plugins.dap.dap-ui'),
require('plugins.dap.mason-dap'),
require("plugins.dap.dap"),
require("plugins.dap.dap-ui"),
require("plugins.dap.mason-dap"),
}

View file

@ -1,34 +1,34 @@
local M = { "folke/lazy.nvim" }
local icons = require('config.icons')
local icons = require("config.icons")
M.opts = {
dev = {
path = (os.getenv("XDG_DOCUMENTS_DIR") or "~/Documents") .. "/code/nvim-plugins",
},
install = {
missing = true,
colorscheme = { "tokyonight" },
},
ui = {
border = "single",
icons = {
cmd = icons.Console .. " ",
config = icons.Gear,
event = icons.Event,
ft = icons.File .. " ",
init = icons.Gear .. " ",
import = icons.Import .. " ",
keys = icons.Keyboard .. " ",
lazy = icons.Sleep .. " ",
loaded = icons.Loaded,
not_loaded = icons.Unloaded,
plugin = icons.Package,
runtime = icons.Runtime .. " ",
source = icons.Source .. " ",
start = icons.Start,
task = icons.Task,
},
},
dev = {
path = (os.getenv("XDG_DOCUMENTS_DIR") or "~/Documents") .. "/code/nvim-plugins",
},
install = {
missing = true,
colorscheme = { "tokyonight" },
},
ui = {
border = "single",
icons = {
cmd = icons.Console .. " ",
config = icons.Gear,
event = icons.Event,
ft = icons.File .. " ",
init = icons.Gear .. " ",
import = icons.Import .. " ",
keys = icons.Keyboard .. " ",
lazy = icons.Sleep .. " ",
loaded = icons.Loaded,
not_loaded = icons.Unloaded,
plugin = icons.Package,
runtime = icons.Runtime .. " ",
source = icons.Source .. " ",
start = icons.Start,
task = icons.Task,
},
},
}
return M

View file

@ -3,29 +3,29 @@ local M = { "stevearc/aerial.nvim" }
M.event = { "BufReadPost", "BufNewFile" }
M.opts = {
attach_mode = "global",
backends = { "lsp", "treesitter", "markdown", "man" },
disable_max_lines = vim.g.max_lines,
disable_max_size = vim.g.max_size,
layout = { min_width = 28 },
show_guides = true,
filter_kind = false,
guides = {
mid_item = "",
last_item = "",
nested_top = "",
whitespace = " ",
},
keymaps = {
["[y"] = "actions.prev",
["]y"] = "actions.next",
["[Y"] = "actions.prev_up",
["]Y"] = "actions.next_up",
["{"] = false,
["}"] = false,
["[["] = false,
["]]"] = false,
},
attach_mode = "global",
backends = { "lsp", "treesitter", "markdown", "man" },
disable_max_lines = vim.g.max_lines,
disable_max_size = vim.g.max_size,
layout = { min_width = 28 },
show_guides = true,
filter_kind = false,
guides = {
mid_item = "",
last_item = "",
nested_top = "",
whitespace = " ",
},
keymaps = {
["[y"] = "actions.prev",
["]y"] = "actions.next",
["[Y"] = "actions.prev_up",
["]Y"] = "actions.next_up",
["{"] = false,
["}"] = false,
["[["] = false,
["]]"] = false,
},
}
return M

View file

@ -1,10 +1,10 @@
return {
{ "folke/neoconf.nvim", config = true },
{ "folke/neodev.nvim", config = true },
require('plugins.lsp.lspconfig'),
require('plugins.lsp.mason'),
require('plugins.lsp.mason-lspconfig'),
require('plugins.lsp.mason-null-ls'),
require('plugins.lsp.null-ls'),
require('plugins.lsp.aerial'),
{ "folke/neoconf.nvim", config = true },
{ "folke/neodev.nvim", config = true },
require("plugins.lsp.lspconfig"),
require("plugins.lsp.mason"),
require("plugins.lsp.mason-lspconfig"),
require("plugins.lsp.mason-null-ls"),
require("plugins.lsp.null-ls"),
require("plugins.lsp.aerial"),
}

View file

@ -12,80 +12,77 @@ capabilities.textDocument.completion.completionItem.deprecatedSupport = true
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = { "documentation", "detail", "additionalTextEdits" }
properties = { "documentation", "detail", "additionalTextEdits" },
}
capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true }
local function merge(table, overwrite)
overwrite = overwrite or {}
return table and vim.tbl_deep_extend("force", table, overwrite) or overwrite
overwrite = overwrite or {}
return table and vim.tbl_deep_extend("force", table, overwrite) or overwrite
end
M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" }
M.cmd = { "LspInstall", "LspUninstall" }
M.config = function()
local icons = require("config.icons")
local signs = {
{ name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" },
{ name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" },
{ name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" },
{ name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" },
{ name = "DapBreakpointCondition", text = icons.DapBreakpointCondition, texthl = "DiagnosticInfo" },
{ name = "DapLogPoint", text = icons.DapLogPoint, texthl = "DiagnosticInfo" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, sign)
end
local icons = require("config.icons")
local signs = {
{ name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" },
{ name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" },
{ name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" },
{ name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" },
{ name = "DapBreakpointCondition", text = icons.DapBreakpointCondition, texthl = "DiagnosticInfo" },
{ name = "DapLogPoint", text = icons.DapLogPoint, texthl = "DiagnosticInfo" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, sign)
end
vim.diagnostic.config({
virtual_text = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = icons.Error,
[vim.diagnostic.severity.HINT] = icons.Hint,
[vim.diagnostic.severity.WARN] = icons.Warn,
[vim.diagnostic.severity.INFO] = icons.Info,
},
active = signs,
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focused = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
})
vim.diagnostic.config({
virtual_text = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = icons.Error,
[vim.diagnostic.severity.HINT] = icons.Hint,
[vim.diagnostic.severity.WARN] = icons.Warn,
[vim.diagnostic.severity.INFO] = icons.Info,
},
active = signs,
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focused = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = "rounded", silent = true }
)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true })
vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded", silent = true })
local mlsp = require('mason-lspconfig')
mlsp.setup({ ensure_installed = serverconf.required })
local mlsp = require("mason-lspconfig")
mlsp.setup({ ensure_installed = serverconf.required })
mlsp.setup_handlers({
function(server)
if not f.has_value(serverconf.ignore, server) then
local ls = require("lspconfig")[server]
local ls_opts = merge(ls, { capabilities = capabilities, on_attach = require("funcs").lsp_on_attach })
local opts = merge(ls_opts, serverconf.handlers[server])
require("lspconfig")[server].setup(opts)
end
end
})
mlsp.setup_handlers({
function(server)
if not f.has_value(serverconf.ignore, server) then
local ls = require("lspconfig")[server]
local ls_opts = merge(ls, { capabilities = capabilities, on_attach = require("funcs").lsp_on_attach })
local opts = merge(ls_opts, serverconf.handlers[server])
require("lspconfig")[server].setup(opts)
end
end,
})
end
return M

View file

@ -1,29 +1,29 @@
local M = { "williamboman/mason.nvim" }
local icons = require('config.icons')
local icons = require("config.icons")
M.cmd = {
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
"MasonUpdate",
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
"MasonUpdate",
}
M.build = ":MasonUpdate"
M.opts = {
ui = {
border = "none",
icons = {
package_installed = icons.True,
package_pending = icons.Pending,
package_uninstalled = icons.False,
},
},
log_level = vim.log.levels.INFO,
max_concurrent_installers = 4,
ui = {
border = "none",
icons = {
package_installed = icons.True,
package_pending = icons.Pending,
package_uninstalled = icons.False,
},
},
log_level = vim.log.levels.INFO,
max_concurrent_installers = 4,
}
return M

View file

@ -5,7 +5,7 @@ M.event = { "BufReadPost", "BufNewFile" }
M.dependencies = { "mason-null-ls.nvim" }
M.opts = {
on_attach = require("funcs").lsp_on_attach,
on_attach = require("funcs").lsp_on_attach,
}
return M

View file

@ -3,156 +3,163 @@ local M = { "goolord/alpha-nvim" }
M.depends = { "telescope.nvim", "todo-comments.nvim" }
M.opts = function()
local icons = require("config.icons")
local dashboard = require("alpha.themes.dashboard")
local icons = require("config.icons")
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.footer.opts.hl = "DashboardFooter"
dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.footer.opts.hl = "DashboardFooter"
local banners = {
[1] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀",
"⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀",
"⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀",
"⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀",
"⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀",
"⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷",
"⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿",
"⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁",
"⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀",
"⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀",
"⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
},
[2] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀",
},
[3] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⠿⠟⠛⠉⠉⠉⠉⠉⢉⣭⡉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣦⡀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀",
"⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀",
"⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⡀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀",
"⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡦⠀⠀⠀⠀⠀⢻⣿⣿⣿⣷⠀⠀",
"⠀⣼⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣧⠀",
"⢠⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⡄",
"⢸⣿⣿⣿⡇⠀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⢸⣿⣿⣿⡇",
"⣿⣿⣿⣿⡇⠀⣿⣦⣤⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⢸⣿⣿⣿⣿",
"⣿⣿⣿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿",
"⣿⣿⣿⣿⡇⠀⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⢸⣿⣿⣿⣿",
"⢸⣿⣿⣿⡇⠀⠉⠉⠉⠉⠉⠉⠉⢠⡀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇",
"⠘⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣦⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⠃",
"⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣤⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡟⠀",
"⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⠀⠀",
"⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⡀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀",
"⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⣤⣀⠀⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠦⠀⠀⠀⠀⠀⣀⣤⣾⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠿⠿⢿⣿⣿⣿⣿⣿⡿⠿⠿⠟⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
},
[4] = {
"",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀",
"⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀",
"⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀",
},
}
local banners = {
[1] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀",
"⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀",
"⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀",
"⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀",
"⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀",
"⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷",
"⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿",
"⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁",
"⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀",
"⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀",
"⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
},
[2] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀",
},
[3] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⠿⠟⠛⠉⠉⠉⠉⠉⢉⣭⡉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣦⡀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀",
"⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀",
"⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⡀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀",
"⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡦⠀⠀⠀⠀⠀⢻⣿⣿⣿⣷⠀⠀",
"⠀⣼⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣧⠀",
"⢠⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⡄",
"⢸⣿⣿⣿⡇⠀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⢸⣿⣿⣿⡇",
"⣿⣿⣿⣿⡇⠀⣿⣦⣤⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⢸⣿⣿⣿⣿",
"⣿⣿⣿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿",
"⣿⣿⣿⣿⡇⠀⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⢸⣿⣿⣿⣿",
"⢸⣿⣿⣿⡇⠀⠉⠉⠉⠉⠉⠉⠉⢠⡀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇",
"⠘⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣦⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⠃",
"⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣤⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡟⠀",
"⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⠀⠀",
"⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⡀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀",
"⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⣤⣀⠀⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠦⠀⠀⠀⠀⠀⣀⣤⣾⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠿⠿⢿⣿⣿⣿⣿⣿⡿⠿⠿⠟⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
},
[4] = {
"",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀",
"⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀",
"⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀",
},
}
dashboard.section.header.val = banners[2]
dashboard.section.header.val = banners[2]
dashboard.section.buttons.val = {
dashboard.button("n", icons.File .. " New file", "<Cmd>ene<CR>"),
dashboard.button("f", icons.Search .. " Find file", "<Cmd>lua require('telescope.builtin').find_files()<CR>"),
dashboard.button("e", icons.FileTree .. " Browse files", "<Cmd>lua require('taolf').start({ dir = 'gwd' })<CR>"),
dashboard.button("t", icons.Task .. " Find todo",
"<Cmd>:lua require('telescope').extensions['todo-comments'].todo()<CR>"),
dashboard.button("q", icons.Leave .. " Quit", "<Cmd>qa<CR>"),
}
dashboard.section.buttons.val = {
dashboard.button("n", icons.File .. " New file", "<Cmd>ene<CR>"),
dashboard.button("f", icons.Search .. " Find file", "<Cmd>lua require('telescope.builtin').find_files()<CR>"),
dashboard.button(
"e",
icons.FileTree .. " Browse files",
"<Cmd>lua require('taolf').start({ dir = 'gwd' })<CR>"
),
dashboard.button(
"t",
icons.Task .. " Find todo",
"<Cmd>:lua require('telescope').extensions['todo-comments'].todo()<CR>"
),
dashboard.button("q", icons.Leave .. " Quit", "<Cmd>qa<CR>"),
}
dashboard.section.footer.val = "Behold: a Snail's Vim"
dashboard.section.footer.val = "Behold: a Snail's Vim"
dashboard.config.layout = {
{ type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) } },
dashboard.section.header,
{ type = "padding", val = 5 },
dashboard.section.buttons,
{ type = "padding", val = 3 },
dashboard.section.footer,
}
dashboard.config.layout = {
{ type = "padding", val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) },
dashboard.section.header,
{ type = "padding", val = 5 },
dashboard.section.buttons,
{ type = "padding", val = 3 },
dashboard.section.footer,
}
dashboard.config.opts.noautocmd = true
dashboard.config.opts.noautocmd = true
return dashboard
return dashboard
end
M.config = function(_, opts)
require("alpha").setup(opts.config)
require("alpha").setup(opts.config)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer",
once = true,
callback = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
opts.section.footer.val = { "Behold: a Snail's Vim | " .. stats.count .. "" .. ms .. "ms" }
pcall(vim.cmd.AlphaRedraw)
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer",
once = true,
callback = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
opts.section.footer.val = { "Behold: a Snail's Vim | " .. stats.count .. "" .. ms .. "ms" }
pcall(vim.cmd.AlphaRedraw)
end,
})
end
return M

View file

@ -3,13 +3,13 @@ local M = { "windwp/nvim-autopairs" }
M.event = { "BufReadPost", "BufNewFile" }
M.opts = {
check_ts = true,
disable_filetype = { "TelescopePrompt", "vim" },
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
check_ts = true,
disable_filetype = { "TelescopePrompt", "vim" },
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
}
return M

View file

@ -3,56 +3,56 @@ local M = { "akinsho/bufferline.nvim" }
M.event = { "BufReadPost", "BufNewFile" }
M.opts = function()
local icons = require('config.icons')
local icons = require("config.icons")
local function diagnostics_indicator(_, _, diagnostics, _)
local result = {}
local symbols = {
error = icons.Error,
warning = icons.Warn,
info = icons.Info,
}
for name, count in pairs(diagnostics) do
if symbols[name] and count > 0 then
table.insert(result, symbols[name] .. " " .. count)
end
end
local result_str = table.concat(result, " ")
return #result_str > 0 and result_str or ""
end
local function diagnostics_indicator(_, _, diagnostics, _)
local result = {}
local symbols = {
error = icons.Error,
warning = icons.Warn,
info = icons.Info,
}
for name, count in pairs(diagnostics) do
if symbols[name] and count > 0 then
table.insert(result, symbols[name] .. " " .. count)
end
end
local result_str = table.concat(result, " ")
return #result_str > 0 and result_str or ""
end
local config = {
highlights = {
background = {
italic = true,
bold = false,
},
buffer_selected = {
italic = false,
bold = true,
},
},
options = {
indicator = {
style = "none",
},
buffer_close_icon = icons.Close,
modified_icon = icons.Modified,
close_icon = icons.Close,
left_trunc_marker = icons.Truncate,
right_trunc_marker = icons.Truncate,
diagnostics = "nvim_lsp",
diagnostics_indicator = diagnostics_indicator,
offsets = {},
show_buffer_close_icons = false,
show_close_icon = false,
separator_style = { '', '' },
move_wraps_at_ends = true,
always_show_bufferline = false,
sort_by = "id",
},
}
return config
local config = {
highlights = {
background = {
italic = true,
bold = false,
},
buffer_selected = {
italic = false,
bold = true,
},
},
options = {
indicator = {
style = "none",
},
buffer_close_icon = icons.Close,
modified_icon = icons.Modified,
close_icon = icons.Close,
left_trunc_marker = icons.Truncate,
right_trunc_marker = icons.Truncate,
diagnostics = "nvim_lsp",
diagnostics_indicator = diagnostics_indicator,
offsets = {},
show_buffer_close_icons = false,
show_close_icon = false,
separator_style = { "", "" },
move_wraps_at_ends = true,
always_show_bufferline = false,
sort_by = "id",
},
}
return config
end
return M

View file

@ -3,10 +3,10 @@ local M = { "numToStr/Comment.nvim" }
M.event = { "BufReadPost", "BufNewFile" }
M.opts = {
mappings = {
basic = false,
extra = false
}
mappings = {
basic = false,
extra = false,
},
}
return M

View file

@ -2,17 +2,17 @@ local M = { "lewis6991/gitsigns.nvim" }
M.event = { "BufReadPost", "BufNewFile" }
local icons = require('config.icons')
local icons = require("config.icons")
M.opts = {
signs = {
add = { text = icons.Added },
change = { text = icons.Modified },
delete = { text = icons.Removed },
topdelete = { text = icons.Removed },
changedelete = { text = icons.ChangeDelete },
untracked = { text = icons.Untracked },
},
signs = {
add = { text = icons.Added },
change = { text = icons.Modified },
delete = { text = icons.Removed },
topdelete = { text = icons.Removed },
changedelete = { text = icons.ChangeDelete },
untracked = { text = icons.Untracked },
},
}
return M

View file

@ -5,31 +5,31 @@ M.main = "ibl"
M.event = { "BufReadPost", "BufNewFile" }
M.dependencies = {
"nvim-treesitter",
"nvim-treesitter",
}
M.opts = {
indent = {
char = "",
tab_char = "",
},
scope = {
char = "",
enabled = true,
show_start = false,
show_end = false,
},
exclude = {
filetypes = {
"help",
"packer",
"NvimTree",
},
buftypes = {
"terminal",
"nofile",
},
},
indent = {
char = "",
tab_char = "",
},
scope = {
char = "",
enabled = true,
show_start = false,
show_end = false,
},
exclude = {
filetypes = {
"help",
"packer",
"NvimTree",
},
buftypes = {
"terminal",
"nofile",
},
},
}
return M

View file

@ -1,28 +1,28 @@
return {
{ "nvim-lua/plenary.nvim", lazy = true },
{ "kyazdani42/nvim-web-devicons", lazy = true },
{ "zk-org/zk-nvim", opts = { picker = "telescope" }, main = "zk" },
{ "NMAC427/guess-indent.nvim" },
{ "JoosepAlviste/nvim-ts-context-commentstring" },
require('plugins.misc.alpha'),
require('plugins.misc.autopairs'),
require('plugins.misc.bufferline'),
require('plugins.misc.colorizer'),
require('plugins.misc.comment'),
require('plugins.misc.gitsigns'),
require('plugins.misc.indent-blankline'),
require('plugins.misc.taolf'),
require('plugins.misc.lspkind'),
require('plugins.misc.lualine'),
require('plugins.misc.rustacean'),
require('plugins.misc.surround'),
require('plugins.misc.telescope'),
require('plugins.misc.telescope-fzf-native'),
require('plugins.misc.todo-comments'),
require('plugins.misc.toggleterm'),
require('plugins.misc.tokyonight'),
require('plugins.misc.treesitter'),
require('plugins.misc.ufo'),
require('plugins.misc.vimtex'),
require('plugins.misc.which-key'),
{ "nvim-lua/plenary.nvim", lazy = true },
{ "kyazdani42/nvim-web-devicons", lazy = true },
{ "zk-org/zk-nvim", opts = { picker = "telescope" }, main = "zk" },
{ "NMAC427/guess-indent.nvim" },
{ "JoosepAlviste/nvim-ts-context-commentstring" },
require("plugins.misc.alpha"),
require("plugins.misc.autopairs"),
require("plugins.misc.bufferline"),
require("plugins.misc.colorizer"),
require("plugins.misc.comment"),
require("plugins.misc.gitsigns"),
require("plugins.misc.indent-blankline"),
require("plugins.misc.taolf"),
require("plugins.misc.lspkind"),
require("plugins.misc.lualine"),
require("plugins.misc.rustacean"),
require("plugins.misc.surround"),
require("plugins.misc.telescope"),
require("plugins.misc.telescope-fzf-native"),
require("plugins.misc.todo-comments"),
require("plugins.misc.toggleterm"),
require("plugins.misc.tokyonight"),
require("plugins.misc.treesitter"),
require("plugins.misc.ufo"),
require("plugins.misc.vimtex"),
require("plugins.misc.which-key"),
}

View file

@ -3,13 +3,13 @@ local M = { "onsails/lspkind.nvim" }
M.lazy = true
M.opts = {
mode = "symbol",
symbol_map = require("config.icons").lspkind,
menu = {},
mode = "symbol",
symbol_map = require("config.icons").lspkind,
menu = {},
}
M.config = function(_, opts)
require("lspkind").init(opts)
require("lspkind").init(opts)
end
return M

View file

@ -1,212 +1,212 @@
local M = { "nvim-lualine/lualine.nvim" }
M.opts = function()
local colors = require('tokyonight.colors').setup({ transform = true })
local icons = require('config.icons')
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
local colors = require("tokyonight.colors").setup({ transform = true })
local icons = require("config.icons")
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand("%:p:h")
local gitdir = vim.fn.finddir(".git", filepath .. ";")
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
local function search_result()
if vim.v.hlsearch == 0 then
return ''
end
local last_search = vim.fn.getreg('/')
if not last_search or last_search == '' then
return ''
end
local searchcount = vim.fn.searchcount { maxcount = 9999 }
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
end
local function search_result()
if vim.v.hlsearch == 0 then
return ""
end
local last_search = vim.fn.getreg("/")
if not last_search or last_search == "" then
return ""
end
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end
local config = {
options = {
component_separators = '',
section_separators = '',
-- theme = {
-- normal = { c = { fg = colors.fg, bg = colors.bg } },
-- inactive = { c = { fg = colors.fg, bg = colors.bg } },
-- },
disabled_filetypes = {
statusline = { 'alpha' }
},
ignore_focus = { 'toggleterm', 'NvimTree' },
globalstatus = true,
},
sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
}
}
local config = {
options = {
component_separators = "",
section_separators = "",
-- theme = {
-- normal = { c = { fg = colors.fg, bg = colors.bg } },
-- inactive = { c = { fg = colors.fg, bg = colors.bg } },
-- },
disabled_filetypes = {
statusline = { "alpha" },
},
ignore_focus = { "toggleterm", "NvimTree" },
globalstatus = true,
},
sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
local function mode_color()
local color = {
n = colors.red,
i = colors.green,
v = colors.magenta,
[string.char(22)] = colors.magenta,
V = colors.magenta,
c = colors.blue,
no = colors.red,
s = colors.orange,
S = colors.orange,
[string.char(19)] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = color[vim.fn.mode()] }
end
local function mode_color()
local color = {
n = colors.red,
i = colors.green,
v = colors.magenta,
[string.char(22)] = colors.magenta,
V = colors.magenta,
c = colors.blue,
no = colors.red,
s = colors.orange,
S = colors.orange,
[string.char(19)] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
["r?"] = colors.cyan,
["!"] = colors.red,
t = colors.red,
}
return { fg = color[vim.fn.mode()] }
end
ins_left {
function()
return ''
end,
color = function()
return mode_color()
end,
padding = { right = 1 },
}
ins_left({
function()
return ""
end,
color = function()
return mode_color()
end,
padding = { right = 1 },
})
ins_left {
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
}
ins_left({
"filename",
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = "bold" },
})
ins_left {
'fileformat',
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green },
}
ins_left({
"fileformat",
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green },
})
ins_left {
'o:encoding',
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green },
}
ins_left({
"o:encoding",
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green },
})
ins_left {
'filesize',
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green },
}
ins_left({
"filesize",
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green },
})
ins_left {
'%04l:%04c',
}
ins_left({
"%04l:%04c",
})
-- NOTE: My beloved :(
-- NOTE: My beloved :(
-- ins_left {
-- function()
-- local current_line = vim.fn.line "."
-- local total_lines = vim.fn.line "$"
-- local chars = icons.progress
-- local line_ratio = current_line / total_lines
-- local index = math.ceil(line_ratio * #chars)
-- return chars[index]
-- end,
-- color = { fg = colors.yellow }
-- }
-- ins_left {
-- function()
-- local current_line = vim.fn.line "."
-- local total_lines = vim.fn.line "$"
-- local chars = icons.progress
-- local line_ratio = current_line / total_lines
-- local index = math.ceil(line_ratio * #chars)
-- return chars[index]
-- end,
-- color = { fg = colors.yellow }
-- }
ins_right {
search_result,
color = { fg = colors.white },
padding = { left = 1 },
}
ins_right({
search_result,
color = { fg = colors.white },
padding = { left = 1 },
})
ins_right {
function()
local msg = ''
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return 'No LSP'
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
msg = msg .. ", " .. client.name
end
end
return msg:sub(3)
end,
color = { fg = colors.blue, gui = 'bold' },
}
ins_right({
function()
local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return "No LSP"
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
msg = msg .. ", " .. client.name
end
end
return msg:sub(3)
end,
color = { fg = colors.blue, gui = "bold" },
})
ins_right {
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = {
error = icons.Error .. ' ',
warn = icons.Warn .. ' ',
info = icons.Info .. ' ',
},
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan },
},
}
ins_right({
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = {
error = icons.Error .. " ",
warn = icons.Warn .. " ",
info = icons.Info .. " ",
},
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan },
},
})
ins_right {
'filetype',
color = { fg = colors.green, gui = 'bold' },
padding = { left = 1 },
}
ins_right({
"filetype",
color = { fg = colors.green, gui = "bold" },
padding = { left = 1 },
})
ins_right {
function()
return ''
end,
color = function()
return mode_color()
end,
padding = { left = 1 },
}
ins_right({
function()
return ""
end,
color = function()
return mode_color()
end,
padding = { left = 1 },
})
return config
return config
end
return M

View file

@ -5,20 +5,20 @@ M.build = ":MasonInstall codelldb"
M.ft = { "rust" }
M.init = function()
local extension_path = os.getenv("XDG_DATA_HOME") .. "/nvim/mason/packages/codelldb/extension/"
local codelldb_path = extension_path .. "apapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
local adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, liblldb_path)
vim.g.rustaceanvim = function()
return {
dap = {
adapter = adapter
},
server = {
on_attach = require("funcs").lsp_on_attach
},
}
end
local extension_path = os.getenv("XDG_DATA_HOME") .. "/nvim/mason/packages/codelldb/extension/"
local codelldb_path = extension_path .. "apapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
local adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, liblldb_path)
vim.g.rustaceanvim = function()
return {
dap = {
adapter = adapter,
},
server = {
on_attach = require("funcs").lsp_on_attach,
},
}
end
end
return M

View file

@ -6,42 +6,42 @@ M.dependencies = { "telescope-fzf-native.nvim" }
M.cmd = "Telescope"
local opts = function()
local actions = require("telescope.actions")
return {
defaults = {
git_worktrees = vim.g.git_worktrees,
prompt_prefix = icons.Selected,
path_display = { "truncate" },
sorting_startegy = "ascending",
layout_config = {
horizontal = { prompt_position = "top", preview_width = 0.5 },
vertical = { mirror = false },
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
mappings = {
i = {
["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
n = { q = actions.close },
},
},
}
local actions = require("telescope.actions")
return {
defaults = {
git_worktrees = vim.g.git_worktrees,
prompt_prefix = icons.Selected,
path_display = { "truncate" },
sorting_startegy = "ascending",
layout_config = {
horizontal = { prompt_position = "top", preview_width = 0.5 },
vertical = { mirror = false },
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
mappings = {
i = {
["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
n = { q = actions.close },
},
},
}
end
M.config = function()
local telescope = require("telescope")
telescope.setup(opts())
if pcall(require, "aerial") then
telescope.load_extension("aerial")
end
if require("funcs").is_available("telescope-fzf-native.nvim") then
telescope.load_extension("fzf")
end
local telescope = require("telescope")
telescope.setup(opts())
if pcall(require, "aerial") then
telescope.load_extension("aerial")
end
if require("funcs").is_available("telescope-fzf-native.nvim") then
telescope.load_extension("fzf")
end
end
return M

View file

@ -1,19 +1,19 @@
local M = { "folke/todo-comments.nvim" }
local icons = require('config.icons')
local icons = require("config.icons")
M.event = { "BufReadPost", "BufNewFile" }
M.config = {
signs = false,
keywords = {
BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } },
TODO = { icon = icons.Task, color = "info" },
HACK = { icon = icons.Flame, color = "warning" },
WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } },
TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
signs = false,
keywords = {
BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } },
TODO = { icon = icons.Task, color = "info" },
HACK = { icon = icons.Flame, color = "warning" },
WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } },
TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
}
return M

View file

@ -3,35 +3,39 @@ local M = { "akinsho/toggleterm.nvim" }
M.cmd = { "ToggleTerm", "TermExec" }
M.opts = {
size = function(term)
if term.direction == "horizontal" then
return vim.o.lines * 0.33
elseif term.direction == "vertical" then
return vim.o.colums * 0.33
end
end,
open_mapping = "<C-z>",
direction = "float",
highlights = {
Normal = { link = "Normal" },
NormalNC = { link = "NormalNC" },
NormalFloat = { link = "NormalFloat" },
FloatBorder = { link = "FloatBorder" },
StatusLine = { link = "StatusLine" },
StatusLineNC = { link = "StatusLineNC" },
WinBar = { link = "WinBar" },
WinBarNC = { link = "WinBarNC" },
},
float_opts = {
border = "curved",
winblend = 5,
width = function() return math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 20))) end,
height = function() return math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 10))) end,
},
on_create = function()
vim.opt.foldcolumn = "0"
vim.opt.signcolumn = "no"
end,
size = function(term)
if term.direction == "horizontal" then
return vim.o.lines * 0.33
elseif term.direction == "vertical" then
return vim.o.colums * 0.33
end
end,
open_mapping = "<C-z>",
direction = "float",
highlights = {
Normal = { link = "Normal" },
NormalNC = { link = "NormalNC" },
NormalFloat = { link = "NormalFloat" },
FloatBorder = { link = "FloatBorder" },
StatusLine = { link = "StatusLine" },
StatusLineNC = { link = "StatusLineNC" },
WinBar = { link = "WinBar" },
WinBarNC = { link = "WinBarNC" },
},
float_opts = {
border = "curved",
winblend = 5,
width = function()
return math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 20)))
end,
height = function()
return math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 10)))
end,
},
on_create = function()
vim.opt.foldcolumn = "0"
vim.opt.signcolumn = "no"
end,
}
return M

View file

@ -3,16 +3,16 @@ local M = { "folke/tokyonight.nvim" }
M.priority = 1000
local opts = {
style = "night",
transparent = true,
on_highlights = function(hl, _)
hl.CurSearch = nil
end
style = "night",
transparent = true,
on_highlights = function(hl, _)
hl.CurSearch = nil
end,
}
M.config = function()
require('tokyonight').setup(opts)
vim.cmd("colorscheme tokyonight")
require("tokyonight").setup(opts)
vim.cmd("colorscheme tokyonight")
end
return M

View file

@ -1,8 +1,8 @@
local M = { "nvim-treesitter/nvim-treesitter" }
M.dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
}
M.event = { "BufReadPost", "BufNewFile" }
@ -10,105 +10,105 @@ M.event = { "BufReadPost", "BufNewFile" }
M.build = ":TSUpdate"
M.cmd = {
"TSBufDisable",
"TSBufEnable",
"TSBufToggle",
"TSDisable",
"TSEnable",
"TSToggle",
"TSInstall",
"TSInstallInfo",
"TSInstallSync",
"TSModuleInfo",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
"TSBufDisable",
"TSBufEnable",
"TSBufToggle",
"TSDisable",
"TSEnable",
"TSToggle",
"TSInstall",
"TSInstallInfo",
"TSInstallSync",
"TSModuleInfo",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
}
M.init = function(plugin)
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end
M.opts = {
ensure_installed = {
"bash",
"c",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"vim",
"vimdoc",
},
autotag = { enable = true },
highlight = {
enable = true,
},
auto_install = true,
autopairs = {
enable = false,
},
incremental_selection = { enable = true },
indent = { enable = true },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["ak"] = { query = "@block.outer", desc = "around block" },
["ik"] = { query = "@block.inner", desc = "inside block" },
["ac"] = { query = "@class.outer", desc = "around class" },
["ic"] = { query = "@class.inner", desc = "inside class" },
["a?"] = { query = "@conditional.outer", desc = "around conditional" },
["i?"] = { query = "@conditional.inner", desc = "inside conditional" },
["af"] = { query = "@function.outer", desc = "around function " },
["if"] = { query = "@function.inner", desc = "inside function " },
["al"] = { query = "@loop.outer", desc = "around loop" },
["il"] = { query = "@loop.inner", desc = "inside loop" },
["aa"] = { query = "@parameter.outer", desc = "around argument" },
["ia"] = { query = "@parameter.inner", desc = "inside argument" },
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]k"] = { query = "@block.outer", desc = "Next block start" },
["]f"] = { query = "@function.outer", desc = "Next function start" },
["]a"] = { query = "@parameter.inner", desc = "Next argument start" },
},
goto_next_end = {
["]K"] = { query = "@block.outer", desc = "Next block end" },
["]F"] = { query = "@function.outer", desc = "Next function end" },
["]A"] = { query = "@parameter.inner", desc = "Next argument end" },
},
goto_previous_start = {
["[k"] = { query = "@block.outer", desc = "Previous block start" },
["[f"] = { query = "@function.outer", desc = "Previous function start" },
["[a"] = { query = "@parameter.inner", desc = "Previous argument start" },
},
goto_previous_end = {
["[K"] = { query = "@block.outer", desc = "Previous block end" },
["[F"] = { query = "@function.outer", desc = "Previous function end" },
["[A"] = { query = "@parameter.inner", desc = "Previous argument end" },
},
},
swap = {
enable = true,
swap_next = {
[">K"] = { query = "@block.outer", desc = "Swap next block" },
[">F"] = { query = "@function.outer", desc = "Swap next function" },
[">A"] = { query = "@parameter.inner", desc = "Swap next argument" },
},
swap_previous = {
["<K"] = { query = "@block.outer", desc = "Swap previous block" },
["<F"] = { query = "@function.outer", desc = "Swap previous function" },
["<A"] = { query = "@parameter.inner", desc = "Swap previous argument" },
},
},
},
ensure_installed = {
"bash",
"c",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"vim",
"vimdoc",
},
autotag = { enable = true },
highlight = {
enable = true,
},
auto_install = true,
autopairs = {
enable = false,
},
incremental_selection = { enable = true },
indent = { enable = true },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["ak"] = { query = "@block.outer", desc = "around block" },
["ik"] = { query = "@block.inner", desc = "inside block" },
["ac"] = { query = "@class.outer", desc = "around class" },
["ic"] = { query = "@class.inner", desc = "inside class" },
["a?"] = { query = "@conditional.outer", desc = "around conditional" },
["i?"] = { query = "@conditional.inner", desc = "inside conditional" },
["af"] = { query = "@function.outer", desc = "around function " },
["if"] = { query = "@function.inner", desc = "inside function " },
["al"] = { query = "@loop.outer", desc = "around loop" },
["il"] = { query = "@loop.inner", desc = "inside loop" },
["aa"] = { query = "@parameter.outer", desc = "around argument" },
["ia"] = { query = "@parameter.inner", desc = "inside argument" },
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]k"] = { query = "@block.outer", desc = "Next block start" },
["]f"] = { query = "@function.outer", desc = "Next function start" },
["]a"] = { query = "@parameter.inner", desc = "Next argument start" },
},
goto_next_end = {
["]K"] = { query = "@block.outer", desc = "Next block end" },
["]F"] = { query = "@function.outer", desc = "Next function end" },
["]A"] = { query = "@parameter.inner", desc = "Next argument end" },
},
goto_previous_start = {
["[k"] = { query = "@block.outer", desc = "Previous block start" },
["[f"] = { query = "@function.outer", desc = "Previous function start" },
["[a"] = { query = "@parameter.inner", desc = "Previous argument start" },
},
goto_previous_end = {
["[K"] = { query = "@block.outer", desc = "Previous block end" },
["[F"] = { query = "@function.outer", desc = "Previous function end" },
["[A"] = { query = "@parameter.inner", desc = "Previous argument end" },
},
},
swap = {
enable = true,
swap_next = {
[">K"] = { query = "@block.outer", desc = "Swap next block" },
[">F"] = { query = "@function.outer", desc = "Swap next function" },
[">A"] = { query = "@parameter.inner", desc = "Swap next argument" },
},
swap_previous = {
["<K"] = { query = "@block.outer", desc = "Swap previous block" },
["<F"] = { query = "@function.outer", desc = "Swap previous function" },
["<A"] = { query = "@parameter.inner", desc = "Swap previous argument" },
},
},
},
}
return M

View file

@ -5,31 +5,35 @@ M.event = { "InsertEnter" }
M.dependencies = { "kevinhwang91/promise-async" }
M.opts = {
preview = {
mappings = {
scrollB = "<C-b>",
scrollF = "<C-f>",
scrollU = "<C-u>",
scrollD = "<C-d>",
},
},
provider_selector = function(_, filetype, buftype)
local function handleFallbackException(bufnr, err, providerName)
if type(err) == "string" and err:match "UfoFallbackException" then
return require("ufo").getFolds(bufnr, providerName)
else
return require("promise").reject(err)
end
end
preview = {
mappings = {
scrollB = "<C-b>",
scrollF = "<C-f>",
scrollU = "<C-u>",
scrollD = "<C-d>",
},
},
provider_selector = function(_, filetype, buftype)
local function handleFallbackException(bufnr, err, providerName)
if type(err) == "string" and err:match("UfoFallbackException") then
return require("ufo").getFolds(bufnr, providerName)
else
return require("promise").reject(err)
end
end
return (filetype == "" or buftype == "nofile") and "indent" -- only use indent until a file is opened
or function(bufnr)
return require("ufo")
.getFolds(bufnr, "lsp")
:catch(function(err) return handleFallbackException(bufnr, err, "treesitter") end)
:catch(function(err) return handleFallbackException(bufnr, err, "indent") end)
end
end,
return (filetype == "" or buftype == "nofile") and "indent" -- only use indent until a file is opened
or function(bufnr)
return require("ufo")
.getFolds(bufnr, "lsp")
:catch(function(err)
return handleFallbackException(bufnr, err, "treesitter")
end)
:catch(function(err)
return handleFallbackException(bufnr, err, "indent")
end)
end
end,
}
return M

View file

@ -1,11 +1,11 @@
local M = { "lervag/vimtex" }
M.init = function()
vim.g.vimtex_view_method = "zathura"
vim.g.tex_flavor = "latex"
vim.g.vimtex_quickfix_mode = 0
vim.o.conceallevel = 1
vim.g.tex_conceal = 'abdmg'
vim.g.vimtex_view_method = "zathura"
vim.g.tex_flavor = "latex"
vim.g.vimtex_quickfix_mode = 0
vim.o.conceallevel = 1
vim.g.tex_conceal = "abdmg"
end
return M

View file

@ -1,37 +1,37 @@
local M = { "folke/which-key.nvim" }
local icons = require('config.icons')
local icons = require("config.icons")
M.event = "VeryLazy"
M.init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
vim.o.timeout = true
vim.o.timeoutlen = 300
end
M.opts = {
plugins = {
presets = {
operators = false,
motions = false,
}
},
icons = {
breadcrumb = icons.Selected,
separator = icons.Selected,
group = "",
},
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
triggers = "auto",
triggers_blacklist = {
i = { "j", "k", "v", "y" },
v = { "j", "k", "y" },
},
plugins = {
presets = {
operators = false,
motions = false,
},
},
icons = {
breadcrumb = icons.Selected,
separator = icons.Selected,
group = "",
},
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
triggers = "auto",
triggers_blacklist = {
i = { "j", "k", "v", "y" },
v = { "j", "k", "y" },
},
}
M.config = function(_, opts)
require("which-key").setup(opts)
require("funcs").which_key_register()
require("which-key").setup(opts)
require("funcs").which_key_register()
end
return M