🐛 fix(nvim): rewrite of a lot of the config style, options and plugins

new terminal, telescope plugins moved into telescope.lua for eassier management and a lot more
This commit is contained in:
Sergio Laín 2023-10-16 12:46:37 +02:00
parent ce2a9fca53
commit 2cce8ffdc8
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
50 changed files with 740 additions and 785 deletions

View file

@ -10,6 +10,7 @@
"lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.lang.java",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.omnisharp",
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.rust",

View file

@ -15,56 +15,56 @@ local function map(mode, lhs, rhs, opts)
end
end
map(
"n",
"<leader>xs",
":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> dua i<CR>",
{ desc = "Workspace Size (root dir)" }
)
-- map(
-- "n",
-- "<leader>xs",
-- ":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> dua i<CR>",
-- { desc = "Workspace Size (root dir)" }
-- )
--
-- map(
-- "n",
-- "<leader>xS",
-- ":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> dua i<CR>",
-- { desc = "Workspace Size (cwd)" }
-- )
--
-- map(
-- "n",
-- "<leader>fx",
-- ":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> xplr<CR>",
-- { desc = "Xplr (root dir)" }
-- )
--
-- map(
-- "n",
-- "<leader>fX",
-- ":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> xplr<CR>",
-- { desc = "Xplr (cwd)" }
-- )
--
-- map(
-- "n",
-- "<leader>gg",
-- ":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> lazygit<CR>",
-- { desc = "Lazygit (root dir)" }
-- )
--
-- map(
-- "n",
-- "<leader>gG",
-- ":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> lazygit<CR>",
-- { desc = "Lazygit (cwd)" }
-- )
--
-- map(
-- "n",
-- "<leader>fd",
-- ":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker<CR>",
-- { desc = "Lazydocker" }
-- )
map(
"n",
"<leader>xS",
":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> dua i<CR>",
{ desc = "Workspace Size (cwd)" }
)
map(
"n",
"<leader>fx",
":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> xplr<CR>",
{ desc = "Xplr (root dir)" }
)
map(
"n",
"<leader>fX",
":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> xplr<CR>",
{ desc = "Xplr (cwd)" }
)
map(
"n",
"<leader>gg",
":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> lazygit<CR>",
{ desc = "Lazygit (root dir)" }
)
map(
"n",
"<leader>gG",
":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> lazygit<CR>",
{ desc = "Lazygit (cwd)" }
)
map(
"n",
"<leader>fd",
":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker<CR>",
{ desc = "Lazydocker" }
)
map("n", "<leader>T", ":Telescope floaterm<CR>", { desc = "Terminals" })
-- map("n", "<leader>T", ":Telescope floaterm<CR>", { desc = "Terminals" })
map("n", "<leader>sz", ":Telescope zoxide list<CR>", { desc = "Zoxide" })
@ -78,24 +78,18 @@ map("n", "<leader>sI", ":Gitignore<CR>", { desc = "Gitignore" })
map("n", "<leader>cC", ":ConformInfo<CR>", { desc = "Conform Info" })
map("n", "<leader>um", ":MarkdownPreviewToggle<CR>", { desc = "Toggle Markdown Preview" })
map(
"n",
"<leader>ft",
":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root><CR>",
{ desc = "New Terminal (root dir)" }
)
map(
"n",
"<leader>fT",
":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer><CR>",
{ desc = "New Terminal (cwd)" }
)
map("n", "<c-Return>", ":FloatermToggle<CR>", { desc = "Toggle Terminal" })
map("t", "<C-Return>", "<C-\\><C-n><C-\\><C-n>:FloatermToggle<CR>", { desc = "Toggle Terminal", nowait = true })
vim.keymap.set("n", "<leader>gU", vim.cmd.UndotreeToggle, { noremap = true, silent = true, desc = "Toggle Undotree" })
-- map(
-- "n",
-- "<leader>ft",
-- ":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root><CR>",
-- { desc = "New Terminal (root dir)" }
-- )
-- map(
-- "n",
-- "<leader>fT",
-- ":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer><CR>",
-- { desc = "New Terminal (cwd)" }
-- )
vim.keymap.set("n", "<C-c>", "<cmd>PickColor<cr>", { noremap = true, silent = true, desc = "Pick Color" })
vim.keymap.set("i", "<C-c>", "<cmd>PickColorInsert<cr>", { noremap = true, silent = true, desc = "Pick Color" })
@ -118,35 +112,35 @@ vim.keymap.set(
vim.api.nvim_set_keymap(
"n",
"<leader>cps",
"<leader>cPs",
"<cmd>lua require('package-info').show({ force = true })<cr>",
{ silent = true, noremap = true, desc = "Show Package Versions" }
)
vim.api.nvim_set_keymap(
"n",
"<leader>cpu",
"<leader>cPu",
"<cmd>lua require('package-info').update()<cr>",
{ silent = true, noremap = true, desc = "Update Package" }
)
vim.api.nvim_set_keymap(
"n",
"<leader>cpr",
"<leader>cPr",
"<cmd>lua require('package-info').delete()<cr>",
{ silent = true, noremap = true, desc = "Remove Package" }
)
vim.api.nvim_set_keymap(
"n",
"<leader>cpv",
"<leader>cPv",
"<cmd>lua require('package-info').change_version()<cr>",
{ silent = true, noremap = true, desc = "Change Package Version" }
)
vim.api.nvim_set_keymap(
"n",
"<leader>cpn",
"<leader>cPn",
"<cmd>lua require('package-info').install()<cr>",
{ silent = true, noremap = true, desc = "Install New Dependency" }
)

View file

@ -99,6 +99,9 @@ vim.api.nvim_set_var("terminal_color_15", "#B8C0E0")
vim.opt.shell = "fish"
vim.o.winwidth = 10
vim.o.winminwidth = 10
vim.o.equalalways = false
-- vim.opt.shiftwidth = 4
-- vim.opt.tabstop = 4
-- vim.opt.smartindent = true

View file

@ -2,22 +2,20 @@ return {
{
"aznhe21/actions-preview.nvim",
event = "BufRead",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
opts = {
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
})
end,
},
},
},
}

