diff options
| -rw-r--r-- | README.md | 47 | ||||
| -rw-r--r-- | init.lua | 4 |
2 files changed, 48 insertions, 3 deletions
@@ -6,4 +6,49 @@ modal is a status line colorizer for vis -right now, it's very opinionated, but I will eventually add the ability to customize it
\ No newline at end of file +# Installation +To install vis-modal, clone this repository in your `~/.config/vis/plugins/` directory +Then, you can use it with the default configuration by putting this into your `~/.config/vis/visrc.lua`: +``` +local modal = require('plugins/modal') +``` + +# Customization +You can change the colors and mode descriptors in vis-modal to your liking, with this template: +``` +local modal = require('plugins/modal') +modal.MODES = { + [vis.modes.NORMAL] = ' NORMAL ', + [vis.modes.INSERT] = ' INSERT ', + [vis.modes.VISUAL] = ' VISUAL ', + [vis.modes.REPLACE] = ' REPLACE ', + [vis.modes.VISUAL_LINE] = ' VISUAL_LINE ', + [vis.modes.OPERATOR_PENDING] = ' OPERATOR_PENDING ' +} +modal.STYLES = { + [vis.modes.NORMAL] = { + REGULAR = 'fore:default,back:yellow', + INVERTED = 'fore:yellow,back:black', + }, + [vis.modes.INSERT] = { + REGULAR = 'fore:default,back:green', + INVERTED = 'fore:green,back:black', + }, + [vis.modes.VISUAL] = { + REGULAR = 'fore:default,back:magenta', + INVERTED = 'fore:magenta,back:black', + }, + [vis.modes.REPLACE] = { + REGULAR = 'fore:default,back:blue', + INVERTED = 'fore:blue,back:black', + }, + [vis.modes.VISUAL_LINE] = { + REGULAR = 'fore:default,back:magenta', + INVERTED = 'fore:magenta,back:black', + }, + [vis.modes.OPERATOR_PENDING] = { + REGULAR = 'fore:default,back:blue', + INVERTED = 'fore:blue,back:black', + }, +} +``` @@ -67,10 +67,10 @@ vis.events.subscribe(vis.events.WIN_STATUS, function(win) cursors = 0 for _ in win:selections_iterator() do cursors = cursors+1 end selection_size = "SELECTION_SIZE: ".. - win.selection.range.finish-win.selection.range.start + win.selection.range.finish - win.selection.range.start cursor_amount = "CURSORS: "..cursors cursor_pos = win.selection.line..":"..win.selection.col - status_right = selection_size.." | "..cursor_amount.." @ "..cursor_pos + status_right = selection_size.." | "..cursor_amount.." | "..cursor_pos win:status(status_left, status_right) |
