imagineerThat
imagineerThat

Reputation: 5553

Vim - convert 4 spaces to bullet

I have a document like such:

asdf
    asdf 
    asdf
        asdf
asdf
    asdf 
        asdf
    asdf

I want to convert this into the following or something more readable with -, ==, *, etc... depending on 4*n spaces (tab == 4 spaces in my vim)

- asdf
    - asdf 
    - asdf
        - asdf
- asdf
    - asdf 
        - asdf
    - asdf

Upvotes: 2

Views: 35

Answers (1)

pfnuesel
pfnuesel

Reputation: 15330

This should do it:

:%s/[^ ]/- &/

Replace the first non space character with - and the character.

Upvotes: 1

Related Questions