Is there a xml formatter?

2007-05-29 Thread wangxu
I want to have this function:
formatting my xml file automatically.
or,indent xml element and attributes.

is there any plugin like this?
thanks!



Re: how to replace ESC to some other key?

2007-04-10 Thread wangxu
That's a very good tip: )
I also wanna know how to insert a Tab when I editing files like
/etc/hosts?
Can I?

[EMAIL PROTECTED] wrote:
 wangxu [EMAIL PROTECTED] 写于 2007-04-05 21:08:43:
   
 but in this situation,is there any way to auto-indent *.py?

 

   is decrease indent (hold on Shift, then '' twice)
   is increase indent
 You can use  or  command in Normal mode and Visual mode. which is as
 good as, if no better than, the tab key.

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



Re: how to replace ESC to some other key?

2007-04-04 Thread wangxu
but in this situation,is there any way to auto-indent *.py?


[EMAIL PROTECTED] wrote:
 Yakov Lerner [EMAIL PROTECTED] 写于 2007-04-04 22:22:43:
   
 On 4/4/07, wangxu [EMAIL PROTECTED] wrote:
 
 ESC is so far from the center of the keyboard.
 Can I replace this key to Caps Lock,for example?
   
 I heard some people use Tab as a substitute for Esc. Weird.
 But it's easier to do in platform-independent way.

 Yakov
 

 It's not weird IMO, Tab key is rarely required inside Vim, thanks to the
 powerful auto-indent feature of Vim (you don't need the tab key even when
 editing Makefile!), I never feel a need to use Tab key in vim during the
 last 3 years.

 Personaly, I think it is easier to train my fingers to reach the
 so-called-far-away-ESC-key. (Imagine that the piano players often need to
 reach keys in the piano much farther than ESC, and they do that precisely.)

 --
 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-03 Thread wangxu

Sure: )I will remeber that next time I post something.
I'v solved the problem. 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 All: )

A.J.Mechelynck wrote:

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.

[...]

The :scriptnames command will list all scripts that have been 
sourced so far in the current Vim session. They are listed in the 
order of first sourcing. When editing your vimrc, the list should 
include:

- the vimrc near the top;
- $VIMRUNTIME/syntax/vim.vim somewhere lower down. The $VIMRUNTIME 
variable will be resolved; on your system, I expect its value to be 
/usr/share/vim/vim70


/etc/vim/vimrc is a strange location for a system vimrc. If the above 
shows that is wasn't sourced, try putting it at /usr/share/vim/vimrc 
-- if you don't want to move the Debian vimrc you can use a soft link:


cd /usr/share/vim
ln -vs /etc/vim/vimrc


Oh, and next time you post a :version listing on the list, please 
first do :language messages C (on Unix). I know just enough Chinese 
to understand that 大 on the fourth line means big, so I can guess 
that that fourth line probably means Big version with GTK2 GUI. 
Features included (+) or not (-): but the average subscriber to this 
list cannot even be assumed to know any Chinese at all.



Best regards,
Tony.




how to replace ESC to some other key?

2007-04-03 Thread wangxu
ESC is so far from the center of the keyboard.
Can I replace this key to Caps Lock,for example?
Thanks.


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 Esc:let current_reg = @CRgvdiC-R=current_regCREsc


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 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 Esc:let current_reg = @CRgvdiC-R=current_regCREsc


 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 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 Esc:let current_reg = @CRgvdiC-R=current_regCREsc


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