Re: Vim in Windows Command Prompt only has 16 colors to work with

2024-06-01 Thread Maxim Kim
I had for a long time

if has("win32") && !has("gui_running")
set t_Co=256
endif

in my configuration to make it 256 colors aware.
On Saturday, May 25, 2024 at 6:19:05 AM UTC+10 DwigtArmyOfChampions wrote:

> If I launch vim from the Windows 10 cmd line and then run the command 
> "echo _Co" it only returns 16. Is there any way to get at least 256 
> colors to display in a regular cmd window, if not full color?

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/24050da4-4487-49f3-86dd-fa7370a23d83n%40googlegroups.com.


Re: "iabbrev" erratic behaviour

2024-02-19 Thread Maxim Kim
> Is there a way to troubleshoot that? 

You can check if it works without your configuration: 

$ vim -Nu NONE
: iabbrev mdate =strftime("%a %d/%m/%Y")

If it isthere must be something in vim config you will need to figure out. 
One common approach is to bisect your vimrc.

On Monday, February 19, 2024 at 11:29:19 PM UTC+11 Ottavio Caruso wrote:

> Hi,
>
> I have this is in my .vimrc:
>
> iabbrev mdate =strftime("%a %d/%m/%Y")
>
>
> It used to work fine, but as of recently (3 or 4 weeks or so), this
> abbreviation only works if it is the first thing that I input on any
> file. If I edit a file, type some characters and then I type "mdate",
> it doesn't get expanded. I have to save and exit the file, then
> re-open it and then type "mdate".
>
> Is there a way to troubleshoot that?
>
> -- 
> Ottavio Caruso
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/b34ee5a3-7464-4697-8611-9716f1bffb23n%40googlegroups.com.


Re: Visually selecting multi-lines inside backticks

2024-02-11 Thread Maxim Kim
Because then there would be things like this:


[image: Screenshot 2024-02-12 132702.png]
On Saturday, February 3, 2024 at 3:50:49 AM UTC+11 Manas wrote:

> Hi, this is quite a stupid question but why doesn't backticks work for
> multi-line selection via something like vi`
>
> I have some blocks like
>
> `
> lorem ipsum
> `
>
> and I want to select whole inside the backticks. I am reading that ',",` 
> are
> only matched in the same lines.
>
> Thanks
> -- 
> Manas
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/699cc162-b0bc-4275-89e8-177253ff5ee3n%40googlegroups.com.


Re: popup window filter, what is <80>` ?

2022-08-07 Thread Maxim Kim
And this is actually cursorhold, and I can filter it out with

if key == "\"
return true
...

Full snippet:

vim9script

def Test()
var prompt: string = ''
const wid: number = popup_create('', {
minwidth: 20,
maxheight: 1,
mapping: false,
filter: (winid: number, key: string): bool => {
if key == "\"
return true
elseif key == "\"
popup_close(winid, -1)
else
prompt ..= key
popup_settext(winid, prompt)
else
return false
endif
return true
},
callback: (_: number, result: number) => {
if result == 0
echomsg prompt
endif
}
})
enddef

Test()


Still not sure why in gvim I get it into a filter func...

воскресенье, 7 августа 2022 г. в 18:55:46 UTC+3, Maxim Kim: 

> The issue is with windows gvim 9.0.133
> I have tried the same in fedora36 vim 9.0.161 and it doesn't have this.
>
> воскресенье, 7 августа 2022 г. в 18:49:03 UTC+3, Maxim Kim: 
>
>>
>> It looks like it happens on cursorhold event, not 100% sure though. 
>>
>> Indeed, if I change `set updatetime=1000` then I get this every second:
>>
>>
>> vim9script
>>
>> def Test()
>> var prompt: string = ''
>> const wid: number = popup_create('', {
>> minwidth: 20,
>> maxheight: 1,
>> mapping: false,
>> filter: (winid: number, key: string): bool => {
>> if key == "\"
>> popup_close(winid, -1)
>> else
>> prompt ..= key
>> popup_settext(winid, prompt)
>> else
>> return false
>> endif
>> return true
>> },
>> callback: (_: number, result: number) => {
>> if result == 0
>> echomsg prompt
>> endif
>> }
>> })
>> enddef
>>
>> Test()
>>
>>
>>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/be7754bb-c77b-486e-9767-6f06d73afd2en%40googlegroups.com.


Re: popup window filter, what is <80>` ?

2022-08-07 Thread Maxim Kim
The issue is with windows gvim 9.0.133
I have tried the same in fedora36 vim 9.0.161 and it doesn't have this.

воскресенье, 7 августа 2022 г. в 18:49:03 UTC+3, Maxim Kim: 

>
> It looks like it happens on cursorhold event, not 100% sure though. 
>
> Indeed, if I change `set updatetime=1000` then I get this every second:
>
>
> vim9script
>
> def Test()
> var prompt: string = ''
> const wid: number = popup_create('', {
> minwidth: 20,
> maxheight: 1,
> mapping: false,
> filter: (winid: number, key: string): bool => {
> if key == "\"
> popup_close(winid, -1)
> else
> prompt ..= key
> popup_settext(winid, prompt)
> else
> return false
> endif
> return true
> },
> callback: (_: number, result: number) => {
> if result == 0
> echomsg prompt
> endif
> }
> })
> enddef
>
> Test()
>
>
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/5a21ec1b-fc56-4b21-8f1e-40dee75d5f72n%40googlegroups.com.


Re: popup window filter, what is <80>` ?

2022-08-07 Thread Maxim Kim



It looks like it happens on cursorhold event, not 100% sure though.


Indeed, if I change `set updatetime=1000` then I get this every second:


vim9script

def Test()
    var prompt: string = ''
    const wid: number = popup_create('', {
    minwidth: 20,
    maxheight: 1,
    mapping: false,
    filter: (winid: number, key: string): bool => {
    if key == "\"
    popup_close(winid, -1)
    else
    prompt ..= key
    popup_settext(winid, prompt)
    else
    return false
    endif
    return true
    },
    callback: (_: number, result: number) => {
    if result == 0
    echomsg prompt
    endif
    }
    })
enddef

Test()

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

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/0d2d33d5-c6be-64a0-1132-283820f30007%40gmail.com.


Re: popup window filter, what is <80>` ?

2022-08-07 Thread Maxim Kim



On 2022-08-07 17:53, Bram Moolenaar wrote:


Don't see it in the GIF.

in the message area at the end of gif <80>`


here probably is a third byte that you don't see.

Third byte is `

   0x80 0xfd is a
prefix for a special key.  There is a list in src/keymap.h, "enum
key_extra".


I have checked this enum, and have absolutely no idea how to figure out 
what is 0x80 0xfd `  and why it appears in the filter at all.


It looks like it happens on cursorhold event, not 100% sure though.

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

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/929f3df8-ac54-3d48-71b6-8e4a6b8c5e00%40gmail.com.


popup window filter, what is <80>` ?

2022-08-07 Thread Maxim Kim
Hi, currently there is no built-in way to have a prompt in a popup window 
so am trying to fake it with filtering.

While in the early stages, I found out that the filter func constantly gets 
<80>` value.

What is this?
How can I properly filter it out?

With the following code:

vim9script

export def TestPopup(contents: string)
var prompt = ""
var main_id = popup_create(contents, {
pos: 'center',
mapping: 0,
filter: (id, key) => {
if key == "\"
popup_close(id, -1)
else
prompt ..= key
endif
return true
},
callback: (id, result) => {
echom prompt
}
})
enddef

TestPopup('hello')

If you wait a 3-4 seconds and close popup with ESC, you will see <80>`:
[image: viim-filter.gif]

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/5d3c9840-b60e-4c07-9040-01d859a47fb0n%40googlegroups.com.


Re: Terminal window colors

2022-08-04 Thread Maxim Kim
Fixed colorschemes are now included into vim.

понедельник, 1 августа 2022 г. в 18:50:31 UTC+7, antone...@gmail.com: 

> Em dom., 31 de jul. de 2022 09:30, Maxim Kim  escreveu:
>
>> This is a bug in remade colorschemes.
>>
>> We have fixed it and will provide updated colorschemes to vim in some 
>> near future.
>>
>> https://github.com/vim/colorschemes/issues/198
>>
>> суббота, 30 июля 2022 г. в 23:33:31 UTC+3, matthew...@gmail.com: 
>>
>>>
>>> сб, 30 июл. 2022 г. в 22:18, Alessandro Antonello :
>>>
>>>> Hi, everyone.
>>>>
>>>> O upgrade my MacVim to version 9 this week. Everything is Ok but the 
>>>> terminal window colors. Before the upgrade, a terminal window, opened 
>>>> inside a GUI view, assumed the foreground and background colors of the 
>>>> current colorscheme normal group applyed to Vim. After the upgrade it 
>>>> seams 
>>>> to assume the colors applyed to my default terminal App (Terminal.app on 
>>>> macOS). Is there a way to restore the old behavior?
>>>>
>>>> Regards.
>>>>
>>>> -- 
>>>> -- 
>>>> 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+u...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/vim_use/CA%2BJN8R%2BFk7J_%3D20Feunp5Nsjuic1Hwa2N9POYfHX3KgZHLQQWQ%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/vim_use/CA%2BJN8R%2BFk7J_%3D20Feunp5Nsjuic1Hwa2N9POYfHX3KgZHLQQWQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>
>>> Your colorscheme is probably outdated. Needs ":hi link Terminal Normal" 
>>> to make it follow Normal color.
>>>
>>> Best regards,
>>> Matvey
>>>
>> -- 
>> -- 
>> 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+u...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vim_use/2e6bcb02-a3e7-44db-9c8c-89823e3aba63n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vim_use/2e6bcb02-a3e7-44db-9c8c-89823e3aba63n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
> Hi, everyone.
>
> Thanks for your help. I solved the problem by linking the Terminal group 
> with Normal group in the custom colorschemes that I have. That was perfect.
>
> Regards.
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/74d88d1f-0113-4844-a0e0-32c3ac6911bcn%40googlegroups.com.


Re: Import vim9 script as that and map that.func fails

2022-08-04 Thread Maxim Kim
Also please note that space between n and  might be something 
you don't want.
Basically your n mapping does `n` then `` (which is cursor right) 
and then your scriptcmd...

