Re: completion menu colors

2007-04-02 Thread panshizhu
fREW <[EMAIL PROTECTED]> 写于 2007-04-03 10:56:11:
>
> Are these things that should be set in the colorschemes, but just
> aren't yet because the names are new, or what?
>
> -fREW

This should be set in colorscheme, however, if you're using the default
colorschme it is buit-in with Vim and you cannot change the source code of
colorscheme.

If you are not using the default colorscheme, then you can just edit the
colorscheme and set those settings.

Note: a colorscheme does not have to set all the highlight settings, the
settings which are not set inside a colorscheme will use the default.

--
Sincerely, Pan, Shi Zhu. ext: 2606

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

2007-04-02 Thread wangxu

You are right.my runtimepath is wrong.
I updated vim to 7.0 using apt-get, but left  the old vimrc  unchanged.
I checked the vimrc and replaced /usr/share/vim/vim63 to 
/usr/share/vim/vim70,

It is OK now.
thank you!

Peter Hodge wrote:

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

  

the results are

  filetype=
  syntax=

Why could this happen?



Not sure? Do you get any results if you type

  :au filetypedetect * *.sh

You should see something like:

  --- Auto-Commands ---
  filetypedetect  BufNewFile
  *.sh  call SetFileTypeSH(getline(1))
  filetypedetect  BufRead
  *.sh  call SetFileTypeSH(getline(1))

If you don't see any commands like those above, then the syntax will not work;
perhaps your 'runtimepath' is wrong?

Also, check the value of 'eventignore', it might prevent the FileType detection
from activating:

  :set eventignore?

should show:

eventignore=

regards,
Peter


  

Peter Hodge wrote:


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 



  
  




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



  




Re: completion menu colors

2007-04-02 Thread fREW

On 4/2/07, Peter Hodge <[EMAIL PROTECTED]> wrote:


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


Are these things that should be set in the colorschemes, but just
aren't yet because the names are new, or what?

-fREW


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: completion menu colors

2007-04-02 Thread Michael Wookey
> Is there a way to change the completion menu colors?

See:

:help hl-Pmenu
:help hl-PmenuSel
:help hl-Pmenu-Sbar
:help hl-PmenuThumb

For example:

:highlight Pmenu guibg=DarkRed

cheers


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: Newbee question:Why don't I have the syntax highlighting when editing files like *.sh *.xml,etc?

2007-04-02 Thread wangxu
I checked with :version,it is compiled with the "+syntax",and no "syntax
off" in /etc/vim/vimrc.local or files like that.
I don't know where the syntax files should be,but there are syntax files
in /usr/share/vim/vim70/syntax.
Below is the :version result.

:version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Jan 31 2007 17:43:00)
包含补丁: 1-122
编译者 [EMAIL PROTECTED]
大型版本 带 GTK2 图形界面。 可使用(+)与不可使用(-)的功能:
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent +clientserver
+clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv
+cscope
+cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags
+eval +ex_extra
+extra_search +farsi +file_in_path +find_in_path +folding -footer
+fork() +gettext
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall
+linebreak
+lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse
+mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm
+multi_byte +multi_lang
-mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript
+printer -profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs
+smartindent -sniff
+statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl
+terminfo +termresponse +textobjects +title +toolbar +user_commands
+vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore
+wildmenu +windows
+writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
系统 vimrc 文件: "$VIM/vimrc"
用户 vimrc 文件: "$HOME/.vimrc"
用户 exrc 文件: "$HOME/.exrc"
系统 gvimrc 文件: "$VIM/gvimrc"
用户 gvimrc 文件: "$HOME/.gvimrc"
系统菜单文件: "$VIMRUNTIME/menu.vim"
$VIM 预设值: "/usr/share/vim"






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



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

2007-04-02 Thread Xi Juanjie
"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
> 
> 
> 
> 


completion menu colors

2007-04-02 Thread fREW

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


-fREW


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

2007-04-02 Thread wangxu
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





Re: bracket completion

2007-04-02 Thread shawn bright

Thanks Luc,
i got the main functionality working, pretty much. I only really
desire the bracket matching, and so far, i am really pleased. They all
work except the [] . So i think maybe there is a conflict with another
plugin ( i have the snippets-Emu, supertabs, and taglist plugins also.
) The overall effect is really cool.

thanks again.

sk

On 4/2/07, Luc Hermitte <[EMAIL PROTECTED]> wrote:

* On Tue, Apr 03, 2007 at 02:14:59AM +0300, Panos Laganakos <[EMAIL PROTECTED]> 
wrote:
> One thing that would also be great, was if you were able to "tab" your
> way out of it, ie move to the outside of the bracket, once you're
> done. Now you need to either press right, to move ahead (which is not
> quite vim-ish), or hit escape and Shift_A, to resume editing.
>
> Only possible way I can think of, is to use a snippet system, like
> snippetsEmu[1] or something. Any other suggestions?

Well. You can use my bracketing system, or the fork of mu-template I'm
maintaining (which relies on the bracketing system) -- see my signature.
The marker/placeholder can be easily enable or disabled, cutomized for
every language, ...

--
Luc Hermitte
http://hermitte.free.fr/vim/ressources/



Re: bracket completion

2007-04-02 Thread Luc Hermitte
* On Tue, Apr 03, 2007 at 02:14:59AM +0300, Panos Laganakos <[EMAIL PROTECTED]> 
wrote:
> One thing that would also be great, was if you were able to "tab" your
> way out of it, ie move to the outside of the bracket, once you're
> done. Now you need to either press right, to move ahead (which is not
> quite vim-ish), or hit escape and Shift_A, to resume editing.
> 
> Only possible way I can think of, is to use a snippet system, like
> snippetsEmu[1] or something. Any other suggestions?

Well. You can use my bracketing system, or the fork of mu-template I'm
maintaining (which relies on the bracketing system) -- see my signature.
The marker/placeholder can be easily enable or disabled, cutomized for
every language, ...

-- 
Luc Hermitte
http://hermitte.free.fr/vim/ressources/


Re: bracket completion

2007-04-02 Thread Panos Laganakos

