Coder Social home page Coder Social logo

Comments (11)

zenbro avatar zenbro commented on September 3, 2024

Hi!
Relative path is already supported.
Looks like an error in option name:
let g:mirror#config_file = '~/.config/nvim/mirrors.yml'
Correct way:
let g:mirror#config_path = '~/.config/nvim/mirrors.yml'

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

Oh, sorry, that was my mistake since I typed that out. I just tested this again, this is an exact copy of what I have in my init.vim:

let g:mirror#config_path = '~/.config/nvim/mirrors.yml'
"let g:mirror#config_path = '/home/local/ANT/<omitted_username>/.config/nvim/mirrors.yml'

This way it doesn't work. I try MirrorPush in the configured path and:

E492: Not and editor command: MirrorPush

If I uncomment the second line it works.

When I comment out both and I run let g:mirror#config_path I see this:

g:mirror#config_path    /home/local/ANT/<omitted_username>/.mirrors

So the default value is using the absolute path.

PERHAPS this is due to the fact that my home path is a bit unusual. Not sure. I'll do some more tests tomorrow, for now I'm going home(this is all in my work setup).

from mirror.vim.

zenbro avatar zenbro commented on September 3, 2024

Can you try to replace ~ with '$HOME' .?
Like this:

let g:mirror#config_path = $HOME . '/.config/nvim/mirrors.yml'

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

Yup, that works just fine.

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

But then again I might as well do this since it works too:

let g:mirror#config_path = expand('~/.config/nvim/mirrors.yml')

from mirror.vim.

zenbro avatar zenbro commented on September 3, 2024

I added expand for config and cache paths.
Hope it helps.

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

Well, I see your change:

let g:mirror#config_path = expand(get(g:, 'mirror#config_path', '~/.mirrors'))

But as far as I can tell if I set g:mirror#config_path in my init.vim then it is set AFTER the plugin is loaded(I'm using vim-plug) so it still results in it being set to exactly what I set.

That's annoying, but I guess it makes sense, your vim config should override anything and everything so it's loaded last.

from mirror.vim.

zenbro avatar zenbro commented on September 3, 2024

That sad.
At least you can use expand in your init.vim.

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

I just checked how this is done in another plugin I use and one that respects ~ in a path and I found this for the g:easytags_by_filetype config:

https://github.com/xolox/vim-easytags/blob/master/autoload/xolox/easytags.vim#L189

He's using his own xolox#misc#path#absolute() function every time he uses the configured path.

I guess it's fine if it stays the way it is but I would point this out in the documentation to avoid people trouble. Thanks for help, you are awesome!

from mirror.vim.

zenbro avatar zenbro commented on September 3, 2024

Added information about possible problems with unusual home path and example of using expand() to docs and readme (0d37c4b).

from mirror.vim.

jakubgs avatar jakubgs commented on September 3, 2024

That's great man. Keep at it!

from mirror.vim.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.