From ada45c1bea838e5f38f24fe37e558c1b7959ae28 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 16 Apr 2020 20:40:45 +0530 Subject: redo pandoc commands to print fragments only --- docs/posts/hold_position!/index.html | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'docs/posts/hold_position!/index.html') diff --git a/docs/posts/hold_position!/index.html b/docs/posts/hold_position!/index.html index b14d41a..61e4768 100644 --- a/docs/posts/hold_position!/index.html +++ b/docs/posts/hold_position!/index.html @@ -2,6 +2,7 @@ + @@ -37,27 +38,7 @@ Hold Position!
- - - - - - - hold_position! - - - - -

Often times, when I run a vim command that makes “big” changes to a file (a macro or a :vimgrep command) I lose my original position and feel disoriented.

+

Often times, when I run a vim command that makes “big” changes to a file (a macro or a :vimgrep command) I lose my original position and feel disoriented.

Save position with winsaveview()!

The winsaveview() command returns a Dictionary that contains information about the view of the current window. This includes the cursor line number, cursor coloumn, the top most line in the window and a couple of other values, none of which concern us.

Before running our command (one that jumps around the buffer, a lot), we save our view, and restore it once its done, with winrestview.

@@ -65,13 +46,15 @@ s/\s\+$//gc " find and (confirm) replace trailing blanks winrestview(view) " restore our original view!

It might seem a little overkill in the above example, just use `` (double backticks) instead, but it comes in handy when you run your file through heavier filtering.

- -
- Hi. Subscribe + Hi. +

I'm Akshay, I go by nerd or nerdypepper on the internet.

I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. -- cgit v1.2.3