michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
558 stars 74 forks source link

:ZettelOpen & :ZettelSearch don't work #133

Open Luca-sudo opened 1 year ago

Luca-sudo commented 1 year ago

Error message: "Command failed: ag --color --smart-case --nogroup --column "^(?=.)" -G 'wiki$' "

Fzf is installed and works from terminal, so does ag.

I have also tried changing the command using g:zettel_fzf_command. The error persist, however.

michal-h21 commented 1 year ago

This is hard to debug. I've updated my Vim plugins completely, and everything works for me in Vim 9.0 and Neovim 0.8.1. It could be caused by something in your configuration. Does the command ag --color --smart-case --nogroup --column "^(?=.)" -G 'wiki$' work from the terminal when you execute it in the directory where you have your wiki files?

k4y4k commented 1 year ago

hello 👋 i'm having the same issue. running that command doesn't do anything (i do have ag and fzf installed also)

take a gander: image it really doesn't like it :(

windows 11 powershell 5.1.25267.1000

❯ nvim --version
NVIM v0.8.0-1210-gd367ed9b2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az177-603

Features: -acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim"

Run :checkhealth for more info
❯ ag --version
ag version 2.2.5 ; Windows port 2021-06-04 Win64 >= Server2003 amd64
MsvcLibX 2021-06-03 ; PCRE 8.44 2020-02-12 ; pthreads4w 3.0.0 ; zlib 1.2.11

Features:
  +jit -lzma +zlib +2enc
❯ fzf --version
0.35.1 (b55f555)

my .vimrc is in my dotfiles repo.

michal-h21 commented 1 year ago

Isn't is possible that it is an issue with Windows handling of quotes or something similar? Ag doesn't print any output, not even an error message?

k4y4k commented 1 year ago

No output whatsoever. It exits with a non 0 code (I can tell because my prompt goes red & n/vim complains) but there is nothing like ag: bad argument or ag: invalid whatever printed. It just quits silently.

I tried with

No dice.

michal-h21 commented 1 year ago

And do you use Vimwiki syntax or Markdown for your notes? If you use Markdown the command should be something like:

   ag --color --smart-case --nogroup --column "^(?=.)" -G 'md$'

If you use Markdown, then do you have correctly set ext field in your configuration? Like:


   let g:vimwiki_list = \
     [{'path':'~/scratchbox/vimwiki/markdown/','ext':'.md',\
     'syntax':'markdown'}, {"path":"~/scratchbox/vimwiki/wiki/"}]
k4y4k commented 1 year ago

i do use markdown.

that md command works: image

and... i did/do/once again have the ext set up: https://github.com/k4y4k/dotfiles/blob/7fa1ca2b1b3e653af58face641b2b818c758beb6/dot_vimrc.tmpl#L285

EDIT: I didn't have the . in the ext field 🤡 but that's fixed now and the issue still persists.

image

i feel like i'm missing something really elementary. vim-zettel worked flawlessly back in my linux days :(

michal-h21 commented 1 year ago

Try the updated version of vim-zettel. I've found that the issue on Windows comes from limiting the search only to the file extension of the current wiki. I couldn't find a better solution than to remove this limit completely.

k4y4k commented 1 year ago

it works 🎉!!!!!!!!

thank you very much 🙏!!!