Giter Club home page Giter Club logo

vim-multiple-cursors's People

Contributors

antoinemadec avatar balta2ar avatar bitdeli-chef avatar brandoncc avatar djjcast avatar eapache avatar faceleg avatar fearphage avatar filbranden avatar flebel avatar ggreer avatar inkarkat avatar itchyny avatar jaytaylor avatar kiswa avatar kristijanhusak avatar madand avatar madnight avatar marcospb19 avatar mattn avatar roryokane avatar schoettl avatar terryma avatar thalesmello avatar tmandry avatar tony avatar uri avatar vitorgalvao avatar xanderman avatar xymostech 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  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

vim-multiple-cursors's Issues

Plugin interferes in selecting options from search or ex mode history

command line - vim_021

In this image, i had chosen cd ~/vysakh0.github.io/ and pressed enter, it din do anything, when I started to move ( j ) I noticed it is selecting the text!

From :map i see multiple cursor is causing the issue, could some one sort this out please?

x  <CR>        * :<C-U>call multiple_cursors#new("v")<CR>
n  <CR>        * :call multiple_cursors#new("n")<CR>

Regex on newline

When marking a section, then typing :MultipleCursorsFind \n to find the newlines, everything breaks. On a file with two lines, selecting all, typing :MultipleCursorsFind \n i gives this response:

Key 'i' cannot be replayed on 122 cursor locations

Also, trying to fetch matches for linestart with ^ results in the same kind of behaviour.

Keystrokes for the example gifs

Example 1

  • jump to p with fp
  • select the word under cursor with <C-n>
  • do that two more times for the other two occurrences in the function
  • press c to change
  • type the replacement
  • press <Esc> to quit back to regular Vim

Example 2

  • select the line with V
  • go to the end of the file with G
  • press <C-n> to add a cursor at the beginning of every line and move to normal mode
  • press I to insert at the beginning of the line
  • type ", move to end of line with <C-e>, type another " followed by ,
  • move every cursor down one line with <C-j>(this is a custom mapping of mine in Insert mode)
  • hit <BS>, now all the words are on the same line
  • the rest is just normal Vim

Example 3

  • press dt" to delete everything until the first quote
  • press L to go to end of line (my custom mapping, default $)
  • pree r, to replace the ] with ,
  • go back to the beginning of the line with H (custom, default ^), press f, to find the first comma
  • press v to select , in visual mode, and mash on <C-n> until the last occurrence
  • press c followed by <CR> to break the line into multiple lines
  • move every cursor up one line with <C-k> (again my custom mapping)
  • delete the left quote with C-g<BS> (custom mapping to move cursor in insert mode)
  • go to end of line and delete right quote with C-e<BS>

Example 4

  • press jV to visually select the second line
  • press Gk to select all but the last line
  • type : followed by the MultipleCursorsFind command
  • press o to toggle the cursor for each visual selection
  • press p to paste the content of the + register (I have clipboard=unnamedplus in my vimrc) to each virtual cursor

"Find All" at once

( I hope I get it correctly after I read the README and tried this plugin. )

Does it provide a method to simply mark all? Suppose I have 100 occurrences of a word I need to replace. Do I have to hit <C-n> for 100 times? Thanks.

Preserve cursor location after using multi_cursor_exit_key

When we have an example file content of:

example file with
approx four lines. example lines
should also containt
lots of example words.

I select the example word on line number 1 like and the others too:

example 1

Then when I press multi_cursor_exit_key my cursor location jumps to line number 4:

example 2

But it should remain on line number 1. This get's annoying when our file is very large and we have decide to not use multi cursors.

Multiple cursor breaks if you use zz

  1. Set those to options to 0
    let g:multi_cursor_exit_from_visual_mode=0
    let g:multi_cursor_exit_from_insert_mode=0
  2. Start cursor mode and leave isert mode
  3. Press zz

The multiple cursor mode will break

column mode

First, this is an awesome plugin!

Just wondering if it's possible to go into column mode by using up/down keys?

Would be nice to press

Ctrl+n Down Down Down Down

to quickly create cursors on four lines at the current column. I know about vim's column mode but this plugin is more wysiwig.

What happened to #12? (Keystrokes)

