Hello,
I see a syntax behavior change between vim 7.4 and earlier version. (We are yet to update VIM version to 8.0+ in our company.)
I use different syntax for lines that begin with "//" (Comments) and lines that begin with "//:" (embedded Perl Code). I was able to achieve this with earlier version of vim by specifying this in the syntax file,
syn match embPerlCode "^\s*//:.*"
and this in .gvimrc,
highlight embPerlCode gui=bold guifg=maroon
This works fine in version 7.2 (didn't check in 7.3). But in version 7.4 the behavior has changed. The embPerlCode lines are shown with syntax color of Comments.
Is there a way to get around this and get back the previous behavior?
thanks,
Chandra
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Wednesday, April 5, 2017
Re: execute sub command without moving cursor
2017-04-05 22:21 GMT+03:00 Ni Va <nivaemail@gmail.com>:
> Hi,
>
>
> I use this kind of command but it moves my cursor pos.
>
>
> silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In ".s[0]." : ".s[1]/e'
>
>
> Can I avoid to move cursor when I replace executing sub command ?
> Thanks
> niva
You can restore it afterwards: use winsaveview()+winrestview().
Otherwise you will have to emulate `:substitute` with search() and
setline() and this is going to be way too tricky.
>
> --
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
--
--
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.
For more options, visit https://groups.google.com/d/optout.
> Hi,
>
>
> I use this kind of command but it moves my cursor pos.
>
>
> silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In ".s[0]." : ".s[1]/e'
>
>
> Can I avoid to move cursor when I replace executing sub command ?
> Thanks
> niva
You can restore it afterwards: use winsaveview()+winrestview().
Otherwise you will have to emulate `:substitute` with search() and
setline() and this is going to be way too tricky.
>
> --
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
--
--
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.
For more options, visit https://groups.google.com/d/optout.
execute sub command without moving cursor
Hi,
I use this kind of command but it moves my cursor pos.
silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In ".s[0]." : ".s[1]/e'
Can I avoid to move cursor when I replace executing sub command ?
Thanks
niva
--
--
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.
For more options, visit https://groups.google.com/d/optout.
I use this kind of command but it moves my cursor pos.
silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In ".s[0]." : ".s[1]/e'
Can I avoid to move cursor when I replace executing sub command ?
Thanks
niva
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode
After a few tries I found something that looks a little bit strange to me: the Insert mode meta keymapping actually works, *only if* you set at least one mapping with the leading <Esc>.
Previously I tried my best to avoid mapping the <Esc> leading keys, although it works, because it would introduce ambiguity and get Vim stuck when <Esc> was pressed, but all the <M-...> mappings wouldn't work then, like they were all ignored.
Now I've found this:
inoremap <Esc>m <nop>
with this key mapping in place, suddenly, all my <M-..> mappings in Insert mode works!
But this mapping still introduces ambiguity to the Escape key, a dilemma ...
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Previously I tried my best to avoid mapping the <Esc> leading keys, although it works, because it would introduce ambiguity and get Vim stuck when <Esc> was pressed, but all the <M-...> mappings wouldn't work then, like they were all ignored.
Now I've found this:
inoremap <Esc>m <nop>
with this key mapping in place, suddenly, all my <M-..> mappings in Insert mode works!
But this mapping still introduces ambiguity to the Escape key, a dilemma ...
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode
>
> What does ":verbose set timeoutlen" answer?
>
> I recommend someting like the following settings:
>
> if exists('+timeout')
> " should a timeout be applied to keys and mappings?
> " 'timeout' true=yes false=no
> " 'ttimeout' (not used if 'timeout' is true) time out on key codes
> " 'timeoutlen' timeout duration on mappings
> " 'ttimeoutlen': timeout duration on keycodes
> " (use 'timeoutlen') if negative)
> " durations are in milliseconds
> set timeout timeoutlen=5000 ttimeoutlen=250
> " ttimeoutlen should be longer than the hardware cycle but shorter
> than your fastest typing speed
> " timeoutlen should be longer than your slowest typing speed
> endif
>
> Best regards,
> Tony.
Yes, the 'timeout' option is usable with my Vim, yet I'm afraid it doesn't help much here. For the Meta key mapping to work in Insert mode I have to do keymapping like this:
inoremap <expr> <Esc>j InsertModeKeymapping('M-j')
And this will introduce ambiguity to the <Esc> key, Vim get stuck for a while to resolve it whenever the key was pressed under Insert mode. Also, from my understanding, the default status with 'timeout' not set equals 'timeoutlen' being set to infinite time, which is indifferent with, say, a large number.
--
--
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.
For more options, visit https://groups.google.com/d/optout.
> What does ":verbose set timeoutlen" answer?
>
> I recommend someting like the following settings:
>
> if exists('+timeout')
> " should a timeout be applied to keys and mappings?
> " 'timeout' true=yes false=no
> " 'ttimeout' (not used if 'timeout' is true) time out on key codes
> " 'timeoutlen' timeout duration on mappings
> " 'ttimeoutlen': timeout duration on keycodes
> " (use 'timeoutlen') if negative)
> " durations are in milliseconds
> set timeout timeoutlen=5000 ttimeoutlen=250
> " ttimeoutlen should be longer than the hardware cycle but shorter
> than your fastest typing speed
> " timeoutlen should be longer than your slowest typing speed
> endif
>
> Best regards,
> Tony.
Yes, the 'timeout' option is usable with my Vim, yet I'm afraid it doesn't help much here. For the Meta key mapping to work in Insert mode I have to do keymapping like this:
inoremap <expr> <Esc>j InsertModeKeymapping('M-j')
And this will introduce ambiguity to the <Esc> key, Vim get stuck for a while to resolve it whenever the key was pressed under Insert mode. Also, from my understanding, the default status with 'timeout' not set equals 'timeoutlen' being set to infinite time, which is indifferent with, say, a large number.
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode
On Wed, Apr 5, 2017 at 3:48 PM, Jacky Liu <bluegene8210@gmail.com> wrote:
> My Vim version is 8.0.540 if it helps
What does ":verbose set timeoutlen" answer?
I recommend someting like the following settings:
if exists('+timeout')
" should a timeout be applied to keys and mappings?
" 'timeout' true=yes false=no
" 'ttimeout' (not used if 'timeout' is true) time out on key codes
" 'timeoutlen' timeout duration on mappings
" 'ttimeoutlen': timeout duration on keycodes
" (use 'timeoutlen') if negative)
" durations are in milliseconds
set timeout timeoutlen=5000 ttimeoutlen=250
" ttimeoutlen should be longer than the hardware cycle but shorter
than your fastest typing speed
" timeoutlen should be longer than your slowest typing speed
endif
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.
For more options, visit https://groups.google.com/d/optout.
> My Vim version is 8.0.540 if it helps
What does ":verbose set timeoutlen" answer?
I recommend someting like the following settings:
if exists('+timeout')
" should a timeout be applied to keys and mappings?
" 'timeout' true=yes false=no
" 'ttimeout' (not used if 'timeout' is true) time out on key codes
" 'timeoutlen' timeout duration on mappings
" 'ttimeoutlen': timeout duration on keycodes
" (use 'timeoutlen') if negative)
" durations are in milliseconds
set timeout timeoutlen=5000 ttimeoutlen=250
" ttimeoutlen should be longer than the hardware cycle but shorter
than your fastest typing speed
" timeoutlen should be longer than your slowest typing speed
endif
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.
For more options, visit https://groups.google.com/d/optout.
Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode
My Vim version is 8.0.540 if it helps
--
--
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.
For more options, visit https://groups.google.com/d/optout.
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Posts (Atom)