Re: HTML editing with vim: where to start ?

2006-05-19 Thread Mikolaj Machowski
 my guess is :source $VIMRUNTIME/mswin.vim -- the script that cripples
 Vim in a not-very-successful attempt to make it more Windows-like. WTF,
 if you want a Windows-like editor, don't use Vim, use Notepad! IMHO
 mswin.vim is better done without.

Hey, it is not *that* bad :)

m.



Re: HTML editing with vim: where to start ?

2006-05-19 Thread A.J.Mechelynck

Mikolaj Machowski wrote:

my guess is :source $VIMRUNTIME/mswin.vim -- the script that cripples
Vim in a not-very-successful attempt to make it more Windows-like. WTF,
if you want a Windows-like editor, don't use Vim, use Notepad! IMHO
mswin.vim is better done without.



Hey, it is not *that* bad :)

m.



  
Maybe I overreacted. OK, let's amend it: if you want a Windows-like 
editor, don't use Vim, use WordPad (in plaintext mode). I still won't 
recommend mswin.vim to anybody.



Best regards,
Tony.


Re: HTML editing with vim: where to start ?

2006-05-19 Thread George Reilly
A.J.Mechelynck [EMAIL PROTECTED] wrote:
 Mikolaj Machowski wrote:
  my guess is :source $VIMRUNTIME/mswin.vim -- the script that cripples
  Vim in a not-very-successful attempt to make it more Windows-like. WTF,
  if you want a Windows-like editor, don't use Vim, use Notepad! IMHO
  mswin.vim is better done without.
 
 
  Hey, it is not *that* bad :)

 Maybe I overreacted. OK, let's amend it: if you want a Windows-like editor, 
 don't use Vim, use WordPad (in plaintext mode). I still won't recommend 
 mswin.vim to anybody.

My preferred Notepad replacement is Notepad++
  http://notepad-plus.sourceforge.net/uk/site.htm
Syntax highlighting, a tabbed interface, handles Unix (LF-separated) files, 
lightweight, etc.

It's not Vim, but it's a good fallback when dealing with people who don't want 
to learn Vim.
-- 
/George V. Reilly  mailto:[EMAIL PROTECTED]
http://www.georgevreilly.com/blog/



Re: HTML editing with vim: where to start ?

2006-05-19 Thread Vinay Doma

A.J.Mechelynck wrote:
Maybe I overreacted. OK, let's amend it: if you want a Windows-like
editor, don't use Vim, use WordPad (in plaintext mode). I still won't
recommend mswin.vim to anybody.


But what about mswin.vim don't you like? All it has is a bunch of
windows friendly mappings (Cut, Copy, Paste, Select All, Redo, Undo,
etc). Looks pretty harmless to me. And you could always modify them to
suit your need.

vdoma


Re: HTML editing with vim: where to start ?

2006-05-19 Thread A.J.Mechelynck

Vinay Doma wrote:

A.J.Mechelynck wrote:
Maybe I overreacted. OK, let's amend it: if you want a Windows-like
editor, don't use Vim, use WordPad (in plaintext mode). I still won't
recommend mswin.vim to anybody.


But what about mswin.vim don't you like? All it has is a bunch of
windows friendly mappings (Cut, Copy, Paste, Select All, Redo, Undo,
etc). Looks pretty harmless to me. And you could always modify them to
suit your need.

vdoma



What I don't like about it is that it interferes with standard Vim 
normal-mode commands, making Vim less Vim-like, and, in some cases, 
making some commands totally unavailable without unneeded extra work 
(such as creating noremaps for them and running the risk of hiding still 
other commands). One case in point is that of Ctrl-X which you (or 
someone else in this thread) noticed; there are others: almost every 
Ctrl-letter keystroke has a meaning in Vim; making them Windows-like 
hides the proper Vim command. There are Vim commands for everything 
you mentioned, and (IMO) those windows-like commands just stand in the 
way of learning the more versatile native Vim commands (for Cut: x = 
cut letter, dd = cut line, daw = cut word, [Visual]d = cut visual 
selection, etc.; prefix by + to place them into the clipboard. Select 
All is ggVG which breaks down as gg = go to top, V = start linewise 
visual, G = go to bottom. Undo is u, Redo is Ctrl-R [not r which is 
replace], And so on.)


In the years I've been on this list, I don't count the number of times 
when newbies have come asking, in essence, Why doesn't Vim behave as 
advertised? and mswin.vim (which they unknowingly were sourcing in 
their vimrc) was the reason.



Best regards,
Tony.


Re: HTML editing with vim: where to start ?

