24 lines
1.3 KiB
Lua
24 lines
1.3 KiB
Lua
-- Custom keybindings using the util `map` function
|
|
local map = require'utils'.map
|
|
local opts = { silent=true }
|
|
|
|
vim.g.mapleader = 'e' -- leader for Edit Mode functions
|
|
--- Mappings for Edit Mode ---
|
|
map("v", "<Leader>h", ":s//") -- visual selection replace with last buffer item
|
|
map("n", "<Leader>g", "<Cmd>Telescope live_grep<CR>", opts) -- Telescope live grep search
|
|
map("n", "<Leader>o", "<Cmd>Telescope file_browser<CR>", opts) -- Open Telescope to grab new file
|
|
|
|
vim.g.mapleader = 'f' -- leader for File Mode functions
|
|
--- Mappings for File Mode ---
|
|
--map("n", "<Leader>o", "<Cmd>Telescope file_browser<CR>", opts) -- Telescope file browser
|
|
map("ni", "<C-w>T", "<Esc><Cmd>tabnew<CR> | <Cmd>Telescope file_browser<CR>", opts) -- Open a new tab buffer
|
|
map("ni", "<C-w>v", "<Esc><C-w>v<CR> | <Cmd>Telescope file_browser<CR>A", opts) -- Open a new verticle split
|
|
map("ni", "<C-w>s", "<Esc><C-w>s<CR> | <Cmd>Telescope file_browser<CR>A", opts) -- Open a new horizontal split
|
|
map("n", "<Leader>do", "<Cmd>DiffOrig<CR>", opts)
|
|
map("n", "<Leader>dc", "<Cmd>DiffOff<CR>", opts)
|
|
|
|
vim.g.mapleader = 't' -- leader for Terminal Mode functions
|
|
--- Mappings for Terminal Mode ---
|
|
map("n", "<Leader>vr", ":vert res 80") -- change verticle size of focused window to x (Default: x = 80)
|
|
map("n", "<Leader>hr", ":horizontal res ") -- change horizontal size of focused window to x (No default)
|