Re: how to prevent loading python.vim

2010-08-12 Thread Tony Mechelynck

On 13/08/10 05:13, pansz wrote:


On Aug 13, 10:19 am, bill lam  wrote:

Чтв, 12 Авг 2010, pansz писал(а):

1. vim-tiny: This is Tiny version of vim, pretty useless IMO.

This is an insult to the original vi. ;-)
More seriously, after using vim.tiny for a week, I found it fit for
most jobs that I needed such as composing email and editing script
files.


I want a vim with +eval feature, which implies at least the Normal
version.

+eval means you can have conditional statement and many fundamental
features for creating any plug-ins. (in vim, no plug-ins often means
no syntax-highlights)

I won't consider it useful if the script doesn't even support the "if"
statement.

Of course, your mind may vary.



My point of view is different: I don't know what I may someday want to 
use, so I compile a Vim with everything I can (Huge features, all kinds 
of mice, including at least xterm and GPM, that I can get included, 
GTK2, Gnome, all interpreters that my distro offers and I can puzzle out 
how to put in; I even include +xterm_save which AFAIK can only be done 
by modifying feature.h, not via configure) except a very few features 
which I know I'll never want (only one so far besides what configure 
auto-excludes: -tag_old_static, which also AFAIK requires patching 
feature.h).


Then I compile (under the executable name "vi" and in a shadow directory 
so as not to confuse the Make machinery) a "tiny" version with the bare 
minimum, both as a "sanity test" that new features can actually be left 
off, and to see how wide the range is in executable file size (currently 
0.5 vs 2 MB). I use it only rarely, but still more than actually "never".



Best regards,
Tony.
--
Everyone talks about apathy, but no one _does_ anything about it.

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


Re: how to make cscope exclude certain directories

2010-08-12 Thread EdwardXu
Jonh
Thank you very much, i used 'find' to generate cscope.file, it works fine.

2010/8/13 John Beckett 

> EdwardXu wrote:
> > I'm working on a huge c project with VIM on Windows XP, there
> > are many useless directories, so i want to exclude them out
> > of cscope database, is there any  way to do this?
>
> The standard procedure is to use the 'find' utility (if Unix),
> or your own script, to build a file that contains a list of each
> file you want indexed, then feed that to cscope with the -i
> option.
>
> John
>
> --
> 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
>



-- 
Thanks & Best Regards
Edward

-- 
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: Is there any internal mechanism that convert the accessing key of dictionary to a specific function?

2010-08-12 Thread winterTTr
On 13 August 2010 00:55, Tom Link  wrote:
>> Or is there an alternate method to accessing dictionary  when the key
>> is not found
>> , instead of showing error directly?
>
> You can use get() -- see :help get()
>
> I have once created a simple prototype-like library that provides for
> defining a method that returns default values: 
> http://github.com/tomtom/prototype_vim
>
> Example (fib with memoization):
>
> let x = prototype#New()
> let ncalls = 0
> function! x.__Default(n) dict
>    let g:ncalls += 1
>    if a:n <= 1
>        let self[a:n] = a:n
>    else
>        let self[a:n] = self.__Get(a:n - 2) + self.__Get(a:n - 1)
>    endif
> endfunction
> Should be equal map(range(0, 10), 'x.__Get(v:val)'),
>            \ [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
> Should be equal x.__Get(10), 55
> Should be equal ncalls, 11
>
> If that was, what you were asking for.

Thanks so much. I will study the code.
>
> --
> 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 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 to prevent loading python.vim

2010-08-12 Thread pansz

On Aug 13, 10:19 am, bill lam  wrote:
> Чтв, 12 Авг 2010, pansz писал(а):
> > 1. vim-tiny: This is Tiny version of vim, pretty useless IMO.
> This is an insult to the original vi. ;-)
> More seriously, after using vim.tiny for a week, I found it fit for
> most jobs that I needed such as composing email and editing script
> files.

I want a vim with +eval feature, which implies at least the Normal
version.

+eval means you can have conditional statement and many fundamental
features for creating any plug-ins. (in vim, no plug-ins often means
no syntax-highlights)

I won't consider it useful if the script doesn't even support the "if"
statement.

Of course, your mind may vary.

-- 
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 to make cscope exclude certain directories

