💾 Archived View for cugi.ie › aminet › 1698466317.gmi captured on 2024-05-12 at 15:47:49. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-11-04)
-=-=-=-=-=-=-
Author: ali at rudi.ir (Ali Gholami Rudi) Uploader: polluks+aminet sdf lonestar org (Stefan Haubenthal) Type: text/edit Version: 12 Architecture: ppc-morphos URL: http://litcave.rudi.ir Date: 2023-10-27 Readme: http://aminet.net/text/edit/neatvi.readme Downloads: 383
http://aminet.net/text/edit/neatvi.lha
NEATVI
======
Neatvi is a vi/ex editor. It can edit bidirectional UTF-8 text.
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 edited.
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]
Switch to buffer buf (buffer number or alias); lists buffers
if buf is missing.
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.
- zL, zl, zr, and zR in normal mode: change 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.
- qX in normal mode: see q-commands section (X can be any letter).
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 ends with ls as directory
listings; the gl command can be used to edit its files.
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.
shape
If set (default), performs Arabic/Farsi letter shaping.
order
If set, reorder characters based on the rules defined
in conf.h.
hl, highlight
If set (default), text will be highlighted based on syntax
highlighting rules in conf.h.
hll, highlightline
If set, highlight current line.
lim, linelimit
Lines longer than this value are not reordered or highlighted.
ai, autoindent
As in vi(1).
aw, autowrite
As in vi(1).
ic, ignorecase
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
Q-COMMANDS
----------
For qX command in normal mode, Neatvi executes ECMD (defined in conf.h)
with the following parameters:
- X (the key following q)
- current file
- current line number
- current line offset
ECMD must print a line of ex commands and Neatvi executes this line.
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. As an example, the following
script shows how to use gopls to implement goto defintion and find
references for Go.
# Compile.
if test "$1" = "c"; then
go build >.make.ls 2>&1
echo ":e +1 .make.ls | :e"
fi
# Goto definition; uses gopls (not very efficient without using LSP).
if test "$1" = "d"; then
loc=`gopls definition $2:$3:$4`
if test -n "$loc"; then
echo $loc | sed -E 's/^([^:]+):([^:]+):([^:]+).*$/:e +\2 \1/'
fi
fi
# Find references. Use gl command on each line.
if test "$1" = "f"; then
gopls references $2:$3:$4 >$OUT/.out.ls
echo ":e +1 $OUT/.out.ls | :e"
fi
PERMISSION UID GID PACKED SIZE RATIO METHOD CRC STAMP NAME ---------- ----------- ------- ------- ------ ---------- ------------ ---------- [generic] 1164 3201 36.4% -lh5- 1e25 Aug 6 08:08 neatvi-12/cmd.c [generic] 644 2290 28.1% -lh5- 5d18 Aug 6 08:08 neatvi-12/conf.c [generic] 2890 7959 36.3% -lh5- bb4b Aug 6 08:08 neatvi-12/conf.h [generic] 1114 3005 37.1% -lh5- 0e08 Aug 6 08:08 neatvi-12/dir.c [generic] 6891 24091 28.6% -lh5- b05c Aug 6 08:08 neatvi-12/ex.c [generic] 2209 6880 32.1% -lh5- 344f Aug 6 08:08 neatvi-12/kmap.h [generic] 2475 8526 29.0% -lh5- 625c Aug 6 08:08 neatvi-12/lbuf.c [generic] 3068 9383 32.7% -lh5- e677 Aug 6 08:08 neatvi-12/led.c [generic] 221 369 59.9% -lh5- c769 Aug 6 08:08 neatvi-12/Makefile [generic] 1548 5333 29.0% -lh5- 1d16 Aug 6 08:08 neatvi-12/mot.c [generic] 2228 5074 43.9% -lh5- c4d8 Aug 6 08:08 neatvi-12/README [generic] 382 816 46.8% -lh5- f855 Aug 6 08:08 neatvi-12/reg.c [generic] 3908 13827 28.3% -lh5- d849 Aug 6 08:08 neatvi-12/regex.c [generic] 236 481 49.1% -lh5- 937b Aug 6 08:08 neatvi-12/regex.h [generic] 1120 3628 30.9% -lh5- 8889 Aug 6 08:08 neatvi-12/ren.c [generic] 1220 3355 36.4% -lh5- 9c3e Aug 6 08:08 neatvi-12/rset.c [generic] 957 2419 39.6% -lh5- 8cac Aug 6 08:08 neatvi-12/rstr.c [generic] 657 1724 38.1% -lh5- 77e7 Aug 6 08:08 neatvi-12/sbuf.c [generic] 811 1716 47.3% -lh5- 472a Aug 6 08:08 neatvi-12/stag.c [generic] 966 2488 38.8% -lh5- a0cc Aug 6 08:08 neatvi-12/syn.c [generic] 633 1425 44.4% -lh5- 0ecb Aug 6 08:08 neatvi-12/tag.c [generic] 1521 4107 37.0% -lh5- 386f Aug 6 08:08 neatvi-12/term.c [generic] 210 368 57.1% -lh5- 162c Aug 6 08:08 neatvi-12/test.sh [generic] 92 162 56.8% -lh5- 221c Aug 6 08:08 neatvi-12/test/e0a.sh [generic] 109 259 42.1% -lh5- 9062 Aug 6 08:08 neatvi-12/test/e0b.sh [generic] 115 341 33.7% -lh5- 2ade Aug 6 08:08 neatvi-12/test/e0c.sh [generic] 119 310 38.4% -lh5- c4cb Aug 6 08:08 neatvi-12/test/e0d.sh [generic] 117 202 57.9% -lh5- 1dfa Aug 6 08:08 neatvi-12/test/e0e.sh [generic] 99 187 52.9% -lh5- b511 Aug 6 08:08 neatvi-12/test/e0f.sh [generic] 43 43 100.0% -lh0- 80b0 Aug 6 08:08 neatvi-12/test/e00.sh [generic] 82 131 62.6% -lh5- 7052 Aug 6 08:08 neatvi-12/test/e01.sh [generic] 93 184 50.5% -lh5- b0d3 Aug 6 08:08 neatvi-12/test/e02.sh [generic] 86 191 45.0% -lh5- 1ba7 Aug 6 08:08 neatvi-12/test/e03.sh [generic] 104 241 43.2% -lh5- 975c Aug 6 08:08 neatvi-12/test/e04.sh [generic] 98 212 46.2% -lh5- 7dab Aug 6 08:08 neatvi-12/test/e05.sh [generic] 110 271 40.6% -lh5- 0fe5 Aug 6 08:08 neatvi-12/test/e06.sh [generic] 119 289 41.2% -lh5- bebb Aug 6 08:08 neatvi-12/test/e07.sh [generic] 115 198 58.1% -lh5- f223 Aug 6 08:08 neatvi-12/test/e08.sh [generic] 98 172 57.0% -lh5- d0d3 Aug 6 08:08 neatvi-12/test/e09.sh [generic] 105 197 53.3% -lh5- 382c Aug 6 08:08 neatvi-12/test/e10.sh [generic] 96 183 52.5% -lh5- 2e1a Aug 6 08:08 neatvi-12/test/e11.sh [generic] 106 239 44.4% -lh5- 0ee4 Aug 6 08:08 neatvi-12/test/e12.sh [generic] 120 213 56.3% -lh5- bec8 Aug 6 08:08 neatvi-12/test/v0a.sh [generic] 118 236 50.0% -lh5- 2808 Aug 6 08:08 neatvi-12/test/v0b.sh [generic] 108 186 58.1% -lh5- 5bf5 Aug 6 08:08 neatvi-12/test/v0c.sh [generic] 114 178 64.0% -lh5- 0152 Aug 6 08:08 neatvi-12/test/v0d.sh [generic] 133 250 53.2% -lh5- d3bb Aug 6 08:08 neatvi-12/test/v0e.sh [generic] 112 191 58.6% -lh5- 2a25 Aug 6 08:08 neatvi-12/test/v0f.sh [generic] 92 123 74.8% -lh5- d3af Aug 6 08:08 neatvi-12/test/v00.sh [generic] 109 165 66.1% -lh5- 5170 Aug 6 08:08 neatvi-12/test/v01.sh [generic] 123 214 57.5% -lh5- 8be0 Aug 6 08:08 neatvi-12/test/v02.sh [generic] 97 145 66.9% -lh5- a3d2 Aug 6 08:08 neatvi-12/test/v03.sh [generic] 133 212 62.7% -lh5- 91d5 Aug 6 08:08 neatvi-12/test/v04.sh [generic] 113 172 65.7% -lh5- 8c93 Aug 6 08:08 neatvi-12/test/v05.sh [generic] 131 238 55.0% -lh5- 5e71 Aug 6 08:08 neatvi-12/test/v06.sh [generic] 107 208 51.4% -lh5- 567b Aug 6 08:08 neatvi-12/test/v07.sh [generic] 99 168 58.9% -lh5- 76e1 Aug 6 08:08 neatvi-12/test/v08.sh [generic] 114 197 57.9% -lh5- ec6d Aug 6 08:08 neatvi-12/test/v09.sh [generic] 108 183 59.0% -lh5- 1efa Aug 6 08:08 neatvi-12/test/v1a.sh [generic] 100 171 58.5% -lh5- 1752 Aug 6 08:08 neatvi-12/test/v1b.sh [generic] 111 196 56.6% -lh5- fa8d Aug 6 08:08 neatvi-12/test/v1c.sh [generic] 94 154 61.0% -lh5- 636e Aug 6 08:08 neatvi-12/test/v1d.sh [generic] 107 181 59.1% -lh5- aa4b Aug 6 08:08 neatvi-12/test/v1e.sh [generic] 96 153 62.7% -lh5- ae03 Aug 6 08:08 neatvi-12/test/v1f.sh [generic] 122 249 49.0% -lh5- bffa Aug 6 08:08 neatvi-12/test/v10.sh [generic] 119 214 55.6% -lh5- 7a57 Aug 6 08:08 neatvi-12/test/v11.sh [generic] 115 223 51.6% -lh5- 6424 Aug 6 08:08 neatvi-12/test/v12.sh [generic] 140 276 50.7% -lh5- 5e9f Aug 6 08:08 neatvi-12/test/v13.sh [generic] 123 219 56.2% -lh5- f120 Aug 6 08:08 neatvi-12/test/v14.sh [generic] 109 201 54.2% -lh5- 8620 Aug 6 08:08 neatvi-12/test/v15.sh [generic] 120 275 43.6% -lh5- 418f Aug 6 08:08 neatvi-12/test/v16.sh [generic] 113 227 49.8% -lh5- f085 Aug 6 08:08 neatvi-12/test/v17.sh [generic] 91 148 61.5% -lh5- 3edd Aug 6 08:08 neatvi-12/test/v18.sh [generic] 99 180 55.0% -lh5- 0c56 Aug 6 08:08 neatvi-12/test/v19.sh [generic] 96 168 57.1% -lh5- 8146 Aug 6 08:08 neatvi-12/test/v20.sh [generic] 86 147 58.5% -lh5- a2aa Aug 6 08:08 neatvi-12/test/v21.sh [generic] 96 217 44.2% -lh5- a6eb Aug 6 08:08 neatvi-12/test/v22.sh [generic] 112 269 41.6% -lh5- b5ca Aug 6 08:08 neatvi-12/test/v23.sh [generic] 6806 21648 31.4% -lh5- dd61 Aug 6 08:08 neatvi-12/uc.c [generic] 9489 35428 26.8% -lh5- 524e Aug 6 08:08 neatvi-12/vi.c [generic] 2016 7016 28.7% -lh5- 1bd5 Aug 6 08:08 neatvi-12/vi.h [generic] 64710 145732 44.4% -lh5- 36b1 Oct 27 22:19 neatvi-12/vi [generic] 8914 18760 47.5% -lh5- 5e54 Oct 27 22:28 neatvi-12/stag ---------- ----------- ------- ------- ------ ---------- ------------ ---------- Total 83 files 134894 352208 38.3% Oct 28 04:11
Aminet © 1992-2023 Urban Müller and the Aminet team. Aminet contact address: <aminet aminet net>