mirror of
1
0
Fork 0

Added smartgf plugin https://github.com/gorkunov/smartgf.vim and removed ack.vim

This commit is contained in:
Mirosław Pragłowski 2014-10-16 16:11:19 +02:00
parent e1643cdd0c
commit fdac5a5ed3
7 changed files with 4 additions and 471 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "bundle/smartgf"]
path = bundle/smartgf
url = git@github.com:gorkunov/smartgf.vim.git

View File

@ -1 +0,0 @@
tags

View File

@ -1,131 +0,0 @@
# ack.vim
This plugin is a front for the Perl module
[App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a
replacement for 99% of the uses of _grep_. This plugin will allow you to run
ack from vim, and shows the results in a split window.
## Installation
### Ack
You will need the ack(>= 2.0), of course, to install it follow the
[manual](http://beyondgrep.com/install/)
### The Plugin
To install it is recommended to use one of the popular package managers for Vim,
rather than installing by drag and drop all required files into your `.vim` folder.
#### Manual (not recommended)
Just
[download](https://github.com/mileszs/ack.vim/archive/kb-improve-readme.zip) the
plugin and put it in your `~/.vim/`(or `%PROGRAMFILES%/Vim/vimfiles` on windows)
#### Vundle
Bundle 'mileszs/ack.vim'
#### NeoBundle
NeoBundle 'mileszs/ack.vim'
## Usage
:Ack [options] {pattern} [{directories}]
Search recursively in {directory} (which defaults to the current directory) for
the {pattern}.
Files containing the search term will be listed in the split window, along with
the line number of the occurrence, once for each occurrence. [Enter] on a line
in this window will open the file, and place the cursor on the matching line.
Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use
`:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively.
(See `doc/ack.txt`, or install and `:h Ack` for more information.)
For more ack options see
[ack documentation](http://beyondgrep.com/documentation/)
### Keyboard Shortcuts
In the quickfix window, you can use:
o to open (same as enter)
O to open and close quickfix window
go to preview file (open but maintain focus on ack.vim results)
t to open in new tab
T to open in new tab silently
h to open in horizontal split
H to open in horizontal split silently
v to open in vertical split
gv to open in vertical split silently
q to close the quickfix window
This Vim plugin is derived (and by derived, I mean copied, essentially) from
Antoine Imbert's blog post
[Ack and Vim Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html)
(in particular, the function at the bottom of the post). I added a help file that
provides just enough reference to get you going. I also highly recommend you
check out the docs for the Perl script 'ack', for obvious reasons:
[ack - grep-like text finder](http://beyondgrep.com/).
### Gotchas
Some characters have special meaning, and need to be escaped your search
pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define
foo'` to search for '#define foo'. (From blueyed in issue #5.)
## Changelog
### 1.0
* Remove support to ack 1.x
* Start to use a Changelog
* Use `autoload` directory to define functions, instead of `plugin`.
* Add option to auto fold the results(`g:ack_autofold_results`)
* Improve documentation, list all options and shortcuts
* Improve highlight option to work when passes directories or use quotes.
* Add g:ack_mapping
* Add g:ack_default_options
* Add a help toggle `?`(like NERDTree)
### 1.0.1
* Fixes #124. Bug with `g:ack_autofold_results`
### 1.0.2
* Add compatibility with [vim-dispatch](https://github.com/tpope/vim-dispatch)
### 1.0.3
* Fixes #127. Use `&l:hlsearch` instead of `v:hlsearch` to keep compatibility
with versions that does not have this variable.
### 1.0.4
* Fixes #128. Always apply mappings, even when using vim-dispatch.
### 1.0.5
* Fixes #128. Fixes the `errorformat` for ack when using vim-dispatch.
* Do not use vim-dispatch by default. To use vim-dispath must set
`g:ack_use_dispatch`
### 1.0.6
* Fixes highlight function to work when user passes options. Ex.: Ack -i test
Thank's @mannih. (#131, #134)
### 1.0.7
* Fixes highlight function to work when passes more than one option, or options
with double dashes(--option) Thank's to @MiguelLatorre and @mannih
### 1.0.8
* Fixes (again) highlight, now using negative look behind.
* Change mappings `o` and `O` to behave as documented

View File

@ -1,23 +0,0 @@
# Added by Josh Nichols, a.k.a. technicalpickles
require 'rake'
files = ['doc/ack.txt', 'plugin/ack.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

View File

@ -1,241 +0,0 @@
*ack.txt* Plugin that integrates ack with Vim
==============================================================================
Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
License: Same terms as Vim itself (see |license|)
==============================================================================
INTRODUCTION *ack*
This plugin is a front for the Perl module App::Ack. Ack can be used as a
replacement for grep. This plugin will allow you to run ack from vim, and
shows the results in a split window.
:Ack[!] [options] {pattern} [{directory}] *:Ack*
Search recursively in {directory} (which defaults to the current
directory) for the {pattern}. Behaves just like the |:grep| command, but
will open the |Quickfix| window for you. If [!] is not given the first
occurence is jumped to.
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
Just like |:Ack|, but instead of making a new list, the matches are
appended to the current |quickfix| list.
:AckFromSearch [{directory}] *:AckFromSearch*
Just like |:Ack| but the pattern is from previous search.
:LAck [options] {pattern} [{directory}] *:LAck*
Just like |:Ack| but instead of the |quickfix| list, matches are placed in
the current |location-list|.
:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
Just like |:AckAdd| but instead of the |quickfix| list, matches are added
to the current |location-list|
:AckFile [options] {pattern} [{directory}] *:AckFile*
Search recursively in {directory} (which defaults to the current
directory) for filenames matching the {pattern}. Behaves just like the
|:grep| command, but will open the |Quickfix| window for you.
:AckHelp[!] [options] {pattern} *:AckHelp*
Search vim documentation files for the {pattern}. Behaves just like the
|:Ack| command, but searches only vim documentation .txt files
:LAckHelp [options] {pattern} *:LAckHelp*
Just like |:AckHelp| but instead of the |quickfix| list, matches are placed
in the current |location-list|.
:AckWindow[!] [options] {pattern} *:AckWindow*
Search all buffers visible in the screen (current tab page only) files for
the {pattern}.
:LAckWindow [options] {pattern} *:LAckWindow*
Just like |:AckWindow| but instead of the |quickfix| list, matches are
placed in the current |location-list|.
Files containing the search term will be listed in the split window, along
with the line number of the occurrence, once for each occurrence. <Enter> on
a line in this window will open the file, and place the cursor on the matching
line.
See http://betterthangrep.com/ for more information.
==============================================================================
CONFIGURATION *ack-configuration*
*g:ackprg*
g:ackprg
Default for ubuntu: "ack-grep"
Default for other systems: "ack"
Use this option to specify the ack command and its options
Example:
>
let g:ackprg = "other-bin-ack"
<
*g:ack_default_options*
g:ack_default_options
Default: " -s -H --nocolor --nogroup --column"
Use this option to specify the options used by ack
Example:
>
let g:ack_default_options =
\ " -s -H --nocolor --nogroup --column --smart-case --follow"
<
*g:ack_apply_qmappings*
g:ack_apply_qmappings
Default: 1
This option enable mappings on quickview window.
*g:ack_apply_lmappings*
g:ack_apply_lmappings
Default: 1
This option enable mappings on Location list window.
*g:ack_mappings*
g:ack_mappings
Default: {
\ "t": "<C-W><CR><C-W>T",
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
\ "o": "<CR>",
\ "O": "<CR><C-W><C-W>:ccl<CR>",
\ "go": "<CR><C-W>j",
\ "h": "<C-W><CR><C-W>K",
\ "H": "<C-W><CR><C-W>K<C-W>b",
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
\ "gv": "<C-W><CR><C-W>H<C-W>b<C-W>J" }
This option list all maps create on quickfix/Location list window.
Example, if you want to open the result in the middle of the screen:
>
let g:ack_mappings = { "o": "<CR>zz" }
<
*g:ack_qhandler*
g:ack_qhandler
Default: "botright copen"
Command to open the quickview window.
If you want to open a quickview window with 30 lines you can do:
>
let g:ack_qhandler = "botright copen 30"
<
*g:ack_lhandler*
g:ack_lhandler
Default: "botright lopen"
Command to open the Location list window.
If you want to open a Location list window with 30 lines you can do:
>
let g:ack_lhandler = "botright lopen 30"
<
*g:ackhighlight*
g:ackhighlight
Default: 0
Use this option to highlight the searched term.
Example:
>
let g:ackhighlight = 1
<
*g:ack_autoclose*
g:ack_autoclose
Default: 0
Use this option to specify whether to close the quickfix window after
using any of the shortcuts.
Example:
>
let g:ack_autoclose = 1
<
*g:ack_autofold_results*
g:ack_autofold_results
Default: 0
Use this option to fold the results in quickfix by file name. Only the current
fold will be open by default and while you press 'j' and 'k' to move between the
results if you hit other fold the last one will be closed and the current will
be open.
Example:
>
let g:ack_autofold_results = 1
<
*g:ackpreview*
g:ackpreview
Default: 0
Use this option to automagically open the file with 'j' or 'k'.
Example:
>
let g:ackpreview = 1
<
*g:ack_use_dispatch*
g:ack_use_dispatch
Default: 0
Use this option to use vim-dispatch to search the results in background
Example:
>
let g:ack_use_dispatch = 1
<
==============================================================================
MAPPINGS *ack-mappings*
The following keyboard shortcuts are available in the quickfix window:
o open file (same as enter).
O open file and close quickfix window.
go preview file (open but maintain focus on ack.vim results).
t open in a new tab.
T open in new tab silently.
h open in horizontal split.
H open in horizontal split silently.
v open in vertical split.
gv open in vertical split silently.
q close the quickfix window.

View File

@ -1,75 +0,0 @@
if !exists("g:ack_default_options")
let g:ack_default_options = " -s -H --nocolor --nogroup --column"
endif
" Location of the ack utility
if !exists("g:ackprg")
if executable('ack')
let g:ackprg = "ack"
elseif executable('ack-grep')
let g:ackprg = "ack-grep"
else
finish
endif
let g:ackprg .= g:ack_default_options
endif
if !exists("g:ack_apply_qmappings")
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
endif
if !exists("g:ack_apply_lmappings")
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
endif
if !exists("g:ack_use_dispatch")
let g:ack_use_dispatch = 0
end
let s:ack_mappings = {
\ "t": "<C-W><CR><C-W>T",
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
\ "o": "<CR>",
\ "O": "<CR><C-W>p<C-W>c",
\ "go": "<CR><C-W>p",
\ "h": "<C-W><CR><C-W>K",
\ "H": "<C-W><CR><C-W>K<C-W>b",
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
\ "gv": "<C-W><CR><C-W>H<C-W>b<C-W>J" }
if exists("g:ack_mappings")
let g:ack_mappings = extend(s:ack_mappings, g:ack_mappings)
else
let g:ack_mappings = s:ack_mappings
endif
if !exists("g:ack_qhandler")
let g:ack_qhandler = "botright copen"
endif
if !exists("g:ack_lhandler")
let g:ack_lhandler = "botright lopen"
endif
if !exists("g:ackhighlight")
let g:ackhighlight = 0
endif
if !exists("g:ack_autoclose")
let g:ack_autoclose = 0
endif
if !exists("g:ack_autofold_results")
let g:ack_autofold_results = 0
endif
command! -bang -nargs=* -complete=file Ack call ack#Ack('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckAdd call ack#Ack('grepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFromSearch call ack#AckFromSearch('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAck call ack#Ack('lgrep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAckAdd call ack#Ack('lgrepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFile call ack#Ack('grep<bang> -g', <q-args>)
command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=help LAckHelp call ack#AckHelp('lgrep<bang>', <q-args>)
command! -bang -nargs=* -complete=help AckWindow call ack#AckWindow('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=help LAckWindow call ack#AckWindow('lgrep<bang>', <q-args>)

1
bundle/smartgf Submodule

@ -0,0 +1 @@
Subproject commit e2814c2f4eb89b043bb9b65af1a4ac9fce518a1b