*insertlessly.txt* Waste no more time entering insert mode just to insert enters!
*insertlessly-author*
Author: Barry Arthur <barry.arthur@gmail.com>
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
INTRODUCTION *insertlessly*
Are you sick of having to go into insert mode -just- to enter a
newline? Do you wish Vim had an even easier way of entering several
newlines at once? Are you sick of people on #vim telling you:
>
"just use o<Esc> and get over it already!"?
<
Well, wish no more! Because, -this- plugin is for you!!1!
How much would you pay for this awesome functionality? One dollar?
Maybe even two dollars?!
Well, wait! Don't answer yet, because... There's More!
Have you ever wanted to be able to Backspace in normal mode? Of course
you have! Who hasn't?! Well, now you can! Absolutely free, with the
Insertlessly plugin! Try it today! Go to a line and just start banging
away on the Backspace key and watch those characters fade away! You
don't even need to be in insert mode! It even wraps around the start
of lines! And it even does so intelligently! Even!
And that's not all, because for no extra charge, we've added the same
intelligent, line-spanning delete action you've seen on the Backspace key
to... the Delete key! Amazing, isn't it? Now you can delete characters AND
join lines with one simple key press. Can life in Vim -get- any better?!
Yes! That's right! Two, no, -three- awesome features in one humble little
plugin! But wait! There's more! Insertlessly even allows you to provide a
count to the Enter, Backspace and Delete actions to perform several in one go!
Need ten newlines? 10<enter> -kapow!-
Wanna backspace over a dozen dirty digits? 12<backspace> -shazam!-
Gotta suck the face off a ratty identifier? 4<del> -fzzzt!-
Now, how much would you pay?! Just think of the hours of frustration
Insertlessly will save you, not to mention the wear and tear on your Escape
key.
You might be thinking that you can already do all these things yourself in Vim
and that you don't need this amazingly friendly little plugin, but... There's
-even- more!
That's right! Not only does Insertlessly let you insert enters without
entering insert; not only does it backspace and delete across lines
intelligently, but... Insertlessly -also- cleans up any trailing whitespace in
your document (or, optionally, only the newly inserted lines) when leaving
insert mode. Tired of seeing rubbish spaces left strewn around other people's
text files? Wish you had a magic wand that would clean all that crap up for
you? Well, Insertlessly is -here- for you!
As if all that wasn't amazing enough, hold onto your keyboards because there's
-even- more! Insertlessly will tirelessly clean up after you so you don't
leave messy trailing spaces all over your files. It will also insert enters
and backspace & delete across lines, multiple times at a time! And now, for an
unlimited time offer, Insertlessly also inserts spaces in the same multitime
mannar you've come to love from enter, backspace and delete. Insertlessly!
And wait! I know, right?! It gets even -better-! Yes! All of these features
are customisable with plugin option variables (g:insertlessly_<option>) and
<plug> maps for all default key bindings. If it got any better, I'd need to
bundle rainbows and unicorns with this plugin!
Quick! Grab your Vim plugin manager and get Insertlessly today! :D
FEATURES *insertlessly-features*
ENTER ~
Pressing <Enter> (by default, but can be customised. See
|insertlessly-configuration|) in normal mode will insert a newline in
the current line at the cursor position. If the cursor is at the end
of the line, this will push the character there to the next line. If
you wanted to open a new line below this one instead, use the
|insertlessly-opennewline| feature instead.
Multiple newlines can be inserted by preceding the <Enter> with a
count.
This feature is on by default but can be disabled in your ~/.vimrc:
>
let g:insertlessly_insert_newlines = 0
<
OPEN NEWLINE ~
Pressing <S-Enter> (by default, but can be customised. See
|insertlessly-configuration|) in normal mode will insert a newline
below the current line without affecting the line the cursor is
currently on.
Multiple newlines can be appended by preceding the <S-Enter> with a
count.
NOTE: <S-Enter> will most probably not work from terminal Vim. In this case,
you will want to change the default mapping as explained in
|insertlessly-configuration|.
This feature is on by default but can be disabled in your ~/.vimrc:
>
let g:insertlessly_open_newlines = 0
<
BACKSPACE ~
Pressing <Backspace> will delete the character to the left of the cursor.
Multiple backspaces can be performed at once by preceding the <Backspace> with
a count. Backspace will delete over the beginning of line when pressed in
column 1.
If you're in column one of an empty line and you press Backspace, it
will not leave a trailing space before the cursor, as in:
(where * is the cursor position)
>
foo
*
foo*
<
But if you're on a line with text, a space will separate the newly
joined lines:
>
foo
*x
foo *x
<
This feature is on by default but can be disabled in your ~/.vimrc:
>
let g:insertlessly_backspace_past_bol = 0
<
DELETE ~
Pressing Delete ( <Del> ) in any column except the last on a line will perform
a normal <Del> operation. Multiple deletes can be performed by preceding the
<Del> with a count. In the last column of a line, it will join the subsequent
line to the end of the current line (like using |J|).
This feature is on by default but can be disabled in your ~/.vimrc:
>
let g:insertlessly_delete_at_eol_joins = 0
<
SPACE~
Pressing <Space> will insert space characters before the cursor position.
Multiple spaces can be inserted by preceding the <Space> with a count.
NOTE: If <Space> is your |mapleader| then you'll want to change the default
mapping as explained in |insertlessly-configuration|.
This feature is on by default but can be disabled in your ~/.vimrc:
>
let g:insertlessly_insert_spaces = 0
<
CLEANUP TRAILING WHITESPACE~
Two options control whether trailing whitespace is removed when leaving insert
mode:
g:insertlessly_cleanup_trailing_ws -- current line only
g:insertlessly_cleanup_all_ws -- all lines in the buffer
These are both on by defdault but can be disabled in your ~/.vimrc:
>
let g:insertlessly_cleanup_trailing_ws = 0
let g:insertlessly_cleanup_all_ws = 0
<
ADJUST CURSOR POSITION~
Some vimmers requested that the cursor position remain in normal mode where it
is seen in insert mode (effectively doing an |l| when leaving insert mode.)
The author appreciates a healthy dose of heresy, but feels even his
tree-hugging hippiedom doesn't extend so far as to leave this on by default.
If you want this behaviour, add this to your ~/.vimrc :
>
let g:insertlessly_adjust_cursor = 1
<
CONFIGURATION *insertlessly-configuration*
Some terminals (like gnome-terminal) can't distinguish between
<Enter>, <S-Enter> and <C-Enter>. If you're afflicted by such a
situation, you can customise the actual key used to perform the
various Insertlessly functions. For example, to map the
|insertlessly-opennewline| feature (which is, by default, mapped to
<S-Enter>) to <BSlash>, put the following in your ~/.vimrc :
>
nmap <BSlash> <Plug>OpenNewline
<
The following map targets are available for remapping in your ~/.vimrc :
>
<Plug>BSPastBOL
<Plug>InsertNewline
<Plug>OpenNewline
<Plug>DelAtEOL
<Plug>InsertSpace
<
ISSUES *insertlessly-issues*
Vim veterans could potentially get confused when using your
installation of Vim. Please report any repeatable instances of this.
Should we have a vnoremap to just delete visually selected text when
the user presses Backspace?
vim:tw=78:ts=8:ft=help:norl: