codekingpro/portable-devtools
114k
1*pi_tar.txt* For Vim version 9.2. Last change: 2026 Feb 142 3 +====================+4 | Tar File Interface |5 +====================+6 7Original Author: Charles E. Campbell8Copyright 2005-2017: *tar-copyright*9 The VIM LICENSE (see |copyright|) applies to the files in this10 package, including tarPlugin.vim, tar.vim, and pi_tar.txt. Like11 anything else that's except use "tar.vim" instead of "VIM". Like12 anything else that's free, tar.vim and its associated files are13 provided *as is* and comes with no warranty of any kind, either14 expressed or implied. No guarantees of merchantability. No15 guarantees of suitability for any purpose. By using this plugin, you16 agree that in no event will the copyright holder be liable for any17 damages resulting from the use of this software. Use at your own risk!18 19==============================================================================201. Contents *tar* *tar-contents*21 1. Contents..................................................|tar-contents|22 2. Usage.....................................................|tar-usage|23 3. Options...................................................|tar-options|24 4. History...................................................|tar-history|25 26==============================================================================272. Usage *tar-usage* *tar-manual*28 29 When one edits a *.tar file, this plugin will handle displaying a30 contents page. Select a file to edit by moving the cursor atop31 the desired file, then hit the <return> key. After editing, one may32 also write to the file. Currently, one may not make a new file in33 tar archives via the plugin.34 35 *:Vimuntar*36 VIMUNTAR~37 38 :Vimuntar [vimhome]39 40 This command copies, if necessary, the tarball to the .vim or vimfiles41 directory using the first writable directory in the 'runtimepath' when42 no [vimhome] is specified. Otherwise, the [vimhome] argument allows43 the user to specify that directory, instead.44 45 The copy is done using the command in *g:tar_copycmd* , which is >46 cp for cygwin, unix, macunix47 copy for windows (32, 95, 64, 16)48< The extraction is done with the command specified with49 *g:tar_extractcmd* , which by default is >50 "tar -xf"51<52 *:TarDiff*53 DIFFERENCING SUPPORT~54 55 :TarDiff [filename]56 57 This command will attempt to show the differences between the tarball58 version of a file and the associated file on the system. In order to59 find that file on the system, the script uses the path associated with60 the file mentioned in the tarball. If the current directory is not61 correct for that path, :TarDiff will fail to find the associated file.62 63 If the [filename] is given, that filename (and path) will be used64 to specify the associated file.65 66 67 PREVENTING LOADING~68 69 If for some reason you do not wish to use vim to examine tar'd files,70 you may put the following two variables into your <.vimrc> to prevent71 the tar plugin from loading: >72 73 let g:loaded_tarPlugin= 174 let g:loaded_tar = 175<76 *tar-mappings*77 MAPPINGS~78 79 The following (buffer-local) mappings are available in a tar buffer:80 81 <CR> Open selected file for editing, any changes will be82 written back to the archive.83 <LeftMouse> same as <CR>84 x Extract selected file.85 86==============================================================================873. Options *tar-options*88 89 These options are variables that one may change, typically in one's90 <.vimrc> file.91 Default92 Variable Value Explanation93 *g:tar_browseoptions* "Ptf" used to get a list of contents94 *g:tar_readoptions* "OPxf" used to extract a file from a tarball95 *g:tar_cmd* "tar" the name of the tar program96 *g:tar_nomax* 0 if true, file window will not be maximized97 *g:tar_writeoptions* "uf" used to update/replace a file98 99 100==============================================================================1014. History *tar-history*102 103 unreleased:104 Jul 13, 2025 * drop leading /105 May 19, 2025 * restore working directory after read/write106 Apr 16, 2025 * decouple from netrw by adding s:WinPath()107 instead of shelling out to file(1)108 Mar 02, 2025 * determine the compression using readblob()109 Mar 02, 2025 * escape the filename before using :read110 Mar 01, 2025 * fix syntax error in tar#Read()111 Feb 28, 2025 * add support for bzip3 (#16755)112 Feb 06, 2025 * add support for lz4 (#16591)113 Nov 11, 2024 * support permissions (#7379)114 Feb 19, 2024 * announce adoption115 Jan 08, 2024 * fix a few problems (#138331, #12637, #8109)116 v31 Apr 02, 2017 * (klartext) reported that browsing encrypted117 files in a zip archive created unencrypted118 swap files. I am applying a similar fix119 used on zip.vim to tar.vim: new buffers120 are opened with |:noswapfile|.121 May 16, 2017 * When the mouse option isn't empty, the122 leftmouse can be used to select a file123 in the tar-file listing.124 v30 Apr 22, 2014 * .tgz files are ambiguous: they may have been125 compressed with either gzip or bzip2. Tar.vim126 disambiguates by using unix's "file" command.127 Feb 18, 2016 * Changed =~ to =~# where appropriate128 Feb 18, 2017 * Now also permits xz decompression129 v28 Jun 23, 2011 * a few more decompression options (tbz tb2 txz)130 v27 May 31, 2011 * moved cygwin detection before g:tar_copycmd131 handling132 * inserted additional |:keepj| modifiers133 * changed silent to sil! (|:silent|)134 v26 Aug 09, 2010 * uses buffer-local instead of window variables135 to hold tarfile name136 * inserted keepj before 0d to protect jump list137 v25 Jun 19, 2010 * (Jan Steffens) added support for xz138 compression139 v24 Apr 07, 2009 * :Untarvim command implemented140 Sep 28, 2009 * Added lzma support141 v22 Aug 08, 2008 * security fixes142 v16 Jun 06, 2008 * tarfile:: used instead of tarfile: when143 editing files inside tarballs. Fixes a144 problem with tarballs called things like145 c:\abc.tar. (tnx to Bill McCarthy)146 v14 May 09, 2008 * arno caught a security bug147 May 28, 2008 * various security improvements. Now requires148 patch 299 which provides the fnameescape()149 function150 May 30, 2008 * allows one to view *.gz and *.bz2 files that151 are in *.tar files.152 v12 Sep 07, 2007 * &shq now used if not the empty string for153 g:tar_shq154 v10 May 02, 2006 * now using "redraw then echo" to show messages,155 instead of "echo and prompt user"156 v9 May 02, 2006 * improved detection of masquerading as tar file157 v8 May 02, 2006 * allows editing of files that merely masquerade158 as tar files159 v7 Mar 22, 2006 * work on making tar plugin work across network160 Mar 27, 2006 * g:tar_cmd now available for users to change161 the name of the tar program to be used. By162 default, of course, it's "tar".163 v6 Dec 21, 2005 * writing to files not in directories caused164 problems - fixed (pointed out by165 Christian Robinson)166 v5 Nov 22, 2005 * report option workaround installed167 v3 Sep 16, 2005 * handles writing files in an archive back to168 the archive169 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds170 Oct 18, 2005 * handles writing to compressed archives171 Nov 03, 2005 * handles writing tarfiles across a network172 using netrw#NetWrite()173 v2 * converted to use Vim7's new autoload feature174 by Bram Moolenaar175 v1 (original) * Michael Toren176 (see michael.toren.net/code/177 link seems dead)178 179==============================================================================180vim:tw=78:ts=8:noet:ft=help181 