Friday, April 30, 2010

Left-align after separator on status line?

Currently, I have the status line displaying Vim's
current working directory.

I like having the cwd on the right side of the status line.

I would like to align the cwd as far left to the separator
as possible, so that it doesn't shift around when I navigate
from column 1 to column 10, (likewise row 1 to row 10).

I've tried many variations of the sprintf syntax, and can't get
the current working directory not to shift around depending on the
line # and col # that I'm on.

Any ideas?

function! MyStatusLine()
let l:statline = '%=' "left/right separator
let l:statline = l:statline . '%-20{" | " . fnamemodify(getcwd(),
":t") . " | "}'
let l:statline = l:statline . '%l, %v of %L' "cursor line/total lines
return l:statline
endfunction

" Status Line
set laststatus=2
set statusline=%!MyStatusLine()

Thanks,
--Nate

--
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

Re: Backups not created

On May 1, 3:10 pm, Ritmo2k <jcas...@gmail.com> wrote:

> no backups are made in /tmp? How do you control this?

The 'backupskip' option; the default value includes /tmp/*.

Please excuse me if I'm wrong, but you seem unaware how good vim's
help is. Mucking around with the whatever option, it's a good idea to
try

:help 'whatever

(that's a single quote). :help 'backup tells about backupskip, and
hyper-links to it.

Regards, John

--
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

Re: Yank range ?

On Friday 30 April 2010 9:57:07 pm stosss wrote:

> On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@swbell.net>
wrote:
> > On Friday 30 April 2010 9:17:57 pm stosss wrote:
> >> I went to :he y and I see:
> >> :[range]y[ank] [x] Yank [range] lines [into register x].
> >>
> >> so I do:
> >> :'y,'zy"c
> >>
> >> It did not give me an error, but when I type:
> >>
> >> "cP
> >>
> >> I don't get what I yanked.
> >>
> >> What I am doing wrong?
> >> What register is my yanked text in?
> >
> > i think it'll be in the un-named register (")
>
> Yes typing P dumped my text into the file.
>
> > i think what you wanted to do was
> >
> > :'y,'zyc
>
> This produced the E492 error
>
> So how does range yank into a named register work?

it works fine when you remember the space between the 'y' and the
register (as it shows -- and i overlooked -- in the help module)

what you really wanted to do was

:'y,'zy c

sc
sc

--
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

Re: Backups not created

> My guess is that your newer Centos comes with a system vimrc that
> contains some setting that's interfering with your backups.
>
> One way to check this is to execute
>
>     :scriptnames
>
> and look for a system vimrc being sourced.  It might be
> /etc/vimrc or /usr/share/vim/vimrc.  See
>
>     :help system-vimrc
>
> for more on this file and
>
>     :help startup
>
> for the details of what Vim does at startup.  If you see such a
> file, you can open it and see if it contains anything suspicious.
> You can also see the current values of options whose setting differ
> from the default by executing
>
>     :set
>
> Unfortunately, I'm not familiar with all the options that can affect
> backups, but
>
>     :help 07.4
>
> seems to explain them pretty well.  You can also execute
>
>     :options
>
> and search for "backup" (no quotes) to see the backup-related option
> settings.
>
> Also, if you see an option value that isn't what you expect it to be
> and want to see where it was last set, execute
>
>     :verbose set backup?
>
> where I just used the 'backup' option as an example.
>
> You might take a look at
>
>     :help --noplugin
>     :help -u
>     :help --cmd
>
> to help you start your Vim with complete control over what files are
> sourced and what initial settings are made.  For example,
>
>     $ vim -N -u NONE --cmd 'set backup' foo
>
> should start Vim with default settings for everything but 'backup'
> and should save a backup copy of foo if you change foo.  You can use
> that to verify that your Vim basically works and that the problem
> lies in one of your configuration files.
>
> HTH,
> Gary

Wow, great post, I will be saving this...
Its resolved, but one thing that caught me was when I noticed the
problem, I
cd'ed into /tmp and started testing there. Well, even when backup is
working
no backups are made in /tmp? How do you control this?
Thanks!

--
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

Re: Yank range ?

On Fri, Apr 30, 2010 at 10:57 PM, stosss <stosss@gmail.com> wrote:
> On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@swbell.net> wrote:
>> On Friday 30 April 2010 9:17:57 pm stosss wrote:
>>
>>> I went to :he y and I see:
>>> :[range]y[ank] [x]    Yank [range] lines [into register x].
>>>
>>> so I do:
>>> :'y,'zy"c
>>>
>>> It did not give me an error, but when I type:
>>>
>>> "cP
>>>
>>> I don't get what I yanked.
>>>
>>> What I am doing wrong?
>>> What register is my yanked text in?
>>
>> i think it'll be in the un-named register (")
>
> Yes typing P dumped my text into the file.
>
>> i think what you wanted to do was
>>
>>    :'y,'zyc
>
> This produced the E492 error
>
> So how does range yank into a named register work?

Answering my own question.

This is the correct way:

:'y,'zy c

There has to be a space between yank and the register.

--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

Re: Yank range ?

On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@swbell.net> wrote:
> On Friday 30 April 2010 9:17:57 pm stosss wrote:
>
>> I went to :he y and I see:
>> :[range]y[ank] [x]    Yank [range] lines [into register x].
>>
>> so I do:
>> :'y,'zy"c
>>
>> It did not give me an error, but when I type:
>>
>> "cP
>>
>> I don't get what I yanked.
>>
>> What I am doing wrong?
>> What register is my yanked text in?
>
> i think it'll be in the un-named register (")

Yes typing P dumped my text into the file.

> i think what you wanted to do was
>
>    :'y,'zyc

This produced the E492 error

So how does range yank into a named register work?

--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

Keeping screen position

I don't like when I'm jumping between two files and if I need to edit a
line at the bottom and see some text at the top, vim re-centers screen
after ctrl-^ so I have to scroll again. I made a little mapping that
remembers and restores screen:

nnoremap <silent> <c-^> msHmt<c-^>:normal! 'tzt`s<CR>

It works great nearly always but on a rare occasion, it seems like it
jumps to the top of file. Or a couple screenfuls up, or something like
that. It happens rarely enough that I can't figure out what causes this
and yet often enough to be annoying; and it always happens when I'm too
busy with something else to investigate.

I'm hoping someone here might be able to spot the problem with this
mapping. Much thanks in advance!

--
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

Re: Yank range ?

On Friday 30 April 2010 9:17:57 pm stosss wrote:

> I went to :he y and I see:
> :[range]y[ank] [x] Yank [range] lines [into register x].
>
> so I do:
> :'y,'zy"c
>
> It did not give me an error, but when I type:
>
> "cP
>
> I don't get what I yanked.
>
> What I am doing wrong?
> What register is my yanked text in?

i think it'll be in the un-named register (")

i think what you wanted to do was

:'y,'zyc

if you want it in register c

sc

--
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

Re: Strange problem with netrw in vim 7.2 windows

Jack Donohue wrote:
> I use the x (execute) command a lot
>
> " Netrw Directory Listing
> (netrw v132)
> " Sorted by time
> " Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by
> x:exec
> "
> ============================================================================
>
>
> Works fine in vim70, but I recently changed to vim 7.2 and I sometime
> get this:
>
> Press <cr> to continue
>
> instead of opening the file with the file association. I'm running
> Windows XP SP 3
>
> Any ideas what's wrong?
Does increasing your cmdheight option help? (:set ch=2)

Regards,
Chip Campbell

--
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

Yank range ?

I went to :he y and I see:

:[range]y[ank] [x] Yank [range] lines [into register x].

so I do:

:'y,'zy"c

It did not give me an error, but when I type:

"cP

I don't get what I yanked.

What I am doing wrong?
What register is my yanked text in?


--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

Re: Backups not created

On 2010-04-30, Ritmo2k wrote:
> With an empty .vimrc or one with just "set backup" in it, or
> typing :set backup, I can't get a backup file created on any
> of my CentOS 5 servers. It used to work and has recently stopped
> on all of them?
>
> A strace on a remote hosting chroot running an older version of Centos
> shows it working as expected but on any of my servers it never
> attempts a write of the file anywhere?

My guess is that your newer Centos comes with a system vimrc that
contains some setting that's interfering with your backups.

One way to check this is to execute

:scriptnames

and look for a system vimrc being sourced. It might be
/etc/vimrc or /usr/share/vim/vimrc. See

:help system-vimrc

for more on this file and

:help startup

for the details of what Vim does at startup. If you see such a
file, you can open it and see if it contains anything suspicious.
You can also see the current values of options whose setting differ
from the default by executing

:set

Unfortunately, I'm not familiar with all the options that can affect
backups, but

:help 07.4

seems to explain them pretty well. You can also execute

:options

and search for "backup" (no quotes) to see the backup-related option
settings.

Also, if you see an option value that isn't what you expect it to be
and want to see where it was last set, execute

:verbose set backup?

where I just used the 'backup' option as an example.

You might take a look at

:help --noplugin
:help -u
:help --cmd

to help you start your Vim with complete control over what files are
sourced and what initial settings are made. For example,

$ vim -N -u NONE --cmd 'set backup' foo

should start Vim with default settings for everything but 'backup'
and should save a backup copy of foo if you change foo. You can use
that to verify that your Vim basically works and that the problem
lies in one of your configuration files.

HTH,
Gary

--
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

Syntax - Highlight TODO w/ Matchgroup

I'm trying to highlight "org-mode" files similar to what's shown here:
http://orgmode.org/img/tasks.png

I found a good start by using "outline.vim" from vim.org.

Now, I'm having problems highlighting the TODO keyword
in a different color than the color of the header.

Example:

* TODO Something

The TODO above should be higlighted differently than the other items
in that line.

Here's what I have so far:
--------------------
syn region Outline_1 matchgroup=Outline_1_match contains=Todo transparent
\ start='^\*.*'
\ end='\n\ze\n\?\*[^*]\|^<$'
\ fold keepend

syn keyword Todo TODO contained

hi! default link Outline_1_match Comment
hi! default link Outline_1 Text
---------------------
I need "matchgroup"since I want to highlight the top TODO
line, but nothing else in that paragraph.

Also, the folding works great.

I think that the "transparent" option is really close to what I want,
because the documentation says

:h syn-matchgroup

In a start or end pattern that is highlighted with "matchgroup" the
contained items of the region are not used. This can be used to avoid
that a contained item matches in the start or end pattern match. When
using "transparent", this does not apply to a start or end pattern
match that is highlighted with "matchgroup".

However, no matter what I've tried, the * TODO Something is always shown
with just the Comment syntax.

Any ideas?

Thanks,
--Nate

--
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

Re: vim wired usage issue that need help

On Friday 30 April 2010 10:13:26 am C. Jiang wrote:

> I am running Windows 7. In it I run a VMware (Fedora linux)
> where my projects files are. I mapped the projects folder in
> windows 7. The Vim is installed on windows 7 and I can use
> the mouse to point a file and right click mouse and in the
> popup menu, use 'Edit with Vim', 'Edit with existing vim -
> myopenedfile.txt'.
>
> The issue is:
>
> If i open just one file, or open files one by one, ':pwd' in
> vim will show me the correct path where the current file is;
>
> But if I highlight 2 or more files and right click and open
> them with 'open with a single vim', after I check ':pwd' in
> vim, it shows c:\windows\system32.
>
> Since my tags for the projects is in the top directory of the
> projects, vim won't find the tag file any more.

the simplest will be to

:set autochdir

in your _vimrc, although this setting has its detractors, and
some plugins misbehave with it set, or did in the past -- i edit
files all over the place and have come to rely on the fact that
no matter where i am, :pwd is always current to the file i am
editing

sc

--
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

Backups not created

With an empty .vimrc or one with just "set backup" in it, or
typing :set backup, I can't get a backup file created on any
of my CentOS 5 servers. It used to work and has recently stopped
on all of them?

A strace on a remote hosting chroot running an older version of Centos
shows it working as expected but on any of my servers it never
attempts
a write of the file anywhere?

Anyone know how to debug this?

Thanks!

--
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

vim wired usage issue that need help

Hi folks,

I am running Windows 7. In it I run a VMware (Fedora linux) where my
projects files are. I mapped the projects folder in windows 7. The
Vim is installed on windows 7 and I can use the mouse to point a file
and right click mouse and in the popup menu, use 'Edit with Vim',
'Edit with existing vim - myopenedfile.txt'.

The issue is:

If i open just one file, or open files one by one, ':pwd' in vim will
show me the correct path where the current file is;

But if I highlight 2 or more files and right click and open them with
'open with a single vim', after I check ':pwd' in vim, it shows
c:\windows\system32.

Since my tags for the projects is in the top directory of the
projects, vim won't find the tag file any more.

Any suggestions is highly appreciated.

Thanks,

Ray

--
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

Re: one instance of gvim on windows?

On Fri, Apr 30, 2010 at 1:06 AM, Bee <200309@calcentral.com> wrote:
>
> On Mar 2, 8:46 am, Ben Fritz <fritzophre...@gmail.com> wrote:
> >
> > http://vim.wikia.com/wiki/Windows_file_associations
> >
> > or
> >
> > http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Windows
> >
> > should get you going.
>
> Thank you.
>
> I replied (via groups.google.com) that this worked great on Windows.
>
> Is there a way to use  --remote-silent  in Linux to open only one
> instance?
>
> I tried several ways and each time I clicked a file it opened a new
> instance of vim.

Same basic idea:

http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Unix

I have not tried this, myself. As far as Vim is concerned the method
is the same.

You do need to have support for the remote interface comiled in. Look
for "+clientserver" in your :version output.

--
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

Thursday, April 29, 2010

Re: one instance of gvim on windows?

On Mar 2, 8:46 am, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Mar 1, 7:46 pm, Bee <200...@calcentral.com> wrote:
>
> > One of the reasons I use vim; it is available AND the same on all
> > three platforms, Unix, Mac, Win. The real reason; vim is great.
>
> > Now... sometimes I must work in Windows, when I double click a
> > document it opens gvim, and that is good. But when I double click
> > another document, another instance of gvim is spawned.
>
> > On Windows, is it possible to prevent new instances of gvim and have
> > the document open in the current gvim by double clicking?
>
> http://vim.wikia.com/wiki/Windows_file_associations
>
> or
>
> http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Windows
>
> should get you going.

ok, I already replied that this worked great on Windows.

Is there a way to use --remote-silent in Linux?

--
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

Re: vim.wikia.com is a poor user experience

On Thu, Apr 29, 2010 at 10:19 PM, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> On 29/04/10 04:55, John Beckett wrote:
> [...]
>>
>> When making an account: Enter a bogus date of birth making your
>> age over 13 (Google COPPA to understand this requirement). I
>> recommend you enter a valid email address so you can be notified
>> if someone leaves you a message on your user talk page. In three
>> years I have had no spam.
>>
>> John
>>
>
> Of course, if you're already over 13 (I'll be 60 next January ;-) ) the
> birth date doesn't have to be bogus. :-)

You are less then 6 years my senior.


--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

Re: A non-Vim behavioural problem

On 2010.04.29 22:00, Marc Weber wrote:

> Excerpts from Steve Bertrand's message of Fri Apr 30 03:47:37 +0200 2010:
>> my $type = $params->{ type };
>> my $data = $params->{ data };
>> my $error = $params->{ error };
>
> Try :set invlist
>
> to see where tabs and spaces are used.
>
> :retab
> or
> :retab!
>
> will replace spaces by tabs or tabs by spaces depending on expandtab
> setting.

...

> See :h paste
>
> or :r!cat
> paste..
>
> <c-d>
>
> which may be faster than using :set invpaste two times.

Thanks for the feedback Marc!

I'll give it a try, and let you know.

Cheers,

Steve

--
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

Re: vim.wikia.com is a poor user experience

On 29/04/10 04:55, John Beckett wrote:
[...]
> When making an account: Enter a bogus date of birth making your
> age over 13 (Google COPPA to understand this requirement). I
> recommend you enter a valid email address so you can be notified
> if someone leaves you a message on your user talk page. In three
> years I have had no spam.
>
> John
>

Of course, if you're already over 13 (I'll be 60 next January ;-) ) the
birth date doesn't have to be bogus. :-)


Best regards,
Tony.
--
Futility Factor: No experiment is ever a complete failure - it can always
serve as a negative example.

--
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

Re: Mapping Shift-space: how to tell if its possible?

On 29/04/10 20:23, Britton Kerin wrote:
>
>
> On Wed, Apr 28, 2010 at 7:55 PM, John Beckett <johnb.beckett@gmail.com
> <mailto:johnb.beckett@gmail.com>> wrote:
>
> Britton Kerin wrote:
> > I'd like to map shift-space <S-Space> to <PageDown> or something.
> >
> > After a lot of googling I find several mentions that some
> > setups are st vim differentiates between <Space> and
> > <S-Space> and some not.
> > It seems not for me since :<C-v><S-Space> outputs only a space.
> >
> > I didn't find any mention what in the setup makes the difference?
> > I'm using gvim not console.
>
> In insert mode in gvim, press Ctrl-K then Shift-Space. On my
> system, it shows <S-Space> indicating that it knows what the key
> was.
>
> Try entering this test:
>
> :map <S-Space> :echo 'You pressed Shift-Space'<CR>
>
> Then, in normal mode, press Shift-Space.
>
>
> Both these tests seem to indicate that my machine doesn't see Shift-Space.
> Any idea why some systems do this and some not, or what I might do to
> fix this problem?
>
> Britton
>
> --
> 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

Gvim usually knows keys and keychords for what they are. In particular,
it usually recognizes Shift-Space as different from Space. However, gvim
is still somewhat dependent on whatever the Windows / X11 / Mac keyboard
driver is doing to the key events. It may be an advantage to run in a
Unicode "system locale" if you can (gvim with GTK2 GUI always does it;
I've heard conflicting reports about gvim for Windows).

When Vim is run in a terminal (i.e., in console mode), it's at the mercy
of the terminal's keyboard logic. Some keys or key combos will not be
passed at all. Others will be "translated" according to the current
locale. For some keys, Shift and/or Ctrl and/or Alt may get lost,
jointly or severally. And so on.

IMHO, the easiest way to fix that kind of problem is to run gvim;
however, if your usual terminal is mlterm, the disadvantage is that you
lose the true-bidi capabilities (which mlterm has, and Vim knows it, but
gvim doesn't have).


Best regards,
Tony.
--
Stult's Report:
Our problems are mostly behind us. What we have to do now is
fight the solutions.

--
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

Re: A non-Vim behavioural problem

Hi Steve,

Excerpts from Steve Bertrand's message of Fri Apr 30 03:47:37 +0200 2010:
> my $type = $params->{ type };
> my $data = $params->{ data };
> my $error = $params->{ error };

Try :set invlist

to see where tabs and spaces are used.

:retab
or
:retab!

will replace spaces by tabs or tabs by spaces depending on expandtab
setting.

Was this what you're looking for?

Also not that when copy & pasting you don't copy paste verbatim by
defaultl. Vim will take copy input the way you type.

See :h paste

or :r!cat
paste..

<c-d>

which may be faster than using :set invpaste two times.

Marc Weber

--
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

A non-Vim behavioural problem

Hi all,

Vim works so well for me, that I've only had the need to follow the list
and not post for a while ;)

However, I am having an issue that is becoming more frustrating over time.

I've got my .vimrc set up how I like it, but oftentimes when I get svn
diff reports of my code, or I send code snips via email to myself via
the command line, I end up with offsets. My code, in vim, appears as such:

$self->function_orders();

my $type = $params->{ type };
my $data = $params->{ data };
my $error = $params->{ error };

my $vardb = ISP::Vars->new();

# die right off the bat if either data is an invalid type,
# or no $error obj was passed in

if ( ! defined $error ) {
$error = ISP::Error->new();
$error->bad_api();
}

...however, in reports, emails and/or bug notifications, it will often
look like this:

$self->function_orders();

my $type = $params->{ type };
my $data = $params->{ data };
my $error = $params->{ error };

my $vardb = ISP::Vars->new();

# die right off the bat if either data is an invalid type,
# or no $error obj was passed in

if ( ! defined $error ) {
$error = ISP::Error->new();
$error->bad_api();
}

....which makes it difficult (ie. *very* frustrating) to review down the
road.

Is this a behavioural problem? If it is, can anyone offer any tips to
correct the behaviour, or better yet, any way to clean up what I'm
thinking could possibly be excessive whitespace?

Cheers!

Stee

--
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

Re: Mapping Shift-space: how to tell if its possible?

> Both these tests seem to indicate that my machine doesn't see Shift-Space.
> Any idea why some systems  do this and some not, or what I might do to
> fix this problem?

We'd need to know which version, OS, and maybe which gui you are
using; the first four lines output by :version would be a start. My
gvim (7.2.411, Linux, GTK2 gui) sees Shift-space.

Regards, John

--
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

RE: vim.wikia.com is a poor user experience

Lloyd Budd wrote:
> I still might try and track down someone at wikia to suggest
> smarter ad logic like we do on WordPress.com .

Wikia have put a lot of effort into their ads and they have a
mechanism for reporting "bad" ads (really obnoxious, offensive,
malware) because they sell block space to third parties rather
than micro manage each ad. If you have ideas, you might like to
mention them initially on my talk:
http://vim.wikia.com/wiki/User_talk:JohnBeckett

John

--
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

RE: Error when calling a user defined function.

yixiaodafang wrote:
> When I call it using:
>
> debug call g:test(llan,vvm)
>
> After I type s for single step, I got
>
> E121: Undefined variable: llan
> E116: Invalid arguments for function g:test

In something like 'call test(hello)' the 'hello' is an
expression that is evaluated, so 'hello' would have to be a
defined variable; you could display the value with:

:echo hello

John

--
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

Re: Sensitivity to the first click on a gvim window (Windows)

Hello Andy,

It seems that your lastpos plugin no longer works when the above
autocmd is added to _vimrc (Windows).

Could you fix that?

Best regards
Jean Johner

--
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

Re: vim.wikia.com is a poor user experience

Thanks for the thoughtful responses everyone.

I'll go ahead and create an account.

I still might try and track down someone at wikia to suggest smarter
ad logic like we do on WordPress.com .

Thanks again for the awesome software and community,
Lloyd

--
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

Re: Mapping Shift-space: how to tell if its possible?



On Wed, Apr 28, 2010 at 7:55 PM, John Beckett <johnb.beckett@gmail.com> wrote:
Britton Kerin wrote:
> I'd like to map shift-space <S-Space> to <PageDown> or something.
>
> After a lot of googling I find several mentions that some
> setups are st vim differentiates between <Space> and
> <S-Space> and some not.
> It seems not for me since :<C-v><S-Space> outputs only a space.
>
> I didn't find any mention what in the setup makes the difference?
> I'm using gvim not console.

In insert mode in gvim, press Ctrl-K then Shift-Space. On my
system, it shows <S-Space> indicating that it knows what the key
was.

Try entering this test:

   :map <S-Space> :echo 'You pressed Shift-Space'<CR>

Then, in normal mode, press Shift-Space.

Both these tests seem to indicate that my machine doesn't see Shift-Space.
Any idea why some systems  do this and some not, or what I might do to
fix this problem?

Britton
 

--
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

Error when calling a user defined function.

Hi,

I have defined a function such as:

function! g:test(pattern, action)
let l:tmp=a:pattern
endfunction

When I call it using:

debug call g:test(llan,vvm)

After I type s for single step, I got

E121: Undefined variable: llan
E116: Invalid arguments for function g:test

I have other similar functions and they are running find. Only this
one give me such error message. If I quote the input as:

debug call g:test("llan","wm")

then I do not have problme. Can someone help me to see why this is
happening?

Thanks

Frank

--
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

Re: $HOME variable not set properly in XP - showing "test"

On 29/04/10 04:41, kp wrote:
> Thanks Jürgen.
>
> 1. The :vimgrep didn't return any results.
> 2. Outside vim, %HOME% is not set
> 3. Before loading the .vimrc, the %HOME% is refering to 'test'
>
> But your help, gave me hint. I added this line in the end of .vimrc and
> it worked
> let $HOME = $HOMEDRIVE.$HOMEPATH
>
> Thanks,
> Krishna

Do you by any chance have a "system vimrc"? Its default location is
$VIM/vimrc (without any initial . or _ before the filename) but that
location depends on a compile-time setting. The actual location for each
Vim executable is displayed near the middle of the ":version" output.

If the file exists, it will be sourced in 'nocompatible' mode, before
looking for your [._]vimrc.


Best regards,
Tony.
--
The gods gave man fire and he invented fire engines. They gave him
love and he invented marriage.

--
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

Re: Marking lines for deletion

On 04/29/2010 09:23 AM, Ben Fritz wrote:

> 1. mark "start delete" with md (sets mark d)
> 2. move to end of text to delete
> 3. Use the ex command, ":d" to delete the lines, with a range starting
> at your previous mark like this:
> :d,.d

Just to clarify, the mark should have an apostrophe before it:

:'d,.d

Just for clarity of understanding which is the mark and which is
the Ex command, if you use mark "q", it would be

:'q,.d

You can even use marks for both ends of the range to delete,
double-check, move around, copy stuff out, etc, and then delete
them using Ben's method:

1) mark "start of delete" with "ms" (sets mark "s")
2) move to the end and mark the "end of delete" with "me" (sets
mark "e")
3) move around, copy stuff, jump back to the start-of-delete
with 's to check it's really where you want, jump back to the end
with 'e to double-check it, yank some stuff, paste it elsewhere,
drink some $PROGRAMMER_BEVERAGE_OF_CHOICE, surf the web, etc
4) delete the stuff with

:'s,'ed

-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

Re: Marking lines for deletion

On 29 April 2010 17:23, Ben Fritz <fritzophrenic@gmail.com> wrote:
> You have lots of answers, all good, but yet one more would be to do
> exactly as you say:
>
> 1. mark "start delete" with md (sets mark d)
> 2. move to end of text to delete
> 3. Use the ex command, ":d" to delete the lines, with a range starting
> at your previous mark like this:
> :d,.d
>
> Or, instead of using an ex command in (3), you could use a motion as
> suggested before, to delete up to the mark:
> d'd
>
> See :help bookmark for details.
>

Thanks, Ben!

--
Dotan Cohen

http://bido.com
http://what-is-what.com

--
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

Re: Marking lines for deletion

On Apr 28, 1:53 pm, Dotan Cohen <dotanco...@gmail.com> wrote:
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?
>

You have lots of answers, all good, but yet one more would be to do
exactly as you say:

1. mark "start delete" with md (sets mark d)
2. move to end of text to delete
3. Use the ex command, ":d" to delete the lines, with a range starting
at your previous mark like this:
:d,.d

Or, instead of using an ex command in (3), you could use a motion as
suggested before, to delete up to the mark:
d'd

See :help bookmark for details.

--
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

Re: Sensitivity to the first click on a gvim window (Windows)

On Apr 29, 3:42 pm, Andy Wokula <anw...@yahoo.de> wrote:

> maybe
>
> :au FocusGained * call getchar(0)

It works. Andy super vim star!

Best regards
Jean Johner

--
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

Re: Sensitivity to the first click on a gvim window (Windows)

Am 29.04.2010 15:32, schrieb Jean Johner:
> Hello,
> In most Windows applications (MS Office, WordPard, Scientific
> WorkPlace), the FIRST click on a window which is not actvated just
> activates the window (without changing the cursor position). Notable
> exceptions are NotePad and Windows Explorer.
>
> This feature is useful as it allows working on multiple windows
> without loosing the cursor position (while clicking anywhere to
> activate the window).
>
> In the case of multiple gvim windows, the first click on a non-
> activated window both
> -activate the windows
> -put the cursor at the position of the click
>
> Is is possible to make gvim windows "first click insensitive"?
>
> Best regards
>
> Jean Johner

maybe

:au FocusGained * call getchar(0)

--
Andy

--
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

Sensitivity to the first click on a gvim window (Windows)

Hello,
In most Windows applications (MS Office, WordPard, Scientific
WorkPlace), the FIRST click on a window which is not actvated just
activates the window (without changing the cursor position). Notable
exceptions are NotePad and Windows Explorer.

This feature is useful as it allows working on multiple windows
without loosing the cursor position (while clicking anywhere to
activate the window).

In the case of multiple gvim windows, the first click on a non-
activated window both
-activate the windows
-put the cursor at the position of the click

Is is possible to make gvim windows "first click insensitive"?

Best regards

Jean Johner

--
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

Re: How to fix broken automatic indentation in vim

Andy Wokula wrote:
>
> At least for VHDL, you may check the help:
>
> :h ft-vhdl-indent
>
> :let g:vhdl_indent_genportmap = 0
>
> --
> Andy
>

Thanks Andy. I tried it but it still does not work right. It is not that I
want to change the way it indents the VHDL code, but that the way the plugin
indents the code is simply wrong.

At some point the indenting gets messed up, and things which should be at
the same level of indentation are put in different levels as in the example
files I sent yesterday.

Cheers,

Didly
--
View this message in context: http://old.nabble.com/How-to-fix-broken-automatic-indentation-in-vim-tp28379120p28398978.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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

Re: How to fix broken automatic indentation in vim

Am 27.04.2010 18:29, schrieb Didlybom:
> Hi,
>
> I am trying to use vim 7.2 (on Windows XP) to automatically indent and
> format some VHDL and Matlab code. To do so I am trying to use the "gg=G"
> command. However this does not work properly. The code is not properly
> indented at all.
> ...

> For VHDL files I get similar problems.
>
> I have tried using different combinations of the autoindent, smartindent and
> cindent settings. After going through these forums I have also made sure
> that the "syntax", "filetype", "filetype indent" and "filetype plugin
> indent" are set to on. Still, it does not work. Also, if I do "set syntax?"
> I get "matlab" for matlab files and "vhdl" for vhdl files which is correct.
> And if I do "set indentexpr?" I get "GetMatlabIndent(v:lnum)" for matlab
> files and "GetVHDLindent()" for vhdl files.
>
> To try to isolate the problem (and ensure that it is not due to one of the
> vim plugins that I have installed) by doing a fresh install of VIM on a
> different computer (in which VIM had never been installed before). On that
> computer I get the same sort of problems (that is why I do not think that I
> need to give you the .vimrc, but if you need it I can upload it here too).

At least for VHDL, you may check the help:

:h ft-vhdl-indent

:let g:vhdl_indent_genportmap = 0

--
Andy

--
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

Re: How to fix broken automatic indentation in vim

Gary Johnson-4 wrote:
>
> On 2010-04-28, Didlybom wrote:
> Didly,
>
> I fetched your example.vhd using wget to a machine running Linux.
> I then re-indented it using my standard configuration and saw the
> problem. Then I followed the procedure I used before,
>
> vim -N -u NONE
> :filetype plugin indent on
> :set sw=2
> gg=G
>
> and still saw the indenting problems.
>
> I had not looked at your example_indented.vhd file, so I did that
> just now. If I leave 'sw' at the default of 8 and re-indent your
> example.vhd, my result is identical to your example_indented.vhd.
>
>
> I neglected to mention this earlier, but the convention on this list
> is to put the text of one's reply at the bottom of the post rather
> than at the top. I appreciate that you do trim your replies,
> though.
>
> Regards,
> Gary
>
> --
> 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
>
>

Gary, thanks again for checking. This seems to confirm that the problem is
with the indenter logic in Vim. I have contacted the author of the VHDL
indent script and hopefully he'll be able to find the problem. If he does I
will post his answer in this thread.

Thanks for the heads up on the proper way to reply to messages on this lits.
I will do as you suggested from now on! :-)

Cheers,

Didly

--
View this message in context: http://old.nabble.com/How-to-fix-broken-automatic-indentation-in-vim-tp28379120p28397882.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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

Re: Marking lines for deletion

On 29 April 2010 06:22, Vladimir Rybas <vladimirrybas@gmail.com> wrote:
> I usually delete blocks like
> V j j j d
> by the way, you could use "conditional deletion"
> :g/^> /d
> will delete all lines, starts with `> `
>

‎Thanks, but I usually quote and leave part of them. But it is a good
tip to know.

--
Dotan Cohen

http://bido.com
http://what-is-what.com

--
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

Wednesday, April 28, 2010

Re: Windows 7 64bit - use 32bit or 64bit Vim?

David Fishburn 写道:
> I regularily build my on Vim using VS 2008.
>
> I have just been upgraded to Windows 7 64bit and am beginning to set it up.
>
> Seems you always have to choose if you want (or can use) the 32bit
> version of software or find a 64bit version.
>
> Now, since I build my own Vim, I guess I can get VS 2008 to build me a
> 64bit version of Vim.
> Here are my problems:
>


Almost all open-source softwares have no problem in 64bit. This is the
reason that almost all Linux software supports 64bit without any problem.

In windows things are a bit different, because close-source and
binary-distributed softwares are very popular in windows and you don't
get 64bit unless they deployed a 64bit version.

If you have all the source code for your python and perl modules it may
be easy to go everything 64-bit. Otherwise it may be easier to keep
32bit if you're using Windows.

--
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

Re: A 'visible within the window' range?


On Apr 28, 2010, at 1:51 AM, Jürgen Krämer wrote:

 cmap <expr> * (getcmdpos() == 1) ? line('w0') . ',' . line('w$') : '*'

Even better!  I, too, have a scrolloff option set (like James Cole mentioned) and so this solution works perfectly for me.

Thanks Jürgen.

Regards,
Duane

Re: vim.wikia.com is a poor user experience

On Apr 29, 11:52 am, Lloyd Budd <foolswis...@gmail.com> wrote:
> I couldn't even read the text with the nauseating animated banner ad
> pushing the text right.

Create an account and log in. Many fewer ads.

HTH, John

--
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

Re: Marking lines for deletion

I usually delete blocks like
V j j j d

by the way, you could use "conditional deletion" 

:g/^> /d

will delete all lines, starts with `> `

On Thu, Apr 29, 2010 at 6:10 AM, LuKreme <kremels@kreme.com> wrote:
On 28-Apr-2010, at 12:53, Dotan Cohen wrote:
>
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?

Press 'v' then used the movement keys to select the text you want to delete, and hit 'd'


--
The only reason for walking into the jaws of Death is so's you can steal His
gold teeth. --Colour of Magic


--
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

--
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

RE: vim.wikia.com is a poor user experience

Lloyd Budd wrote:
> My Google search ended at
> http://vim.wikia.com/wiki/Switching_case_of_characters
>
> I couldn't even read the text with the nauseating animated
> banner ad pushing the text right.
> screen shot:
> http://skitch.com/lloydbudd/dbnhh/switching-case-of-characters
> -vim-tips-wiki

Yes, the adverts can be a pain. I actually checked the other day
(that is, I browsed a couple of pages as an anonymous user on a
system with no ad blocking software) and the adverts were OK.
They were plain and not unattractive, with no animation.
However, I know they also have animated adverts including Flash.

There is not much we can do because Wikia provide not just the
base system, but they also maintain the software and provide
quite good support (I've only had to ask for help a couple of
times, and the response was good). Someone might be able to
donate a base system with no ads, but the maintenance and
assurance of continuing availability would be a problem.

Anyway, for an individual user like yourself, there is an easy
way to avoid the adverts (but adverts will still be visible on
the main page, and will be seen occasionally due to a glitch
which sometimes shows an advert when it is not supposed to).

At vim.wikia.com click the buttons to register an account. When
logged on, there are no adverts. You can stay logged on for 30
days (if cookies enabled).

When making an account: Enter a bogus date of birth making your
age over 13 (Google COPPA to understand this requirement). I
recommend you enter a valid email address so you can be notified
if someone leaves you a message on your user talk page. In three
years I have had no spam.

John

--
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

RE: Mapping Shift-space: how to tell if its possible?

Britton Kerin wrote:
> I'd like to map shift-space <S-Space> to <PageDown> or something.
>
> After a lot of googling I find several mentions that some
> setups are st vim differentiates between <Space> and
> <S-Space> and some not.
> It seems not for me since :<C-v><S-Space> outputs only a space.
>
> I didn't find any mention what in the setup makes the difference?
> I'm using gvim not console.

In insert mode in gvim, press Ctrl-K then Shift-Space. On my
system, it shows <S-Space> indicating that it knows what the key
was.

Try entering this test:

:map <S-Space> :echo 'You pressed Shift-Space'<CR>

Then, in normal mode, press Shift-Space.

John

--
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

Re: $HOME variable not set properly in XP - showing "test"

Thanks Jürgen.

1. The :vimgrep didn't return any results.
2. Outside vim, %HOME% is not set
3. Before loading the .vimrc, the %HOME% is refering to 'test'

But your help, gave me hint. I added this line in the end of .vimrc and it worked
let $HOME = $HOMEDRIVE.$HOMEPATH

Thanks,
Krishna


On Wed, Apr 28, 2010 at 9:51 PM, Jürgen Krämer <jkr@jottkaerr.de> wrote:

Hi,

kp wrote:
>
> I am having problem in my XP machine.
> While closing GVIM window, I get an error "Can't write viminfo file
> test\_viminfo"
> This is irritating as I needs to press Enter at every time.
>
> When I debugged further it says $HOME is set to "test"!!!!!!!!!!!!
>
> Not sure why this is like this?
>
> The other variables look fine.
> $VIMRUNTIME = C:\Program Files\Vim\Vim72
> $HOMEDRIVE = C:
> $HOMEPATH = \Documents and Settings\kp
>
> Can you please let me know the solution?

is $HOME set to "test" outside of Vim, too? You can check this with

 echo %HOME%

in a "stand-alone" command line window. (Don't do this from a command
line window started with

 :sh

from inside Vim. This would inherit the incorrect value from Vim.)
Normally Windows does not define %HOME%, just %HOMEDRIVE% and
%HOMEPATH%, and Vim uses these two variable to initialize its own $HOME
variable whenever %HOME% is not set.

If it is not set outside of Vim it must have been changed from .vimrc or
a plugin file. You can either check every Vim script that gets
mentioned in the output of

 :scriptnames

manually or try something like (all on one line)

 :vimgrep /\clet $HOME.*=.*test/ $VIMRUNTIME/**/*.vim
