Re: vim not opening directories

2007-06-05 Thread Peter Palm
Op dinsdag 5 juni 2007, schreef Reid Thompson:
 currently running vim 7.1.2 svn.
 In the past when invoking vim on a directory, it would open the
 directory and list the contents, my current build is not doing this. 
 It returns the message
   src is a directory
 instead.  Can someone point me to what I've mis-configured?

You are probably running vim in 'compatible' mode.

Try
:set nocompatible

to disable this behaviour, or create a ~/.vimrc file (if this file even 
exists, vim defaults to nocompatible)

And maybe start vim as 'vim' instead of 'vi' helps too.


Regards,


Peter Palm


Re: vim not opening directories

2007-06-05 Thread Peter Palm
Op dinsdag 5 juni 2007, schreef Reid Thompson:
 I have a .vimrc.
 it has
  Use Vim settings, rather then Vi settings (much better!).
  This must be first, because it changes other options as a
 side effect.
 set nocompatible

 I've already tried invoking via
 [EMAIL PROTECTED]:~$ /usr/bin/vim src
 [EMAIL PROTECTED]:~$ /usr/bin/gvim src


Well, the problem is vim can't find the netrwPlugin.vim file.

What is the output of
:echo $VIMRUNTIME
?


Peter


Re: good keys for mappings

2007-05-31 Thread Peter Palm
Op donderdag 31 mei 2007, schreef Arn:
 Hi,

 Any suggestions on keys/key combos that are good candidates for
 custom mappings etc?

 Maybe a dumb question but I hate having to unlearn something, I'd
 like to create a fair number of mappings that use a consistent
 convention and won't conflict with anything existing.  I think Bram
 mentioned he's found prefixing with _ works well..

Well, there's a special key, the so called 'mapleader', you can use to 
define your mappings. If you don't set it, it defaults to '\'. You can 
change the value of the mapleader to '_' to 'test' your mapping with 
the '_' prefix, or change it to something else, without changing the 
definition of the map.

See
:help mapleader

for more info.

Oh, and personally, I just keep it set to the default.


Peter


Re: Is there a xml formatter?

2007-05-30 Thread Peter Palm
Op woensdag 30 mei 2007, schreef 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!

Well, if you're on a unix machine with xmllint installed, you could do 
the following:

setlocal equalprg=xmllint\ --format\ -

and then use gg=G to reformat the entire document.


Peter Palm


Re: Why bottom-posting is prefered on Vim Mainling List?

2007-05-29 Thread Peter Palm
Op dinsdag 29 mei 2007, schreef Gene Kwiecinski:

 Write top-post or bottom-post makes no difference for me, the
  problem

 is

 that I found bottom-post is harder to read since I will have to skim

 all

 original messages before I could read the actual reply.

 Again, it's a lack of editing (ie, laziness) that creates this
 problem, *NOT* bottom-quoting in general.

Since you yourself are too lazy to fix your own quoted text, may i 
suggest
http://home.in.tum.de/~jain/software/outlook-quotefix/ ?