четверг, 4 августа 2022 г. в 14:32:45 UTC+7, niva...@gmail.com: 

> Thank you Maxim, this is what i've done yesterday.
>
> But it does not solve two problems :
>
>1. first when I open $MYVIMRC and search for a word as 'import' it 
>does not call imported that.HLNExt func, I HAVE TO SOURCE $MYVIMRC ANOTEHR 
>TIME
>2. then, when I search forward for import it blinks the word occurence 
>searched where cursor is on, then searching backwards with N it seems to 
>work until I attempt to search forward one more time and the blinking 
>feature does not appear anymore.
>
>
> You can see it :  
> https://drive.google.com/file/d/1q0hn3h4u05jpClaiAC_kn8DMnYrRymE9/view?usp=sharing
>
> Le jeudi 4 août 2022 à 06:52:50 UTC+2, Maxim Kim a écrit :
>
>> *> nnoremap  n n*that.HLNext(80)
>>
>> remove  to see messages, also `:` is not needed.
>>
>> Also in the gif you are importing with the full path, not sure if it 
>> matters.
>>
>> среда, 3 августа 2022 г. в 20:31:47 UTC+7, niva...@gmail.com: 
>>
>>> Thank you Bram, 
>>>
>>>- I added  as described.
>>>- Can you just look at this gif that shows that I have to source 
>>>$MYVIMRC to take account an import vim9script, then the function that 
>>> blink 
>>>the searched work is working.
>>>
>>>
>>>
>>> https://drive.google.com/file/d/1l4l_7M14eHjEG_cgwCpkm6NFX_QIWYCj/view?usp=sharing
>>>
>>> Le mercredi 3 août 2022 à 12:05:05 UTC+2, N V a écrit :
>>>
>>>> Import is now successfull, what is now wrong is overloading mapping as 
>>>> intended by D.Conway https://www.youtube.com/watch?v=aHm36-na4-4#t6m36s
>>>> as this :
>>>>
>>>> # Imported Functions {{{
>>>> import autoload 'nvhelper.vim' as that
>>>> # nnoremap   that.HLNext(80)  # CALL SUCCESS
>>>> *nnoremap  n n:* that.HLNext(80)   # FAILS 
>>>> GOTO NEXT
>>>> nnoremap  N N: that.HLNext(80)
>>>>
>>>>
>>>>
>>>> It seems to goto one time to item searched but don't do next jump.
>>>> Le mercredi 3 août 2022 à 11:51:49 UTC+2, Bram Moolenaar a écrit :
>>>>
>>>>>
>>>>> > Would import vim9 script as that. It seems to work when I directly 
>>>>> call 
>>>>> > that.foobar. 
>>>>> > 
>>>>> > But how to map the same call in a nnoremapping ? 
>>>>> > Thank you 
>>>>> > NV 
>>>>> > 
>>>>> > 
>>>>> > # Imported Functions {{{ 
>>>>> > import './vimfiles/autoload/nvhelper.vim' as that 
>>>>> > nnoremap n n:call that.HLNext(80) 
>>>>> > nnoremap N N:call that.HLNext(80) 
>>>>>
>>>>> Use ":help import-legacy" and then go up a few lines. 
>>>>>
>>>>> -- 
>>>>> The term "free software" is defined by Richard M. Stallman as 
>>>>> being software that isn't necessarily for free. Confusing? 
>>>>> Let's call it "Stallman software" then! 
>>>>> -- Bram Moolenaar 
>>>>>
>>>>> /// Bram Moolenaar -- br...@moolenaar.net -- http://www.Moolenaar.net 
>>>>> \\\ 
>>>>> /// \\\ 
>>>>> \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// 
>>>>> \\\ 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/b369de94-2d4b-410b-8284-8c8011c0c92dn%40googlegroups.com.


Re: strange difference in UI for identical .vimrc

2022-08-03 Thread Maxim Kim
Colorschemes were changed, now all of them define Normal highlight.

To make it transparent, you can follow :h :colorscheme (several paragraphs 
down):

If a color scheme is almost right, you can add modifications on top of it by
using the |ColorScheme| autocommand.  For example, to remove the background
color (can make it transparent in some terminals): >
augroup my_colorschemes
  au!
  au Colorscheme pablo hi Normal ctermbg=NONE
augroup END

Change a couple more colors: >
augroup my_colorschemes
  au!
  au Colorscheme pablo hi Normal ctermbg=NONE
  \ | higlight Special ctermfg=63
  \ | highlight Identifier ctermfg=44
augroup END

Also :h new-colorschemes-9

Colorschemes from https://github.com/vim/colorschemes have been included.
They were made to work consistently across many types of terminals. 
 Although
generally an improvement, a lot of personal preference is involved.  You can
always get the old version if you prefer it, look here:
https://github.com/vim/colorschemes/blob/master/legacy_colors/
четверг, 4 августа 2022 г. в 09:28:20 UTC+7, aryeh.f...@gmail.com: 

> On Wed, Aug 3, 2022 at 9:30 PM 'Grant Taylor' via vim_use
>  wrote:
> >
> > On 8/3/22 5:37 PM, Aryeh Friedman wrote:
> > > I have two machines with 8.2.2263 and 8.2.5052 respectively with
> > > the following .vimrc (same NIS account/NFS home dir) and in the 2263
> > > machine shows a transparent background (which is what I want) and the
> > > 5052 shows and opaque one which is not what I want (See screen shots).
> > > How do I make 5052 behave like 2263.
> >
> > This seems like a Window Manager / Desktop Environment issue more than
> > it seems like a Vim issue to me.
>
> Thats what I thought to but see experiment below.
>
> >
> > Though I would naively assume that a common NFS mounted home directory
> > would have the same WM / DE preferences too.
>
> Since I always ssh into machine that shows the background (it is my
> "work" vm and my desktop is for more general purpose computing like
> this email and watching youtube). BTW both machines are FreeBSD 12.1
>
> >
> > What happens if you run gVim on each machine displaying on the other
> > machine remote X11 display (possibly via SSH forwarding)?
>
> It seems now that FreeBSD has switched over to Wayland you can not do
> intermachine remote xproto stuff. Gvim does open with an opaque
> background on the desktop machine though.
>
>
> -- 
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/8e3ff9a7-0c0d-4a66-9bc7-7764d2267c27n%40googlegroups.com.


Re: Import vim9 script as that and map that.func fails

2022-08-03 Thread Maxim Kim
*> nnoremap  n n*that.HLNext(80)

remove  to see messages, also `:` is not needed.

Also in the gif you are importing with the full path, not sure if it 
matters.

среда, 3 августа 2022 г. в 20:31:47 UTC+7, niva...@gmail.com: 

> Thank you Bram, 
>
>- I added  as described.
>- Can you just look at this gif that shows that I have to source 
>$MYVIMRC to take account an import vim9script, then the function that 
> blink 
>the searched work is working.
>
>
>
> https://drive.google.com/file/d/1l4l_7M14eHjEG_cgwCpkm6NFX_QIWYCj/view?usp=sharing
>
> Le mercredi 3 août 2022 à 12:05:05 UTC+2, N V a écrit :
>
>> Import is now successfull, what is now wrong is overloading mapping as 
>> intended by D.Conway https://www.youtube.com/watch?v=aHm36-na4-4#t6m36s
>> as this :
>>
>> # Imported Functions {{{
>> import autoload 'nvhelper.vim' as that
>> # nnoremap   that.HLNext(80)  # CALL SUCCESS
>> *nnoremap  n n:* that.HLNext(80)   # FAILS 
>> GOTO NEXT
>> nnoremap  N N: that.HLNext(80)
>>
>>
>>
>> It seems to goto one time to item searched but don't do next jump.
>> Le mercredi 3 août 2022 à 11:51:49 UTC+2, Bram Moolenaar a écrit :
>>
>>>
>>> > Would import vim9 script as that. It seems to work when I directly 
>>> call 
>>> > that.foobar. 
>>> > 
>>> > But how to map the same call in a nnoremapping ? 
>>> > Thank you 
>>> > NV 
>>> > 
>>> > 
>>> > # Imported Functions {{{ 
>>> > import './vimfiles/autoload/nvhelper.vim' as that 
>>> > nnoremap n n:call that.HLNext(80) 
>>> > nnoremap N N:call that.HLNext(80) 
>>>
>>> Use ":help import-legacy" and then go up a few lines. 
>>>
>>> -- 
>>> The term "free software" is defined by Richard M. Stallman as 
>>> being software that isn't necessarily for free. Confusing? 
>>> Let's call it "Stallman software" then! 
>>> -- Bram Moolenaar 
>>>
>>> /// Bram Moolenaar -- br...@moolenaar.net -- http://www.Moolenaar.net 
>>> \\\ 
>>> /// \\\ 
>>> \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// 
>>> \\\ 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/0ad6f1f0-581a-4646-a40d-f4349ca7a2c2n%40googlegroups.com.


Re: Terminal window colors

2022-07-31 Thread Maxim Kim
https://github.com/vim/vim/pull/10828

воскресенье, 31 июля 2022 г. в 19:29:57 UTC+7, Maxim Kim: 

> This is a bug in remade colorschemes.
>
> We have fixed it and will provide updated colorschemes to vim in some near 
> future.
>
> https://github.com/vim/colorschemes/issues/198
>
> суббота, 30 июля 2022 г. в 23:33:31 UTC+3, matthew...@gmail.com: 
>
>>
>> сб, 30 июл. 2022 г. в 22:18, Alessandro Antonello :
>>
>>> Hi, everyone.
>>>
>>> O upgrade my MacVim to version 9 this week. Everything is Ok but the 
>>> terminal window colors. Before the upgrade, a terminal window, opened 
>>> inside a GUI view, assumed the foreground and background colors of the 
>>> current colorscheme normal group applyed to Vim. After the upgrade it seams 
>>> to assume the colors applyed to my default terminal App (Terminal.app on 
>>> macOS). Is there a way to restore the old behavior?
>>>
>>> Regards.
>>>
>>> -- 
>>> -- 
>>> 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+u...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/vim_use/CA%2BJN8R%2BFk7J_%3D20Feunp5Nsjuic1Hwa2N9POYfHX3KgZHLQQWQ%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/vim_use/CA%2BJN8R%2BFk7J_%3D20Feunp5Nsjuic1Hwa2N9POYfHX3KgZHLQQWQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>> Your colorscheme is probably outdated. Needs ":hi link Terminal Normal" 
>> to make it follow Normal color.
>>
>> Best regards,
>> Matvey
>>
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/0659b8ee-05b0-4311-a176-cfb91cbedc45n%40googlegroups.com.


