initial neovim config, plugins and a few mappings/settings

This commit is contained in:
2025-08-17 23:56:04 -05:00
parent 371a034035
commit 3caa97137b
18 changed files with 391 additions and 10 deletions

View File

@@ -0,0 +1,49 @@
return {
-- TODO: decide which of these i won't be using, then remove from this file
{
"ellisonleao/gruvbox.nvim",
name = "gruvbox",
-- priority = 1000,
opts = {
terminal_colors = true, -- add neovim terminal colors
undercurl = true,
underline = true,
bold = true,
italic = {
strings = true,
emphasis = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "", -- "hard", "soft", or ""
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = false,
},
},
{
"rose-pine/neovim",
name = "rose-pine",
},
{
"folke/tokyonight.nvim",
lazy = false,
opts = {
style = "night", -- "night", "storm", "moon", "day"
styles = {
functions = {} -- disable italic for functions
},
on_colors = function(colors)
colors.hint = colors.orange
colors.error = "#ff0000"
end
},
}
}

View File

@@ -0,0 +1,3 @@
return {
{ "tpope/vim-fugitive" },
}

View File

@@ -0,0 +1,11 @@
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2", -- https://github.com/ThePrimeagen/harpoon/tree/harpoon2
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local harpoon = require("harpoon")
harpoon:setup()
end,
},
}

View File

@@ -0,0 +1,30 @@
local glob_patterns_find_files = {
"-g", "!**/.git/**",
"-g", "!**/build/**",
"-g", "!**/node_modules/**",
}
local glob_patterns_live_grep = {
unpack(glob_patterns_find_files), -- same for now
}
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' },
opts = {
pickers = {
find_files = {
find_command = {
"rg", "--no-ignore", "--hidden", "--files",
unpack(glob_patterns_find_files),
},
},
live_grep = {
additional_args = {
"--no-ignore", "--hidden",
unpack(glob_patterns_live_grep),
}
},
},
},
}

View File

@@ -0,0 +1,73 @@
return {
{
"nvim-treesitter/nvim-treesitter",
branch = 'master',
lazy = false,
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"vimdoc", "bash", "lua", "c", "cpp", "go", "python", "ruby",
"html", "css", "json", "sql", "javascript", "jsdoc",
"markdown", "markdown_inline",
-- "odin", "zig", "ocaml", "java", "typescript",
},
sync_install = false, -- install `ensure_installed` parsers synchronously
auto_install = true, -- install missing on BufEnter, requires tree-sitter CLI
ignore_install = {},
-- indent = { enable = true }, -- TODO: do i want this?
highlight = {
enable = true, -- `false` will disable the whole extension
disable = function(lang, buf)
for i, v in ipairs({ "html", }) do
if lang == v then
print("treesitter disabled for this language")
return true
end
end
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > (100 * 1024) then -- 100 KB
vim.notify(
"larger file, treesitter disabled for performance",
vim.log.levels.WARN,
{title = "Treesitter"}
)
return true
end
end,
-- true, false, or list of langs; may cause slowness or duplicate highlights
additional_vim_regex_highlighting = { "markdown" },
},
})
-- TODO: decide if needed/wanted
-- local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- treesitter_parser_config.templ = {
-- install_info = {
-- url = "https://github.com/vrischmann/tree-sitter-templ.git",
-- files = {"src/parser.c", "src/scanner.c"},
-- branch = "master",
-- },
-- }
-- vim.treesitter.language.register("templ", "templ")
end
},
{
"nvim-treesitter/nvim-treesitter-context",
after = "nvim-treesitter",
opts = {
enable = true, -- can enable/disable via manual command
multiwindow = false,
max_lines = 0, -- lines the window should span; x <= 0 means no limit
min_window_height = 10, -- min window height to enable; x <= 0 means no limit
line_numbers = true,
multiline_threshold = 40, -- max lines to show for a single context
trim_scope = 'outer', -- 'inner', 'outer'; discard lines if max_lines exceeded
mode = 'cursor', -- 'cursor', 'topline'; line used to calculate context
separator = "-", -- 1 char, like '-'; only shown when >= 2 lines above
zindex = 20, -- z-index of the context window
on_attach = nil, -- (fun(buf: integer): boolean); return false to disable attaching
},
},
}

View File

@@ -0,0 +1,3 @@
return {
"mbbill/undotree",
}