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 (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix new file mode 100644 index 000000000..d1104931d --- /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(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index d1104931d..9ff9beb45 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 9ff9beb45..053fee81e 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 053fee81e..9fb0759ff 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(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 9fb0759ff..ba0060b40 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ba0060b40..ab0fdc23f 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ab0fdc23f..ea2c4c955 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index ea2c4c955..758dd506b 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 758dd506b..62ed02f74 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(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 62ed02f74..6691350eb 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 6691350eb..2e49a0ca0 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(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 2e49a0ca0..7eb2eb139 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/2configs/vim.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 7eb2eb139..74eee0a3b 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"; }; -- 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 74eee0a3b..f17443871 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index f17443871..b9ee725b8 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(-) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index b9ee725b8..8c6c9fb45 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 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(+) (limited to 'tv/2configs/vim.nix') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 8c6c9fb45..14f086e5c 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