(other people using Outlook Express can use
http://home.in.tum.de/~jain/software/oe-quotefix/)


The above text, broken (even more broken) by my client (which was 
expected), should've looked more like:

quote
Write top-post or bottom-post makes no difference for me, the problem
is that I found bottom-post is harder to read since I will have to skim 
all original messages before I could read the actual reply.

Again, it's a lack of editing (ie, laziness) that creates this
problem, *NOT* bottom-quoting in general.
/quote


Peter Palm


Re: Why bottom-posting is prefered on Vim Mainling List?

2007-05-29 Thread Peter Palm
Op Tuesday 29 May 2007 19:33:37 schreef Gene Kwiecinski:

 Want me to show you an actual screencap of my reply as it went out from
 here?

Sure, take a look at:

http://watmoetikjenogeenkeeruitleggen.nl/Vim-Quoting/quoting-kmail.png

http://watmoetikjenogeenkeeruitleggen.nl/Vim-Quoting/quoting-mutt.png

http://watmoetikjenogeenkeeruitleggen.nl/Vim-Quoting/quoting-source.png


Peter Palm


Re: A performance question

2007-05-23 Thread Peter Palm
Op woensdag 23 mei 2007, schreef fREW:
 Another thing that might help with speed that was mentioned a month
 or so ago is the following script specifically aimed at increasing
 speed for large files:
 http://www.vim.org/scripts/script.php?script_id=1506.

Indeed, among other things, this disables the swap file for 'large' 
files, which should really speed up things.


Peter



Re: weird defaults in Feisty

2007-05-22 Thread Peter Palm
Op dinsdag 22 mei 2007, schreef fREW:

 I figured it out and if anyone else has this problem I am sending out
 the solution.  Basically when I run vi it is running vim.tiny.
 vim.tiny sources /etc/vim/vimrc.tiny, not /etc/vim/vimrc, also,
 vim.tiny is pretty crippled, in that it doesn't even have syntax
 highlighting, so consider whether that's even what you want.


Actually, if I run vi (not vim), I definitely don't want 
a 'full-featured' vim (modeline exploits etc), and expect vim to run 
in 'compatible mode' (or whatever vi implementation is the default on 
my system). (my shell config aliases vi to vim, if it's available, but 
only as a normal user)

Setting the defaults in /etc/vim/vimrc is, in my opinion, not 'the right 
way', it's what ~/.vimrc is for.

And, just out of curiosity, does vim.tiny parse ~/.vimrc, or does it 
(only?) look at ~/.vimrc.tiny as well?


Regards,


Peter Palm


Re: ...to shoot into oneelse feet...

2007-05-01 Thread Peter Palm
Op maandag 30 april 2007, schreef [EMAIL PROTECTED]:
  HmmmESC kills everything between # and $...
  u would undo it...but this like do the wrong thing
  and repair it afterwards.

  What I want is to prevent doing wrong things by aborting
  them,..not to do them and saying ooops sorry...my fault
  afterwards and starting repairing the desaster then... :)

  Sohow can I _abort_ this ?

As far as I know, you can't abort it. But as you dont use the 'black 
hole' register, you could just re-insert the text you wanted to change 
by typing:
Ctrl-R

Not the best solution, probably (don't type cfn if you don't want to 
change the text :) )


Peter


Re: join all lines inside pattern that occurs more than once

2007-04-26 Thread Peter Palm
Op donderdag 26 april 2007, schreef Nikolaos A. Patsopoulos:
 Hi,

Hi

 I want to join all lines that are inside a given pattern and occurs
 more than once  in the text, ie:

 
 PatternStart 
 text1
 text2
 ...text3
 ..text4
 PatternEnd
 ...
 ...


 PatternStart 
 text1
 text2
 ...text3
 ..text4
 ...
 ...textn
 PatternEnd
 


 ...
 PatternStart text1text2...text3..text4PatternEnd
 
 

 PatternStart text1text2...text3..text4...   
 ...textnPatternEnd 

 I tried to use:
 :g/PatternStart\_.\{-}PatternEnd/ J

How about:

:g/PatternStart/,/PatternEnd/j


Peter


Re: problem with shifting block

2007-04-13 Thread Peter Palm
Op vrijdag 13 april 2007, schreef shawn bright:
 lo there,

Hi

 i am using visual mode and shift  to indent a block of code.
 the problem i am having is that once i do this, the visual mode is
 gone. So, i have to re-select everything and do it again. Is there a
 command to repeat the last shift ?

Sure, just use '.'

 or better yet, is there a better way to shift code right and left ? i
 develop in python, which is white-space sensitive, so this is a
 rather big deal for me to get right.

   or  in visual mode shifts right
   or  in visual mode shifts left

And, by the way, you can re-select your previous visual selection 
with 'gv'


Peter


Re: Strange behaviour of C-X and C-A

2006-10-11 Thread Peter Palm
Op woensdag 11 oktober 2006 11:46, schreef Marius Roets:
 Hi everybody,

 I'm using Vim 7.0.94 on Linux. I use C-A and C-X from time to time to
 increment/decrement numbers. However when there is a leading zero I
 get very strange behaviour with both.
 Example:
 01
 02
 03
 04
 05
 06
 07
 08
 09
 10
 11

 :nmap F7 C-Xj

 I position the cursor on 01 and press F7, this works fine up to 08.
 For 08, 09 and 10, the leading zero dissapears.

  :nmap F7 C-Aj

 Use the same unmodified list.
 This is even weirder. 07 becomes 010, 08 becomes 9, and the rest
 seems ok.

