summaryrefslogtreecommitdiffstats
path: root/modules/lass/vim.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-06-14 19:22:37 +0200
committertv <tv@shackspace.de>2015-06-14 19:22:37 +0200
commitbff3b50dddb1bb37831d9f17ca25ccab7f7476fe (patch)
tree6a36b91b0ed33ba90b4da32d1fa995789f923a8d /modules/lass/vim.nix
parent78c3c09f1579d1f8132d95d260e9ed8789d3dfc5 (diff)
parentafa7f0b98d89c9746c204e4ee0dd79e7ae4eb23f (diff)
Merge remote-tracking branch 'mors/master' into mors-staging
Diffstat (limited to 'modules/lass/vim.nix')
-rw-r--r--modules/lass/vim.nix47
1 files changed, 35 insertions, 12 deletions
diff --git a/modules/lass/vim.nix b/modules/lass/vim.nix
index e277bd725..e1cff0d24 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\$"; }
];
+
})
];
}