added harpoon 2

This commit is contained in:
Radu Macocian (admac)
2026-01-26 14:49:58 +01:00
parent cdc5f5df6a
commit 7d048a98dc
5 changed files with 62 additions and 12 deletions

View File

@@ -29,6 +29,31 @@ dap.adapters['pwa-chrome'] = {
}
}
local function is_odoo_project()
local cwd = vim.fn.getcwd()
return vim.fn.filereadable(cwd .. "/odoo-bin") == 1 or
vim.fn.filereadable(cwd .. "/odoo/odoo-bin") == 1
end
local function debug_odoo()
local db_name = vim.fn.input('Odoo DB: ', 'master')
if db_name == "" then return end
dap.run({
type = "python",
request = "launch",
name = "Odoo Server",
program = "/home/admac/projects/odoo/odoo/odoo-bin",
pythonPath = "/home/admac/projects/odoo/venv/bin/python3",
args = {
"--addons-path", "/home/admac/projects/odoo/enterprise/,/home/admac/projects/odoo/odoo/addons/",
"--dev", "all",
"-d", db_name
},
console = "externalTerminal",
})
end
local function run_odoo_test_at_cursor()
-- Safely get the node at cursor
local status, node = pcall(vim.treesitter.get_node)
@@ -95,6 +120,13 @@ local function run_odoo_test_at_cursor()
})
end
vim.keymap.set("n", "<leader>d5", function()
if is_odoo_project() then
debug_odoo()
else
dap.continue()
end
end)
vim.keymap.set("n", "<leader>5", function() dap.continue() end)
vim.keymap.set("n", "<leader>6", function() dap.step_over() end)
vim.keymap.set("n", "<leader>+", function() dap.step_into() end)

View File

@@ -1,9 +1,23 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
local harpoon = require("harpoon");
vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)
harpoon:setup({
settings = {
save_on_toggle = true,
key = function()
local branch = vim.fn.system("git branch --show-current 2> /dev/null")
if branch == "" then
return vim.loop.cwd()
else
return vim.loop.cwd() .. "-" .. branch
end
end,
},
})
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end)

View File

@@ -35,7 +35,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
callback = function(event)
local opts = { buffer = event.buf }
vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, opts)
vim.keymap.set('n', 'gd', function() require('telescope.builtin').lsp_definitions() end, opts)
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts)
vim.keymap.set('n', '<leader>vws', function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set('n', '<leader>vd', function() vim.diagnostic.open_float() end, opts)

View File

@@ -6,10 +6,10 @@
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"everforest-nvim": { "branch": "main", "commit": "557bce922401e247a596583679bc181d4d688554" },
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"markview.nvim": { "branch": "main", "commit": "c81ce9ed129387fc5fdec91abe9818a1b0e6fcac" },
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"markview.nvim": { "branch": "main", "commit": "c81ce9ed129387fc5fdec91abe9818a1b0e6fcac" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "4823a251e7578a835bb979c37df390fca692ba39" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"mini.icons": { "branch": "main", "commit": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c" },

View File

@@ -30,7 +30,11 @@ require("lazy").setup({
},
'odoo/odoo-neovim',
'nvim-treesitter/nvim-treesitter',
{
'theprimeagen/harpoon',
branch = 'harpoon2',
dependencies = { 'nvim-lua/plenary.nvim' }
},
'petertriho/nvim-scrollbar',
'mbbill/undotree',
{