laptop-dots/.config/nvim/lua/mappings.lua
2023-02-19 22:07:04 -08:00

39 lines
1.0 KiB
Lua

local vimp = require('vimp')
-- Map leader
vim.g.mapleader = " "
-- NvimTree
vimp.noremap({ 'silent' }, '<leader>n', [[:NvimTreeToggle<CR>]])
-- Telescope
vimp.noremap({ 'silent' }, '<leader>ff', [[:Telescope find_files<CR>]])
vimp.noremap({ 'silent' }, '<leader>fg', [[:Telescope live_grep<CR>]])
vimp.noremap({ 'silent' }, '<leader>fb', [[:Telescope buffers<CR>]])
-- tabs and stuff
vimp.vnoremap('<C-b>', [[<C-a>]])
vimp.noremap("<Tab>", [[>gv]])
vimp.noremap("<S-Tab>", [[<gv]])
-- tabline
vimp.nnoremap({ 'silent' }, '<A-Right>', [[:TablineBufferNext<CR>]])
vimp.nnoremap({ 'silent' }, '<A-Left>', [[:TablineBufferPrevious<CR>]])
-- markdown
vimp.noremap({ 'silent' }, '<leader>md', [[:MarkdownPreviewToggle<CR>]])
-- Remove search highlight on Enter
vimp.nnoremap("<CR>", [[:nohlsearch<CR><CR>]])
-- Don't lose selection on < or >
vimp.xnoremap("<", [[<gv]])
vimp.xnoremap(">", [[>gv]])
-- ArgWrap
vimp.nnoremap({ 'silent' }, '<leader>a', [[:ArgWrap<CR>]])
-- Toggle Line
vimp.nnoremap({ 'silent' }, '<leader>l', [[:lua Toggleln()<CR>]])