HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/Git/usr/share/vim/vim91/ftplugin/csv.vim
vim9script

# Maintainer: Maxim Kim <[email protected]>
# Last Update: 2024-06-18

if !exists("b:csv_delimiter")
    # detect delimiter
    var delimiters = ",;\t|"

    var max = 0
    for d in delimiters
        var count = getline(1)->split(d)->len() + getline(2)->split(d)->len()
        if count > max
            max = count
            b:csv_delimiter = d
        endif
    endfor
endif

if exists("b:did_ftplugin")
    finish
endif
b:did_ftplugin = 1