2011-06-08 127 views
2

感謝這些stackoverflow職位,我知道如何使一個nmap的中心搜索後。這很好,但我正在使用管道分隔值,其中單行可能爲1000列,我想將行排在中間,並將匹配的放在屏幕的左側。任何人都知道嗎?vim自動跳轉到列後搜索或跳轉

例子:

/University of California<CR>n 

應該把

University of California, San Francisco, Calif. (...) 

在屏幕的左側,當談到這一行:

CASE, Ed|N00025882|http://bioguide.congress.gov/scripts/biodisplay.pl?index=C001055|a Representative from Hawaii; born in Hilo, Territory of Hawaii, September 27, 1952; graduated from Hawaii Preparatory High School, Kamuela, Hawaii, 1970; B.A., Williams College, Williamstown, Mass., 1975; J.D., University of California, San Francisco, Calif., 1981; lawyer, private practice; staff member for United States Representative Spark Matsunaga, 1975-1977; staff member for United States Senator Spark Matsunaga, 1977-1978; member of the Hawaii state house of representatives, 1994-2002; unsuccessful candidate for nomination for Governor of Hawaii in 2002; elected as a Democrat to the One Hundred and Seventh Congress, by special election, to fill the vacancy caused by the death of United States Representative Patsy Mink, (November 30, 2002-January 3, 2003); elected as a Democrat to the One Hundred Eighth Congress, by special election, to fill the vacancy caused by the death of United States Representative Patsy Mink, and reelected to the succeeding Congress (January 4, 2003-January 3, 2007); not a candidate for reelection, but was an unsuccessful candidate to the United States Senate in 2006; unsuccessful candidate for United States House of Representatives in 2010. 

回答

2

nnoremap n nzzzsnnoremap N Nzzzs可能會實現你在問什麼。如果vim隱藏了搜索短語的第一個字母,您可能需要在那裏輸入zh以向左滾動一列。

  • zz把光標在屏幕的中心垂直
  • zs把光標移動到最左邊的屏幕

更多信息請參見:help scroll-horizontal的。

+0

謝謝 - 這很快! – 2011-06-08 14:52:02