Re: Terminal window colors

2022-07-31 Thread Maxim Kim
This is a bug in remade colorschemes.

We have fixed it and will provide updated colorschemes to vim in some near 
future.

https://github.com/vim/colorschemes/issues/198

суббота, 30 июля 2022 г. в 23:33:31 UTC+3, matthew...@gmail.com: 

>
> сб, 30 июл. 2022 г. в 22:18, Alessandro Antonello :
>
>> Hi, everyone.
>>
>> O upgrade my MacVim to version 9 this week. Everything is Ok but the 
>> terminal window colors. Before the upgrade, a terminal window, opened 
>> inside a GUI view, assumed the foreground and background colors of the 
>> current colorscheme normal group applyed to Vim. After the upgrade it seams 
>> to assume the colors applyed to my default terminal App (Terminal.app on 
>> macOS). Is there a way to restore the old behavior?
>>
>> Regards.
>>
>> -- 
>> -- 
>> 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+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vim_use/CA%2BJN8R%2BFk7J_%3D20Feunp5Nsjuic1Hwa2N9POYfHX3KgZHLQQWQ%40mail.gmail.com
>>  
>> 
>> .
>>
>
> Your colorscheme is probably outdated. Needs ":hi link Terminal Normal" to 
> make it follow Normal color.
>
> Best regards,
> Matvey
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/2e6bcb02-a3e7-44db-9c8c-89823e3aba63n%40googlegroups.com.


vim9 file manager/dir explorer

2022-07-27 Thread Maxim Kim
Hi, for those of you who already have vim9, could you test "a new plugin" 
that serves a role of simple file manager / dir explorer?

https://github.com/habamax/vim-dir

Thank you!

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/c7e6de4b-3b75-45f0-8238-3910acc187d7n%40googlegroups.com.


Re: [VIM] Re: [VIM] Re: [VIM] Re: vim/colorschemes: Request For Comments

2022-02-15 Thread Maxim Kim


вторник, 15 февраля 2022 г. в 13:44:16 UTC+3, Walter Cazzola: 

> As replied to Romain, also the manual installation fails. 
>

The directory structure I see is not what `:h packages` would suggest to 
have.

In the end it should have smth like: 

/home/username/.vim/pack/bundle/start
└── colorschemes
├── README.md
├── colors
│·· ├── README.txt
│·· ├── blue.vim
│·· ├── darkblue.vim
│·· ├── delek.vim
│·· ├── desert.vim
│·· ├── elflord.vim
│·· ├── evening.vim
│·· ├── industry.vim
│·· ├── koehler.vim
│·· ├── morning.vim
│·· ├── murphy.vim
│·· ├── pablo.vim
│·· ├── peachpuff.vim
│·· ├── ron.vim
│·· ├── shine.vim
│·· ├── slate.vim
│·· ├── tools
│·· │·· ├── check_colors.vim
│·· │·· ├── sample_base.vim
│·· │·· ├── sample_diff.vim
│·· │·· ├── sample_messages.vim
│·· │·· └── sample_popupmenu.vim
│·· ├── torte.vim
│·· └── zellner.vim
├── colortemplate
│·· ├── _diff
│·· ├── _tcozero
│·· ├── blue.colortemplate
│·· ├── darkblue.colortemplate
│·· ├── delek.colortemplate
│·· ├── desert.colortemplate
│·· ├── elflord.colortemplate
│·· ├── evening.colortemplate
│·· ├── industry.colortemplate
│·· ├── koehler.colortemplate
│·· ├── morning.colortemplate
│·· ├── murphy.colortemplate
│·· ├── pablo.colortemplate
│·· ├── peachpuff.colortemplate
│·· ├── ron.colortemplate
│·· ├── shine.colortemplate
│·· ├── slate.colortemplate
│·· ├── torte.colortemplate
│·· └── zellner.colortemplate
└── tags

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/ae16b47e-27a4-47a3-ad1f-6dff9b640d4en%40googlegroups.com.


Re: [VIM] Re: [VIM] Re: vim/colorschemes: Request For Comments

2022-02-14 Thread Maxim Kim
Hi Walter, looks like your vim/colorscheme installation is not "correct".

Your `:verbose hi Normal` command shows that original murphy was used, not 
the one from vim/colorschemes.

I can't tell anything about vundle as I don't use it, but the simplest way 
to install a "plugin" from github is to clone it into your 
`~/.vim/pack/bundle/start` directory ("bundle" is an arbitrary name here):

git clone g...@github.com:vim/colorschemes.git ~/.vim/pack/bundle/start/

вторник, 15 февраля 2022 г. в 01:28:25 UTC+3, Walter Cazzola: 

> Hi
>
> On Mon, 14 Feb 2022, Romain Lafourcade wrote:
>
> > @Walter Cazzola, could you do
> >
> > :verbose hi Normal
> >
> > and report back with the exact output?
>
> I get this:
> :verbose hi Normal
> Normal xxx ctermfg=121 ctermbg=0 guifg=lightgreen guibg=Black font=DejaVu 
> Sans Mono 10
> Last set from /usr/share/vim/vim82/colors/murphy.vim line 14
>
> Walter
>
> > Le lundi 14 février 2022 à 11:03:34 UTC+1, Walter Cazzola a écrit :
> >
> >> Uhm, what should I notice? I'm using murphy in gvim and still I've to 
> use
> >> CSApprox to have it behaving closely in a terminal. Maybe I'm doing
> >> something
> >> wrong. I used vundle to install it.
> >>
> >> Walter
> >>
> >> On Sun, 13 Feb 2022, Lifepillar wrote:
> >>
> >>> On 2022-02-12, Romain Lafourcade  wrote:
>  thanks to the hard work of a small but motivated team, a
>  first milestone is finally within reach
> >>>
> >>> As a mostly passive observer of the development of this project, I feel
> >>> compelled to thank you for undertaking this time-consuming task with
> >>> invincible passion! I can testify that it was no mean feat.
> >>>
>  - due to the _many_ inconsistencies plaguing the originals, we 
> generally
>  favored the _spirit_ to the _letter_ so the peachpuff remake (to 
> really
>  pick a random example) _is not the original peachpuff_; it still 
> retains
>  much of what made peachpuff peachpuff but in a much more usable and
>  up-to-date package.
> >>>
> >>> Compatibility (with terminal and GUI environments, and with Vim's own
> >>> highlighting definitions) has been greatly improved. This makes the 
> user
> >>> experience so much better: to pick a random example, peachpuff used 
> only
> >>> 0-15 colors in terminals, so activating it in 256-color capable
> >>> terminals would leave the user wondering why it didn't look like
> >>> peachpuff (or worse, why it looked completely different in different
> >>> terminals). But the number of improvements is really huge.
> >>>
> >>> Thanks again for setting the path forward and raising the bar for color
> >>> schemes: hopefully, it will become now easier to add new ones, finally
> >>> pushing forward https://github.com/vim/vim/issues/1665. Personally, 
> I'd
> >>> like to see a joint effort to produce an original and fresh color 
> scheme
> >>> created specifically for Vim (9?), in the same way as some other 
> editors
> >>> have "their own" branding color scheme. But maybe this is wishful
> >>> thinking...
> >>>
> >>> Life.
> >>>
> >>>
> >>>
> >>
> >> --
> >> Walter Cazzola, PhD, Associate Professor, Computer Science, Univ. of 
> Milano
> >> caz...@di.unimi.it @w_cazzola Ph: +39 02 503 16300 HP: 
> cazzola.di.unimi.it
> >> · · ·  · · ·  · 
> · ·
> >> ... recursive: adjective, see recursive ...
> >> · · ·  · · ·  · 
> · ·
> >>
> >
> >
>
> -- 
> Walter Cazzola, PhD, Associate Professor, Computer Science, Univ. of Milano
> caz...@di.unimi.it @w_cazzola Ph: +39 02 503 16300 HP: cazzola.di.unimi.it
> · · ·  · · ·  · · ·
> ... recursive: adjective, see recursive ...
> · · ·  · · ·  · · ·
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/259cc6c6-88c9-4d20-b5c8-90c683663c81n%40googlegroups.com.


vim9script process a range with a function

2022-01-11 Thread Maxim Kim
How in vim9script a range should be processed by a def function?

Vim9.txt states that def functions do not support range option.

So given a range what def function would/should do? Run it for every line 
in range?

How do I get smth similar to a:firstline and a:lastline?

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/1f5954ad-48e5-4cab-9e56-7751dd7c46cbn%40googlegroups.com.


Re: syntax include and spellcheck

2011-05-22 Thread Maxim Kim
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


syntax include and spellcheck

2011-05-21 Thread Maxim Kim
Hi,


Is there any way I can have spellcheck and 'syntax include' in one buffer?

If I open new buffer and enter there:

Hello wld

then after :setlocal spell spelllang=en
I have 'wld' highlighted as spellbad.

Now if I execute
:syntax include @testgroup syntax/python.vim

spellchecker stops highlighting 'wld'.

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


Re: How Could I modify the Vim Script Type

2010-12-23 Thread Maxim Kim


On Thursday, December 23, 2010 10:33:56 PM UTC+3, Bram Moolenaar wrote:


 Shawjia wrote:

  I just upload a new Vim Scipt to vim.org. (
 http://www.vim.org/scripts/script.php?script_id=3376)
  For some reasons, I forget to select the right Script Type.
  Now the type of this script is syntax, I want to modify it to
  utility.
  But when I edit the script detail, it seems I can only modify the
  script name, summary, etc. except script type.
  How could I fix it?
  Could anyone tell me?

 I have changed it for you.  phpmyadmin makes it possible :-).


