vim.keymap.set('n', 'b;', ':let @+ = expand("%:p")', { desc = 'Copy Name' }) vim.keymap.set('n', 't;', ':tc %:p:h', { desc = 'Change Directory to file path' }) vim.keymap.set('n', 'tr', ':tc +', { desc = 'Change Directory to file path' }) vim.keymap.set('n', ',', function() local output = string.gsub(vim.fn.expand '%', '.md', '.pdf') local command = ':!pandoc -t pdf --pdf-engine tectonic -o ' .. output .. ' --section-divs=true % ; okular ' .. output vim.fn.execute(command) end) vim.keymap.set('n', 'be', ':tabe %', { desc = 'Open in New Tab' }) vim.keymap.set('n', 'T', ':term', { desc = 'Terminal Here' }) vim.keymap.set('n', '-', ':tc -:pwd', { desc = 'Cd -' }) vim.keymap.set('n', 'Q', ':bd! %', { desc = 'Quit buffer' }) vim.keymap.set('n', 'L', ':!ls', { desc = 'List Items' }) vim.keymap.set('n', 'D', ':!ri -Force %', { desc = 'Delete Item' }) vim.keymap.set('n', 'gv', ':vs | lua vim.lsp.buf.definition()', { desc = 'Goto Definition split vertical' }) vim.keymap.set('n', 'gs', ':sp | lua vim.lsp.buf.definition()', { desc = 'Goto Definition split horizontal' }) vim.keymap.set('n', '', ':DecreaseFont', { noremap = true, silent = true }) vim.keymap.set('n', '', ':IncreaseFont', { noremap = true, silent = true }) vim.keymap.set('n', '', ':IncreaseFont', { noremap = true, silent = true }) vim.keymap.set('n', '', ':ResetFontSize', { noremap = true, silent = true }) vim.keymap.set('n', 'bb', function() local user_input = vim.fn.input 'Enter input: ' local row, col = unpack(vim.api.nvim_win_get_cursor(0)) vim.cmd { cmd = 'b', args = { user_input } } end) vim.keymap.set('n', '', 'w!', { desc = 'Force write' }) vim.keymap.set('n', '', 'qa!', { desc = 'Force quit' }) vim.keymap.set('n', '|', 'vsplit', { desc = 'Vertical Split' }) vim.keymap.set('n', '\\', 'split', { desc = 'Horizontal Split' }) vim.keymap.set('n', 'h', 'nohl', { desc = 'Horizontal Split' }) vim.keymap.set('n', 'h', 'nohl', { desc = 'Horizontal Split' }) vim.keymap.set('n', 'la', vim.lsp.buf.code_action, { desc = 'Code action' }) vim.keymap.set('t', '', 'wincmd h', { desc = 'Terminal left window navigation' }) vim.keymap.set('t', '', 'wincmd j', { desc = 'Terminal down window navigation' }) vim.keymap.set('t', '', 'wincmd k', { desc = 'Terminal up window navigation' }) vim.keymap.set('t', '', 'wincmd l', { desc = 'Terminal right window navigation' }) return {}