Introduction

Altap Salamander: Plugins: File Comparator: Introduction

Getting Started with File Comparator Plugin

The File Comparator plugin allows you to visually compare text and binary files. It shows you the differences between files side-by-side. It can also show detailed differences, it means that it highlights not only lines with differences, but directly added, changed, and deleted characters.

See Menu Extension section in Using Plugins for a description of basic work with menu extension.

© 2001-2019 ALTAP. All rights reserved.


Comparing Files

The File Comparator plugin allows you to visually compare text and binary files. It shows you the differences between files side-by-side.

To compare files:

  1. You can specify two files for comparison directly in panels or enter their names in the Compare Files dialog. This dialog is displayed only if Confirm files selection before launching File Comparator is checked (see General tab in Configuration dialog).

    How to specify two files for comparison in panels:
    1. select both files in one panel,
    2. select first file in left panel and then select second file in right panel,
    3. select first file and then focus the second file in one panel,
    4. select first file in left panel and then focus second file in right panel (and vice versa),
    5. if you have files with the same name in both panels, focus first file in one panel and second file with the same name will be taken from opposite panel.
  2. Open the Compare Files dialog (or directly open the File Comparator window if this dialog is suppressed):
    Menu: Plugins/File Comparator/Compare Files...
    Shortcut key: Ctrl+Shift+C
    File Comparator menu: File/Compare...
    File Comparator shortcut key: Ctrl+O
  3. Choose the OK button to open the File Comparator window.

See Also

Comparing Files from Other Applications


Comparing Files from Other Applications

You can use File Comparator plugin from other applications, e.g. Tortoise Hg or Tortoise SVN. Use supplied fcremote.exe utility to start Altap Salamander if it is not running and then to open new File Comparator window with two specified files to compare.

To compare files specified by other application:

  1. Go to File Comparator plugin's directory, e.g. C:\Program Files\Altap Salamander\plugins\filecomp.
  2. Find fcremote.exe utility.
  3. Use Copy Path + Name as Text command (Alt+Insert key) on fcremote.exe to copy full name of fcremote.exe to clipboard.
  4. Paste full name of fcremote.exe to application and give it two parameters with files to compare. If you need fcremote.exe to wait for closing File Comparator window (applications use it as a signal to remove temporary copies of compared files), use option -w before two files to compare.

Example: Using File Comparator plugin from Tortoise Hg:

  1. Open your mercurial.ini file in text editor. You can do it e.g. from Tortoise Hg Settings dialog, click Edit File button.
  2. Find section [tortoisehg], add line:
    vdiff = MySalDiff
  3. Find section [merge-tools], add lines:
    MySalDiff.executable=C:\Program Files\Altap Salamander\plugins\filecomp\fcremote.exe
    MySalDiff.diffargs=-w $parent $child

See Also

Comparing Files


Browsing Differences

The File Comparator usually finds many differences between compared files. To browse these differences you can use following commands:

  • First Difference (the Alt+Home key): go to the first difference,
  • Previous Difference (the Alt+Up Arrow key): go to the previous difference,
  • Next Difference (the Alt+Down Arrow key): go to the next difference,
  • Last Difference (the Alt+End key): go to the last difference.

You can find all described commands in the File Comparator window in the View menu.

See Also

Keyboard Shortcuts


Showing Detailed Differences

The plugin can also show detailed differences. It means that it highlights not only lines with differences, but directly added, changed, and deleted characters. If you want this to be always turned on, check Show detailed differences by default box on the General tab in the Configuration dialog.

To show detailed differences:

File Comparator menu: | View/Detailed Differences
File Comparator shortcut key: | F4


Recomparing Files

If one or both compared files has changed, you can compare them again.

To recompare files:

File Comparator menu: | File/Recompare
File Comparator shortcut key: | Ctrl+R


Showing Caret

If you want to select text and copy it to the clipboard using only the keyboard, you will need to show caret. Then you can use arrows to move the caret, hold Shift to select text, and Ctrl+C to copy the selection to the clipboard. To switch between the left and right file views use the Tab key.

To show/hide the caret:

File Comparator menu: | View/Show Caret
File Comparator shortcut key: | F2

See Also

Keyboard Shortcuts


Showing Only Differences

You may want to see only the parts of files where are differences. You can specify how many equal lines should be displayed before and after the difference (as the context of the difference), see Number of context lines to show if only differences are viewed on the General tab in the Configuration dialog.

To show only differences:

File Comparator menu: | View/Show Only Differences
File Comparator shortcut key: | Ctrl+D


Showing White Spaces

You may want to visualize white space characters which are normally invisible, see White space character on the General tab in the Configuration dialog.

To show white spaces:

File Comparator menu: | View/Show White Space
File Comparator shortcut key: | Ctrl+W


Resizing File Views

Compared files are displayed side-by-side. You can change the size of the file views by dragging the Split bar between the views or right-click the Split bar and choose a ratio from the context menu. When you double click the Split bar, both views will have the same size. You can also use the following commands:

  • Maximize Left (Top) File View (the Ctrl+, key): maximize the left (top) file view (right (bottom) view is minimized),
  • Maximize Right (Bottom) File View (the Ctrl+. key): maximize the right (bottom) file view (left (top) view is minimized),
  • Size File Views Equally (the Ctrl+E key): both views will have the same size,
  • Toggle Full Screen (the F11 key): maximize the File Comparator window.

You can find all described commands in the File Comparator window in the View menu.


General

Use this tab to customize general parameters of the plugin. See Configuring Plugins for general information about configuration.

Options

Confirm files selection before launching File Comparator
When checked, the Compare Files dialog is displayed before opening File Comparator window. You can check the pair of files you are going to compare and also set compare options in this dialog.
Number of context lines to show if only differences are viewed
When you are using File Comparator with Show Only Differences turned on (see Showing Only Differences for details), this is the number of lines displayed before and after the each shown difference.
Tab size
The width of tab character specified in the number of space characters.
White space character
The character used for visualization of space character (see Showing White Spaces for details).
Show detailed differences by default
When checked, the File Comparator window opens with Detailed Differences turned on (see Showing Detailed Differences for details).
Split file view horizontally
When checked, the File Comparator window opens with first file file shown in the upper half of the window and the second file in the lower half, instead of showing them in the left and right halves of the window.
File view font
The font used for text of compared files in the File Comparator window.
Load plugin on Altap Salamander start
When checked, the plugin is loaded on start of Altap Salamander.


Colors

Use this tab to set colors in the File Comparator window.

Choose the group of colors which you want to display/change: common colors, left panel colors, or right panel colors. Each color is displayed in its own row. Use the buttons in the row to change the color of text and background.

You can see all chosen colors in the preview at the bottom of this tab.


Default Compare Options

Use this tab to set the default options for comparing files. You can change these options also from Compare Files dialog (see Comparing Files for details) using the Advanced button.

Options

Ignores: All white space (only when comparing text files)
When checked, the file comparator ignores all horizontal and vertical white space characters (space, tab, end of line). You can imagine that it removes all white space characters before it starts any other actions.
Ignores: Changes in the amount of white space (only when comparing text files)
When checked, the file comparator ignores all changes in horizontal and vertical white space characters (space, tab, end of line). You can imagine that it replaces every sequence of white space characters by a single space character before it starts any other actions.
Ignores: Case (only when comparing text files)
When checked, the file comparator ignores case (upper and lower case characters are equivalent).
Files type: Autodetect, Text, or Binary
If you choose autodetect, both files will be tested if they are text files. If yes, they will be compared as text files. Otherwise they will be compared as binary files. If you don't want the files types to be autodetected, select if the plugin should compare them as text or as binary files.
Encoding of text files
You can let File Comparator autodetect the encoding (or code page) of the compared files when comparing as text files. Or you can choose one of several encodings and conversions.
There are 2 groups of available options:
  • ASCII-8: Conversions between several various encodings (code pages) of one of 3 groups of languages: Central European, Cyrillic and Western European. Only 1 group is available at a time. It is the same group as in the Internal Viewer of Altap Salamander. Another group can be chosen in the Language page in Configuration of Altap Salamander as Code page conversion tables.
    When a conversion is selected, the entire file is first converted in memory and then compared with the other file.
    Choosing a conversion is suitable when comparing files in different encodings. Otherwise usually no conversion is needed. For better (correct) display, it is advisable to convert both files either to CP12xx or ASCII codepage.
  • Unicode: Various Unicode encodings
