Re: Highlight just headings?

2013-01-13 Thread Shlomi Fish
Hi wolfv,

On Sat, 12 Jan 2013 10:44:03 -0800 (PST)
wolfv wolfvo...@gmail.com wrote:

 I use VIM to edit .txt files for personal notes and to-do lists.  I really
 like my setup but sometimes it is hard to pick out the headings.
 
 The only Markdown convention I use is headings.  I turned off Markdown syntax
 because most of the highlighting gets in the way e.g. the “_” underscore in
 URLs, file_names, and paths start italics where I don't want it.  Escape
 characters would slow down typing and reading.
 
 I use Markdown headings for folding.  I do not want the remaining Markdown
 syntax.
 
 Is there a Vim script that has the following three syntax or a plugin where
 the other syntax can be turned off?: 1. indented wrapping e.g. Block Quotes
 from reStructuredText (RST) 2. heading highlighting from Markdown e.g. ##title
  3. folding on the Markdown headings
 

(sorry for messing up the text).

I think the quickest way given these requirements is to write something like
that yourself or pay/convince/bribe/force/threaten/etc. someone else to do it.
I am willing to do it given the right price, but I should warn you that I'm not
a very big expert when it comes to writing Vim syntax files. If you're
interested in hiring me, then contact me offlist:

http://www.shlomifish.org/me/contact-me/

Other people may be able to help you too, but most of them will also probably
expect a payment of some sort. Or like I said, you can learn it from vim's
usr_* and write it yourself.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Why I Love Perl - http://shlom.in/joy-of-perl

Larry Wall *does* know all of Perl. However, he pretends to be wrong
or misinformed, so people will underestimate him.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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


Re: Yank part of line?

2013-01-13 Thread Tim Chase

On 01/13/13 01:15, stosss wrote:

On Sun, Jan 13, 2013 at 1:29 AM, John Beckett
johnb.beck...@gmail.com wrote:

In normal mode, you can of course move the cursor to somewhere
within the line and type y$ to yank to the end, or y0 to yank
to the beginning, and lots more things.



An example could be in your reply above move the cursor I want
to put the cursor on m yank everything to r and I would do
this in a mapping and/or manually.


In the above, you would move to the m in move the cursor and 
then do something like


  y3e

to yank to the end of the 3rd word.

-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


Macros viewing them?

2013-01-13 Thread stosss
I didn't find anything in help about being able to see the commands in
a macro. When I create a mapping I can see what I have typed into the
mapping so I can figure out what I did wrong if my mapping doesn't
work as expected the first time. Is it possible to do something like
this with a recorded macro?

I took the commands I have in a complex mapping and did them manually
with copy and paste within a record session. The recording worked up
to a point and then failed but I don't know where it failed and
without seeing the commands visually I have to redo the recording from
start to finish and hope I get it all done correctly. That is a pain.

Maybe I am thinking about this backwards. Maybe I should use macros
for the simple things and mappings for the more complex. I need to
figure out how to create scripts and functions and stuff like that.

This is what I found in usr_10.txt and repeat.txt following:

usr_10.txt

*10.1*  Record and playback commands

The . command repeats the preceding change.  But what if you want to do
something more complex than a single change?  That's where command recording
comes in.  There are three steps:

1. The q{register} command starts recording keystrokes into the register
   named {register}.  The register name must be between a and z.
2. Type your commands.
3. To finish recording, press q (without any extra character).

You can now execute the macro by typing the command @{register}.

Take a look at how to use these commands in practice.  You have a list of
filenames that look like this:

stdio.h ~
fcntl.h ~
unistd.h ~
stdlib.h ~

And what you want is the following:

#include stdio.h ~
#include fcntl.h ~
#include unistd.h ~
#include stdlib.h ~

You start by moving to the first character of the first line.  Next you
execute the following commands:

qa  Start recording a macro in register a.
^   Move to the beginning of the line.
i#include EscInsert the string #include  at the beginning
of the line.
$   Move to the end of the line.
aEsc Append the character double quotation mark ()
to the end of the line.
j   Go to the next line.
q   Stop recording the macro.

