From ebdebc6fe960c4166f291bf76b7deac2c635c843 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Sun, 8 Mar 2020 16:41:57 +0000 Subject: [PATCH] Add some global configuration --- role/base.nix | 5 ++++ role/base/etc/gitconfig | 31 +++++++++++++++++++++++ role/base/etc/vimrc | 54 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 role/base/etc/gitconfig create mode 100644 role/base/etc/vimrc diff --git a/role/base.nix b/role/base.nix index ac2face..d2d65f6 100644 --- a/role/base.nix +++ b/role/base.nix @@ -38,4 +38,9 @@ dates = "weekly"; options = "--delete-older-than 30d"; }; + + environment.etc = { + gitconfig.source = ./base/etc/gitconfig; + vimrc.source = ./base/etc/vimrc; + }; } diff --git a/role/base/etc/gitconfig b/role/base/etc/gitconfig new file mode 100644 index 0000000..1971e05 --- /dev/null +++ b/role/base/etc/gitconfig @@ -0,0 +1,31 @@ +[core] + packedGitWindowSize = 16m + packedGitLimit = 64m +[pack] + windowMemory = 64m + packSizeLimit = 64m + thread = 1 + deltaCacheSize = 1m +[color] + branch = auto + diff = auto + status = auto +[push] + default = simple +[pull] + rebase = true +[branch] + autosetuprebase = always +[commit] +# gpgsign = true +[tag] +# gpgsign = true + +[alias] + s = status --short --branch + a = add --patch + c = commit --message + l = log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset' --abbrev-commit + d = diff +[diff] +# noprefix = true diff --git a/role/base/etc/vimrc b/role/base/etc/vimrc new file mode 100644 index 0000000..fc66567 --- /dev/null +++ b/role/base/etc/vimrc @@ -0,0 +1,54 @@ + +" Use Vim settings, rather than Vi settings (much better!). +" This must be first, because it changes other options as a side effect. +" Avoid side effects when it was already reset. +if &compatible + set nocompatible +endif + +" Convenient command to see the difference between the current buffer and the +" file it was loaded from, thus the changes you made. +" Only define it when not defined already. +" Revert with: ":delcommand DiffOrig". +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + +" Don't wake up system with blinking cursor: +" http://www.linuxpowertop.org/known.php +let &guicursor = &guicursor . ",a:blinkon0" + + + + +"""""""""""""""""""""""""" +" Design Settings +"""""""""""""""""""""""""" +set background=dark +colorscheme elflord + +"""""""""""""""""""""""""" +" Other Settings +"""""""""""""""""""""""""" +set ignorecase " Ignore search case +set autoindent " Newline with automatic text indent +set ruler " Show current position +set pastetoggle= +set ignorecase +set hidden + +set splitbelow +set splitright + +set tabstop=2 +set shiftwidth=2 +set softtabstop=2 +set expandtab + +set listchars="eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣" +set grepprg=ack\ -k + +filetype plugin indent on +syntax on +