Thanks to these stack overflow posts, I know how to make an nmap that centers the row after a search. That’s great, but I am working with pipe separated values where a single row is perhaps 1000 columns long, and I would like to center the row AND put the column of the match at the left hand side of the screen. Anyone know how?
Example:
/University of California<CR>n
should put
University of California, San Francisco, Calif. (...)
at the left hand side of the screen when it comes to this line:
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.
nnoremap n nzzzsandnnoremap N Nzzzswill probably accomplish what you’re asking for. You may want to azhin there to scroll one column to the left if vim is hiding the first letter of your search phrase.zzputs the cursor in the center of the screen verticallyzsputs the cursor at the far left of the screenSee
:help scroll-horizontalfor more information.