74th / vscode-vim

vim emulator for Visual Studio Code
MIT License
215 stars 25 forks source link

Fixed dj, dk, dw, db. Fixed word motion ignoring new line characters. #16

Closed benjaminRomano closed 8 years ago

benjaminRomano commented 8 years ago

dj, dk, dw, and db now work as expected.

Fixed word motion ignoring new line characters.

Example:

//   | is the cursor
var a = |5;
var b = 5;

Pressing w before resulted in

//   | is the cursor
var a = 5;
var |b = 5;

Now it correctly moves forward one word.

//   | is the cursor
var a = 5;
|var b = 5;
74th commented 8 years ago

What is wrong in dj and dk?

74th commented 8 years ago

Your approach feels exaggeratedly. I wrote this plugin in 3 days at last week, so its structure has some problems. I want to think a little more slowly.

benjaminRomano commented 8 years ago

Fair enough. It's probably for the best to rethink the structure. I'd recommend looking at https://github.com/atom/vim-mode.

Also for dj, dk. The expected behavior is to delete the line the cursor started at, and the line the cursor ends at. However, before it was deleting from the start position of the cursor to the end position.

74th commented 8 years ago

dj and dk already are able to delete lines. DeleteAction has is-treat-line option, dj and dk use it.

DennyScott commented 8 years ago

I converted a large chunk of atoms code into this project, but it would still need a couple days of testing to move in, and I'm worried that it would be too large of a move.

I have finished most of the selection mode, and will put a PR for you guys to look over in the next couple days :).

benjaminRomano commented 8 years ago

@DennyScott It's probably for the best. Atom's vim-mode has been around for a long time and they probably have a good implementation of vim features, but it's up to @74th on what's the best way to handle everything.

If you commit your changes to your branch, I could help test it for you.

74th commented 8 years ago

​I know atom/vim-mode is a great product and it is a good idea for increasing vim simulation. But I think the goal of this plugin is not to contain atom/vim-mode. Because I does not want to tail atom/vim-mode updates, and to make an integration atom and vscode. The reason I started is VSCodeVim/Vim supporting any vim functions seems not good. So I'll make the smallest number of functions to use VSCode without stress.

DennyScott commented 8 years ago

Would you be opposed to us forking your project and continuing on our own? It seems your desire is to add the keybindings you need/use, but not support the others. I don't think thats a fair assessment.

DennyScott commented 8 years ago

@benjaminRomano We could always move over support to the https://github.com/VSCodeVim/Vim project, they're a step behind this project in terms of keys, but their goal is to emulate the atom-vim mode.

benjaminRomano commented 8 years ago

@DennyScott I'll check it out.

74th commented 8 years ago

I desire this features are

So I think this plugin does not have to support keybinding with ctrl key. They are used by vscode functions and other extensions. (When I begun to code this, the largest problem is writing texts by an extantion does not corporate with Intellisence. Now, in insert mode it call to show suggesutions, and when it shows suggestions does not hundle keybinds. This problem has not been solved yet.)

My next update is if users add a pare of a vim-style-keybind and a vscode command to setting.json, it calls the command by the keybinding. If you are not sure of this poricy or want to more improve vim simulation, please folk and release.