One thing that would also be great, was if you were able to "tab" your
way out of it, ie move to the outside of the bracket, once you're
done. Now you need to either press right, to move ahead (which is not
quite vim-ish), or hit escape and Shift_A, to resume editing.

Only possible way I can think of, is to use a snippet system, like
snippetsEmu[1] or something. Any other suggestions?


[1] http://www.vim.org/scripts/script.php?script_id=1318

On 4/2/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

Zarko Coklin wrote:
> It is hard to expand on Tony's feedback, ever. Still,
> I found the following works a bit better. Not only
> that it creates a right brace but it also places a
> cursor on the right spot (taking into consideration
> indentation if you set it).
>
>
> :inoremap { {}
> :inoremap [ []
> :inoremap ( ()
>
> Regards,
> Zarko Coklin

"The right spot" depends on your C coding style: your mapping might apply for

if (condition) {
statement;
statement;
}

and

void function functionname(void* p) {
statement;
statement;
}

though it might be better to place  _after_  in the {rhs} to avoid
splitting a word in the middle. Mine is better for

if (condition)
{   statement;
statement;
}

and

void function functionname(void* p)
{   statement;
statement;
}

and can still be used for yours, by hitting  after the mapped {


Best regards,
Tony.
--
Taxes are going up so fast, the government is likely to price itself
out of the market.




--
Panos Laganakos


Re: bracket completion

2007-04-02 Thread Luc Hermitte
Hello,

* On Mon, Apr 02, 2007 at 10:38:14AM -0500, shawn bright <[EMAIL PROTECTED]> 
wrote:
> >> Check out Luc Hermitte's development of Stephen Riehm's
> >> bracketing macros.
> >>
> >> http://hermitte.free.fr/vim/settings.php#settings

> On 4/2/07, shawn bright <[EMAIL PROTECTED]> wrote:
> >this looks like exactly what i am after.  i am kind of a newbie here,
> >and cant quite get it to work right.
> >i believe that i need a python.vim file in /ftplugin directory.

Only if you want to customize the bracketing system for python.

> >but i dont know how to word it to make this plugin work,
> >could anyone kinda help me here, i can't make out what i should do
> >from the docs on the website that you linked to

> whoa !, nevermind, found an example file on his website, tried it and 
> works,.
> sorry, my own rftm mistake


The doc is a little bit outdated. The plugin used to word standalone.
But now there are a lot of inter-dependendies between by plugins -- I'm
still in the process of refactoring everything. As a consequence,
prefer the tarball archives.

lh-map-tools.tar.gz should be enough -- but don't forget to define a
ftplugin suited to your needs. If you want a more complete suite,
check the C&C++ ftplugins suite (which encapsulates/contains map-tools),
which is the most complete of all [1]. There are a few other suites,
which are not really maintained anymore. [2]

If you have any questions feel free to ask. I've tried to write a
documentation (the one in the tarball) as complete as I could, but I may
have missed a few details.

HTH,

[1] it contains many mappings to insert control-statements (if, for,
...) in every mode.
[2] http://hermitte.free.fr/vim/ressources -> *.tar.gz

-- 
Luc Hermitte
http://hermitte.free.fr/vim/


Re: Unsubscribing...

2007-04-02 Thread A.J.Mechelynck

[EMAIL PROTECTED] wrote:

Mr. Mechelynck,

I have tried on several occasions to unsubscribe to this mailing list.
All efforts have proven futile. Can you tell me a sure-fire method to
unsubscribe?

Your input would be much appreciated.

Regards,

Dennis
--



I suppose you mean the vim -at- vim.org list, which is one of several lists to 
which I am subscribed at the address at which you reached me.


The official method to unsubscribe from the Vim list is as follows:

1. Send an email to [EMAIL PROTECTED] -- the subject and contents of 
that email are unimportant (and may be empty) but the From: line *must* be the 
"address-of-record" under which the Vim list robot knows you (and at which you 
receive the list mail).


2. You will get an autoreply to the email you sent at step 1. You must read 
that autoreply, because it will contain instructions (and a secret code) 
telling you how to finalize the unsubscription. This step is necessary because 
it ascertains that the "unsubscribe" email came from you and was not a (bad) 
practical joke played on you.



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
159. You get excited whenever discussing your hard drive.


Re: what is wrong with my keymap for commenting a block

2007-04-02 Thread flyfish

Thank you very much, i got it.

A.J.Mechelynck wrote:
> 
> flyfish wrote:
>> Hi,
>> 
>> i write a simple keymap for commenting C file,
>> 
>> map C 0i/*A*/j
>> 
>> now i want to use the command like 12C to comment a block, however, it
>> does
>> not follow my mind, it does not comment one line then go down comment the
>> next line, it only give a lot of /* in the first line and make mistake,
>> how
>> to implement what i want?
>> 
>> Thank you very much.
> 
> The way you do it, the 12 in 12C is simply prepended to the mapping,
> changing 
> it to 120i/* etc., i.e., adding /* ten times the count (120 times
> here), 
> then */ once at the end of the line.
> 
> Method I: Put your command in a register, let's say "q, and invoke that 
> register with a count:
> 
>   :let @q = "0i/*\eA*/\ej"
> or
>   :let @q = "i\/*\*/\\e"
> 
> and in either case
> 
>   :map C @q
> 
> Method II: Use a Visual-mode mapping:
> 
>   :vmap  :'<-1put ='/* ':'>put =' */'
> or
>   :vmap  :'<-1put ='#if 0':'>put ='#endif'
> 
> I recommend the last of the above, which will (if I didn't goof) add "#if
> 0" 
> above your (linewise) visual area and "#endif" below it, so than any /* */ 
> inside the block won't disturb the compilation.
> 
> (I'm not sure what you use Ctrl-Esc for: I have no help for i_CTRL-Esc and
> on 
> my system, the Ctrl-Esc key is preempted by the window manager so that
> gvim 
> never sees it.)
> 
> 
> Best regards,
> Tony.
> -- 
> "The society which scorns excellence in plumbing as a humble activity
> and tolerates shoddiness in philosophy because it is an exalted
> activity will have neither good plumbing nor good philosophy ...
> neither its pipes nor its theories will hold water."
> 
> 

-- 
View this message in context: 
http://www.nabble.com/what-is-wrong-with-my-keymap-for-commenting-a-block-tf3506043.html#a9800173
Sent from the Vim - General mailing list archive at Nabble.com.



Re: ok, new question on search

2007-04-02 Thread A.J.Mechelynck

Gene Kwiecinski wrote:

Need to keep the pattern in memory?  If not, "/zzz" will do it,

assuming

you don't have "zzz" anywhere else in your file, of course.


The search register can be overwritten by setting @/ to ''.  This then 
clears your search "properly".

For my purposes, I have the following mapping in my vimrc:
nnoremap   :set @/=''
so pressing alt-/ then clears my search.


Yeah, but all those - and - stretches on the kb make my
fingers hurt...  :D



:noh

(with no "set") clears search highlighting until next search. If the 4 
characters are to much for you, map it to a key, e.g.


:map  :noh
:imap  :noh


Best regards,
Tony.
--
What the large print giveth, the small print taketh away.


Re: repeat replace many time on each line

2007-04-02 Thread Tobia
Bob Hiestand wrote:
> Tobia wrote:
> > Arnaud Bourree wrote:
> > > I've Xml document with attribute likes:
> > > foo="00 12 AF"
> > > I want to replace with:
> > > foo="0x00 0x12 0xAF"
> >
> > this works:
> >
> > %s/\%(\%(foo=\"\)\@<=\%([0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g
>
> In using :s with the /g flag, I take it the potential changes are
> marked first, and then executed, per line?

It would seem so.

By the way, I would have used a simpler pattern for such a task:

%s/\v%(foo\="[^"]*)@<=(<\x\x>)/0x\1/g


> I prefer when dealing with that many special characters to use the
> very-magic form

Me too.  I can't stand trying to match \( \) with my eyes, they just
don't look right, not to mention \{ \? \+...  Egrep and Perl have it
right.  I wish I could turn very-magic on by default.


Tobia


Re: what is wrong with my keymap for commenting a block

2007-04-02 Thread A.J.Mechelynck

flyfish wrote:

Hi,

i write a simple keymap for commenting C file,

map C 0i/*A*/j

now i want to use the command like 12C to comment a block, however, it does
not follow my mind, it does not comment one line then go down comment the
next line, it only give a lot of /* in the first line and make mistake, how
to implement what i want?

Thank you very much.


The way you do it, the 12 in 12C is simply prepended to the mapping, changing 
it to 120i/* etc., i.e., adding /* ten times the count (120 times here), 
then */ once at the end of the line.


Method I: Put your command in a register, let's say "q, and invoke that 
register with a count:


:let @q = "0i/*\eA*/\ej"
or
:let @q = "i\/*\*/\\e"

and in either case

:map C @q

Method II: Use a Visual-mode mapping:

:vmap  :'<-1put ='/* ':'>put =' */'
or
:vmap  :'<-1put ='#if 0':'>put ='#endif'

I recommend the last of the above, which will (if I didn't goof) add "#if 0" 
above your (linewise) visual area and "#endif" below it, so than any /* */ 
inside the block won't disturb the compilation.


(I'm not sure what you use Ctrl-Esc for: I have no help for i_CTRL-Esc and on 
my system, the Ctrl-Esc key is preempted by the window manager so that gvim 
never sees it.)



Best regards,
Tony.
--
"The society which scorns excellence in plumbing as a humble activity
and tolerates shoddiness in philosophy because it is an exalted
activity will have neither good plumbing nor good philosophy ...
neither its pipes nor its theories will hold water."


Re: Monospaced font problem

2007-04-02 Thread Pablo Arantes

Tobia,

Man, you're a genius! Your script solved the problem. I ran it and now
every program (including gvim, of course) recognizes Pragmata as being
monospaced.

Thank you very much.

--
Pablo

-- Forwarded message --
From: Tobia <[EMAIL PROTECTED]>
To: 'Vim mailing list' 
Date: Sun, 1 Apr 2007 13:55:46 +0200
Subject: Re: Monospaced font problem
Pablo Arantes wrote:

I contacted the author of Pragmata to share my concerns but he
couldn't help me much in this respect. I explained him the problem but
I'm not sure he understood it.


I emailed him too.  We share our first language, so maybe he will
understand me better.



I wonder if there is a feasible way to change this specification myself.


I had a look at the TTF file format[1] and it's quite easy.  I have
attached a small Python script that will query, set or clear the
monospaced flag on a TTF file.  Run it with no arguments to get help.

Remember to operate on a copy of the font file and to install/uninstall
the font through Windows's Control Panel.  That is: make a copy of the
font file; set the flag on it; uninstall the currently installed font;
install the modified version; profit.


Tobia

[1]
http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html
http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6post.html


Re: repeat replace many time on each line

2007-04-02 Thread Bob Hiestand

On 4/2/07, Tobia <[EMAIL PROTECTED]> wrote:

Arnaud Bourree wrote:
> I've Xml document with attribute likes:
> foo="00 12 AF"
> I want to replace with:
> foo="0x00 0x12 0xAF"
>
> %s/\%(\%(foo=\"\)\@<=\%(0x[0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g

this works:

%s/\%(\%(foo=\"\)\@<=\%([0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g


In using :s with the /g flag, I take it the potential changes are
marked first, and then executed, per line?

Somewhat more generally, the pattern above could be:

%s/\%(\%(foo=\"\)\@<=\%(\%(0x\)\?[0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g

which works both with and (repeatedly) without the /g flag.

I prefer when dealing with that many special characters to use the
very-magic form:

%s/\v%(%(foo\=")@<=%(%(0x)?[0-9A-F]{2}\s)*)@<=([0-9A-F]{2})/0x\1/g

... but that's obviously a matter of personal preference.

Thank you,

bob


Re: problem loading Python dll

2007-04-02 Thread A.J.Mechelynck

Alan G Isaac wrote:
On Mon, 2 Apr 2007, Johan du Preez apparently wrote: 
I have installed Python 2.5, but vim does not appear to see it? How do 
I solve this one!. 


:h python-dynamic

hth,
Alan Isaac






Rather than edit the executable as that help item suggests, you can look at 
the "Compilation" line in the output of ":version"; but in the OP's case 
(where Vim shouts for python25.dll) that oughtn't to be necessary.


Best regards,
Tony.
--
Love's Drug

My love is like an iron wand
That conks me on the head,
My love is like the valium
That I take before my bed,
My love is like the pint of scotch
That I drink when I be dry;
And I shall love thee still, my dear,
Until my wife is wise.


Re: bracket completion

2007-04-02 Thread A.J.Mechelynck

Zarko Coklin wrote:

It is hard to expand on Tony's feedback, ever. Still,
I found the following works a bit better. Not only
that it creates a right brace but it also places a
cursor on the right spot (taking into consideration
indentation if you set it).


:inoremap { {}
:inoremap [ []
:inoremap ( ()

Regards,
Zarko Coklin


"The right spot" depends on your C coding style: your mapping might apply for

if (condition) {
statement;
statement;
}

and

void function functionname(void* p) {
statement;
statement;
}

though it might be better to place  _after_  in the {rhs} to avoid 
splitting a word in the middle. Mine is better for


if (condition)
{   statement;
statement;
}

and

void function functionname(void* p)
{   statement;
statement;
}

and can still be used for yours, by hitting  after the mapped {


Best regards,
Tony.
--
Taxes are going up so fast, the government is likely to price itself
out of the market.


Re: how to create tag file in Vim for matlab .m files?

2007-04-02 Thread Charles E Campbell Jr

frank wang wrote:


Does anyone know how to do it?



The hdrtag program will do it:  
http://mysite.verizon.net/astronaut/src/index.html and click on "hdrtag".


Regards,
Chip Campbell



how to create tag file in Vim for matlab .m files?

2007-04-02 Thread frank wang

Does anyone know how to do it?

Thanks

Frank


help file imprecision

2007-04-02 Thread A.J.Mechelynck

In

*insert.txt*For Vim version 7.0.  Last change: 2006 Dec 06

under :help i_CTRL-_ at lines 222-223, there is:

Only if compiled with the |+rightleft| feature (which is not
the default).

there should be:

Only if compiled with the |+rightleft| feature (which means
a Big or Huge version of Vim).

Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
158. You get a tuner card so you can watch TV while surfing.


RE: bracket completion

2007-04-02 Thread Waters, Bill
Can you provide and example of how to do this?

Thanks,
Bill


> >
> >:inoremap { {}
> >:inoremap [ []
> >:inoremap ( ()
> >
>
> I'll just add a statment enabling this for certain languages. This has
> also giving me a couple new ideas to play with. Thanks again. :)
> 
> --Greg


Re: Esperanto dictionary

2007-04-02 Thread A.J.Mechelynck

Cyril Slobin wrote:

On 4/2/07, Hugh Sasse <[EMAIL PROTECTED]> wrote:


It might be useful to also support C^irkau^ as well.  I'm not sure
how often the h form is used given the exception(s?) (flughaveno...)


For h form you can use my plugin:

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

It converts misc ascii representations to unicode and vice versa.
Among others are supported Cxirkaux-style, Zamenhof style with h (and
it knows about flughaveno and chashundo!), html/xml entities,
tex/latex notation and many more... If you want to spell check text
written with h's, you just convert it to unicode, check, and convert
back. Plugin is table-driven, and I haven't write tables myself -- I
borrowed them from two other open-source projects (UniRed and catdoc).
UniRed also has tables for ^Cirka^u, C^irkau^ and C`irkau`, and plugin
can use them, but I haven't bundled with plugin.


Also isn't your example often written "CXirkaux" because the CX is
(effectively) one character, capitalized?


I've newer seen this form, and I believe it is ugly. And in unicode
terms, this one character is not capitalized, but title-cased.



Well, I suppose both uppercase and titlecase should be supported then. Cxu ne? 
CXU VERE NE? (Kompreneble, ĉiukaze mi preferas "verajn" ĉapelitajn literojn.)


I suppose texts written in "«Fundamenta» h-stilo" could emphasise the radical 
break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er, etc.). 
Anyway, I anticipate that all substitution schemes will become less and less 
necessary as Unicode generalizes: e.g., my fr_BE keyboard supports consonants 
with circumflex "out of the box" in openSUSE Linux 10.2 (thus going back to 
the "universality" of the French typewriters of Zamenhof's time ;-) ).


Best regards,
Tony.
--
How can you be in two places at once when you're not anywhere at all?


Re: Question about b:did_ftplugin

2007-04-02 Thread Andy Wokula

Thomas schrieb:



Now, when I do set ft=X from the command line, it happens that the
ftplugin X doesn't get loaded because it finishes when
b:did_ftplugin is set.

What I actually meant by this was: the ftplugin X doesn't get loaded
when a filetype was already set before, i.e. when a filetype plugin
already defined b:did_ftplugin.


ftplugins should define b:undo_ftplugin .
   :h undo_ftplugin
If this var exists and its commands get executed then (only then)
also b:did_ftplugin will be unset.

Executing b:undo_ftplugin is one of the first things  :setf X  tries
to do.

Thanks, in the meantime I already found this help page. But it doesn't
seem to solve the problem.

Here's what I do (vim is 7.0-204):

in ~/.vim/ftplugin/test.vim

   if &cp || exists("b:did_ftplugin")
   echom 'b:did_ftplugin already set!'
   finish
   endif
   let b:did_ftplugin = 1

   echom "Test ftplugin!"

on the command line:
gvim -u NONE

in vim:
:set nocompatible
:syntax on
:filetype plugin on
:help
:set ft=test

Result: 'b:did_ftplugin already set!' is printed in the echo area.
b:did_ftplugin obviously is set by the help ftplugin (b:undo_ftplugin
is set to "setl fo< tw<") but is never unset.


Ok.  There has been an error in the earlier help ftplugin (from
2006-04-19).  Are you sure your help ftplugin sets

   :let b:undo_ftplugin = "setl fo< tw<"

and not

   :let b:undo_plugin = "setl fo< tw<"

(?)  In the latter case, update your runtime file(s) and try again.


Is this really the intended behaviour? Is the user meant to manually
unlet b:did_ftplugin in such a situation? Do I misunderstand here
something quite fundamentally?

Regards,
Thomas.


No, no, no :-)

--
Regards,
Andy

EOM



Re: Question about b:did_ftplugin

2007-04-02 Thread Thomas


Now, when I do set ft=X from the command line, it happens that the 
ftplugin X doesn't get loaded because it finishes when b:did_ftplugin 
is set.
What I actually meant by this was: the ftplugin X doesn't get loaded 
when a filetype was already set before, i.e. when a filetype plugin 
already defined b:did_ftplugin.



ftplugins should define b:undo_ftplugin .
   :h undo_ftplugin
If this var exists and its commands get executed then (only then) also
b:did_ftplugin will be unset.

Executing b:undo_ftplugin is one of the first things  :setf X  tries
to do.
Thanks, in the meantime I already found this help page. But it doesn't 
seem to solve the problem.


Here's what I do (vim is 7.0-204):

in ~/.vim/ftplugin/test.vim

   if &cp || exists("b:did_ftplugin")
   echom 'b:did_ftplugin already set!'
   finish
   endif
   let b:did_ftplugin = 1

   echom "Test ftplugin!"

on the command line:
gvim -u NONE

in vim:
:set nocompatible
:syntax on
:filetype plugin on
:help
:set ft=test

Result: 'b:did_ftplugin already set!' is printed in the echo area. 
b:did_ftplugin obviously is set by the help ftplugin (b:undo_ftplugin is 
set to "setl fo< tw<") but is never unset.


Is this really the intended behaviour? Is the user meant to manually 
unlet b:did_ftplugin in such a situation? Do I misunderstand here 
something quite fundamentally?


Regards,
Thomas.



Re: gVim and Cygwin

2007-04-02 Thread A.J.Mechelynck

Robert Schols wrote:
[...]

I use the UnxUtils package:
http://unxutils.sourceforge.net/

It includes all of the commands I need and accepts forward slashes as
well as backslashes. I use these commands from the standard precompiled
gvim.exe from vim.org.

I have cygwin as well, but it is later in my %PATH%.

Although technically not an answer to your question, I think this is the
best solution to your problem.

Best regards,
Robert

PS: Actually I use the Labrat Toolkit which includes the UnxUtils
package, but labrattech.com seems to have issues with php syntax at the
moment. When they are up and running again you must check this out.




When I was on Windows, I tried the unxutils package, but I had some problems 
with it, I don't remember which ones. Apparently it works for some people, so 
let those go on using it. For people like me, happily there is another set of 
Unix-like programs which work under native Windows, viz. the GnuWin32 
utilities (available as a SourceForge project).


I used to have GnuWin32 late in my PATH (after any Micro$oft programs of the 
same name such as sort.exe) and Cygwin not in the PATH at all (except of 
course in the terminal window running Cygwin bash, where it came early in the 
$PATH).


Best regards,
Tony.
--
"A wizard cannot do everything; a fact most magicians are reticent to
admit, let alone discuss with prospective clients.  Still, the fact
remains that there are certain objects, and people, that are, for one
reason or another, completely immune to any direct magical spell.  It
is for this group of beings that the magician learns the subtleties of
using indirect spells.  It also does no harm, in dealing with these
matters, to carry a large club near your person at all times."
-- The Teachings of Ebenezum, Volume VIII


Re: repeat replace many time on each line

2007-04-02 Thread Tobia
Arnaud Bourree wrote:
> I've Xml document with attribute likes:
> foo="00 12 AF"
> I want to replace with:
> foo="0x00 0x12 0xAF"
>
> %s/\%(\%(foo=\"\)\@<=\%(0x[0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g
  ^^
this works:

%s/\%(\%(foo=\"\)\@<=\%([0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g


Tobia


Re: ok, new question on search

2007-04-02 Thread Chad Gulley
i have a mapping that will toggle search highlighting on and off.  you may find 
it useful.
map  :set hlsearch! 

--
chad



On Mon, Apr 02, 2007 at 12:43:07PM -0400, Jean-Rene David wrote:
> * shawn bright [2007.04.02 12:00]:
> > when i do a search like  /text
> > it highlights all of the matches and i can use n
> > and N to navigate.  how do i turn the
> > highlighting off when i am done?
> 
> There's a command to do exactly that:
> 
> :nohlsearch
> 
> This will turn off highlighting for the current
> search. Highlighting will come back for the next
> search.
> 
> Note that this is different from the 'hlsearch'
> option, whose effects are permanent.
> 
> Of course you can map this:
> 
> :map  :nohlsearch
> 
> -- 
> JR


Re: ok, new question on search

2007-04-02 Thread Jean-Rene David
* shawn bright [2007.04.02 12:00]:
> when i do a search like  /text
> it highlights all of the matches and i can use n
> and N to navigate.  how do i turn the
> highlighting off when i am done?

There's a command to do exactly that:

:nohlsearch

This will turn off highlighting for the current
search. Highlighting will come back for the next
search.

Note that this is different from the 'hlsearch'
option, whose effects are permanent.

Of course you can map this:

:map  :nohlsearch

-- 
JR


Re: ok, new question on search

2007-04-02 Thread Guido Van Hoecke

shawn bright said on 02-04-07 17:56:

lo there,
when i do a search like  /text
it highlights all of the matches and i can use n and N to navigate.
how do i turn the highlighting off when i am done?


You could put following mapping in your.vimrc:

:nnoremap   :nohlsearch

Now, as soon as you hit the enter key, the higlight is turned off.

Is a very straigthforward and easy way of turning off the current highlight, 
without changing your settings at all.

HTH, Guido.

--
http://vanhoecke.org ... and go2 places!


Re: bracket completion

2007-04-02 Thread Zarko Coklin
It is hard to expand on Tony's feedback, ever. Still,
I found the following works a bit better. Not only
that it creates a right brace but it also places a
cursor on the right spot (taking into consideration
indentation if you set it).


:inoremap { {}
:inoremap [ []
:inoremap ( ()

Regards,
Zarko Coklin


 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121


Re: ok, new question on search

2007-04-02 Thread shawn bright

great, have this set now in mine.
thanks,
sk

On 4/2/07, Albie Janse van Rensburg <[EMAIL PROTECTED]> wrote:

Gene Kwiecinski wrote:
>> when i do a search like  /text
>> it highlights all of the matches and i can use n and N to navigate.
>> how do i turn the highlighting off when i am done?
>>
>
> Need to keep the pattern in memory?  If not, "/zzz" will do it, assuming
> you don't have "zzz" anywhere else in your file, of course.
>
> Can fiddle with ":set nohls" and whatnot, but for me, it's just easier
> to search for nothing to turn off highlighting of the just-searched-for
> text.
>
> Then, of course, you'd have to ":set hls" to turn it back on again.
> Lotta typing, big pain, 'swhy I don't do that, and just search for
> gibberish instead if I want to unhighlight what I was just looking for.
>
The search register can be overwritten by setting @/ to ''.  This then
clears your search "properly".

For my purposes, I have the following mapping in my vimrc:

nnoremap   :set @/=''

so pressing alt-/ then clears my search.

--
Albie Janse van Rensburg

It is only by risking our persons from one hour to another that we live
at all. And often enough our faith beforehand in an uncertified result
is the only thing that makes the result come true. -- William James



RE: ok, new question on search

2007-04-02 Thread Gene Kwiecinski
>cool enough, i guess i could map something to
>:/impossible_to_find_text or something

Or, just "zzz"... or "qwqw"... or ";;;"... etc.  


RE: ok, new question on search

2007-04-02 Thread Gene Kwiecinski
>>Need to keep the pattern in memory?  If not, "/zzz" will do it,
assuming
>>you don't have "zzz" anywhere else in your file, of course.

>The search register can be overwritten by setting @/ to ''.  This then 
>clears your search "properly".
>For my purposes, I have the following mapping in my vimrc:
>nnoremap   :set @/=''
>so pressing alt-/ then clears my search.

Yeah, but all those - and - stretches on the kb make my
fingers hurt...  :D


Re: ok, new question on search

2007-04-02 Thread shawn bright

cool enough, i guess i could map something to
:/impossible_to_find_text or something
thanks
sk

On 4/2/07, Gene Kwiecinski <[EMAIL PROTECTED]> wrote:

>when i do a search like  /text
>it highlights all of the matches and i can use n and N to navigate.
>how do i turn the highlighting off when i am done?

Need to keep the pattern in memory?  If not, "/zzz" will do it, assuming
you don't have "zzz" anywhere else in your file, of course.

Can fiddle with ":set nohls" and whatnot, but for me, it's just easier
to search for nothing to turn off highlighting of the just-searched-for
text.

Then, of course, you'd have to ":set hls" to turn it back on again.
Lotta typing, big pain, 'swhy I don't do that, and just search for
gibberish instead if I want to unhighlight what I was just looking for.



Re: ok, new question on search

2007-04-02 Thread Albie Janse van Rensburg

Gene Kwiecinski wrote:

when i do a search like  /text
it highlights all of the matches and i can use n and N to navigate.
how do i turn the highlighting off when i am done?



Need to keep the pattern in memory?  If not, "/zzz" will do it, assuming
you don't have "zzz" anywhere else in your file, of course.

Can fiddle with ":set nohls" and whatnot, but for me, it's just easier
to search for nothing to turn off highlighting of the just-searched-for
text.

Then, of course, you'd have to ":set hls" to turn it back on again.
Lotta typing, big pain, 'swhy I don't do that, and just search for
gibberish instead if I want to unhighlight what I was just looking for.
  
The search register can be overwritten by setting @/ to ''.  This then 
clears your search "properly".


For my purposes, I have the following mapping in my vimrc:

nnoremap   :set @/=''

so pressing alt-/ then clears my search.

--
Albie Janse van Rensburg

It is only by risking our persons from one hour to another that we live 
at all. And often enough our faith beforehand in an uncertified result 
is the only thing that makes the result come true. -- William James


RE: ok, new question on search

2007-04-02 Thread Gene Kwiecinski
>when i do a search like  /text
>it highlights all of the matches and i can use n and N to navigate.
>how do i turn the highlighting off when i am done?

Need to keep the pattern in memory?  If not, "/zzz" will do it, assuming
you don't have "zzz" anywhere else in your file, of course.

Can fiddle with ":set nohls" and whatnot, but for me, it's just easier
to search for nothing to turn off highlighting of the just-searched-for
text.

Then, of course, you'd have to ":set hls" to turn it back on again.
Lotta typing, big pain, 'swhy I don't do that, and just search for
gibberish instead if I want to unhighlight what I was just looking for.


RE: invoking yanked register into colon command

2007-04-02 Thread Gene Kwiecinski
>after having read the user-manual. For example, I do often want to
>replace a name in the text with another. What I used to do is
>selecting it with mouse and type
>:%s//newname/gc
>Is there a way to do this with the mouse (and without retyping the
name) ?
>What I want is maybe something like 'invoking a yanked register in my
>colon command'

Me, I go to whatever I'm looking for, hit 'v', then use normal motion
commands (eg, "3e") to highlight the text in question, instead of using
the moose.

If a single word, '*' will automagically highlight and search for the
word under the cursor.

>From there, once you highlighted the exact pattern you want, can just
use

:%s//newname/gc

as it remembers what you just looked for.  No need to reinsert it for
the 's' command.


ok, new question on search

2007-04-02 Thread shawn bright

lo there,
when i do a search like  /text
it highlights all of the matches and i can use n and N to navigate.
how do i turn the highlighting off when i am done?

thanks
sk


Re: bracket completion

2007-04-02 Thread shawn bright

whoa !, nevermind, found an example file on his website, tried it and works,.
sorry, my own rftm mistake

sk

On 4/2/07, shawn bright <[EMAIL PROTECTED]> wrote:

this looks like exactly what i am after.
i am kind of a newbie here, and cant quite get it to work right.
i believe that i need a python.vim file in /ftplugin directory.
but i dont know how to word it to make this plugin work,
could anyone kinda help me here, i can't make out what i should do
from the docs on the website that you linked to

thanks for any tips

sk

On 4/2/07, Greg Matheson <[EMAIL PROTECTED]> wrote:
> On Mon, 02 Apr 2007, shawn bright wrote:
>
> > i am finding these usefull too, thanks
>
> Check out Luc Hermitte's development of Stephen Riehm's
> bracketing macros.
>
> http://hermitte.free.fr/vim/settings.php#settings
>
> --
> Greg MathesonI have an elaborate mnemonic for
>  remembering what day it is. It's
>  called the number system.
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>



Re: bracket completion

2007-04-02 Thread shawn bright

this looks like exactly what i am after.
i am kind of a newbie here, and cant quite get it to work right.
i believe that i need a python.vim file in /ftplugin directory.
but i dont know how to word it to make this plugin work,
could anyone kinda help me here, i can't make out what i should do
from the docs on the website that you linked to

thanks for any tips

sk

On 4/2/07, Greg Matheson <[EMAIL PROTECTED]> wrote:

On Mon, 02 Apr 2007, shawn bright wrote:

> i am finding these usefull too, thanks

Check out Luc Hermitte's development of Stephen Riehm's
bracketing macros.

http://hermitte.free.fr/vim/settings.php#settings

--
Greg MathesonI have an elaborate mnemonic for
 remembering what day it is. It's
 called the number system.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




Re: Question about b:did_ftplugin

2007-04-02 Thread Andy Wokula

Thomas schrieb:

Hi,

When I set a filetype for a buffer the variable b:did_ftplugin is set.

The help says:

If you are writing a filetype plugin to be used by many people, they 
need a

chance to disable loading it.  Put this at the top of the plugin: >

" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
  finish
endif
let b:did_ftplugin = 1


Now, when I do set ft=X from the command line, it happens that the 
ftplugin X doesn't get loaded because it finishes when b:did_ftplugin is 
set.


When is b:did_ftplugin ever unset? What's the rationale of setting 
b:did_ftplugin and not b:did_ftplugin_X?


Regards,
Thomas.


ftplugins should define b:undo_ftplugin .
   :h undo_ftplugin
If this var exists and its commands get executed then (only then) also
b:did_ftplugin will be unset.

Executing b:undo_ftplugin is one of the first things  :setf X  tries
to do.

--
Regards,
Andy

EOM


what is wrong with my keymap for commenting a block

2007-04-02 Thread flyfish

Hi,

i write a simple keymap for commenting C file,

map C 0i/*A*/j

now i want to use the command like 12C to comment a block, however, it does
not follow my mind, it does not comment one line then go down comment the
next line, it only give a lot of /* in the first line and make mistake, how
to implement what i want?

Thank you very much.
-- 
View this message in context: 
http://www.nabble.com/what-is-wrong-with-my-keymap-for-commenting-a-block-tf3506043.html#a9791728
Sent from the Vim - General mailing list archive at Nabble.com.



repeat replace many time on each line

2007-04-02 Thread Arnaud Bourree
Hello,

I've Xml document with attribute likes:
foo="00 12 AF"
I want to replace with:
foo="0x00 0x12 0xAF"

I try:
%s/\%(\%(foo=\"\)\@<=\%(0x[0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g

It works fine for each first occurrence of each line but not on others
whatever I've put g option.
I have to use repeat manually until change is finish.

How can I do repeat?

Thanks,

Arnaud.

-- 
Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird


Re: bracket completion

2007-04-02 Thread Greg Matheson
On Mon, 02 Apr 2007, shawn bright wrote:

> i am finding these usefull too, thanks

Check out Luc Hermitte's development of Stephen Riehm's
bracketing macros.

http://hermitte.free.fr/vim/settings.php#settings

--
Greg MathesonI have an elaborate mnemonic for
 remembering what day it is. It's
 called the number system.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: bracket completion

2007-04-02 Thread shawn bright

i am finding these usefull too, thanks
sk

On 4/2/07, Panos Laganakos <[EMAIL PROTECTED]> wrote:

Those are great, thanks alot :)

On 4/1/07, Fritz Mehner <[EMAIL PROTECTED]> wrote:
> A.J.Mechelynck schrieb:
>
> > Greg Fitzgerald wrote:
> >
> >> Anyone know of a way to achieve bracket completion? For example if
> >> your typing a if statement, if (something) { once you type the first
> >> bracket
> >> the 2nd one is inserted below for you. Scribes and a few other editors
> >> have this functionality and was hoping to achieve it with Vim. Another
> >> thing that this does, if you were to type $data[' for example. The 2nd '
> >> would be inserted for you after your cursor. Just seems to save time
> >> when I played with scribes a few days ago. I was looking through the
> >> help, scripts and mailing list archives for something like this but have
> >> not hit any matches. Just wondering if people have ideas on how this
> >> could be done or maybe know of an existing way. Thanks in advance.
> >>
> >> --Greg
> >>
> >
> > :inoremap { {}
> > :inoremap [ []
> > :inoremap ( ()
> >
> > etc.
> >
> > This assumes brace indenting is taken care of (by 'cindent' or
> > 'indentexpr').
> >
> > IIUC, you can still enter an "unpaired brace" (or bracket or paren) by
> > prefixing it with Ctrl-V (or with Ctrl-Q if Ctrl-V pastes).
> >
> > Best regards,
> > Tony.
>
> In addition I use the following settings
>
> vnoremap  (  s()P
> vnoremap  [  s[]P
> vnoremap  {  s{}P
>
> to surround a  selection in visual mode.
> Regards,
> Fritz
>
>
>
>
>


--
Panos Laganakos



Re: problem loading Python dll

2007-04-02 Thread Alan G Isaac
On Mon, 2 Apr 2007, Johan du Preez apparently wrote: 
> I have installed Python 2.5, but vim does not appear to see it? How do 
> I solve this one!. 

:h python-dynamic

hth,
Alan Isaac






Question about b:did_ftplugin

2007-04-02 Thread Thomas

Hi,

When I set a filetype for a buffer the variable b:did_ftplugin is set.

The help says:


If you are writing a filetype plugin to be used by many people, they need a
chance to disable loading it.  Put this at the top of the plugin: >

" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
  finish
endif
let b:did_ftplugin = 1


Now, when I do set ft=X from the command line, it happens that the 
ftplugin X doesn't get loaded because it finishes when b:did_ftplugin is 
set.


When is b:did_ftplugin ever unset? What's the rationale of setting 
b:did_ftplugin and not b:did_ftplugin_X?


Regards,
Thomas.



Re: delete all but first occurence of a pattern

2007-04-02 Thread Nikolaos A. Patsopoulos

Tobia wrote:

I don't think Vim's regular expressions are the best tool for this job.
I mean, XML manipulation is much easier done in XSLT:


http://www.w3.org/1999/XSL/Transform";>













This does what you want in your example, assuming the source is a proper
XML document (among other things there must be a "root tag" encompassing
all the articles.)  Invoke with "xsltproc fix-authors.xsl articles.xml"
or with any other XSLT tool.


To get back on-topic, I find these scripts make working with XSLT a bit
less painful:

xslhelper.vim  http://www.vim.org/scripts/script.php?script_id=1364
closetag.vim  http://www.vim.org/scripts/script.php?script_id=13

This, on the other hand, is on my list of "things to check", but I still
haven't got around to checking it out:

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


Tobia


  
I'm currently looking for sth that will work with VI (I use vim script 
files). As last resort I'll try your suggestion though.


Thank you for your reply,

Nikos



RE: gVim and Cygwin

2007-04-02 Thread Robert Schols

> -Original Message-
> From: Waters, Bill [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 30, 2007 18:06
> To: vim@vim.org
> Subject: gVim and Cygwin
> 
> 
> Does anyone have experience with running gVim and using 
> Cygwin commands (ex. indent)?  I would prefer not to run vim 
> in a Cygwin terminal, unless someone has all of the 
> configurations needed (syntax highlighting, etc) to have that 
> act like gVim.

I use the UnxUtils package:
http://unxutils.sourceforge.net/

It includes all of the commands I need and accepts forward slashes as
well as backslashes. I use these commands from the standard precompiled
gvim.exe from vim.org.

I have cygwin as well, but it is later in my %PATH%.

Although technically not an answer to your question, I think this is the
best solution to your problem.

Best regards,
Robert

PS: Actually I use the Labrat Toolkit which includes the UnxUtils
package, but labrattech.com seems to have issues with php syntax at the
moment. When they are up and running again you must check this out.



Re: Esperanto dictionary

2007-04-02 Thread Cyril Slobin

On 4/2/07, Hugh Sasse <[EMAIL PROTECTED]> wrote:


It might be useful to also support C^irkau^ as well.  I'm not sure
how often the h form is used given the exception(s?) (flughaveno...)


For h form you can use my plugin:

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

It converts misc ascii representations to unicode and vice versa.
Among others are supported Cxirkaux-style, Zamenhof style with h (and
it knows about flughaveno and chashundo!), html/xml entities,
tex/latex notation and many more... If you want to spell check text
written with h's, you just convert it to unicode, check, and convert
back. Plugin is table-driven, and I haven't write tables myself -- I
borrowed them from two other open-source projects (UniRed and catdoc).
UniRed also has tables for ^Cirka^u, C^irkau^ and C`irkau`, and plugin
can use them, but I haven't bundled with plugin.


Also isn't your example often written "CXirkaux" because the CX is
(effectively) one character, capitalized?


I've newer seen this form, and I believe it is ugly. And in unicode
terms, this one character is not capitalized, but title-cased.

--
Cyril Slobin <[EMAIL PROTECTED]> `When I use a word,' Humpty Dumpty said,
 `it means just what I choose it to mean'


Re: Esperanto dictionary

2007-04-02 Thread Hugh Sasse
On Sat, 31 Mar 2007, Cyril Slobin wrote:

> Hi all!
[...] 
> I have complied my own eo.utf-8.spl from ispell sources by Sergio
> Pokrovskij found in Debian 3.1 distribution. It understands both real
> Unicode and surrogate "Cxirkaux"-style (if you don't speak Esperanto,

It might be useful to also support C^irkau^ as well.  I'm not sure
how often the h form is used given the exception(s?) (flughaveno...)
Also isn't your example often written "CXirkaux" because the CX is 
(effectively) one character, capitalized?

Anyway, nice to see someone working on this stuff.  

Hugh



Re: bracket completion

2007-04-02 Thread Panos Laganakos

Those are great, thanks alot :)

On 4/1/07, Fritz Mehner <[EMAIL PROTECTED]> wrote:

A.J.Mechelynck schrieb:

> Greg Fitzgerald wrote:
>
>> Anyone know of a way to achieve bracket completion? For example if
>> your typing a if statement, if (something) { once you type the first
>> bracket
>> the 2nd one is inserted below for you. Scribes and a few other editors
>> have this functionality and was hoping to achieve it with Vim. Another
>> thing that this does, if you were to type $data[' for example. The 2nd '
>> would be inserted for you after your cursor. Just seems to save time
>> when I played with scribes a few days ago. I was looking through the
>> help, scripts and mailing list archives for something like this but have
>> not hit any matches. Just wondering if people have ideas on how this
>> could be done or maybe know of an existing way. Thanks in advance.
>>
>> --Greg
>>
>
> :inoremap { {}
> :inoremap [ []
> :inoremap ( ()
>
> etc.
>
> This assumes brace indenting is taken care of (by 'cindent' or
> 'indentexpr').
>
> IIUC, you can still enter an "unpaired brace" (or bracket or paren) by
> prefixing it with Ctrl-V (or with Ctrl-Q if Ctrl-V pastes).
>
> Best regards,
> Tony.

In addition I use the following settings

vnoremap  (  s()P
vnoremap  [  s[]P
vnoremap  {  s{}P

to surround a  selection in visual mode.
Regards,
Fritz








--
Panos Laganakos