RE: wish: collaboration of N vim instances editing same file

2007-04-23 Thread Peter Hodge
Hello,

Couldn't the 'patch' command do this?  E.g., Vim#1 has made some changes to
example.c (but not saved them), and Vim#2 makes some different changes and
saves them.  Vim#1 sees that example.c has changed, and makes a diff between
the new example.c and what it originally was, and also makes a diff between
Vim#1's modifications and what example.c originally was, patches the original
with both those diffs and *bingo* you have the merged file (so far as you can
trust the patch utility).

Shouldn't this be possible through the autocommands? I think you could write
this as a plugin, Yakov.

regards,
Peter

 
--- Gene Kwiecinski <[EMAIL PROTECTED]> wrote:

> >>I'd be seriously uncomfortable with that as a "feature".  Imagine
> >>absentmindedly editing the same file 2x or more.  Make some changes in
> >>one instance, make different changes in another instance, save/quit
> the
> >>first, save/quit the second, trash all the edits made in the first
> >>instance.
> 
> >In the orininal post, I wrote about the feature where two+ instances
> >of vim show and merge changes made by other instances. With
> >such "collaboration" enabled, the 2nd instance would show and merge
> >changes made by 1st instance, and 1st instance would absorb, merge
> >and show changes made by 2nd instance. In this scenario, loss of
> >edits does not happen. So I don't underastand why you say you are
> >against it if it avoids exactly what you cited as unwanted ?
> 
> >>-- Ability of N instances of vim to absorb, merge and show changes
> >>to the same file made by other running vim instances
> 
> Because I don't trust such mechanisms.  Especially if editing the same
> block of text/code/etc., where subtle changes in a program can be
> disastrous.
> 
> Eg, just yesterday, I wanted to "split off" some functionality to a
> separate variable, so made another one called "avg" from the original
> "average".  What if the second instance just "assumed" that I wanted to
> make similar changes to the original instance of "average" when I in
> fact wanted/needed it to be the same.  There's no easy way to "absorb"
> or "merge" changes automagically;  sometimes even the order of
> implementation is rather significant.  Just ask anyone who uses
> sccs/rcs/etc., about forked code, and some of the nightmares trying to
> reconcile different disparate versions.
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: wish: collaboration of N vim instances editing same file

2007-04-11 Thread Peter Hodge
Hello Yakov,

Couldn't you hook into the FileChangedShell autocmd event and merge the changes
into your buffer from there? You can also handle the swap file message with
SwapExists event.

regards,
Peter



