Git Product home page Git Product logo

vim-visual-increment'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

vim-visual-increment's Issues

conflict with vim 8

Vim 8 has the similar built-in feature but behave differently.
In vim 8, ctrl+A in visual's column increase the numbers by the same step.
While g+ctrl+A behave same like this.
So when updating to vim 8, these two behavior may be a confliction.
Is increasing by the same step omitted on purpose or implemented by another shortcut?
more see this.

add new mode to override previous lines

In some case there are already some lines with number:

1
4
7
8

I want it be formatted to:

1
2
3
4

But actually it becomes:

1
5
9
11

Maybe add a 'force' mode to override the rest line?

error at installing: unknown option 'shallow-submodules'

I used Vendle to install this plugin but got the following error:

[2023-09-08 10:12:33] Plugin https://github.com/triglav/vim-visual-increment.git
[2023-09-08 10:12:33] $ git clone --depth 1 --recursive --shallow-submodules 'https://github.com/triglav/vim-visual-increment.git' '/home/yjiang/.vim/bundle/vim-visual-increment'
[2023-09-08 10:12:33] > error: unknown option `shallow-submodules'

Could you tell me how can I fix this problem? Thanks!

"exec normal!" instead of "normal", please

I've rebound <C-a> to a slightly customized one. It gave me some unexpected behaviour. Fortunately, using normal! makes vim use the builtin default, and everything works again.

diff --git a/plugin/visual-increment.vim b/plugin/visual-increment.vim
index 0e7a17a..98a640b 100644
--- a/plugin/visual-increment.vim
+++ b/plugin/visual-increment.vim
@@ -25,7 +25,7 @@ function! s:doincrement(step, ...)

   if start_row == end_row
     " just increment/decrement the value if only one line is selected
-    exe "normal ".a:step.incrementer
+    exe "normal! ".a:step.incrementer
   else
     " move to the next line, as we are not interested in incrementing the very
     " first one
@@ -34,7 +34,7 @@ function! s:doincrement(step, ...)
     let i = a:step
     while 1
       " increment the current line by <i>
-      exe "normal ".i.incrementer
+      exe "normal! ".i.incrementer
       " finish once the last row is incremented
       if line('.') == end_row
         break

VisualIncrement swallows hyphens

Before:

id="thing-0"
id="thing-0"
id="thing-0"
id="thing-0"
id="thing-0"

After:

id="thing-0"
id="thing1"
id="thing2"
id="thing3"
id="thing4"

VIM 7.4 on Debian 8.6

the plugin takes digits outside of visual selection

Sometimes it can be useful, but sometimes it is annoying, like in this case:

server-1.
server-1.
server-1.
server-1.

after selecting column of 1s and pressing CTRL-A the result will be:

server-1.
server0.
server1.
server2.

Maybe there could be some option or separate mode to stick to a selection.

Great plugin btw, saves a lot of time.

Skip unrelated numbers?

this may just be how it works, but its not how i would expect it to. looks like it increments the first number on each line?
thanks for checking it out!

source:

{
"item":    "item.1",
"item_2":  "item.1",
"another": "item.1",
"other":   "item.1",
"more":    "item.1",
}

expected:

{
"item":    "item.1",
"item_2":  "item.2",
"another": "item.3",
"other":   "item.4",
"more":    "item.5",
}

actual:

{
"item":    "item.1",
"item_3":  "item.1",
"another": "item.3",
"other":   "item.4",
"more":    "item.5",
}

Plugin behaviour is built into vim

Hi, I just wanted to let any users of this plugin know that the behavior this plugin provides is already built into vim through g<C-a> and g<C-x>. See :help v_g_CTRL-A.

So to emulate this plugin I've just added these simple mappings to my vimrc so the:

vnoremap <C-a> g<C-a>
vnoremap <C-x> g<C-x>
vnoremap g<C-a> <C-a>
vnoremap g<C-x> <C-x>

I've used this plugin for many years, so thanks to the maintainer for providing this in the first place.

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.