AminetAminet
Search:
85026 packages online
About
Recent
Browse
Search
Upload
Setup
Services

text/edit/neatvi.lha

Mirror:Random
Showing: ppc-morphos icongeneric icon
No screenshot available
Short:Neat vi clone
Author: ali at rudi.ir (Ali Gholami Rudi)
Uploader:polluks+aminet sdf org (Stefan Haubenthal)
Type:text/edit
Version:17
Architecture:ppc-morphos
Date:2025-11-08
URL:http://litcave.rudi.ir
Download:text/edit/neatvi.lha - View contents
Readme:text/edit/neatvi.readme
Downloads:1878

NEATVI
======

Neatvi is a small vi/ex editor for editing UTF-8 text.  It supports
syntax highlighting, multiple windows, right-to-left languages, and
keymaps.

CONFIGURATION
-------------

Edit conf.h to adjust syntax highlighting rules and text direction
patterns.  To define a new keymap, create a new array in kmap.h, like
kmap_fa, and add it to kmaps array in the same header (the first entry
of the new array specifies its name).  The current keymap may be
changed with :cm ex command.  When in input mode, ^e activates the
English keymap and ^f switches to the alternate keymap (the last
keymap specified with :cm).

Sadly, VTE-based terminals such as GNOME's implement a
backward-incompatible extension of virtual terminal escape codes to
render bidirectional text by default.  When using these terminal, the
value of LNPREF macro in conf.h needs to be changed to "\33[8l".

COMMANDS
--------

Commands not available in ex(1):

:cm[ap][!] [kmap]
  Without kmap, prints the current keymap name.
  When kmap is specified, sets the alternate keymap to
  kmap and, unless ! is given, switches to this keymap.
:ft [filetype]
  Without filetype, prints the current file type.
  When filetype is specified, sets the file type of the
  current ex buffer.
:ta[g] tag
  Jumps to tag (tags file: TAGPATH environment variable or ./tags).
:tn[ext]
  Jumps to the next matching tag.
:tp[rev]
  Jumps to the previous matching tag.
:po[p]
  Pops tag stack.
:b[uffer] [buf]
  Without buf, prints buffer list.  Switches to the given buffer
  if buf is a buffer number or alias.  Also, buf can be -, +, !,
  and ~ to switch to the previous buffer, switch to the next buffer,
  delete the current buffer, and renumber buffers, respectively.
:rs reg
  Reads dot-terminated lines (similar to :a command) from ex input
  and copies them to the given yank buffer.
:rx reg cmd
  Like :! command, executes cmd.  However, the contents of the
  specified yank buffer is given to the command as input, and the
  output of the command is written to the same buffer.
:rk reg path
  Connects to a unix socket, writes the contents of the given buffer
  to it, and reads from the socket into the buffer.
:ra reg
  Similar to :@ command, executes the contents of the given buffer.
  Before executing the buffer, however, it replaces ^rx with the
  contents of buffer x, and ^vx with x, in which x is any character.
:ec[ho] msg
  Prints the given message (useful in ex scripts or q-commands).

New key mappings:
- ^a in normal mode: searches for the word under the cursor.
- ^p in insert mode: inserts the contents of the default yank buffer.
- ^rX in insert mode: inserts the contents of yank buffer X.
- z>, z<, 2z>, and 2z< in normal mode: changes the value of td option.
- ^e and ^f in insert mode: switches to the English and alternate keymap.
- ze and zf in normal mode: switches to the English and alternate keymap.
- gu, gU, and g~ in normal mode: switches character case.
- ^l in normal mode: updates terminal dimensions (after resizing it).
- ^] and ^t in normal mode: jumps to tag and pops tag stack.
- gf in normal mode: edits the file whose address is under the cursor.
- gl in normal mode: like gf, but it reads line and column numbers too.
- ^ws, ^wo, ^wc, ^wj, ^wk, ^wx in normal mode: manages windows.
- ^wgf, ^wgl, ^w^] in normal mode: executes gf, gl, ^] in a new window.
- zj, zk, zD: equivalent to :b+, :b-, :b !.
- zJ, zK: equivalent to :next, :prev.
- q in normal mode: see quick access section.
- ^a in ex, search, and pipe prompts: inserts from history lines.

Other noteworthy differences with vi(1):
- Neatvi assumes POSIX extended regular expressions (ERE) in search
  patterns, conf.h variables, and even tags files.
- If paths start with =, they are assumed to be relative to the
  directory of the current file.
- Neatvi highlights files whose names end with ls as directory
  listings; the gl command edits the file under the cursor.  For
  instance, git ls-files >ls && neatvi ls.
- In addition to the standard single-letter yank buffers, Neatvi
  supports a set of extended buffers whose two-letter names begin
  with a backslash, like \x.
- If EXINIT environment variable is defined as "so /path/to/exrc",
  Neatvi executes the ex commands in this file at startup.

Note that in :rs command, input lines are read from ex input stream
(unlike :a), to make it usable in @ commands and ex scripts (files
passed to :so).  This allows setting the value of yank buffers in ex
files, as the following example shows:

  rs a
  :!git add %
  .

OPTIONS
-------

To improve Neatvi's performance, shaping, character reordering, and
syntax highlighting can be disabled by defining the EXINIT environment
variable as "set noshape | set noorder | set nohl | set td=+2".

Options supported in Neatvi:

td, textdirection
  Current direction context.  The following values are meaningful:
  * +2: always left-to-right.
  * +1: follow conf.h's dircontexts[]; left-to-right for others.
  * -1: follow conf.h's dircontexts[]; right-to-left for others.
  * -2: always right-to-left.
  The default value is 0, which assumes left-to-right if the first
  character of the line is single-byte; otherwise, it follows
  dircontexts[].
shape
  If set, Arabic/Farsi letter shaping will be performed.
order
  If set, characters will be reordered based on the rules defined
  in conf.h.  If the value is 1, only lines with at least one
  multi-byte UTF-8 character are reordered.  If it is 2, all lines
  are reordered.
hl, highlight
  If set, text will be highlighted based on syntax highlighting
  rules in conf.h.
hll, highlightline
  If set, the current line will be highlighted.
lim, linelimit
  Lines longer than this value are not reordered or highlighted.
ru, ruler
  Indicates when to redraw the status line:
  * 0: never.
  * 1: always.
  * 2: when multiple windows are visible.
  * 4: when the current file changes.
hist, history
  Indicates the number of lines remembered for ex, search, and
  pipe prompts.  Zero disables command history.
ai, autoindent
  As in vi(1).
aw, autowrite
  As in vi(1).
ic, ignorecase
  As in vi(1).
wa, writeany
  As in vi(1).

MARKS AND BUFFERS
-----------------

Special marks:
- * the position of the previous change
- [ the first line of the previous change
- ] the last line of the previous change

Special yank buffers:
- / the previous search keyword
- : the previous ex command
- ! the previous pipe command
- % the name of the current file
- " the default yank buffer
- ; the current line
- . the last vi command
- # cursor line number
- ^ cursor line offset
- \/ search history
- \: ex command history
- \! pipe command history

QUICK ACCESS
------------

When q is pressed in normal mode, Neatvi prints the list of buffers at
the bottom of the screen and waits for a key.  If the key is a digit,
it switches to its corresponding buffer.  If it is a letter and the
extended buffer with that letter is defined, the contents of that
buffer is executed.  Otherwise, Neatvi executes ECMD (defined in
conf.h) with the following parameters: i) the letter, ii) the current
file, iii) the current line number, and iv) the current line offset.

What ECMD writes to its standard output, Neatvi executes as ex
commands.  Q-commands can be used to add interesting features to
Neatvi, such as language-dependent IDE features, for instance by
connecting to an LSP (language server protocol) server.  ecmd.sh is an
example ECMD shell script.

AUTO-COMPLETION
---------------

When the hist option is nonzero, Neatvi suggests the most recent
matching entry when reading user input for :, /, and ! prompts; ^a
completes the input using the suggestion.

On the other hand, when in insert mode, ^a changes the value of the
buffer named ~ to the contents of the current line up to the cursor,
and executes the contents of \~ buffer (as :ra \~).  The buffer can
execute any ex command (for instance, :ec to print a message), and
change the contents of ~ to suggest a completion; a second ^a inserts
the suggestion.  The following lines define \~ to demonstrate how it
works.

  rs \~
  ec completing '~'
  rs ~
  completion
  .
  .

In a real implementation, the \~ buffer can use external commands
(with rx or rk) to compute the completions.