View file

@ -1,38 +1,38 @@
return {
{
"gaoDean/autolist.nvim",
ft = {
"markdown",
"text",
"tex",
"plaintex",
"norg",
},
config = function()
require("autolist").setup()
vim.keymap.set("i", "<tab>", "<cmd>AutolistTab<cr>")
vim.keymap.set("i", "<s-tab>", "<cmd>AutolistShiftTab<cr>")
-- vim.keymap.set("i", "<c-t>", "<c-t><cmd>AutolistRecalculate<cr>") -- an example of using <c-t> to indent
vim.keymap.set("i", "<CR>", "<CR><cmd>AutolistNewBullet<cr>")
vim.keymap.set("n", "o", "o<cmd>AutolistNewBullet<cr>")
vim.keymap.set("n", "O", "O<cmd>AutolistNewBulletBefore<cr>")
vim.keymap.set("n", "<CR>", "<cmd>AutolistToggleCheckbox<cr><CR>")
vim.keymap.set("n", "<C-r>", "<cmd>AutolistRecalculate<cr>")
-- cycle list types with dot-repeat
vim.keymap.set("n", "<leader>cn", require("autolist").cycle_next_dr, { expr = true })
vim.keymap.set("n", "<leader>cp", require("autolist").cycle_prev_dr, { expr = true })
-- if you don't want dot-repeat
-- vim.keymap.set("n", "<leader>cn", "<cmd>AutolistCycleNext<cr>")
-- vim.keymap.set("n", "<leader>cp", "<cmd>AutolistCycleNext<cr>")
-- functions to recalculate list on edit
vim.keymap.set("n", ">>", ">><cmd>AutolistRecalculate<cr>")
vim.keymap.set("n", "<<", "<<<cmd>AutolistRecalculate<cr>")
vim.keymap.set("n", "dd", "dd<cmd>AutolistRecalculate<cr>")
vim.keymap.set("v", "d", "d<cmd>AutolistRecalculate<cr>")
end,
{
"gaoDean/autolist.nvim",
ft = {
"markdown",
"text",
"tex",
"plaintex",
"norg",
},
config = function()
require("autolist").setup()
vim.keymap.set("i", "<tab>", "<cmd>AutolistTab<cr>")
vim.keymap.set("i", "<s-tab>", "<cmd>AutolistShiftTab<cr>")
-- vim.keymap.set("i", "<c-t>", "<c-t><cmd>AutolistRecalculate<cr>") -- an example of using <c-t> to indent
vim.keymap.set("i", "<CR>", "<CR><cmd>AutolistNewBullet<cr>")
vim.keymap.set("n", "o", "o<cmd>AutolistNewBullet<cr>")
vim.keymap.set("n", "O", "O<cmd>AutolistNewBulletBefore<cr>")
vim.keymap.set("n", "<CR>", "<cmd>AutolistToggleCheckbox<cr><CR>")
vim.keymap.set("n", "<C-r>", "<cmd>AutolistRecalculate<cr>")
-- cycle list types with dot-repeat
vim.keymap.set("n", "].", require("autolist").cycle_next_dr, { desc = "Next List Type", expr = true })
vim.keymap.set("n", "[.", require("autolist").cycle_prev_dr, { desc = "Prev List Type", expr = true })
-- if you don't want dot-repeat
-- vim.keymap.set("n", "<leader>cn", "<cmd>AutolistCycleNext<cr>")
-- vim.keymap.set("n", "<leader>cp", "<cmd>AutolistCycleNext<cr>")
-- functions to recalculate list on edit
vim.keymap.set("n", ">>", ">><cmd>AutolistRecalculate<cr>")
vim.keymap.set("n", "<<", "<<<cmd>AutolistRecalculate<cr>")
vim.keymap.set("n", "dd", "dd<cmd>AutolistRecalculate<cr>")
vim.keymap.set("v", "d", "d<cmd>AutolistRecalculate<cr>")
end,
},
}

View file

@ -1,14 +1,12 @@
return {
{
"HampusHauffman/block.nvim",
keys = { { "<leader>ub", ":Block<CR>", desc = "Toggle Block" } },
config = function()
require("block").setup({
percent = 0.9,
depth = 4,
colors = nil,
automatic = false,
})
end,
{
"HampusHauffman/block.nvim",
keys = { { "<leader>ub", "<cmd>Block<CR>", desc = "Toggle Block" } },
opts = {
percent = 0.9,
depth = 4,
colors = nil,
automatic = false,
},
},
}

View file

@ -1,14 +1,12 @@
return {
{
"declancm/cinnamon.nvim",
event = "VeryLazy",
config = function()
require("cinnamon").setup({
default_keymaps = true,
extra_keymaps = true,
extended_keymaps = true,
override_keymaps = true,
})
end,
{
"declancm/cinnamon.nvim",
event = "VeryLazy",
opts = {
default_keymaps = true,
extra_keymaps = true,
extended_keymaps = true,
override_keymaps = true,
},
},
}

View file

@ -1,19 +1,17 @@
return {
{
"ziontee113/color-picker.nvim",
cmd = { "PickColor", "PickColorInsert" },
config = function()
require("color-picker").setup({
["icons"] = { "", "" },
["border"] = "rounded", -- none | single | double | rounded | solid | shadow
["keymap"] = { -- mapping example:
["U"] = "<Plug>ColorPickerSlider5Decrease",
["O"] = "<Plug>ColorPickerSlider5Increase",
},
["background_highlight_group"] = "Normal", -- default
["border_highlight_group"] = "FloatBorder", -- default
["text_highlight_group"] = "Normal", --default
})
end,
{
"ziontee113/color-picker.nvim",
cmd = { "PickColor", "PickColorInsert" },
opts = {
["icons"] = { "", "" },
["border"] = "rounded", -- none | single | double | rounded | solid | shadow
["keymap"] = { -- mapping example:
["U"] = "<Plug>ColorPickerSlider5Decrease",
["O"] = "<Plug>ColorPickerSlider5Increase",
},
["background_highlight_group"] = "Normal", -- default
["border_highlight_group"] = "FloatBorder", -- default
["text_highlight_group"] = "Normal", --default
},
},
}

View file

@ -25,7 +25,7 @@ return {
lua = { "stylua" },
fish = { "fish_indent" },
sh = { "shfmt", "shellharden" },
python = { "isort", "black" },
python = { "black" },
bash = { "shfmt", "shellharden" },
javascript = { { "prettierd", "prettier", "rustywind" } },
javascriptreact = { { "prettierd", "prettier", "rustywind" } },
@ -39,6 +39,7 @@ return {
css = { { "prettierd", "prettier", "stylelint" } },
scss = { { "prettierd", "prettier", "stylelint" } },
less = { { "prettierd", "prettier", "stylelint" } },
markdown = { { "prettierd", "prettier" } },
},
-- LazyVim will merge the options you set here with builtin formatters.
-- You can also define any custom formatters here.

View file

@ -1,41 +1,44 @@
return {
{
"tpope/vim-dadbod",
dependencies = {
"kristijanhusak/vim-dadbod-ui",
"kristijanhusak/vim-dadbod-completion",
},
opts = {
db_competion = function()
require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } })
end,
},
config = function(_, opts)
vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui"
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
},
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
"mysql",
"plsql",
},
callback = function()
vim.schedule(opts.db_completion)
end,
})
end,
keys = {
{ "<leader>Dt", "<cmd>DBUIToggle<cr>", desc = "Toggle UI" },
{ "<leader>Df", "<cmd>DBUIFindBuffer<cr>", desc = "Find Buffer" },
{ "<leader>Dr", "<cmd>DBUIRenameBuffer<cr>", desc = "Rename Buffer" },
{ "<leader>Dq", "<cmd>DBUILastQueryInfo<cr>", desc = "Last Query Info" },
},
{
"tpope/vim-dadbod",
dependencies = {
"kristijanhusak/vim-dadbod-ui",
"kristijanhusak/vim-dadbod-completion",
"jsborjesson/vim-uppercase-sql",
},
cmd = { "DBUI", "DBUIToggle" },
ft = "sql",
opts = {
db_competion = function()
require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } })
end,
},
config = function(_, opts)
vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui"
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
},
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
"mysql",
"plsql",
},
callback = function()
vim.schedule(opts.db_completion)
end,
})
end,
keys = {
{ "<leader>Dt", "<cmd>DBUIToggle<cr>", desc = "Toggle UI" },
{ "<leader>Df", "<cmd>DBUIFindBuffer<cr>", desc = "Find Buffer" },
{ "<leader>Dr", "<cmd>DBUIRenameBuffer<cr>", desc = "Rename Buffer" },
{ "<leader>Dq", "<cmd>DBUILastQueryInfo<cr>", desc = "Last Query Info" },
},
},
}

