This commit is contained in:
2024-08-22 17:45:46 +04:00
parent 066e3ef14e
commit 445cb399ef
7 changed files with 209 additions and 24 deletions

View File

@@ -1,5 +1,4 @@
local map = vim.keymap.set
local ufo = require("ufo")
map("n", ";", ":", { desc = "CMD enter command mode" })
@@ -14,10 +13,20 @@ 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", "<leader>e", "<cmd>NeoTreeFocus<CR>", { desc = "nvimtree focus window" })
map("n", "<leader>n", "<cmd>set norelativenumber<CR>", { desc = "toggle line number" })
map("n", "<leader>rn", "<cmd>set relativenumber<CR>", { desc = "toggle relative number" })
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" })
lvim.builtin.which_key.mappings["ln"] = { "<cmd>set norelativenumber<CR>", "Toggle line number" }
lvim.builtin.which_key.mappings["e"] = { "<cmd>NeoTreeFocus<CR>", "Nvimtree focus window" }
lvim.builtin.which_key.mappings["rn"] = { "<cmd>set relativenumber<CR>", "Toggle relative number" }
lvim.builtin.which_key.mappings["ns"] = { "<Cmd>split<cr>", "Horizontal split" }
lvim.builtin.which_key.mappings["vs"] = { "<Cmd>vsplit<cr>", "Vertical split" }
map("n", "<F9>", "<cmd>DapContinue<cr>")
map("n", "<F5>", "<cmd>DapToggleBreakpoint<cr>")
map("n", "mk", "<cmd>RustLsp moveItem up<cr>")
map("n", "m,", "<cmd>RustLsp moveItem down<cr>")
@@ -27,9 +36,6 @@ map("n", "ca", "<cmd>RustLsp codeAction<cr>")
map("n", "<C-s>", "<cmd>w!<cr>")
map("i", "<C-s>", "<cmd>w!<cr>")
map("n", "<leader>sn", "<Cmd>split<cr>", { desc = "Horizontal split" })
map("n", "<leader>sv", "<Cmd>vsplit<cr>", { desc = "Vertical split" })
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "do", function()
@@ -42,13 +48,9 @@ map("n", "dt", function()
require("dapui").toggle()
end, { desc = "Toggle DAP ui" })
map("n", "<F9>", "<cmd>DapContinue<cr>", { desc = "Start or continue debug" })
map("n", "+", "<cmd>vertical resize +5<cr>", { desc = "Increase vertical buffer" }) -- make the window biger vertically
map("n", "-", "<cmd>vertical resize -5<cr>", { desc = "Decrease vertical buffer" }) -- make the window smaller vertically
map("n", "_", "<cmd>horizontal resize +2<cr>", { desc = "Increase horizontal buffer" }) -- make the window bigger horizontally by pressing shift and =
map("n", "=", "<cmd>horizontal resize -2<cr>", { desc = "Decrease horizontal buffer" }) -- make the window smaller horizontally by pressing shift and -
map('n', 'zR', ufo.openAllFolds)
map('n', 'zM', ufo.closeAllFolds)
map("n", "_", "<cmd>horizontal resize +2<cr>", { desc = "Increase horizontal buffer" }) -- make the window bigger horizontally by pressing shift and =
map("n", "<C-{>", "<cmd>foldopen<cr>")
map("n", "<C-}>", "<cmd>foldclose<cr>")