vim에서 CSV파일을 다루기 위해 csv.vim이라는 플러그인을 설치했는데 잘 작동하지 않습니다.

익명 사용자의 이미지

개발자는 아니고 리눅스에서 쉘, 파이썬을 이용하여 데이터를 분석하는 생명과학하는 사람입니다.

플러그인 개발 페이지는
https://github.com/chrisbra/csv.vim#using-a-plugin-manager
입니다.

저는 Vundle을 사용하기 때문에 .vimrc에 해당 플러그인을 넣고
:PluginInstall을 실행했습니다.

제 .vimrc파일 입니다.

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
 
Plugin 'VundleVim/Vundle.vim'
Plugin 'chrisbra/csv.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'AutoComplPop'
Plugin 'davidhalter/jedi-vim'
 
call vundle#end()
set nocompatible
filetype plugin on
 
"filetype plugin indent on
 
 
set nu
set tabstop=8
set expandtab
set shiftwidth=4
set softtabstop=4
syntax on
set background=dark
"filetype indent on
 
set foldmethod=syntax
 
set ffs=unix,dos
set ff=unix
 
nmap <F2> :w<CR>:!./%<CR>
map <Leader>nt :NERDTreeToggle<CR>
nnoremap <buffer> H :<C-u>execute "!pydoc " . expand("<cword>")<CR>

플러그인 문서에 보면 파일 타입을 디텍하지 못할 경우인 .vim/filetype.vim에 다음의 내용을 넣고 저장하라고 해서 그렇게 했습니다.

if exists("did_load_csvfiletype")
  finish
endif
let did_load_csvfiletype=1
 
augroup filetypedetect
  au! BufRead,BufNewFile *.csv,*.dat	setfiletype csv
augroup END

tab을 delimiter로 하는 aa.csv파일을 만들어서 vim으로 열면 다음과 같은 에러 메시지가 나옵니다.

"aa.csv" 2L, 30C
CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\)
Press ENTER or type command to continue

하지만 다른 일반파일을 열 때 위와 같은 메시지가 나오는 않는 것으로 봐서 csv파일을 인식하는데는 문제가 없는 것 같습니다.

참고로 위 에러 메시지를 가지고 구글링을 하면

.vimrc에서 "filetype plugin on"이 "syntax on"이전에 나와야 작동한다고 하는데, 위 제 .vimrc를 보시면 아시겠지만 그렇게 되어있습니다.

뭐가 문제인지 모르겠습니다.

사실 vim에대해 자세히 알고 .vimrc를 작성한 것이 아니라 여기저기 가지고 와서 붙여넣은거라, 혹시 충돌이 있는 것은 아닌지 걱정이기도 합니다.

도움부탁드립니다. 그리고 혹시 제 .vimrc에 이상한 구문이 있으면 지적도 감사하겠습니다.

ymir의 이미지

csv 는 comma separated value 입니다.
csv 파일 생성하실 때, tab 대신 comma(,) 로 바꾸시면 될 것 같네요.

되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.