|
Thursday, February 27, 2020
Learn more about our updated Terms of Service
Tuesday, February 25, 2020
Vim charity financial results
Hello Vim users,
Vim is open source and you can use it for free. But you are encouraged
to make a donation for needy children in Uganda. The ICCF Holland
foundation collects the money and sends it to the project in Kibaale.
Last year had a nice increase in donations. The revenue went up by
about 12 percent, compared to 2018. That means we can help 12% more
children! I'm also happy that we managed to keep the cost at the same
level: only 0.5% of the donations goes into costs, 99.5% goes to Uganda.
You can find the financial report here:
https://www.iccf.nl/jaarrekening2019en.pdf
And the Dutch version: https://www.iccf.nl/jaarrekening2019nl.pdf
A big thanks to all who helped!
--
"A clear conscience is usually the sign of a bad memory."
-- Steven Wright
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/202002252124.01PLOrYm019368%40masaka.moolenaar.net.
Vim is open source and you can use it for free. But you are encouraged
to make a donation for needy children in Uganda. The ICCF Holland
foundation collects the money and sends it to the project in Kibaale.
Last year had a nice increase in donations. The revenue went up by
about 12 percent, compared to 2018. That means we can help 12% more
children! I'm also happy that we managed to keep the cost at the same
level: only 0.5% of the donations goes into costs, 99.5% goes to Uganda.
You can find the financial report here:
https://www.iccf.nl/jaarrekening2019en.pdf
And the Dutch version: https://www.iccf.nl/jaarrekening2019nl.pdf
A big thanks to all who helped!
--
"A clear conscience is usually the sign of a bad memory."
-- Steven Wright
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/202002252124.01PLOrYm019368%40masaka.moolenaar.net.
Friday, February 21, 2020
Re: Error detected on BufWritePost Autocommands for "*.vim" : drive not recognized with expand('%:p')
A change dir command has been made before BufWritePost..
Le vendredi 21 février 2020 09:46:47 UTC+1, Ni Va a écrit :
-- How to make expand('%:p') of a file not impacted by a :cd change dir command ?
Le vendredi 21 février 2020 09:46:47 UTC+1, Ni Va a écrit :
Hi,Using gvim 8.2.292 on windows, following error appears while I am saving a vim file.It seems to mistake good drive. C: out of D:expand('%:p') returns bad drive.Error detected while processing BufWritePost Autocommands for "*.vim":
E484: Can't open file c:\logiciels\Vim\vimfiles\plugged\foo-bar\autoload\ foobar.vim
autocmd! BufWritePost *.vim exe 'source '.expand('%:p')
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/8b365698-7fcd-46ab-8a8a-9bd090fe73df%40googlegroups.com.
Error detected on BufWritePost Autocommands for "*.vim" : drive not recognized with expand('%:p')
Hi,
-- Using gvim 8.2.292 on windows, following error appears while I am saving a vim file.
It seems to mistake good drive. C: out of D:
expand('%:p') returns bad drive.
Error detected while processing BufWritePost Autocommands for "*.vim":
E484: Can't open file c:\logiciels\Vim\vimfiles\plugged\foo-bar\autoload\foobar.vim
autocmd! BufWritePost *.vim exe 'source '.expand('%:p')
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/24c42b2b-b01d-4b57-870a-4eb1233f73e0%40googlegroups.com.
Monday, February 17, 2020
How to test if an escape sequence is currently mapped
Thanks to everyone who offered very helpful suggestion regarding my previous question on the best way to conditionally map function keys using autocmd BufReadPre, when editing particular files.
I wanted to unmap the keys upon exiting the file and have done that also using aucocmd BufLeave. However, I found that an attempt to unmap a key sequence that isn't currently mapped results in an error. If there a way to perform a test to see if a particular key or escape sequence is mapped, and only then unmap it? Something like:
:if ismapped <Esc>[1;3S
: nunmap <Esc>[1;3S
: iunmap <Esc>[1;3S
:endif
If I can do this, then I can write a single universal function that handles all conditions.
And if there is some sort of test, is it generic to all mappings or particular to the mode such as imap, nmap, etc?
Thanks!
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/b5d3ae51-4e62-45f6-8c65-064f950b94c2%40googlegroups.com.
Null pointer in a string ^@ popup
Solved: lines->split('\n')
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/bbdb218b-1e0c-42d5-85ca-8fa1640aa354%40googlegroups.com.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/bbdb218b-1e0c-42d5-85ca-8fa1640aa354%40googlegroups.com.
Null pointer in a string ^@ popup
I am trying to show a string with null pointers in a popup, I know if you write it to a buffer first with put or if if I echo the string the new lines(null pointers) are shown properly. Is there a way to show the text formatted correctly without writing it to a buffer first?
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/e3c6bb5a-882e-4a15-a971-0036295fc4c0%40googlegroups.com.
Null pointer in a string ^@ popup
I am trying to show a string with null pointers in a popup, I know if you write it to a buffer first with put or if if I echo the string the new lines(null pointers) are shown properly. Is there a way to show the text formatted correctly without writing it to a buffer first?
let winid = popup_create(lines, #{
\ filter: function('s:popup_filter'),
\ pos: 'botleft',
\ line: 'cursor-1',
\ col: 'cursor',
\ moved: 'WORD',
\ firstline: 1,
\ scrollbar: 1,
\ close: 'button',
\ minwidth: 70,
\ maxwidth: 70,
\ minheight: 20,
\ maxheight: 20,
\ mapping: 0,
\ })
\ filter: function('s:popup_filter'),
\ pos: 'botleft',
\ line: 'cursor-1',
\ col: 'cursor',
\ moved: 'WORD',
\ firstline: 1,
\ scrollbar: 1,
\ close: 'button',
\ minwidth: 70,
\ maxwidth: 70,
\ minheight: 20,
\ maxheight: 20,
\ mapping: 0,
\ })
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/f91dae8c-7bb3-4de3-9ae9-d1711570b992%40googlegroups.com.
Sunday, February 16, 2020
Re: Pressing Enter removes indentation
On Mon, Feb 17, 2020 at 5:06 AM Steven Penny <svnpenn@gmail.com> wrote:
>
> If I have a file "a.js" like this:
>
> let a1 = [
> ];
>
> and I press Enter at the end of the first line, a Tab is inserted. I do not
> want this. I added setting "filetype indent off", but then if I have this:
>
> let a1 = [
> 10,
> 20
> ];
>
> I have to manually add tabs for each item. So I added another setting
> "set autoindent". These two settings solve the existing problems, but introduce
> a new problem. If I move the cursor to the start of one of the indented lines,
> and press Enter, the indentation is removed.
>
> Another option is to use "set smartindent", and redo the second example.
> However after I press Enter, if I then press Up or Down, the indentation is
> removed, repeating the problem. Can I change a setting to resolve this issue?
Hm, this sounds like wanting to have your cake and eating it, but maybe not.
If you can describe to yourself exactly what you want when, then maybe
you can write the appropriate :setlocal statement for the appropriate
indent options in ~/vimfiles/after/indent/javascript.vim (for Windows)
or in ~/.vim/after/indent/javascript.vim (for Unix-like systems
including Linux and Mac OSX), overriding what is set by defaut when
you have :filetype plugin indent on. The defaut settings are set in
the script $VIMRUNTIME/indent/javascript.vim, which you should not
modify because any change you make in that script can be silently
unmade by any later update of Vim. But you can override all or part of
it by means of an "after" script in your own user space, as described
above.
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtU3Ke2W%3DniGmgVcokgcLEtbKBXsE8j80-hRH0AkC5QEw%40mail.gmail.com.
>
> If I have a file "a.js" like this:
>
> let a1 = [
> ];
>
> and I press Enter at the end of the first line, a Tab is inserted. I do not
> want this. I added setting "filetype indent off", but then if I have this:
>
> let a1 = [
> 10,
> 20
> ];
>
> I have to manually add tabs for each item. So I added another setting
> "set autoindent". These two settings solve the existing problems, but introduce
> a new problem. If I move the cursor to the start of one of the indented lines,
> and press Enter, the indentation is removed.
>
> Another option is to use "set smartindent", and redo the second example.
> However after I press Enter, if I then press Up or Down, the indentation is
> removed, repeating the problem. Can I change a setting to resolve this issue?
Hm, this sounds like wanting to have your cake and eating it, but maybe not.
If you can describe to yourself exactly what you want when, then maybe
you can write the appropriate :setlocal statement for the appropriate
indent options in ~/vimfiles/after/indent/javascript.vim (for Windows)
or in ~/.vim/after/indent/javascript.vim (for Unix-like systems
including Linux and Mac OSX), overriding what is set by defaut when
you have :filetype plugin indent on. The defaut settings are set in
the script $VIMRUNTIME/indent/javascript.vim, which you should not
modify because any change you make in that script can be silently
unmade by any later update of Vim. But you can override all or part of
it by means of an "after" script in your own user space, as described
above.
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtU3Ke2W%3DniGmgVcokgcLEtbKBXsE8j80-hRH0AkC5QEw%40mail.gmail.com.
Pressing Enter removes indentation
If I have a file "a.js" like this:
let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
-- let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/12e08548-5082-4f92-820a-8553ca031528%40googlegroups.com.
Pressing Enter removes indentation
If I have a file "a.js" like this:
let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/5e49fce5.1c69fb81.70ff3.cf02%40mx.google.com.
let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/5e49fce5.1c69fb81.70ff3.cf02%40mx.google.com.
Pressing Enter removes indentation
If I have a file "a.js" like this:
let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/5e49fc0e.1c69fb81.f1d79.d06c%40mx.google.com.
let a1 = [
];
and I press Enter at the end of the first line, a Tab is inserted. I do not
want this. I added setting "filetype indent off", but then if I have this:
let a1 = [
10,
20
];
I have to manually add tabs for each item. So I added another setting
"set autoindent". These two settings solve the existing problems, but introduce
a new problem. If I move the cursor to the start of one of the indented lines,
and press Enter, the indentation is removed.
Another option is to use "set smartindent", and redo the second example.
However after I press Enter, if I then press Up or Down, the indentation is
removed, repeating the problem. Can I change a setting to resolve this issue?
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/5e49fc0e.1c69fb81.f1d79.d06c%40mx.google.com.
Saturday, February 15, 2020
Re: Retrive old inserts
Alessandro Falcione wrote:
> I wrote something in a file and then accidentally removed the file, is
> there any possibility to retrive what I've inserted in that file?
Check for any backup file (ending in ~), in the directory of the ile or
'backupdir'.
Check for an undo file, ending in .un~.
--
hundred-and-one symptoms of being an internet addict:
87. Everyone you know asks why your phone line is always busy ...and
you tell them to send an e-mail.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/202002152208.01FM8MMe020415%40masaka.moolenaar.net.
> I wrote something in a file and then accidentally removed the file, is
> there any possibility to retrive what I've inserted in that file?
Check for any backup file (ending in ~), in the directory of the ile or
'backupdir'.
Check for an undo file, ending in .un~.
--
hundred-and-one symptoms of being an internet addict:
87. Everyone you know asks why your phone line is always busy ...and
you tell them to send an e-mail.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/202002152208.01FM8MMe020415%40masaka.moolenaar.net.
Re: Retrive old inserts
does your .vimrc file include:
On Saturday, February 15, 2020 at 10:19:29 AM UTC-5, Alessandro Falcione wrote:
-- set backup
and possibly
set backupdir=SOMEPATH
?
If so, your chances are good.
If so, your chances are good.
On Saturday, February 15, 2020 at 10:19:29 AM UTC-5, Alessandro Falcione wrote:
I wrote something in a file and then accidentally removed the file, is there any possibility to retrive what I've inserted in that file?
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/da15ede2-32c1-4b86-b37d-ba6ff9f10f04%40googlegroups.com.
Retrive past inserts
I inserted an address in a file and then accidentally deleted the file, is there any chance to retrieve an history of all the old vi inserts?
-- --
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 on the web visit https://groups.google.com/d/msgid/vim_use/04300388-e2b3-43f5-af51-dc7232513d23%40googlegroups.com.
Retrive old inserts
I wrote something in a file and then accidentally removed the file, is there any possibility to retrive what I've inserted in that file?
-- --
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 on the web visit https://groups.google.com/d/msgid/vim_use/8ef2c2cb-beff-4abc-a488-535e4fb33753%40googlegroups.com.
Friday, February 14, 2020
Re: nested expr in a mapping
On 2020-02-14, M Kelly wrote:
> Hi,
>
> ok, thank you.
> I always thought there had to be quotes around each block, as in () ? 'foo' :
> 'bar'
> So I was trying \' and \\' and \" and \\" and extra quotes for each additional
> nested block to no success.
> I will remove all quotes and see if I can get it to work.
The quotes are necessary if the expression evaluates to a string and
each of the alternatives is a literal string.
Here are some simple examples.
:let x = 1
:echo x == 1 ? 73 : 88
73
:echo x == 0 ? "hello" : "goodbye"
goodbye
In the first example, the expression evaluates to a number, while in
the second example the expression evaluates to a string.
Here's an example of nesting.
:let x = 2
:echo x == 1 ? "one" : x == 2 ? "two" : "something else"
two
I deliberately didn't use any parentheses to show that they're often
not necessary, although they can make expressions more clear.
If you can't get it to work, post what you've tried here and we'll
figure it out.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200215071733.GD9366%40phoenix.
> Hi,
>
> ok, thank you.
> I always thought there had to be quotes around each block, as in () ? 'foo' :
> 'bar'
> So I was trying \' and \\' and \" and \\" and extra quotes for each additional
> nested block to no success.
> I will remove all quotes and see if I can get it to work.
The quotes are necessary if the expression evaluates to a string and
each of the alternatives is a literal string.
Here are some simple examples.
:let x = 1
:echo x == 1 ? 73 : 88
73
:echo x == 0 ? "hello" : "goodbye"
goodbye
In the first example, the expression evaluates to a number, while in
the second example the expression evaluates to a string.
Here's an example of nesting.
:let x = 2
:echo x == 1 ? "one" : x == 2 ? "two" : "something else"
two
I deliberately didn't use any parentheses to show that they're often
not necessary, although they can make expressions more clear.
If you can't get it to work, post what you've tried here and we'll
figure it out.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200215071733.GD9366%40phoenix.
Re: nested expr in a mapping
Hi,
-- ok, thank you.
I always thought there had to be quotes around each block, as in () ? 'foo' : 'bar'
So I was trying \' and \\' and \" and \\" and extra quotes for each additional nested block to no success.
I will remove all quotes and see if I can get it to work.
take care,
-m
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/16fe93d4-4447-457a-a9f0-1fd0a856745d%40googlegroups.com.
Thursday, February 13, 2020
Re: nested expr in a mapping
On 2020-02-13, M Kelly wrote:
> Hi,
>
> Is it posible to nest conditionals in a mapping, something like, just for
> demonstration:
>
> vnoremap <expr> vv (strlen(@y) == 1) ? ':let ...' : '("vcl" =~ getregtype("*"))
> ? 'some foo' : 'some bar' ' <bar> some more ...
>
> Can we do this ?
Yes. See
:help 41.3
:help expr1
:help :map-<expr>
:help matchup.txt " lines 896-900 for some examples
> Do I use ''' (3 single quotes) to embed quotes ? (and then 5
> for a 2nd level embed ...) ... ?
No. Expressions are not nested using quotes. You may use
parentheses if you wish, or just use the precedence rules.
It would be easier to help you if we knew what you had tried, the
actual results, and what you expected.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200214042128.GC9366%40phoenix.
> Hi,
>
> Is it posible to nest conditionals in a mapping, something like, just for
> demonstration:
>
> vnoremap <expr> vv (strlen(@y) == 1) ? ':let ...' : '("vcl" =~ getregtype("*"))
> ? 'some foo' : 'some bar' ' <bar> some more ...
>
> Can we do this ?
Yes. See
:help 41.3
:help expr1
:help :map-<expr>
:help matchup.txt " lines 896-900 for some examples
> Do I use ''' (3 single quotes) to embed quotes ? (and then 5
> for a 2nd level embed ...) ... ?
No. Expressions are not nested using quotes. You may use
parentheses if you wish, or just use the precedence rules.
It would be easier to help you if we knew what you had tried, the
actual results, and what you expected.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200214042128.GC9366%40phoenix.
Re: nested expr in a mapping
Hi,
-- I suppose I can call a function to do this :-)
-m
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/fc4865e6-2357-4a8c-ae7c-c5fe7796b27a%40googlegroups.com.
nested expr in a mapping
Hi,
-- Is it posible to nest conditionals in a mapping, something like, just for demonstration:
vnoremap <expr> vv (strlen(@y) == 1) ? ':let ...' : '("vcl" =~ getregtype("*")) ? 'some foo' : 'some bar' ' <bar> some more ...
Can we do this ? Do I use ''' (3 single quotes) to embed quotes ? (and then 5 for a 2nd level embed ...) ... ?
thx as always,
-m
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/da6436ec-0159-4364-8ab0-90e9b075764d%40googlegroups.com.
Re: Is "vim -C" supposed to override .vimrc?
On Thu, 13 Feb 2020 at 17:00, Gary Johnson <garyjohn@spocom.com> wrote:
>
> On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> > Hi,
> >
> > this is a snippet or my vimrc:
> >
> > $ cat .vim/vimrc
> > source $VIMRUNTIME/defaults.vim
> > set dir=~/.vim/tmp
> > set expandtab
> > set autoindent
> > iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
> > digraph bl 8226 " Insert Bullet with <CTRL>+k bl
> > map <f5> :1m$<cr>
> >
> > which sources the default vim system file, which in turn sets
> > "nocompatible", as expected. So far. so good.
> >
> > If I start vim with:
> > $ vim -C somefile
> >
> > I expect this to turn some features off, for example visual mode with
> > mouse clicks, but it doesn't. If I manually set "compatible" from the
> > ex command line, it does turn visual mode off. I assume I could put
> > this is my vimrc, but I don't want to do this all the time. I could
> > probably make an alias to:
> >
> > vim -c "set compatible" somefile
> >
> > However I wonder if this is intended behaviour or not, that is, I
> > expected "vim -C" to override vimrc.
>
> From ":help -C":
>
> -C Compatible mode. Sets the 'compatible' option. You can use
> this to get 'compatible', even though a .vimrc file exists.
> Keep in mind that the command ":set nocompatible" in some
> plugin or startup script overrules this, so you may end up
> with 'nocompatible' anyway.
Thanks. I was looking at the wrong section of the help file.
(For posterity, setting "mouse=r" did what I meant to do).
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHz1%2BhFhdh9UKqtL%3DPG6O7jd9Vh_zrvvvn5cLq7T-uzBHg%40mail.gmail.com.
>
> On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> > Hi,
> >
> > this is a snippet or my vimrc:
> >
> > $ cat .vim/vimrc
> > source $VIMRUNTIME/defaults.vim
> > set dir=~/.vim/tmp
> > set expandtab
> > set autoindent
> > iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
> > digraph bl 8226 " Insert Bullet with <CTRL>+k bl
> > map <f5> :1m$<cr>
> >
> > which sources the default vim system file, which in turn sets
> > "nocompatible", as expected. So far. so good.
> >
> > If I start vim with:
> > $ vim -C somefile
> >
> > I expect this to turn some features off, for example visual mode with
> > mouse clicks, but it doesn't. If I manually set "compatible" from the
> > ex command line, it does turn visual mode off. I assume I could put
> > this is my vimrc, but I don't want to do this all the time. I could
> > probably make an alias to:
> >
> > vim -c "set compatible" somefile
> >
> > However I wonder if this is intended behaviour or not, that is, I
> > expected "vim -C" to override vimrc.
>
> From ":help -C":
>
> -C Compatible mode. Sets the 'compatible' option. You can use
> this to get 'compatible', even though a .vimrc file exists.
> Keep in mind that the command ":set nocompatible" in some
> plugin or startup script overrules this, so you may end up
> with 'nocompatible' anyway.
Thanks. I was looking at the wrong section of the help file.
(For posterity, setting "mouse=r" did what I meant to do).
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHz1%2BhFhdh9UKqtL%3DPG6O7jd9Vh_zrvvvn5cLq7T-uzBHg%40mail.gmail.com.
Re: Is "vim -C" supposed to override .vimrc?
On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> Hi,
>
> this is a snippet or my vimrc:
>
> $ cat .vim/vimrc
> source $VIMRUNTIME/defaults.vim
> set dir=~/.vim/tmp
> set expandtab
> set autoindent
> iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
> digraph bl 8226 " Insert Bullet with <CTRL>+k bl
> map <f5> :1m$<cr>
>
> which sources the default vim system file, which in turn sets
> "nocompatible", as expected. So far. so good.
>
> If I start vim with:
> $ vim -C somefile
>
> I expect this to turn some features off, for example visual mode with
> mouse clicks, but it doesn't. If I manually set "compatible" from the
> ex command line, it does turn visual mode off. I assume I could put
> this is my vimrc, but I don't want to do this all the time. I could
> probably make an alias to:
>
> vim -c "set compatible" somefile
>
> However I wonder if this is intended behaviour or not, that is, I
> expected "vim -C" to override vimrc.
From ":help -C":
-C Compatible mode. Sets the 'compatible' option. You can use
this to get 'compatible', even though a .vimrc file exists.
Keep in mind that the command ":set nocompatible" in some
plugin or startup script overrules this, so you may end up
with 'nocompatible' anyway.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200213170019.GB9366%40phoenix.
> Hi,
>
> this is a snippet or my vimrc:
>
> $ cat .vim/vimrc
> source $VIMRUNTIME/defaults.vim
> set dir=~/.vim/tmp
> set expandtab
> set autoindent
> iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
> digraph bl 8226 " Insert Bullet with <CTRL>+k bl
> map <f5> :1m$<cr>
>
> which sources the default vim system file, which in turn sets
> "nocompatible", as expected. So far. so good.
>
> If I start vim with:
> $ vim -C somefile
>
> I expect this to turn some features off, for example visual mode with
> mouse clicks, but it doesn't. If I manually set "compatible" from the
> ex command line, it does turn visual mode off. I assume I could put
> this is my vimrc, but I don't want to do this all the time. I could
> probably make an alias to:
>
> vim -c "set compatible" somefile
>
> However I wonder if this is intended behaviour or not, that is, I
> expected "vim -C" to override vimrc.
From ":help -C":
-C Compatible mode. Sets the 'compatible' option. You can use
this to get 'compatible', even though a .vimrc file exists.
Keep in mind that the command ":set nocompatible" in some
plugin or startup script overrules this, so you may end up
with 'nocompatible' anyway.
Regards,
Gary
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200213170019.GB9366%40phoenix.
Is "vim -C" supposed to override .vimrc?
Hi,
this is a snippet or my vimrc:
$ cat .vim/vimrc
source $VIMRUNTIME/defaults.vim
set dir=~/.vim/tmp
set expandtab
set autoindent
iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
digraph bl 8226 " Insert Bullet with <CTRL>+k bl
map <f5> :1m$<cr>
which sources the default vim system file, which in turn sets
"nocompatible", as expected. So far. so good.
If I start vim with:
$ vim -C somefile
I expect this to turn some features off, for example visual mode with
mouse clicks, but it doesn't. If I manually set "compatible" from the
ex command line, it does turn visual mode off. I assume I could put
this is my vimrc, but I don't want to do this all the time. I could
probably make an alias to:
vim -c "set compatible" somefile
However I wonder if this is intended behaviour or not, that is, I
expected "vim -C" to override vimrc.
My settings:
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 13 2019 20:46:00)
Included patches: 1-2200
Modified by morr@NetBSD.org
Compiled by oc@e130
Huge version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
-browse +gettext +num64 +textprop
-builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand -perl -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall -python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap -ruby +wildmenu
+cursorbind -lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname -sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic +mouse_dec +statusline -xsmp
+emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "/usr/pkg/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/pkg/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include
-I/usr/pkg/include/ncurses -O2 -I/usr/include
-I/usr/pkg/include/ncurses -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: cc -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/local/lib
-Wl,--as-needed -o vim -lm -lnsl -lncurses -liconv -ldl
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHy%2BFp%3DNSaduUSBJp8HHmnMj5qVaDX0s5xeFAQ9%3DpMEqXQ%40mail.gmail.com.
this is a snippet or my vimrc:
$ cat .vim/vimrc
source $VIMRUNTIME/defaults.vim
set dir=~/.vim/tmp
set expandtab
set autoindent
iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
digraph bl 8226 " Insert Bullet with <CTRL>+k bl
map <f5> :1m$<cr>
which sources the default vim system file, which in turn sets
"nocompatible", as expected. So far. so good.
If I start vim with:
$ vim -C somefile
I expect this to turn some features off, for example visual mode with
mouse clicks, but it doesn't. If I manually set "compatible" from the
ex command line, it does turn visual mode off. I assume I could put
this is my vimrc, but I don't want to do this all the time. I could
probably make an alias to:
vim -c "set compatible" somefile
However I wonder if this is intended behaviour or not, that is, I
expected "vim -C" to override vimrc.
My settings:
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 13 2019 20:46:00)
Included patches: 1-2200
Modified by morr@NetBSD.org
Compiled by oc@e130
Huge version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
-browse +gettext +num64 +textprop
-builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand -perl -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall -python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap -ruby +wildmenu
+cursorbind -lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname -sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic +mouse_dec +statusline -xsmp
+emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "/usr/pkg/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/pkg/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include
-I/usr/pkg/include/ncurses -O2 -I/usr/include
-I/usr/pkg/include/ncurses -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: cc -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/local/lib
-Wl,--as-needed -o vim -lm -lnsl -lncurses -liconv -ldl
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHy%2BFp%3DNSaduUSBJp8HHmnMj5qVaDX0s5xeFAQ9%3DpMEqXQ%40mail.gmail.com.
Tuesday, February 11, 2020
Re: Applying Settings in vimrc Or gvimrc Based on v:servername
On Tue, Feb 11, 2020 at 7:36 PM <johanns@nacs.net> wrote:
>
> While working on a Windows machine, I found that I could
> selectively load settings or plugins based on the Vim
> servername by do a regular expression check against the
> v:servername variable right in vimrc.
>
> Example:
> if v:servername =~ '^\cHPWORK\d*'
> ru HP/HPSpecificPlugin.vim
> endif
>
> I had been relying on this featured when sharing a vimrc
> file for XWindows under Linux. What I found is that this
> technique does not seem to work. I traced in the Vim
> source code and it seems like v:servername is set fairly
> late in start up process for Vim after the script files
> have been run. Thus when vimrc is executed v:servername
> is blank and all these v:servername checks are false.
>
> Is there a place in the startup process or a sensable
> technique under XWindows to trigger loading something
> globally based on the v:servername value? I am using this
> technique as an alternative to an auto command that
> assumes a particular filename or file extension.
Try placing the check in an autocommand for the VimEnter event, which
is triggered at the very end of startup. The autocommand can be
defined in your vimrc.
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsx9ofmgJDsD6RRv-pGDy3H7hK53QxZa1_Rz16Yjxmfww%40mail.gmail.com.
>
> While working on a Windows machine, I found that I could
> selectively load settings or plugins based on the Vim
> servername by do a regular expression check against the
> v:servername variable right in vimrc.
>
> Example:
> if v:servername =~ '^\cHPWORK\d*'
> ru HP/HPSpecificPlugin.vim
> endif
>
> I had been relying on this featured when sharing a vimrc
> file for XWindows under Linux. What I found is that this
> technique does not seem to work. I traced in the Vim
> source code and it seems like v:servername is set fairly
> late in start up process for Vim after the script files
> have been run. Thus when vimrc is executed v:servername
> is blank and all these v:servername checks are false.
>
> Is there a place in the startup process or a sensable
> technique under XWindows to trigger loading something
> globally based on the v:servername value? I am using this
> technique as an alternative to an auto command that
> assumes a particular filename or file extension.
Try placing the check in an autocommand for the VimEnter event, which
is triggered at the very end of startup. The autocommand can be
defined in your vimrc.
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsx9ofmgJDsD6RRv-pGDy3H7hK53QxZa1_Rz16Yjxmfww%40mail.gmail.com.
Applying Settings in vimrc Or gvimrc Based on v:servername
While working on a Windows machine, I found that I could
selectively load settings or plugins based on the Vim
servername by do a regular expression check against the
v:servername variable right in vimrc.
Example:
if v:servername =~ '^\cHPWORK\d*'
ru HP/HPSpecificPlugin.vim
endif
I had been relying on this featured when sharing a vimrc
file for XWindows under Linux. What I found is that this
technique does not seem to work. I traced in the Vim
source code and it seems like v:servername is set fairly
late in start up process for Vim after the script files
have been run. Thus when vimrc is executed v:servername
is blank and all these v:servername checks are false.
Is there a place in the startup process or a sensable
technique under XWindows to trigger loading something
globally based on the v:servername value? I am using this
technique as an alternative to an auto command that
assumes a particular filename or file extension.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200211135416.GB4961%40linux.site.
selectively load settings or plugins based on the Vim
servername by do a regular expression check against the
v:servername variable right in vimrc.
Example:
if v:servername =~ '^\cHPWORK\d*'
ru HP/HPSpecificPlugin.vim
endif
I had been relying on this featured when sharing a vimrc
file for XWindows under Linux. What I found is that this
technique does not seem to work. I traced in the Vim
source code and it seems like v:servername is set fairly
late in start up process for Vim after the script files
have been run. Thus when vimrc is executed v:servername
is blank and all these v:servername checks are false.
Is there a place in the startup process or a sensable
technique under XWindows to trigger loading something
globally based on the v:servername value? I am using this
technique as an alternative to an auto command that
assumes a particular filename or file extension.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200211135416.GB4961%40linux.site.
Friday, February 7, 2020
Re: Triplicate text after mix-matching vim and nvi
On Tue, 4 Feb 2020 at 09:03, Ottavio Caruso
<ottavio2006-usenet2012@yahoo.com> wrote:
>
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
For the record, the culprit is nvi (and mate-terminal).
When mate-terminal crashes (and this should not happen) obviously also
nvi crashes. For some reason, nvi creates multiple recovery files in
/tmp (and this shouldn't happen either).
So, for the time being, I have abandoned my educational purposes and
will stick with vim.
Thanks for making a great editor.
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHywJ-oDxqQ%3DwrC0ifqtiQ0AC_XheS69Gq%3DgLbHsJOFGAw%40mail.gmail.com.
<ottavio2006-usenet2012@yahoo.com> wrote:
>
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
For the record, the culprit is nvi (and mate-terminal).
When mate-terminal crashes (and this should not happen) obviously also
nvi crashes. For some reason, nvi creates multiple recovery files in
/tmp (and this shouldn't happen either).
So, for the time being, I have abandoned my educational purposes and
will stick with vim.
Thanks for making a great editor.
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHywJ-oDxqQ%3DwrC0ifqtiQ0AC_XheS69Gq%3DgLbHsJOFGAw%40mail.gmail.com.
Thursday, February 6, 2020
Re: join() a list with a newline char for an echo
> I agree that works - but my list is from a ch_read() and has ^@ (NL) at the end of each element
and I just cannot seem to get this work. The join("\n") just puts the ^@ back everywhere.
I don't know what you've got there. Presumably, you are familiar with the way vim handles NUL
characters (they are stored in memory as newlines, 0x0a, and show as ^@).
Have you tried chopping off the ends of the elements? Say,
:let my_list = ["alice", "bob", "carol"]
:call map(my_list, {k,v -> v[0:-2]})
:echo my_list
['alic', 'bo', 'caro']
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/2a046725-c7f3-4d9d-b571-0cd9242984ae%40googlegroups.com.
Re: join() a list with a newline char for an echo
Hi,
-- I agree that works - but my list is from a ch_read() and has ^@ (NL) at the end of each element
and I just cannot seem to get this work. The join("\n") just puts the ^@ back everywhere.
thx tho,
-m
On Thursday, February 6, 2020 at 6:35:57 PM UTC-5, John Little wrote:
On Thursday, February 6, 2020 at 6:35:57 PM UTC-5, John Little wrote:
On Friday, February 7, 2020 at 7:53:02 AM UTC+13, M Kelly wrote:
> I have tried join( mylist, "\n") but it uses ^@ and "\r" uses ^Mworks fine for me, vim, gvim, and vim --clean.:let l = ["one", "two", "three"]:echo join(l, "\n")onetwothreePress ENTER or type command to continueMaybe you're on MS Windows? Used single quotes? Have some settings causing trouble? (try with vim --clean).HTH, John Little
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/b5908d0a-4191-4347-a55c-b95266e78945%40googlegroups.com.
Re: join() a list with a newline char for an echo
On Friday, February 7, 2020 at 7:53:02 AM UTC+13, M Kelly wrote:
> I have tried join( mylist, "\n") but it uses ^@ and "\r" uses ^M
-- > I have tried join( mylist, "\n") but it uses ^@ and "\r" uses ^M
works fine for me, vim, gvim, and vim --clean.
:let l = ["one", "two", "three"]
:echo join(l, "\n")
one
two
three
Press ENTER or type command to continue
Maybe you're on MS Windows? Used single quotes? Have some settings causing trouble? (try with vim --clean).
HTH, John Little
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/9e8284d8-136e-4dff-8154-d9b24b693c94%40googlegroups.com.
Re: How about dropping the MzScheme interface?
> I know how to breathe since birth, I can't edit text!
>
Which invites the question "What do you use computers f0r?"
Even mail requires entering text. Programs and configuration files are all
text, rarely correct when first entered, and almost certainly need to be
changed from time to time.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/da48bea7bf1a7d751da028f8d39c9822.squirrel%40webmail.vybenetworks.com.
>
Which invites the question "What do you use computers f0r?"
Even mail requires entering text. Programs and configuration files are all
text, rarely correct when first entered, and almost certainly need to be
changed from time to time.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/da48bea7bf1a7d751da028f8d39c9822.squirrel%40webmail.vybenetworks.com.
join() a list with a newline char for an echo
Hi,
-- If I have a list [ one, two, three ] is there a way to turn it into a single string with newlines after each element ?
Such that an echo mylist would show it as mulitple lines, ie:
one
two
three
I have tried join( mylist, "\n") but it uses ^@ and "\r" uses ^M
thx for everything vim,
-m
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/abac3a43-a328-402d-bdca-635f430d665c%40googlegroups.com.
Wednesday, February 5, 2020
Re: viw / how to select a one char word ?
Hi,
-- Yes, I'll wager this has something to do with my terminal and its terminfo capabilities.
thx,
-m
On Monday, February 3, 2020 at 8:45:14 AM UTC-5, Tony Mechelynck wrote:
On Monday, February 3, 2020 at 8:45:14 AM UTC-5, Tony Mechelynck wrote:
On Mon, Feb 3, 2020 at 2:33 PM M Kelly <mckel...@gmail.com> wrote:
>
> Hi,
>
> ok I found my error and fixed it. It was in a bad vmap I had for iw
> Thank you all, as always, for the info.
> Now I think 'viw' works well for me in all cases :-)
> I wish the one char word, when selected, changed colour but not a problem.
In my gvim the one-character visually selected word's Visual highlight
is visible during the "off" phase of the blinking cursor; and with
'showcmd' on the number of characters (and bytes, if different) in the
selection is displayed near bottom right of the Vim screen.
Best regards,
Tony.
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/3f324d66-cb05-4088-a500-142d901d9345%40googlegroups.com.
Re: Triplicate text after mix-matching vim and nvi
On 2020-02-05 08:38, 'Ottavio Caruso' via vim_use wrote:
> the command works in both vim and nvi. The remap only in vim. I'll
> try to find a way of making it work in nvi, but this would be off
> topic.
Ah, good point. The "<f5>" notation is a vim thing. You can either
use some other key such as "Q"
:map Q :1m$^M
where ^M is entered using control+V followed by control+M
(just tested in the nvi that I have here on FreeBSD)
Alternatively, if you know the escape sequence for the key you want
such as F5, you might be able to enter it literally, escaping with
control+V as above.
(as I type this, your follow-up email arrived where you do just that)
> (BTW: if anybody knows a of a vi/nvi mailing list or usenet group,
> please let me know, on of off list)
I think this list is the closest there is. I regularly use vi/nvi,
vim, and ed(1), and occasionally neovim. I'm sure there are others.
There's enough overlap between vi/nvi and vim/neovim that even if
you're asking questions about vi/nvi here, you'll hopefully get some
good answers. It also helps get relevant answers if you mention that
your question is about vi/nvi instead of vim, so folks don't try to
reply with vim-specific answers.
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200205072126.224f67a3%40bigbox.attlocal.net.
> the command works in both vim and nvi. The remap only in vim. I'll
> try to find a way of making it work in nvi, but this would be off
> topic.
Ah, good point. The "<f5>" notation is a vim thing. You can either
use some other key such as "Q"
:map Q :1m$^M
where ^M is entered using control+V followed by control+M
(just tested in the nvi that I have here on FreeBSD)
Alternatively, if you know the escape sequence for the key you want
such as F5, you might be able to enter it literally, escaping with
control+V as above.
(as I type this, your follow-up email arrived where you do just that)
> (BTW: if anybody knows a of a vi/nvi mailing list or usenet group,
> please let me know, on of off list)
I think this list is the closest there is. I regularly use vi/nvi,
vim, and ed(1), and occasionally neovim. I'm sure there are others.
There's enough overlap between vi/nvi and vim/neovim that even if
you're asking questions about vi/nvi here, you'll hopefully get some
good answers. It also helps get relevant answers if you mention that
your question is about vi/nvi instead of vim, so folks don't try to
reply with vim-specific answers.
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200205072126.224f67a3%40bigbox.attlocal.net.
Re: Triplicate text after mix-matching vim and nvi
On Wed, 5 Feb 2020 at 08:38, Ottavio Caruso
<ottavio2006-usenet2012@yahoo.com> wrote:
>
> On Tue, 4 Feb 2020 at 14:10, Christian Brabandt <cblists@256bit.org> wrote:
> >
> >
> > On Di, 04 Feb 2020, Tim Chase wrote:
> >
> > > On 2020-02-04 14:43, Christian Brabandt wrote:
> > > > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > > > 1) dd
> > > > > 2) [shift] + g
> > > > > 3) p
> > > >
> > > > :1t$
> > >
> > > That copies where Ottavio's command sequence moves, so he'd want
> > >
> > > :1m$
> > >
> >
> > Oh, yes he wanted to move and not copy. Sorry.
>
> Tim & Christian,
>
> the command works in both vim and nvi. The remap only in vim. I'll try
> to find a way of making it work in nvi, but this would be off topic.
Correction: I had to prefix the maps with [ctrl]+v and now it works on nvi too:
nvi:
map ^[[15~ :1m$^M
vim:
map <f5> :1m$<cr>
Thanks Tony, Christian and Tim!
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHziw5NHqJYsTMPPCnD7Md%3DLBCKx2tV7Okq%2B7%3DY8r7X8%3DA%40mail.gmail.com.
<ottavio2006-usenet2012@yahoo.com> wrote:
>
> On Tue, 4 Feb 2020 at 14:10, Christian Brabandt <cblists@256bit.org> wrote:
> >
> >
> > On Di, 04 Feb 2020, Tim Chase wrote:
> >
> > > On 2020-02-04 14:43, Christian Brabandt wrote:
> > > > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > > > 1) dd
> > > > > 2) [shift] + g
> > > > > 3) p
> > > >
> > > > :1t$
> > >
> > > That copies where Ottavio's command sequence moves, so he'd want
> > >
> > > :1m$
> > >
> >
> > Oh, yes he wanted to move and not copy. Sorry.
>
> Tim & Christian,
>
> the command works in both vim and nvi. The remap only in vim. I'll try
> to find a way of making it work in nvi, but this would be off topic.
Correction: I had to prefix the maps with [ctrl]+v and now it works on nvi too:
nvi:
map ^[[15~ :1m$^M
vim:
map <f5> :1m$<cr>
Thanks Tony, Christian and Tim!
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHziw5NHqJYsTMPPCnD7Md%3DLBCKx2tV7Okq%2B7%3DY8r7X8%3DA%40mail.gmail.com.
Re: Triplicate text after mix-matching vim and nvi
On Tue, 4 Feb 2020 at 14:10, Christian Brabandt <cblists@256bit.org> wrote:
>
>
> On Di, 04 Feb 2020, Tim Chase wrote:
>
> > On 2020-02-04 14:43, Christian Brabandt wrote:
> > > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > > 1) dd
> > > > 2) [shift] + g
> > > > 3) p
> > >
> > > :1t$
> >
> > That copies where Ottavio's command sequence moves, so he'd want
> >
> > :1m$
> >
>
> Oh, yes he wanted to move and not copy. Sorry.
Tim & Christian,
the command works in both vim and nvi. The remap only in vim. I'll try
to find a way of making it work in nvi, but this would be off topic.
(BTW: if anybody knows a of a vi/nvi mailing list or usenet group,
please let me know, on of off list)
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHwe6cXd%2BRNQOuzmm1-16uZ2DCJA8WFbV5mkQT_SSRf7Ow%40mail.gmail.com.
>
>
> On Di, 04 Feb 2020, Tim Chase wrote:
>
> > On 2020-02-04 14:43, Christian Brabandt wrote:
> > > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > > 1) dd
> > > > 2) [shift] + g
> > > > 3) p
> > >
> > > :1t$
> >
> > That copies where Ottavio's command sequence moves, so he'd want
> >
> > :1m$
> >
>
> Oh, yes he wanted to move and not copy. Sorry.
Tim & Christian,
the command works in both vim and nvi. The remap only in vim. I'll try
to find a way of making it work in nvi, but this would be off topic.
(BTW: if anybody knows a of a vi/nvi mailing list or usenet group,
please let me know, on of off list)
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHwe6cXd%2BRNQOuzmm1-16uZ2DCJA8WFbV5mkQT_SSRf7Ow%40mail.gmail.com.
Re: Triplicate text after mix-matching vim and nvi
On Tue, 4 Feb 2020 at 13:27, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> The following mapping will move the first line from top to bottom of
> the file (at least in Vim in 'nocompatible' mode, I'm not sure about
> vi (or 'compatible' Vim) and nvi):
>
> :map <F5> :1d<Bar>$put<CR>
>
> (<Bar> rather than | to avoid interpreting the rest when declaring the
> mapping rather than when executing it). Of course you can use any
> convenirnt {lhs} instead of <F5>
>
Thanks. The remap works in vim but not in vi, probably because I'm
using the wrong syntax.
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHx8ypGffZQGabrvoff0aM9yca5QxsL3JgkgGy1TcbkBAA%40mail.gmail.com.
<antoine.mechelynck@gmail.com> wrote:
> The following mapping will move the first line from top to bottom of
> the file (at least in Vim in 'nocompatible' mode, I'm not sure about
> vi (or 'compatible' Vim) and nvi):
>
> :map <F5> :1d<Bar>$put<CR>
>
> (<Bar> rather than | to avoid interpreting the rest when declaring the
> mapping rather than when executing it). Of course you can use any
> convenirnt {lhs} instead of <F5>
>
Thanks. The remap works in vim but not in vi, probably because I'm
using the wrong syntax.
--
Ottavio Caruso
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHx8ypGffZQGabrvoff0aM9yca5QxsL3JgkgGy1TcbkBAA%40mail.gmail.com.
Tuesday, February 4, 2020
Re: Triplicate text after mix-matching vim and nvi
On 2020-02-04 09:03, 'Ottavio Caruso' via vim_use wrote:
> I have a file (man-pages.txt) where I have a list of man pages that
> I need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
While I suggested using ":1m$" elsewhere in the thread, I'm glad I'm
not the only one doing something similar with man-pages.
However, I've used calendar programs to do this. You can either use
the venerable calendar(1) format:
# BSD date(1)
$ d=$(date +%s); while read line ; do printf '%s\t%s\n' $(date
-r $d +%Y-%m-%d ) "$line" ; d=$(( $d + (60*60*24) )); done <
list_of_manpages.txt >> ~/.calendar
# Linux date(1)
$ d=$(date +%s) ; while read line ; do printf '%s\t%s\n'
$(date --date="@$d" +%Y-%m-%d) "$line" ; d=$(( $d + (60*60*24) )) ;
done < list_of_manpages.txt >> ~/.calendar
(though beware that, if you have more than 365 entries, calendar(1)
seems to ignore the year)
You can then invoke
$ calendar
(or put it in a cron-job if it's not automatically picked up by your
system scripts)
I do something similar using remind(1) which I prefer for calendaring:
$ cat remify_manpages.awk
BEGIN {
print "SET ManStart date(2020,1,5)"
}
$7 ~ /^[1678]$/ {
printf("REM [ManStart + %i] MSG man %s %%\"%s%%\"%%\n", NR - 1, $7,
$6)
}
$ find /usr/share/man/man[1678]/ -maxdepth 2 -type f |
grep -vi perl |
sort -R |
awk -F'[./]' -f remify_manpages.awk > manpages.rem
(I ignore the perl man-pages and randomly shuffle them)
and then invoking remind(1) will include my man-page-of-the-day for
that given date.
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204083930.5561f584%40bigbox.attlocal.net.
> I have a file (man-pages.txt) where I have a list of man pages that
> I need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
While I suggested using ":1m$" elsewhere in the thread, I'm glad I'm
not the only one doing something similar with man-pages.
However, I've used calendar programs to do this. You can either use
the venerable calendar(1) format:
# BSD date(1)
$ d=$(date +%s); while read line ; do printf '%s\t%s\n' $(date
-r $d +%Y-%m-%d ) "$line" ; d=$(( $d + (60*60*24) )); done <
list_of_manpages.txt >> ~/.calendar
# Linux date(1)
$ d=$(date +%s) ; while read line ; do printf '%s\t%s\n'
$(date --date="@$d" +%Y-%m-%d) "$line" ; d=$(( $d + (60*60*24) )) ;
done < list_of_manpages.txt >> ~/.calendar
(though beware that, if you have more than 365 entries, calendar(1)
seems to ignore the year)
You can then invoke
$ calendar
(or put it in a cron-job if it's not automatically picked up by your
system scripts)
I do something similar using remind(1) which I prefer for calendaring:
$ cat remify_manpages.awk
BEGIN {
print "SET ManStart date(2020,1,5)"
}
$7 ~ /^[1678]$/ {
printf("REM [ManStart + %i] MSG man %s %%\"%s%%\"%%\n", NR - 1, $7,
$6)
}
$ find /usr/share/man/man[1678]/ -maxdepth 2 -type f |
grep -vi perl |
sort -R |
awk -F'[./]' -f remify_manpages.awk > manpages.rem
(I ignore the perl man-pages and randomly shuffle them)
and then invoking remind(1) will include my man-page-of-the-day for
that given date.
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204083930.5561f584%40bigbox.attlocal.net.
Re: Triplicate text after mix-matching vim and nvi
On Di, 04 Feb 2020, Tim Chase wrote:
> On 2020-02-04 14:43, Christian Brabandt wrote:
> > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > 1) dd
> > > 2) [shift] + g
> > > 3) p
> >
> > :1t$
>
> That copies where Ottavio's command sequence moves, so he'd want
>
> :1m$
>
Oh, yes he wanted to move and not copy. Sorry.
Best,
Christian
--
Es gibt Menschen, denen jedes Lob Tadel ist, das nicht das größte ist.
-- Jean Paul
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204141012.GD12806%40256bit.org.
> On 2020-02-04 14:43, Christian Brabandt wrote:
> > On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > > 1) dd
> > > 2) [shift] + g
> > > 3) p
> >
> > :1t$
>
> That copies where Ottavio's command sequence moves, so he'd want
>
> :1m$
>
Oh, yes he wanted to move and not copy. Sorry.
Best,
Christian
--
Es gibt Menschen, denen jedes Lob Tadel ist, das nicht das größte ist.
-- Jean Paul
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204141012.GD12806%40256bit.org.
Re: Triplicate text after mix-matching vim and nvi
On 2020-02-04 14:43, Christian Brabandt wrote:
> On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > 1) dd
> > 2) [shift] + g
> > 3) p
>
> :1t$
That copies where Ottavio's command sequence moves, so he'd want
:1m$
:-)
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204080459.0de24fad%40bigbox.attlocal.net.
> On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> > 1) dd
> > 2) [shift] + g
> > 3) p
>
> :1t$
That copies where Ottavio's command sequence moves, so he'd want
:1m$
:-)
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204080459.0de24fad%40bigbox.attlocal.net.
Re: Triplicate text after mix-matching vim and nvi
On 2020-02-04 14:27, Tony Mechelynck wrote:
> The following mapping will move the first line from top to bottom of
> the file (at least in Vim in 'nocompatible' mode, I'm not sure about
> vi (or 'compatible' Vim) and nvi):
>
> :map <F5> :1d<Bar>$put<CR>
Or more simply
:map <f5> :1m$<cr>
Should work in vi, vim, nvi, neovim, and the same concept/command in
ed(1). It should also work regardless of your 'compatible' settings.
:-)
(within vim/neovim, I'd tend to use "nnoremap" instead of just "map")
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204075241.1476df4a%40bigbox.attlocal.net.
> The following mapping will move the first line from top to bottom of
> the file (at least in Vim in 'nocompatible' mode, I'm not sure about
> vi (or 'compatible' Vim) and nvi):
>
> :map <F5> :1d<Bar>$put<CR>
Or more simply
:map <f5> :1m$<cr>
Should work in vi, vim, nvi, neovim, and the same concept/command in
ed(1). It should also work regardless of your 'compatible' settings.
:-)
(within vim/neovim, I'd tend to use "nnoremap" instead of just "map")
-tim
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204075241.1476df4a%40bigbox.attlocal.net.
Re: Triplicate text after mix-matching vim and nvi
On Di, 04 Feb 2020, 'Ottavio Caruso' via vim_use wrote:
> Hi,
>
> Maybe this is off-topic but I hope you guys can help, as there's no
> specific maling list for classic vi/nvi.
>
> On my system (Linux/amd64 Debian 4.9.189) I have:
>
> - vim (vim 8.1)
> - vi (aliased to vim)
> - nvi (nvi-1.81.6nb5 )
>
> For self-educational purposes, I've been trying to teach myself to use
> both vim and nvi, as I'm studying for a BSD-related certification,
> where old vi is installed by default. So, to a certain extent, I am
> looking for trouble, however...
>
> I have a file (man-pages.txt) where I have a list of man pages that I
> need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
>
> and so on. When I am finished with reading a man page, I cut the first
> line and I paste to the last line, so:
>
> 1) dd
> 2) [shift] + g
> 3) p
>
> And I've been doing this for a few months. Sometimes I use vim and
> some other times nvi.
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
Not sure what could be causing this. Note however, you can use the
`:copy` or `:t` alias. So to copy the first line to the last line, you
can simply do:
:1t$
Best,
Christian
--
Man muß wissen, daß der Krieg etwas Allgemeines ist, daß das Recht
auf dem Streit beruht und daß alles aus dem Streit und aus der
Notwendigkeit entsteht.
-- Heraklit von Ephesus (540-480 v. Chr.)
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204134327.GC12806%40256bit.org.
> Hi,
>
> Maybe this is off-topic but I hope you guys can help, as there's no
> specific maling list for classic vi/nvi.
>
> On my system (Linux/amd64 Debian 4.9.189) I have:
>
> - vim (vim 8.1)
> - vi (aliased to vim)
> - nvi (nvi-1.81.6nb5 )
>
> For self-educational purposes, I've been trying to teach myself to use
> both vim and nvi, as I'm studying for a BSD-related certification,
> where old vi is installed by default. So, to a certain extent, I am
> looking for trouble, however...
>
> I have a file (man-pages.txt) where I have a list of man pages that I
> need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
>
> and so on. When I am finished with reading a man page, I cut the first
> line and I paste to the last line, so:
>
> 1) dd
> 2) [shift] + g
> 3) p
>
> And I've been doing this for a few months. Sometimes I use vim and
> some other times nvi.
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
Not sure what could be causing this. Note however, you can use the
`:copy` or `:t` alias. So to copy the first line to the last line, you
can simply do:
:1t$
Best,
Christian
--
Man muß wissen, daß der Krieg etwas Allgemeines ist, daß das Recht
auf dem Streit beruht und daß alles aus dem Streit und aus der
Notwendigkeit entsteht.
-- Heraklit von Ephesus (540-480 v. Chr.)
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20200204134327.GC12806%40256bit.org.
Re: Triplicate text after mix-matching vim and nvi
On Tue, Feb 4, 2020 at 10:04 AM 'Ottavio Caruso' via vim_use
<vim_use@googlegroups.com> wrote:
>
> Hi,
>
> Maybe this is off-topic but I hope you guys can help, as there's no
> specific maling list for classic vi/nvi.
>
> On my system (Linux/amd64 Debian 4.9.189) I have:
>
> - vim (vim 8.1)
> - vi (aliased to vim)
> - nvi (nvi-1.81.6nb5 )
>
> For self-educational purposes, I've been trying to teach myself to use
> both vim and nvi, as I'm studying for a BSD-related certification,
> where old vi is installed by default. So, to a certain extent, I am
> looking for trouble, however...
>
> I have a file (man-pages.txt) where I have a list of man pages that I
> need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
>
> and so on. When I am finished with reading a man page, I cut the first
> line and I paste to the last line, so:
>
> 1) dd
> 2) [shift] + g
> 3) p
>
> And I've been doing this for a few months. Sometimes I use vim and
> some other times nvi.
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
>
> Thanks
>
> --
> Ottavio Caruso
The following mapping will move the first line from top to bottom of
the file (at least in Vim in 'nocompatible' mode, I'm not sure about
vi (or 'compatible' Vim) and nvi):
:map <F5> :1d<Bar>$put<CR>
(<Bar> rather than | to avoid interpreting the rest when declaring the
mapping rather than when executing it). Of course you can use any
convenirnt {lhs} instead of <F5>
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXszH_D3AKqVA7nRgckX0jO0WtSX4d4ACbNf7X7v%2BRB01Q%40mail.gmail.com.
<vim_use@googlegroups.com> wrote:
>
> Hi,
>
> Maybe this is off-topic but I hope you guys can help, as there's no
> specific maling list for classic vi/nvi.
>
> On my system (Linux/amd64 Debian 4.9.189) I have:
>
> - vim (vim 8.1)
> - vi (aliased to vim)
> - nvi (nvi-1.81.6nb5 )
>
> For self-educational purposes, I've been trying to teach myself to use
> both vim and nvi, as I'm studying for a BSD-related certification,
> where old vi is installed by default. So, to a certain extent, I am
> looking for trouble, however...
>
> I have a file (man-pages.txt) where I have a list of man pages that I
> need to expand, for example:
>
> man 8 tcpdump
> man 1 login
> man 8 sysctl
> man 8 adduser
> man 5 adduser.conf
> man 8 rmuser
> man 8 useradd
> man 8 userdel
>
> and so on. When I am finished with reading a man page, I cut the first
> line and I paste to the last line, so:
>
> 1) dd
> 2) [shift] + g
> 3) p
>
> And I've been doing this for a few months. Sometimes I use vim and
> some other times nvi.
>
> At one point, I noticed that the size of this file was growing
> abnormally. Then, I realised that the entries were in duplicate or
> triplicate copies, that is, as if I had copied the whole file and then
> pasted it twice onto itself.
>
> I removed the duplicate lines and started from scratch and, as a proof
> of concept, alternated between vim and nvi, just to see if this would
> happen again, and indeed it did.
>
> I wonder if somebody has a clue why this happens. Is this something I
> should expect? Is there a markup that one editor places that confuses
> the other?
>
> Thanks
>
> --
> Ottavio Caruso
The following mapping will move the first line from top to bottom of
the file (at least in Vim in 'nocompatible' mode, I'm not sure about
vi (or 'compatible' Vim) and nvi):
:map <F5> :1d<Bar>$put<CR>
(<Bar> rather than | to avoid interpreting the rest when declaring the
mapping rather than when executing it). Of course you can use any
convenirnt {lhs} instead of <F5>
Best regards,
Tony.
--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXszH_D3AKqVA7nRgckX0jO0WtSX4d4ACbNf7X7v%2BRB01Q%40mail.gmail.com.
Subscribe to:
Posts (Atom)