Big Nvim Update
This commit is contained in:
@@ -5,21 +5,89 @@ return {
|
||||
},
|
||||
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.startify")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
vim.cmd("source ~/.cache/wal/colors-wal.vim")
|
||||
local color9 = vim.g.color9 or "#ffffff"
|
||||
local color3 = vim.g.color3 or "#ffffff"
|
||||
local color4 = vim.g.color4 or "#ffffff"
|
||||
local color5 = vim.g.color5 or "#ffffff"
|
||||
local color6 = vim.g.color6 or "#ffffff"
|
||||
|
||||
dashboard.section.header.val = {
|
||||
[[ ██████████ █████████ ]],
|
||||
[[ ████████████ ████████████████ █ ██ ]],
|
||||
[[ ██ ███ █████ ██ ]],
|
||||
[[ ██████████ ██████████ ████████ ███ ███████████ ]],
|
||||
[[ ██████████ ██████████ ████████ █████ ██████████████ ]],
|
||||
[[ ██ ██ ███████ █████ █████ ████ █████ ]],
|
||||
[[ ██████████ ██ ██████ █████ █████ ████ █████ ]],
|
||||
[[ ████████████ ██ ███ ████ █████ █████ ████ ██████ ]],
|
||||
-- helper function for utf8 chars
|
||||
local function getCharLen(s, pos)
|
||||
local byte = string.byte(s, pos)
|
||||
if not byte then
|
||||
return nil
|
||||
end
|
||||
return (byte < 0x80 and 1) or (byte < 0xE0 and 2) or (byte < 0xF0 and 3) or (byte < 0xF8 and 4) or 1
|
||||
end
|
||||
|
||||
local function applyColors(logo, colors, logoColors)
|
||||
dashboard.section.header.val = logo
|
||||
|
||||
for key, color in pairs(colors) do
|
||||
local name = "Alpha" .. key
|
||||
vim.api.nvim_set_hl(0, name, color)
|
||||
colors[key] = name
|
||||
end
|
||||
|
||||
dashboard.section.header.opts.hl = {}
|
||||
for i, line in ipairs(logoColors) do
|
||||
local highlights = {}
|
||||
local pos = 0
|
||||
|
||||
for j = 1, #line do
|
||||
local opos = pos
|
||||
pos = pos + getCharLen(logo[i], opos + 1)
|
||||
|
||||
local color_name = colors[line:sub(j, j)]
|
||||
if color_name then
|
||||
table.insert(highlights, { color_name, opos, pos })
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(dashboard.section.header.opts.hl, highlights)
|
||||
end
|
||||
return dashboard.opts
|
||||
end
|
||||
|
||||
require("alpha").setup(applyColors({
|
||||
[[███████╗ ██████╗ ]],
|
||||
[[██╔════╝ ██╔═══╝ ]],
|
||||
[[█████╗ ██████╗ ]],
|
||||
[[██╔══╝ ██╔═══╝ ]],
|
||||
[[███████╗ ██║ ]],
|
||||
[[╚══════╝ ╚═╝ ]],
|
||||
[[N E O V I M ]],
|
||||
}, {
|
||||
["a"] = { fg = color9, ctermfg = 33},
|
||||
["b"] = { fg = color3, ctermfg = 33},
|
||||
["c"] = { fg = color4, ctermfg = 33},
|
||||
["d"] = { fg = color5, ctermfg = 33},
|
||||
["e"] = { fg = color6, ctermfg = 33},
|
||||
}, {
|
||||
[[bbbbbbba cccccca ]],
|
||||
[[bbaaaaaa ccaaaaa ]],
|
||||
[[bbbbba cccccca ]],
|
||||
[[bbaaaa ccaaaaa ]],
|
||||
[[bbbbbbba cca ]],
|
||||
[[aaaaaaaa aaa ]],
|
||||
[[d d d e e e ]],
|
||||
}))
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button( "e", " > New file" , ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button( "f", " > Find file", ":lua require('telescope.builtin').find_files({ find_command = { 'rg', '--files' } })<CR>"),
|
||||
dashboard.button( "F", " > Find folder", ":lua search_and_scope_into_directory()<CR>"),
|
||||
dashboard.button( "r", " > Recent" , ":Telescope oldfiles<CR>"),
|
||||
dashboard.button( "c", " > Config" , ":cd ~/.config/nvim | Telescope find_files<CR>"),
|
||||
dashboard.button( "l", " > Lazy", ":Lazy<CR>"),
|
||||
dashboard.button( "q", " > Quit", ":qa<CR>"),
|
||||
|
||||
}
|
||||
dashboard.section.footer.val = {
|
||||
"",
|
||||
"Welcome!",
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = function()
|
||||
vim.cmd("source ~/.cache/wal/colors-wal.vim")
|
||||
local color9 = vim.g.color9 or "#808080"
|
||||
local color5 = vim.g.color5 or "#ffffff"
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = false,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = false,
|
||||
lsp_doc_border = false,
|
||||
},
|
||||
})
|
||||
vim.cmd('highlight NoiceCmdlineIcon guifg=' .. color9)
|
||||
vim.cmd('highlight NoiceCmdlinePopupBorder guifg=' .. color5)
|
||||
vim.cmd('highlight NotifyINFOBorder guifg=' .. color5)
|
||||
vim.cmd('highlight NotifyINFOIcon guifg=' .. color9)
|
||||
vim.cmd('highlight NotifyINFOTitle guifg=' .. color5)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
return {
|
||||
{ 'AlphaTechnolog/pywal.nvim', name = 'pywal' }
|
||||
"AlphaTechnolog/pywal.nvim",
|
||||
lazy = false, -- Load immediately on startup
|
||||
priority = 1000, -- Ensure it loads before other colorscheme plugins
|
||||
config = function()
|
||||
-- Set up pywal and load the colors
|
||||
require("pywal").setup()
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,56 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim"
|
||||
"lewis6991/gitsigns.nvim", -- Add a comma here
|
||||
config = function()
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = false,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
use_focus = true,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"ellisonleao/glow.nvim",
|
||||
config = function()
|
||||
require('glow').setup()
|
||||
end,
|
||||
cmd = "Glow",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"echasnovski/mini.icons",
|
||||
lazy = true,
|
||||
opts = {
|
||||
file = {
|
||||
[".keep"] = { glyph = "", hl = "MiniIconsGrey" },
|
||||
["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
||||
},
|
||||
filetype = {
|
||||
dotenv = { glyph = "", hl = "MiniIconsYellow" },
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
package.preload["nvim-web-devicons"] = function()
|
||||
require("mini.icons").mock_nvim_web_devicons()
|
||||
return package.loaded["nvim-web-devicons"]
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
dependencies = { "nvim-tree/nvim-web-devicons","kdheepak/tabline.nvim" },
|
||||
|
||||
config = function()
|
||||
require('lualine').setup {
|
||||
@@ -9,6 +9,7 @@ return {
|
||||
theme = 'auto',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
component_separators = {'', ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
@@ -25,8 +26,8 @@ return {
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filepath','filename'},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
@@ -39,7 +40,14 @@ return {
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
tabline = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { require'tabline'.tabline_buffers },
|
||||
lualine_x = { require'tabline'.tabline_tabs },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
sections = {
|
||||
{
|
||||
section = "terminal",
|
||||
cmd = "chafa ~/wallpapers/pywallpaper.jpg --format symbols --symbols vhalf --size 60x17 --stretch;",
|
||||
height = 17,
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
pane = 2,
|
||||
{ section = "keys", gap = 1, padding = 1 },
|
||||
{ section = "startup" },
|
||||
},
|
||||
},
|
||||
},
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>z", function() Snacks.zen() end, desc = "Toggle Zen Mode" },
|
||||
{ "<leader>s", function() Snacks.scratch() end, desc = "Toggle Scratch Buffer" },
|
||||
{ "<leader>S", function() Snacks.scratch.select() end, desc = "Select Scratch Buffer" },
|
||||
{ "<c-/>", function() Snacks.terminal() end, desc = "Toggle Terminal" },
|
||||
{ "<leader>gB", function() Snacks.gitbrowse() end, desc = "Git Browse", mode = { "n", "v" } },
|
||||
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
|
||||
{ "<leader>gf", function() Snacks.lazygit.log_file() end, desc = "Lazygit Current File History" },
|
||||
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" },
|
||||
{ "<leader>gl", function() Snacks.lazygit.log() end, desc = "Lazygit Log (cwd)" },
|
||||
{
|
||||
"<leader>N",
|
||||
desc = "Neovim News",
|
||||
function()
|
||||
Snacks.win({
|
||||
file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
|
||||
width = 0.6,
|
||||
height = 0.8,
|
||||
wo = {
|
||||
spell = false,
|
||||
wrap = false,
|
||||
signcolumn = "yes",
|
||||
statuscolumn = " ",
|
||||
conceallevel = 3,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
vim.print = _G.dd
|
||||
-- Create some toggle mappings
|
||||
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
|
||||
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
'kdheepak/tabline.nvim',
|
||||
config = function()
|
||||
require'tabline'.setup {
|
||||
enable = true,
|
||||
options = {
|
||||
section_separators = { '','' },
|
||||
component_separators = {'', ''},
|
||||
max_bufferline_percent = 80,
|
||||
show_tabs_always = true,
|
||||
show_devicons = true,
|
||||
show_bufnr = false,
|
||||
show_filename_only = true,
|
||||
modified_italic = true,
|
||||
show_tabs_only = false,
|
||||
}
|
||||
}
|
||||
end,
|
||||
requires = {'hoob3rt/lualine.nvim', 'kyazdani42/nvim-web-devicons'}
|
||||
}
|
||||
@@ -7,7 +7,30 @@ return {
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<A-f>", builtin.live_grep, {})
|
||||
end,
|
||||
|
||||
-- Function for searching and scoping into a directory
|
||||
function search_and_scope_into_directory()
|
||||
builtin.find_files({
|
||||
prompt_title = "Search Directories",
|
||||
find_command = {"fd", "--type", "d", "--hidden", "--follow"},
|
||||
attach_mappings = function(prompt_bufnr, map)
|
||||
local actions = require("telescope.actions")
|
||||
actions.select_default:replace(function()
|
||||
local selection = require("telescope.actions.state").get_selected_entry()
|
||||
local selected_dir = selection.path
|
||||
|
||||
-- Change the current working directory to the selected directory
|
||||
vim.cmd("cd " .. selected_dir)
|
||||
actions.close(prompt_bufnr)
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Keybinding to trigger directory search and scoping
|
||||
vim.keymap.set("n", "<A-d>", search_and_scope_into_directory)
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
@@ -18,8 +41,49 @@ return {
|
||||
require("telescope.themes").get_dropdown({}),
|
||||
},
|
||||
},
|
||||
defaults = {
|
||||
file_ignore_patterns = {
|
||||
"node_modules", "build", "dist", "yarn.lock"
|
||||
},
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--follow",
|
||||
"--hidden",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
"--glob=!**/.git/*",
|
||||
"--glob=!**/.idea/*",
|
||||
"--glob=!**/.vscode/*",
|
||||
"--glob=!**/build/*",
|
||||
"--glob=!**/dist/*",
|
||||
"--glob=!**/yarn.lock",
|
||||
"--glob=!**/package-lock.json",
|
||||
},
|
||||
},
|
||||
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
find_command = {
|
||||
"rg",
|
||||
"--files",
|
||||
"--hidden",
|
||||
"--glob=!**/.git/*",
|
||||
"--glob=!**/.idea/*",
|
||||
"--glob=!**/.vscode/*",
|
||||
"--glob=!**/build/*",
|
||||
"--glob=!**/dist/*",
|
||||
"--glob=!**/yarn.lock",
|
||||
"--glob=!**/package-lock.json",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user