19 events
when toggle format what by license comment
Aug 15 '18 at 4:07 comment added Wildcard Interesting, I just double-checked on an Ubuntu VM with Vim 7.4 and had no issues. On Mac, with Vim 7.3, if a 2<c-k> is followed by <c-j>, the <c-j> and each subsequent <c-j> or <c-k> (until another command is run or a count is given) will move the cursor one line as expected but scroll the view two lines. Like the stale value of the count that was read earlier is applied to the subsequent view adjustments, but not to the cursor adjustments. Not a major issue, just a wild bug. Probably I should just find out how to update Vim on this Mac. (MacVim 8.0 has no problem either.)
Aug 15 '18 at 3:57 comment added B Layer @Wildcard Works for me. What's the problem?
Aug 14 '18 at 23:37 comment added Wildcard @BLayer, could you look at this again please? Something peculiar goes on with the counts. For instance, try (from the middle of the screen in a long document) 2<c-k> followed by <c-j><c-j><c-j>.
Jul 25 '18 at 21:05 comment added Wildcard Works great! One odd bug I noticed, that I don't quite understand (but doesn't hinder usability): if you 50<c-k> at the top of the document, and then <c-j>, you get very odd results. Likewise for moving past the bottom.
Feb 14 '18 at 12:09 comment added B Layer I think we're looking at this differently. OP wants to "leave the cursor where it is and scroll the document past it". My interpretation of that as well as what feels correct to me is that I wouldn't want it to keep scrolling text up once the cursor reaches the last line. If I did I'd just use <c-e> at that point. OP's call, though.
Feb 14 '18 at 11:59 comment added Christian Brabandt @B Using this mapping: :nnoremap <expr> <c-j> winline() == winheight(0) ? "\<c-e>".v:count1."j" : "j".v:count1."\<c-e>", :h usr_toc, :norm! Gz. Note, you won't be able to scroll the content upwards, although using <c-e> it still works. This is because the j fails and the mapping is aborted. (And it works, if you go up one line and press <c-j>)
Feb 14 '18 at 11:00 comment added B Layer @ChristianBrabandt I'm not seeing any issue with last line when it's not at the bottom of the window. It doesn't appear to behave any differently than if I hit plain j. I'll look closer but for now I've put the base mappings in.
Feb 14 '18 at 10:59 history edited B Layer CC BY-SA 3.0
Add count handling with v:count1
Feb 14 '18 at 8:05 comment added Christian Brabandt The problem is, if the cursor is on the last line and that line is not the last window line. I guess the mapping should look like this: :nnoremap <expr> <c-j> line('.') == line('$') ? "\<c-e>" : (winline() == winheight(0) ? "\<c-e>".v:count1."j" : "j".v:count1."\<c-e>") I guess, it would be time to refactor this into a function to work correctly ;)
Feb 14 '18 at 7:49 comment added B Layer @ChristianBrabandt Oh, cool, no user command necessary? That variable is ringing some bells for me now that you mention it. As for problems with last line and j I tested it without any issues. (Or do you mean once the count is added?) Will re-check when I'm front of a computer (and try your count idea). Thanks!
Feb 14 '18 at 7:04 comment added Christian Brabandt something like this I guess: :nnoremap <expr> <c-j> winline() == winheight(0) ? "\<c-e>".v:count1."j" : "j".v:count1."\<c-e>" Note: this has still some problems when the cursor is on the last line of a buffer, because then the j will fail
Feb 14 '18 at 6:28 history edited B Layer CC BY-SA 3.0
mention user commands
Feb 14 '18 at 6:18 history edited B Layer CC BY-SA 3.0
Solution to first problem.
Feb 14 '18 at 6:17 history undeleted B Layer
Feb 14 '18 at 6:12 history edited B Layer CC BY-SA 3.0
Solution to first problem.
Feb 14 '18 at 6:02 history edited B Layer CC BY-SA 3.0
added 117 characters in body
Feb 14 '18 at 5:56 history edited B Layer CC BY-SA 3.0
deleted 142 characters in body
Feb 14 '18 at 5:44 history deleted B Layer via Vote
Feb 14 '18 at 5:42 history answered B Layer CC BY-SA 3.0