Now that you have done the work once, you can repeat the change by typing the
command @a three times.
   The @a command can be preceded by a count, which will cause the macro to
be executed that number of times.  In this case you would type: 

3@a


MOVE AND EXECUTE

You might have the lines you want to change in various places.  Just move the
cursor to each location and use the @a command.  If you have done that once,
you can do it again with @@.  That's a bit easier to type.  If you now
execute register b with @b, the next @@ will use register b.
   If you compare the playback method with using ., there are several
differences.  First of all, . can only repeat one change.  As seen in the
example above, @a can do several changes, and move around as well.
Secondly, . can only remember the last change.  Executing a register allows
you to make any changes and then still use @a to replay the recorded
commands.  Finally, you can use 26 different registers.  Thus you can remember
26 different command sequences to execute.


repeat.txt

3. Complex repeats  *complex-repeat*

*q* *recording*
q{0-9a-zA-Z}   Record typed characters into register {0-9a-zA-Z}
(uppercase to append).  The 'q' command is disabled
while executing a register, and it doesn't work inside
a mapping.  {Vi: no recording}

q   Stops recording.  (Implementation note: The 'q' that
stops recording is not stored in the register, unless
it was the result of a mapping)  {Vi: no recording}

*@*
@{0-9a-z.=*}   Execute the contents of register {0-9a-z.=*} [count]
times.  Note that register '%' (name of the current
file) and '#' (name of the alternate file) cannot be
used.  For @= you are prompted to enter an
expression.  The result of the expression is then
executed.  See also |@:|.  {Vi: only named registers}

*@@* *E748*
@@  Repeat the previous @{0-9a-z:*} [count] times.

:[addr]*{0-9a-z.=} *:@* *:star*
:[addr]@{0-9a-z.=*}Execute the contents of register {0-9a-z.=*} as an Ex
command.  First 

Re: Macros viewing them?

2013-01-13 Thread stosss
Sorry I stopped reading the help file too soon!

On Sun, Jan 13, 2013 at 9:21 AM, stosss sto...@gmail.com wrote:
 I didn't find anything in help about being able to see the commands in
 a macro. When I create a mapping I can see what I have typed into the
 mapping so I can figure out what I did wrong if my mapping doesn't
 work as expected the first time. Is it possible to do something like
 this with a recorded macro?

 I took the commands I have in a complex mapping and did them manually
 with copy and paste within a record session. The recording worked up
 to a point and then failed but I don't know where it failed and
 without seeing the commands visually I have to redo the recording from
 start to finish and hope I get it all done correctly. That is a pain.

 Maybe I am thinking about this backwards. Maybe I should use macros
 for the simple things and mappings for the more complex. I need to
 figure out how to create scripts and functions and stuff like that.

 This is what I found in usr_10.txt and repeat.txt following:

 usr_10.txt

 *10.1*  Record and playback commands

 The . command repeats the preceding change.  But what if you want to do
 something more complex than a single change?  That's where command recording
 comes in.  There are three steps:

 1. The q{register} command starts recording keystrokes into the register
named {register}.  The register name must be between a and z.
 2. Type your commands.
 3. To finish recording, press q (without any extra character).

 You can now execute the macro by typing the command @{register}.

 Take a look at how to use these commands in practice.  You have a list of
 filenames that look like this:

 stdio.h ~
 fcntl.h ~
 unistd.h ~
 stdlib.h ~

 And what you want is the following:

 #include stdio.h ~
 #include fcntl.h ~
 #include unistd.h ~
 #include stdlib.h ~

 You start by moving to the first character of the first line.  Next you
 execute the following commands:

 qa  Start recording a macro in register a.
 ^   Move to the beginning of the line.
 i#include EscInsert the string #include  at the beginning
 of the line.
 $   Move to the end of the line.
 aEsc Append the character double quotation mark ()
 to the end of the line.
 j   Go to the next line.
 q   Stop recording the macro.

 Now that you have done the work once, you can repeat the change by typing the
 command @a three times.
The @a command can be preceded by a count, which will cause the macro to
 be executed that number of times.  In this case you would type: 

 3@a


 MOVE AND EXECUTE

 You might have the lines you want to change in various places.  Just move the
 cursor to each location and use the @a command.  If you have done that once,
 you can do it again with @@.  That's a bit easier to type.  If you now
 execute register b with @b, the next @@ will use register b.