$VIM/vimfiles/**/*.vim

Another cause might be a batch file that you use to start Vim and which
sets the value of %HOME%.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--
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

--
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

Re: vim.wikia.com is a poor user experience

On Wednesday 28 April 2010 6:52:51 pm Lloyd Budd wrote:

> Hello fantastic vim users,
>
> I haven't needed a vim tip in some time it seems.
>
> My Google search ended at
> http://vim.wikia.com/wiki/Switching_case_of_characters
>
> I couldn't even read the text with the nauseating animated
> banner ad pushing the text right.
> screen shot:
> http://skitch.com/lloydbudd/dbnhh/switching-case-of-character
> s-vim-tips-wiki

i don't see any ads at all when i go to that site -- of course
i'm using firefox + adblock plus

sc

--
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

Re: How to map to for modeless selection

On 28/04/10 14:25, Jean Johner wrote:
> Hello,
>
> I do not use<C-LeftMouse> for tags but I am very fond of<C-S-
> LeftMouse> for modeless selection while editing.
>
> Is there a way to remap<C-LeftMouse> to<C-S-LeftMouse>.
>
> I tried "map<C-LeftMouse> <C-S-LeftMouse>" with no success.
>
> Best regards
>
> Jean Johner
>

Well, mappings are modal: they're either nmap, omap, xmap, smap, imap,
cmap... or several of them together. The modeless selection is, well,
modeless; it can even happen across window boundaries.