Line ends (only when comparing text files)
Choose what types of line ends should be recognized in the first and second file.
Combine diacritic marks to precomposed characters
Many accented characters can be represented in several ways in Unicode. Either as a pair (or triple) of characters (the unaccented version of the character plus the accent(s), this is called decomposed or composite character) or as a single character (precomposed character). While on Windows the precomposed form is the usual one, files originating on other operating systems can use the decomposed form. Both forms are equivalent in terms of rendering, but stored differently.
When this option is checked, File Comparator on Unicode input files attempts to convert decomposed characters to precomposed ones to achieve so called Normalization Form C of Unicode. The Form C allows comparison of the content rather than the way the text is stored.
NOTE: Not every decomposed pair or triple has its precomposed equivalent.
NOTE: This function is available only on systems that contain a system library called normaliz.dll. It is a part of Windows Vista and newer OS versions, but is also part of MSIE 7 or Windows Media Player 11 when installed on Windows XP or 2003. It can also be installed separately as Microsoft Internationalized Domain Names (idndlpackage.EXE) from Microsoft downloads.


Advanced Options dialog box

Altap Salamander: Plugins: File Comparator: Dialog Boxes

Advanced Options

Use this dialog to set options for comparing files. You can choose if to use these options only for the current comparison or set them as defaults. You can preset these options also on Default Compare Options tab in Configuration dialog.

Options

Ignores: All white space (only when comparing text files)
When checked, the file comparator ignores all horizontal and vertical white space characters (space, tab, end of line). You can imagine that it removes all white space characters before it starts any other actions.
Ignores: Changes in the amount of white space (only when comparing text files)
When checked, the file comparator ignores all changes in horizontal and vertical white space characters (space, tab, end of line). You can imagine that it replaces every sequence of white space characters by a single space character before it starts any other actions.
Ignores: Case (only when comparing text files)
When checked, the file comparator ignores case (upper and lower case characters are equivalent).
Files type: Autodetect, Text, or Binary
If you choose autodetect, both files will be tested if they are text files. If yes, they will be compared as text files. Otherwise they will be compared as binary files. If you don't want the files types to be autodetected, select if the plugin should compare them as text or as binary files.
Encoding of text files
You can let File Comparator autodetect the encoding (or code page) of the compared files when comparing as text files. Or you can choose one of several encodings and conversions.
There are 2 groups of available options:
  • ASCII-8: Conversions between several various encodings (code pages) of one of 3 groups of languages: Central European, Cyrillic and Western European. Only 1 group is available at a time. It is the same group as in the Internal Viewer of Altap Salamander. Another group can be chosen in the Language page in Configuration of Altap Salamander as Code page conversion tables.
    When a conversion is selected, the entire file is first converted in memory and then compared with the other file.
    Choosing a conversion is suitable when comparing files in different encodings. Otherwise usually no conversion is needed. For better (correct) display, it is advisable to convert both files either to CP12xx or ASCII codepage.
  • Unicode: Various Unicode encodings
Line ends (only when comparing text files)
Choose what types of line ends should be recognized in the first and second file.
Combine diacritic marks to precomposed characters
Many accented characters can be represented in several ways in Unicode. Either as a pair (or triple) of characters (the unaccented version of the character plus the accent(s), this is called decomposed or composite character) or as a single character (precomposed character). While on Windows the precomposed form is the usual one, files originating on other operating systems can use the decomposed form. Both forms are equivalent in terms of rendering, but stored differently.
When this option is checked, File Comparator on Unicode input files attempts to convert decomposed characters to precomposed ones to achieve so called Normalization Form C of Unicode. The Form C allows comparison of the content rather than the way the text is stored.
NOTE: Not every decomposed pair or triple has its precomposed equivalent.
NOTE: This function is available only on systems that contain a system library called normaliz.dll. It is a part of Windows Vista and newer OS versions, but is also part of MSIE 7 or Windows Media Player 11 when installed on Windows XP or 2003. It can also be installed separately as Microsoft Internationalized Domain Names (idndlpackage.EXE) from Microsoft downloads.
Use these settings in future comparisons
When checked, options will be saved as defaults and will be used for all future comparisons. Otherwise these options are used only for the current comparison.


