Comments (4)
Well, I didn't know :help
does survive session save/load. Not sure how I missed this, maybe it was implemented in vim after viewdoc release date (i.e. in last 9 years or so 😄). This is a cool feature and I'd like to have it in viewdoc. But, to be honest, unlikely I'll have enough spare time to implement it anytime soon. So, PR is welcome.
from vim-plugin-viewdoc.
@powerman Ok, same here, times are a bit busy to read through your code and send a PR in coming weeks. What about the minimal information that I ask? 1) full filename+path of current file, 2) way of knowing that current buffer is a vim-plugin-viewdoc's buffer? Don't you already have that information available at your disposal in the plugin somewhere?
If you could provide that, then at least I will be able to make it going in my vimrc. Then maybe at a later point a clean PR could be sent.
from vim-plugin-viewdoc.
In last years there was about 1 commit/year with minor updates, so I don't have viewdoc code base at the top of my head now.
AFAIR in most cases (doc sources) we don't have any source file, viewdoc run external tools and gather it output into vim buffer.
As for detecting viewdoc buffers - there was some way. One probably depends on concrete viewdoc plugin: usually they define a custom &ft
value, like when you open documentation for Go you'll see ft=godoc
, when you open documentation for shell script you'll see ft=man
, etc. This was supposed to be used for doc-specific syntax highlight, but may be useful for you too. Or you may try to add some fixed marker into
vim-plugin-viewdoc/plugin/viewdoc.vim
Lines 279 to 299 in 0a93615
from vim-plugin-viewdoc.
@powerman The way :help
partially survives session save and restore is that it does not change the buffer's filename like vim-plugin-viewdoc does. If you try doing :echo expand('%:p')
from a help buffer opened by :help
, it will show the full path of file. While restoring the session, vim would open this file using usual :edit
command, then a user can fully restore :help
functionality in that buffer by processing it.
I see... if there is no source file, then it would be hard to save state and restore it. At least for the sources like vim help, man pages, etc that do have a file, a function that returns file name would be ideal.
A hacky way of checking if its a viewdoc buffer would be to look if a buffer local variable b:
unique to viewdoc exists...
from vim-plugin-viewdoc.
Related Issues (20)
- Make viewdoc buffers easier to identify HOT 1
- Support for GNU info HOT 4
- Support for LaTeX HOT 1
- Conflicts with vim 7.4.264 HOT 10
- Custom handler no longer working HOT 7
- ViewDocInfo doesn't work for cp, ls etc. (sub-nodes)
- Close doc buffers on tab close? HOT 6
- ViewDocInfo performance issue HOT 3
- Make vim-plugin-viewdoc respect $MANWIDTH and &winwidth HOT 1
- Can you use <Plug> instead of trying to replace <F1> and K mappings? HOT 3
- [feature request] add an option to get single window for documentation HOT 2
- Error when opening man pages HOT 5
- Provide a setting so docs open in dedicated buffer by default HOT 2
- pydoc preserve color HOT 1
- REQUEST: Support for C++ Documentation HOT 1
- Consider adding BufReadCmd's to make the plugin more Session friendly. HOT 3
- use as manpager HOT 1
- Windows problems HOT 11
- macOS issue: E227: mapping already exists for <80>k1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-plugin-viewdoc.