Existem muitas maneiras de fazer isso, aqui estão algumas delas:
-
:%s/\%>56c.//g
-
:%s/\%57c.*//
-
:%s/\v^.{56}\zs.*//
-
:% normal 57|D
(este assumevirtualedit=all
ouvirtualedit=onemore
) -
Shift-g
57
| Ctrl-v 1 Shift-g < kbd> End x (este assumevirtualedit=all
)
Editar: Adicionando as regurgitações relevantes do manual, conforme solicitado:
- Para 1. e 2. (
:h /\%c
):\%23c
Matches in a specific column.\%<23c
Matches before a specific column.\%>23c
Matches after a specific column.
These three can be used to match specific columns in a buffer or string. The "23" can be any column number. The first column is 1. Actually, the column is the byte number (thus it's not exactly right for multi-byte characters). - Para 3. (
:h \zs
):\zs
Matches at any position, and sets the start of the match there: The next char is the first char of the whole match. -
Para 4. (
:h |
,:h D
,:h :normal
,:h :%
,:h 'virtualedit'
):|
To screen column [count] in the current line. exclusive motion. Ceci n'est pas une pipe["x]D
Delete the characters under the cursor until the end of the line and [count]-1 more lines [into register x]; synonym for "d$".:norm[al][!] {commands}
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.%
equal to1,$
(the entire file)'virtualedit'
A comma separated list of these words:block
Allow virtual editing in Visual block mode.insert
Allow virtual editing in Insert mode.all
Allow virtual editing in all modes.onemore
Allow the cursor to move just past the end of the lineVirtual editing means that the cursor can be positioned where there is no actual character. This can be halfway into a tab or beyond the end of the line. Useful for selecting a rectangle in Visual mode and editing a table.
-
Para 5. (
:h G
,:h CTRL-V
,:h <End>
,:h x
):G
Goto line [count], default last line, on the first non-blank character linewise.[count]CTRL-V
Start Visual mode blockwise.$
or<End>
To the end of the line.["x]x
Delete [count] characters under and after the cursor [into register x] (not linewise). Does the same as "dl".