Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

philip_rhoades
People,

Since the Bookmark Managers in different browsera generally drive me
crazy - because they can never do everything what I want, I am going to
experiment with a Bookmarks plain text file that I can manage in Vim - I
can start a browser with a new tab from Vim when the cursor is over an
URL - so if I can get the auto folding working I should have everything
I need.  If I have a structure like:

FOLDER aaa
     FOLDER aaa-1
     URL 1
     URL 2
     URL 3
     URL 4
     FOLDER aaa-2
     URL 5
     URL 6
     URL 7
     URL 8
         FOLDER aaa-2-1
         URL 9
         URL 10
         URL 11
         URL 12
     FOLDER aaa-3
     URL 13
     URL 14
     URL 15
     URL 16
URL 17    # ie directly under folder "aaa"
URL 18    # ie directly under folder "aaa"
URL 19    # ie directly under folder "aaa"
URL 20    # ie directly under folder "aaa"
FOLDER bbb
     FOLDER bbb-1
     URL 21
     URL 22
     URL 23
     URL 24

- the auto folding would have to allow for nesting so a fold would start
on the word "FOLDER" and continue to the last line before the next word
"FOLDER" with the same level of indentation or until a change of
indentation occurs.

Suggestions about how to do this?

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

philip_rhoades
People,

Actually I think the Vim plugin Voom will do what I want nicely! - but
it would be nice if someone had a solution to the original question . .

P.


On 2018-11-16 02:58, Philip Rhoades wrote:

> People,
>
> Since the Bookmark Managers in different browsera generally drive me
> crazy - because they can never do everything what I want, I am going
> to experiment with a Bookmarks plain text file that I can manage in
> Vim - I can start a browser with a new tab from Vim when the cursor is
> over an URL - so if I can get the auto folding working I should have
> everything I need.  If I have a structure like:
>
> FOLDER aaa
>     FOLDER aaa-1
>     URL 1
>     URL 2
>     URL 3
>     URL 4
>     FOLDER aaa-2
>     URL 5
>     URL 6
>     URL 7
>     URL 8
>         FOLDER aaa-2-1
>         URL 9
>         URL 10
>         URL 11
>         URL 12
>     FOLDER aaa-3
>     URL 13
>     URL 14
>     URL 15
>     URL 16
> URL 17    # ie directly under folder "aaa"
> URL 18    # ie directly under folder "aaa"
> URL 19    # ie directly under folder "aaa"
> URL 20    # ie directly under folder "aaa"
> FOLDER bbb
>     FOLDER bbb-1
>     URL 21
>     URL 22
>     URL 23
>     URL 24
>
> - the auto folding would have to allow for nesting so a fold would
> start on the word "FOLDER" and continue to the last line before the
> next word "FOLDER" with the same level of indentation or until a
> change of indentation occurs.
>
> Suggestions about how to do this?
>
> Thanks,
>
> Phil.
> --
> Philip Rhoades
>
> PO Box 896
> Cowra  NSW  2794
> Australia
> E-mail:  [hidden email]
>
> --

--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Kit
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

Kit
In reply to this post by philip_rhoades
2018-11-15 16:58 GMT+01:00, Philip Rhoades <[hidden email]>:
> People,
>
> Since the Bookmark Managers in different browsera generally drive me
> crazy - because they can never do everything what I want, I am going to
> experiment with a Bookmarks plain text file that I can manage in Vim - I
> can start a browser with a new tab from Vim when the cursor is over an
> URL - so if I can get the auto folding working I should have everything
> I need.  If I have a structure like:

Try YAML structure or Markdown.
--
Kit

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

Lifepillar
In reply to this post by philip_rhoades
On 2018-11-15, Philip Rhoades <[hidden email]> wrote:

> People,
>
> Since the Bookmark Managers in different browsera generally drive me
> crazy - because they can never do everything what I want, I am going to
> experiment with a Bookmarks plain text file that I can manage in Vim - I
> can start a browser with a new tab from Vim when the cursor is over an
> URL - so if I can get the auto folding working I should have everything
> I need.  If I have a structure like:
>
> FOLDER aaa
>      FOLDER aaa-1
>      URL 1
>      URL 2
>      URL 3
>      URL 4
>      FOLDER aaa-2
>      URL 5
>      URL 6
>      URL 7
>      URL 8
>          FOLDER aaa-2-1
>          URL 9
>          URL 10
>          URL 11
>          URL 12
>      FOLDER aaa-3
>      URL 13
>      URL 14
>      URL 15
>      URL 16
> URL 17    # ie directly under folder "aaa"
> URL 18    # ie directly under folder "aaa"
> URL 19    # ie directly under folder "aaa"
> URL 20    # ie directly under folder "aaa"
> FOLDER bbb
>      FOLDER bbb-1
>      URL 21
>      URL 22
>      URL 23
>      URL 24
>
> - the auto folding would have to allow for nesting so a fold would start
> on the word "FOLDER" and continue to the last line before the next word
> "FOLDER" with the same level of indentation or until a change of
> indentation occurs.
>
> Suggestions about how to do this?

You may try my Outlaw plugin:

    https://github.com/lifepillar/vim-outlaw

with g:outlaw_topic_mark set to 'FOLDER'.

