Skip to content

Commit

Permalink
update harpoon settings
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed Jun 23, 2024
1 parent 65b3fbf commit 18a6cde
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 63 deletions.
18 changes: 9 additions & 9 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ end, {})

-- Read seltabl.logs command
vim.api.nvim_create_user_command("SeltablLogs", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/seltabl.log")
local log_path = vim.fn.expand("~/.config/seltabls/seltabl.log")
vim.cmd(":e " .. log_path)
end, {})

-- Clear seltabl.logs command
vim.api.nvim_create_user_command("SeltablClearLogs", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/seltabl.log")
local log_path = vim.fn.expand("~/.config/seltabls/seltabl.log")
local file = io.open(log_path, "w")
if file then
file:close()
Expand All @@ -131,12 +131,12 @@ vim.api.nvim_create_user_command("SeltablClearLogs", function()
end, {})

vim.api.nvim_create_user_command("SeltablStateLogs", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/state.log")
local log_path = vim.fn.expand("~/.config/seltabls/state.log")
vim.cmd(":e " .. log_path)
end, {})

vim.api.nvim_create_user_command("SeltablStateClearLogs", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/state.log")
local log_path = vim.fn.expand("~/.config/seltabls/state.log")
local file = io.open(log_path, "w")
if file then
file:close()
Expand All @@ -147,18 +147,18 @@ vim.api.nvim_create_user_command("SeltablStateClearLogs", function()
end, {})

vim.api.nvim_create_user_command("SeltablDb", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/uri.sqlite")
local log_path = vim.fn.expand("~/.config/seltabls/uri.sqlite")
vim.cmd(":e " .. log_path)
end, {})

vim.api.nvim_create_user_command("SeltablDbClear", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/uri.sqlite")
local log_path = vim.fn.expand("~/.config/seltabls/uri.sqlite")
os.execute("rm " .. log_path)
end, {})

-- clear all command
vim.api.nvim_create_user_command("SeltablClearAll", function()
local log_path = vim.fn.expand("~/.config/seltabl-lsp/state.log")
local log_path = vim.fn.expand("~/.config/seltabls/state.log")
local file = io.open(log_path, "w")
if file then
file:close()
Expand All @@ -172,10 +172,10 @@ vim.api.nvim_create_user_command("SeltablClearAll", function()
file:close()
print("seltabl.log cleared.")
else
print("Error: Could not open seltabl.log.")
print("Error: Could not open seltabls.log.")
end

log_path = vim.fn.expand("~/.config/seltabl-lsp/uri.sqlite")
log_path = vim.fn.expand("~/.config/seltabls/uri.sqlite")
print("Removing " .. log_path)
os.execute("rm " .. log_path)
end, {})
62 changes: 11 additions & 51 deletions lua/plugins/harpoon-plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,20 @@ return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
config = function()
-- bind harpoon view all project marks to space + h
vim.api.nvim_set_keymap("n", "<space>h", "<cmd>lua require('harpoon.ui').toggle_quick_menu()<CR>", {
noremap = true,
silent = true,
desc = "View all harpoon marks"
})
local harpoon = require("harpoon")

-- bind harpoon navigate next to alt + h
vim.api.nvim_set_keymap("n", "<A-h>", ":lua require('harpoon.ui').nav_next()<CR>", {
noremap = true,
silent = true,
desc = "Navigate to next harpoon mark"
})
harpoon:setup()

-- bind harpoon navigate previous to alt + l
vim.api.nvim_set_keymap("n", "<A-l>", ":lua require('harpoon.ui').nav_prev()<CR>", {
noremap = true,
silent = true,
desc = "Navigate to previous harpoon mark"
})
vim.keymap.set("n", "<space>m", function() harpoon:list():add() end)
vim.keymap.set("n", "<space>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)

-- bind harpoon mark / add file to space + m
vim.api.nvim_set_keymap("n", "<space>m", ":lua require('harpoon.mark').add_file()<CR>", {
noremap = true,
silent = true,
desc = "Add file to harpoon list of files"
})
vim.keymap.set("n", "<M-1>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<M-2>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<M-3>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<M-4>", function() harpoon:list():select(4) end)

-- Bind harpoon go to first mark to Alt + 1
vim.api.nvim_set_keymap("n", "<M-1>", ":lua require('harpoon.ui').nav_file(1)<CR>", {
noremap = true,
silent = true,
desc = "Navigate to first harpoon mark"
})

-- Bind harpoon go to second mark to Ctrl + 2
vim.api.nvim_set_keymap("n", "<M-2>", ":lua require('harpoon.ui').nav_file(2)<CR>", {
noremap = true,
silent = true,
desc = "Navigate to second harpoon mark"
})

-- Bind harpoon go to third mark to Ctrl + 3
vim.api.nvim_set_keymap("n", "<M-3>", ":lua require('harpoon.ui').nav_file(3)<CR>", {
noremap = true,
silent = true,
desc = "Navigate to third harpoon mark"
})

-- Bind harpoon go to fourth mark to Ctrl + 4
vim.api.nvim_set_keymap("n", "<C-4>", ":lua require('harpoon.ui').nav_file(4)<CR>", {
noremap = true,
silent = true,
desc = "Navigate to fourth harpoon mark"
})
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<A-l>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<A-h>", function() harpoon:list():next() end)
end
}
12 changes: 12 additions & 0 deletions lua/plugins/lsp-zero-plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ return {
"neovim/nvim-lspconfig",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
{
'nvimdev/lspsaga.nvim',
event = "LspAttach",
config = function()
require('lspsaga').setup({})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
}
},
},
config = function()
local lsp = require("lsp-zero")
Expand Down Expand Up @@ -130,6 +141,7 @@ return {
"typescript",
"astro",
"svelte",
"html",
"vue",
"templ"
}
Expand Down
5 changes: 2 additions & 3 deletions lua/seltabl/seltabl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ end
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.go",
callback = function()
print("FileType")
local bufnr = vim.api.nvim_get_current_buf()
vim.lsp.buf_attach_client(bufnr, client)
-- local bufnr = vim.api.nvim_get_current_buf()
-- vim.lsp.buf_attach_client(bufnr, client)
end
})

0 comments on commit 18a6cde

Please sign in to comment.