VoidVim/lua/mappings.lua

58 lines
2.3 KiB
Lua
Raw Normal View History

2024-03-09 19:03:44 +03:00
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
2024-12-12 13:07:56 +03:00
map("i", "<C-h>", "<Left>", { desc = "move left" })
map("i", "<C-l>", "<Right>", { desc = "move right" })
map("i", "<C-j>", "<Down>", { desc = "move down" })
map("i", "<C-k>", "<Up>", { desc = "move up" })
map("n", "<C-h>", "<C-w>h", { desc = "switch window left" })
map("n", "<C-l>", "<C-w>l", { desc = "switch window right" })
map("n", "<C-j>", "<C-w>j", { desc = "switch window down" })
map("n", "<C-k>", "<C-w>k", { desc = "switch window up" })
map("n", "<C-n>", "<cmd>NeoTreeShowToggle<CR>", { desc = "nvimtree toggle window" })
map("n", "<C-A-l>", "<cmd>BufferLineMoveNext<cr>", { desc = "move buffer to right" })
map("n", "<C-A-J>", "<cmd>BufferLineMovePrev<cr>", { desc = "move buffer to left" })
map("n", "<Tab>", "<cmd>BufferLineCycleNext<cr>", { desc = "switch to next buffer" })
map("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<cr>", { desc = "switch to prev buffer" })
map("n", "<F9>", "<cmd>DapContinue<cr>")
map("n", "<F5>", "<cmd>DapToggleBreakpoint<cr>")
map("n", "mk", "<cmd>RustLsp moveItem upcr>")
map("n", "m,", "<cmd>RustLsp moveItem down<cr>")
map("n", "rs", "<cmd>RustLsp run<cr>")
map("n", "ca", "<cmd>RustLsp codeAction<cr>")
map("n", "<C-s>", "<cmd>w!<cr>")
map("i", "<C-s>", "<cmd>w!<cr>")
map("n", "<", "<cmd><gv<cr>")
map("n", ">", "<cmd>>gv<cr>")
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "do", function()
require("dapui").open()
end, { desc = "Open DAP ui" })
map("n", "dc", function()
require("dapui").close()
end, { desc = "Start or continue debug" })
map("n", "dt", function()
require("dapui").toggle()
end, { desc = "Toggle DAP ui" })
map("n", "<leader>rn", "<cmd>set relativenumber<cr>")
map("n", "<leader>an", "<cmd>set norelativenumber<cr>")
map("n", "tt", "<cmd>ToggleTerm<cr>")
map("n", "<C-{>", "<cmd>foldopen<cr>")
map("n", "<C-}>", "<cmd>foldclose<cr>")
map("n", "hh", require("hover").hover, {desc = "hover.nvim"})
map("n", "hs", require("hover").hover_select, {desc = "hover.nvim (select)"})
map("n", "<C-Tab>", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"})
map("n", "<C-S-Tab>", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"})