├── README.adoc ├── visplugs.adoc ├── vis ├── themes │ ├── plain.lua │ └── quiet.lua └── visrc.lua └── visplugsetup /README.adoc: -------------------------------------------------------------------------------- 1 | = vis editor configuration 2 | 3 | For the `vis` subdirectory under `~/.config`. 4 | 5 | Link and/or copy everything or individual files as needed. 6 | -------------------------------------------------------------------------------- /visplugs.adoc: -------------------------------------------------------------------------------- 1 | // last modified 2025-04-20 vi:ul=0xabc 2 | // github.com/erf/vis-minimal-theme 3 | // github.com/rokf/vis-themes 4 | // gitlab.com/mcepl/vis-jump 5 | // repo.or.cz/vis-surround 6 | github.com/erf/vis-cursors 7 | github.com/jpaulogg/vis-ins-completion 8 | github.com/lutobler/vis-commentary 9 | github.com/roguh/vis-copypasta 10 | repo.or.cz/vis-quickfix 11 | -------------------------------------------------------------------------------- /vis/themes/plain.lua: -------------------------------------------------------------------------------- 1 | -- last modified 2025-06-11 2 | -- created 2025-04-19 3 | -- Dorai Sitaram 4 | 5 | local lexers = vis.lexers 6 | 7 | lexers.STYLE_ATTRIBUTE = '' 8 | lexers.STYLE_CLASS = '' 9 | lexers.STYLE_COMMENT = '' 10 | lexers.STYLE_CONSTANT = '' 11 | lexers.STYLE_FUNCTION = '' 12 | lexers.STYLE_HEADING = '' 13 | lexers.STYLE_KEYWORD = '' 14 | lexers.STYLE_LABEL = '' 15 | lexers.STYLE_NUMBER = '' 16 | lexers.STYLE_OPERATOR = '' 17 | lexers.STYLE_PREPROCESSOR = '' 18 | lexers.STYLE_REGEX = '' 19 | lexers.STYLE_STRING = '' 20 | lexers.STYLE_TYPE = '' 21 | 22 | lexers.STYLE_COLOR_COLUMN = '' 23 | lexers.STYLE_CURSOR = 'fore:#dddddd,back:#0055ff' 24 | lexers.STYLE_CURSOR_LINE = 'fore:gray63,back:gray23' 25 | lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR 26 | lexers.STYLE_INFO = '' 27 | lexers.STYLE_LINENUMBER = 'fore:#222222' 28 | lexers.STYLE_LINENUMBER_CURSOR = lexers.STYLE_LINENUMBER 29 | lexers.STYLE_SELECTION = 'fore:black,back:white' 30 | lexers.STYLE_STATUS = 'fore:#6b6b6b,back:#242424' 31 | lexers.STYLE_STATUS_FOCUSED = lexers.STYLE_STATUS 32 | 33 | lexers.STYLE_EOF = lexers.STYLE_LINENUMBER 34 | 35 | lexers.STYLE_LINK = '' 36 | lexers.STYLE_LIST = '' 37 | lexers.STYLE_CODE = '' 38 | -------------------------------------------------------------------------------- /visplugsetup: -------------------------------------------------------------------------------- 1 | # last modified 2025-06-12 2 | # created 2025-04-19 3 | 4 | packagedir=~/.config/vis/plugins 5 | 6 | mkdir -p $packagedir 7 | 8 | cd $packagedir 9 | 10 | function pullhosthook() { 11 | local dir=$1 12 | if test "$dir" = 'vis-commentary'; then 13 | sed -i \ 14 | -e 's/^local \(comment_string\)/\1/' \ 15 | -e 's/comment_string/vis.\0/g' \ 16 | -e 's/^-- escape all/\nvis.comment_string.asciidoc = "\/\/"\nvis.comment_string.pyret = "#"\n\n\0/' \ 17 | init.lua 18 | fi 19 | if test "$dir" = 'vis-copypasta'; then 20 | cp -p copypasta.lua init.lua 21 | fi 22 | if test "$dir" = 'vis-ins-completion'; then 23 | sed -i \ 24 | -e 's/\(dirname =\).*/\1 "\/usr\/share\/dict\/"/' \ 25 | -e 's/\(local syntax =\).*/\1 "words"/' \ 26 | complete-dict.lua 27 | fi 28 | if test "$dir" = 'vis-quickfix'; then 29 | sed -i \ 30 | -e 's/\(grepprg =\).*/\1 "grep -HIns --exclude-dir={.git,node_modules}",/' \ 31 | init.lua 32 | fi 33 | } 34 | 35 | function installplugin() { 36 | local f=$1 37 | fb=${f##*/} 38 | if test -d $fb; then 39 | echo -n 📦 $f '' 40 | cd $fb 41 | git checkout -- \* 42 | git pull 43 | else 44 | git clone https://$f 45 | cd $fb 46 | fi 47 | pullhosthook $fb 48 | cd .. 49 | echo --------------------------- 50 | } 51 | 52 | function installpluginlist() { 53 | local L=$1 54 | for f in $(grep -v '^\(//\|;\)' $L); do 55 | installplugin $f 56 | done 57 | } 58 | 59 | installpluginlist ~/src/visrc/visplugs.adoc 60 | -------------------------------------------------------------------------------- /vis/visrc.lua: -------------------------------------------------------------------------------- 1 | -- last modified 2025-06-12 2 | -- created 2025-04-18 3 | 4 | require('vis') 5 | 6 | vis.ftdetect.filetypes.pyret = { 7 | ext = { '%.arr$' }, 8 | } 9 | 10 | require('plugins/vis-commentary') 11 | require('plugins/vis-copypasta') 12 | require('plugins/vis-cursors') 13 | require('plugins/vis-ins-completion') 14 | require('plugins/vis-quickfix') 15 | 16 | -- require('plugins/vis-surround') 17 | 18 | vis.events.subscribe(vis.events.INIT, function() 19 | require('themes/plain') 20 | -- require('plugins/darkest-space') 21 | -- require('plugins/oil6') 22 | -- require('plugins/vis-minimal-theme/minimal-clear') 23 | -- require('themes/solarized') 24 | end) 25 | 26 | vis.events.subscribe(vis.events.WIN_OPEN, function() 27 | vis.win.options.tabwidth = 2 28 | vis:command('set expandtab') 29 | vis:command('set ignorecase') 30 | vis:command('set number') 31 | -- vis.win.options.expandtab = true 32 | -- vis.win.options.ignorecase = true 33 | -- vis.win.options.number = true 34 | end) 35 | 36 | vis:map(vis.modes.INSERT, 'jj', function() 37 | vis.mode = vis.modes.NORMAL 38 | end) 39 | 40 | -- from vis api doc 41 | vis:operator_new('gq', function(file, range) 42 | local ideal_text_width = 66 43 | local status, out, err = vis:pipe(file, range, 44 | 'fmt -w ' .. ideal_text_width .. ' | sed -e "s/\\(\\S\\)\\s\\+/\\1 /g"') 45 | if status ~= 0 then 46 | vis:info(err) 47 | else 48 | file:delete(range) 49 | file:insert(range.start, out) 50 | end 51 | return range.start -- new cursor location 52 | end, 'format paragraphs') 53 | 54 | vis.events.subscribe(vis.events.FILE_SAVE_POST, function(_, path) 55 | local pos = vis.win.selection.pos 56 | os.execute('vidatestamp ' .. path) 57 | vis:command('e!') 58 | vis.win.selection.pos = pos 59 | return true 60 | end) 61 | -------------------------------------------------------------------------------- /vis/themes/quiet.lua: -------------------------------------------------------------------------------- 1 | -- last modified 2025-04-22 2 | -- created 2025-04-19 3 | -- Dorai Sitaram 4 | 5 | local lexers = vis.lexers 6 | 7 | -- lexers.STYLE_DEFAULT = 'fore:#b5b5b5,back:#1c1c1c' 8 | -- lexers.STYLE_DEFAULT = 'fore:#a5a5a5,back:#1c1c1c' 9 | -- lexers.STYLE_DEFAULT = 'fore:#a5a5a5,back:#00000000' 10 | lexers.STYLE_DEFAULT = 'fore:#959595' 11 | -- lexers.STYLE_LINENUMBER = 'fore:#666666' 12 | lexers.STYLE_LINENUMBER = 'fore:#222222' 13 | -- lexers.STYLE_CURSOR = 'back:#888888' 14 | lexers.STYLE_CURSOR = 'fore:black,back:#888888' 15 | lexers.STYLE_SELECTION = 'fore:black,back:white' 16 | lexers.STYLE_STATUS = 'fore:#6b6b6b,back:#242424' 17 | lexers.STYLE_STRING = 'fore:#80b080' 18 | lexers.STYLE_COMMENT = 'fore:#8c8c8c,back:#262626' 19 | 20 | lexers.STYLE_ATTRIBUTE = '' 21 | lexers.STYLE_CLASS = '' 22 | lexers.STYLE_CONSTANT = '' 23 | -- lexers.STYLE_DEFINITION = '' 24 | -- lexers.STYLE_EMBEDDED = '' 25 | -- lexers.STYLE_ERROR = '' 26 | lexers.STYLE_FUNCTION = '' 27 | lexers.STYLE_HEADING = lexers.STYLE_STRING 28 | -- lexers.STYLE_IDENTIFIER = '' 29 | lexers.STYLE_KEYWORD = '' 30 | lexers.STYLE_LABEL = '' 31 | lexers.STYLE_NUMBER = '' 32 | lexers.STYLE_OPERATOR = '' 33 | lexers.STYLE_PREPROCESSOR = lexers.STYLE_STRING 34 | lexers.STYLE_REGEX = '' 35 | -- lexers.STYLE_TAG = '' 36 | lexers.STYLE_TYPE = '' 37 | -- lexers.STYLE_VARIABLE = '' 38 | -- lexers.STYLE_WHITESPACE = '' 39 | 40 | lexers.STYLE_LINENUMBER_CURSOR = lexers.STYLE_LINENUMBER 41 | lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR 42 | -- lexers.STYLE_CURSOR_PRIMARY = 'fore:white,back:#0000c0,bold' 43 | -- lexers.STYLE_CURSOR_LINE = 'back:#444444' 44 | -- lexers.STYLE_CURSOR_LINE = 'fore:black,back:white' 45 | lexers.STYLE_CURSOR_LINE = lexers.STYLE_STRING 46 | lexers.STYLE_COLOR_COLUMN = lexers.STYLE_COMMENT 47 | lexers.STYLE_STATUS_FOCUSED = lexers.STYLE_STATUS 48 | -- lexers.STYLE_SEPARATOR = '' 49 | -- lexers.STYLE_INFO = '' 50 | lexers.STYLE_EOF = lexers.STYLE_LINENUMBER 51 | 52 | lexers.STYLE_LINK = '' 53 | lexers.STYLE_LIST = '' 54 | lexers.STYLE_CODE = lexers.STYLE_STRING 55 | --------------------------------------------------------------------------------