Wednesday, February 29, 2012

Re: imap has some problems

On Thu, March 1, 2012 04:48, ShengHe wrote:
> Problem:
> inoremap <CR> <CR><C-o>:call inputdialog("yes")<CR>
> open one buffer,inputdialog can work.however,use tabnew,split,the
> inputdialog can't work !

Not sure, what your problem is. Works For Me™ on Windows 7.3.46 and
Unix 7.3.409

Please explain exactly what you expect and what you experience and
what you think the problem is.

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

Included syntax file and contained items.

Hello all,

A while ago I posted a question about Lua highlighting in a Vim file
being completely wrong after syntax files were updated. I had no answer,
but now I think I've found the source of the problem: in the Lua syntax
file, some regions which "contains" something have been changed to
"contains" TOP (i.e. not "contained") groups instead of precisely named
groups. On the other hand, the ":syntax include" command adds the
"contained" flag to all items declared in the included file, and so
there are no TOP elements anymore, and the containing regions contain
nothing.

This means that any syntax file which uses TOP for containment can't
be properly included in another one. Is there any workaround? (And isn't
it somewhat buggy behavior, or at least ill-designed?)

Best,
Paul

--
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 won't beep in Kubuntu Oneiric

Hi all

I've just installed Kubuntu 11.10 (aka Oneiric) after using 10.04 for
a long time, and gvim won't give an audible beep. Vim in konsole
beeps nicely, as does gvim in a Gnome session for the same user. In
the kubuntu system settings -manage notifications - KDE Workspace -
Beep is set to play a sound. I don't want the PC speaker beep that
one can turn on under "system bell", but that doesn't work anyway.

Any ideas? (Googling for vim and beep gives many hits for turning the
beep off, but I want it on.)

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: Which runtime files for console vim?

Hi,

howard Schwartz wrote:
>
> Question 1:
>
> Let me try to be more concrete: Im running gvim (7.0) in console mode only.
> Its runtime directories include these:
>
> autoload colors compiler doc ftplugin icons indent keymap lang macros
> plugin print spell syntax tools tutor dict thesaurus
>
> Which of these directories, or files in them can I eliminate, because I am
> only using textmode? I suspect icons can obviously go, probably ftplugins
> since I will not use ftp, compiler because I will not be compiling source
> code. Some of the menu files in the main runtime directory will not show up in
> a console.

just a note in addition to the answers you already got: "ftplugins" has
nothing to do with FTP, it's the directory for *F*ile *T*ype plugins.

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: Need help in recovering file in vi.

