diff options
author | Akshay <[email protected]> | 2020-02-09 04:54:03 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-02-09 04:54:03 +0000 |
commit | 359a92f770e621828e628f319290bb5736b1f67b (patch) | |
tree | c4c4e5168c22ac13cd62c2ee03ef1a4334aa10fc /docs/posts/bash_harder_with_vim/index.html | |
parent | 75c5c6044170bd6cc23502a6f40f15378269b3d1 (diff) |
new styles, new post!
Diffstat (limited to 'docs/posts/bash_harder_with_vim/index.html')
-rw-r--r-- | docs/posts/bash_harder_with_vim/index.html | 9 |
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’t let your editor get in your way. Here’s a couple of neat | 40 | <p>Bash is tricky, don't let your editor get in your way. Here's a couple of neat |
40 | additions you could make to your <code>vimrc</code> for a better shell programming | 41 | additions you could make to your <code>vimrc</code> for a better shell programming |
41 | experience.</p> | 42 | experience.</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/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>. | |||
61 | a sample from the script used to generate this site: </p> | 62 | a 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 |
64 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" | 65 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" |
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 "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g& | |||
80 | <pre><code>syntax off # previously run commands | 81 | <pre><code>syntax off # previously run commands |
81 | edit index.html # in a buffer! | 82 | edit index.html # in a buffer! |
82 | w | so % | 83 | w | so % |
83 | !echo "new_post.md" | sed -E -e "s/\..+$//g" --snip-- | 84 | !echo "new_post.md" | sed -E -e "s/\..+$//g" --snip-- |
84 | ^--- note the use of '!' | 85 | ^--- note the use of '!' |
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> |