python search regex

2016-11-23 Thread rameo
A time ago, I asked if it possible to add python regex to vim.
No one answered that question.

VIM is a great editor and the use of Vimscript makes it even better.
Then I started to learn Python and noted that Bram has integrated Python in 
Vim. 
I transformed many scripts from Vimscript to Python.
I noted that the things you want to do in vimscript, you can do the same thing 
in Python with 30/40% less lines.

There is much more info on line about python and much more people who can help 
you to resolve a problem.
Many things that you can do easier in Python.
Number manipulations, range with float step (using Numpy) etc.
And what about list manipulations? It is so easy in Python. 
Putting all your buffer lines in a python list and you can do magic with your 
text in the buffer.

But what I miss and why I have to mix my functions with vimscript, is the 
python regex to search things in the buffer.
If I want to catch certain things in the text I have to search it using 
vimscript. It would be much easier if I could use also the python regex.

Would this be possible in a future vim release?

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with macro and defaults.vim

2016-11-23 Thread Christian Brabandt

Am 2016-11-22 21:31, schrieb Cesar Romani:

I'm using Vim 8.0.94 on Windows.
Suppose I have the following line
111 bbb aaa ccc

and I delete the first word with 'dw', the second with '.', go the end
of line with $, go the previous space with 'F' followed by space, and 
do
'p'. Summing up, I'm doing 'dw.$F p' (without the quotes). If I 
directly

run these commands, I get:
aaa bbb ccc

but if I use a macro, say @a, it doesn't work. I get
bbb aaa 111 111 ccc

If I disable defaults.vim it works.


I cannot replicate this problem. Please check the following:
 - What is the content of your register?
 - Where is the cursor located when you run the macro?
 - How can we reproduce this problem?

Also defaults.vim does not set that many options. If nothing helps you 
might want to

check each option individually if it has an influence.

Best,
Christian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Write a buffer other than the current one?

2016-11-23 Thread Efraim Yawitz
I haven't been able to find a way to write a buffer other than the current
one, i.e. something like a command :writebuf  or a similar
function.  It seems like this would be something useful to do, say after
listing buffers and seeing which ones were changed.  I know one can do
:wall, but that does not allow choosing which ones to save.

Thanks,

Ephraim

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fold-related bug and pointer to fix

2016-11-23 Thread Efraim Yawitz
I had the following problem and I think it is a bug in some fold-related
code:

I was trying to use the NarrowRegion plugin to do diffs between two
functions in the same file by creating narrowed buffers for each function
and calling :diffthis on them.  When I tried to do this using folds, i.e.
:.,+2NarrowRegion to create a buffer for a folded-up function which looked
like this:

int FuncName() {
.folded
}

I got everything but the final brace in the narrowed buffer.  Eventually I
discovered that this has nothing to do with NarrowRegion, but just a yank
such as:

:.,+2y

over a fold gives only the folded lines but not the line after the fold.

A normal command of y2j works just fine and gets the line after the fold.
Similarly, in a file where multiple folds are right after one another (a
nice example is in fold.c of the vim code), a normal command of y2j yanks
two folds, but :.,+2y yanks only one.

A little debugging led me to believe that the problem is in this code in
ex_docmd.c, lines 2548-2549 in the latest git code:

/* Put the first line at the start of a closed fold, put the last line
 * at the end of a closed fold. */
(void)hasFolding(ea.line1, , NULL);
(void)hasFolding(ea.line2, NULL, );

This seems to use the side effect of the hasFolding call to set the value
of ea.line2 which is passed to the actual yank command.

I hope this will be helpful to fix the bug.

Ephraim

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.