GithubHelp home page GithubHelp logo

vim's People

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  avatar  avatar

vim's Issues

The search should continue on the line after cursor

Currently search function doesn't behave in the vim mode like it does in the vim itself.

  1. Search for any text on the current buffer, which occurs on multiple lines.
  2. Move cursor after the current selection so that it will also skip search result.
  3. Press n

The search will move cursor back to the skipped result.

The vim behavior: there is no currently highlighted found text in vim. If you move the cursor down, the search will continue to show results after current cursor position.

Visual mode keys lose current selection

In #40 and other cases, we want to map visual mode keys to commands that operate on what's selected. Unfortunately, on OSX 10.9, LT 0.6.7 and Vim 0.1.0, CodeMirror appears to be losing its selection. To recreate this:

  1. Map a visual mode key to a command e.g. in user.behaviors:

    (:lt.plugins.vim/map-keys-visual {"=" ":ltexec smart-indent-selection"})
    
  2. Put a debugging statement in that command to demonstrate what's selected: (prn "HERE" (editor/selection cur))

  3. Select something and press '='. You should see "HERE" "" printed to the console indicating selection is last. If you select and then run the command Editor: Smart indent line(s), you'll see a selection printed.

Further investigation required to determine if this is a bug with CodeMirror or LT

Add support for "ZZ" command.

ZZ is an alias for ":x" (short for ":xit" or ":exit"), which itself is like ":wq" except it only writes if the file has been modified.

I can't be the only one who prefers using ZZ over :wq. If it's not too hard to contribute, I may add a PR for this.

activating the plugin - improved docs

My user.behaviors:
:editor [:lt.objs.editor/no-wrap
(:lt.objs.style/set-theme "default")
(:lt.plugins.vim/activate-vim)]

I cloned this repo into my LIghtTable plugins dir:
$ cd LightTable/blah/blah/.../plugins
$ git clone https://github.com/LightTable/Vim.git

When I save my user.behaviors I see LightTable reload them.
However, I can't get into vim command mode.

The solution seems to be 'restart LightTable'.

So, I suggest this project's README.md file should add:

  • clone this repo into the LIghtTable plugins dir
  • restart LightTable

Star search doesn't update editor search state

How to reproduce.

  1. Search something with / command. All matching words will be highlighted
  2. Move cursor on any word and press * or # in normal mode. This word will be highlighted by previously highlighted words won't lose their state.
  3. Press n/N. The search will continue to jump on the results found on the step 1

The correct behavior would be to update search to the word selected in the step 2 and to drop the search from the first step.

Failure to exit insert mode

Since updating the vim plugin recently I sometimes get in a state where I can not exit insert mode.

I haven't nailed down exactly what steps are needed to reproduce this, I will update this issue if I am able to.

The following errors appear in the console when trying to exit by hitting escape:

Uncaught TypeError: Cannot call method 'find' of undefined
vim.js [2870]   updateLastSelection
vim.js [2906]   exitVisualMode
vim.js [2169]   actions.enterInsertMode
vim.js [1919]   operators.change
vim.js [1490]   commandDispatcher.evalInput
vim.js [1084]   commandDispatcher.processOperator
vim.js [1041]   commandDispatcher.processCommand
vim.js [738]    vimApi.handleKey
vim.js [4603]   anonymous
codemirror.js [3004]    doHandleBinding
codemirror.js [3061]    anonymous
codemirror.js [4723]    lookup
codemirror.js [4738]    CodeMirror.lookupKey
codemirror.js [3060]    handleCharBinding
codemirror.js [3119]    onKeyPress
codemirror.js [2008]    anonymous
Uncaught TypeError: Cannot read property 'height' of undefined
vim.js [4648]   exitInsertMode
codemirror.js [3004]    doHandleBinding
codemirror.js [3047]    anonymous
codemirror.js [4723]    lookup
codemirror.js [4738]    CodeMirror.lookupKey
codemirror.js [3047]    handleKeyBinding
codemirror.js [3079]    onKeyDown
codemirror.js [2008]    anonymous

Port existing CodeMirror features

There are a number of CodeMirror features that this plugin does not have. This issue serves as a meta-issue until these are knocked out. Some of these may be broken out into separate cards. If you care about one of these, make a pull request for it :) Will keep this list up to date:

  • Search/replace with confirm (openDialog)
  • Replace over a range (openDialog)
  • Motions combined with search e.g. d/be (openDialog) - from #10
    • We'll need to let c/ and d/ passthrough which doesn't seem possible yet
  • Search history - needs to be reimplemented to use LT's dialog
  • Expose available ex-commands e.g. :sort and :global
    • Iterate over commands and pipe to handleEx

