vim-signify/README.md

225 lines
5.9 KiB
Markdown
Raw Normal View History

2013-03-28 05:25:24 -04:00
vim-signify
-----------
2013-03-05 14:07:37 -05:00
2013-03-15 08:52:57 -04:00
Or just: __sy__
2013-03-06 17:40:57 -05:00
2013-03-10 06:29:19 -04:00
Sy shows all added, deleted and modified lines since the last commit via Vim its
2013-03-15 08:52:57 -04:00
sign column. It __supports several version control systems__.
2013-03-05 18:30:30 -05:00
2013-03-15 08:52:57 -04:00
It's __fast__, __highly configurable__ and __well documented__.
2013-03-05 14:07:37 -05:00
Features:
2013-03-15 08:08:56 -04:00
- supports git, mercurial, darcs, bazaar, subversion, cvs, rcs
2013-03-12 10:05:09 -04:00
- quick jumping between changed lines
2013-03-05 14:12:24 -05:00
- apart from signs there is also optional line highlighting
2013-03-12 10:05:09 -04:00
- fully configurable through global variables (options and mappings)
2013-03-07 06:56:25 -05:00
- optional preserving of signs from other plugins
- you can toggle the plugin per buffer
- skip certain filetypes and filenames
2013-03-05 14:07:37 -05:00
- good documentation
2013-03-05 14:12:24 -05:00
- quick developer response! :-)
2013-03-05 14:07:37 -05:00
2013-03-07 07:29:54 -05:00
![Example:signify in action](https://github.com/mhinz/vim-signify/raw/master/signify.png)
2013-03-15 08:52:57 -04:00
Limits exist only in your mind!
2013-03-28 05:25:24 -04:00
Feedback, please!
-----------------
2013-03-15 08:52:57 -04:00
If you use any of my plugins, star it on github. This is a great way of getting
feedback! Same for issues or feature requests.
Thank you for flying mhi airlines. Get the Vim on!
2013-03-05 14:07:37 -05:00
2013-03-28 05:25:24 -04:00
What about vim-gitgutter?
-------------------------
2013-03-14 07:51:19 -04:00
To be honest, I don't understand why people always compare plugins like Sy to
vim-gitgutter. I understand that it is by far the most known one, but primarily
because it was featured on the Hacker News frontpage.
Don't get me wrong, I don't intend to badmouth gitgutter, I even contributed to
it once. (Granted, it was only a small fix.) And I'm glad about everyone
contributing to the Vim community, but there are two important facts one should
consider:
1. There were other plugins providing the same functionality as gitgutter years
before its creation.
1. Sy provides a superset of gitgutter.
So here is the short answer: The main difference is Sy its support for version
control systems other than git. Moreover, two of its design goals are speed and
high configurability.
2013-03-28 05:25:24 -04:00
Sign explanation
----------------
2013-03-14 06:13:25 -04:00
2013-03-22 14:00:05 -04:00
`+`
2013-03-14 06:13:25 -04:00
A new line was added. The sign is shown on the same line as the new line.
2013-03-22 14:00:05 -04:00
`_`
2013-03-14 06:13:25 -04:00
A line was deleted. The sign is shown on the line above the deleted line. Special case: The first line was deleted. In this case the sign is shown on the same line.
2013-03-22 14:00:05 -04:00
`!`
2013-03-14 06:13:25 -04:00
A line was changed. Something was changed, but the amount of lines stayed the same. The sign is shown on the same line.
2013-03-22 14:00:05 -04:00
`!_`
2013-03-14 06:13:25 -04:00
A line was changed and one or more of the lines below were deleted. A combination of **!** and **_**. The sign is shown on the same line.
2013-03-28 05:25:24 -04:00
Longer introduction
-------------------
2013-03-12 10:05:09 -04:00
2013-03-15 08:08:56 -04:00
#### supports several version control systems
2013-03-12 10:05:09 -04:00
This plugin is based on the diffing features of the supported version control
systems. Since not all VCS support the same options, sometimes we have to fall
back to the 'diff' executable.
Current the following VCS are supported:
- git
- mercurial (hg)
- bazaar (bzr)
- darcs
- subversion (svn)
- cvs
2013-03-15 08:08:56 -04:00
- rcs
2013-03-12 10:05:09 -04:00
2013-03-12 10:08:27 -04:00
#### quick jumping between changed lines
2013-03-12 10:05:09 -04:00
There are mappings for jumping forth and back between changed lines (so-called
hunks). The following example shows the default mappings and how to change them:
2013-03-21 10:04:08 -04:00
```vim
let g:signify_mapping_next_hunk = '<leader>gj'
let g:signify_mapping_prev_hunk = '<leader>gk'
```
2013-03-12 10:05:09 -04:00
Note: In case you don't know about the mapleader, have a look at `:h mapleader`.
The default is the '\' button.
Following Vim conventions you can also use __]c__ and __[c__.
2013-03-12 10:08:27 -04:00
#### apart from signs there is also optional line highlighting
2013-03-12 10:05:09 -04:00
Sy shows you signs for changed lines. Moveover, you can enable highlighting of
the concerned lines:
2013-03-21 10:04:08 -04:00
```vim
let g:signify_mapping_toggle_highlight = '<leader>gh'
```
2013-03-12 10:05:09 -04:00
You can also change the highlighting classes for these lines. The defaults are:
2013-03-21 10:04:08 -04:00
```vim
let g:signify_line_color_add = 'DiffAdd'
let g:signify_line_color_delete = 'DiffDelete'
let g:signify_line_color_change = 'DiffChange'
```
2013-03-12 10:05:09 -04:00
2013-03-12 10:08:27 -04:00
#### you can toggle the plugin per buffer
2013-03-12 10:05:09 -04:00
In case you want to disable the plugin for the current buffer, you can toggle
it:
2013-03-21 10:04:08 -04:00
```vim
let g:signify_mapping_toggle = '<leader>gt'
```
2013-03-12 10:05:09 -04:00
#### skip certain filetypes and filenames
2013-03-12 10:05:09 -04:00
If you want to disable Sy for certain kinds of filename or file types,
you explicitely have to create "skip dicts":
2013-03-12 10:05:09 -04:00
Example:
2013-03-21 10:04:08 -04:00
```vim
let g:signify_skip_filetype = { 'vim': 1, 'c': 1 }
let g:signify_skip_filename = { '/home/user/.vimrc': 1 }
2013-03-21 10:04:08 -04:00
```
2013-03-12 10:05:09 -04:00
2013-03-12 10:08:27 -04:00
#### good documentation
2013-03-12 10:05:09 -04:00
You should know by now!
2013-03-28 05:25:24 -04:00
Installation
------------
2013-03-05 14:07:37 -05:00
2013-03-21 10:04:08 -04:00
I suggest using tpope's pathogen:
- https://github.com/tpope/vim-pathogen
Afterwards, just clone vim-signify into ~/.vim/bundle/.
2013-03-05 14:07:37 -05:00
2013-03-28 05:25:24 -04:00
Documentation
-------------
2013-03-05 14:07:37 -05:00
`:h signify`
2013-03-28 05:25:24 -04:00
Configuration
-------------
2013-03-07 07:55:18 -05:00
For more info: `:h signify-options`
__NOTE__: The shown assignments are only examples, not defaults.
2013-03-21 10:04:08 -04:00
```vim
let g:signify_vcs_list = [ 'git', 'hg' ]
let g:signify_mapping_next_hunk = '<leader>gj'
let g:signify_mapping_prev_hunk = '<leader>gk'
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_mapping_toggle_highlight = '<leader>gh'
let g:signify_mapping_toggle = '<leader>gt'
2013-03-07 07:55:18 -05:00
let g:signify_skip_filetype = { 'vim': 1, 'c': 1 }
let g:signify_skip_filename = { '/home/user/.vimrc': 1 }
2013-03-10 05:59:52 -04:00
2013-03-21 10:04:08 -04:00
let g:signify_sign_overwrite = 1
2013-03-10 05:59:52 -04:00
2013-03-21 10:04:08 -04:00
let g:signify_sign_add = '+'
let g:signify_sign_delete = '-'
let g:signify_sign_change = '*'
let g:signify_sign_delete_first_line = '‾'
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_sign_color_guifg_add = '#00ff00'
let g:signify_sign_color_guifg_delete = '#ff0000'
let g:signify_sign_color_guifg_change = '#ffff00'
let g:signify_sign_color_guibg = '#111111'
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_sign_color_ctermfg_add = 2
let g:signify_sign_color_ctermfg_delete = 1
let g:signify_sign_color_ctermfg_change = 3
let g:signify_sign_color_ctermbg = 0
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_sign_color_group_add = 'MyAdd'
let g:signify_sign_color_group_delete = 'MyDelete'
let g:signify_sign_color_group_change = 'MyChange'
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_line_color_add = 'DiffAdd'
let g:signify_line_color_delete = 'DiffDelete'
let g:signify_line_color_change = 'DiffChange'
2013-03-07 07:55:18 -05:00
2013-03-21 10:04:08 -04:00
let g:signify_enable_cvs = 1
2013-03-10 20:00:02 -04:00
2013-03-21 10:04:08 -04:00
let g:signify_cursorhold_normal = 1
let g:signify_cursorhold_insert = 1
```
2013-03-28 05:25:24 -04:00
Author
------
2013-03-05 14:07:37 -05:00
Marco Hinz `<mh.codebro@gmail.com>`
2013-03-28 05:25:24 -04:00
License
-------
2013-03-05 14:07:37 -05:00
2013-03-07 07:12:01 -05:00
Copyright © 2013 Marco Hinz. Revised BSD license.