Friday, September 30, 2011

replace e flag works in command but fails if that command in key mapping

The e option in

:s/\<[a-z]/\u&/ge

duly suppresses the error message if used as a command, but fails when used
in the following key mapping in .vimrc

" Type ;c to ConcatenateTitles and accumulate them in register z
:map ;c :s/\<[a-z]/\u&/ge<CR>:s/[ ,.;:'"]//ge<CR>"Zyy

producing "E486: Pattern not found: \<[a-z]" and failing to complete the
command string

Why different?

--
View this message in context: http://vim.1045645.n5.nabble.com/replace-e-flag-works-in-command-but-fails-if-that-command-in-key-mapping-tp4858038p4858038.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: Link to part of the same file

On 30/09/11 19:04, Fernando Basso wrote:
> What would be a good way (if possible at all) to have vim link, say, a
> table of contents to each section? I use vim for taking all kinds of
> notes and that would be terrific.
>
> Thanks in advance.
>

It depends on the filetype (tables of contents are written very
differently in Vim helpfiles and in HTML, and they're implicit in
Wikimedia source) so you would have to code an ad-hoc filetype-dependent
function. Probably set it up in ~/.vim/after/ftplugin/<filetype>.vim
(replacing <filetype> by the filetype, and, on Windows only, .vim by
vimfiles), possibly with the bulk of the function code in some autoload
script.

See
:help after-directory
:help autoload


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
189. You put your e-mail address in the upper left-hand corner of envelopes.

--
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: setloclist() doesn't work

On Sep 30, 8:34 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 30/09/11 08:44, sinbad wrote:
>
> > hi,
>
> > i am trying to store the contents of location list, so as to use
> > multiple location lists for the same split-window window.
> > here is what i did. created a location list for some pattern.
> > now i ran the following commands in vi.
>
> I hope you mean Vim, and in 'nocompatible' mode. Legacy vi has no
> quickfix capabilities.
>
>
>
> > :let x= getloclist(0)
> > :call setloclist(0, x, 'r')
>
> > location-list is screwed up, i can see some contents in the location
> > list
> > with filename missing. is it the rightway of using get/setloclist()
> > functions.
>
> > thanks
>
> Does it work if you omit the ,'r' (last argument of setloclist())?
>
> Best regards,
> Tony.
> --
> Do what comes naturally now.  Seethe and fume and throw a tantrum.

I tried that, it doesn't work too. when i print the stored list 'x' it
seems to have
all the values properly. but after i use setloclist(0,x) and open the
location list
the valid bit is set to '0'. i am not sure if i am using it wrongly or
if there is a
bug in the setloclist() function.

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

Link to part of the same file

What would be a good way (if possible at all) to have vim link, say, a
table of contents to each section? I use vim for taking all kinds of
notes and that would be terrific.

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

Encoding questions for vcscommand plugin users

vcscommand plugin users,

I'm currently working on some changes to the vcscommand plugin to make
it play more nicely in localized environments.  Unfortunately, I don't
have a good sense of how people use the various dials vim provides to
customize such a setting, or how that interacts with localization
settings outside of vim.  I would therefore very much appreciate any
help that could be provided by users whose environment isn't straight
utf-8 across the board.

Please feel free to reply off-list if appropriate.

The changes I'm considering can be found in the dev/encoding branch in
the plugin repo:

http://repo.or.cz/w/vcscommand.git/shortlog/refs/heads/dev/encoding

A copy of the plugin with the proposed changes can be downloaded at:

http://repo.or.cz/w/vcscommand.git/snapshot/e144820c27acff083aaa1ddc3969fa4dc7906a30.zip

The rules I am considering following are as follow:

1.  When reading the output of a VCS command execution:
1A.  If &tenc and &enc differ, transcode the output from &tenc to &enc;
1B.  Otherwise if the command is one of (Diff, Annotate, Review), and
&fenc differs from &enc, transcode from &fenc to &enc

2.  When committing, if &tenc and &enc differ, transcode the message
from &enc to &tenc.

(1A) was a patch from Xavier Wang.  (1B) is made under the assumption
that the file output coming from the VCS is encoded as &fenc as well.
This may fail in annotate if the annotations added by the VCS are not
in the same encoding as the file content.

(2) is made under the assumption that the user expects the encoding of
the log message to respect &tenc.

I have tested a few scenarios that I guessed are likely, but I am a
novice with respect to typical usage of localization settings.  Do the
assumptions above make sense?

Thank you for your help,

bob

--
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: setloclist() doesn't work

On 30/09/11 08:44, sinbad wrote:
> hi,
>
> i am trying to store the contents of location list, so as to use
> multiple location lists for the same split-window window.
> here is what i did. created a location list for some pattern.
> now i ran the following commands in vi.

I hope you mean Vim, and in 'nocompatible' mode. Legacy vi has no
quickfix capabilities.

>
> :let x= getloclist(0)
> :call setloclist(0, x, 'r')
>
> location-list is screwed up, i can see some contents in the location
> list
> with filename missing. is it the rightway of using get/setloclist()
> functions.
>
> thanks
>
>

Does it work if you omit the ,'r' (last argument of setloclist())?


Best regards,
Tony.
--
Do what comes naturally now. Seethe and fume and throw a tantrum.

--
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 as default email (thunderbird) editor

On Sep 30, 5:43 am, Calon <calon...@gmail.com> wrote:
> Tried on Windows, got the same error message when press Ctrl+E.
> Then drag External Editor icon to the toolbar, and click the new icon, it
> just works fine.

Since I didn't see any "Installation" instructions in the page, I
assumed I'd just
install it as any other add-on. I was going to post a comment the add-
on page,
where it says "react to this article", and just above the textarea
there was
this text:

====================================================================
Installation
The External Editor button is not visible by default; you must
customize your composer toolbar:

Open the compose window
Select the menu View/Toolbars/Customize..., or right click on the
toolbar and select Customize...
Drag and Drop the new icon External Editor on your toolbar
Click OK

Then, open the extension option window and set your editor (without
path or with an absolute path)
====================================================================

It is working now, but I don't need to mouse-click the icon. Ctrl-E
does it as well.

SOLVED.

Thanks everybody for all the tips. I liked vmail and and
mutt, although I still need to get more skilled at them.

--
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 as default email (thunderbird) editor

Thanks for your input, Calon. This in fact does the trick (still an error in the plugin); I would never have tried this myself...

Have a nice weekend

--
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: Outline in MacVim

that helped.
Thank you.
You can search in http://www.vimoutliner.org/postnuke-phoenix-0.7.2.3/html/

George Papanikolaou

--
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 as default email (thunderbird) editor

Tried on Windows, got the same error message when press Ctrl+E.
Then drag External Editor icon to the toolbar, and click the new icon, it just works fine.

On Thu, Sep 29, 2011 at 9:12 PM, Fernando Basso <fernandobasso.br@gmail.com> wrote:


On Sep 29, 9:46 am, Reid Thompson <Reid.Thomp...@ateb.com> wrote:
> On Thu, 2011-09-29 at 04:55 -0700, Fernando Basso wrote:
> > I'm running linux (arch linux). I tried with
>
> you may have already tried this and or it may not help, but ...
>
> try running thunderbird from the command line and attempt to use the
> external editor and see if there are any valid error messages output to
> the terminal that point you to the issue

   thunderbird --jsconsole

Thunderbird's Error Console showed this when I tried to launch
the external editor:

   Error: document.getElementById("exteditor_editAsHtml") is null
   Source File: chrome://exteditor/content/exteditor.js
   Line: 442

"thunderbird" alone in the terminal doesn't show anything, neither
does "thunderbird --g-fatal-warinings".


--
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 as default email (thunderbird) editor

Not working here (Windows 2003, Thunderbird 7.0, exteditor 1.0).

Same error in JS Console.

This seems to be an error in the plugin; even when using "notepad" as the text editor, it would not get called (verified with procmon).

=> Faulty plugin; nothing to do with GVim.

This returns us to the original question: Is there any working combination of GVim with Thunderbird 7.0?

--
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, September 29, 2011

setloclist() doesn't work

hi,

i am trying to store the contents of location list, so as to use
multiple location lists for the same split-window window.
here is what i did. created a location list for some pattern.
now i ran the following commands in vi.

:let x= getloclist(0)
:call setloclist(0, x, 'r')

location-list is screwed up, i can see some contents in the location
list
with filename missing. is it the rightway of using get/setloclist()
functions.

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: creating a new location list

On Sep 29, 10:56 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Sep 29, 12:48 am, sinbad <sinbad.sin...@gmail.com> wrote:
>
> > hi,
>
> > i know that we can have multiple location lists for a window.
> > i read through the documentation but couldn't find the command
> > or function that creates a new location list. lexpr doesn't take
> > window
> > nr as argument. so i was wondering how can i create a new location
> > list.
> > every time i use lexpr, the old location list will be rewritten. i am
> > missing some
> > thing here ?
>
> You cannot have multiple location lists per Vim split-window window.
> You can only have one per split window.
>
> However, you can have multiple location lists in one Vim OS window, if
> you make a new one on each split-window window.
>
> This is in comparison to the quickfix list, which is shared by all
> windows in all tabs.

oh crap! it would have been great if multiple location lists are
allowed per
split-window window. let me see if i can do it manually by loclist()
functions.

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: Vim as default email (thunderbird) editor

On Sep 28, 2011, at 7:18 AM, Fernando Basso wrote:

> I simply cannot stand any other editor anymore. There is no life after
> vim.

Do you know about this?
http://www.hogbaysoftware.com/products/quickcursor

Or this? [Only for gmail, though.
http://danielchoi.com/software/vmail.html

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"What is man without the beasts? If all the beasts were gone,
men would die from a great loneliness of spirit."

- Chief Seattle


--
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: creating a new location list

On Sep 29, 12:48 am, sinbad <sinbad.sin...@gmail.com> wrote:
> hi,
>
> i know that we can have multiple location lists for a window.
> i read through the documentation but couldn't find the command
> or function that creates a new location list. lexpr doesn't take
> window
> nr as argument. so i was wondering how can i create a new location
> list.
> every time i use lexpr, the old location list will be rewritten. i am
> missing some
> thing here ?

You cannot have multiple location lists per Vim split-window window.
You can only have one per split window.

However, you can have multiple location lists in one Vim OS window, if
you make a new one on each split-window window.

This is in comparison to the quickfix list, which is shared by all
windows in all tabs.

--
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: creating a new location list

On 29/09/11 07:48, sinbad wrote:
> hi,
>
> i know that we can have multiple location lists for a window.
> i read through the documentation but couldn't find the command
> or function that creates a new location list. lexpr doesn't take
> window
> nr as argument. so i was wondering how can i create a new location
> list.
> every time i use lexpr, the old location list will be rewritten. i am
> missing some
> thing here ?
>
> thanks
> sinbad
>

Most quickfix and location-list commands are documented under :help quickfix

There are various ways to create a new location list:

:lfile [errorfile]
read the errorfile and jump to the first error

:lhelpgrep {pattern}[@xx]
search the help for the pattern (if @xx is given, it's a language code)
and return the results as a location list for the help window. If the
current window is not a help window, its location list isn't changed.

:lvimgrep[!] /pattern/[g][j] {file}...
search the named file(s) for the pattern and return the result as a
location list

similarly :lgrep, :lmake, etc.


Best regards,
Tony.
--
Razors pain you;
Rivers are damp;
Acids stain you;
And drugs cause cramp.
Guns aren't lawful;
Nooses give;
Gas smells awful;
You might as well live.
-- Dorothy Parker

--
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: creating a new location list

On 09:18 Thu 29 Sep , sinbad wrote:
> On Sep 29, 10:48 am, sinbad <sinbad.sin...@gmail.com> wrote:
> > hi,
> >
> > i know that we can have multiple location lists for a window.
> > i read through the documentation but couldn't find the command
> > or function that creates a new location list. lexpr doesn't take
> > window
> > nr as argument. so i was wondering how can i create a new location
> > list.
> > every time i use lexpr, the old location list will be rewritten. i am
> > missing some
> > thing here ?
> >
> > thanks
> > sinbad
>
> can anyone please shed some light on this ?
>
> --
> 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

I think you can have just one loction list per window, though it is easy to
save and restore location lists using getloclist() and setloclist()
functions.

Best,
Marcin

--
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: creating a new location list

On Sep 29, 10:48 am, sinbad <sinbad.sin...@gmail.com> wrote:
> hi,
>
> i know that we can have multiple location lists for a window.
> i read through the documentation but couldn't find the command
> or function that creates a new location list. lexpr doesn't take
> window
> nr as argument. so i was wondering how can i create a new location
> list.
> every time i use lexpr, the old location list will be rewritten. i am
> missing some
> thing here ?
>
> thanks
> sinbad

can anyone please shed some light on this ?

--
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: Outline in MacVim

On Thu, Sep 29, 2011 at 3:40 PM, George Papanikolaou <g3orge.app@gmail.com> wrote:
yup.
that was it, it worked. I "think" it's installed now.
and I say that because I don't know how to trigger it.
the ",,cb" command does nothing. What's wrong? Does it need activate or something inside a file?

Thank you for your help

On [29], at 9:53 AM, Francesc Salvat-Pujol wrote:

On Wed, Sep 28, 2011 at 10:56 PM, g3orge pap <g3orge.app@gmail.com> wrote:
I didn't really manage to do that.
The video's quality is poor, and I could make the install.sh script to
run
Also the manual installation, didn't worked as well.
Any thoughts?

On Sep 28, 7:06 pm, Walkman_ <w2lk...@gmail.com> wrote:
> There is a plugin called "vimoutliner". It's great, I use it every day.
> Here you can find it:https://github.com/vimoutliner/vimoutliner.git
> Here is a long video of what it can do and how to use:http://video.google.com/videoplay?docid=8810772602188234059
>
> On Wed, Sep 28, 2011 at 5:32 PM, George Papanikolaou
> <g3orge....@gmail.com>wrote:
>
> > Hi,
> > is there any way to make vim work like an outline application (like
> > OmniOutliner)??
> > I don't know. A command to enable and one to disable the feature.
>
> > Thank you 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, visithttp://www.vim.org/maillist.php
>
> --
> Walkman

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

What was the problem with the install script? I recall obtaining an error which was solved by renaming the function "sure?" (no "")  to "sure_".  Then everything worked.

HTH

Cesc

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


Try:    vim caca.otl

Then edit a few lines with different levels of tab indentations. Try the ,,cb and you should get checkboxes at the beginning of the line. BTW, have you found any documentation aside from the video and :h vo ? I was wondering if there is a way of having an (automatically) numbered list or so, so that when you enter

1. First thing

and hit return, a line with

2.

appears.

Happy outlining,

Cesc

--
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: Outline in MacVim

yup.
that was it, it worked. I "think" it's installed now.
and I say that because I don't know how to trigger it.
the ",,cb" command does nothing. What's wrong? Does it need activate or something inside a file?

Thank you for your help

On [29], at 9:53 AM, Francesc Salvat-Pujol wrote:

On Wed, Sep 28, 2011 at 10:56 PM, g3orge pap <g3orge.app@gmail.com> wrote:
I didn't really manage to do that.
The video's quality is poor, and I could make the install.sh script to
run
Also the manual installation, didn't worked as well.
Any thoughts?

On Sep 28, 7:06 pm, Walkman_ <w2lk...@gmail.com> wrote:
> There is a plugin called "vimoutliner". It's great, I use it every day.
> Here you can find it:https://github.com/vimoutliner/vimoutliner.git
> Here is a long video of what it can do and how to use:http://video.google.com/videoplay?docid=8810772602188234059
>
> On Wed, Sep 28, 2011 at 5:32 PM, George Papanikolaou
> <g3orge....@gmail.com>wrote:
>
> > Hi,
> > is there any way to make vim work like an outline application (like
> > OmniOutliner)??
> > I don't know. A command to enable and one to disable the feature.
>
> > Thank you 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, visithttp://www.vim.org/maillist.php
>
> --
> Walkman

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

What was the problem with the install script? I recall obtaining an error which was solved by renaming the function "sure?" (no "")  to "sure_".  Then everything worked.

HTH

Cesc

--
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: Insert a tab or call a function

On 09/29/2011 08:15 AM, Christian Brabandt wrote:
> On Thu, September 29, 2011 1:52 pm, AK wrote:
>> On 09/29/2011 01:58 AM, Benjamin R. Haskell wrote:
>>> On Wed, 28 Sep 2011, AK wrote:
>>>> Hi, I'm trying to write a small function that is called when I press
>>>> tab key and checks if current line is empty; if it is, it should
>>>> insert a tab, and if not, it should call two other functions. Here's
>>>> the example of what I came up with, which does not work right:
>>>
>>> Wanting to either insert something or run another function is a good
>>> case for<expr> mappings. It depends a bit on how TriggerSnippet works,
>>> the following might be all you need:
>>>
>>> fun! DoTab()
>>> if getline('.') =~ '^\s*$'
>>> return "\<tab>"
>>> else
>>> call CloseMenu()
>>> return TriggerSnippet()
>>> endif
>>> endfun
>>> ino<expr> <tab> DoTab()
>>
>> I get 'E523: not allowed here' in TriggerSnippet. I tried :set secure ,
>> but that did not help.
>
> I think what happens is, that one of your functions triggers an
> action, that is not allowed inside an expr-mapping. If you need to do
> something like this, you need to have the functions return the
> commands, that will do that.
>
> See :h :map-<expr>
> and look at the third paragraph.
>
> regards,
> Christian
>


Ok, I think I'm getting there: I've added the check to the
top of TriggerSnippet:

if getline('.') =~ '^\s*$'
" return "\<tab>"
call feedkeys("\<tab>", 'n') | return ''
endif

Now the issue is only that when I go to a new line by pressing
enter, first tab I press is 'eaten'. Nothing happens at all.
Subsequent tabs work fine. If I press 'a' key at the end of
an existing empty line, tab also works fine, i.e. the first
tab does not get 'eaten'.

The same behaviour occurs if I uncomment the 2nd line in
code I pasted.

If I understand right, when a new line is created, it's indent
is 'virtual', and that seems to cause this problem. I still
don't understand why, though, since tab should not be affected
by indent being virtual or not.. I may be completely off track
here..

-ak

--
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 as default email (thunderbird) editor

On Sep 29, 9:46 am, Reid Thompson <Reid.Thomp...@ateb.com> wrote:
> On Thu, 2011-09-29 at 04:55 -0700, Fernando Basso wrote:
> > I'm running linux (arch linux). I tried with
>
> you may have already tried this and or it may not help, but ...
>
> try running thunderbird from the command line and attempt to use the
> external editor and see if there are any valid error messages output to
> the terminal that point you to the issue

thunderbird --jsconsole

Thunderbird's Error Console showed this when I tried to launch
the external editor:

Error: document.getElementById("exteditor_editAsHtml") is null
Source File: chrome://exteditor/content/exteditor.js
Line: 442

"thunderbird" alone in the terminal doesn't show anything, neither
does "thunderbird --g-fatal-warinings".


--
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 as default email (thunderbird) editor

On Thu, 2011-09-29 at 04:55 -0700, Fernando Basso wrote:

> I'm running linux (arch linux). I tried with

you may have already tried this and or it may not help, but ...

try running thunderbird from the command line and attempt to use the
external editor and see if there are any valid error messages output to
the terminal that point you to the issue


--
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: Insert a tab or call a function

On 09/29/2011 08:15 AM, Christian Brabandt wrote:
> On Thu, September 29, 2011 1:52 pm, AK wrote:
>> On 09/29/2011 01:58 AM, Benjamin R. Haskell wrote:
>>> On Wed, 28 Sep 2011, AK wrote:
>>>> Hi, I'm trying to write a small function that is called when I press
>>>> tab key and checks if current line is empty; if it is, it should
>>>> insert a tab, and if not, it should call two other functions. Here's
>>>> the example of what I came up with, which does not work right:
>>>
>>> Wanting to either insert something or run another function is a good
>>> case for<expr> mappings. It depends a bit on how TriggerSnippet works,
>>> the following might be all you need:
>>>
>>> fun! DoTab()
>>> if getline('.') =~ '^\s*$'
>>> return "\<tab>"
>>> else
>>> call CloseMenu()
>>> return TriggerSnippet()
>>> endif
>>> endfun
>>> ino<expr> <tab> DoTab()
>>
>> I get 'E523: not allowed here' in TriggerSnippet. I tried :set secure ,
>> but that did not help.
>
> I think what happens is, that one of your functions triggers an
> action, that is not allowed inside an expr-mapping. If you need to do
> something like this, you need to have the functions return the
> commands, that will do that.
>
> See :h :map-<expr>
> and look at the third paragraph.


I would like to avoid changing trigger snippet function because it's
complicated and to be able to upgrade it later. The issue is,
I want to call the function using a mapping to <c-o>:call myfunc()<cr>
and then I want it to do the check, and to insert a literal tab without
any side effects if current line is empty; if line is not empty, I need
it to run CloseMenu and then trigger snippet.

When this line runs:

call feedkeys("\<tab>", 'n') | return ''

TriggerSnippet is triggered.. and I don't understand why that happens, I
thought this should input a literal tab?

-ak

--
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: Insert a tab or call a function

On Thu, September 29, 2011 1:52 pm, AK wrote:
> On 09/29/2011 01:58 AM, Benjamin R. Haskell wrote:
>> On Wed, 28 Sep 2011, AK wrote:
>>> Hi, I'm trying to write a small function that is called when I press
>>> tab key and checks if current line is empty; if it is, it should
>>> insert a tab, and if not, it should call two other functions. Here's
>>> the example of what I came up with, which does not work right:
>>
>> Wanting to either insert something or run another function is a good
>> case for <expr> mappings. It depends a bit on how TriggerSnippet works,
>> the following might be all you need:
>>
>> fun! DoTab()
>> if getline('.') =~ '^\s*$'
>> return "\<tab>"
>> else
>> call CloseMenu()
>> return TriggerSnippet()
>> endif
>> endfun
>> ino <expr> <tab> DoTab()
>
> I get 'E523: not allowed here' in TriggerSnippet. I tried :set secure ,
> but that did not help.

I think what happens is, that one of your functions triggers an
action, that is not allowed inside an expr-mapping. If you need to do
something like this, you need to have the functions return the
commands, that will do that.

See :h :map-<expr>
and look at the third paragraph.

regards,
Christian

--
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: Insert a tab or call a function

On Thu, September 29, 2011 1:53 pm, AK wrote:
> On 09/29/2011 01:30 AM, Christian Brabandt wrote:
>> On Wed, September 28, 2011 10:52 pm, AK wrote:
>>> Hi, I'm trying to write a small function that is called when I press
>>> tab
>>> key and checks if current line is empty; if it is, it should insert a
>>> tab, and if not, it should call two other functions. Here's the example
>>> of what I came up with, which does not work right:
>>>
>>> function! DoTab()
>>> if match(getline('.'), '^\s*$') != -1
>>> call feedkeys("\<tab>") | return ''
>>> else
>>> call CloseMenu()
>>> call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
>>> endif
>>> endfu
>>> ino<silent> <tab> <c-o>:call DoTab()<CR>
>>>
>>> CloseMenu is another function I have that closes a popup menu if it's
>>> open, TriggerSnippet is a snipmate function that expands current
>>> snippet.
>>
>> And now the question: What are you expecting and what do you see
>> instead?
>> Please don't let us guess, what is not working!
>
> Sorry, but it was just flickering the cursor on screen, so
> I thought it was some obvious error in the way I wrote it.

I think what happens is, that your call to feedkeys("\<tab>") triggers
the mapping again and again.

Use the second argument "n" to prevent that.

regards,
Christian

--
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 as default email (thunderbird) editor

On Sep 28, 8:31 pm, Reid Thompson <reid.thomp...@ateb.com> wrote:

> i didn't catch whether you noted windows or linux -- i can state that
> windows thunderbird 7.0 does work for me BUT only if the call to gvim
> uses the '-f' parameter.  The '--no-fork' parameter gives an error for
> me.    I have the full path declared    
> C:\MyPrograms\Vim\vim73\gvim.exe -f     for the plugin.

I'm running linux (arch linux). I tried with

gvim --nofork
gvim -f
/usr/bin/gvim -f (also: --nofork)
xterm -e vim --nofork (also: -f)

None of them worked. I even tried:

mv $HOME/.vimrc $HOME/dot_vimrc
mv $HOME/.vim/ $HOME/dot_vim

to see if any plugin or config was getting in the way, but
that didn't help either.

Thanks everybody for all the tips and suggestions on other
alternatives. I'm pondering and trying them all.


--
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: Insert a tab or call a function

On 09/29/2011 01:30 AM, Christian Brabandt wrote:
> On Wed, September 28, 2011 10:52 pm, AK wrote:
>> Hi, I'm trying to write a small function that is called when I press tab
>> key and checks if current line is empty; if it is, it should insert a
>> tab, and if not, it should call two other functions. Here's the example
>> of what I came up with, which does not work right:
>>
>> function! DoTab()
>> if match(getline('.'), '^\s*$') != -1
>> call feedkeys("\<tab>") | return ''
>> else
>> call CloseMenu()
>> call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
>> endif
>> endfu
>> ino<silent> <tab> <c-o>:call DoTab()<CR>
>>
>> CloseMenu is another function I have that closes a popup menu if it's
>> open, TriggerSnippet is a snipmate function that expands current
>> snippet.
>
> And now the question: What are you expecting and what do you see instead?
> Please don't let us guess, what is not working!
>
> regards,
> Christian
>


Sorry, but it was just flickering the cursor on screen, so
I thought it was some obvious error in the way I wrote it.

-ak

--
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: Insert a tab or call a function

On 09/29/2011 01:58 AM, Benjamin R. Haskell wrote:
> On Wed, 28 Sep 2011, AK wrote:
>
>> Hi, I'm trying to write a small function that is called when I press
>> tab key and checks if current line is empty; if it is, it should
>> insert a tab, and if not, it should call two other functions. Here's
>> the example of what I came up with, which does not work right:
>>
>> function! DoTab()
>> if match(getline('.'), '^\s*$') != -1
>> call feedkeys("\<tab>") | return ''
>> else
>> call CloseMenu()
>> call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
>> endif
>> endfu
>> ino <silent> <tab> <c-o>:call DoTab()<CR>
>>
>> CloseMenu is another function I have that closes a popup menu if it's
>> open, TriggerSnippet is a snipmate function that expands current snippet.
>
> Wanting to either insert something or run another function is a good
> case for <expr> mappings. It depends a bit on how TriggerSnippet works,
> the following might be all you need:
>
> fun! DoTab()
> if getline('.') =~ '^\s*$'
> return "\<tab>"
> else
> call CloseMenu()
> return TriggerSnippet()
> endif
> endfun
> ino <expr> <tab> DoTab()
>

I get 'E523: not allowed here' in TriggerSnippet. I tried :set secure ,
but that did not help.

-ak

--
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, September 28, 2011

Re: Outline in MacVim

On Wed, Sep 28, 2011 at 10:56 PM, g3orge pap <g3orge.app@gmail.com> wrote:
I didn't really manage to do that.
The video's quality is poor, and I could make the install.sh script to
run
Also the manual installation, didn't worked as well.
Any thoughts?

On Sep 28, 7:06 pm, Walkman_ <w2lk...@gmail.com> wrote:
> There is a plugin called "vimoutliner". It's great, I use it every day.
> Here you can find it:https://github.com/vimoutliner/vimoutliner.git
> Here is a long video of what it can do and how to use:http://video.google.com/videoplay?docid=8810772602188234059
>
> On Wed, Sep 28, 2011 at 5:32 PM, George Papanikolaou
> <g3orge....@gmail.com>wrote:
>
> > Hi,
> > is there any way to make vim work like an outline application (like
> > OmniOutliner)??
> > I don't know. A command to enable and one to disable the feature.
>
> > Thank you 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, visithttp://www.vim.org/maillist.php
>
> --
> Walkman

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

What was the problem with the install script? I recall obtaining an error which was solved by renaming the function "sure?" (no "")  to "sure_".  Then everything worked.

HTH

Cesc

--
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: Outline in MacVim

On Sep 28, 11:32 am, George Papanikolaou <g3orge....@gmail.com> wrote:
> Hi,
> is there any way to make vim work like an outline application (like OmniOutliner)??
> I don't know. A command to enable and one to disable the feature.
>
> Thank you in advance

I've created wiki page with a list of plugins for outlining:
http://vim.wikia.com/wiki/List_of_Scripts_for_Outlining?useskin=monobook
Hope this helps.

--
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: Insert a tab or call a function

On Wed, 28 Sep 2011, AK wrote:

> Hi, I'm trying to write a small function that is called when I press
> tab key and checks if current line is empty; if it is, it should
> insert a tab, and if not, it should call two other functions. Here's
> the example of what I came up with, which does not work right:
>
> function! DoTab()
> if match(getline('.'), '^\s*$') != -1
> call feedkeys("\<tab>") | return ''
> else
> call CloseMenu()
> call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
> endif
> endfu
> ino <silent> <tab> <c-o>:call DoTab()<CR>
>
> CloseMenu is another function I have that closes a popup menu if it's
> open, TriggerSnippet is a snipmate function that expands current
> snippet.

Wanting to either insert something or run another function is a good
case for <expr> mappings. It depends a bit on how TriggerSnippet works,
the following might be all you need:

fun! DoTab()
if getline('.') =~ '^\s*$'
return "\<tab>"
else
call CloseMenu()
return TriggerSnippet()
endif
endfun
ino <expr> <tab> DoTab()

--
Best,
Ben

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

creating a new location list

hi,

i know that we can have multiple location lists for a window.
i read through the documentation but couldn't find the command
or function that creates a new location list. lexpr doesn't take
window
nr as argument. so i was wondering how can i create a new location
list.
every time i use lexpr, the old location list will be rewritten. i am
missing some
thing here ?

thanks
sinbad

--
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: Insert a tab or call a function

On Wed, September 28, 2011 10:52 pm, AK wrote:
> Hi, I'm trying to write a small function that is called when I press tab
> key and checks if current line is empty; if it is, it should insert a
> tab, and if not, it should call two other functions. Here's the example
> of what I came up with, which does not work right:
>
> function! DoTab()
> if match(getline('.'), '^\s*$') != -1
> call feedkeys("\<tab>") | return ''
> else
> call CloseMenu()
> call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
> endif
> endfu
> ino <silent> <tab> <c-o>:call DoTab()<CR>
>
> CloseMenu is another function I have that closes a popup menu if it's
> open, TriggerSnippet is a snipmate function that expands current
> snippet.

And now the question: What are you expecting and what do you see instead?
Please don't let us guess, what is not working!

regards,
Christian

--
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: help - how do I unsubscribe?

On Thu, 2011-09-29 at 10:01 +1000, Lacis, Alf wrote:
> help - how do I unsubscribe?
>
> Think green - keep it on the screen.
>
> This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
>
>
Take a look at the http://www.vim.org/maillist.php link on these mails.
It will take you to a page explaining your options for several mail
lists. Likely you want the vim@vim.org list and the option "To
unsubscribe".

Namaste,

Kevin Tough

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

help - how do I unsubscribe?

help - how do I unsubscribe?

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. 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: Vim as default email (thunderbird) editor

On 9/28/2011 7:18 AM, Fernando Basso wrote:
> I really want to find a way to use vim as my default email editor. I
> have been using thunderbird for a reasonable amount of time now, and I
> stumbled through this "external editor" thunderbird plubin. However,
> it seems not to be working with recent versions of thunderbird.
>
> So, I was pondering, "well, many vim users certainly use vim to write
> emails." If so, do you have any tips regarding this subject. What I
> have done so far is to write the email in vim, and then paste the
> message back into the email client. There must be a better, clever, or
> nicer way of doing this.
>
> I simply cannot stand any other editor anymore. There is no life after
> vim.
>
> Any thoughts and ideas are welcome.
>
i didn't catch whether you noted windows or linux -- i can state that
windows thunderbird 7.0 does work for me BUT only if the call to gvim
uses the '-f' parameter. The '--no-fork' parameter gives an error for
me. I have the full path declared
C:\MyPrograms\Vim\vim73\gvim.exe -f for the plugin.

--
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: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

On Sep 28, 7:52 am, Amitava Shee <amitava.s...@gmail.com> wrote:
> I have starting using the excellent surround.vim plugin. Is there a way to
> mimic textmate's "wrap each selected line in open/close tag" ?
>

:'<,'>normal yss<tagname>

This will execute the (mapped) normal-mode command yss<tagname>, which
surround.vim will use to surround the entire line in a <tagname> tag
pair, on every line in the visual selection.

> Also, I am viws" does not wrap the word with " - instead it deletes the word
> and puts you between "".  viwS" seems to do the right thing. Is this correct
> behaviour?
>

Works for me (mostly, it behaves badly for me due to my "selection"
option setting, but it surrounds without deleting at least). Maybe
there is a setting somewhere which interferes.

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

pythonHelper script optimization!

Hello again!

A month and a half ago I has asked for some help on creating some
functions within gvim for helping me with Python coding and Christian
Brabandt was very helpful in giving me a starting point for me to work
off of. The code itself works perfect, but the performance of the
code while opening a file or making changes is pretty horrible if the
file is a bit long (although not hugely long).

I put the script here so it could be looked at:
http://asylumstudioproductions.com/vim/pythonHelper.vim

What this script does:

- Any tabs or spaces not dividable by 4 generates a red line of text
to say there is a problem with that line
- depth 0 shows in purple
- depth 1+ alternates between cyan and blue

This is to help identify where your scope should be when working in
deeper nested functions.

In any case, anyone have any idea how to improve the performance.
Each line is independent (meaning their result of coloring should not
depend on any other line in the file). I think it is working on the
whole file again each time. Also, while editing a line, I wanted it
to update as I was typing. The original version did not update as
often as I would like.

Any suggestions GREATLY appreciated.

Rick

--
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: Outline in MacVim

I didn't really manage to do that.
The video's quality is poor, and I could make the install.sh script to
run
Also the manual installation, didn't worked as well.
Any thoughts?

On Sep 28, 7:06 pm, Walkman_ <w2lk...@gmail.com> wrote:
> There is a plugin called "vimoutliner". It's great, I use it every day.
> Here you can find it:https://github.com/vimoutliner/vimoutliner.git
> Here is a long video of what it can do and how to use:http://video.google.com/videoplay?docid=8810772602188234059
>
> On Wed, Sep 28, 2011 at 5:32 PM, George Papanikolaou
> <g3orge....@gmail.com>wrote:
>
> > Hi,
> > is there any way to make vim work like an outline application (like
> > OmniOutliner)??
> > I don't know. A command to enable and one to disable the feature.
>
> > Thank you 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, visithttp://www.vim.org/maillist.php
>
> --
> Walkman

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

Insert a tab or call a function

Hi, I'm trying to write a small function that is called when I press tab
key and checks if current line is empty; if it is, it should insert a
tab, and if not, it should call two other functions. Here's the example
of what I came up with, which does not work right:

function! DoTab()
if match(getline('.'), '^\s*$') != -1
call feedkeys("\<tab>") | return ''
else
call CloseMenu()
call feedkeys("\<c-r>=TriggerSnippet()\<cr>") | return ''
endif
endfu
ino <silent> <tab> <c-o>:call DoTab()<CR>

CloseMenu is another function I have that closes a popup menu if it's
open, TriggerSnippet is a snipmate function that expands current
snippet.


Thanks! -ak

--
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 as default email (thunderbird) editor

On Sep 28, 3:27 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

>
> Try setting your External Editor preferences to call gvim with not only
> --nofork (or -f) but also a full path, i.e., not just
>
>         gvim --nofork
>
> but something like
>
>         /usr/local/bin/gvim -f
> or
>         C:\PROGRA~1\vim\vim73\gvim.exe -f

Still doesn't work. Thanks anyway.

--
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 as default email (thunderbird) editor

On 28/09/11 17:50, Fernando Basso wrote:
>
>
> On Sep 28, 10:58 am, Quincy Bowers<qui...@quakbo.com> wrote:
>> Make sure you setup External Editor to call 'gvim --nofork' or it won't work
>> properly. Other than that I can't imagine what would be wrong.
>
> It still doesn't work. Even using gvim --nofork.
>

Try setting your External Editor preferences to call gvim with not only
--nofork (or -f) but also a full path, i.e., not just

gvim --nofork

but something like

/usr/local/bin/gvim -f
or
C:\PROGRA~1\vim\vim73\gvim.exe -f
etc.


Best regards,
Tony.
--
"Why isn't there a special name for the tops of your feet?"
-- Lily Tomlin

--
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 as default email (thunderbird) editor

On Wed, Sep 28, 2011 at 05:18 PM, Marcin Szamotulski <mszamot@gmail.com> wrote:

> from: Marcin Szamotulski <mszamot@gmail.com>
> date: Wed, Sep 28 05:18 PM +01:00 2011
> to: vim_use@googlegroups.com
> reply-to: vim_use@googlegroups.com
> subject: Re: Vim as default email (thunderbird) editor
>
> On 04:18 Wed 28 Sep , Fernando Basso wrote:
>> I really want to find a way to use vim as my default email editor. I
>> have been using thunderbird for a reasonable amount of time now, and I
>> stumbled through this "external editor" thunderbird plubin. However,
>> it seems not to be working with recent versions of thunderbird.
>>
>> So, I was pondering, "well, many vim users certainly use vim to write
>> emails." If so, do you have any tips regarding this subject. What I
>> have done so far is to write the email in vim, and then paste the
>> message back into the email client. There must be a better, clever, or
>> nicer way of doing this.
>>
>> I simply cannot stand any other editor anymore. There is no life after
>> vim.
>>
>> Any thoughts and ideas are welcome.
>>
>> --
>> 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
>
> It should be noted that it is fairly easy to configure mutt to use vim as an
> external editor, this is a line of my muttrc file:
> set editor='vim +set\ spell\ spelllang=pl,pt,en_gb'
>
> Best,
> Marcin
>
> --
> 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

Hi Fernando

How about trying vmail? Emails from within Vim. The link is:

https://rubygems.org/gems/vmail

I use it everyday and it's really good.

Cheers

G

--
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 as default email (thunderbird) editor

On 04:18 Wed 28 Sep , Fernando Basso wrote:
> I really want to find a way to use vim as my default email editor. I
> have been using thunderbird for a reasonable amount of time now, and I
> stumbled through this "external editor" thunderbird plubin. However,
> it seems not to be working with recent versions of thunderbird.
>
> So, I was pondering, "well, many vim users certainly use vim to write
> emails." If so, do you have any tips regarding this subject. What I
> have done so far is to write the email in vim, and then paste the
> message back into the email client. There must be a better, clever, or
> nicer way of doing this.
>
> I simply cannot stand any other editor anymore. There is no life after
> vim.
>
> Any thoughts and ideas are welcome.
>
> --
> 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

It should be noted that it is fairly easy to configure mutt to use vim as an
external editor, this is a line of my muttrc file:
set editor='vim +set\ spell\ spelllang=pl,pt,en_gb'

Best,
Marcin

--
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 as default email (thunderbird) editor

On Sep 28, 11:32 am, David Ohlemacher <dohlemac...@scisol.com> wrote:
> Have you seen these?
> -http://dactyl.sourceforge.net/teledactyl
> -http://vimperator.org/muttator

They seem fine, although I'd prefer to edit in 'real' vim. Anyway,
thanks
for the suggestion. I was aware of vimperator, but not the other.

--
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: Outline in MacVim

There is a plugin called "vimoutliner". It's great, I use it every day.
Here you can find it: https://github.com/vimoutliner/vimoutliner.git
Here is a long video of what it can do and how to use:
http://video.google.com/videoplay?docid=8810772602188234059

On Wed, Sep 28, 2011 at 5:32 PM, George Papanikolaou <g3orge.app@gmail.com> wrote:
Hi,
is there any way to make vim work like an outline application (like OmniOutliner)??
I don't know. A command to enable and one to disable the feature.

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



--
Walkman

--
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: function to get word under cursor

On Wednesday, September 28, 2011 04:18:33 Михаил Голубев wrote:

> P.S. Also I'd like to ask whether you know some good vim
> scripting cheatsheet or advanced guide (cause I don't want to
> flood this group up with questions about basic functions a
> lot [?])?

in my opinion the best place to start is with

:h usr_41.txt

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: Vim as default email (thunderbird) editor

On Sep 28, 10:58 am, Quincy Bowers <qui...@quakbo.com> wrote:
> Make sure you setup External Editor to call 'gvim --nofork' or it won't work
> properly.  Other than that I can't imagine what would be wrong.

It still doesn't work. Even using gvim --nofork.

--
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 as default email (thunderbird) editor

I have not used either of those before.


On Wed, Sep 28, 2011 at 08:32, David Ohlemacher <dohlemacher@scisol.com> wrote:

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

Outline in MacVim

Hi,
is there any way to make vim work like an outline application (like OmniOutliner)??
I don't know. A command to enable and one to disable the feature.

Thank you 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: Folding recursively/levels

On Sep 28, 2:28 am, philipx <goo...@poi1.com> wrote:
> Hi.
>
> I'm having troubles understanding folding, in particular the recursive
> folding.
> I expect that if I fold a multi-level document (e.g. XML) with "zC" -
> "Close all folds under the cursor recursively", and then I execute
> "zo" on the fold, it would "Open one fold under the cursor", meaning
> that it keeps lower levels folded.
> Say you have this xml document (fdm=syntax,
> g:xml_syntax_folding=1,foldlevelstart=99).
> A
>   B
>     C
>     C
>   B
>     C...
>   B
>     C...
>
> Execute zC on the A node:
> --- xx lines: <A>------
> Now executing zo on that line, I would expect to see the following:
> A
>   -- xx lines: <B>-----
>   -- xx lines: <B>-----
>   -- xx lines: <B>-----
>
> Instead the whole tree opens up, which is what I would expect to
> happen if I used zO not zo.
>
> Are my expectations wrong? Is there a way to achieve this incremental
> unfolding I am looking for?
>
> Thanks.

I think you misunderstand "folds under the cursor".

With the cursor on the A node, folds on B and C nodes are not under
the cursor at all. Therefore zC does not close them. Note the text
of :he zC, which says, "Folds that don't contain the cursor line are
unchanged."

But with your cursor on the C node, zC will close the B node above it
and the A node above that.

What you probably want is to adjust the fold level with zm/zr/zM/zR.
You could also use :foldclose! with a range (where a range could be
determined by a complicated regex or a visual selection even).

I also just learned about zC in visual mode, from reading the help.
Another solution would be to visually select all the lines which you
wish to close all folds in, and use zC on the visual selection. With
the % command and the matchit plugin, this should only be a few extra
keystrokes (e.g. V%zC instead of just zC). This should do about the
same thing as :foldclose! on a visual selection but with fewer
keystrokes.

--
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: Status line in gvim: lost my input help (command mode input)

Ah, very fine! Thanks!

Regards - Marco.

--
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 as default email (thunderbird) editor

Have you seen these?
- http://dactyl.sourceforge.net/teledactyl
- http://vimperator.org/muttator

Re: Vim as default email (thunderbird) editor

Make sure you setup External Editor to call 'gvim --nofork' or it won't work properly.  Other than that I can't imagine what would be wrong.

Quincy

On Wed, Sep 28, 2011 at 07:42, Fernando Basso <fernandobasso.br@gmail.com> wrote:


On Sep 28, 9:45 am, Quincy Bowers <qui...@quakbo.com> wrote:
> I am using External Editor with Thunderbird 6.02 and everything is working
> just fine.  I would check to see if you have the latest updates for the
> plugin.

I got the plugin from here:

    http://globs.org/download.php?lng=en

I never tried this plugin until today. Incidentally, my first try
with this plugin was together with tunderbird 7 upgrade in
arch 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

--
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: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?


should visualize the inner word, delete it, leave you in insert
mode where your double-quote appears.  OTOH,

   viwS"

visualizes the inner word, then deletes the entire line (except
leading whitespace, depending on your indentation settings),
leaves you in insert mode, where your double-quote appears.  If
you get behavior different from either of these, you likely have
some mapping interfering that you'd have to track down.

viwS" in my case is wrapping the word with double-quotes. I am using MacVim and janus.

--
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: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

To surround the current line with say a div-tag, type the following while your cursor is on the line:
Vstdiv
 
I would like to do this to each line in a visual block (TextMate - Shift-Ctrl-Cmd W). Tim Chase suggested using ex mode substitute which works. I will probably end up creating a map. But before I do that, I would like to find out if there is a more "surround.vim"-ish way :-)


Also, I am viws" does not wrap the word with " - instead it deletes the word and puts you between "".  viwS" seems to do the right thing. Is this correct behaviour?

It is. Use ysiw" instead.
But viws" doesn't - here's my wrong-headed way of thinking viw selects inner word to which i want to apply surround using ". Just want to make sure I understand this.

Thanks for the replies.

--
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: anoying horiz scroll when scrolling down

On 09/28/2011 03:15 PM, Tim Chase wrote:
> On 09/28/11 07:59, Razvan Rotaru wrote:
>> What happens when I scroll down, is that the cursor is
>> following along. The problem occurs when the cursor jumps to a
>> short line (which is now out of the screen, because I am
>> scrolled to the right) and vim scrolls me back to the left so
>> that cursor remains in the screen.
>>
>> This is incredibly annoying since I have to scroll to the
>> right again.
>
> While it has other side-effects, you might try
>
> :set ve=all
>
> which you can read about at
>
> :help 'virtualedit'
>
> It seems to allow me to jump to the end of a long line and then scroll
> downward with the cursor landing in virtual-space on the short lines
> without triggering the horizontal-scroll back to where the short lines
> would normally force me. You can then just reset it when you don't want it:
>
> :set ve=
>
> -tim
>
>
>
>

I had a similar problem which was solved by :set nostartofline
This prevents the cursor from automatically moving to the first
non-blank character: the column is kept.

HTH,

Cesc

--
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 as default email (thunderbird) editor

On Sep 28, 9:45 am, Quincy Bowers <qui...@quakbo.com> wrote:
> I am using External Editor with Thunderbird 6.02 and everything is working
> just fine.  I would check to see if you have the latest updates for the
> plugin.

I got the plugin from here:

http://globs.org/download.php?lng=en

I never tried this plugin until today. Incidentally, my first try
with this plugin was together with tunderbird 7 upgrade in
arch 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: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

Dear Amitava Shee,

2011/9/28 Amitava Shee <amitava.shee@gmail.com>
I have starting using the excellent surround.vim plugin. Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

To surround the current line with say a div-tag, type the following while your cursor is on the line:
Vstdiv
 

Also, I am viws" does not wrap the word with " - instead it deletes the word and puts you between "".  viwS" seems to do the right thing. Is this correct behaviour?

It is. Use ysiw" instead.

See :h surround for details


Kind regards!
Asis

--
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: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

On 09/28/11 07:52, Amitava Shee wrote:
> I have starting using the excellent surround.vim plugin. Is there a way to
> mimic textmate's "wrap each selected line in open/close tag" ?

if you're doing whole lines, I do this infrequently enough that I
just use

:'<,'>s!.*!<tag>&</tag>

which will operate on the highlighted lines or

:g/pattern/s!.*!<tag>&</tag>

to operate on lines matching "pattern". However, if you do it
frequently or need to operate on partial lines, you can investigate

http://www.vim.org/scripts/script.php?script_id=1697

I can't say I've used it, but it's the #1 answer given anytime
anybody asks a question like yours, so it seems to have a lot of
happy users :)

> Also, I am viws" does not wrap the word with " - instead it deletes the word
> and puts you between "". viwS" seems to do the right thing. Is this correct
> behaviour?

I'm not sure what behavior you're expecting here, as

viws"

should visualize the inner word, delete it, leave you in insert
mode where your double-quote appears. OTOH,

viwS"

visualizes the inner word, then deletes the entire line (except
leading whitespace, depending on your indentation settings),
leaves you in insert mode, where your double-quote appears. If
you get behavior different from either of these, you likely have
some mapping interfering that you'd have to track down.

-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: anoying horiz scroll when scrolling down

On 09/28/11 07:59, Razvan Rotaru wrote:
> What happens when I scroll down, is that the cursor is
> following along. The problem occurs when the cursor jumps to a
> short line (which is now out of the screen, because I am
> scrolled to the right) and vim scrolls me back to the left so
> that cursor remains in the screen.
>
> This is incredibly annoying since I have to scroll to the
> right again.

While it has other side-effects, you might try

:set ve=all

which you can read about at

:help 'virtualedit'

It seems to allow me to jump to the end of a long line and then
scroll downward with the cursor landing in virtual-space on the
short lines without triggering the horizontal-scroll back to
where the short lines would normally force me. You can then just
reset it when you don't want it:

:set ve=

-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

anoying horiz scroll when scrolling down

Hi,

I'd like to get rid of an annoying behaviour of vim which happens sometimes when scrolling down.

I have a text file with alternately long and short lines. I want to scroll down the file, while keeping an eye on the "right part" of the long lines (wrap is disabled, so 1 text line is displayed on one screen line, and I have scrolled horizontally the text a little bit, to see the end of the long lines).

What happens when I scroll down, is that the cursor is following along. The problem occurs when the cursor jumps to a short line (which is now out of the screen, because I am scrolled to the right) and vim scrolls me back to the left so that cursor remains in the screen.

This is incredibly annoying since I have to scroll to the right again.

I'd really love some hints about how to get rid of this behaviour. I have searched a little bit around, and found that it is not possible to make the cursor not follow the lines (trying to stay on the screen), mainly because vim is a terminal app.

Cheers,
Razvan

Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

I have starting using the excellent surround.vim plugin. Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

Also, I am viws" does not wrap the word with " - instead it deletes the word and puts you between "".  viwS" seems to do the right thing. Is this correct behaviour?

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: Vim as default email (thunderbird) editor

I am using External Editor with Thunderbird 6.02 and everything is working just fine.  I would check to see if you have the latest updates for the plugin.

--
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: function to get word under cursor

Thanks, John! I probably should check 'vimwiki' first)

