Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

A small vi/ex terminal text editor (neatvi rewrite)

License

NotificationsYou must be signed in to change notification settings

kyx0r/nextvi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nextvi(1)                   General Commands Manual                  Nextvi(1)NAME     Nextvi - A small vi/ex terminal text editorSYNOPSIS     vi [-emsv] [file ...]DESCRIPTION     Nextvi is a modern clone of the command-line text editor vi(1),     initially developed by Bill Joy in 1976 for Unix-based systems.     Nextvi builds upon many standard features from vi(1) including     unique modal interface that allows users to switch between normal,     insert, and command modes, for efficient text manipulation.     Additional enhancements include an unrestricted macro system,     syntax highlighting, keymaps, bidirectional UTF-8 support, and     numerous other features. Nextvi remains highly efficient, portable,     and hackable, ensuring its continued relevance and high quality     for years to come.OPTIONS     -e      Enter Ex mode on startup     -m      Disable initial file read message     -s      Enter raw Ex mode on startup     -v      Enter visual mode on startup (Default)MANPAGE NOTATION     <x>     A closure where x represents character literal     [x]     A closure where x represents optional argument     {x}     A closure where x represents required argument     "x"     A closure where x represents a string     <^X>    Represents a ctrl key X     #       Represents a positive number in a closure     *       Represents any character(s) in a closure     < >     Separates alternatives in a closure     x-y     Range from x to yVI NORMAL     [#]j          Move # lines down     [#]k          Move # lines up     [#]+     [#]<^M>     [#]<Newline>                   Move # lines down, cursor after indent     [#]-          Move # lines up, cursor after indent     [#]h          Move # cols left     [#]l          Move # cols right     f{arg}        Move to arg character found forward     F{arg}        Move to arg character found backward     t{arg}        Move until arg character found forward     T{arg}        Move until arg character found backward     [#],          Repeat last <f F t T> move backward # times     [#];          Repeat last <f F t T> move forward # times     [#]E          Move to end of word # times, skip punctuation     [#]e          Move to end of word # times     [#]B          Move to start of word backward # times, skip punctuation     [#]b          Move to start of word backward # times     [#]W          Move to start of word forward # times, skip punctuation     [#]w          Move to start of word forward # times     vw            Toggle line mode for <E e B b W w>     [#]{          Move to next <{> section down # times     [#]}          Move to next <{> section up # times     [#][          Move to next <Newline> section down # times     [#]]          Move to next <Newline> section up # times     ^             Move to start of line after indent     0             Move to start of line     $             Move to end of line     [#]|          Goto # col     [#]<Space>    Move # characters forward     [#]<^H>     [#]<Backspace>                   Move # characters backward     %             Move to closest <] ) }><[ ( {> pair     {#}%          Move to # percent line number     '{a-z ` ' [] *}                   Move to a line mark     `{a-z ` ' [] *}                   Move to a line mark with cursor position     gg            Goto first line in buffer     [#]G          Move to last line in buffer or # line     H             Move to highest line on a screen     L             Move to lowest line on a screen     M             Move to middle line on a screen     [#]z.         Center screen at cursor. # is xtop     [#]z<^M>     [#]z<Newline>                   Center screen at top row. # is xtop     [#]z-         Center screen at bottom row. # is xtop     [#]<^E>       Scroll down 1 or # lines, retain # and cursor position     [#]<^Y>       Scroll up 1 or # lines, retain # and cursor position     [#]<^D>       Scroll down half a screen size. If [#], set scroll to #                   lines     [#]<^U>       Scroll up half a screen size. If [#], set scroll to # lines     <^B>          Scroll up full screen size     <^F>          Scroll down full screen size     #             Show global and relative line numbers     2#            Toggle show global line numbers permanently     4#            Toggle show relative line numbers after indent permanently     8#            Toggle show relative line numbers permanently     V             Toggle show hidden characters:<Space Tab Newline>     <^C>          Toggle show line motion numbers for <l h e b E B w W>     {1-5}<^C>     Switch to line motion number mode #     <^V>          Loop through line motion number modes     [#]<^R>       Redo # times     [#]u          Undo # times     <^I>     <Tab>                   Open file path from cursor to end of line     <^K>          Write current buffer to file. Force write on 2nd attempt     [#]<^W>{arg}  Unindent arg region # times     [#]<{arg}     Indent left arg region # times     [#]>{arg}     Indent right arg region # times     "{arg}{arg1}  Operate on arg register according to arg1 motion     R             Print registers and their contents     [#]&{arg}     Execute arg register macro in non-blocking mode # times     [#]@{arg}     Execute arg register macro in blocking mode # times     [#]@@     [#]&&                   Execute a last executed register macro # times     [#].          Repeat last normal command # times     [#]v.         Repeat last normal command moving down across # lines     :             Enter ex prompt     [#]!{arg}     Enter pipe ex prompt based on # or arg region     vv            Enter ex prompt with the last line from history buffer b-1     [#]vr         Enter %s/ ex prompt. Insert # words from cursor     [#]vt[#arg]   Enter .,.+0s/ ex prompt. Insert # of lines from cursor.                   Insert #arg words from cursor     [#]v/         Enter v/ xkwd ex prompt to set search keyword. Insert #                   words from cursor     v;            Enter ! ex prompt     [#]vi         Enter %s/ ex prompt. Contains regex for changing spaces to                   tabs. # modifies tab width     [#]vI         Enter %s/ ex prompt. Contains regex for changing tabs to                   spaces. # modifies tab width     vo            Remove trailing white spaces and <\r> line endings     va            Toggle ai ex option     <^G>          Print buffer status infos     1<^G>         Enable permanent status bar row     2<^G>         Disable permanent status bar row     ga            Print character info     1ga           Enable permanent character info bar row     2ga           Disable permanent character info bar row     [#]gw         Hard word wrap a line to # col limit. Default: 80     [#]gq         Hard word wrap a buffer to # col limit. Default: 80     [#]g~{arg}    Switch character case for arg region # times     [#]gu{arg}    Switch arg region to lowercase # times     [#]gU{arg}    Switch arg region to uppercase # times     [#]~          Switch character case # times forward     i             Enter insert mode     I             Enter insert mode at start of line after indent     A             Enter insert mode at end of line     a             Enter insert mode 1 character forward     [#]s          Enter insert mode and delete # characters     S             Enter insert mode and delete all characters     o             Enter insert mode and create a new line down     O             Enter insert mode and create a new line up     [#]c{arg}     Enter insert mode and delete arg region # times     C             Enter insert mode and delete from cursor to end of line     [#]d{arg}     Delete arg region # times     D             Delete from cursor to end of line     [#]x          Delete # characters from cursor forward     [#]X          Delete # characters from cursor backward     di{arg}       Delete inside arg pairs <( ) ">     ci{arg}       Change inside arg pairs <( ) ">     [#]r{arg}     Replace # characters with arg from cursor forward     K             Split a line     {#}K          Split a line without creating blank <Newline>     [#]J          Join # lines     vj            Toggle space padding when joining lines     [#]y{arg}     Yank arg region # times     [#]Y          Yank # lines     [#]p          Paste default register # times     [#]P          Paste default register below current line or behind cursor                   position # times     m{a-z ` ' [] *}                   Set buffer local line mark     <^T>          Set global line mark 0. Global marks are always valid     {0 2 4 6 8}<^T>                   Set a global line mark #     {1 3 5 7 9}<^T>                   Switch to a global line mark #     [#]<^7>{0-9}     [#]<^_>{0-9}     [#]<^/>{0-9}                   Show buffer list and switch based on # or 0-9 index when                   prompted     <^^>     <^6>                   Swap to previous buffer     [#]<^N>       Swap to next buffer, # changes direction [forward backward]     \             Swap to /fm/ buffer b-2     {#}\          Swap from /fm/ buffer b-2 and backfill directory listing     vb            Recurse into b-1 history buffer. Insert current line into                   ex prompt on exit     z1            Set alternative keymap to Farsi keymap     z2            Set alternative keymap to Russian keymap     ze            Switch to English keymap     zf            Switch to alternative keymap     zL            Set td ex option to 2     zl            Set td ex option to 1     zr            Set td ex option to -1     zR            Set td ex option to -2     [#]/          Regex search, move down 1 or # matches     [#]?          Regex search, move up 1 or # matches     [#]n     [#]N                   Repeat regex search, move [down up] 1 or # matches     <^A>          Regex search 1 word from cursor, no center, wraparound move                   [up down]     {#}<^A>       Regex search, set keyword to # words from cursor     <^]>          Filesystem search forward based on directory listing in b-2     {#}<^]>       Filesystem search forward, set keyword to # words from                   cursor     <^P>          Filesystem search backward based on directory listing in                   b-2     {#}<^P>       Filesystem search backward, set keyword to # words from                   cursor     <^Z>          Suspend vi     <^L>          Force redraw whole screen and update terminal dimensions     Z{*}          Exit and clean terminal, force quit in an & macro     Zz            Exit and submit history command, force quit in an & macro     ZZ            Exit and write unsaved changes to a fileVI REGIONS     Regions are vi normal commands that define [h v]range for vi motions.     Commands described with the word "move" define a region.     <+ j ^M Newline - k h l f F t T , ; B E b e W w { } [ ] ^ 0 $ Space ^H             Backspace % ' ` G H L M / ? n N ^A>             All regionsVI MOTIONS     Motions are vi normal commands that run in a [h v]range.     Commands described with the word "region" consume a region.     Motions can be prefixed or suffixed by [#].     <^W < > ! c d y "> g~ gu gU             All motions     <">     Special motions that consume a motion     dd yy cc g~~ guu gUU >> << <^W><^W> !!             Special motions that can use [#] as number of lines     Examples:     3d/int  Delete text until the 3rd instance of "int" keyword     3dw     Delete 3 words (prefix [#])     d3w     Delete 3 words (suffix [#])     "ayl    Yank a character into <a> register     "Ayw    Append a word to <a> registerVI/EX INSERT     <^H>     <Backspace>                   Delete a character     <^U>          Delete util <^X> mark or everything     <^W>          Delete a word     <^T>          Increase indent     <^D>          Decrease indent     <^]>          Select paste register from 0-9 registers in a loop     <^\>{arg}     Select paste register arg. <^\> selects default register     <^P>          Paste a register     <^X>          Mark autocomplete and <^U> starting position. <^X> resets                   the mark     <^G>          Index current buffer for autocomplete     <^Y>          Reset all indexed autocomplete data     <^R>          Loop through autocomplete options backward     <^N>          Loop through autocomplete options forward     <^B>          Print autocomplete options when in vi insert     <^B>          Recurse into b-1 history buffer when in ex prompt. Insert                   current line into ex prompt on exit     <^A>          Loop through lines in a history buffer b-1     <^Z>          Suspend vi/ex     <^L>          Redraw screen in vi mode, clean terminal in ex     <^O>          Switch between vi and ex modes recursively     <^E>          Switch to english keymap     <^F>          Switch to alternative keymap     <^V>{arg}     Read a literal character arg     <^K>{arg}     Read a digraph sequence arg     <^C>     <ESC>                   Exit insert modeEX     Ex is a powerful line editor for Unix systems, initially developed     by Bill Joy in 1976. This essential tool serves as the backbone     of vi, enabling it to execute commands, macros and even transform     into a purely command-line interface (CLI) when desired.EX PARSING     Parsing follows the structure:     [<:>][range][sep][cmd][<sep>][args][<:>]     Ex commands are initiated and separated by <:> prefix. Fields     can be separated by <Space> or <Tab>. There can only be one separator     in between [cmd] and [args]. To avoid ambiguity, it is recommended     to always use a separator between [cmd] and [args] in scripts.     Examples:     :evi.c             Evaluates to ":e vi.c"     :eabc             Evaluates to ":ea bc" not ":e abc"     :e  vi.c             Edit " vi.c". [<sep>] is requiredEX ESCAPES     Special characters in [args] will become regular when escaped     with <\>.     <( ^ [ ] \>             Special characters in regex "[]" expression     <( ) { } + * ? ^ $ [ ] | \ .> "\<" "\>"             Specials in regex     <# % ! :>             Special characters in exEX EXPANSION     Characters <# %> in [args] substitute the buffer pathname.     <%> substitutes current buffer and <#> last swapped buffer.     It is possible to expand any arbitrary buffer by using <# %>     followed by the buffer number.     Example: print the pathname for buffer 69.     :!echo "%69"     Every ex command is be able to receive data from external process     through a special expansion character <!> which pipes the data     into the command itself. If the closing <!> is not specified,     the end of the line becomes a terminator.     Example: substitute "int" with the value of $RANDOM     :%s/int/!printf "%s" $RANDOM!     Example: insert output of ls shell command     :& i!lsEX RANGES     Some ex commands can be prefixed with ranges.     [. - +][1-9 %][sep][, ;][. - +][1-9 $]             Numeric ranges     </ ?>{kwd}[</ ?>]             Search ranges     <'>{mark}             Mark ranges     .       Current position     ,       Vertical range separator     ;       Horizontal range separator     %       Range from first to last line of the buffer     $       Last line of the buffer or end of the line     Examples:     :1,5p   Print lines 1,5     :.-5,.+5p             Print 5 lines around xrow     :/int/p             Print first occurrence of int     :?int?p             Print first occurrence of int in reverse     :.,/int/p             Print until int is found     :?int?,.p             Print until int is found in reverse     :'d,'ap             Print lines from mark <d> to mark <a>     :%p     Print all lines in the buffer     :$p     Print last line in the buffer     :;50    Goto character offset 50     :10;50  Goto line 10 character offset 50     :10;.+5             Goto line 10 +5 character offset     :'a;'a  Goto line mark <a> offset mark <a>     :;$     Goto end of the line     :5;/int/             Search for int on line 5     :.;?int?             Search for int in reverse on the current lineEX COMMANDS     [range]f{/?}[kwd]             Ranged search (stands for find)             Example: no range given, current line only             :f/int             Example: reverse             :f?int             Example: range given             :10,100f/int             Subsequent commands within the range will move to the next match             just like vi n/N commands.     b[#]    Print currently active buffers state or switch to a buffer             Example: switch to the 5th buffer             :b5             There are two temporary buffers which are separate from             the main buffers.             b-1 = /hist/ ex history buffer             b-2 = /fm/ directory listing buffer             Example: switch to the b-1 buffer             :b-1             Example: switch to the b-2 buffer             :b-2     bp[path]             Set current buffer path     bs[#]   Set current buffer saved. If any arg given, reset undo/redo             history     [range]p             Print line(s) from the buffer             Example: utilize character offset ranges             :1,10;5;5p             Example: print current line from offset 5 to 10             :.;5;10p     ea[kwd] [#]             Open file based on filename substring from dir listing in b-2             Requires directory listing in b-2 backfilled prior.             Example: backfill b-2 using :fd             :fd             Example: backfill b-2 using find             :b-2:1,$!find .             If the substring matches more than one filename, a prompt will             be shown. Submit using numbers 0-9 or higher ascii values.             <^C> to cancel, <Newline> to select first match. Passing an             extra arg to :ea in form of a number will bypass the prompt             and open the corresponding file.             Example: open filename containing "v"             :ea v             Example: open first match containing "v"             :ea v 0     ea![kwd] [#]             Forced version of ea     [#]a[str]     [#]i[str]     [#]c[str]             Enter ex {append insert change} mode             # determines insertion line number.             str determines initial input into the insertion buffer.             Example: insert "hello" in vi/ex             :i hello<^M><ESC>             Example: discard changes in vi/ex             :i hello<^C>             Example: immediately insert "hello"             :i hello<^V><^M><^V><ESC>             Example: insert "hello" in raw ex mode             i hello<^M>.<^M>     [range]d             Delete line(s)     e[path]             Open a file at a path             No argument opens "unnamed" buffer.     e![path]             Force open a file at a path             No argument re-reads the current buffer from the filesystem.     [range]g{*}[kwd]{*}{cmd}             Global command             Execute an ex command on a range of lines that matches an             enclosed regex.             Example: remove all empty lines             :g/^$/d             Example: print lines matching previously set search keyword             :g//p             Multiple ex commands can be chained in one global command.             To chain commands, the ex separator <:> must be escaped once.             Example: yank matches appending to reg 'a' and print them out.             :g/int/ya A\:p             It is possible to nest global commands inside of global commands.             A global command will not be executed on lines that were changed             by a nested global command.             When range not given, a nested global command is executed on             the current line.             Example: nested global command             Append "has a semicolon" to all lines that contain "int" and             end with <;>.             :g/int/g/;$/& A has a semicolon             Example: extract/print data enclosed in "()"             :g/\(.+\)/;0;/\(.+\)/\:.;.+1k a\:se grp=2\:;/\)*(\))/\:             se nogrp\:k s\:.;'a;'sp     [range]g!{*}[kwd]{*}{cmd}             Inverted global command     [range]=             Print the current range line number     [range]k[mark]             Set a line mark             The character offset is set to the current position.     &{macro}             Global non-blocking macro             Execute raw vi/ex input sequence.             A non-blocking macro shall not wait for input when the end of             the sequence is reached. A non-blocking macro executing other             macros will always reach a terminating point.             Example: execute vi insert statement             :& ihello             Example: execute :hello             :& \:hello<^V><^M>             Example: execute vi ci(int macro             :& ci(int             Example: nest blocking macro inside non-blocking             :& \:@ \\:blocking<^V><^M>i continue in non-blocking     @{macro}             Global blocking macro             Execute raw vi/ex input sequence.             A blocking macro shall wait for input when the end of the sequence             is reached. A blocking macro executing other macros may result             in congestion.             Example: execute vi insert statement             :@ ihello             Example: insert "hello" into <:> vi prompt             :@ \:hello             Example: execute vi ci(int macro             :@ ci(int             Example: execute ci(int exiting insert mode             :@ ci(int<^V><^C>             Example: execute ci)INT as a follow-up             :@ ci(int<^V><^C>ci)INT             Example: execute vi dw command after user exits insert             :@i:@dw     pu[register] [cmd]             Paste a register             To pipe register data to an external process use :pu \![cmd]             Example: copy default register to X11 clipboard             :pu \!xclip -selection clipboard     [range]r[path cmd]             Read a file or a pipe             To read data from a pipe use :[range]r \![cmd]             Example: pipe in only the first line             :r \!ls             Example: pipe in only lines 3,5             :3,5r \!ls             Example: pipe in all data             :%r \!ls     [range]w[path cmd]             Write to a file or a pipe             To pipe buffer data to external process use :[range]w \![cmd]             Example: pipe out all data into less             :w \!less             Example: pipe out only first 10 lines             :1,10w \!less     [range]w![path]             Force write to a file     q       Exit     q!      Force quit     wq     x             Write and exit     wq!     x!             Force write and quit     u[# $]  Undo # times or all with $     rd[# $]             Redo # times or all with $     se{exp}             Set ex option variable             Example: set using implications             :se hll             :se nohll             Example: set using numeric values             :se hll=1             :se hll=0             Example: set using ascii values             :se hll=a     [range]s{*}[kwd]{*}{str}[*][opts]             Substitute             Find and replace text in a range of lines that matches an             enclosed regex with an enclosed replacement string.             Example: global replacement             :%s/term1/term2/g             Example: replace matching previously set search keyword             :%s//term2/g             Substitution backreference inserts the text of matched group             specified by \x where x is group number.             Example: substitution backreference             this is an example text for subs and has int or void             :%s/(int)|(void)/pre\0after             this is an example text for subs and has preintafter or void             :%s/(int)|(void)/pre\2after/g             this is an example text for subs and has prepreafterafter or prevoidafter     [range]ya[register][append]             Yank a range             To append to the register, pass in its uppercase version.             To append to any of the non-alphabetical registers add any extra             character to the command.             Example: append to register <1>             :ya 1x     ya![register]             Reset register value     [range]![cmd]             Run external program             When ex range specified, pipes the buffer data to an external             process and pipes the output back into current buffer replacing             the affected range.             Example: infamously sort the buffer             :1,$!sort     ft[filetype]             Set a filetype             No argument prints the current file type.             Reloads the highlight ft, which makes it possible to reset dynamic             highlights created by options like "hlw".     cm[keymap]             Set a keymap             No argument prints the current keymap name.     cm![keymap]             Set an alternative keymap     fd[path]             Set a secondary directory (stands for file dir)             Recalculates directory listing in b-2 buffer.             No argument implies current directory.     fp[path]             Set a directory path for :fd (stands for file path)     cd[path]             Set a working directory (stands for change dir)             Currently open buffers' file paths will be automatically adjusted             to reflect a newly set working directory.     inc[regex]             Include regex for :fd calculation             Example: include only files in submodule directory that end with .c             :inc submodule.*\.c$             Example: exclude .git and submodule folders             :inc (^(?\:(?\!^\.git|^submodule).)+[^/]+$)             No argument disables the filter.     reg[hscroll]             Print registers and their contents             Printing position is determined by xcols / 2 * [hscroll]     bx[#]   Set max number of buffers allowed             Buffers will be deallocated if the number specified is lower             than the number of buffers currently in use.             No argument will reset to the default value of 10.     ac[regex]             Set autocomplete filter regex             Example: autocomplete using whole lines from the buffer             :ac .+             No argument resets to the default word filter regex as defined             in led.c.     uc      Toggle multibyte utf-8 decoding             This command is particularly useful when editing files with             mixed encodings, binary files, or when the terminal does not             support UTF-8 or lacks the necessary fonts to display UTF-8             characters. It's often paired with :ph command to achieve             hex editor-like functionality.     uz      Toggle zero width placeholders             Use only if you need to hide zero width characters.     ub      Toggle combining multicodepoint placeholders             Use only if your terminal can render multicodepoint utf-8 (emojis).     ph[#clow] [#chigh] [#width] [#blen][*char]             Redefine placeholders             This command replaces placeholders defined in conf.c             and subsequent :ph commands expand the list of placeholders.             Example: render 8 bit ascii (Extended ASCII) as <~>             :ph 128 255 1 1~             Example: flawless ISO/IEC 8859-1 (latin-1) support             :uc:ph 128 160 1 1~             Example: render control byte 03 as "^C"             :ph 3 3 2 1^C             Example: reset to default as in conf.c             :ph             Example: disable default placeholders in conf.c             :ph:ph0EX OPTIONS     ai=1    Indent new lines     ic=1    Ignore case in regular expressions     ish=0   Interactive shell             Run every <!> command through an interactive shell.             The shell will source the .rc file before command execution.             This makes it possible to use predefined functions, aliases             and ENV variables from the .rc file.             Precondition 1:                     The .rc filename is shell specific, such as .bashrc in Bash                     and .zshrc in Zsh.             Precondition 2:                     The environment variable $SHELL determines the default                     shell, otherwise it defaults to /bin/sh.             Precondition 3:                     There must be no stdout output created by .rc file                     for <!> commands to return expected results.     grp=0   Regex search group             Defines a target search group for any regex search operation.             This becomes necessary when the result of regex search is to             be based on some group rather than default match group.             Example: ignore tabs at the start of the line             :se grp=2:1,$f/^[       ]+(.+):se nogrp             The value of grp is calculated using (group number * 2).     hl=1    Highlight text based on rules defined in conf.c     hlr=0   Highlight text in reverse direction     hll=0   Highlight current line based on filetype hl     hlp=0   Highlight "[]" "()" "{}" pairs based on filetype hl     hlw=0   Highlight current word based on filetype hl     led=1   Enable all terminal output     vis=0   Control startup flags             Example: disable :e message in ex mode             :se vis=12             Example: disable :e message in vi mode             :se vis=8             Example: enable raw ex mode             :se vis=6             Example: disable raw ex mode             :se vis=4     mpt=0   Control vi prompts             When set to 0 after an ex command is called from vi, disables             the "[any key to continue]" prompt.             If mpt is negative, the prompt will remain disabled.     order=1             Reorder characters based on rules defined in conf.c     shape=1             Perform Arabic script letter shaping     pac=0   Print autocomplete suggestions on the fly     tbs=8   Number of spaces used to represent a tab     td=1    Current text direction context             This option accepts four meaningful values:             +2      Exclusively left-to-right             +1      Follow dircontexts[] (in conf.c), defaulting to left-to-                     right             -1      Follow dircontexts[], defaulting to right-to-left             -2      Exclusively right-to-left     pr=0    Print register             Set a special register using a character or a number.             Once the register is set, all data passed into ex_print will             be stored in the register.             If the register is uppercase, <Newline> characters are added             to match the exact output that was printed.             Example: paste current buffer list exactly like from :b command             :se pr=A:ya! a: b:pu a             Example: store a line printed with :p             :se pr=A:ya! a:p     sep=:   Ex separator             Set Ex command separator character.             Changing default <:> separator will break some built-in commands/macros.             Example: set separator to <|>             :se sep=|             Example: disable separator             :se nosep     lim=-1  Line length render limit             Set render cutoff length for non cursor lines in vi and all             lines in ex mode.             Improves redraw performance when editing a file containing one             or many long lines (1MB+ per line).             Example: reasonable value             :se lim=5000             Example: render only the cursor line             :se lim=0             Example: disable the limit             :se lim=-1     seq=1   Control Undo/Redo             When seq is 0, multiple distinct operations undo/redo in a single             step.             To optimize resource use under heavy workloads, undo/redo tracking             can be disabled by setting seq to a negative value.             Example: test undo/redo operations in a single step             :&ocontrol test:se noseq:&a step1:&a step2:&a step3:se seq             Example: completely disable undo/redo             :se seq=-1EXINIT ENV VAR     EXINIT defines a sequence of vi/ex commands to be performed     at startup. Consequently, this is the primary way for scripting     and customizing Nextvi outside of C.     Many standard text processing utils such as grep, awk, sed     can be replaced by Nextvi with EXINIT in mind.     Examples:     export EXINIT="$(printf '%b' 'e ./vi.c:& i\x7\x3:bx 1:bx')"             Index vi.c for autocomplete     export EXINIT='b-1:%r ./vi.c:b-1'             Load vi.c into a history buffer     export EXINIT="$(printf '%b' 'e:& io{\n}\x16\x3kA\x3:& 1G:& 2"ayy')"             Setup @ macro in register <a>             @a macro creates <{> and closing <}> below the cursor leaving             cursor in insert mode in between the braces.     export EXINIT='se td=2:se order=0:se lim=5000'             Set ex options for optimal long line performanceREGEX     Pikevm is a fast non backtracking NFA simulation regex engine     developed for Nextvi. It ensures regular expressions are evaluated     in constant space and O(n + k) time complexity where <n> is     the input string length and <k> represents the regex's structural     complexity (e.g., state transitions or alternations). While     this does not guarantee strict O(n) linear runtime performance,     it ensures computational and memory resources are distributed     linearly and evenly across the input, with <k> directly influencing     the constant factor. This principle is similar to the concept     utilized in radix sort algorithms.     Pikevm's syntax is akin to regexp(7) from Plan 9.     Disregard manpage notation for <{ } [ ]> in this section.     .       Match any single char     ^       Assert start of the line     $       Assert end of the line     {N,M}   Match N to M times     ()      Grouping     (?:)    Non capture grouping     [N-M]   Match a set of alternate ranges N to M     *       Repeated zero or more times     +       Repeated one or more times     |       Union, alternative branch     \<      Assert start of the word     \>      Assert end of the word     ?       One or zero matches greedy     ??      One or zero matches lazy     (?=)    Positive lookahead     (?!)    Negative lookahead     (?<)    Positive lookbehind     (?>)    Negative lookbehind     (?#)    Lookbehind offset in bytes     Lookaround expressions enable the creation of regular expressions     that would be impossible to construct without them. They can     be used anywhere within a regex, though some considerations     must be taken into account.     Aspect 1:             Lookarounds contain a full regex, but should use non-capturing             groups to avoid incorrect results and performance issues.     Aspect 2:             Lookarounds can have nested lookarounds.     Aspect 3:             Static lookarounds like (?=^word) are optimized, bypassing             the regex engine.     Aspect 4:             Lookarounds are best suited for asserting near the end of a             complex pattern, where the engine has already narrowed down             potential matches.     Aspect 5:             Lookbehind without offset rescans entire string. Offset begins             scanning from current position minus specified value.SPECIAL MARKS     *       Position of the previous operation or command     [       First line of the previous change     ]       Last line of the previous change     '       Position of the previous line region     `       Position of the previous line regionSPECIAL REGISTERS     /       Previous search keyword     :       Previous ex command     0       Previous value of default register (atomic)             Atomic means the operation did not include a <Newline>.     1-9     Previous value(s) of default register (nonatomic)CODE MAP     +--------------+----------------------+     | 510 vi.h     |  definitions/aux     |     | 537 kmap.h   |  keymap translation  |     +--------------+----------------------+     | 306 conf.c   |  hl/ft/td config     |     | 342 term.c   |  low level IO        |     | 398 ren.c    |  positioning/syntax  |     | 539 lbuf.c   |  file/line buffer    |     | 637 uc.c     |  UTF-8 support       |     | 683 led.c    |  insert mode/output  |     | 748 regex.c  |  extended RE         |     | 1251 ex.c    |  ex options/commands |     | 1950 vi.c    |  normal mode/general |     | 6854 total   |  wc -l *.c|sort      |     +--------------+----------------------+COMPILING     export CC='g++ -x c'             Set compiler, g++ example     export CFLAGS='-s'             Set CFLAGS, strip example     ./cbuild.sh             Build once     ./cbuild.sh build             Build     ./cbuild.sh debug             Build with -O0 -g     ./cbuild.sh pgobuild             PGO build can lead to a significant performance boost on some             application specific tasks     ./cbuild.sh install             Install vi to $DESTDIR$PREFIX/bin     ./cbuild.sh fetch             Merge commits from upstream repository     ./cbuild.sh bench             Performance bench test 2000 word deletions on vi.cPHILOSOPHY     In most text editors, flexibility is a minor or irrelevant design     goal. Nextvi is designed to be flexible where the editor adapts     to the user needs. This flexibility is achieved by heavily chaining     basic commands and allowing them to create new ones with completely     different functionality. Command reuse keeps the editor small     without infringing on your freedom to quickly get a good grasp     on the code. If you want to customize anything, you should be     able to do it using only core commands or a mix with some specific     C code for more difficult tasks. Simple and flexible design     allows for straight forward solutions to any problem long term     and filters bad inconsistent ideas.     "All software sucks, but some do more than others."             - Kyryl MelekhinSEE ALSO     New functionality can be obtained through optional patches provided     in the patches branch. If you have a meaningful contribution     and would love to be made public the patch can be submitted     via email or github pull request.https://github.com/kyx0r/nextvi/tree/patches     Scripts used to generate this manual are located in the manual     branch.https://github.com/kyx0r/nextvi/tree/manual     Original Neatvi repositoryhttps://github.com/aligrudi/neatvi     Posix vi(1)https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html     Posix ex(1)https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html     NFA regular expressions by Russ Coxhttps://swtch.com/~rsc/regexp/regexp1.html     Plan 9 regexp(7)https://man.cat-v.org/p9p/7/regexpAUTHORS     Nextvi was written by Kyryl Melekhin <k.melekhin@gmail.com>.  It is based     on neatvi(1), which was written by Ali Gholami Rudi <ali@rudi.ir>.  This     manual page was inspired by nepeta <nepeta@canaglie.net>Linux 6.14.10                    July 12, 2025                   Linux 6.14.10

About

A small vi/ex terminal text editor (neatvi rewrite)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2025 Movatter.jp