diff options
author | tv <tv@krebsco.de> | 2015-06-14 19:22:37 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-06-14 19:22:37 +0200 |
commit | e9970fc3bdaf204ce0999058017a471e1efcfaa9 (patch) | |
tree | 6a36b91b0ed33ba90b4da32d1fa995789f923a8d /modules/lass/vim.nix | |
parent | 55e6974bdf76ca7a7e0df6a8e99c70ab01dda74e (diff) | |
parent | 3eb5e2ace450035c0cdff424e68eed6906e997e1 (diff) |
Merge remote-tracking branch 'mors/master' into mors-staging
Diffstat (limited to 'modules/lass/vim.nix')
-rw-r--r-- | modules/lass/vim.nix | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/modules/lass/vim.nix b/modules/lass/vim.nix index e277bd7..e1cff0d 100644 --- a/modules/lass/vim.nix +++ b/modules/lass/vim.nix @@ -1,9 +1,20 @@ { config, pkgs, ... }: -{ - - environment.systemPackages = with pkgs; [ - (vim_configurable.customize { +let + customPlugins.mustang2 = pkgs.vimUtils.buildVimPlugin { + name = "Mustang2"; + src = pkgs.fetchFromGitHub { + owner = "croaker"; + repo = "mustang-vim"; + rev = "6533d7d21bf27cae94d9c2caa575f627f003dfd5"; + sha256 = "0zlmcrr04j3dkiivrhqi90f618lmnnnpvbz1b9msfs78cmgw9w67"; + }; + }; + +in { + + environment.systemPackages = [ + (pkgs.vim_configurable.customize { name = "vim"; vimrcConfig.customRC = '' @@ -12,7 +23,7 @@ syntax on " TODO autoload colorscheme file set background=dark - colorscheme solarized + colorscheme mustang filetype off filetype plugin indent on @@ -47,8 +58,6 @@ "Tabwidth set ts=2 sts=2 sw=2 et - autocmd BufRead *.js,*.json set ts=2 sts=2 sw=2 et - autocmd BufRead *.hs set ts=4 sts=4 sw=4 et " create Backup/tmp/undo dirs function! InitBackupDir() @@ -79,15 +88,29 @@ set viminfo='20,<1000,s100,h,n~/.vim/tmp/info set undodir=$HOME/.vim/undo set undofile + + " highlight whitespaces + highlight ExtraWhitespace ctermbg=red guibg=red + match ExtraWhitespace /\s\+$/ + autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ + autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ + autocmd InsertLeave * match ExtraWhitespace /\s\+$/ + autocmd BufWinLeave * call clearmatches() + + "ft specific stuff + autocmd BufRead *.js,*.json set ts=2 sts=2 sw=2 et + autocmd BufRead *.hs set ts=4 sts=4 sw=4 et + + "esc timeout + set timeoutlen=1000 ttimeoutlen=0 ''; - vimrcConfig.vam.knownPlugins = vimPlugins; + vimrcConfig.vam.knownPlugins = pkgs.vimPlugins // customPlugins; vimrcConfig.vam.pluginDictionaries = [ - { name = "Gundo"; } - { name = "commentary"; } - { name = "vim-addon-nix"; } - { name = "colors-solarized"; } + { names = [ "Gundo" "commentary" "mustang2" ]; } + { names = [ "vim-addon-nix" ]; ft_regex = "^nix\$"; } ]; + }) ]; } |