restructured nvim config

This commit is contained in:
pika 2024-08-18 13:51:43 +02:00
parent 22d4936a21
commit 6bb0e86ded
9 changed files with 148 additions and 147 deletions

View file

@ -26,10 +26,11 @@ require("lazy").setup({
spec = { spec = {
-- import your plugins -- import your plugins
{ import = "pika.plugins" }, { import = "pika.plugins" },
{ import = "pika.plugins.lsp" },
}, },
-- Configure any other settings here. See the documentation for more details. -- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins. -- colorscheme that will be used when installing plugins.
install = { colorscheme = { "eldritch" } }, install = { colorscheme = { "nord" } },
-- automatically check for plugin updates -- automatically check for plugin updates
checker = { enabled = true }, checker = { enabled = true },
}) })

View file

@ -1,37 +1,32 @@
return { return {
{ "rose-pine/neovim" }, { "folke/tokyonight.nvim" },
{ "sontungexpt/witch" }, { "rose-pine/neovim" },
{ "sontungexpt/witch" },
{ 'AlexvZyl/nordic.nvim' }, { 'AlexvZyl/nordic.nvim' },
{ { "eldritch-theme/eldritch.nvim" },
"ribru17/bamboo.nvim", {
lazy = false, "ribru17/bamboo.nvim",
-- priority = 1000, -- Make sure to load this before all the other start plugins. lazy = false,
config = function() -- priority = 1000, -- Make sure to load this before all the other start plugins.
require("bamboo").setup({ config = function()
-- ────────────────────────────< optional configuration here >───────────────────────── require("bamboo").setup({
code_style = { -- ────────────────────────────< optional configuration here >─────────────────────────
comments = { italic = false, bold = true }, code_style = {
conditionals = { italic = true }, comments = { italic = false, bold = true },
keywords = { bold = true }, conditionals = { italic = true },
functions = {}, keywords = { bold = true },
namespaces = { italic = true }, functions = {},
parameters = { italic = true }, namespaces = { italic = true },
strings = {}, parameters = { italic = true },
variables = { bold = true }, strings = {},
}, variables = { bold = true },
-- ─< Custom Highlights -- >──────────────────────────────────────────────────────────── },
colors = {}, -- Override default colors -- ─< Custom Highlights -- >────────────────────────────────────────────────────────────
highlights = { -- Override highlight groups colors = {}, -- Override default colors
["@comment"] = { fg = "#555653" }, highlights = { -- Override highlight groups
}, ["@comment"] = { fg = "#555653" },
}) },
end, })
}, end,
},
{
"eldritch-theme/eldritch.nvim",
lazy = false,
opts = {},
}
} }

View file

@ -3,45 +3,80 @@ return{
"nvimdev/dashboard-nvim", "nvimdev/dashboard-nvim",
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function() opts = function()
-- local logo = [[
-- ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·.
-- •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪
-- ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█·
-- ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌
-- ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀
-- ]]
local logo = [[ local logo = [[
Z
Z
z
z
]] ]]
logo = string.rep("\n", 8) .. logo .. "\n\n" logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = { local opts = {
theme = "doom", theme = "doom",
hide = { hide = {
-- this is taken care of by lualine statusline = false,
-- enabling this messes up the actual laststatus setting after loading a file },
statusline = false, config = {
}, header = vim.split(logo, "\n"),
config = { center = {
header = vim.split(logo, "\n"), {
-- stylua: ignore action = function()
center = { require("telescope.builtin").find_files()
{ 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 = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore 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, end,
desc = " Find File",
icon = " ",
key = "f"
}, },
} { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
{
action = function()
require("telescope.builtin").oldfiles()
end,
desc = " Recent Files",
icon = " ",
key = "r"
},
{
action = function()
require("telescope.builtin").live_grep()
end,
desc = " Find Text",
icon = " ",
key = "g"
},
{
action = function()
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
end,
desc = " Search Neovim files",
icon = " ",
key = "c"
},
{ action = 'lua require("persistence").load()', desc = " Restore 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 for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc) button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
@ -73,6 +108,7 @@ return{
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" }, { "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, { "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, { "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
{ "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
}, },
} }
} }

View file

@ -34,9 +34,14 @@ return {
"svelte", "svelte",
"lua_ls", "lua_ls",
"graphql", "graphql",
"typos-lsp",
"emmet_ls", "emmet_ls",
"prismals", "prismals",
"pyright", "pyright",
"lemminx",
"hyprls",
"textlsp",
"yamlls",
}, },
}) })
@ -44,8 +49,6 @@ return {
ensure_installed = { ensure_installed = {
"prettier", -- prettier formatter "prettier", -- prettier formatter
"stylua", -- lua formatter "stylua", -- lua formatter
-- "isort", -- python formatter
-- "black", -- python formatter
"pylint", "pylint",
"eslint_d", "eslint_d",
}, },

View file

@ -47,7 +47,7 @@ return {
return { return {
sources = { "filesystem", "buffers", "git_status" }, sources = { "filesystem", "buffers", "git_status" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" }, open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
close_if_last_window = false, close_if_last_window = true,
popup_border_style = "rounded", popup_border_style = "rounded",
enable_git_status = true, enable_git_status = true,
enable_diagnostics = true, enable_diagnostics = true,
@ -62,23 +62,17 @@ return {
window = { window = {
mappings = { mappings = {
["l"] = "open", ["l"] = "open",
["o"] = "open",
["C-v"] = "open_split",
["h"] = "close_node", ["h"] = "close_node",
["<space>"] = "none", ["<space>"] = "none",
["Y"] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
end,
desc = "Copy Path to Clipboard",
},
["O"] = { ["O"] = {
function(state) function(state)
require("lazy.util").open(state.tree:get_node().path, { system = true }) require("lazy.util").open(state.tree:get_node().path, { system = true })
end, end,
desc = "Open with System Application", desc = "Open with System Application",
}, },
["P"] = { "toggle_preview", config = { use_float = false } }, ["P"] = { "toggle_preview", config = { use_float = true } },
}, },
}, },
default_component_configs = { default_component_configs = {

View file

@ -2,14 +2,14 @@ return {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
config = function() config = function()
require("notify").setup({ require("notify").setup({
stages = "fade_in_slide_out", stages = "slide",
background_colour = "FloatShadow", background_colour = "FloatShadow",
max_width = 60, max_width = 120,
timeout = 2750, timeout = 2750,
render = "compact", render = "wrapped-compact",
-- Minimum/Maximum width for notification windows -- Minimum/Maximum width for notification windows
minimum_width = 30, minimum_width = 30,
maximum_width = 60, maximum_width = 120,
-- Function called when a new window is opened, use for changing win settings/config -- Function called when a new window is opened, use for changing win settings/config
on_open = nil, on_open = nil,

View file

@ -1,65 +1,37 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate", build = ":TSUpdate",
dependencies = { dependencies = {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
}, },
config = function() config = function()
-- import nvim-treesitter plugin require("nvim-treesitter.configs").setup({
local treesitter = require("nvim-treesitter.configs") highlight = {
enable = true,
-- configure treesitter additional_vim_regex_highlighting = false,
treesitter.setup({ -- enable syntax highlighting },
highlight = { indent = { enable = true },
enable = true, autotag = { enable = true },
comments = { color = { "#333" }, italic = false }, -- adjust comment color and style ensure_installed = {
}, "bash", "fish", "http", "html", "php", "css", "scss",
-- enable indentation "gitignore", "git_config", "markdown", "markdown_inline",
indent = { enable = true }, "dockerfile", "yaml", "json", "javascript", "typescript",
-- enable autotagging (w/ nvim-ts-autotag plugin) "graphql", "lua", "query", "c", "prisma", "hyprlang",
autotag = { "ini", "passwd", "vim", "vimdoc",
enable = true, },
}, incremental_selection = {
-- ensure these language parsers are installed enable = true,
ensure_installed = { keymaps = {
"bash", init_selection = "<C-space>",
"fish", node_incremental = "<C-space>",
"http", scope_incremental = false,
"html", node_decremental = "<bs>",
"php", },
"css", },
"scss", -- Add these fields to address the error
"gitignore", sync_install = true,
"git_config", auto_install = true,
"markdown", })
"markdown_inline", end,
"dockerfile",
"yaml",
"json",
"javascript",
"typescript",
"graphql",
"lua",
"query",
"c",
"prisma",
"hyprlang",
"ini",
"passwd",
"vim",
"vimdoc",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
})
end,
} }

View file

@ -3,7 +3,7 @@ return {
event = "VeryLazy", event = "VeryLazy",
init = function() init = function()
vim.o.timeout = true vim.o.timeout = true
vim.o.timeoutlen = 500 vim.o.timeoutlen = 350
end, end,
opts = { opts = {
-- your configuration comes here -- your configuration comes here