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 some new commands #344

Open
mu2so4 opened this issue Jun 12, 2022 · 0 comments
Open

Add some new commands #344

mu2so4 opened this issue Jun 12, 2022 · 0 comments

Comments

@mu2so4
Copy link
Contributor

mu2so4 commented Jun 12, 2022

There are some useful commands:

  1. :ba[ll] - edit all buffers as horizontal windows;
  2. <% - de-indent a block with () or {} (cursor on brace);
  3. :mak[e] - execute external command makeprg and parse error messages. It's like exiting Vim, executing make in terminal, and reopening the file(s), but with error logs in the quickfix window;
  4. g? - Rot13 encode up to motion. I'm not sure this command is useful.

There are other flags for the :s[ubstitude] command:

  1. :%s[ubstitute]/old/new - replace all "old" first occurrences within lines with "new" throughout file
  2. :%s[ubstitute]/old/new/i - replace all "old" first occurrences within lines with "new" throughout file (ignore case)

Also one can use different ranges, not only "%" which means the entire buffer:

  1. :12,26s/old/new/g - replace all "old" with "new" from 12th to 26th lines inclusively;
  2. :31s/old/new/g - replace all "old" with "new" in the 31st line;
  3. :s/old/new/g - replace all "old" with "new" in the line under the cursor.

These ranges may be used for other commands (e. g. :d, :>, etc.).

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

1 participant