Vim : how to index a plain text file?

前端 未结 3 1117
孤街浪徒
孤街浪徒 2020-12-18 06:00

Is it possible to index a plain text file (a book) in vim such as :

1. This line contains the words : London, Berlin, Paris
2. In this line, I write about :          


        
3条回答
  •  既然无缘
    2020-12-18 06:29

    Have a look at ptx, perhaps

    :%!cut -d: -f2 | ptx -Ar
    

    Will output something like this, when unmodified:

    :1:                         London,   Berlin, Paris
    :2:               New-York, London,   Berlin
    :1:                                   London, Berlin, Paris
    :2:                       New-York,   London, Berlin
    :2:                                   New-York, London, Berlin
    :4:                                   New-York, Paris
    :1:                 London, Berlin,   Paris
    :4:                       New-York,   Paris
    :2:                            New-   York, London, Berlin
    :4:                            New-   York, Paris
    

    I'll see if I can the rest of the steps too

提交回复
热议问题