2006-05-19 Thread Tim Chase

In the years I've been on this list, I don't count the number
of times when newbies have come asking, in essence, Why
doesn't Vim behave as advertised? and mswin.vim (which they
unknowingly were sourcing in their vimrc) was the reason.


Or the converse, where someone will ask Why does vim behave
differently on Linux/Mac/whatever than it does on my Windows box
that I've been using for a long time?.  Plenty of those come
through on the list too :)

Maybe mswin.vim should create a menu option called make vim 
behave like it should, not like a Windows app that opens all 
available vimrc files and nukes/comments any references to mswin ;)


-tim (who also can't count the number of times mswin.vim has been 
involved in the answer to a post on the list)











Re: HTML editing with vim: where to start ?

2006-05-19 Thread Robert Hicks

A.J.Mechelynck wrote:

Vinay Doma wrote:

A.J.Mechelynck wrote:
Maybe I overreacted. OK, let's amend it: if you want a Windows-like
editor, don't use Vim, use WordPad (in plaintext mode). I still won't
recommend mswin.vim to anybody.


But what about mswin.vim don't you like? All it has is a bunch of
windows friendly mappings (Cut, Copy, Paste, Select All, Redo, Undo,
etc). Looks pretty harmless to me. And you could always modify them to
suit your need.

vdoma



What I don't like about it is that it interferes with standard Vim 
normal-mode commands, making Vim less Vim-like, and, in some cases, 
making some commands totally unavailable without unneeded extra work 
(such as creating noremaps for them and running the risk of hiding still 
other commands). One case in point is that of Ctrl-X which you (or 
someone else in this thread) noticed; there are others: almost every 
Ctrl-letter keystroke has a meaning in Vim; making them Windows-like 
hides the proper Vim command. There are Vim commands for everything 
you mentioned, and (IMO) those windows-like commands just stand in the 
way of learning the more versatile native Vim commands (for Cut: x = 
cut letter, dd = cut line, daw = cut word, [Visual]d = cut visual 
selection, etc.; prefix by + to place them into the clipboard. Select 
All is ggVG which breaks down as gg = go to top, V = start linewise 
visual, G = go to bottom. Undo is u, Redo is Ctrl-R [not r which is 
replace], And so on.)


In the years I've been on this list, I don't count the number of times 
when newbies have come asking, in essence, Why doesn't Vim behave as 
advertised? and mswin.vim (which they unknowingly were sourcing in 
their vimrc) was the reason.



Best regards,
Tony.

I never thought of that. I just started learning Vim on Windows because 
I was doing vi on HP/UX (now Vim7). I realize the handicap that 
mswin.vim gave me. I have commented it out for now to see if I can cut 
it, since my goal was to learn one editor on all the platform I am on 
(Windows, OSX, HP/UX).


Robert



Re: HTML editing with vim: where to start ?

2006-05-18 Thread Mikolaj Machowski
Dnia czwartek, 18 maja 2006 03:49, David Fishburn napisał:

 Since Ivan mentioned he is using PHP with his HTML, closetag will be
 very useful for him.

PHP/HTML/XML omni-completion mixes *extremely* well :)

m.



Re: HTML editing with vim: where to start ?

2006-05-18 Thread Mikolaj Machowski
Dnia środa, 17 maja 2006 22:27, Ivan Vecerina napisał:
 Mikolaj Machowski [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]

 : Dnia wtorek, 16 maja 2006 14:17, Ivan Vecerina napisał:
 :   - get vim to automatically close/complete the innermost previously
 :  opened tag.
 :
 : What do you mean automatically?. You can do:
 :
 : inoremap / /c-xc-o

 That's a great step forward, and I was able to make this work in a .html
 file.
 But it would not work in a PHP file

Works for me.

 Where can I find documentation for this feature (seems to be part of the
 vim70 new enhancements), with which help keyword/tag ?

:help ft-html-omni
:help ft-php-omni
:help ft-css-omni
:help ft-javascript-omni

 [ I would never have fould this by chance, c-x does cut by default on
 my install... ]

:behave mswin?

 How do I do an s/.../.../ on the current visual block?
 [ I guess I can find out, but maybe you could answer this by the way ]

For operation on visual blocks you need special plugins. Don't remember
names (never need them).

m.



Re: HTML editing with vim: where to start ?

2006-05-18 Thread A.J.Mechelynck

Mikolaj Machowski wrote:

Dnia środa, 17 maja 2006 22:27, Ivan Vecerina napisał:
  

Mikolaj Machowski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]



[...]

