Giter Club home page Giter Club logo

vscode-vim's Introduction

There are no plans to update this project.

I recommend using Neo Vim Extension.

Vim emulator for VSCode

vimanimetion

Build Status Version Installs Rating

Require

  • v0.3 : Visual Studio Code 1.0.0

Features

vimanimetion

  • support repeat command

vimanimetion

Installation

ext install vimStyle

Supported vim commands

  • h j k l 0 $ ^ w W b B e E { } [{ ]} tx fx Tx Fx ; , gg G

  • Nh Nj Nk Nl Nw NW Nb NB Ne NE N{ N} N[{ N]} Ntx Nfx NTx NFx N; N, NG

  • i a s o x r I A S O X gr J

  • Nx Nr Ngr

  • d y c dd yy cc D C p P d$ y$ c$ ...

  • Ndd Nyy Ncc

  • ci[ ca[ ci" ca"

  • Nci[ Nca[

  • v V v..d v..c v..y v..r v..j

  • .

  • quickref function list is here.

  • If you need Ctrl-D and Ctrl-U for scrolling, you can use additional scroll key entention.

Support to call VSCode commands from vim keybind

  • u : / n N > < %

But they do not behave exactly as vim command, and their supports may be changed.

Settings

If you needs optional settings, please copy belong json and paste to your settings.json.

// Show mode in status bar (default: true)
"vimStyle.showMode": false,
// changing cursor by mode (default: true)
"vimStyle.changeCursorStyle": false,
// motion with jkl;(default: false)
"vimStyle.useErgonomicKeyForMotion": true,
// default mode (default: "normal")
"vimStyle.defaultMode": "insert",
// disable without to uninstall (default: "true")
"vimStyle.enabled": "false",
// keys go to normal mode from insert mode (default: "" disable)
"vimStyle.imapEsc": "jj",
// some vimrc like settings
"vimStyle.vimrc": [
	"nmap Y y$", //
	"nnoremapmap Y y$", //
]

If you would like to use ctrl+[ instead of escape, please add blong setting to your keybindings.json.

{
	"key": "ctrl+[",
	"command": "vim.Esc",
	"when": "editorTextFocus"
}

If you would like more vim flavor, you can use vim.inNormalMode, vim.inInsertMode and vim.inVisualMode to your keyboard shortcuts. For example,

// in insert mode
{
	// Ctrl-h : BackSpace
	"key": "ctrl+h", "command": "deleteLeft",
	"when": "editorTextFocus && vim.inInsertMode"
},
{
	// Ctrl-w : delete word
	"key": "ctrl+w", "command": "deleteWordLeft",
	"when": "editorTextFocus && vim.inInsertMode"
},
// in visual mode
{
	// arrow up
	"key": "up", "command": "vim.type-<Up>",
	"when": "editorTextFocus && vim.inVisualMode"
},
{
	// arrow down
	"key": "down", "command": "vim.type-<Down>",
	"when": "editorTextFocus && vim.inVisualMode"
},
{
	// arrow right
	"key": "right", "command": "vim.type-<Right>",
	"when": "editorTextFocus && vim.inVisualMode"
},
{
	// arrow left
	"key": "left", "command": "vim.type-<Left>",
	"when": "editorTextFocus && vim.inVisualMode"
},

Support vimrc settings

  • nmap Y y$
  • nnoremap Y y$

Will never be supported

  • Ctrl-x Cmd-x Alt-x Meta-x

VimStyle Loadmap

the vim emulator written type script

  • basic vim keybinds
  • fix word motion bugs
  • user keybindings ( nmap )
  • user keybindings ( call vscode function )
  • text object ( diw, di{ ... )
  • resister
  • vim style plugin for chrome browser
  • complete quickref list

License

MIT License

Contributing

function list

git clone https://github.com/74th/vscode-vim.git ~/.vscode/extensions/vscode-vim
cd ~/.vscode/extensions/vscode-vim
npm install
npm run-script build

Updates

0.5.7

  • fix insert mode

0.5.5

0.5.4

  • fix multi select problem #64 #69

0.5.3

  • #57 support arrow keys in visual mode(need add keybindings)

0.5.2

  • fix #65

0.5.1

  • support J v..J V..J

0.5.0

  • support ci[ ci{ ci( ci< ca[ ca{ ca( ca<
  • support ci' ci" ci ca' ca" ca
  • treat _ as alphabet

0.4.7

  • fix visual mode moves

0.4.6

  • revert 0.4.2

0.4.5

  • some bugfix

0.4.2

  • support [(,[{,]),]}

0.4.1

  • support {,}

0.4.0

  • support nmap nnoremap (use like vimrc setting)

0.3.13

  • support vim mode contexts for keyboard shortcuts #45
  • fix word motion bugs #38

0.3.12

  • support imap ESC keybinding
  • support enable setting

0.3.11

0.3.10

0.3.9

0.3.6

  • support r gr v..r
  • fix visual mode move bug

0.3.5

  • support VSCode commands from vim keybindings %
  • fix some bug

0.3.4

  • support VSCode commands from vim keybindings : / n N > <

0.3.3

  • support ^
  • change icon

icon

0.3.2

  • update for vscode 1.0.0
  • support repeat command
  • support visual line mode
  • support tab size

0.2.4

  • support W B e E

0.2.3

  • support useErgonomicKeyForMotion option : move a cursur by jkl;
  • support visual mode

0.2.2

  • fix #21 CR+LF bug

0.2.1

  • update README

0.2.0

  • more friendly with VSCode functions
  • show block sursor
  • bug fix : dfx dFx dtx dTx
  • append indents by o O

0.1.8

  • JISキーボード向けオプション(support Win and Mac Jis keyboard option)
  • show suggestion by only alpabet and .
  • fix some bugs

0.1.7

  • gg G

0.1.1

pre release!

vscode-vim's People

Contributors

74th avatar benjaminromano avatar dennyscott avatar drewcassidy avatar guilhermelimak avatar mstenemo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-vim's Issues

cw deletes new line character

Given this code:

{
    "vimStyle.showMode": true
}

Using cw on true will change the text to this:

{
    "vimStyle.showMode": }

number accelerators don't round down

There is one small issue I have found so far:

When I am on line 6, and the file totals only 15 lines, if I do:20j then it should still round 20 down to 15 and subsequently go to line 15. Currently, you must give it an exact number, 9j in this case, to reach down to line 15.

word motion skips first word

push w

before:
fmt.Print("hello world")
   ^
except:
fmt.Print("hello world")
    ^
actual:
fmt.Print("hello world")
         ^

add vim mode for keybindings

Enable using vim modes for keybidings.
ex:

{
    // Ctrl-H : BackSpace
    "key": "ctrl+h",
    "command": "deleteLeft",
    "when": "editorTextFocus && vim.inInsertMode"
},

And only enabled ESC keybindings to the option to enable vim extension.

{
    "command": "vim.Esc",
    "key": "escape",
    "when": "editorTextFocus && vim.enabled"
}

Motion commands in visual mode

There are a few motion commands that do not seem to work in visual mode:

  • arrow keys
  • most word motions (e E w W b B …) only w and B seem to work
  • others?

The arrow keys make the visual selection disappear, but the status bar still says VISUAL and pressing any Vim motion key restores it.

Code Cleanup

Hey is it cool if I clean up some of your code?
It seems like you have interfaces all over the place which could be moved to a typings file (.d.ts)

Search does not iterate through findings

After updating to the latest VS Code version with the latest release of vscode-vim, search acts like it can't find my text. It highlights them as I type, but will not iterate through what it finds.

capture

{ and }

Thank you for this plugin.

Only thing missing which I had come to rely on is { and }, so I'll just leave this issue here :)

One thing that could be improved over Vim is ignoring whitespace, where a line with only whitespace could be considered empty.

ce, de

before:
|word word
after:
|d word
expect:
| word

I can't input +

Thank you for your writing nice extension!

I can't input + in insert mode.

If I input +, it turns out to * on each two times input just like
+++++++++++++++

vsCode: Version 0.10.2 (0.10.2) 7cc0c602a2b802b09a3f56b68a1a61ee9e8f0066
OS: Mac OSX Yosemite
Keyboard: US

`u` will undo multiple editting if not pressing `Enter`

  • VSCode Version: 1.1.0
  • OS Version: Windows 10 (Insider Preview Build 14342)

It seems that pressing u will undo multiple editting, if each one is splitted by Esc rather than Enter.

For example, if I i something at one line, then Esc and go to another line, then i something, then pressing u, both the two editting will be undo, rather than the last one.

This behavior is different from GVim 7.4.977 on my computer and often destorys my work if I edit lots of lines without adding a new one.

This problem seems to be talked in #25 and I've checked microsoft/vscode#4313. However, when I use Python: Sort Imports extension to test the issue, the Ctrl-Z works just as expected.

Since amVim has the same problem, I don't know whether the problem with Microsoft has been fixed.

Thanks!

Allow jj for Esc

This question is related to support for motion with jkl;,

I'd like to map jj (double j) for Esc and I'm trying this keybindings.json setting, but without any success:

{
    "key": "jj",
    "command": "vim.Esc",
    "when": "editorTextFocus"
}

Is jj be feasible?

Display current mode in Status Bar

I've added the ability to display the current mode in the status bar in PR #11

INSERT Mode:
image
NORMAL Mode:
image
NORMAL Mode after 'd' has been pressed once:
image

Extension stops working completely

After only a few minutes of usage on Mac OS X the extension completely stopped working. no letter keys will work, though arrows still move the cursor. I would provide logs but I dont know where to find them

Text object operations not working

Example:
"This is text"
with cursor at 'T', execute di"

Expected result:
""

Actual result:
"This is text"

Running VS Code 1.2 on Win7.
vimStyle 0.3.9

Only thing unique about my settings.json is configuring a proxy.

Weird gray overlay extending along the cursor as you type

Hi - not sure if it's a feature or mistake, but I'm seeing this weird overlay after typing Esc for view mode then i for insert mode, then as I type along the gray overlay extend with my cursor, which makes the code looks really ugly...

screen shot 2016-01-16 at 3 33 18 pm

Does not work with some user prefs

Thanks for the plugin.

It looks like the following user prefs are not working when the vimStyle plugin is enabled

"editor.formatOnType" : true,
"editor.autoClosingBrackets": true

Screen Line/Characters movement support

We added screen line/character movement command in Visual Studio Code in July. The commands is like

cursroMove({to: 'lineStart', inSelectionMode: true});

More details are listed in microsoft/vscode#2771 . Leveraging thse commands, following Vim commands can be implemented real quick

  • g0
  • g^
  • g$
  • gm
  • gj
  • gk

vimrc support not documented

There is no mention of support for .vimrc, _vimrc or a variation in the docs/README.

Scanning through the source code shows nothing related to use of the config files.
Is it considered, planned?

Add support for motion with jkl;

(This is somewhat related to #19 issue.)

Many of Vim users prefer the ergonomic jkl; over the historic hjkl.

As there is no plan to support .vimrc of any kind, please add support for configuration setting to enable switching between those two mappings.

why highlight all the same letter

When I move the cursor on the letter e in the normal mode,
all the rest of e are highlighted.

0

Is it a feature or a bug? If former, can I turn it off in the settings?

Navigating with 'j' and 'k' doesn't scroll.

Just wanted to say, Thanks for doing this project.

However, one thing which is causing problems for me right now, is that using 'j' and 'k', for navigating up and down a text file doesn't scroll the displayed text, so when I navigate off screen, it still displays where I was already.

Obviously, it would be great if the displayed text would move as well when we press 'j' or 'k'.

Cursor blinks back and forth when holding down movement keys

When holding the movement keys like hjkl(;)w, the cursor will blink between a former position and a newer position, which looks really strange and significantly disturbs editing. What's the problem? What additional information should I provide?
Thanks!

No handler found for the command: 'vim.j'

After installing this plugin and restarting visual studio code I get a warning like
"No handler found for the command: 'vim.j'"
pop up for every key I press inside the editor. Attached is my version information and what I see in the editor with the plugin installed

screenshot from 2015-11-26 12 26 33
screenshot from 2015-11-26 12 28 04

Not sure if I'm just missing something or if this is a bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.