matchend() and \zs

2012-04-19 Thread rameo
My file - first line: an 91.010 &System.-sep010- I want to copy all numbers after -sep echo match(getline(1), 'sep\zs\d\+\ze-') gives 23 as output. All ok. but echo matchend(getline(1), 'sep\zs\d\+\ze-', 23) gives -1 as output. Why? If I remove "sep" before '\zs' it works. (echo matchend(ge

Re: matchend() and \zs

2012-04-19 Thread rameo
On Thursday, April 19, 2012 1:09:10 PM UTC+2, jott...@googlemail.com wrote: > Hi, > > rameo wrote: > > My file - first line: > > an 91.010 &System.-sep010- > > > > I want to copy all numbers after -sep > > echo match(getline(1), 'sep\

Re: matchend() and \zs

2012-04-20 Thread rameo
On Thursday, April 19, 2012 8:12:55 PM UTC+2, Ben Fritz wrote: > On Thursday, April 19, 2012 5:35:11 AM UTC-5, rameo wrote: > > My file - first line: > > an 91.010 &System.-sep010- > > > > I want to copy all numbers after -sep > > echo match(getline(

Re: matchend() and \zs

2012-04-20 Thread rameo
On Friday, April 20, 2012 5:52:37 PM UTC+2, Ben Fritz wrote: > On Friday, April 20, 2012 2:45:28 AM UTC-5, rameo wrote: > > > > After all these match() and matchend() problems, I'm trying to view if > > matches can be captured by using the submatch(0) and addi

Re: matchend() and \zs

2012-04-20 Thread rameo
On Friday, April 20, 2012 8:51:37 PM UTC+2, Ben Fritz wrote: > On Friday, April 20, 2012 11:30:02 AM UTC-5, rameo wrote: > > On Friday, April 20, 2012 5:52:37 PM UTC+2, Ben Fritz wrote: > > > On Friday, April 20, 2012 2:45:28 AM UTC-5, rameo wrote: > > > > >

questions about submatch()

2012-04-22 Thread rameo
rsion when there are float values. How can I let submatch() know that it has to make a float value when the increment/decrement value or the number self is a float, else it has to see the value as integer? Tnx, Rameo -- You received this message from the "vim_use" maillist. Do

Re: questions about submatch()

2012-04-23 Thread rameo
On Monday, April 23, 2012 8:41:33 AM UTC+2, rameo wrote: > Hello to all readers, > > I use submatch() to increment/decrement numbers in a text. > > My questions are: > 1) In my country the "comma" is seen as decimal separator. >submatch() doesn't seem to

Re: questions about submatch()

2012-04-23 Thread rameo
Tnx John and Ben. Please let me ask one more question about submatch() If I use submatch like this: :%s/'pattern'/\=MyFunction(submatch())/g function! MyFunction(m) variable x do something with variable x return x endfunction I would like to confirm (with a "c" flag) all single substitutions

Re: questions about submatch()

2012-04-24 Thread rameo
On Tuesday, April 24, 2012 10:01:35 AM UTC+2, JohnBeckett wrote: > rameo wrote: > > If I use submatch like this: > > :%s/'pattern'/\=MyFunction(submatch())/g > > That gives: > E119: Not enough arguments for function: submatch > E116: Invalid arguments for fun

Colorschemes and split window

2012-04-27 Thread rameo
I use this code in my .vimrc to use my dark colorscheme when I open a .vim page and my light colorscheme when I open whatever other page: augroup filetype_colorscheme au BufEnter * \ if !exists('b:colors_name') \ | if &ft == "vim" \ | let b:colors_name

Re: Colorschemes and split window

2012-04-27 Thread rameo
On Friday, April 27, 2012 6:18:29 PM UTC+2, Ben Fritz wrote: > On Friday, April 27, 2012 10:56:55 AM UTC-5, rameo wrote: > > I use this code in my .vimrc to use my dark colorscheme when I open a .vim > > page and my light colorscheme when I open whatever other page: &

Re: Colorschemes and split window

2012-04-27 Thread rameo
On Friday, April 27, 2012 8:29:03 PM UTC+2, Tony Mechelynck wrote: > On 27/04/12 18:34, rameo wrote: > > On Friday, April 27, 2012 6:18:29 PM UTC+2, Ben Fritz wrote: > >> On Friday, April 27, 2012 10:56:55 AM UTC-5, rameo wrote: > >>> I use this code in my .vimrc to

Re: Colorschemes and split window

2012-04-28 Thread rameo
On Saturday, April 28, 2012 12:39:51 AM UTC+2, Tony Mechelynck wrote: > On 27/04/12 23:41, rameo wrote: > > On Friday, April 27, 2012 8:29:03 PM UTC+2, Tony Mechelynck wrote: > >> On 27/04/12 18:34, rameo wrote: > >>> On Friday, April 27, 2012 6:18:29 PM UTC+2, Ben

Re: map Ctrl with special characters

2012-04-28 Thread rameo
On Friday, April 27, 2012 5:45:15 PM UTC+2, rameo wrote: > I still have problems mapping keys. > > On my keyboard I have these keys I want to map: > > > > > > > Tony once told in a message these info: > ò = (0xF2, o-grave) and (Alt+0x72, Alt-r) > à =

Re: Colorschemes and split window

2012-04-29 Thread rameo
On Saturday, April 28, 2012 12:39:51 AM UTC+2, Tony Mechelynck wrote: > On 27/04/12 23:41, rameo wrote: > > On Friday, April 27, 2012 8:29:03 PM UTC+2, Tony Mechelynck wrote: > >> On 27/04/12 18:34, rameo wrote: > >>> On Friday, April 27, 2012 6:18:29 PM UTC+2, Ben

Re: Colorschemes and split window

2012-04-30 Thread rameo
It seems that I have found the solution (after many many hours of trying :-( ) I created the function below. The function must do this (and seems to do it): a) when there is only 1 window: check if filetype is "vim" --> Dark_ColorScheme if filetype is not "vim" --> Light_ColorScheme

Highlight after invoking a function

2012-05-02 Thread rameo
I would like to know how to highlight matches after invoking a function p.e. function! s:MyFunction() let search = '\d\+' let @/ = search return "normal n" endfunction :call Test() does not highlight the matches. I know I can add :set hls after the function call but that creates p

Re: email plugin

2012-11-29 Thread rameo
On Friday, November 30, 2012 12:05:41 AM UTC+1, Bost wrote: > Is there any good email plugin you can recommend me guys? It seems > > like there isn't any star plugin for handling emails in vim, in fact > > google search doesn't return many useful links to this topic. So, I'd > > like to hear you

command using numeric keypad

2013-01-27 Thread rameo
I would like to associate commands with the numeric keypad ctrl + -> (number 6 on the numeric keypad with numlock enabled) I don't know how to do this. Can anyone help me? -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are repl

Cursor question

2013-03-13 Thread rameo
In insert mode I have a blinking vertical bar as cursor. I noted a strange thing when I'm in insert mode: I have to click with the mouse on the next letter in order to put the vertical bar before this letter. When I click on the space between two letters the cursor goes to the space before the p

Re: Cursor question

2013-03-14 Thread rameo
post this message. Well if there is nothing I can do, I have to accept it as it is :) On Wednesday, March 13, 2013 10:34:22 AM UTC+1, rameo wrote: > In insert mode I have a blinking vertical bar as cursor. > > I noted a strange thing when I'm in insert mode: > I have to click with

using !sort in windows commandline: passing special characters

2013-07-21 Thread rameo
I use cygwin on my windows system to use unix commands from vim commandline. This is written in my text file: Adam|12345 Bob|34567 Joe|56789 Sam|45678 Wendy|23456 When I use: :%!sort -k2n -t'|' it gives an error: ''' is not recognized as an internal or external command, operable program or ba

Re: using !sort in windows commandline: passing special characters

2013-07-22 Thread rameo
ome of the more edge-case > > sort-orders (such as --month-sort, --human-numeric-sort and > > --version-sort). I don't use those very often and far more > > frequently have need to sort by some regexp like vim provides. > > > > -tim Thank you very much

Match all characters enclosed in brackets

2013-08-09 Thread rameo
I have trouble finding the correct regex. I know that a sequence of characters enclosed in brackets means their optional: [xyz] means any 'x' OR 'y' OR 'z' but how can I find them all? any 'x' AND 'y' AND 'z' in whatever sequence and quantity p.e. Match first an uppercase character then a

Encoding and Fileencoding of a latin1 file

2014-07-03 Thread rameo
I've written this in my _vimrc file if has("multi_byte") if &termencoding == "" let &termencoding = &encoding endif set encoding=utf-8 set fileencoding=utf-8 set fileencodings=ucs-bom,utf-8,latin1 endif When I open a latin1 file in my editor VIM indicates [CONVERTED] after the file

Re: Encoding and Fileencoding of a latin1 file

2014-07-05 Thread rameo
Ben, Try to write these french words in a file with a latin1 fileencoding: bœuf, cœur, manœuvre, œil (beef, heart, manoeuvre, eye) Close this file. Set encoding to utf-8 in your vimrc. Open the file. Encoding is utf-8 Fileencoding is latin1 (:set fileencoding?), converted is written after the

Re: Encoding and Fileencoding of a latin1 file

2014-07-06 Thread rameo
Thank you very much Ben for your great explication. Not easy to understand. I still don't understand why my vimrc and menu.vim, containing both french characters as "œu", could be read in latin1 in the past, without any problem or error. (The only encoding line I had in my vimrc file at that mom

Inputdialog - Aligning

2014-07-27 Thread rameo
I noted that Vim uses the proportional windows default font for his inputdialog text. (The same font as the gvim menu font) If I create an inputdialog like this: Let question = "Which formatting? \ \n \ \n1) %.2f --> Floating point number, 2 decimals \ \n2) %10d --> Integer Rig

Re: Inputdialog - Aligning

2014-08-02 Thread rameo
On Sunday, July 27, 2014 11:51:30 AM UTC+2, rameo wrote: > I noted that Vim uses the proportional windows default font for his > inputdialog text. (The same font as the gvim menu font) > > If I create an inputdialog like this: > > Let question = "Which formatting? >

Python 3 support

2016-01-22 Thread rameo
I've installed the latest vim beta: gvim-7-4-1087.exe Doesn't the beta support python 3? `import vim` doesn't work. Vim could not load library python27.dll I've installed python 3.5. uninstalled it and installed python 3.4 uninstalled it and installed 3.3 Still same error. -- -- You receive

Python 3 support

2016-01-22 Thread rameo
I've installed the latest vim beta: gvim-7-4-1087.exe Doesn't the beta support python 3? `import vim` doesn't work. Vim could not load library python27.dll I've installed python 3.5. uninstalled it and installed python 3.4 uninstalled it and installed 3.3 Still same error. -- -- You receive

Re: Python 3 support

2016-01-22 Thread rameo
Op vrijdag 22 januari 2016 22:18:03 UTC+1 schreef Christian Brabandt: > Hi rameo! > > On Fr, 22 Jan 2016, rameo wrote: > > > I've installed the latest vim beta: gvim-7-4-1087.exe > > > > Doesn't the beta support python 3? > > > > `impo

inputdialog() font

2016-01-24 Thread rameo
I use this monospaced font in VIM (in _vimrc): set guifont=DejaVu_Sans_Mono:h10 However in the inputdialog window the font is not this monospaced font but some NON monospaced font (it seems to me that it is Arial). Is it possible to change the font in inputdialog()? (text is not aligned in inpu

Capture confirmation flag

2016-02-15 Thread rameo
"linenumber".s/search/replace/gc Replace with 'replace' (y/n/a/q/l/^E/^Y)? Do you know if there is any way to capture which one has been clicked? -- -- 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 informati

Vim and Python

2016-03-04 Thread rameo
Vim and Python is an incredible power combination. Vimscript is great, Python makes it even greater, faster and easier. What I just want to ask is if it possible in a future release to include the python regex code as well. Now I do a search in vim, capture the search/matches and use it in a vims

Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-07 Thread rameo
I use searchpos() to capture start/endcolumns of a matches. Then I use the results in Python code to transform the text. However I noted that latin characters as 'èéàòìù' are counted as 1 byte in Python but 2 bytes in Vim and the output is not as expected. Is there any way to resolve this proble

Re: Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-07 Thread rameo
> In Python you are not using *byte* counts, it indexes *unicode > codepoints*. You may convert unicode Python objects to bytes objects > by using `string.encode(vim.options['encoding'])`, use > `.decode(vim.options['encoding'])` to convert back. bytes objects are > indexed by bytes. You may also

Re: Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-08 Thread rameo
Can't find anything on the net about string.encode(vim.options[encoding]). No info either in Vim documentation: if_pyth Let say I create my list "MyPositions" with start/end position of matches using searchpos() in vim. Then in my python code I have to do something like this to convert it to byt

Re: Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-08 Thread rameo
Thank you. You're right. It is not a question of decoding a list but decoding a string. Never did anything before with string encoding. I've got it: I cannot use searchpos() to use with python. Searching positions must be done in python (p.e. finditer). BTW I thought that ['encoding'] was a pl

Re: Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-08 Thread rameo
> Better `vim.Function('getline')(linenr) You seems to know everything in every computer language :) Yes I use Pyth3 and many times also `vim.current.buffer[linenr-1]` or things like this `r = vim.current.buffer[startline:endline]` To avoid decoding errors it is better to switch all these stateme

Re: Is there any way to count all latin characters in utf-8 as 1 byte?

2016-03-08 Thread rameo
Thanks but I still don't understand it. No problem. Hope I'll not have problems with `vim.current.buffer[linenr -1]`. My experience with Python tells me that Python language is much easier then vimscript. Things can be done easier with the many Python modules using less code then in vimscript.

Start/end positions of all matches on a single line

2016-03-19 Thread rameo
I would like to know the start/end positions of matches on a few lines. These linenumbers are in a list "list". I want to add the startpositions of all matches in the list "idx" and the endpositions of matches in the list "edx" idx = [] edx = [] for n in range(0,len(list)-1) "idx positions cal

Vim Function: return from within Python Code

2016-03-19 Thread rameo
I have a VIM function with a lot of code written in python. There are many loops and sub-loops with this kind of code: if this exit else do this Does anyone know how to exit the python code and return to vim? (or even better "how to exit the function from within python code?") sys.exit() an

Re: Vim Function: return from within Python Code

2016-03-21 Thread rameo
@ZyX, Thanks, You mean to extract the Python code to a .py file and import it in my vim function? I still don't understand how to exit from my pythoncode from within my python code. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text yo

Capture columns nummers of matches ending with double byte chars

2016-04-21 Thread rameo
Since I use Vim I have troubles with double byte characters. I want to capture all strings of matches together with startcolumn and endcolumn of a match (line by line). I don't need only the strings but also the columnnumbers for other functions. The last few years I used match/matchend then I

Re: Capture columns nummers of matches ending with double byte chars

2016-04-23 Thread rameo
Searchpos() doesn't return the right end value of a match if the match end with a double byte character (èéòìùá...). (encoding utf-8) Isn't this a bug Would it be possible to add a feature in Vim like finditer in Python? Searchpos() searches the entire file till stopline. finditer returns all

Re: Capture columns nummers of matches ending with double byte chars

2016-04-25 Thread rameo
Op maandag 25 april 2016 22:26:27 UTC+2 schreef Ken Takata: > Hi rameo, > > 2016/4/23 Sat 21:37:15 UTC+9 rameo wrote: > > Searchpos() doesn't return the right end value of a match if the match end > > with a double byte character (èéòìùá...). (encoding utf-8) > &g

Re: Capture columns nummers of matches ending with double byte chars

2016-04-25 Thread rameo
> > It is much better to download sources from https://github.com/vim/vim. > Found it: https://github.com/vim/vim-win32-installer/releases However... Tried: gvim_7.4.1782_x86.exe gvim_7.4.1786_x86.exe Both gives an error: Error detected while processing vimrc_example.vim line 114: E919: Dire

Re: Capture columns nummers of matches ending with double byte chars

2016-04-26 Thread rameo
Op dinsdag 26 april 2016 08:14:33 UTC+2 schreef Christian Brabandt: > Hi rameo! > > On Mo, 25 Apr 2016, rameo wrote: > > > > > > > > > It is much better to download sources from https://github.com/vim/vim. > > > > > > > Found it

Re: Capture columns nummers of matches ending with double byte chars

2016-04-26 Thread rameo
Op dinsdag 26 april 2016 09:14:52 UTC+2 schreef rameo: > Op dinsdag 26 april 2016 08:14:33 UTC+2 schreef Christian Brabandt: > > Hi rameo! > > > > On Mo, 25 Apr 2016, rameo wrote: > > > > > > > > > > > > > It is muc

Python Regex in a Vim Search

2016-05-11 Thread rameo
I would like to ask whether it is possible to add python regex to the VIM search in a future VIM release? p.e. We could use a `P` or something like that in a vim search to indicate that it concerns a Python regex p.e. `/P'pythonregex'` If we have this we can use the same regex in the other pyt

visual mode detection

2016-08-21 Thread rameo
I'm using the latest Nightly Vim Windows build v7.4.2232 I noted that the last builds don't detect visual mode. in my menu.vim nnoreme 93.02.12 &Sort.Vertical\ :call VerticalSort("%") vnoreme 93.02.12 &Sort.Vertical\ :call VerticalSort("''<,''>") When I don't select anything the first line mu

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.

idx-edx: Different Character count in Vim and Python

2017-01-25 Thread rameo
Example: s="I like crème caramel but not only caramel I also like crème fraîche." Searching the idx-edx numbers of the matches of the word "crème": echo matchstrpos(s, "crème") --> 7,13 echo matchstrpos(s, "crème",14) --> 55,61 I do have a python function in which I transform the above stri

Re: Vim as external editor for thunderbird

2017-02-06 Thread rameo
Guido, I use http://www.listary.com/text-editor-anywhere Saluti da una ventosa Francia. :) ~R. -- -- 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 --- Yo

Re: python 3

2017-11-24 Thread rameo
On Wednesday, November 22, 2017 at 11:31:10 PM UTC+1, Ni Va wrote: > Hi, > > Just try from vim.8.0.1330 to execute :py3 import sys (with python v3.7.0a2) > fails and exit vim. > > > May I miss some things to do? > Thank you You're using Python 3.7. Vim is made for Python 3.5. You need to insta

Vim external command output encoding

2019-02-15 Thread rameo
I am trying to get the output from Everything Search in Vim using Everything commandline (es.exe) This works great in cmd shell but when I do the same in gvim I do not see any accents. E.g. :r !es *.doc returns all doc files, but all accents (éèòì etc) are not shown. No problem if I use this i

Vim9 - Python/Lua interface

2020-05-13 Thread rameo
I first came into contact with Vim about 15 years ago. A few times I uninstalled it and reinstalled it a while later. After a few months I was convinced it was the best text editor I had ever seen. I only noticed how much value it had when I wrote scripts in vimrc myself and changed plugins/menu.

Re: Vim9 - Python/Lua interface

2020-05-13 Thread rameo
python regex in the command line. Hopefully it'll work out. I'm also thinking of a way to leave python functions just like in vimscript (return). On Wednesday, May 13, 2020 at 12:54:19 PM UTC+2, rameo wrote: > > I first came into contact with Vim about 15 years ago. > A few tim

Command Line Bookmark manager

2021-07-16 Thread rameo
Hi, Is there a possibility in Vim or a script that allows us to Bookmark or Pin Command Line commands? I know there is such a thing for files and directories (eg FavMenu) but is there something similar for search and execute commands? Thanks in advance. -- -- You received this message from

Re: Command Line Bookmark manager

2021-07-16 Thread rameo
Hi, Vim command line commands On Friday, July 16, 2021 at 4:37:21 PM UTC+2 rwmit...@gmail.com wrote: > On Friday, July 16, 2021 at 5:37:44 AM UTC-4 rameo wrote: > >> Hi, >> >> Is there a possibility in Vim or a script that allows us to Bookmark or >> Pin Comma

Re: Command Line Bookmark manager

2021-07-19 Thread rameo
Thank you, even though it looks really good, it's much more than I wanted. I was looking for something in vim itself and only focused on saving vim search/exec commands (like a bookmark manager). On Saturday, July 17, 2021 at 5:37:56 PM UTC+2 stevelitt wrote: > rameo said on Fri, 16

Importing values from vim to python in vim9

2023-12-05 Thread rameo
I installed vim 9 but still have multiple functions written in old vimscript. I've read that functions written in old vimscript still work. However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works I don't always get the right values imported. Exampl

Re: Importing values from vim to python in vim9

2023-12-05 Thread rameo
:variable1")) variable2 = str(vim.bindeval("a:variable2")) This works. But now it's binary isn't it (b'value')? How do I get it as text again? Isn't there a better solution? Thanks, Rameo On Tuesday, December 5, 2023 at 11:14:21 PM UTC+1 Christian Brabandt wr

Re: Importing values from vim to python in vim9

2023-12-06 Thread rameo
in the function > definition in quotes? > > Salman > > On Tue, Dec 5, 2023, 17:14 Christian Brabandt wrote: > >> >> On Di, 05 Dez 2023, rameo wrote: >> >> > I installed vim 9 but still have multiple functions written in old >> vimscript. >&g

<    1   2   3