csv.vim icon indicating copy to clipboard operation
csv.vim copied to clipboard

`:Header` in `autocmd`?

Open gilbh opened this issue 3 years ago • 1 comments
trafficstars

Hi,

When I try the following lines in my .vimrc:

  autocmd BufRead *.csv:
      \ Header

-- nothing happens. (What I want this to do is to have :Header happen automatically on opening a csv file).

I am not an expert of vim, so I am not sure if this is my bad or a bug?

Thanks!!

gilbh avatar Jun 26 '22 00:06 gilbh

yeah, by the time the vimrc file has been sourced, Vim does not know yet the csv functions. You may want to try this instead:

aug CSV_Editing
      au!
      au BufRead *.csv :call csv#Init(1,'$',0) | call csv#SplitHeaderLine('', 0,1)
aug end

chrisbra avatar Aug 04 '22 14:08 chrisbra