*vim-common-util* Utility Commands **************** The following is a list of utility commands provided by eclim. These are general purpose commands that are useful in and outside the scope of eclim. *:LocateFile* - :LocateFile [file_pattern] - Attempts to locate the supplied file pattern or if no argument is supplied, opens a temporary window where the text you type is turned into a pattern and search results are presented as you type. [image] While in this completion mode the following key bindings are available: - - close the search window without selecting a file - or - cycle forward through the results - or - cycle backwards through the results - - open the selected file using the default action - e - open the selected file via :edit - s - open the selected file via :split - t - open the selected file via :tabnew - l - switch the locate scope - h - toggle the help buffer By default, the search string accepted by the completion mode is intended to be just portions of the file name you are looking for, which is then automatically expanded in an effort to help you find the file with the fewest keystrokes possible. The argument version of :LocateFile on the other hand, accepts a hybrid glob/regex pattern. The glob portion allows you to use * and ** to match portions of a path or traverse multiple directories. You can mix * and ** with standard perl compatible regex operators to construct your search pattern. If you prefer the more explicit patterns supported by the argument version of :LocateFile over the default "fuzzy" pattern supported by the completion version of :LocateFile, then you can turn off the fuzzy matching support using the g:EclimLocateFileFuzzy variable described below. By default, all searching by both variants of this command is limited to the current project and any projects listed as dependencies, but you can widen the search scope to include all open projects by setting g:EclimLocateFileScope to 'workspace', which is the default scope when :LocateFile is executed outside of a project. In addition to the 'project' and 'workspace' scopes, :LocateFile also supports the following scopes: - buffers: search listed buffers - quickfix: search the quickfix results - vcsmodified: search files reported by your vcs as modified or untracked. Note: For performance reasons, locating files in the 'project' and 'workspace' scopes depends on eclipse being aware of all your project files. For the most part this is handled automatically as you create and edit files within vim. However, actions you take outside of vim or eclipse (moving/removing files, updates from a version control system, etc.) will not be visible until you force a project refresh via |:ProjectRefresh|. Configuration Vim Settings *g:EclimLocateFileDefaultAction* - g:EclimLocateFileDefaultAction (Default: 'split') - Determines the command used to open the file when hitting on an entry in the locate file results. *g:EclimLocateFileScope* - g:EclimLocateFileScope (Default: 'project') - Determines the scope for which to search for files. - 'project': search only the current project and its dependencies. - 'workspace': search the entire workspace (all open projects). - 'buffers': search listed buffers - 'quickfix': search the quickfix results - 'vcsmodified': search files reported by your vcs as modified or untracked. *g:EclimLocateFileFuzzy* - g:EclimLocateFileFuzzy (Default: 1) - Determines whether or not 'fuzzy' searching will be used on the no arugment version of :LocateFile. *:Split* - :Split file [file ...] - Behaves like the 'split' command, but allows multiple files to be supplied. Supports '*' and '**' wildcards. *:SplitRelative* - :SplitRelative file [file ...] - Like :Split this command provides splitting of multiple files, but this command splits files relative to the file in the current buffer. Supports '*' and '**' wildcards. *:Tabnew* - :Tabnew file [file ...] - Behaves like :Split, but issues a :tabnew on each file. Supports '*' and '**' wildcards. *:TabnewRelative* - :TabnewRelative file [file ...] - Behaves like :SplitRelative, but issues a :tabnew on each file. Supports '*' and '**' wildcards. *:EditRelative* - :EditRelative file - Like :SplitRelative except issues an 'edit' and only supports one file at a time. *:ReadRelative* - :ReadRelative file - Like :SplitRelative except issues a 'read' and only supports one file at a time. *:ArgsRelative* - :ArgsRelative file_pattern [file_pattern ...] - Like :SplitRelative except executes 'args'. *:ArgAddRelative* - :ArgAddRelative file_pattern [file_pattern ...] - Like :SplitRelative except executes 'argadd'. *:VimgrepRelative* - :VimgrepRelative /regex/ file_pattern [ file_pattern ...] - Executes :vimgrep relative to the current file. *:VimgrepAddRelative* - :VimgrepAddRelative /regex/ file_pattern [ file_pattern ...] - Executes :vimgrepadd relative to the current file. *:LvimgrepRelative* - :LvimgrepRelative /regex/ file_pattern [ file_pattern ...] - Executes :lvimgrep relative to the current file. *:LvimgrepAddRelative* - :LvimgrepAddRelative /regex/ file_pattern [ file_pattern ...] - Executes :lvimgrepadd relative to the current file. *:CdRelative* - :CdRelative dir - Executes :cd relative to the current file. *:LcdRelative* - :LcdRelative dir - Executes :lcd relative to the current file. *:Tcd* - :Tcd dir - Mimics vim's :lcd command but sets the current working directory local to the current tab instead of just the current window. *:DiffLastSaved* - :DiffLastSaved - Performs a diffsplit with the last saved version of the currently modifed file. *:SwapWords* - :SwapWords - Swaps two words (with cursor placed on the first word). Supports swapping around non-word characters like commas, periods, etc. *:Sign* - :Sign - Toggles adding or removing a vim sign on the current line. *:Signs* - :Signs - Opens a new window containing a list of signs for the current buffer. Hitting on one of the signs in the list will take you to that sign in the corresponding buffer. *:SignClearUser* - :SignClearUser - Removes all vim signs added via :Sign. *:SignClearAll* - :SignClearAll - Removes all vim signs. *:QuickFixClear* - :QuickFixClear - Removes all entries from the quick fix window. *:LocationListClear* - :LocationListClear - Removes all entries from the location list window. *:Buffers* - :Buffers - Opens a temporary window with a list of all the currently listed buffers in vim (like :buffers). From this list you can open any of the files using one of the following shortcuts: - E (shift-e) - Open the file with 'edit'. - S (shift-s) - Open the file with 'split'. - T (shift-t) - Open the file with 'tabnew'. - D (shift-d) - Deletes the buffer and removes it from the list. - ? - View the help buffer. In addition to the above mappings you can also use to execute the configured default action on the buffer under the cursor. To configure the default action you can set the following variable: g:EclimBuffersDefaultAction (defaults to 'split') By default entries will be sorted by path name, but you may change the sorting via these two variables: Configuration Vim Settings *g:EclimBuffersSort* - g:EclimBuffersSort (defaults to 'path') Supports one of 'path', 'status' (active or hidden), 'bufnr'. *g:EclimBuffersSortDirection* - g:EclimBuffersSortDirection (defaults to 'asc') Supports one of 'asc' or 'desc'. *:Only* - :Only - Alternative for vim's :only command. The purpose of this command and the original vim version is to close all but the current window. Unfortunately there is no way to tell the vim version to exclude some windows you may wish to keep open (taglist, quickfix, etc.). The eclim version provides that ability via the g:EclimOnlyExclude variable. Configuration Vim Settings *g:EclimOnlyExclude* g:EclimOnlyExclude (defaults to '(ProjectTree_*|__Tag_List__|-MiniBufExplorer-|command-line)') *:OtherWorkingCopyDiff* - :OtherWorkingCopyDiff - Diffs the current file against the same file in another project (one which has the same project relative path). This is most useful if you find yourself doing branch development and want to view the differences of the current file against one of the other branches. Supports command line tab completion of project names which contain a file with the same relative path as the current file: :OtherWorkingCopyDiff . *:OtherWorkingCopyEdit* - :OtherWorkingCopyEdit - Like :OtherWorkingCopyDiff, except open the file in the current window. *:OtherWorkingCopySplit* - :OtherWorkingCopySplit - Like :OtherWorkingCopyDiff, except open the file in a new window. *:OtherWorkingCopyTabopen* - :OtherWorkingCopyTabopen - Like :OtherWorkingCopyDiff, except open the file in a new tab. vim:ft=eclimhelp