From 3b23e6e8bbb42d0866b0d4d6c42f610510fa915c Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 31 Jan 2018 09:38:47 +0100 Subject: j: +zsh --- jeschli/2configs/default.nix | 1 + jeschli/2configs/zsh.nix | 138 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 jeschli/2configs/zsh.nix (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/default.nix b/jeschli/2configs/default.nix index 0ac3708b..5aaabe24 100644 --- a/jeschli/2configs/default.nix +++ b/jeschli/2configs/default.nix @@ -4,6 +4,7 @@ with import ; imports = [ ./vim.nix ./retiolum.nix + ./zsh.nix { environment.variables = { diff --git a/jeschli/2configs/zsh.nix b/jeschli/2configs/zsh.nix new file mode 100644 index 00000000..be5b661b --- /dev/null +++ b/jeschli/2configs/zsh.nix @@ -0,0 +1,138 @@ +{ config, lib, pkgs, ... }: +{ + environment.systemPackages = [ pkgs.fzf ]; + programs.zsh = { + enable = true; + shellInit = '' + #disable config wizard + zsh-newuser-install() { :; } + ''; + interactiveShellInit = '' + setopt autocd extendedglob + bindkey -e + + #history magic + bindkey "" up-line-or-local-history + bindkey "" down-line-or-local-history + + up-line-or-local-history() { + zle set-local-history 1 + zle up-line-or-history + zle set-local-history 0 + } + zle -N up-line-or-local-history + down-line-or-local-history() { + zle set-local-history 1 + zle down-line-or-history + zle set-local-history 0 + } + zle -N down-line-or-local-history + + setopt share_history + setopt hist_ignore_dups + # setopt inc_append_history + bindkey '^R' history-incremental-search-backward + + #C-x C-e open line in editor + autoload -z edit-command-line + zle -N edit-command-line + bindkey "^X^E" edit-command-line + + #fzf inclusion + source ${pkgs.fzf}/share/fzf/completion.zsh + source ${pkgs.fzf}/share/fzf/key-bindings.zsh + + #completion magic + autoload -Uz compinit + compinit + zstyle ':completion:*' menu select + + #enable automatic rehashing of $PATH + zstyle ':completion:*' rehash true + + eval $(dircolors -b ${pkgs.fetchFromGitHub { + owner = "trapd00r"; + repo = "LS_COLORS"; + rev = "master"; + sha256="05lh5w3bgj9h8d8lrbbwbzw8788709cnzzkl8yh7m1dawkpf6nlp"; + }}/LS_COLORS) + + #beautiful colors + alias ls='ls --color' + # zstyle ':completion:*:default' list-colors ''${(s.:.)LS_COLORS} + + #emacs bindings + bindkey "[7~" beginning-of-line + bindkey "[8~" end-of-line + bindkey "Oc" emacs-forward-word + bindkey "Od" emacs-backward-word + + #aliases + alias ll='ls -l' + alias la='ls -la' + + #fancy window title magic + ''; + promptInit = '' + # TODO: figure out why we need to set this here + HISTSIZE=900001 + HISTFILESIZE=$HISTSIZE + SAVEHIST=$HISTSIZE + + autoload -U promptinit + promptinit + + p_error='%(?..%F{red}%?%f )' + t_error='%(?..%? )' + + case $UID in + 0) + p_username='%F{red}root%f' + t_username='root' + ;; + 1337) + p_username="" + t_username="" + ;; + *) + p_username='%F{blue}%n%f' + t_username='%n' + ;; + esac + + if test -n "$SSH_CLIENT"; then + p_hostname='@%F{magenta}%M%f ' + t_hostname='@%M ' + else + p_hostname="" + t_hostname="" + fi + + #check if in nix shell + if test -n "$buildInputs"; then + p_nixshell='%F{green}[s]%f ' + t_nixshell='[s] ' + else + p_nixshell="" + t_nixshell="" + fi + + PROMPT="$p_error$p_username$p_hostname$p_nixshell%~ " + TITLE="$t_error$t_username$t_hostname$t_nixshell%~" + case $TERM in + (*xterm* | *rxvt*) + function precmd { + PROMPT_EVALED="$(print -P $TITLE)" + echo -ne "\033]0;$$ $PROMPT_EVALED\007" + } + # This is seen while the shell waits for a command to complete. + function preexec { + PROMPT_EVALED="$(print -P $TITLE)" + echo -ne "\033]0;$$ $PROMPT_EVALED $1\007" + } + ;; + esac + ''; + }; + users.defaultUserShell = "/run/current-system/sw/bin/zsh"; +} -- cgit v1.2.3 From e5114f1bfb9f7f412236f05e15fb6023699c96d6 Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 31 Jan 2018 11:56:05 +0100 Subject: j fontsize default 12; bln 20 --- jeschli/2configs/urxvt.nix | 65 +++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 30 deletions(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/urxvt.nix b/jeschli/2configs/urxvt.nix index 69811eb0..01491874 100644 --- a/jeschli/2configs/urxvt.nix +++ b/jeschli/2configs/urxvt.nix @@ -1,34 +1,39 @@ { config, pkgs, ... }: with import ; - { - services.urxvtd.enable = true; - krebs.xresources.enable = true; - krebs.xresources.resources.urxvt = '' - *foreground: rgb:a8/a8/a8 - *background: rgb:00/00/00 - *faceName: DejaVu Sans Mono - *faceSize: 12 - *color0: rgb:00/00/00 - *color1: rgb:a8/00/00 - *color2: rgb:00/a8/00 - *color3: rgb:a8/54/00 - *color4: rgb:00/00/a8 - *color5: rgb:a8/00/a8 - *color6: rgb:00/a8/a8 - *color7: rgb:a8/a8/a8 - *color8: rgb:54/54/54 - *color9: rgb:fc/54/54 - *color10: rgb:54/fc/54 - *color11: rgb:fc/fc/54 - *color12: rgb:54/54/fc - *color13: rgb:fc/54/fc - *color14: rgb:54/fc/fc - *color15: rgb:fc/fc/fc - - URxvt*scrollBar: false - URxvt*urgentOnBell: true - URxvt*font: xft:DejaVu Sans Mono:pixelsize=12 - URXvt*faceSize: 12 - ''; + options.jeschliFontSize = mkOption { + type = types.int; + default = 12; + }; + config = { + services.urxvtd.enable = true; + krebs.xresources.enable = true; + krebs.xresources.resources.urxvt = '' + *foreground: rgb:a8/a8/a8 + *background: rgb:00/00/00 + *faceName: DejaVu Sans Mono + *faceSize: ${toString config.jeschliFontSize} + *color0: rgb:00/00/00 + *color1: rgb:a8/00/00 + *color2: rgb:00/a8/00 + *color3: rgb:a8/54/00 + *color4: rgb:26/8b/d2 + *color5: rgb:a8/00/a8 + *color6: rgb:00/a8/a8 + *color7: rgb:a8/a8/a8 + *color8: rgb:54/54/54 + *color9: rgb:fc/54/54 + *color10: rgb:54/fc/54 + *color11: rgb:fc/fc/54 + *color12: rgb:54/54/fc + *color13: rgb:fc/54/fc + *color14: rgb:54/fc/fc + *color15: rgb:fc/fc/fc + + URxvt*scrollBar: false + URxvt*urgentOnBell: true + URxvt*font: xft:DejaVu Sans Mono:pixelsize=${toString config.jeschliFontSize} + URXvt*faceSize: ${toString config.jeschliFontSize} + ''; + }; } -- cgit v1.2.3 From 257f91eff3cf2ef01c25f4e88d186ea30dc250f7 Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 7 Feb 2018 10:08:36 +0100 Subject: j vim: +trailing White detection; *cosmetics --- jeschli/2configs/vim.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/vim.nix b/jeschli/2configs/vim.nix index 7721b1d4..02ea95f6 100644 --- a/jeschli/2configs/vim.nix +++ b/jeschli/2configs/vim.nix @@ -27,6 +27,9 @@ in { name = "vim"; vimrcConfig.customRC = let colorscheme = ''colorscheme molokai''; + highlightTrailingWhiteSpaces = '' + au Syntax * syn match Garbage containedin=ALL /\s\+$/ + ''; setStatements = '' set autowrite set clipboard=unnamedplus @@ -74,11 +77,12 @@ in { ''; in '' ${colorscheme} + ${highlightTrailingWhiteSpaces} ${remapStatements} ${setStatements} ${settingsForElm} ${settingsForGo} - " I dont know what this line is about + " dont expand tabs in go files and show it with four whitespaces. autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 ''; vimrcConfig.vam.knownPlugins = pkgs.vimPlugins // customPlugins; -- cgit v1.2.3 From ab24f3c3a802eabef3f425d2b46e1b4ffc626e71 Mon Sep 17 00:00:00 2001 From: jeschli Date: Fri, 9 Feb 2018 15:11:24 +0100 Subject: j vim.nix: remap tt to GoTest --- jeschli/2configs/vim.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/vim.nix b/jeschli/2configs/vim.nix index 02ea95f6..c13113f1 100644 --- a/jeschli/2configs/vim.nix +++ b/jeschli/2configs/vim.nix @@ -45,6 +45,7 @@ in { remapStatements = '' imap jk map gr :GoRun " Map gr to execute go run + map tt :GoTest " Map tt to execute go test map nf :NERDTreeToggle nnoremap nnoremap :bnext -- cgit v1.2.3