💾 Archived View for gmi.noulin.net › vim › various.gmi captured on 2024-08-19 at 03:52:19. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2024-06-16)
🚧 View Differences
-=-=-=-=-=-=-
- various.txt* For Vim version 9.1. Last change: 2024 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
Various commands *various*
1. Various commands |various-cmds|
2. Using Vim like less or more |less|
==============================================================================
1. Various commands *various-cmds*
*CTRL-L*
CTRL-L Clear and redraw the screen. The redraw may happen
later, after processing typeahead.
*:redr* *:redraw*
:redr[aw][!] Redraw the screen right now. When ! is included it is
cleared first.
It can be used to redraw the screen in a script
or function (or a mapping if |'lazyredraw'| is set).
*:redraws* *:redrawstatus*
:redraws[tatus][!] Redraw the status line of the current window. When !
is included all status lines are redrawn.
Useful to update the status line(s) when 'statusline'
includes an item that doesn't cause automatic
updating.
If the command line is being edited the redraw is
postponed until later.
*:redrawt* *:redrawtabline*
:redrawt[abline] Redraw the tabline. Useful to update the tabline when
'tabline' includes an item that doesn't trigger
automatic updating.
*N<Del>*
<Del> When entering a number: Remove the last digit.
Note: if you like to use <BS> for this, add this
mapping to your .vimrc: >
:map CTRL-V <BS> CTRL-V <Del>
< See |:fixdel| if your <Del> key does not do what you
want.
:as[cii] or *ga* *:as* *:ascii*
ga Print the ascii value of the character under the
cursor in decimal, hexadecimal and octal.
Mnemonic: Get Ascii value.
For example, when the cursor is on a 'R':
<R> 82, Hex 52, Octal 122 ~
When the character is a non-standard ASCII character,
but printable according to the 'isprint' option, the
non-printable version is also given.
When the character is larger than 127, the <M-x> form
is also printed. For example:
<~A> <M-^A> 129, Hex 81, Octal 201 ~
<p> <|~> <M-~> 254, Hex fe, Octal 376 ~
(where <p> is a special character)
The <Nul> character in a file is stored internally as
<NL>, but it will be shown as:
<^@> 0, Hex 00, Octal 000 ~
If the character has composing characters these are
also shown. The value of 'maxcombine' doesn't matter.
If the character can be inserted as a digraph, also
output the two characters that can be used to create
the character:
<ö> 246, Hex 00f6, Oct 366, Digr o: ~
This shows you can type CTRL-K o : to insert ö.
*g8*
g8 Print the hex values of the bytes used in the
character under the cursor, assuming it is in |UTF-8|
encoding. This also shows composing characters. The
value of 'maxcombine' doesn't matter.
Example of a character with two composing characters:
e0 b8 81 + e0 b8 b9 + e0 b9 89 ~
*8g8*
8g8 Find an illegal UTF-8 byte sequence at or after the
cursor. This works in two situations:
1. when 'encoding' is any 8-bit encoding
2. when 'encoding' is "utf-8" and 'fileencoding' is
any 8-bit encoding
Thus it can be used when editing a file that was
supposed to be UTF-8 but was read as if it is an 8-bit
encoding because it contains illegal bytes.
Does not wrap around the end of the file.
Note that when the cursor is on an illegal byte or the
cursor is halfway a multibyte character the command
won't move the cursor.
*:p* *:pr* *:print* *E749*
:[range]p[rint] [flags]
Print [range] lines (default current line).
Note: If you are looking for a way to print your text
on paper see |:hardcopy|. In the GUI you can use the
File.Print menu entry.
See |ex-flags| for [flags].
The |:filter| command can be used to only show lines
matching a pattern.
:[range]p[rint] {count} [flags]
Print {count} lines, starting with [range] (default
current line |cmdline-ranges|).
See |ex-flags| for [flags].
*:P* *:Print*
:[range]P[rint] [count] [flags]
Just as ":print". Was apparently added to Vi for
people that keep the shift key pressed too long...
This command is not supported in |Vim9| script.
Note: A user command can overrule this command.
See |ex-flags| for [flags].
*:l* *:list*
:[range]l[ist] [count] [flags]
Same as :print, but display unprintable characters
with '^' and put $ after the line. This can be
further changed with the 'listchars' option.
See |ex-flags| for [flags].
*:nu* *:number*
:[range]nu[mber] [count] [flags]
Same as :print, but precede each line with its line
number. (See also 'highlight' and 'numberwidth'
option).
See |ex-flags| for [flags].
*:#*
:[range]# [count] [flags]
synonym for :number.
*:#!* *vim-shebang*
:#!{anything} Ignored, so that you can start a Vim script with: >
#!vim -S
let mylogbook='$HOME/logbook.md'
exe