mirror of
				https://github.com/mhinz/vim-galore.git
				synced 2025-11-04 11:55:35 +08:00 
			
		
		
		
	Tips: reload your file on saving
This commit is contained in:
		@@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
 | 
			
		||||
- Basics: [Folding?](README.md#folding)
 | 
			
		||||
- Commands: [:redir](README.md#redir)
 | 
			
		||||
- Tips: [Saner command-line history](README.md#saner-command-line-history)
 | 
			
		||||
- Tips: [Reload a file on saving](README.md#reload-a-file-on-saving)
 | 
			
		||||
- Usage: [Editing remote files](README.md#editing-remote-files)
 | 
			
		||||
- Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file)
 | 
			
		||||
- Usage: [MatchIt](README.md#matchit)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README.md
									
									
									
									
									
								
							@@ -56,6 +56,7 @@ added every day. Things about to be added can be found here:
 | 
			
		||||
- [Quickly change font size in GUI](#quickly-change-font-size-in-gui)
 | 
			
		||||
- [Change cursor style in insert mode](#change-cursor-style-in-insert-mode)
 | 
			
		||||
- [Don't lose selection when shifting sidewards](#dont-lose-selection-when-shifting-sidewards)
 | 
			
		||||
- [Reload a file on saving](#reload-a-file-on-saving)
 | 
			
		||||
 | 
			
		||||
#### [Commands](#commands-1)
 | 
			
		||||
 | 
			
		||||
@@ -1192,6 +1193,17 @@ Now you can use `>>>>>` on your visual selection without any problems.
 | 
			
		||||
 | 
			
		||||
**NOTE**: The same can be achieved using `.`, which repeats the last change.
 | 
			
		||||
 | 
			
		||||
#### Reload a file on saving
 | 
			
		||||
 | 
			
		||||
Using [autocmds](#autocmds) you can do anything on saving a file, e.g. sourcing
 | 
			
		||||
it in case of a dotfile or running a linter to check for syntactical errors in
 | 
			
		||||
your source code.
 | 
			
		||||
 | 
			
		||||
```viml
 | 
			
		||||
autocmd BufWritePost $MYVIMRC source $MYVIMRC
 | 
			
		||||
autocmd BufWritePost ~/.Xdefaults call system('xrdb ~/.Xdefaults')
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Commands
 | 
			
		||||
 | 
			
		||||
Useful commands that are good to know.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user