sponsor Vim development Vim logo Vim Book Ad

RepeatLast.vim : Provides <count>\. to repeat the last group of actions you performed.

 script karma  Rating 5/2, Downloaded by 101    Comments, bugs, improvements  Vim wiki

created by
joey twiddle
 
script type
utility
 
description
" Provides <count>\. to repeat the last group of actions you performed.
"
" The '.' key is fantastic at repeating the last 1 action you made.  But
" sometimes I do three actions, and then want to repeat them again.  Now
" this is just 3\.



" == Usage ==
"
" Assuming your mapleader is backslash (the default):
"
"   \?   Display a list of recently recorded actions
"
"   4\?  Display the last four recorded actions
"
"   4\.  Repeat the last four actions
"
"   \.   Repeat the last action (similar to . but may replay just a movement)
"
"   \D   Forget (drop) the last action (e.g. to discard an unwanted movement)
"
"   3\D  Drop the last 3 recorded actions (useful to get back to earlier state)
"
"   \|  or  \#   Temporarily disable recording of the next few actions.
"
" Commands are also available for the main shortcuts above:
"
"   :ShowRecent   :RepeatLast   :DropLast   :PauseRecording
"
" Commands to toggle state at runtime:
"
"   :RepeatLastOn    Disables action recording, leaves macro record mode.
"
"   :RepeatLastOff   Enables action recording, enters macro record mode.
"
"   :RepeatLast<Tab>  or  :RepeatLast<Ctrl-D>   More commands, to toggle info.
"
" New feature - Auto Ignoring:
"
"   After executing a repeat action, action storage will be *temporarily
"   disabled* for the number of actions specified in:
"
"     g:RepeatLast_Ignore_After_Use_For
"
"   This allows you to move to a new location between executing repeats,
"   without recording those movement actions.  (Movement actions in the
"   *original* executed repeat remain in history so can still be repeated.)
"
"   Action storage can also be temporarily disabled with \| or \#
"
"   Once you have performed enough actions without executing a repeat, action
"   storage will be re-enabled, and the ignored actions will be added to the
"   history as one large entry.



" == Limitations ==
"
" It uses macro recording ALL THE TIME.  The word "recording" will forever be
" displayed in your command-line, hiding any messages usually displayed there
" by Vim's echo.  To make those hidden messages visible, you will need to:
"
"   :set cmdheight=2    or more
"
" (This is preferable to adding frequent calls to sleep, which pause Vim long
" enough to show messages, but can slow down / lock up Vim when we are
" pressing a lot of keys.)
"
" If you want to record your own macro, you can disable the plugin with
" :RepeatLastOff (or you could try just pressing 'q' for a one-time disable).
"
" CursorHold events do not fire in macro-recording mode.  Any visual tools,
" taglist updates, etc. that require CursorHold *will not be triggered*.
" Other events such as CursorMove, InsertLeave, BufWritePost work fine.

 
install details
Drop it in plugin/ folder.

Latest version at http://hwi.ath.cx/code/home/.vim/plugin/RepeatLast.vim
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
RepeatLast.vim 1.34e 2013-06-01 7.0 joey twiddle Removed debugging code which I had accidentally left in
RepeatLast.vim 1.34d 2013-05-31 7.0 joey twiddle reduced triggering of CursorHold based on user interaction speed, and other modes
RepeatLast.vim 1.34c 2013-05-09 7.0 joey twiddle Minor updates to documentation.
RepeatLast.vim 1.34 2013-04-25 7.0 joey twiddle Can now trigger CursorHold events, without which some visual plugins may not act normally.
RepeatLast.vim 1 2013-01-02 6.0 joey twiddle Initial upload
ip used for rating: 107.20.7.65

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo