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

View file

@ -1,4 +1,5 @@
return {
{'folke/tokyonight.nvim'},
{ "nvim-lua/popup.nvim" }, -- An implementation of the Popup API from vim in Neovim
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used ny lots of plugins
{ "windwp/nvim-autopairs" }, -- Autopairs
@ -7,15 +8,15 @@ return {
-- Colorschemes
-- "lunarvim/colorschemes" -- A bunch of colorschemes you can try out
{ "lunarvim/darkplus.nvim" },
{ "akinsho/bufferline.nvim" },
{ "moll/vim-bbye" },
-- cmp plugins
{ "hrsh7th/nvim-cmp" }, -- The completion plugin
{ "hrsh7th/cmp-buffer" }, -- buffer completions
{ "hrsh7th/cmp-path" }, -- path completions
{ "hrsh7th/cmp-cmdline" }, -- cmdline completions
{ "saadparwaiz1/cmp_luasnip" }, -- snippet completions
{ "hrsh7th/cmp-nvim-lsp" },
-- { "hrsh7th/nvim-cmp" }, -- The completion plugin
-- { "hrsh7th/cmp-buffer" }, -- buffer completions
-- { "hrsh7th/cmp-path" }, -- path completions
-- { "hrsh7th/cmp-nvim-lua" },
-- { "hrsh7th/cmp-cmdline" }, -- cmdline completions
-- { "saadparwaiz1/cmp_luasnip" }, -- snippet completions
-- { "hrsh7th/cmp-nvim-lsp" },
-- snippets
{ "L3MON4D3/LuaSnip" }, --snippet engine

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)",
},
},
}

View file

@ -1,9 +1,3 @@
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
--
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),

View file

@ -57,7 +57,6 @@ keymap('v', '<A-k>', ':m .-2<CR>==', opts)
-- paste over currently selected text without yanking it
keymap('v', 'p', '"_dp', opts)
keymap('v', 'P', '"_dP', opts)
-- Visual Block --
-- Move text up and down
keymap('x', 'J', ":move '>+1<CR>gv-gv", opts)
@ -131,3 +130,6 @@ vim.keymap.set("n", "<C-a>", "ggVG", opts)
vim.keymap.set("n", "YY", "va{Vy", opts)
vim.keymap.set("n", "<leader>r", ":w<CR>:!python3 %<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader><leader>x", ":source %<CR>", opts)
vim.keymap.set("n", "<leader>x", ":.lua<CR>", opts)
vim.keymap.set("v", "<leader>x", ":lua<CR>", opts)

View file

@ -16,7 +16,7 @@ local options = {
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 300, -- faster completion (4000ms default)
@ -35,12 +35,12 @@ local options = {
guifont = 'monospace:h17', -- the font used in graphical neovim applications
}
vim.opt.shortmess:append 'c'
-- vim.opt.shortmess:append 'c'
for k, v in pairs(options) do
vim.opt[k] = v
end
vim.cmd 'set whichwrap+=<,>,[,],h,l'
vim.cmd [[set iskeyword+=-]]
vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work
-- vim.cmd 'set whichwrap+=<,>,[,],h,l'
-- vim.cmd [[set iskeyword+=-]]
-- vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work