From bb5c011d91ed00ac168c7e5f0b525feb29254cca Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 10:50:03 +0100 Subject: tv: cherry-pick vim from hotwip! --- tv/2configs/vim.nix | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 tv/2configs/vim.nix diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix new file mode 100644 index 00000000..d1104931 --- /dev/null +++ b/tv/2configs/vim.nix @@ -0,0 +1,96 @@ +{ lib, pkgs, ... }: + +with lib; +let + out = { + environment.systemPackages = [ + vim' + ]; + + environment.variables.EDITOR = mkForce "vim"; + }; + + runtimepath = concatStringsSep "," [ + "$HOME/.vim" # TODO get rid if this and incorporate everything from wu:~tv/.vim + "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" + #"${tv-vim}/share/vim" + ]; + + vim' = pkgs.writeScriptBin "vim" '' + #! /bin/sh + set -eu + mkdir -p "$HOME"/.vim/backup + mkdir -p "$HOME"/.vim/cache + mkdir -p "$HOME"/.vim/undo + exec ${pkgs.vim}/bin/vim -u ${vimrc} "$@" + ''; + + vimrc = pkgs.writeText "vimrc" '' + set nocompatible + + set autoindent + set backspace=indent,eol,start + set backup + set backupdir=$HOME/.vim/backup/ + set directory=$HOME/.vim/cache// + set hlsearch + set incsearch + set mouse=a + set pastetoggle= + set runtimepath=${runtimepath} + set shortmess+=I + set showcmd + set showmatch + set ttimeoutlen=0 + set undodir=$HOME/.vim/undo + set undofile + set undolevels=1000000 + set undoreload=1000000 + set viminfo='20,<1000,s100,h,n$HOME/.vim/cache/info + set visualbell + set wildignore+=*.o,*.class,*.hi,*.dyn_hi,*.dyn_o + set wildmenu + set wildmode=longest,full + + filetype plugin indent on + + "colorscheme industry # TODO + syntax on + + cmap w!! w!sudo tee % >/dev/null + + nmap q :buffer + nmap :buffer + + cnoremap + + noremap :q + + nnoremap [5^ :tabp + nnoremap [6^ :tabn + nnoremap [5@ :tabm -1 + nnoremap [6@ :tabm +1 + + nnoremap :tabp + nnoremap :tabn + inoremap :tabp + inoremap :tabn + + " + noremap Oa | noremap! Oa + noremap Ob | noremap! Ob + noremap Oc | noremap! Oc + noremap Od | noremap! Od + " <[C]S-{Up,Down,Right,Left> + noremap [a | noremap! [a + noremap [b | noremap! [b + noremap [c | noremap! [c + noremap [d | noremap! [d + vnoremap u + ''; + + # "7.4.335" -> "74" + #majmin = x: concatStrings (take 2 (splitString "." x)); +in +out +#https://github.com/mbbill/undotree -- cgit v1.2.3 From c0cfbb5fcfcf0da49bbfa67328ba0b426ad9f321 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 11:29:58 +0100 Subject: tv vim: import industry colors From: http://www.vim.org/scripts/script.php?script_id=4875 --- tv/2configs/vim.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index d1104931..9ff9beb4 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -16,6 +16,52 @@ let #"${tv-vim}/share/vim" ]; + vim-industry-colors = pkgs.writeTextFile rec { + name = "vim-industry-colors"; + destination = "/colors/${name}"; + text = '' + " Vim color file + " Maintainer: Shian Lee + " Last Change: 2014 Mar 6 (for vim 7.4) + " Remark: "industry" stands for 'industrial' color scheme. In industrial + " HMI (Human-Machine-Interface) programming, using a standard color + " scheme is mandatory in many cases (in traffic-lights for example): + " LIGHT_RED is 'Warning' + " LIGHT_YELLOW is 'Attention' + " LIGHT_GREEN is 'Normal' + " LIGHT_MAGENTA is 'Warning-Attention' (light RED-YELLOW) + " LIGHT_CYAN is 'Attention-Normal' (light YELLOW-GREEN). + " BLACK is Dark-High-Contrast Background for maximum safety. + " BLUE is Shade of BLACK (not supposed to get attention). + " + " Industrial color scheme is by nature clear, safe and productive. + " Yet, depends on the file type's syntax, it might appear incorrect. + + " Reset to dark background, then reset everything to defaults: + set background=dark + highlight clear + if exists("syntax_on") + syntax reset + endif + + let colors_name = "industry" + + " First set Normal to regular white on black text colors: + hi Normal ctermfg=LightGray ctermbg=Black guifg=#dddddd guibg=Black + + " Syntax highlighting (other color-groups using default, see :help group-name): + hi Comment cterm=NONE ctermfg=DarkCyan gui=NONE guifg=#00aaaa + hi Constant cterm=NONE ctermfg=LightCyan gui=NONE guifg=#00ffff + hi Identifier cterm=NONE ctermfg=LightMagenta gui=NONE guifg=#ff00ff + hi Function cterm=NONE ctermfg=LightGreen gui=NONE guifg=#00ff00 + hi Statement cterm=NONE ctermfg=White gui=bold guifg=#ffffff + hi PreProc cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 + hi Type cterm=NONE ctermfg=LightGreen gui=bold guifg=#00ff00 + hi Special cterm=NONE ctermfg=LightRed gui=NONE guifg=#ff0000 + hi Delimiter cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 + ''; + }; + vim' = pkgs.writeScriptBin "vim" '' #! /bin/sh set -eu -- cgit v1.2.3 From 4cdd35a7ce88d32279c6b94c682ac6425248fc75 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 11:32:51 +0100 Subject: tv vim industry: retab & co. --- tv/2configs/vim.nix | 55 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 9ff9beb4..053fee81 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -21,21 +21,23 @@ let destination = "/colors/${name}"; text = '' " Vim color file - " Maintainer: Shian Lee - " Last Change: 2014 Mar 6 (for vim 7.4) - " Remark: "industry" stands for 'industrial' color scheme. In industrial - " HMI (Human-Machine-Interface) programming, using a standard color - " scheme is mandatory in many cases (in traffic-lights for example): - " LIGHT_RED is 'Warning' - " LIGHT_YELLOW is 'Attention' - " LIGHT_GREEN is 'Normal' - " LIGHT_MAGENTA is 'Warning-Attention' (light RED-YELLOW) - " LIGHT_CYAN is 'Attention-Normal' (light YELLOW-GREEN). - " BLACK is Dark-High-Contrast Background for maximum safety. - " BLUE is Shade of BLACK (not supposed to get attention). + " Maintainer: Shian Lee + " Last Change: 2014 Mar 6 (for vim 7.4) + " Remark: "industry" stands for 'industrial' color scheme. In + " industrial HMI (Human-Machine-Interface) programming, + " using a standard color scheme is mandatory in many cases + " (in traffic-lights for example): " - " Industrial color scheme is by nature clear, safe and productive. - " Yet, depends on the file type's syntax, it might appear incorrect. + " LIGHT_RED is 'Warning' + " LIGHT_YELLOW is 'Attention' + " LIGHT_GREEN is 'Normal' + " LIGHT_MAGENTA is 'Warning-Attention' (light RED-YELLOW) + " LIGHT_CYAN is 'Attention-Normal' (light YELLOW-GREEN). + " BLACK is Dark-High-Contrast Background for maximum safety. + " BLUE is Shade of BLACK (not supposed to get attention). + " + " Industrial color scheme is by nature clear, safe and productive. + " Yet, depends on the file type's syntax, it might appear incorrect. " Reset to dark background, then reset everything to defaults: set background=dark @@ -47,18 +49,19 @@ let let colors_name = "industry" " First set Normal to regular white on black text colors: - hi Normal ctermfg=LightGray ctermbg=Black guifg=#dddddd guibg=Black - - " Syntax highlighting (other color-groups using default, see :help group-name): - hi Comment cterm=NONE ctermfg=DarkCyan gui=NONE guifg=#00aaaa - hi Constant cterm=NONE ctermfg=LightCyan gui=NONE guifg=#00ffff - hi Identifier cterm=NONE ctermfg=LightMagenta gui=NONE guifg=#ff00ff - hi Function cterm=NONE ctermfg=LightGreen gui=NONE guifg=#00ff00 - hi Statement cterm=NONE ctermfg=White gui=bold guifg=#ffffff - hi PreProc cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 - hi Type cterm=NONE ctermfg=LightGreen gui=bold guifg=#00ff00 - hi Special cterm=NONE ctermfg=LightRed gui=NONE guifg=#ff0000 - hi Delimiter cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 + hi Normal ctermfg=LightGray ctermbg=Black guifg=#dddddd guibg=Black + + " Syntax highlighting + " (other color-groups using default, see :help group-name): + hi Comment cterm=NONE ctermfg=DarkCyan gui=NONE guifg=#00aaaa + hi Constant cterm=NONE ctermfg=LightCyan gui=NONE guifg=#00ffff + hi Identifier cterm=NONE ctermfg=LightMagenta gui=NONE guifg=#ff00ff + hi Function cterm=NONE ctermfg=LightGreen gui=NONE guifg=#00ff00 + hi Statement cterm=NONE ctermfg=White gui=bold guifg=#ffffff + hi PreProc cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 + hi Type cterm=NONE ctermfg=LightGreen gui=bold guifg=#00ff00 + hi Special cterm=NONE ctermfg=LightRed gui=NONE guifg=#ff0000 + hi Delimiter cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 ''; }; -- cgit v1.2.3 From 658780d3649ae5d13bb9afafa810022b28a81e6a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:12:08 +0100 Subject: tv vim industry: hi Normal ctermfg=White --- tv/2configs/vim.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 053fee81..9fb0759f 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -48,8 +48,7 @@ let let colors_name = "industry" - " First set Normal to regular white on black text colors: - hi Normal ctermfg=LightGray ctermbg=Black guifg=#dddddd guibg=Black + hi! Normal ctermfg=White " Syntax highlighting " (other color-groups using default, see :help group-name): -- cgit v1.2.3 From 7a9800289e64b25854b73d534f777ebcfb51ea04 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:13:07 +0100 Subject: tv vim: colorize nix --- tv/2configs/vim.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 9fb0759f..ba0060b4 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -107,6 +107,25 @@ let cmap w!! w!sudo tee % >/dev/null + au BufRead,BufNewFile *.nix so ${pkgs.writeText "nix.vim" '' + setf nix + + " Ref + syn match INT /[0-9]\+/ + syn match PATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ + syn match HPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ + syn match SPATH /<[a-zA-Z0-9\.\_\-\+]\+\(\/[a-zA-Z0-9\.\_\-\+]\+\)*>/ + syn match URI /[a-zA-Z][a-zA-Z0-9\+\-\.]*:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']\+/ + hi link INT Constant + hi link PATH Constant + hi link HPATH Constant + hi link SPATH Constant + hi link URI Constant + + syn match String /"\([^"]\|\\\"\)*"/ + syn match Comment /\s#.*/ + ''} + nmap q :buffer nmap :buffer -- cgit v1.2.3 From 51f875a43666af5ee16ef04fd95142ac09a16754 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:16:15 +0100 Subject: tv vim: don't ru ~/vim --- tv/2configs/vim.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ba0060b4..ab0fdc23 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -11,9 +11,7 @@ let }; runtimepath = concatStringsSep "," [ - "$HOME/.vim" # TODO get rid if this and incorporate everything from wu:~tv/.vim "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" - #"${tv-vim}/share/vim" ]; vim-industry-colors = pkgs.writeTextFile rec { -- cgit v1.2.3 From 72800459a51d2618f9ed850c1bf02d416cac2767 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:17:11 +0100 Subject: tv vim: use industry colors --- tv/2configs/vim.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ab0fdc23..ea2c4c95 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -11,6 +11,7 @@ let }; runtimepath = concatStringsSep "," [ + vim-industry-colors "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" ]; @@ -100,7 +101,8 @@ let filetype plugin indent on - "colorscheme industry # TODO + set t_Co=256 + colorscheme industry syntax on cmap w!! w!sudo tee % >/dev/null -- cgit v1.2.3 From fac32d63571d322ee7b73bc06ab69b519e301706 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:20:17 +0100 Subject: tv vim: ru pkg.vim share --- tv/2configs/vim.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ea2c4c95..758dd506 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -12,6 +12,7 @@ let runtimepath = concatStringsSep "," [ vim-industry-colors + "${pkgs.vim}/share/vim/vim${majmin pkgs.vim.version}" "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" ]; @@ -157,7 +158,7 @@ let ''; # "7.4.335" -> "74" - #majmin = x: concatStrings (take 2 (splitString "." x)); + majmin = x: concatStrings (take 2 (splitString "." x)); in out #https://github.com/mbbill/undotree -- cgit v1.2.3 From 542a78403fe92c7690e985d19195087c10b0252f Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:21:09 +0100 Subject: tv vim: so vimrc via VIMINIT --- tv/2configs/vim.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 758dd506..62ed02f7 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -66,11 +66,12 @@ let vim' = pkgs.writeScriptBin "vim" '' #! /bin/sh - set -eu - mkdir -p "$HOME"/.vim/backup - mkdir -p "$HOME"/.vim/cache - mkdir -p "$HOME"/.vim/undo - exec ${pkgs.vim}/bin/vim -u ${vimrc} "$@" + set -efu + ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/backup + ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/cache + ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/undo + export VIMINIT; VIMINIT=':so ${vimrc}' + exec ${pkgs.vim}/bin/vim "$@" ''; vimrc = pkgs.writeText "vimrc" '' -- cgit v1.2.3 From 3c1e22076992df1f5fffa9c069af97cca4d54f66 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:21:35 +0100 Subject: tv vim: set noruler --- tv/2configs/vim.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 62ed02f7..6691350e 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -85,6 +85,7 @@ let set hlsearch set incsearch set mouse=a + set noruler set pastetoggle= set runtimepath=${runtimepath} set shortmess+=I -- cgit v1.2.3 From c29f45dec1c41f6ab12a9b2c4f91e70a4bbc830c Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:22:15 +0100 Subject: tv vim: colorize tabs and trailing space --- tv/2configs/vim.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 6691350e..2e49a0ca 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -108,7 +108,10 @@ let colorscheme industry syntax on - cmap w!! w!sudo tee % >/dev/null + au Syntax * syn match Tabstop containedin=ALL /\t\+/ + \ | hi Tabstop ctermbg=16 + \ | syn match TrailingSpace containedin=ALL /\s\+$/ + \ | hi TrailingSpace ctermbg=88 au BufRead,BufNewFile *.nix so ${pkgs.writeText "nix.vim" '' setf nix -- cgit v1.2.3 From 2977f6d2910528bd7b3c78ae614aebff18dd4874 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:22:43 +0100 Subject: tv vim: no backup & co for /dev/shm/* --- tv/2configs/vim.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 2e49a0ca..7eb2eb13 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -132,6 +132,8 @@ let syn match Comment /\s#.*/ ''} + au BufRead,BufNewFile /dev/shm/* set nobackup nowritebackup noswapfile + nmap q :buffer nmap :buffer -- cgit v1.2.3 From 9c36073e7b0081eaec37b0de232aeee2dcf5d8ab Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:28:16 +0100 Subject: tv base: import vim --- tv/1systems/xu.nix | 1 - tv/2configs/base.nix | 14 ++------------ tv/2configs/vim.nix | 7 +++++++ tv/4lib/default.nix | 3 --- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix index 82f5abf7..b858444a 100644 --- a/tv/1systems/xu.nix +++ b/tv/1systems/xu.nix @@ -110,7 +110,6 @@ with lib; #minicom #mtools #ncmpc - #neovim #nethogs #nix-prefetch-scripts #cvs bug #openssl diff --git a/tv/2configs/base.nix b/tv/2configs/base.nix index 0a8dbdcc..41159690 100644 --- a/tv/2configs/base.nix +++ b/tv/2configs/base.nix @@ -3,17 +3,13 @@ with builtins; with lib; -let - # "7.4.335" -> "74" - majmin = x: concatStrings (take 2 (splitString "." x)); -in - { krebs.enable = true; networking.hostName = config.krebs.build.host.name; imports = [ + ./vim.nix { # stockholm dependencies environment.systemPackages = with pkgs; [ @@ -107,10 +103,8 @@ in lAtr = "ls -lAtr"; # alias ll='ls -l' ls = "ls -h --color=auto --group-directories-first"; - # alias vim='vim -p' - # alias vi='vim' - # alias view='vim -R' dmesg = "dmesg -L --reltime"; + view = "vim -R"; }; programs.bash = { @@ -153,10 +147,6 @@ in } { - nixpkgs.config.packageOverrides = pkgs: { - nano = pkgs.vim; - }; - services.cron.enable = false; services.nscd.enable = false; services.ntp.enable = false; diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 7eb2eb13..74eee0a3 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -7,6 +7,13 @@ let vim' ]; + # Nano really is just a stupid name for Vim. + # Note: passing just pkgs.vim to cvs to not rebuild it all the time + nixpkgs.config.packageOverrides = pkgs: { + cvs = pkgs.cvs.override { nano = pkgs.vim; }; + nano = vim'; + }; + environment.variables.EDITOR = mkForce "vim"; }; diff --git a/tv/4lib/default.nix b/tv/4lib/default.nix index 7e6b2ab1..c099eb73 100644 --- a/tv/4lib/default.nix +++ b/tv/4lib/default.nix @@ -6,9 +6,6 @@ lib // rec { inherit lib pkgs; }; - # "7.4.335" -> "74" - majmin = with lib; x : concatStrings (take 2 (splitString "." x)); - # TODO deprecate shell-escape for lass shell-escape = lib.shell.escape; } -- cgit v1.2.3 From 4d43b92b22972e663f72e2b48f5f0892aff4334a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:48:38 +0100 Subject: tv vim: use upstream industry colors + mods --- tv/2configs/vim.nix | 55 +++-------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 74eee0a3..f1744387 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -17,60 +17,10 @@ let environment.variables.EDITOR = mkForce "vim"; }; - runtimepath = concatStringsSep "," [ - vim-industry-colors - "${pkgs.vim}/share/vim/vim${majmin pkgs.vim.version}" + extra-runtimepath = concatStringsSep "," [ "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" ]; - vim-industry-colors = pkgs.writeTextFile rec { - name = "vim-industry-colors"; - destination = "/colors/${name}"; - text = '' - " Vim color file - " Maintainer: Shian Lee - " Last Change: 2014 Mar 6 (for vim 7.4) - " Remark: "industry" stands for 'industrial' color scheme. In - " industrial HMI (Human-Machine-Interface) programming, - " using a standard color scheme is mandatory in many cases - " (in traffic-lights for example): - " - " LIGHT_RED is 'Warning' - " LIGHT_YELLOW is 'Attention' - " LIGHT_GREEN is 'Normal' - " LIGHT_MAGENTA is 'Warning-Attention' (light RED-YELLOW) - " LIGHT_CYAN is 'Attention-Normal' (light YELLOW-GREEN). - " BLACK is Dark-High-Contrast Background for maximum safety. - " BLUE is Shade of BLACK (not supposed to get attention). - " - " Industrial color scheme is by nature clear, safe and productive. - " Yet, depends on the file type's syntax, it might appear incorrect. - - " Reset to dark background, then reset everything to defaults: - set background=dark - highlight clear - if exists("syntax_on") - syntax reset - endif - - let colors_name = "industry" - - hi! Normal ctermfg=White - - " Syntax highlighting - " (other color-groups using default, see :help group-name): - hi Comment cterm=NONE ctermfg=DarkCyan gui=NONE guifg=#00aaaa - hi Constant cterm=NONE ctermfg=LightCyan gui=NONE guifg=#00ffff - hi Identifier cterm=NONE ctermfg=LightMagenta gui=NONE guifg=#ff00ff - hi Function cterm=NONE ctermfg=LightGreen gui=NONE guifg=#00ff00 - hi Statement cterm=NONE ctermfg=White gui=bold guifg=#ffffff - hi PreProc cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 - hi Type cterm=NONE ctermfg=LightGreen gui=bold guifg=#00ff00 - hi Special cterm=NONE ctermfg=LightRed gui=NONE guifg=#ff0000 - hi Delimiter cterm=NONE ctermfg=Yellow gui=NONE guifg=#ffff00 - ''; - }; - vim' = pkgs.writeScriptBin "vim" '' #! /bin/sh set -efu @@ -94,7 +44,7 @@ let set mouse=a set noruler set pastetoggle= - set runtimepath=${runtimepath} + set runtimepath=${extra-runtimepath},$VIMRUNTIME set shortmess+=I set showcmd set showmatch @@ -119,6 +69,7 @@ let \ | hi Tabstop ctermbg=16 \ | syn match TrailingSpace containedin=ALL /\s\+$/ \ | hi TrailingSpace ctermbg=88 + \ | hi Normal ctermfg=White au BufRead,BufNewFile *.nix so ${pkgs.writeText "nix.vim" '' setf nix -- cgit v1.2.3 From 6412cdf137a7b1993473937988648517a06629a9 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:59:53 +0100 Subject: tv vim: decouple vimrc from ENV --- tv/2configs/vim.nix | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index f1744387..b9ee725b 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -4,33 +4,24 @@ with lib; let out = { environment.systemPackages = [ - vim' + pkgs.vim ]; # Nano really is just a stupid name for Vim. - # Note: passing just pkgs.vim to cvs to not rebuild it all the time nixpkgs.config.packageOverrides = pkgs: { - cvs = pkgs.cvs.override { nano = pkgs.vim; }; - nano = vim'; + nano = pkgs.vim; }; + environment.etc.vimrc.source = vimrc; + environment.variables.EDITOR = mkForce "vim"; + environment.variables.VIMINIT = ":so /etc/vimrc"; }; extra-runtimepath = concatStringsSep "," [ "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" ]; - vim' = pkgs.writeScriptBin "vim" '' - #! /bin/sh - set -efu - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/backup - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/cache - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/undo - export VIMINIT; VIMINIT=':so ${vimrc}' - exec ${pkgs.vim}/bin/vim "$@" - ''; - vimrc = pkgs.writeText "vimrc" '' set nocompatible -- cgit v1.2.3 From 33b7521bca9354d219c575ec1ff0a271707bb78b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:06:58 +0100 Subject: tv: what's majmin? --- tv/2configs/vim.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index b9ee725b..8c6c9fb4 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -112,9 +112,5 @@ let noremap [d | noremap! [d vnoremap u ''; - - # "7.4.335" -> "74" - majmin = x: concatStrings (take 2 (splitString "." x)); in out -#https://github.com/mbbill/undotree -- cgit v1.2.3 From 7dc05de06ab689e79149d6f02c4f06a5d6c9a384 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:13:10 +0100 Subject: xu nixpkgs: e57024f -> c44a593 --- tv/1systems/xu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix index b858444a..e2cc2c06 100644 --- a/tv/1systems/xu.nix +++ b/tv/1systems/xu.nix @@ -11,7 +11,7 @@ with lib; krebs.build.source = { git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "e57024f821c94caf5684964474073649b8b6356b"; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From 383732b49365b8db281776cb7a711664a5bcc0b4 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:14:16 +0100 Subject: wu nixpkgs: e916273 -> c44a593 --- tv/1systems/wu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 65389b66..85fba1d8 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -11,7 +11,7 @@ with lib; krebs.build.source = { git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "e916273209560b302ab231606babf5ce1c481f08"; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From 5d258e9b5b2c12403a20ff51be59dc39e3f6c2b4 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:15:36 +0100 Subject: cd nixpkgs: 4z3/03130ec -> NixOS/c44a593 --- tv/1systems/cd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index 69f1300b..1122e6a1 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -10,8 +10,8 @@ with lib; krebs.build.source = { git.nixpkgs = { - url = https://github.com/4z3/nixpkgs; - rev = "03130ec91356cd250b80f144022ee2f4d665ca36"; # 1357692 + url = https://github.com/NixOS/nixpkgs; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From 6755476c0a6e77d289c38bbd0e9053ae84f40e67 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:27:24 +0100 Subject: rmdir nixpkgs: 68bd8e4 -> c44a593 --- tv/1systems/rmdir.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/1systems/rmdir.nix b/tv/1systems/rmdir.nix index f77268b5..e24ef64f 100644 --- a/tv/1systems/rmdir.nix +++ b/tv/1systems/rmdir.nix @@ -24,7 +24,7 @@ in krebs.build.source = { git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "68bd8e4a9dc247726ae89cc8739574261718e328"; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From c7a27fc0003a80f8de12e7c7ee9feaed9aa83158 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:27:51 +0100 Subject: mkdir nixpkgs: e57024f -> c44a593 --- tv/1systems/mkdir.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/1systems/mkdir.nix b/tv/1systems/mkdir.nix index 305ea726..e8e35419 100644 --- a/tv/1systems/mkdir.nix +++ b/tv/1systems/mkdir.nix @@ -24,7 +24,7 @@ in krebs.build.source = { git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "e57024f821c94caf5684964474073649b8b6356b"; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From d2ac2e0d0080e1b76d1d6249ab52231b72ae8ea9 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 14:31:16 +0100 Subject: nomic nixpkgs: 4z3/03130ec -> NixOS/c44a593 --- tv/1systems/nomic.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix index 61f833d4..df45b817 100644 --- a/tv/1systems/nomic.nix +++ b/tv/1systems/nomic.nix @@ -10,8 +10,8 @@ with lib; krebs.build.source = { git.nixpkgs = { - url = https://github.com/4z3/nixpkgs; - rev = "03130ec91356cd250b80f144022ee2f4d665ca36"; # 1357692 + url = https://github.com/NixOS/nixpkgs; + rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; }; dir.secrets = { host = config.krebs.hosts.wu; -- cgit v1.2.3 From bfad3f16b16c9d132f9af7a48ede69b3ddb6bedc Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2015 10:28:56 +0100 Subject: krebs nix-install: softcode using target-path --- krebs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/default.nix b/krebs/default.nix index 31a7f7d0..175b0205 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -178,7 +178,7 @@ let out = { nix-path = lib.concatStringsSep ":" - (lib.mapAttrsToList (name: _: "${name}=/root/${name}") + (lib.mapAttrsToList (name: src: "${name}=${src.target-path}") (config.krebs.build.source.dir // config.krebs.build.source.git)); in '' -- cgit v1.2.3 From ed86c7f44e16cd70693ca78ecdcc620fc8c66495 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2015 10:17:30 +0100 Subject: wu: {/root => /var/src}/{nixpkgs,stockholm} --- tv/1systems/wu.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 85fba1d8..b12e7df9 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -12,6 +12,7 @@ with lib; git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; rev = "c44a593aa43bba6a0708f6f36065a514a5110613"; + target-path = "/var/src/nixpkgs"; }; dir.secrets = { host = config.krebs.hosts.wu; @@ -20,6 +21,7 @@ with lib; dir.stockholm = { host = config.krebs.hosts.wu; path = "/home/tv/stockholm"; + target-path = "/var/src/stockholm"; }; }; -- cgit v1.2.3 From 62e7c137187eed2abc39b78fe7d8ddfc7606aae5 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2015 13:48:40 +0100 Subject: krebs.init: talk about ssh.privkey.path --- krebs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/default.nix b/krebs/default.nix index 175b0205..bfd6175d 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -84,6 +84,7 @@ let out = { cat<; ssh.pubkey = $(echo $pubkey | jq -R .); EOF ''; -- cgit v1.2.3 From 9b985720ea761aea900f18249b179dbd0345c83f Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2015 13:51:03 +0100 Subject: nomic: fix ssh.{priv,pub}key --- krebs/3modules/tv/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 4c295dff..302d1a92 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -158,7 +158,8 @@ with lib; }; }; secure = true; - ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILn7C3LxAs9kUynENdRNgQs4qjrhNDfXzlHTpVJt6e09"; + ssh.privkey.path = ; + ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILMPMh3nHxVcPqM+LrkK7eYxNJY1ShBXOTg1vlSR45wx"; }; ok = { nets = { -- cgit v1.2.3 From 1ddbdddc696316986b07376a7fc5e33aaf228e89 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2015 00:31:14 +0100 Subject: tv vim: set et ts=2 sts=2 sw=2 --- tv/2configs/vim.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 8c6c9fb4..14f086e5 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -50,6 +50,8 @@ let set wildmenu set wildmode=longest,full + set et ts=2 sts=2 sw=2 + filetype plugin indent on set t_Co=256 -- cgit v1.2.3