aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/mapping.lua
blob: c0ffe3fe6ebf56f6d5c6c02bee4d4b9c01765635 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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>:IBLToggle<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 lsp_lines
vim.keymap.set("", "<F12>", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })