2013-10-02 07:47:05 -04:00
|
|
|
*signify.txt* Indicate changed lines within a file using a VCS.
|
2013-03-05 17:07:54 -05:00
|
|
|
*signify*
|
2017-02-17 10:19:34 -05:00
|
|
|
>
|
2013-03-05 17:07:54 -05:00
|
|
|
___
|
|
|
|
__ __ /'___\
|
|
|
|
____/\_\ __ ___ /\_\/\ \__/ __ __
|
|
|
|
/',__\/\ \ /'_ `\ /' _ `\/\ \ \ ,__\/\ \/\ \
|
|
|
|
/\__, `\ \ \/\ \L\ \/\ \/\ \ \ \ \ \_/\ \ \_\ \
|
|
|
|
\/\____/\ \_\ \____ \ \_\ \_\ \_\ \_\ \/`____ \
|
|
|
|
\/___/ \/_/\/___L\ \/_/\/_/\/_/\/_/ `/___/> \
|
|
|
|
/\____/ /\___/
|
|
|
|
\_/__/ \/__/
|
2017-02-17 10:19:34 -05:00
|
|
|
<
|
2013-10-02 07:47:05 -04:00
|
|
|
by Marco Hinz~
|
2013-03-05 17:07:54 -05:00
|
|
|
|
|
|
|
==============================================================================
|
2014-09-11 10:48:22 -04:00
|
|
|
TOC *signify-contents*
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2014-09-11 10:48:22 -04:00
|
|
|
INTRO .......................... |signify-intro|
|
2017-02-17 10:19:34 -05:00
|
|
|
MODUS OPERANDI ................. |signify-modus-operandi|
|
|
|
|
DEBUG .......................... |signify-debug|
|
|
|
|
SIGNS .......................... |signify-signs|
|
2014-09-11 10:48:22 -04:00
|
|
|
OPTIONS ........................ |signify-options|
|
|
|
|
COMMANDS ....................... |signify-commands|
|
2016-03-31 10:47:33 -04:00
|
|
|
AUTOCOMMAND .................... |signify-autocommand|
|
2014-09-11 10:48:22 -04:00
|
|
|
MAPPINGS ....................... |signify-mappings|
|
|
|
|
COLORS ......................... |signify-colors|
|
2015-06-15 12:15:29 -04:00
|
|
|
FAQ ............................ |signify-faq|
|
2014-11-05 08:16:44 -05:00
|
|
|
EXAMPLE ........................ |signify-example|
|
2013-03-05 17:07:54 -05:00
|
|
|
|
|
|
|
==============================================================================
|
2014-09-11 10:48:22 -04:00
|
|
|
INTRO *signify-intro*
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2017-02-17 10:19:34 -05:00
|
|
|
Signify uses the sign column to indicate added, modified and removed lines
|
|
|
|
based on the data of an underlying version control system.
|
2013-10-02 07:47:05 -04:00
|
|
|
|
2013-10-02 08:08:34 -04:00
|
|
|
Supported VCS:~
|
2013-10-02 07:47:05 -04:00
|
|
|
>
|
|
|
|
git
|
|
|
|
mercurial
|
|
|
|
darcs
|
|
|
|
bzr
|
|
|
|
subversion
|
|
|
|
cvs
|
|
|
|
rcs
|
|
|
|
fossil
|
|
|
|
accurev
|
2014-06-03 11:40:21 -04:00
|
|
|
perforce
|
2016-02-24 19:18:41 -05:00
|
|
|
tfs
|
2017-02-18 11:28:49 -05:00
|
|
|
<
|
2017-02-17 10:19:34 -05:00
|
|
|
==============================================================================
|
|
|
|
MODUS OPERANDI *signify-modus-operandi*
|
|
|
|
|
2017-02-20 10:16:07 -05:00
|
|
|
When you open a new buffer, Sy registers it as `active` and tries to figure out
|
|
|
|
whether the underlying file is controlled by a VCS (version control system) or
|
|
|
|
not.
|
2017-02-17 10:19:34 -05:00
|
|
|
|
|
|
|
For that, it asynchronously tries all the `diff` subcommands of all the VCS
|
|
|
|
tools that are supported and executable. It's recommended to set
|
|
|
|
|g:signify_vcs_list| to limit the VCS to test for.
|
|
|
|
|
|
|
|
If one of the checks produces a proper diff, that VCS will automatically be
|
|
|
|
used for all successive calls to Sy.
|
|
|
|
|
2017-02-20 10:16:07 -05:00
|
|
|
If none of the checks produces a proper diff, the VCS will be set to `unknown`.
|
|
|
|
The next time Sy gets run, the buffer will be marked as `inactive`, so it won't
|
|
|
|
look for changes anymore.
|
2017-02-17 10:19:34 -05:00
|
|
|
|
2017-02-18 14:17:17 -05:00
|
|
|
Or you set |g:signify_disable_by_default|, which registers all new buffers as
|
|
|
|
`inactive`, and enable Sy on demand using |signify-:SignifyToggle|.
|
|
|
|
|
|
|
|
By default, Sy is rather conservative and only updates signs when opening a
|
|
|
|
new buffer or writing it. If you want more agressive sign updating, have a
|
|
|
|
look at |g:signify_realtime|.
|
2017-02-17 10:19:34 -05:00
|
|
|
|
|
|
|
Use |signify-:SignifyList| to list all buffers managed by Sy and their current
|
|
|
|
state.
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
DEBUG *signify-debug*
|
|
|
|
|
|
|
|
If signs aren't showing up as expected, see if |signify-:SignifyDebug| shows
|
|
|
|
anything suspicious. It will try all VCS and shows either errors or a diff for
|
|
|
|
each VCS.
|
|
|
|
|
|
|
|
If the output looks fine though, create an issue on Github:
|
|
|
|
|
|
|
|
https://github.com/mhinz/vim-signify/issues/new
|
|
|
|
|
|
|
|
Make sure to mention your Vim version and which Sy version you use (latest
|
|
|
|
release or master).
|
|
|
|
|
|
|
|
Additionally, include the output of |:messages| after executing one of the
|
|
|
|
following:
|
|
|
|
|
|
|
|
- opening the buffer via `vim -V1 <file>`
|
|
|
|
- or running `:verb w` in the buffer
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
SIGNS *signify-signs*
|
2013-03-14 06:22:36 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
`+` This line was added.
|
2013-03-14 06:22:36 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
`!` This line was modified.
|
2013-03-14 06:22:36 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
`_1` The number of deleted lines below this sign. If the number is larger
|
2014-01-03 20:06:25 -05:00
|
|
|
`99` than 9, the `_` will be omitted. For numbers larger than 99, `_>`
|
|
|
|
`_>` will be shown instead.
|
2013-03-14 06:22:36 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
`!1` This line was modified and a number of lines below were deleted.
|
2014-01-01 17:40:57 -05:00
|
|
|
`!>` It is a combination of `!` and `_`. If the number is larger than 9,
|
2014-10-07 16:55:11 -04:00
|
|
|
`!>` will be shown instead.
|
2013-04-12 05:56:23 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
`‾` The first line was removed. It's a special case of the `_` sign.
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2017-02-17 10:19:34 -05:00
|
|
|
See |g:signify_sign_add| on how to use different signs.
|
|
|
|
|
2013-03-05 17:07:54 -05:00
|
|
|
==============================================================================
|
2014-09-11 10:48:22 -04:00
|
|
|
OPTIONS *signify-options*
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2013-06-22 09:11:25 -04:00
|
|
|
Put these variables into your vimrc. The provided examples also indicate the
|
|
|
|
default values, as long as no "Default:" section is given.
|
2013-03-07 06:56:25 -05:00
|
|
|
|
2017-02-18 11:28:49 -05:00
|
|
|
Most important options:~
|
2013-10-02 07:47:05 -04:00
|
|
|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_vcs_list|
|
2017-02-18 11:28:49 -05:00
|
|
|
|g:signify_realtime|
|
|
|
|
|
|
|
|
Other options:~
|
|
|
|
|
2015-05-20 08:23:29 -04:00
|
|
|
|g:signify_vcs_cmds|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_disable_by_default|
|
|
|
|
|g:signify_skip_filetype|
|
|
|
|
|g:signify_skip_filename|
|
2016-03-03 06:50:55 -05:00
|
|
|
|g:signify_skip_filename_pattern|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_update_on_bufenter|
|
2014-11-02 09:57:50 -05:00
|
|
|
|g:signify_update_on_focusgained|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_line_highlight|
|
2014-10-04 13:35:51 -04:00
|
|
|
|g:signify_sign_add|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_sign_delete|
|
2014-10-04 13:35:51 -04:00
|
|
|
|g:signify_sign_delete_first_line|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_sign_change|
|
2014-10-04 13:35:51 -04:00
|
|
|
|g:signify_sign_changedelete|
|
2014-10-07 16:55:11 -04:00
|
|
|
|g:signify_sign_show_count|
|
2016-09-28 11:05:40 -04:00
|
|
|
|g:signify_sign_show_text|
|
2017-02-25 16:06:54 -05:00
|
|
|
|g:signify_cursorhold_normal|
|
|
|
|
|g:signify_cursorhold_insert|
|
2014-09-11 10:48:22 -04:00
|
|
|
|g:signify_difftool|
|
2015-06-02 09:12:01 -04:00
|
|
|
|g:signify_fold_context|
|
2013-10-02 07:47:05 -04:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_vcs_list* >
|
2013-03-25 11:12:31 -04:00
|
|
|
let g:signify_vcs_list = [ 'git', 'hg' ]
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
|
|
|
Default: empty
|
2014-09-11 10:35:35 -04:00
|
|
|
Possible values: 'accurev'
|
|
|
|
'bzr'
|
|
|
|
'cvs'
|
|
|
|
'darcs'
|
|
|
|
'fossil'
|
|
|
|
'git'
|
|
|
|
'hg'
|
|
|
|
'perforce'
|
|
|
|
'rcs'
|
|
|
|
'svn'
|
2016-02-24 19:18:41 -05:00
|
|
|
'tfs'
|
2013-03-25 11:12:31 -04:00
|
|
|
|
2013-12-19 06:05:32 -05:00
|
|
|
NOTE: This is the most important option, so read closely.
|
2013-03-25 11:12:31 -04:00
|
|
|
|
2017-02-17 10:19:34 -05:00
|
|
|
This option determines what VCS to check for.
|
|
|
|
|
|
|
|
This can improve buffer loading time, since by default all supported and
|
|
|
|
installed VCS will be checked for. This only happens once, when signs get set
|
|
|
|
the first time. Afterwards, the VCS will either be remembered or registered as
|
|
|
|
inactive when no VCS was found.
|
|
|
|
|
|
|
|
If your Vim is recent enough, these checks will happen asynchronously.
|
2013-04-16 03:26:59 -04:00
|
|
|
|
2017-02-17 10:19:34 -05:00
|
|
|
NOTE: If you don't set this option, updating signs for a non-VCS file can lead
|
|
|
|
to a significant delay since all supported and installed VCS will be tested
|
|
|
|
for. (But this also happens only once, afterwards the buffer is registered as
|
|
|
|
inactive.)
|
2013-04-16 03:26:59 -04:00
|
|
|
|
2014-09-11 10:35:35 -04:00
|
|
|
NOTE: Some VCS rely on a an external diff tool to work properly (svn, darcs,
|
|
|
|
bzr, fossil), thus you have to make sure that Vim can find a valid diff tool.
|
2014-09-11 10:48:22 -04:00
|
|
|
So either the one you set through |g:signify_difftool| or "diff" by default.
|
2013-11-03 10:08:17 -05:00
|
|
|
|
2017-02-18 11:28:49 -05:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
*g:signify_realtime* >
|
|
|
|
let g:signify_realtime = 0
|
|
|
|
<
|
2017-03-03 20:17:08 -05:00
|
|
|
By default, the plugin is quite conservative and only updates on:
|
2017-02-18 11:28:49 -05:00
|
|
|
|
2017-03-03 20:17:08 -05:00
|
|
|
|BufRead| Opening a buffer.
|
|
|
|
|BufWritePost| Saving a buffer.
|
2017-02-18 11:28:49 -05:00
|
|
|
|
2017-03-03 20:17:08 -05:00
|
|
|
When this option is set, you get more aggressive sign updates:
|
2017-02-18 11:28:49 -05:00
|
|
|
|
2017-03-03 20:17:08 -05:00
|
|
|
|BufEnter| Opening or switching to another buffer.
|
|
|
|
|WinEnter| Opening or switching to another window.
|
|
|
|
|BufWritePost| Saving a buffer.
|
|
|
|
|FocusGained| When the window containing Vim gains focus.
|
|
|
|
Disable with |g:signify_update_on_focusgained|.
|
|
|
|
|CursorHold| After 'updatetime' milliseconds without moving the cursor
|
|
|
|
in normal mode. Disable with |g:signify_cursorhold_normal|.
|
|
|
|
This also saves the buffer!~
|
|
|
|
|CursorHoldI| After 'updatetime' milliseconds without moving the cursor
|
|
|
|
in insert mode. Disable with |g:signify_cursorhold_insert|.
|
|
|
|
This also saves the buffer!~
|
2017-02-25 16:06:54 -05:00
|
|
|
|
|
|
|
You can check the autocmds yourself: `:au signify`
|
2017-02-18 11:28:49 -05:00
|
|
|
|
|
|
|
NOTE: Running Sy on all these events would block too often for older Vim
|
|
|
|
versions, thus this option requires Vim 7.4.1967+, which is the minimum
|
2017-02-18 14:26:40 -05:00
|
|
|
version needed for asynchronous execution. Older Vim versions silently ignore
|
|
|
|
this option.
|
2017-02-18 11:28:49 -05:00
|
|
|
|
2015-05-20 08:23:29 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_vcs_cmds* >
|
2015-05-20 08:23:29 -04:00
|
|
|
let g:signify_vcs_cmds = {
|
|
|
|
\ 'cvs': 'cvs -d '. $CVSROOT .' diff -U0 -- %f' }
|
|
|
|
<
|
|
|
|
This is a |dict|. They key is any version control system from |g:signify_vcs_list|
|
2017-03-13 10:50:04 -04:00
|
|
|
and the value is the corresponding command-line.
|
2015-05-20 08:23:29 -04:00
|
|
|
|
|
|
|
Modifiers:~
|
|
|
|
|
|
|
|
%f actual filepath
|
|
|
|
%d |g:signify_difftool|
|
2017-03-13 10:50:04 -04:00
|
|
|
%n Unix: `/dev/null`, Windows: `NUL`
|
2015-05-20 08:23:29 -04:00
|
|
|
|
2017-03-13 10:50:04 -04:00
|
|
|
Redirection: Instead of `>foo` use `sy#util#shell_redirect('foo')`. This
|
|
|
|
helper function takes 'shellredir' into account.
|
2015-07-28 19:49:11 -04:00
|
|
|
|
|
|
|
The output format mustn't change, otherwise Sy won't give any reasonable
|
2015-05-20 08:23:29 -04:00
|
|
|
results. It's probably wise to start with the respective default values.
|
|
|
|
|
2017-03-13 10:50:04 -04:00
|
|
|
If your VCS program is not in `$PATH` and you have to specify an absolute path,
|
2015-07-28 19:49:11 -04:00
|
|
|
escape spaces by quoting, e.g.:
|
2015-07-06 15:58:23 -04:00
|
|
|
>
|
|
|
|
let g:signify_vcs_cmds = {
|
2015-07-06 19:07:41 -04:00
|
|
|
\ 'git': '"C:\Program Files (x86)\Git\bin\git.exe" diff --no-color --no-ext-diff -U0 -- %f'
|
2015-07-06 15:58:23 -04:00
|
|
|
\ }
|
|
|
|
<
|
2015-05-20 08:23:29 -04:00
|
|
|
Default:
|
|
|
|
>
|
|
|
|
let g:signify_vcs_cmds = {
|
|
|
|
\ 'git': 'git diff --no-color --no-ext-diff -U0 -- %f',
|
|
|
|
\ 'hg': 'hg diff --config extensions.color=! --config defaults.diff= --nodates -U0 -- %f',
|
|
|
|
\ 'svn': 'svn diff --diff-cmd %d -x -U0 -- %f',
|
|
|
|
\ 'bzr': 'bzr diff --using %d --diff-options=-U0 -- %f',
|
|
|
|
\ 'darcs': 'darcs diff --no-pause-for-gui --diff-command="%d -U0 %1 %2" -- %f',
|
|
|
|
\ 'fossil': 'fossil set diff-command "%d -U 0" && fossil diff --unified -c 0 -- %f',
|
|
|
|
\ 'cvs': 'cvs diff -U0 -- %f',
|
|
|
|
\ 'rcs': 'rcsdiff -U0 %f 2>%n',
|
|
|
|
\ 'accurev': 'accurev diff %f -- -U0',
|
2015-07-28 19:49:11 -04:00
|
|
|
\ 'perforce': 'p4 info '. sy#util#shell_redirect('%n') .' && env P4DIFF=%d p4 diff -dU0 %f'
|
2016-02-24 19:18:41 -05:00
|
|
|
\ 'tfs': 'tf diff -version:W -noprompt %f',
|
2015-05-20 08:23:29 -04:00
|
|
|
\ }
|
|
|
|
<
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_disable_by_default* >
|
2013-07-04 06:28:18 -04:00
|
|
|
let g:signify_disable_by_default = 0
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2017-02-17 10:19:34 -05:00
|
|
|
This makes Sy not looking for changes for each new buffer. You can easily
|
|
|
|
enable it later using |signify-:SignifyToggle|.
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2016-03-03 06:50:55 -05:00
|
|
|
*g:signify_skip_filename_pattern*
|
2014-09-11 10:48:22 -04:00
|
|
|
*g:signify_skip_filename*
|
2016-03-03 06:50:55 -05:00
|
|
|
*g:signify_skip_filetype*
|
2013-10-02 07:47:05 -04:00
|
|
|
>
|
2013-03-26 05:34:29 -04:00
|
|
|
let g:signify_skip_filetype = { 'vim': 1, 'c': 1 }
|
|
|
|
let g:signify_skip_filename = { '/home/user/.vimrc': 1 }
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2016-03-03 06:50:55 -05:00
|
|
|
Don't activate the plugin for these filetypes and/or filenames. Filenames have
|
|
|
|
to be absolute paths.
|
2013-04-03 04:38:32 -04:00
|
|
|
|
2016-03-03 06:50:55 -05:00
|
|
|
These options must be |Dict|s for faster lookup.
|
|
|
|
>
|
|
|
|
let g:signify_skip_filename_pattern = [ 'foo.*bar', 'tmp' ]
|
|
|
|
<
|
|
|
|
Don't activate the plugin for filenames matching these patterns.
|
2013-03-10 05:17:53 -04:00
|
|
|
|
2016-03-03 06:50:55 -05:00
|
|
|
Default: <none>
|
2013-06-22 09:11:25 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_update_on_bufenter* >
|
2013-06-06 06:39:24 -04:00
|
|
|
let g:signify_update_on_bufenter = 0
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-06-06 06:39:24 -04:00
|
|
|
Update signs when entering a buffer that was modified.
|
2013-04-03 04:38:32 -04:00
|
|
|
|
2013-06-06 12:02:57 -04:00
|
|
|
NOTE: This also saves the buffer to disk!
|
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_update_on_focusgained* >
|
2014-11-02 09:57:50 -05:00
|
|
|
let g:signify_update_on_focusgained = 0
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2017-03-02 10:46:38 -05:00
|
|
|
Update the signs on |FocusGained|, thus when the window holding Vim gains focus.
|
|
|
|
It does so by executing |signify-:SignifyRefresh|.
|
2017-02-25 16:06:54 -05:00
|
|
|
|
2017-03-02 10:46:38 -05:00
|
|
|
NOTE: The |FocusGained| event is fired for all GUIs and even a few terminal
|
|
|
|
emulators. If you use tmux, put `set-option -g focus-events on` in your
|
|
|
|
tmux.conf.
|
2013-08-13 02:09:02 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_line_highlight* >
|
2013-06-22 09:11:25 -04:00
|
|
|
let g:signify_line_highlight = 0
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-07-03 10:59:28 -04:00
|
|
|
Enable line highlighting in addition to using signs by default.
|
2013-04-18 00:55:53 -04:00
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2014-10-04 13:35:51 -04:00
|
|
|
*g:signify_sign_add*
|
2014-09-11 10:48:22 -04:00
|
|
|
*g:signify_sign_delete*
|
2014-10-04 13:35:51 -04:00
|
|
|
*g:signify_sign_delete_first_line*
|
2014-09-11 10:48:22 -04:00
|
|
|
*g:signify_sign_change*
|
2014-10-04 13:35:51 -04:00
|
|
|
*g:signify_sign_changedelete*
|
2013-10-02 07:47:05 -04:00
|
|
|
>
|
2013-03-11 20:14:48 -04:00
|
|
|
let g:signify_sign_add = '+'
|
2013-06-22 09:11:25 -04:00
|
|
|
let g:signify_sign_delete = '_'
|
2013-03-11 20:14:48 -04:00
|
|
|
let g:signify_sign_delete_first_line = '‾'
|
2014-10-04 13:35:51 -04:00
|
|
|
let g:signify_sign_change = '!'
|
|
|
|
let g:signify_sign_changedelete = g:signify_sign_change
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-03-11 20:14:48 -04:00
|
|
|
The sign to use if a line was added, deleted or changed or a combination of
|
|
|
|
these.
|
2013-03-05 17:07:54 -05:00
|
|
|
|
2017-07-18 10:13:28 -04:00
|
|
|
You can use unicode characters, but signs must not take up more than two
|
|
|
|
cells. Otherwise |E239| is thrown.
|
2014-10-04 13:35:51 -04:00
|
|
|
|
2017-07-18 10:13:28 -04:00
|
|
|
If |g:signify_sign_show_count| is set, |g:signify_sign_delete| and
|
|
|
|
|g:signify_sign_changedelete| get truncated as needed.
|
2014-10-04 13:35:51 -04:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_sign_show_count* >
|
2014-10-07 16:55:11 -04:00
|
|
|
let g:signify_sign_show_count = 1
|
2014-10-04 13:35:51 -04:00
|
|
|
<
|
2014-10-07 16:55:11 -04:00
|
|
|
Add the number of deleted lines to |g:signify_sign_delete| (up to 99) and
|
|
|
|
|g:signify_sign_changedelete| (up to 9). Otherwise only the normal signs will
|
|
|
|
be shown.
|
2014-10-04 13:35:51 -04:00
|
|
|
|
2016-09-28 11:05:40 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_sign_show_text* >
|
2016-09-28 11:05:40 -04:00
|
|
|
let g:signify_sign_show_text = 1
|
|
|
|
<
|
|
|
|
Don't show any text in the sign column. (Actually it will show a non-breaking
|
|
|
|
space.)
|
|
|
|
|
|
|
|
This is useful if you only want to see colors instead. If your colorscheme
|
|
|
|
doesn't do it for you, you can set the background color of a particular sign
|
|
|
|
yourself: |signify-colors|.
|
|
|
|
|
2017-03-13 10:50:04 -04:00
|
|
|
If you want no sign column at all and use Vim 7.4.2201+, use 'signcolumn'.
|
2016-09-28 11:05:40 -04:00
|
|
|
|
2017-02-25 16:06:54 -05:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
*g:signify_cursorhold_normal*
|
|
|
|
*g:signify_cursorhold_insert* >
|
|
|
|
let g:signify_cursorhold_normal = 0
|
|
|
|
let g:signify_cursorhold_insert = 0
|
|
|
|
<
|
|
|
|
Additionally trigger sign updates in normal or insert mode after 'updatetime'
|
|
|
|
miliseconds without any keypresses. This fires only once between keypresses,
|
|
|
|
thus not every 'updatetime' miliseconds.
|
|
|
|
|
|
|
|
NOTE: This also saves the buffer to disk!
|
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_difftool* >
|
2013-06-06 19:01:30 -04:00
|
|
|
let g:signify_difftool = 'gnudiff'
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-06-06 19:01:30 -04:00
|
|
|
This will avoid the attempt to find the proper diff tool for version control
|
|
|
|
systems that rely on an external diff tool that supports the -U0 flag. These
|
|
|
|
are: svn, bzr, darcs, fossil.
|
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
Default: "diff"
|
2013-08-07 06:57:02 -04:00
|
|
|
|
2015-06-02 09:12:01 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*g:signify_fold_context* >
|
2015-06-02 09:12:01 -04:00
|
|
|
let g:signify_fold_context = [0, 3]
|
|
|
|
<
|
|
|
|
This changes the number of lines of context that |signify-:SignifyFold| should
|
|
|
|
use. The first element describes the context at foldlevel 0 and the second the
|
|
|
|
context at foldlevel 1.
|
|
|
|
|
|
|
|
Example:~
|
|
|
|
|
|
|
|
Using "[0,3]" means that after using :SignifyFold, only changed lines will be
|
|
|
|
unfolded. Using |zo| (and similar |fold-commands|) on a folded line will reveal
|
|
|
|
3 more lines of context. Using |zo| a second time will reveal everything.
|
|
|
|
|
|
|
|
Default: [3, 8]
|
|
|
|
|
2013-03-05 17:07:54 -05:00
|
|
|
==============================================================================
|
2014-09-11 10:48:22 -04:00
|
|
|
COMMAND *signify-commands*
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyEnable* >
|
2016-01-06 18:00:21 -05:00
|
|
|
:SignifyEnable
|
|
|
|
<
|
|
|
|
Enable the plugin for the current buffer only.
|
|
|
|
|
2016-01-14 20:04:59 -05:00
|
|
|
Can also be used to when a repository was initialized while Sy was already
|
|
|
|
loaded.
|
|
|
|
|
2016-01-06 18:00:21 -05:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyDisable* >
|
2016-01-06 18:00:21 -05:00
|
|
|
:SignifyDisable
|
|
|
|
<
|
|
|
|
Disable the plugin for the current buffer only.
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyToggle* >
|
2013-03-05 17:07:54 -05:00
|
|
|
:SignifyToggle
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-03-05 17:07:54 -05:00
|
|
|
Toggle the plugin for the current buffer only.
|
|
|
|
|
2013-10-02 07:47:05 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyToggleHighlight* >
|
2013-03-05 17:07:54 -05:00
|
|
|
:SignifyToggleHighlight
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-03-05 17:07:54 -05:00
|
|
|
Toggle line highlighting for lines containing changes.
|
2014-11-02 09:57:50 -05:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyRefresh* >
|
2014-11-05 08:16:44 -05:00
|
|
|
:SignifyRefresh
|
|
|
|
<
|
|
|
|
Refresh signs in all windows.
|
2014-11-02 09:57:50 -05:00
|
|
|
|
2017-03-02 10:46:38 -05:00
|
|
|
NOTE: Nothing will happen, if :SignifyRefresh is used from the |cmdline-window|.
|
|
|
|
|
2015-06-02 09:12:01 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyFold* >
|
2015-12-08 18:40:21 -05:00
|
|
|
:SignifyFold[!]
|
2015-06-02 09:12:01 -04:00
|
|
|
<
|
2017-03-13 10:50:04 -04:00
|
|
|
Open the current buffer in a new tabpage and set 'foldexpr' so that only
|
2015-06-02 09:12:01 -04:00
|
|
|
changed lines with their surrounding context are unfolded.
|
|
|
|
|
|
|
|
The number of lines per context can be changed via |g:signify_fold_context|.
|
|
|
|
|
|
|
|
The |foldtext| will be set so that the left side shows the first line in the
|
|
|
|
fold and the right side shows something like "50 [1]" which whereas "50"
|
|
|
|
stands for the number of folded lines and the "1" is the foldlevel.
|
|
|
|
|
2015-12-08 18:40:21 -05:00
|
|
|
If [!] is given, Sy will do the same without opening an extra tabpage. Another
|
|
|
|
":SignifyFold!" will toggle back to the previous settings.
|
|
|
|
|
2015-06-02 09:12:01 -04:00
|
|
|
See |folds| to learn more about folding.
|
|
|
|
|
2014-11-05 08:16:44 -05:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyList* >
|
|
|
|
:SignifyList
|
2014-11-02 09:57:50 -05:00
|
|
|
<
|
2014-11-05 08:16:44 -05:00
|
|
|
Outputs debug info for all managed buffers.
|
|
|
|
|
2015-05-24 04:52:28 -04:00
|
|
|
------------------------------------------------------------------------------
|
2017-02-17 10:19:34 -05:00
|
|
|
*signify-:SignifyDebug* >
|
|
|
|
:SignifyDebug
|
2015-05-26 04:59:29 -04:00
|
|
|
<
|
|
|
|
In case no signs are shown, although the buffer contains a file controlled by
|
|
|
|
a supported VCS, use this command.
|
|
|
|
|
2017-02-17 10:19:34 -05:00
|
|
|
It will show all tried commands and their output. Errors will be highlighted
|
|
|
|
via |hl-ErrorMsg|.
|
2015-05-26 04:59:29 -04:00
|
|
|
|
2016-03-31 10:47:33 -04:00
|
|
|
==============================================================================
|
|
|
|
AUTOCOMMAND *signify-autocommand*
|
|
|
|
|
2017-02-20 10:40:57 -05:00
|
|
|
User SignifySetup~
|
2016-03-31 10:47:33 -04:00
|
|
|
|
2017-02-20 10:40:57 -05:00
|
|
|
This event fires at the end of `plugin/signify.vim`, in case you want to
|
|
|
|
change any of the default autocmds, commands, or mappings.
|
|
|
|
|
|
|
|
User Signify~
|
|
|
|
|
|
|
|
This event fires when Sy detects changes in a version-controlled file.
|
2016-03-31 10:47:33 -04:00
|
|
|
|
2016-07-21 13:46:03 -04:00
|
|
|
NOTE: Autocmds don't nest by default. If you use any command that triggers new
|
2017-02-25 16:06:54 -05:00
|
|
|
events, make sure to use |autocmd-nested|.
|
2016-07-21 13:46:03 -04:00
|
|
|
|
2014-10-05 17:58:59 -04:00
|
|
|
==============================================================================
|
2014-11-05 08:16:44 -05:00
|
|
|
MAPPINGS *signify-mappings*
|
2014-10-05 17:58:59 -04:00
|
|
|
|
2014-11-05 08:16:44 -05:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
Hunk jumping:~
|
2016-01-13 21:40:52 -05:00
|
|
|
|
|
|
|
]c Jump to next hunk.
|
|
|
|
[c Jump to previous hunk.
|
|
|
|
|
|
|
|
]C Jump to last hunk.
|
|
|
|
[C Jump to first hunk.
|
|
|
|
|
|
|
|
If you don't like these mappings, you can map them yourself:
|
2014-10-05 17:58:59 -04:00
|
|
|
>
|
2014-11-05 08:16:44 -05:00
|
|
|
nmap <leader>gj <plug>(signify-next-hunk)
|
|
|
|
nmap <leader>gk <plug>(signify-prev-hunk)
|
2016-01-13 21:40:52 -05:00
|
|
|
nmap <leader>gJ 9999<leader>gj
|
|
|
|
nmap <leader>gK 9999<leader>gk
|
2014-10-05 17:58:59 -04:00
|
|
|
<
|
2014-11-05 08:16:44 -05:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
Hunk text object:~
|
2014-10-28 12:32:08 -04:00
|
|
|
>
|
|
|
|
omap ic <plug>(signify-motion-inner-pending)
|
|
|
|
xmap ic <plug>(signify-motion-inner-visual)
|
|
|
|
omap ac <plug>(signify-motion-outer-pending)
|
|
|
|
xmap ac <plug>(signify-motion-outer-visual)
|
|
|
|
<
|
2014-11-05 08:16:44 -05:00
|
|
|
"ic" operates on all lines of the current hunk. "ac" does the same, but also
|
|
|
|
removes all trailing empty lines.
|
|
|
|
|
|
|
|
NOTE: Don't be surprised that this also works with "deleted lines".
|
|
|
|
|
2013-03-05 17:07:54 -05:00
|
|
|
==============================================================================
|
2014-09-11 10:48:22 -04:00
|
|
|
COLORS *signify-colors*
|
2013-07-03 10:59:28 -04:00
|
|
|
|
|
|
|
This plugin defines highlighting groups for two different places: for lines
|
|
|
|
and signs. Per default these don't really exist but are linked to the standard
|
|
|
|
highlighting groups: DiffAdd, DiffChange, DiffDelete:
|
2013-10-02 07:47:05 -04:00
|
|
|
>
|
2014-10-04 13:35:51 -04:00
|
|
|
highlight link SignifyLineAdd DiffAdd
|
|
|
|
highlight link SignifyLineChange DiffChange
|
|
|
|
highlight link SignifyLineDelete DiffDelete
|
|
|
|
highlight link SignifyLineChangeDelete SignifyLineChange
|
|
|
|
highlight link SignifyLineDeleteFirstLine SignifyLineDelete
|
|
|
|
|
|
|
|
highlight link SignifySignAdd DiffAdd
|
|
|
|
highlight link SignifySignChange DiffChange
|
|
|
|
highlight link SignifySignDelete DiffDelete
|
|
|
|
highlight link SignifySignChangeDelete SignifySignChange
|
|
|
|
highlight link SignifySignDeleteFirstLine SignifySignDelete
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-07-03 10:59:28 -04:00
|
|
|
Thus if you do not want to change the standard highlighting groups, but want
|
|
|
|
different colors for either your signs or lines, you can define one of these 6
|
|
|
|
Signify groups yourself in your vimrc.
|
|
|
|
|
|
|
|
Personally I use (256 colors terminal):
|
2013-10-02 07:47:05 -04:00
|
|
|
>
|
2013-07-03 10:59:28 -04:00
|
|
|
" highlight lines in Sy and vimdiff etc.)
|
|
|
|
|
|
|
|
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119
|
|
|
|
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167
|
|
|
|
highlight DiffChange cterm=bold ctermbg=none ctermfg=227
|
|
|
|
|
|
|
|
" highlight signs in Sy
|
|
|
|
|
|
|
|
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119
|
|
|
|
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167
|
|
|
|
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227
|
2013-10-02 07:47:05 -04:00
|
|
|
<
|
2013-07-03 11:23:38 -04:00
|
|
|
For Unix people there is a small script, showcolors.bash, in the repo that
|
|
|
|
shows all 256 colors available to the terminal. That makes picking the right
|
|
|
|
numbers much easier.
|
2013-07-03 10:59:28 -04:00
|
|
|
|
2015-06-15 12:15:29 -04:00
|
|
|
==============================================================================
|
|
|
|
FAQ *signify-faq*
|
|
|
|
|
|
|
|
|signify-faq-01| What about vim-flagship support?
|
2016-10-05 11:59:53 -04:00
|
|
|
|signify-faq-02| The plugin is slow!
|
2017-02-15 15:54:55 -05:00
|
|
|
|signify-faq-03| Line highlighting without showing signs?
|
2015-06-15 12:15:29 -04:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
*signify-faq-01*
|
|
|
|
What about vim-flagship support?~
|
|
|
|
|
|
|
|
sy#repo#get_stats() returns a list with 3 integers for added, modified and
|
|
|
|
removed lines. Create a wrapper function around it and return a string:
|
|
|
|
>
|
|
|
|
function! s:sy_stats_wrapper()
|
|
|
|
let symbols = ['+', '-', '~']
|
|
|
|
let [added, modified, removed] = sy#repo#get_stats()
|
|
|
|
let stats = [added, removed, modified] " reorder
|
|
|
|
let hunkline = ''
|
|
|
|
|
|
|
|
for i in range(3)
|
|
|
|
if stats[i] > 0
|
|
|
|
let hunkline .= printf('%s%s ', symbols[i], stats[i])
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
|
|
|
|
if !empty(hunkline)
|
|
|
|
let hunkline = printf('[%s]', hunkline[:-2])
|
|
|
|
endif
|
|
|
|
|
|
|
|
return hunkline
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
autocmd User Flags call Hoist('buffer', function('s:sy_stats_wrapper'))
|
|
|
|
<
|
2016-10-05 11:59:53 -04:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
*signify-faq-02*
|
|
|
|
The plugin is slow!~
|
|
|
|
|
|
|
|
* Set |g:signify_vcs_list|. Always.
|
|
|
|
|
|
|
|
* Sy relies on external tools. Check if these are the bottleneck.
|
|
|
|
|
|
|
|
If you use a centralized VCS like Subversion, is the connection to the
|
|
|
|
server slow?
|
|
|
|
|
|
|
|
If you use a decentralized VCS like Git, are you working on a slow remote
|
|
|
|
file system?
|
|
|
|
|
|
|
|
* Vim its sign handling code is known to be slow. If the delay is very long,
|
|
|
|
chances are the diff is just huge. This often happens after adding (or
|
|
|
|
removing) a huge file to the repo.
|
|
|
|
|
2017-02-15 15:54:55 -05:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
*signify-faq-03*
|
|
|
|
Line highlighting without showing signs?~
|
|
|
|
|
|
|
|
The line highlighting relies on signs being placed. The sign column is being
|
2017-02-16 07:54:54 -05:00
|
|
|
shown automatically if there are placed signs.
|
2017-02-15 15:54:55 -05:00
|
|
|
|
|
|
|
With a recent Vim, you can change that behaviour using 'signcolumn'.
|
|
|
|
|
2014-11-05 08:16:44 -05:00
|
|
|
==============================================================================
|
|
|
|
EXAMPLE *signify-example*
|
|
|
|
|
|
|
|
An example configuration for Sy:
|
|
|
|
>
|
|
|
|
let g:signify_vcs_list = [ 'git', 'hg' ]
|
2017-02-25 16:06:54 -05:00
|
|
|
let g:signify_cursorhold_insert = 1
|
|
|
|
let g:signify_cursorhold_normal = 1
|
2014-11-05 08:16:44 -05:00
|
|
|
let g:signify_update_on_bufenter = 0
|
|
|
|
let g:signify_update_on_focusgained = 1
|
|
|
|
|
2017-06-06 15:37:02 -04:00
|
|
|
nnoremap <leader>gt :SignifyToggle<CR>
|
|
|
|
nnoremap <leader>gh :SignifyToggleHighlight<CR>
|
|
|
|
nnoremap <leader>gr :SignifyRefresh<CR>
|
|
|
|
nnoremap <leader>gd :SignifyDebug<CR>
|
2014-11-05 08:16:44 -05:00
|
|
|
|
|
|
|
" hunk jumping
|
|
|
|
nmap <leader>gj <plug>(signify-next-hunk)
|
|
|
|
nmap <leader>gk <plug>(signify-prev-hunk)
|
|
|
|
|
|
|
|
" hunk text object
|
|
|
|
omap ic <plug>(signify-motion-inner-pending)
|
|
|
|
xmap ic <plug>(signify-motion-inner-visual)
|
|
|
|
omap ac <plug>(signify-motion-outer-pending)
|
|
|
|
xmap ac <plug>(signify-motion-outer-visual)
|
|
|
|
<
|
2013-03-05 17:07:54 -05:00
|
|
|
==============================================================================
|
2017-03-03 20:17:08 -05:00
|
|
|
vim: et tw=78
|