2

I am trying to do a diff between a couple of csv files. I have performed column -t -s"," on both the files to be able to compare better. The first row contains the column names and I want to lock it when I do vimdiff on the two files.

I did vimdiff on the two files and then :1sp on both the split windows to see the first row. When I do $ I am able to move to the end of the line and all the splits move together. I can see the last column name.

However, when I move to the next page, the first line of the page gets displayed in the 1sp windows instead of the column names. I need the column names (first line of the file) to be fixed there with horizontal scrolling and no vertical scrolling so that the column name remains there when I move to the bottom of the file.

I have tried various versions of :set noscb and :set scrollopt-=ver, :set scrollopt=hor, :set scrollopt=, :set scrollopt=hor,jump but no luck. Has anyone faced this issue?

1
  • 1
    There is no easy way. You would have to create a split window, that just contains the header lines. My csv.vim does it that way. – Christian Brabandt Mar 19 '20 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.