The README links to issue #12 for all the keystrokes used in the screencasts. That seems to 404 and I can't find it in the Issue history. I know I've read that issue before. Weird. Maybe GitHub is playing up, or has it been deleted (somehow)?

Pressing Ctrl-C with multiple cursors selected leaves editor in weird state

Firstly, massive kudos for bringing this project to Vim. I'm hoping to help and contribute when I get time, but until then I'll file some issues just so they are recorded and somebody else may be able to fix them.

If you select multiple cursors, then press Ctrl-C, you'd expect the cursors to go away, much like pressing ESC. This is what happens when you are in visual mode and you press Ctrl-C. Instead, with multiple cursors what happens is all the cursors remain marked, even though they're not really active anymore. Pressing ESC at this point does nothing, and the only way to clear them is to do: Ctrl-n, ESC.

should match by words, not text

if you have

function hello()
endfunction

and you select function, and then <C-n>, it will select endfunction. endfunction should not be selected at all.

Two cursor misalignment problems

I begin selecting words with a ctrl-n on the first "hello", and then hit ctrl-n a few more times to select the rest. Note how the cursor on the first "hello" is one column too far to the right and misaligned from the others:

top_cursor_misaligned

You can correct this problem if you remember to correct the first element before selecting the rest. That is, ctrl-n, then j to correct it, then the remaining ctrl-n:

even_selection

Now that everything is even i can type v for normal mode, move to the beginning of the word, and insert the word "jonah" by doing ijonah:
insert words

Of course I have g:multi_cursor_exit_from_insert_mode=0 so that I can escape and keep using all my cursors. But uh-oh, as soon as I hit escape, the bottom cursor gets misaligned from the others, going one space to the left:

bottom_misaligned_after_esc

Multiple Errors When Using the Plugin

To reproduce:

I type some text, do <C-n>, do any kind of text movement, and I get this error, every single time:

Screenshot

I did a git clone in my /home/david/.vim/bundle direction for installation with Pathogen. I am using vim 7.3

Does not work with non-standard key mapping

I have "i" mapped to "move right" (I think the standard for that is "l"). Nonetheless the plugin assumes that I have a default one and whenever I hit Edit (which is "s" in my case) after "C-n"ing couple positions, it inserts something like that:

:call <SNR>164_apply_user_input_next('i')

Is there any way to set it up correctly?

Key 'i' cannot be replayed at 11 cursor locations

When I've selected multiple areas with <C-n>, if I attempt to enter insert mode by pressing i, I get the following error message:

Key 'i' cannot be replayed at 11 cursor locations

Pressing i again allows me to enter insert mode and works as expected.

Error messages when using j,k,l,h after selection multiple words

I press Control-n several times to select a word, the I press any of the movement keys and I see this:

Error while processing function 59_apply_user_input_next..385
E488: Trailing characters
E488: Trailing characters

