aboutsummaryrefslogtreecommitdiff
path: root/docs/posts/bash_harder_with_vim
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-02-09 04:54:03 +0000
committerAkshay <[email protected]>2020-02-09 04:54:03 +0000
commit359a92f770e621828e628f319290bb5736b1f67b (patch)
treec4c4e5168c22ac13cd62c2ee03ef1a4334aa10fc /docs/posts/bash_harder_with_vim
parent75c5c6044170bd6cc23502a6f40f15378269b3d1 (diff)
new styles, new post!
Diffstat (limited to 'docs/posts/bash_harder_with_vim')
-rw-r--r--docs/posts/bash_harder_with_vim/index.html9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/posts/bash_harder_with_vim/index.html b/docs/posts/bash_harder_with_vim/index.html
index 7d6d7b3..c9303a6 100644
--- a/docs/posts/bash_harder_with_vim/index.html
+++ b/docs/posts/bash_harder_with_vim/index.html
@@ -10,6 +10,7 @@
10 <meta property="og:type" content="website"> 10 <meta property="og:type" content="website">
11 <meta property="og:description" content="a static site {for, by, about} me "> 11 <meta property="og:description" content="a static site {for, by, about} me ">
12 <meta property="og:url" content="https://peppe.rs"> 12 <meta property="og:url" content="https://peppe.rs">
13 <link rel="icon" type="image/x-icon" href="/favicon.png">
13 <title>Bash Harder With Vim - peppe.rs</title> 14 <title>Bash Harder With Vim - peppe.rs</title>
14 <body> 15 <body>
15 <div class="posts"> 16 <div class="posts">
@@ -36,7 +37,7 @@
36 Bash Harder With Vim 37 Bash Harder With Vim
37 </span> 38 </span>
38 <div class="post-text"> 39 <div class="post-text">
39 <p>Bash is tricky, don&#8217;t let your editor get in your way. Here&#8217;s a couple of neat 40 <p>Bash is tricky, don&#39;t let your editor get in your way. Here&#39;s a couple of neat
40additions you could make to your <code>vimrc</code> for a better shell programming 41additions you could make to your <code>vimrc</code> for a better shell programming
41experience.</p> 42experience.</p>
42 43
@@ -44,7 +45,7 @@ experience.</p>
44 45
45<p>Source this script to get started: </p> 46<p>Source this script to get started: </p>
46 47
47<pre><code>runtime ftplugin/man.vim 48<pre><code>runtime ftplugin&#47;man.vim
48</code></pre> 49</code></pre>
49 50
50<p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting 51<p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting
@@ -61,7 +62,7 @@ and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.
61a sample from the script used to generate this site: </p> 62a sample from the script used to generate this site: </p>
62 63
63<pre><code># a substitution to convert snake_case to Title Case With Spaces 64<pre><code># a substitution to convert snake_case to Title Case With Spaces
64echo &quot;$1&quot; | sed -E -e &quot;s/\..+$//g&quot; -e &quot;s/_(.)/ \u\1/g&quot; -e &quot;s/^(.)/\u\1/g&quot; 65echo &#34;$1&#34; | sed -E -e &#34;s&#47;\..+$&#47;&#47;g&#34; -e &#34;s&#47;_(.)&#47; \u\1&#47;g&#34; -e &#34;s&#47;^(.)&#47;\u\1&#47;g&#34;
65</code></pre> 66</code></pre>
66 67
67<p>Instead of dropping into a new shell, just test it out directly from vim!</p> 68<p>Instead of dropping into a new shell, just test it out directly from vim!</p>
@@ -80,7 +81,7 @@ echo &quot;$1&quot; | sed -E -e &quot;s/\..+$//g&quot; -e &quot;s/_(.)/ \u\1/g&
80<pre><code>syntax off # previously run commands 81<pre><code>syntax off # previously run commands
81edit index.html # in a buffer! 82edit index.html # in a buffer!
82w | so % 83w | so %
83!echo &quot;new_post.md&quot; | sed -E -e &quot;s/\..+$//g&quot; --snip-- 84!echo &#34;new_post.md&#34; | sed -E -e &#34;s&#47;\..+$&#47;&#47;g&#34; --snip--
84^--- note the use of &#39;!&#39; 85^--- note the use of &#39;!&#39;
85</code></pre></li> 86</code></pre></li>
86<li><p>Hit enter with the cursor on the line containing your command!</p> 87<li><p>Hit enter with the cursor on the line containing your command!</p>