-
Notifications
You must be signed in to change notification settings - Fork 15
/
vim.nix
84 lines (77 loc) · 2.16 KB
/
vim.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{ config, pkgs, lib, ...}:
with lib;
let
notPython = pkgs.writeScript "notPython" ''
#!${pkgs.stdenv.shell}
shift
shift
shift
wakatime "$@"
'';
myVim = (pkgs.vim_configurable.override {
#python = pkgs.python3;
}).customize {
name = "vim";
vimrcConfig = {
customRC = ''
syntax on
set nu
set foldmethod=syntax
set listchars=tab:->,trail:·
set list
set ruler
set backspace=indent,eol,start
set pastetoggle=<F2>
nmap <F3> :!nix-build -A default <enter>
map <F7> :tabp<enter>
map <F8> :tabn<enter>
set expandtab
set softtabstop=2
set shiftwidth=2
set autoindent
"set statusline+=col:\ %c,
set ruler
set background=dark
" remove trailing whitespace upon save
" au BufWritePre * %s/\s\+$//e
" highlight all trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
au ColorScheme * highlight ExtraWhitespace guibg=red
au BufEnter * match ExtraWhitespace /\s\+$/
au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
au InsertLeave * match ExtraWhiteSpace /\s\+$/
let g:wakatime_PythonBinary = '${notPython}'
autocmd Filetype haskell set foldmethod=indent foldcolumn=2 softtabstop=2 shiftwidth=2
let g:ycm_semantic_triggers = {'haskell' : ['.']}
let g:ycm_server_python_interpreter='${pkgs.python3.interpreter}'
let g:ycm_max_diagnostics_to_display=1000
'';
vam.pluginDictionaries = [
{
names = [
"vim-nix"
"Syntastic"
"vim-wakatime"
] ++ optional config.programs.vim.fat "YouCompleteMe";
}
];
};
};
in
{
options = {
programs.vim.fat = mkOption {
type = types.bool;
default = true;
description = "include vim modules that consume a lot of disk space";
};
};
config = {
environment.systemPackages = [ myVim pkgs.wakatime ];
environment.shellAliases.vi = "vim";
environment.variables.EDITOR = "vim";
programs.bash.shellAliases = {
vi = "vim";
};
};
}