but the movement works. This is what I have in my .vim directory:
/Users/julian/.vim
├── after
│   └── syntax
│   ├── haml.vim
│   └── html.vim
├── autoload
│   ├── pathogen.vim
│   ├── rails.vim
│   └── zencoding.vim
├── bundle
│   ├── ctrlp.vim
│   │   ├── autoload
│   │   │   ├── ctrlp
│   │   │   │   ├── bookmarkdir.vim
│   │   │   │   ├── buffertag.vim
│   │   │   │   ├── changes.vim
│   │   │   │   ├── dir.vim
│   │   │   │   ├── line.vim
│   │   │   │   ├── mixed.vim
│   │   │   │   ├── mrufiles.vim
│   │   │   │   ├── quickfix.vim
│   │   │   │   ├── rtscript.vim
│   │   │   │   ├── tag.vim
│   │   │   │   ├── undo.vim
│   │   │   │   └── utils.vim
│   │   │   └── ctrlp.vim
│   │   ├── plugin
│   │   │   └── ctrlp.vim
│   │   └── readme.md
│   ├── desert.vim
│   │   ├── README
│   │   └── desert.vim
│   ├── nerdtree
│   │   ├── README.markdown
│   │   ├── autoload
│   │   │   └── nerdtree.vim
│   │   ├── nerdtree_plugin
│   │   │   ├── exec_menuitem.vim
│   │   │   └── fs_menu.vim
│   │   ├── plugin
│   │   │   ├── NERD_tree.vim
│   │   │   └── nerdtree
│   │   │   ├── bookmark.vim
│   │   │   ├── creator.vim
│   │   │   ├── key_map.vim
│   │   │   ├── menu_controller.vim
│   │   │   ├── menu_item.vim
│   │   │   ├── opener.vim
│   │   │   ├── path.vim
│   │   │   ├── tree_dir_node.vim
│   │   │   └── tree_file_node.vim
│   │   └── syntax
│   │   └── nerdtree.vim
│   ├── supertab
│   │   ├── Makefile
│   │   ├── README.rst
│   │   └── plugin
│   │   └── supertab.vim
│   ├── vim-fugitive
│   │   ├── README.markdown
│   │   └── plugin
│   │   └── fugitive.vim
│   ├── vim-multiple-cursors
│   │   ├── CHANGELOG.md
│   │   ├── MIT-LICENSE.txt
│   │   ├── README.md
│   │   ├── assets
│   │   │   ├── example1.gif
│   │   │   ├── example2.gif
│   │   │   └── example3.gif
│   │   ├── autoload
│   │   │   └── multiple_cursors.vim
│   │   ├── doc
│   │   │   ├── multiple_cursors.txt
│   │   │   └── tags
│   │   └── plugin
│   │   └── multiple_cursors.vim
│   ├── vim-sensible
│   │   ├── README.markdown
│   │   └── plugin
│   │   └── sensible.vim
│   └── vim-surround
│   ├── README.markdown
│   └── plugin
│   └── surround.vim
├── compiler
│   └── coffee.vim
├── doc
│   ├── coffee-script.txt
│   ├── rails.txt
│   ├── tags
│   └── zencoding.txt
├── ftdetect
│   ├── coffee.vim
│   └── eco.vim
├── ftplugin
│   └── coffee.vim
├── indent
│   └── coffee.vim
├── plugin
│   ├── rails.vim
│   └── zencoding.vim
└── syntax
├── coffee.vim
└── eco.vim

35 directories, 69 files

And this is my vimrc

if v:progname =~? "evim"
finish
endif

set nocompatible
set backspace=indent,eol,start

if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif

set history=1000 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching

map Q gq
inoremap u
syntax on
set hlsearch
augroup vimrcEx
au!
autocmd FileType text setlocal textwidth=78
autocmd BufReadPost *
\ if line("'"") > 1 && line("'"") <= line("$") |
\ exe "normal! g`"" |
\ endif

augroup END

set autoindent " always set autoindenting on

if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
au BufRead,BufNewFile *.rabl setf ruby
set smartindent
set tabstop=2
set shiftwidth=2
set expandtab
set colorcolumn=120
set number
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
nnoremap c :set cursorline! cursorcolumn!

" Pathogen
call pathogen#infect()
call pathogen#helptags()

set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)

set mousehide
set ignorecase
set nowrap
set cursorline
set softtabstop=2

set background=dark
colorscheme desert

nmap : :%s/:([a-z_0-9]+)\s+=>/\1:/g
set autoread " Auto-reload buffers when file changed on disk
set backupdir=/.vim_backup " where to put backup files.
set directory=
/.vim_temp " where to put swap files.
let mapleader=","

Implement A and I in Visual mode (similar to vim's Visual block mode)

When I select a bunch of lines or words and press shift-i (What normally do in visual block mode) the plugin jumps to insert mode like it should but it also injects: ":call 74_apply_user_input_next('i')" into the code at every cursor.

I am using VIM version 7.3.429 and using the latest vim-multiple-cursors.

Thanks for the great plugin BTW! :)

Plugin breaks when using "paste" option

How to reproduce:

  1. Open an empty file

  2. Type :set paste

  3. Insert the following text:

    foo
    bar
    
  4. Place cursor over "f"

  5. Ctrl-v then G

  6. Ctrl-d

  7. Enter insert mode (bang!)

Output:

foo
<Plug>(a)<Plug>(d)bar

Multiple line selection breaks when pressing unexpected key

Do the following:

Shift-V
jjjj
Ctrl-n
l (L)

The multiple cursors get set on each line as expected, then when you press L, the cursor on the top and bottom lines moves right (as expected), but the others remain "stuck". At this point the cursors aren't working at all and you need to Ctrl-n, ESC to get the editor looking normal again.

