feat: enable dap

fix: git push
This commit is contained in:
Kristofers Solo
2024-01-29 16:06:10 +02:00
parent 1e7e40ca1b
commit 6ac678077e
10 changed files with 95 additions and 44 deletions

View File

@@ -1,6 +1,5 @@
return {
"jayp0521/mason-nvim-dap.nvim",
enabled = false,
opts = {
ensure_installed = {
"python",

View File

@@ -4,5 +4,33 @@ return {
keys = {
{ "<leader>gg", vim.cmd.G, desc = "[G]it" },
{ "<leader>gd", vim.cmd.Gdiffsplit, desc = "[G]it [D]iff" },
{
"<leader>gh",
function()
vim.cmd.diffget("//2")
end,
desc = "[G]it Select Left",
},
{
"<leader>gl",
function()
vim.cmd.diffget("//3")
end,
desc = "[G]it Select Right",
},
{
"<leader>gp",
function()
vim.cmd.Git("pull --rebase")
end,
desc = "[G]it [P]ull",
},
{
"<leader>gP",
function()
vim.cmd.Git("push -u origin")
end,
desc = "[G]it [P]ush",
},
},
}

View File

@@ -11,7 +11,7 @@ return {
desc = "Harpoon [A]dd File",
},
{
"<C-i>",
"<C-e>",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())

View File

@@ -6,6 +6,7 @@ return {
"hrsh7th/cmp-nvim-lsp",
"folke/neodev.nvim",
"nvim-telescope/telescope.nvim",
"folke/trouble.nvim",
},
config = function()
@@ -44,11 +45,25 @@ return {
)
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap("<leader>ws", vim.lsp.buf.workspace_symbol, "[W]orkspace [S]ymbol")
nmap("<leader>wd", vim.diagnostic.open_float, "[W]orkspace [D]iagnostic")
nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
nmap("<leader>lD", vim.lsp.buf.type_definition, "Type [D]efinition")
nmap("<leader>lr", vim.lsp.buf.rename, "[R]ename")
nmap("<leader>lj", vim.diagnostic.goto_next, "Diagnostic Next")
nmap("<leader>lk", vim.diagnostic.goto_prev, "Diagnostic Prev")
nmap("]d", function()
local trouble = require("trouble")
trouble.open("workspace_diagnostics")
trouble.next({ skip_groups = true, jump = true })
end, "Trouble Next")
nmap("[d", function()
local trouble = require("trouble")
trouble.open("workspace_diagnostics")
trouble.previous({ skip_groups = true, jump = true })
end, "Trouble Prev")
vim.keymap.set(
{ "n", "v" },
"<leader>la",
@@ -76,7 +91,7 @@ return {
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
local config = {
vim.diagnostic.config({
virtual_text = true, -- virtual text
signs = {
active = signs, -- show signs
@@ -92,9 +107,7 @@ return {
header = "",
prefix = "",
},
}
vim.diagnostic.config(config)
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",

View File

@@ -18,13 +18,16 @@ return {
tools = {
-- on_initialized = nil,
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
vim.api.nvim_create_autocmd(
{ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost", "InsertEnter" },
{
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
}
)
end,
reload_workspace_from_cargo_toml = true,
inlay_hints = {

View File

@@ -1 +1,17 @@
return { "christoomey/vim-tmux-navigator" }
return {
"christoomey/vim-tmux-navigator",
cmds = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<C-h>", vim.cmd.TmuxNavigateLeft, desc = "Focus window left", mode = { "n", "t" } },
{ "<C-j>", vim.cmd.TmuxNavigateDown, desc = "Focus window down", mode = { "n", "t" } },
{ "<C-k>", vim.cmd.TmuxNavigateUp, desc = "Focus window up", mode = { "n", "t" } },
{ "<C-l>", vim.cmd.TmuxNavigateRight, desc = "Focus window right", mode = { "n", "t" } },
{ "<C-\\>", vim.cmd.TmuxNavigatePrevious, desc = "Focus window previous", mode = { "n", "t" } },
},
}

View File

@@ -3,9 +3,11 @@ return {
build = ":TSUpdate",
dependencies = {
"p00f/nvim-ts-rainbow",
"nvim-treesitter/nvim-treesitter-context",
"mechatroner/rainbow_csv",
"JoosepAlviste/nvim-ts-context-commentstring",
"nvim-treesitter/nvim-treesitter-textobjects",
"luckasRanarison/tree-sitter-hyprlang",
},
config = function()
local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move")
@@ -42,7 +44,7 @@ return {
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = { "markdown" },
additional_vim_regex_highlighting = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
@@ -177,5 +179,7 @@ return {
},
},
})
vim.cmd.highlight("TreesitterContext guibg=None")
vim.cmd.highlight("TreesitterContextLineNumberBottom gui=underline guisp=Grey")
end,
}

View File

@@ -23,20 +23,6 @@ return {
end,
desc = "[D]ocument Diagnostics",
},
{
"[d",
function()
require("trouble").next({ skip_groups = true, jump = true })
end,
desc = "Trouble Next",
},
{
"]d",
function()
require("trouble").previous({ skip_groups = true, jump = true })
end,
desc = "Trouble Prev",
},
},
opts = {
position = "bottom", -- position of the list can be: bottom, top, left, right