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

Support for Wildfire (visual selection expansion using text objects) #2834

Open
expelledboy opened this issue Jul 11, 2018 · 9 comments
Open

Comments

@expelledboy
Copy link

Hey guys, love the idea of using vim in vscode!

Would it be possible atm to implement something similar to vim's wildfire plugin? It expands the visual selection according to next recognized text objects, searching in order of a configurable list.

Wildfire Preview

I use it so much I actually cant use vim anywhere that doesn't support it, just breaks my concentration.

@xconverge
Copy link
Member

did you try our keybinding of af https://github.com/VSCodeVim/Vim#-vscodevim-tricks

You can rebind something else to af if that makes you more comfortable as well

@expelledboy
Copy link
Author

@xconverge Wow! That was easy, you should add it to the readme!

    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["enter"],
            "after": ["v", "a", "f"],
        }
    ],
    "vim.visualModeKeyBindingsNonRecursive": [
        {
            "before": ["enter"],
            "after": ["a", "f"],
        }
    ]

The only other powerful feature lacking here is then, having custom rules for text object expansions per language. For example in Erlang I expand inside { character according to what its encapulating, but these do no apply to any other lanugage. Even the order matters, if we cant define our own custom text objects.

But now I am invested, I think I am going to have a read through how this all works. This project has come along way!

@Zyst
Copy link

Zyst commented Jul 16, 2018

@expelledboy I think it is, what do you think is missing there?

https://github.com/VSCodeVim/Vim#-vscodevim-tricks

If necessary it's possible to write more detailed docs for it.

@expelledboy
Copy link
Author

@Zyst My bindings with af posted above is what I was looking for, but the final step to get the full wildfire goodness is to have custom rules for text expansion per filetype.

If anyone could point me to where its implemented I would appreciate it!

@cursorzz
Copy link

cursorzz commented Mar 2, 2019

Is there any command that support select Inside block? for the example below

af - visual mode command which selects increasingly large blocks of text. For example, if you had "blah (foo [bar 'ba|z'])" then it would select 'baz' first. If you pressed af again, it'd then select [bar 'baz'], and if you did it a third time it would select "(foo [bar 'baz'])".

I would like to select baz instead of 'baz'

@Glench
Copy link

Glench commented Nov 15, 2019

Yes, is it possible to get af to work just like VSCode's Expand Selection command? It would be awesome if they were consistent.

@kronaemmanuel
Copy link

Is there a way to Reduce the selection? If you've accidentally pressed af one too many times accidentally?

@d1y
Copy link

d1y commented Sep 5, 2023

FYI, I use https://github.com/jhasse/vscode-bracket-select the plugin

    {
      "before": [
        "enter"
      ],
      "commands": [ "bracket-select.select" ],
      // "after": [
      //   "v",
      //   "a",
      //   "f"
      // ]
    },

demo.gif

@expelledboy
Copy link
Author

expelledboy commented Sep 5, 2023

Amazing! Thanks @d1y, perhaps I can modify this code to be customizable.

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

No branches or pull requests

7 participants