Comments (16)
Thanks for the interest in this everyone! I did some work on this yesterday. I'm basically starting again because there's some big differences after #22 had been merged.
The non filtered version is fairly similar to before (branch 10-cursor-line
).
But the filtered version (branch 10-cursor-line-filtered
) turns out to be more challenging. I'll need some more time to decide if a simple approach will be enough (might be slightly misleading in some cases).
And I still haven't decided if I want to support one of them or both of these variations. To me personally the filtered one seems more visually appealing, but is harder to get right on my end.
So yeah, I'll get back to this eventually. โ๏ธ
from context.vim.
@typhooncamel @jclifford-zd: I pushed a branch which should do what you asked for: https://github.com/wellle/context.vim/compare/10-cursor-line
Can you please use that for a bit and let me know if that's really what you want? In that case I might add a setting to enable this behavior. Thanks!
from context.vim.
thanks @wellle , your custom branch 10-cursor-line-filtered
is exactly what i was looking for.
I feel that the "cursor-line-filtered` is really the primary use case of this plugin.
Consider what happens when one is editing the line under the cursor, and starts wondering about its context. I start scanning vertically upwards, away from the current line, searching for enclosing scopes. When I reach the top of the screen, I can't continue the mental search without scrolling of the buffer. This is when this context plugin comes in: it summarizes what's not visible on the screen but in relation to the currently highlighted line, not just the arbitrary line atop the screen.. That's exactly what the cursor-line-filtered mod accomplishes!
from context.vim.
I mean I would imagine the preview screen to open up when the definition of a function/class (that I am currently looking at) moves out of screen
from context.vim.
@Pawan-Bishnoi: Thanks! I pushed a new branch which only adds lines to the context (still based on the cursor lines) which are not visible on screen:
https://github.com/wellle/context.vim/compare/10-cursor-line-filtered
I think there are still some issues where the context is not always automatically updated, but could you try that and let me know if that seems useful? Thanks!
from context.vim.
Thank you @wellle and everyone else - sorry, I've been away and couldn't check it out. I agree that 10-cursor-line
is what I was after.
from context.vim.
10-cursor-line-filtered is just what I was looking for! I'm used to invoking context with a mapping (I have a command that :echo
s it -- but context does it better), so I don't want context on the screen unless it's currently relevant and I'd rather see more code at the top of the screen than context for a function I'm not currently editing.
Look forward to this being an option in master (to use it with popupwin)!
from context.vim.
@typhooncamel @Pawan-Bishnoi @jclifford-zd @idbrii @maxigit @wmusial @nilsboy @ThomasFeher @igorsol @mredaelli @GaurangTandon
Thanks for the interest and patience everyone. I've finished working on this over the last few days and just opened #76. I'd appreciate if some of you could try this new version and give me some feedback on it before I merge the PR. Thank you!
from context.vim.
Okay, thank you both for the feedback.
I'm currently working on something else (for #4) and will get back to this afterwards.
from context.vim.
works perfectly ๐ . Thanks @wellle !!!
from context.vim.
Personally I don't feel like this would be useful, as in your case you already have the full context just on screen. But I'm willing to implement this as an option and have you try it if you really like it. Not high prio yet though.
from context.vim.
Thanks @wellle for the nice work you have done. I tried the 'follow the cursor' option but it turned out to be confusing and not as useful as I thought it would be.
I have a different suggestion:
Show the preview window only if a block of code overflows the screen
What do you think @typhooncamel
from context.vim.
@Pawan-Bishnoi: I'm not sure I understand. Can you clarify what you mean by a block of code
?
from context.vim.
Thanks @wellle
That looks much better. I agree we might be missing a few corner cases here, I will keep an eye out for them.
from context.vim.
@wellle thanks for this. I have been using 10-cursor-line
and it seems to work perfectly.
It suits my use case perfectly.
I prefer to see the full context of the cursor location (as opposed to the filtering on 10-cursor-line-filtered
).
from context.vim.
This plugin is fantastic and is really handy for example to edit html file. This feature will really help to see which tags are the parent or too check if which if branch your are even when the screen is to small to trigger the context.
from context.vim.
Related Issues (20)
- Doesn't work on windows vim 8.2 HOT 2
- Plugin breaks vim's visual-block append. HOT 2
- remove <context.vim> in the upper right corner HOT 3
- Can't install with Pathogen HOT 2
- ใE28 No highlight group name๏ผCommentใ
- Auto commands are not disabled by g:context_filetype_blacklist
- Support getting context of topmost line (regardless of cursor position) HOT 1
- Slow scrolling in perl files HOT 5
- Add name to filetype so it can be ignored by other plugins more easily
- Bug: When in select/selection mode it will jump back into normal mode
- Opens a [Scratch] window when using CtrlP or NerdTree
- [Feature Request] Return the number of lines context.vim would take if the user was to press `zt` HOT 4
- stray background text not painted over in the context window when scrolling with Ctrl+D
- Context doesn't update when switching buffers with fzf.vim HOT 1
- [Question] is there a way to show a "header" when the matched line is a single `{`
- Feature request: syntax highlighting in context lines
- refreshing the file with `:e` raises error in file with modeline
- context.vim doesn't play nice with coc diagnostic window HOT 1
- Conflict with nvim-notify
- C preprocessor handling
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 context.vim.