Skip to content

zigius/vim-auto-save-git-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Description

907th/vim-auto-save pre-save git hook - only save files under git (or any other scm you can think of) Inspired by vim-rooter

Installation

Use your favorite package manger

Usage

Just install this package and 907th/vim-auto-save and all your git files will be automatically saved. All other files will have to be saved manually.

Options

A lot of the options are taken from vim rooter. for a more detailed explanation view vim-rooter's README file

To specify how to identify a project's root directory:

" .vimrc
let g:git_patterns = ['.git', '.git/', '_darcs/', '.hg/', '.bzr/', '.svn/'] " default values

By default all files and directories trigger git-auto-save. Configure a comma separated list of file patterns to specify which files trigger git-auto-save. Include / to trigger git-auto-save on directories.

" directories and all files (default)
let g:git_targets = '/,*'

" ignore directories; all files
let g:git_targets = '*'

" ignore directories; yaml files
let g:git_targets = '*.yml,*.yaml'

" directories and yaml files
let g:git_targets = '/,*.yml,*.yaml'

By default git-auto-save doesn't resolve symbolic links. To resolve links:

let g:git_resolve_links = 1

Configuration

My preferred settings:

" .vimrc
let g:auto_save = 1
let g:auto_save_silent = 1
let g:auto_save_events = ["CursorHold"]
let updatetime=4000

License

None

About

auto save only git files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published