-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation is still based on range-search.vim and the convenient normal mode keystrokes do not work, but we're getting there.
- Loading branch information
0 parents
commit 1329a24
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Rakefile copied from https://github.com/mileszs/ack.vim (license is | ||
# unknown). | ||
# Modified by Shlomi Fish, while disclaiming all rights to the modifications. | ||
# | ||
# Added by Josh Nichols, a.k.a. technicalpickles | ||
require 'rake' | ||
|
||
plugin_name = 'add-to-word-search' | ||
files = ['doc/#{plugin_name}.txt', 'plugin/#{plugin_name}.vim'] | ||
|
||
desc 'Install plugin and documentation' | ||
task :install do | ||
vimfiles = if ENV['VIMFILES'] | ||
ENV['VIMFILES'] | ||
elsif RUBY_PLATFORM =~ /(win|w)32$/ | ||
File.expand_path("~/vimfiles") | ||
else | ||
File.expand_path("~/.vim") | ||
end | ||
files.each do |file| | ||
target_file = File.join(vimfiles, file) | ||
FileUtils.mkdir_p File.dirname(target_file) | ||
FileUtils.cp file, target_file | ||
|
||
puts " Copied #{file} to #{target_file}" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*range-search.txt* Plugin for searching inside ranges | ||
|
||
============================================================================== | ||
Author: Shlomi Fish < http://www.shlomifish.org/ > | ||
License: MIT/X11 ( http://www.opensource.org/licenses/mit-license.php ) | ||
|
||
============================================================================== | ||
|
||
:[range]Rs {pattern} *:Rs* | ||
|
||
Searches the range for the pattern. | ||
|
||
:[range]RS {pattern} *:RS* | ||
|
||
Same as :Rs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
" Author: Shlomi Fish | ||
" Homepage: http://www.shlomifish.org/ | ||
" Email: shlomif@cpan.org | ||
" Date: 27 February 2012 | ||
" License: MIT X11 ( http://www.opensource.org/licenses/mit-license.php ) | ||
" Version: 0.2.0 | ||
" | ||
" Motivation for this plugin: | ||
" --------------------------- | ||
" | ||
" When searching through code I often found that I need to add more related | ||
" terms to the search. For example, if I found a call to a function inside | ||
" a different one, or when a type is typedef'ed to something else (in C). | ||
" This module aims to allow you to convenietly add search terms to the search | ||
" so you can find all the occurences of all of them. | ||
" To use: put this in ~/.vim/plugin/ | ||
" | ||
" Then you can type <Leader>** to add a search term to the search (mnemonic - | ||
" * is the namespace and '*' searches forward for a keyword. | ||
|
||
function! Append_pat_to_search(mypat) | ||
let @/ = @/ . a:mypat | ||
endfunction | ||
|
||
" This recipe is based on: | ||
" | ||
" http://stackoverflow.com/questions/7093397/vim-equivalent-of-preg-quote-and-quotemeta | ||
function! Quotemeta(mypat) | ||
return '\V' . substitute(a:mypat,'\\','\\\\','g') . '\m' | ||
endfunction | ||
|
||
function! Append_keyword_to_search(mypat) | ||
call Append_pat_to_search('\<' . Quotemeta(mypat) . '\>') | ||
endfunction | ||
|
||
" command -range -nargs=1 Rs call Range_Search(<f-args>,<line1>,<line2>) | ||
" command -range -nargs=1 RS call Range_Search(<f-args>,<line1>,<line2>) | ||
|
||
" Changelog: | ||
" | ||
" 0.2.0: | ||
" first release. |