- introduction
- basics
- commands
- search
- visual mode
- configuration
- commandline commands
- macros
- marks and registers
- optional plugins
Command-Line Commands
This page describes the commands available within the command-line:
mode.Commands may be chained with a
|
character between them. For example::'<,'>s/foo/bar/g | '<,'>s/baz/bat/g
Vrapper allows abbreviated commands only when there are no conflicts (e.g. custom commands defined in
.vrapperrc
).
Command | Description | ||
---|---|---|---|
:w :update |
Writes the edited file to disk. | ||
:wa[ll] | Writes all edited files to disk. | ||
:q | Closes the editor if nothing was changed since the last save. | ||
:qall | Closes all editors if nothing was changed since the last save. | ||
:wq :x |
Writes the edited file to disk and closes the editor. | ||
:wqall :xall |
Writes all edited files to disk and closes all editors. | ||
:q! | Closes the editor even if there are unsaved changes. | ||
:u :undo |
Undoes the last change. | ||
:red[o] | Redoes an undone change. | ||
:fm :format |
Calls the formatter of the underlying editor if present. The formatter will be applied to the current selection or the whole text if nothing is selected. |
||
:ascii | Display the ascii value of the character under the cursor | ||
:<number> | Jumps to line <number> . |
||
:e[dit] <filename> |
Opens a file relative to the current working directory. If <filename> doesn't exist, create a new file in the current working directory.
|
||
:e[dit] | Refresh current file | ||
:e[dit]! | Revert changes to current file | ||
:cd <directory> | Changes current working directory (used by :e[dit] command). |
||
:pwd | Print current working directory. | ||
:find <filename> :tabfind <filename> |
Opens a file found in the list of directories defined by path variable. |
||
:tabnext :bn[ext] |
Move to next Eclipse editor (tab) | ||
:tabprevious :bp[revious] |
Move to previous Eclipse editor (tab) | ||
:tabrewind | Move to first Eclipse editor (tab) | ||
:tablast | Move to last Eclipse editor (tab) | ||
:files | List all open files in the current block of editors in the Eclipse UI. Editors which are open in another split are not listed. | ||
:buffers :ls |
List all recently-seen buffers and their ids. The currently active buffer is marked with '%', the previously active buffer is marked with '#'. | ||
:b[uffer ]<buffer id> |
Switch to the buffer with the given id. The special '%' and '#' ids are also
allowed. See :buffers above.
|
||
:bd[elete] | Close current editor (tab) | ||
:registers | List current registers and their contents | ||
:marks | List current marks and their locations | ||
:delmarks[!][marks] |
Delete specified mark, or delete all marks with Formats supported:
|
||
:only :tabonly |
Close all "other" Eclipse editors (close other tabs) | ||
:tabnew | Invoke Eclipse's New File dialog | ||
:tabs | Display open files (tabs) | ||
:noh[lsearch] | Clear the current search highlight without disabling the search highlight feature. | ||
:source <filename> | Include another config file (e.g. :source .vimrc ) to extend current configuration. |
||
:let @<char>=<register contents> |
Programmatically set register contents for register
Note that the search register is special: setting it to an empty
string will clear search highlighting, setting it to a given value
will activate a search query for the given string with defaults
(forward, any part of a word, ...) or use settings from the
last given search query after which the highlighting will be
updated (when |
||
:let mapleader=<character> | Set the value of <Leader> for use in mappings. |
||
:command <name> <command> |
Defines a custom command-line command <name> which will execute the command <command> .
Note that <command> can use | to chain multiple commands to a single <name> .
Example: :command MyReplace s/foo/bar/g | s/baz/bat/g would be executed with :MyReplace
|
||
:<range>!<command> |
Execute a shell command with the text from the given range as input, replacing that text with the output. Examples:
|
||
:r!<command> | Execute a shell command and insert the output. | ||
:move [line number] | Move current line to [line number] | ||
:copy [line number] | Copy current line to [line number] | ||
:autocmd <editor type> <command> |
Execute a .vrapperrc <command> only if the current editor is of Eclipse editor type <editor type>.
The <editor type> is the "registered name" of the Eclipse "part". For example:
|
||
The famous substitution feature.
|
|||
:<range>,<range>[y|d|s|c|t|m] |
Perform either the yank (y ), delete (d ), substitution (s ), copy (c , t ), or move (m ) operation on a range of lines.
|
||
Sort lines in entire file or over specified range.
|
|||
:retab[!] [new_tabstop] |
Replace all tabs with spaces (or spaces with tabs) within the file.
! nor new_tabstop is specified, the behavior is determined by the expandtab and tabstop
config properties.
|
||
:g/<pattern>/[d|s|normal] :g!/<pattern>/[d|s|normal] :v/<pattern>/[d|s|normal] |
Perform an operation on all lines that match pattern . Or, in the case of :g! and :v , all lines that don't match pattern .Operations are:
|
||
:startinsert[!] | Start in insertmode (only useful as the last line of a .vrapperrc file) | ||
:vim |
The current active file in Eclipse is opened in a new gvim window. Cursor is on the exact same line
and column as it was in Eclipse. This allows you to perform any operation in gvim which Vrapper doesn't support.
After you save the file and exit gvim (:wq ) Eclipse will reload the file with your changes.
Path to gvim is determined by gvimpath property (defaults to /usr/bin/gvim ).Arguments for gvim is determined by gvimargs property. |
||
:maximize | Maximize this editor tab in Eclipse. Run again to restore editor size. | ||
:eclipseaction[!] <name> <id> |
Binds the Eclipse action with the specified id to a (command line mode) command <name>. There are lists with action ids for workbench, text editors, and java editors. For example, if you wanted to define an action for JDT's "Find all References in Workspace" you can put the following in the .vrapperrc file: eclipseaction findref org.eclipse.jdt.ui.edit.text.java.search.references.in.workspace This command can then be called with :findref The action can be mapped to keys, for example gr :nmap gr :findref<enter> If ! is passed any existing command binding will be overwritten!
|
||
:eclipseuiaction[!] <name> <id> | Similar to :eclipseaction except it handles commands which display (or may display) a popup or dialog. |