--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> Hello Bram,
> Is it possible to add this item to the vim voting list ?:
> 
>   "collaboration of N vim instances editing same file"
>   -- Ability of N instances of vim to absorb, merge and show changes
>   to the same file made by other running vim instances [ either by reading
>   other vim's swapfiles, or somehow else ] ?
> 
> Can this be added to SOC ?
> 
> Yakov
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Using variables in syntax definitions

2007-04-10 Thread Peter Hodge
Hello,

You'll probably need to use 'execute':

  execute 'syn match myPattern' s:mypattern

but again, highlighting won't work for you then.

regards,
Peter


  

--- Ian Tegebo <[EMAIL PROTECTED]> wrote:

> Is doesn't seem possible to store my patterns in variables for use in syntax
> definitions like the following:
> 
> let s:mypattern = '#.*'
> syn match myPattern s:mypattern
> 
> I get 'pattern delimiter not found' and what not.  Is there a way to achieve
> this?
> 
> The general "problem" I'm trying to solve is having to update patterns in
> syntax files when they're used in multiple places and to reduce the line
> length of syntax definitions; I've tried using line continuations but
> highlighting in the definition file itself seems to fail in this case.
> 
> -- 
> Ian Tegebo
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: case of very slow regex search

2007-04-03 Thread Peter Hodge

--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> I use sometimes the regex that finds paragraphs
> containing given words w1,w2,... in any order ( I define "paragraph"
> as separated by lines, \n\n).
> 
> I use the pattern like this: (two-word example, w1 and w2, but easily
> expandable for N words):
> /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
>(and I set :set maxmempattern=2 )
> This works. But search time is unbelievably slow on big files.
> 
> My question is; is there a rewrite of this  regex that works faster.
> 
> To see the testcase how of how slow this works:
>1. wget http://www.vmunix.com/~gabor/c/draft.html
>   # this is ~1.3 MB file.
>2. vim draft.html
>3. /\c\(.\|.\n\)*\\&\(.\|.\n\)*\

Try this pattern:

  /\c\n\zs\%(\%(.\|.\n\)\{-}\\&\%(.\|.\n\)\{-}\\)

It has the \n at the start so it will match at most once per line and uses \{-}
instead of * to prevent backtracking. That search ends in 30 seconds (on a Dual
1.8ghz G5).  You won't need to tweak maxmempattern either.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: completion menu colors

2007-04-02 Thread Peter Hodge

--- fREW <[EMAIL PROTECTED]> wrote:

> Hi all,
> Is there a way to change the completion menu colors?

Change the highlighting options for the Pmenu* highlight groups:

  :hi Pmenu  ctermfg=Cyanctermbg=Blue cterm=None guifg=Cyan 
guibg=DarkBlue
  :hi PmenuSel   ctermfg=White   ctermbg=Blue cterm=Bold guifg=White
guibg=DarkBlue gui=Bold
  :hi PmenuSbar  ctermbg=Cyanguibg=Cyan
  :hi PmenuThumb ctermfg=White   guifg=White

etc.  The 'cterm*' settings are for colour terminal, the 'gui*' settings are
for GUI.

You can see all colour groups by using ':runtime syntax/hitest.vim', or in GUI
Vim use the menu selection Syntax -> Highlight Test.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Newbee question:Why don't I have the syntax highlighting when editing files like *.sh *.xml,etc?

2007-04-02 Thread Peter Hodge
Hello,

Also you can use

  :set ft? syntax?

to see which filetype has been detected, and which syntax has been activated.

regards,
Peter



--- Xi Juanjie <[EMAIL PROTECTED]> wrote:

> "syntax on" should be ok.
> 
> Please use :version to confirm your vim was compiled with "+syntax"
> function and keep the corresponding syntax file in vim runtime folder.
> 
> Also to check if there has any "syntax off" in /etc/vim/vimrc.local.
> 
> wangxu wrote:
> > Why don't I have the syntax highlighting when editing files like *.sh
> > *.xml,etc?
> > After commands like "syntax on",still nothing happened.
> > below is my /etc/vim/vimrc,what else should I do to turn the syntax
> > highlighting on?
> > Thanks,
> > shell.
> > 
> > 
> > set
> >
>
runtimepath=~/.vim,/etc/vim,/usr/share/vim/vimfiles,/usr/share/vim/addons,/usr/share/vim/vim63,/usr/share/vim/vimfiles,/usr/share/vim/addons/after,~/.vim/after
> > 
> > set nocompatible " Use Vim defaults instead of 100% vi compatibility
> > set backspace=indent,eol,start " more powerful backspacing
> > 
> > set autoindent " always set autoindenting on
> > set textwidth=0 " Don't wrap lines by default
> > set viminfo='20,\"50 " read/write a .viminfo file, don't store more than
> > " 50 lines of registers
> > set history=50 " keep 50 lines of command line history
> > set ruler " show the cursor position all the time
> > 
> > set
> >
>
suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
> > 
> > if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" || &term =~ "xterm"
> > set t_Co=16
> > set t_Sf=[3%dm
> > set t_Sb=[4%dm
> > endif
> > 
> > vnoremap p :let current_reg = @"gvdi=current_reg
> > 
> > 
> > syntax on
> > 
> > 
> > if has("autocmd")
> > " Enabled file type detection
> > " Use the default filetype settings. If you also want to load indent files
> > " to automatically do language-dependent indenting add 'indent' as well.
> > filetype plugin on
> > 
> > endif " has ("autocmd")
> > 
> > augroup filetype
> > au BufRead reportbug.* set ft=mail
> > au BufRead reportbug-* set ft=mail
> > augroup END
> > 
> > try
> > if filereadable('/etc/papersize')
> > let s:papersize = matchstr(system('/bin/cat /etc/papersize'), '\p*')
> > if strlen(s:papersize)
> > let &printoptions = "paper:" . s:papersize
> > endif
> > unlet! s:papersize
> > endif
> > catch /E145/
> > endtry
> > 
> > 
> > if filereadable("/etc/vim/vimrc.local")
> > source /etc/vim/vimrc.local
> > endif
> > 
> > 
> > 
> > if &t_Co > 2 || has("gui_running")
> > syntax on
> > set hlsearch
> > endif
> > 
> > 
> > 
> > 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: foldingmethod=manual (does not fold what is visual-highlighted)

2007-03-25 Thread Peter Hodge
Hello,

Folds can't overlap, so Vim extends the range of the new fold to line 15 so
that it completely encloses the first fold.  Use ':set foldcolumn=5' to see
what's happening with the folds as you create them. If you don't want Vim to
extend the folds, then you'll need to delete them first using 'zd'.

regards,
Peter


--- calmar <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> on my:
> VIM - Vi IMproved 7.0 (2006 May 7, compiled Feb 12 2007 14:19:03)
> Included patches: 1-192
> e.g on this file:
> 
> http://www.calmar.ws/tmp/dd.tex
> 
> having: foldmethod=manual 
> 
> e.g. I make a manual fold on line number 9 to 15
> 9GV15Gzf
> open it again
> zo
> go to the sixth line and want to make a fold from 6 to 9
> 6GV9Gzf
> 
> it folds a 10 line range (6-15) instead of the v-highlight 6-9.
> (it includes obviously the old fold in that new one in some way)
> 
> What could I do about that? I only want a plain 'line 6 to 9' fold
> without including the 'ex' manual fold from 9 to 15.
> 
> 
> thanks for any hints about that,
> marco
> 
> 
> 
> -- 
>(o_  It rocks: LINUX + Command-Line-Interface
>//\
>V_/_ http://www.calmar.ws
> 

Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Any way to have multiple setfiletype's?

2007-03-08 Thread Peter Hodge

--- Kevin Old <[EMAIL PROTECTED]> wrote:

> Hello everyone,
> 
> I've recently found the new HTML.zip
> (http://www.vim.org/scripts/script.php?script_id=453) utility and want
> to use it with my setup.  By itself HTML.zip works fine.
> 
> Thing is, I use HTML::Mason as my template language for Perl and I
> have my setfiletype defined in filetypes.vim as:
> 
> au! BufRead,BufNewFile *.htmlsetfiletype mason
> 
> But, when it's defined this way, I'm not able to use the HTML.zip as
> it's not loaded.
> 
> Is there any way I can have the best of both worlds and have my mason
> syntax highlighting and the usage of HTML.zip?

You can set multiple filestypes by using:

  set filetype=html.mason

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored

2007-03-01 Thread Peter Hodge

--- Hugh Sasse <[EMAIL PROTECTED]> wrote:

> On Thu, 1 Mar 2007, Alexander Farber wrote:
> 
> > Hello Hugh,
> > 
> > On 3/1/07, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> > 
> > Actually I edit .sh, .pl, .c, .h, .java and .as files
> > and like to have similar colors (like inverted comments)
> > everywhere. So probably this is not the best way?
> 
> Then I'm not really sure what is, hopefully someone else will
> jump in here

Hello,

If you insist on having your colors inside .vimrc, then you can do it like
this:

  augroup MyColors
  autocmd!
  autocmd ColorScheme * hi Cursor term=inverse   ctermfg=black 
  guifg=black guibg=green
  autocmd ColorScheme * hi Visual term=inverse   ctermfg=yellow
ctermbg=black guifg=yellow guibg=black
  autocmd ColorScheme * hi Commentterm=inverse   ctermfg=white 
ctermbg=black guifg=white guibg=black
  autocmd ColorScheme * hi Identifier term=NONE  ctermfg=black 
  guifg=black
  autocmd ColorScheme * hi Constant   term=underline ctermfg=red   
  guifg=red
  autocmd ColorScheme * hi Statement  term=bold  ctermfg=blue  
  guifg=blue
  autocmd ColorScheme * hi PreProcterm=NONE  ctermfg=black 
  guifg=black gui=underline
  autocmd ColorScheme * hi Specialterm=NONE  ctermfg=red   
  guifg=red
  autocmd ColorScheme * hi Type   term=bold  ctermfg=blue  
  guifg=blue
  augroup end

otherwise, you can download my AfterColors plugin:

  http://www.vim.org/scripts/script.php?script_id=1641

and move your highlight commands into $HOME\vimfiles\after\colors\common.vim'.

regards,
Peter



Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Optimum syntax file size...

2007-02-19 Thread Peter Hodge
Hello,

If it is a C-style syntax where you're matching together lots of { } areas (or
if/endif blocks, etc), using regions, then you should provide an option to turn
it on/off, because this can be slow on large files (and get out of sync).

Thousands of keywords probably isn't an issue, but if you put them all on one
line it might slow things down (that might be a myth).  For readability sake,
maybe 12-50 per line?

Folding using regions is slow, you definitely should provide a way to turn this
feature off.

The new PHP syntax (http://www.vim.org/scripts/script.php?script_id=1571) is
quite large, but the only speed issue I've seen is with folding.

Try opening multiple windows of the same file and see if editting becomes slow
as Vim tries to re-sync the other windows in real-time.

Hope that helps,

regards,
Peter
  


--- Robert Hicks <[EMAIL PROTECTED]> wrote:

> Is there a size limit that one should set as a ceiling for syntax file size?
> 
> Robert
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Peter Hodge
--- Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> 
> Pete Johns wrote:
> 
> > On Tue, 2007-02-13 at 16:07:32 -0700, <[EMAIL PROTECTED]> sent:
> > >>(Sorry guys, my web-based editor, which I must use at work
> > >>becauseof IT paranoia about SMTP, simply will not let me reply
> > >>at the end rather than beginning of the thread.)=20
> > >>
> > Web-based editor? Why not use Vim as your editor from within
> > Firefox? Works a treat for me!
> > 
> > ViewSourceWith 
> 
> Don't see something about Vim here...
> 
> I'm using "It's All Text!" now.  Just had to create a shell script to
> start gvim, because it doesn't allow you to give arguments to the
> command.

Mozex (http://mozex.mozdev.org/) is working quite well for me on Windows and
Mac.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Folding to produce a high-level index of code

2007-01-09 Thread Peter Hodge
Hello,

Try this script:

http://www.vim.org/scripts/script.php?script_id=1623

regards,
Peter



--- Noah Spurrier <[EMAIL PROTECTED]> wrote:

> 
> I have folding set to use expr. I have a foldexpr that
> identifies lines for functions and classes in PHP.
> Lines that are part of a function are folded.
> Function definition lines are NOT folded.
> This gives me a single level of folding that works like
> an index to my code. This works great.
> 
> Is it possible to have an open fold include a few lines BEFORE the
> beginning of the fold? For example, it's common in PHP to have a
> phpdoc comment before the function definition.
> When all folds are closed I see just a list of function names.
> When I open a fold I see the entire body of the function, but
> I don't see the comment before the function.
> 
> I'm sure I could get the fold expression to work so that it starts the
> fold on the comment BEFORE the function definition, but then when I closed
> the fold I would not see the function name.
> 
> Perhaps I could set the fold to start at the comment before the
> function definition and set the 'foldtext' to be the
> text of the line with the function definition. I shall mull that over.
> In the mean time, if anyone has any suggestions or has already done
> this then please let me know.
> 
> So when I have all folds closed I see my code like this:
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> function delete_inventory ()
> +--  5 lines: {
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> If I wanted to view "delete_inventory" I would click on the + to open
> the fold to see something like this (note how the comment BEFORE
> the function is also show):
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> /**
>  * This deletes unqualified inventory from t_inventory.
>  * The table "inv_delete" is used to find unqualified inventory
>  * scheduled for deletion.
>  * @see function create_inv_delete
>  */
> function delete_inventory ()
> {
> $sql = "DELETE inventory FROM inventory, inv_delete WHERE
> inventory.inventory_id=inv_delete.inventory_id;";
> touch_sql ($sql);
> }
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> Currently, the best I can do is to show everything below the fold.
> This is nice, but the documentation comment remains hidden, like this:
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> function delete_inventory ()
> {
> $sql = "DELETE inventory FROM inventory, inv_delete WHERE
> inventory.inventory_id=inv_delete.inventory_id;";
> touch_sql ($sql);
> }
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> Yours,
> Noah
> 
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Help with syntax file

2006-12-21 Thread Peter Hodge
Hello,

The raw syntax string item is defined so as to skip over a [\"].  You just need
to remove the 'skip=+\\"+' part from this line:

  syn region dRawString start=+r"+ skip=+\\"+ end=+"[cwd]\=+ [EMAIL PROTECTED]

change to

  syn region dRawString start=+r"+ end=+"[cwd]\=+ [EMAIL PROTECTED]

regards,
Peter


--- jose isaias cabrera <[EMAIL PROTECTED]> wrote:

> 
> Greetings vim'ers.
> 
> I have a syntax file for the D Programming Language.  The D language has a 
> Raw String, which starts with r" and ends with ".  Anything in there is 
> taken as is.  But I have one problem with the D syntax file (d.vim):  When I 
> have this code,
> 
> a = r"c:\temp\" ~ GetUserName() ~ "\test.db";
> 
> everything after \" gets highlighted as Raw String, where it should not. 
> The Raw String stops at the second", or \".  I know why it's happening: the 
> syntax file is taking \" and is assuming that it is a normal D String and it 
> is making the second " escaped, where it should not be.
> 
> Any idea on how to fix this?  Attached is the d.vim syntax file.
> 
> thanks,
> 
> josé 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Bug? (Re: local map and vmap not cleared when buffer deleted)

2006-12-05 Thread Peter Hodge

--- Alan G Isaac <[EMAIL PROTECTED]> wrote:
> 
> Quoting from :h :bd ::
> 
> Actually, the buffer isn't completely deleted, it is 
> removed from the buffer list |unlisted-buffer| and 
> option values, variables and mappings/abbreviations 
> for the buffer are cleared.
> 


Hello,

I can confirm that using ':bd' on a buffer *will* remove a buffer-local 'imap'
but *will not* remove a buffer-local 'vmap' for that buffer.

To test, open any file in Vim, and execute these commands:

  :imap   
  :vmap   
  :imap  | vmap 

[you should see that two mappings are defined for the buffer]

  :bd
  :b1

you have just 'deleted' the buffer and reloaded it, which should have cleared
both the imap and the vmap for that buffer.

  :imap  | vmap 

You will see that the 'vmap' still remains. (I haven't checked what other
types of mappings might also survive a ':bd' command.)

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Matching JUST the nth occurence of a text in a line

2006-11-30 Thread Peter Hodge

--- Bill McCarthy <[EMAIL PROTECTED]> wrote:

> On Thu 30-Nov-06 10:24pm -0600, you wrote:
> 
> > --- Bill McCarthy <[EMAIL PROTECTED]> wrote:
> 
> >> On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
> >> 
> >> > Try:
> >> >
> >> >   /^.\{-}home.\{-}\zshome
> >> >
> >> >
> >> > for your reference:
> >> >
> >> >   \{-} makes the '.' match as little as possible
> >> >   \zs makes the search match begin at this point in the pattern
> >> 
> >> One might think so, but also note:
> >> 
> >> :help non-greedy
> >> 
> >> In particular, ready the sentence starting with "BUT".  All
> >> that is needed is:
> >> 
> >> /home.\{-}\zshome
> >> 
> >> Earliest is preferred to shortest.
> 
> > Yes, but that could also match a 3rd or 4th or 5th occurance of 'home' in
> one
> > line, so it's slightly safer to anchor the pattern to the start of the
> line.
> 
> Given the use of the "shortest match first algorithm" I
> don't see how that's possible.  Please give an example.

'/home.\{-}\zshome' will match every 2nd home in the following text:

  home home home home
  home home home home home home home home
  home home home home home

This is assuming you are doing a normal search using '/', not using a command
like ':g' or ':s' with the 'g' flag.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Matching JUST the nth occurence of a text in a line

2006-11-30 Thread Peter Hodge

--- Bill McCarthy <[EMAIL PROTECTED]> wrote:

> On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
> 
> > Try:
> >
> >   /^.\{-}home.\{-}\zshome
> >
> >
> > for your reference:
> >
> >   \{-} makes the '.' match as little as possible
> >   \zs makes the search match begin at this point in the pattern
> 
> One might think so, but also note:
> 
> :help non-greedy
> 
> In particular, ready the sentence starting with "BUT".  All
> that is needed is:
> 
> /home.\{-}\zshome
> 
> Earliest is preferred to shortest.

Yes, but that could also match a 3rd or 4th or 5th occurance of 'home' in one
line, so it's slightly safer to anchor the pattern to the start of the line.

regards,
Peter

Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Matching JUST the nth occurence of a text in a line

2006-11-30 Thread Peter Hodge
Hello,

Try:

  /^.\{-}home.\{-}\zshome


for your reference:

  \{-} makes the '.' match as little as possible
  \zs makes the search match begin at this point in the pattern


regards,
Peter


--- zzapper <[EMAIL PROTECTED]> wrote:

> Hi given a sample text below
> 
> home
> 
> home gg home xxx
> 
> home ggg ggg home home
> 
> home home
> 
> How do you match JUST the second "home" in any of the above lines (ie avoid 
> greediness)
> 
> 
> -- 
> zzapper
> http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: finding extra { braces

2006-11-30 Thread Peter Hodge
Hello Yakov,

One way is to have Vim fold the { } regions.  I think this is already set up in
the C syntax, so you just need to ':set foldmethod=syntax'.  You may also want
to ':set foldcolumn=4' (or whatever number works for you).  Note how the left
side of the display shows you where each fold (each { } region) starts and
ends.

regards,
Peter



--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> It is easy to identify extra '}' in the .c source, compiler
> points us to the exact line. Rarely, I have the opposite error,
> the extra '{' somewhere in the source. For example
>  int foo() {
>  {
>
>   }
> In this case, gcc points me to the end of file. This is not helpful.
> Can anyone suggest quick method of finding the function
> that contains extra '{' brace ?
> 
> Thanks
> Yakov
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: I look for php abbreviations configuration script...

2006-11-28 Thread Peter Hodge
Hello,

I haven't heard of any PHP abbreviations script, you could perhaps search
vim.org for scripts related to PHP.  Perhaps you are looking for these
commands?

  filetype plugin on
  filetype indent on
  syntax on

regards,
Peter




--- KLEIN Stéphane <[EMAIL PROTECTED]> wrote:

> 2006/11/28, Peter Hodge <[EMAIL PROTECTED]>:
> > Hello,
> >
> > What does a 'php abbreviations configuration script' do?
> >
> > regards,
> > Peter
> >
> >
> > --- KLEIN Stéphane <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> > >
> > > I look for php abbreviations configuration script. There aren't ?
> 
> It's some line to add in my .vimrc file to define some php abbreviations.
> 
> Sorry if my request isn't unequivocal.
> 
> Regards,
> Stephane
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: an uncomfortable thing

2006-11-27 Thread Peter Hodge

--- Ronald <[EMAIL PROTECTED]> wrote:

> I am new.
> Usually when I am in command mode (I mean when I pressed ESC), the
> cursor shape becomes a block, it is well that when I press `i' or `a'
> the cursor will become a bar at the left or right side of the block.
> But here is a problem, when I want to enter something like:
> 
> (test)
> 
> I will enter the parentheses first, then I need simple key stokes to
> back one letter like:
> 
> control oh or control oi
> 

Hello,

Perhaps if you map () to move the cursor for you, it will save you some
trouble:

  imap () ()

Now you should be able to insert () and the cursor will move to the correct
place without the need for CTRL-O.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: I look for php abbreviations configuration script...

2006-11-27 Thread Peter Hodge
Hello,

What does a 'php abbreviations configuration script' do?

regards,
Peter


--- KLEIN Stéphane <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I look for php abbreviations configuration script. There aren't ?
> 
> Thanks
> Stephane
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: compile code from within vim

2006-11-26 Thread Peter Hodge
Hello,

Probably the most straightforward way to do this in your ~/.vimrc file:

  nnoremap  :call CompileScript()

  function! CompileScript()
" the name of the current file
let fname = expand('%')

" can't compile unless the file is saved
if &modified
  echo printf('Please save %s before compiling', fname)
  return
endif

" decide how to execute the script:
if &filetype == 'perl'
  execute printf('!perl %s', fname)

elseif &filetype == 'ruby'
  execute printf('!ruby %s', fname)

elseif &filetype == 'bash' || &filetype == 'sh'
  execute printf('!source %s', fname)

else
  echo printf("Don't know how to compile filetype '%s'", &filetype)
endif
  
  endfunction


I hope that's enough to get you started.

regards,
Peter


--- atstake atstake <[EMAIL PROTECTED]> wrote:

> I'm using vim 6.4.7 on Fedora Core 5. I would like to compile C,
> Perl, ruby & bash script from within vim. I want vim to recognize a file
> by extenstion and if I map it to, say,  vim would be able to compile
> the code based on the extension; eg. if it's a .pl file it would do
> "perl filename", show the result and if there's any error it would take
> me to the line where the error is.
> 
> Is there any easy way to do this with functions? Any example would be
> greatly appreciated.
> 
> Thanks.
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: yank and put 'over' instead of 'insert'

2006-11-14 Thread Peter Hodge

--- Troy Piggins <[EMAIL PROTECTED]> wrote:

> * A.J.Mechelynck <[EMAIL PROTECTED]> :
> > Troy Piggins wrote:
> > >I use 'R' replace mode when doing, for example, ascii art etc
> > >because it allows me to change characters without affecting the
> > >layout of the rest of the window/page.
> > >
> > >But if I want to yank a section using visual or visual block, is
> > >there a way to put 'p' that block in without affecting the
> > >layout?  The way I've been doing it, the rest gets pushed along.
> > 
> > Use visual again, and the put will replace the selection: see ":help v_p".
> 
> Thanks for the quick response Tony!
> 
> That works if the 2nd visual selection is the same size, but if
> different size text to the right is moved along.
> 
> Also, if I want to delete a block to move it instead of copy it,
> text to the right of the deleted block is shifted left.  Is there
> a way around that?


Hello,

Select the visual block and use 'r' to replace all characters with
spaces.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Checking an option

2006-11-13 Thread Peter Hodge
Hello,

The 'no{option}' options aren't really options, that's just a way of turning
them off. You can use:

  if ! &startofline
(do something)
  endif

regards,
Peter

--- Meino Christian Cramer <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> 
>  in a script I want to to something like:
> 
> if 
>(do something)
>   endif
> 
>  From the help I got under the toppic "expr-option"
> 
> option*expr-option* *E112* 
> *E113*
> --
> &option   option value, local value if possible
> &g:option global option value
> &l:option local option value
> 
> Examples: >
>   echo "tabstop is " . &tabstop
>   if &insertmode
> 
> Any option name can be used here.  See |options|.  When using the local
> value
> and there is no buffer-local or window-local value, the global value is
> used
> anyway.
> 
> 
> 
>  So I wrote (before there was a "set nostartofline")
> 
> if &nostartofline
>  (do something)
> endif
> 
>  but it fails with:
> 
> Error detected while processing /home/mccramer/.vimrc:
> line  561:
> E113: Unknown option: nostartofline
> E15: Invalid expression: &nostartofline
> 
>  which I dont understand, since some line before "set nostartofline"
>  was used and there "nostartofline" was known...
> 
>  What can I do to solve the problem ?
> 
>  Thank you very much in advance for any help !
> 
>  Keep editing!
>  mcc
> 
> 
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: grep.vim support

2006-11-09 Thread Peter Hodge

--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> Neil Gabriel wrote:
> >> On 11/9/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
> >> > Neil Gabriel wrote:
> >> > > I did in fact look at that.  Reading through the "internal" grep
> >> > > however, I do not see a way of running a recursive search (i could be
> >> > > missing it).
> >> > >
> >> > > Thanks
> >> >
> >> > If you mean recursing into directories, see the ** wildcard. I don't 
> >> remember
> >> > where in the help it's mentioned but that's what it means.
> >> >
> >> > A few (untested) silly examples:
> >> >
> >> > :vimgrep /\/g $VIMRUNTIME/**/*.vim
> >> >
> >> > to find all "if" statements in all distributed Vim scripts.
> >> >
> >> >
> >> > vimgrep /\s/g /**/*
> >> >
> >> > to find all spaces and tabs anywhere on your hard disk (the current 
> >> drive on
> >> > Windows, _all_ currently mounted filesystems on Unix). This might, 
> >> of course,
> >> > take quite a lot of time. Don't try it unless you're ready to go to 
> >> bed and
> >> > see in the morrow whether Vim has finished searching!
> >> >
> >> >
> >> > Best regards,
> >> > Tony.
> >> >
> >> > P.S.
> >> > 1. Top-posting is frowned upon in the Vim lists.
> >> > 2. Please don't use private mail unless you're straying off-topic. I 
> >> suppose
> >> > you can educate yourself to use "Reply to All" (or "Reply to List" 
> >> if your
> >> > mailer offers it) rather than "Reply to Sender", can't you?
> >> >
> >>
> > 
> > On 11/9/06, Neil Gabriel <[EMAIL PROTECTED]> wrote:
> >> Thanks for the info.. I will be sure to use 'Reply to all'.  With
> >> regard to top vs. bottom posting, i'll have to dig through my gmail
> >> settings... I image they support either way.
> >>
> >> Thanks again
> >>
> > 
> > Btw ... Is there a way to map a key such that vim will invoke vimgrep
> > on whatever symbol the cursor is on?
> > 
> 
> Of course. Since Ctrl-R Ctrl-W inserts (in Command-line mode) the word under 
> the cursor, you can use (untested):
> 
>   :map   :vimgrep //g

Hello,

 is the only part which doesn't work, so you can use:

  :map  :vimgrep />/g

or just

  :map  :vimgrep //g

regards,
Peter


> 
> The cursor will (if I didn't goof) stop on the command-line, ready for you to
> 
> insert the filename(s) (possibly with wildcards) then hit Return.
> 
> See ":help keycodes" and ":help <>" about how special keys have been
> represented.
> 
> 
> Best regards,
> Tony.
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: vim.org refreshed mockup

2006-11-07 Thread Peter Hodge

--- Ricardo SIGNES <[EMAIL PROTECTED]> wrote:

> * Panos Laganakos <[EMAIL PROTECTED]> [2006-11-07T12:59:57]
> > I made a mockup of a refreshed version of vim.org, trying to maintain
> > as much of the original look as possible:
> > 
> > http://panos.solhost.org/mockups/vimorg-01.png
> > 
> > vim tangofied icon by toZth
> 
> I like it.  The light grey used in the dates/names in the sripts section is a
> bit too light for easy reading.  I think that if the "V" icon is going to be
> used (as opposed to the (unofficial?) "Vim" icon), you should do SOMETHING to
> get "Vim" in the header.  After all, it isn't "V the editor."

No, 'V' is in fact an energy drink, quite well-known in Australia, so it's good
to keep the whole 'Vim' name on the page!

http://www.frucor.com/brands/aus/new_age.html

regards,
Peter

Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Agonized by "auto changed cursor to next line when typing".

2006-11-02 Thread Peter Hodge

--- Shark Wang <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I was agonized by GVim 7.0, the editor always auto changed my cursor
> to next line, when I typed
> with long line ( less than the wrap margin ) or end tag element, such
> as "".
> 
> the following is my vimrc, you could see that I had disabled autoindent :
> =
> "* display *
> colo darkblue
> syntax on
> set gfn=Bitstream\ Vera\ Sans\ Mono:h11
> set anti
> set nonu
> "* wrap and tab *
> set wm=78
> set ts=2
> set sw=2
> set et
> "* indent *
> set noai
> set nosi
> set nocin
> set ic
> 
> What should I do for this issue ? thanks for your help.

Hello,

If you have 'wrapmargin' or 'wm' set to 78, Vim is going to wrap your text 78
characters *before* the right margin.  That means if you have 110 columns of
screen space, Vim will wrap after just 32 characters.  Perhaps 'textwidth' is
the option you are trying to set in your vimrc where you have:

  set wm=78

maybe you should use

  set textwidth=78

See also
  :help 'wm'
  :help 'tw'

Also, AFAIK indenting options don't insert newlines, they only adjust the
number of tabs/spaces at the start of the line.

regards,
Peter

Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Key mapping on "," and "." with "CTRL"

2006-10-27 Thread Peter Hodge
Hello,

I think it depends on what your terminal can understand.  One way you can find
it out is to type ':map ' (using command mode), then press CTRL-V and then the
key sequence you want to map.  For example, to map CTRL-L you could use ':map
'.

regards,
Peter



--- Zhaojun WU <[EMAIL PROTECTED]> wrote:

> Hi, Vimmers,
> 
> Is there any way to map the "comma" and "period" with "CTRL" such as:
> map   :foo
> map   :foo
> It seems the "," and "." cannot be used here directly. How can I do in
> this case?
> 
> Another question is how I can check all of the current key mappings in
> VIM? I remembered I saw something about it before, but failed to find
> it out.
> 
> Thanks,
> -- 
> Best,
> Zhaojun
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Need to write a language

2006-10-25 Thread Peter Hodge
--- Billy Patton <[EMAIL PROTECTED]> wrote:

> I'm in the semiconductor industry.  My job is to create data and to run
> regression tests on that data for the validation of physical layout rules.
> 
> Skip to bottom for questions, if you don't want to read my ramblings. 
> 
> 
> The current problem is tha the rules are not in a computer readable form.
> Many paople have a hand in writing different sections of the rules, so you
> can imagine that the wording is widely varied.  There is no standard to
> wording or even the dialog used.
> 
> One of the things I have been ask to do is to try and get a handle on how
> the rules may be written that that they are computer readable.
> I've been working with perl hash's and excel spread sheets.
> The main problem I was having was that I was trying to decreace the
> relationship words and increase the number of variables.  This was quickly
> resulting in a spread sheet that was growing (number of columns) very
> rapidly.  I assume excel has a limit to the number of columns.
> 
> The idea that I have come up with is to create a language with limited
> descriptive words.  Here is an example of a rule that might be written in a
> human readable form but also parsable by puter.
> 
> MET1 spacing to MET1 is 45 if MET1 width is <= 245 and >= 100
> 
> By looking at this
> MET1 is a layer
> Spacing width <= >= are relationships
> If is a constraint
> #'s are #'s
> 
> I want to have them write correct by construction.
> 
> Is it possible, in vim/gvim to open a special version of vim so that the
> user can begin to type, spac , and it would complete the word?
> Would it also be possible to not allow a word to be type'd if that word was
> not in a list.
> 
> Vim would have to open in edit mode and remain there for most users, until
> save/exit.  Most of the users of this would be hard core pc users who think
> the only editor is "word".  But there are a few unix users.
> 
> My questions.
> 1. Can vim be configured to automatically start in edit mode?
> 2. Can vim monitor each word that is being typed?
> 3. Can vim do word completion?
> 4. Can vim offer all possible spellings for partial word completion?
> If the answer to most of qeustion above is yes
> 5. Can I do the programming?  I do perl, c, c++, csh and sh programming.


Hello,

As well as completing words, it would be very helpful if you wrote a syntax
file for your language. If your users see things in color, they can be sure
they have typed the commands correctly, but if the text is *not* colored, then
they will know they've got something wrong.

Something else you may want to consider - Map  to call a perl script which
examines the line under the cursor and prints a message explaining what needs
to be typed next.

regards,
Peter




 
On Yahoo!7 
Win VIP tickets to meet R'n'B stars superstars Ne-Yo and Rihanna 
http://advision.webevents.yahoo.com/aunz/music/jay_z_promotion/index.htm 



Re: Bold font in OS X GUI?

2006-10-24 Thread Peter Hodge

--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> Peter Hodge wrote:
> > Hello,
> > 
> > I am having trouble with OS X GUI, none of the highlighting is in Bold.  Is
> > this a Bug, or does Bold font just not work in the OS X gui?
> > 
> > regards,
> > peter
> 
> 
> It may depend on your 'guifont'. Some font faces have no bold glyphs, others 
> no italic, etc. Here, when I set 'guifont' to "SUSE Sans Mono 9", all italics
> 
> appear bolded; on "B&H LucidaTypewriter" there are no italics at all, ...
> 
> If your GUI flavour accepts it, try ":set gui=*" (without the quotes) and 
> select the "regular" version of a font which has also "bold" "italic" etc.
> 
> If it doesn't accept it, you'll have to find from another source which font 
> names are valid on your system, and then find by hit-and-miss some font
> having 
> regular, bold, etc.

I can use guifont=*, and have tried many different fonts which have bold and
italic glyphs. The problem is that no matter which font I choose, Vim refuses
to show text in Bold (Unless I choose a font which has only a bold glyph).  I
get the impression it's a shortcoming of the OS X GUI, because underlined text
doesn't work either (Vim reverses the bg/fg colors instead).

regards,
Peter







 
On Yahoo!7 
Messenger: Share up to 1GB of files in the IM window
http://au.messenger.yahoo.com 



Bold font in OS X GUI?

2006-10-24 Thread Peter Hodge
Hello,

I am having trouble with OS X GUI, none of the highlighting is in Bold.  Is
this a Bug, or does Bold font just not work in the OS X gui?

regards,
peter




 
On Yahoo!7 
Want to make technology work harder for your business? 
http://au.mobile.yahoo.com/mobile-business-solutions/index.html 



Spam on vim.org

2006-10-22 Thread Peter Hodge
Hello,

Can the person responsible please remove this spam from vim.org?

http://www.vim.org/tips/tip.php?tip_id=1367

regards,
Peter



 
Do you Yahoo!? 
Yahoo!7 Time Capsule - Make your mark and be a part of history
http://www.yahoo7.com.au/timecapsule


Re: BUG: formatoptions+=t makes comments wrap (incorrectly) when they shouldn't

2006-10-19 Thread Peter Hodge

--- Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> 
> Peter Hodge wrote:
> 
> > When I have formatoptions=t, it makes comment lines wrap when they
> > shouldn't, and it also ignores whatever comment leader is defined in
> > 'comments'.  To reproduce:
> > 
> > 
> >   :set formatoptions=roc
> >   :set comments=b:%
> >   :set textwidth=30
> > 
> >   % type these lines of text
> >   % as one line, and notice
> >   % how Vim automatically
> >   % wraps the lines and adds
> >   % '%' at the start of each
> >   % line.
> > 
> > Now remove 'c' from formatoptions and add 't'.
> >   :set formatoptions-=c
> >   :set formatoptions+=t
> > From the help pages (:help fo-table)
> > t   Auto-wrap text using textwidth (does not apply to comments)
> > c   Auto-wrap comments using textwidth, inserting the current
> comment
> > leader automatically.
> > With 'formatoptions' now set to 'rot', Vim should wrap normal text, but not
> > comments.
> > 
> >   % but when you type this
> >   next set of comments, Vim
> >   will wrap them (when it
> >   shouldn't, because they are
> >   comments), and it will also
> >   miss out the comment leader.
> > 
> > I hope it's clear what's going on here.  I'm running Vim 7 with
> > patches 1-101.
> 
> When you remove "c" from 'formatoptions' Vim doesn't recognize comments,
> thus everything is formatted as normal text.
> 
> I don't think there currently is a value for 'formatoptions' to only
> format text that isn't comments.  Mostly because comments is text that
> you normally want to format.

OK, I understand now.  Perhaps the fo-table docs should read:

  t  Auto-wrap all text using textwidth.  Comment leader is not inserted
 automatically unless 'c' is present also.

Otherwise, it appears as though 't' should wrap everything except comments.
"... (does not apply to comments)".

regards,
Peter




 
On Yahoo!7 
Men's Health Radio: Chill out or work out, or just tune in 
http://au.launch.yahoo.com/mens-health-radio/index.html


Re: What's the exact meaning of the set 'background'?

2006-10-18 Thread Peter Hodge
Hello,

If you change the background=light, Vim reloads the colorscheme so it has a
chance to give you new colors.  But if the colorscheme changes background=dark
again, then Vim knows that the colorscheme isn't capable of picking colors for
a light background.  In that case, Vim will just ignore whatever the
colorscheme says and will use default colors instead.

Therefore, your colorscheme could just read the value of 'background' and
choose appropriate colors, or it could set it the value of background to light
or dark, and choose those colors, because if Vim sees the colorscheme trying to
set 'dark' when you have just selected 'light', it ignores your colorscheme.

regards,
peter



--- [EMAIL PROTECTED] wrote:

> 
> Hi Vimmers,
> 
> Recently, I've been thinking what this option is designed for.
> 
> The document saids that:
> 
>   when 'background' is set Vim will adjust the default color groups for the
> new value. But the colors used for syntax highlighting will not change.
> 
> But in fact, I had tested and found that when I set the 'background'
> option, Vim will source the color scheme script again. The idea seems to be
> good, if the color scheme script reads the 'background' option and set a
> different color according to the option everything should work...
> 
> However, we could imagine... what will happen if I set background=light
> while the color scheme set background=dark inside the script? When we set
> background=light in command line, the script will be launched, and the
> background set to dark. then we will never be able to set background=light.
> Then, if another color scheme wants the value, it will always get
> background=dark even if the user set background=light. (Okay the "System"
> will try to set the 'background' option too, and that will more more
> confusing...)
> 
> So, is 'background' option designed so that the color scheme should not
> read or write it at all? In my opinion it is introducing more confusing
> than good if it works this way.
> 
> Could anyone explains what this option "exactly" means and what it is
> designed to and how should we use it? I've been quite confused now.
> 
> --
> Sincerely, Pan, Shi Zhu. ext: 2606
> 
> 




 
Do you Yahoo!? 
Spring Racing Carnival - Check out Sonia Kruger's blog
http://au.sports.yahoo.com/racing/


Re: Match something that not in the pattern

2006-10-18 Thread Peter Hodge

--- Peng Yu <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have the following file segments. I want to concatenate all the
> lines with their next lines, except that it ends with "}}". I want to
> use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.

[EMAIL PROTECTED] is the look-ahead assersion, you want the look-behind 
assertion which is
\@http://www.totalgirl.com.au/slumberparty


BUG: formatoptions+=t makes comments wrap (incorrectly) when they shouldn't

2006-10-18 Thread Peter Hodge
Hello,

When I have formatoptions=t, it makes comment lines wrap when they shouldn't,
and it also ignores whatever comment leader is defined in 'comments'.  To
reproduce:


  :set formatoptions=roc
  :set comments=b:%
  :set textwidth=30

  % type these lines of text
  % as one line, and notice
  % how Vim automatically
  % wraps the lines and adds
  % '%' at the start of each
  % line.

Now remove 'c' from formatoptions and add 't'.
  :set formatoptions-=c
  :set formatoptions+=t
>From the help pages (:help fo-table)
t   Auto-wrap text using textwidth (does not apply to comments)
c   Auto-wrap comments using textwidth, inserting the current comment
leader automatically.
With 'formatoptions' now set to 'rot', Vim should wrap normal text, but not
comments.

  % but when you type this
  next set of comments, Vim
  will wrap them (when it
  shouldn't, because they are
  comments), and it will also
  miss out the comment leader.

I hope it's clear what's going on here.  I'm running Vim 7 with patches 1-101.

regards,
Peter



 
Do you Yahoo!? 
Cars: Buy and sell, news, reviews, videos and more 
http://yahoo.drive.com.au/


Re: Fighting with comments

2006-10-18 Thread Peter Hodge

--- Gary Johnson <[EMAIL PROTECTED]> wrote:

> On 2006-10-18, eric1235711 <[EMAIL PROTECTED]> wrote:
> 
> > Yakov Lerner-3 wrote:
> > > 
> > > On 10/18/06, eric1235711 <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Hello
> > >>
> > >> I´m PHP programmer and I started programming in gVim last weak, and I´m
> > >> liking it very much
> > >>
> > >> But I got a trouble...
> > >>
> > >> When I´m commenting (// or /* or #) and I type  it breaks the
> line
> > >> automatically. Always I start a comment, i have to go to normal mode and
> > >> type :set nosta :set noai :set nosi
> > >>
> > >> I find that only nosta or nosi is enought to make it stop breaking the
> > >> line
> > >> automatically, but I want to configure to it stop doing it forever...
> > >>
> > >> I took a look in syntax/php.vim but I just don´t know where correct
> it...
> > >>
> > >> Do you have any idea of how I fix it?
> > > 
> > > Does this help:
> > >:set tw=0
> > > ?
> 
> > I can fix it when I´m programming, i´m doing it... but I´m getting tired of
> > doing that.
> > 
> > I want to alter the syntax file (or what ever else) to fix it permanently.
> 
> First of all, don't alter any of the files that are in the
> $VIMRUNTIME directory.  For Vim-7.0 on Windows, this is commonly
> 
> C:\Program Files\Vim\vim70
> 
> Doing so will cause you to lose those changes when you upgrade your
> vim installation.
> 
> The way to fix this problem is to create two new directories:
> 
> $VIM\vimfiles\after
> $VIM\vimfiles\after\ftplugin
> 
> on Windows or
> 
> ~/.vim/after
> ~/.vim/after/ftplugin
> 
> on Unix.  Then create a new file in the after/ftplugin directory
> named php.vim and put in it those commands that fix the problem,
> e.g.,
> 
> setlocal nosta
> setlocal noai
> setlocal nosi

I wouldn't have thought those options would make a difference? You should be
able to just use (in after/ftplugin/php.vim):

  " don't auto-wrap text
  setlocal formatoptions-=t

  " don't auto-wrap comments either.
  setlocal formatoptions-=c

regards,
Peter



 
On Yahoo!7 
Men's Health Radio: Chill out or work out, or just tune in 
http://au.launch.yahoo.com/mens-health-radio/index.html


Re: Mapping doesn't work in putty.

2006-10-17 Thread Peter Hodge
Perhaps you could use:

  map [ctrl-v][ctrl-left] :tabp
  map [ctrl-v][ctrl-right] :tabn

Except instead of typing 'ctrl-v' and 'ctrl-left' literally, you type those
combinations instead.  This will map the exact escape sequences that your
terminal is sending.

regards,
Peter



--- J A G P R E E T <[EMAIL PROTECTED]> wrote:

> Hi There,
>I have these mappings defined in my .vimrc file.
> 
> map  :tabnew
> map  :tabp
> map  :tabn
> 
> I'm using putty(terminal emulator) to access the unix server.
> 
> The fist mapping works absolutely fine.
> The other two doesn't work at all and gives the error(E388: Couldn't find
> definition).
> Furthermore I checked  shows the definition for the variable under
> cursor.
> No clues why its not overridden from my mapping.
> 
> When I changed map  : tabp to
> Map  : tabp
> It works.
> 
> Another point is the mapping(, ) works if I use Exceed or
> x-Manager.
> I have no clue at all why its not working in putty.
> As far as I know for mapping at least; graphics support is not a must.
> 
> Whats missing for this mapping in putty.
> 
> Regards,
> Jagpreet 
> 
> 
> 
> 




 
On Yahoo!7 
Men's Health: What music do you want to hear on Men's Health Radio? 
http://www.menshealthmagazine.com.au/ 


Re: Contextual 'iskeyword'?

2006-10-17 Thread Peter Hodge
--- Benji Fisher <[EMAIL PROTECTED]> wrote:

> On Tue, Oct 17, 2006 at 05:43:08AM -0500, Tim Chase wrote:
> > In some text, I've got compound words separated by a single 
> > hyphen.  For convenience of yanking, I've added the hyphen to my 
> > iskeyword setting which works nicely for the most part.  However, 
> > I also use a doubled-hyphen to the effect one would use an 
> > em-dash which leads to the unwanted situation that a yank of a 
> > "word" now includes the first word of the subordinate sentence 
> > structure--such as this where the dashes are doubled--and effects 
> > my ^N/^P searching (as duplicates appear for entries followed by 
> > the double-dash).
> > 
> > I'm on the prowl for some way to keep the iskeyword behavior for 
> > things like "doubled-hyphen" and "em-dash" in the above 
> > paragraph, but exclude things like "structure--such" and 
> > "doubled--and", limiting the "word" to things with a dash only if 
> > that dash is not repeated.  Something like "\w-\w" but not 
> > "\w-\+\w" (assuming that "-" isn't part of iskeyword for this 
> > example)
> > 
> > Any hints?
> 
>  Let's think big and look for a generic solution.  IMHO, it is way
> too restrictive to insist that a word is anything matching the pattern
> /\k\+/ .  I want a new option, 'wordpat', with a default value of
> '\k\+', that specifies what should be recognized as a word, for purposes
> of search patterns, Normal-mode commands such as w and b, and maybe
> other uses.  (Oh, yes:  Insert-mode completion.)
> 
> Examples:
> 
> :let &l:wordpat = '\k\+\(-\k\+\)*'
> 
> allows words-with-hyphens but--as requested--does not match double
> hyphens.  Change the '*' to '\=' to allow no more than one hyphen per
> word.  C programmers may like to use '\.' instead of '-'.
> 
> :let &l:wordpat = '\\\=\k\+'
> 
> matches TeX commands like \def and \input and caters to the (lazy but
> common) style of omitting optional white space:
>   $ \alpha\beta\gamma=\alpha+\beta+\gamma $.
> 
> :let &l:wordpat = '\a\l*'
> 
> matches Capitalized words but rejects CamelCase words.
> 
>  What do you think?  Would this solve enough problems to be worth
> the effort?  How many vim users would add it to their wish lists?

I have exactly the same problem with '_' and '__' in words, so I would like the
feature also, if it is possible.

That said, you can use something like the following to get by in the meantime:

  function! SelectCustomWord()
let l:oldISK = &isk
let l:oldSearch = @/

set isk+=\-
normal! v?\<\|--?e+1
mto`t/\>\|--/s-1

let &isk = l:oldISK
let @/ = l:oldSearch
nohls
  endfunction

  " enable using 'yi-' just like you use 'yiw'
  onoremap i-  :call SelectCustomWord()
  vnoremap i- v:call SelectCustomWord()

  " a mapping for you to try stuff out
  map  "ayi-:echo @a

Then you can use 'i-' just like you would use 'iw'.  here's some words for you
to try it on (press F5 with the cursor over different words):

  "one-word"
  two--words
  first-word--second-word--thirdword!

See ':help text-objects' and ':help iw' for more information on how to use 'iw'
and your new 'i-' command.

regards,
Peter




 
Do you Yahoo!? 
Spring Racing Carnival - Check out Sonia Kruger's blog
http://au.sports.yahoo.com/racing/


Re: How to find a file.

2006-10-16 Thread Peter Hodge
--- Zheng Da <[EMAIL PROTECTED]> wrote:

> Hello.
> I want to open a file, and I know its name, but don't know the path.
> I want to use the command "find". For example I want to open the file
> space.cc, and use the command :find space.cc. I know the file may be
> in the current directory, or the subdirectories, but always get the
> error E345: Cannot find file "space.cc" in path. I use the default
> path, it should be .,/usr/include,,. (I use Linux).
> So what's the problem? And how to open the file I want?

Hello,

If you prefix '**/' to the filename, Vim should search through subdirectories
for the file:

  :edit **/space.cc
  :find **/space.cc

Also, if you use , Vim will show you a list of matching files:

  :find **/space.cc
src/space.cc
src/backup/space.cc

regards,
Peter




 
On Yahoo!7 
Music: Create your own personalised radio station. 
http://au.launch.yahoo.com/ 



Re: replace using variable

2006-10-16 Thread Peter Hodge

--- Akbar <[EMAIL PROTECTED]> wrote:

> Hi, I have these words:
> 
> 1. I am good
> 2. You sucks!
> 3. Take that, moron
> 
> I want to change those sentences into:
> 1. I am good
> 2. You sucks!
> 3. Take that, moron
> 
> How do I do that using vim replace command?
> All I can think  is this:
> :%s/\d/\d/igc
> 
> But that does not work. Any idea? Yeah, I can change them using vim
> macro or using scripting language but it will be nice if I can change
> them using vim replace command.

Hello, you're looking for backreferences:

  :help /\1

You want this command:

  :%s/\(\d\+\)/\1/igc

regards,
Peter

P.S. If you are feeling frustrated (Vim can do that to you), try writing
something more soothing, e.g.:

  1. I am happy
  2. You are beautiful!
  3. Take that, as a token of my love





 
On Yahoo!7 
Music: Create your own personalised radio station. 
http://au.launch.yahoo.com/ 



Re: substitude, write and close with one command

2006-10-16 Thread Peter Hodge
--- Tomas Lovetinsky <[EMAIL PROTECTED]> wrote:

> Hi,
> I would like to ask you for help with my problem. I think it is simple but in
> fact I'm not able to 
> find the solution as quickly as I need.
> I need to do sometink like
> :s/a/b/g :wq
> It means to substitute, write and close file.

Hello,

You can separate multiple commands using '|', therefore:

  :s/a/b/g | wq

regards,
Peter



 
On Yahoo!7 
Caller tones: Replace your ring tone with your favourite sound clip! 
http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag



Re: cursor moves back with ESC

2006-10-16 Thread Peter Hodge

--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> On 10/16/06, Lev Lvovsky <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I've never actually figured out why upon after typing in insert mode,
> > the cursor moves back one character to the left after pressing
> > escape.  What's the reason behind this, and is there any way to turn
> > it off?
> 
> IIRC there was a post some months a go on list with
> location of unofficial patch that changes this behaviour.
> (I dont have the location of the patch at hand).
> 
> You can try this:
> au InsertLeave * norm l
> , not that I find it convenient. YMMV.

You can also try:

  inoremap  l

which will work a little quicker in a terminal Vim.

cheers,
Peter




 
On Yahoo!7 
Fuel Price Watch: Find the cheapest petrol in your area 
http://au.maps.yahoo.com/fuelwatch/


Re: VimL and Exuberant tags - Suggestions please

2006-10-12 Thread Peter Hodge
Hello David,

Can I suggest support for these commands:

  :set/setlocal/setglobal
  :syntax
  :highlight (and maybe :HiLink because it is so commonly used)

Some examples:

  set foldmethod=syntax
  setlocal formatoptions+=roq
  setglobal completeopt-=preview

  syntax keyword phpFunction ...
  syn match phpIdentifier ...
  syn region phpRegion ...
  sy cluster phpClTop ...
  syntax clear phpMethods

  highlight String ...
  hi clear Constant ...
  hi link Number ...
  hi! link Number ...
  hi def link Function ...
  HiLink Number ...

These are all pretty straightforward to find.

Also, for dictionary functions would it make sense to mark them twice, since
they get a new 'name' if the dictionary is copied to a new variable?  For
example:

  let foo = { }
  function! foo.func1() dict
  endfunction
  let bar = foo

There is now a function called 'bar.func1()', so maybe func1 should be tagged
as:

  Dictionary Functions
  foo.bar /^function! foo.bar() dict/
  .bar  /^function! foo.bar() dict/


I wouldn't mind if mappings could be tagged as well.

Is there or will there be any way to toggle options for the way ctags scans vim
files?

regards,
Peter




--- David Fishburn <[EMAIL PROTECTED]> wrote:

> 
> I have taken over maintenance of the VimL exuberant tags component.
> 
> For the vim plugin writers, are there any outstanding bugs or new feature
> requests you have for ctags.exe?
> 
> Hari just mentioned Vim7 introduces some additional syntax items to function
> names:
> 
> function mydict.len() dict
> endfunction
> 
> function autoloadFunc#subdirname#Funcname()
> endfunction
> 
> Support for this has been added to the next version of ctags (possibly 5.7).
> 
> I noticed a bug in variables which shows up in Vim7, since we introduced the
> for/endfo construct.  Ctags starts generating variable tags for tags that
> are within functions after encountering an "endfo" since the short form for
> a endfunction is "endf".
> - Also fixed in the next version.
> 
> 
> These are the items ctags currently flags:
> "augroup",  "autocommand groups"
> "function", "function definitions"
> "variable", "variable definitions"
> 
> Does it make sense to also identify autocommands?
> Or possibly only autocommands if they are outside of an augroup?
> 
> 
> When variables are identified we strip off the scope:
>   let s:ignoreNextCursorMovedI = 0 ==> ignoreNextCursorMovedI 
> Should the scope be left on ==> s:ignoreNextCursorMovedI 
> 
> 
> Instead of simply grouping everything under variables, should we distinguish
> between different types?
> let forms#form = {
>   \ 'title': 'Address Entry Form',
>   \ 'fields': [],
>   \ 'defaultbutton': 'ok',
>   \ 'fieldMap': {},
>   \ 'hotkeyMap': {},
>   \ }
> 
> Right now this is identified as a variable, should we identify it as a
> Dictionary by adding another kind of tag?
> 
> 
> What about identifying commands:
> command! -nargs=+ Select :call s:DB_execSql("select " . )
> 
> 
> What about [ion]maps (though we cannot give them a name really, but at least
> identifying where they are in the source?
> 
> 
> We could also pick up local variables (have this off by default) and produce
> something like this:
> function! s:DB_runCmd(cmd, sql)
> let l:display_cmd_line = 'blah'
> let display_shell = 'blah'
> endf
> 
> Local variables
> s:DB_runCmd.display_cmd_line
> s:DB_runCmd.display_shell
> 
> 
> 
> I am open to suggestions.
> If you have suggestions, please provide code snippets so I have examples to
> work from.
> 
> We can add these tags and leave them on or off by default, so having that
> information is useful as well.
> 
> 
> At this point the sky is the limit, we can hash out details as we move
> forward.  Somethings might not be worth the effort.  
> 
> 
> TIA,
> Dave
> 
> 




 
On Yahoo!7 
Caller tones: Replace your ring tone with your favourite sound clip! 
http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag



Re: Planet Vim

2006-10-12 Thread Peter Hodge
--- Panos Laganakos <[EMAIL PROTECTED]> wrote:

> I searched the archives, but didn't find any reference to this.

Google can't find it either, so therefore it can't exist.

> Are there enough people out there users/developers that blog about Vim?

Personally I don't think so, but one way is to set up the aggregator and see
for yourself.  It depends how much volume you call 'enough'.  I would love to
see a planet Vim site, but unfortunately most Vim articles I read tend to be
very technical and rather boring.  :-(

> If so, it would be great to have a planet vim to aggregate these blog posts.

Absolutely.  I don't want to traul the web myself to find those Vim bloggers,
if/when they exist.  You might also be able to pinch the source code from
another OS 'planet' site.

All the best,
Peter



 
On Yahoo!7 
Music: Create your own personalised radio station. 
http://au.launch.yahoo.com/ 



Re: syntax highlighting not working when loading a session

2006-10-11 Thread Peter Hodge
> 
> Thanks a lot. Your solution works perfectly. One small question. In my 
> previous .vimrc, I had this varible called fortran_free_source. Do I need to 
> worry about it in ~/.vim/ftplugin/fortran.vim or can I just forget about its 
> existence completely?

It shouldn't exist any more once you take that code out of your .vimrc.  (It
was the 'global' variable for choosing the free-source format, but the code
I've shown you uses a the per-buffer variable.)

regards,
Peter







 
On Yahoo!7 
Messenger: Plug-in the fun with handy plug-ins 
http://au.messenger.yahoo.com 



Re: syntax highlighting not working when loading a session

2006-10-11 Thread Peter Hodge
Ok, the problem is in your .vimrc:

" this only works if the "filetype plugin indent on" command precedes the
" "syntax on" command
let s:extfname = expand("%:e")
if s:extfname ==? "f90"
let fortran_free_source=1
unlet! fortran_fixed_source
else
let fortran_fixed_source=1
unlet! fortran_free_source
endif

If you don't start Vim with a .f90 file, then 'fortran_fixed_source' is set to
'1' and all .f90 files will try to highlight as fixed source (looking for
numbers).  You should put the block of code into your ftplugin/fortran.vim and
make it to use the buffer-local variables instead:


  ~/.vim/ftplugin/fortran.vim

" Don't do other file type settings for this buffer
let b:did_ftplugin = 1

+   " use free source format for all .f90 files:
+   let s:extfname = expand("%:e")
+   if s:extfname ==? "f90"
+   let b:fortran_fixed_source = 0
+   else
+   let b:fortran_fixed_source = 1
+   endif

regards,
Peter



--- Kamaraju Kusumanchi <[EMAIL PROTECTED]> wrote:

> On Wednesday 11 October 2006 19:31, Peter Hodge wrote:
> 
> > At any rate, using ':setfiletype fortran' should fix the problem straight
> > away.
> 
> No. This does not change the behavior. I cannot get the correct syntax 
> highlighting even after doing this.
> 
> > The distributed ftplugin file for fortran sets a variable called
> > 'b:fortran_fixed_source' to let the syntax file know how to highlight.  The
> > 'bad highlighting' is because the ftplugin file isn't being executed (for
> > some reason?) and so the syntax defaults to using wrong highlighting (it's
> > looking for numbers at the start of each line). 
> 
> This could be the reason. I have changed the default
> .vim/ftplugin/fortran.vim 
> quite a bit and might have messed it up somewhere.
> 
> > Curiously, my Vim doesn't 
> > have a problem with opening a session and choosing the correct
> > highlighting, so I wonder if something in your custom ftplugin or syntax
> > files is preventing the distributed ftplugin file from detecting the
> > fortran format correctly? Is there any chance you could paste the contents
> > of your .vim/ftplugin/fortran.vim into an email?
> 
> I think this list does not allow any attachements (my messages were not 
> delivered when I attached the files). So I posted 
> my .vimrc, .gvimrc, .vim/ftplugin/fortran.vim, .vim/indent/fortran.vim at 
> http://kamaraju.googlepages.com/vim_problems .
> 
> Please forgive me for not "tidying up" those configuration files. But I hope 
> you guys wont have any trouble digging through them.
> 
> Thanks for all the replies so far.
> 
> raju
> 
> -- 
> http://groups.google.com/group/ask-anything/about
> 




 
On Yahoo!7 
Photos: Unlimited free storage – keep all your photos in one place! 
http://au.photos.yahoo.com 



Re: syntax highlighting - a separate colour for each word

2006-10-11 Thread Peter Hodge
Hello,

You'll need to use syntax commands, and you may need to open up the colour
viewer while you're setting these up.  First, to highlight some words using the
existing color groups:

  syn keyword Function  containedin=ALL word1 word2
  syn keyword Statement containedin=ALL word3 word4
  syn keyword Typedef   containedin=ALL word5 word6
  syn keyword Constant  containedin=ALL word7 word8
  syn keyword PreProc   containedin=ALL word9 word10
  syn keyword Operator  containedin=ALL word11 word12

There are a few more groups you could choose from.  Use this command to see
them all:

  :so $VIMRUNTIME/syntax/hitest.vim

If there's not enough colours for you to choose from there, you could make up
your own colour groups:

  syn keyword myColor1 containedin=ALL word1 word2
  syn keyword myColor2 containedin=ALL word3 word4
  syn keyword myColor3 containedin=ALL word5 word6

  " for GUI vim:
  hi myColor1 guifg=SeaGreen
  hi myColor2 guifg=#FF

  " or for color terminal:
  hi myColor1 ctermfg=Green cterm=Bold
  hi myColor2 ctermfg=Red   cterm=Underline

You could either put all that in an ftplugin file, or maybe inside a function
inside your .vimrc.

regards,
Peter



--- Eric Smith <[EMAIL PROTECTED]> wrote:

> Like I want all instances of a word in a file to have its own color.
> 
> Amy one done something like that?
> 
> -- 
> Eric Smith
> 




 
On Yahoo!7 
Caller tones: Replace your ring tone with your favourite sound clip! 
http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag



Re: syntax highlighting not working when loading a session

2006-10-11 Thread Peter Hodge
Hello Kamaraju,

The distributed ftplugin file for fortran sets a variable called
'b:fortran_fixed_source' to let the syntax file know how to highlight.  The
'bad highlighting' is because the ftplugin file isn't being executed (for some
reason?) and so the syntax defaults to using wrong highlighting (it's looking
for numbers at the start of each line).  Curiously, my Vim doesn't have a
problem with opening a session and choosing the correct highlighting, so I
wonder if something in your custom ftplugin or syntax files is preventing the
distributed ftplugin file from detecting the fortran format correctly? Is there
any chance you could paste the contents of your .vim/ftplugin/fortran.vim into
an email?

At any rate, using ':setfiletype fortran' should fix the problem straight away.

regards,
Peter




--- Kamaraju Kusumanchi <[EMAIL PROTECTED]> wrote:

> When I save and load a session, the syntax highlighting is messed up.
> 
> I am able to reproduce the problem as follows. Consider helloworld.f90
> 
> $cat helloworld.f90
> program helloworld
> implicit none
> 
> write(*,*) 'Hello World\n'
> end program helloworld
> 
> If I do
> 
> $gvim helloworld.f90
> 
> I get something like shown in working.png ( 
> http://kamaraju.googlepages.com/vim_problems ). Now
> inside the gvim session, I did
> 
> :mksession! test.vim
> 
> After this, exiting gvim and opening test.vim using
> 
> gvim -S test.vim
> 
> gave me something like shown in not_working.png
> 
> Why is the syntax highlighting messed up in the second case? I have a bunch
> of
> configuration files
> namely .vimrc, .gvimrc, .vim/ftplugin/fortran.vim, .vim/indent/fortran.vim
> which ensure that the syntax highlighting is correct in the first case. But I
> do not know why these files are not being loaded when I am restoring the
> session using -S. Any ideas?
> 
> PS: This mailing list does not seem to accept any attachments. That is why I 
> uploaded the screenshots to http://kamaraju.googlepages.com/vim_problems .
> 
> thanks
> raju
> 
> -- 
> http://groups.google.com/group/ask-anything/about
> 




 
On Yahoo!7 
Men's Health: What music do you want to hear on Men's Health Radio? 
http://www.menshealthmagazine.com.au/ 


Re: Shading alternating patterns.

2006-10-10 Thread Peter Hodge
Hello Aaron,

You could do something like this:

  syn match Sel1 /^\.selector/ nextgroup=Items1 skipwhite
  syn region Items1 start=/{/ end=/}/ contained keepend
\ nextgroup=Sel2 skipwhite skipempty

  hi Sel1 guibg=#44
  hi Items1 guibg=#44

  syn match Sel2 /^\.selector/ contained nextgroup=Items2 skipwhite
  syn region Items2 start=/{/ end=/}/ contained keepend

  hi Sel2 guibg=#004400
  hi Items2 guibg=#004400

That will get you started.

regards,
Peter


--- Aaron <[EMAIL PROTECTED]> wrote:

> I've been swapping my subscribed addresses, so I apologize if this got 
> posted more than once.
> 
> My question is casual, but I wasn't able to find anything on the FAQs or
> Google, so I hope someone here can tell me if I'm nuts or not.
> 
> In my ideal world (which, so far, Vim has done an excellent job creating
> for me), CSS definitions would be lightly, alternatingly shaded. Here at
> work, we format our CSS files like so:
> 
> .selector { property: value; property: value;
> property: value; }
> .selector { property: value; }
> .selector { property: value; property: value;
> property: value; property: value; }
>
> 
> You can see immediately that it is easy enough to scan down the left
> column to find the selector you're interested in, but it's a bit more
> difficult to see where one definition's property list starts and
> another's ends (especially with syntax highlighting in there).
> 
> Is there some way, perhaps through a syntax rule, or rules, to have Vim
> shade the background of *alternating* CSS definitions, assuming this
> file format?
> 
> I'm handy with regex but I don't know if Vim's syntax system is even up
> to the task. A function that ran against the buffer would be fine, too.
> 
> Thanks!
> 
> -- 
> Aaron
> 




 
On Yahoo!7 
Photos: Unlimited free storage – keep all your photos in one place! 
http://au.photos.yahoo.com 



Re: Replacing '%' in a text file

2006-10-09 Thread Peter Hodge
Hello,


--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> Muhammad Farooq-i-Azam wrote:
> > I have to replace every occurrence of % in a file with
> > % |. I have been effectively replacing text using the
> > following construct:
> > 
> > :%s/\/replacement/g
> > 
> > However when I try to do the following:
> > 
> > :%s/\<%\>/% |/g 

A.J. is right, the \< and \> won't work because there's no word boundary there.
 Are you trying to say 'replace % when surrounded by whitespace?'  If so, you
could use:

  :%s/\s\@<[EMAIL PROTECTED]/% |/g

regards,
Peter



 
On Yahoo!7 
Men's Health: What music do you want to hear on Men's Health Radio? 
http://www.menshealthmagazine.com.au/ 


Re: Local scope ?

2006-10-03 Thread Peter Hodge
Hello,

> Hi,
> 
>  when writing a function in vim script sometimes it makes sense to
>  change options of vim.
> 
>  Are these changes local to the function ?

No, they persist after the function is ended.  As a simple example, you could
use a function like the following to toggle the 'number' option.

  map  :call ToggleNumberOption()
  function! ToggleNumberOption()
set number!
  endfunction

You'll see that the ToggleNumberOption function is changing the 'number' option
and the change persists after the function is ended.

>  And if not: Can I simply assign the current value of the option to a 
>  variable, change the option and restore the option value from the
>  value stored in that variable?

Occasionally it is useful to store the value of an option and restore it later.
 You can do it like this:

  " store the value
  let l:old_isk = &iskeyword

  " restore the value
  let &iskeyword = l:old_isk

regards,
Peter




 
On Yahoo!7 
New Idea: Catch up on all the latest celebrity gossip 
http://www.newidea.com.au


BUG? getchar(0) and getchar(1) do not detect

2006-10-03 Thread Peter Hodge
Hello all,

I am having trouble with getchar() detecting .  If I use getchar(0) or
getchar(1), it will not pick up an  keystroke.  You can replicate this by
using the command:

  :sleep 3 | echo getchar(0)

... and pressing  quickly before the getchar() function is called.  In GUI
Vim, I correctly see 27 returned by getchar(0), but in Terminal Vim, getchar(0)
is returning '0', even though  has been pressed.  Is this a bug in Vim?

regards,
Peter




 
On Yahoo!7 
Answers:  25 million answers and counting. Learn something new today
http://www.yahoo7.com.au/answers


Re: Colorschemes Need Updating

2006-10-01 Thread Peter Hodge
Hello,

> I found no way to change Gvim's default highlighting for
> these groups.  What I found is a mapping of the groups to
> group names in the setting 'highlight'.

I believe you're supposed to change these default mappings in your .vimrc file,
but unfortunately your changes will get lost as soon as you change colorscheme
or change the 'background' setting, and maybe under some other circumstances as
well, so .vimrc actually doesn't work so well for customizing colors.  I've
made a small plugin which lets me use 'after/colors/' scripts in the same way I
would have '/after/syntax/' scripts, and I find this system works very well for
customizing colorschemes (individually or all at once).
(http://www.vim.org/scripts/script.php?script_id=1641)

regards,
Peter



 
On Yahoo!7 
Photos: Unlimited free storage – keep all your photos in one place! 
http://au.photos.yahoo.com 



Re: Spell and Perl source highlighting

2006-09-28 Thread Peter Hodge
Hello,

> Finally, when spell check is enabled and syntax highlighting is also
> enabled, there vim is highlighting some text in a way that the
> foreground and background colors are the same -- so the text vanishes
> from view.  Maybe the solution is to not have syntax and spell
> highlighting enabled at the same time?

You could just change your highlighting for spelling errors. If you use the
following command:

  :source $VIMRUNTIME/syntax/hitest.vim

Vim will show you all the colors currently being used.  Then you can just use a
command like:

  :highlight SpellBad ctermbg=Red ctermfg=Blue cterm=Underline

... to fix your highlighting.  Just add that to your .vimrc and you should be
fine.

regards,
Peter




 
On Yahoo!7 
Caller tones: Replace your ring tone with your favourite sound clip! 
http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag



Re: glued Cursor trick anyone ?

2006-09-19 Thread Peter Hodge

--- Meino Christian Cramer <[EMAIL PROTECTED]> wrote:

> Hi,
> 
>  I would like to accomplish three "tricks":
> 
>  1.) Suppose you have a source code and have started an new search
>task recently. With "n" you are jumping from match to
>match. Sometimes the "next match" is right on the last line
>currently visible. Pressing "n" let the cursor jump there. The
>screen is not scrolled, cause the target is still on the screen --
>but the context is not.
> 
>Is it possible to always scroll the screen that way, that pressing
>"n" wll always take you to the middle of the screen (or in other
>words: The cursor is glued to the middle of the screen and the text
>jumps "under" the cursor)?
> 
>  2.) This is similiar: I want to scroll through text and keep the
>cursor glued to a certain position on the screen.
> 
>  3.) Last "glued cursor" thingy: I want to glue the cursor on the text
>and using "up" and "down" will not move the cursor on the text but
>the text on the screen.
> 

Sounds like you want to use the 'scrolloff' option.  Try ':help scrolloff',
it's pretty straightforward.  Personally I find 'set scrolloff=4' makes
everything much easier to read.

cheers,
Peter



 
On Yahoo!7 
Check out the new Great Outdoors site with video highlights and more 
http://au.travel.yahoo.com/great-outdoors/index.html


Re: find word under cursor

2006-09-16 Thread Peter Hodge
Hello,

What * picks up depends on the value of the 'iskeyword' option.  It seems as
though your value of 'iskeyword' is including '('.  Try ':set isk-=('.  Also
have a look at ':set iskeyword?' and ':help iskeyword'.

regards,
Peter


--- Fabian Braennstroem <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have small problem to find words under the cursor with '*'
> for certain constellations, e.g. in a python script I have
> some functions with:
> 
> convert_different(tab)
> 
> Pressing '*' marks me the whole function name and '(tab'
> without the last ')'. Is there a way to tell vim 6.4, just
> to mark the function name without the variable list?
> 
> Greetings!
>  Fabian
> 
> 




 
On Yahoo!7 
Check out PS Trixi - The hot new online adventure 
http://www.trixi.com.au


Re: Two """problems"""

2006-09-14 Thread Peter Hodge

--- Andrea Spadaccini <[EMAIL PROTECTED]> wrote:
> 
> Well.. the vim book is for vim 5.7.. Are there any plans to make a new
> version for vim 7.x?
> 
> I would buy it if only it was up-to-date! :)
>

Many of Vim's best features were included in 5.7.  It is still a great book to
get you from a novice to intermediate user quickly.

regards,
Peter



> 
> -- 
> [ Andrea Spadaccini - a.k.a. Lupino - from Catania - ICQ #: 91528290 ]
> [ GPG ID: 5D41ABF0 - key on keyservers - Gentoo GNU / Linux - 2.6.17 ]
> [ Linux Registered User 313388 - @: a.spadaccini(at)catania.linux.it ]
> 




 
Do you Yahoo!? 
Take part in Total Girl’s Ultimate Slumber Party and help break a world record 
http://www.totalgirl.com.au


Re: Two """problems"""

2006-09-13 Thread Peter Hodge
> Do you have more of these multi-solver tips
> for me, Peter ??? :)))

The Vim Book (http://iccf-holland.org/click5.html#oualline) will get you up to
speed quickly on most of Vim's important features, and teach you how to use
some important tools you might miss otherwise.  Most complex commands can still
be reduced down to one or two keystrokes, just post again if you need help with
anything.

regards,
Peter



 
On Yahoo!7 
Photos: Unlimited free storage – keep all your photos in one place! 
http://au.photos.yahoo.com 



Re: Two """problems"""

2006-09-13 Thread Peter Hodge
Hello,

--- Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
> 
>  1.) Splitting line into two from normal mode.
>  My current "concept" (hu...great word...;) to split a line into
>  two is (starting and ending in normal mode, which is wanted):
>  
>   i Ctrl-j 
> 
>  Are there any shorter ways to split a line, may be without the
>  detour around insert mode ?


I found the following mapping helpful:

  nmap  i#r

Basically that lets you hit  in normal mode and insert a single character.
 With that mapping in place, you could use  to insert a linebreak
quickly.

regards,
Peter



 
On Yahoo!7 
Answers: 25 million answers and counting. Learn something new today 
http://www.yahoo7.com.au/answers


Re: Counts for mapping

2006-09-11 Thread Peter Hodge

--- Benji Fisher <[EMAIL PROTECTED]> wrote:
> 
> :nnoremap = @='3l'
> 

Thank you!  I've been trying to figure out how to do that for 2 years.

cheers,
Peter



 
Do you Yahoo!? 
Yahoo! Dating: Get busy flirting with your 7-day free pass 
http://au.personals.yahoo.com


How do I get back the old insert-completion behaviour?

2006-09-11 Thread Peter Hodge
Hello,

In Vim 6.2, insert-completion would start when I type  or , but
it would stop as soon as I used typed another letter or pressed backspace.  Now
in Vim 7, when I type  or another character, insert-completion does a
'refresh' to give me the complete list of ... er, completions.  While this
makes sense, it is a real problem for me because I am on a 'low-end' machine
(1.25ghz G4) and refreshing the popup-window takes so long (almost half a
second) that I can't see what I'm doing as I am typing!  It is quicker for me
to leave insert mode and come back than to try and type or backspace because
the refresh is so slow.

Is there any way to make it so that changing text will de-activate the
popup-window rather than refresh it?

regards,
Peter



 
Do you Yahoo!? 
Take part in Total Girl’s Ultimate Slumber Party and help break a world record 
http://www.totalgirl.com.au


Re: question about syntax highlighting

2006-09-07 Thread Peter Hodge
Hello,


> 
> Does this actually work for you? IIRC, "after" colorschemes didn't work 
> for me, so I concluded that ":colorscheme foobar" is equivalent to 
> ":runtime colors/foobar.vim" not ":runtime! colors/foobar.vim".
>

I'm not quite sure what you mean.  'after' colorschemes had never worked for me
because, as you said, it uses ':runtime ...' rather than ':runtime! ...' which
is why I made that plugin - it just uses the ColorScheme event to call
'runtime!  after/colors/.vim'.

regards,
Peter




 
On Yahoo!7 
Answers: 25 million answers and counting. Learn something new today 
http://www.yahoo7.com.au/answers


+clientserver on Mac OS X

2006-09-07 Thread Peter Hodge
Hello,

Is it possible to run the clientserver feature on Mac OS X?  I cannot see
anywhere in the help that directly states that clientserver only runs on
Windows or X11.

regards,
Peter

regards,
Peter



 
On Yahoo!7 
Answers: 25 million answers and counting. Learn something new today 
http://www.yahoo7.com.au/answers


Re: question about syntax highlighting

2006-09-07 Thread Peter Hodge
Hello,

--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> 
> If you have found a colorscheme which satisfies you "almost, but not 
> completely", copy it to ~/.vim/colors/ under a different name (ending in 
> .vim) and modify it there. Then you can set gui=bold for Function or 
> cFunction in your own version of that colorscheme.

Alternatively, if you have Vim 7, you can download my AfterColors plugin
(http://vim.sourceforge.net/scripts/script.php?script_id=1641) and create your
customizations in ~/.vim/after/colors/.vim, and you won't need to
make a copy of the entire colorscheme.

regards,
Peter




 
On Yahoo!7 
Check out PS Trixi - The hot new online adventure 
http://www.trixi.com.au


Re: Syntax question regarding \%[

2006-09-06 Thread Peter Hodge
Hello,

--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> 
> So, it matches a part-word. Try adding an end-of-word pattern atom \> 
> before the ending slash (but after the ending bracket) on each line. You 
> wouldn't want "session.cookie_nomatch" to be matched as far as 
> "session.cookie_" would you?
> 

Sorry, it isn't that simple.  I want to match as much as possible regardless of
what comes next.  What I am trying to do is:

  http://www.totalgirl.com.au


Re: Syntax question regarding \%[

2006-09-06 Thread Peter Hodge
Hello everyone,

Thank you for your help ...

> 
>  syn keyword Error inte[ger] inte[rval]
> 

Unfortunately I need to use matches because the 'words' contain the '.'
character, and I also need to be able to use a look-behind assertion.  The
thing is, I wanted to be able to write each match so that it is fairly
independent of the previous one, because it is very easy to generate this
automatically from an array of strings:

  syntax match phpIniKey /['"]\@<=s\%[ession\.cache_expire]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cache_limiter]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cookie_domain]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cookie_httponly]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cookie_lifetime]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cookie_path]/
  syntax match phpIniKey /['"]\@<=s\%[ession\.cookie_secure]/

Unfortunately, the last match always takes priority, so something like this:

  'session.cache_ex'

it gets matched by the last item and the highlighting goes as far as
'session.c'.  The only solution I can come up with is to write the patterns
like this:

  syntax match phpIniKey /['"]\@<=s\%[ession\.cache_expire]/
  syntax match phpIniKey /['"]\@<=session\.cache_l\%[imiter]/
  syntax match phpIniKey /['"]\@<=session\.co\%[okie_domain]/
  syntax match phpIniKey /['"]\@<=session\.cookie_h\%[ttponly]/
  syntax match phpIniKey /['"]\@<=session\.cookie_l\%[ifetime]/
  syntax match phpIniKey /['"]\@<=session\.cookie_p\%[ath]/
  syntax match phpIniKey /['"]\@<=session\.cookie_s\%[ecure]/

This way, the newer matches only take priority when they are long enough to be
different from the previous match.  But that is much more complicated to
generate, and I really wanted to avoid comlexity.

regards,
Peter




 
On Yahoo!7 
Check out the new Great Outdoors site with video highlights and more 
http://au.travel.yahoo.com/great-outdoors/index.html


Syntax question regarding \%[

2006-09-05 Thread Peter Hodge
Hello all,

Given the following text:

  inte
  integ
  intege
  integer
  inter
  interv
  interva
  interval

is there any easy way to make these two commands work?

  syntax match Error /int\%[eger]/
  syntax match Error /int\%[erval]/

The second match begins taking priority as soon as the word is 'inte', and
prevents 'integer' from being matched correctly.

regards,
Peter




 
Do you Yahoo!? 
The new TV home page features highlights, popular picks, and the best of 
homemade TV 
http://au.tv.yahoo.com/tv/


Re: syntax borked

2006-09-05 Thread Peter Hodge

--- Jorge Almeida <[EMAIL PROTECTED]> wrote:

>
> It appears there is a bug in the syntax file (see reply by Peter Hodge).
> This brings  up the question: How to install a syntax file without
> poluting the distribution system? In gentoo, the file is (for version
> 6.4):
> /usr/share/vim/vim64/syntax/perl.vim
> Replacing this is not a good idea, since it would be replaced next time
> I updated vim in gentoo. So, is there a way to tell vim where to look
> for [some] syntax files? (Something like /usr/local/share/...)?
> 

Well, there was a bug in the older syntax file I used (the one from 2005), but
the newer syntax file I downloaded is fine.  If you don't want to put the new
syntax file in your home directory (~/.vim/syntax/perl.vim), you can also put
it in /usr/share/vim/vimfiles/syntax/perl.vim.  That directory should already
be scanned by default ... check the value of 'runtimepath' to be sure.

>
> And about the indenting problem? Could you check with your vim and the
> above piece of code? If you place the cursor on line 796 and press 'o'
> in normal mode, it should open a line with the cursor above the '$' of
> "$heavy". What happened to me is that the cursor would be below the 'f'
> of "for".
> 

The indenting works fine for me, without installing any new indent scripts. 
Have you enabled 'autoindent' and/or 'smartindent'?

regards,
Peter




 
On Yahoo!7 
Check out PS Trixi - The hot new online adventure 
http://www.trixi.com.au


Re: syntax borked

2006-09-04 Thread Peter Hodge
--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

> 
> It doesn't. After pasting into an empty buffer via the clipboard, 
> block-deleting the column of numbers (from the left margin up to, but 
> not including, the s in "sub" at top and the last } at bottom) and 
> setting 'filetype' to perl, I see all reserved words in brown, 
> identifiers starting @ or $ in green including a preceding backslash if 
> present, the identifier D also in green, strings and numbers in pink 
> with the exception of backslash-escaped single quotes which are in 
> mauve, regular expressions in pink and mauve between brown slashes, and 
> the rest in black, all of it on a white background (this is gvim) from 
> top to bottom of the text. The only thing doubtful (to me) is that, 
> inside the double-quoted strings, ${logdir} is in pink but $! is in green.
> 
> My Vim distribution uses ftplugin/perl.vim by Dan Sharp (2005 Dec 16) 
> and syntax/perl.vim by Nick Hibma (2006 Aug 9).
>

That explains alot, then.  I was using perl syntax by Nick Hibma, October 18,
2005 (probably what was packaged with vim 7 when it was released).  Downloading
the latest version from ftp://ftp.vim.org/pub/vim/runtime/syntax/perl.vim
corrected the problem.

regards,
Peter




 
On Yahoo!7 
360°: Share your blog, photos, interests and what matters most to you 
http://www.yahoo7.com.au/360


Re: syntax borked

2006-09-04 Thread Peter Hodge
Hello Jorge,

The problem is solved if you change this line:

  768 sub reloadlist{

to this:

  768 sub reloadlist {

It looks as though it is a bug in the perl syntax file.  You should send the
maintainer an email with your perl code snippet, and he should be able to fix
it.  It probably never even crossed his mind that someone might leave out the
whitespace there.

You can fix your copy of the perl syntax by changing this line:

   363 syn match  perlFunctionName  "\h\w*[^:]" contained

to this:

   363 syn match  perlFunctionName  "\h\w*[^:{]" contained

regards,
Peter


> 
> Vim does a very good job dealing with perl syntax. This problem came as
> a really bad surprise.
>
> Jorge 
> 




 
Do you Yahoo!? 
Take part in Total Girl’s Ultimate Slumber Party and help break a world record 
http://www.totalgirl.com.au


Re: unmatched strings

2006-09-01 Thread Peter Hodge

--- Tim Chase <[EMAIL PROTECTED]> wrote:

> > Is there a way to highlight unmatched strings for " and ' in a syntax file?
> 
> What is an "unmatched string"?

Here's two matches which will find a string that extends to the end of the
line:

  syntax match Error /"\%(\\.\|[^"]\)*$/
  syntax match Error /'\%(\\.\|[^']\)*$/

regards,
Peter 



 
Do you Yahoo!? 
Take part in Total Girl’s Ultimate Slumber Party and help break a world record 
http://www.totalgirl.com.au


Re: Re [2]: again: % does not work with ' ( '

2006-08-30 Thread Peter Hodge
Hey,

Thanks for that important clue.  It seems the secret to making it work is in
the values of the b:match_skip and b:match_words variables.  Thank you, this
problem has been bugging me for a while.

regards,
Peter


> 
> Addendum: It depends on the 'filetype' and possibly on whether %-jumping 
> is done by Vim C code or by the matchit script: with the same file, if
> 
>   :set filetype=vim
> 
> % jumps between 1 and 6 (but here the matchit plugin comes into play), 
> and matchparen pairs 1 with 6 too.
> 
> 
> Best regards,
> Tony.
> 




 
Do you Yahoo!?  
Great meals in less than 30 mins - Family Circle Sept – out now 
http://www.familycircle.com.au 



Re: again: % does not work with ' ( '

2006-08-29 Thread Peter Hodge
Sorry,

In my example I meant to use

  if("string(string")

and not

  if('string(string')

because double-quotes DO work, single-quotes do not.

- Peter


--- Peter Hodge <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I don't know what I was smoking last time I posted this question, but it
> definitely is not working for me now: If I have the following code:
> 
>   if("string(string")
> 
> and I press % while the cursor is on the last ')', it correctly jumps to the
> first '('.   But, if I change the quotes to single-quotes, it doesn't jump
> correctly, it jumps to the '(' in 'string(string'.
> 
> Is there a way to fix this?
> 
> regards,
> Peter
> 




 
On Yahoo!7 
360°: Share your blog, photos, interests and what matters most to you 
http://www.yahoo7.com.au/360


again: % does not work with ' ( '

2006-08-29 Thread Peter Hodge
Hello,

I don't know what I was smoking last time I posted this question, but it
definitely is not working for me now: If I have the following code:

  if('string(string')

and I press % while the cursor is on the last ')', it correctly jumps to the
first '('.   But, if I change the quotes to single-quotes, it doesn't jump
correctly, it jumps to the '(' in 'string(string'.

Is there a way to fix this?

regards,
Peter






 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



Re: cursorline highlight error

2006-08-29 Thread Peter Hodge
Hi Paul,

You are doing the same as this:

  :set highlight <- shows contents of 'highlight' option
  :set cursorline <- activates 'cursorline' option

... but in the one command:

  :set highlight cursorline <- shows contents of 'highlight' option and
activate 'cursorline' option

Just use 'set cursorline' and leave out the 'highlight' part.

regards,
Peter


--- Paul van Erk <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'm having a problem with Vim 7.0.17's cursorline highlighting. When I have
> in 
> my .gvimrc 'set highlight cursorline', I get the next error in gvim:
> 
>
highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,
>
+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine
> 
> It also happens when I have a default .gvimrc
> 
> The highlighting DOES work, though. What am I missing?
> 
> Grts,
> Paul van Erk
> 




 
On Yahoo!7 
Answers: Ask a question on any topic and get answers from real people 
http://www.yahoo7.com.au/answers


Re: How to create a plugin that runs after any skeletons are loaded as part of BufNewFile.

2006-08-26 Thread Peter Hodge
Hello,

--- Elliot Shank <[EMAIL PROTECTED]> wrote:

> What I'm trying to do is create a plugin that acts based upon the contents of
> an arbitrary file buffer as soon after it has loaded its contents as
> possible.
> 
> For existing files, using a BufReadPost autocmd is fine.
> 
> For new file buffers that have text loaded into them via a BufNewFile
> autocmd, I can't just create a BufNewFile autocmd myself because I can't
> guarantee that mine will run last.
> 
> So, the obvious thing to do is use BufEnter and/or BufWinEnter.
> 
> However, I've got other plugins that will need the result of the new plugin
> and that want to use BufEnter and BufWinEnter themselves, which leads me back
> to the ordering problem.  I can't make sure that the plugin will run first.
> 
> It looks like FileType and Syntax events can occur between BufNewFile and
> BufWinEnter, but this only happens for files that a file type can be figured
> out for.  If I edit a non-existent file called "blah", there aren't any
> events between BufNewFile and BufWinEnter.
> 
> 
> Any suggestions?
> 

Hi Elliot,

Perhaps put your plugin in after/plugin/yourplugin.vim, because the :runtime
command used to load all the plugins looks in plugin/ before it looks in
after/plugin.  If your plugin is loaded last, then hopefully it's autocommands
will also be the last BufNewFile commands to be executed.  I can't remember
correctly, but there may be another event which runs every time your run a
vimscript using ':source' or 'runtime'.  If that is the case, you could maybe
use that ~ScriptRun~ event to clear and redefine your BufNewFile autocommands
so that they are always added last after every other script of any kind, and
hopefully they will then always be the last BufNewFile commands.

I have no idea if any of that will work, all the best!

regards,
Peter






 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



Re: Python Script Execution Support in ViM

2006-08-23 Thread Peter Hodge
Hello Barry,

For PHP, I use a command like ':!php %' (or ':!php "%"' for windows) to run a
file through PHP.  From there, it's not hard to set up a mapping ':nnoremap
 :!python %' or a menu command ':nnoremenu Python.Run :!python %', or an
auto-command to run the script when it is saved ':autocmd! BufWritePost *.py
:!python %'.

regards,
Peter



--- "Carroll, Barry" <[EMAIL PROTECTED]> wrote:

> Greetings:
> 
>  
> 
> This is my first posting to this list.  I have used ViM off and on for many
> years.  For the past year I have been using it exclusively to write Python
> programs for the Windows (2000/XP) and Linux (Fedora) platforms.  I am using
> version 6.3 with python/dyn enabled on Windows and 6.2 with Python enabled on
> Linux.  
> 
>  
> 
> Currently, when I want to run a script I am working on I have to open a
> separate command or interpreter window and do my work there.  I would like to
> be able to execute the open buffer from inside ViM, open a split window and
> have the Python interpreter start automatically and import the open buffer, 
> and other IDE-like actions.  Does ViM offer this kind of support for Python? 
> I have read tantalizing bits on various web pages that indicate it might be
> so, but can find nothing that tells just what is supported and how to make it
> work.  
> 
>  
> 
> Can someone point me in the right direction?  Thank you in advance for your
> help.  
> 
>  
> 
> Regards,
> 
>  
> 
> Barry
> 
> [EMAIL PROTECTED]
> 
> 541-302-1107
> 
> 
> 
> We who cut mere stones must always be envisioning cathedrals.
> 
> -Quarry worker's creed
> 
>  
> 
> 
> 




 
On Yahoo!7 
360°: Your own space to share what you want with who you want! 
http://www.yahoo7.com.au/360


Re: php indent in vim7 not worked

2006-08-23 Thread Peter Hodge
Hello Vu,

I don't know the indenting features very well, but I can tell you:

1)  I'm not sure that lines are indented after ' wrote:

> I'm very sorry but could you tell me how to indent *.php file in vim7?
> I'm using winXP. I created test.php file, open it and type  hit Enter
> But it not indent at all.
> Do I need to setup something?
> 
> The pgp indent file (php.vim) of vim 7 is here:
> http://www.vim.org/scripts/script.php?script_id=1120 
> 
> About install method, it said that:
> 
> "PHP syntax coloring must be turned on. "
> 
> How can I know that my vim7 already have PHP syntax turned on?
> 
> Do I must put "syntax on" into vim7 _vimrc?
> 
> Please help me. I need your help.
> 
> THanks in advanced.
> 




 
Do you Yahoo!? 
Check out gigs in your area on the comprehensive Yahoo! Music Gig Guide 
http://au.music.yahoo.com/gig-guide


Re: highlight setting overwritten

2006-08-22 Thread Peter Hodge
Hello,

Another way to get around this is to add something like this to your _vimrc:

  augroup MyColors
  au!
  au ColorScheme * highlight Comment guifg=Darkgreen
  au ColorScheme * highlight Identifier guifg=Blue
  [ ... etc ... ]
  augroup end

  " execute the commands now in case they aren't triggered immediately:
  do MyColors ColorScheme


Each time colors are reloaded (like when you use ':syn on'), the highlight
commands will be executed.

regards,
Peter



--- [EMAIL PROTECTED] wrote:

> Hello,
> 
> in my old gvim62 installation I do a few highlight commands in the
> $VIM/_gvimrc:
> 
> highlight Comment guifg=DarkGreen guibg=background
> ...
> 
> Now in my new vim70 installation this seems to be overwritten somewhere.
> The _gvimrc *is* sourced (-> :scriptnames)
> If I do the highlight command manually it works.
> 
> Where may the highlight be overwritten resp. where should I place the
> highlight command instead?
> 
> Thank You
> 
> Joachim
> 
> [gvim70 WinXP]
> ###
> 
> This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
> For more information, connect to http://www.f-secure.com/
> 




 
Do you Yahoo!? 
Yahoo! Dating: It's free to check out our great singles! 
http://au.personals.yahoo.com


Re: % does not work with ' ( ' - never mind

2006-08-21 Thread Peter Hodge
Sorry, disregard last post, % wasn't working because I didn't actually have %
in cpoptions yet.



--- Peter Hodge <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> Is there any way to make % jump to the correct parenthesis and ignore a '('
> inside a single-quoted string?  For example:
> 
>   if('string(string')
> 
> Pressing % while the cursor is at the end of the line will jump to the wrong
> '('.  Is there any way to fix this?  The help page on % does not mention any
> way to make % skip over single-quoted strings unless '(' is the whole string.
> 
> regards,
> Peter
> 
> 
> 
>   
>  
> On Yahoo!7 
> The new Yahoo!7 home page - scan your email inbox, start an IM conversation
> or update your blog 
> http://au.yahoo.com/
> 




 
On Yahoo!7 
360°: Your own space to share what you want with who you want! 
http://www.yahoo7.com.au/360


% does not work with ' ( '

2006-08-21 Thread Peter Hodge
Hello,

Is there any way to make % jump to the correct parenthesis and ignore a '('
inside a single-quoted string?  For example:

  if('string(string')

Pressing % while the cursor is at the end of the line will jump to the wrong
'('.  Is there any way to fix this?  The help page on % does not mention any
way to make % skip over single-quoted strings unless '(' is the whole string.

regards,
Peter




 
On Yahoo!7 
The new Yahoo!7 home page - scan your email inbox, start an IM conversation or 
update your blog 
http://au.yahoo.com/


Why is after/colors/.vim disabled?

2006-08-20 Thread Peter Hodge
Hello,

I am just curious as to why after/colors/ scripts are disabled instead of
behaving like after/ftplugin and after/syntax scripts?

regards,
Peter






 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



Re: can we set vim to use magic=very ??

2006-08-10 Thread Peter Hodge
Hi Martin,

Unfortunately, I don't think there's any way to use \v by default for every
pattern.

It may help to remember that when you have the default 'magic' option set, Vim
only recognizes 5 special characters without backslash:
  ^
  $
  .
  *
  [ (if there is a matching ] to make a collection)

Every other special sequence needs a '\'.

regards,
Peter



> martin kraegeloh wrote:
> all,
> 
> rtfm didn't help ... I'd like to *always* make my regexes behave like 
> perl, but I find no way to set it as a default. will I have to always 
> use \v ??
> I tend to think that if I can't get vim to do something it's because I 
> don't know why, not because it is not possible ... so how do I do this?
> 
> cheers, martin



Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: PCRE? Perl Compatible Regular Expressions?

2006-08-08 Thread Peter Hodge
Hi David,

If you begin your pattern with '\v', then every character except [_a-z0-9]
becomes 'special'.  This allows you to use tokens like '?', '(' and '+' without
a backslash.  Unfortunately, you can't use '(?:' and friends.

Maybe there should be a modifier like '\v' which makes the pattern compatible
with PCRE. '\!' hasn't been taken yet, i.e., :s/\!(?:foo|bar)/---/

But this could potentially cause some headaches, because PCRE does not support
any of the Vim-only goodness such as \x\o\h\a\l\u\i\k etc (not to mention \%#
and \%c etc), and some items such as '\f' are ambigous?  Vim treats it as any
file name character (from 'isfname') but PCRE treats it as the form-feed
character (\x0B I think).  And then there is the question of where you want to
put the PCRE after-delimiter modifiers.

regards,
Peter


--- David Conrad <[EMAIL PROTECTED]> wrote:

> The regular expression syntax that Vim uses is, I'm sure, compatible with Vi.
> There were always a number of different regex dialects to choose from:
> grep, egrep, sed. But in the last few years, pcre's have become popular, and
> virtually standard across a lot of different languages, from Perl to Python
> to
> Ruby to JavaScript to C# to Java.
> 
> Is there any way to use them in Vim? I've learned to used the Vim-style
> regex's
> in my s///'s, but if I could use one regex syntax across everything I
> work with, it
> would free up a few more brain cells for more constructive purposes.
> 
> Any advice is appreciated.
> 
> Thanks,
> David Conrad
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Smarter Indent (an odd problem)

2006-08-05 Thread Peter Hodge
Hi Yakov,

--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> Must be possible using CursorMoves autoevent, except
> that I don't see in syntax/html.vim how  is handled.
> Is is indeed in syntax /html.vim ?

PHP stuff is in syntax/php.vim which loads html.vim inside it.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: how to check if we are inside phpRegion

2006-08-05 Thread Peter Hodge
Hi Yakov,

As far as I can remember, all PHP syntax items begin with 'php', with the
exception of the preg* pattern items (these are only available if you've
downloaded the new PHP syntax from vim.org), and they start with 'preg'.  Sorry
I don't have a copy of Vim installed at this location so I can't check this for
you right now, but I'm pretty every PHP syntax item is contained (directly or
indirectly) inside phpRegion, so you can just examine the 'lower-most' syntax
group and if it begins with 'php' or 'preg', then the cursor is in phpRegion.

regards,
Peter




--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> Let's say I want to check if we are inside phpRegion
> ().
> 
> I am aware of synID(), synIDattr() and
> synIDtrans() functions, but they only tell the "lower-most"
> syntax group.
> 
> The current point has the whole stack of regions
> and matches above it. right, and what ig I want to check if "pfpRegion"
> appears in smoe place in this stack ?
> 
> Yakov
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: How to scroll up and down without changing horizontal pos

2006-08-03 Thread Peter Hodge
Hi,

You can use CTRL-E and CTRL-Y to scroll up and down without moving the cursor.

regards,
Peter



--- Eric Leenman <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'm using page-up and page-down to scroll.
> Also ctrl-home and ctrl-end.
> This moves the cursor to the beginning of the line.
> How can this be avoided.
> I need to the cursor to stay where it is, as the lines are 1000+ characters 
> long
> 
> Rgds,
> Eric
> 
> _
> Is your PC infected? Get a FREE online computer virus scan from McAfee® 
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Sorting columns in a file

2006-08-03 Thread Peter Hodge
Hi Eric,

I am assuming you want to re-order the columns horizontally, in which case
Visual Block Mode is what you want.  Press CTRL+V to start selecting a column,
use 'x' to delete it, and 'P' (upper-case P) to paste it (I find upper-case P
is more logical for Visual Block paste).

HTH,
regards,
Peter



--- Eric Leenman <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have file which contains hexadecimal numbers like below:
> 
> 04F  ---  05F  ---  052  ---  188  ---  2D4  ---  173  ---  040  ---  18D
> 051  ---  040  ---  05F  ---  1CA  ---  2E8  ---  14F  ---  040  ---  1E2
> 051  ---  040  ---  069  ---  1B9  ---  2D7  ---  15E  ---  040  ---  1A6
> 051  ---  040  ---  06F  ---  1ED  ---  2EB  ---  12E  ---  040  ---  209
> 051  ---  040  ---  078  ---  1F9  ---  2E3  ---  122  ---  040  ---  220
> 051  ---  045  ---  063  ---  1C8  ---  2D1  ---  146  ---  040  ---  1F4
> 051  ---  046  ---  05A  ---  1BB  ---  2D7  ---  158  ---  040  ---  1D3
> 051  ---  052  ---  04F  ---  1B6  ---  2E3  ---  154  ---  040  ---  1BB
> 052  ---  040  ---  045  ---  1BC  ---  2D6  ---  146  ---  040  ---  1CE
> 052  ---  040  ---  04A  ---  1BC  ---  2DD  ---  146  ---  040  ---  1D3
> 
> How can I sort the columns so that they are as the first column?
> 
> Best regards,
> 
> Eric
> 
> _
> FREE pop-up blocking with the new MSN Toolbar  get it now! 
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Automatic updating file content

2006-08-01 Thread Peter Hodge
>
> Thank you very much for the tip. ":e" works so nicely. I will try out those 
> commands soon. Should I insert them in my vimrc file ?
>

Hi Tien,

Sorry, it seems I was a little naive with that autocommand I showed you, it
doesn't work because CursorHold won't trigger again until you press a key. 
After a little experimentation, I think you would best add something like this
to your .vimrc:

  function! s:ReloadWhileWaiting()
while ! getchar(1)
  edit
  normal G
  sleep 1
endwhile
  endfunction

  augroup RefreshFile
  autocmd!
  autocmd CursorHold somefile.log call s:ReloadWhileWaiting()
  augroup end

The automatic refresh ('s:ReloadWhileWaiting()') only begins after Vim is idle
for 4 seconds; after that it will reload the file ('edit'), move to the end
('normal G') and wait for a second before it tries again ('sleep 1').  Pressing
any key will stop the automatic refreshing ('while ! getchar(1)'), but it will
resume as soon as Vim is idle for 4 seconds again.  I hope that's all clear and
does what you need or that you can customize it easily.

regards,
Peter



Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Automatic updating file content

2006-08-01 Thread Peter Hodge
Hi Tien,

You can use ':e[dit]' to reload the current file.  Perhaps you could set up
something with an autocommand based on the CursorHold event and reduce the
updatetime to half a second?  For example:

  set updatetime=500
  augroup RefreshFile
  autocmd!
  autocmd CursorHold somefile.log edit
  augroup end

However, this may not work so well if you have multiple files open in Vim.

regards,
Peter



--- Tien Pham <[EMAIL PROTECTED]> wrote:

> Hi all
> 
> Is there any key stroke to update content of a currently open file when its 
> content has been changed?
> 
> Reason for this is that I want to look at my log file from a simulation, as 
> I run simulation so frequently, it is so tedious to click "open" and 
> "select" the same file name to see the changes that a new simulation is 
> recorded in the log file. I would appreciate very much if someone teach me 
> a quick way to update content of the file I have opened, of course the same 
> file name.
> 
> Your help is greatly appreciated.
> Kind regards
> tien
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: au! failure in vimrc

2006-07-31 Thread Peter Hodge
Hi Bill,

vimrc is read before plugins, so your au! command in .vimrc can't replace the
AsNeeded autocommand because AsNeeded hasn't been defined yet.

regards,
Peter



--- Bill McCarthy <[EMAIL PROTECTED]> wrote:

> Hello Vim List,
> 
> Suppose two plugins define autocmds, so after start Vim,
> 
> :au FuncUndefined
> 
> displays:
> 
> * call AsNeeded(1,expand(""))
> Tlist_*   source C:\vim\vimfiles\plugin\taglist.vim
> 
> Now I add a line to my _vimrc:
> 
> au! FuncUndefined * call Foo()
> 
> Now after starting Vim and typing :au FuncUndefined
> 
> * call Foo()
>   call AsNeeded(1,expand(""))
> Tlist_*   source C:\vim\vimfiles\plugin\taglist.vim
> 
> It did not replace!
> 
> Now removing the line I added to _vimrc, starting Vim and
> typing :au! FuncUndefined * call Foo()
> 
> I get what I expected from :au FuncUndefined
> 
> Tlist_*   source C:\vim\vimfiles\plugin\taglist.vim
> * call Foo()
> 
> Vim only appears to fail in startup - it is not just a
> script error.  If I write a small script file that just
> contains the line:  au! FuncUndefined * call Foo()
> 
> Sourcing that script works just like typing the command.
> 
> -- 
> Best regards,
> Bill
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: Differences with vim 7

2006-07-31 Thread Peter Hodge
Some GUIs will allow you to use the command

  set guifont=*

Which brings up a font selection window.  If that works, you can select a font
and then use

  set guifont

to find out exactly what to add to your .vimrc

regards,
Peter

--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> On 7/31/06, Robert Cussons <[EMAIL PROTECTED]> wrote:
> > I just installed vim 7 on my linux system at work (more specifically
> > debian sarge running KDE 3.3) and I get a few funny things happening. It
> > is installed in my home/bin directory as I don't have root permissions.
> > All comments seem to come out underlined and the fonts for everything
> > including the menus are different to before, I don't know how to check
> > the current font setting, but when I type :set, there doesn't seem to be
> > anything that would have changed the font listed. Anyone had the same
> > problems?
> 
> :set guifont?
> 
> Yakov
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Syntax Feature Request

2006-07-27 Thread Peter Hodge
Hello all,

I just want to throw this idea out there as a potential solution to the
problems I am having with the PHP syntax.  It would be helpful to be able to
name sequential 'nextgroups' for regions and matches, so that the syntax will
highlight an area using certain groups in specific order. I.e:

For example, the PHP function preg_replace(), takes 3 arguments like this:

  /* print 'Goodbye ' instead of 'Hello ' */
  $text = 'Hello Peter';
  print preg_replace('/Hello (\w+)/', "Goodbye \1", $text);

Preg_replace works just like Vim's substitute() function, except preg_replace
takes the subject as the last argument rather than the first.  There is
actually a major bug in that code sample which A) most people would not notice;
and B) the highlighting in most text editors would only confuse people even
more (I will explain further down).

For preg_replace, the first argument, '/Hello (\w+)/' is a perl-style regular
expression; the second argument is the replacement pattern which may contain
backreferences, and the third argument can be any variable, expression, etc.

Currently I am finding and highlighting the regular expression string like
this:

  syntax keyword pregFunction preg_replace nextgroup=pregOpenParent
  syntax match pregOpenParent /(/ nextgroup=pregString
  syntatx region pregString start=/'/ end=/'/ skip=...

I have a couple of problems with this; first of all, pregOpenParent matches a
lone opening '(', which means the parenthesis errors syntax items (which match
( and ) together to spot errors) will find another ')' seemingly all by itself
at the end of the call to preg_replace() and highlight it as an error.  I would
like to turn pregOpenParent into a region to take care of the closing ')', but
then how do I specify that the first argument (and only the first) to that
function call is a string with a PCRE pattern in it?

Also very important is that I am able to highlight the 2nd argument to
preg_replace using a specific group for Preg replacement strings, because
(!major bug explanation!) in the string "Goodbye \1", most people will see the
\1 and think 'backreference', and in fact the best text editors around might
highlight the \1 in a separate color from the rest of the string, and then most
would think 'definitely backreference!', when really it's octal (\x01) and not
a backreference at all.  So for the 2nd argument to preg-replace, I would like
to be able to highlight "\1" as an Error so that people might think "What's up
with that?" and hopefully they will work out that they need to use '\1' or
"\\1" instead; at any rate it would be obvious to them that if the
backreference doesn't seem to be working, the "\1" is definitely the problem
and they have a good idea where to start investigating.

My hope is that the new highlighting will save people from wasting hours on
PCRE regular expressions; even though I was fairly good with Vim REs when I
started using PHP's preg functions, a single line of code containing a
15-character preg RE would usually take me 10 or 15 minutes to write correctly
because A) I couldn't remember what needed to have a '\' before it and what
didn't, and B) if I had a misplaced '\', the syntax highlighting would not help
me to find it and I had to fiddle with the pattern endlessly to get it working.

So in order to make an effective PHP syntax, I need to be able to do something
like this in Vim:

  syntax keyword preg_replace nextgroup=pregReplaceParents
  syntax region pregReplaceParents matchgroup=Delimiter start=/(/ end=/)/
\ first=pregPattern,phpIdentifier
\ second=phpComma
\ third=pregReplacement,phpIdentifier
\ fourth=phpComma
\ fifth=phpIdentifier,phpString

... so that inside the pregReplaceParents region, Vim would first try and match
a 'pregPattern' or a 'phpIdentifier', followed by a comma, followed by a
'pregReplacement' or a 'phpIdentifier', followed by a comma, followed by a
phpIdentifier or phpString.

An alternative to this which isn't as tidy but might be simpler to implement,
and might be useful elsewhere, is to allow the 'nextgroup' on a syntax cluster:

  syntax keyword preg_replace nextgroup=pregReplaceParents
  syntax region pregReplaceParents matchgroup=Delimiter start=/(/ end=/)/
\ [EMAIL PROTECTED]
  syntax cluster pregReplaceFirst add=pregPattern,phpIdentifier
[EMAIL PROTECTED]
  syntax cluster pregReplaceSecond add=phpComma [EMAIL PROTECTED]
  syntax cluster pregReplaceThird add=pregReplacement,phpIdentifier
[EMAIL PROTECTED]
  syntax cluster pregReplaceFourth add=phpComma [EMAIL PROTECTED]
  syntax cluster pregReplaceFifth add=phpIdentifier,phpString

*end of suggestions*
==

Does anyone else think that one or both of these features might be useful?

Are there any specific plans for the future of Vim's highlighting?

Is there any possibility of these Feature Requests becoming reality, even if I
have to finish learning C and code them myself?  I would really like to push
the PHP sy

Re: using syntax match two time in one line? fst blocks snd?

2006-07-24 Thread Peter Hodge
Hi Marc,

I am assuming that you have output like this:

  ---
  | Field1 | Field2 | Field3 | Field4 | ... |
  ---
  | Value1 | Value2 | Value3 | Value4 | ... |
  ---

In which case you might want to try something like this:

  syntax match Border '^-\+$'
  syntax match Border '^|' nextgroup=Col1
  syntax match Col1 '[^|]\+|' contained nextgroup=Col2
  syntax match Col2 '[^|]\+|' contained nextgroup=Col3
  syntax match Col3 '[^|]\+|' contained nextgroup=Col4
  syntax match Col4 '[^|]\+|' contained [ ... etc ... ]

  syntax match Border "|" contained containedin=Col1,Col2,Col3,Col4

  hi link Border Error
  hi link Col1 Macro
  hi link Col2 Type
  hi link Col3 Statement
  hi link Col4 String
  [ ... etc ... ]

This should highlight each column in a different color for you.  In case this
doesn't help you, the following might help you:

  - using '^' in your pattern means it can *only* match at the beginning of the
line

  - you don't need to use \ze at the end of your pattern.  Typically \ze is
used when you want the match to end there, but you want to make sure some other
things following \ze also match.  'foo\zebar' matches and 'foo', but only if it
is followed by 'bar'.

  - rather than adding the whole '' pattern stuff to the
Color2 match, why not add 'nextgroup=Color2' to the end of the Color1 match?

HTH,
regards,
Peter


--- Marc Weber <[EMAIL PROTECTED]> wrote:

> background:
> I want to highlight columns in a table differently (database output)
> So 1 and 2 will be substituted by either \t or |.
> 
> = syntax file
> ==
> hi def link Color1 Macro
> hi def link Color2 Error
> 
> "Show colors of Color1, Color2
> syn keyword Color1 A
> syn keyword Color2 B
> 
> syn match Color1 '^1\zs[^1]*\ze'
> syn match Color2 '^1[^1]*1\zs[^1]*\ze'
> syn match Color2 '^2[^2]*2\zs[^2]*\ze'
> 
> = testfile
> =
> A 
> B 
> 1aa1bb
> 2cc2dd
> 
> explanation lines testfile:
> Line 1 testline to show Color1
> Line 2 testfile to show Color2
> Line 3 Here aa and bb should be highlighted with Color1, Color2 ( bb isn't)
> Line 4 only dd should be highlighted to show that the match pattern
> works (only difference is 2 instead of 1)
> 
> Marc
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


Re: :edit {file} question

2006-07-19 Thread Peter Hodge
Hi Malahal,

You can use ':S' to open a new File Explorer window or ':E' to open file
explorer in the current window.

regards,
Peter



--- [EMAIL PROTECTED] wrote:

> What is the easiest way to edit a file that is in the same directory as
> the current file? E.g. I open a file like this: vim /x/y/z/w/file1.c and
> want to now open /x/y/z/w/file2.c? Occasionally want to open files in
> the parent directory of current file's directory. It would be nice if
> there is a special character like "," which starts from the current
> buffer's directory. So ":e ,/file2.c" would work. Or maybe "~~" double
> tilda character if "," doesn't work...
> 
> Thanks, Malahal.
> 







 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



RE: colors

2006-07-18 Thread Peter Hodge
Hi Bill,

You do not have to program a new colorscheme. If you run this command:

  :source $VIMRUNTIME/syntax/hitest.vim

... you will get a window containing all the highlighting colours used by Vim. 
There's hundreds of colours listed, but there are prossibly only two that you
want to change, under the 'Syntax Highlighting Groups' section.  Add something
like this to your ~/.vimrc

  " change default colors for color terminal
  highlight Comment ctermfg=Blue cterm=Underline
  highlight Identifier ctermfg=Red cterm=Bold

  " change default colors for GUI
  highlight Comment guifg=Blue gui=Underline
  highlight Identifier guifg=Red gui=Bold


It shouldn't be too difficult to change those colors to something which works
for you.  I hope you don't have to go back to using Vim 6.4.



> I am afraid that I have to agree with the complaint against drastically
> changing the default color scheme. As a sight-impaired user I relied on the
> color scheme that I was using before version 7.0. I did not create it myself;
> I developed my own convention for using the color scheme that was there as a
> default.
>
> Now that the colors have change in a bad way (e.g. PERL comments are the same
> color as PERL variables) I do not have time to invest in learning how to
> program a new color scheme. My only solution right now is to try to uninstall
> VIM and reinstall the old version.

I can see your point and it is concerning that the colour change is enough to
force you to go back to Vim 6.4, but Bram (or any software package author) must
reserve privileges to change things and make them the default, otherwise
everyone gets a Vim 7.0 which behaves exactly like 6.4 and 70% of the user base
doesn't have the time or knowledge to find and activate the new features.  I
regularly confront this issue as I write the PHP syntax as I must decided
whether to A) make a feature ON by default and frustrate lots of people; or B)
make a feature OFF by default so that no one gets annoyed, but risk that many
people will miss out on that feature because they don't know how to turn it on.

regards,
Peter






 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



Re: Color Question

2006-07-17 Thread Peter Hodge
Hi Ralf,

The colorscheme 'morning' has very little Cyan in it - cyan is the default for
the 'Identifier' group, which is used for $variables and functions().

Just add something like this to colors/morning.vim:

  highlight Identifier ctermfg=Red guifg=Red

If you want function calls in a distinguishable color, use:

  highlight Function ctermfg=Blue guifg=Blue

... otherwise, they are the same color as Identifiers.

The 'cterm=' option is for color terminal use, the 'guifg=' option is if you
are using the GUI.

regards,
Peter




--- Ralf Schmitt <[EMAIL PROTECTED]> wrote:

> 
> Hello all,
> 
> I'm on vim7 with 'syntax on' and 'colorscheme morning'.
> The colors used by syntax highlighting for c / c++ and 
> java are great but on php or perl I've got a lot of Cyan
> in it. I don't know why but reading Cyan Text is horror for me
> and vim highlights a lot in php and perl with that color. 
> 
> I've turned all Cyan to Black in colors/morning.vim but that 
> didn't help. 
> 
> please let me know how I can get rid of that cyan in this 
> colorscheme.
> 
> 
> regards 
> 
> Ralf
> 







 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 



Re: perlcomplete.vim -- anyone working on this?

2006-07-16 Thread Peter Hodge
It may be worthwhile e-mailing the author to let them know that their
modification of the iskeyword is not ideal.  After all, ftplugin scripts
*should* be setting iskeyword to something useful, but if it is not done
properly it can cause major hastles.

regards,
Peter




--- Vigil <[EMAIL PROTECTED]> wrote:

> Oh. Grr, I hate it when plugins go changing the absolute value of your 
> settings. I had a perl_doc.vim ftplugin that was "setlocal 
> iskeyword=a-z,A-Z,48-57,:,/,."ing, which must have been being sourced after 
> perl.vim.
> 
> Thanks, Peter.
> 
> On Mon, 17 Jul 2006, Peter Hodge wrote:
> 
> > I do believe that if you 'set verbose=2' and then 'set isk?' vim will tell
> you
> > where it was last set.  I was having the same problem Saturday night when
> the
> > ftplugin/php.vim was adding '$' to isk.  I found that adding "set isk-=$"
> to
> > ~/.vim/ftplugin/php.vim did *not* work, but adding it to
> > ~/.vim/after/ftplugin/php.vim *did* work, you may wish to try changing
> > iskeyword in your after/ftplugin script.
> 
> -- 
> 
> .
> 




 
Do you Yahoo!? 
Yahoo! Personals: It's free to check out our great singles! 
http://au.personals.yahoo.com


Re: perlcomplete.vim -- anyone working on this?

2006-07-16 Thread Peter Hodge
Hello,

I do believe that if you 'set verbose=2' and then 'set isk?' vim will tell you
where it was last set.  I was having the same problem Saturday night when the
ftplugin/php.vim was adding '$' to isk.  I found that adding "set isk-=$" to
~/.vim/ftplugin/php.vim did *not* work, but adding it to
~/.vim/after/ftplugin/php.vim *did* work, you may wish to try changing
iskeyword in your after/ftplugin script.

regards,
Peter




--- Vigil <[EMAIL PROTECTED]> wrote:

> I put 'set iskeyword+=_' (I've tried numerous quoting around the underscore) 
> but ':set iskeyword?' keeps saying "iskeyword=a-z,A-Z,48-57,:,/,.". I just 
> can't get the underscore into iskeyword. What's the command to see where a 
> setting was last defined?
> 
> On Wed, 12 Jul 2006, Hakim Cassimally wrote:
> 
> > Check what you have set for iskeyword.  On my vim:
> >
> >   iskeyword=48-57,_,A-Z,a-z,:
> >
> > (silly vim insists on 48-57 for the numbers 0-9...)  iskeyword
> > determines what counts as a word for the purposes of */# and tag
> > searching.  I include : because I think that Module::Name is a single
> > symbol.  To make sure these settings only affect Perl, I put them in
> > my ~/.vim/ftplugin/perl.vim (see
> > http://greenokapi.net/svn/.vim/ftplugin/perl.vim )
> 
> -- 
> 
> .
> 




 
Do you Yahoo!? 
Never miss an Instant Message - Yahoo! Messenger for SMS 
http://au.mobile.yahoo.com/mweb/index.html


  1   2   >