Skip to content

Commit 996f5d3

Browse files
added 18th Vim tip
1 parent db42f2d commit 996f5d3

File tree

10 files changed

+47
-9
lines changed

10 files changed

+47
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ I'm addicted to reading fantasy/sci-fi books, so I have a [blog](https://learnby
6161

6262
## Tips
6363

64+
* [Vim tip 18: moving within long lines](https://learnbyexample.github.io/tips/vim-tip-18/)
6465
* [CLI tip 19: extended globs](https://learnbyexample.github.io/tips/cli-tip-19/)
6566
* [Python tip 19: manipulating string case](https://learnbyexample.github.io/tips/python-tip-19/)
6667
* [Vim tip 17: setting options](https://learnbyexample.github.io/tips/vim-tip-17/)

atom.xml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,39 @@
55
<link href="https://learnbyexample.github.io/atom.xml" rel="self" type="application/atom+xml"/>
66
<link href="https://learnbyexample.github.io"/>
77
<generator uri="https://www.getzola.org/">Zola</generator>
8-
<updated>2022-11-25T00:00:00+00:00</updated>
8+
<updated>2022-11-29T00:00:00+00:00</updated>
99
<id>https://learnbyexample.github.io/atom.xml</id>
10+
<entry xml:lang="en">
11+
<title>Vim tip 18: moving within long lines</title>
12+
<published>2022-11-29T00:00:00+00:00</published>
13+
<updated>2022-11-29T00:00:00+00:00</updated>
14+
<link rel="alternate" href="https://learnbyexample.github.io/tips/vim-tip-18/" type="text/html"/>
15+
<id>https://learnbyexample.github.io/tips/vim-tip-18/</id>
16+
<content type="html">&lt;p&gt;Here are Normal mode commands you can use to move within long lines that are spread over multiple screen lines:&lt;&#x2F;p&gt;
17+
&lt;ul&gt;
18+
&lt;li&gt;&lt;kbd&gt;g0&lt;&#x2F;kbd&gt; move to the beginning of the current screen line&lt;&#x2F;li&gt;
19+
&lt;li&gt;&lt;kbd&gt;g^&lt;&#x2F;kbd&gt; move to the first non-blank character of the current screen line&lt;&#x2F;li&gt;
20+
&lt;li&gt;&lt;kbd&gt;g$&lt;&#x2F;kbd&gt; move to the end of the current screen line&lt;&#x2F;li&gt;
21+
&lt;li&gt;&lt;kbd&gt;gj&lt;&#x2F;kbd&gt; move down by one screen line, prefix a count to move down by that many screen lines&lt;&#x2F;li&gt;
22+
&lt;li&gt;&lt;kbd&gt;gk&lt;&#x2F;kbd&gt; move up by one screen line, prefix a count to move up by that many screen lines&lt;&#x2F;li&gt;
23+
&lt;li&gt;&lt;kbd&gt;gm&lt;&#x2F;kbd&gt; move to the middle of the current screen line
24+
&lt;ul&gt;
25+
&lt;li&gt;&lt;strong&gt;Note&lt;&#x2F;strong&gt; that this is based on the screen width, not the number of characters in the line!&lt;&#x2F;li&gt;
26+
&lt;&#x2F;ul&gt;
27+
&lt;&#x2F;li&gt;
28+
&lt;li&gt;&lt;kbd&gt;gM&lt;&#x2F;kbd&gt; move to the middle of the current line
29+
&lt;ul&gt;
30+
&lt;li&gt;&lt;strong&gt;Note&lt;&#x2F;strong&gt; that this is based on the total number of characters in the line&lt;&#x2F;li&gt;
31+
&lt;&#x2F;ul&gt;
32+
&lt;&#x2F;li&gt;
33+
&lt;&#x2F;ul&gt;
34+
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;info.svg&quot; alt=&quot;info&quot; &#x2F;&gt; See &lt;a href=&quot;https:&#x2F;&#x2F;vimhelp.org&#x2F;motion.txt.html#left-right-motions&quot;&gt;:h left-right-motions&lt;&#x2F;a&gt; for more details.&lt;&#x2F;p&gt;
35+
&lt;p&gt;&lt;strong&gt;Video demo&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
36+
&lt;p align=&quot;center&quot;&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; loading=&quot;lazy&quot; src=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;embed&#x2F;VfN_LJIiyaI&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;&#x2F;iframe&gt;&lt;&#x2F;p&gt;
37+
&lt;br&gt;
38+
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;info.svg&quot; alt=&quot;info&quot; &#x2F;&gt; See also my &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;vim_reference&quot;&gt;Vim Reference Guide&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;learnbyexample.github.io&#x2F;curated_resources&#x2F;vim.html&quot;&gt;curated list of resources for Vim&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
39+
</content>
40+
</entry>
1041
<entry xml:lang="en">
1142
<title>CLI tip 19: extended globs</title>
1243
<published>2022-11-23T00:00:00+00:00</published>
@@ -5356,7 +5387,7 @@ The substitution works from start of the line for every iteration of the while l
53565387
<entry xml:lang="en">
53575388
<title>Customizing pandoc to generate beautiful pdf and epub from markdown</title>
53585389
<published>2020-07-21T00:00:00+00:00</published>
5359-
<updated>2022-08-11T00:00:00+00:00</updated>
5390+
<updated>2022-11-29T00:00:00+00:00</updated>
53605391
<link rel="alternate" href="https://learnbyexample.github.io/customizing-pandoc/" type="text/html"/>
53615392
<id>https://learnbyexample.github.io/customizing-pandoc/</id>
53625393
<content type="html">&lt;p&gt;Either you&#x27;ve already heard of &lt;code&gt;pandoc&lt;&#x2F;code&gt; or if you have searched online for &lt;code&gt;markdown&lt;&#x2F;code&gt; to &lt;code&gt;pdf&lt;&#x2F;code&gt; or similar, you are sure to come across &lt;code&gt;pandoc&lt;&#x2F;code&gt;. This tutorial will help you use &lt;code&gt;pandoc&lt;&#x2F;code&gt; to generate &lt;code&gt;pdf&lt;&#x2F;code&gt; and &lt;code&gt;epub&lt;&#x2F;code&gt; from a &lt;a href=&quot;https:&#x2F;&#x2F;github.github.com&#x2F;gfm&#x2F;&quot;&gt;GitHub style markdown&lt;&#x2F;a&gt; file. The main motivation for this blog post is to highlight what customizations I did to generate &lt;code&gt;pdf&lt;&#x2F;code&gt; and &lt;code&gt;epub&lt;&#x2F;code&gt; versions for &lt;a href=&quot;https:&#x2F;&#x2F;learnbyexample.github.io&#x2F;books&#x2F;&quot;&gt;self-publishing my ebooks&lt;&#x2F;a&gt;. It wasn&#x27;t easy to arrive at the setup I ended up with, so I hope this will be useful for those looking to use &lt;code&gt;pandoc&lt;&#x2F;code&gt; to generate &lt;code&gt;pdf&lt;&#x2F;code&gt; and &lt;code&gt;epub&lt;&#x2F;code&gt; formats. This guide is specifically aimed at technical books that has code snippets.&lt;&#x2F;p&gt;
@@ -5588,6 +5619,7 @@ no VAL is specified, the key will be given the value true.&lt;&#x2F;p&gt;
55885619
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.thedigitalcatbooks.com&#x2F;maubook-introduction&#x2F;&quot;&gt;Mau&lt;&#x2F;a&gt; — template-based markup language, heavily inspired by AsciiDoc&lt;&#x2F;li&gt;
55895620
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asciidoctor.org&#x2F;docs&#x2F;what-is-asciidoc&#x2F;&quot;&gt;Asciidoctor&lt;&#x2F;a&gt;
55905621
&lt;ul&gt;
5622+
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;daneah&#x2F;asciidoc-book-template&quot;&gt;Asciidoc book template&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
55915623
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;shape-of-code.coding-guidelines.com&#x2F;2019&#x2F;08&#x2F;11&#x2F;my-books-pdf-generation-workflow&#x2F;&quot;&gt;pdf generation workflow with Asciidoc&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
55925624
&lt;&#x2F;ul&gt;
55935625
&lt;&#x2F;li&gt;

customizing-pandoc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
</span><span style=color:#5597d6;> --metadata</span><span style=color:#72ab00;>=</span><span>lang:</span><span style=color:#d07711;>"en-US" </span><span>\
8282
</span><span style=color:#5597d6;> --metadata</span><span style=color:#72ab00;>=</span><span>cover-image:</span><span style=color:#d07711;>"cover.png" </span><span>\
8383
</span><span style=color:#5597d6;> -o </span><span style=color:#d07711;>"$</span><span style=color:#acb3c2;>2</span><span style=color:#d07711;>"
84-
</span></code></pre><br><h2 id=resource-links>Resource links<a aria-label="Anchor link for: resource-links" class=zola-anchor href=#resource-links>🔗</a></h2><ul><li><a href=https://pandoc.org/MANUAL.html>pandoc: manual</a><li><a href=https://pandoc.org/demos.html>pandoc: demos</a><li><a href=https://github.com/jgm/pandoc/wiki/Pandoc-Tricks>pandoc: tips and tricks</a></ul><p><strong>More options and workflows for generating ebooks</strong>:<ul><li><a href=https://github.com/Wandmalfarbe/pandoc-latex-template>pandoc-latex-template</a> — a clean pandoc LaTeX template to convert your markdown files to PDF or LaTeX<li><a href=https://keleshev.com/my-book-writing-setup/>Writing a book with pandoc, make, and vim</a><li><a href=https://quarto.org/>Quarto</a> — open source scientific and technical publishing system built on Pandoc<li><a href=https://jupyterbook.org/intro.html>Jupyter Book</a> — open source project for building beautiful, publication-quality books and documents from computational material <ul><li>See also <a href=https://github.com/fastai/fastdoc>fastdoc</a> — the output of fastdoc is an asciidoc file for each input notebook. You can then use asciidoctor to convert that to HTML, DocBook, epub, mobi, and so forth</ul><li><a href=https://www.thedigitalcatbooks.com/maubook-introduction/>Mau</a> — template-based markup language, heavily inspired by AsciiDoc<li><a href=https://asciidoctor.org/docs/what-is-asciidoc/>Asciidoctor</a> <ul><li><a href=https://shape-of-code.coding-guidelines.com/2019/08/11/my-books-pdf-generation-workflow/>pdf generation workflow with Asciidoc</a></ul><li><a href=https://www.sphinx-doc.org/en/stable/index.html>Sphinx</a> <ul><li><a href=https://digitalsuperpowers.com/blog/2019-02-16-publishing-ebook.html>Self-publishing a book with reStructuredText, Sphinx, Calibre, and vim</a></ul><li><a href=https://bookdown.org/home/>Bookdown</a><li><a href=https://orgmode.org/>Emacs orgmode</a><li><a href=https://casual-effects.com/markdeep/>Markdeep</a></ul><p><strong>Miscellaneous</strong><ul><li><a href=https://nickjanetakis.com/blog/vim-is-saving-me-hours-of-work-when-writing-books-and-courses>Vim is saving me hours of work when writing books & courses</a><li><a href=https://joecmarshall.com/posts/book-writing-environment/>Writing a Book with Unix</a><li><a href=https://askubuntu.com/questions/3697/how-do-i-install-fonts>askubuntu: How do I install fonts?</a><li><a href=https://tex.stackexchange.com/questions/9533/what-best-combination-of-fonts-for-serif-sans-and-mono-do-you-recommend>tex.stackexchange: What best combination of fonts for Serif, Sans, and Mono do you recommend?</a><li><a href=https://tug.org/FontCatalogue/>LaTeX font catalogue</a><li><a href=https://github.com/karthik/markdown_science/wiki/Tools-to-support-your-markdown-authoring>Tools to support markdown authoring</a><li><a href=https://picular.co/>picular: search engine for colors</a> and <a href=https://www.colorhexa.com/>colorhexa</a><li><a href="https://ebooks.stackexchange.com/questions?sort=votes">ebooks.stackexchange</a></ul></div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/tutorial/>#tutorial</a><a href=https://learnbyexample.github.io/tags/ebook-generation/>#ebook-generation</a><a href=https://learnbyexample.github.io/tags/pandoc/>#pandoc</a><a href=https://learnbyexample.github.io/tags/xelatex/>#xelatex</a><a href=https://learnbyexample.github.io/tags/markdown/>#markdown</a><a href=https://learnbyexample.github.io/tags/pdf/>#pdf</a><a href=https://learnbyexample.github.io/tags/epub/>#epub</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/python-intermediate/>← I know Python basics, what next?</a><br><p><a class=next href=https://learnbyexample.github.io/javascript-regexp-cheatsheet/>JavaScript regular expressions cheatsheet and examples →</a><br></div><hr color=#e6e6e6><p>📰 Use <a href=https://learnbyexample.github.io/atom.xml>this link</a> for the Atom feed. <br> ✅ Follow me on <a href=https://twitter.com/learn_byexample>Twitter</a>, <a href=https://github.com/learnbyexample>GitHub</a> and <a href=https://www.youtube.com/c/learnbyexample42>Youtube</a> for interesting tech nuggets. <br> 📧 Subscribe to <a href=https://learnbyexample.gumroad.com/l/learnbyexample-weekly>learnbyexample weekly</a> for programming resources, tips, tools, free ebooks and more (free newsletter, delivered every Friday).<hr color=#e6e6e6></div></article></div></main></div><script src=https://learnbyexample.github.io/even.js></script>
84+
</span></code></pre><br><h2 id=resource-links>Resource links<a aria-label="Anchor link for: resource-links" class=zola-anchor href=#resource-links>🔗</a></h2><ul><li><a href=https://pandoc.org/MANUAL.html>pandoc: manual</a><li><a href=https://pandoc.org/demos.html>pandoc: demos</a><li><a href=https://github.com/jgm/pandoc/wiki/Pandoc-Tricks>pandoc: tips and tricks</a></ul><p><strong>More options and workflows for generating ebooks</strong>:<ul><li><a href=https://github.com/Wandmalfarbe/pandoc-latex-template>pandoc-latex-template</a> — a clean pandoc LaTeX template to convert your markdown files to PDF or LaTeX<li><a href=https://keleshev.com/my-book-writing-setup/>Writing a book with pandoc, make, and vim</a><li><a href=https://quarto.org/>Quarto</a> — open source scientific and technical publishing system built on Pandoc<li><a href=https://jupyterbook.org/intro.html>Jupyter Book</a> — open source project for building beautiful, publication-quality books and documents from computational material <ul><li>See also <a href=https://github.com/fastai/fastdoc>fastdoc</a> — the output of fastdoc is an asciidoc file for each input notebook. You can then use asciidoctor to convert that to HTML, DocBook, epub, mobi, and so forth</ul><li><a href=https://www.thedigitalcatbooks.com/maubook-introduction/>Mau</a> — template-based markup language, heavily inspired by AsciiDoc<li><a href=https://asciidoctor.org/docs/what-is-asciidoc/>Asciidoctor</a> <ul><li><a href=https://github.com/daneah/asciidoc-book-template>Asciidoc book template</a><li><a href=https://shape-of-code.coding-guidelines.com/2019/08/11/my-books-pdf-generation-workflow/>pdf generation workflow with Asciidoc</a></ul><li><a href=https://www.sphinx-doc.org/en/stable/index.html>Sphinx</a> <ul><li><a href=https://digitalsuperpowers.com/blog/2019-02-16-publishing-ebook.html>Self-publishing a book with reStructuredText, Sphinx, Calibre, and vim</a></ul><li><a href=https://bookdown.org/home/>Bookdown</a><li><a href=https://orgmode.org/>Emacs orgmode</a><li><a href=https://casual-effects.com/markdeep/>Markdeep</a></ul><p><strong>Miscellaneous</strong><ul><li><a href=https://nickjanetakis.com/blog/vim-is-saving-me-hours-of-work-when-writing-books-and-courses>Vim is saving me hours of work when writing books & courses</a><li><a href=https://joecmarshall.com/posts/book-writing-environment/>Writing a Book with Unix</a><li><a href=https://askubuntu.com/questions/3697/how-do-i-install-fonts>askubuntu: How do I install fonts?</a><li><a href=https://tex.stackexchange.com/questions/9533/what-best-combination-of-fonts-for-serif-sans-and-mono-do-you-recommend>tex.stackexchange: What best combination of fonts for Serif, Sans, and Mono do you recommend?</a><li><a href=https://tug.org/FontCatalogue/>LaTeX font catalogue</a><li><a href=https://github.com/karthik/markdown_science/wiki/Tools-to-support-your-markdown-authoring>Tools to support markdown authoring</a><li><a href=https://picular.co/>picular: search engine for colors</a> and <a href=https://www.colorhexa.com/>colorhexa</a><li><a href="https://ebooks.stackexchange.com/questions?sort=votes">ebooks.stackexchange</a></ul></div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/tutorial/>#tutorial</a><a href=https://learnbyexample.github.io/tags/ebook-generation/>#ebook-generation</a><a href=https://learnbyexample.github.io/tags/pandoc/>#pandoc</a><a href=https://learnbyexample.github.io/tags/xelatex/>#xelatex</a><a href=https://learnbyexample.github.io/tags/markdown/>#markdown</a><a href=https://learnbyexample.github.io/tags/pdf/>#pdf</a><a href=https://learnbyexample.github.io/tags/epub/>#epub</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/python-intermediate/>← I know Python basics, what next?</a><br><p><a class=next href=https://learnbyexample.github.io/javascript-regexp-cheatsheet/>JavaScript regular expressions cheatsheet and examples →</a><br></div><hr color=#e6e6e6><p>📰 Use <a href=https://learnbyexample.github.io/atom.xml>this link</a> for the Atom feed. <br> ✅ Follow me on <a href=https://twitter.com/learn_byexample>Twitter</a>, <a href=https://github.com/learnbyexample>GitHub</a> and <a href=https://www.youtube.com/c/learnbyexample42>Youtube</a> for interesting tech nuggets. <br> 📧 Subscribe to <a href=https://learnbyexample.gumroad.com/l/learnbyexample-weekly>learnbyexample weekly</a> for programming resources, tips, tools, free ebooks and more (free newsletter, delivered every Friday).<hr color=#e6e6e6></div></article></div></main></div><script src=https://learnbyexample.github.io/even.js></script>

sitemap.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</url>
3737
<url>
3838
<loc>https://learnbyexample.github.io/customizing-pandoc/</loc>
39-
<lastmod>2022-08-11</lastmod>
39+
<lastmod>2022-11-29</lastmod>
4040
</url>
4141
<url>
4242
<loc>https://learnbyexample.github.io/duplicates-irrespective-field-order/</loc>
@@ -588,6 +588,10 @@
588588
<loc>https://learnbyexample.github.io/tips/vim-tip-17/</loc>
589589
<lastmod>2022-11-08</lastmod>
590590
</url>
591+
<url>
592+
<loc>https://learnbyexample.github.io/tips/vim-tip-18/</loc>
593+
<lastmod>2022-11-29</lastmod>
594+
</url>
591595
<url>
592596
<loc>https://learnbyexample.github.io/tips/vim-tip-2/</loc>
593597
<lastmod>2021-12-29</lastmod>

0 commit comments

Comments
 (0)