Re: Vim: deleting first character and inserting a char at first column



On 10 Apr 2008 00:01:29 GMT, Gary Johnson <garyjohn@xxxxxxxxxx> wrote:

The way I do this depends on the number of lines I'm changing and
whether the changes are to contiguous lines. The simplest method is to
move the cursor to the first line, type

I

followed by the character or characters to be inserted, followed by
typing the Esc key. To repeat the insertion on subsequent lines, I type
Enter to move to the next line, then

.

to repeat the last change. Then I just put my ring finger on the Enter key,
my index finger on the . and alternate the two until the "marking" is
done. To skip a line, I just hit Enter an extra time without hitting
the ..

Hi Gary, thanks for answering.
I'm familiar with the above procedure, since it's the one I'm using
and trying to avoid.
The main problem with it is that you repeat the last command with .
If you do something in between (like moving a lot of lines up and
down, and setting some numeric values in them) then it becomes
tiresome quickly.
The bottom one is pretty much the same, except it includes the use of
V mode.

I'm currently in the process of help reading, and trying to do patch
up something like this:
- read some string
- put it out
<c-r>=strftime("%a %d %b %Y")<cr>
(in an analogous manner)
- map some key to do it quickly

You wouldn't know by any chance how to read a string and how to put it
out ?

Ivan
.



Relevant Pages

  • Re: Repeating a character X number of times?
    ... DV> What function do I use to repeat a character X number of times? ... say I want to create a string with 40 dashes. ... Friedrich Nietzsche ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Creating a unique customer code with a function
    ... Function ThreeLetters(CompanyName As String) As String ... Repeat the Replace part for every character you want removed. ... Tom Ellison wrote: ...
    (microsoft.public.access.queries)
  • Re: Prevent key repeat
    ... the character should be typed once and then not repeat. ... If Time gap is what's needed. ... I want to end up with a string as in 4563 or whatever the user types. ...
    (alt.comp.lang.borland-delphi)
  • [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
    ... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ...
    (Linux-Kernel)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)