Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Post History
If you know the normal mode key sequence to achieve the desired result, you can always feed it to the ex-mode normal command. Step 3 translates to :norm ggVGp See the documentation in :help :n...
Answer
#2: Post edited
- If you know the normal mode key sequence to achieve the desired result, you can always feed it to the ex-mode `normal` command.
- Step 3 translates to
- :norm ggVGp
- See the documentation in `:help :norm`,
- ```
- :norm[al][!] {commands} *:norm* *:normal*
- Execute Normal mode commands {commands}. This makes
- it possible to execute Normal mode commands typed on
- the command-line. {commands} are executed like they
- are typed.
```
- If you know the normal mode key sequence to achieve the desired result, you can always feed it to the ex-mode `normal` command.
- Step 3 translates to
- :norm ggVGp
- See the documentation in `:help :norm`,
- ```
- :norm[al][!] {commands} *:norm* *:normal*
- Execute Normal mode commands {commands}. This makes
- it possible to execute Normal mode commands typed on
- the command-line. {commands} are executed like they
- are typed.
- ```
- ---
- You could also combine `:d` and `:put`,
- :%d|pu!2
- - `%` is a range that means "all lines".
- - `d`, short for `delete`, deletes all in that range.
- - `|` is the command separator.
- - `pu`, short for `put`, inserts text from register `2`.
- `line 4` turns up in register 2 after being displaced from register 1 by the remaining lines deleted by `%d`.
- That would leave an empty line behind, so a pedantically correct answer would be
- :%d|pu!2|$d
#1: Initial revision
If you know the normal mode key sequence to achieve the desired result, you can always feed it to the ex-mode `normal` command. Step 3 translates to :norm ggVGp See the documentation in `:help :norm`, ``` :norm[al][!] {commands} *:norm* *:normal* Execute Normal mode commands {commands}. This makes it possible to execute Normal mode commands typed on the command-line. {commands} are executed like they are typed. ```