Hi Bram!
Could you change script type of vimwiki plugin from ftplugin to utility? 
http://www.vim.org/scripts/script.php?script_id=2226

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


Re: Change plugin owner on vim online?

2010-12-15 Thread Maxim Kim

On Wednesday, December 15, 2010 10:32:06 AM UTC+3, H wrote:

 Hi,
 Is it possible to change plugin owner on vim online?
 Thanks.


I don't think so. I would love to change type of my plugin from ftplugin to 
utility myself but there is no way to do. Unless you ask Bram I believe. 

-- 
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


Getting background color of Normal highlight group.

2010-10-05 Thread Maxim Kim
Hi,


Could anyone point me if there is a way I can find out background
color of Normal highlight group?

I need it in form of #RRGGBB.

What I have at the moment:


redir = hlstatus
silent hi Normal
redir END
echo matchstr(hlstatus, 'guibg\s*=\s*\zs\S\+')


It
   * prints empty string on 'default' colorscheme -- that is fine;
   * prints #40 on 'darkblue' colorscheme -- fine too;
   * prints 'darkBlue' on 'blue' colorscheme -- that's not what I
want.

Is it possible to convert 'darkBlue' type of colors to #RRGGBB format?

Or is there an easier way to find background color?

-- 
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


Re: How could I show the line by indent as in notepad++?

2010-07-31 Thread Maxim Kim
 'colorcolumn' option depends on the value of textwidth, and can only
 highlight one
 column. Is there any other method? Thank you.

try
:set colorcolumn=4,8,12,16

-- 
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


Re: Request for Win Gvim to match *nix re: .vimrc/.gvimrc/.vim

2010-07-23 Thread Maxim Kim


On 23 июл, 05:49, Linda W v...@tlinx.org wrote:
 I'd like to try to reuse my files as much as possible w/o modications, so when
 files go missing or I need to reinstall in a new dir or such, I can just
 tar or zip up one dir or just use 'cp -a' from the linux dir to the windows 
 dir.

 Gvim does look for and use .vim/.gvim (though it doesn't look for them
 first, as I wish it would) -- but it doesn't seem to look for .vim at all --
 I thought it used to, but I can't verify that so it might have been imagined.

 So can it be brought up to conform with the *nix version and look for the
 .vim{/,rc} versions, and if they don't exist, then look for the DOS 
 compatible
 file names?

I have the following lines in my .vimrc:

 use .vim folder instead of vimfiles on windows.
if !has(unix)
  set rtp
  let rtp = expand('~/.vim').','.rtp.','.expand('~/.vim/after')
endif

-- 
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


Re: Right margin highlighting not working when opening more windows.

2010-07-23 Thread Maxim Kim
On 23 июл, 13:30, Frans Grotepass fmgrotep...@yahoo.co.uk wrote:
 On Friday 23 July 2010 10:23:55 Frans Grotepass wrote: Hi all,

  I enabled right margin highlighting using

     :match rightMargin /.\%100v/
     :highlight rightMargin guifg=black
     :highlight rightMargin guibg=pink

  When I open a second window using split or vsplit, then the margin
  highlighting is not active. How can I enable the margin highlighting?

 Found it...
 autocmd WinEnter * if !exists('w:created') | :match rightMargin /.\%100v/ | 
 endif

JFYI, Vim73 has 'colorcolumn'

'colorcolumn' is a comma separated list of screen columns that are
highlighted with ColorColumn |hl-ColorColumn|.  Useful to align
text.  Will make screen redrawing slower.
The screen column can be an absolute number, or a number preceded
with
'+' or '-', which is added to or subtracted from 'textwidth'. 

:set cc=+1   highlight column after 'textwidth'
:set cc=+1,+2,+3   highlight three columns after 'textwidth'
:hi ColorColumn ctermbg=lightgrey guibg=lightgrey

When 'textwidth' is zero then the items with '-' and '+' are not
used.
A maximum of 256 columns are highlighted.

-- 
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


Re: scratch buffer on start up

2010-05-06 Thread Maxim Kim

On 6 май, 13:15, john Maclean jaye...@gmail.com wrote:
 Chaps,

 Check this out - going from emacs to vim, (again) as emacs' keybindings
 are a pain on a mac book pro.

 There must be a way to have vim create a scratch buffer on start up.

The following line in your vimrc might help:

au VimEnter * if empty(expand('%')) | set buftype=nofile | endif

-- 
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


Re: au BufReadPost * if readonly | set nomodifiable

2010-05-05 Thread Maxim Kim

On 5 май, 08:43, rudy_b rudyke...@yahoo.com wrote:
 Hi,
 I have included the autocmd (listed below) in my .vimrc file.
  au BufReadPost * if readonly | set nomodifiable

 The intention is to not let gvim even modify the read only files, which
 works great with some downside.

 It only works when I just start a new gvim window!!! If, in the same window,
 I load a different buffer (by opening a new read only file) I have to go in
 and manually do set nomodifiable... which is very annoying.

I have just tried your autocommand and it works for me with 2 readonly
buffers.

-- 
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


Re: au BufReadPost * if readonly | set nomodifiable

2010-05-05 Thread Maxim Kim


On 5 май, 19:54, rudy_b rudyke...@yahoo.com wrote:
 hi,
 how did you open your second file? Cause it doesn't work for me.
 I am using either :vsplit or :sp   and non works

I did it with :e command. I have also tried :sp -- it works just fine.

Could you show us your .vimrc?

-- 
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


Re: menu for buffers of specific filetype

2010-04-04 Thread Maxim Kim


On 5 апр, 08:44, Tony Mechelynck antoine.mechely...@gmail.com wrote:
 I'm surprised that there was no answer to this post in almost two months.

 Yes, in Vim the only way to detect that a buffer has been entered or
 left is by means of autocommands. Since you want to take some action
 (modify the menus, which in Vim are normally global) depending on which
 buffer is current, you would have to harness some autocommand events,
 probably BufEnter and BufLeave.

 Best regards,
 Tony.

Thanks, Tony.
I use those 2 (plus BufHidden) autocomands to enable/disable menus
since the first letter.

Maxim.

-- 
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

To unsubscribe, reply using remove me as the subject.


Width of the visual selection

2010-03-26 Thread Maxim Kim
Hi!

Is there a way one can get visual selection width without corrupting
registers?

Say I have 'dummy text' visually selected.

Using registers I can find the length by using:

y
echo len(getreg(''))

I thought strpart with col('`') and col('`') would work but it
doesn't as col('`') returns 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

To unsubscribe from this group, send email to 
vim_use+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Width of the visual selection

2010-03-26 Thread Maxim Kim
On 26 мар, 15:28, Jürgen Krämer jottka...@googlemail.com wrote:
 High

 Maxim Kim wrote:

  Is there a way one can get visual selection width without corrupting
  registers?

  Say I have 'dummy text' visually selected.

  Using registers I can find the length by using:

  y
  echo len(getreg(''))

  I thought strpart with col('`') and col('`') would work but it
  doesn't as col('`') returns 0.

 you must use the non-backtick mark for col()

   echo col(')

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

To unsubscribe from this group, send email to 
vim_use+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: motion end of line excluding space

2010-03-11 Thread Maxim Kim
On 11 мар, 15:32, sinbad sinbad.sin...@gmail.com wrote:
 hi,

 how to move to end of line ignoring end of line spaces. meaning i have
 to move to first space of end of line.

Try :help g_

-- 
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


Re: Generate Header

2010-02-21 Thread Maxim Kim
On 21 фев, 14:20, epanda callingel...@hotmail.fr wrote:
 Hi,

 I would like to generate my header ;

 func! GenereHeader()
         let l:header = \** . \n
         let l:header .= \\\* ... . \n
         let l:header .= \\\* @author ONEPERSON . \n
         let l:header .= \\\* . \n
         call setline(line('.'),l:header . getline(line('.')))
 endfunc

 Setline replace my line by header . my line but I don't understant why
 \n is not interpreted ?


You could try this one instead:

func! GenereHeader()
let l:header = [\**]
let l:header += [\\\* ...]
let l:header += [\\\* @author ONEPERSON]
let l:header += [\\\*]
call append(line('.')-1, l:header)
endfunc

Maxim.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Advanced vim auto-completion

2010-02-11 Thread Maxim Kim
On 11 фев, 11:30, Aman Jain amanjain.nit...@gmail.com wrote:
 Hi

 I am trying to build a lexical analyzer using flex. Following is a
 line which shows a regular expression and its corresponding action.

 [0-9] {printf(yada yada \n);} //regex1
 Is there a way to reuse {printf(yada yada \n);} from regex1 by auto-
 completion features of vim, so that I don't need to write the whole
 thing again while writing regex2?

 e.g.

 .* {printf(yada yada \n);} //regex2
 This goes beyond word completion, so I was wondering is this doable in
 vim?

 P.S.
  I know one can do this by storing the text in a register(aymotion),
 but I am looking for some divine vim auto-completion.

 TIA

Have you seen my answer to your question at Stackoverflow.com?

http://stackoverflow.com/questions/2242690/advanced-vim-autocompletion

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


menu for buffers of specific filetype

2010-02-09 Thread Maxim Kim
Hi,

What is the vim way to define filetype(or buffer) specific menus?
I want a menu to be available only in buffers of my filetype.
For mappings I usually use buffer but couldn't find it for :menu
command.

There is 'disable' exists though. But as far as I can see it needs
autocommands to set menus disabled/enabled depending on buffer. Is it
the only way?

Maxim.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Python indention

2010-01-28 Thread Maxim Kim
On 28 янв, 14:16, Torsten Andre q...@takb.net wrote:
 Hi everyone,
 I am having some trouble with my indention in python. I installed the
 indention plugin for Python under [1] and according to the
 documentation, I think comments starting with a # should not moved to
 the very left of the page, but the current line indention should be
 kept. In my case, whenever I type a # to start a comment, the comment
 is moved to the very left. I tried it including and excluding the plugin
 file (and restarting vim), but the behavior kept the same. Can someone
 tell me how to alter this stupid behavior?

set nosmartindent
:h smartindent

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: FIXME syntax highlighting.

2010-01-26 Thread Maxim Kim


On 26 янв, 18:35, Stroller strol...@stellar.eclipse.co.uk wrote:
 Hi there,


 The documentation [1] shows that syn clear perlTodo will clear this  
 highlighting for the current programming language, and presumably I  
 can put it in my .vimrc and never be bothered again when writing Perl.

 Is it possible to clear the syntax highlighting for ALL *Todo types,  
 without having to list javaTodo, pamconfTodo, groovyTodo, ...  
 individually?

:hi Todo none

Do it after :colorscheme in your .vimrc.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Plugin to manage buffers and tabs

2010-01-22 Thread Maxim Kim

On 22 янв, 02:55, Andy Wokula anw...@yahoo.de wrote:
 Am 21.01.2010 19:47, schrieb Foss User:
 It's all builtin:

 :set swb=usetab
 :tab sb {part-of-bufname}

You can omit :tab here
:sb {part-of-bufname}

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Plugin to manage buffers and tabs

2010-01-22 Thread Maxim Kim


On 22 янв, 13:27, Andy Wokula anw...@yahoo.de wrote:
 Am 22.01.2010 09:05, schrieb Maxim Kim:



  On 22 янв, 02:55, Andy Wokulaanw...@yahoo.de  wrote:
  Am 21.01.2010 19:47, schrieb Foss User:
  It's all builtin:

  :set swb=usetab
  :tab sb {part-of-bufname}

  You can omit :tab here
  :sb {part-of-bufname}

 ... yes, when a yet invisible buffer should be opened in
 a new window instead of a new tab page.

Indeed. Thanks!

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Vim plugin to maintain journal?

2010-01-22 Thread Maxim Kim


On 22 янв, 16:27, Gary Bickford gar37...@gmail.com wrote:
  AFAI can tell the VIM wiki plugin
 doesn't have folding support however.

As far as I know vimwiki has folding support. But it is quite slow
especially for a huge files.
For smaller ones it is more than useable though.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Plugin to manage buffers and tabs

2010-01-22 Thread Maxim Kim


On 22 янв, 18:24, Ben Fritz fritzophre...@gmail.com wrote:
 On Jan 21, 5:55 pm, Andy Wokula anw...@yahoo.de wrote:

  It's all builtin:

  :set swb=usetab
  :tab sb {part-of-bufname}

 or just:

 :set swb=usetab,newtab
 :sb {part-of-bufname}


Doesn't work for me when
when a yet invisible buffer should be opened in a new window instead of a new 
tab page.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Custom Paragraph Formatting with gq

2009-12-01 Thread Maxim Kim
On 1 дек, 09:05, Robert Chan vibrant.softw...@gmail.com wrote:
 I have logbook entries that have the following structure:

 Any ideas?

 (I've been reading 'formatoptions' and fo-table but could not find anything
 of related to custom paragraph settings.)

 Thanks.

Last time I tried to do almost the same I didn't find the way to do
it.
But
:h paragraph
could give you some information.

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: Custom Paragraph Formatting with gq

2009-12-01 Thread Maxim Kim
On 1 дек, 17:54, Andy Wokula anw...@yahoo.de wrote:
 Andy Wokula schrieb:

  Robert Chan schrieb:
  I have logbook entries that have the following structure:
  If it wasn't so d*** unusable, I would recommend 'formatexpr':
      :h 'fex

 Having sent that, I immediately regretted it.
 In this case, it isn't that hard:

 setlocal formatexpr=FexLogBook()

 func! FexLogBook()
     if mode() =~# '[iR]'
         return 1
     endif
     exec v:lnum. mark [
     exec (v:lnum + v:count - 1). mark ]
     '[,']s/^\[.*]$/\r/
     setl fex=
     normal! '[gq']
     setl fex=FexLogBook()
     '[,']s/^\[.*]\zs\n$//
     return
 endfunc

