Giter Club home page Giter Club logo

beacon.nvim's Introduction

Beacon.nvim - see your cursor jump

Whenever cursor jumps some distance or moves between windows, it will flash so you can see where it is. This plugin is heavily inspired by emacs package beacon.

Note: required versions neovim v0.4+ or vim v8.2+. Working on support for older versions.

example.gif

Installation

  1. Add the following configuration to your .vimrc.

     Plug 'danilamihailov/beacon.nvim'
    
  2. Install with :PlugInstall.

Or use your favorite plugin manager

Customization

Disable beacon

Just set

let g:beacon_enable = 0

and beacon will be disabled, but you still can use :Beacon command to highlight cursor. See commands.

Changing color

Beacon is highlighted by Beacon group, so you can change it like this:

highlight Beacon guibg=white ctermbg=15

use guibg if you have termguicolors enabled, otherwise use ctermbg.

Changing beacon size

let g:beacon_size = 40

When to show beacon

If you only want to see beacon when cursor changes windows, you can set

let g:beacon_show_jumps = 0

and it will ignore jumps inside buffer. By default shows all jumps.

You can change what beacon considers significant jump, by changing

let g:beacon_minimal_jump = 10

Animation

You can disable shrinking animation by setting

let g:beacon_shrink = 0

enabled by default

You can disable fading animation by setting (neovim only)

let g:beacon_fade = 0

enabled by default.

You can set g:beacon_timeout to hide beacon early, by default it set to 500ms.

Ignoring buffers

To ignore a buffer you can set list of regexes

g:beacon_ignore_buffers = [\w*git*\w]

Ignoring filetypes

To ignore filetypes you can set list of filetypes

g:beacon_ignore_filetypes = ['fzf']

Commands

There is 4 commands available.

  • :Beacon highlight current position (even if plugin is disabled)
  • :BeaconToggle toggle g:beacon_enable variable
  • :BeaconOn enable Beacon
  • :BeaconOff disable Beacon

Tips

If you want cursor to be highlighted when you jump to searches with n/N regardless of distance, use this mappings

nmap n n:Beacon<cr>
nmap N N:Beacon<cr>
nmap * *:Beacon<cr>
nmap # #:Beacon<cr>

Hide cursor line on inactive windows

augroup MyCursorLineGroup
    autocmd!
    au WinEnter * setlocal cursorline
    au WinLeave * setlocal nocursorline
augroup end

Similar plugins

How it works

Whenever plugin detects some kind of a jump, it's showing floating window at the cursor position and using winblend fades window out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.