Skip to content

WIP: add support for vi mode - #407

Merged
sophiajt merged 2 commits into
nushell:masterfrom
iamcodemaker:vi
Aug 30, 2019
Merged

sophiajt merged 2 commits into
nushell:masterfrom
iamcodemaker:vi

Conversation

@iamcodemaker

Copy link
Copy Markdown
Contributor

This change adds support for vi editing mode. This is somewhat of a proof of concept. It works by reading the edit_mode value from the config file and setting the mode to Emacs or Vi depending on what the value is there.

Use config --set [edit_mode vi] and config --set [edit_mode emacs] (or config --remove edit_mode) to set the edit mode.

This also fixes what appears to be a bug with config --remove in which the modified config wasn't actually saved.

related to: #354

@wycats

wycats commented Aug 26, 2019

Copy link
Copy Markdown
Contributor

What about this is WIP?

@wycats

wycats commented Aug 26, 2019

Copy link
Copy Markdown
Contributor

Also, do you have any thoughts on the config-related design questions from #100?

@iamcodemaker

Copy link
Copy Markdown
Contributor Author

This is WIP mostly because of the config stuff. Those questions have to be worked out before the design for this can be finalized. Also I'm not sure it is doing a good job handling errors.

As far as #100 goes, I like your suggestion to watch the file and reload as necessary. That reload could also be triggered by invocation of config. My larger question was around accessing the config from the various places it might be needed. A handle needs to be passed around, or it needs to have some kind of global state.

@wycats

wycats commented Aug 29, 2019

Copy link
Copy Markdown
Contributor

@iamcodemaker there are a few Context objects that get passed around to various parts of the system (with things like Host, ShellManager and CommandRegistry), and config could be added to that.

@BatmanAoD

Copy link
Copy Markdown
Contributor

Should this maybe be "blocked" (on either #100 or another config issue) rather than "WIP"?

@BatmanAoD

Copy link
Copy Markdown
Contributor

Or, just merge it, since config related issues will be resolved separately?

@sophiajt

Copy link
Copy Markdown
Contributor

Fwiw, I'm fine with merging it and then having a todo item issue that ties it into the config work. As it stands now it will work, you just have to restart nu correct?

@iamcodemaker

Copy link
Copy Markdown
Contributor Author

No restart is necessary. It loads the config each time a new prompt is displayed.

@sophiajt

Copy link
Copy Markdown
Contributor

@iamcodemaker - this seems good to me. If you want, we can go ahead and land it

@iamcodemaker

Copy link
Copy Markdown
Contributor Author

If y'all are ok with it, I'm ok with it.

@sophiajt
sophiajt merged commit 729051f into nushell:master Aug 30, 2019
@iamcodemaker
iamcodemaker deleted the vi branch September 16, 2019 21:46
elferherrera pushed a commit to elferherrera/nushell that referenced this pull request Feb 7, 2022
kubouch pushed a commit that referenced this pull request Feb 7, 2022
Hofer-Julian pushed a commit to Hofer-Julian/nushell that referenced this pull request Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants