hello Mark,
On Fri, Jan 02, 2026 at 03:57:08PM -0600, Mark Manning wrote:
> Actually, I was just posting it so if anyone wanted it they could have
> it. As for using someone else's script - I just like mine.
if so, you should probably create a git repo outthere so people can
easily deploy, comment, contribute ...
> Thanks for > letting me know how you feel. :-)
I try to be as helpful as others was to me when providing me this kinds
of feedbacks. you're welcome.
regards
--
Marc Chantreux
Pôle CESAR (Calcul et services avancés à la recherche)
Université de Strasbourg
☎ 03.68.85.60.79
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVudy8pUCiDoyrDe%40prometheus.
Monday, January 5, 2026
Friday, January 2, 2026
Re: decvers.vim
Actually, I was just posting it so if anyone wanted it they could have
it. As for using someone else's script - I just like mine. Thanks for
letting me know how you feel. :-)
On Fri, Jan 2, 2026 at 7:04 AM Marc Chantreux <mc@unistra.fr> wrote:
>
> hello Mark,
>
> As you posted the whole script on the list, you probably expect some
> feedbacks so mine is:
>
> I script a lot of things and what I consider a good practice is the
> complete oposite of what you're trying to achieve here: If your code is
> useful, someone will probably want to use it out of vim so don't use
> viml and pick another scripting langage (zsh, dash, rc, tcl, perl, js,
> ruby, python, R, there are tons of those) then use it from vim using
> ! or system* functions.
>
> Also: take a look at vim9script: it it much more confortable than the
> old style vim langage.
>
> regards,
> Marc
>
>
> --
> Marc Chantreux
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/uz1SylyjsfQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVfCMhJyywsFvJNM%40prometheus.
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CAPJLamx-OupBP2j6Agw60ueZbfRRi4m00iG6d-Qez8Ss%3DksDYQ%40mail.gmail.com.
it. As for using someone else's script - I just like mine. Thanks for
letting me know how you feel. :-)
On Fri, Jan 2, 2026 at 7:04 AM Marc Chantreux <mc@unistra.fr> wrote:
>
> hello Mark,
>
> As you posted the whole script on the list, you probably expect some
> feedbacks so mine is:
>
> I script a lot of things and what I consider a good practice is the
> complete oposite of what you're trying to achieve here: If your code is
> useful, someone will probably want to use it out of vim so don't use
> viml and pick another scripting langage (zsh, dash, rc, tcl, perl, js,
> ruby, python, R, there are tons of those) then use it from vim using
> ! or system* functions.
>
> Also: take a look at vim9script: it it much more confortable than the
> old style vim langage.
>
> regards,
> Marc
>
>
> --
> Marc Chantreux
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/uz1SylyjsfQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVfCMhJyywsFvJNM%40prometheus.
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CAPJLamx-OupBP2j6Agw60ueZbfRRi4m00iG6d-Qez8Ss%3DksDYQ%40mail.gmail.com.
Re: decvers.vim
hello Mark,
As you posted the whole script on the list, you probably expect some
feedbacks so mine is:
I script a lot of things and what I consider a good practice is the
complete oposite of what you're trying to achieve here: If your code is
useful, someone will probably want to use it out of vim so don't use
viml and pick another scripting langage (zsh, dash, rc, tcl, perl, js,
ruby, python, R, there are tons of those) then use it from vim using
! or system* functions.
Also: take a look at vim9script: it it much more confortable than the
old style vim langage.
regards,
Marc
--
Marc Chantreux
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVfCMhJyywsFvJNM%40prometheus.
As you posted the whole script on the list, you probably expect some
feedbacks so mine is:
I script a lot of things and what I consider a good practice is the
complete oposite of what you're trying to achieve here: If your code is
useful, someone will probably want to use it out of vim so don't use
viml and pick another scripting langage (zsh, dash, rc, tcl, perl, js,
ruby, python, R, there are tons of those) then use it from vim using
! or system* functions.
Also: take a look at vim9script: it it much more confortable than the
old style vim langage.
regards,
Marc
--
Marc Chantreux
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVfCMhJyywsFvJNM%40prometheus.
Thursday, January 1, 2026
decvers.vim
First, sorry for top posting. I was just replying to my email. Live and learn as they say. Now I know to not do that. I'll try to always go to the list and post there from now on. Again - very sorry.
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/b8b1a020-dbcd-48bd-9350-348eb66b068an%40googlegroups.com.
I decided to post my decvers.vim script here in case anyone out there would like to use it. Why is it called decvers.vim? The "dec" part comes from the Digital Equipment Corporation or DEC name. The "vers" is for the word "version". Thus decvers.vim.
What it does is to make a copy of your source code automatically. It does this by adding a semicolon (;) to the end of the file name and then adding a five digit number to the end of the file name also. (So like "00000" or "00001" and so on.) Each time you edit the file, it adds one new number onto the end of the save (I have it set to do this three times). When you reach the maximum number of saves the earliest version is removed. Thus, you don't over run your system with backup copies. The interesting thing about this is that this shows you how you could do an automated version number in the program but I'm just interested in just having a backup I can return to if somehow I manage to muck up the current version. Anyway, here is the code. It is not perfect but it works. :-)
decvers.vim
" Note that tab stops should be at 4 spaces. Also I left all of my ECHO commands
" in - in case anyone wants to play around with the script. This is free software and
" can be used anywhere for anything. It is basically public domain. MEM.
Beginning of script
" -*- vim -*-
" @(#) $Id: decvers.vim,v 0.1 Mark Manning
"
" Notes: Please note that I am using five zeros as the size of the
" backup file names. So we have 00000 and then 00001, 00002, etc...
"
let path_name=expand("%:p")
let file_name=expand("%:t")
"
" Now see about getting all of the iterations of the current file
"
let cmd ='dir /b/on "' . path_name . ';*"'
let x=systemlist(cmd)
" let x=split(x[0],"\n")
let ary_len=len(x)
" echo "CMD = " . cmd
" echo "X = "
" echo x
"
" Now get the highest number of the iterations
"
let l=0
let high_num=0
if( ary_len > 0 )
while( l < ary_len )
let a=split(x[l],";")
" echo "A = "
" echo a
let a_len = len(a) - 1
let a_last = a[a_len]
" echo "a_last = " . a_last
if( a_last >= high_num )
"
" For unknown reasons a_last is never higher than high_num
"
" echo "a_last = " . a_last
let high_num = str2nr( a_last, 10 )
" echo "High_num = " . high_num
else
" echo "a_last = " . a_last
let high_num = str2nr( a_last, 10 )
" echo "High_num = " . high_num
endif
" echo "L = " . l
let l += 1
endwhile
endif
"
" Make a new filename (ie: full file name PLUS .(high_num+1)
" In other words - make a new filename with the backup number one
" higher than the highest backup number. Example A.BOB;00001
"
" echo "High_num = " . high_num
let high_num = high_num + 1
" echo "High_num = " . high_num
let ext = printf("%05d", high_num )
" echo "High_num = " . high_num
" echo "ext = " . ext
let new_path = expand("%:p") . ";" . ext
"
" Now save the file to the new file name we just made.
"
" echo "new_path = " . new_path
let cmd = 'copy "' . path_name . '" "' . new_path . '"'
let output = systemlist( cmd )
" echo "CMD = " . cmd
" echo "Output = "
" echo output
"
" Now get rid of any extra backup files we might have. MAX_BACKUPS is set here.
"
let max_backups = 3
"
" Now do the above again to get all of the backup files
"
let cmd ='dir /b/on "' . path_name . ';*"'
let x=systemlist(cmd)
" let x=split(x[0],"\n")
let ary_len = len(x)
" echo "CMD = " . cmd
" echo "X = "
" echo x
"
" If the ary_len is greater than max_backups - get rid of
" the lowest numbers because those are the oldest.
"
if( ary_len > max_backups )
let l=0
let ary_len = ary_len - max_backups
if( ary_len > 0 )
while( l < ary_len )
let a=split(x[l],";")
" echo "A = "
" echo a
let a_len = len(a) - 1
let ext = a[a_len]
let file_name = expand("%:p") . ";" . ext
let cmd = 'del "' . file_name . '"'
let output = systemlist( cmd )
" echo "CMD = " . cmd
" echo "Output = "
" echo output
" echo "L = " . l
let l += 1
endwhile
endif
endif
finish
" @(#) $Id: decvers.vim,v 0.1 Mark Manning
"
" Notes: Please note that I am using five zeros as the size of the
" backup file names. So we have 00000 and then 00001, 00002, etc...
"
let path_name=expand("%:p")
let file_name=expand("%:t")
"
" Now see about getting all of the iterations of the current file
"
let cmd ='dir /b/on "' . path_name . ';*"'
let x=systemlist(cmd)
" let x=split(x[0],"\n")
let ary_len=len(x)
" echo "CMD = " . cmd
" echo "X = "
" echo x
"
" Now get the highest number of the iterations
"
let l=0
let high_num=0
if( ary_len > 0 )
while( l < ary_len )
let a=split(x[l],";")
" echo "A = "
" echo a
let a_len = len(a) - 1
let a_last = a[a_len]
" echo "a_last = " . a_last
if( a_last >= high_num )
"
" For unknown reasons a_last is never higher than high_num
"
" echo "a_last = " . a_last
let high_num = str2nr( a_last, 10 )
" echo "High_num = " . high_num
else
" echo "a_last = " . a_last
let high_num = str2nr( a_last, 10 )
" echo "High_num = " . high_num
endif
" echo "L = " . l
let l += 1
endwhile
endif
"
" Make a new filename (ie: full file name PLUS .(high_num+1)
" In other words - make a new filename with the backup number one
" higher than the highest backup number. Example A.BOB;00001
"
" echo "High_num = " . high_num
let high_num = high_num + 1
" echo "High_num = " . high_num
let ext = printf("%05d", high_num )
" echo "High_num = " . high_num
" echo "ext = " . ext
let new_path = expand("%:p") . ";" . ext
"
" Now save the file to the new file name we just made.
"
" echo "new_path = " . new_path
let cmd = 'copy "' . path_name . '" "' . new_path . '"'
let output = systemlist( cmd )
" echo "CMD = " . cmd
" echo "Output = "
" echo output
"
" Now get rid of any extra backup files we might have. MAX_BACKUPS is set here.
"
let max_backups = 3
"
" Now do the above again to get all of the backup files
"
let cmd ='dir /b/on "' . path_name . ';*"'
let x=systemlist(cmd)
" let x=split(x[0],"\n")
let ary_len = len(x)
" echo "CMD = " . cmd
" echo "X = "
" echo x
"
" If the ary_len is greater than max_backups - get rid of
" the lowest numbers because those are the oldest.
"
if( ary_len > max_backups )
let l=0
let ary_len = ary_len - max_backups
if( ary_len > 0 )
while( l < ary_len )
let a=split(x[l],";")
" echo "A = "
" echo a
let a_len = len(a) - 1
let ext = a[a_len]
let file_name = expand("%:p") . ";" . ext
let cmd = 'del "' . file_name . '"'
let output = systemlist( cmd )
" echo "CMD = " . cmd
" echo "Output = "
" echo output
" echo "L = " . l
let l += 1
endwhile
endif
endif
finish
End of Script
Have fun with it!
-- --
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/b8b1a020-dbcd-48bd-9350-348eb66b068an%40googlegroups.com.
Re: Q&A: MSDOS SET command gave me some of my mapped commands
Please do not top poste.
On Mi, 31 Dez 2025, Mark Manning wrote:
> One last message. Plus zero did not work. Yes, it is acting as if it
> were octal. Vim should not really do that as sometimes people do put
> zeros in front of the number. (At least, this old fogey remembers when
> people used to do that all of the time.)
I am afraid that ship has sailed long ago.
> Here is what works:
>
> str2nr( $value, $type )
>
> So I used str2nr( $ext, 10 )
>
> And that forced it to keep the number as 10. Just thinking aloud here
> but it would be nice to have 0b for binary, 0c for octal, 0x for
> hexadecimal, and 0d for decimal. But I guess no one wants to do that.
> :-)
:h expr-number
Thanks,
Christian
--
Ingrate, n.:
A man who bites the hand that feeds him, and then complains of
indigestion.
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVaKtE78zPujCmAi%40256bit.org.
On Mi, 31 Dez 2025, Mark Manning wrote:
> One last message. Plus zero did not work. Yes, it is acting as if it
> were octal. Vim should not really do that as sometimes people do put
> zeros in front of the number. (At least, this old fogey remembers when
> people used to do that all of the time.)
I am afraid that ship has sailed long ago.
> Here is what works:
>
> str2nr( $value, $type )
>
> So I used str2nr( $ext, 10 )
>
> And that forced it to keep the number as 10. Just thinking aloud here
> but it would be nice to have 0b for binary, 0c for octal, 0x for
> hexadecimal, and 0d for decimal. But I guess no one wants to do that.
> :-)
:h expr-number
Thanks,
Christian
--
Ingrate, n.:
A man who bites the hand that feeds him, and then complains of
indigestion.
--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aVaKtE78zPujCmAi%40256bit.org.
Subscribe to:
Comments (Atom)