lh-brackets while using << for indentation

17 views
Skip to first unread message

qz.m...@gmail.com

unread,
Dec 12, 2012, 3:19:59 PM12/12/12
to lh-vim...@googlegroups.com
Hi,

I'm using lh-cpp as the main plugin for my C++ coding efforts. I've installed everything using VAM, and have a clean .vimrc with little other modifications in it.

When using lh-cpp (and lh-brackets), I can no longer use the < key for removing indentation, and haven't been able to figure out from the documentation how to disable the current behaviour in normal mode (adding a closing parenthesis), so that I can use the standard indentation behaviour of VIM again.

If anyone else has encountered this problem / a solution on how to work around this, I would be grateful if you could let me know!

Thanks!

Luc Hermitte

unread,
Dec 12, 2012, 6:39:59 PM12/12/12
to lh-vim...@googlegroups.com
Hello

2012/12/12 <qz.m...@gmail.com>:
> When using lh-cpp (and lh-brackets), I can no longer use the < key for
> removing indentation, and haven't been able to figure out from the
> documentation how to disable the current behaviour in normal mode (adding a
> closing parenthesis), so that I can use the standard indentation behaviour
> of VIM again.

I've been annoyed myself by this a few times. But as I prefer to rely
on = to reindent automatically, I did take my time to fix this, and
only for C & C++.

There are two workarounds to this problem:
- the first is to hit <F9> (if triggers.vim is installed [1]), which
will momentarily disable the mappings from lh-brackets

- the second is to duplicate only what you like from
after/ftplugin/{ft}/{ft}_brackets.vim into any file that you put into
your .vim/ftplugin/{ft}/ directory (not in the after/ directory), and
to set b:loaded_ftplug_{ft}_brackets to whatever you like from that
same file. [The {ft}_brackets.vim ftplugins are in the after/ zone in
order to let the end user override the default settings]
You'll have to replace {ft} by whatever filetype you have this issue with.


But, I'll just check my files and I see that the c_brackets file(s)
fix(es) this bug -- and that the two version of c_brackets are not the
same ... :/
I'll fix the bracket definitions for the other filetypes for which I
provide a default behaviour.

> Thanks!

Thank you for your input!

[1] http://code.google.com/p/lh-vim/source/browse/misc/trunk/plugin/Triggers.vim
Hum... it seems it need to be installed manually. Sorry about that.

HTH,
--
Luc Hermitte

Luc Hermitte

unread,
Dec 13, 2012, 9:38:01 AM12/13/12
to lh-vim...@googlegroups.com
Hello again,

2012/12/13 Luc Hermitte <luc.he...@gmail.com>:
> There are two workarounds to this problem:
> - the first is to hit <F9> (if triggers.vim is installed [1]), which
> will momentarily disable the mappings from lh-brackets

My mistake, Triggers is not required anymore. see :h <Plug>ToggleBrackets

> - the second is to duplicate only what you like from
> after/ftplugin/{ft}/{ft}_brackets.vim into any file that you put into
> your .vim/ftplugin/{ft}/ directory (not in the after/ directory), and
> to set b:loaded_ftplug_{ft}_brackets to whatever you like from that
> same file. [The {ft}_brackets.vim ftplugins are in the after/ zone in
> order to let the end user override the default settings]
> You'll have to replace {ft} by whatever filetype you have this issue with.

This is what I've tried to explain in: :h :Brackets-notes.
I guess I'll have to rephrase it.

> But, I'll just check my files and I see that the c_brackets file(s)
> fix(es) this bug -- and that the two version of c_brackets are not the
> same ... :/
> I'll fix the bracket definitions for the other filetypes for which I
> provide a default behaviour.

Just to say, this is now fixed. < in normal and visual modes continues
to force the indentation.
If you want to surround the current-word (/the selection) with a pait
of angle-brackets, type the localleader (coma or \ depending on your
settings), followed by <.

--
Luc Hermitte

Luc Hermitte

unread,
Dec 13, 2012, 9:45:59 AM12/13/12
to lh-vim...@googlegroups.com, qz.m...@gmail.com
Sorry I've noticied you weren't registered to the mailing-list.
Here is my latest answer.
Best regards
--Luc Hermitte

2012/12/13 Luc Hermitte <luc.he...@gmail.com>:
> Hello again,
>
> 2012/12/13 Luc Hermitte <luc.he...@gmail.com>:
>> There are two workarounds to this problem:
>> - the first is to hit <F9> (if triggers.vim is installed [1]), which
>> will momentarily disable the mappings from lh-brackets
>
> My mistake, Triggers is not required any more. see :h <Plug>ToggleBrackets
Reply all
Reply to author
Forward
0 new messages