Neovim/lua/keymap.lua

147 lines
3.0 KiB
Lua

return {
{
{ "i", "x", "n", "s" },
"<C-s>",
"<cmd>w<cr><esc>",
{ desc = "Save file" },
},
{
{ "n" },
"<C-t>",
"<cmd>enew<cr>",
{ desc = "New File" },
},
{
{ "n", "i" },
"<C-z>",
"<cmd>u<CR>",
{ desc = "Undo" },
},
{
{ "n", "i" },
"<C-y>",
"<cmd>redo<CR>",
{ desc = "Undo" },
},
{
{ "n", "i" },
"<S-tab>",
"<cmd><<CR>",
{ desc = "Remove Tab" },
},
{
{ "n", "i" },
"<C-g>",
"<cmd>Telescope<CR>",
{ desc = "Open Telescope" },
},
{
{ "n", "i" },
"<S-ScrollWheelUp>",
"<ScrollWheelLeft>",
{ desc = "Scroll sideways" },
},
{
{ "n", "i" },
"<S-ScrollWheelDown>",
"<ScrollWheelRight>",
{ desc = "Scroll sideways" },
},
{
{ "n" },
"<S-Tab>",
"<cmd>BufferPrevious<CR>",
{ desc = "Next Tab", silent = false },
},
{
{ "n" },
"<Tab>",
"<cmd>BufferNext<CR>",
{ desc = "Previous Tab", silent = false },
},
{
{ "n" },
"<C-w>",
"",
{ desc = "Disable STRG+w" },
},
{
{ "n" },
"<C-w>v",
"<cmd>vsplit<CR>",
{ desc = "Split Vertical", noremap = true },
},
{
{ "n" },
"<C-w>h",
"<cmd>split<CR>",
{ desc = "Split Horizontal", noremap = true },
},
{
{ "n" },
"q",
"<cmd>BufferClose<CR>",
{ desc = "Quit Buffer" },
},
{
{ "n" },
"<C-w>q",
"<cmd>quit<CR>",
{ desc = "Quit Window" },
},
{
{ "n" },
"<C-w><Left>",
"<cmd>wincmd h<CR>",
{ desc = "Window Left" },
},
{
{ "n" },
"<C-w><Down>",
"<cmd>wincmd j<CR>",
{ desc = "Window Down" },
},
{
{ "n" },
"<C-w><Up>",
"<cmd>wincmd k<CR>",
{ desc = "Window Up" },
},
{
{ "n" },
"<C-w><Right>",
"<cmd>wincmd l<CR>",
{ desc = "Window Right" },
},
{
{ "n", "i" },
"<C-b>",
"<cmd>NvimTreeToggle<CR>",
{ desc = "Toggle Neotree" },
},
{
{ "n" },
":",
"<cmd>Telescope cmdline<CR>",
{ noremap = true, desc = "Open Cmdline" },
},
{
{ "n" },
"<leader><leader>",
"<cmd>Telescope cmdline<CR>",
{ noremap = true, desc = "Open Cmdline" },
},
{
{ "v" },
"i",
"<esc>i",
{ noremap = true, desc = "Switch from Visual to Insert mode" },
},
{
{ "n" },
"<C-f>",
"<cmd>Telescope current_buffer_fuzzy_find<CR>",
{ noremap = true, desc = "Find" },
}
}