-- set as leader key vim.keymap.set('', '', '', { silent = true }) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- disable default ENTER binding vim.keymap.set('', '', '', { silent = true }) -- disable command history keymap, because i fatfinger it too often -- FIXME: these seem to disable the binding only partially. -- when pressing q: "fast", it is disabled. -- when pausing between q and :, the binding still opens command history. -- this may be relatred to the timeoutlen setting? vim.keymap.set('', 'q:', '', { silent = true }) vim.keymap.set('', 'q/', '', { silent = true }) vim.keymap.set('', 'Q', '', { silent = true }) -- disable them evil arrows vim.keymap.set('', '', '', { silent = true }) vim.keymap.set('', '', '', { silent = true }) vim.keymap.set('', '', '', { silent = true }) vim.keymap.set('', '', '', { silent = true }) local function open_link_under_cursor() local file_under_cursor = vim.fn.expand '' --check that it vaguely resembles an URI if file_under_cursor and file_under_cursor:match '%a+://.+' then local Job = require 'plenary.job' Job :new({ --FIXME: a x-platform command is needed here command = 'firefox', args = { file_under_cursor }, on_exit = function(status, code) print(status:result(), code) vim.notify('Openend ' .. file_under_cursor) end, }) :start() end end vim.keymap.set('n', 'gx', open_link_under_cursor, { silent = true })