Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Misexplain the :g command (maybe) #160

Copy link
Copy link
@aidancz

Description

@aidancz
Issue body actions

Thank you for your work! It's a really helpful guide and I learned a lot from it

https://github.com/iggredible/Learn-Vim/blob/master/ch13_the_global_command.md#advanced-sort

However, in the section above, it says that This command also follows the form :g/pattern1/,/pattern2/command, but I can't find anything about this form from the doc

In my opinion, it should be illustrated like this:

  • :g is the global command pattern.
  • /\[/ is the only pattern. It matches a literal left square bracket "[".
  • +1,/\]/-1 is a range, it begins from the line below the current cursor position (current cursor is placed at [), to the line above ]. thus, if not abbreviated, it should be written as .+1,/\]/-1.
  • sort is the command-line command which the range applies.

If I add a dot before +1, it works well, that's why I think this explanation makes more sense.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.