Skip to content

Highlight cursor and visual selections in current buffer when entering command mode.

License

Notifications You must be signed in to change notification settings

moyiz/command-and-cursor.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

command-and-cursor.nvim

Highlight cursor and visual selections when entering command mode (experimental).

Demo

command-and-cursor-2024-04-18_13.31.53.webm

Features

  • Highlight cursor in active buffer when entering command mode (:/?).
  • Highlight visual selections and include cursor location by default (inclusive).
  • Highlight initial visual selection prior to its expansion with incremental search.
  • Configure highlight group.

Motivation

  • In normal mode, cursor "disappears" from buffer when entering cmdline.
  • Visual selection highlight is not inclusive (cursor).
  • Visual selection highlight might be too subtle in a colorful "big" terminal.
  • When expanding a visual selection with incremental search, there is no indication of the original selection.

Installation

Use your favorite plugin manager:

Lazy

{
  "moyiz/command-and-cursor.nvim",
  event = "VeryLazy",
  opts = {},
}

Options

M.defaults = {
  hl_group = "TermCursor", -- The highlight group to use.
  hl_priority = 300,       -- Priority of highlight
  inclusive = true,        -- Highlight cursor with visual selection.
  debug_position = false,  -- Show start and end positions with `vim.notify`.
}

License

See LICENSE.

About

Highlight cursor and visual selections in current buffer when entering command mode.

Topics

Resources

License

Stars

Watchers

Forks

Languages