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

Add more Vim keystrokes #32

Open
6 of 7 tasks
cmaughan opened this issue Feb 12, 2019 · 3 comments
Open
6 of 7 tasks

Add more Vim keystrokes #32

cmaughan opened this issue Feb 12, 2019 · 3 comments
Assignees
Projects

Comments

@cmaughan
Copy link
Collaborator

cmaughan commented Feb 12, 2019

In order of preference/usefulness/ease of implementation:

  • r 'replace' mode. I use this a lot for single character replacement
  • ct, dt 'change to'/'delete to'. Change everything up to a character
  • ci 'change in' ()[], etc.
  • / search
  • :%s///g search and replace (harder)
  • viw Select inner word. This may be broken rather than unimplemented!
  • % find matching delimiter
@cmaughan cmaughan self-assigned this Feb 17, 2019
@cmaughan cmaughan added this to Ice Box in Rezonality Sep 13, 2020
@totalgee
Copy link
Contributor

Would indeed love to have ci)(change in parentheses) and also % (jump between matching braces/parens/brackets). Or ... some hints on where to start for adding these.

cmaughan added a commit that referenced this issue Feb 28, 2022
Issue #32

Behaves the same way as in Vim.  % to go to the next match of the first
thing found on the line, or the previous thing found on the line, at any
further point into the document.  No support for a count.

Unit test added to confirm basic behavior.

Added a FindFirstCharOf command on the buffer, which returns the first
found char in a list of characters, either forward or backwards
(inclusive).
cmaughan added a commit that referenced this issue Mar 3, 2022
Can now change a region demarked by the char after ci.  Should work for
just about anything; though probably best not to use it for things other
than brackets and quotes.

Known minor bug; an empty string ci" will not work depending on which
side you are in (i.e. you won't be dropped into insert mode).

The code tries to maintain indent, with reasonable success for multiple
line curly brackets, etc.  i.e for the following command in the inner
brackets:

{
    { dsdf
    sdf <ci}>
    }
}

Results in:

{
    {
        |
    }
}

Even though Zep doesn't really support auto intent, this is convenient
for now.

ci(, ci), ci{, ci}, ci[, ci], ci", ci' are of course very useful...

No unit tests yet.
@cmaughan
Copy link
Collaborator Author

cmaughan commented Mar 3, 2022

@totalgee Let me know if the ci works for you.

@totalgee
Copy link
Contributor

totalgee commented Mar 4, 2022

Thanks, see my comment regarding ci here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Rezonality
  
Ice Box
Development

No branches or pull requests

2 participants