aboutsummaryrefslogtreecommitdiff
path: root/docs/posts/hold_position!/index.html
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-04-16 09:10:50 +0100
committerAkshay <[email protected]>2020-04-16 09:10:50 +0100
commit2a778912251874f9b808f82e61244efcd12210aa (patch)
tree72cd692749c36f068fe22a32ede51a88a65bc759 /docs/posts/hold_position!/index.html
parentd71a288d944959057064d64ce03cad759a42ba06 (diff)
rerender with pandoc
Diffstat (limited to 'docs/posts/hold_position!/index.html')
-rw-r--r--docs/posts/hold_position!/index.html47
1 files changed, 28 insertions, 19 deletions
diff --git a/docs/posts/hold_position!/index.html b/docs/posts/hold_position!/index.html
index 58851c5..b14d41a 100644
--- a/docs/posts/hold_position!/index.html
+++ b/docs/posts/hold_position!/index.html
@@ -37,27 +37,36 @@
37 Hold Position! 37 Hold Position!
38 </h1> 38 </h1>
39 <div class="post-text"> 39 <div class="post-text">
40 <p>Often times, when I run a vim command that makes &#8220;big&#8221; changes to a file (a 40 <!DOCTYPE html>
41macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> 41<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
42 42<head>
43 <meta charset="utf-8" />
44 <meta name="generator" content="pandoc" />
45 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
46 <title>hold_position!</title>
47 <style>
48 code{white-space: pre-wrap;}
49 span.smallcaps{font-variant: small-caps;}
50 span.underline{text-decoration: underline;}
51 div.column{display: inline-block; vertical-align: top; width: 50%;}
52 div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
53 ul.task-list{list-style: none;}
54 </style>
55 <!--[if lt IE 9]>
56 <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
57 <![endif]-->
58</head>
59<body>
60<p>Often times, when I run a vim command that makes “big” changes to a file (a macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p>
43<p><em>Save position with <code>winsaveview()</code>!</em></p> 61<p><em>Save position with <code>winsaveview()</code>!</em></p>
44 62<p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> 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.</p>
45<p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information 63<p>Before running our command (one that jumps around the buffer, a lot), we save our view, and restore it once its done, with <code>winrestview</code>.</p>
46about the view of the current window. This includes the cursor line number,
47cursor coloumn, the top most line in the window and a couple of other values,
48none of which concern us.</p>
49
50<p>Before running our command (one that jumps around the buffer, a lot), we save
51our view, and restore it once its done, with <code>winrestview</code>.</p>
52
53<pre><code>let view = winsaveview() 64<pre><code>let view = winsaveview()
54s&#47;\s\+$&#47;&#47;gc &#34; find and (confirm) replace trailing blanks 65s/\s\+$//gc &quot; find and (confirm) replace trailing blanks
55winrestview(view) &#34; restore our original view! 66winrestview(view) &quot; restore our original view!</code></pre>
56</code></pre> 67<p>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.</p>
57 68</body>
58<p>It might seem a little overkill in the above example, just use `` (double 69</html>
59backticks) instead, but it comes in handy when you run your file through
60heavier filtering.</p>
61 70
62 </div> 71 </div>
63 72