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

Capital W/B word movement #147

Merged
merged 4 commits into from
Feb 18, 2016

Conversation

tma-isbx
Copy link

Implement W/B WORD movements

  • update regex so as to treat “) {“ as two words instead of one
  • update word movements to use indexes returned by regex directly
  • fix b/B behavior when moving up a line (should move to beginning of last word/WORD)
  • fix w/W behavior when moving down a line (should move to beginning of first word/WORD)

- update regex so as to treat “) {“ as two words instead of one
- update word movements to use indexes returned by regex directly
- fix b/B behavior when moving up a line
- fix w/W behavior when moving down a line
@@ -23,8 +23,10 @@ export class NormalMode extends Mode {
"gg" : async (c) => { return c.firstLineNonBlankChar().move(); },
"G" : async (c) => { return c.lastLineNonBlankChar().move(); },
"w" : async (c) => { return c.wordRight().move(); },
"W" : async (c) => { return c.WORDRight().move(); },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big fan of differentiating functions using casing. I understand that vim differentiates using word vs. WORD, but I'm wondering if there are alternatives?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not usually a fan either. Though I figured in this case it would be the most obvious vocabulary for someone familiar with vim.

I took a look at various other projects to see what they use, and I think I like "Big Word" the best. Still short, and the connection can be made to WORD pretty easily and recalled easily. I'll make an update to the pull request.

@tma-isbx
Copy link
Author

Updated.

this._nonBigWordCharRegex = this.makeWordRegex(Position.NonBigWordCharacters);
}

private makeWordRegex(characterSet: string) : RegExp {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: mind moving the f(x) around such that public comes first then privates?

@jpoon
Copy link
Member

jpoon commented Feb 17, 2016

Awesome Thanks! Mind also updating the Readme?

I'll push an update to the extension following this PR merge. Sidenote: I should setup a continuous delivery system. Such that every time we push to a stable branch, it auto publishes it to VSCE. I'll file an issue to track this actually :)

@jpoon
Copy link
Member

jpoon commented Feb 18, 2016

Meh, we'll update the readme later -- want to push a new version out.

jpoon added a commit that referenced this pull request Feb 18, 2016
@jpoon jpoon merged commit 4117ecb into VSCodeVim:master Feb 18, 2016
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.

3 participants