Keyboard Shortcuts

There are many hotkeys defined in File Comparator. These can speed up your work with File Comparator. You can find all the functions in menu together with associated hotkeys, so you can learn hotkeys just in time of use. Take this list as overview of all hotkeys, not as something you have to know to use File Comparator efficiently.

General Shortcuts

Press | To
F2 | Turn on/off caret in text mode
F4 | Turn on/off detailed differences view in text mode
F11 | Toggle fullscreen
M | Toggle fullscreen
O | Compare files
Ctrl+O | Compare files
R | Recompare currently opened files
Ctrl+R | Recompare currently opened files
C | Copy selection to clipboard
Ctrl+C | Copy selection to clipboard
D | Turn on/off view mode in which only differences are displayed
Ctrl+D | Turn on/off view mode in which only differences are displayed
W | Show white space
Ctrl+W | Show white space
Ctrl+H | Split horizontally to top and bottom views
, | Maximize left (top) file view
Ctrl+, | Maximize left (top) file view
. | Maximize right (bottom) file view
Ctrl+. | Maximize right (bottom) file view
E | Size left and right (top and bottom) views equally
Ctrl+E | Size left and right (top and bottom) views equally
H | Works like Left Arrow key
J | Works like Down Arrow key
K | Works like Up Arrow key
L | Works like Right Arrow key
B | Works like Page Up key
F | Works like Page Down key
G | Scroll to file begin
Shift+G | Scroll to file end
Alt+D | Activates differences combo box
Escape | Close File Comparator or cancel current operation
Page Up | Scroll to previous page
Page Down | Scroll to next page
Ctrl+Up | Scroll to previous line
Ctrl+Down | Scroll to next line
Ctrl+Home | Scroll to file begin
Ctrl+End | Scroll to file end
Ctrl+Page Up | Scroll to file begin
Ctrl+Page Down | Scroll to file end
Ctrl+Insert | Copy selection to clipboard
Alt+Up | Focus previous difference
Alt+Left | Focus previous difference
Alt+K | Focus previous difference
P | Focus previous difference
Alt+Down | Focus next difference
Alt+Right | Focus next difference
Alt+J | Focus next difference
N | Focus next difference
Alt+Home | Focus first difference
Alt+End | Focus last difference
Tab | Toggle active file view (for caret mode)
Ctrl+Tab | Cycle between maximized left (top) view, right (bottom) view, and both views
Ctrl+Shift+Tab | Cycle between maximized right (bottom) view, left (top) view, and both views

Following shortcuts applies only when caret is hidden

Press | To
Up | Scroll to previous line
Down | Scroll to next line
Left | Scroll to previous column
Right | Scroll to next column
Ctrl+Left | Fast scroll to previous column
Ctrl+Right | Fast scroll to next column
Home | Scroll to file begin
End | Scroll to file end

Following shortcuts applies only when caret is shown

Press | To
Up | Move caret to previous line
Down | Move caret to next line
Left | Move caret one character left
Right | Move caret one character right
Ctrl+Left | Move caret to previous word begin/end
Ctrl+Right | Move caret to next word begin/end
Home | Move caret to line begin
End | Move caret to line end
Space | Focus difference under caret (if any)
Shift+Space | Focus and select difference under caret (if any)

To select text hold the shift key down while moving caret.

See Also

Mouse Shortcuts


Other Mouse Shortcuts

Altap Salamander: Plugins: File Comparator: Shortcuts

Mouse Shortcuts

There are many mouse shortcuts defined in File Comparator.

You can:
  • Select text by dragging mouse pointer over text
  • Select one word by double clicking on it with left mouse button
  • Select full lines by dragging mouse pointer over text and holding ctrl key down
  • Select one line by double clicking in it with left mouse button while holding ctrl key down
  • Focus difference by clicking on it with left mouse button
  • Focus and select whole difference by double clicking on it in line numbers column with left mouse button
  • Display context menu by clicking in text window with right mouse button

See Also

Keyboard Shortcuts