mirror of
				https://github.com/mhinz/vim-galore.git
				synced 2025-11-04 11:55:35 +08:00 
			
		
		
		
	Tips: quickly edit your macros
This commit is contained in:
		@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
 | 
			
		||||
- Tips: [Saner behavior of n and N](README.md#saner-behavior-of-n-and-n)
 | 
			
		||||
- Tips: [Quickly move current line](README.md#quickly-move-current-line)
 | 
			
		||||
- Tips: [Quickly add empty lines](README.md#quickly-add-empty-lines)
 | 
			
		||||
- Tips: [Quickly edit your macros](README.md#quickly-edit-your-macros)
 | 
			
		||||
- Tips: [Don't lose selection when shifting sidewards](README.md#dont-lose-selection-when-shifting-sidewards)
 | 
			
		||||
 | 
			
		||||
## [1.0] - 2016-01-06
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								README.md
									
									
									
									
									
								
							@@ -20,6 +20,7 @@
 | 
			
		||||
- [Saner behavior of n and N](#saner-behavior-of-n-and-n)
 | 
			
		||||
- [Quickly move current line](#quickly-move-current-line)
 | 
			
		||||
- [Quickly add empty lines](#quickly-add-empty-lines)
 | 
			
		||||
- [Quickly edit your macros](#quickly-edit-your-macros)
 | 
			
		||||
- [Don't lose selection when shifting sidewards](#dont-lose-selection-when-shifting-sidewards)
 | 
			
		||||
 | 
			
		||||
#### [Debugging](#debugging-1)
 | 
			
		||||
@@ -382,6 +383,18 @@ nnoremap [<space>  :put! =''<cr>
 | 
			
		||||
nnoremap ]<space>  :put =''<cr>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Quickly edit your macros
 | 
			
		||||
 | 
			
		||||
This is a real gem! The mapping takes a register (or `*` by default) and opens
 | 
			
		||||
it in the cmdline-window. Hit `<cr>` when you're done editing for setting the
 | 
			
		||||
register.
 | 
			
		||||
 | 
			
		||||
I often use this to correct typos I did while recording a macro.
 | 
			
		||||
```viml
 | 
			
		||||
nnoremap <leader>m  :<c-u><c-r>='let @'. v:register .' = '. string(getreg(v:register))<cr><c-f><left>
 | 
			
		||||
```
 | 
			
		||||
Use it like this `<leader>m` or `"q<leader>m`.
 | 
			
		||||
 | 
			
		||||
#### Don't lose selection when shifting sidewards
 | 
			
		||||
 | 
			
		||||
If you select one or more lines, you can use `<` and `>` for shifting them
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user