aboutsummaryrefslogtreecommitdiff
path: root/docs/posts/bash_harder_with_vim/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/posts/bash_harder_with_vim/index.html')
-rw-r--r--docs/posts/bash_harder_with_vim/index.html22
1 files changed, 15 insertions, 7 deletions
diff --git a/docs/posts/bash_harder_with_vim/index.html b/docs/posts/bash_harder_with_vim/index.html
index 099733a..96210d5 100644
--- a/docs/posts/bash_harder_with_vim/index.html
+++ b/docs/posts/bash_harder_with_vim/index.html
@@ -28,7 +28,7 @@
28 31/07 — 2019 28 31/07 — 2019
29 <div class="stats"> 29 <div class="stats">
30 <span class="stats-number"> 30 <span class="stats-number">
31 24.37 31 24.38
32 </span> 32 </span>
33 <span class="stats-unit">cm</span> 33 <span class="stats-unit">cm</span>
34 &nbsp 34 &nbsp
@@ -42,18 +42,26 @@
42 Bash Harder With Vim 42 Bash Harder With Vim
43 </h1> 43 </h1>
44 <div class="post-text"> 44 <div class="post-text">
45 <p>Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat additions you could make to your <code>vimrc</code> for a better shell programming experience.</p> 45 <p>Bash is tricky, don’t let your editor get in your way. Here’s a
46couple of neat additions you could make to your <code>vimrc</code> for a
47better shell programming experience.</p>
46<h3 id="man-pages-inside-vim">Man pages inside vim</h3> 48<h3 id="man-pages-inside-vim">Man pages inside vim</h3>
47<p>Source this script to get started:</p> 49<p>Source this script to get started:</p>
48<pre><code>runtime ftplugin/man.vim</code></pre> 50<pre><code>runtime ftplugin/man.vim</code></pre>
49<p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.</p> 51<p>Now, you can open manpages inside vim with <code>:Man</code>! It adds
50<p>By default, the manpage is opened in a horizontal split, I prefer using a new tab:</p> 52nicer syntax highlighting and the ability to jump around with
53<code>Ctrl-]</code> and <code>Ctrl-T</code>.</p>
54<p>By default, the manpage is opened in a horizontal split, I prefer
55using a new tab:</p>
51<pre><code>let g:ft_man_open_mode = &#39;tab&#39;</code></pre> 56<pre><code>let g:ft_man_open_mode = &#39;tab&#39;</code></pre>
52<h3 id="scratchpad-to-test-your-commands">Scratchpad to test your commands</h3> 57<h3 id="scratchpad-to-test-your-commands">Scratchpad to test your
53<p>I often test my <code>sed</code> substitutions, here is a sample from the script used to generate this site:</p> 58commands</h3>
59<p>I often test my <code>sed</code> substitutions, here is a sample from
60the script used to generate this site:</p>
54<pre><code># a substitution to convert snake_case to Title Case With Spaces 61<pre><code># a substitution to convert snake_case to Title Case With Spaces
55echo &quot;$1&quot; | sed -E -e &quot;s/\..+$//g&quot; -e &quot;s/_(.)/ \u\1/g&quot; -e &quot;s/^(.)/\u\1/g&quot;</code></pre> 62echo &quot;$1&quot; | sed -E -e &quot;s/\..+$//g&quot; -e &quot;s/_(.)/ \u\1/g&quot; -e &quot;s/^(.)/\u\1/g&quot;</code></pre>
56<p>Instead of dropping into a new shell, just test it out directly from vim!</p> 63<p>Instead of dropping into a new shell, just test it out directly from
64vim!</p>
57<ul> 65<ul>
58<li>Yank the line into a register:</li> 66<li>Yank the line into a register:</li>
59</ul> 67</ul>