aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/binds.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/binds.lua')
-rw-r--r--.config/nvim/lua/binds.lua54
1 files changed, 54 insertions, 0 deletions
diff --git a/.config/nvim/lua/binds.lua b/.config/nvim/lua/binds.lua
new file mode 100644
index 0000000..55da905
--- /dev/null
+++ b/.config/nvim/lua/binds.lua
@@ -0,0 +1,54 @@
+local map = vim.keymap.set
+-- local color_converter = require "color_converter"
+
+-- toggle nvim-tree
+map("n", "<Leader>t", "<cmd>NvimTreeToggle<CR>")
+-- toggle trouble
+map("n", "<Leader>e", "<cmd>TroubleToggle<CR>")
+-- undo
+map("n", "U", "<C-r>")
+
+map("c", "<CR>", function()
+ if vim.fn.pumvisible() == 1 then
+ return "<C-y>"
+ end
+ return "<CR>"
+end, { expr = true })
+
+map("n", "H", "5h")
+map("n", "J", "5j")
+map("n", "K", "5k")
+map("n", "L", "5l")
+
+-- disable arrow keys
+map("n", "<UP>", "<NOP>")
+map("n", "<DOWN>", "<NOP>")
+map("n", "<LEFT>", "<NOP>")
+map("n", "<RIGHT>", "<NOP>")
+
+map("i", "<UP>", "<NOP>")
+map("i", "<DOWN>", "<NOP>")
+map("i", "<LEFT>", "<NOP>")
+map("i", "<RIGHT>", "<NOP>")
+
+map("n", "<Leader>h", vim.lsp.buf.hover)
+map("n", "<Leader>gd", vim.lsp.buf.definition)
+
+map("n", "<leader>bp", function()
+ require('cokeline.mappings').pick("focus")
+end, { desc = "Pick a buffer to focus" })
+map("n", "<leader>bq", function()
+ require('cokeline.mappings').pick("close")
+end, { desc = "Pick a buffer to close" })
+map("n", "<Leader>p", function ()
+ require("cokeline.mappings").by_step("switch", -1)
+end, { silent = true })
+map("n", "<Leader>n", function ()
+ require("cokeline.mappings").by_step("switch", 1)
+end, { silent = true })
+
+
+-- local function setup_lsp_keys(_client, buffer)
+-- map("<Leader>d", vim.diagnostic.open_float, "Line diagnostics")
+--
+-- end