[ I would never have fould this by chance, c-x does cut by default on
my install... ]



:behave mswin?
  

[...]

my guess is :source $VIMRUNTIME/mswin.vim -- the script that cripples 
Vim in a not-very-successful attempt to make it more Windows-like. WTF, 
if you want a Windows-like editor, don't use Vim, use Notepad! IMHO 
mswin.vim is better done without.



Best regards,
Tony.


Re: HTML editing with vim: where to start ?

2006-05-17 Thread John Love-Jensen
Hi Ivan,

 The FAQ contains some obscure information that goes beyond your average
 Vim cheat sheet.

For the aforementioned average Vim cheat sheet...

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

--Eljay



Re: HTML editing with vim: where to start ?

2006-05-17 Thread Mikolaj Machowski
Dnia wtorek, 16 maja 2006 14:17, Ivan Vecerina napisał:
  - get vim to automatically close/complete the innermost previously
 opened tag.

What do you mean automatically?. You can do:

inoremap / /c-xc-o

 Other things I don't know how to find is: how do I make sure that VIM
 finds the CSS associated with the document I am editing (to help with
 auto-completion)?

It should work automatically.

 What are other tricks I should know for HTML-style document editing, and
 where can I learn them?

Useful new feature for HTML-edition is of course omni-completion but
also new text-objects:

:help at
:help it

m.



Re: HTML editing with vim: where to start ?

2006-05-17 Thread Mikolaj Machowski
Dnia wtorek, 16 maja 2006 18:37, A.J.Mechelynck napisał:
 Ivan Vecerina wrote:
 [...]

  For example, here are a few simple things I need to do all the time:
  [...]
   - get vim to automatically close/complete the innermost previously
  opened tag.

 [...]

 see the closeag.vim plugin,
 http://vim.sourceforge.net/scripts/script.php?script_id=13

For base needs this is not needed. Closetag is now part of completion
scripts for HTML.

m.



Re: HTML editing with vim: where to start ?

2006-05-17 Thread Ivan Vecerina
Gerald Lai [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
: On Tue, 16 May 2006, Ivan Vecerina wrote:

: You could read Bram Moolenaar's
: Seven Habits of Effective Text Editing at:
:   http://www.moolenaar.net/habits.html
A very good read indeed.

: I think using matchit is one of the fastest ways to delete block-like
: items, including start and end tags.
:   http://www.vim.org/scripts/script.php?script_id=39
matchit seems like a must-install, too bad it's not activated
by default.  And it is not mentioned in the vimbook or the FAQs
I read so far (maybe because they were pre-vim6).

This was a great pointer - thanks.


: In order to obtain more support for operations involving HTML tags, you
: could search in
:
:   http://www.vim.org/scripts/index.php
...
:   http://www.vim.org/tips/index.php
:
: to get a feel of what other users want and have made out of Vim.
: Also, stay on this mailing list and you will learn a lot.

Yes. Problem with those resources is that they include a lot of
noise, and are not up-to-date when it comes to vim7 - which seems
to have introduced some useful improvements, as pointed out in
Mikolaj's replies.

Many thanks,
Ivan
-- 
http://ivan.vecerina.com/contact/?subject=NG_POST - email contact form





RE: HTML editing with vim: where to start ?

2006-05-17 Thread David Fishburn
 

 -Original Message-
 From: Mikolaj Machowski [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 17, 2006 6:57 AM
 To: vim@vim.org
 Subject: Re: HTML editing with vim: where to start ?
 
 Dnia wtorek, 16 maja 2006 18:37, A.J.Mechelynck napisał:
  Ivan Vecerina wrote:
  [...]
 
   For example, here are a few simple things I need to do 
 all the time:
   [...]
- get vim to automatically close/complete the innermost 
 previously 
   opened tag.
 
  [...]
 
  see the closeag.vim plugin,
  http://vim.sourceforge.net/scripts/script.php?script_id=13
 
 For base needs this is not needed. Closetag is now part of 
 completion scripts for HTML.


Since Ivan mentioned he is using PHP with his HTML, closetag will be very
useful for him.

I keep the following in my vimrc:

 CloseTag options:
 http://vim.sourceforge.net/script.php?script_id=13
 closetag.vim
 Functions and mappings to close open HTML/XML tags
 This uses C-_ to close an open tag above
if filereadable(expand('$VIM/vimfiles/scripts/closetag.vim')) 
let g:closetag_html_style=1
autocmd Filetype html,xml,xsl,sql,ant,sqlunit,mhtml,php source
$VIM/vimfiles/scripts/closetag.vim 
endif

HTH,
Dave