Bernhard Leiner avatar Bernhard Leiner committed f8a54fd

add :PssFile command and improve doc somewhat

Comments (0)

Files changed (2)

 *pss.txt*   Plugin that integrates pss with Vim. This plugin has been heavily
-inpired by the ack plugin for Vim!
+inpired by the ack plugin from Antoine Imbert.
 
 ==============================================================================
 Author:  Bernhard Leiner <bleiner@gmail.com>                      *pss-author*
 
 This plugin is a front for pss.
 
-:Pss[!] [options] {pattern} [{directory}]                               *:pss*
+:Pss[!] [options] {pattern} [{directory}]                               *:Pss*
 
     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
     error is jumped to.
 
+:PssFile [options] {pattern} [{directory}]                          *:PssFile*
+
+    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.
+
 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.
+
+==============================================================================
+MAPPINGS                                                        *pss-mappings*
+
+The following keyboard shortcuts are available in the quickfix window:
+
+o                   open file (same as enter).
+go                  preview file (open but maintain focus on pss.vim results).
+t                   open in a new tab.
+T                   open in new tab silently.
+v                   open in vertical split.
+gv                  open in vertical split silently.
+q                   close the quickfix window.
         botright copen
     endif
 
-    " TODO: Document this!
+    " mappings within the quickfix window
+    "close the quickfix window.
     exec "nnoremap <silent> <buffer> q :ccl<CR>"
+    " open in a new tab.
     exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
+    " open in new tab silently.
     exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
+    " open file (same as enter)
     exec "nnoremap <silent> <buffer> o <CR>"
+    " preview file (open but maintain focus on pss.vim results).
     exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
+    " open in vertical split.
+    exec "nnoremap <silent> <buffer> v <C-W><C-W><C-W>v<C-L><C-W><C-J><CR>"
+    " open in vertical split silently.
+    exec "nnoremap <silent> <buffer> gv <C-W><C-W><C-W>v<C-L><C-W><C-J><CR><C-W><C-J>"
 
     " If highlighting is on, highlight the search keyword.
     if exists("g:psshighlight")
 endfunction
 
 command! -bang -nargs=* -complete=file Pss call s:Pss('grep<bang>',<q-args>)
+command! -bang -nargs=* -complete=file PssFile call s:Pss('grep<bang> -g', <q-args>)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.