local map = vim.keymap.set; local builtin = require('telescope.builtin') local opts = { noremap = true, silent = true} map('', '', 'gk', opts) map('', '', 'gj', opts) map('n', 'J', 'mzJ`z', opts) map('', 'o', 'o', opts) map('', 'O', 'O', opts) map('i', '', '', opts) map('v', '', '', opts) map('t', '', '', opts) map('v', '', ":m '>+1gv=gv", opts) map('v', '', ":m '<-2gv=gv", opts) map('n', 'Q', '') -- -- telescope -- map('n', 'pf', builtin.find_files, {}) map('n', 'pg', function() -- If the directory is not a git repository, fallback to regular find_files. if pcall(builtin.git_files) then else pcall(builtin.find_files) end end, {}) map('n', 'fs', function() builtin.grep_string({ search = vim.fn.input("Grep > ") }) end, {}) -- map("n", "-", "Oil", { desc = "Open parent directory" }) map('n', 'u', vim.cmd.UndotreeToggle) map('n', '', vim.cmd.BufferLineCycleNext) map('n', '', vim.cmd.BufferLineCyclePrev) map('n', 'br', vim.cmd.BufDel) -- -- window resizing -- -- map('n', '', ':vertical resize -2', { silent = true }) -- map('n', '', ':vertical resize +2', { silent = true }) -- map('n', '', ':resize +2', { silent = true }) -- map('n', '', ':resize -2', { silent = true }) map('n', '', ':MarkdownPreview', { silent = true }) map('x', 'p', '\"_dP') map('n', 'y', '\"+y') map('v', 'y', '\"+y') map('n', 'Y', '\"+Y') map('n', 'd', '\"+d') map('v', 'd', '\"+d') map('n', 'js', ':vertical botright Repl julia') map('n', 'jr', function() vim.cmd.ReplSend(string.format('include("%s")', vim.fn.expand('%:p'))) end) map('n', 'j;', function() vim.cmd.ReplSend(string.format('include("%s");', vim.fn.expand('%:p'))) end) map('n', '', vim.cmd.HopWord) map('n', 'vv', vim.cmd.VimtexCompile) map('n', 'vc', ':VimtexClean!') map('i', '', [[: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"':w]], opts) map('n', '', [[: silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &':redraw!]], opts) vim.cmd([[ " press to expand or jump in a snippet. These can also be mapped separately " via luasnip-expand-snippet and luasnip-jump-next. imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' ]]) map('i', '', [[lua require'luasnip'.jump(-1)]], opts) map('s', '', [[lua require('luasnip').jump(1)]], opts) map('s', '', [[lua require('luasnip').jump(-1)]], opts) map('', '', 'Markdown_NewLineAbove', opts) map('', '', 'Markdown_NewLineBelow', opts)