aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/keybinds.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/keybinds.lua')
-rw-r--r--.config/nvim/lua/keybinds.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua
new file mode 100644
index 0000000..49ea2e3
--- /dev/null
+++ b/.config/nvim/lua/keybinds.lua
@@ -0,0 +1,25 @@
+vim.g.mapleader = " "
+
+vim.api.nvim_set_keymap("n", "<Leader>n", ":NvimTreeToggle<CR>",
+ { noremap = true; silent = true })
+
+vim.api.nvim_command("nnoremap <A-j> :m .+1<CR>==")
+vim.api.nvim_command("nnoremap <A-k> :m .-2<CR>==")
+vim.api.nvim_command("inoremap <A-k> <Esc>:m .-2<CR>==gi")
+vim.api.nvim_command("inoremap <A-j> <Esc>:m .+1<CR>==gi")
+vim.api.nvim_command("vnoremap <A-j> :m '>+1<CR>gv=gv")
+vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv")
+
+vim.api.nvim_command(
+ "nnoremap <buffer> <Leader><CR> :lua vim.lsp.buf.code_action()<CR>")
+vim.api.nvim_command("nnoremap <buffer> <Leader>, :TroubleToggle<CR>")
+
+vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>",
+ { noremap = true; silent = true })
+vim.api.nvim_set_keymap("n", "<Leader><TAB>", ":Telescope buffers<CR>",
+ { noremap = true; silent = true })
+
+vim.keymap.set("n", "<Leader>[", require("ufo").openAllFolds)
+vim.keymap.set("n", "<Leader>]", require("ufo").closeAllFolds)
+vim.keymap.set("n", "<Leader>r", require("renamer").rename)
+