diff --git a/plugin/vim-ripgrep.vim b/plugin/vim-ripgrep.vim index 7188001..16df83b 100644 --- a/plugin/vim-ripgrep.vim +++ b/plugin/vim-ripgrep.vim @@ -61,7 +61,8 @@ fun! s:RgSearch(txt) if &smartcase == 1 let l:rgopts = l:rgopts . '-S ' endif - silent! exe 'grep! ' . l:rgopts . a:txt + " Escaping Command-line special characters '#', '%' (:h :_%), and '|' (:h :bar) + silent! exe 'grep! ' . l:rgopts . escape(a:txt, "#%|") if len(getqflist()) exe g:rg_window_location 'copen' redraw!