diff options
author | aszlig <aszlig@redmoonstudios.org> | 2017-09-05 16:38:49 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2017-09-05 17:01:15 +0200 |
commit | 3a94ab3459ba2cc9218d3f19cc9c4c42a933940a (patch) | |
tree | fc2a0e071a8b76570c216311bf9943de15256e5a /pkgs | |
parent | 84b87d10101b9a74cfb51991db93d59526fef1bc (diff) |
pkgs/vim: Add plugin for editing CSV files
I happen to work with CSV files quite a bit lately but it's a major nuisance doing so with a normal text editor and I don't want to use a full-blown spreadsheet programm just for a few CSV files or even write a script every time I need to edit only a tiny bit. So this plugin solves that problem for me. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/aszlig/vim/default.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/aszlig/vim/default.nix b/pkgs/aszlig/vim/default.nix index aa0ef6b7..5712fe84 100644 --- a/pkgs/aszlig/vim/default.nix +++ b/pkgs/aszlig/vim/default.nix @@ -261,6 +261,18 @@ let rev = "3afc475cc64479a406ce73d3333df1f67db3c73f"; sha256 = "04dijb4hgidypppphcy83bacmfrd9ikyjc761hqq6bl4kc49f5kc"; }; + + csv = fetchFromGitHub { + owner = "chrisbra"; + repo = "csv.vim"; + rev = "443fa8bd2a1a017b26cc421a9494e1a1e33f4acf"; + sha256 = "1pbgl9f00kqxr2dpxmxg9jnk5q41sxzgan7hn16hc2b4as3zbihd"; + extraPostFetch = '' + # Use sane (non-UTF8) settings for separators + sed -i -e 's/(&enc *[=~#]\+ *.utf-8. *?[^:]*: *\([^)]*\))/\1/g' \ + "$out/ftplugin/csv.vim" "$out/syntax/csv.vim" + ''; + }; }; generic = '' @@ -323,8 +335,10 @@ let " prevent colorscheme from overriding these highlights au ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red - " highlight everything exceeding 79 characters - au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>79v.\+', -1) + " highlight everything exceeding 79 characters (except for CSV) + au BufWinEnter * if &ft !=# 'csv' + \ | let w:m2=matchadd('ErrorMsg', '\%>79v.\+', -1) + \ | endif ''; misc = '' |