🚚 Better structure
- Reorganize plugins - Eliminate ui directory - Follows proper config structure
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- -------------------------------- DASHBOARD ----------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
return {
|
||||
"nvimdev/dashboard-nvim",
|
||||
opts = function()
|
||||
if vim.fn.winheight(0) >= 80 and vim.fn.winwidth(0) >= 80 then
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/rootiest.txt"),
|
||||
"\n"
|
||||
)
|
||||
elseif vim.fn.winheight(0) >= 48 and vim.fn.winwidth(0) >= 48 then
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/nvim.txt"),
|
||||
"\n"
|
||||
)
|
||||
elseif vim.fn.winwidth(0) >= 100 then
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/long.txt"),
|
||||
"\n"
|
||||
)
|
||||
elseif vim.fn.winwidth(0) >= 80 then
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/tall.txt"),
|
||||
"\n"
|
||||
)
|
||||
elseif vim.fn.winwidth(0) >= 50 then
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/small.txt"),
|
||||
"\n"
|
||||
)
|
||||
else
|
||||
LOGO = table.concat(
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/logo/tiny.txt"),
|
||||
"\n"
|
||||
)
|
||||
end
|
||||
LOGO = "\n\n" .. LOGO .. "\n\n"
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(LOGO, "\n"),
|
||||
-- stylua: ignore
|
||||
center = {
|
||||
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" },
|
||||
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g" },
|
||||
{ action = "LazyGit", desc = " LazyGit", icon = " ", key = "G" },
|
||||
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = 'RemoteStart', desc = " Remote Session", icon = " ", key = "S" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, 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)
|
||||
button.key_format = " %s"
|
||||
end
|
||||
-- open dashboard after closing lazy
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
}
|
||||
@@ -103,4 +103,88 @@ return {
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"gen740/SmoothCursor.nvim",
|
||||
event = "InsertEnter",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("smoothcursor").setup({
|
||||
type = "default",
|
||||
cursor = "",
|
||||
texthl = "SmoothCursor",
|
||||
fancy = {
|
||||
enable = true, -- enable fancy mode
|
||||
head = { cursor = "", texthl = nil, linehl = nil },
|
||||
body = {},
|
||||
tail = { false }, -- false to disable fancy tail
|
||||
},
|
||||
matrix = { -- Loaded when 'type' is set to "matrix"
|
||||
head = {
|
||||
cursor = require("smoothcursor.matrix_chars"),
|
||||
texthl = {
|
||||
"SmoothCursor",
|
||||
},
|
||||
linehl = nil, -- No line highlight for the head
|
||||
},
|
||||
body = {
|
||||
length = 6, -- Specifies the length of the cursor body
|
||||
cursor = require("smoothcursor.matrix_chars"),
|
||||
texthl = {
|
||||
"SmoothCursorGreen",
|
||||
},
|
||||
},
|
||||
tail = {
|
||||
cursor = nil,
|
||||
texthl = {
|
||||
"SmoothCursor",
|
||||
},
|
||||
},
|
||||
unstop = false,
|
||||
},
|
||||
autostart = true, -- Automatically start SmoothCursor
|
||||
always_redraw = true, -- Redraw the screen on each update
|
||||
flyin_effect = nil, -- Choose "bottom" or "top" for flying effect
|
||||
speed = 25, -- Max speed is 100 to stick with your current position
|
||||
intervals = 35, -- Update intervals in milliseconds
|
||||
priority = 10, -- Set marker priority
|
||||
timeout = 3000, -- Timeout for animations in milliseconds
|
||||
threshold = 3, -- Animate only if cursor moves more than this many lines
|
||||
max_threshold = 2000, -- If you move more than this many lines, don't animate (if `nil`, deactivate check)
|
||||
disable_float_win = false, -- Disable in floating windows
|
||||
enabled_filetypes = nil, -- Enable only for specific file types, e.g., { "lua", "vim" }
|
||||
disabled_filetypes = nil, -- Disable for these file types
|
||||
show_last_positions = nil,
|
||||
})
|
||||
-- Define cursor color/icon based on mode
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
autocmd({ "ModeChanged", "BufEnter" }, {
|
||||
callback = function()
|
||||
local current_mode = vim.fn.mode()
|
||||
if current_mode == "n" then
|
||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8aa8f3" })
|
||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||
elseif current_mode == "v" then
|
||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||
elseif current_mode == "V" then
|
||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||
elseif current_mode == "�" then
|
||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
|
||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||
elseif current_mode == "i" then
|
||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#9bd482" })
|
||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||
end
|
||||
end,
|
||||
})
|
||||
-- Define last cursor position icon
|
||||
vim.fn.sign_define("smoothcursor_n", { text = "" })
|
||||
vim.fn.sign_define("smoothcursor_v", { text = " " })
|
||||
vim.fn.sign_define("smoothcursor_V", { text = "" })
|
||||
vim.fn.sign_define("smoothcursor_i", { text = "" })
|
||||
vim.fn.sign_define("smoothcursor_�", { text = "" })
|
||||
vim.fn.sign_define("smoothcursor_R", { text = "" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package.path = package.path
|
||||
.. ";"
|
||||
.. vim.fn.expand("$HOME")
|
||||
.. "/.luarocks/share/lua/5.1/?/init.lua"
|
||||
package.path = package.path
|
||||
.. ";"
|
||||
.. vim.fn.expand("$HOME")
|
||||
.. "/.luarocks/share/lua/5.1/?.lua"
|
||||
|
||||
-- lazy snippet
|
||||
return {
|
||||
"3rd/image.nvim",
|
||||
config = function()
|
||||
require("image").setup()
|
||||
end,
|
||||
cond = function()
|
||||
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.useimage") == 1 then
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.useimage")[1]
|
||||
== "true"
|
||||
then
|
||||
local term = os.getenv("TERM") or ""
|
||||
local kit = string.find(term, "kitty")
|
||||
return kit ~= nil
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user