2010-08-12 Thread John Beckett
EdwardXu wrote:
> I'm working on a huge c project with VIM on Windows XP, there
> are many useless directories, so i want to exclude them out
> of cscope database, is there any  way to do this?

The standard procedure is to use the 'find' utility (if Unix),
or your own script, to build a file that contains a list of each
file you want indexed, then feed that to cscope with the -i
option.

John

-- 
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 to prevent loading python.vim

2010-08-12 Thread bill lam
Чтв, 12 Авг 2010, pansz писал(а):
> 1. vim-tiny: This is Tiny version of vim, pretty useless IMO.

This is an insult to the original vi. ;-) 

More seriously, after using vim.tiny for a week, I found it fit for
most jobs that I needed such as composing email and editing script
files.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

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


how to make cscope exclude certain directories

2010-08-12 Thread EdwardXu
Hi, all
I'm working on a huge c project with VIM on Windows XP, there are many
useless directories, so i want to exclude them out of cscope database, is
there any  way to do this?
Thank you.

-- 
Thanks & Best Regards
Edward

-- 
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 to prevent loading python.vim

2010-08-12 Thread pansz

On Aug 13, 5:13 am, Charles Campbell 
wrote:
> Since you want "syn on", I suppose a "normal" vim would do.  Why not?  
> Smaller footprint, quicker loading, etc.

debian packages 4 kinds of vim:

1. vim-tiny: This is Tiny version of vim, pretty useless IMO.
2. vim: This is Huge version of vim without GUI support and without
X11 support.
3. vim-gtk: This is Huge version with GTK+2 support.
4. vim-gnome: This is vim-gtk with gnome/kde session support.

So you see, you cannot get a normal version from debian package
manager. And you really need the Huge version just in order to get the
syntax highlight.

Personally, I always compile my own vim, because I want a console-only
vim with X11 support. (console vim with X11 supports mouse)

-- 
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 to prevent loading python.vim

2010-08-12 Thread bill lam
When I compiled vim from source, I chose "normal" built. However since
debian squeeze can offer updated vim, I switched to use vim from its
repository.  It offers vim.gtk (huge) and vim.tiny (indeed tiny) but
no "normal" version.  Now I link vim to vim.tiny and only run vim.gtk
when I need more functionalities.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

-- 
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: Vim 7.3e ready for beta testing

2010-08-12 Thread George V. Reilly
On Thu, Aug 12, 2010 at 1:43 PM, Bram Moolenaar  wrote:

> Pan Shizhu wrote:
>  > We need a Big icon for Windows 7.
> >
> > During the Vim 7.3 development, Windows 7 releases, in Windows 7
> > desktop we can choose small Icon, normal Icon, and big Icon.
> >
> > The Icon for Vim 7.3 works for Normal Icon and Small Icon, but when I
> > choose Big icon on Windows 7 desktop, it still shows a Normal Icon.
> >
> > Now it is time to give Vim 7.3 Windows Installer a Big Icon. Thanks.
>
> OK, so can someone tell me how to do that?  How big is a Big Icon?
>

256x256, which then gets scaled automatically by Vista and Windows 7. 24-bit
color. More 3D.
* http://msdn.microsoft.com/en-us/library/aa511280.aspx
* http://www.axialis.com/tutorials/tutorial-vistaicons.html

Perhaps we could
use the icon from MacVim as a starting point?
-- 
/George V. Reilly  geo...@reilly.org  Twitter: @georgevreilly
http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech

-- 
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: copy highlighted text after : prompt

2010-08-12 Thread Benjamin Esham
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Fetchinson wrote:

> Benjamin Esham wrote:
> 
> > Are you aware that if you leave the search field "blank", i.e.
> > 
> >   :s//replacement/
> > 
> > then Vim just uses the most recent search text?
> 
> No, I was not aware of that! This is brilliant, the only reason I'm not
> surprised is that I got used to the fact that whatever I ask on this list
> I always get the exact thing in a response along the line "vim already
> makes this very simple, here is how" :)

;-)

- -- 
Benjamin D. Esham   |   bdes...@gmail.com
“White shores and beyond. A far green country, under a swift sunrise.”
“Well...  That isn’t so bad.”
“No...  No it isn’t.”   — Gandalf and Pippin in RotK
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (Darwin)