Wow!

Thanks, Andy!

-- 
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php


Re: About showbreak

2009-11-13 Thread Maxim Kim

On 13 ноя, 17:17, Andreas Kreienbuehl k7...@unb.ca wrote:
 Hi there

 For my vimrc, what would be the proper syntax for

 if 'beginning of line = n tabs (n an integer greater or equal to one)'
      do 'set showbreak = n tabs worth of white space'
 endif

I believe there is a patch that does what you want.
http://groups.google.com/group/comp.editors/browse_thread/thread/8cbd5e2fc06eb74d

 By the way, what language is the vimrc written in? Is it C? I'm pretty
 new to this but want to understand it better.
It is vimscript.

Type
:h eval
in vim to get some help.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: About showbreak

2009-11-13 Thread Maxim Kim

On 13 ноя, 17:53, Maxim Kim haba...@gmail.com wrote:
 On 13 ноя, 17:17, Andreas Kreienbuehl k7...@unb.ca wrote: Hi there

  By the way, what language is the vimrc written in? Is it C? I'm pretty
  new to this but want to understand it better.

 It is vimscript.

 Type
 :h eval
 in vim to get some help.

Better one
:h usr_41.txt

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: selectively disable filetype indent

2009-11-09 Thread Maxim Kim

On 9 ноя, 10:54, Rene de Zwart renew...@xs4all.nl wrote:
 I wrote a plugin for assisting in (x)(ht)(x)ml editing.
 However when
    filetype indent on
 is specified it messes up some actions in my plugin
 e.g.
 \t\thtml
 becomes
 html
 \t\t|
 /html
 AND I Expect it to become
 \t\thtml
 \t\t\t
 \t\thtml

 I used filetype indent off in my plugin. Which is global and not localized
 to the buffer. It works but the side effects are to much.

 Has someone a solution?

What about setting indent expression to nothing?
'setlocal indentexpr='

You can add it to your filetype or autocmd.

Best wishes,
Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: check if inoremap is set

2009-10-13 Thread Maxim Kim

On 13 окт, 11:27, Keyan key@googlemail.com wrote:
 hi,

 can i somehow ask if there was one set, or is there a better way to
 solve the problem?

Add the following line
inoremap buffer { { }ESCO

into the files(create if needed):
.vim/after/ftplugin/perl.vim
.vim/after/ftplugin/cpp.vim
etc.

:h map-buffer

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Possible bug with autochdir

2009-10-04 Thread Maxim Kim

On 3 окт, 23:51, Mikalai Chaly nch...@gmail.com wrote:
 The issue reason is command order.

 When you do set autochdir, vim changes current dir and sets up current
 buffer to use file myfile instead of test\myfile.

 Then set encoding brings up multibyte initialization, which re-writes
 parameters for buffer using new encoding. During this process, file name is
 changed from correct myfile to the original test\myfile and expanded to
 test\test\myfile.
I see, thanks for explanation.


 I'm not sure if this really a bug and how it can be fixed, but simple change
 of commands order brings us a workaround. Such vimrc:

 set nocp
 set encoding=utf-8
 set autochdir

 opens required file correctly.

I think that behaviour should be noted in ':h autochdir' in case this
is not a bug.


Best wishes,
Maxim.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Possible bug with autochdir

2009-10-03 Thread Maxim Kim

Hi,

Could anyone verify the next behaviour:

1. _vimrc should only have:
   set nocp
   set autochdir
   set encoding=utf-8
2. in the shell do:
   mkdir test
   echo hello world  test\myfile
   vim test\myfile

My vim do not open test\myfile it just says: test\myfile [New
DIRECTORY]

Now if you delete 'set endoding=utf-8' from your _vimrc so you would
have only:
set nocp
set autochdir

and run:
   vim test\myfile
Vim opens this file successfully.

Okay, now if I delete 'set autochdir' and return 'set encoding=utf-8'
like this:
set nocp
set encoding=utf-8

and run again:
   vim test\myfile
Vim opens this file successfully too.

It looks like with the combination of 'set autochdir' and 'set
encoding=utf-8' one can not open files in another dir from shell.

So I use autocmd approach now:
autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
instead of autochdir.


My vim is 7.2 with 1-148 patches applied on winXP.

Best wishes,
Maxim.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Windows console: unable to read/write russian text

2009-09-29 Thread Maxim Kim




On 29 сен, 09:36, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 On 29/09/09 06:37, Maxim Kim wrote:
 [...]

 IIUC, the Vim default for 'termencoding' is the empty string. Maybe that
 option is set elsewhere, maybe in the UTF-8-setting script that I
 published at vim-online, or maybe in some other script. What does
 Console Vim answer to

 :verbose set enc? tenc?

 immediately after startup (the way you normally start it, with vimrc and
 all)?
encoding=utf-8
Last set from ~\_vimrc
termencoding=cp866

 To know what console encoding yout WinXP uses, start Vim as

 vim -N -u NONE

 (which loads neither your vimrc nor any global plugins), then, after
 startup, ask

 :set enc?

 That should show you the default encoding used by the underlying terminal.
cp1251

PS
This is quite strange. If I (using my _vimrc with set enc=utf-8)
1. Change font to Lucida Console.
2. Write some text -- everything is ok. I can see correct russian
text.
3. Change font to standard bitmap font -- everything is ok. I can
see
previously entered russian text.
4. Write the same text -- previously entered text is ok, current
is crap
with a lot of triangles.
5. Change font to Lucida Console -- text from 2. is ok, text from
4. is
still crap but with questions and incorrect letters.
6. Press C-L and all the entered text (2, 4) is correct.

So the only option I can see for now is using Lucida Console.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Windows console: unable to read/write russian text

2009-09-29 Thread Maxim Kim


On 29 сен, 10:57, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 On 29/09/09 08:11, Maxim Kim wrote:
  PS
  This is quite strange. If I (using my _vimrc with set enc=utf-8)
   1. Change font to Lucida Console.
   2. Write some text -- everything is ok. I can see correct russian
  text.
   3. Change font to standard bitmap font -- everything is ok. I can
  see
   previously entered russian text.
   4. Write the same text -- previously entered text is ok, current
  is crap
   with a lot of triangles.
   5. Change font to Lucida Console -- text from 2. is ok, text from
  4. is
   still crap but with questions and incorrect letters.
   6. PressC-L  and all the entered text (2, 4) is correct.

 Oho! Sounds like a missing screen redraw somewhere. You aren't using
 'lazyredraw' by any chance? Also, what Vim version and patchlevel are
 you using? (as shown on the second non-blank line of the :intro
 screen, or as the first two lines -- starting VIM - Vi Improved and
 Included patches respectively -- in the output of :version)
Aha, I have 'set lazyredraw' in my _vimrc. (included patches 1-160)

 Or rather -- Vim is probably not aware that the font has been changed
 (see bottom paragraph before my sig below) so it doesn't redraw anything.
Actually at step 5 vim changes triangles to questions -- partial
redraw? :)


 What happens if you hit Ctrl-L (in Normal mode) between steps 4 and 5?
 My guess would be that the text from step 2 turns to crap,
