mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
23
sources_non_forked/vim-multiple-cursors/CONTRIBUTING.md
Normal file
23
sources_non_forked/vim-multiple-cursors/CONTRIBUTING.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Problems summary
|
||||
|
||||
## Expected
|
||||
|
||||
## Environment Information
|
||||
* OS:
|
||||
* Neovim/Vim/Gvim version:
|
||||
|
||||
## Provide a minimal .vimrc with less than 50 lines
|
||||
|
||||
" Your minimal.vimrc
|
||||
|
||||
## Generate a logfile if appropriate
|
||||
|
||||
1. export NVIM_PYTHON_LOG_FILE=/tmp/log
|
||||
2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
3. nvim -u minimal.vimrc
|
||||
4. recreate your issue
|
||||
5. cat /tmp/log_{PID}
|
||||
|
||||
## Screen shot (if possible)
|
||||
|
||||
## Upload the log file
|
@ -1,5 +1,7 @@
|
||||
# vim-multiple-cursors [](https://travis-ci.org/terryma/vim-multiple-cursors)
|
||||
|
||||
# vim-multiple-cursors
|
||||
[](https://travis-ci.org/terryma/vim-multiple-cursors)
|
||||
[](http://issuestats.com/github/terryma/vim-multiple-cursors)
|
||||
[](http://issuestats.com/github/terryma/vim-multiple-cursors)
|
||||
## Contents
|
||||
- [About](#about)
|
||||
- [Features](#features)
|
||||
@ -10,7 +12,8 @@
|
||||
- [Interactions with other plugins](#interactions-with-other-plugins)
|
||||
- [Highlight](#highlight)
|
||||
- *[FAQ](#faq)*
|
||||
- *[Known Issues](#known-issues)*
|
||||
- *[Known issues](#known-issues)*
|
||||
- *[Issue creation requirements](#issue-creation-requirements)*
|
||||
- [Changelog](#changelog)
|
||||
- [Contributing](#contributing)
|
||||
- [Credit](#credit)
|
||||
@ -42,7 +45,7 @@ Vim command sequence: `2Gdf[$r,0f,v<C-n>…<C-n>c<CR><Up><Del><Right><Right><Rig
|
||||
### Add multiple cursors using regexes
|
||||

|
||||
|
||||
To see what keystrokes are used for the above examples, see [this issue](https://github.com/terryma/vim-multiple-cursors/issues/39).
|
||||
To see what keystrokes are used for the above examples, see [the wiki page](https://github.com/terryma/vim-multiple-cursors/wiki/Keystrokes-for-example-gifs).
|
||||
|
||||
## Features
|
||||
- Live update in Insert mode
|
||||
@ -203,6 +206,10 @@ highlight link multiple_cursors_visual Visual
|
||||
## Known Issues
|
||||
- Select mode is not implemented
|
||||
|
||||
## Issue Creation Requirements
|
||||
|
||||
This is a community supported project. Contributor's time is precious and limited. To ensure your issue is not closed out of hand, please ensure it meets the requirements outlined in [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
|
||||
## Changelog
|
||||
See [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
|
@ -218,9 +218,12 @@ function! multiple_cursors#find(start, end, pattern)
|
||||
let first = 1
|
||||
while 1
|
||||
if first
|
||||
" Set `virtualedit` to 'onemore' for the first search to consistently
|
||||
" match patterns like '$'
|
||||
let saved_virtualedit = &virtualedit
|
||||
let &virtualedit = "onemore"
|
||||
" First search starts from the current position
|
||||
let match = search(a:pattern, 'cW')
|
||||
let first = 0
|
||||
else
|
||||
let match = search(a:pattern, 'W')
|
||||
endif
|
||||
@ -228,9 +231,26 @@ function! multiple_cursors#find(start, end, pattern)
|
||||
break
|
||||
endif
|
||||
let left = s:pos('.')
|
||||
call search(a:pattern, 'ceW')
|
||||
" Perform an intermediate backward search to correctly match patterns like
|
||||
" '^' and '$'
|
||||
let match = search(a:pattern, 'bceW')
|
||||
let right = s:pos('.')
|
||||
" Reset the cursor and perform a normal search if the intermediate search
|
||||
" wasn't successful
|
||||
if !match || s:compare_pos(right, left) != 0
|
||||
call cursor(left)
|
||||
call search(a:pattern, 'ceW')
|
||||
let right = s:pos('.')
|
||||
endif
|
||||
if first
|
||||
let &virtualedit = saved_virtualedit
|
||||
let first = 0
|
||||
endif
|
||||
if s:compare_pos(right, pos2) > 0
|
||||
" Position the cursor at the end of the previous match so it'll be on a
|
||||
" virtual cursor when multicursor mode is started. The `winrestview()`
|
||||
" call below 'undoes' unnecessary repositionings
|
||||
call search(a:pattern, 'be')
|
||||
break
|
||||
endif
|
||||
call s:cm.add(right, [left, right])
|
||||
@ -510,7 +530,7 @@ function! s:CursorManager.update_current() dict
|
||||
" adjust other cursor locations
|
||||
if vdelta != 0
|
||||
if self.current_index != self.size() - 1
|
||||
let cur_line_length = len(getline(cur.line()))
|
||||
let cur_column_offset = (cur.column() - col('.')) * -1
|
||||
let new_line_length = len(getline('.'))
|
||||
for i in range(self.current_index+1, self.size()-1)
|
||||
let hdelta = 0
|
||||
@ -522,7 +542,7 @@ function! s:CursorManager.update_current() dict
|
||||
if cur.line() == c.line()
|
||||
if vdelta > 0
|
||||
" Added a line
|
||||
let hdelta = cur_line_length * -1
|
||||
let hdelta = cur_column_offset
|
||||
else
|
||||
" Removed a line
|
||||
let hdelta = new_line_length
|
||||
|
@ -191,7 +191,7 @@ end
|
||||
|
||||
describe "Multiple Cursors" do
|
||||
let(:filename) { 'test.txt' }
|
||||
let(:options) { [] }
|
||||
let(:options) { ['set autoindent'] }
|
||||
|
||||
specify "#paste buffer normal x then p" do
|
||||
before <<-EOF
|
||||
@ -350,6 +350,38 @@ describe "Multiple Cursors" do
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#multiple new lines on one line in insert mode" do
|
||||
before <<-EOF
|
||||
'a','b','c','d','e'
|
||||
EOF
|
||||
|
||||
type 'f,v<C-n><C-n><C-n>c<CR><Esc>'
|
||||
|
||||
after <<-EOF
|
||||
'a'
|
||||
'b'
|
||||
'c'
|
||||
'd'
|
||||
'e'
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#multiple new lines on one line in insert mode with indents" do
|
||||
before <<-EOF
|
||||
'a','b','c','d','e'
|
||||
EOF
|
||||
|
||||
type '4i<Space><Esc>f,v<C-n><C-n><C-n>c<CR><Esc>:%s/^/^<CR>'
|
||||
|
||||
after <<-EOF
|
||||
^ 'a'
|
||||
^ 'b'
|
||||
^ 'c'
|
||||
^ 'd'
|
||||
^ 'e'
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#normal mode 'o'" do
|
||||
before <<-EOF
|
||||
hello
|
||||
@ -397,6 +429,48 @@ describe "Multiple Cursors" do
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#find command start-of-line" do
|
||||
before <<-EOF
|
||||
hello
|
||||
world
|
||||
|
||||
hello
|
||||
world
|
||||
EOF
|
||||
|
||||
vim.normal ':MultipleCursorsFind ^<CR>'
|
||||
type 'Ibegin<Esc>'
|
||||
|
||||
after <<-EOF
|
||||
beginhello
|
||||
beginworld
|
||||
begin
|
||||
beginhello
|
||||
beginworld
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#find command end-of-line" do
|
||||
before <<-EOF
|
||||
hello
|
||||
world
|
||||
|
||||
hello
|
||||
world
|
||||
EOF
|
||||
|
||||
vim.normal ':MultipleCursorsFind $<CR>'
|
||||
type 'Iend<Esc>'
|
||||
|
||||
after <<-EOF
|
||||
helloend
|
||||
worldend
|
||||
end
|
||||
helloend
|
||||
worldend
|
||||
EOF
|
||||
end
|
||||
|
||||
specify "#visual line mode replacement" do
|
||||
before <<-EOF
|
||||
hello world
|
||||
|
Reference in New Issue
Block a user