So IIUC you cannot reassign the modeless selection to something else by
means of a mapping. It's <C-S-LeftDrag> in the GUI, or any of the
triggers listed at ":help modeless-selection" but AFAIK you can't change
them (short of recompiling the appropriate source module(s), which is
not recommended).


Best regards,
Tony.
--
GUARD #1: What -- a swallow carrying a coconut?
ARTHUR: It could grip it by the husk!
GUARD #1: It's not a question of where he grips it! It's a simple question
of weight ratios! A five ounce bird could not carry a 1 pound
coconut.
The Quest for the Holy Grail (Monty
Python)

--
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

vim.wikia.com is a poor user experience

Hello fantastic vim users,

I haven't needed a vim tip in some time it seems.

My Google search ended at http://vim.wikia.com/wiki/Switching_case_of_characters

I couldn't even read the text with the nauseating animated banner ad
pushing the text right.
screen shot: http://skitch.com/lloydbudd/dbnhh/switching-case-of-characters-vim-tips-wiki

I love vim, thanks for listening,
LLoyd

--
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

Mapping Shift-space: how to tell if its possible?


I'd like to map shift-space <S-Space> to <PageDown> or something.

After a lot of googling I find several mentions that some setups are st
vim differentiates between <Space> and <S-Space> and some not.
It seems not for me since :<C-v><S-Space> outputs only a space.

