Add initial config
This commit is contained in:
27
lua/config/keymaps.lua
Normal file
27
lua/config/keymaps.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local keys = require("lazy.core.handler").handlers.keys
|
||||
---@cast keys LazyKeysHandler
|
||||
-- do not create the keymap if a lazy keys handler exists
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
if opts.remap and not vim.g.vscode then
|
||||
opts.remap = nil
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
end
|
||||
|
||||
local lazyterm = function()
|
||||
Util.float_term(nil, { cwd = Util.get_root() })
|
||||
end
|
||||
|
||||
map("n", "<F7>", lazyterm, { desc = "Terminal (root dir)" })
|
||||
|
||||
map("t", "<F7>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
Reference in New Issue
Block a user