iEYEARECAAYFAkxkZSIACgkQzOC3TdZ2u5pApQCgtQdHbq9yr8ICP65G2NP3Q4k9
acYAoOW/xoh7fCSgIBzHQgdoM5+X20jU
=4w0W
-END PGP SIGNATURE-

-- 
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 to prevent loading python.vim

2010-08-12 Thread Charles Campbell

bill lam wrote:

Птн, 06 Авг 2010, Ben Fritz писал(а):
   


On Aug 6, 5:08 am, bill lam  wrote:
 

I set compatible ... in ~/.vimrc
   

Why on earth do you do that?

 

Because there is such an option. ;-)

   
Cute -- so you're loading a "huge" vim, with lots of bells and whistles, 
and then telling it via your .vimrc that you're happy with very few 
features -- apparently, just syntax highlighting.


Since you want "syn on", I suppose a "normal" vim would do.  Why not?  
Smaller footprint, quicker loading, etc.


Chip Campbell

--
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: Vim 7.3e ready for beta testing

2010-08-12 Thread Bram Moolenaar

Pan Shizhu wrote:

> We need a Big icon for Windows 7.
> 
> During the Vim 7.3 development, Windows 7 releases, in Windows 7
> desktop we can choose small Icon, normal Icon, and big Icon.
> 
> The Icon for Vim 7.3 works for Normal Icon and Small Icon, but when I
> choose Big icon on Windows 7 desktop, it still shows a Normal Icon.
> 
> Now it is time to give Vim 7.3 Windows Installer a Big Icon. Thanks.

OK, so can someone tell me how to do that?  How big is a Big Icon?

-- 
hundred-and-one symptoms of being an internet addict:
44. Your friends no longer send you e-mail...they just log on to your IRC
channel.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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


syn region question

2010-08-12 Thread Jeri Raye
Hi,

I have in my after\syntax directory a vhdl.vim file defined as below
+-+
syn sync fromstart
set foldmethod=syntax

"syntax match vhdlEndIf "end\s\+if"
syn region vhdlFold
  \ start="\z(\\)"
  \ end="\http://www.vim.org/maillist.php


Re: folding question

2010-08-12 Thread Jeri Raye
Hi Christian,

>> folds into:
>> # Start of text #
>> +-- 4 lines: if-
>> end if
>> # End of Text #
>> Notice the not included 'end if'
>
> That is because of the keepend. There was a reason why I left it out, in
> my previous message ;)
But when I remove the keepend it fold all the rest of the file.
What a pain is this.
Thanks any way for thinking with me.

Best regards,
Jeri

-- 
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: copy highlighted text after : prompt

2010-08-12 Thread Daniel Fetchinson
>> I use * regularly to search for words and the results are nicely
>> highlighted. Many times I need to copy these terms after the : prompt
>> (what is its name? command prompt? status bar?) for example when I need to
>> grep for it in other files or search-and-replace it, etc.
>>
>> Is this possible?
>
> Hi Daniel,
>
> Are you aware that if you leave the search field "blank", i.e.
>
>   :s//replacement/
>
> then Vim just uses the most recent search text?

No, I was not aware of that! This is brilliant, the only reason I'm
not surprised is that I got used to the fact that whatever I ask on
this list I always get the exact thing in a response along the line
"vim already makes this very simple, here is how" :)


> This means that if you use
> the * command to search for a word, and then execute the command above, the
> word will be replaced with "replacement" without you needing to type it in.
> Similarly, you could do
>
>   :g//
>
> to find all occurrences of the most recent search term in the file.

This is uber-cool too!

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

-- 
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: copy highlighted text after : prompt

2010-08-12 Thread Daniel Fetchinson
>> I use * regularly to search for words and the results are nicely
>> highlighted. Many times I need to copy these terms after the : prompt
>
> Sounds like you're looking for Control+R followed by Control+W
>
>:help c_ctrl-R_ctrl-W
>
> Very handy indeed.

Yes! Thanks a lot!

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

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


Can autocomplete pull from deleted text?

2010-08-12 Thread Paul
I would find it extremely useful if text completion (using Ctrl-N and
Ctrl-N-Ctrl-X-Ctrl-N) could access lines of text that used to exist in
the current buffer and session, but were deleted. Perhaps the
completion function could look at the undo history for this?

Is there any setting or clever scripting that could make this happen?