I didn't find any mention what in the setup makes the difference?
I'm using gvim not console.

I tried setting gnome configuration option Keyboard Preferences->Keyboard Layout Options->Using space key to input non-breakable space character->Space key outputs non-breakable space character at second level in the hope that this would generated a different characters that vim could detect.  But if it does, it isn't <S-Space> apparently.  And that solution seems undesirable for other reasons, since I don't ever really want unbreakable spaces creeping in.

Advice?

Thanks,
Britton

--
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

Re: Marking lines for deletion

On 28-Apr-2010, at 12:53, Dotan Cohen wrote:
>
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?

Press 'v' then used the movement keys to select the text you want to delete, and hit 'd'


--
The only reason for walking into the jaws of Death is so's you can steal His
gold teeth. --Colour of Magic


--
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

Strange problem with netrw in vim 7.2 windows

I use the x (execute) command a lot

" Netrw Directory Listing (netrw
v132)
" Sorted by time
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by
x:exec
"
============================================================================

Works fine in vim70, but I recently changed to vim 7.2 and I sometime get
this:

Press <cr> to continue

instead of opening the file with the file association. I'm running Windows
XP SP 3

Any ideas what's wrong?

Thanks


Jack

--
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

Re: How to fix broken automatic indentation in vim

On 2010-04-28, Didlybom wrote:

