diff options
Diffstat (limited to 'lua/config')
| -rw-r--r-- | lua/config/autocmds.lua | 2 | ||||
| -rw-r--r-- | lua/config/keymaps.lua | 21 | ||||
| -rw-r--r-- | lua/config/options.lua | 9 |
3 files changed, 22 insertions, 10 deletions
diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index b8953ce..c178f44 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -25,7 +25,7 @@ vim.api.nvim_create_autocmd("FileType", { }) vim.api.nvim_create_autocmd("FileType", { - pattern = { "gitcommit", "markdown", "NeogitCommitMessage" }, + pattern = { "gitcommit", "markdown", "NeogitCommitMessage", "norg" }, callback = function() vim.opt_local.wrap = true vim.opt_local.spell = true diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index f5c0248..22b786d 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,14 +1,27 @@ local map = vim.keymap.set map("v", "<leader>p", function() - local val = vim.fn.getreg '"' + local val = vim.fn.getreg '+' vim.api.nvim_command [[normal! p]] - vim.fn.setreg('"', val) + vim.fn.setreg('+', val) end, { desc = "Special paste, paste without replacing copy register content" }) +map("n", "<leader>mm", function() + local items = + vim.fn.systemlist "make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\\/\t=]*:([^=]|$)/ {split($1,A,/ /);print A[1]}'" + + vim.ui.select(items, { promt = "Make command" }, function(choice) + if not choice then + return + end + + require("harpoon.term").sendCommand(1, "make " .. choice) + end) +end) + map("n", "<leader>bd", ":bd!<CR>", { desc = "Deletes the current buffer" }) -map("n", "<leader>fz", function () +map("n", "<leader>fz", function() vim.cmd [[normal zfaf]] end, { desc = "Fold the function" }) @@ -56,3 +69,5 @@ map( map("n", "<leader>vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) map("n", "<leader>vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" }) + +map("v", "<leader>q", require('alpha.select_to_quickfix').handle) diff --git a/lua/config/options.lua b/lua/config/options.lua index 30a3127..7cbc205 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -3,7 +3,7 @@ vim.g.snippets = "luasnip" local opt = vim.o -opt.mouse = false +opt.mouse = "" opt.number = true opt.relativenumber = true opt.conceallevel = 3 @@ -37,8 +37,5 @@ opt.cmdheight = 1 opt.updatetime = 50 opt.signcolumn = "yes" opt.equalalways = false - -if vim.fn.has "nvim-0.9.0" == 1 then - opt.splitkeep = "screen" - opt.shortmess = "filnxtToOFWIcC" -end +opt.splitkeep = "screen" +opt.shortmess = "filnxtToOFWIcC" |