changesPlugin : indicate changes of a buffer
| script karma
Downloaded by 2366
Comments, bugs, improvements
script versions (upload new version)
|PLEASE RATE THIS PLUGIN, IF YOU LIKE IT!
For a screenshot of the plugin see http://www.256bit.org/~chrisbra/changes.png
Follow this plugin at github:
This plugin was written to help visualize which lines have been changes since
editing started for a file. The plugin was inspired by so called changed-bars,
available at other editors, such as Embarcadero C++ Builder (there it is
called Change Bars, see:
or Visual Studio where it is called indicator margin (see
ChangesPlugin.vim uses the |diff|-feature of vim and compares the actual
buffer with it's saved state. In order to highlight the indicator signs at the
first column, its using |signs|. For newly added lines, the first column will
be displayed with a leading '+' and highlighted using the DiffAdd highlighting
(see |hl-DiffAdd|), deleted lines will be indicated by a '-' with a
DiffDelete highlighting (see |hl-DiffDelete|) and modified lines will be
displayed using '*' and a DiffChange highlighting (see |hl-DiffChange|).
This means, that in order to use this plugin you need a vim, that was built
with |+signs|-support and |+diff|-support and you also need an executable diff
command. If neither of these conditions are met, changePlugin.vim will issue a
warning and abort.
By default the plugin is not enabled. To enable it enter >
When you run this command, changesPlugin.vim diffs the current file agains
its saved file on disk and displays the changes in the first column.
If you want to disable the plugin, enter >
2. Configuring changesPlugin.vim
There are basically four different configuration options available.
2.1 Highlighte the whole line
By default, changesPlugin.vim will only indicate a change in the first column.
Setting g:changes_hl_lines to 1 will highlight the whole line. By default this
variable is unset (which is the same as setting it to 0).
If you'd like to have this, set this variable in your |.vimrc| >
2.2 Auto-refresh the changes
By default changesPlugin.vim will not automatically update the view. You can
however configure it to do so. This will use an |CursorHold| autocommand to
update the indicator signs after |'updatetime'| seconds in Normal mode when
no key is pressed. To enable this feature, put this in your |.vimrc| >
2.3 Show what the indicator signs mean.
By default, whenever you run |:EnableChanges|, changesVim will print a short
status message, what each sign means. If you don't want this, put this in your
2.4 Specify different colors.
changesVim uses the highlighting used for |diff| mode to indicate the change
in a buffer. This is consistent, since when you're already used to |vimdiff|
you'll probably also know the highlighting. If for any reason you do not like
the colors, you have to define your own highlighting items.
If for example you want the DiffAdd highlighting to be displayed like White on
a Blue background, you can define it as follows in your |.vimrc| >
:hi DiffAdd term=bold ctermbg=4 guibg=DarkBlue
In the same way, you can change DiffDelete for indicating deleted lines and
DiffChange for indicating modified lines. You can also specify your favorite
highlighting colors using your own build |colorscheme|.
3. changesPlugin History *changesPlugin-history*
0.2: Apr 11, 2010: Added Documentation
created an autoload version
0.1: Apr 10, 2010: First working version
|This plugin comes as vimball, which makes it really easy to install it into the right place.
1) Edit changes.vba with your vim (:e changes.vim)
2) From within vim, simply source the file using
3) Restart vim to autoload the plugin and the documentation
4) Read the help at :h changesPlugin.txt
See also the help available for vimballs at :h vimball-intro
Click on the package to download.
ip used for rating: 22.214.171.124
||NF: use TextChanged autocommand to update signs faster
NF: use new utf8 symbols
NF: Hide SignColumn
NF: include some nice looking icons for gvim
BF: Code cleanup
BF: resolve symlinks
NF: airline integration
BF: only draw at most one deleted sign, if a range of several consecutive lines have been deleted
NF: only place newly changed lines (instead of always removing all previous signs and adding them again)
NF: if g:changes_linehi_diff is set, tries to highlight changes within a line by overlaying CursorColumn highlighting over that parts.
BF: try to skip expensive TextChanged calls if possible.
BF: detect other signs correctly (didn't work with non-english locale)
BF: do not try to detect changes on vim help files and read only files
BF: calling :DC twice would cause an error
BF: Make use of patch 7.4.341
BF: When undefining signs and starting the gui, make sure no '[Deleted]' signs are left over
BF: Clear SignColumn before linking it to Normal group
BF: Make sure a warning message is shown for :EC
BF: Catch E255 when defining signs
BF: prevent recursively calling FocusGained autocommand on windows
BF: if vim-gitgutter is installed and the current buffer is handled by vim-gitgutter, let gitgutter handle the current buffer (issue https://github.com/chrisbra/changesPlugin/issues/12, reported by Gray-Wind, thanks!)
NF: g:changes_fast variable (to enable more correct at the cost of being possibly slower placement of signs).
BF: when updating signs, make sure that the first line of a consecutive number has the correcty type
NF: In insert mode, when <CR> is pressed, update the signs immediately
NF: InsertEnter/Leave autocommands to update signs
NF: Stage hunks for git
NF: Ignore special buffers (help window, quickfix buffer, command line window..)
BF: Make :CL only add the first line of each hunk to the location list.
||BF: Exception not caught (reported by Marco, thanks!)
BF: Prevent flickering by resetting SignColumn on
updates (reported by Marco, thanks!)
BF: parse diff output instead of relying on vimdiff
and parsing the syntax items (prevents flickering
since no window needs to be split)
BF: avoid error messages, when buffer is ignored
reported by mpfusion, thanks!)
BF: avoid error messages, using |DC|
reported by mpfusion, thanks!)
BF: don't mess with the |alternate-file|
reported by mpfusion, thanks!)
[h/]h move to previous/next changed line
||BF: Plugin used :EnableDisplayChanges, but documentation talked about EnableChanges (same for DisableChanges)
BF: Don't load the autoload script when sourcing the plugin (reported by Sergey Kholev, thanks!)
||NF: Fix issue #3 from github (check changes against
any file, suggested by Alessio Bolognino, Thanks!)
BF: Fix E117 error (patch by Mate Gabri, Thanks!)
BF: Check, that the current file is readable, before
diffing (patch by Mate Gabri, Thanks!)
BF: Sometimes, the previous Window is not accessible
by Mate Gabri, Thanks!)
||BF: Document, that |InsertLeave| autocommand is used as autocommand
BF: generate the help file with 'et' set, so that the README at github looks prettier
BF: When staying in diff mode, don't reset 'fdm' and apply syntax coloring to scratch buffer
BF: the check for the diff executable does not work as expected (Reported by Sergey Khorev), additionally outputting the Warnings did not work in that case
||Fixed Issue 1 from github (http://github.com/chrisbra/changesPlugin/issues/1/find)
||0.9: Apr 24, 2010:
NF: You can now use different VCS Systems for each buffer you are using.
NF: Stay in diff mode
BF: Fix the display of deleted signs
BF: Undefining old signs, so that changing g:changes_hl_lines works
BF: Some more error handling.
NF: Show an overview for changed lines in location-list (|:CL|)
NF: Show what each sign means using |:CC|
0.8: Apr 22, 2010: NF: Renamed the helpfile, to make it more obvious, that it refers to a plugin
NF: Outputting name of checked file, if checking against VCS
BF: Don't check for empty files.
BF: Reworked the Message function
BF: Don't try to place signs, if there are no differences (unreleased, VCS successfully tested with git, hg, svn, cvs, bzr)
0.7: Apr 19, 2010:
NF: Check against a file in a VCS (unreleased, first working version, needs to be checked for each VCS)
||BF: also take care of DiffText from diff-mode (see :h hl-DiffText)
||BF: error when trying to access b:diffhl in the scratch buffer. This should be fixed now (thanks Jeet Sukumaran!)
BF: Use the correct highlighting groups (thanks Jeet Sukumaran!)
NF: The autocommand checks, if the buffer has been modified, since the last time.
BF: Do not mess with signs, that have not been placed by changesPlugin.vim
BF: CleanUp was seriously messed up (sorry, I must have been asleep, when writing that)
BF: Take care of 'foldcolumn' setting, which would be overwritten by the signs-column
||BF: redraw, so that the diff window will not be displayed
NF: enabled GLVS (see |GLVS|)