-- Pasting with Control-V because of muscle-memory vim.keymap.set('n', '', '"+p') vim.keymap.set('n', '', '"+p') vim.keymap.set('i', '', '*') vim.keymap.set('i', '', '*') vim.keymap.set('t', '', '"+pi') vim.keymap.set('t', '', '"+pi') -- Faster window navigation vim.keymap.set('n', '', 'j') vim.keymap.set('n', '', 'k') vim.keymap.set('n', '', 'h') vim.keymap.set('n', '', 'l') vim.keymap.set('n', ',', ':noh', { silent = true, desc = "Clear highlighting" }) vim.keymap.set('n', 'v', [[:e ~/.config/nvim/init.lua]], { silent = true, desc = "Open [V]im config" }) -- URL handling (since I disabled netrw) -- source: https://sbulav.github.io/vim/neovim-opening-urls/ if vim.fn.has('mac') == 1 then vim.keymap.set('n', '', '"+p') vim.keymap.set('n', '', '"+p') vim.keymap.set('i', '', '*') vim.keymap.set('i', '', '*') vim.keymap.set('t', '', '"+pi') vim.keymap.set('t', '', '"+pi') vim.keymap.set('', 'gx', [[call jobstart(['open', expand('')], { 'detach': v:true })]], { noremap = true, silent = true }) elseif vim.fn.has("unix") == 1 then vim.keymap.set('', 'gx', [[call jobstart(['xdg-open', expand('')], { 'detach': v:true })]], { noremap = true, silent = true }) else vim.keymap.set[''].gx = {[[lua print("Error: gx is not supported on this OS!")]]} end -- this is needed here since it doesn't work in plugins/sqls.lua for some reason -- sqls is dead now apparently :( -- vim.keymap.set('n', 's', [[SqlsExecuteQuery]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor" }) -- vim.keymap.set('n', 'S', [[SqlsExecuteQueryVertical]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor in vertical split" }) -- vim.keymap.set('x', 's', [[(sqls-execute-query)]], { noremap = false, silent = true, desc = "[S]qls execute selected query" }) -- vim.keymap.set('x', 'S', [[(sqls-execute-query-vertical)]], { noremap = false, silent = true, desc = "[S]qls execute selected query in vertical split" }) vim.keymap.set("n", "bo", "%bd|e#", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188 vim.g.neovide_input_macos_alt_is_meta = true