On Thursday 01 March 2012 05:46 AM, Tim Chase wrote:
> On 02/29/12 14:02, Tayade, Nilesh wrote:
>> While modifying my own code I accidently saved the file using
>> ".wq" (note the dot placed accidently) and lost the contents.
>> I am not really able to understand what this command did and
>> how the contents are lost.
>>
>> Could someone please provide any pointer on how can I recover
>> the contents?
>
> It would seem to me that you would have needed to issue ":.wq!" (note
> the exclamation point in addition to the period) or otherwise Vim would
> have cowardly refused with an E140. To understand what the period did,
> it's the range for the current line as detailed under ":help :w" with
> the ":[range]w[rite][!]" entry.
>
> If you have a rather recent version of Vim (I believe 7.3+) with
> persistent undo enabled, it might be possible to resurrect the file. Or,
> if you have backups enabled or keep your code/text in a VCS, you could
> use those to restore the original (though if you're asking here, it
> sounds like this isn't the case). Alternatively, you might be able to
> use a file-recovery tool at the OS level to resurrect the file from the
> disk.
I have an older version of vim installed (7.2) and as rightly guessed no
backups enabled.

>
> Otherwise, I'm afraid that you issued a "write the currently-named file
> with the contents of the range I specify ('.' is the current line) and I
> mean it!" command, so Vim obediently did as you asked even at the cost
> of your data.
Yes, this was the case, and I learned a lesson of being careful with the
"!".
Thanks for your response.

>
> -tim
>
>

--
Thanks,
Nilesh

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

imap has some problems

Problem:
      inoremap <CR>    <CR><C-o>:call inputdialog("yes")<CR>
     open one buffer,inputdialog can work.however,use tabnew,split,the inputdialog can't work !

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

On Wed, Feb 29, 2012 at 17:43, Marc Weber <marco-oweber@gmx.de> wrote:

Talking about :args command?

I think that was what I was looking for. On the good-new/bad-news front, the bad news is :args did not help in finding the problem. The good news is the problem went away when I closed down all current instances of Vim.

I've never had it do this before. Each successive instance seemed to want to allocate a multiple of the memory allocated by the previous instance. It finally threw an error trying to allocate about ten times more than the 8GB I have in the machine. 

Now each instance is allocating a small number of MB, just like it always has. Very strange. BTW, this is with Win7-64.

  -- Jay

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

Jay Heyl, Wed 2012-02-29 @ 17:34:33-0800:
> Is there a way from within Vim to determine what command line options
> were specified when that particular instance of Vim was started? Not
> compile options or .vim_rc settings, but strictly items specified on
> the startup command line. If Vim was started with '-r' and '+1234', is
> there a way to determine that from within Vim?

If you're running Linux, this will show you the full command line used
to start Vim, from within Vim:

:exe '!tr "\0" " " </proc/' . getpid() . '/cmdline'

Re: Vim startup options

Talking about :args command?

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

I know the answer to this question is out there, but nothing I search for turns up what I'm looking for.

Is there a way from within Vim to determine what command line options were specified when that particular instance of Vim was started? Not compile options or .vim_rc settings, but strictly items specified on the startup command line. If Vim was started with '-r' and '+1234', is there a way to determine that from within Vim?

I'm having a problem where the first instance of Vim is running like normal, but when I launch additional instances those instances grab seriously huge amounts of memory and run like total dogs. This started after configuring a third party program to use Vim as its default editor and I have a suspicion this program changed something at the system level about the way Vim starts based on file type. I'd like to be able to see if the startup options are involved in some way.

  -- Jay

--
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: problems building vim with cygwin (Make_cyg.mak)

I've just downloaded the newest version of cygwin (1.7.11) and the hg
version of vim (7.3.462) and using windows 7.
change src/Make_cyg.mak and src/GvimExt/Make_cyg.mak , gcc ==>gcc-3,
g++ ==> g++-3
make -f Make_cyg.mak works without problem.

:version shows
Compilation: gcc-3 -O3 -fomit-frame-pointer -freg-struct-return
-fno-strength-reduce -DWIN32 -DHAVE_PATHDEF -DFEAT_BIG
-DWINVER=0x0400 -D_WIN32_WI
NNT=0x0400 -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE
-DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG
-DFEAT_GUI_W32 -DFEAT_C
LIPBOARD -march=i386 -Iproto -s -mno-cygwin
Linking: gcc-3 -s -o gvim.exe -luuid -lole32 -lwsock32 -mwindows
-lcomctl32 -lversion

and it seems that the only libraries used are uuid, ole32, wsock32,
windows, comctl32 and version.


On Wed, Feb 29, 2012 at 11:58 PM, Charles E Campbell Jr
<drchip@campbellfamily.biz> wrote:
> Hello,
>
> I've been having some problems compiling vim with
>
>  make -f Make_cyg.mak
>
> using cygwin and vista.  In particular,
>
> gobj/os_win32.o:os_win32.c:(.text+0x1f5): undefined reference to `_wcsicmp'
> gobj/os_win32.o:os_win32.c:(.text+0x24f2): undefined reference to `__wmkdir'
> gobj/os_win32.o:os_win32.c:(.text+0x3d10): undefined reference to `__wopen'
> gobj/os_win32.o:os_win32.c:(.text+0x3da1): undefined reference to `__wfopen'
> gobj/os_mswin.o:os_mswin.c:(.text+0x19da): undefined reference to `__wchdir'
> gobj/os_mswin.o:os_mswin.c:(.text+0x1b13): undefined reference to `__wstat'
> gobj/os_mswin.o:os_mswin.c:(.text+0x1ee4): undefined reference to
> `__wfullpath'
> gobj/os_mswin.o:os_mswin.c:(.text+0x201d): undefined reference to
> `__wfullpath'
> gobj/os_mswin.o:os_mswin.c:(.text+0x3f0e): undefined reference to
> `_IID_IPersistFile'
> gobj/if_cscope.o:if_cscope.c:(.text+0x26b5): undefined reference to
> `__open_osfhandle'
> gobj/if_cscope.o:if_cscope.c:(.text+0x26f9): undefined reference to
> `__open_osfhandle'
>
> I tried searching for the libraries:  nm -A *.a */*.a */*/*.a | fgrep wmkdir
>
> but was unable to find the library holding these functions.  Help would be
> appreciated!
>
> 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

--
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: Need help in recovering file in vi.

On 02/29/12 14:02, Tayade, Nilesh wrote:
> While modifying my own code I accidently saved the file using
> ".wq" (note the dot placed accidently) and lost the contents.
> I am not really able to understand what this command did and
> how the contents are lost.
>
> Could someone please provide any pointer on how can I recover
> the contents?

It would seem to me that you would have needed to issue ":.wq!"
(note the exclamation point in addition to the period) or
otherwise Vim would have cowardly refused with an E140. To
understand what the period did, it's the range for the current
line as detailed under ":help :w" with the ":[range]w[rite][!]"
entry.

If you have a rather recent version of Vim (I believe 7.3+) with
persistent undo enabled, it might be possible to resurrect the
file. Or, if you have backups enabled or keep your code/text in
a VCS, you could use those to restore the original (though if
you're asking here, it sounds like this isn't the case).
Alternatively, you might be able to use a file-recovery tool at
the OS level to resurrect the file from the disk.

Otherwise, I'm afraid that you issued a "write the
currently-named file with the contents of the range I specify
('.' is the current line) and I mean it!" command, so Vim
obediently did as you asked even at the cost of your data.

-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: Which runtime files for console vim?

Hi howard!

On Mi, 29 Feb 2012, howard Schwartz wrote:

> >I don't know what your asking, but I am trying to provide you with
> >*something *useful. What exactly are you wanting? What is vim
> >doing instead?
>
> Question 1:
>
> Let me try to be more concrete: Im running gvim (7.0) in console mode only.
> Its runtime directories include these:
>
> autoload colors compiler doc ftplugin icons indent keymap lang macros
> plugin print spell syntax tools tutor dict thesaurus
>
> Which of these directories, or files in them can I eliminate, because I am
> only using textmode? I suspect icons can obviously go, probably ftplugins
> since I will not use ftp, compiler because I will not be compiling source
> code. Some of the menu files in the main runtime directory will not show up in
> a console.

None. Because vim won't load any of them, unless specifically requested.
Well, icons may go, but it won't hurt, if you leave it. It really
doesn't hurt to leave the files as they are.

> What I'm try to do is avoid vim sourcing files that it (or I) will
> never use, or files that might cause problems when gvim is not
> opened in a
> graphics window.

No problem with that. Vim only loads those, when being specifically
requested.

>
> Question 2:
>
> I have defined the dictionary variable in .vimrc, and placed appropriate
> dictionary files in the dict directory. However, when I place the cursor on a
> word like,
>
> take
>
> while in insert mode, and hit ctrl-X ctrl-K I get the message that vim is
> scanning the dictionary files. Then vim gives the message ``back at
> original". I never get a menu of choices or a completion string. Yet I know
> there is a line line this:
>
> take taken, takes, taking -> [taking], took
>
> in one of the dictionary files. Sometimes the screen freezes with a line at the bottom like:
>
> Scanning dictionary XXX
>
> If I hit ctrl-x ctrl-k again at this point, vim crashes with the message:
>
> Vim: Caught deadly signal SEGV
>
> Vim: Finished.
> Segmentation fault
>
> What am I doing wrong, to enable dictionary completion?

Try a more recent version. If it still crashes, please provide exact
steps how to reproduce the problem (see also the faq:
http://vimhelp.appspot.com/vim_faq.txt.html#faq-36.12). See also Gary's
answer.

Mit freundlichen Grüßen
Christian
--
Oft sind am besten Menschen dessen größte Tugenden und größte Flecken
unbekannt.
-- Jean Paul

--
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: Which runtime files for console vim?

> I don't know what your asking, but I am trying to provide you with
> *something *useful. What exactly are you wanting? What is vim doing instead?

Question 1:

Let me try to be more concrete: Im running gvim (7.0) in console mode only.
Its runtime directories include these:

autoload colors compiler doc ftplugin icons indent keymap lang macros
plugin print spell syntax tools tutor dict thesaurus

Which of these directories, or files in them can I eliminate, because I am
only using textmode? I suspect icons can obviously go, probably ftplugins
since I will not use ftp, compiler because I will not be compiling source
code. Some of the menu files in the main runtime directory will not show up in
a console.

What I'm try to do is avoid vim sourcing files that it (or I) will
never use, or files that might cause problems when gvim is not opened in a
graphics window.

Question 2:

I have defined the dictionary variable in .vimrc, and placed appropriate
dictionary files in the dict directory. However, when I place the cursor on a
word like,

take

while in insert mode, and hit ctrl-X ctrl-K I get the message that vim is
scanning the dictionary files. Then vim gives the message ``back at
original". I never get a menu of choices or a completion string. Yet I know
there is a line line this:

take taken, takes, taking -> [taking], took

in one of the dictionary files. Sometimes the screen freezes with a line at the bottom like:

Scanning dictionary XXX

If I hit ctrl-x ctrl-k again at this point, vim crashes with the message:

Vim: Caught deadly signal SEGV

Vim: Finished.
Segmentation fault

What am I doing wrong, to enable dictionary completion?

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

Need help in recovering file in vi.

Hi,

While modifying my own code I accidently saved the file using ".wq"
(note the dot placed accidently) and lost the contents.
I am not really able to understand what this command did and how the
contents are lost.

Could someone please provide any pointer on how can I recover the
contents?

--
Thanks,
Nilesh

--
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: Questions about searching and visual areas

Sorry if this formats strangly, I needed to use the "new" Google Groups interface, because somehow the old interface isn't loading any discussions for me. The new interface offers no way that I can tell to remove the "rich text" editor.
 
These should answer your questions:
 

--
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: Which runtime files for console vim?

On 2012-02-29, howard Schwartz wrote:
> Hi,
>
> I successfully installed gvim on a redhat installation, which must
> run in console mode only. It does this fine, and has perhaps double
> the features enabled as the tiny or expanded console vim.
>
> My problem now is how to select the runtime directories and files for
> gvim, running as console vim? With usual ones, I get various error
> messages related to no graphics. If I used the tiny or expanded
> runtime files, I fear they would not contain some useful features
> (e.g., search, cmd, dictionary completion).

There are not separate sets of plugins or runtime files for the GUI
or terminal modes of Vim. As long as the version of Vim that you're
running supports a _feature_ required by a plugin, it should work
fine. (See ":help feature-list".) Plugins _should_ check for the
presence of a feature before trying to use it, but not all plugins
do that. As long as you're running a reasonably full-featured Vim,
as it sounds like you are, you should have no problem.

If you are having a problem, then please post the _exact_ error
message or messages that you are getting and a minimal list of the
_exact_ commands you executed that gave you the error.

> Specifically, I have tried to impliment the dictionary and thesaurus
> functions, but they do not seem to work. I have the files, and have
> set the dictionary and thesaurus variables to the correct
> directories.
>
> However, i only get results when I tried to complete a word, for
> instance `have', within a dictionary file itself. In any other file,
> I get ``pattern not found'' for the same word. And I can not use
> i_CTRL-X i_CTRL-K to generate any popup menu with a list of words. Do
> these popups require graphics in linux? They seem to work OK on in my
> dos box under windows.

On a system running Ubuntu 10.04 and using Vim 7.3.434 that I built
myself as a "Normal version with GTK2 GUI", I started Vim as

vim -N -u NONE -c 'set dictionary=/usr/share/dict/words'

to avoid loading any customizations. I then typed 'i' to enter
insert mode, typed 'have' and then Ctrl-X Ctrl-K. The result was a
text-mode pop-up window below my word 'have' that looked like this:

have /usr/share/dict/words
haven /usr/share/dict/words
havens /usr/share/dict/words
haversack /usr/share/dict/words
haversacks /usr/share/dict/words
haves /usr/share/dict/words

See if that much works for you and we'll go from there to get it
working for you with your normal configuration.

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: Questions about searching and visual areas

Dedeco, Wed 2012-02-29 @ 12:35:22-0300:
> 2- I have some visually selected text and want to make a search
> within the selected area (we can do :s)

For this, see `:help /\%V`.

Re: Which runtime files for console vim?

Most gVim installations also install vim, vimdiff, as well as some other vim binaries.

All of these are different programs and each source your "vimrc" file. The system probably has one at /etc/vimrc and you probabaly have your own at $HOME/.vimrc.

I don't know what your asking, but I am trying to provide you with something useful.

What exactly are you wanting? What is vim doing instead?

On Wednesday, February 29, 2012 12:55:16 PM UTC-5, howardb21 wrote:
Hi,

I successfully installed gvim on a redhat installation, which must run in
console mode only. It does this fine, and has perhaps double the features
enabled as the tiny or expanded console vim.

My problem now is how to select the runtime directories and files for gvim,
running as console vim? With usual ones, I get various error messages related
to no graphics. If I used the tiny or expanded runtime files, I fear they
would not contain some useful features (e.g., search, cmd, dictionary
completion).

Specifically, I have tried to impliment the dictionary and thesaurus
functions, but they do not seem to work. I have the files, and have set the
dictionary and thesaurus variables to the correct directories.

However, i only get results when I tried to complete a word, for instance
`have', within a dictionary file itself. In any other file, I get ``pattern
not found'' for the same word. And I can not use i_CTRL-X i_CTRL-K to generate
any popup menu with a list of words. Do these popups require graphics in
linux? They seem to work OK on in my dos box under windows.

Any help appreciated.


On Wednesday, February 29, 2012 12:55:16 PM UTC-5, howardb21 wrote:
Hi,

I successfully installed gvim on a redhat installation, which must run in
console mode only. It does this fine, and has perhaps double the features
enabled as the tiny or expanded console vim.

My problem now is how to select the runtime directories and files for gvim,
running as console vim? With usual ones, I get various error messages related
to no graphics. If I used the tiny or expanded runtime files, I fear they
would not contain some useful features (e.g., search, cmd, dictionary
completion).

Specifically, I have tried to impliment the dictionary and thesaurus
functions, but they do not seem to work. I have the files, and have set the
dictionary and thesaurus variables to the correct directories.

However, i only get results when I tried to complete a word, for instance
`have', within a dictionary file itself. In any other file, I get ``pattern
not found'' for the same word. And I can not use i_CTRL-X i_CTRL-K to generate
any popup menu with a list of words. Do these popups require graphics in
linux? They seem to work OK on in my dos box under windows.

Any help appreciated.

--
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: Two Fold-Related Questions



On Friday, February 17, 2012 2:08:13 AM UTC-8, Marc van Dongen wrote:
* Christian Brabandt  [2012-02-17 10:25:47 +0100]:

Hi Christian,

: I think, you almost get what you want, if you set
: :set foldopen-=block
: This will make the { movements not open the folds. But it won't move to
: before the closed fold, but stays on the closed fold, where the
: paragraph is.

Perfect. Seems to do exactly what I want.

: > The second question has got to do with ``entering'' a fold. Years ago
: > I used an occam folding editor that let you enter a fold. Basically,
: > this let you edit the contents of the fold in a fresh screen. You
: > could only edit what was outside the fold if you left the fold. Is
: > there an equivalent of this facility in vim? (I read the manual pages
: > but I may have missed this.)
:
: Not exactly possible. Use one of the many NarrowRegion plugins
: available, e.g. my NrrwRgn
: http://www.vim.org/scripts/script.php?script_id=3075
: which opens a selected range of lines in a new buffer and marks the
: original buffer non-modifiable.

Thanks. I may see if I can implement it myself.

Regards,


Marc van Dongen


Entering a fold (occam style) is supported by a package by Mario Schweigler

http://www.informatico.de/kent-vim-ext/index-plain.php

Works very well. Hard to imagine life without it.

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

Which runtime files for console vim?

Hi,

I successfully installed gvim on a redhat installation, which must run in
console mode only. It does this fine, and has perhaps double the features
enabled as the tiny or expanded console vim.

My problem now is how to select the runtime directories and files for gvim,
running as console vim? With usual ones, I get various error messages related
to no graphics. If I used the tiny or expanded runtime files, I fear they
would not contain some useful features (e.g., search, cmd, dictionary
completion).

Specifically, I have tried to impliment the dictionary and thesaurus
functions, but they do not seem to work. I have the files, and have set the
dictionary and thesaurus variables to the correct directories.

However, i only get results when I tried to complete a word, for instance
`have', within a dictionary file itself. In any other file, I get ``pattern
not found'' for the same word. And I can not use i_CTRL-X i_CTRL-K to generate
any popup menu with a list of words. Do these popups require graphics in
linux? They seem to work OK on in my dos box under windows.

Any help appreciated.

--
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 limit syntax rule match to the outside of a region?

Hello,

I'm trying to write a syntax file for a language that looks like this:

var1 = foo;
block name {
var2 = bar;
var3 = true;
}

The problem I have is that some variables can occur only at the global
scope, i.e. outside of any block, while others can only occur inside a
block. Ideally I'd like to highlight occurrences of the variables of the
first kind inside a block and that of the second kind at global scope as
errors but I'd also settle for not highlighting them at all. Unfortunately
I don't see how to do it. Currently I have (simplified):

syn keyword GlobalVar var1;
syn keyword BlockVar var2 contained;
syn region Block start="{" end="}" contains=ALLBUT,GlobalVar transparent

which more or less works for "var2" but "var1" is highlighted even if it
occurs inside the block. I'd like to understand why does this happen and
how to avoid it -- as well as implementing highlighting of the variables in
the wrong places as errors. Does anybody know how could this be done?


Also, on a similar topic, what is the best way to highlight the values of
the variables? I.e. for some of them only a limited set of values is valid,
for example there are boolean variables which can only be "true" or "false".
Currently I do

syn keyword BoolValue false true contained
syn match BlockVar "var3 *=.*$"he=s+4 contains BoolValue

but this is quite inconvenient because I need to compute the highlighting
index (4 above) for each variable and just doesn't look right. I'm sure
there must be a better way of doing what I want but what could it be?

Thanks in advance for your help!
VZ

problems building vim with cygwin (Make_cyg.mak)

Hello,

I've been having some problems compiling vim with

make -f Make_cyg.mak

using cygwin and vista. In particular,

gobj/os_win32.o:os_win32.c:(.text+0x1f5): undefined reference to `_wcsicmp'
gobj/os_win32.o:os_win32.c:(.text+0x24f2): undefined reference to `__wmkdir'
gobj/os_win32.o:os_win32.c:(.text+0x3d10): undefined reference to `__wopen'
gobj/os_win32.o:os_win32.c:(.text+0x3da1): undefined reference to `__wfopen'
gobj/os_mswin.o:os_mswin.c:(.text+0x19da): undefined reference to `__wchdir'
gobj/os_mswin.o:os_mswin.c:(.text+0x1b13): undefined reference to `__wstat'
gobj/os_mswin.o:os_mswin.c:(.text+0x1ee4): undefined reference to
`__wfullpath'
gobj/os_mswin.o:os_mswin.c:(.text+0x201d): undefined reference to
`__wfullpath'
gobj/os_mswin.o:os_mswin.c:(.text+0x3f0e): undefined reference to
`_IID_IPersistFile'
gobj/if_cscope.o:if_cscope.c:(.text+0x26b5): undefined reference to
`__open_osfhandle'
gobj/if_cscope.o:if_cscope.c:(.text+0x26f9): undefined reference to
`__open_osfhandle'

I tried searching for the libraries: nm -A *.a */*.a */*/*.a | fgrep wmkdir

but was unable to find the library holding these functions. Help would
be appreciated!

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

Questions about searching and visual areas

Hi,

how to do a search when:

1- I have some visually selected text (on one or more lines) and want
to search for this selection in the rest of the file. Similar to * and #
for words under the cursor

2- I have some visually selected text and want to make a search within
the selected area (we can do :s)

Regards,

Dedeco

--
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: abbreviation does not work after map

On 02/29/12 08:41, Yichao Zhou wrote:
> I found a very annoying problem. If I map<CR> like
> :inoremap<CR> <C-G>u<CR>
> Then the<CR> will lose the ability to translate the abbreviation.
>
> Other maps does not work either.
> So are there any workaround to make<CR> work in abbreviation while
> we can still map it?

You might try

:inoremap <cr> <c-]><c-g>u<cr>

:help i_CTRL-]

-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

abbreviation does not work after map

Hello everyone,
I found a very annoying problem. If I map <CR> like
:inoremap <CR> <C-G>u<CR>
Then the <CR> will lose the ability to translate the abbreviation.

Other maps does not work either.
So are there any workaround to make <CR> work in abbreviation while
we can still map it?

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

Latest Educational News

Iqra is an educational portal with the aim to provide information on
Pakistani colleges and universities. Latest Educational News, Blogs,
Schools, Career tips, Event, Jobs, Practice Test and Much more....

http://iqra.org.pk/

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


On Feb 29, 2012, at 3:41 AM, David Sanson wrote:

Take a look at https://github.com/vim-pandoc/vim-pandoc and https://github.com/juhasz/mmd_vim.

Ah, see that you're one of the maintainers of vim-pandoc. Being familiar with mmd I'm vaguely familiar with pandoc. Your plugin is pretty impressive, at least judging from the documentation.

My reason for being interested in mmd is {1] I'm not a programmer, [2] I compose in and manage larger writing projects with Scrivener, which provides for export to latex via mmd, [3] I'm primarily interested in being able to use latex to format and print/publish short documents composed in vim.

Thanks again for the links, and I'll keep vim-pandoc in mind. [There is no documentation for mmd_vim.]

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir

"Uncertainty is an uncomfortable position, 
but certainty is an absurd one."
 
- Voltaire

Re: Vim for LaTeX


On Feb 29, 2012, at 3:41 AM, David Sanson wrote:

Take a look at https://github.com/vim-pandoc/vim-pandoc and https://github.com/juhasz/mmd_vim.

You might also be interested in https://launchpad.net/vim-latex-box, an alternative to vim-latex.

Thanks, David. I'll check them out. Especially intrigued by the mmd-vim link.

------------------------------------------------------------------------------------------

"Every moment is unique and discrete."

Eknath Eswaran

Re: Vim for LaTeX

Take a look at https://github.com/vim-pandoc/vim-pandoc and https://github.com/juhasz/mmd_vim.

You might also be interested in https://launchpad.net/vim-latex-box, an alternative to vim-latex.

-David

--
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, February 28, 2012

Suggestion: change in open fold by mouse behaviour

I think it would be good if clicking to open a fold with a mouse
would jump cursor to the first line of the fold.

Usually, when I open a fold, I want to look at it starting from the top.
When a fold is a few screens wide and current line is under the fold,
the only way to look at the top of it after it's open is to scroll a
few screens up. I run into this all the time. It's much easier to
jump back with ctrl-o than to page up unknown number of times.

What do you guys think?

-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 Script that displays site-packages source python

On 02/28/2012 10:55 PM, Taylor Hedberg wrote:
> Taylor Hedberg, Tue 2012-02-28 @ 22:34:47-0500:

>>
>> It's quick and dirty, and would probably fail in some corner case, but
>> would something like this work?
>>
>> function! s:PySource(module)
>> let path = substitute(a:module, '\v(\w+)\.', '\1/', 'g')
>> execute 'view /usr/lib/python2.7/site-packages/' .
>> \ substitute(path, '/\w\+$', '', '') .
>> \ '.py'
>> execute '/\%(class\|def\)' substitute(path, '\v.*/(\w+)$', '\1', '')
>> endfunction
>> command! -nargs=1 PySource call s:PySource('<args>')
>>
>> It may require tweaking to work on your particular system (though it
>> works on my machine), but this should at least give you an idea of how
>> you might approach it.
>
> Or it might be easier to just use ctags to create an index of your
> site-packages directory, and then use Vim's tag lookup commands to
> navigate to the code you want to see.


That's what I do and it works really well. -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 Script that displays site-packages source python

Taylor Hedberg, Tue 2012-02-28 @ 22:34:47-0500:
> Colin Wood, Tue 2012-02-28 @ 17:44:25-0800:
> > Maybe I am not saying it right. Ill try again. I am looking to be
> > able to get source of a file that is installed in the site-packages
> > directory. Instead of opening the file and finding where it is in
> > the package I want to be able to do :PySource
> > django.views.generic.DetailView and it open a new buffer or window
> > with the source of the DetialView. Or something similar?
>
> It's quick and dirty, and would probably fail in some corner case, but
> would something like this work?
>
> function! s:PySource(module)
> let path = substitute(a:module, '\v(\w+)\.', '\1/', 'g')
> execute 'view /usr/lib/python2.7/site-packages/' .
> \ substitute(path, '/\w\+$', '', '') .
> \ '.py'
> execute '/\%(class\|def\)' substitute(path, '\v.*/(\w+)$', '\1', '')
> endfunction
> command! -nargs=1 PySource call s:PySource('<args>')
>
> It may require tweaking to work on your particular system (though it
> works on my machine), but this should at least give you an idea of how
> you might approach it.

Or it might be easier to just use ctags to create an index of your
site-packages directory, and then use Vim's tag lookup commands to
navigate to the code you want to see.

Re: Vim Script that displays site-packages source python

Colin Wood, Tue 2012-02-28 @ 17:44:25-0800:
> Maybe I am not saying it right. Ill try again. I am looking to be able
> to get source of a file that is installed in the site-packages
> directory. Instead of opening the file and finding where it is in the
> package I want to be able to do :PySource
> django.views.generic.DetailView and it open a new buffer or window
> with the source of the DetialView. Or something similar?

It's quick and dirty, and would probably fail in some corner case, but
would something like this work?

function! s:PySource(module)
let path = substitute(a:module, '\v(\w+)\.', '\1/', 'g')
execute 'view /usr/lib/python2.7/site-packages/' .
\ substitute(path, '/\w\+$', '', '') .
\ '.py'
execute '/\%(class\|def\)' substitute(path, '\v.*/(\w+)$', '\1', '')
endfunction
command! -nargs=1 PySource call s:PySource('<args>')

It may require tweaking to work on your particular system (though it
works on my machine), but this should at least give you an idea of how
you might approach it.

Re: Vim Script that displays site-packages source python

Maybe I am not saying it right. Ill try again. I am looking to be able to get source of a file that is installed in the site-packages directory. Instead of opening the file and finding where it is in the package I want to be able to do :PySource django.views.generic.DetailView and it open a new buffer or window with the source of the DetialView. Or something similar?

Thanks again,

Colin

On Sunday, February 19, 2012 9:45:49 PM UTC-5, Colin Wood wrote:
Looking for a plugin that will show a site-package or python code for
a import. Anyone know of any or got any suggestions I knew about pyref
but that just sends me ot the docs and pydoc but Id like to just view
the code itself.

Thanks,

Colin

--
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: If there is a > in exactly the 80th character, the following lines will be double-quoted after gq

On Mon, 27 Feb 2012, Christian Brabandt wrote:
>contains the '>' at the beginning, but since nesting is allowed
>(:set comments includes n:>), Vim insert the same amount of comment
>leaders at the beginning of the line as on the previous line.

I don't know what you mean by 'nesting is allowed', but this seems like
something that could be fixed so that it would "just work". (I know, it's
a very minor problem, and someone would have to carefully read the text
to figure out why it seemed that the quoting was "wrong" in this case, since
one of the quote chars is a > symbol intended that way.)

and of course, the "real solution" would be to use format=flowed, but the
same people who argue that probably argue against using a text based editor
too.

--
Answer: Because it makes conversations flow in a nonsensical order.
Question: Why is top-posting wrong? [http://en.wikipedia.org/wiki/Netiquette]

--
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 is vim's bug of syntax and fold?

Cocular wrote:
> Thanks.
>
> In my understanding, the larger region will ALWAYS cover small region,
> UNLESS you specify transparent to the larger region or you specify the
> contains=small to the larger region.
>
> Also, the contained region will eat the end spot so that the parent
> region can not end correct if they share the same end point. keepend
> can force its childs do keep the end and extend can force to eat the
> end spot even its parent has keepend.
>
> Am I right?
>
Not exactly.

Vim doesn't "know" whether one region will be larger than another; its a
question of priority (later definitions have priority) and which region
starts first.

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

Re: bash function output in vim function

On Mon, Feb 27, 2012, at 11:23 PM, Gary Johnson wrote:
> On 2012-02-27, sinbad wrote:
> > hi,
> >
> > here is what i want. i have a function in bash, based on some
> > criteria it emits a list of files, i want these list of files to be
> > used in vim's quickfix list. how can this be done. i tried like
> > this. The bash function is aliased to bashfunc, but the alias
> > is not available in vim's system() cmd, so i wrote a bash
> > script, which inturn source's the bashrc for the alias, and
> > calls the aliased cmd, when i call this script from vim's system()
> > it still doesn't work, am i missing something here.
>
> The bash(1) man page, in the ALIASES section, says:
>
> Aliases are not expanded when the shell is not interactive,
> unless the expand_aliases shell option is set using shopt (see
> the description of shopt under SHELL BUILTIN COMMANDS below).
>
> When executing your script, the shell is not interactive. So
> somewhere in your script, you need to put this command:
>
> shopt -s expand_aliases
>
> That will solve your alias expansion problem. Whether that is the
> best solution to your overall problem, whatever it is, I don't know.
>
> 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
>

Hope this helped Sinbad, but even if it didn't it helped me.
Thanks Gary
--
Nick Hawk
sky2hawk@myopera.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: underlining support for markdown syntax?

Hi Tim!

On Tue, 28 Feb 2012 06:02:21 -0600, Tim Chase wrote:
> On 02/28/12 05:41, rath@mglug.de wrote:
>> [..]
> There are two possibilities that occur to me. The first is if you
> want the *whole* line underlined. There are lots of ways you can do
> this. I personally use
>
> :t.|s/./-/g

Sounds good.

> (which could be wrapped up in a macro) because it doesn't tromp my
> scratch register. I know other people use a macro that does
> something
> like
>
> YpVr-
>
> to "Y"ank the current line, "p"aste it, "V"isualize the line, and
> "r"eplace each character in that selection with a "-". Note that
> changes your scratch/yank registers' contents.

Thats so easy if I see it now! Thanks!

>
> You can map them something like
>
> :nnoremap <leader>- :t.<bar>s/./-/g<cr>
> :nnoremap <leader>= YpVr=
>
> so you can (by default, based on your 'mapleader' setting) type
>
> \=
>
> to underline the current line with "="s. I put in both styles so you
> can see how each would work, but I'd pick the one that's clearest to
> you and stick with it for both cases.

Ok, thanks.

I modified the command to "Ypwv$r=", so ich moved to the next "word"
(let the comment marker alive), then marked with standard marker v (not
V for whole line) up to the end ("$"), then replacing it :-)

>
>
> The other case regards visually marking a sub-portion of a line as
> underlined such as
>
> I only want this part underlined, okay?
> --------------------
>
> That's a lot harder, so if it's what you want, time can be taken to
> cook up something, but there are some non-trivial edge-cases that
> would have to be addressed.

Thats not necessary. For Markdown-Syntax the example above is full
functionally.

Thanks a lot!

Regards,
Oliver

--
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: underlining support for markdown syntax?

On Tue, 28 Feb 2012 12:56:17 +0100, Thomas Ba wrote:
> You could use for example:
>> nnoremap ;u yyp:s/./=/g<CR>:nohlsearch<CR>
>
> This copies the current line an replaces each character with '='

Copying and then replacing with the right character ist a good idea!
Thanks!

Regards,

Oliver

--
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: underlining support for markdown syntax?

On 02/28/12 05:41, rath@mglug.de wrote:
> im looking for a posibillity for fast "underlining" some Text with a
> charakter like "=" or "-", which is used in markdown-Syntax.
>
> I.E. if I write some comment in a program like
>
> # This is an big Headline
> # =======================
> #
> # And this a normal headline
> # --------------------------
>
> So it would be nice to expand the "=" or "-" with a command up to the
> end of the upper line.
>
> How can I do this? Is there a builtin for this? Makro?

There are two possibilities that occur to me. The first is if
you want the *whole* line underlined. There are lots of ways you
can do this. I personally use

:t.|s/./-/g

(which could be wrapped up in a macro) because it doesn't tromp
my scratch register. I know other people use a macro that does
something like

YpVr-

to "Y"ank the current line, "p"aste it, "V"isualize the line, and
"r"eplace each character in that selection with a "-". Note that
changes your scratch/yank registers' contents.

You can map them something like

:nnoremap <leader>- :t.<bar>s/./-/g<cr>
:nnoremap <leader>= YpVr=

so you can (by default, based on your 'mapleader' setting) type

\=

to underline the current line with "="s. I put in both styles so
you can see how each would work, but I'd pick the one that's
clearest to you and stick with it for both cases.


The other case regards visually marking a sub-portion of a line
as underlined such as

I only want this part underlined, okay?
--------------------

That's a lot harder, so if it's what you want, time can be taken
to cook up something, but there are some non-trivial edge-cases
that would have to be addressed.

-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: underlining support for markdown syntax?

On Tue, Feb 28, 2012 at 12:41:49 +0100, rath@mglug.de wrote:
> Hi list,
>
> im looking for a posibillity for fast "underlining" some Text with a
> charakter like "=" or "-", which is used in markdown-Syntax.
>
> I.E. if I write some comment in a program like
>
> # This is an big Headline
> # =======================
> #
> # And this a normal headline
> # --------------------------
>
> So it would be nice to expand the "=" or "-" with a command up to
> the end of the upper line.
>
> How can I do this? Is there a builtin for this? Makro?

You could use for example:
> nnoremap ;u yyp:s/./=/g<CR>:nohlsearch<CR>

This copies the current line an replaces each character with '='

--
Zombie processes haunting the computer

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

underlining support for markdown syntax?

Hi list,

im looking for a posibillity for fast "underlining" some Text with a
charakter like "=" or "-", which is used in markdown-Syntax.

I.E. if I write some comment in a program like

# This is an big Headline
# =======================
#
# And this a normal headline
# --------------------------

So it would be nice to expand the "=" or "-" with a command up to the
end of the upper line.

How can I do this? Is there a builtin for this? Makro?

TfH!
Oliver

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

Monday, February 27, 2012

Re: bash function output in vim function

On 2012-02-27, sinbad wrote:
> hi,
>
> here is what i want. i have a function in bash, based on some
> criteria it emits a list of files, i want these list of files to be
> used in vim's quickfix list. how can this be done. i tried like
> this. The bash function is aliased to bashfunc, but the alias
> is not available in vim's system() cmd, so i wrote a bash
> script, which inturn source's the bashrc for the alias, and
> calls the aliased cmd, when i call this script from vim's system()
> it still doesn't work, am i missing something here.

The bash(1) man page, in the ALIASES section, says:

Aliases are not expanded when the shell is not interactive,
unless the expand_aliases shell option is set using shopt (see
the description of shopt under SHELL BUILTIN COMMANDS below).

When executing your script, the shell is not interactive. So
somewhere in your script, you need to put this command:

shopt -s expand_aliases

That will solve your alias expansion problem. Whether that is the
best solution to your overall problem, whatever it is, I don't know.

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: Is is vim's bug of syntax and fold?

Thanks.

In my understanding, the larger region will ALWAYS cover small region,
UNLESS you specify transparent to the larger region or you specify the
contains=small to the larger region.

Also, the contained region will eat the end spot so that the parent
region can not end correct if they share the same end point. keepend
can force its childs do keep the end and extend can force to eat the
end spot even its parent has keepend.

Am I right?

On Tue, Feb 28, 2012 at 1:36 AM, Charles Campbell
<Charles.E.Campbell@nasa.gov> wrote:
> Ben Fritz wrote:
>>
>>
>> On Feb 27, 4:45 am, Yichao Zhou<broken.z...@gmail.com>  wrote:
>>
>>>
>>> 3. syn region vimBug1 start="{" end="}"
>>> 4. syn region vimBig2 start="\\begin{homework}" end="\\end{homework}"
>>> transparent fold
>>>
>>>
>>
>> This fails because the end of your vimBug1 group matches the last
>> character of end{homework}, preventing the end of the vimBig2 group
>> from matching at that location. By default, only one pattern can match
>> at a specific spot, which allows nesting.
>>
>> To fix this, you'll need to use the "keepend" keyword. :help :syn-
>> keepend.
>>
>> Note that this will make you unable to nest vimBig2 groups, so you
>> will probably also need to look at :help :syn-extend and make
>> modifications elsewhere in the syntax file.
>>
>>
>
> Well, Ben, you beat me to it!
>
> Yichao Zhou: may I suggest that you try my hilinks.vim plugin
> (http://drchip.0sites.net/astronaut/vim/index.html#HILINKS).   Issue  :HLT!
> with it, and as you move your cursor about, a report on the bottom will
> (succinctly) show you the syntax and highlighting linkages.
>
> In the example you gave:
>
>  \begin{homework}
>  111112222222222
>
> where 1=vimBig2
> and      2=vimBig2->vimBug1
>
> Furthermore, the reason why vimBug1 shows up is due to your use of the
> "transparent" keyword with vimBig2.  Take transparent out, and you get the
> folding you want.
>
> 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

--
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: If there is a > in exactly the 80th character, the following lines will be double-quoted after gq

On Tue, February 28, 2012 01:57, Tim Chase wrote:
> On 02/27/12 14:11, Matt Ackeret wrote:
>
>> I got an email that had in exactly the 80th column. (I read
>> email in alpine, with vim as my alternate editor.)
>>
>> The text was not wrapped, so I gq it.
>
> I see the same peculiar behavior in my slightly older 7.2.445
> (stock on Debian Stable). To duplicate, I did the following:
>
> vim blank_file.txt
> :0put='>This is the first line of the quoted'
> :t.|t.|%j
> :set tw=40
> gqip
>
> and I ended up with sequential increments of ">" indentation
> where I would normally have expected one ">" on each line.

This depends on the value of the 'formatoptions' setting.
By default, vim includes the 'q'. If you remove the q, Vim won't
include a new comment-leader when wrapping the text.

I think how it actually works is that vim inspects the 'comments' setting
and uses it to recognize comments. After wrapping, the line already
contains the '>' at the beginning, but since nesting is allowed
(:set comments includes n:>), Vim insert the same amount of comment
leaders at the beginning of the line as on the previous line.

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:bash function output in vim function

you can write it like this:
redir => var
 silent! function()
redir END
 
let list = matchstr(var,'\n')
 
 
 
 
------------------ Original ------------------
Date:  Tue, Feb 28, 2012 01:59 PM
To:  "vim_use"<vim_use@googlegroups.com>;
Subject:  bash function output in vim function
 
hi,

here is what i want. i have a function in bash, based on some
criteria it emits a list of files, i want these list of files to be
used in vim's quickfix list. how can this be done. i tried like
this. The bash function is aliased to bashfunc, but the alias
is not available in vim's system() cmd, so i wrote a bash
script, which inturn source's the bashrc for the alias, and
calls the aliased cmd, when i call this script from vim's system()
it still doesn't work, am i missing something here.

tia
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

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

bash function output in vim function

hi,

here is what i want. i have a function in bash, based on some
criteria it emits a list of files, i want these list of files to be
used in vim's quickfix list. how can this be done. i tried like
this. The bash function is aliased to bashfunc, but the alias
is not available in vim's system() cmd, so i wrote a bash
script, which inturn source's the bashrc for the alias, and
calls the aliased cmd, when i call this script from vim's system()
it still doesn't work, am i missing something here.

tia
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

ANN: YankRing 13.0

YankRing.vim : Maintains a history of previous yanks, changes and deletes
http://www.vim.org/scripts/script.php?script_id=1234

What does it do?

Allows you to retrieve previous yanks, deletes and changed text and
cycle through them choosing which item you need. It also works across
Vim instances so they all see the same history. Useful for sharing
text across instances, including when using Screen in *nix.

For a more descriptive write up, please see the web page.

Thanks for everyone's feedback so far.
If you do try the plugin and find things that bother you, please send
me an email.


What is new?


NF: [p, ]p, [P, ]P are now supported within the YankRing window
(Alexandre Provencio).

NF: When using the console version of Vim the yankring was not detecting
the "+ register automatically as the FocusGained event does not fire in
console mode. When new elements are added or the YankRing is shown the
clipboard will be checked for new values (Giuseppe Rota).

NF: Added a new option, g:yankring_manual_clipboard_check which when
enabled will manually check for clipboard changes at certain times
within the YankRing. This option is not used if the GUI is running as
the FocusGained will perform checks at appropriate times (Erik Westrup).

BF: With clipboard=unnamed replacing the previous paste with a different
value from the YankRing did not work in all cases (Chris Lott).

BF: Under certain conditions the YankRing would still check the system
clipboard even if g:yankring_clipboard_monitor == 0. This can lead to
delays when attempting to access the clipboard when running in console
mode. Starting Vim with the -X switch removes the delay (Erik Westrup).

BF: Incorrect syntax setting cpoptions (Thilo Six).


As usual, feedback good and bad is always welcome.

Enjoy.
Dave

--
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: If there is a > in exactly the 80th character, the following lines will be double-quoted after gq

On 02/27/12 14:11, Matt Ackeret wrote:

> I got an email that had in exactly the 80th column. (I read
> email in alpine, with vim as my alternate editor.)
>
> The text was not wrapped, so I gq it.

I see the same peculiar behavior in my slightly older 7.2.445
(stock on Debian Stable). To duplicate, I did the following:

vim blank_file.txt
:0put='>This is the first line of the quoted'
:t.|t.|%j
:set tw=40
gqip

and I ended up with sequential increments of ">" indentation
where I would normally have expected one ">" on each line.

-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

If there is a > in exactly the 80th character, the following lines will be double-quoted after gq

Vim 7.3

I got an email that had > in exactly the 80th column. (I read email in alpine,
with vim as my alternate editor.)

The text was not wrapped, so I gq it. Then it ends up like

>This is the first line of the quoted text and is quoted properly. But there was
>> character right at the 80th line. adf asf asf asf adf adf adf adf as as asf
>> asf asf asf asf asf asf adf adf adf af afd afas ...

Now, the second line being "doubly-quoted" is proper, since the second > was
really part of the text.

However, it seems to me that this means that the vim gq code is simply doing
a "look at the last line.. quote the same as it. It should really have a
"how much should I be quoting" that it kept throughout the gq operation.

--
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: gnu scientific library reference like crefvim

Daniel Fetchinson wrote:
> Hi folks, there is the excellent C reference help file for vim
>
> http://www.vim.org/scripts/script.php?script_id=614
>
> and I was wondering whether such a thing exists for gsl, the GNU
> Scientific Library.
>
> Any ideas?
>
Well, something related -- you might find
http://drchip.0sites.net/astronaut/vim/index.html#HINTS_GSL of interest.

What it does is, when you insert thefunctionname( the prototype for
thefunctionname will show on the bottom of your vim console.

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

Re: Is is vim's bug of syntax and fold?

Ben Fritz wrote:
>
> On Feb 27, 4:45 am, Yichao Zhou<broken.z...@gmail.com> wrote:
>
>> 3. syn region vimBug1 start="{" end="}"
>> 4. syn region vimBig2 start="\\begin{homework}" end="\\end{homework}"
>> transparent fold
>>
>>
> This fails because the end of your vimBug1 group matches the last
> character of end{homework}, preventing the end of the vimBig2 group
> from matching at that location. By default, only one pattern can match
> at a specific spot, which allows nesting.
>
> To fix this, you'll need to use the "keepend" keyword. :help :syn-
> keepend.
>
> Note that this will make you unable to nest vimBig2 groups, so you
> will probably also need to look at :help :syn-extend and make
> modifications elsewhere in the syntax file.
>
>
Well, Ben, you beat me to it!

Yichao Zhou: may I suggest that you try my hilinks.vim plugin
(http://drchip.0sites.net/astronaut/vim/index.html#HILINKS). Issue
:HLT! with it, and as you move your cursor about, a report on the bottom
will (succinctly) show you the syntax and highlighting linkages.

In the example you gave:

\begin{homework}
111112222222222

where 1=vimBig2
and 2=vimBig2->vimBug1

Furthermore, the reason why vimBug1 shows up is due to your use of the
"transparent" keyword with vimBig2. Take transparent out, and you get
the folding you want.

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

gnu scientific library reference like crefvim

Hi folks, there is the excellent C reference help file for vim

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

and I was wondering whether such a thing exists for gsl, the GNU
Scientific Library.

Any ideas?

Cheers,
Daniel


--
Psss, psss, put it down! - http://www.cafepress.com/putitdown

--
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: wrong encoding for digraph page

On Feb 27, 3:37 am, "Christian Brabandt" <cbli...@256bit.org> wrote:
> On Mon, February 27, 2012 04:59, Adam Monsen wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
>
> > I think there's a problem with
> >http://vimdoc.sourceforge.net/htmldoc/digraph.html.
>
> > 1. the server doesn't say what character encoding is used
> > 2. the HTML says <meta http-equiv="Content-type" content="text/html;
> > charset=ISO-8859-1">
> > 3. it only looks correct if I force it to be interpreted as UTF-8
>
> The page at vimhelp.appspot.com/digraph.txt.html looks correct.
>

Confirmed in IE8. The appspot page is detected by IE8 as UTF-8, the
sourceforge page is not. I note that :help digraph.txt within Vim
opens the file with utf-8 fileencoding (at least on my Windows system,
with 'encoding' set to utf-8 in my .vimrc).

--
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 is vim's bug of syntax and fold?

On Feb 27, 4:45 am, Yichao Zhou <broken.z...@gmail.com> wrote:
> 3. syn region vimBug1 start="{" end="}"
> 4. syn region vimBig2 start="\\begin{homework}" end="\\end{homework}"
> transparent fold
>

This fails because the end of your vimBug1 group matches the last
character of end{homework}, preventing the end of the vimBig2 group
from matching at that location. By default, only one pattern can match
at a specific spot, which allows nesting.

To fix this, you'll need to use the "keepend" keyword. :help :syn-
keepend.

Note that this will make you unable to nest vimBig2 groups, so you
will probably also need to look at :help :syn-extend and make
modifications elsewhere in the syntax file.

--
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: netrw in try clause


Several users including myself have run into this issue with the Vimwiki plugin.  We have a try-catch stmt wrapped around a command that opens an existing directory, and we are receiving the "Illegal file name" error and a blank page.  I am using Vim 7.3, like others above.  I believe I am using Netrw v143 ... at least, when I type ":help netrw-history", it starts with:

v143: Jun 01, 2011 * |g:netrw_winsize| will accept a negative
    number; the absolute value of it will then
    be used to specify lines/columns instead of
    a percentage.

If I source motz's script (above) *without* the try-stmt, it works, and *with* the try-stmt, nothing happens.

Are we doing something wrong?  
Any help would be appreciated.  

Thank you,
- Stu

p.s. Here's my Vim version info:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 31 2011 19:27:29)
Compiled by XXXXXXXXX
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path 
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv 
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent 
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse 
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype 
+path_extra -perl +persistent_undo +postscript +printer -profile -python 
-python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent 
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses



On Thursday, February 10, 2011 4:41:29 PM UTC-5, Charles Campbell wrote:
Bram Moolenaar wrote:
> Charles Campbell wrote:
>
>    
>> Bram Moolenaar wrote:
>>      
>>> Possibly netrw could add a BufReadCmd that leaves the buffer empty.
>>> That avoids the "illegal file name" error. Just be very careful to only
>>> trigger the auto command for directories, otherwise you disable editing
>>> some type of file.
>>>
>>>
>>>        
>> v141j of netrw now uses a BufReadCmd on files matching, via an autocmd,
>> *[/\\] .  This method does avoid the "... is a directory" message as
>> Bram said it would, and works inside a try-endtry clause, so long as the
>> directory path ends with a "/" or "\".  However, paths to directories
>> that don't end in a "/" or "\" will continue to exhibit the former behavior.
>>
>> v141j of netrw is available at my website as:
>> http://mysite.verizon.net/astronaut/vim/index.html#NETRW .
>>      
> I suppose to fix this properly would require adding some magic to the
> autocmd pattern, e.g.:
>
>         :autocmd BufReadCmd<type==dir>  DoNothing
>
> We already have the<buffer>  item in the pattern, thus we would follow
> that.
>
> Could also do something like this:
>
>         :autocmd BufWritePost<type!=dir>/tmp/* chmod 600
>         :autocmd BufWritePost<type==dir>/tmp/* chmod 700
>
> Perhaps this is too complicated?
>
>    
How about <isdir> and <notisdir> ... otherwise, you're bound to have
someone ask for full-fledged expressions in those <...>s.  But that
would work nicely.  I've been trying  the  *[/\\] along with BufReadCmd
and have been ending up with readonly files.  I haven't really looked
into it in detail yet to see what's doing the readonly bit (I tried  
:set verbose ro?  and didn't get anything).

Regards,
Chip Campbell


On Thursday, February 10, 2011 4:41:29 PM UTC-5, Charles Campbell wrote:
Bram Moolenaar wrote:
> Charles Campbell wrote:
>
>    
>> Bram Moolenaar wrote:
>>      
>>> Possibly netrw could add a BufReadCmd that leaves the buffer empty.
>>> That avoids the "illegal file name" error. Just be very careful to only
>>> trigger the auto command for directories, otherwise you disable editing
>>> some type of file.
>>>
>>>
>>>        
>> v141j of netrw now uses a BufReadCmd on files matching, via an autocmd,
>> *[/\\] .  This method does avoid the "... is a directory" message as
>> Bram said it would, and works inside a try-endtry clause, so long as the
>> directory path ends with a "/" or "\".  However, paths to directories
>> that don't end in a "/" or "\" will continue to exhibit the former behavior.
>>
>> v141j of netrw is available at my website as:
>> http://mysite.verizon.net/astronaut/vim/index.html#NETRW .
>>      
> I suppose to fix this properly would require adding some magic to the
> autocmd pattern, e.g.:
>
>         :autocmd BufReadCmd<type==dir>  DoNothing
>
> We already have the<buffer>  item in the pattern, thus we would follow
> that.
>
> Could also do something like this:
>
>         :autocmd BufWritePost<type!=dir>/tmp/* chmod 600
>         :autocmd BufWritePost<type==dir>/tmp/* chmod 700
>
> Perhaps this is too complicated?
>
>    
How about <isdir> and <notisdir> ... otherwise, you're bound to have
someone ask for full-fledged expressions in those <...>s.  But that
would work nicely.  I've been trying  the  *[/\\] along with BufReadCmd
and have been ending up with readonly files.  I haven't really looked
into it in detail yet to see what's doing the readonly bit (I tried  
:set verbose ro?  and didn't get anything).

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

Vim for LaTeX


I've started learning to use LaTeX for formatting and printing documents with the help of LyX, the graphical front end for LaTeX. It's occurred to me that I could use Vim to LaTeX shorter documents---letters, memos, simply formatted reports, etc.

There is one option I'm aware of---the Vim-LaTeX plugin. That might be overkill for the simple documents I have in mind. Markdown or MultiMarkdown would be simpler and MD- or MMD-coded documents would be more readable than LaTeX-coded documents even before compiling.

Is there aan MD or MMD compiler plugin for Vim? 

Thanks.
------------------------------------------------------------------------------------------

"Every moment is unique and discrete."

Eknath Eswaran

Re: Basic syntax highlighting fail



On 27 February 2012 19:18, Jean-Michel Pichavant <jeanmichel@sequans.com> wrote:
Christian Brabandt wrote:
On Mon, February 27, 2012 05:28, Paul Harris wrote:
 
Hi,

I'm using Vim 7.2.445 on Debian, with no .vimrc or .gvimrc.

I write a file to the /tmp path, called x.c
call("look
call_something();

I load up that file in gvim
vim /tmp/x.c

Turn on syntax
:syntax on

Split the buffer
:sp

And put a quote at the end of the first line, so it looks like call("look"
A"

The top buffer is correctly coloured, the bottom buffer is not.

Why?  How can I fix it?
It is a source of a lot of syntax colour problems for me.
   

I can't reproduce it. Try to give exact commands, how to trigger the bug.
See also the faq (vimhelp.appspot.com) Q: 36.12 and 2.5

regards,
Christian

 
I did reproduce it with vim 7.3. Looks like a bug to me, not the first one I met with the syntax colors. Only the first window is updated properly, even when the modification is done in another one.

If you want it to be fixed, your best bet is to open a bug.

JM



Thanks JM, I thought I was going mad.

 

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