let toggle = key: action: { key = "\\${key}"; options.desc = "Toggle ${action}"; action = "setlocal ${action}!"; }; window-jump = key: { key = ""; action = "${key}"; }; in [ { key = ""; options.desc = "Redo"; action = ""; } { key = ""; options.desc = "Comment line"; action = "normal gcc"; } (toggle "w" "wrap") (toggle "n" "number") (toggle "r" "relativenumber") (toggle "i" "ignorecase") (toggle "c" "cursorline") (toggle "C" "cursorcolumn") { key = ""; options.desc = "Previous buffer"; action = "bprevious"; } { key = ""; options.desc = "Next Buffer"; action = "bnext"; } ] ++ map window-jump ["h" "j" "k" "l"]