Re: Delete word under cursor in insert mode
- On Fri, 31 Aug 2001, Bohdan Vlasyuk wrote:
> On Fri, Aug 31, 2001 at 12:53:33PM -0500, Adam 'Vonlia' Seyfarth wrote:Look before you leap :-) Try this:
> >>> ---that won't work, it needs the <Esc>tx treatment.
> >> I don't undertand how <Esc>tx is supposed to work...
> > Sorry, typo, I meant "t<Esc>x". That puts the cursor in normal mode
> > on the char the cursor was on in insert mode.
> same does <C-O>..
imap <BS> <C-O>hx
it will move the cursor left, then insert an x. That isn't what I want,
I want to delete the char to the left. Which is two normal mode
commands. So, if I were to do it in normal mode, I would have to stay
in normal mode after the first command.
> I still don't understand what you want to win with <esc>, considering(it isn't a battle, just a discussion :-)
> that it behaves differently at the beginnig of the line.
<Esc>, by itself, will behave differently at beginning of line. That is
the problem I was fixing in the first place. That is why I would do
imap <BS> t<Esc>xhx
" t temperary. so we are NOT at beginning of line
" <Esc> to normal mode, on the 't'
" x delete the 't' we just put
" hx delete char to left
---it behaves same for any position of line, except for this example is
bad, it needs an 'h' which does behave differently on beginning of line,
but the "t<Esc>x" should work.
Hunter with gun: ``I love animals. That's why I love to kill
-- Monty Python::sketch
/|| Adam Seyfarth <http://members.home.net/adam.seyfarth/> ||\
/«|| <mailto:cloud@...> Geekcode, version 3.12 ||»\
\«|| GU d-- s+: a---- C++ UL+>++ P-- L++ E-- W++ N++ o K- w-- ||»/
\|| O M- V- PE- Y PGP- t 5 X R tv+ b+ DI+ D+ G e-- h! !r !y+ ||/
- On Fri, Aug 31, 2001 at 04:55:53PM -0500, Adam 'Vonlia' Seyfarth wrote:
> > same does <C-O>..You may consider using <C-o>:normal hx<cr>
> Look before you leap :-) Try this:
> imap <BS> <C-O>hx
>> I still don't understand what you want to win with <esc>,that is the problem that <C-o> solves. If you still beliebe <esc>
>> considering that it behaves differently at the beginnig of the
> <Esc>, by itself, will behave differently at beginning of line.
> That is the problem I was fixing in the first place.
method is better, well, i have nothing else to say.
Life's too short to dance with ugly women.