If you compare the playback method with using ., there are several
 differences.  First of all, . can only repeat one change.  As seen in the
 example above, @a can do several changes, and move around as well.
 Secondly, . can only remember the last change.  Executing a register allows
 you to make any changes and then still use @a to replay the recorded
 commands.  Finally, you can use 26 different registers.  Thus you can remember
 26 different command sequences to execute.


 repeat.txt

 3. Complex repeats  *complex-repeat*

 *q* *recording*
 q{0-9a-zA-Z}   Record typed characters into register {0-9a-zA-Z}
 (uppercase to append).  The 'q' command is disabled
 while executing a register, and it doesn't work inside
 a mapping.  {Vi: no recording}

 q   Stops recording.  (Implementation note: The 'q' that
 stops recording is not stored in the register, unless
 it was the result of a mapping)  {Vi: no recording}

 *@*
 @{0-9a-z.=*}   Execute the contents of register {0-9a-z.=*} [count]
 times.  Note that register '%' (name of the current
 file) and '#' (name of the alternate file) cannot be
 used.  For @= you are prompted to enter an
 expression.  The result of the expression is then
 executed.  See also |@:|.  {Vi: only named registers}

 *@@* *E748*
 @@  Repeat the previous @{0-9a-z:*} [count] times.

 

Re: Macros viewing them?

2013-01-13 Thread Marc Weber
 Maybe I am thinking about this backwards. Maybe I should use macros
 for the simple things and mappings for the more complex. I need to
Yes - you sohuld, write a function.

Another thing you may try:
  step one, create macro a
  step two, create macro b
  step three, create macro c

then create macro z running a,b,c in sequence.

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


Re: Highlight just headings?

2013-01-13 Thread wolfv
Thanks Shlomi.  What is usr_*?

-- 
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: Highlight just headings?

2013-01-13 Thread stosss
On Sun, Jan 13, 2013 at 9:55 AM, wolfv wolfvo...@gmail.com wrote:
 Thanks Shlomi.  What is usr_*?


I am sure he means the help files. some of the help files are named
usr_*.txt. replace * with a number.

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


Use registers in search and replace?

2013-01-13 Thread stosss
I would like to know if I can put the contents of a register on the
RHS of a search and replace in a mapping.

Or I would like to know if a visual mode used in a mapping can be
accomplished based on the conditions. Example:

a href=filenames1.htmlFilenames 1/a

I need to be able to use visual mode to grab only the letters and not
the numbers. File names can be from four letters and one number to 13
letters and 3 numbers. That makes doing this

^flvt.h

impossible because it won't reach back far enough on a two or three
digit number and trying to go back far enough for a three digit number
will miss some letters on one less than three digit.

Or use s/a href=\zsfilename\ze1/dump the contents of a register here/

If there is a help file that can show how to do one of these please
point me to 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


Re: Use registers in search and replace?

2013-01-13 Thread Bee
On Jan 13, 9:30 am, stosss sto...@gmail.com wrote:
 a href=filenames1.htmlFilenames 1/a

 I need to be able to use visual mode to grab only the letters
 and not the numbers. File names can be from four letters and
 one number to 13 letters and 3 numbers. That makes doing this

not sure what result you want
the following search replace will extract the filename
given your specifications

:s#a href=\(\w\{4,13}\)\d\{1,3}\.html.*#\1#c

Bill

-- 
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: Use registers in search and replace?

2013-01-13 Thread Bee
Correction:
That should be \a not \w because \w includes 0-9

:s#a href=\(\a\{4,13}\)\d\{1,3}\.html.*#\1#c

Bill

-- 
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: Use registers in search and replace?

2013-01-13 Thread stosss
On Sun, Jan 13, 2013 at 1:25 PM, Bee fo...@calcentral.com wrote:
 Correction:
 That should be \a not \w because \w includes 0-9

 :s#a href=\(\a\{4,13}\)\d\{1,3}\.html.*#\1#c


I appreciate the effort but that doesn't solve the problem. Also
thanks for the knowledge of the \a because I didn't know that and I
don't remember seeing it in the help files. s/// is usually not a
problem for me but I can't find if the contents of a register can be
dropped into the s///. If not then I need to find a way to solve the
visual mode approach of grabbing the letters. It appears I am trying
to cross between normal, visual and command line at the same time.

-- 
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: Use registers in search and replace?

2013-01-13 Thread Bee


On Jan 13, 10:37 am, stosss sto...@gmail.com wrote:
 On Sun, Jan 13, 2013 at 1:25 PM, Bee fo...@calcentral.com wrote:
  Correction:
  That should be \a not \w because \w includes 0-9

  :s#a href=\(\a\{4,13}\)\d\{1,3}\.html.*#\1#c

 I appreciate the effort but that doesn't solve the problem. Also
 thanks for the knowledge of the \a because I didn't know that and I
 don't remember seeing it in the help files. s/// is usually not a
 problem for me but I can't find if the contents of a register can be
 dropped into the s///. If not then I need to find a way to solve the
 visual mode approach of grabbing the letters. It appears I am trying
 to cross between normal, visual and command line at the same time.

Is something like this what you are looking for:

copy the folowing line to register a using: Vay

 I need to be able to use visual mode to grab only the letters

:echo substitute(@a, 'need', 'want', )

:help substitute

-- 
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: Use registers in search and replace?

2013-01-13 Thread Bee
Sorry for the multiple errors,
A cold caught me :(

 :help substitute

should be:

:help substitute()

Bill

-- 
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: Use registers in search and replace?

2013-01-13 Thread BPJ

On 2013-01-13 19:37, stosss wrote:

On Sun, Jan 13, 2013 at 1:25 PM, Bee fo...@calcentral.com wrote:

Correction:
That should be \a not \w because \w includes 0-9

:s#a href=\(\a\{4,13}\)\d\{1,3}\.html.*#\1#c



I appreciate the effort but that doesn't solve the problem. Also
thanks for the knowledge of the \a because I didn't know that and I
don't remember seeing it in the help files. s/// is usually not a
problem for me but I can't find if the contents of a register can be
dropped into the s///. If not then I need to find a way to solve the
visual mode approach of grabbing the letters. It appears I am trying
to cross between normal, visual and command line at the same time.



:h c_CTRL-R

/bpj

--
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: Use registers in search and replace?

2013-01-13 Thread stosss
Bill,

On Sun, Jan 13, 2013 at 2:26 PM, Bee fo...@calcentral.com wrote:
 Sorry for the multiple errors,
 A cold caught me :(

 :help substitute

 should be:

 :help substitute()


I took a closer look at the \a you showed me and solved my problem
with that by adding in a few more command strings. I will look at the
last two things you shared and see how they can help me for now or
later. The \a really did help a lot!

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: Use registers in search and replace?

2013-01-13 Thread Bee


On Jan 13, 12:23 pm, stosss sto...@gmail.com wrote:
 Bill,

 On Sun, Jan 13, 2013 at 2:26 PM, Bee fo...@calcentral.com wrote:
  Sorry for the multiple errors,
  A cold caught me :(

  :help substitute

  should be:

  :help substitute()

 I took a closer look at the \a you showed me and solved my problem
 with that by adding in a few more command strings. I will look at the
 last two things you shared and see how they can help me for now or
 later. The \a really did help a lot!

 Thanks

Also:

:help \{

and friends

Bill

-- 
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: Use registers in search and replace?

2013-01-13 Thread stosss
bpj

On Sun, Jan 13, 2013 at 2:28 PM, BPJ b...@melroch.se wrote:
 On 2013-01-13 19:37, stosss wrote:

 On Sun, Jan 13, 2013 at 1:25 PM, Bee fo...@calcentral.com wrote:

 Correction:
 That should be \a not \w because \w includes 0-9

 :s#a href=\(\a\{4,13}\)\d\{1,3}\.html.*#\1#c


 I appreciate the effort but that doesn't solve the problem. Also
 thanks for the knowledge of the \a because I didn't know that and I
 don't remember seeing it in the help files. s/// is usually not a
 problem for me but I can't find if the contents of a register can be
 dropped into the s///. If not then I need to find a way to solve the
 visual mode approach of grabbing the letters. It appears I am trying
 to cross between normal, visual and command line at the same time.


 :h c_CTRL-R


Thanks for sharing this. I will figure out how to make it work for me.

-- 
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: Use registers in search and replace?

2013-01-13 Thread stosss
On Sun, Jan 13, 2013 at 3:29 PM, Bee fo...@calcentral.com wrote:


 On Jan 13, 12:23 pm, stosss sto...@gmail.com wrote:
 Bill,

 On Sun, Jan 13, 2013 at 2:26 PM, Bee fo...@calcentral.com wrote:
  Sorry for the multiple errors,
  A cold caught me :(

  :help substitute

  should be:

  :help substitute()

 I took a closer look at the \a you showed me and solved my problem
 with that by adding in a few more command strings. I will look at the
 last two things you shared and see how they can help me for now or
 later. The \a really did help a lot!

 Thanks

 Also:

 :help \{

 and friends

Thanks I learned about \{n,m} in s/// a while ago. Thanks for you help though.

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


Buffer-local unmap of global mapping

2013-01-13 Thread Michael Henry
All,

I've got several two-key global mappings for the CtrlP plugin:

  nnoremap C-PC-O :C-UCtrlPBufferCR
  nnoremap C-PC-P :C-UCtrlPCR
  [...]

These mappings interact with plugins that provide buffer-local
mappings that are prefixes of these multi-key mappings.  For
example, the Tagbar plugin defines a normal-mode buffer-local
mapping for CTRL-P.

The problem is that when I press CTRL-P in the Tagbar window,
Vim assumes that it might be the prefix for the global mappings
for CtrlP, so it waits for 'timeoutlen' before deciding to
invoke the single-key buffer-local mapping for Tagbar.  Because
my preferred 'timeoutlen' is three seconds, this renders the
buffer-local mapping essentially useless for me.

My current work-around is to map the key CTRL-P to a prefix,
then combine that prefix with other keys to make the final
mappings, something like this:

  nmap  C-P SIDCtrlP
  nnoremap  SIDCtrlPC-O   :C-UCtrlPBufferCR
  nnoremap  SIDCtrlPC-P   :C-UCtrlPCR

This way, Vim won't see any multi-key mappings that begin with
CTRL-P, so a buffer-local mapping of CTRL-P will execute without
waiting for 'timeoutlen'.

Is there a better way to handle this problem in general?  I
don't see a way to unmap the global mappings on a per-buffer
basis, and I'd like to keep the global mappings in-place for
most buffers while Tagbar is running so globally unmapping when
Tagbar opens and restoring when it closes doesn't quite fit the
bill, either.

Thanks,
Michael Henry

-- 
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: Use registers in search and replace?

2013-01-13 Thread Bee
:help \a
is the collection [A-Za-z]
all upper and lower case alphabet characters
possibly faster than [A-Za-z]

:help /[]
a collection
create your own collection
[a-fz] only lower case letters a b c d e f z

:help \(
a grouping
surround part of the search pattern with \( ... \)
then use \1 in the replace to use that found part

Bill

-- 
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: Use registers in search and replace?

2013-01-13 Thread stosss
On Sun, Jan 13, 2013 at 3:56 PM, Bee fo...@calcentral.com wrote:
 :help \a
 is the collection [A-Za-z]
 all upper and lower case alphabet characters
 possibly faster than [A-Za-z]

 :help /[]
 a collection
 create your own collection
 [a-fz] only lower case letters a b c d e f z

 :help \(
 a grouping
 surround part of the search pattern with \( ... \)
 then use \1 in the replace to use that found part


Those last two are just part of what brought me to Vim almost 3 years ago.

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


Use current file name in the current file?

2013-01-13 Thread stosss
I think I saw something earlier about being able to use the current
file name in the current file. But now I can't find what I saw
earlier. I have been in too many help files today.

I hope some one understands what I am trying to ask.

-- 
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: Use current file name in the current file?

2013-01-13 Thread Tim Chase

On 01/13/13 15:18, stosss wrote:

I think I saw something earlier about being able to use the
current file name in the current file. But now I can't find what
I saw earlier. I have been in too many help files today.


the current file's name is stored in the % register, so you can 
either paste it from Normal mode with


  %p

or you can dump it in Insert mode using control+R followed by %.

-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: Buffer-local unmap of global mapping

2013-01-13 Thread Andy Wokula

Am 13.01.2013 21:42, schrieb Michael Henry:

All,

I've got several two-key global mappings for the CtrlP plugin:

   nnoremap C-PC-O :C-UCtrlPBufferCR
   nnoremap C-PC-P :C-UCtrlPCR
   [...]

These mappings interact with plugins that provide buffer-local
mappings that are prefixes of these multi-key mappings.  For
example, the Tagbar plugin defines a normal-mode buffer-local
mapping for CTRL-P.

The problem is that when I press CTRL-P in the Tagbar window,
Vim assumes that it might be the prefix for the global mappings
for CtrlP, so it waits for 'timeoutlen' before deciding to
invoke the single-key buffer-local mapping for Tagbar.  Because
my preferred 'timeoutlen' is three seconds, this renders the
buffer-local mapping essentially useless for me.

My current work-around is to map the key CTRL-P to a prefix,
then combine that prefix with other keys to make the final
mappings, something like this:

   nmap  C-P SIDCtrlP
   nnoremap  SIDCtrlPC-O   :C-UCtrlPBufferCR
   nnoremap  SIDCtrlPC-P   :C-UCtrlPCR

This way, Vim won't see any multi-key mappings that begin with
CTRL-P, so a buffer-local mapping of CTRL-P will execute without
waiting for 'timeoutlen'.

Is there a better way to handle this problem in general?  I
don't see a way to unmap the global mappings on a per-buffer
basis, and I'd like to keep the global mappings in-place for
most buffers while Tagbar is running so globally unmapping when
Tagbar opens and restoring when it closes doesn't quite fit the
bill, either.

Thanks,
Michael Henry


I don't have an answer, I think what you tried is the best you can get
so far.

But I agree, a general solution would be useful!

Several plugins (buffer explorers, file explorers) define a lot of short
keys (keys like `d' or `y'), but it's awkward to use them because they
often wait for a longer global sequence (e.g. `ds', `ys' from
surround.vim).

First idea: add a new buffer-local option that, when enabled, means:
Only check buffer-local mappings (not global mappings) when waiting
for a complete left-hand-side.

Using an option, the mechanism could be turned on and off (how would I
otherwise access a global mapping?);
(this is opposed to a new mapping modifier (next to buffer, silent,...)).

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


How to get to EOF, not last line ???

2013-01-13 Thread Aggelos Kolaitis
Hey, I 'm trying to implement a control all mapping with the following 
command at my .vimrc

:map c-a escggvG

(The escape is to get out of insert mode if needed).

However, that way the last line of the file is not selected, which apparently 
is how G works. So, is there a key to use instead of G to reach the end of the 
file (EOF)?

-- 
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 can I make the found location of a search standout in GVIM?

2013-01-13 Thread Steve Young
Hi All,
When performing a search, the found location is indicated by an outline box 
cursor.  How can I make it standout from the rest of the text such as blink, 
solid bright yellow, etc.  I find myself looking thru the entire screen trying 
to see this indicator.  I'm using the default screen colors and have tried 
others.
Thanks for any help
regards,
Steve

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


Map control all error

2013-01-13 Thread neoaggelos
Hey I'm trying to create a control all mapping with this:

:map c-a escggvG

However, the last line isn't selected.
I know that G is the problem, what I would like to know is the key to get to 
EOF instead of the last line

-- 
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: Map control all error

2013-01-13 Thread Michael Henry
On 01/13/2013 05:20 PM, neoagge...@yahoo.gr wrote:
 Hey I'm trying to create a control all mapping with this:

 :map c-a escggvG

 However, the last line isn't selected. I know that G is the
 problem, what I would like to know is the key to get to EOF
 instead of the last line

If you really want a character-wise selection, you can add $
to the end of your mapping.  This will take you to the end of
the last line.

But you might want to have a look at the mappings found in the
mswin.vim file distributed with Vim.  For example, the Select
all mappings are:

 CTRL-A is Select all
noremap C-A gggHC-OG
inoremap C-A C-OggC-OgHC-OG
cnoremap C-A C-CgggHC-OG
onoremap C-A C-CgggHC-OG
snoremap C-A C-CgggHC-OG
xnoremap C-A C-CggVG

These use linewise selections which many people prefer.

Michael Henry

-- 
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 can I make the found location of a search standout in GVIM?

2013-01-13 Thread Michael Henry
On 01/13/2013 04:37 PM, Steve Young wrote:
 When performing a search, the found location is indicated by
 an outline box cursor. How can I make it standout from the
 rest of the text such as blink, solid bright yellow, etc.

I like Vim's 'hlsearch' option.  You can enable it via:

  :set hlsearch

This highlights the found text everywhere it is found in the
file.

To turn off highlighting until the next search, use:

  :noh

See more in Vim's help:

  :help 'hlsearch'
  :help :noh

Michael Henry

-- 
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 get to EOF, not last line ???

2013-01-13 Thread Gary Johnson
On 2013-01-13, Aggelos Kolaitis wrote:
 Hey, I 'm trying to implement a control all mapping with the
 following command at my .vimrc
 
 :map c-a escggvG
 
 (The escape is to get out of insert mode if needed).
 
 However, that way the last line of the file is not selected, which
 apparently is how G works. So, is there a key to use instead of G
 to reach the end of the file (EOF)?

G does move to the last line.  The problem is probably that you're
using v (characterwise) instead of V (linewise).  Try this:

:map c-a escggVG

If for some reason you would rather select characterwise, you could
use this:

:map c-a escgg^vG$

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: How to get to EOF, not last line ???

2013-01-13 Thread Tim Chase

On 01/13/13 18:45, Gary Johnson wrote:

If for some reason you would rather select characterwise, you could
use this:

 :map c-a escgg^vG$


I'd recommend using 0 instead of ^ in case there is some leading 
white-space:


  :map c-a escgg0vG$

Or, for parity, use g_ instead of $:

  :map c-a escgg^vGg_

(Had to dig in the help for g_ given how rarely I use it--only for 
vimgolf)


Additionally, I'd follow the advice seen in the mswin.vim file and 
make mappings for each individual mode as suggested elsewhere in the 
thread, rather than try to make one mapping that does everything.


-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: How to get to EOF, not last line ???

2013-01-13 Thread Gary Johnson
On 2013-01-13, Tim Chase wrote:
 On 01/13/13 18:45, Gary Johnson wrote:
 If for some reason you would rather select characterwise, you could
 use this:
 
  :map c-a escgg^vG$
 
 I'd recommend using 0 instead of ^ in case there is some leading
 white-space:
 
   :map c-a escgg0vG$

Oops.  Good catch.  Thanks.

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


Error with autostarting in vim-indent-guides

2013-01-13 Thread Gautier DI FOLCO
Hi,

I'm trying to use vim-indent-guides (
https://github.com/nathanaelkane/vim-indent-guides/issues)
with Vim 7.3.682 on Fedora 17.

I have set this in my vimrc:

let g:indent_guides_start_level = 0
let g:indent_guides_guide_size = 1
let g:indent_guides_enable_on_vim_startup = 1

But, when I open a file or enter in a buffer, I have this error:

Error detected while processing function
SNR37_IndentGuidesEnable..indent_guides#enable:
line   17:
E71: Invalid character after \%
Press ENTER or type command to continue
Error detected while processing function
SNR37_IndentGuidesEnable..indent_guides#enable:
line   17:
E475: Invalid argument: ^\s*\%-3v\zs\s*\%-2v\ze
Press ENTER or type command to continue
Error detected while processing function
SNR37_IndentGuidesEnable..indent_guides#enable:
line   19:
E71: Invalid character after \%
Press ENTER or type command to continue
Error detected while processing function
SNR37_IndentGuidesEnable..indent_guides#enable:
line   19:
E475: Invalid argument: ^\t*\%-3v\zs\t*\%1v\ze
Press ENTER or type command to continue

Have you got the same issue?
Is their a way to fix it?

For your help,
Thanks by 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