View file

@ -1,75 +0,0 @@
return {
{
"glepnir/dashboard-nvim",
event = "VimEnter",
opts = function()
local logo = [[
]]
-- local logo = [[
-- ▄ ▄
-- ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄
-- █ ▄ █▄█ ▄▄▄ █ █▄█ █ █
-- ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █
-- ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄
-- █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄
-- ▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █
-- █▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █
-- █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█
-- ]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
center = {
{ action = "Telescope find_files", desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find text", icon = "", key = "g" },
{ action = "e $MYVIMRC", desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
end
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end
return opts
end,
},
}

View file

@ -1,13 +1,11 @@
return {
{
"sindrets/diffview.nvim",
keys = {
{ "<Leader>gdd", "<cmd>DiffviewFileHistory<CR>", desc = "Diff File History" },
{ "<Leader>gdo", "<cmd>DiffviewOpen<CR>", desc = "Open Diff View" },
{ "<Leader>gdc", "<cmd>DiffviewClose<CR>", desc = "Close Diff View" },
},
config = function()
require("diffview").setup()
end,
{
"sindrets/diffview.nvim",
keys = {
{ "<Leader>gdd", "<cmd>DiffviewFileHistory<CR>", desc = "Diff File History" },
{ "<Leader>gdo", "<cmd>DiffviewOpen<CR>", desc = "Open Diff View" },
{ "<Leader>gdc", "<cmd>DiffviewClose<CR>", desc = "Close Diff View" },
},
opts = {},
},
}

View file

@ -1,9 +1,13 @@
return {
{
"Bekaboo/dropbar.nvim",
event = "BufRead",
config = function()
require("dropbar").setup()
end,
{
"Bekaboo/dropbar.nvim",
event = "BufRead",
opts = {
sources = {
terminal = {
name = "",
},
},
},
},
}

View file

@ -1,13 +1,11 @@
return {
{
"dnlhc/glance.nvim",
cmd = { "Glance" },
config = function()
require("glance").setup({
border = {
enable = true,
},
})
end,
{
"dnlhc/glance.nvim",
cmd = { "Glance" },
opts = {
border = {
enable = true,
},
},
},
}

View file

@ -1,11 +1,9 @@
return {
{
"tzachar/highlight-undo.nvim",
event = "BufReadPost",
config = function()
require("highlight-undo").setup({
duration = 700,
})
end,
{
"tzachar/highlight-undo.nvim",
event = "BufReadPost",
opts = {
duration = 700,
},
},
}

View file

@ -1,23 +1,21 @@
return {
{
"kosayoda/nvim-lightbulb",
event = "BufReadPre",
config = function()
require("nvim-lightbulb").setup({
sign = {
enabled = false,
priority = 10,
},
float = {
enabled = true,
text = "💡",
win_opts = {},
},
virtual_text = {
enabled = false,
text = "💡",
},
})
end,
{
"kosayoda/nvim-lightbulb",
event = "BufReadPre",
opts = {
sign = {
enabled = false,
priority = 10,
},
float = {
enabled = true,
text = "💡",
win_opts = {},
},
virtual_text = {
enabled = false,
text = "💡",
},
},
},
}

View file

@ -9,7 +9,6 @@ return {
fish = { "fish" },
markdown = { "markdownlint" },
python = { "pylint" },
yaml = { "yamllint" },
dockerfile = { "hadolint" },
css = { "stylelint" },
sass = { "stylelint" },

View file

@ -1,9 +1,7 @@
return {
{
"VidocqH/lsp-lens.nvim",
event = "BufReadPost",
config = function()
require("lsp-lens").setup()
end,
},
{
"VidocqH/lsp-lens.nvim",
event = "BufReadPost",
opts = {},
},
}

View file

@ -34,6 +34,7 @@ return {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
Util.lualine.root_dir(),
{
"diagnostics",
symbols = {
@ -45,9 +46,7 @@ return {
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{
function()
return Util.root.pretty_path()
end,
Util.lualine.pretty_path(),
},
-- stylua: ignore
{
@ -88,6 +87,16 @@ return {
modified = icons.git.modified,
removed = icons.git.removed,
},
source = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end,
},
},
lualine_y = {

View file

@ -1,11 +0,0 @@
return {
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
}

View file

@ -0,0 +1,11 @@
return {
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && npx --yes yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
}

View file

@ -1,79 +1,47 @@
return {
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
opts = {
snippet_engine = "luasnip",
enabled = true,
languages = {
lua = {
template = {
annotation_convention = "ldoc",
},
},
python = {
template = {
annotation_convention = "google_docstrings",
},
},
rust = {
template = {
annotation_convention = "rustdoc",
},
},
javascript = {
template = {
annotation_convention = "jsdoc",
},
},
typescript = {
template = {
annotation_convention = "tsdoc",
},
},
typescriptreact = {
template = {
annotation_convention = "tsdoc",
},
},
},
},
keys = {
{
"<leader>ad",
function()
require("neogen").generate()
end,
desc = "Default Annotation",
},
{
"<leader>ac",
function()
require("neogen").generate({ type = "class" })
end,
desc = "Class",
},
{
"<leader>af",
function()
require("neogen").generate({ type = "func" })
end,
desc = "Function",
},
{
"<leader>at",
function()
require("neogen").generate({ type = "type" })
end,
desc = "Type",
},
{
"<leader>aF",
function()
require("neogen").generate({ type = "file" })
end,
desc = "File",
},
},
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
opts = {
snippet_engine = "luasnip",
enabled = true,
},
keys = {
{
"<leader>ad",
function()
require("neogen").generate()
end,
desc = "Default Annotation",
},
{
"<leader>ac",
function()
require("neogen").generate({ type = "class" })
end,
desc = "Class",
},
{
"<leader>af",
function()
require("neogen").generate({ type = "func" })
end,
desc = "Function",
},
{
"<leader>at",
function()
require("neogen").generate({ type = "type" })
end,
desc = "Type",
},
{
"<leader>aF",
function()
require("neogen").generate({ type = "file" })
end,
desc = "File",
},
},
},
}

View file

@ -1,28 +1,28 @@
return {
{
"nvimtools/none-ls.nvim",
opts = function(_, opts)
local nls = require("null-ls")
{
"nvimtools/none-ls.nvim",
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
nls.builtins.formatting.beautysh,
nls.builtins.formatting.black,
nls.builtins.formatting.csharpier,
nls.builtins.formatting.rustywind,
nls.builtins.formatting.sqlfmt,
nls.builtins.formatting.rustfmt,
nls.builtins.formatting.fish_indent,
nls.builtins.formatting.taplo,
nls.builtins.diagnostics.fish,
--nls.builtins.diagnostics.cspell,
--nls.builtins.code_actions.cspell,
nls.builtins.hover.dictionary,
nls.builtins.hover.printenv,
--nls.builtins.diagnostics.markuplint,
nls.builtins.diagnostics.markdownlint,
--nls.builtins.diagnostics.codespell,
})
end,
},
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
nls.builtins.formatting.beautysh,
nls.builtins.formatting.black,
nls.builtins.formatting.csharpier,
nls.builtins.formatting.rustywind,
nls.builtins.formatting.sqlfmt,
nls.builtins.formatting.rustfmt,
nls.builtins.formatting.fish_indent,
nls.builtins.formatting.taplo,
nls.builtins.diagnostics.fish,
--nls.builtins.diagnostics.cspell,
--nls.builtins.code_actions.cspell,
nls.builtins.hover.dictionary,
nls.builtins.hover.printenv,
--nls.builtins.diagnostics.markuplint,
nls.builtins.diagnostics.markdownlint,
--nls.builtins.diagnostics.codespell,
})
end,
},
}

View file

@ -1,9 +1,7 @@
return {
{
"nacro90/numb.nvim",
event = "BufRead",
config = function()
require("numb").setup({})
end,
},
{
"nacro90/numb.nvim",
event = "BufRead",
opts = {},
},
}

View file

@ -1,30 +1,28 @@
return {
{
"vuki656/package-info.nvim",
requires = "MunifTanjim/nui.nvim",
event = "BufRead",
config = function()
require("package-info").setup({
colors = {
up_to_date = "#3C4048", -- Text color for up to date dependency virtual text
outdated = "#d19a66", -- Text color for outdated dependency virtual text
},
icons = {
enable = true, -- Whether to display icons
style = {
up_to_date = "|  ", -- Icon for up to date dependencies
outdated = "|  ", -- Icon for outdated dependencies
},
},
autostart = true, -- Whether to autostart when `package.json` is opened
hide_up_to_date = false, -- It hides up to date versions when displaying virtual text
hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3
-- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc...
-- The plugin will try to auto-detect the package manager based on
-- `yarn.lock` or `package-lock.json`. If none are found it will use the
-- provided one, if nothing is provided it will use `yarn`
package_manager = "npm",
})
end,
{
"vuki656/package-info.nvim",
requires = "MunifTanjim/nui.nvim",
event = "BufRead",
opts = {
colors = {
up_to_date = "#3C4048", -- Text color for up to date dependency virtual text
outdated = "#d19a66", -- Text color for outdated dependency virtual text
},
icons = {
enable = true, -- Whether to display icons
style = {
up_to_date = "|  ", -- Icon for up to date dependencies
outdated = "|  ", -- Icon for outdated dependencies
},
},
autostart = true, -- Whether to autostart when `package.json` is opened
hide_up_to_date = false, -- It hides up to date versions when displaying virtual text
hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3
-- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc...
-- The plugin will try to auto-detect the package manager based on
-- `yarn.lock` or `package-lock.json`. If none are found it will use the
-- provided one, if nothing is provided it will use `yarn`
package_manager = "npm",
},
},
}

View file

@ -1,16 +1,14 @@
return {
{
"Weissle/persistent-breakpoints.nvim",
event = "BufReadPost",
keys = {
{ "<leader>dbd", "<cmd>PBClearAllBreakpoints<cr>", desc = "Delete All Breakpoints" },
{ "<leader>dbc", "<cmd>PBSetConditionalBreakpoint<cr>", desc = "Set Conditional Breakpoint" },
{ "<leader>dbb", "<cmd>PBToggleBreakpoint<cr>", desc = "Toggle Breakpoint" },
},
config = function()
require("persistent-breakpoints").setup({
load_breakpoints_event = { "BufReadPost" },
})
end,
{
"Weissle/persistent-breakpoints.nvim",
event = "BufReadPost",
keys = {
{ "<leader>dbd", "<cmd>PBClearAllBreakpoints<cr>", desc = "Delete All Breakpoints" },
{ "<leader>dbc", "<cmd>PBSetConditionalBreakpoint<cr>", desc = "Set Conditional Breakpoint" },
{ "<leader>dbb", "<cmd>PBToggleBreakpoint<cr>", desc = "Toggle Breakpoint" },
},
opts = {
load_breakpoints_event = { "BufReadPost" },
},
},
}

View file

@ -1,20 +1,20 @@
return {
{
"HiPhish/rainbow-delimiters.nvim",
event = "VeryLazy",
config = function(_, opts)
require("rainbow-delimiters.setup")(opts)
end,
opts = {
highlight = {
"RainbowDelimiterBlue",
"RainbowDelimiterYellow",
"RainbowDelimiterViolet",
"RainbowDelimiterOrange",
"RainbowDelimiterCyan",
"RainbowDelimiterRed",
"RainbowDelimiterGreen",
},
},
{
"HiPhish/rainbow-delimiters.nvim",
event = "VeryLazy",
config = function(_, opts)
require("rainbow-delimiters.setup").setup({ opts })
end,
opts = {
highlight = {
"RainbowDelimiterBlue",
"RainbowDelimiterYellow",
"RainbowDelimiterViolet",
"RainbowDelimiterOrange",
"RainbowDelimiterCyan",
"RainbowDelimiterRed",
"RainbowDelimiterGreen",
},
},
},
}

View file

@ -1,13 +1,11 @@
return {
{
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
config = function()
require("refactoring").setup()
end,
{
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
opts = {},
-- stylua: ignore
keys = {
{ "<leader>Rs", function() require("telescope").extensions.refactoring.refactors() end, mode = { "v" }, desc = "Refactor Options", },
@ -22,5 +20,5 @@ return {
{ "<leader>cRx", function() require('refactoring').refactor('Extract Variable') end, mode = {"v"}, desc = "Extract Variable" },
{ "<leader>cRp", function() require('refactoring').debug.print_var({}) end, mode = {"v"}, desc = "Debug Print Variable" },
},
},
},
}

View file

@ -1,13 +1,10 @@
return {
{
"bennypowers/nvim-regexplainer",
config = function()
require("regexplainer").setup()
end,
event = "BufReadPost",
requires = {
"nvim-treesitter/nvim-treesitter",
"MunifTanjim/nui.nvim",
},
{
"bennypowers/nvim-regexplainer",
opts = {},
event = "BufReadPost",
requires = {
"MunifTanjim/nui.nvim",
},
},
}

View file

@ -1,65 +1,63 @@
return {
{
"lewis6991/satellite.nvim",
event = "BufRead",
config = function()
require("satellite").setup({
current_only = false,
winblend = 50,
zindex = 40,
excluded_filetypes = {},
width = 2,
handlers = {
cursor = {
enable = true,
-- Supports any number of symbols
symbols = { "", "", "", "" },
-- symbols = { '⎻', '⎼' }
-- Highlights:
-- - SatelliteCursor (default links to NonText
},
search = {
enable = true,
-- Highlights:
-- - SatelliteSearch (default links to Search)
-- - SatelliteSearchCurrent (default links to SearchCurrent)
},
diagnostic = {
enable = true,
signs = { "-", "=", "" },
min_severity = vim.diagnostic.severity.HINT,
-- Highlights:
-- - SatelliteDiagnosticError (default links to DiagnosticError)
-- - SatelliteDiagnosticWarn (default links to DiagnosticWarn)
-- - SatelliteDiagnosticInfo (default links to DiagnosticInfo)
-- - SatelliteDiagnosticHint (default links to DiagnosticHint)
},
gitsigns = {
enable = true,
signs = { -- can only be a single character (multibyte is okay)
add = "",
change = "",
delete = "-",
},
-- Highlights:
-- SatelliteGitSignsAdd (default links to GitSignsAdd)
-- SatelliteGitSignsChange (default links to GitSignsChange)
-- SatelliteGitSignsDelete (default links to GitSignsDelete)
},
marks = {
enable = true,
show_builtins = false, -- shows the builtin marks like [ ] < >
key = "m",
-- Highlights:
-- SatelliteMark (default links to Normal)
},
quickfix = {
signs = { "-", "=", "" },
-- Highlights:
-- SatelliteQuickfix (default links to WarningMsg)
},
},
})
end,
{
"lewis6991/satellite.nvim",
event = "BufRead",
opts = {
current_only = true,
winblend = 50,
zindex = 40,
excluded_filetypes = {},
width = 2,
handlers = {
cursor = {
enable = true,
-- Supports any number of symbols
symbols = { "", "", "", "" },
-- symbols = { '⎻', '⎼' }
-- Highlights:
-- - SatelliteCursor (default links to NonText
},
search = {
enable = true,
-- Highlights:
-- - SatelliteSearch (default links to Search)
-- - SatelliteSearchCurrent (default links to SearchCurrent)
},
diagnostic = {
enable = true,
signs = { "-", "=", "" },
min_severity = vim.diagnostic.severity.HINT,
-- Highlights:
-- - SatelliteDiagnosticError (default links to DiagnosticError)
-- - SatelliteDiagnosticWarn (default links to DiagnosticWarn)
-- - SatelliteDiagnosticInfo (default links to DiagnosticInfo)
-- - SatelliteDiagnosticHint (default links to DiagnosticHint)
},
gitsigns = {
enable = true,
signs = { -- can only be a single character (multibyte is okay)
add = "",
change = "",
delete = "-",
},
-- Highlights:
-- SatelliteGitSignsAdd (default links to GitSignsAdd)
-- SatelliteGitSignsChange (default links to GitSignsChange)
-- SatelliteGitSignsDelete (default links to GitSignsDelete)
},
marks = {
enable = true,
show_builtins = false, -- shows the builtin marks like [ ] < >
key = "m",
-- Highlights:
-- SatelliteMark (default links to Normal)
},
quickfix = {
signs = { "-", "=", "" },
-- Highlights:
-- SatelliteQuickfix (default links to WarningMsg)
},
},
},
},
}

View file

@ -1,13 +1,13 @@
return {
{
"mrjones2014/smart-splits.nvim",
build = "./kitty/install-kittens.bash",
{
"mrjones2014/smart-splits.nvim",
build = "./kitty/install-kittens.bash",
-- stylua: ignore
keys = {
{ "<A-h>", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" },
{ "<A-j>", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" },
{ "<A-k>", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" },
{ "<A-l>", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" },
{ "<C-A-Left>", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" },
{ "<C-A-Down>", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" },
{ "<C-A-Up>", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" },
{ "<C-A-Right>", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" },
{ "<C-h>", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" },
{ "<C-j>", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" },
{ "<C-k>", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" },
@ -17,5 +17,5 @@ return {
{ "<C-A-k>", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up", mode = "n" },
{ "<C-A-l>", function() require("smart-splits").swap_buf_right() end, desc = "Swap buffer right", mode = "n" },
},
},
},
}

View file

@ -1,26 +0,0 @@
return {
{
"prochri/telescope-all-recent.nvim",
event = "VeryLazy",
config = function()
require("telescope-all-recent").setup({
pickers = {
["workspaces.nvim#workspaces"] = {
disable = false,
sorting = "frecency",
},
["project.nvim#projects"] = {
disable = false,
sorting = "frecency",
},
["yanky.nvim#yank_history"] = {
disable = true,
},
["zoxide.nvim#zoxide"] = {
disable = true,
},
},
})
end,
},
}

View file

@ -1,10 +0,0 @@
return {
{
"dawsers/telescope-floaterm.nvim",
opts = {},
event = "VeryLazy",
config = function(_, opts)
require("telescope").load_extension("floaterm")
end,
},
}

View file

@ -1,10 +0,0 @@
return {
{
"piersolenski/telescope-import.nvim",
requires = "nvim-telescope/telescope.nvim",
event = "VeryLazy",
config = function(_, opts)
require("telescope").load_extension("import")
end,
},
}

View file

@ -1,9 +0,0 @@
return {
{
"tsakirist/telescope-lazy.nvim",
event = "VeryLazy",
config = function()
require("telescope").load_extension("lazy")
end,
},
}

View file

@ -1,9 +0,0 @@
return {
{
"benfowler/telescope-luasnip.nvim",
event = "VeryLazy",
config = function()
require("telescope").load_extension("luasnip")
end,
},
}

View file

@ -1,10 +0,0 @@
return {
{
"debugloop/telescope-undo.nvim",
opts = {},
event = "VeryLazy",
config = function(_, opts)
require("telescope").load_extension("undo")
end,
}
}

View file

@ -1,9 +0,0 @@
return {
{
"jvgrootveld/telescope-zoxide",
event = "VeryLazy",
config = function()
require("telescope").load_extension("zoxide")
end,
},
}

View file

@ -17,6 +17,75 @@ return {
end)
end,
},
{
"debugloop/telescope-undo.nvim",
opts = {},
event = "VeryLazy",
config = function(_, opts)
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("undo")
end)
end,
},
{
"prochri/telescope-all-recent.nvim",
event = "VeryLazy",
opts = {
pickers = {
["workspaces.nvim#workspaces"] = {
disable = false,
sorting = "frecency",
},
["project.nvim#projects"] = {
disable = false,
sorting = "frecency",
},
["yanky.nvim#yank_history"] = {
disable = true,
},
["zoxide.nvim#zoxide"] = {
disable = true,
},
},
},
},
{
"benfowler/telescope-luasnip.nvim",
event = "VeryLazy",
config = function()
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("luasnip")
end)
end,
},
{
"piersolenski/telescope-import.nvim",
requires = "nvim-telescope/telescope.nvim",
event = "VeryLazy",
config = function(_, opts)
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("import")
end)
end,
},
{
"jvgrootveld/telescope-zoxide",
event = "VeryLazy",
config = function()
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("zoxide")
end)
end,
},
{
"tsakirist/telescope-lazy.nvim",
event = "VeryLazy",
config = function()
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("lazy")
end)
end,
},
},
keys = {
{
@ -97,7 +166,7 @@ return {
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
{ "<leader>gu", "<cmd>Telescope undo<cr>", desc = "Telescope Undotree" },
{ "<leader>cu", "<cmd>Telescope undo<cr>", desc = "Undotree" },
{
"<leader>sw",
Util.telescope("grep_string", { word_match = "-w" }),

View file

@ -0,0 +1,38 @@
return {
{
"akinsho/nvim-toggleterm.lua",
cmd = "ToggleTerm",
opts = {
-- size can be a number or function which is passed the current terminal
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_filetypes = {},
shade_terminals = true,
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true,
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
direction = "float",
close_on_exit = false, -- close the terminal window when the process exits
shell = "/bin/fish", -- change the default shell
auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_win_open'
-- see :h nvim_win_open for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
border = "curved",
-- width = <value>,
-- height = <value>,
winblend = 3,
highlights = { border = "Normal", background = "Normal" },
},
},
keys = {
{ [[<c-\>]], "<cmd>ToggleTerm<CR>", mode = "n", desc = "Toggle terminal" },
},
},
}

View file

@ -1,38 +0,0 @@
return {
{
"akinsho/nvim-toggleterm.lua",
cmd = "ToggleTerm",
opts = {
-- size can be a number or function which is passed the current terminal
size = 20,
open_mapping = [[<c-return>]],
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_filetypes = {},
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true,
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
direction = "float",
close_on_exit = true, -- close the terminal window when the process exits
shell = "/bin/fish", -- change the default shell
auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_win_open'
-- see :h nvim_win_open for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
border = "curved",
-- width = <value>,
-- height = <value>,
winblend = 3,
highlights = { border = "Normal", background = "Normal" },
},
},
keys = {
{ "<c-Return>", "<cmd>ToggleTerm<CR>", mode = "n", desc = "Toggle terminal" },
{ "<c-Return>", "<C-\\><C-n><C-\\><C-n>:FloatermToggle<CR>", mode = "t", desc = "Toggle terminal" },
},
},
}

View file

@ -1,29 +1,29 @@
return {
{
"folke/twilight.nvim",
cmd = "Twilight",
keys = { { "<leader>ut", "<cmd>Twilight<cr>", desc = "Toggle Twilight" } },
opts = {
{
dimming = {
alpha = 0.25, -- amount of dimming
-- we try to get the foreground from the highlight groups or fallback color
color = { "Normal", "#ffffff" },
term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color
inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer)
},
context = 20, -- amount of lines we will try to show around the current line
treesitter = true, -- use treesitter when available for the filetype
-- treesitter is used to automatically expand the visible text,
-- but you can further control the types of nodes that should always be fully expanded
expand = { -- for treesitter, we always try to expand to the top-most ancestor with these types
"function",
"method",
"table",
"if_statement",
},
exclude = {}, -- exclude these filetypes
},
{
"folke/twilight.nvim",
cmd = "Twilight",
keys = { { "<leader>uZ", "<cmd>Twilight<cr>", desc = "Toggle Twilight" } },
opts = {
{
dimming = {
alpha = 0.25, -- amount of dimming
-- we try to get the foreground from the highlight groups or fallback color
color = { "Normal", "#ffffff" },
term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color
inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer)
},
context = 20, -- amount of lines we will try to show around the current line
treesitter = true, -- use treesitter when available for the filetype
-- treesitter is used to automatically expand the visible text,
-- but you can further control the types of nodes that should always be fully expanded
expand = { -- for treesitter, we always try to expand to the top-most ancestor with these types
"function",
"method",
"table",
"if_statement",
},
exclude = {}, -- exclude these filetypes
},
},
},
}

View file

@ -1,6 +1,6 @@
return {
{
"mbbill/undotree",
cmd = "UndotreeToggle",
},
{
"mbbill/undotree",
event = "BufReadPost",
},
}

View file

@ -1,12 +1,10 @@
return {
{
"axieax/urlview.nvim",
cmd = { "UrlView" },
keys = { { "<leader>su", "<cmd>UrlView<cr>", desc = "Search Urls" } },
config = function()
require("urlview").setup({
default_picker = "telescope",
})
end,
{
"axieax/urlview.nvim",
cmd = { "UrlView" },
keys = { { "<leader>su", "<cmd>UrlView<cr>", desc = "Search Urls" } },
opts = {
default_picker = "telescope",
},
},
}

View file

@ -23,7 +23,7 @@ return {
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>cc"] = { name = "+compile" },
["<leader>cp"] = { name = "+packages" },
["<leader>cP"] = { name = "+packages" },
["<leader>gd"] = { name = "+diff" },
["<leader>gw"] = { name = "+worktrees" },
["<leader>cR"] = { name = "+refactor" },

View file

@ -0,0 +1,100 @@
local M = {}
M.winbar_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"neo-tree",
"Trouble",
"alpha",
"lir",
"Outline",
"spectre_panel",
"toggleterm",
}
local get_filename = function()
local filename = vim.fn.expand("%:t")
local extension = vim.fn.expand("%:e")
local f = require("user.functions")
if not f.isempty(filename) then
local file_icon, file_icon_color =
require("nvim-web-devicons").get_icon_color(filename, extension, { default = true })
local hl_group = "FileIconColor" .. extension
vim.api.nvim_set_hl(0, hl_group, { fg = file_icon_color })
if f.isempty(file_icon) then
file_icon = ""
file_icon_color = ""
end
return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#LineNr#" .. filename .. "%*"
end
end
local get_gps = function()
local status_gps_ok, gps = pcall(require, "nvim-gps")
if not status_gps_ok then
return ""
end
local status_ok, gps_location = pcall(gps.get_location, {})
if not status_ok then
return ""
end
if not gps.is_available() or gps_location == "error" then
return ""
end
if not require("user.functions").isempty(gps_location) then
return require("user.icons").ui.ChevronRight .. " " .. gps_location
else
return ""
end
end
local excludes = function()
if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then
vim.opt_local.winbar = nil
return true
end
return false
end
M.get_winbar = function()
if excludes() then
return
end
local f = require("user.functions")
local value = get_filename()
local gps_added = false
if not f.isempty(value) then
local gps_value = get_gps()
value = value .. " " .. gps_value
if not f.isempty(gps_value) then
gps_added = true
end
end
if not f.isempty(value) and f.get_buf_option("mod") then
local mod = "%#LineNr#" .. require("user.icons").ui.Circle .. "%*"
if gps_added then
value = value .. " " .. mod
else
value = value .. mod
end
end
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", value, { scope = "local" })
if not status_ok then
return
end
end
return M

View file

@ -1,21 +1,16 @@
return {
{
"anuvyklack/windows.nvim",
event = "WinNew",
dependencies = {
{ "anuvyklack/middleclass" },
{ "anuvyklack/animation.nvim" },
},
keys = {
{ "<leader>wv", "<cmd>WindowsMaximizeVertically<cr>", desc = "Vertical Zoom" },
{ "<leader>wh", "<cmd>WindowsMaximizeHorizontally<cr>", desc = "Horizontal Zoom" },
{ "<leader>we", "<cmd>WindowsEqualize<cr>", desc = "Equalize Zoom" },
},
config = function()
vim.o.winwidth = 10
vim.o.winminwidth = 10
vim.o.equalalways = false
require("windows").setup()
end,
{
"anuvyklack/windows.nvim",
event = "WinNew",
dependencies = {
{ "anuvyklack/middleclass" },
{ "anuvyklack/animation.nvim" },
},
keys = {
{ "<leader>wv", "<cmd>WindowsMaximizeVertically<cr>", desc = "Vertical Zoom" },
{ "<leader>wh", "<cmd>WindowsMaximizeHorizontally<cr>", desc = "Horizontal Zoom" },
{ "<leader>we", "<cmd>WindowsEqualize<cr>", desc = "Equalize Zoom" },
},
opts = {},
},
}