In Normal mode, 'o' works, but 'O' does not

Discovered this while testing something else. 'O' should insert a new line above every virtual cursor and goes in insert mode. Does not do that at the moment. 'o' on the other hand works.

Conflict WIth AutoComplPop plugin

When using multiple cursors in insert mode, I'm seeing lots of errors with AutoComplPop plugin.

This plugin provides command to enable/disable itself: :AcpEnable and AcpDisable.

Is there a way to hook a custom command into vim-multiple-cursors that gets triggered on any transition into or out of insert mode? If not, how could I hack around this?

C-n followed by S-v throws an error

How to reproduce:

test data
test
test
In normal mode
Select words "test"s with <C-n><C-n><C-n>
Press <S-v> (line visual mode)

Error message:

Error detected while processing function <SNR>153_apply_user_input_next..208..197..<SNR>153_highlight_region:
line   14:
E71: Invalid character after \%
E475: Invalid argument: \%13l\%>0v.*\%<-2147483648v.
Error detected while processing function <SNR>153_apply_user_input_next..208..197..<SNR>153_highlight_region:
line   14:
E71: Invalid character after \%
E475: Invalid argument: \%11l\%>0v.*\%<-2147483648v.
Error detected while processing function <SNR>153_apply_user_input_next..208..197..<SNR>153_highlight_region:
line   14:
E71: Invalid character after \%

Bad behavior if you don't have the expandtab option set

If you have any tabs () in the same line and before where your cursor is located and you start the multiple cursors, It doesn't seem to count the tab key as a character and it selects the wrong block of text.
If I remove the tabs it works fine.

Shift-i and Shift-a dump Vimscript code into buffer

Make multiple selections (<C-n>) however you want, then press A or I. Vimscript seems to get dumped right into the buffer where the cursors are :)

It's hard to see with my colorscheme, but the variable Type is selected in two places here.

Schermata 2013-04-25 alle 17 30 27

When pressing I this happens:

Schermata 2013-04-25 alle 17 31 04

[Feature] Support multikey commands

Currently the plugin doesn't work for multikey commands in any mode once multicursor mode is started. Actions like ciw in normal mode causes undetermined behavior since the plugin literally tries to fan out c, i, and w individually at every virtual cursor location. Adding this support requires the plugin to be more intelligent with user input, deciding what to 'keep' vs what to 'fan out'.

Selecting in normal mode should not switch to visual mode

It's written in your README.md file as:

Pressing the key in Normal mode highlights the current word under the cursor in Visual mode and places a virtual cursor at the end of it.

Currently if we use multi_cursor_next_key in normal mode, we have to press v in order to get back to normal mode. But it should not change the mode. Even in ST2, when select a word in normal mode, it stills remain in the normal (thus I can use normal mode commands liek I, A,etc..). I shouldn't use v to get back (because I've started it in normal mode already)

Strange undo behavior

After selecting some words with Control-n and typing c followed by some letters and hitting ESCAPE, typing u will only undo one letter at a time. Instead, it should probably undo the entire editing operation at once (perhaps using undo blocks?). Also, when the undo operation completes, the cursor should return to where the editing operation first began.

Many thanks for a great plugin!

Bug: Ctrl+n selects seemingly random things

Using Ctrl+n to select words seems to just pick random highlights over the file.

Screen Shot 2013-04-16 at 12 05 08

In this screenshot, I was originally over this word: cache_mp3_file

I have the following plugins:

  • delimitMate
  • fugitive
  • powerline
  • solarized
  • supertab
  • trailing-whitespace
  • typescript
  • vim-multiple-cursors

Movement by cursor keys broken

Hi,

great implementation of multiple cursors!

But with your plugin installed I can't move anymore with the cursor keys in normal mode. When I open a file, press "cursor down": vim go into insert mode, add the char "B" and add a new line after that and leaves me in insert mode. The j and k key work as expected.

Implement sequence key mappings

The following mappings doesnt work as expected..

let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_next_key="m"
let g:multi_cursor_prev_key="p"
let g:multi_cursor_skip_key="x"
let g:multi_cursor_quit_key=""

Shortcuts with cmd does not work