The plugin is ~250 LoC: you may browse the source code, in particular
how foldexpr is defined, to see how to define a folding function that
does what you ask.

Hope this helps!
Life

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

philip_rhoades
Lifepillar,


On 2018-11-16 18:26, Lifepillar wrote:

> On 2018-11-15, Philip Rhoades <[hidden email]> wrote:
>> People,
>>
>> Since the Bookmark Managers in different browsera generally drive me
>> crazy - because they can never do everything what I want, I am going
>> to
>> experiment with a Bookmarks plain text file that I can manage in Vim -
>> I
>> can start a browser with a new tab from Vim when the cursor is over an
>> URL - so if I can get the auto folding working I should have
>> everything
>> I need.  If I have a structure like:
>>
>> FOLDER aaa
>>      FOLDER aaa-1
>>      URL 1
>>      URL 2
>>      URL 3
>>      URL 4
>>      FOLDER aaa-2
>>      URL 5
>>      URL 6
>>      URL 7
>>      URL 8
>>          FOLDER aaa-2-1
>>          URL 9
>>          URL 10
>>          URL 11
>>          URL 12
>>      FOLDER aaa-3
>>      URL 13
>>      URL 14
>>      URL 15
>>      URL 16
>> URL 17    # ie directly under folder "aaa"
>> URL 18    # ie directly under folder "aaa"
>> URL 19    # ie directly under folder "aaa"
>> URL 20    # ie directly under folder "aaa"
>> FOLDER bbb
>>      FOLDER bbb-1
>>      URL 21
>>      URL 22
>>      URL 23
>>      URL 24
>>
>> - the auto folding would have to allow for nesting so a fold would
>> start
>> on the word "FOLDER" and continue to the last line before the next
>> word
>> "FOLDER" with the same level of indentation or until a change of
>> indentation occurs.
>>
>> Suggestions about how to do this?
>
> You may try my Outlaw plugin:
>
>     https://github.com/lifepillar/vim-outlaw
>
> with g:outlaw_topic_mark set to 'FOLDER'.
>
> The plugin is ~250 LoC: you may browse the source code, in particular
> how foldexpr is defined, to see how to define a folding function that
> does what you ask.


Thanks for that! - I will have a look at it.

Regards,

Phil.


> Hope this helps!
> Life
>
> --

--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

MarcWeber
In reply to this post by philip_rhoades
Why use folding?

use tags:
http:/// #bar #batch #s
http:/// #batch #s
http:/// #batch #batch

the folder thing never works..

and create shortcut for filter for filtering or :%!grep ..
https://github.com/MarcWeber/vim-addon-other/blob/master/plugin/vim-addon-other.vim#L39

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding - Voom working well !

philip_rhoades
In reply to this post by philip_rhoades
People,


On 2018-11-16 03:24, Philip Rhoades wrote:
> People,
>
> Actually I think the Vim plugin Voom will do what I want nicely! - but
> it would be nice if someone had a solution to the original question .
> .


After quite a few hours of hacking and massaging a very large Chrome
Bookmark file, I now have something that is working well and with a
Chrome extension to copy the page Title and URL into the clipboard, I
can immediately paste it into the Vim edited Bookmarks.txt file.  I can
also open a link from the file using "<leader>w" too.

See attached screencapture.

P.



> On 2018-11-16 02:58, Philip Rhoades wrote:
>> People,
>>
>> Since the Bookmark Managers in different browsera generally drive me
>> crazy - because they can never do everything what I want, I am going
>> to experiment with a Bookmarks plain text file that I can manage in
>> Vim - I can start a browser with a new tab from Vim when the cursor is
>> over an URL - so if I can get the auto folding working I should have
>> everything I need.  If I have a structure like:
>>
>> FOLDER aaa
>>     FOLDER aaa-1
>>     URL 1
>>     URL 2
>>     URL 3
>>     URL 4
>>     FOLDER aaa-2
>>     URL 5
>>     URL 6
>>     URL 7
>>     URL 8
>>         FOLDER aaa-2-1
>>         URL 9
>>         URL 10
>>         URL 11
>>         URL 12
>>     FOLDER aaa-3
>>     URL 13
>>     URL 14
>>     URL 15
>>     URL 16
>> URL 17    # ie directly under folder "aaa"
>> URL 18    # ie directly under folder "aaa"
>> URL 19    # ie directly under folder "aaa"
>> URL 20    # ie directly under folder "aaa"
>> FOLDER bbb
>>     FOLDER bbb-1
>>     URL 21
>>     URL 22
>>     URL 23
>>     URL 24
>>
>> - the auto folding would have to allow for nesting so a fold would
>> start on the word "FOLDER" and continue to the last line before the
>> next word "FOLDER" with the same level of indentation or until a
>> change of indentation occurs.
>>
>> Suggestions about how to do this?
>>
>> Thanks,
>>
>> Phil.
>> --
>> Philip Rhoades
>>
>> PO Box 896
>> Cowra  NSW  2794
>> Australia
>> E-mail:  [hidden email]
>>
>> --
>
> --
> Philip Rhoades
>
> PO Box 896
> Cowra  NSW  2794
> Australia
> E-mail:  [hidden email]
>
> --
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Screenshot_2018-11-17_03-53-22.png (386K) Download Attachment