<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: vi / vim editor: Can I paste text inside a colon command?</title>
	<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command/</link>
	<description>Comments on Ask MetaFilter post vi / vim editor: Can I paste text inside a colon command?</description>
	<pubDate>Tue, 21 Oct 2008 12:40:50 -0800</pubDate>
	<lastBuildDate>Tue, 21 Oct 2008 12:40:50 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: vi / vim editor: Can I paste text inside a colon command?</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command</link>	
		<description>vi / vim editor: Can I paste text &lt;em&gt;inside&lt;/em&gt; a colon command? &lt;br /&gt;&lt;br /&gt; (Long-time emacs user here, having a great time learning vim)  I often want to copy some text and then use it as the match portion of a substitution command, rather than re-typing it.  I&apos;ve looked over the FAQs, the tips, etc. and didn&apos;t see this addressed.  Is it possible?  Or is there some other vi-specific idiom for doing the same thing?&lt;br&gt;
&lt;br&gt;
Bonus question: As I&apos;m still getting my head around the vim terminology and resources, what/where could I have searched to find this answer myself?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.104821</guid>
		<pubDate>Tue, 21 Oct 2008 12:19:35 -0800</pubDate>
		<dc:creator>alb</dc:creator>
		
			<category>vi</category>
		
			<category>vim</category>
		
			<category>unix</category>
		
			<category>linux</category>
		
			<category>editor</category>
		
	</item> <item>
		<title>By: sbutler</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515486</link>	
		<description>Well, the first part is to know the terminology. The mode you enter when you type &quot;:&quot; or search, etc, is either Ex mode or Command mode. For this question, they&apos;re the same. So if you go to the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/cmdline.html#Command-line&quot;&gt;docs on command mode&lt;/a&gt;, you see this:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;CTRL-R {0-9a-z&quot;%#:-=.}					*c_CTRL-R* *c_&amp;lt;C-R&amp;gt;*&lt;br&gt;		Insert the contents of a numbered or named register.  Between&lt;br&gt;		typing CTRL-R and the second character &apos;&quot;&apos;&apos; will be displayed&lt;br&gt;		to indicate that you are expected to enter the name of a&lt;br&gt;		register.&lt;br&gt;		The text is inserted as if you typed it, but mappings and&lt;br&gt;		abbreviations are not used.  Command-line completion through&lt;br&gt;		&apos;wildchar&apos; is not triggered though.  And characters that end&lt;br&gt;		the command line are inserted literally (&amp;lt;Esc&amp;gt;, &amp;lt;CR&amp;gt;, &amp;lt;NL&amp;gt;,&lt;br&gt;		&amp;lt;C-C&amp;gt;).  A &amp;lt;BS&amp;gt; or CTRL-W could still end the command line&lt;br&gt;		though, and remaining characters will then be interpreted in&lt;br&gt;		another mode, which might not be what you intended.&lt;br&gt;		Special registers:&lt;br&gt;			&apos;&quot;&apos;&apos;	the unnamed register, containing the text of&lt;br&gt;				the last delete or yank&lt;br&gt;			&apos;%&apos;	the current file name&lt;br&gt;			&apos;#&apos;	the alternate file name&lt;br&gt;			&apos;*&apos;	the clipboard contents (X11: primary selection)&lt;br&gt;			&apos;+&apos;	the clipboard contents&lt;br&gt;			&apos;/&apos;	the last search pattern&lt;br&gt;			&apos;:&apos;	the last command-line&lt;br&gt;			&apos;-&apos;	the last small (less than a line) delete&lt;br&gt;			&apos;.&apos;	the last inserted text&lt;br&gt;&lt;br&gt;							*c_CTRL-R_=*&lt;br&gt;			&apos;=&apos;	the expression register: you are prompted to&lt;br&gt;				enter an expression (see |expression|)&lt;br&gt;				(doesn&apos;t work at the expression prompt; some&lt;br&gt;				things such as changing the buffer or current&lt;br&gt;				window are not allowed to avoid side effects)&lt;br&gt;		See |registers| about registers.  {not in Vi}&lt;br&gt;		Implementation detail: When using the |expression| register&lt;br&gt;		and invoking setcmdpos(), this sets the position before&lt;br&gt;		inserting the resulting string.  Use CTRL-R CTRL-R to set the&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
So the short answer is, if you want to paste the last line yanked or deleted, then do CTRL-R-&quot;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515486</guid>
		<pubDate>Tue, 21 Oct 2008 12:40:50 -0800</pubDate>
		<dc:creator>sbutler</dc:creator>
	</item><item>
		<title>By: sbutler</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515510</link>	
		<description>And in case you didn&apos;t know how to copy text: use &apos;v&apos; to enter the visual mode, highlight the region, and then &apos;y&apos; to yank it. That puts it in the default register, which gets overwritten all the time. To put it in another register, prefix the &apos;y&apos; with &apos;&quot;&lt;letter&gt;&apos;. For example, to place in the &apos;a&apos; register, you would type: &quot;ay. Then to paste while in ex mode, it&apos;s CTRL-R-a.&lt;br&gt;
&lt;br&gt;
I love vi/vim because you can find it everywhere. But there&apos;s also a secret-society-handshake aspect to it :)&lt;/letter&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515510</guid>
		<pubDate>Tue, 21 Oct 2008 12:50:43 -0800</pubDate>
		<dc:creator>sbutler</dc:creator>
	</item><item>
		<title>By: sbutler</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515513</link>	
		<description>&lt;small&gt;Arg... that&apos;s supposed to be: To put it in another register, prefix the &apos;y&apos; with &apos;&quot;&amp;lt;letter&amp;gt;&apos;&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515513</guid>
		<pubDate>Tue, 21 Oct 2008 12:53:05 -0800</pubDate>
		<dc:creator>sbutler</dc:creator>
	</item><item>
		<title>By: alb</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515514</link>	
		<description>Great!   Thanks for answering both parts of my question in one go.  I was searching for answers with the term &quot;command mode&quot;, but then using &quot;paste&quot; instead of &quot;insert&quot;  (and &quot;register&quot; apparently would have helped, too)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515514</guid>
		<pubDate>Tue, 21 Oct 2008 12:54:07 -0800</pubDate>
		<dc:creator>alb</dc:creator>
	</item><item>
		<title>By: jepler</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515661</link>	
		<description>You can also call up the &quot;command line window&quot;, which you can edit like it was a normal buffer, or invoke items in it by hitting enter in normal or insert mode.  In the command line window, you can use &quot;p&quot; to paste, just like when editing files.  Read :help q: for more info.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515661</guid>
		<pubDate>Tue, 21 Oct 2008 14:15:46 -0800</pubDate>
		<dc:creator>jepler</dc:creator>
	</item><item>
		<title>By: namewithoutwords</title>
		<link>http://ask.metafilter.com/104821/vi-vim-editor-Can-I-paste-text-inside-a-colon-command#1515893</link>	
		<description>if you&apos;re using vim, &lt;a href=&quot;http://www.vim.org/htmldoc/usr_01.html&quot;&gt;vimtutor&lt;/a&gt; is a great resource (on *nix just run vimtutor, in windows, check the start menu)  quick intro to the terminology and methodology, as well as the must-know basics to be effective.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.104821-1515893</guid>
		<pubDate>Tue, 21 Oct 2008 17:33:08 -0800</pubDate>
		<dc:creator>namewithoutwords</dc:creator>
	</item>
	</channel>
</rss>
