Compare files, folders, clipboard or git changes with the tool meld (or other like WinMerge, Beyond Compare, ...) directly from vs codeThis extension open two files (or folders) in the external tool meld (or any other diff tool you want). It is also possible to compare editor context or text selection with the clipboard or to use it with the git source control. There are several commands to do different ways of comparing. It is also possible to choose the files (or folders) from the file list. Hit Folder comparison is only possible from file list (see hint in command description 'Select for meld compare' and 'Compare with selected for meld compare') Important:
Meld tool must be available on your system. In a command line the command It is also possible to change the compare tool (see Customize settings). Table of contents:
Detailed command informationThis chapter describes every command in detail. Compare all visible documents (two or three) using meldUp to three visible files can be compared with this command. To use it two or three files have to be visible side by side. If there are more than three files visible the three files with the newest modification timestamp are used. Compare current file with one other open file in editor using meldThe current selected file will be the first file for the comparison (left side in meld). The second file for the comparison (right side in meld) is selected by menu which shows all open files. Compare current file with one other file (not open in editor) using meldThe current selected file will be the first file for the comparison (left side in meld). The second file file for the comparison (right side in meld) is selected by open file dialog. Compare current file with saved version using meldCompare the changed version in the current editor with it's saved version. Change the contend in an editor and call the function. The changed content will be compared with the saved content in meld. This command is also available in the editor title context menu. Select for meld compareSet the current selected file as the first file for the comparison (left side in meld). This command is also available in the file list (only if one element is selected) and the editor title context menu. Compare with selected for meld compareCompare the current file (right side in meld) with the file selected before by 'Select for meld compare'. This command is also available in the file list (only if one element is selected and an element for meld compare is selected before) and the editor title context menu. Compare with clipboard using meldCompare the current file or the current selected text with the content of the clipboard.
If no text is selected the whole content of the editor is taken as selection. If the selection is equal to the clipboard just a message will appear and no meld is started. If the selection is not equal meld will be started comparing the saved file with the clipboard (not the maybe unsaved content). This command is also available in the editor context menu. Open with meld diff (git scm)It is possible to open a diff or merge conflict of a file from the Source Control window with meld (only for git). Therefore the command 'Open with meld diff (git scm)' can be selected from the context menu. All versions of the file that are not in the current workspace that are needed for the diff (e.g for diff of HEAD version to staged version) are only temporary and are deleted after meld is closed. Compare all selected files/folders using meldCompare all in file list selected files or folder using meld. This option is only available in the file list and only if more than one file is selected. Command in context menu only available if multiple elements are selected in list! Usage with file list (also folder comparison possible)Select for meld compareSelect the first file or folder to compare (left side in meld) by right click on file list and hit 'Select for meld compare'. Command in context menu only shown if one element is selected! Compare with selected for meld compareSelect the file or folder to compare to the file or folder selected before (right side in meld) by right click on file list and hit 'Compare with selected for meld compare'. Command in context menu only if one element is selected and an element for meld compare was selected before! Compare all selected files/folders using meldSee Compare all selected files/folders using meld above. Usage with editor context menuThe command 'Compare with clipboard' is also available in the context menu of a text editor. Usage with editor title context menuThe commands 'Select for meld compare', 'Compare with selected for meld compare' and 'Compare current file with saved version' are also available in the context menu of a text editor title. Usage with vscode diff editorComparisons performed with the vscode internal diff editor can be shown with meld by pressing the icon in the context area of the editor at the top right. Customize settingsUse other tools than meldIn the settings for Meld Diff it is possible to customize the tool to use. Instead of Meld other tools like WinMerge or Beyond Compare can be used. Also the given arguments can be configured. The default values are: Don't delete temp files if visual studio code is closed before meldBy default all temporary files created for comparison of unsaved files, selections and clipboard are removed on closing visual studio code. This is done even if meld instances are running. To prevent deleting of temp files that are used by meld instances on closing visual studio code uncheck the settings entry |