Saturday, February 18, 2012

VIM editor line numbering

If you are fan of VI editor, here is the trick how you can enable the line numbering,

below is your normal presentation when you do vi


#define your item pipelines here
from scrapy.exceptions import DropItem
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html

class newsPipeline(object):
    def process_item(self, item, spider):
...........

1. hit esc
2. enter - :set rnu

result -

  0 #define your item pipelines here
  1 from scrapy.exceptions import DropItem
  2 # Don't forget to add your pipeline to the ITEM_PIPELINES setting
  3 # See: http://doc.scrapy.org/topics/item-pipeline.html
  4
  5 class newsPipeline(object):
  6     def process_item(self, item, spider):

  7 ......

if you want to revert to the original settings..
1. hit esc
2. enter - :set nornu


No comments:

Post a Comment