Yep.

 which might indicate that your bitmapped font has wrong glyphs for your 
 current
 terminal encoding.
Actually at step 3 I can see russian letters of that bitmapped(!)
font. Then do c-l and they turn to crap, again in that bitmapped
font.

 I expect that the Russian would reappear after step
 6, even where it had changed to crap at step 4½.
True.


  So the only option I can see for now is using Lucida Console.

 Is that so bad? (in Console Vim, not gvim)
Not it isn't
If I knew Lucida console is okay for vim console I wouldn't email
here.

Thanks,
Maxim

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Windows console: unable to read/write russian text

2009-09-28 Thread Maxim Kim

Hi,

Can you tell me how can I setup my vim to handle russian (utf-8) text
in win console?
Simple russian phrase

Привет, меня зовут Максим.

is unreadable. Though I can copy and it paste here.

My settings are:
:set enc? tenc?
encoding=utf-8
termencoding=cp866

I thought it might be font issue, but with C-Z I can paste the same
text into shell and it looks good.
So this is not font issue.

Thanks,
Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Windows console: unable to read/write russian text

2009-09-28 Thread Maxim Kim

On 29 сен, 02:15, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 On 28/09/09 22:06, Maxim Kim wrote:

  My settings are:
  :set enc? tenc?
  encoding=utf-8
  termencoding=cp866

 I'm not sure.

 - IIUC, typing

 echo Здравствуйте мир!
  echo Здравствуй мир!
sounds better. :)

 at the cmd.exe prompt works OK (echoes the correct Russian greeting in
 reply) and the result can be pasted (but not into Vim)?
Yes.

 - Does it make a difference if you leave 'termencoding' empty?
No. I tried different termencodings (empty too) with no visible
effect.

 - Are you sure your console uses cp866? The email I'm replying to was in
 koi8-r.
I am not 100% sure it is cp866 but I use WinXP. Is there a way I can
check
what encoding it uses? Btw I do not setup termencoding in _vimrc so it
is vim
makes termencoding=cp866.


 Until (or unless) this issue is resolved, you ought to be able to use
 gvim (with the same settings), where anything can be stored in memory
 (as a UTF-8 bytestring) and displayed in the GUI in some well-chosen
 font.
I usually do use gVim but sometimes console vim comes in handy.
(commiting to
svn, hg etc). I have no encoding problems with gVim but consVim.

Thanks,
Maxim.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: f{char} over multiple lines

2009-09-24 Thread Maxim Kim

On 24 сен, 11:57, Nathan Huesken v...@lonely-star.org wrote:
 Hi,

 Can the command f{char} (jump to the next occurence of {char} in the
 current line) be extended to work with multiple lines?

I'd say no, but not sure.

Why not /{char}CR instead?


--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: How to save/restore buffer lists between vim sessions?

2009-09-23 Thread Maxim Kim

Hi,

On 23 сен, 10:20, pansz panshi...@routon.com wrote:
 In vim we can use :ls to list all buffers. You open 3 files, it all show
 in buffers.

 When you exit, and start vim without command-line arguments, the buffers
 are still there, use :ls list all buffers.
I have no buffers.

 When you start vim with a file name as argument, the buffers are
 cleared, use :ls list only the opened file and my buffer lists are lost
 forever.

No buffers here too.

 Is there anyway to preserve the buffer list when I start vim with a file
 name? Or if anyone can provide ideas on save/restore the buffer list so
 that I can use :ls to list buffer in the last vim session?

Did you try
:h Session

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Your own text objects: extending selection

2009-08-18 Thread Maxim Kim

Hi,

I want 'header' text object (select with 'vah') to be extendable by
further `ah` presses like ordinary `vaw`, `aw` works.

So this is example data:
= Header 1 =
asdflkja
asdlfkj
asldfkj
lkasdjf

== Header 2 ==
asdfsad
asdfasdf
sdfasdfas
asdfa

= Header 1 =
asdfasdfk

This is my attempt:
function! Count_first_sym(line) {{{
  let idx = 0
  while a:line[idx] == a:line[0]  idx  len(a:line)
let idx += 1
  endwhile
  return idx
endfunction }}}

