Vim/README.md

169 lines
6.7 KiB
Markdown
Raw Normal View History

[![Version](http://vsmarketplacebadge.apphb.com/version/vscodevim.vim.svg)](http://aka.ms/vscodevim)
[![Build Status](https://travis-ci.org/VSCodeVim/Vim.svg?branch=master)](https://travis-ci.org/VSCodeVim/Vim) [![Slack Status](https://vscodevim-slackin.azurewebsites.net/badge.svg)](https://vscodevim-slackin.azurewebsites.net)
2016-01-07 02:59:32 +03:00
# Vim
2016-07-04 11:48:04 +03:00
VSCodeVim is a [Visual Studio Code](https://code.visualstudio.com/) extension that provides Vim keybindings within Visual Studio Code.
2016-06-23 11:53:28 +03:00
2016-09-28 09:16:48 +03:00
Please **[report missing or buggy features on GitHub](https://github.com/VSCodeVim/Vim/issues)**. We've added a lot of functionality, but everyone uses Vim in their own special way, so let us know if we're missing your favourite obscure command. :wink:
2016-06-23 11:53:28 +03:00
2016-09-28 09:16:48 +03:00
We're super friendly people if you want to drop by and talk to us on [Slack](https://vscodevim-slackin.azurewebsites.net).
2015-11-18 23:00:58 +03:00
2015-11-29 13:37:35 +03:00
![Screenshot](images/screen.png)
2015-11-18 23:00:58 +03:00
2016-08-03 09:47:10 +03:00
## Features We Support
2016-07-07 09:59:05 +03:00
2016-08-09 13:16:42 +03:00
* All modes (including visual block mode!)
2016-07-08 04:03:06 +03:00
* Most typical commands, including command combinations like `c3w`, `daw`, `2dd`, etc. (Check the [roadmap](ROADMAP.md) for details.)
2016-07-07 10:08:37 +03:00
* Command remapping (jj to esc)
2016-07-07 09:59:05 +03:00
* Repeating actions with `.`
2016-07-07 10:09:14 +03:00
* Incremental search with `/` and `?` that works like Vim (doesn't just open the search box!)
2016-07-07 09:59:05 +03:00
* Correct undo/redo state
* Marks
2016-08-11 19:24:56 +03:00
* Vim Options
2016-09-20 10:51:50 +03:00
* Multiple Cursor mode (allows multiple simultaneous cursors to receive Vim commands. It's like macros, but in real time. Allows `/` search, has independent clipboards for each cursor, etc.)
2016-07-07 09:59:05 +03:00
2016-07-07 10:42:42 +03:00
## Roadmap
See our [Github Milestone page](https://github.com/VSCodeVim/Vim/milestones) for an idea of what we plan to implement next.
## Install
2016-09-28 09:16:48 +03:00
Install the extension through the [VS Code Marketplace](https://code.visualstudio.com/docs/editor/extension-gallery).
## Configure
2016-07-04 20:05:53 +03:00
2016-09-28 09:16:48 +03:00
Due to overlap between VS Code and Vim, options are loaded slightly different from native Vim. The option loading sequence is
2016-07-14 08:28:25 +03:00
1. `:set {option}` on the fly
2. [TODO] .vimrc.
3. `vim.{option}` from user settings or workspace settings.
4. VSCode configuration
5. VSCodeVim flavored Vim option default values
2016-07-14 08:28:25 +03:00
## Multi-Cursor Mode
2016-10-03 23:41:05 +03:00
Multi-Cursor mode is currently in beta. Please report things you expected to work but didn't [to our feedback thread.](https://github.com/VSCodeVim/Vim/issues/824)
#### Getting into multi-cursor mode
You can enter multi-cursor mode by:
* Pressing cmd-d on OSX.
* Runing "Add Cursor Above/Below" or the shortcut on any platform.
* Pressing `gc`, a new shortcut we added which is equivalent to cmd-d on OSX or ctrl-d on Windows. (It adds another cursor at the next word that matches the word the cursor is currently on.)
#### Doing stuff
2016-10-03 23:41:05 +03:00
Now that you have multiple cursors, you should be able to use Vim commands as you see fit. Most of them should work. There is a list of things I know of which don't [here](https://github.com/VSCodeVim/Vim/pull/587). If you find yourself wanting one of these, please [add it to our feedback thread.](https://github.com/VSCodeVim/Vim/issues/824)
Each cursor has its own clipboard.
Pressing Escape in Multi-Cursor Visual Mode will bring you to Multi-Cursor Normal mode. Pressing it again will return you to Normal mode.
2016-10-19 12:00:22 +03:00
## Additional (Custom) Vim Commands
* `gh` - show the hover tooltip.
* `gc` - add an additional cursor at the next place that matches `*`.
## Supported Options
2016-07-14 08:28:25 +03:00
2016-09-28 09:16:48 +03:00
Vim options can be added to your user or workspace settings (open the Command Pallete and search for "User Settings" or "Workspace Settings"). Changes require restarting of VSCode to take effect.
2016-07-04 20:05:53 +03:00
2016-09-10 23:48:58 +03:00
The following is a subset of the supported configurations; the full list is described in [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L175):
2016-08-03 09:47:10 +03:00
* insertModeKeyBindings/otherModesKeyBindings
* Keybinding overrides to use for insert and other (non-insert) modes
* *Example:* Bind `jj` to `<Esc>` while in insert mode
```
2016-07-04 20:06:25 +03:00
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
2016-07-04 20:06:25 +03:00
}
]
```
2016-07-04 20:05:53 +03:00
Similarly for `otherModesKeyBindings`, bind `jj` to `<Esc>` for modes which are not insert mode
2016-07-04 20:05:53 +03:00
```
2016-07-04 20:06:25 +03:00
"vim.otherModesKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
2016-07-04 20:06:25 +03:00
}
]
```
* insertModeKeyBindingsNonRecursive/otherModesKeyBindingsNonRecursive
* Non-recursive keybinding overrides to use for insert and other (non-insert) modes (similar to `:noremap`)
2016-09-28 09:16:48 +03:00
* *Example:* Bind `j` to `gj`. Notice that if you attempted this binding normally, the j in gj would be expanded into gj, on and on forever. Stop this recursive expansion using insertModeKeyBindingsNonRecursive and/or otherModesKeyBindingNonRecursive.
```
"vim.otherModesKeyBindingsNonRecursive": [
{
"before": ["j"],
"after": ["g", "j"]
}]
```
* useCtrlKeys
2016-09-28 09:16:48 +03:00
* Enable Vim ctrl keys overriding common VS Code operations (eg. copy, paste, find, etc). Setting this option to true will enable:
* `ctrl+c`, `ctrl+[` => `<Esc>`
* `ctrl+f` => Page Forward
* `ctrl+v` => Visual Block Mode
* etc.
* Type: Boolean (Default: `false`)
2016-09-28 09:16:48 +03:00
* *Example:*
```
"vim.useCtrlKeys": true
```
* useSystemClipboard
* Enable yanking to the system clipboard by default
* Type: Boolean (Default: `false`)
* Note: Linux users must have xclip installed
* useSolidBlockCursor
* Use a non-blinking block cursor
* Type: Boolean (Default: `false`)
* ignorecase
* Ignore case in search patterns
* Type: Boolean (Default: `true`)
* smartcase
* Override the 'ignorecase' option if the search pattern contains upper case characters
* Type: Boolean (Default: `true`)
* hlsearch
* When there is a previous search pattern, highlight all its matches
* Type: Boolean (Default: `false`)
* autoindent
* Copy indent from current line when starting a new line
* Type: Boolean (Default: `true`)
2016-07-04 20:05:53 +03:00
## F.A.Q.
2016-07-19 12:32:01 +03:00
#### `j`, `k` and others don't repeat when I hold them down.
2016-08-13 10:57:26 +03:00
On OS X, open Terminal and run the following command:
2016-08-13 10:57:26 +03:00
```
2016-09-28 09:16:48 +03:00
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false // For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false // For VS Code Insider
```
2016-08-11 19:24:56 +03:00
2016-01-03 11:31:33 +03:00
## Contributing
2016-09-28 09:16:48 +03:00
This project is maintained by a group of awesome [contributors](https://github.com/VSCodeVim/Vim/graphs/contributors) and contributions are extremely welcome :heart:. If you are having trouble thinking of how you can help, check out our [roadmap](ROADMAP.md). For a quick tutorial on how to get started, see our [contributing guide](/.github/CONTRIBUTING.md).
2016-10-08 03:54:57 +03:00
Thanks to [Kevin Coleman](http://kevincoleman.io), who created our awesome logo!
2016-10-08 03:51:57 +03:00
2016-08-09 21:26:06 +03:00
## Changelog
Please see our [list of recent releases and features added.](https://github.com/VSCodeVim/Vim/releases)