Issues marked with openDialog require an interactive dialog. The current dialog does not handle that yet.

Pasting after 'dd' sometimes pastes vertically

This is probably one of the weirdest bugs.
Sometimes, after working for a while, something triggers this bug. Basically when I delete a whole line using 'dd' and then paste it with p, the line is actually pasted vertically, not horizontally! As weird as it sound here is an example:
2014-12-12-004918_473x349_scrot

This seems to be file-specific, if I try to 'dd' in another file, it works fine (until the bug is hit in that file too).

Cannot delete first line with `dd`

I'm getting the following error, when I have a single-line document, and I try to delete to the start of the line with dd:

Error: There is no line -1 in the document.
    at getLine (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:6721:39)
    at cursorCoords (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:1789:26)
    at drawSelectionCursor (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:1299:15)
    at drawSelection (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:1266:9)
    at endOperation_R2 (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:2053:30)
    at endOperations (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:2014:7)
    at endOperation (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:2001:7)
    at eval (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:2147:17)
    at CodeMirror.setOption (/opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/codemirror/codemirror.js:4020:48)
    at lt.objs.editor.set_mode (file:///opt/homebrew-cask/Caskroom/lighttable/0.7.2/LightTable/LightTable.app/Contents/Resources/app.nw/core/node_modules/lighttable/bootstrap.js:23804:43)

Obviously I could just cc, but. :P

CTRL-[ should be the same as ESC also in selection mode

When selecting something I get an error if I want to use CTRL+[ instead of ESC. It works in normal mode but when something is selected.

Also completely unrelated: Would it make sense to use Emacs Evil plugin and port it from emacs lisp to cljs instead of using Codemirrors vim? It supports tons of features and might be easy to port for it being a lisp. Just a thought. Feel free to ignore.

map jk to Esc - insert mode mapping

Hi, sorry for the noob question but it's possible map the keys jk for change from insert to normal mode??..thanks!...by the way, seems than the configuration file changes in the latest lightable release......

Keybinding to complexe macro

I want do this keymap :

[:editor :lt.plugins.vim/map-keys {",;" "$A;<ESC>"}]

The $a of keymap work fine : cursor go to the end of line and pass to edition mode. The end of keymap (; character don't work).

ex-mode :qa and :wqa commands

ex-mode :qa command should be supported to quit LightTable entirely and :wqa command that saves all not saved files and quits LightTable

"/" key binding for searching a file throws an error

When I hit the "/" key to search with the vim plugin active, I get the following error in a dialog box:

Not an editor command ":ltexec vim.find"

When I search for this I find a keybinding in the vim plugin's source. Suspecting there was an api change, I added the following to my keybindings:

:editor { ...
        "/" [:vim.find]}

and after saving this it seems to work. However, I can't get rid of the error messages about :ltexec find.next and :ltexec find.prev by adding similar key bindings for n and shift-n.

Copy/paste pastes the clipboard together with commands given

Hi, I noticed a funny bug in the vim plugin, which I experience only on one of the two (Linux) machines where I use lighttable.
Basically, if I copy something, say a line using yy, then I move somewhere, or use other commands, when I paste I get the content of the clipboard and, below, all the letter commands I have given.
So, say that I copied Hallo, then moved around using say jjjlll when I paste I will get:

Hallo
jjjlll

Anyone has seen this before?

Cursor not visible when on search result

Steps to reproduce

  • Search for something (either with *, or / or Ctrl/Cmd-F).
  • Put cursor just before search result - cursor is visible:

light table 2014-11-28 18-00-36 2014-11-28 18-01-31

  • Go right one symbol - cursor becomes invisible:

light table 2014-11-28 18-00-09 2014-11-28 18-00-19

This is very confusing - it's like getting lost every now and then.

Versions

OS X: 10.7.5
Light Table version: 0.7.2
Binary version: 0.8.4
Vim plugin: 0.1.0

user.behaviours

[
 [:app :lt.objs.style/set-skin "dark"]

 [:editor :lt.objs.editor/wrap]
 [:editor :lt.objs.style/set-theme "default"]
 [:editor :lt.plugins.vim/activate-vim]
 [:editor :lt.objs.style/font-settings "Ubuntu Mono" 10]

 [:editor.clojure :lt.objs.langs.clj/print-length 1000]
]

Unable to delete/change by "searching"

In Vim I can easily delete text (or change with c) by pressing d/ and typing some letters. For example (cursor at [0,0]):

ba a a a
a a a be

Typing d/be will delete everything up to "be". It's currently not possible to do with LT. Note that it's actually supported by CodeMirror.

`:vim.send-key` command not working for some keys?

I'm trying to answer the following Stack Overflow question:

key bindings - Bind multiple actions to one key in lighttable - Stack Overflow

It seems like I should be able to add the following to my user.keymap file to implement this:

[:editor "esc" :auto-complete.remove (:vim.send-key "<Esc>")]

But it doesn't work.

Trying to isolate what's going on, I added the following to my user.keymap file instead:

[:editor "capslock" (:vim.send-key "<Esc>")]

But it doesn't work. Nor does ... (:vim.send-key "Esc").

But other argument values, like "$" or "0" do work. What's up with Escape?

Visual mode selection doesn't include character under cursor

Expected behavior: evaluating an arbitrary unit of code selected with the visual mode requires selecting exactly the code users want to evaluate.

Actual behavior: evaluating an arbitrary unit of code selected with the visual mode requires users to select one character further, unless an exception is throw. The exception thrown is related to malformed selections being evaluated.

Demonstration:
lighttable_eval_selection

Light Table 0.6.2/Vim plugin 0.0.2

Is it possible to use "noremap" like behaviour?

Hi. Lovely plugin :) I'm trying to adjust it to my keymap. But have few issues. Main is that instead of hjkl keys I use dhtn for movements (dvorak and stuff). So when I do bindings like

  "d" "h"
  "j" "d"

j is still working but d is not. Is it possible to configure binding in non recursive way (like nnoremap in vim for example)?

Vim plugin breaks keymap sequences that include key presses without modifier keys

The problem

When you have the Vim plugin installed, keymap sequences that include a key press without a modifier key (e.g. ctrl-w w) don't work.

How to reproduce

  1. Add the {:app {"ctrl-w w" [:workspace.show]}} to user.keymap.
  2. Enable Vim mode.
  3. Type Control-w followed by w.

Expected behavior

The workspace tree shows or hides itself.

Actual behavior

Nothing happens. If you disable Vim mode and then open a new editor window, the workspace tree shows or hides as expected.

Please let me know if you need any more info.

Going to next line using j unfolds folded code

To reproduce:

  1. set the cursor to the start of a function
  2. fold it(default binding is Ctrl+=)
  3. press j to move to the next line
  4. code unfolds

Without Vim plugin we are able to move past the folded code without it being unfolded.

No editor command ":ltexec vim.ex"

With Light Table 0.6.0, binary version 0.8.4, when I press : I get the following popup:

image

Can't use the keyboard at all until I switch tabs.

Add extending selection with find/search in visual mode

In codemirror's vim demo ( https://codemirror.net/demo/vim.html ) the '/' activates the find dialog while in visual mode. Entering a useful search term and then pressing enter, extends the current selection to the beginning of the search term.

In Light Table, the '/' key has no effect in visual mode. Using the LT command menu to choose "Find: In current editor" does open the find dialog but, upon completion, the cursor is moved without extending the selection. The editor is still in visual mode.

Shortcuts doesn't work

After 0.6 and the plugins the shortcuts like "/" and "=" doesn't work but gives an error like: "Not an editor command ":ltexec vim.find""

Binding them in user keymap seems to overwrite the behaviour that the vimplugin brings so maybe the ltexec part needs to be removed?

Motion mappings do not work

The normal mode mappings ( and ) do not work. They should go forward and backward one line.

The normal mode mapping { and } should go forward and back a paragraph, but they go to the beginning and end of a file.

The section mappings [[ and ]] do not work.

For details see :he object-motion in vim.

The 'c' keybind sometimes doesn't drop into insert mode

I tend to use the 'c' character a lot to delete + insert text in a single keystroke. Sometimes after I have been working for a while, I realize that hitting 'c'+something (like 'cw' or 'ct(' ) it will delete the contents but not drop me into insert mode.
I fear this might be related to bug #38 but I am not sure.

Visual mode selection setting is different from default vim setting

By default vim mode in lighttable doesn't include the character under the cursor, which is different from vim default.

The highlighted text normally includes the character under the cursor.
However, when the 'selection' option is set to "exclusive" and the cursor is
after the Visual area, the character under the cursor is not included.

It'd be great to get it fixed or get it as an option.

gt, Gt & context switching

This plugin is getting really close to replacing vim for me. A couple issues though:

1.) I'd really like to be able to use gt and Gt to change tabs. Having to do the comand + shift + bracket chord currently.

2.) When I hit : or / I can no longer use <C-[> to close out of that particular context. Example: I press : in normal mode, and the command window pops up. I decide I don't want to enter a command. Now I have to use ^-space to close that context. I realize this is nitpicky, but it's not the way vim behaves.

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.