Skip to content

Commit 361ba8f

Browse files
added meta tags for vim tips
1 parent 651619a commit 361ba8f

File tree

26 files changed

+26
-26
lines changed

26 files changed

+26
-26
lines changed

tips/vim-tip-1/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Vim tip 1: increment/decrement numbers</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content=learnbyexample property=og:title><meta content=website property=og:type><meta content="Learn Python, Regex, Linux, Scripting, Vim, Ebooks, Self-Publishing and Interesting Tech Nuggets." property=og:description><meta content=https://learnbyexample.github.io property=og:url><meta content=https://learnbyexample.github.io/images/learnbyexample.png property=og:image><meta content=1280 property=og:image:width><meta content=640 property=og:image:height><meta content=summary_large_image property=twitter:card><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/tips/vim-tip-1/>Vim tip 1: increment/decrement numbers</a></h1><div class=post__meta><span class=post__time>2021-12-08</span></div></header><div class=post-content><p>Did you know that you can easily increment or decrement a number in Vim?<ul><li><kbd>Ctrl</kbd>+<kbd>a</kbd> will increment the number under the cursor or the first occurrence of a number to the right of the cursor<li><kbd>Ctrl</kbd>+<kbd>x</kbd> will decrement the number under the cursor or the first occurrence of a number to the right of the cursor</ul><p>You can also provide a count prefix:<ul><li><kbd>3</kbd> followed by <kbd>Ctrl</kbd>+<kbd>a</kbd> will add <code>3</code><li><kbd>1000</kbd> followed by <kbd>Ctrl</kbd>+<kbd>x</kbd> will subtract <code>1000</code></ul><p>Numbers prefixed with <code>0</code>, <code>0x</code> and <code>0b</code> will be treated as octal, hexadecimal and binary respectively. You can also use uppercase for <code>x</code> and <code>b</code>. What if you want numbers prefixed with <code>0</code> to be treated as decimal? You can use the <code>nrformats</code> setting as shown below:<pre class=language-vim data-lang=vim style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-vim data-lang=vim><span style=color:#b39f04;>set</span><span> nrformats-=octal
1+
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Vim tip 1: increment/decrement numbers</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content="Vim tip 1: increment/decrement numbers" property=og:title><meta content=website property=og:type><meta content=https://learnbyexample.github.io/vim-tip-1/ property=og:url><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/tips/vim-tip-1/>Vim tip 1: increment/decrement numbers</a></h1><div class=post__meta><span class=post__time>2021-12-08</span></div></header><div class=post-content><p>Did you know that you can easily increment or decrement a number in Vim?<ul><li><kbd>Ctrl</kbd>+<kbd>a</kbd> will increment the number under the cursor or the first occurrence of a number to the right of the cursor<li><kbd>Ctrl</kbd>+<kbd>x</kbd> will decrement the number under the cursor or the first occurrence of a number to the right of the cursor</ul><p>You can also provide a count prefix:<ul><li><kbd>3</kbd> followed by <kbd>Ctrl</kbd>+<kbd>a</kbd> will add <code>3</code><li><kbd>1000</kbd> followed by <kbd>Ctrl</kbd>+<kbd>x</kbd> will subtract <code>1000</code></ul><p>Numbers prefixed with <code>0</code>, <code>0x</code> and <code>0b</code> will be treated as octal, hexadecimal and binary respectively. You can also use uppercase for <code>x</code> and <code>b</code>. What if you want numbers prefixed with <code>0</code> to be treated as decimal? You can use the <code>nrformats</code> setting as shown below:<pre class=language-vim data-lang=vim style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-vim data-lang=vim><span style=color:#b39f04;>set</span><span> nrformats-=octal
22
</span></code></pre><p>Decimal numbers prefixed with <code>-</code> will be treated as negative numbers. For example, using <kbd>Ctrl</kbd>+<kbd>a</kbd> on <code>-100</code> will give you <code>-99</code>. While this is handy, this trips me up often when dealing with date formats like 2021-12-08.<p><img alt=info src=/images/info.svg> See <a href=https://vimhelp.org/change.txt.html#CTRL-A>:h ctrl-a</a>, <a href=https://vimhelp.org/change.txt.html#CTRL-X>:h ctrl-x</a> and <a href=https://vimhelp.org/options.txt.html#%27nrformats%27>:h nrformats</a> for documentation.<p><strong>Video demo</strong>:<p align=center><iframe allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" allowfullscreen frameborder=0 height=315 loading=lazy src=https://www.youtube.com/embed/slB98yJ7lv0 width=560></iframe></p><br><p><img alt=info src=/images/info.svg> See also my <a href=https://learnbyexample.github.io/curated_resources/vim.html>curated list of resources for Vim</a> and <a href=https://github.com/learnbyexample/vim_reference>Vim Reference Guide</a>.</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/vim/>#vim</a><a href=https://learnbyexample.github.io/tags/tip/>#tip</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/tips/vim-tip-2/>← Vim tip 2: indent/unindent lines</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>

tips/vim-tip-10/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Vim tip 10: Undo and Redo</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content=learnbyexample property=og:title><meta content=website property=og:type><meta content="Learn Python, Regex, Linux, Scripting, Vim, Ebooks, Self-Publishing and Interesting Tech Nuggets." property=og:description><meta content=https://learnbyexample.github.io property=og:url><meta content=https://learnbyexample.github.io/images/learnbyexample.png property=og:image><meta content=1280 property=og:image:width><meta content=640 property=og:image:height><meta content=summary_large_image property=twitter:card><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/tips/vim-tip-10/>Vim tip 10: Undo and Redo</a></h1><div class=post__meta><span class=post__time>2022-06-15</span></div></header><div class=post-content><p>In Normal mode, you can undo and redo changes using the following commands:<ul><li><kbd>u</kbd> undo last change <ul><li>press <kbd>u</kbd> again for further undos</ul><li><kbd>U</kbd> undo latest changes on last edited line<li><kbd>Ctrl</kbd>+<kbd>r</kbd> redo a change undone by <kbd>u</kbd><li><kbd>U</kbd> redo changes undone by <kbd>U</kbd></ul><p><img alt=info src=/images/info.svg> See <a href=https://vimhelp.org/usr_32.txt.html#32.3>:h 32.3</a> for details on <kbd>g-</kbd> and <kbd>g+</kbd> commands that you can use to undo branches.<p><strong>Video demo</strong>:<p align=center><iframe allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" allowfullscreen frameborder=0 height=315 loading=lazy src=https://www.youtube.com/embed/ScTAZ0f6e-Q width=560></iframe></p><br><p><img alt=info src=/images/info.svg> See also my <a href=https://github.com/learnbyexample/vim_reference>Vim Reference Guide</a> and <a href=https://learnbyexample.github.io/curated_resources/vim.html>curated list of resources for Vim</a>.</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/vim/>#vim</a><a href=https://learnbyexample.github.io/tags/tip/>#tip</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/tips/vim-tip-11/>← Vim tip 11: replace characters in Normal mode</a><br><p><a class=next href=https://learnbyexample.github.io/tips/vim-tip-9/>Vim tip 9: named registers →</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>
1+
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Vim tip 10: Undo and Redo</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content="Vim tip 10: Undo and Redo" property=og:title><meta content=website property=og:type><meta content=https://learnbyexample.github.io/vim-tip-10/ property=og:url><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/tips/vim-tip-10/>Vim tip 10: Undo and Redo</a></h1><div class=post__meta><span class=post__time>2022-06-15</span></div></header><div class=post-content><p>In Normal mode, you can undo and redo changes using the following commands:<ul><li><kbd>u</kbd> undo last change <ul><li>press <kbd>u</kbd> again for further undos</ul><li><kbd>U</kbd> undo latest changes on last edited line<li><kbd>Ctrl</kbd>+<kbd>r</kbd> redo a change undone by <kbd>u</kbd><li><kbd>U</kbd> redo changes undone by <kbd>U</kbd></ul><p><img alt=info src=/images/info.svg> See <a href=https://vimhelp.org/usr_32.txt.html#32.3>:h 32.3</a> for details on <kbd>g-</kbd> and <kbd>g+</kbd> commands that you can use to undo branches.<p><strong>Video demo</strong>:<p align=center><iframe allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" allowfullscreen frameborder=0 height=315 loading=lazy src=https://www.youtube.com/embed/ScTAZ0f6e-Q width=560></iframe></p><br><p><img alt=info src=/images/info.svg> See also my <a href=https://github.com/learnbyexample/vim_reference>Vim Reference Guide</a> and <a href=https://learnbyexample.github.io/curated_resources/vim.html>curated list of resources for Vim</a>.</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/vim/>#vim</a><a href=https://learnbyexample.github.io/tags/tip/>#tip</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/tips/vim-tip-11/>← Vim tip 11: replace characters in Normal mode</a><br><p><a class=next href=https://learnbyexample.github.io/tips/vim-tip-9/>Vim tip 9: named registers →</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>

0 commit comments

Comments
 (0)