I have the following lines in ~/.vimrc and it doesn't accept them:

let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_next_key="\<D-d>"
let g:multi_cursor_prev_key="\<D-u>"
let g:multi_cursor_skip_key="\<D-k>"
let g:multi_cursor_exit_key="\<Esc>"

The ctrlp vim plugin has a shorcut setting like let g:ctrlp_map = '<D-p>' and it works like a charm. May be looking into this plugin for internal work could be helpful.

Visual line mode is broken

If I select an entire line using visual line mode, then hit C-n to add a cursor, I get unexpected behavior. Expected behavior should be that a new virtual cursor is added at the end of the line, and another search is performed on the buffer, similar to how visual mode works today.

[Feature] Add regex search to add multiple cursors at once

Similar to Sublime Text's Find All -> Option-Enter feature:

  • Search for a regex in the whole buffer should add a virtual cursor at the end of every match
  • Search for a regex in the visual selection should add a virtual cursor at the end of every match within the visual selection

Breaks up and down left right custom key mappings

I have the following mappings in my .vimrc

nmap <Up> ]<Space>
nmap <Down> [<Space>

these are loaded after the pathogen infect is called. When your (awesome) plugin is loaded, when I hit i get an A inserted on the line above my current line and put into insert mode. Same for down except the character is a B, left is a D, right is a C.

When I don't load your plugin everything is fine again.

Thoughts?

EasyMotion: No Matches with Cursor Next Key

Expected Behavior:
When I'm on a word and hit Cursor Next Key it will generate another cursor on the next matching word.

When I visually select multiple rows and hit Cursor Next Key it will generate a cursor for each row

Actual Behavior
Whenever Cursor Next Key is pressed I get the error:
EasyMotion: No matches

Reproduce
I've reproduced this in terminal vim 7.3.266 and mvim 7.3.
I've mapped n to Cursor Next Key to prevent conflicts with ctrlp plugin.

In terminal:
echo -e "one\none\none" > test.txt
mvim test.txt

with cursor on first "one" I hit Cursor Next Key and get:
EasyMotion: No matches

Enter visual mode and select all three rows of "ones", hit Cursor Next Key:
EasyMotion: No matches

Same thing with Visual Block

Fixing the overly-fine-grained undo problem (use undojoin)

Haven't looked at the source yet to see how the plugin works, but it would appear that in order to ensure all the changes made during a multiple-cursors edit are undone/redone on a single undo/redo you need to use the :undojoin command so that each small change is merged with the previous one... this should make things feel more natural and less painful when undoing the edit. It probably also gives you a pathway to undoing all the changes if the user decides to 'cancel' the edit with a Ctrl-C at some point.

[Feature] Support consistent undo behavior

Currently the plugin's undo behavior is unpredictable, both inside and outside of multicursor mode. For example, text inserted into the buffer during multicursor mode is undone one character at a time in all virtual cursor locations. The correct behavior should be consistent with Vim - everything entered during insert mode before exiting back to normal mode is 1 undo block.

Implementing this might require some clever hackery with using undojoin, further investigation is needed.

Selected words are not highlighted correctly

I've choose four words but it's like it selects three words:

Example 2

Any action is done on all four words, thus there is no problem with selecting. It just the misguiding highlighting. Is this a color scheme error or a vim-multiple-cursors error?

Editing multiple cursors is slow when large number of cursors

Hi,

I'm using vimified with vim-multiple-cursors.

It works fine, but it is too slow when I use more than 5-6 cursors at the same time. When I use about 20 cursors, it takes about 1 second for entering a single character in insert mode.

Is that normal behavior of the plugin ?

Thanks

Pressing Ctrl-n sounds the the terminal's bell

This is a weird one, and possibly intentional. Each press of Ctrl-n in Vim running in iTerm on OS X makes my Terminal sound the alarm. It's a harmless side-effect, but it just seems weird :)

multiple cursors break keymapping

I have mapped jj to escape in insert mode, but this is broken when multiple cursors is used. That is, the jj is interpreted as raw keystrokes.

undo behavior is inconsistent

it appears that every keystroke is being recorded right now. this is not consistent with the default undo behavior (which is that it undos everything you did in insert mode and reverts back to what it was in normal mode).

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.