blob: 62ee2c3966a25adbda4b80a5e5b3b20f2bb3dd55 [file] [log] [blame]
Bram Moolenaar81695252004-12-29 20:58:21 +00001*pi_expl.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by M A Aziz Ahmed
5 updated by Mark Waggoner
6
7
8 *file-explorer* *file-browser*
9Plugin for exploring (or browsing) directories and files
10
111. Starting the file explorer |expl-starting|
12
13The functionality mentioned here is a |standard-plugin|.
14This plugin is only available if 'compatible' is not set.
15You 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==============================================================================
211. Starting the file explorer *expl-starting*
22
23This plugin is used to explore directories inside Vim. The file explorer is
24launched whenever the user tries to edit a directory.
25 *:Explore* *:Sexplore*
26To launch the explorer in the directory of the file currently edited: >
27 :Explore
28If the file has changes the window is split. To always split the window: >
29 :Sexplore
30To launch the explorer in a specific directory: >
31 :Explore dirname
32 :Sexplore dirname
33
34From inside the explorer move your cursor to a line containing a file or
35directory 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
48When splitting off a new window, you can control where the split window will
49go relative to the explorer window using the variables g:explVertical,
50g:explSplitBelow and g:explSplitRight.
51
52 *g:explVertical*
53 *g:explSplitBelow*
54 *g:explSplitRight*
55 *g:explStartBelow*
56 *g:explStartRight*
57To 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
61To control where the window goes relative to the explorer window when
62splitting 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
65The default for this is the setting of splitbelow at the time the plugin is
66loaded.
67
Bram Moolenaar81695252004-12-29 20:58:21 +000068To control where the window goes relative to the explorer window when
Bram Moolenaar071d4272004-06-13 20:20:40 +000069splitting 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
72The default for this is the setting of splitright at the time the plugin is
73loaded.
74
75To 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
Bram Moolenaar81695252004-12-29 20:58:21 +000080The default is the value of g:explSplitRight at the time the plugin is loaded.
Bram Moolenaar071d4272004-06-13 20:20:40 +000081
82To 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
Bram Moolenaar81695252004-12-29 20:58:21 +000087The default is the value of g:explSplitBelow at the time the plugin is loaded.
Bram Moolenaar071d4272004-06-13 20:20:40 +000088
89The start splits allow for the explorer window to be placed in a file browser
90type arrangement, where the directories are shown on the left and the contents
91opened on the right. The start split settings are only used when issuing
92the Sexplore command.
93
94Note that the window split is done a little bit differently than window splits
95are usually done. Ordinarily, when splitting a window, the space occupied by
96the current window will be split to give space for the new window. The
97explorer attempts to instead split from a window adjacent to the explorer
98window so that the explorer window will not change sizes. If there is not an
99adjacent window in the direction you are splitting, the explorer window is
100split.
101
102 *g:explWinSize*
103After opening a file with the 'o' command, you might want to resize the
104explorer window. This can be done by setting the variable >
105 let g:explWinSize=N
106N is the number of rows (when the window is split horizontally) or the number
107of columns (when the window is split vertically). If g:explWinSize is set to
108an empty string (""), resizing will not be done. g:explWinSize defaults to
10915.
110
111 *g:explDetailedList*
112The file size (in bytes) and modification time can be displayed inside the
113file explorer window. By pressing 'i', you can toggle between the name only
114display and the more lengthy display. If you want the size and date to show
115by default, use >
116 let g:explDetailedList=1
117Doing this may slightly slow down explorer. The difference may or may not be
118noticeable depending on your system and whether the directory is local or on
119the network and on the size of the directory.
120
121 *g:explDateFormat*
122The format of date displayed is configurable using the variable
123g:explDateFormat. explorer uses this variable to pass to strftime() to fetch
124the date information. |strftime()| The default is >
125 let g:explDateFormat="%d %b %Y %H:%M"
126
127Note that for sorting purposes, the date is always placed at the end of the
128line in its 'raw' form. If you have syntax highlighting turned on, this raw
129date should be invisible.
130
131 *g:explHideFiles*
132You can hide some files by filling the variable g:explHidFiles with regular
133expressions. A filename that matches any of these regular expressions will not
134be shown. For example, >
135
136 let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$'
137
138will 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,
140you'd like to see the hidden files as well, use the command "a".
141The explorer header will indicate if filtering is being done.
142
143 *g:explDetailedHelp*
144The help information spanning a few lines can be turned off (and just a single
145help message enabled) using the option >
146 let g:explDetailedHelp=0
147You can anytime switch to the detailed help format by pressing ?.
148
149 *explorer-delete*
150Pressing 'D' inside explorer deletes the file under the cursor. You can delete
151many files by visually selecting them and using 'D'. The deletion is
152interactive in the form y/n/a/q. Directory deletion is not supported (mainly
153because there is no way to delete a directory using a vim built-in function).
154
155 *explorer-rename*
156Pressing 'R' inside explorer will allow you to rename the file under the
157cursor.
158
159 *g:explSortBy*
160The display in the file explorer can be sorted in forward or reverse order by
161name, size, or modification date. You can set the default sorting direction
162with 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
169While 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.
171Sorting on fields other than the name will be faster if the size and date are
172displayed (using 'i' or g:explDetailedList).
173The explorer heading will indicate the current sort order.
174
175 *g:explDirsFirst*
176To 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*
182To control the segregation of files matching the suffixes option, you can set
183this 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
189The heading will indicate if suffixes have been moved to the end (or start) of
190the list.
191
192 *g:explUseSeparators*
193Directories and files matching the suffixes list will be highlighted. If you
194have the directories, files, and suffixes separated, and you would like a
195separator 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*
200If 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
202passed as an argument to the function. Suppose you have KDE, you could use
203this: >
204
205 function MyFileHandler(fn)
206 exec "silent! !kfmclient exec " . escape(a:fn,' \%#')
207 endfunction
208 let g:explFileHandler = 'MyFileHandler'
209
210For Win32 the variable is set by default to invoke the execute action. If you
211type 'x' on a HTML file, Microsoft Internet Explorer will start (or whatever
212application you have associated with HTML files).
213
214==============================================================================
215 vim:tw=78:noet:ts=8:ft=help:norl: