All Projects → inside → Vim Search Pulse

inside / Vim Search Pulse

Easily locate the cursor after a search

Projects that are alternatives of or similar to Vim Search Pulse

Vim Follow My Lead
Vim plugin for showing all your <Leader> mappings in a readable table including the descriptions.
Stars: ✭ 100 (+9.89%)
Mutual labels:  viml, vim-plugins
Vim Packager
Vim plugin manager that utilizes "jobs" and "pack" features.
Stars: ✭ 197 (+116.48%)
Mutual labels:  viml, vim-plugins
Vim Todo Lists
Vim plugin for TODO lists
Stars: ✭ 126 (+38.46%)
Mutual labels:  viml, vim-plugins
Vim Ruby Minitest
Vim highlighting & completion for MiniTest
Stars: ✭ 97 (+6.59%)
Mutual labels:  viml, vim-plugins
Pear Tree
A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
Stars: ✭ 327 (+259.34%)
Mutual labels:  viml, vim-plugins
Vim Operator User
Vim plugin: Define your own operator easily
Stars: ✭ 161 (+76.92%)
Mutual labels:  viml, vim-plugins
Stackanswers.vim
Vim plugin to fetch and display answers from Stack Overflow
Stars: ✭ 165 (+81.32%)
Mutual labels:  viml, vim-plugins
Vifm.vim
Vim plugin that allows use of vifm as a file picker
Stars: ✭ 197 (+116.48%)
Mutual labels:  viml, vim-plugins
Vim Dadbod Ui
Simple UI for https://github.com/tpope/vim-dadbod
Stars: ✭ 315 (+246.15%)
Mutual labels:  viml, vim-plugins
Vim Go
Go development plugin for Vim
Stars: ✭ 14,085 (+15378.02%)
Mutual labels:  viml, vim-plugins
Vim Devicons
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
Stars: ✭ 4,473 (+4815.38%)
Mutual labels:  viml, vim-plugins
Winresizer
very simple vim plugin for easy resizing of your vim windows
Stars: ✭ 353 (+287.91%)
Mutual labels:  viml, vim-plugins
Vimcompletesme
You don't Complete Me; Vim Completes Me! A super simple, super minimal, super light-weight tab completion plugin for Vim.
Stars: ✭ 752 (+726.37%)
Mutual labels:  viml, vim-plugins
Omnisharp Vim
Vim omnicompletion (intellisense) and more for C#
Stars: ✭ 1,269 (+1294.51%)
Mutual labels:  vim-plugins
Auto Git Diff
A vim plugin which shows git diff for Git Rebase Interactive
Stars: ✭ 88 (-3.3%)
Mutual labels:  vim-plugins
Vim Prettier
A Vim plugin for Prettier
Stars: ✭ 1,268 (+1293.41%)
Mutual labels:  vim-plugins
Vim
Stars: ✭ 85 (-6.59%)
Mutual labels:  viml
Vim
我的VIM配置
Stars: ✭ 89 (-2.2%)
Mutual labels:  viml
Netrw.vim
Network oriented reading, writing, and browsing (keywords: netrw ftp scp)
Stars: ✭ 86 (-5.49%)
Mutual labels:  viml
Vim Jira Complete
AutoComplete JIRA issues in Vim
Stars: ✭ 85 (-6.59%)
Mutual labels:  viml

The vim search pulse plugin: easily locate the cursor after a search

Description

When you perform a search, the cursor jumps to the closest match. It's often hard to locate it's new position. With this plugin the cursor line (by default) or the search pattern will "pulse" thus requiring your eyes attention.

For the cursor line to be set only in the active window you may want to install this plugin: https://github.com/vim-scripts/CursorLineCurrentWindow

Activate the cursor line highlighing by putting set cursorline in your .vimrc file.

Cursor line pulse animation:

cursor line pulse

Pattern pulse animation:

pattern pulse

Installation

Use pathogen or a pathogen compatible plugin manager.

Configuration

Sets whether the cursor line pulses (default is cursor_line):

let g:vim_search_pulse_mode = 'cursor_line'

or just the search pattern:

let g:vim_search_pulse_mode = 'pattern'

If you want to set your own mappings, do:

let g:vim_search_pulse_disable_auto_mappings = 1

Otherwise the plugin will do the following for you:

nmap n n<Plug>Pulse
nmap N N<Plug>Pulse
nmap * *<Plug>Pulse
nmap # #<Plug>Pulse
" Pulses cursor line on first match
" when doing search with / or ?
cmap <silent> <expr> <enter> search_pulse#PulseFirst()

The pulse duration is 200 milliseconds by default. You can set your own using the following global variable. For example:

let g:vim_search_pulse_duration = 400

The colors used by the pulse are [237, 238, 239, 240, 241] (gray scale) by default. A color map can be found at: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html

You can set your own and as many as you want using the following global variable. For example (green scale):

let g:vim_search_pulse_color_list = [22, 28, 34, 40, 46]

If you are using gvim, these are the default colors:

`['#3a3a3a', '#444444', '#4e4e4e', '#585858', '#606060']`

To disable/enable set the value of g:vim_search_pulse_disable to 0 or 1

To execute arbitrary commands before and after pulse runs, use these autocmds:

autocmd User PrePulse
autocmd User PostPulse

For example, to turn on cursorcolumn during the pulse and then off right after:

augroup Pulse
    autocmd! User PrePulse
    autocmd! User PostPulse
    autocmd  User PrePulse  set cursorcolumn
    autocmd  User PostPulse set nocursorcolumn
augroup END

This functionality requires Vim 7.3.438 or newer.

Integration with the incsearch.vim plugin

incsearch.vim provides a very nice improved incremental searching. With a little configuration, it can work with the vim search pulse:

" incsearch and vim search pulse
let g:vim_search_pulse_disable_auto_mappings = 1
let g:incsearch#auto_nohlsearch = 1
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)

" Next or previous match is followed by a Pulse
map n <Plug>(incsearch-nohl-n)<Plug>Pulse
map N <Plug>(incsearch-nohl-N)<Plug>Pulse
map * <Plug>(incsearch-nohl-*)<Plug>Pulse
map # <Plug>(incsearch-nohl-#)<Plug>Pulse
map g* <Plug>(incsearch-nohl-g*)<Plug>Pulse
map g# <Plug>(incsearch-nohl-g#)<Plug>Pulse

" Pulses the first match after hitting the enter keyan
autocmd! User IncSearchExecute
autocmd User IncSearchExecute :call search_pulse#Pulse()

Integration with the vim-asterisk plugin

vim-asterisk provides improved star motions. Here's the configuration:

let g:vim_search_pulse_disable_auto_mappings = 1

nmap * <Plug>(asterisk-*)<Plug>Pulse
nmap # <Plug>(asterisk-#)<Plug>Pulse
nmap n n<Plug>Pulse
nmap N N<Plug>Pulse
" Pulses cursor line on first match
" when doing search with / or ?
cmap <silent> <expr> <enter> search_pulse#PulseFirst()

Known bugs

MacVim

Credits

This plugin is inspired by:

The animated gif was created using http://www.cockos.com/licecap/

Thanks to everyone who participated in making this plugin better.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].