-- Map a key with optional options local function map(mode, keys, action, options) if options == nil then options = {noremap=true} end vim.api.nvim_set_keymap(mode,keys,action,options) end vim.g.mapleader = " " map('i','jk','',{noremap=true}) map('v','jk','',{noremap=true}) map('n', "H", "^",{noremap=true}) map('n', "L", "$",{noremap=true}) map('n','j',"v:count ? 'j' : 'gj'",{expr=true,noremap=true}) map('n','k',"v:count ? 'k' : 'gk'",{expr=true,noremap=true}) -- zettelkasten keybindings -- Create a new note after asking for its title. -- map("n", "zn", "ZkNew { title = vim.fn.input('Title: ') }") -- -- Open notes. -- map("n", "zo", "ZkNotes { sort = { 'modified' } }") -- -- Open notes associated with the selected tags. -- map("n", "zt", "ZkTags") -- -- Search for the notes matching a given query. -- map("n", "zf", "ZkNotes { sort = { 'modified' }, match = vim.fn.input('Search: ') }") -- -- Search for the notes matching the current visual selection. map("v", "zf", ":'<,'>ZkMatch") local mappings = lvim.builtin.which_key.mappings mappings["z"] = { name = "zk", n = { "ZkNew { title = vim.fn.input('Title: ') }", "New"}, o = { "ZkNotes { sort = { 'modified' } }", "Open" }, t = { "ZkTags", "Tags"}, f = { "ZkNotes { sort = { 'modified' }, match = vim.fn.input('Search: ') }", "Fuzzy Search" }, } mappings["s"]["p"] = {"Telescope projects","Recent Projects"} mappings["s"]["w"] = {"Telescope live_grep","Find Word"} mappings[';'] = { "Alpha", "Dashboard"} -- keymappings [view all the defaults by pressing Lk] -- lvim.leader = "space" -- add your own keymapping lvim.keys.normal_mode[""] = ":w"