2011/9/28 John Beckett <johnb.beckett@gmail.com>
> Is there any standard function to get the word under cursor (
> as */# search commands do ) or I should write it by myself
> using getline('.')?

Use <cword> or <cWORD>. Some examples:
 http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches
 http://vim.wikia.com/wiki/Search_all_files_in_project_quickly
 http://vim.wikia.com/wiki/Search_for_current_word_in_new_window

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



--
Best regards
Golubev Mikhail

--
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 as default email (thunderbird) editor

I really want to find a way to use vim as my default email editor. I
have been using thunderbird for a reasonable amount of time now, and I
stumbled through this "external editor" thunderbird plubin. However,
it seems not to be working with recent versions of thunderbird.

So, I was pondering, "well, many vim users certainly use vim to write
emails." If so, do you have any tips regarding this subject. What I
have done so far is to write the email in vim, and then paste the
message back into the email client. There must be a better, clever, or
nicer way of doing this.

I simply cannot stand any other editor anymore. There is no life after
vim.

Any thoughts and ideas are welcome.

--
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: Status line in gvim: lost my input help (command mode input)

Hi,

marco wrote:
>
> I somehow lost an important feature in the status line: when in
> Command mode, and I want to put the content of buffer "x" 431 times, I
> just type
>
> 431"xp
>
> This 431 and "x are shown normally in the status line, which is really
> helpful. Somehow I lost that in gvim, but it is there in vim
> (terminal), and :help statusline doesn't mention that (or I just
> haven't found it). Any hint for what keywords I would have to search?
>
> Thanks, really thanks for any hint!

:help 'showcmd'

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: Folding recursively/levels

On Wed, 28 Sep 2011, philipx wrote:

> Hi.
>
> I'm having troubles understanding folding, in particular the recursive
> folding.
>
> I expect that if I fold a multi-level document (e.g. XML) with "zC" -
> "Close all folds under the cursor recursively", and then I execute
> "zo" on the fold, it would "Open one fold under the cursor", meaning
> that it keeps lower levels folded.
>
> Say you have this xml document (fdm=syntax,
> g:xml_syntax_folding=1,foldlevelstart=99).
> A
> B
> C
> C
> B
> C...
> B
> C...
>
> Execute zC on the A node:
> --- xx lines: <A>------
> Now executing zo on that line, I would expect to see the following:
> A
> -- xx lines: <B>-----
> -- xx lines: <B>-----
> -- xx lines: <B>-----
>
> Instead the whole tree opens up, which is what I would expect to
> happen if I used zO not zo.
>
> Are my expectations wrong? Is there a way to achieve this incremental
> unfolding I am looking for?

Your expectations match what I observe.

Maybe there is a mapping that prevents zo from only opening one fold?
If so:

:map zo

will show you.

--
Best,
Ben

--
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: function to get word under cursor

> Is there any standard function to get the word under cursor (
> as */# search commands do ) or I should write it by myself
> using getline('.')?

Use <cword> or <cWORD>. Some examples:
http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches
http://vim.wikia.com/wiki/Search_all_files_in_project_quickly
http://vim.wikia.com/wiki/Search_for_current_word_in_new_window

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

function to get word under cursor

Hello to everyone!

Is there any standard function to get the word under cursor ( as */# search commands do ) or I should write it by myself using getline('.')?

P.S. Also I'd like to ask whether you know some good vim scripting cheatsheet or advanced guide (cause I don't want to flood this group
up with questions about basic functions a lot )?

--
Best regards
Golubev Mikhail

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

Status line in gvim: lost my input help (command mode input)

Hi,

I somehow lost an important feature in the status line: when in
Command mode, and I want to put the content of buffer "x" 431 times, I
just type

431"xp

This 431 and "x are shown normally in the status line, which is really
helpful. Somehow I lost that in gvim, but it is there in vim
(terminal), and :help statusline doesn't mention that (or I just
haven't found it). Any hint for what keywords I would have to search?

Thanks, really thanks for any hint!

My gvim under Ubuntu / Awesome
:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 24 2011 07:07:34)
Inklusive der Korrekturen: 1-35
Verändert von pkg-vim-maintainers@lists.alioth.debian.org
Übersetzt von buildd@
Riesige Version mit GTK2-GNOME GUI. Ein- (+) oder ausschließlich (-)
der Eigenschaften:

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

Folding recursively/levels

Hi.

I'm having troubles understanding folding, in particular the recursive
folding.
I expect that if I fold a multi-level document (e.g. XML) with "zC" -
"Close all folds under the cursor recursively", and then I execute
"zo" on the fold, it would "Open one fold under the cursor", meaning
that it keeps lower levels folded.
Say you have this xml document (fdm=syntax,
g:xml_syntax_folding=1,foldlevelstart=99).
A
B
C
C
B
C...
B
C...

Execute zC on the A node:
--- xx lines: <A>------
Now executing zo on that line, I would expect to see the following:
A
-- xx lines: <B>-----
-- xx lines: <B>-----
-- xx lines: <B>-----

Instead the whole tree opens up, which is what I would expect to
happen if I used zO not zo.

Are my expectations wrong? Is there a way to achieve this incremental
unfolding I am looking for?

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