mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: custom keymaps
This commit is contained in:
parent
20e8fc9b55
commit
c045fc1f63
4 changed files with 20 additions and 2 deletions
|
@ -21,14 +21,14 @@
|
|||
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "bfaa24b899233385c92364f95856e6280bddef30" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||
"mini.animate": { "branch": "main", "commit": "626c51eba5d344572d6da0938044a73369de8b8b" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "6e3546751076890304428150e53bd59198a4505d" },
|
||||
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "c226aca7a506dd4325fb96188bffe804d24bbf18" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "b4bd764cd1705086de4bd89f7ccf9d9ed0401259" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "2236d2bf621b64ccbceebc452137b25ecc7f6228" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||
|
|
|
@ -6,6 +6,7 @@ require("user.keymaps")
|
|||
-- require("user.snip")
|
||||
require("core.neovide")
|
||||
require("custom.autocmd")
|
||||
require("custom.keymaps")
|
||||
-- require("user.nvim-tree")
|
||||
-- require("user.options")
|
||||
-- require("user.keymaps")
|
||||
|
|
6
lua/custom/keymaps.lua
Normal file
6
lua/custom/keymaps.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- custom key maps disini
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { desc = desc })
|
||||
end
|
||||
-- click ctrl + Left mouse buttn to run
|
||||
map("t", "<C-LeftMouse>", "<cmd>lua print('Run Link')<cr>", "Run Link")
|
|
@ -79,11 +79,21 @@ function _OPEN_WEZTERM()
|
|||
vim.cmd("silent !wezterm start --cwd " .. vim.fn.getcwd())
|
||||
end
|
||||
|
||||
-- get folder name from current directory
|
||||
local _get_folder_name = function()
|
||||
return vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
end
|
||||
|
||||
function _OPEN_WEZTERM_TAB()
|
||||
-- open new tab wezterm current directory
|
||||
vim.cmd('silent !wezterm cli spawn --cwd "' .. vim.fn.getcwd() .. '"')
|
||||
end
|
||||
|
||||
function _SET_TAB_TITLE()
|
||||
-- set tab title
|
||||
vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
||||
end
|
||||
|
||||
local setup = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
|
@ -342,6 +352,7 @@ local mappings = {
|
|||
a = { "<cmd>lua _OPEN_ALACRITTY()<cr>", "Open Alacritty" },
|
||||
w = { "<cmd>lua _OPEN_WEZTERM()<cr>", "Open Wezterm" },
|
||||
t = { "<cmd>lua _OPEN_WEZTERM_TAB()<cr>", "Open Tab Wezterm" },
|
||||
j = { "<cmd>lua _SET_TAB_TITLE()<cr>", "Set Tab Title" },
|
||||
},
|
||||
r = {
|
||||
name = " Run",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue