added more capabilities to my nvim setup
This commit is contained in:
@@ -106,3 +106,11 @@ autocmd("FileType", {
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("DirChanged", {
|
||||
callback = function()
|
||||
if vim.fn.filereadable(".devcontainer/devcontainer.json") == 1 then
|
||||
vim.notify("Devcontainer detected", vim.log.levels.INFO)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -68,3 +68,37 @@ map("n", "<leader>at", "<cmd>AvanteToggle<cr>", { desc = "AI Toggle" })
|
||||
-- Database keymaps
|
||||
map("n", "<leader>db", "<cmd>DBUIToggle<cr>", { desc = "Toggle DB UI" })
|
||||
map("n", "<leader>da", "<cmd>DBUIAddConnection<cr>", { desc = "Add DB Connection" })
|
||||
|
||||
-- Neotest
|
||||
local neotest = require("neotest")
|
||||
|
||||
map("n", "<leader>tt", neotest.run.run, { desc = "Run nearest test" })
|
||||
map("n", "<leader>tf", function()
|
||||
neotest.run.run(vim.fn.expand("%"))
|
||||
end, { desc = "Run test file" })
|
||||
|
||||
map("n", "<leader>ts", neotest.summary.toggle)
|
||||
map("n", "<leader>to", neotest.output.open)
|
||||
map("n", "<leader>tc", "<cmd>Coverage<cr>", { desc = "Show coverage" })
|
||||
|
||||
-- Go benchmark
|
||||
map("n", "<leader>gb", function()
|
||||
vim.cmd("!go test -bench . ./...")
|
||||
end, { desc = "Go benchmarks" })
|
||||
map("n", "<leader>gp", function()
|
||||
vim.cmd("!go test -cpuprofile cpu.out && go tool pprof cpu.out")
|
||||
end, { desc = "Go CPU profile" })
|
||||
|
||||
-- Overseer
|
||||
map("n", "<leader>or", "<cmd>OverseerRun<cr>", { desc = "Run task" })
|
||||
map("n", "<leader>ot", "<cmd>OverseerToogle<cr>", { desc = "Task list" })
|
||||
|
||||
-- Aerial
|
||||
map("n", "<leader>so", "<cmd>AerialToggle<cr>", { desc = "Symbols outline" })
|
||||
map("n", "<leader>sh", vim.lsp.buf.incoming_calls, { desc = "Incoming calls" })
|
||||
map("n", "<leader>sc", vim.lsp.buf.outgoing_calls, { desc = "Outgoing calls" })
|
||||
|
||||
-- Diagnostics
|
||||
map("n", "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>")
|
||||
map("n", "<leader>xw", "<cmd>Trouble workspace_diagnostics<cr>")
|
||||
map("n", "<leader>xt", "<cmd>Trouble todo<cr>")
|
||||
|
||||
@@ -3,35 +3,40 @@
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
if vim.env.SSH_CONNECTION then
|
||||
opt.clipboard = ""
|
||||
opt.timeoutlen = 1000
|
||||
end
|
||||
|
||||
-- General
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
opt.confirm = true -- Confirm before closing unsaved buffer
|
||||
opt.cursorline = true -- Highlight current line
|
||||
opt.mouse = "a" -- Enable mouse
|
||||
opt.number = true -- Show line numbers
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.signcolumn = "yes" -- Always show sign column
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.wrap = false -- Disable line wrap
|
||||
opt.confirm = true -- Confirm before closing unsaved buffer
|
||||
opt.cursorline = true -- Highlight current line
|
||||
opt.mouse = "a" -- Enable mouse
|
||||
opt.number = true -- Show line numbers
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.signcolumn = "yes" -- Always show sign column
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.wrap = true -- Disable line wrap
|
||||
|
||||
-- Indentation
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.shiftwidth = 2 -- Size of indent
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.shiftwidth = 2 -- Size of indent
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.smartindent = true -- Smart indentation
|
||||
|
||||
-- Search
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.hlsearch = true -- Highlight search results
|
||||
opt.incsearch = true -- Show search results as you type
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.hlsearch = true -- Highlight search results
|
||||
opt.incsearch = true -- Show search results as you type
|
||||
|
||||
-- Split behavior
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
|
||||
-- Undo
|
||||
opt.undofile = true -- Persistent undo
|
||||
opt.undofile = true -- Persistent undo
|
||||
opt.undolevels = 10000 -- Maximum undo levels
|
||||
|
||||
-- Performance
|
||||
@@ -45,3 +50,16 @@ opt.completeopt = "menu,menuone,noselect"
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
opt.foldlevel = 99 -- Start with all folds open
|
||||
|
||||
opt.exrc = true
|
||||
opt.secure = true
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
prefix = "●",
|
||||
},
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user