> Gary,
>
> thanks for your effort in trying to help me find the problem. Did you try to
> format the file using your vim installation? I'd like to confirm that the
> problem really is not with my vim installation but with the plugin itself as
> you suspect. If the problem is with the plugin I will try to contact the
> author and hopefully he'll be able to help me.

Didly,

I fetched your example.vhd using wget to a machine running Linux.
I then re-indented it using my standard configuration and saw the
problem. Then I followed the procedure I used before,

vim -N -u NONE
:filetype plugin indent on
:set sw=2
gg=G

and still saw the indenting problems.

I had not looked at your example_indented.vhd file, so I did that
just now. If I leave 'sw' at the default of 8 and re-indent your
example.vhd, my result is identical to your example_indented.vhd.


I neglected to mention this earlier, but the convention on this list
is to put the text of one's reply at the bottom of the post rather
than at the top. I appreciate that you do trim your replies,
though.

Regards,
Gary

--
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

Re: Marking lines for deletion

> While AK has provided another terse answer (use line-wise visual mode), if
> there's something notable about the end, you can often use it as a motion
> such as
>
>  d}
>
> to delete from the current location down to the next blank line.  If you
> want to force an otherwise-character-wise motion to be line-wise, you can
> use "V" as an infix operator:
>
>  dV}
>
> as detailed at
>
>  :help o_V
>
> (a subsection of the corresponding "FORCING A MOTION TO BE LINEWISE,
> CHARACTERWISE OR BLOCKWISE")
>
> Reading through
>
>  :help motion.txt
>
> gives you an abundance of motions you can use with operators (such as "d" in
> your case) that can make your editing much faster.
>
> -tim
>
>

Thanks, Tim, I will go through those docs.


--
Dotan Cohen

http://bido.com
http://what-is-what.com

--
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

Re: Marking lines for deletion

On 28 April 2010 21:53, AK <andrei.avk@gmail.com> wrote:
> V
>

Thank you!


--
Dotan Cohen

http://bido.com
http://what-is-what.com

--
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

Re: Marking lines for deletion

On 04/28/2010 01:53 PM, Dotan Cohen wrote:
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?

While AK has provided another terse answer (use line-wise visual
mode), if there's something notable about the end, you can often
use it as a motion such as

d}