-- 
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: folding question

2010-08-12 Thread Christian Brabandt
Hi Jeri!

On Do, 12 Aug 2010, Jeri Raye wrote:

> Unfortantly the adding of \ contains=vhdlFold doesn't do the trick.
> I have now the following:
> 
> syntax match vhdlEndIf "end\s\+if"
> syn region vhdlFold
>   \ start="\z(if\)"
>   \ end="end\s\+\z1"
>   \ contains=vhdlFold
>   \ fold transparent
>   \ keepend
> 
> The following text
> # Start of text #
>  if
>if
> 
>   end  if
> end if
> # End of Text #
> 
> folds into:
> # Start of text #
> +-- 4 lines: if-
> end if
> # End of Text #
> Notice the not included 'end if'

That is because of the keepend. There was a reason why I left it out, in 
my previous message ;)

regards,
Christian

-- 
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: Including search results in the command line

2010-08-12 Thread Gary Johnson
On 2010-08-12, Daniel Fetchinson wrote:
> Hi folks,
> 
> I use * regularly to search for words and the results are nicely
> highlighted. Many times I need to copy these terms after the : prompt
> (what is its name? command prompt? status bar?) for example when I
> need to grep for it in other files or search-and-replace it, etc.
> 
> Is this possible?

The : begins an ex command.  The part of the display on which you
enter ex commands is the command line.

There are a number of ways to do this.

1.  If the cursor is still on the desired word when you begin the ex
command, you can insert that word into the command by typing
Ctrl-R Ctrl-W.  See

:help c_CTRL-R_CTRL-W

2.  Yank the word into a register before beginning the ex command.
For example,

yiw

will yank the word the cursor is in to the default register.
Then you can insert the contents of that register into the ex
command by typing Ctrl-R " .  (That's Ctrl-R followed
immediately by a double-quote.)  See

:help c_CTRL-R

3.  Insert the contents of the search pattern register (named '/')
into the ex command by typing Ctrl-R / .  See

:help c_CTRL-R

That has the feature that it will include the '\<' and '\>' at
the beginning and end of the pattern, which may or may not be
what you want.

Regards,
Gary

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


Re: Is there any internal mechanism that convert the accessing key of dictionary to a specific function?

2010-08-12 Thread Tom Link
> Or is there an alternate method to accessing dictionary  when the key
> is not found
> , instead of showing error directly?

You can use get() -- see :help get()

I have once created a simple prototype-like library that provides for
defining a method that returns default values: 
http://github.com/tomtom/prototype_vim

Example (fib with memoization):

let x = prototype#New()
let ncalls = 0
function! x.__Default(n) dict
let g:ncalls += 1
if a:n <= 1
let self[a:n] = a:n
else
let self[a:n] = self.__Get(a:n - 2) + self.__Get(a:n - 1)
endif
endfunction
Should be equal map(range(0, 10), 'x.__Get(v:val)'),
\ [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
Should be equal x.__Get(10), 55
Should be equal ncalls, 11

If that was, what you were asking for.

-- 
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: copy highlighted text after : prompt

2010-08-12 Thread Benjamin Esham
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Fetchinson wrote:

> I use * regularly to search for words and the results are nicely
> highlighted. Many times I need to copy these terms after the : prompt
> (what is its name? command prompt? status bar?) for example when I need to
> grep for it in other files or search-and-replace it, etc.
> 
> Is this possible?

Hi Daniel,

Are you aware that if you leave the search field "blank", i.e.

  :s//replacement/

then Vim just uses the most recent search text?  This means that if you use
the * command to search for a word, and then execute the command above, the
word will be replaced with "replacement" without you needing to type it in.
Similarly, you could do

  :g//

to find all occurrences of the most recent search term in the file.

HTH,
- -- 
Benjamin D. Esham   |   bdes...@gmail.com
“Quidquid latine dictum sit, altum viditur.”
(Whatever is said in Latin sounds profound.)
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (Darwin)

iEYEARECAAYFAkxkIvcACgkQzOC3TdZ2u5r+mACg0qflgICn2u0I7uqvZcVBu4yY
7bkAmwTvXNE9I9o9qJISIuI38fL+24+Y
=2YNB
-END PGP SIGNATURE-

-- 
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: copy highlighted text after : prompt

2010-08-12 Thread Tim Chase

On 08/12/10 10:47, Daniel Fetchinson wrote:

I use * regularly to search for words and the results are nicely
highlighted. Many times I need to copy these terms after the : prompt


Sounds like you're looking for Control+R followed by Control+W

  :help c_ctrl-R_ctrl-W

Very handy indeed.

-tim


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


copy highlighted text after : prompt

2010-08-12 Thread Daniel Fetchinson
Hi folks,

I use * regularly to search for words and the results are nicely
highlighted. Many times I need to copy these terms after the : prompt
(what is its name? command prompt? status bar?) for example when I
need to grep for it in other files or search-and-replace it, etc.

Is this possible?

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

-- 
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: Limiting the range of a search

2010-08-12 Thread Ben Fritz


On Aug 12, 5:05 am, winterTTr  wrote:
> I give an alternate way
>
> function! VModeSearchRange()
>         return '\%>' . ( line("'<") - 1 ) . 'l\%<' . ( line("'>") + 1 ) .  'l'
> endfunction
>
> vnoremap / /=VModeSearchRange()
>
> You can v-select the range you want to search and then press "/",
> continue type the word you want to search.
>

There is no need for an extra function to restrict your search to
visual mode, you can just use \%V in your pattern.

This is how I normally restrict a search range.

For example, to restrict a search to the current {...} block:

vaB/\%Vpattern

I use this often enough I've defined a mapping as well:

vnoremap  /\%V
nnoremap  /\%V

I diddn't want to remap / by itself, because being able to search to
extend the range of a visual selection is way too useful to lose.

-- 
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: folding question

2010-08-12 Thread Jeri Raye
> or else (untested)
>
>        syn region vhdlFold
>                \ start='\z(\\)'
>                \ end='\                \ contains=vhdlFold
>                \ fold transparent
>
> to make it recursive?
>
>
> Best regards,
> Tony.
> --

Unfortantly the adding of \ contains=vhdlFold doesn't do the trick.
I have now the following:

syntax match vhdlEndIf "end\s\+if"
syn region vhdlFold
  \ start="\z(if\)"
  \ end="end\s\+\z1"
  \ contains=vhdlFold
  \ fold transparent
  \ keepend

The following text
# Start of text #
 if
   if

  end  if
end if
# End of Text #

folds into:
# Start of text #
+-- 4 lines: if-
end if
# End of Text #
Notice the not included 'end if'

However if I open a c file it does include the closing bracket char '}'

The following text:
# Start of text #
if (c = 'a')
{
  if
  {
  }
}
# End of Text #

Folds in:
# Start of text #
if (c = 'a')
+--  6 lines: {-
# End of Text #
Notice the including closing bracket }

When I look into the c.vim file in "C:\Program
Files\Vim\vim72\syntax\c.vim" on my windows XP PC I can't discover why
it works on a c-file. It might be, but I'm not sure, because of the
following code, but I can't make this work for VHDL.

Out c.vim:
# Start of text #
[...]
" This should be before cErrInParen to avoid problems with #define ({ xxx })
if exists("c_curly_error")
  syntax match cCurlyError "}"
  syntax region cBlock  start="{" end="}"
contains=ALLBUT,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
fold
else
  syntax region cBlock  start="{" end="}" transparent fold
endif
[...]
# End of Text #

Any idea why?

Best Regards,
Jeri

-- 
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: Limiting the range of a search

2010-08-12 Thread winterTTr
On 12 August 2010 17:37, Jürgen Krämer  wrote:
>
> Hi,
>
> James Kanze wrote:
>> I'm currently editing some files which contain several more or
>> less independent sets of data.  At any one time, I'm generally
>> working on one, and only one set, delimited as a contiguous
>> range of lines.  I'd like to limit all of the search commands to
>> only consider this range.
>>
>> I'm aware of using \%<'m and \%>'m in the search string, but
>> this has to be entered each search.
>>
>> My initial idea was to fold the regions before and after the
>> range, but this doesn't seem to stop the search, and it
>> automatically opens the fold when it finds something in the
>> folded text.  I want it to not search in the folded text.  Is
>> there some option to make search ignore folded text, or some
>> other way of achieving what I want.
>
> depending on how you define those sets of lines you can also use
> 'searchpair()' if the cursor is currently inside the block you want
> to search through. Wrapped in a command this would look something like
>
>  :command -nargs=1 SearchInSet  call searchpair('^BEGIN$', , '^END$')
>
> if those set of lines are delimited by BEGIN and END. You can than use
> this command with
>
>  :SearchInSet search-string
>
> Regards,
> Jürgen

I give an alternate way

function! VModeSearchRange()
return '\%>' . ( line("'<") - 1 ) . 'l\%<' . ( line("'>") + 1 ) .  'l'
endfunction

vnoremap / /=VModeSearchRange()

You can v-select the range you want to search and then press "/",
continue type the word you want to search.

>
> --
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us.     (Calvin)
>
> --
> 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 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: Limiting the range of a search

2010-08-12 Thread Jürgen Krämer

Hi,

James Kanze wrote:
> I'm currently editing some files which contain several more or
> less independent sets of data.  At any one time, I'm generally
> working on one, and only one set, delimited as a contiguous
> range of lines.  I'd like to limit all of the search commands to
> only consider this range.
> 
> I'm aware of using \%<'m and \%>'m in the search string, but
> this has to be entered each search.
> 
> My initial idea was to fold the regions before and after the
> range, but this doesn't seem to stop the search, and it
> automatically opens the fold when it finds something in the
> folded text.  I want it to not search in the folded text.  Is
> there some option to make search ignore folded text, or some
> other way of achieving what I want.

depending on how you define those sets of lines you can also use
'searchpair()' if the cursor is currently inside the block you want
to search through. Wrapped in a command this would look something like

  :command -nargs=1 SearchInSet  call searchpair('^BEGIN$', , '^END$')

if those set of lines are delimited by BEGIN and END. You can than use
this command with

  :SearchInSet search-string

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

-- 
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: Limiting the range of a search

2010-08-12 Thread Christian Brabandt
Hi James!

On Do, 12 Aug 2010, James Kanze wrote:

> I'm currently editing some files which contain several more or
> less independent sets of data.  At any one time, I'm generally
> working on one, and only one set, delimited as a contiguous
> range of lines.  I'd like to limit all of the search commands to
> only consider this range.
> 
> I'm aware of using \%<'m and \%>'m in the search string, but
> this has to be entered each search.
> 
> My initial idea was to fold the regions before and after the
> range, but this doesn't seem to stop the search, and it
> automatically opens the fold when it finds something in the
> folded text.  I want it to not search in the folded text.  Is
> there some option to make search ignore folded text, or some
> other way of achieving what I want.

You can do this using folding and the 'foldopen' setting and the 
folddopen command. See :h 'foldopen' and :h folddopen

Alternatively, try the NrrwRgn Plugin:
http://www.vim.org/scripts/script.php?script_id=3075

regards,
Christian

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


Limiting the range of a search

2010-08-12 Thread James Kanze
I'm currently editing some files which contain several more or
less independent sets of data.  At any one time, I'm generally
working on one, and only one set, delimited as a contiguous
range of lines.  I'd like to limit all of the search commands to
only consider this range.

I'm aware of using \%<'m and \%>'m in the search string, but
this has to be entered each search.

My initial idea was to fold the regions before and after the
range, but this doesn't seem to stop the search, and it
automatically opens the fold when it finds something in the
folded text.  I want it to not search in the folded text.  Is
there some option to make search ignore folded text, or some
other way of achieving what I want.

--
James Kanze

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


Is there any internal mechanism that convert the accessing key of dictionary to a specific function?

2010-08-12 Thread winterTTr
I mean if there is such mechanism in the vim script itself.
OK, maybe the title of this mail is not very clear for you to
understand, i just give an example.

let foo = {}
let foo.var = 100

we can access the value 100 by :
echo foo.var
echo foo['var']

i just want to know if there is a mechanism to convert
==> echo foo.var_not_exist
to
==> echo foo.__index__( "var_not_exist" )"pseudo code, the
__index__ does not exist as i know
, which __index__ is a method when the key can not be found in a
dictionary object.

I found this kind of mechanism in many script languages, such as python, lua.
With this mechanism, we can hack the dictionary to many "interesting" feature.

Is there this accessing mechanism in vim script?
# As i know it seems not.

Or is there an alternate method to accessing dictionary  when the key
is not found
, instead of showing error directly?

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