Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 08 2021 22:28
    seandewar edited #15604
  • Sep 08 2021 22:27
    seandewar synchronize #15604
  • Sep 08 2021 22:04
    bfredl synchronize #15566
  • Sep 08 2021 21:59
    seandewar labeled #15604
  • Sep 08 2021 21:58
    seandewar opened #15604
  • Sep 08 2021 21:50
    justinmk edited #15535
  • Sep 08 2021 21:49
    justinmk edited #15535
  • Sep 08 2021 21:27
    justinmk edited #15602
  • Sep 08 2021 21:21
    justinmk closed #15603
  • Sep 08 2021 21:01
    seandewar edited #15603
  • Sep 08 2021 20:56
    seandewar labeled #15603
  • Sep 08 2021 20:56
    seandewar opened #15603
  • Sep 08 2021 20:37
    clason review_requested #15602
  • Sep 08 2021 20:37
    clason review_requested #15602
  • Sep 08 2021 20:36
    clason unlabeled #15602
  • Sep 08 2021 20:36
    clason labeled #15602
  • Sep 08 2021 20:36
    github-actions[bot] labeled #15602
  • Sep 08 2021 20:36
    github-actions[bot] labeled #15602
  • Sep 08 2021 20:36
    github-actions[bot] labeled #15602
  • Sep 08 2021 20:36
    clason opened #15602
mcepl
@mcepl:matrix.org
[m]
nope, still nothing with pattern=vim.fn.stdpath('config') .. "/plugin/*",
seandewar
@seandewar:matrix.org
[m]
🤔
sus
clason
@clason:matrix.org
[m]
probably the usual shortmess shenanigan
mcepl
@mcepl:matrix.org
[m]
works with print() on the comamnd line, but not in the autocommand.
clason
@clason:matrix.org
[m]
try setting a global variable and see if that gets set
mcepl
@mcepl:matrix.org
[m]
You mean like shortmess=filnxtToOF?
clason
@clason:matrix.org
[m]
yes, like that
seandewar
@seandewar:matrix.org
[m]
does shortmess still hide messages from autocmds like this
i think it was fixed right
clason
@clason:matrix.org
[m]
no idea what their version is
seandewar
@seandewar:matrix.org
[m]
ah
sometimes i forget not everybody is using master 🫠
mcepl
@mcepl:matrix.org
[m]
I do use master
seandewar
@seandewar:matrix.org
[m]
🫠
mcepl
@mcepl:matrix.org
[m]
commit 3030b4d6
seandewar
@seandewar:matrix.org
[m]
ok well in that case shortmess shouldn't stop it from printing
clason
@clason:matrix.org
[m]
yes
nova
@nova:libera.chat
[m]
mcepl, did not check cull scroll back, do you want something like vim.fn/globpath(vim.o.rtp, 'plugin/*', false, true)
s/cull/full
seandewar
@seandewar:matrix.org
[m]
wait
you wouldn't happen to have your config behind a symlink?
mcepl
@mcepl:matrix.org
[m]
well, in the end I just want the equivalent of au! BufWritePost ~/.config/nvim/* source %
ad_chaos
@ad_chaos:matrix.org
[m]
just just vim.cmd it
mcepl
@mcepl:matrix.org
[m]
yup, there are some symlinks involved.
seandewar
@seandewar:matrix.org
[m]
does pattern=vim.fn.resolve(vim.fn.stdpath("config")).."/plugin/*" work?
mcepl
@mcepl:matrix.org
[m]
yup, that's it … wow! that's ugly ...
clason
@clason:matrix.org
[m]
here's a more elegant way: vim.cmd [[au! BufWritePost ~/.config/nvim/* source %]]
nova
@nova:libera.chat
[m]
on archlinux, I have .config/nvim as a symlink and stdpath('config') works fine
clason
@clason:matrix.org
[m]
(btw)
nova
@nova:libera.chat
[m]
no. it's been the only distro I have ever used. not a "look how hip I am"
clason
@clason:matrix.org
[m]
for autocommand patterns?
(because the issue is specific to that)
clason
@clason:matrix.org
[m]
mcepl you want to add a group = vim.api.nvim_create_augroup('whatever') key to the table to mimic au!, btw
nova
@nova:libera.chat
[m]
oh they make autocmd with pattern= stdpath/plugin/* I see. You probably need to escape some things. maybe fnameescape or something. That's a weird case
clason
@clason:matrix.org
[m]
the point is that the pattern will not follow symlinks, while the BufWrite will
nova
@nova:libera.chat
[m]
though I don't see why you'd need to resolve the symlink. pretty spooky.
clason
@clason:matrix.org
[m]
so the BufWrite gets triggered for the link origin, while the pattern only sees the link target
so you manually need to resolve the latter for them to match up
nova
@nova:libera.chat
[m]
makes sense. multitasking and missed the whole convo. just ignore me
clason
@clason:matrix.org
[m]
basically, pattern is Just A String for the API, not a (validated/expanded) path
(while the upstream ex command Does Magic, as a treat)
nova
@nova:libera.chat
[m]
but also fnameescape() seems reasonable because your path could have funky chars
yeah I get it :)
clason
@clason:matrix.org
[m]
not sure; you'd have to test that
(the point is how <amatch> looks -- either escaped or not; you need to match that)
nova
@nova:libera.chat
[m]
hmm. it's hard coming from years raw vim-script. Would only know via a test :)
I guess the API could just have amatch as a string and wouldn't need the escapes because the lua api uses strings, which are better than vim ex "parameter" which are very finicky
ad_chaos
@ad_chaos:matrix.org
[m]
vimscript is super nice for configuring,
I still use it in places where it is nicer looking and lua for things I don't know how to do in vimscript :)
nova
@nova:libera.chat
[m]
(well, not necessarily better - just less escape weirdness - but ex command arguments are very powerful, indeed)