*pi_expl.txt* For Vim version 6.3. Last change: 2002 Nov 08 VIM REFERENCE MANUAL by M A Aziz Ahmed updated by Mark Waggoner *file-explorer* *file-browser* Plugin for exploring (or browsing) directories and files 1. Starting the file explorer |expl-starting| The functionality mentioned here is a |standard-plugin|. This plugin is only available if 'compatible' is not set. You can avoid loading this plugin by setting the "loaded_explorer" variable: > :let loaded_explorer = 1 {Vi does not have any of this} ============================================================================== 1. Starting the file explorer *expl-starting* This plugin is used to explore directories inside Vim. The file explorer is launched whenever the user tries to edit a directory. *:Explore* *:Sexplore* To launch the explorer in the directory of the file currently edited: > :Explore If the file has changes the window is split. To always split the window: > :Sexplore To launch the explorer in a specific directory: > :Explore dirname :Sexplore dirname From inside the explorer move your cursor to a line containing a file or directory name. The following command keys are available: will open the file in the window the explorer is currently occupying. 'o' will split a new window and open the file in the new window. 'O' will open the file chosen using the window that the cursor was in just before you started or entered the explorer window. If the explorer is the only window, it will first split a new window to use for the file to be opened. 'p' will open (or use) the preview window showing the file 'x' will execute the file with the system tools. Only when supported (currently MS-Windows and KDE). When splitting off a new window, you can control where the split window will go relative to the explorer window using the variables g:explVertical, g:explSplitBelow and g:explSplitRight. *g:explVertical* *g:explSplitBelow* *g:explSplitRight* *g:explStartBelow* *g:explStartRight* To control whether the split is made horizontally or vertically, use: > let g:explVertical=1 " Split vertically let g:explVertical=0 " Split horizontally (default) To control where the window goes relative to the explorer window when splitting horizontally, use the variable: > let g:explSplitBelow=1 " Put new window below explorer window let g:explSplitBelow=0 " Put new window above explorer window The default for this is the setting of splitbelow at the time the plugin is loaded. To control where the windows goes relative to the explorer window when splitting vertically, use the variable: > let g:explSplitRight=1 " Put new window to the right of the explorer let g:explSplitRight=0 " Put new window to the left of the explorer The default for this is the setting of splitright at the time the plugin is loaded. To use a different split method for the explorer window, use: > let g:explStartRight=1 " Put new explorer window to the right of the " current window let g:explStartRight=0 " Put new explorer window to the left of the " current window The default for this set to g:explSplitRight at the time the plugin is loaded. To use a different split method for the explorer window, use: > let g:explStartBelow=1 " Put new explorer window below the " current window let g:explStartBelow=0 " Put new explorer window above the " current window The default for this set to g:explSplitBelow at the time the plugin is loaded. The start splits allow for the explorer window to be placed in a file browser type arrangement, where the directories are shown on the left and the contents opened on the right. The start split settings are only used when issuing the Sexplore command. Note that the window split is done a little bit differently than window splits are usually done. Ordinarily, when splitting a window, the space occupied by the current window will be split to give space for the new window. The explorer attempts to instead split from a window adjacent to the explorer window so that the explorer window will not change sizes. If there is not an adjacent window in the direction you are splitting, the explorer window is split. *g:explWinSize* After opening a file with the 'o' command, you might want to resize the explorer window. This can be done by setting the variable > let g:explWinSize=N N is the number of rows (when the window is split horizontally) or the number of columns (when the window is split vertically). If g:explWinSize is set to an empty string (""), resizing will not be done. g:explWinSize defaults to 15. *g:explDetailedList* The file size (in bytes) and modification time can be displayed inside the file explorer window. By pressing 'i', you can toggle between the name only display and the more lengthy display. If you want the size and date to show by default, use > let g:explDetailedList=1 Doing this may slightly slow down explorer. The difference may or may not be noticeable depending on your system and whether the directory is local or on the network and on the size of the directory. *g:explDateFormat* The format of date displayed is configurable using the variable g:explDateFormat. explorer uses this variable to pass to strftime() to fetch the date information. |strftime()| The default is > let g:explDateFormat="%d %b %Y %H:%M" Note that for sorting purposes, the date is always placed at the end of the line in its 'raw' form. If you have syntax highlighting turned on, this raw date should be invisible. *g:explHideFiles* You can hide some files by filling the variable g:explHidFiles with regular expressions. A filename that matches any of these regular expressions will not be shown. For example, > let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$' will not show files that begin with "." and those that end in .gz, .exe or .zip. However, all directory names will always be shown. If while exploring, you'd like to see the hidden files as well, use the command "a". The explorer header will indicate if filtering is being done. *g:explDetailedHelp* The help information spanning a few lines can be turned off (and just a single help message enabled) using the option > let g:explDetailedHelp=0 You can anytime switch to the detailed help format by pressing ?. *explorer-delete* Pressing 'D' inside explorer deletes the file under the cursor. You can delete many files by visually selecting them and using 'D'. The deletion is interactive in the form y/n/a/q. Directory deletion is not supported (mainly because there is no way to delete a directory using a vim built-in function). *explorer-rename* Pressing 'R' inside explorer will allow you to rename the file under the cursor. *g:explSortBy* The display in the file explorer can be sorted in forward or reverse order by name, size, or modification date. You can set the default sorting direction with the option > let g:explSortBy='name' " alphabetically let g:explSortBy='reverse name' " reverse alphabetically let g:explSortBy='date' " newest first let g:explSortBy='reverse date' " oldest first let g:explSortBy='size' " largest first let g:explSortBy='reverse size' " smallest first While in the explorer, you can rotate through the sort fields by pressing the 's' key and you can reverse the current sort order by pressing the 'r' key. Sorting on fields other than the name will be faster if the size and date are displayed (using 'i' or g:explDetailedList). The explorer heading will indicate the current sort order. *g:explDirsFirst* To control the segregation of directories and files, you can set this option > let g:explDirsFirst=1 " Directories at the top of the list (default) let g:explDirsFirst=0 " Directories mixed in with files let g:explDirsFirst=-1 " Directories at the bottom of the list *g:explSuffixesLast* To control the segregation of files matching the suffixes option, you can set this option > let g:explSuffixesLast=1 " Files matching suffixes sorted at the bottom " of the list (default) let g:explSuffixesLast=0 " Files matching suffixes sorted normally let g:explSuffixesLast=-1 " Files matching suffixes sorted at the top of " the list The heading will indicate if suffixes have been moved to the end (or start) of the list. *g:explUseSeparators* Directories and files matching the suffixes list will be highlighted. If you have the directories, files, and suffixes separated, and you would like a separator line between the groups, you can set the option > let g:explUseSeparators=1 " Use separator lines let g:explUseSeparators=0 " Don't use separator lines < *g:explFileHandler* If you set the "g:explFileHandler" variable to the name of a function, typing 'x' will call this function. The file or directory under the cursor will be passed as an argument to the function. Suppose you have KDE, you could use this: > function MyFileHandler(fn) exec "silent! !kfmclient exec " . escape(a:fn,' \%#') endfunction let g:explFileHandler = 'MyFileHandler' For Win32 the variable is set by default to invoke the execute action. If you type 'x' on a HTML file, Microsoft Internet Explorer will start (or whatever application you have associated with HTML files). ============================================================================== vim:tw=78:noet:ts=8:ft=help:norl: