Saturday, January 29, 2011

Help, please

I use DropBox. I edit a file on computer "A" and FORGET to exit vim. Now on computer "B",
the .swp file prevents me from editing. I know I can ignore and just to go computer. However, VIM
and DropBox could solve my problem by having an option to update on 1,4,16,64,256 second intervals
and abandoning the lock file that is the .swp file. DropBox has solved the SYNC problem. Please embrace
it and make DropBox and VIM work as people WANT, not as developer's expect.

Ed Bradford
egbegb2 AT gmail DOT com

--
It is impossible to rightly govern a nation without God and the Bible.
George Washington

--
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 do the default key commands work

Hi,

I have some basic questions about how things work in vim.

Is it true that every key command executes a function? Say the key command »%«
performed on a bracket jumps to the matching closing bracket. Is there a
function defined like MatchBracket()? If this is true, how can I see which key
command executes which function?

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: Show method name in gutter

Someone on the list pointed me to this:


I use StlShowFunc for this; see  http://mysite.verizon.net/astronaut/vim/index.html#STLSHOWFUNC


I have not used it.


I follow you on "blogs"...so will be interesting to see what comes out.


-- 

Robert

Re: Starting out with VIM and C++

> I just started an introductory course on C++, and I would like to take the
> time to use VIM as an IDE. What do I need to do to get colored syntax and
> make it more usable for C++ programming?

Nick,

Since you are new to C++, you are likely to write mostly single-file
console/terminal programs. For this kind of work, I would modestly
recommend my own :) plug-in Side-C (script #2434).

It's a very simple gvim IDE for at least Linux and Windows that
transparently invokes the compiler, opens/closes the quickfix
(i.e. error message) window as necessary, runs the executable
program in several modes, and does several other useful things.

I myself happily use it on a daily basis so it must be good enough :)

Boyko

--
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: 'list', :list, and 'listchars'

Am 26.01.2011 18:41, schrieb Ben Fritz:
>> From looking at :list, it seems like it's basically supposed to print
> the line as it would show with 'list' turned on. However, I have a few
> questions:
>
> :help :list says it will use '^' for unprintable characters, and
> additionally says "This can be changed with the 'listchars' option.
> However, there does not seem to be any 'listchars' option controlling
> the display of unprintable characters. What does setting 'list' do for
> unprintable characters? Anything?
>
> :help :list only mentions EOL and unprintable behavior, but
> experimentation shows that "trail", "extends", and "tab" also apply
> from 'listchars'. "precedes" and "extends" certainly would not make
> sense in this context, but what about "nbsp" and "conceal"?
> Experimentation shows that these two options do not have any effect.
> Should they? I could understand "conceal" having no effect, but I
> would certainly expect "nbsp" to apply, since "trail", etc. all apply.

Unprintable characters basically are control characters
:h 'isprint
Tab is a control character - when 'listchars' does not include
'tab:xy', then tab will be printed as '^I'.

"nbsp" was added recently, maybe just forgotten to be implemented for
:list ...
:list is such a rarely used command ...

--
Andy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: How to replace "\" to "\\"

Am 27.01.2011 03:51, schrieb Wayne Young:
> Hi Andy,
>
> I can understand the pattern ifys0325 gave now (thanks ifys0325!) ,
> but yours really scared me... All I can know is the last one with a
> "\=". The first one seems to be: find a "\\*", without a "\" ahead,
> and without a "\\" followed?
> And the second one: no "\" leads, but followed by a "\", and it
> matches "\\*" ?
>
> I think I may wrong to parse those two, but I am not able to
> understand them at all...
>
> On Thu, Jan 27, 2011 at 5:03 AM, Andy Wokula<anwoku@yahoo.de> wrote:
>
>> Am 26.01.2011 07:34, schrieb Wayne Young:
>>
>> Thanks very much. The second works!
>>> I am still wondering how it work. It seems to replace the "
>>> \%(\\\)\@<!\\\$(\\\)\@! " part to "\\\\". Would you help to explain
>>> the meaning of the replaced part?
>>
>> What about '\\\', the given substitute will not turn it into '\\\\'.

With spaces to make it readable:

First command:

:%s/ \\ \@<! \%( \\ \\ \) * \\ \\ \@! / \\ & / g

works as follows.
Find an odd number of backslashes (one or more):

\%( \\ \\ \) * \\

The above will find '\\\' at the start of '\\\\' (which is bad); make
sure no '\' follows the match:

\%( \\ \\ \) * \\ \\ \@!

Now the above will find '\\\' at the end of '\\\\' (after backtracking,
the next try starts one position to the right); make sure no '\'
precedes the match:

\\ \@<! \%( \\ \\ \) * \\ \\ \@!

Eventually, '\','\\\',... are found and '\\','\\\\',... are skipped.

The replace part is: a backslash plus the whole matched text.


Second command:

:%s/ \\ \@<! \%( \%( \\ \\ \) * \) \@> \\ / \\ & / g

This one makes use of \@> (rarely to be found in patterns).

Find an odd number of '\':

\%( \%( \\ \\ \) * \) \@> \\

The above will find '\\\', but not at the start of '\\\\', because
'\\\\' is matched by \%( \\ \\ \) * and the surrounding \@> disables
backtracking (which would allow a match for the following \\ ).

Now when the whole pattern (so far) fails, the next try starts one
position to the right, allowing a match for '\\\' at the end of '\\\\'.
Like with the first command, this is avoided with \\ \@<! .


Third command:

:%s/ \\ \\ \= / \\ \\ / g

This one processes each encountered backslash, no problem with
backtracking then.


Get help:

:h pattern
:h /\@!

:h sub-replace-special

etc.

--
Andy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: [VIM]: Help with constructing error format string....

Excerpts from vijay's message of Sat Jan 29 09:02:10 +0100 2011:
> set efm=%W\[[0-9A-Z]*]\\s%#\\S%#\\s%#\\S%#\\s%#%f\\s%#%l\\s%#[0-9]s%#
> %m

You need scanf like expressions. Don't ask me why - this seems to work:

set efm=%*[^\ ]%*[\ ]%*[^\ ]%*[\ ]%*[^\ ]%*[\ ]%*[^\ ]%*[\ ]%f\ %l%m

match no spaces:
%*[^\ ]
match spaces:
%*[\ ]

repeat until path is expected...

Marc Weber

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php