Browse files

fix quoting of |, add ri sample

  • Loading branch information...
1 parent 8fa4cfc commit 3e95e7ce8fe0d7fa95bd39ce4b112cc3b49a29c9 @MarcWeber committed Apr 25, 2012
Showing with 9 additions and 2 deletions.
  1. +2 −2 autoload/views.vim
  2. +7 −0 doc/views.txt
View
4 autoload/views.vim
@@ -3,7 +3,7 @@ if !exists('g:vim_views_config') | let g:vim_views_config = {} | endif | let s:c
let s:c['show_action'] = get(s:c,'show_action', 'sp')
fun! views#Escape(s)
- return escape(a:s, "[#,")
+ return escape(a:s, '[#,\\')
endf
" open a view of type type passing arguments args
@@ -12,7 +12,7 @@ fun! views#View(type, args, ...)
if urlOnly
return 'vim_view_'.a:type.'://'.views#Escape(string(a:args))
else
- exec s:c['show_action'].' vim_view_'.a:type.'://'.views#Escape(string(a:args))
+ exec s:c['show_action'].' '.fnameescape('vim_view_'.a:type.'://'.string(a:args))
endif
endf
View
7 doc/views.txt
@@ -32,4 +32,11 @@ customization ~
Of course if _fun and _exec is not enough you can extend g:vim_views_config.
See usage in vim-addon-views.vim
+------------------------------------------------------------------------------
+simple examples~
+command! -nargs=1 Ri call views#View('exec',['sh', '-c', 'ri '.<f-args>.' <bar> sed -e "s/.//g" -e "s///"'])
+
You can also use augroups to set syntax highliting and such
+
+------------------------------------------------------------------------------
+ vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:

0 comments on commit 3e95e7c

Please sign in to comment.