Skip to content
TmpFinger1 edited this page Dec 14, 2019 · 13 revisions

A list of community-provided patches.

  • smartcase and literal search options
    A sample setup, where / searches for fixed strings, g/ - for regular expressions:
    vis.events.subscribe(vis.events.INIT, function()
       vis:command'set smartcase on'
        vis:map(vis.modes.NORMAL, '/', function() vis:command'set literal on' vis:feedkeys'<vis-search-forward>' end)
        vis:map(vis.modes.NORMAL, 'g/', function() vis:command'set literal off' vis:feedkeys'<vis-search-forward>' end)
    end)
  • operator to add cursors on each line of a textobject/motion
    It's mapped to <C-v> by default, as, at least in some cases, it resembles visual block mode in vim.

insertline cursorline only in insert mode

There is currently a bug where the cursorline gets removed to late after switching modes see issue #767

This patch will allow you to only show the cursor line while in insert mode, this will help you see when you are in insert mode without having to look at the bottom left of your screen

visrc.lua
vis:command('set cursorline on')
diff --git a/vis.c b/vis.c
index 03b01ab..e896685 100644
--- a/vis.c
+++ b/vis.c
@@ -311,6 +311,8 @@ static void window_draw_cursorline(Win *win) {
 		return;
 	if (view_selections_count(view) > 1)
 		return;
+	if (vis->mode->id != VIS_MODE_INSERT)
+		return;
 
 	int width = view_width_get(view);
  	CellStyle style = win->ui->style_get(win->ui, UI_STYLE_CURSOR_LINE);
Clone this wiki locally