aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/mapping.lua
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2023-08-22 19:43:07 +0100
committerJustine Smithies <justine@smithies.me.uk>2023-08-22 19:43:07 +0100
commit86c0c3694c93025dfec23f27266905c12f446a4e (patch)
tree32ee6e5cc84b6e2962a998d788554cb984fb7a8e /.config/nvim/lua/mapping.lua
parent3058d6df77817de298a207d36b8b0871893c417a (diff)
Initial commit
Diffstat (limited to '.config/nvim/lua/mapping.lua')
-rw-r--r--.config/nvim/lua/mapping.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/nvim/lua/mapping.lua b/.config/nvim/lua/mapping.lua
new file mode 100644
index 0000000..d454eec
--- /dev/null
+++ b/.config/nvim/lua/mapping.lua
@@ -0,0 +1,23 @@
+function map(mode, lhs, rhs, opts)
+ local options = { noremap = true }
+ if opts then
+ options = vim.tbl_extend("force", options, opts)
+ end
+ vim.api.nvim_set_keymap(mode, lhs, rhs, options)
+end
+
+-- Toggle line numbers
+map("n", "<F4>", "<cmd>:set number!<cr>", { silent = true })
+-- Toggle IndentBlankline
+map("n", "<F5>", "<cmd>:IndentBlanklineToggle<cr>", { silent = true })
+-- Toggle Undotree
+map("n", "<F6>", "<cmd>:lua require('undotree').toggle()<cr>", { silent = true })
+-- Toggle Nvim Tree
+map("n", "<F7>", "<cmd>NvimTreeToggle<cr> <cmd>NvimTreeRefresh<cr>", { silent = true })
+-- Toggle Tagbar
+map("n", "<F8>", "<cmd>:TagbarToggle<cr>", { silent = true })
+-- Toggle Tagbar
+map("n", "<F8>", "<cmd>:TagbarToggle<cr>", { silent = true })
+-- Toggle lsp_lines
+vim.keymap.set("", "<F12>", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })
+