feat: add support for fish-like abbreviations#1060
Open
casedami wants to merge 3 commits intonushell:mainfrom
Open
feat: add support for fish-like abbreviations#1060casedami wants to merge 3 commits intonushell:mainfrom
casedami wants to merge 3 commits intonushell:mainfrom
Conversation
* feat(editor): detect if cursor is in unclosed string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on my comment in #556 i figured i would go ahead and get something working. This would be the initial step to getting abbreviations in nushell and would require
a parsing implementationabbreviations to be stored in nushell config and then passed to reedline. Open to any comments or opinions as far as implementation goes but this is a feature that i would personally love to have in nushell.I've essentially added a check during the following events that will check if the word before the cursor is an abbreviation and expand it if true:
SubmitandSubmitOrNewlineEnterEditif the first command in the event is to insert a spaceAs for adding this to nushell, here's a simple example of how this might look in the nushell config:
Note, that the
is_inside_string_literalfunction could potentially be used for a bug fix for!$history expansion uses naive last token, rather than the last argument to previous command nushell#6971As an aside, here's how im currently getting abbreviations with this hacky solution