lualine config edits

This commit is contained in:
Daniel B Sherry 2025-05-22 14:10:59 -05:00
parent 9331121a9f
commit 5c937dc1c8
19 changed files with 301 additions and 83 deletions

39
lua/plugins/autopairs.lua Normal file
View file

@ -0,0 +1,39 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter", -- Load when entering insert mode
config = function()
local autopairs = require("nvim-autopairs")
autopairs.setup({
disable_filetype = { "TelescopePrompt", "vim" },
check_ts = true, -- Use Treesitter to check for pairs
ts_config = {
lua = { "string" }, -- don't add pairs in lua string nodes
javascript = { "template_string" },
java = false, -- disable treesitter check for Java
},
fast_wrap = {
map = "<M-e>", -- Alt+e to trigger fast wrap
chars = { "{", "[", "(", '"', "'" },
pattern = [=[[%'%"%>%]%)%}%,]]=],
end_key = "$",
before_key = "h",
after_key = "l",
cursor_pos_before = true,
keys = "qwertyuiopzxcvbnmasdfghjkl",
manual_position = true,
highlight = "Search",
highlight_grey = "Comment"
},
enable_check_bracket_line = true, -- Don't add a pair if the closing bracket is already on the same line
ignored_next_char = "[%w%.]", -- Will ignore alphanumeric and `.` after the pair
})
-- Optional: Integration with nvim-cmp for auto completion pairing
local cmp_status_ok, cmp = pcall(require, "cmp")
if cmp_status_ok then
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
end,
}

View file

@ -1,7 +1,5 @@
return {
"folke/snacks.nvim",
priority = 9999,
lazy = false,
opts = {
notifier = { enabled = true },
dashboard = {
@ -42,3 +40,4 @@ return {
},
},
}

24
lua/plugins/lspconfig.lua Normal file
View file

@ -0,0 +1,24 @@
-- ~/.config/nvim/lua/plugins/lspconfig.lua
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile", "BufWritePre" },
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Example: Python
lspconfig.pyright.setup({
capabilities = capabilities
})
-- Example: Lua
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
},
},
})
end,
}

View file

@ -9,5 +9,16 @@ return {
section_separators = "",
component_separators = "",
},
sections = {
lualine_c = {
{
'filename',
path=1
},
},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
},
}

68
lua/plugins/nvim-cmp.lua Normal file
View file

@ -0,0 +1,68 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
-- Completion sources
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"saadparwaiz1/cmp_luasnip",
-- Snippet engine
"L3MON4D3/LuaSnip",
-- Optional: VSCode-style icons
"onsails/lspkind.nvim",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-e>"] = cmp.mapping.close(),
["<C-space>"] = cmp.mapping.complete(),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}),
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text", -- "text", "symbol", or "symbol_text"
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
-- Cmdline completion (optional)
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" }
}
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" }
}, {
{ name = "cmdline" }
})
})
end,
}

View file

@ -0,0 +1,50 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", -- ensures parsers stay updated
event = { "BufReadPost", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "python", "javascript", "go" },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = "<C-s>",
node_decremental = "<C-backspace>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
},
},
})
end,
}

18
lua/plugins/which-key.lua Normal file
View file

@ -0,0 +1,18 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}