That's because vim knows about octal numbers (base 8 instead of 10). 
Octal numbers normally start with a 0.

 Do others see the same behaviour. What am I missing?

No I don't, I don't like this behaviour as well, so I've put the 
following in my .vimrc:

set nrformats-=octal


Peter


Question about client-server in combination with ssh and netrw

2006-08-24 Thread Peter Palm
Hi all,

I've got a few questions about client-server.

I want to ssh to another machine, and then tell my local (desktop) vim 
to open a file on the remote machine.

Using

vim --remote scp://$HOST/$PWD/.vimrc

results in

E344: Cannot find directory /extra1/home/peterp in cdpath

Which leads me to think using a combination of netrw and --remote don't 
work.

Has anyone ever tried something like this, and succeeded?


Peter Palm


Re: Editing an html file with vi

2006-06-21 Thread Peter Palm
Op maandag 19 juni 2006 19:03, schreef Adnan Ali:
 --- Peter Palm [EMAIL PROTECTED] wrote:
  Op maandag 19 juni 2006 17:04, schreef Adnan Ali:
  What is the output of:
  :version
 
  ?

 It's weird too. It says it is elvis. That's how I
 found what vi was pointing to. I hope you don't snub
 me for that. I did acknowledge that I was not an
 advanced user!

Sure, no problem.

  Vim's commandset is a superset of vi's, and since
  you're asking a
  question on the vim mailinglist, I suppose you mean
  the 'vim
  interface'.

 When vi points to vim, can we call this an interface
 to vim? that's what I meant! I regret my poor
 and improper usage of the English language!

The original vi was not freely distributable, so different 
implementations of vi were programmed by various people, and many 
distributions use one of these alternatives as the 'default vi 
implementation'. All these implementations provide the basic vi 
functions, using the same keystrokes.

 Many thanks for your reply! I almost solved the
 problem by pointing vi to vim.

Good luck, and I hope you'll like our favourite vi-implementation :)


Regards,

Peter Palm


Re: Editing an html file with vi

2006-06-19 Thread Peter Palm
Op maandag 19 juni 2006 17:04, schreef Adnan Ali:
 I am not such an advanced user of vi, still I like to
 stick with it for whatever text I do. I learn along my
 work.

 Today, I tried to edit some .html files with vi.
 However, when I do
 $vi index.html
 it opens the html file like a browser i.e. not the
 complete text along with html tags, but the *content*
 only.

That's weird, your 'vi' is probably not a 'vim', what does a 'vi' 
without arguments say?

What is the output of:
:version
?

 When I did 
 $vim index.html
 it does open the file with complete *text* including
 the tags, but I am convenient with this mode as I am
 used to working with the vi interface (? I don't what
 else could I use?).

Vim's commandset is a superset of vi's, and since you're asking a 
question on the vim mailinglist, I suppose you mean the 'vim 
interface'.

It's possible your 'vi' is another implementation of 'vi' than 'vim'. If 
you answer the questions above, we can probably help you.

 So, I would be glad and appreciate if somebody would
 help me open my index.html with my *vi* so that I
 could edit the content and the tags.

What exactly do you mean with 'my *vi*', did you compile and install it 
yourself? In that case, you should enter the entire path of 'your 
*vi*'.

 Thanks in advance for any help!

No problem, though your problem is not yet entirely clear to me yet...


Regards,

Peter Palm


Re: Shell command history in VIM?

2006-05-18 Thread Peter Palm
Op donderdag 18 mei 2006 16:38, schreef Wijaya Edward:
 Hi,

 Is there a way to enable history view of
 all the shell command executed under vim,
 i.e. with :! shell_command

Well, as long as the info is known by vim (see :help viminfo), you could do:
q:
to open the command-line window

and then:
g/^!/p
to print all the lines beginning with !


Regards,


Peter Palm