感谢这些stack overflow帖子,我知道如何在搜索后创建一个以行为中心的nmap。这很好,但我正在使用管道分隔值,其中一行可能是1000列长,我想将行放在中心并将匹配的列放在左侧。屏幕。谁知道怎么做?
示例:
/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.
答案 0 :(得分:2)
nnoremap n nzzzs
和nnoremap N Nzzzs
可能会完成您的要求。如果vim隐藏了搜索短语的第一个字母,您可能希望在其中zh
向左滚动一列。
zz
将光标垂直放在屏幕中央zs
将光标放在屏幕的最左侧有关详细信息,请参阅:help scroll-horizontal
。