update init and add harpoon

This commit is contained in:
2026-10-08 10:09:21 -04:00
parent ba2d04ce00
commit 560a493191
2 changed files with 97 additions and 26 deletions
+39 -26
View File
@@ -174,6 +174,11 @@ vim.opt.expandtab = true
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
vim.keymap.set('n', 'q:', '<nop>')
vim.keymap.set('n', 'q/', '<nop>')
vim.keymap.set('n', 'q?', '<nop>')
vim.keymap.set('c', '<C-f>', '<nop>')
-- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
@@ -363,7 +368,7 @@ require('lazy').setup({
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
branch = '0.1.x',
branch = 'master',
dependencies = {
'nvim-lua/plenary.nvim',
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
@@ -676,6 +681,9 @@ require('lazy').setup({
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
clangd = {},
verible = {
cmd = { 'verible-verilog-ls', '--rules_config_search' },
},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
@@ -718,7 +726,7 @@ require('lazy').setup({
return nil
end
local xml_path = vim.fn.stdpath('cache') .. '/jdtls-formatter-' .. vim.fn.sha256(props_path) .. '.xml'
local xml_path = vim.fn.stdpath 'cache' .. '/jdtls-formatter-' .. vim.fn.sha256(props_path) .. '.xml'
local xml_stat = fs.fs_stat(xml_path)
if not xml_stat or xml_stat.mtime.sec < stat.mtime.sec then
local lines = {
@@ -727,8 +735,8 @@ require('lazy').setup({
'<profile kind="CodeFormatterProfile" name="GTCS1332" version="21">',
}
for line in io.lines(props_path) do
local key, value = line:match('^%s*([^=%s]+)%s*=%s*(.-)%s*$')
if key and not key:match('^#') then
local key, value = line:match '^%s*([^=%s]+)%s*=%s*(.-)%s*$'
if key and not key:match '^#' then
value = value:gsub('&', '&amp;'):gsub('"', '&quot;'):gsub('<', '&lt;'):gsub('>', '&gt;')
table.insert(lines, string.format('<setting id="%s" value="%s"/>', key, value))
end
@@ -1028,29 +1036,34 @@ require('lazy').setup({
},
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
branch = 'main',
lazy = false,
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
disable = { 'latex' },
},
indent = { enable = true, disable = { 'ruby' } },
},
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
config = function()
local ts = require 'nvim-treesitter'
ts.setup()
ts.install { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
vim.api.nvim_create_autocmd('FileType', {
callback = function(args)
local lang = vim.treesitter.language.get_lang(args.match)
if not lang then
return
end
if not pcall(vim.treesitter.start, args.buf, lang) then
if vim.tbl_contains(ts.get_available(), lang) then
ts.install(lang):await(function()
if vim.api.nvim_buf_is_valid(args.buf) then
pcall(vim.treesitter.start, args.buf, lang)
end
end)
end
return
end
vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
end,
},
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the