vim-pad icon indicating copy to clipboard operation
vim-pad copied to clipboard

Unable to use search

Open gzagatti opened this issue 9 years ago • 10 comments

Hi @fmoralesc,

I'm unable to use the search tool. Every time I enter the search bar, no search is executed. The query becomes: >> [NEW], which leads me to create a new note. I thought the problem might be because I didn't have the appropriate tool for the search mechanism as I'm using OS X. I've installed ack with brew install ack and updated the g:pad#search_backend to ack without success.

My version of vim:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 20 2016 09:07:10)
MacOS X (unix) version
Included patches: 1-1090
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -Os -w -pipe -march=native -mmacosx-version-min=10.11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang   -L. -L/usr/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python   -lruby.2.0.0 -lobjc

gzagatti avatar Jan 29 '16 11:01 gzagatti

This also does not work for me. I have not tried to use it with ack or anything.

cxgslegend avatar Apr 20 '16 22:04 cxgslegend

Sorry for the delay in replying, this issue fell in the cracks...

I would like to know:

  • if you have grep in your $PATH, and if it isn't where it is
  • if it's GNU grep or BSD grep ($ grep --version)

I recommend trying with ag (https://github.com/ggreer/the_silver_searcher), see if it makes a difference.

fmoralesc avatar Apr 21 '16 08:04 fmoralesc

I have grep and ag. screen shot 2016-04-21 at 11 35 43 am

I have never tried to set up ag with vim-pad, however I still think grep should work. I am not sure what is going on here.

Here is a test I did where I added two notes with the word "search" in them. As you can see it just tries to create a new note. screen shot 2016-04-21 at 11 41 02 am screen shot 2016-04-21 at 11 41 35 am

But what is strange is that filtering is working for things like searching for an archive (so I guess grep is working sometimes). screen shot 2016-04-21 at 11 43 11 am

cxgslegend avatar Apr 21 '16 15:04 cxgslegend

I think there was some incompatibility with BSD grep, I'll look into it.

Searching for directories doesn't call on grep.

fmoralesc avatar Apr 21 '16 15:04 fmoralesc

I just tried it with ag and it is working now. I am satisfied with this, but others might have similar issues trying to use grep. Thank you for your help (and the awesome plugin).

cxgslegend avatar Apr 21 '16 16:04 cxgslegend

Same issue, also on OSX. It sounds like BSD grep is the culprit.

If you use ag (the silver searcher), then it works fine. So you can do: brew install the_silver_searcher then set let g:pad#search_backend = 'ag' in vimrc.

Skyfold avatar Apr 23 '16 02:04 Skyfold

Just pushed some changes that should fix this, please confirm.

fmoralesc avatar Apr 23 '16 07:04 fmoralesc

Just pulled.

As far as I can tell c1fcb76 fixes the issue with grep on OSX.

Skyfold avatar Apr 23 '16 07:04 Skyfold

Cool.

I added a small tweak for python3 compat, but I think that will be it.

fmoralesc avatar Apr 23 '16 07:04 fmoralesc

It seems like I pushed to the old master branch (the more recent one is devel) so I added it to it aswell.

fmoralesc avatar Apr 23 '16 08:04 fmoralesc