to delete from the current location down to the next blank line.
If you want to force an otherwise-character-wise motion to be
line-wise, you can use "V" as an infix operator:

dV}

as detailed at

:help o_V

(a subsection of the corresponding "FORCING A MOTION TO BE
LINEWISE, CHARACTERWISE OR BLOCKWISE")

Reading through

:help motion.txt

gives you an abundance of motions you can use with operators
(such as "d" in your case) that can make your editing much faster.

-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

Re: Marking lines for deletion

On 04/28/2010 02:53 PM, Dotan Cohen wrote:
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?
>
> Thanks!
>
>

V

--
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

Marking lines for deletion

I use VIM for editing mails. Often I must trim responses, but I do not
know in advance how many lines. Is there a way to mark "start delete",
then J my way down to the last line, and there to active the delete?

Thanks!

--
Dotan Cohen

http://bido.com
http://what-is-what.com

--
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

Re: one instance of gvim on windows?

On Mar 2, 8:46 am, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Mar 1, 7:46 pm, Bee <200...@calcentral.com> wrote:
>
> > One of the reasons I use vim; it is available AND the same on all
> > three platforms, Unix, Mac, Win. The real reason; vim is great.
>
> > Now... sometimes I must work in Windows, when I double click a
> > document it opens gvim, and that is good. But when I double click
> > another document, another instance of gvim is spawned.
>
> > On Windows, is it possible to prevent new instances of gvim and have
> > the document open in the current gvim by double clicking?
>
> http://vim.wikia.com/wiki/Windows_file_associations
>
> or
>
> http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Windows
>
> should get you going.

From:
> http://vim.wikia.com/wiki/Windows_file_associations

This example is exactly the format I was looking for:

assoc .c=sourcecode
assoc .h=sourcecode
assoc .pl=sourcecode
assoc .py=sourcecode
ftype sourcecode="C:\Program Files\Vim\vim72\gvim.exe" --remote-silent
"%1"

Now double clicking files opens only one instance of vim and only one
tab.

Thank you.

--
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

Re: How to fix broken automatic indentation in vim

On Apr 28, 4:38 am, Didlybom <didly...@gmail.com> wrote:
> On the second system in which I tried this I downloaded the Vim 7.2
> installer fromwww.vim.org so I assume that it is as recent as it gets.
>

Not quite. This installer is a couple years old and has not been
updated with any of the patches and bugfixes that have occurred since
it was released.

For Windows, Steve Hall maintains a Vim installer with all the latest
patches and most recent official runtime files at the time of the
patch, available here:

http://sourceforge.net/projects/cream/

There are two different installers in this project, one for a "plain
Vim" which is basically equivalent to the installer on www.vim.org,
but with all the recent updates, and another for a "point-and-click"
configuration (which I tried recently after installing it for my
wife's use...it drives me nuts, but mostly just because I know that
Vim has so much more that it can do, not made readily available).

--
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

Re: How to fix broken automatic indentation in vim

Gary,

thanks for your effort in trying to help me find the problem. Did you try to
format the file using your vim installation? I'd like to confirm that the
problem really is not with my vim installation but with the plugin itself as
you suspect. If the problem is with the plugin I will try to contact the
author and hopefully he'll be able to help me.

BTW, the file with which I have the problem uses the VHDL-93 syntax (which
is the latest widely used syntax, BTW).

Cheers,

Didly


Gary Johnson-4 wrote:
>
> I don't know VHDL, but I see those problems you pointed out and it
> doesn't seem right to me, either.
>
>> I think that perhaps I originally had 2 problems. One was probably caused
>> by
>> something on my .vimrc setup, but there seems to be something else.
>>
>> Could there be some problem related to the format of the file? Some of
>> these
>> files have been edited in Windows and in Linux. Could there be some mix
>> of
>> line endings that could confuse vim somehow? When I open the file I do
>> not
>> see any "^M" symbol on the line endings so I assumed that their format
>> was
>> correct.
>
> As long as you don't see any ^Ms, the file uses only Unix or only
> DOS line endings and you should be OK.
>
> I don't know what the problem is, but it seems to be in the indent
> plugin and not with your configuration. I looked briefly at the
> plugin, $VIMRUNTIME/indent/vhdl.vim, and didn't see anything obvious
> in the way of settings that would affect these issues. You might
> have a look and see what you think. The author's name and address
> are in that file so you might try contacting him directly. That
> file says that it supports the "'93 syntax" if that means anything
> to you. The plugin I have also says that it is version 1.54, last
> changed on 2007 Aug 17.
>
> Regards,
> Gary
>
> --
> 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
>
>

--
View this message in context: http://old.nabble.com/How-to-fix-broken-automatic-indentation-in-vim-tp28379120p28391063.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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

Re: $HOME variable not set properly in XP - showing "test"

Hi,

kp wrote:
>
> I am having problem in my XP machine.
> While closing GVIM window, I get an error "Can't write viminfo file
> test\_viminfo"
> This is irritating as I needs to press Enter at every time.
>
> When I debugged further it says $HOME is set to "test"!!!!!!!!!!!!
>
> Not sure why this is like this?
>
> The other variables look fine.
> $VIMRUNTIME = C:\Program Files\Vim\Vim72
> $HOMEDRIVE = C:
> $HOMEPATH = \Documents and Settings\kp
>
> Can you please let me know the solution?

is $HOME set to "test" outside of Vim, too? You can check this with

echo %HOME%

in a "stand-alone" command line window. (Don't do this from a command
line window started with

:sh

from inside Vim. This would inherit the incorrect value from Vim.)
Normally Windows does not define %HOME%, just %HOMEDRIVE% and
%HOMEPATH%, and Vim uses these two variable to initialize its own $HOME
variable whenever %HOME% is not set.

If it is not set outside of Vim it must have been changed from .vimrc or
a plugin file. You can either check every Vim script that gets
mentioned in the output of

:scriptnames

manually or try something like (all on one line)

:vimgrep /\clet $HOME.*=.*test/ $VIMRUNTIME/**/*.vim
$VIM/vimfiles/**/*.vim

Another cause might be a batch file that you use to start Vim and which
sets the value of %HOME%.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
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

Re: How to fix broken automatic indentation in vim

On 2010-04-28, Didlybom wrote:
> Gary,
>
> I do not have the same ~/.vimrc on both computers. In the first computer I
> have a heavily modified .vimrc file. However, on the second computer I did a
> fresh Vim 7.2 install. I actually went to www.vim.org and downloaded the vim
> installer from there. Thus the .vimrc file on the second computer should be
> the default.
>
> However, I did try what you suggested. I executed "vim -N -u NONE", set the
> "filetype plugin indent on" setting and loaded the example file. When I
> issued the "gg=G" command the indentation worked fine.
>
> However, I then tried to indent a VHDL file. This is a simple VHDL which I
> put online. Hopefuly you can access it through:
> http://old.nabble.com/file/p28386622/example.vhd example.vhd .
>
> Again, I opened vim using "vim -N -u NONE", set "filetype indent plugin on"
> and opened the file. I used the "gg=G" command and let vim indent the file.
> Unfortunately I found that vim did not do a good job and that the
> indentation was not good at all :-(
>
> I saved and uploaded the file after indenting into
> http://old.nabble.com/file/p28386622/example_indented.vhd
> example_indented.vhd . If you can open it you will see that the "type
> secondStruct" is not indented properly. Also, the comments (beginning with
> "--") are not indented right and the final "END;" is not indented properly
> either.
>
> Could you give it a try and see if you have the same problem that I do?

I don't know VHDL, but I see those problems you pointed out and it
doesn't seem right to me, either.

> I think that perhaps I originally had 2 problems. One was probably caused by
> something on my .vimrc setup, but there seems to be something else.
>
> Could there be some problem related to the format of the file? Some of these
> files have been edited in Windows and in Linux. Could there be some mix of
> line endings that could confuse vim somehow? When I open the file I do not
> see any "^M" symbol on the line endings so I assumed that their format was
> correct.

As long as you don't see any ^Ms, the file uses only Unix or only
DOS line endings and you should be OK.

I don't know what the problem is, but it seems to be in the indent
plugin and not with your configuration. I looked briefly at the
plugin, $VIMRUNTIME/indent/vhdl.vim, and didn't see anything obvious
in the way of settings that would affect these issues. You might
have a look and see what you think. The author's name and address
are in that file so you might try contacting him directly. That
file says that it supports the "'93 syntax" if that means anything
to you. The plugin I have also says that it is version 1.54, last
changed on 2007 Aug 17.

Regards,
Gary

--
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

$HOME variable not set properly in XP - showing "test"

Hi all,

I am having problem in my XP machine.
While closing GVIM window, I get an error "Can't write viminfo file test\_viminfo"
This is irritating as I needs to press Enter at every time.

When I debugged further it says $HOME is set to "test"!!!!!!!!!!!!

Not sure why this is like this?

The other variables look fine.
$VIMRUNTIME = C:\Program Files\Vim\Vim72
$HOMEDRIVE = C:
$HOMEPATH = \Documents and Settings\kp

Can you please let me know the solution?

Thanks,
Krishna


--
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

How to map to for modeless selection

Hello,

I do not use <C-LeftMouse> for tags but I am very fond of <C-S-
LeftMouse> for modeless selection while editing.

Is there a way to remap <C-LeftMouse> to <C-S-LeftMouse>.

I tried "map <C-LeftMouse> <C-S-LeftMouse>" with no success.

Best regards

Jean Johner

--
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

Re: How to fix broken automatic indentation in vim

Ben,

On the second system in which I tried this I downloaded the Vim 7.2
installer from www.vim.org so I assume that it is as recent as it gets.

Cheers,

Didly


Ben Fritz wrote:
>
>
>
> On Apr 27, 11:29 am, Didlybom <didly...@gmail.com> wrote:
>> I have tried using different combinations of the autoindent, smartindent
>> and
>> cindent settings. After going through these forums I have also made sure
>> that the "syntax", "filetype", "filetype indent" and "filetype plugin
>> indent" are set to on. Still, it does not work. Also, if I do "set
>> syntax?"
>> I get "matlab" for matlab files and "vhdl" for vhdl files which is
>> correct.
>> And if I do "set indentexpr?" I get "GetMatlabIndent(v:lnum)" for matlab
>> files and "GetVHDLindent()" for vhdl files.
>>
>
> I know filetype indent plugins *should* override these options, but in
> general you should NOT set cindent in your .vimrc, you should rely on
> the filetype indent rules to set it for you. You should also not have
> smartindent on in combination with any other indent option. I would
> say you should not have smartindent on at all...but I know there are a
> few people who actually prefer the behavior of this option.
> Regardless, it's supposed to work *instead* of, not in addition to,
> filetype indent rules.
>
> Your indentexpr values indicate the correct rules are being applied,
> but make sure cindent, smartindent, and possibly even autoindent are
> all turned off as well. Also check that 'equalprg' is empty.
>
> Other than that, it may be an error in your indent scripts (though
> this is unlikely). Are your runtime files fairly recent?
>
> --
> 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
>
> Subscription settings:
> http://groups.google.com/group/vim_use/subscribe?hl=en
>
>

--
View this message in context: http://old.nabble.com/How-to-fix-broken-automatic-indentation-in-vim-tp28379120p28386632.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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

Re: How to fix broken automatic indentation in vim

Gary,

I do not have the same ~/.vimrc on both computers. In the first computer I
have a heavily modified .vimrc file. However, on the second computer I did a
fresh Vim 7.2 install. I actually went to www.vim.org and downloaded the vim
installer from there. Thus the .vimrc file on the second computer should be
the default.

However, I did try what you suggested. I executed "vim -N -u NONE", set the
"filetype plugin indent on" setting and loaded the example file. When I
issued the "gg=G" command the indentation worked fine.

However, I then tried to indent a VHDL file. This is a simple VHDL which I
put online. Hopefuly you can access it through:
http://old.nabble.com/file/p28386622/example.vhd example.vhd .

Again, I opened vim using "vim -N -u NONE", set "filetype indent plugin on"
and opened the file. I used the "gg=G" command and let vim indent the file.
Unfortunately I found that vim did not do a good job and that the
indentation was not good at all :-(

I saved and uploaded the file after indenting into
http://old.nabble.com/file/p28386622/example_indented.vhd
example_indented.vhd . If you can open it you will see that the "type
secondStruct" is not indented properly. Also, the comments (beginning with
"--") are not indented right and the final "END;" is not indented properly
either.

Could you give it a try and see if you have the same problem that I do?

I think that perhaps I originally had 2 problems. One was probably caused by
something on my .vimrc setup, but there seems to be something else.

Could there be some problem related to the format of the file? Some of these
files have been edited in Windows and in Linux. Could there be some mix of
line endings that could confuse vim somehow? When I open the file I do not
see any "^M" symbol on the line endings so I assumed that their format was
correct.

Thanks,

Didly

Gary Johnson-4 wrote:
>
> You have the same problem on both computers and you're using the
> same ~/.vimrc on both? Hmm.
>
> It works fine for me. I copied your example code into a file named
> foo.m. Then I started vim as
>
> vim -N -u NONE
>
> to avoid loading any configuration files at all. Within vim I
> executed
>
> :filetype plugin indent on
> :e foo.m
> gg=G
>
> The result was that both indented lines were re-indented by 8
> spaces, which makes sense since 'shiftwidth' defaults to 8.
>
> I don't know what's specifically wrong with your ~/.vimrc since I
> don't know what's in it. The indent plugin should override your
> 'cindent' and 'smartindent' settings, so those shouldn't be a
> problem. As I demonstrated above, you don't need anything in your
> ~/.vimrc other than
>
> filetype plugin indent on
>
> and
>
> set shiftwidth=4
>
> to get the indentation you want.
>
> HTH,
> Gary
>
> --
> 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
>
> Subscription settings:
> http://groups.google.com/group/vim_use/subscribe?hl=en
>
>

--
View this message in context: http://old.nabble.com/How-to-fix-broken-automatic-indentation-in-vim-tp28379120p28386622.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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

Re: FAQ 19.2 toggle set option ?

On Wed, Apr 28, 2010 at 3:07 AM, stosss <stosss@gmail.com> wrote:
> I read:
>
> http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#19.2
>
> and
>
> :help set-option
>
> I don't understand how this:
>
> :se[t] {option}!   or
> :se[t] inv{option}
>
> works
>
> I want to be able to use one <F> key to toggle between :set wrap and :set nowrap
>
> I don't know how to do this but it appears that it can be done.

Never mind I had tried several ways before sending the OP but not the
right one. I got it.

noremap <F12> :se wrap!<CR>

--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

FAQ 19.2 toggle set option ?

I read:

http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#19.2

and

:help set-option

I don't understand how this:

:se[t] {option}! or
:se[t] inv{option}

works

I want to be able to use one <F> key to toggle between :set wrap and :set nowrap

I don't know how to do this but it appears that it can be done.

--
If we can but prevent the government from wasting the labours of the
people, under the pretence of taking care of them, they must become
happy. - Thomas Jefferson

--
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

Tuesday, April 27, 2010

Re: A 'visible within the window' range?

Hi,

Duane Johnson wrote:
>
> So the % symbol is a special range that means 'the whole file'. Is
> there a similar special symbol that means 'what is visible in the
> window'?
>
> For example, say I can see three instances of the word 'abracadabra'
> on the screen. I want to change them to 'wizard' but don't want to
> affect any other parts of the file. Is there a way to do this without
> entering visual mode? If not, is there a way to select all visible
> lines so that (in visual mode) I can do:
>
> :*s/abracadabra/wizard/r

as Tim already wrote * might be a shorthand for the range '<,'> . If
you don't need this shorthand you can use this mapping to replace the
asterisk with the line number of the first and last line of the current
window

cmap <expr> * (getcmdpos() == 1) ? line('w0') . ',' . line('w$') : '*'

This replaces the asterisk only if it's the first character on the line.
Of course you can also use any other key for this.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
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