From 7d19a9c744068bde95dd96b61ededb1f5de55fea Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Sun, 27 Sep 2020 16:38:35 +0200 Subject: [PATCH] new beginnings --- .config/nvim/init.vim | 13 +++++----- .config/starship.toml | 57 +++++++++++++++++++++++++++++++++++++++++++ .gitconfig | 10 +++++++- .inputrc | 4 +-- .tmux.conf | 21 ++++++---------- .zshrc | 49 ++++++++++++++++++++++++++++++++++--- 6 files changed, 127 insertions(+), 27 deletions(-) create mode 100644 .config/starship.toml diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 7d0e4a3..ac8253a 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,7 +1,6 @@ -"" Vundle -" set rtp+=~/.vim/bundle/Vundle.vim call plug#begin('~/.local/share/nvim/plugged') + " Autocomplete " Plug 'ncm2/ncm2' " Plug 'roxma/nvim-yarp' @@ -233,8 +232,8 @@ let g:explDetailedHelp=1 "" Backup set backup set backupcopy=yes -set backupdir=~/.vim/backup,~/.tmp,~/tmp,/var/tmp,/tmp" -set directory=~/.vim/backup,~/.tmp,~/tmp,/var/tmp,/tmp" +set backupdir=~/tmp,/var/tmp,/tmp" +set directory=~/tmp,/var/tmp,/tmp" let myvar = strftime("%y%m%d-%H%M") let myvar = "set backupext=_". myvar execute myvar @@ -562,7 +561,7 @@ map ,h :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" -set background=dark +set background=light let g:one_allow_italics=1 let g:PaperColor_Light_Override = { 'Background' : '#fefe00' } @@ -657,8 +656,8 @@ let &t_8f = "[38;2;%lu;%lu;%lum" let &t_8b = "[48;2;%lu;%lu;%lum" -color dln-dim -map ,l :color dln-dim +color dln-light +map ,l :color dln-light let s:hidden_all = 0 diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..87390cf --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,57 @@ +add_newline = false + +prompt_order = [ + "username", + "hostname", + "kubernetes", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "hg_branch", + "docker_context", + "package", + "dotnet", + "elixir", + "elm", + "erlang", + "golang", + "java", + "julia", + "kubernetes", + "nim", + "nodejs", + "ocaml", + "php", + "purescript", + "python", + "ruby", + "rust", + "terraform", + "zig", + "nix_shell", + "conda", + "memory_usage", + "aws", + "env_var", + "crystal", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] + +[character] +symbol = "%%" + +[line_break] +disabled = true + +[directory] +truncation_length = 1 +truncate_to_repo = false +style = "bold" diff --git a/.gitconfig b/.gitconfig index 5258d7c..6f90bdd 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,7 +1,7 @@ [core] excludesfile = "~/.gitignore" editor = nvim -#pager = diff-so-fancy | less -+R -nBJFXRgiM -h512 -x4 +pager = delta [user] useConfigOnly = true @@ -66,12 +66,20 @@ threads = 0 [blame] date = relative +[delta] +plus-color = "#012800" +minus-color = "#340001" +syntax-theme = GitHub + [hub] protocol = git [http] cookiefile = /home/dln/.gitcookies +[interactive] +diffFilter = delta --color-only + [credential] helper = store diff --git a/.inputrc b/.inputrc index 62734f4..062ffe5 100644 --- a/.inputrc +++ b/.inputrc @@ -6,6 +6,6 @@ set visible-stats on set show-all-if-ambiguous on set completion-query-items 150 -"\C-p": history-search-backward -"\C-n": history-search-forward +#"\C-p": history-search-backward +#"\C-n": history-search-forward diff --git a/.tmux.conf b/.tmux.conf index 41b6416..223ea2f 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -51,18 +51,13 @@ bind -n C-l send-keys C-l \; clear-history bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down - -# Startup -new -d -s0 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -neww -d 'exec zsh' -selectw -t 1 +setw -g window-status-format "" +setw -g window-status-separator "" +set -g status-justify left +set -g status-left " #I " +set -g status-right "" +set -g set-titles on +set -g set-titles-string "#H:#T" +set -g status-style "fg=#EFEBE9,bg=#546E7A" # vim:set ft=tmux: diff --git a/.zshrc b/.zshrc index ce3ee03..c227a11 100644 --- a/.zshrc +++ b/.zshrc @@ -1,9 +1,10 @@ source ~/.zplug/init.zsh zplug "plugins/git", from:oh-my-zsh -zplug "zsh-users/zsh-history-substring-search" zplug "zsh-users/zsh-completions" -zplug "zsh-users/zsh-syntax-highlighting", defer:2 +zplug 'zsh-users/zsh-syntax-highlighting', defer:2 +zplug 'zsh-users/zsh-history-substring-search', defer:3 +zplug 'zsh-users/zsh-autosuggestions' if ! zplug check --verbose; then printf "Install? [y/N]: " @@ -13,11 +14,46 @@ if ! zplug check --verbose; then fi zplug load +## History +HISTSIZE=50000 +SAVEHIST=50000 +HISTFILE=~/.zsh_history +setopt append_history +setopt extended_history +setopt hist_expire_dups_first +setopt hist_fcntl_lock +setopt hist_ignore_all_dups +setopt hist_ignore_space +setopt HIST_IGNORE_SPACE +setopt hist_lex_words +setopt hist_reduce_blanks +setopt hist_save_no_dups +setopt hist_subst_pattern +setopt hist_verify +setopt share_history + + +## zsh settings +setopt pipe_fail +setopt auto_pushd +setopt no_beep +setopt no_rm_star_silent +setopt extended_glob +setopt ksh_glob +setopt null_glob ## Completion autoload -Uz compinit compinit +## Keybindings +bindkey -e +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down +bindkey '^P' history-substring-search-up +bindkey '^N' history-substring-search-down + + ## Gnupg / gpg / ssh / yubikey export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) @@ -66,8 +102,13 @@ GOPROXY=https://proxy.golang.org/ export ANSIBLE_NOCOWS=1 ## Prompt +function set_win_title(){ + echo -ne "\033]0;${PWD}\007" +} +starship_precmd_user_func="set_win_title" +precmd_functions+=(set_win_title) + eval "$(starship init zsh)" + export PATH=$HOME/bin:$PATH - -