GithubHelp home page GithubHelp logo

Use `info://...` for buffer name about info.vim HOT 2 OPEN

hiphish avatar hiphish commented on July 23, 2024
Use `info://...` for buffer name

from info.vim.

Comments (2)

HiPhish avatar HiPhish commented on July 23, 2024

I'm afraid I don't quite follow. Can you please give me an example (even if it is contrived) where my scheme could be a problem? The reason I went with for example info:make.info#Top instead of info://make.info#Top is that the former is the URI scheme proposed by GNU Texinfo for Info files without path. See info:texinfo.info#Info%20Files (or :Info texinfo Info\ Files).

I would prefer to remain compatible with this suggestion because it is supported by Emacs as well (principle of lease surprise). However, I think pragmatism trumps least surprise, Vim is not Emacs.

Truth be told, I don't like working on this plugin anymore. It is far too complicated for Vim script and it relies on standalone info to render the text. I would prefer to just rewrite it in Lua for Neovim only and use lpeg (which will be included with Neovim 0.10) to parse the Info files directly and render them myself. But Info files are often compressed, I don't know how I would deal with those. So far standalone info has been giving me support for them for free.

from info.vim.

tomtomjhj avatar tomtomjhj commented on July 23, 2024

Can you please give me an example (even if it is contrived) where my scheme could be a problem?

For example, user may want to edit the file named info:info.vim in the cwd.

touch info:info.vim
vim info:info.vim # shows the info page for info.vim

With the current scheme, info.vim cannot tell whether the user wants the file or the info page.
On the other hand, vim unambiguously interprets info://... as an absolute path.

v:oldfiles records the file names (among many other things) of the recently edited buffers.
For example, if you edit, ~/.vimrc, :oldfiles will display /home/user/.vimrc (after you rerun vim).

In some cases, you may want to exclude some files from v:oldfiles, especially when they are temporary files or not real files,
e.g. /tmp/*, fugitive://* (git commit, blob, ..), man:// (man page), and info pages.
This can be done with :h viminfo-r (or :h shada-r), but this only filters the filename by the prefix of the file name.

With info:info.vim scheme, the filename recorded in v:oldfiles will be /path/to/cwd/info:info.vim.
Therefore, it cannot be ignored from :oldfiles.
With info://info:info.vim scheme, exactly info://info:info.vim is recorded in v:oldfiles, so you can filter it out with set viminfo+=rinfo://.

So I think info:// scheme is more practical, but I do understand the advantage of info: scheme's compatibility.

Truth be told, I don't like working on this plugin anymore. It is far too complicated for Vim script and it relies on standalone info to render the text.

Fair enough 🙃

from info.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.