command to indent file

2007-03-09 Thread Vu The Cuong
In the path I often used command to indent my php file or C# file:
gg ... G
mean go to the top of file and indent code until the end of file.
But Unfortunately I forgot.
Could anyone tell me what I forgot?
Thanks




RE: omni complete for php is really slooow

2007-01-16 Thread Vu The Cuong
On my Sempron2200, 512MB RAM it may be not very fast but IMO is acceptable. 
Looks like something is wrong with your setup. Do 
you use tags files? 
You mean ctags?
Yes. I'm using it
Anyway thanks for your response. I will recheck my config.

-Original Message-
From: Mikolaj Machowski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 17, 2007 3:33 AM
To: vim@vim.org
Subject: Re: omni complete for php is really slooow

On wtorek 16 styczeń 2007, vim users list wrote:
 The mail subject says it all:omni complete for php in vim7 in my PC 
 (P4 D, 1GB Ram) is really slooow.

 How about omni complete for php in vim7 in in your  PC? Fast or Slow???
 How can I make it faster?

Only for price in functionality. You can just comment various levels of 
completion logic.

On my Sempron2200, 512MB RAM it may be not very fast but IMO is acceptable. 
Looks like something is wrong with your setup. Do you use tags files?

m.






RE: omni complete for php is really slooow

2007-01-15 Thread Vu The Cuong
 Coud anyone hep me hic hic :(
Does omni complete for php it can  not be improved speed?
Tnx in advanced


-Original Message-
From: Vu The Cuong 
Sent: Monday, January 15, 2007 1:04 PM
To: vim users list
Subject: omni complete for php is really slooow

Dear all
The mail subject says it all:omni complete for php in vim7 in my PC (P4
D, 1GB Ram) is really slooow.

How about omni complete for php in vim7 in in your  PC? Fast or Slow???
How can I make it faster?
Thanks in advanced.




omni complete for php is really slooow

2007-01-14 Thread Vu The Cuong
Dear all
The mail subject says it all:omni complete for php in vim7 in my PC (P4
D, 1GB Ram) is really slooow.

How about omni complete for php in vim7 in in your  PC? Fast or Slow???
How can I make it faster?
Thanks in advanced.


RE: gvim window maximize in freebsd6

2007-01-07 Thread Vu The Cuong
thanks for quick response :D
 

-Original Message-
From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 08, 2007 7:33 AM
To: vuthecuong
Cc: vim@vim.org
Subject: Re: gvim window maximize in freebsd6

vuthecuong wrote:
 In windows, this command  au GUIEnter * simalt ~x   will make gvim 
 window to become maximize.
 How about in freebsd? When I used above command in freebsd, it cannot 
 maximize Thanks in advanced
 
 
 

:simalt ~x simulates Alt-Space x, invoking that menu, if there is
any. It is not cross-language, and, as you saw, not always
cross-platform.

The command

if has(gui_running)
set lines= columns=
endif

will enlarge the GUI screen to within one character cell of the OS
viewport.

Ordering of statements may be important:
1) set 'guifont' (which changes the character cell's pixel size)
2) set 'lines' and 'columns'
3) set '(no)equalalways', 'winheight', 'winminheight' etc. (which depend
on the Vim screen size).


Best regards,
Tony.



RE: xhtml editing in vim

2006-11-02 Thread Vu The Cuong
Hi
Thanks for the quick response.
As your advice,  I added :let g:do_xhtml_mappings = 1: into my vimrc
but it not worked.
I also set :let g:html_tag_case = 'l' so that html tag become lower
case.
How can I do? Please  help me. I need your help. Thanks in advance

Here is my _vimrc:
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif
  silent execute '!C:\Vim\vim63\diff ' . opt . arg1 . ' ' . arg2 . '  '
. arg3
endfunction
set dictionary-=C:\Vim\vim63\sql.dict dictionary+=C:\Vim\vim63\sql.dict
:let g:textutil_txt_encoding='utf-8'
nmap ENTERENTER G
function! NumberNo()
:set nonumber
:map F12 :call NumberYes()CR
endfunction

function! NumberYes()
:set number
:map F12 :call NumberNo()CR
endfunction
map F12 :call NumberNo()CR
 Window size appearance
augroup guiappearance
au!
:map F9 :set lines+=5CR
:map S-F9 :set lines-=5CR
:map C-F9 :set lines=60CR
:map M-F9 :set lines=30CR
:map F8 :set columns+=10CR
:map S-F8 :set columns-=10CR
:map C-F8 :set columns=132CR
:map M-F8 :set columns=80CR
augroup END
set nonumber
 set winaltkeys=yes 

let w:windowmaximized = 0

function! MaxRestoreWindow()
if w:windowmaximized == 1
let w:windowmaximized = 0
 restore the window
:simalt ~r
else
let w:windowmaximized = 1
 maximize the window
:simalt ~x
endif
endfunction

map F5 :call MaxRestoreWindow()CR
:filetype plugin on
:let g:html_tag_case = 'l'


:let g:do_xhtml_mappings = 1
colorscheme candycode

:nmap C-S-tab :tabpreviouscr
:nmap C-tab :tabnextcr
:map C-S-tab :tabpreviouscr
:map C-tab :tabnextcr
:imap C-S-tab ESC:tabpreviouscri
:imap C-tab ESC:tabnextcri
:nmap C-t :tabnewcr
:imap C-t ESC:tabnewcr 
:nmap C-S-w :tabclosecr
:nmap C-A-tab :tabfirstcr
:nmap S-tab :tablastcr

:filetype indent on

syntax on
:set smartindent
:set autoindent





-Original Message-
From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 02, 2006 11:25 AM
To: Vu The Cuong
Cc: Vim Help list
Subject: Re: xhtml editing in vim

Vu The Cuong wrote:
 I often use html script for editing html files.
 (see: http://www.vim.org/scripts/script.php?script_id=453)
 I prefer XHML compatible tags. (Ex: when press ;br, insteadof br, it
will ouput  /br.

Shouldn't it rather output br / ? The BR element cannot have a
closing tag.

 Can this script do that. If yes, could you guide me in detail?
 If No, is there script to do that?
 Thanks

What about

:let g:do_xhtml_mappings = 1

in your vimrc (if all your HTML files must have lowercase
xhtml-compatible tags), or

:let b:do_xhtml_mappings = 1

either manually or (if you can recognise which files to use it for) at
the BufRead and possibly the BufNewFile autocommand events?

I got this from :help html-cutomization in the companion helpfile; but
I didn't try it.


Best regards,
Tony.



RE: xhtml editing in vim

2006-11-02 Thread Vu The Cuong
Hi
Last night I added it in vimrc on my Freebsd 6.1 (version of vim of my
freebsd is 7) and 
HTML script is latest. And it worked well.
May be in XP, version of script is outdate.
I'll recheck it. 
Many thanks and best regard


-Original Message-
From: Christian J. Robinson [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 6:04 AM
To: Vu The Cuong
Cc: A.J.Mechelynck; Vim Help list
Subject: RE: xhtml editing in vim

On Thu, 2 Nov 2006, Vu The Cuong wrote:

 As your advice,  I added :let g:do_xhtml_mappings = 1: into my vimrc 
 but it not worked.
 I also set :let g:html_tag_case = 'l' so that html tag become lower 
 case.
 How can I do? Please  help me. I need your help. Thanks in advance

Have you installed the latest version of the script?  Support for XHTML
was only added recently, so you need version 0.21 or later.

If you do have a recent enough version, are you setting the variable
before the script gets sourced?  (Did you restart vim after you put :let
g:do_xhtml_mappings = 1 in your vimrc?)

- Christian

-- 
 Too bad stupidity isn't painful.
Christian J. Robinson [EMAIL PROTECTED]
http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp



RE: xhtml editing in vim

2006-11-02 Thread Vu The Cuong
 Hi
Got it.
I download the latest HTML script and finally it worked in XP (But
mainly I use HTML script in freebsd). 
I just want to perform some PHP debug on XP to see is there a difference
between PHP on freebsd and PHP in XP.

Many thanks



-Original Message-
From: Vu The Cuong 
Sent: Friday, November 03, 2006 9:30 AM
To: 'Christian J. Robinson'
Cc: A.J.Mechelynck; Vim Help list
Subject: RE: xhtml editing in vim

Hi
Last night I added it in vimrc on my Freebsd 6.1 (version of vim of my
freebsd is 7) and HTML script is latest. And it worked well.
May be in XP, version of script is outdate.
I'll recheck it. 
Many thanks and best regard


-Original Message-
From: Christian J. Robinson [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 6:04 AM
To: Vu The Cuong
Cc: A.J.Mechelynck; Vim Help list
Subject: RE: xhtml editing in vim

On Thu, 2 Nov 2006, Vu The Cuong wrote:

 As your advice,  I added :let g:do_xhtml_mappings = 1: into my vimrc 
 but it not worked.
 I also set :let g:html_tag_case = 'l' so that html tag become lower 
 case.
 How can I do? Please  help me. I need your help. Thanks in advance

Have you installed the latest version of the script?  Support for XHTML
was only added recently, so you need version 0.21 or later.

If you do have a recent enough version, are you setting the variable
before the script gets sourced?  (Did you restart vim after you put :let
g:do_xhtml_mappings = 1 in your vimrc?)

- Christian

-- 
 Too bad stupidity isn't painful.
Christian J. Robinson [EMAIL PROTECTED]
http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp



xhtml editing in vim

2006-11-01 Thread Vu The Cuong
I often use html script for editing html files.
(see: http://www.vim.org/scripts/script.php?script_id=453)
I prefer XHML compatible tags. (Ex: when press ;br, insteadof br, it will 
ouput  /br.
Can this script do that. If yes, could you guide me in detail?
If No, is there script to do that?
Thanks
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 02, 2006 10:02 AM
To: Gary Johnson
Cc: Vim Help list
Subject: Re: Command line tab completion

Gary Johnson [EMAIL PROTECTED] 写于 2006-11-02 09:26:41:

 I don't think that's the issue, as I understand it.  As another 
 example, if I type

 This has bothered me for some time--it just never rose above my 
 posting threshold until someone else brought it up first.

What is your 'completeopt' setting?

I do never have the problem like yours. If I type :help termi followed by 
tab, it complete things as I'd expected.


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




php online help in windowsXP

2006-10-02 Thread Vu The Cuong
I already read vim tip about online-refer to function of PHP.
http://www.vim.org/tips/tip.php?tip_id=598
It said: 
==
set keywordprg=a_script

What it does:
default, when you ar with the cursor on a WORD and press K (SHIFT+k) in
`command mode',
the vim will run 'man WORD'.
If you set keywordprg=a_script,  the  vim will run `a_script WORD'

So I have
set keywordprg=/home/marcel/php_doc
and php_doc looks like:
###
#!/usr/bin/bash
links http://www.php.net/$1
###
And now I have the online help 
==
This worked for me in FC5 and FreeBSD 6.1. How about WindowsXP
How can I refer PHP online function in WindowsXP.
Thanks in advanced



taglist

2006-09-29 Thread Vu The Cuong
Thanks, Yegappan Lakshmanan
Finally taglist worked. I reinstalled it from ports with version 5.6
Then in .vimrc, I put let Tlist_Ctags_Cmd='/usr/local/bin/exctags'
THanks

taglist plugin problem in freebsd 6.1
From: Vu The Cuong cuongvt at fsoft.com.vn
Subject: taglist plugin problem in freebsd 6.1
Newsgroups: gmane.editors.vim
Date: 2006-09-28 09:35:54 GMT

I'm using vim 7 with taglist and ctags on freebsd 6.1

I opened php file on gvim, typed :Tlist but it raised an error:
Taglist: Failed to generate tags for /usr/local/web/test.php
The system cannot find the path specified.

in .vimrc, I already put: let Tlist_Ctags_Cmd='/usr/bin/ctags'
but the above error still displayed.

Could anyone tell me how to solve this problem?
Thanks in advanced


Permalink | Reply |
headers
Yegappan Lakshmanan | 28 Sep 16:13
Picon
Re: taglist plugin problem in freebsd 6.1
From: Yegappan Lakshmanan yegappanl at gmail.com
Subject: Re: taglist plugin problem in freebsd 6.1
Newsgroups: gmane.editors.vim
Date: 2006-09-28 14:13:20 GMT

Hello,

On 9/28/06, Vu The Cuong cuongvt at fsoft.com.vn wrote:
 I'm using vim 7 with taglist and ctags on freebsd 6.1

 I opened php file on gvim, typed :Tlist but it raised an error:
 Taglist: Failed to generate tags for /usr/local/web/test.php
 The system cannot find the path specified.

 in .vimrc, I already put: let Tlist_Ctags_Cmd='/usr/bin/ctags'
 but the above error still displayed.

 Could anyone tell me how to solve this problem?


What is the output of the following command from the shell?

$ /usr/bin/ctags --version

You can try the steps mentioned in the taglist FAQ:

http://www.geocities.com/yegappan/taglist/faq.html

- Yegappan



taglist plugin problem in freebsd 6.1

2006-09-28 Thread Vu The Cuong
I'm using vim 7 with taglist and ctags on freebsd 6.1

I opened php file on gvim, typed :Tlist but it raised an error:
Taglist: Failed to generate tags for /usr/local/web/test.php
The system cannot find the path specified.

in .vimrc, I already put: let Tlist_Ctags_Cmd='/usr/bin/ctags'
but the above error still displayed.

Could anyone tell me how to solve this problem?
Thanks in advanced




php indent in vim7 not worked

2006-08-23 Thread Vu The Cuong
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 ?php then
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.


RE: nmap, scripts and UTF-8

2006-06-15 Thread Vu The Cuong
Hi all
How can I set the width of vim window more larger (not maximum)?
I only know that put something in vimrc file but I don't know exactly what need 
to be added to vimrc file.
Thanks
 

 -Original Message-
 From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 15, 2006 6:22 AM
 To: Jan Weytjens
 Cc: 'Vim mailing list'
 Subject: Re: nmap, scripts and UTF-8
 
 Jan Weytjens wrote:
  Hi Tony,
  Ah. That's bad. Vim 7.0 on W2K aren't you.
 
  What are the answers to:
 gvim -N -u NONE
 :set encoding?
  latin1
 :lang cty
  Current ctype language: C
 :echo char2nr('²')
  178
 :echo char2nr('µ')
  181
 
  and to
 gvim
 :verbose set enc? tenc?
  encoding = latin1
  termencoding = latin1
 Last set from c:\Program Files\Vim\_vimrc
 :set enc=latin1
 :map ²
 :map! ²
 :map µ
 :map! µ
  No mapping found
  (for all of them)
 :set enc=utf-8
  This gives the following error message:
 
  Error detected while processing EncodingChanged Auto 
 commands for *:
  E492: Not an editor command: SpecialMaps()
 
  I have included my _vimrc (adapted according to your suggestions)
 :map ²
 :map! ²
 :map µ
 :map! µ
  Best regards,
 
  Jan
 
  
 --
  --
 
  scriptencoding latin1
  set nocompatible
  source $VIMRUNTIME/vimrc_example.vim
  source $VIMRUNTIME/mswin.vim
  behave mswin
 
  set diffexpr=MyDiff()
  function MyDiff()
let opt = '-a --binary '
if diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
  if sh =~ '\cmd'
let cmd = '' . $VIMRUNTIME . '\diff'
let eq = ''
  else
let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff'
  endif
else
  let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 
 . '  ' . 
  arg3 . eq endfunction
 
   My stuff
  set dir=c:\tmp
  set expandtab
  set hls
  set nobackup
  set nowritebackup
  set number
  set printoptions=syntax:y
  set shiftwidth=2
  set tabstop=2
  set showtabline=2
 
  imap ! !--
 
  --ki
  nmap ! i!
 
  nmap F6 :buffersCR
  nmap F7 :bpCR
  nmap F8 :bnCR
 
   Replace tabs by 2 spaces
  nmap F11 :%s/\t/  /gCR
   Remove trailing white space
  nmap F12 :%s/\s\+$//CR
  nmap ² ~
  imap ² ~
  cmap ² ~
  nmap % :vsplitCR
 
   Move to beginning/end of function
  nmap M-{ mx bar ?^{
  imap M-{  mx bar ?^{
  nmap M-} mx bar /^}
  imap M-}  mx bar /^}
 
  let termencoding = encoding
 
  augroup cprog
   Remove all cprog autocommands
au!
 Set formatting of comments and set C-indenting on for 
 C, C++, CSS and Java files
 Switch it off for other files.
 (The line with * must come first)
autocmd FileType *  set formatoptions=tcql 
 nocindent comments
autocmd FileType c,cpp,css  set formatoptions=croql 
 cindent comments=sr:/*,mb:*,ex:*/,://
autocmd FileType java   set formatoptions=croql 
 cindent comments=sr:/*,mb:*,ex:*/,sr:/**,mb:*,ex:*/,://
autocmd FileType c,cpp,css,java,xml,xsd set nu
autocmd FileType c,cpp,css,xml,xsd set shiftwidth=2
autocmd FileType c,cpp,css,xml,xsd set tabstop=2
autocmd FileType c,cpp,css,xml,xsd set textwidth=80
autocmd FileType xml,xsd,wsdl set encoding=utf-8
autocmd FileType xml,xsd,wsdl set fileencoding=utf-8
autocmd FileType java   set shiftwidth=4
autocmd FileType java   set tabstop=4
  augroup END
 
  function! SpecialMaps()
silent! unmap  Char-178
silent! unmap! Char-178
exe 'noremap  Char-178 Char-126'
exe 'noremap! Char-178 Char-126'
  endfunction
  if has(autocmd)  version = 700
augroup vimrcmaps
  au! EncodingChanged * SpecialMaps()
augroup END
  endif
 
   Plugins
  let g:EnhCommentifyUseAltKeys = 'Yes'

 Oops! My bad. The autocommand should be
 
 au! EncodingChanged * call SpecialMaps()
 
 (I forgot the call verb.)
 
 Note: I am no professional Vim tech, just a plain user like 
 everyone on this list. Except when straying off-topic, please 
 use Reply to All 
 rather than Reply to Sender so that everyone has a chance 
 to reply if by any chance I don't, or if (like here) I goof.
 
 
 Best regards,
 Tony.
 
 


RE: html auto completion

2006-05-21 Thread Vu The Cuong
Thanks for the reply.
My system is WInXP.
  :so $VIMRUNTIME/mswin.vim
You mean I must put above line into my vimrc file?
 
Line in configuration scripts (it is remapping c-x required for
omni-completion).
I not understand clearly what you said.
I know I bother you, but could you tell me more indetail? Many thanks.
Suppose that I have test.html file.
I opened it and started to typing:
table
But right after I finished typing , vim did not auto close tag /table for 
me. 
I think Omni auto completion is something like that. Isn't it?
Thanks.

 

-Original Message- 
From: Mikolaj Machowski [mailto:[EMAIL PROTECTED] 
Sent: Sat 5/20/2006 8:40 PM 
To: vim@vim.org 
Cc: 
Subject: Re: html auto completion



Dnia sobota, 20 maja 2006 07:11, Vu The Cuong napisał:
 I'm new to vim and I tried a couple of hours to make html auto -
 completion feature to work.
 But had no result. Could anyone tell me how to config vim to turn on
 html auto - completion?

What system? If MS-Windows get rid of::

:so $VIMRUNTIME/mswin.vim

Line in configuration scripts (it is remapping c-x required for
omni-completion).

If it is no MS-Windows tell exactly what you are doing, error messages,
example of file.

m.





RE: html auto completion

2006-05-21 Thread Vu The Cuong
Dear Mechelynck

My vimrc file is as below:

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

Based on your advice, I will remove  source $VIMRUNTIME/mswin.vim. Is
it right?
But there is a line behave mswin. Do I must remove this line also?
I just carefully confirm only. Thank you.


-Original Message-
From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 21, 2006 5:19 PM
To: Vu The Cuong
Cc: Mikolaj Machowski; vim@vim.org
Subject: Re: html auto completion

Vu The Cuong wrote:
 Thanks for the reply.
 My system is WInXP.
   
  :so $VIMRUNTIME/mswin.vim
 
 You mean I must put above line into my vimrc file?
   
We mean you must make sure it _isn't_ there, because it interferes with
the Ctrl-X which is the first key for all omni-completion commands --
mswin.vim maps it to cut to clipboard.

You must also invoke filetype detection and filetype-specific plugins: 
to see if you've got them, enter :filetype without the quotes, the
answer should include Filetype detection=ON plugin=ON. Filetype indent
may be on or off. If it isn't set, add filetype plugin on or filetype
plugin indent on to your vimrc.
  
   
 Line in configuration scripts (it is remapping c-x required for 
 omni-completion).
 
 I not understand clearly what you said.
 I know I bother you, but could you tell me more indetail? Many thanks.
 Suppose that I have test.html file.
 I opened it and started to typing:
 table
 But right after I finished typing , vim did not auto close tag
/table for me. 
 I think Omni auto completion is something like that. Isn't it?
 Thanks.

 [...]
   
No.

Type tabletrtdbla1

Then type / followed by Ctrl-X Ctrl-O. Vim should complete it to /td.

Do it again, you should get /tr, do it again for /table and so on
until you get to /html after which there's nothing more you can
complete.

Depending on where the cursor is when you invoke omni-completion, you
may get possible tags, or (inside a tag) possible attributes, or after
attribute-name and equal sign possible values (if they are finite in
number, e.g., left/right/center/justify at div align=  ), etc.

See
:help compl-omni
:help i_CTRL-X_CTRL-O
:help ft-html-omni
etc.
   


Best regards,
Tony.



html auto completion

2006-05-19 Thread Vu The Cuong
I'm new to vim and I tried a couple of hours to make html auto -
completion feature to work.
But had no result. Could anyone tell me how to config vim to turn on
html auto - completion?
BR