Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame^] | 1 | *pi_expl.txt* For Vim version 7.0aa. Last change: 2002 Nov 08 |
| 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by M A Aziz Ahmed |
| 5 | updated by Mark Waggoner |
| 6 | |
| 7 | |
| 8 | *file-explorer* *file-browser* |
| 9 | Plugin for exploring (or browsing) directories and files |
| 10 | |
| 11 | 1. Starting the file explorer |expl-starting| |
| 12 | |
| 13 | The functionality mentioned here is a |standard-plugin|. |
| 14 | This plugin is only available if 'compatible' is not set. |
| 15 | You can avoid loading this plugin by setting the "loaded_explorer" variable: > |
| 16 | :let loaded_explorer = 1 |
| 17 | |
| 18 | {Vi does not have any of this} |
| 19 | |
| 20 | ============================================================================== |
| 21 | 1. Starting the file explorer *expl-starting* |
| 22 | |
| 23 | This plugin is used to explore directories inside Vim. The file explorer is |
| 24 | launched whenever the user tries to edit a directory. |
| 25 | *:Explore* *:Sexplore* |
| 26 | To launch the explorer in the directory of the file currently edited: > |
| 27 | :Explore |
| 28 | If the file has changes the window is split. To always split the window: > |
| 29 | :Sexplore |
| 30 | To launch the explorer in a specific directory: > |
| 31 | :Explore dirname |
| 32 | :Sexplore dirname |
| 33 | |
| 34 | From inside the explorer move your cursor to a line containing a file or |
| 35 | directory name. The following command keys are available: |
| 36 | |
| 37 | <enter> will open the file in the window the explorer is currently |
| 38 | occupying. |
| 39 | 'o' will split a new window and open the file in the new window. |
| 40 | 'O' will open the file chosen using the window that the cursor was in just |
| 41 | before you started or entered the explorer window. If the explorer is |
| 42 | the only window, it will first split a new window to use for the file to |
| 43 | be opened. |
| 44 | 'p' will open (or use) the preview window showing the file |
| 45 | 'x' will execute the file with the system tools. Only when supported |
| 46 | (currently MS-Windows and KDE). |
| 47 | |
| 48 | When splitting off a new window, you can control where the split window will |
| 49 | go relative to the explorer window using the variables g:explVertical, |
| 50 | g:explSplitBelow and g:explSplitRight. |
| 51 | |
| 52 | *g:explVertical* |
| 53 | *g:explSplitBelow* |
| 54 | *g:explSplitRight* |
| 55 | *g:explStartBelow* |
| 56 | *g:explStartRight* |
| 57 | To control whether the split is made horizontally or vertically, use: > |
| 58 | let g:explVertical=1 " Split vertically |
| 59 | let g:explVertical=0 " Split horizontally (default) |
| 60 | |
| 61 | To control where the window goes relative to the explorer window when |
| 62 | splitting horizontally, use the variable: > |
| 63 | let g:explSplitBelow=1 " Put new window below explorer window |
| 64 | let g:explSplitBelow=0 " Put new window above explorer window |
| 65 | The default for this is the setting of splitbelow at the time the plugin is |
| 66 | loaded. |
| 67 | |
| 68 | To control where the windows goes relative to the explorer window when |
| 69 | splitting vertically, use the variable: > |
| 70 | let g:explSplitRight=1 " Put new window to the right of the explorer |
| 71 | let g:explSplitRight=0 " Put new window to the left of the explorer |
| 72 | The default for this is the setting of splitright at the time the plugin is |
| 73 | loaded. |
| 74 | |
| 75 | To use a different split method for the explorer window, use: > |
| 76 | let g:explStartRight=1 " Put new explorer window to the right of the |
| 77 | " current window |
| 78 | let g:explStartRight=0 " Put new explorer window to the left of the |
| 79 | " current window |
| 80 | The default for this set to g:explSplitRight at the time the plugin is loaded. |
| 81 | |
| 82 | To use a different split method for the explorer window, use: > |
| 83 | let g:explStartBelow=1 " Put new explorer window below the |
| 84 | " current window |
| 85 | let g:explStartBelow=0 " Put new explorer window above the |
| 86 | " current window |
| 87 | The default for this set to g:explSplitBelow at the time the plugin is loaded. |
| 88 | |
| 89 | The start splits allow for the explorer window to be placed in a file browser |
| 90 | type arrangement, where the directories are shown on the left and the contents |
| 91 | opened on the right. The start split settings are only used when issuing |
| 92 | the Sexplore command. |
| 93 | |
| 94 | Note that the window split is done a little bit differently than window splits |
| 95 | are usually done. Ordinarily, when splitting a window, the space occupied by |
| 96 | the current window will be split to give space for the new window. The |
| 97 | explorer attempts to instead split from a window adjacent to the explorer |
| 98 | window so that the explorer window will not change sizes. If there is not an |
| 99 | adjacent window in the direction you are splitting, the explorer window is |
| 100 | split. |
| 101 | |
| 102 | *g:explWinSize* |
| 103 | After opening a file with the 'o' command, you might want to resize the |
| 104 | explorer window. This can be done by setting the variable > |
| 105 | let g:explWinSize=N |
| 106 | N is the number of rows (when the window is split horizontally) or the number |
| 107 | of columns (when the window is split vertically). If g:explWinSize is set to |
| 108 | an empty string (""), resizing will not be done. g:explWinSize defaults to |
| 109 | 15. |
| 110 | |
| 111 | *g:explDetailedList* |
| 112 | The file size (in bytes) and modification time can be displayed inside the |
| 113 | file explorer window. By pressing 'i', you can toggle between the name only |
| 114 | display and the more lengthy display. If you want the size and date to show |
| 115 | by default, use > |
| 116 | let g:explDetailedList=1 |
| 117 | Doing this may slightly slow down explorer. The difference may or may not be |
| 118 | noticeable depending on your system and whether the directory is local or on |
| 119 | the network and on the size of the directory. |
| 120 | |
| 121 | *g:explDateFormat* |
| 122 | The format of date displayed is configurable using the variable |
| 123 | g:explDateFormat. explorer uses this variable to pass to strftime() to fetch |
| 124 | the date information. |strftime()| The default is > |
| 125 | let g:explDateFormat="%d %b %Y %H:%M" |
| 126 | |
| 127 | Note that for sorting purposes, the date is always placed at the end of the |
| 128 | line in its 'raw' form. If you have syntax highlighting turned on, this raw |
| 129 | date should be invisible. |
| 130 | |
| 131 | *g:explHideFiles* |
| 132 | You can hide some files by filling the variable g:explHidFiles with regular |
| 133 | expressions. A filename that matches any of these regular expressions will not |
| 134 | be shown. For example, > |
| 135 | |
| 136 | let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$' |
| 137 | |
| 138 | will not show files that begin with "." and those that end in .gz, .exe or |
| 139 | .zip. However, all directory names will always be shown. If while exploring, |
| 140 | you'd like to see the hidden files as well, use the command "a". |
| 141 | The explorer header will indicate if filtering is being done. |
| 142 | |
| 143 | *g:explDetailedHelp* |
| 144 | The help information spanning a few lines can be turned off (and just a single |
| 145 | help message enabled) using the option > |
| 146 | let g:explDetailedHelp=0 |
| 147 | You can anytime switch to the detailed help format by pressing ?. |
| 148 | |
| 149 | *explorer-delete* |
| 150 | Pressing 'D' inside explorer deletes the file under the cursor. You can delete |
| 151 | many files by visually selecting them and using 'D'. The deletion is |
| 152 | interactive in the form y/n/a/q. Directory deletion is not supported (mainly |
| 153 | because there is no way to delete a directory using a vim built-in function). |
| 154 | |
| 155 | *explorer-rename* |
| 156 | Pressing 'R' inside explorer will allow you to rename the file under the |
| 157 | cursor. |
| 158 | |
| 159 | *g:explSortBy* |
| 160 | The display in the file explorer can be sorted in forward or reverse order by |
| 161 | name, size, or modification date. You can set the default sorting direction |
| 162 | with the option > |
| 163 | let g:explSortBy='name' " alphabetically |
| 164 | let g:explSortBy='reverse name' " reverse alphabetically |
| 165 | let g:explSortBy='date' " newest first |
| 166 | let g:explSortBy='reverse date' " oldest first |
| 167 | let g:explSortBy='size' " largest first |
| 168 | let g:explSortBy='reverse size' " smallest first |
| 169 | While in the explorer, you can rotate through the sort fields by pressing the |
| 170 | 's' key and you can reverse the current sort order by pressing the 'r' key. |
| 171 | Sorting on fields other than the name will be faster if the size and date are |
| 172 | displayed (using 'i' or g:explDetailedList). |
| 173 | The explorer heading will indicate the current sort order. |
| 174 | |
| 175 | *g:explDirsFirst* |
| 176 | To control the segregation of directories and files, you can set this option > |
| 177 | let g:explDirsFirst=1 " Directories at the top of the list (default) |
| 178 | let g:explDirsFirst=0 " Directories mixed in with files |
| 179 | let g:explDirsFirst=-1 " Directories at the bottom of the list |
| 180 | |
| 181 | *g:explSuffixesLast* |
| 182 | To control the segregation of files matching the suffixes option, you can set |
| 183 | this option > |
| 184 | let g:explSuffixesLast=1 " Files matching suffixes sorted at the bottom |
| 185 | " of the list (default) |
| 186 | let g:explSuffixesLast=0 " Files matching suffixes sorted normally |
| 187 | let g:explSuffixesLast=-1 " Files matching suffixes sorted at the top of |
| 188 | " the list |
| 189 | The heading will indicate if suffixes have been moved to the end (or start) of |
| 190 | the list. |
| 191 | |
| 192 | *g:explUseSeparators* |
| 193 | Directories and files matching the suffixes list will be highlighted. If you |
| 194 | have the directories, files, and suffixes separated, and you would like a |
| 195 | separator line between the groups, you can set the option > |
| 196 | let g:explUseSeparators=1 " Use separator lines |
| 197 | let g:explUseSeparators=0 " Don't use separator lines |
| 198 | < |
| 199 | *g:explFileHandler* |
| 200 | If you set the "g:explFileHandler" variable to the name of a function, typing |
| 201 | 'x' will call this function. The file or directory under the cursor will be |
| 202 | passed as an argument to the function. Suppose you have KDE, you could use |
| 203 | this: > |
| 204 | |
| 205 | function MyFileHandler(fn) |
| 206 | exec "silent! !kfmclient exec " . escape(a:fn,' \%#') |
| 207 | endfunction |
| 208 | let g:explFileHandler = 'MyFileHandler' |
| 209 | |
| 210 | For Win32 the variable is set by default to invoke the execute action. If you |
| 211 | type 'x' on a HTML file, Microsoft Internet Explorer will start (or whatever |
| 212 | application you have associated with HTML files). |
| 213 | |
| 214 | ============================================================================== |
| 215 | vim:tw=78:noet:ts=8:ft=help:norl: |