Skip to content

Commit

Permalink
Minor updates to doc and code
Browse files Browse the repository at this point in the history
  • Loading branch information
yegappan committed Mar 3, 2018
1 parent d49f185 commit 8ff0923
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
8 changes: 5 additions & 3 deletions autoload/greplace.vim
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ endfunction
" greplace#show_matches
" Display the search results in the replace buffer
function! greplace#show_matches(search_pat)
let s:save_qf_list = {}

let qf = getqflist()
if empty(qf)
call s:warn_msg('Error: Quickfix list is empty')
Expand Down Expand Up @@ -334,10 +336,10 @@ function! greplace#search(type, ...)
if pattern == ''
return
endif
endif

" Escape the special characters in the supplied pattern
let pattern = shellescape(pattern)
" Escape the special characters in the supplied pattern
let pattern = shellescape(pattern)
endif

if a:type == 'grep'
if filenames == ''
Expand Down
21 changes: 13 additions & 8 deletions doc/greplace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ across several files in a single pass.

This plugin will run only on Vim 7.0 and above.

The github repository for this plugin is at
https://github.com/yegappan/greplace

==============================================================================
2. Installation *greplace-installation*

Expand Down Expand Up @@ -97,7 +100,7 @@ Vim internal grep, set the "grepprg" option to "internal".

The syntax of the ":Gsearch" command is:
>
:Gsearch [<grep-option(s)>] [[<pattern>] [<filename(s)>]]
:Gsearch [<grep-option(s)>] [[<pattern>] [<filename(s)>]]
<
The arguments to the ":Gsearch" command are optional.

Expand All @@ -107,8 +110,10 @@ MS-Windows). For example, to ignore case, you can use "-i" for the Unix
grep program.

The next argument specifies the pattern. You cannot use space characters in
the pattern. To specify space characters in the pattern, don't specify the
pattern in the command-line. See below for more information.
the pattern. To specify space or other special characters in the pattern,
don't specify the pattern in the command-line. You will then be prompted to
enter the pattern where you can enter the special characters. See below for
more information.

The last set of arguments specify the filenames. You can use wild cards (like
'*') in the filenames. You can also complete directory and file names by
Expand All @@ -117,14 +122,14 @@ pressing <Tab>.
If the pattern or the filenames is not supplied as argument to the ":Gsearch"
command, then you will be prompted to enter the pattern and the filenames. The
default value for the search pattern is the keyword under the cursor. In the
prompt for entering the pattern, you can enter a pattern with space
characters. In the prompt for entering the filenames, you can press <Tab> to
complete the directory and file names.
prompt for entering the pattern, you can enter a pattern with space and other
special characters. In the prompt for entering the filenames, you can press
<Tab> to complete the directory and file names.

To search for a pattern in the files in the Vim buffer list, use the
":Gbuffersearch" command. The syntax of this command is:
>
:Gbuffersearch [<grep-option(s)>]
:Gbuffersearch [<grep-option(s)>]
<
This command is similar to the ":Gsearch" command. This command searches for
the specified pattern in all the files in the buffer list. You cannot specify
Expand All @@ -133,7 +138,7 @@ filenames to this command.
To search for a pattern in the files in the Vim argument list, use the
":Gargsearch" command. The syntax of this command is:
>
:Gargsearch [<grep-option(s)>]
:Gargsearch [<grep-option(s)>]
<
This command is similar to the ":Gsearch" command. This command will search
for the specified pattern in all the files in the argument list. You cannot
Expand Down

0 comments on commit 8ff0923

Please sign in to comment.