VIM Plugins

VimHere are some plugins that I’ve put together for Vim. Most of them just grew out of the fact that I’ve used previous IDEs and editors that have similar functionality. Hope it helps someone.

CompView – Compressed Search View

CompView.vim is a handy little script that I use all the time. After a search term is entered it generates a list of matches and displays a window with all the matching lines. As you move around this window to different matched lines the original window is automatically updated to show you where in the file the match is found. It is like an interactive ‘cw’ command.

Mini-FAQ

Can you change it to search all the buffers loaded?
That was my original intent, but as you can see I haven’t had time to change the script.
Why is there a delay when I move around the result list?
This is because it is not really capturing keystrokes but rather using the CursorHold event that gets triggered whenever the user doesn’t press a key for the specified time in ‘updatetime’. You can try reducing the value but might slow down other things. Play around with it.

Screenshoot

CompView

TaskList – Simple Eclipse Like Task List

TaskList.vim I got a request from a developer that he used the CompView script (see above) all the time, but wanted something that resembled the eclipse task list. So here it is, this script will search the file for FIXME, TODO, and XXX (or a custom list) and put them in a handy list for you to browse which at the same time will update the location in the document so you can see exactly where the tag is located. Something like an interactive ‘cw’

Mini-FAQ

Can you change it to search all the buffers loaded?
I haven’t had time to implement this but I really think this would help out.
Can you make it sort according to the way the appear in the file rather than grouping by type?
The way it is implemented right now it is not very easy to do this. You would have to re-write the whole search function to do this.

Screenshoot

TaskList

SearchFold – Search by folding non matching lines

SearchFold.vim is a good script to have around. You give it a search string to find and folds everything except for the lines where the string matches. By default is keeps some non-matching lines around you you can get an idea of where you are in the file and gives you the ability to expand “the view” for a particular match to get more context. After you are done looking around you can “quit” the script and keep the fold or go back to the file as it was (restoring any previous folds).

Screenshoot

SearchFold

Miscellaneous Commands Beta

I have a few version control commands that I use quite often, I have not tested them or polished them for general distribution so they are very beta. If you feel adventurous here they are RCSDiff, CVSDiff and SVNDiff. Just drop them into your plugins directory, then when you are in a file with version control use the command :RCSDiff to start a diff session. You can also specify the revision you want to compare to as well such as :CVSDiff 1.5 And the best part is that I can do a quick diff from the command line $ vim +SVNDiff main.c

If you are a GIT user Bart Trojanowski has GITDiff script.

  • #1 written by Alessandro
    about 1 year ago

    Hi,

    I just want to inform you that a add one global variable to your script “TaskList” and made a change on the “map” option. Of course, in my copy of your plugin. I used t for something else and I added a global variable to be able to change the key mapping in a setting flag.

  • #2 written by keramcan
    about 5 months ago

    Hi
    Thanks for the tasklist.vim it is very helpful. However it is very greedy I mean it does not respect the script formatting of the Tokens. I was wondering if we could get a version that is less greedy when searching for the tokens in the file?

    thanks

    • #3 written by Juan Frias
      about 5 months ago

      I am not sure what you mean by “greedy” can you give me an example?

  • #4 written by keramcan
    about 5 months ago

    Hi
    I meant that it matches every occurences even inside individual words.

    For example, Tasklist catches “mytodolist” as a TODO and lists it naturally in the special buffer. I would think that it should only do exact match?

    • #5 written by Juan Frias
      about 5 months ago

      Ah! I see what you mean. Well the patterns it uses for matching are actually regular expressions so you could add this to your .vimrc to make it “non-greedy”

      let g:tlTokenList = ["\\<FIXME\\>", "\\<TODO\\>", "\\<XXX\\>"]

      The plugin uses the search() function so you can use any {pattern} you like. See :help pattern for details.

      Hope this helps.

Please leave these two fields as-is:
No trackbacks yet.