save
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
vim.g.colors_name = 'coolurs'
|
||||
|
||||
vim.cmd('hi Normal guibg=black guifg=#ffffff')
|
||||
vim.cmd('hi String guifg=#008000')
|
||||
vim.cmd('hi String guifg=#00ff00')
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
return {
|
||||
}
|
||||
@@ -11,30 +11,22 @@ return {
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function()
|
||||
harpoon:list():add()
|
||||
end, { desc = "Append to harpoon" })
|
||||
end)
|
||||
vim.keymap.set("n", "<C-e>", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end, { desc = "Quick Menu" })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<C-w>", function()
|
||||
vim.keymap.set("n", "<C-1>", function()
|
||||
harpoon:list():select(1)
|
||||
end, { desc = "Select First" })
|
||||
vim.keymap.set("n", "<C-t>", function()
|
||||
end)
|
||||
vim.keymap.set("n", "<C-2>", function()
|
||||
harpoon:list():select(2)
|
||||
end, { desc = "Select Second" })
|
||||
vim.keymap.set("n", "<C-n>", function()
|
||||
end)
|
||||
vim.keymap.set("n", "<C-3>", function()
|
||||
harpoon:list():select(3)
|
||||
end, { desc = "Select Third" })
|
||||
vim.keymap.set("n", "<C-s>", function()
|
||||
end)
|
||||
vim.keymap.set("n", "<C-4>", function()
|
||||
harpoon:list():select(4)
|
||||
end, { desc = "Select Fourth" })
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set("n", "<C-S-P>", function()
|
||||
harpoon:list():prev()
|
||||
end, { desc = "Select Previous" })
|
||||
vim.keymap.set("n", "<C-S-N>", function()
|
||||
harpoon:list():next()
|
||||
end, { desc = "Select Next" })
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,43 +1,50 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"stevearc/conform.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"j-hui/fidget.nvim",
|
||||
},
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"stevearc/conform.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"j-hui/fidget.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {},
|
||||
})
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {},
|
||||
})
|
||||
|
||||
require("fidget").setup({})
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"gopls",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
require("fidget").setup({})
|
||||
require("mason").setup()
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"gopls",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({})
|
||||
end,
|
||||
|
||||
["lua_ls"] = function()
|
||||
require("lspconfig").lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
["clangd"] = function()
|
||||
require("lspconfig").clangd.setup({
|
||||
cmd = { "clangd", "--header-insertion=iwyu" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
return {
|
||||
-- this is a sort of related
|
||||
{
|
||||
-- this is a sort of related
|
||||
"stevearc/dressing.nvim",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ return {
|
||||
"c",
|
||||
"lua",
|
||||
"bash",
|
||||
"java",
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
|
||||
@@ -8,30 +8,5 @@ return {
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xX",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||
desc = "Buffer Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cs",
|
||||
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP Definitions / references / ... (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xL",
|
||||
"<cmd>Trouble loclist toggle<cr>",
|
||||
desc = "Location List (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xQ",
|
||||
"<cmd>Trouble qflist toggle<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend("force", options, opts)
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend("force", options, opts)
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
-- Remove search highlight --
|
||||
map("n", "<Esc>", ":nohlsearch<CR>")
|
||||
|
||||
-- Quickfix
|
||||
map("n", "<leader>h", vim.lsp.buf.code_action)
|
||||
|
||||
-- Move lines --
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '>-2<CR>gv=gv")
|
||||
@@ -24,6 +27,7 @@ map("n", "<leader>pv", ":Oil<CR>")
|
||||
|
||||
-- Terminal --
|
||||
map("t", "<C-k>", "<C-\\><C-n><C-w><C-k>")
|
||||
map("t", "<C-Space>", "<C-\\><C-n>:bd!<CR>")
|
||||
|
||||
-- Exec
|
||||
map("n", "<leader>x", ":.lua<CR>")
|
||||
@@ -31,7 +35,19 @@ map("n", "<leader><leader>x", ":source %<CR>")
|
||||
|
||||
-- LSP
|
||||
map("n", "gd", vim.lsp.buf.definition)
|
||||
map("n", "<leader>rn", vim.lsp.buf.rename, { noremap = true, silent = true, desc = "Go to definition" })
|
||||
map("n", "<leader>rn", vim.lsp.buf.rename, { noremap = true, silent = true })
|
||||
map('n', '<leader>h', function()
|
||||
local diag = vim.diagnostic.get(0) -- Get diagnostics for the current buffer
|
||||
if #diag > 0 then
|
||||
-- Try to resolve the first diagnostic (you can adjust logic for more advanced fixing)
|
||||
vim.lsp.buf.code_action({
|
||||
filter = function(action)
|
||||
return action.kind == "quickfix"
|
||||
end
|
||||
})
|
||||
end
|
||||
end, { desc = "LSP Quickfix for Current Diagnostic" })
|
||||
|
||||
|
||||
-- Window Controls
|
||||
map("n", "<C-h>", "<C-w><C-h>")
|
||||
|
||||
Reference in New Issue
Block a user