Files
nixos/modules/dev/nvim.conf
2026-10-06 17:01:39 +02:00

27 lines
1.2 KiB
Plaintext

local map = vim.keymap.set
local builtin = require('telescope.builtin')
map("n", ";", ":", { desc = "CMD enter command mode" })
map("n", "<leader>sw", "<cmd> set wrap! <CR>", {desc = "Toggle text wrapping"})
map("n", "<leader>fm", function() require("conform").format() end, {desc = "Format with conform"})
map("n", "<leader>-", "<cmd> Oil <CR>", {desc = "Open directory in oil"})
map("n", "<leader>rcu", function() require('crates').upgrade_all_crates() end, {desc = "Upgrade rust crates"})
map("n", "<leader>ca", function() vim.lsp.buf.code_action() end, {desc = "Lsp code action"})
map("n", "<leader>gr", function() vim.lsp.buf.references() end, {desc = "Lsp references"})
map("n", "<leader>ra", function() vim.lsp.buf.rename() end, {desc = "Lsp rename symbol"})
map("n", "<leader>gm", "<cmd>Telescope git_commits<CR>", { desc = "telescope git commits" })
map('n', '<leader>fi', function()
builtin.live_grep({
prompt_title = "Files matching TODO",
default_text = "(TODO|todo|FIXME|THOUGHT|REFACTOR|TEST)",
})
end, {desc = "find comments using telescope"})
-- stay in v mode after indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- remove the fuckass escape to normal mode bind that nvchad includes for some reason
vim.keymap.del("i", "jk")