mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-29 02:53:50 -03:00
chore: organize ui shit in its own folder
This commit is contained in:
parent
f6e7ce77d8
commit
9569774c7b
10 changed files with 45 additions and 8 deletions
14
lua/config/plugins/ui/alpha.lua
Normal file
14
lua/config/plugins/ui/alpha.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local M = {
|
||||
"goolord/alpha-nvim",
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
local startify = require("alpha.themes.startify")
|
||||
startify.section.bottom_buttons.val = {
|
||||
startify.button("e", "New file", "<cmd>ene <CR>"),
|
||||
startify.button("q", "Quit", "<cmd>q <CR>"),
|
||||
}
|
||||
require("alpha").setup(startify.config)
|
||||
end
|
||||
|
||||
return M
|
32
lua/config/plugins/ui/colors.lua
Normal file
32
lua/config/plugins/ui/colors.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
local M = {
|
||||
{
|
||||
"EdenEast/nightfox.nvim",
|
||||
enabled = true,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd("colorscheme nightfox")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
enabled = false,
|
||||
priority = 1000,
|
||||
opts = {
|
||||
variant = "auto",
|
||||
dark_variant = "main",
|
||||
groups = {
|
||||
border = "muted",
|
||||
panel = "surface",
|
||||
error = "love",
|
||||
hint = "iris",
|
||||
info = "foam",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
9
lua/config/plugins/ui/dressing.lua
Normal file
9
lua/config/plugins/ui/dressing.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local M = {
|
||||
"stevearc/dressing.nvim",
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
require("dressing").setup()
|
||||
end
|
||||
|
||||
return M
|
11
lua/config/plugins/ui/init.lua
Normal file
11
lua/config/plugins/ui/init.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
local M = {
|
||||
require("config.plugins.ui.colors"),
|
||||
require("config.plugins.ui.alpha"),
|
||||
require("config.plugins.ui.dressing"),
|
||||
require("config.plugins.ui.whichkey"),
|
||||
require("config.plugins.ui.noice"),
|
||||
require("config.plugins.ui.scroll"),
|
||||
require("config.plugins.ui.status"),
|
||||
}
|
||||
|
||||
return M
|
93
lua/config/plugins/ui/noice.lua
Normal file
93
lua/config/plugins/ui/noice.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
local M = {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
local noice = require("noice")
|
||||
|
||||
noice.setup({
|
||||
routes = {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
any = {
|
||||
{ find = "%d+L, %d+B" },
|
||||
{ find = "; after #%d+" },
|
||||
{ find = "; before #%d+" },
|
||||
{ find = "%d fewer lines" },
|
||||
{ find = "%d more lines" },
|
||||
},
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
progress = { enabled = true },
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
hover = { silent = true },
|
||||
signature = {
|
||||
auto_open = { throttle = vim.api.nvim_get_option_value("updatetime", { scope = "global" }) },
|
||||
},
|
||||
},
|
||||
cmdline = {
|
||||
format = {
|
||||
cmdline = { icon = "" },
|
||||
search_down = { icon = " " },
|
||||
search_up = { icon = " " },
|
||||
},
|
||||
},
|
||||
messages = {
|
||||
enabled = false,
|
||||
},
|
||||
popupmenu = { enabled = true },
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
long_message_to_split = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
throttle = 1000,
|
||||
views = {
|
||||
split = {
|
||||
enter = true,
|
||||
size = "25%",
|
||||
win_options = {
|
||||
signcolumn = "no",
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
list = false,
|
||||
wrap = false,
|
||||
},
|
||||
},
|
||||
popup = { border = { style = "rounded" } },
|
||||
hover = {
|
||||
border = { style = "rounded" },
|
||||
position = { row = 2, col = 2 },
|
||||
},
|
||||
mini = {
|
||||
timeout = 3000,
|
||||
position = { row = -2 },
|
||||
border = { style = "rounded" },
|
||||
win_options = {
|
||||
winblend = vim.api.nvim_get_option_value("winblend", { scope = "global" }),
|
||||
},
|
||||
},
|
||||
cmdline_popup = { border = { style = "rounded" } },
|
||||
confirm = {
|
||||
border = {
|
||||
style = "rounded",
|
||||
padding = { 0, 1 },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
41
lua/config/plugins/ui/scroll.lua
Normal file
41
lua/config/plugins/ui/scroll.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
local M = {
|
||||
"karb94/neoscroll.nvim",
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
require("neoscroll").setup({
|
||||
-- All these keys will be mapped to their corresponding default scrolling animation
|
||||
mappings = { "<C-u>", "<C-d>" },
|
||||
hide_cursor = true, -- Hide cursor while scrolling
|
||||
stop_eof = true, -- Stop at <EOF> when scrolling downwards
|
||||
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
|
||||
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
|
||||
easing_function = nil, -- Default easing function
|
||||
pre_hook = nil, -- Function to run before the scrolling animation starts
|
||||
post_hook = nil, -- Function to run after the scrolling animation ends
|
||||
performance_mode = false, -- Disable "Performance Mode" on all buffers.
|
||||
})
|
||||
local neoscroll = require("neoscroll")
|
||||
|
||||
local t = {
|
||||
["<C-u>"] = function()
|
||||
neoscroll.ctrl_u({ duration = 50 })
|
||||
end,
|
||||
["<C-k>"] = function()
|
||||
neoscroll.ctrl_u({ duration = 50 })
|
||||
end,
|
||||
["<C-d>"] = function()
|
||||
neoscroll.ctrl_d({ duration = 50 })
|
||||
end,
|
||||
["<C-j>"] = function()
|
||||
neoscroll.ctrl_d({ duration = 50 })
|
||||
end,
|
||||
}
|
||||
|
||||
local modes = { "n", "v", "x" }
|
||||
for key, func in pairs(t) do
|
||||
vim.keymap.set(modes, key, func)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
66
lua/config/plugins/ui/status.lua
Normal file
66
lua/config/plugins/ui/status.lua
Normal file
|
@ -0,0 +1,66 @@
|
|||
local M = {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local lualine = require("lualine")
|
||||
|
||||
local mode = "mode"
|
||||
local filetype = { "filetype", icon_only = true }
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
sections = { "error", "warn", "info", "hint" },
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Info,
|
||||
warn = icons.diagnostics.Warning,
|
||||
},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
source = function()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end,
|
||||
symbols = {
|
||||
added = icons.git.LineAdded .. " ",
|
||||
modified = icons.git.LineModified .. " ",
|
||||
removed = icons.git.LineRemoved .. " ",
|
||||
},
|
||||
colored = true,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { mode },
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { diff, diagnostics, filetype },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
25
lua/config/plugins/ui/whichkey.lua
Normal file
25
lua/config/plugins/ui/whichkey.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local M = {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
require("which-key").setup({
|
||||
win = {
|
||||
border = "single",
|
||||
},
|
||||
plugins = {
|
||||
marks = true,
|
||||
registers = true,
|
||||
spelling = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue