Giter VIP home page Giter VIP logo

vim-matchmaker's Introduction

Matchmaker v0.2.1

Highlight matches for the word under the cursor.

Usage

  • :Matchmaker turns it on
  • :Matchmaker! turns it off
  • :MatchmakerToggle toggles it

Note: this behaviour will change in version 1.0.0; be aware! When it does, the new usage will look like :Matchmaker on / :Matchmaker off. :Matchmaker! will toggle it. This is to make way for more commands, like maybe :Matchmaker someOtherMatchingMethod to change the matching behaviour. Also, I like it more.

Configuration

Add let g:matchmaker_enable_startup = 1 to your ~/.vimrc to enable Matchmaker when vim starts.

Add let g:matchmaker_ignore_single_match = 1 to your ~/.vimrc to prevent matching when the word under the cursor doesn't show up anywhere else.

If you have any highlighting conflicts with other plugins (such as EasyMotion) you can configure the highlighting priority with let g:matchmaker_matchpriority = 0, where 0 can be any value below (or above) the conflicting plugin.

Contributing

This project uses the git flow model for development. There's a handy git module for git flow. If you'd like to be added as a contributor, make some well-formatted pull requests (against the develop branch) and let me know.

License

Same as Vim; see :help license

vim-matchmaker's People

Contributors

cpixl avatar elmarx avatar faceleg avatar idning avatar jordelver avatar mvoto avatar qstrahl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-matchmaker's Issues

Add option to not override search highlight

Currently, if my cursor is on top of the word that appears in my search, it will be highlighted according to Matchmaker's highlight setting, but ignore the search highlight. See in this example where my cursor is over "brew" and I also did a search for "brew":
screen shot 2015-01-03 at 16 55 47
Instances of "brew" that are not exact matches are still search highlighted orange, while exact matches are highlighted

In the case where the Matchmaker highlight need not conflict with the search highlight (Can have both underline and background color highlights), I would love for Matchmaker to show both highlights rather than just Matchmaker's highlight. In the case above, I would see both an underline and an orange background highlight.

Perhaps you could look at the current search buffer, see if it contains the word the cursor is currently on top of, and if so, apply both the search highlight as well as Matchmaker's highlight?

Delay the highlight to help speed scrolling

It would be nice to be able to delay the highlight so that when you are scrolling quickly through code there is no studdering.

This script is similar to this one and has the delay:

hicursorwords.vim http://www.vim.org/scripts/script.php?script_id=4306

I even tried to hack in the "delay" function from that script into yours but it did not work:

function! s:HiCursorWords__startHilighting()
    let b:HiCursorWords__oldUpdatetime = &updatetime
    let &updatetime = g:HiCursorWords_delay
    augroup HiCursorWordsUpdate
        autocmd!
        autocmd CursorHold,CursorHoldI  *
                \ if exists('b:HiCursorWords__oldUpdatetime') | let &updatetime =     b:HiCursorWords__oldUpdatetime | endif
                \ | call s:HiCursorWords__execute()
    augroup END
endfunction       

So I thought I would ask if you guys knew how to do this or if you could add it to your script.

Thanks for the GREAT script!

Match visual selection

When there is an active visual selection, Matchmaker should attempt to match that instead of <cword>.

Don't highlight when there are no other matches

Many thanks for this great plugin! It does for me what most GUI IDEs do, and it doesn't even interfere with vim's search highlighting.

It would be nice if there were an option to disable highlighting when there are no matches to the word under the cursor. It seems unnecessary to highlight the word under the cursor if there is nothing else to highlight.

Thanks!

Overriding highlight group does not work (in neovim?)

My understanding is that it should be possible to customize the highlight colors for matchmaker by adding something like highlight Matchmaker guibg=yellow guifg=black to the vim config before the plugin is loaded. However, I cannot get this to work i my neovim setup. It seems like changes to the highlight group only are effective if done inside of the plugin file.

I have no clue why that is. Could be because of other plugins, my gruvbox colorscheme, a neovim thing, ... .

My current solution is this:
master...rompetroll:master

With this new variable, the plugin will link the Matchmaker highlight group to a different group. Example usage:

let g:matchmaker_hl_group='underlined'

Now, while this works, I would prefer if I could set highlight link Matchmaker underlined in my user config instead.

Improve Performance

Matchmaker causes quite a performance drain when I'm navigating large source files.

See this screen recording where just navigating up and down lines of code if very slow and laborious with Matchmaker turned on, but very fast and smooth with Matchmaker turned off.

I'd like to keep Matchmaker always turned on, like most GUI IDEs. However, doing so is too much of a performance drain right now. How about not triggering Matchmaker until the cursor has come to rest? This is the behavior in Xcode.

Which is better, `:Matchmaker cmd` or `:MatchmakerCmd`?

I'm considering adding tab completion to the :Matchmaker command (to complete on and off and any future commands), but I wonder if it would just be better to have a separate command for each, which seems to be the usual vim way of doing things. I welcome any input anyone has to offer.

Don't Highlight Anything When Cursor is Not on Word

You can see in the below screenshot that although my cursor is not actually on any word at all, Matchmaker is highlighting (underlining) the word closest to the cursor.

screen shot 2015-01-03 at 18 36 56

It's very strange that anything should be highlighted when I'm not focusing on anything. I find it much more of a distraction than it is helpful. Could we highlight words only when the cursor is truly on top of them? Or perhaps at least make this an option?

Thanks!

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.