Vu The Cuong wrote:
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 <ENTER><ENTER> 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+=5<CR>
:map <S-F9> :set lines-=5<CR>
:map <C-F9> :set lines=60<CR>
:map <M-F9> :set lines=30<CR>
:map <F8> :set columns+=10<CR>
:map <S-F8> :set columns-=10<CR>
:map <C-F8> :set columns=132<CR>
:map <M-F8> :set columns=80<CR>
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> :tabprevious<cr>
:nmap <C-tab> :tabnext<cr>
:map <C-S-tab> :tabprevious<cr>
:map <C-tab> :tabnext<cr>
:imap <C-S-tab> <ESC>:tabprevious<cr>i
:imap <C-tab> <ESC>:tabnext<cr>i
:nmap <C-t> :tabnew<cr>
:imap <C-t> <ESC>:tabnew<cr>
:nmap <C-S-w> :tabclose<cr>
:nmap <C-A-tab> :tabfirst<cr>
:nmap <S-tab> :tablast<cr>
: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.
Check the code of the script for buffer-local mappings. If the code which
creates the mappings for unpaired tags (such as <meta /> <br /> <hr /> etc.
which are never allowed to have a closing tag, but not <p> <li> etc. which, in
xhtml-compatible code, must be written as <p>...</p>, <li>...</li> etc.)
doesn't end in /> when b:do_xhtml_mappings is on, then you'll have to discuss
with the script maintainer how to add a closing slash at the end of unpaired
XHTML tags.
Best regards,
Tony.