snipt

Ctrl+h for KB shortcuts

Bash

Undo and redo

1
2
3
4
5
6
7
8
# Undo the last action
U

# Undo all the latest changes that were made to the current line
Shift + U

# Redo
Ctrl + R
https://snipt.net/embed/d7045646f5ae6a1e1b8c154624f2e36b/
/raw/d7045646f5ae6a1e1b8c154624f2e36b/
d7045646f5ae6a1e1b8c154624f2e36b
bash
Bash
8
2019-07-15T01:56:04
True
False
False
/api/public/snipt/26121/
undo-and-redo
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Undo the last action</span> </span><span id="L-2"><a name="L-2"></a>U </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Undo all the latest changes that were made to the current line</span> </span><span id="L-5"><a name="L-5"></a>Shift + U </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c1"># Redo</span> </span><span id="L-8"><a name="L-8"></a>Ctrl + R </span></pre></div> </td></tr></table>
vim

Bash

Go to the next/previous result

1
2
3
4
5
# Next result
N

# Previous result
Shift + N
https://snipt.net/embed/d47276b35547c7f05338752c84e22ce3/
/raw/d47276b35547c7f05338752c84e22ce3/
d47276b35547c7f05338752c84e22ce3
bash
Bash
5
2019-07-13T05:34:55
True
False
False
/api/public/snipt/26120/
go-to-the-nextprevious-result
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Next result</span> </span><span id="L-2"><a name="L-2"></a>N </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Previous result</span> </span><span id="L-5"><a name="L-5"></a>Shift + N </span></pre></div> </td></tr></table>
vim

Bash

Close all buffers

:bufdo bd
https://snipt.net/embed/2584f44983c513bec6e6ec9e97c41372/
/raw/2584f44983c513bec6e6ec9e97c41372/
2584f44983c513bec6e6ec9e97c41372
bash
Bash
1
2019-07-16T17:28:35
True
False
False
/api/public/snipt/26082/
close-all-buffers
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>:bufdo bd </span></pre></div> </td></tr></table>
vim

Bash

Copy and paste

1
2
3
4
5
6
7
8
1. Place the cursor at the beginning of the block you want to COPY
2. Mark it with my
3. Go to the end of the block
4. Copy it with y'y
5. Go to the new location that you want to PASTE those text
6. Press P

http://vim.wikia.com/wiki/Copy,_cut_and_paste
https://snipt.net/embed/d8d1d308ef0406dd24152e0ef018317b/
/raw/d8d1d308ef0406dd24152e0ef018317b/
d8d1d308ef0406dd24152e0ef018317b
bash
Bash
8
2019-06-13T21:53:45
True
False
False
/api/public/snipt/25731/
copy-and-paste
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>1. Place the cursor at the beginning of the block you want to COPY </span><span id="L-2"><a name="L-2"></a>2. Mark it with my </span><span id="L-3"><a name="L-3"></a>3. Go to the end of the block </span><span id="L-4"><a name="L-4"></a>4. Copy it with y<span class="err">&#39;</span>y </span><span id="L-5"><a name="L-5"></a>5. Go to the new location that you want to PASTE those text </span><span id="L-6"><a name="L-6"></a>6. Press P </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>http://vim.wikia.com/wiki/Copy,_cut_and_paste </span></pre></div> </td></tr></table>
vim

Bash

Cut and paste

1
2
3
4
5
6
7
8
1. Place the cursor at the beginning of the block you want to CUT
2. Mark it with md
3. Go to the end of the block
4. Cut it with d'd
5. Go to the new location that you want to PASTE those text
6. Press P

http://vim.wikia.com/wiki/Copy,_cut_and_paste
https://snipt.net/embed/448b81c0728b71dfe7d5393cfaee6f01/
/raw/448b81c0728b71dfe7d5393cfaee6f01/
448b81c0728b71dfe7d5393cfaee6f01
bash
Bash
8
2019-06-09T13:05:00
True
False
False
/api/public/snipt/25730/
cut-and-paste
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>1. Place the cursor at the beginning of the block you want to CUT </span><span id="L-2"><a name="L-2"></a>2. Mark it with md </span><span id="L-3"><a name="L-3"></a>3. Go to the end of the block </span><span id="L-4"><a name="L-4"></a>4. Cut it with d<span class="err">&#39;</span>d </span><span id="L-5"><a name="L-5"></a>5. Go to the new location that you want to PASTE those text </span><span id="L-6"><a name="L-6"></a>6. Press P </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>http://vim.wikia.com/wiki/Copy,_cut_and_paste </span></pre></div> </td></tr></table>
vim

Bash

Uninstall all Ruby gems

# http://geekystuff.net/2009/1/14/remove-all-ruby-gems
$ gem list | cut -d" " -f1 | xargs sudo gem uninstall -aIx
https://snipt.net/embed/2a26e81ee1f89e4fd8ff493b9a5a85ff/
/raw/2a26e81ee1f89e4fd8ff493b9a5a85ff/
2a26e81ee1f89e4fd8ff493b9a5a85ff
bash
Bash
2
2019-07-15T15:56:44
True
False
False
/api/public/snipt/25310/
uninstall-all-ruby-gems-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># http://geekystuff.net/2009/1/14/remove-all-ruby-gems</span> </span><span id="L-2"><a name="L-2"></a>$ gem list <span class="p">|</span> cut -d<span class="s2">&quot; &quot;</span> -f1 <span class="p">|</span> xargs sudo gem uninstall -aIx </span></pre></div> </td></tr></table>
ruby, rubygems

Bash

Navigate between tabs

1
2
3
4
5
6
7
# Commands
:tabp
:tabn

# Hot keys
gT
gt
https://snipt.net/embed/9d8f2068ae85b85ea898724046297658/
/raw/9d8f2068ae85b85ea898724046297658/
9d8f2068ae85b85ea898724046297658
bash
Bash
7
2019-06-10T04:14:20
True
False
False
/api/public/snipt/25309/
navigate-between-tabs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Commands</span> </span><span id="L-2"><a name="L-2"></a>:tabp </span><span id="L-3"><a name="L-3"></a>:tabn </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># Hot keys</span> </span><span id="L-6"><a name="L-6"></a>gT </span><span id="L-7"><a name="L-7"></a>gt </span></pre></div> </td></tr></table>
vim

Bash

Open a file in a new tab

:tabe /file/path
https://snipt.net/embed/7cf7a49a6b02f8f24dba672156e79714/
/raw/7cf7a49a6b02f8f24dba672156e79714/
7cf7a49a6b02f8f24dba672156e79714
bash
Bash
1
2019-07-06T08:38:10
True
False
False
/api/public/snipt/25308/
open-a-file-in-a-new-tab
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>:tabe /file/path </span></pre></div> </td></tr></table>
vim

Bash

Delete a block of text

1
2
3
4
5
# Go to the top of the block and add a mark 'x'
mx

# Go to the last line of the block and execute
:'x, . d
https://snipt.net/embed/0befb7667e78665de7ceaf99ce29f414/
/raw/0befb7667e78665de7ceaf99ce29f414/
0befb7667e78665de7ceaf99ce29f414
bash
Bash
5
2019-07-01T16:53:44
True
False
False
/api/public/snipt/25307/
delete-a-block-of-text
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Go to the top of the block and add a mark &#39;x&#39;</span> </span><span id="L-2"><a name="L-2"></a>mx </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Go to the last line of the block and execute</span> </span><span id="L-5"><a name="L-5"></a>:<span class="err">&#39;</span>x, . d </span></pre></div> </td></tr></table>
vim