-- 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 }) vim.keymap.set('n', 'v', [[:e ~/.config/nvim/init.lua]], { silent = true }) -- 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