| Computers Forum Index » Computer - Editors » empty lines above... |
|
Page 1 of 1 |
|
| Author |
Message |
| julia... |
Posted: Wed Sep 02, 2009 8:32 pm |
|
|
|
Guest
|
How do I insert a blank line above line containg the pattern '\begin
{tabular}'
This command in vim is supposed to insert the blank line.
:g/\\begin{tabular}/s/^/^M
(the final value is entered by typing <ctrl>v<return>)
Is any other way to do that in Vim. I use windows and <ctrl>v<return>
doesn't produce ^M.
Thanks |
|
|
| Back to top |
|
|
|
| Gary Johnson... |
Posted: Thu Sep 03, 2009 2:53 am |
|
|
|
Guest
|
julia <julia_2683 at (no spam) hotmail.com> wrote:
Quote: How do I insert a blank line above line containg the pattern '\begin
{tabular}'
This command in vim is supposed to insert the blank line.
:g/\\begin{tabular}/s/^/^M
(the final value is entered by typing <ctrl>v<return>)
Is any other way to do that in Vim. I use windows and <ctrl>v<return
doesn't produce ^M.
This should do it:
:g/\\begin{tabular}/s/^/\r/
The problem with using Ctrl-V could be because it is often mapped to
paste text by the default \Program Files\Vim\_vimrc file. See
:help c_CTRL-V
If that's the case, then using Ctrl-Q instead of Ctrl-V should allow you
to enter literal control characters such as Ctrl-M. If you prefer, you
can comment-out or delete these lines in your _vimrc file to get the
behavior of Unix vim.
source $VIMRUNTIME/mswin.vim
behave mswin
--
Gary Johnson |
|
|
| Back to top |
|
|
|
|