1
0

Added fidget back in as replacement for noice.nvim, improved telescope hotkeys

dap fix for C/C++
added java to conform
This commit is contained in:
2024-10-05 15:25:46 +02:00
parent 98dd2510c9
commit 032d00a164
8 changed files with 95 additions and 81 deletions

View File

@ -8,6 +8,7 @@ return {
lua = { "stylua"},
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
java = { "clang-format", stop_after_first = true },
},
format_on_save = { timeout_ms = 500 },
default_format_ops = {

View File

@ -22,21 +22,38 @@ return {
},
config = function ()
local dap = require('dap')
-- Godot Config
dap.adapters.godot = {
type = "server",
host = "127.0.0.1",
port = 6006
}
--dap.configurations.gdscript{
-- type = "godot",
-- request = "launch",
-- name = "launch scene",
-- project = "${workspaceFolder}"
--}
-- C/C++ Config
dap.configurations.cpp = {
{
name = "Launch",
type= "codelldb",
type= "lldb",
request = "launch",
program = function ()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() , 'file')
end,
cwd = '${workspaceFolder}/Framework',
stopOnEntry = false,
runInTerminal = false,
}
}
dap.adapters.lldb = {
type = 'executable',
command = "C:\\Program Files\\LLVM\\bin\\lldb-dap.exe",
type = 'server',
port= "${port}",
executable = {
command = "C:\\Users\\nigel\\AppData\\Local\\nvim-data\\mason\\bin\\codelldb.cmd",
args = { "--port", "${port}"}
},
name = 'lldb'
}
@ -57,17 +74,7 @@ return {
name = "Launch file",
program = "java ${file}",
}}
dap.configurations.cpp = {{
name="launch",
type="lldb",
request="launch",
program = function ()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() ..'/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
}}
-- Golang config
dap.configurations.go = {
{
type = "delve",
@ -99,14 +106,6 @@ return {
args = {'dap', '-l', '127.0.0.1:${port}'},
}
}
dap.adapters.codelldb = {
type= 'server',
port = '${port}',
executable = {
command = 'C:/Users/Nigel/Appdata/Local/nvim-data/mason/bin/codelldb.cmd',
args = {"--port", "${port}"}
}
}
end
}
}

View File

@ -0,0 +1,8 @@
return {
{
"j-hui/fidget.nvim",
opt = {
}
}
}

View File

@ -1,18 +1,35 @@
return {
"ThePrimeagen/harpoon",
branch= "harpoon2",
dependencies = {{"nvim-lua/plenary.nvim"}},
dependencies = {
{"nvim-lua/plenary.nvim"},
{"nvim-telescope/telescope.nvim"}
},
config = function()
local harpoon = require("harpoon")
harpoon.setup()
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
vim.keymap.set("n", "<C-h>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
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)
require("telescope.pickers").new({}, {
result = file_paths,
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
vim.keymap.set("n", "<leader>ha", function() harpoon:list():add() end)
vim.keymap.set("n", "<leader>hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>fe", function () toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window"} )
vim.keymap.set("n", "C-1", function() harpoon:list():select(1) end)
vim.keymap.set("n", "C-2", function() harpoon:list():select(2) end)
vim.keymap.set("n", "C-3", function() harpoon:list():select(3) end)
vim.keymap.set("n", "C-4", function() harpoon:list():select(4) end)
vim.keymap.set("n", "<C-Q>", function() harpoon:list():prev() end)

View File

@ -25,6 +25,12 @@ return
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" }
})
local ls = require("luasnip")
ls.config.set_config({
history = true,
updateevents = "TextChanged, TextChangedI",
enable_autosnippets = true,
})
local cmp = require('cmp')
cmp.setup({
snippet = {
@ -41,7 +47,6 @@ return
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp', keyword_length = 1 },
{ name = 'luasnip', option = { show_autosnippets = true}},
{ name = 'path' },
}, {
{ name = 'buffer', keyword_length = 2 },
@ -61,42 +66,36 @@ return
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
cmp.setup.filetype({ "sql"}, {
sources = {
{ name = 'buffer' }
{ name = "vim-dadbod-completion"},
{ name = "buffer"} ,
}
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
{ name = 'path' },
{ name = 'buffer' }
}, {
{ name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
local ls = require("luasnip")
ls.config.set_config({
history = true,
updateevents = "TextChanged, TextChangedI",
enable_autosnippets = true,
})
vim.keymap.set({"i", "s"}, "<C-K>", function() ls.expand() end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-L>", function() ls.jump(1) end, {silent = true })
vim.keymap.set({"i", "s"}, "<C-J>", function() ls.jump(-1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-n>", function() ls.jump(1) end, {silent = true })
vim.keymap.set({"i", "s"}, "<C-p>", function() ls.jump(-1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, {silent = true})
require("luasnip.loaders.from_lua").load({paths= "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\barink\\snippets"})
require("luasnip.loaders.from_lua").load({paths= "~/.config/nvim/lua/barink/snippets"})
-- Set up lspconfig.
@ -105,9 +104,11 @@ return
local language_server = {
asm_lsp= true,
mojo = true,
zls = true,
emmet_language_server = true,
rust_analyzer = true,
gdtoolkit = { flags = { debounce_text_changes = 150 }},
jdtls = true,
pylsp = true,
phpactor = {

View File

@ -1,11 +0,0 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
},
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
}

View File

@ -21,7 +21,7 @@ return {
vim.keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find)
vim.keymap.set('n', '<leader>gw', builtin.grep_string)
vim.keymap.set('n', '<leader>fp',function ()
builtin.find_files { cwd = "~/AppData/Local/nvim/lua/barink/"}
builtin.find_files { cwd = "~/.config/nvim/lua/barink/"}
end)
end
}