Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Four of my favourite lines of Vimscript
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
btiffin




PostPosted: Thu Jul 25, 2013 12:04 pm   Post subject: Four of my favourite lines of Vimscript

code:

" Mucking with no cursor movement on escape from insert mode
let CursorColumnI = 0 "the cursor column position in INSERT
augroup inserttweak
autocmd!
autocmd InsertEnter * let CursorColumnI = col('.')
autocmd CursorMovedI * let CursorColumnI = col('.')
autocmd InsertLeave * if col('.') != CursorColumnI | call cursor(0, col('.')+1) | endif
augroup END


Ok, four lines plus three lines of grouping and a comment.

Makes toggling insert mode in Vim a lot easier on the brain and fingers. Placed in ~/.vimrc

Cheers
Sponsor
Sponsor
Sponsor
sponsor
jackie15




PostPosted: Sat Oct 26, 2013 7:23 am   Post subject: RE:Four of my favourite lines of Vimscript

thanks for sharing...!
BigBear




PostPosted: Sat Oct 26, 2013 10:29 am   Post subject: RE:Four of my favourite lines of Vimscript

What does it do?

Allows you to toggle insert mode with '.'?
btiffin




PostPosted: Sun Oct 27, 2013 5:08 pm   Post subject: RE:Four of my favourite lines of Vimscript

BigBear;

Normally vim backspaces when escaping out of insert mode. It gets rid of an end-of-line off by one error that scripts might bump into. But it kinda blows getting used to. This slows the editor down, but leaves the cursor position alone when you leave insert mode. Umm, which in itself can kinda blow if your fingers have gotten used to normal back positioning behaviour.
kashu123




PostPosted: Fri Nov 01, 2013 1:02 am   Post subject: RE:Four of my favourite lines of Vimscript

I am waiting you give me a more interested information.
btiffin




PostPosted: Sat Nov 02, 2013 4:24 pm   Post subject: RE:Four of my favourite lines of Vimscript

kashu123;

But, but; unlike the Dos Equis guy, I'm the most Uninteresting Nerd in the World. Smile

Cheers
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: