2024-03-20 20:48:32 -05:00
|
|
|
-- This file lists all the global keymaps
|
2024-03-26 22:44:37 -05:00
|
|
|
local map = vim.keymap.set
|
|
|
|
local g = vim.g
|
2024-03-20 20:48:32 -05:00
|
|
|
|
|
|
|
-- Change the leader and localleader
|
2024-03-26 22:44:37 -05:00
|
|
|
g.mapleader = ','
|
|
|
|
g.maplocalleader = ';'
|
2024-03-20 20:48:32 -05:00
|
|
|
|
|
|
|
-- Use ,dd for deleting without putting into buffer
|
2024-03-26 22:44:37 -05:00
|
|
|
map({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
|
|
|
|
map('n', '<leader>D', '"_D', { remap = false })
|
|
|
|
map('n', '<leader>x', '"_x', { remap = false })
|
2024-03-20 20:48:32 -05:00
|
|
|
|
|
|
|
-- Insert a newline in normal mode by ,o
|
2024-03-26 22:44:37 -05:00
|
|
|
map('n', '<leader>o', "o<Esc>k", { remap = false })
|
|
|
|
map('n', '<leader>O', "O<Esc>j", { remap = false })
|
2024-03-20 20:48:32 -05:00
|
|
|
|
|
|
|
-- Use ,u for redo
|
2024-03-26 22:44:37 -05:00
|
|
|
map('n', '<leader>u', "<c-r>", { remap = false })
|
2024-03-20 20:48:32 -05:00
|
|
|
|
2024-03-21 17:29:10 -05:00
|
|
|
-- Find files using fzf by ,f
|
2024-03-26 22:44:37 -05:00
|
|
|
map('n', '<leader>f', ":Files<cr>", { remap = false })
|
2024-03-21 17:29:10 -05:00
|
|
|
|
2024-03-20 20:48:32 -05:00
|
|
|
-- Move around buffers using ,j and ,k
|
2024-03-26 22:44:37 -05:00
|
|
|
map('n', '<leader>k', ":bnext<cr>", { remap = false })
|
|
|
|
map('n', '<leader>j', ":bprevious<cr>", { remap = false })
|
|
|
|
|
|
|
|
-- Clear search highlight by Esc in normal mode
|
|
|
|
map('n', '<Esc>', ':noh<cr>', { remap = false })
|
2024-03-20 20:48:32 -05:00
|
|
|
|