1 .Dd $Mdocdate: September 28 2016 $
7 .Nd a command line completion backend for iomenu
21 is a highly efficient vim like text editor.
24 Print version information and exit.
27 Denotes the end of the options. Arguments after this will be handled as a
33 Vis implements more or less functional normal, operator-pending, insert,
34 replace and visual (in both line and character wise variants) modes.
36 Visual block mode is not implemented and there exists no immediate plan
37 to do so. Instead vis has built in support for multiple cursors.
39 Command mode is implemented as a regular file. Use the full power of
40 the editor to edit your commands / search terms.
42 Ex mode is deliberately not implemented, instead a variant of the
43 structural regular expression based command language of `sam(1)`
46 .Ss Undo/Redo and Repeat
48 The text is currently snapshotted whenever an operator is completed as
49 well as when insert or replace mode is left. Additionally a snapshot is
50 also taken if in insert or replace mode a certain idle time elapses.
52 Another idea is to snapshot based on the distance between two consecutive
53 editing operations (as they are likely unrelated and thus should be
54 individually reversible).
56 Besides the regular undo functionality, the key bindings
60 traverse the history in chronological order. Further more the
64 commands provide means to restore the text to an arbitrary
69 works for all operators and is able to repeat
70 the last insertion or replacement.
72 .Ss Tab <-> Space conversion and Line endings \n vs \r\n
74 Tabs can optionally be expanded to a configurable number of spaces.
75 The first line ending in the file determines what will be inserted upon
76 a line break (defaults to \n).
78 .Ss Jump list and change list
80 A per window, file local jump list (navigate with `CTRL+O` and `CTRL+I`)
81 and change list (navigate with `g;` and `g,`) is supported. The jump
82 list is implemented as a fixed sized ring buffer.
86 The general purpose registers
88 can be used to record macros. Use
91 to append to an existing macro.
97 refers to the least recently recorded macro.
99 repeats the last :-command.
105 .Ss Structural Regular Expression based Command Language
110 structural regular expression based command language.
130 indent, currently an alias for gq
167 previous start of a word
170 previous start of a WORD
182 to next occurrence of char to the left
185 to next occurrence of char to the right
188 first non-blank of line
191 begin of display line
197 previous end of a word
200 previous end of a WORD
206 goto line or end of file
215 last non-blank of line
218 middle of display line
227 goto top/home line of window
239 goto bottom/last line of window
245 go to start of line containing mark
251 goto middle line of window
254 next end of C-like function
263 next start of C-like function
266 repeat last search backwards
269 repeat last search forward
272 previous end of C-like function
275 previous start of block
281 previous start of parenthese pair
284 next start of parenthese pair
293 previous start of C-like function
296 repeat last to/till movement
299 repeat last to/till movement but in opposite direction
302 search word under cursor backwards
305 search word under cursor forwards
308 till before next occurrence of char to the left
311 till before next occurrence of char to the right
314 to next match of text in backward direction
317 to next match of text in forward direction
326 An empty line is currently neither a word nor a WORD.
328 Some of these commands do not work as in vim when prefixed with a
329 digit i.e. a multiplier. As an example in vim
332 of the 3rd line down. However vis treats it as a move to the end of
333 current line which is repeated 3 times where the last two have no
338 All of the following text objects are implemented in an inner variant
340 .Ql i`) and a normal variant (prefixed with
356 .It [,], (,), {,}, <,>, ", ', `
357 block enclosed by these symbols
360 For sentence and paragraph there is no difference between the inner and
365 matches the last used search term in forward direction
368 matches the last used search term in backward direction
371 Additionally the following text objects, which are not part of stock
372 vim are also supported:
379 entire file content except for leading and trailing empty lines
382 C-like function definition including immediately preceding comments
385 C-like function definition only function body
391 current line without leading and trailing white spaces
394 .Ss Multiple Cursors / Selections
397 supports multiple cursors with immediate visual feedback (unlike in the
398 visual block mode of vim where for example inserts only become visible
399 upon exit). There always exists one primary cursor located within the
400 current view port. Additional cursors ones can be created as needed. If
401 more than one cursor exists, the primary one is styled differently
404 To manipulate multiple cursors use in normal mode:
408 create count new cursors on the lines above
411 create count new cursors on the lines above the first cursor
414 create count new cursors on the lines below
417 create count new cursors on the lines below the last cursor
420 remove primary cursor
423 select word the cursor is currently over, switch to visual mode
426 make the count previous cursor primary
429 make the count next cursor primary
432 remove the count cursor column
435 remove all but the count cursor column
438 try to align all cursor on the same column
441 dispose all but the primary cursor
444 Visual mode was enhanced to recognize:
448 create a cursor at the start of every selected line
451 create a cursor at the end of every selected line
454 left align selections by inserting spaces
457 right align selections by inserting spaces
460 create new cursor and select next word matching current selection
463 clear (skip) current selection, but select next matching word
466 remove primary cursor
469 make the count previous cursor primary
472 make the count next cursor primary
475 remove the count cursor column
478 remove all but the count cursor column
481 rotates selections rightwards count times
484 rotates selections leftwards count times
487 trim selections, remove leading and trailing white space
490 clear all selections, switch to normal mode
493 In insert/replace mode:
497 align all cursors by inserting spaces
505 general purpose marks
508 start of the last selected visual area in current buffer
511 end of the last selected visual area in current buffer
516 Supported registers include:
520 general purpose registers
523 append to corresponding general purpose register
526 "+ system clipboard integration via shell script vis-clipboard
538 black hole (/dev/null) register
541 If no explicit register is specified a default register is used.
546 Besides the sam command language the following commands are also recognized at
547 the `:`-command prompt. Any unique prefix can be used.
550 close all windows which display the same file as the current one
552 revert to older text state
554 replace current file with a new one or reload it from disk
556 set key equivalents for layout specific key mappings
558 revert to newer text state
560 launch external command, redirect keyboard input to it
562 add a global key mapping
564 add a window local key mapping
566 open an empty window, arrange horizontally
570 close all windows, exit editor
572 close currently focused window
575 insert content of another file at current cursor position
578 set the options below
581 split window horizontally
584 search and replace currently implemented in terms of `sed(1)`
587 remove a global key mapping
590 remove a window local key mapping
593 open an empty window, arrange vertically
596 split window vertically
599 write changes then close window
602 write current buffer content to file
604 .It tabwidth [1-8] default 8
605 set display width of a tab and number of spaces to use if expandtab is enabled
607 .It expandtab (yes|no) default no
608 whether typed in tabs should be expanded to tabwidth spaces
610 .It autoindent (yes|no) default no
611 replicate spaces and tabs at the beginning of the line when
613 .It number (yes|no) default no
615 .It relativenumber (yes|no) default no
616 whether absolute or relative line numbers are printed alongside
618 .It syntax name default yes
619 use syntax definition given (e.g. "c") or disable syntax
622 show/hide special white space replacement symbols
626 newlines = [0|1] default 0
629 tabs = [0|1] default 0
632 spaces = [0|1] default 0
635 .It cursorline (yes|no) default no
636 highlight the line on which the cursor currently resides
638 .It colorcolumn number default 0
639 highlight the given column
641 .It horizon number default 32768 (32K)
642 how far back the lexer will look to synchronize parsing
644 .It theme name default dark-16.lua | solarized.lua (16 | 256 color)
645 use the given theme / color scheme for syntax highlighting
648 Commands taking a file name will use a simple file open dialog based on
649 the included `vis-open` shell script and `vis-menu` utility, if given
650 a file pattern or directory.
652 opens a menu with all C files
654 opens a menu with all files of the current directory
656 .Ss Runtime Configurable Key Bindings
658 Vis supports run time key bindings via the
659 .Ic :{un,}map{,-window}
660 set of commands. The basic syntax is
661 .Ic :map <mode> <lhs> <rhs>
676 refers to the key to map,
678 is a key action or alias. An existing mapping can be overridden by appending
682 Key mappings are always recursive, this means doing something like
683 .Ic :map! normal j 2j
684 will not work because it will enter an endless loop. Instead vis uses
685 pseudo keys referred to as key actions which can be used to invoke a set
690 for a list) editor functions. Hence the correct thing to do would be
691 .Ic :map! normal j 2<cursor-line-down>
693 Unmapping works as follows:
694 .Ic :unmap <mode> <lhs>
696 The commands suffixed with `-window` only affect the currently active window.
698 .Ss Layout Specific Key Bindings
700 Vis allows to set key equivalents for non-latin keyboard layouts. This
701 facilitates editing non-latin texts. The defined mappings take effect
702 in all non-input modes, i.e. everywhere except in insert and replace mode.
704 For example, the following maps the movement keys in Russian layout:
705 .Ic :langmap ролд hjkl
707 More generally the syntax of the `:langmap` command is:
708 .Ic :langmap <keys in your layout> <equivalent keys in latin layout>
710 If the key sequences have not the same length, the rest of the longer
711 sequence will be discarded.
713 .Ss Runtime Configurable Key Bindings
715 Vis supports run time key bindings via the
716 .Ic :{un,}map{,-window}
717 set of commands. The basic syntax is
718 .Ic :map <mode> <lhs> <rhs>
733 refers to the key to map,
735 is a key action or alias. An existing mapping can be overridden by appending
739 Key mappings are always recursive, this means doing something like
740 .Ic :map! normal j 2j
741 will not work because it will enter an endless loop. Instead vis uses
742 pseudo keys referred to as key actions which can be used to invoke a set
747 for a list) editor functions. Hence the correct thing to do would be
748 .Ic :map! normal j 2<cursor-line-down>
750 Unmapping works as follows:
751 .Ic :unmap <mode> <lhs>
753 The commands suffixed with `-window` only affect the currently active window.
755 .Ss Layout Specific Key Bindings
757 Vis allows to set key equivalents for non-latin keyboard layouts. This
758 facilitates editing non-latin texts. The defined mappings take effect
759 in all non-input modes, i.e. everywhere except in insert and replace mode.
761 For example, the following maps the movement keys in Russian layout:
762 .Ic :langmap ролд hjkl
764 More generally the syntax of the `:langmap` command is:
765 .Ic :langmap <keys in your layout> <equivalent keys in latin layout>
767 If the key sequences have not the same length, the rest of the longer
768 sequence will be discarded.
774 Override path to look for Lua support files as used for syntax highlighting.
775 Defaults (in this order) to:
779 The location of the vis binary
782 .Pa $XDG_CONFIG_HOME/vis
790 .Pa /usr/local/share/vis
796 Override syntax highlighting theme to use.
802 Settings and keymaps can be specified in a
807 at runtime. An example
810 .Pa /usr/local/share/vis
811 by default. This file can be copied to
812 .Pa $XDG_CONFIG_HOME/vis
814 .Pa $HOME/.config/vis
815 ) for further configuration.
817 The environment variable
819 can be set to override the path that
821 will look for Lua support files as used for syntax highlighting.
823 defaults (in this order) to:
832 .Pa $XDG_CONFIG_HOME/vis
840 .Pa /usr/local/share/vis
846 The environment variable
848 can be set to specify the theme used by
852 VIS_THEME=/path/to/your/theme.lua
867 .An Marc André Tanner Aq mat at brain-dump.org