pasting html to vim resulted in additional tags

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

pasting html to vim resulted in additional tags

Peng Yu
Hi,

<html>
  <body></body>
</html>

If I paste the above code to vim (with command+p) on my mac, I get an
extra line on the bottom. It seems that vim tries to matches the tags
<html> and <body> without recognizing that they are already matched.

</body></html>

However, the gvim doesn't have the problem and it doesn't
automatically indent the text that I input at all. I think that the
difference must be in the compilation enabled options. But I can not
tell which one cause the problem. Could anybody take a look and let me
know if which option cause the problem?

/tmp$ vim  --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 22 2011 11:07:02)
MacOS X (unix) version
Included patches: 1-244, 246-353
Compiled by [hidden email]
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset
+cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
-conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff
+digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi
+file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input
+iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak
+lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -
mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm -mouse_urxvt +multi_byte +multi_lang -mzscheme
+netbeans_intg
+path_extra -perl +persistent_undo +postscript +printer -profile
+python
-python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs
+smartindent
-sniff +startuptime +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
 -xterm_clipboard -xterm_save
   system vimrc file: "/opt/local/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/opt/local/share/vim"
Compilation: /usr/bin/gcc-4.2 -c -I. -Iproto -DHAVE_CONFIG_H   -I/opt/
local/include -DMACOS_X_UNIX -no-cpp-precomp  -pipe -O2 -arch x86_64 -
D_FORTIFY_SOURCE=1
Linking: /usr/bin/gcc-4.2   -L/opt/local/lib -arch x86_64 -L/usr/local/
lib -o vim       -lm  -lncurses -liconv -lintl -framework Cocoa     -L/
opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/config -lpython2.7 -framework CoreFoundation -u
_PyMac_Error /opt/local/Library/Frameworks/Python.framework/Versions/
2.7/Python


/tmp$ gvim  --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 27 2011 12:15:32)
MacOS X (unix) version
Included patches: 1-237
Compiled by Bjorn Winckler <[hidden email]>
Huge version with MacVim GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui
+diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search
+farsi
+file_in_path +find_in_path +float +folding -footer +fork()
+fullscreen
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap
+langmap
+libcall +linebreak +lispindent +listcmds +localmap -lua +menu
+mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm
+mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -
mzscheme
+netbeans_intg +odbeditor +path_extra +perl +persistent_undo
+postscript
+printer +profile +python -python3 +quickfix +reltime +rightleft
+ruby
+scrollbind +signs +smartindent -sniff +startuptime +statusline -
sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse
 +textobjects +title +toolbar +transparency +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore
+wildmenu
+windows +writebackup -X11 -xfontset +xim -xsmp -xterm_clipboard -
xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/
vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -
Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX -no-cpp-precomp  -g -
O2 -arch i386 -arch x86_64 -D_FORTIFY_SOURCE=1
Linking: gcc   -L.    -L.         -arch i386 -arch x86_64 -L/usr/local/
lib -o Vim -framework Cocoa -framework Carbon      -lncurses  -liconv -
framework Cocoa    -L/usr/local/lib  -L/System/Library/Perl/5.10.0/
darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework
Python   -framework Ruby

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: pasting html to vim resulted in additional tags

Tony Mechelynck
On 25/12/11 18:27, Peng Yu wrote:

> Hi,
>
> <html>
>    <body></body>
> </html>
>
> If I paste the above code to vim (with command+p) on my mac, I get an
> extra line on the bottom. It seems that vim tries to matches the tags
> <html>  and<body>  without recognizing that they are already matched.
>
> </body></html>
>
> However, the gvim doesn't have the problem and it doesn't
> automatically indent the text that I input at all. I think that the
> difference must be in the compilation enabled options. But I can not
> tell which one cause the problem. Could anybody take a look and let me
> know if which option cause the problem?
>
> /tmp$ vim  --version
> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 22 2011 11:07:02)
> MacOS X (unix) version
> Included patches: 1-244, 246-353
> Compiled by [hidden email]
> Normal version without GUI.  Features included (+) or not (-):
[...]

Pasting within Vim (via some internal register, probably the default ""
register) or pasting from outside (via the clipboard)?

N.B. Compiled with +clipboard -X11 -xterm_clipboard


Best regards,
Tony.
--
"Not only is God dead, but just try to find a plumber on weekends."
                -- Woody Allen

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: pasting html to vim resulted in additional tags

Tony Mechelynck
On 26/12/11 04:14, Tony Mechelynck wrote:

> On 25/12/11 18:27, Peng Yu wrote:
>> Hi,
>>
>> <html>
>> <body></body>
>> </html>
>>
>> If I paste the above code to vim (with command+p) on my mac, I get an
>> extra line on the bottom. It seems that vim tries to matches the tags
>> <html> and<body> without recognizing that they are already matched.
>>
>> </body></html>
>>
>> However, the gvim doesn't have the problem and it doesn't
>> automatically indent the text that I input at all. I think that the
>> difference must be in the compilation enabled options. But I can not
>> tell which one cause the problem. Could anybody take a look and let me
>> know if which option cause the problem?
>>
>> /tmp$ vim --version
>> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 22 2011 11:07:02)
>> MacOS X (unix) version
>> Included patches: 1-244, 246-353
>> Compiled by [hidden email]
>> Normal version without GUI. Features included (+) or not (-):
> [...]
>
> Pasting within Vim (via some internal register, probably the default ""
> register) or pasting from outside (via the clipboard)?
>
> N.B. Compiled with +clipboard -X11 -xterm_clipboard

P.S. See also:
        :help 'paste'
        :help 'pastetoggle'

In gvim, these options are usually unneeded because gvim (or macvim
which is a gvim "flavour") usually knows if you're pasting when running
as a GUI.

>
>
> Best regards,
> Tony.
--
Q:  How many existentialists does it take to screw in a lightbulb?
A:  Two.  One to screw it in and one to observe how the lightbulb
     itself symbolizes a single incandescent beacon of subjective
     reality in a netherworld of endless absurdity reaching out toward a
     maudlin cosmos of nothingness.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: pasting html to vim resulted in additional tags

Peng Yu
In reply to this post by Tony Mechelynck
> Pasting within Vim (via some internal register, probably the default ""
> register) or pasting from outside (via the clipboard)?

I use command+v in mac to paste. I assume this means the second way.

> N.B. Compiled with +clipboard -X11 -xterm_clipboard

What does N.B. stands for?

--
Regards,
Peng

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: pasting html to vim resulted in additional tags

Tim Chase
On 12/26/11 11:04, Peng Yu wrote:
>> N.B. Compiled with +clipboard -X11 -xterm_clipboard
>
> What does N.B. stands for?

Latin for "Nota Bene", meaning "note well" or "worth noting".

-tim




--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: pasting html to vim resulted in additional tags

Tony Mechelynck
In reply to this post by Peng Yu
On 26/12/11 18:04, Peng Yu wrote:
>> Pasting within Vim (via some internal register, probably the default ""
>> register) or pasting from outside (via the clipboard)?
>
> I use command+v in mac to paste. I assume this means the second way.

See if the 'paste' option can help you.

>
>> N.B. Compiled with +clipboard -X11 -xterm_clipboard
>
> What does N.B. stands for?
>

As Tim said, it's a Latin abbreviation, still in common use in English
and French (and probably other European languages too). "nota bene", wfw
"note well", hence "Note:", etc.

Best regards,
Tony.
--
"He could be a poster child for retroactive birth control."

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php