Contents of text/edit/neatvi.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                   12      12 100.0% -lh0- 1c8e Apr 18  2025 neatvi-17/.gitignore
[generic]                 1423    3925  36.3% -lh5- 5d8a Apr 18  2025 neatvi-17/cmd.c
[generic]                  644    2290  28.1% -lh5- 5d18 Apr 18  2025 neatvi-17/conf.c
[generic]                 3418    9316  36.7% -lh5- 59db Apr 18  2025 neatvi-17/conf.h
[generic]                 1138    3065  37.1% -lh5- ba23 Apr 18  2025 neatvi-17/dir.c
[generic]                  975    1942  50.2% -lh5- 412c Apr 18  2025 neatvi-17/ecmd.sh
[generic]                 8536   30870  27.7% -lh5- 5945 Apr 18  2025 neatvi-17/ex.c
[generic]                 2207    6881  32.1% -lh5- a860 Apr 18  2025 neatvi-17/kmap.h
[generic]                 2678    9272  28.9% -lh5- 3f1f Apr 18  2025 neatvi-17/lbuf.c
[generic]                 3446   10729  32.1% -lh5- 2fa4 Apr 18  2025 neatvi-17/led.c
[generic]                  221     369  59.9% -lh5- c769 Apr 18  2025 neatvi-17/Makefile
[generic]                 1548    5333  29.0% -lh5- 1d16 Apr 18  2025 neatvi-17/mot.c
[generic]                 3419    8252  41.4% -lh5- 36b5 Apr 18  2025 neatvi-17/README
[generic]                  594    1434  41.4% -lh5- b8f3 Apr 18  2025 neatvi-17/reg.c
[generic]                 4103   14484  28.3% -lh5- 4e13 Apr 18  2025 neatvi-17/regex.c
[generic]                  236     481  49.1% -lh5- 937b Apr 18  2025 neatvi-17/regex.h
[generic]                 1211    3906  31.0% -lh5- 1692 Apr 18  2025 neatvi-17/ren.c
[generic]                 1225    3365  36.4% -lh5- 1baf Apr 18  2025 neatvi-17/rset.c
[generic]                  957    2419  39.6% -lh5- 8cac Apr 18  2025 neatvi-17/rstr.c
[generic]                  657    1724  38.1% -lh5- 77e7 Apr 18  2025 neatvi-17/sbuf.c
[generic]                 1356    3223  42.1% -lh5- 1ae9 Apr 18  2025 neatvi-17/stag.c
[generic]                  991    2578  38.4% -lh5- 0f77 Apr 18  2025 neatvi-17/syn.c
[generic]                  723    1719  42.1% -lh5- c407 Apr 18  2025 neatvi-17/tag.c
[generic]                 1528    4142  36.9% -lh5- 173f Apr 18  2025 neatvi-17/term.c
[generic]                  249     425  58.6% -lh5- d858 Apr 18  2025 neatvi-17/test.sh
[generic]                   92     162  56.8% -lh5- 221c Apr 18  2025 neatvi-17/test/e0a.sh
[generic]                  109     259  42.1% -lh5- 9062 Apr 18  2025 neatvi-17/test/e0b.sh
[generic]                  115     341  33.7% -lh5- 2ade Apr 18  2025 neatvi-17/test/e0c.sh
[generic]                  119     310  38.4% -lh5- c4cb Apr 18  2025 neatvi-17/test/e0d.sh
[generic]                  117     202  57.9% -lh5- 1dfa Apr 18  2025 neatvi-17/test/e0e.sh
[generic]                   99     187  52.9% -lh5- b511 Apr 18  2025 neatvi-17/test/e0f.sh
[generic]                   43      43 100.0% -lh0- 80b0 Apr 18  2025 neatvi-17/test/e00.sh
[generic]                   82     131  62.6% -lh5- 7052 Apr 18  2025 neatvi-17/test/e01.sh
[generic]                   93     184  50.5% -lh5- b0d3 Apr 18  2025 neatvi-17/test/e02.sh
[generic]                   86     191  45.0% -lh5- 1ba7 Apr 18  2025 neatvi-17/test/e03.sh
[generic]                  104     241  43.2% -lh5- 975c Apr 18  2025 neatvi-17/test/e04.sh
[generic]                   98     212  46.2% -lh5- 7dab Apr 18  2025 neatvi-17/test/e05.sh
[generic]                  110     271  40.6% -lh5- 0fe5 Apr 18  2025 neatvi-17/test/e06.sh
[generic]                  119     289  41.2% -lh5- bebb Apr 18  2025 neatvi-17/test/e07.sh
[generic]                  115     198  58.1% -lh5- f223 Apr 18  2025 neatvi-17/test/e08.sh
[generic]                   98     172  57.0% -lh5- d0d3 Apr 18  2025 neatvi-17/test/e09.sh
[generic]                  105     197  53.3% -lh5- 382c Apr 18  2025 neatvi-17/test/e10.sh
[generic]                   96     183  52.5% -lh5- 2e1a Apr 18  2025 neatvi-17/test/e11.sh
[generic]                  106     239  44.4% -lh5- 0ee4 Apr 18  2025 neatvi-17/test/e12.sh
[generic]                  104     210  49.5% -lh5- 3427 Apr 18  2025 neatvi-17/test/e13.sh
[generic]                   92     196  46.9% -lh5- aa64 Apr 18  2025 neatvi-17/test/e14.sh
[generic]                   98     201  48.8% -lh5- 0b7a Apr 18  2025 neatvi-17/test/e15.sh
[generic]                   99     194  51.0% -lh5- 2bd6 Apr 18  2025 neatvi-17/test/e16.sh
[generic]                   97     186  52.2% -lh5- 1bdc Apr 18  2025 neatvi-17/test/e17.sh
[generic]                  120     213  56.3% -lh5- bec8 Apr 18  2025 neatvi-17/test/v0a.sh
[generic]                  118     236  50.0% -lh5- 2808 Apr 18  2025 neatvi-17/test/v0b.sh
[generic]                  108     186  58.1% -lh5- 5bf5 Apr 18  2025 neatvi-17/test/v0c.sh
[generic]                  114     178  64.0% -lh5- 0152 Apr 18  2025 neatvi-17/test/v0d.sh
[generic]                  133     250  53.2% -lh5- d3bb Apr 18  2025 neatvi-17/test/v0e.sh
[generic]                  112     191  58.6% -lh5- 2a25 Apr 18  2025 neatvi-17/test/v0f.sh
[generic]                   92     123  74.8% -lh5- d3af Apr 18  2025 neatvi-17/test/v00.sh
[generic]                  109     165  66.1% -lh5- 5170 Apr 18  2025 neatvi-17/test/v01.sh
[generic]                  123     214  57.5% -lh5- 8be0 Apr 18  2025 neatvi-17/test/v02.sh
[generic]                   97     145  66.9% -lh5- a3d2 Apr 18  2025 neatvi-17/test/v03.sh
[generic]                  133     212  62.7% -lh5- 91d5 Apr 18  2025 neatvi-17/test/v04.sh
[generic]                  113     172  65.7% -lh5- 8c93 Apr 18  2025 neatvi-17/test/v05.sh
[generic]                  131     238  55.0% -lh5- 5e71 Apr 18  2025 neatvi-17/test/v06.sh
[generic]                  107     208  51.4% -lh5- 567b Apr 18  2025 neatvi-17/test/v07.sh
[generic]                   99     168  58.9% -lh5- 76e1 Apr 18  2025 neatvi-17/test/v08.sh
[generic]                  114     197  57.9% -lh5- ec6d Apr 18  2025 neatvi-17/test/v09.sh
[generic]                  108     183  59.0% -lh5- 1efa Apr 18  2025 neatvi-17/test/v1a.sh
[generic]                  100     171  58.5% -lh5- 1752 Apr 18  2025 neatvi-17/test/v1b.sh
[generic]                  111     196  56.6% -lh5- fa8d Apr 18  2025 neatvi-17/test/v1c.sh
[generic]                   94     154  61.0% -lh5- 636e Apr 18  2025 neatvi-17/test/v1d.sh
[generic]                  107     181  59.1% -lh5- aa4b Apr 18  2025 neatvi-17/test/v1e.sh
[generic]                   96     153  62.7% -lh5- ae03 Apr 18  2025 neatvi-17/test/v1f.sh
[generic]                  122     249  49.0% -lh5- bffa Apr 18  2025 neatvi-17/test/v10.sh
[generic]                  111     205  54.1% -lh5- 2fe0 Apr 18  2025 neatvi-17/test/v11.sh
[generic]                  115     223  51.6% -lh5- 6424 Apr 18  2025 neatvi-17/test/v12.sh
[generic]                  140     276  50.7% -lh5- 5e9f Apr 18  2025 neatvi-17/test/v13.sh
[generic]                  123     219  56.2% -lh5- f120 Apr 18  2025 neatvi-17/test/v14.sh
[generic]                  109     201  54.2% -lh5- 8620 Apr 18  2025 neatvi-17/test/v15.sh
[generic]                  120     275  43.6% -lh5- 418f Apr 18  2025 neatvi-17/test/v16.sh
[generic]                  113     227  49.8% -lh5- f085 Apr 18  2025 neatvi-17/test/v17.sh
[generic]                   91     148  61.5% -lh5- 3edd Apr 18  2025 neatvi-17/test/v18.sh
[generic]                   99     180  55.0% -lh5- 0c56 Apr 18  2025 neatvi-17/test/v19.sh
[generic]                   96     168  57.1% -lh5- 8146 Apr 18  2025 neatvi-17/test/v20.sh
[generic]                   86     147  58.5% -lh5- a2aa Apr 18  2025 neatvi-17/test/v21.sh
[generic]                   96     217  44.2% -lh5- a6eb Apr 18  2025 neatvi-17/test/v22.sh
[generic]                  105     260  40.4% -lh5- a9c2 Apr 18  2025 neatvi-17/test/v23.sh
[generic]                 6869   21848  31.4% -lh5- d2b9 Apr 18  2025 neatvi-17/uc.c
[generic]                11569   41613  27.8% -lh5- 9687 Apr 18  2025 neatvi-17/vi.c
[generic]                 2075    7188  28.9% -lh5- 5713 Apr 18  2025 neatvi-17/vi.h
[generic]                68854  166468  41.4% -lh5- 26a5 Nov  7 21:28 neatvi-17/vi
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        89 files  139223  381401  36.5%            Nov  8 02:09
Page generated in 0.009 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>