Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to implement :wq ? #18

Open
dtabell opened this issue Nov 25, 2020 · 2 comments
Open

Is it possible to implement :wq ? #18

dtabell opened this issue Nov 25, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dtabell
Copy link

dtabell commented Nov 25, 2020

Before I forget (again) to say this, many thanks for this great plugin!

The commands :w and :q serve, respectively, to write the file and to exit to Jupyter command mode.
Is it possible to to have :wq perform the combined action?

@ianhi
Copy link
Collaborator

ianhi commented Dec 21, 2020

I think this should be possible. You probably would need to add another mapCommand like is done here: https://github.com/axelfahy/jupyterlab-vim/blob/c4e43f940ef4be4c961608b6192412d2f3a33d1f/src/index.ts#L181

@firai firai added the enhancement New feature or request label Oct 1, 2023
@firai
Copy link
Collaborator

firai commented Oct 6, 2023

Wouldn't mapCommand() create a normal mode key binding? It seems like ex commands are created with defineEx()?

jupyterlab-vim/src/index.ts

Lines 127 to 137 in 43ffc6e

Vim.defineEx('write', 'w', () => {
app.commands.execute('docmanager:save');
});
Vim.defineEx('quit', 'q', () => {
// In JupyterLab 4.0 needs to be executed after vim panel has closed, here
// achived by moving it to end of execution stack with `setTimeout()`.
setTimeout(() => {
app.commands.execute('notebook:enter-command-mode');
});
});
.

@firai firai added the good first issue Good for newcomers label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants