I'm using a lot the command zf% with the cursor on the first bracket of a function for example, to fold it.
Ex : I put my cursor on the first bracket
I type zf%
It become :
I would like to fold all matching bracket in the file with 1 command.
Now i have to manually place my cursor on every bracket to manualy create the fold.
How to procced please ?
Thank you in advance.
Last edited by RudiC; 05-12-2016 at 01:50 PM..
Reason: Added code tags
Type 'q' to begin recording the macro, then select a register between a-z. Now type the macro '/{' + 'zf%'. Press q at the end to finish recording.
Now you can do something like '10@q' to play 10 times this macro. I still need to improve it to make it begin at the top of the file and end at the bottom, but it's already a quick easy way to deserve the purpose.
Summary :
Create macro
Execute macro
Just be careful to not doing zf multiple times on the same {
Enjoy
EDIT : I'm here again, just call :set nowrapscan to configure search not going back to the beggining of the file. Then you can simply do 1000@a end all functions gonna be collapse 1 time.
Last edited by Purgator; 05-27-2016 at 06:20 AM..
Reason: improving answer
Is this possible? The below code not working for me.
dir=mydir
if ; then
echo "found /home/$mydir "
else
echo "Not found /home/$mydir"
fi
---------- Post updated at 05:28 AM ---------- Previous update was at 05:25 AM ----------
Its working for me now (1 Reply)
Hi
I have to remove in a file in first column whatever is written in brackets with brackets
so one file
hgfd 123
gfhdj 483
jdgfdg 34738
the output shuld be
hgfd 123
gfhdj 483
jdgfdg 34738 (9 Replies)
Goodmorning,
I've some problem in using regular expression in a VIM syntax configuration file.
I've need to match a string as <<< some to match >>> so that it matches only some to match .
With standard regular expression i know that for this goal works fine the regex:
(?<=<{3}).*(?=>{3})
... (4 Replies)
Can somebody tell me the difference between double brackets and single
brackets, when doing a test.
I have always been acustomed to using single brackets and have not
encountered any issues to date. Why would somebody use double brackets.
Ie
if ]
vs
if
Thanks to... (2 Replies)
Hi,
Am trying to split a string with bracket in ksh but it is not splitting it correctly.
split("Hello, Name(1), Name(2)", main,",");
How do i split correctly? (3 Replies)
I downloaded vim.7.2 and compiled the vim source .
Added the vim binary path to PATH (Because iam not the root of the box)
when i load the file using vim it throws me an error
Error detected while processing /home2/e3003091/.vimrc:
line 2:
E185: Cannot find color scheme darkblue
line... (0 Replies)
So, I have no formal higher education in programming at all and am self taught. I am now wondering what would be considered best practices? Like should I hard code a variable, then compare it to what I want to know or achieve, or should I just put the commands with in the brackets?
Example, a... (5 Replies)