Skip to content

Commit adaa6bd

Browse files
authored
execute vim normal mode commands without using mappings (#578)
1 parent e7d510d commit adaa6bd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/actions/globalActions.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,25 @@ export function loadGlobalActions(action: ActionExplorer) {
789789
},
790790
},
791791
);
792+
action.addNodeAction(
793+
'normal!',
794+
async ({ args }) => {
795+
if (args[0]) {
796+
await nvim.command(`execute "normal! ${args[0]}"`);
797+
}
798+
},
799+
'execute vim normal mode commands without using mappings',
800+
{
801+
args: [
802+
{
803+
name: 'normal! commands',
804+
},
805+
],
806+
menus: {
807+
zz: 'execute normal! zz',
808+
},
809+
},
810+
);
792811
action.addNodeAction(
793812
'esc',
794813
async ({ source, mode }) => {

0 commit comments

Comments
 (0)