function! TO_header() {{{
  if !search('^\(=\+\)[^=]\+\1\s*$', 'bcW')
return
  endif

  let level = Count_first_sym(getline(line('.')))

  normal V

  if search('^\(=\{1,'.level.'}\)[^=]\+\1\s*$', 'W')
call cursor(line('.') - 1, 0)
  else
call cursor(line('$'), 0)
  endif
endfunction

vmap ah :call TO_header()CR

It only selects a header and I don't know where to dig to make it
extendable to select further.

Any suggestions?

Thanks,
Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Using a variable as a command's 'count' argument

2009-07-29 Thread Maxim Kim


On 29 июл, 09:02, Daniel Tripp qpmirruvnnvwoca...@dt.theorem.ca
wrote:
 Hello all.  I have a situation that I can't figure out.

 Say that I have set a variable like this:

 :let desiredcolumn=42
 ...
 But instead of a constant like 42, I want to take the value from my
 'desiredcolumn' variable.  Something like this:

 :map F2 desiredcolumnbar

 But of course that doesn't work.

 Any suggestions?

Use cursor() function instead:

:let g:desiredcolumn = 42
:map F2 :call cursor(line('.'), g:desiredcolumn)CR


Best wishes,
Maxim.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: testing for an empty file

2009-07-27 Thread Maxim Kim

On 27 июл, 23:07, at atorgovit...@gmail.com wrote:
 I'm using a very nice template plugin called tSkeleton. Right now I'm
 operating it using an autocmd in my .vimrc:
     autocmd BufNewFile *.f90      TSkeletonSetup fortran.f90

 This works great when I start a new buffer from within .vim. However
 sometimes I want to touch and name a new file and then open it
 directly by double clicking on it in my GUI (a boorish practice, I
 know ;).

You could use the following approach:

function! RunOnEmptyBuffer()
  if line('$') == 1  getline('$') == ''
echo Buffer is empty!
 do other stuff on empty buffer here
  endif
endfunction

au BufEnter * call RunOnEmptyBuffer()


Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Some o command that breaks the line at the cursor?

2009-05-19 Thread Maxim Kim

Hi Raúl
On 19 май, 13:35, Raúl Núñez de Arenas Coronado raul...@gmail.com
wrote:
 Hi all :)

 Moreover, in my map I want to do something like this (which doesn't
 work):

 nnoremap bufferLeadero :while getline(.)[col(.) - 1] ==
 ''\|normal l\|endwhileCR
It doesn't work for me either. I suppose that 'map' has the similar
limitation as :execute has.

As far as I can see the following mapping does what you want:
nnoremap bufferLeadero :call search('\+', 'cWe')CR

Best wishes,
Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Remapping the Enter key

2009-05-19 Thread Maxim Kim

On 20 май, 08:36, Matt Wozniski m...@drexel.edu wrote:
 2009/5/19 Raúl Núñez de Arenas Coronado:
 Don't know if you've thought about it, but an expr map might be suitable...

 nnoremap expr Enter SuperEnter()
 inoremap expr Enter SuperEnter()

 function! SuperEnter()
   if match(getline('.'), some context)  0
     return \CR
   endif

   echomsg Magic!
   return 
 endfunction

Wow, thanks for :map-expr !
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: dw command not work propely with russian words

2009-05-18 Thread Maxim Kim

On 18 май, 22:06, crm79 chechul...@gmail.com wrote:
 if i type in vim слово, then after first using 'dw' -command deletes
 only char с (result is лово), after second use 'dw'-command result
 is ово. This is a bug?

I suppose you use encoding other than utf8.
What is the output of :set encoding ?

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: can vim do this simple syntax translate

2009-04-19 Thread Maxim Kim

On 20 апр, 08:27, Sean guo.xiaoy...@gmail.com wrote:
 For example, I have a text file in which
 there are a lot of expressions in the following form:

        id = number

 id: [a-z]+
 number: [0-9]+

 I want to rewrite these expressions into this form

           (set id number)

 is it possible to do this in vim?
Yes. Something like
:%s/\([a-z]\+\)\s*=\s*\([0-9]\+\)/(set \1 \2)/g

Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: How do I shift a line by char characters instead of a tab?

2009-04-16 Thread Maxim Kim

On 16 апр, 17:35, Thierry lamthie...@gmail.com wrote:
 If I want to shift a few lines 3 chars to the right, I use the
 following command:

 set sw=3
 // select the number of lines I want to shift from where my cursor is
 // 

 However, the above shifts my lines by a tab character of size 3.  How
 do I configure the above so that it shifts my lines by 3 character
 spaces instead of a tab?

:set expandtab
should help you.

Regards, Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Search a pattern contained in a register

2009-04-15 Thread Maxim Kim

On 15 апр, 10:27, Aman Jain amanjain.nit...@gmail.com wrote:
 How can I search for the text contained in a register(after yanking).
 e.g. if I did a ' ayw ' (copy a word to register a) on an
 identifier,
 but after some time navigate away , and then need to search for the
 same,
 then how do I get the contents of the register a after pressing / ?

Just press Ctrl+R then a:
/C-Ra

Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Keymap and q-macro

2009-04-13 Thread Maxim Kim

On 13 апр, 11:16, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 What is in register q? (:reg q without the quotes will tell you). If
 it's aGhbdtn? Vbh! (without the quotes) then the language-mapping
 wasn't applied to the recorded keystrokes, but only to what got written
 into the buffer.
It is aGhbdtn? Vbh! which is bit unexpected for me -- keymapped q-
macro yields to non-keymapped chars in insert mode.

 For this kind of repeated insert, do it once without recording, yank
 it into a register of your choice (let's say a) (see :help v_a), and
 put it from there (using either ap in Normal mode or Ctrl-R a in
 Insert mode) when needed. I have several such repeated inserts in
 various registers, but I practically never use q-style recording.
Thanks, so if I want russian text in a q-recording I have to paste it
from a named register or switch to system-wide russian to type it in.

Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Move to a pattern without destroying the last search pattern?

2009-04-12 Thread Maxim Kim

On 12 апр, 14:25, Dennis Benzinger dennis.benzin...@gmx.net wrote:
 Hi!

 Sometimes I want to move to a pattern without actually searching for it.
 That is I don't want to destroy the last search pattern and I don't want
 to change the hlsearch highlighting.

 Is there a command for this?

 If not, would something like the following work:

 :let last_search_pattern = @/
 :let last_hlsearch = hlsearch
 /new_pattern
 :let @/ = last_search_pattern
 :let hlsearch = last_hlsearch

:h search()
:call search('pattern')
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Keymap and q-macro

2009-04-12 Thread Maxim Kim

Hi
I have just found that I can not use russian text in a q-macro using
russian keymap.
In normal mode:
qqaПривет, Мир!q
Then @q and result is:
Ghbdtn? Vbh!

I tried it at vanilla vim 7.2 and vim 7.2 1-148.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Check if highlight exists and not cleared.

2009-04-09 Thread Maxim Kim

Hi

How can I check if highlight exists (was defined by a colorscheme)?

For example if I define a group:
:hi HelloWorld guifg=green
I can check its existance with
:echo hlexists(HelloWorld)

And if I change colorscheme
:colo desert
highlight still exists but has clear status.

So, is there a way I can check if that group was cleared?

Maxim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Check if highlight exists and not cleared.

2009-04-09 Thread Maxim Kim

On 9 апр, 11:46, Tony Mechelynck antoine.mechely...@gmail.com wrote:
 func HlExists(hl)        untested
         if !hlexists(a:hl)
                 return 0
         endif
         redir = hlstatus
         exe silent hi a:hl
         redir END
         return (hlstatus !~ cleared)
 endfunc

Thanks, Tony!

Best regards,
Maxim.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Decimal to hexadecimal

2009-04-08 Thread Maxim Kim

Hi,

Can I convert decimal number to a hexadecimal in vimscript?
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Decimal to hexadecimal

2009-04-08 Thread Maxim Kim



On 8 апр, 13:11, Teemu Likonen tliko...@iki.fi wrote:
 On 2009-04-08 01:48 (-0700), Maxim Kim wrote:

  Can I convert decimal number to a hexadecimal in vimscript?

 Yes, for example:

     printf('%x', 1234)
     printf('%X', 1234)
     printf('%04x', 1234)

Thanks!
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: to prevent comment startting from new line

2009-04-06 Thread Maxim Kim

On 6 апр, 10:20, Visco Shaun visc...@gmail.com wrote:
 While programming in python whenever i type '#' to start commenting it
 goes to the start of the line rather than at the indented position where
 i like it to be added. Is there any command to prevent this behaviour
 without changing any other settings?

Using my search-fu I dig out:
http://groups.google.com/group/vim_use/browse_thread/thread/623c13a3819ebd83/087ebae05e41295b?#087ebae05e41295b
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



netrw colors

2009-04-03 Thread Maxim Kim

Hi,

In my colorscheme I want to redefine some netrw colors:

hi link netrwData Operator
hi link netrwLib Operator
hi link netrwMakeFile Operator
hi link netrwClassify Constant
hi link netrwHidePat Constant
hi link netrwList Constant

But it doesn't work. It looks like netrw syntax file uses
'highlight link' instead of 'highlight default link' so my color
definition is redefined by netrw.
I do not have the latest runtime at the moment so I can't check it
myself.

PS.
I would mail Charles E. Campbell if I had access to my e-mail
accounts.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: netrw colors

2009-04-03 Thread Maxim Kim

On 3 апр, 11:13, François Ingelrest francois.ingelr...@gmail.com
wrote:
 On Fri, Apr 3, 2009 at 09:00, Maxim Kim haba...@gmail.com wrote:
 Have you tried using '!' ? I.e., hi! link netrwData Operator
Yes I have. No effect. As expected.

 I raised the 'default' issue once, and Charles did change netrw:

 http://groups.google.com/group/vim_use/browse_thread/thread/f76fc54a4...
Blame me -- I didn't use my search-fu. :)

 So at least in the latest versions (I have v133i), the 'default'
 keyword is there.
That is nice, thanks!

Maxim Kim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Replacing a character in a string

2009-04-02 Thread Maxim Kim


On 2 апр, 19:34, Spiros Bousbouras spi...@gmail.com wrote:
 let s = 'qwerty'
 Let's say I want to replace the first character by Q. I thought
 the following would work
 let s[0] = 'Q'   but it gives
 E689: Can only index a List or Dictionary
 So what is the simplest way to achieve such a task ?
...
 Anyone got a better idea ?

let s='qwerty'
let s='Q'.s[1:]

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: local options in autocmds apply settings to wrong buffer

2009-04-02 Thread Maxim Kim

On 2 апр, 20:14, Ben Fritz fritzophre...@gmail.com wrote:
 This simple test case demonstrates my problem:

 vim -u NONE -N -i NONE

 :autocmd BufRead *.txt setlocal wrap
 :view test.txt
 :tabe test.c
 :setlocal nowrap

 Now modify test.txt outside of Vim and give focus back to Vim to
 trigger a reload of test.txt.

 Vim is still in the test.c tab, so when the BufRead autocmd fires,
 'wrap' is set for test.c instead of test.txt.
I confirm it. Looks like a bug to me.

Regards,
Maxim Kim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: NERD_tree color scheme

2009-03-28 Thread Maxim Kim

On 28 мар, 18:12, JuanPablo jabar...@gmail.com wrote:
 hi,
   I have the same problem, and I added the highlight
 :hi Directory
 Directory      xxx term=bold ctermfg=3 ctermbg=4 guifg=Cyan
:hi Direcory shows current highlight settings for group named
'Directory'.

Use the following for gVim to change Directory group settings:
:hi Directory guifg=red guibg=green

Regards
Maxim Kim
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: How to split multiple CSS rules into one line each?

2009-03-26 Thread Maxim Kim

On 26 мар, 09:20, Leandro N. Camargo leandro...@gmail.com wrote:
 Now, what if I want to do the reverse, tranforming this:

 a.anything {
   color:#eee;
   display:block;
   width:300px;

 }

 onto this:

 a.anything {color:#eee;display:block;width:300px;}

 ???

Try
g/[;}]\s*$/-1j

It works for me with:
a.anything {
  color:#eee;
  display:block;
  width:300px;
}
a.anything {
  color:#eee;
  display:block;
  width:300px;
}

Result:
a.anything { color:#eee; display:block; width:300px; }
a.anything { color:#eee; display:block; width:300px; }

Regards,
Maxim Kim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: How to split multiple CSS rules into one line each?

2009-03-26 Thread Maxim Kim

On 26 мар, 09:56, Maxim Kim haba...@gmail.com wrote:
 Try
 g/[;}]\s*$/-1j

 It works for me with:
 a.anything {
   color:#eee;
   display:block;
   width:300px;}

 a.anything {
   color:#eee;
   display:block;
   width:300px;

 }

Result:
a.anything { color:#eee; display:block; width:300px;
}
a.anything { color:#eee; display:block; width:300px;
}

Run  :g/[;}]\s*$/-1j one more time to get
a.anything { color:#eee; display:block; width:300px; }
a.anything { color:#eee; display:block; width:300px; }

Or use
:g/\%([;}]\s*$\|^\s*$\)/-1j

Regards,
Maxim Kim.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: use vim's command mode when typing commands?

2009-03-26 Thread Maxim Kim

On 26 мар, 12:55, fka...@googlemail.com fka...@googlemail.com
wrote:
 Hi all,

 probably I do not express myself correctly in the subject, and as you
 might see, it's almost impossible to find something reasonable in the
 internet with these keywords ... ;-)

 When I type in comands like :help something or :mak long_filename:
 Can I somehow switch to vim's command mode even here, for example to
 move the cursor with h, j, k, l or to insert somthing from the buffer
 with p etc.?

:h q:

While in command mode press C-F.
While in normal mode press q:

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Can I run vimscript in arbitrary buffer?

2009-03-21 Thread Maxim Kim

On 21 мар, 20:08, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 On 18/03/09 10:26, Maxim Kim wrote:

 See :help E10 and check your backslashes. Also, what does

         :verbose set cp?
 (with the question mark) tell you?
nocompatible
 Last set from ~\_vimrc


 Anyway, the safest way to run a (possibly long) vimscript is to source
 it after having saved it. Why don't you want to save your script?
Usually I do save  source my script files. But sometimes there are
moments I want to test some vimscript. So I create a new buffer, write
and test functions there and if everything is ok I move them into my
script file.
It is also really convenient to tune colorschemes -- add bunch of
colors for a single group:
  hi Identifier guibg=#e8f0e0 guifg=#306010 gui=none
  hi Identifier guibg=#e8f0d0 guifg=#306010 gui=italic
  hi Identifier guibg=#e8f0c0 guifg=#306010 gui=bold
  hi Identifier guibg=#e8f0b0 guifg=#306010 gui=none
Try every highlight and choose preffered one.

Anyway the following mappings work for me (without longlines)
 run selected vimscript
vmap Leaderr vy:@vCR
 run vimscript line
nmap Leaderr vyy:@vCR


PS
Is the next command Ex one?
map C-d ihello
\worldESC
If it is, shouldn't 2yy:@ command run it flawlessly?
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Can I run vimscript in arbitrary buffer?

2009-03-18 Thread Maxim Kim

Hi,

What is if it exist the right way to run vimscript from a buffer
without saving it first?
I know about :@ but it can't process vimscript's longlines. If I copy
the following lines into unnamed register:

map F4 m`:silent! %s/\(\s\+$\)\\|\(\r$\)//gCR``
  \:echo Remove trailing spaces and ^Ms ...CR

and try to run it using :@ I get the error E10.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Maxim Kim

Hi,

I have a (ft)plugin that overrides filetype of .wiki extension from
flexwiki to vimwiki. Everything seems quite good except for a state of
just opened buffer that is in 'changed' one.
As far as I can see FlexWiki ftplugin does :setlocal bomb command that
puts vim's buffer in a 'changed' state.
As a workaround I suggest vimwiki users to delete a line from
filetype.vim or use another file extension for vimwiki's files.
It looks like this is the only standard ftplugin that sets bomb on
it's files.

But anyway, shouldn't vim revert setlocal stuff?
I can see:
let b:undo_ftplugin = setl tw wrap lbr et ts fenc bomb ff
in flexwiki.vim and it doesn't work for bomb.

PS
To test it:
:e ~/aaa.wiki
:w
:set ft=html
:q
E37: No write since last change ...
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Maxim Kim


On 16 мар, 16:20, Tony Mechelynck antoine.mechely...@gmail.com
wrote:
 ...
 Note that altering any of these three options in an undo_ftplugin line
 is courting disaster: Vim has a separate mechanism to detect these
 options' values when opening an existing file, and the results are
 usually correct; for new files, you might have set them manually to
 something else than the global default, and if I did that I would expect
 Vim to respect my choice even if I later change the filetype.
So one shouldn't do like this:
 let b:undo_ftplugin = setl bomb
 setlocal bomb
in ftplugin, should him?
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Maxim Kim

On 16 мар, 22:57, Ben Fritz fritzophre...@gmail.com wrote:
 On Mar 16, 12:00 pm, Maxim Kim haba...@gmail.com wrote:

  On 16 мар, 19:12, Ben Fritz fritzophre...@gmail.com wrote:

 Unix-like systems have a patch utility that does the opposite of
 diff so that you can take the difference between two files, apply it
 to one, and get the other.
I was hoping vim could do it. :)

 On Windows, you can either find a version of this patch utility, or
 merge it manually. The patch linked above is a contextual diff so
 you should be able to fairly easily find the appropriate place in the
 file, then copy-paste from the patch as needed.
Yep, thanks.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug with Title highliting

2009-03-14 Thread Maxim Kim

On 14 мар, 02:27, Maxim Kim haba...@gmail.com wrote:

 Now I can see that letter.
 I do not know what happend but I did those steps 3 times before post
 here and the letter was invisible.
 Weird.

The problem is in Dejavu Sans Mono font. With font size 12 bold
russian letter 'У' is invisible. In vim and notepad.
So that is not vim's fault. :)


--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Bug with Title highliting

2009-03-13 Thread Maxim Kim

Hi,

Could someone confirm the following bug -- if some russian text
highlighted as Title then letter У is invisible.
Hitting ga shows me У 1059, Hex 0423, Octal 2043

Steps to reproduce:
Open Vim.
:syntax match testTitle /^.*$/
:hi def link testTitle Title
Enter the next text:
Уже угроза миновала
Result is:
 же угроза миновала


PS
set encoding=utf-8
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug with Title highliting

2009-03-13 Thread Maxim Kim

On 14 мар, 02:15, Maxim Kim haba...@gmail.com wrote:
 Hi,

 Steps to reproduce:
 Open Vim.
 :syntax match testTitle /^.*$/
 :hi def link testTitle Title
 Enter the next text:
 Уже угроза миновала
 Result is:
  же угроза миновала

Now I can see that letter.
I do not know what happend but I did those steps 3 times before post
here and the letter was invisible.
Weird.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Is there a smarter way to get count into my function?

2009-03-04 Thread Maxim Kim



On 4 мар, 22:00, Charles Campbell charles.e.campb...@nasa.gov wrote:
 I've taken a little liberty with the Hello command itself, but perhaps
 you can modify this further to suit you:

 command! -count=1 Hello call Hello(count)
 map ,ff :c-ucall Hello(v:count)CR

Thanks!
v:count is just what I have been looking for.

function! Hello(count)
  do smth useable here a:count
  echo a:count
endfunction
command! -count Hello call Hello(v:count)
map ,ff :HelloCR

Regards,
Maxim Kim
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Is there a smarter way to get count into my function?

2009-03-04 Thread Maxim Kim



On 5 мар, 05:57, Tony Mechelynck antoine.mechely...@gmail.com wrote:
 On 04/03/09 20:30, Maxim Kim wrote:
  map ,ff :c-ucall Hello(v:count)CR

  function! Hello(count)
     do smth useable here a:count
     echo a:count
  endfunction
  command! -count Hello call Hello(v:count)
  map ,ff :HelloCR

 Without C-U this will convert whatever count you prepended to the
 mapping to a range of (count) lines starting at the cursor line.

 See :help v:count for details, and an example.

C-U has no effect on :command stuff. Just on functions?
Do I miss something?
function! Hello(count)
  do smth useable here with a:count
  echo a:count
endfunction
command! -count Hello call Hello(v:count)
map ,ff :C-UHelloCR
map ,ff :HelloCR


--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: About Shift+Space

2009-03-03 Thread Maxim Kim

On 3 мар, 11:09, Wu Bingzheng wubingzh...@gmail.com wrote:
 Hi men,

  nmap Space C-B

 it doesn't work.
It works for me.
Note: C-B doesn't move you cursor to the very top of buffer. If your
cursor is on 10th line C-B has no visible effect.

I use the follwing bindings instead:
nnoremap Space C-DC-D
nnoremap S-Space C-UC-U
vnoremap Space C-DC-D
vnoremap S-Space C-UC-U

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: About Shift+Space

2009-03-03 Thread Maxim Kim

On 4 мар, 08:30, Tony Mechelynck antoine.mechely...@gmail.com wrote:
 Here, Ctrl-B (directly or by mapping Space to it) moves the cursor to
 the ('scrolloff' + 1)th line. If I set 'scrolloff' to a high value
 () it still scrolls by a page. See also :help 'window'.

As far as I can see C-B doesn't move the cursor -- it scrolls the
window. Cursor is moved as a side effect of this scrolling.
Thus I can't visually select every line with 20gg10C-B command for
example.
C-U on the other hand moves cursor up. Thus I can C-U to the line
number 1.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: About Shift+Space

2009-03-03 Thread Maxim Kim


 Thus I can't visually select every line with 20gg10C-B command for
 example.
edit:
Thus I can't visually select every line to the top of buffer with
continiously hitting C-B command for
example.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Is there a smarter way to get count into my function?

2009-03-03 Thread Maxim Kim

Hi,

In the following example count gives me 0 or current linenumber
+number that I prepend ,ff (3,ff gives me lnum+3). Is it possible to
have exactly what was prepended to a command?

function! Hello(count)
  if a:count  0
let cnt = 0
  else
let cnt = a:count
  endif
  echo cnt
endfunction

command! -count Hello call Hello(count-line1+1)
map ,ff :HelloCR

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



for [k,v] in items(dict): Bug? Design?

2009-03-02 Thread Maxim Kim

Hi,
the following vimscript gives me an error on plain vim72 with no
patches applied:

let mdict = {name: vimwiki, data:[]}
for [key, value] in items(mdict)
   echo key value
endfor

E706: Variable type mismatch for: value.

:h E706 gives some explanation -- it looks like there is change the
type of a variable from string to a list.

So, it looks like for loop cannot iterate over composite data.
Just tried:

let lst = [hello, []]
for value in lst
endfor

Gives me the same error.
I'd expect it to do :unlet key, :unlet value before each iteration.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: for [k,v] in items(dict): Bug? Design?

2009-03-02 Thread Maxim Kim

 Just tried:

 let lst = [hello, []]
 for value in lst
 endfor

 Gives me the same error.
 I'd expect it to do :unlet key, :unlet value before each iteration.

He he.
Note on :h for made it clear.

Note that the type of each list item should be
identical to avoid errors for the type of {var}
changing.  Unlet the variable at the end of the loop
to allow multiple item types.

I have to unlet variables explicitly:
let lst = [hello, []]
for value in lst
  unlet value
endfor

This is inconvenient but usable. :)

Just curious, why for loop implemented that way?
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: A trick to hide all global variables in plugin

2009-02-26 Thread Maxim Kim

On 27 фев, 09:38, Sean maxiangji...@gmail.com wrote:
 (2) no global variables can be accessed outside the plugin
I have multiple files in my plugin, should I for variable in G in
all of them?
BTW, why do you want to hide global vars that you let user to define?
I would hide only those globals that user shouldn't access -- ie,
state of the plugin that spreads across all its files but
un_user_setupable.
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Syntax folding

2009-02-18 Thread Maxim Kim

Hi
Is it possible to make syntax folding could fold the following text:

! Level 1
blablabla
blablabla

!! Level 2
blablabla
blablabla
blablabla

!!! Level 3
blablabla
blablabla
blablabla

!!! Level 3
blablabla
blablabla
blablabla

!! Level 2
blablabla
blablabla
blablabla

! Level 1
blablabla
blablabla
blablabla

into:
+-- 23 lines: ! Level 1--

+-- 4 lines: ! Level 1--

With all levels folded according to count of exclamation marks.

For level1 folding I have the next command:
:syntax region level1 start=/^![^!]\+.*/ end=/\n\+\ze![^!]\+.*/
transparent fold

For level2 folding the similar command doesn't work (region should
start at double ! and end at double or single !):
:syntax region level2 start=/^!![^!]\+.*/ end=/\n\+\ze!!\?[^!]\+.*/
transparent fold

Why the last command does wrong folding?
--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Syntax folding

2009-02-18 Thread Maxim Kim



On Feb 18, 10:48 pm, Brett Stahlman brettstahl...@comcast.net wrote:
 On Feb 18, 10:55 am, Maxim Kim haba...@gmail.com wrote:

 You need to give level 2 the 'contained' attribute, and indicate that
 level 1 can contain level 2: e.g.,

 :syntax region level1 start=/^![^!]\+.*/ end=/\n\+\ze![^!]\+.*/
 transparent fold contains=level2
 :syntax region level2 start=/^!![^!]\+.*/ end=/\n\+\ze!!\?[^!]\+.*/
 transparent fold contained
Unfortunatly It doesn't work:

+-- 19 lines: ! Level 1--
 !! Level 2
 blablabla
 blablabla
 blablabla

+-- 4 lines: ! Level 1--

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



  1   2   >