dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 2babf48da155fa5047f8877ab4d2840085cd227e
parent 26391296c789d9cdb0ecf74ce7f8837c3bd003f4
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 24 May 2019 10:32:54 +0200

Use nvim, fix cursor changing, improve bash prompt

Diffstat:
M.bashrc | 49++++++++++++++++++++++++++-----------------------
M.commands.sh | 5+----
M.inputrc | 15++++++++++-----
M.profile | 2+-
M.tmux.conf | 4+++-
Minit/aur_pkgs.csv | 3++-
Minit/pacman_pkgs.csv | 18++++++++++--------
7 files changed, 53 insertions(+), 43 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -1,9 +1,5 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. - # If not running interactively, don't do anything -[ -z "$PS1" ] && return - -set -o vi +[[ $- != *i* ]] && return # don't put duplicate lines in the history, and ignore lines with leading space HISTCONTROL=ignoredups:ignorespace @@ -17,26 +13,33 @@ HISTFILESIZE=20000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. -shopt -s checkwinsize +[[ $DISPLAY ]] && shopt -s checkwinsize export CLICOLOR=1 export HISTTIMEFORMAT='%F %T ' -# shellcheck source=/home/ad/.commands.sh -. ~/.commands.sh # SC1019 - -right_prompt() { - rprompt=" $PWD" - [[ $rprompt/ = " $HOME"/* ]] && rprompt=\~${rprompt# $HOME} - [ ! "$USER" = "ad" ] && rprompt+=" \u" - [ ! "$HOSTNAME" = "idkfa" ] && rprompt+=" \h" - printf "%*s" $COLUMNS "$rprompt" -} -set_prompt() { - PS1="\n\[$(tput sc; right_prompt; tput rc)\]\$ " -} -# function to call before PS1 is displayed -PROMPT_COMMAND=set_prompt - -# shellcheck source=/home/ad/.fzf.bash +# Set prompt appearance +PS1="\n" +[ "$USER" != "ad" ] && PS+="\u@" +[ "$HOSTNAME" != "idkfa" ] && PS+="\h " +PS1+="\w\$ " + +case ${TERM} in + xterm*|rxvt*|Eterm|aterm|kterm|gnome*) + PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' + + ;; + screen*) + PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' + ;; +esac + +# shellcheck source=/dev/null +[ -r /usr/share/bash-completion/bash_completion ] && \ + . /usr/share/bash-completion/bash_completion + +# shellcheck source=/dev/null [ -f ~/.fzf.bash ] && source ~/.fzf.bash + +# shellcheck source=/dev/null +. ~/.commands.sh diff --git a/.commands.sh b/.commands.sh @@ -5,7 +5,7 @@ alias b='bash' alias z='zsh' -alias v='vim' +alias v='nvim' alias n='nnn' alias sx="sxiv -ft *" @@ -57,9 +57,6 @@ o() { fi } -## editor -alias vi='vim -u ~/.vim/vimrc.noplugs' - ## dotfiles alias zshreload="source ~/.zshrc" alias dotfiles="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME" diff --git a/.inputrc b/.inputrc @@ -1,18 +1,23 @@ +$include /etc/inputrc set editing-mode vi -set keymap vi -#set convert-meta on # vi settings $if mode=vi + set show-mode-in-prompt on - set vi-ins-mode-string - set vi-cmd-mode-string "\e[34;1m\+" + set vi-ins-mode-string "\1\e[6 q\2" + set vi-cmd-mode-string "\1\e[2 q\2" "jk": vi-movement-mode set keymap vi-command Control-l: clear-screen + Control-a: beginning-of-line + Control-p: previous-history + Control-n: next-history set keymap vi-insert Control-l: clear-screen + Control-a: beginning-of-line + Control-p: previous-history + Control-n: next-history $endif - diff --git a/.profile b/.profile @@ -1,6 +1,6 @@ # shellcheck source=/dev/null [ -f ~/.locale ] && . ~/.locale -export EDITOR="vim" +export EDITOR="nvim" export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export MAILDIR="$HOME/mail" diff --git a/.tmux.conf b/.tmux.conf @@ -21,7 +21,9 @@ bind , rename-window "" \; command-prompt "rename-window '%%'" #### APPEARANCE -set -g default-terminal "screen-256color" # use 256 colors +# set -g default-terminal "xterm-256color" # use 256 colors +# set -ga terminal-overrides ',xterm-256color:Tc' # fix escape sequences +set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' # fix escape sequences setw -g aggressive-resize on # resize window to smallest client set -g pane-border-style fg=7 # border color for inactive panes diff --git a/init/aur_pkgs.csv b/init/aur_pkgs.csv @@ -15,8 +15,9 @@ sent 1-4 shellcheck-static 0.6.0-1 signal-desktop-bin 1.24.1-4 task-spooler 1.0-2 -tor-browser 8.0.9-1 +tor-browser 8.5-1 ttf-emojione 4.5-1 +ttf-ms-fonts 2.0-10 ttf-symbola 12.00-1 urlview 0.9-12 wd719x-firmware 1-4 diff --git a/init/pacman_pkgs.csv b/init/pacman_pkgs.csv @@ -1,9 +1,10 @@ abcde 2.9.3-1 acpi 1.7-2 adobe-source-sans-pro-fonts 2.045ro+1.095it-1 -alsa-utils 1.1.8-1 +alsa-utils 1.1.9-1 arandr 0.1.10-3 arch-wiki-lite 20181022-1 +at 3.1.23-3 autoconf 2.69-5 automake 1.16.1-1 bind-tools 9.14.2-1 @@ -16,7 +17,7 @@ cmake 3.14.4-1 compton 6.2-2 cowsay 3.04-1 cronie 1.5.4-1 -ctags 1:r20181015+g45968eff-1 +ctags 1:r20190522+g3fdf28bc-1 dash 0.5.10.2-1 dopewars 1.5.12-10 dunst 1.4.0-1 @@ -25,12 +26,11 @@ entr 4.2-1 fakeroot 1.23-1 figlet 2.2.5-3 firejail 0.9.58.2-1 -flex 2.6.4-2 font-bh-ttf 1.0.3-4 fortune-mod 2.6.2-1 fzf 0.18.0-1 fzy 1.0-1 -gdb 8.2.1-3 +gdb 8.3-1 gimp 2.10.10-1 glances 3.1.0-1 gnu-netcat 0.7.1-7 @@ -51,10 +51,10 @@ ipython 7.5.0-1 jhead 3.03-1 julia 2:1.1.0-1 keynav 0.20110708.0-3 -libreoffice-fresh 6.2.3-2 +libreoffice-fresh 6.2.4-1 libvdpau-va-gl 0.4.2-2 licenses 20181104-1 -linux-headers 5.1.3.arch1-1 +linux-headers 5.1.4.arch1-1 logrotate 3.15.0-1 lshw B.02.18-3 lvm2 2.02.184-4 @@ -72,6 +72,7 @@ mpd 0.21.9-1 mutt 1.11.4-1 ncmpcpp 0.8.2-8 neofetch 6.0.0-1 +neovim 0.3.5-1 netctl 1.20-1 nethack 3.6.2-1 nethogs 0.8.5-3 @@ -81,8 +82,9 @@ nmap 7.70-3 notmuch 0.28.3-1 notmuch-mutt 0.28.3-1 ntp 4.2.8.p13-2 +obs-studio 23.1.0-1 offlineimap 7.2.3-1 -papirus-icon-theme 20190501-1 +papirus-icon-theme 20190521-1 paraview 5.6.0-5 pass 1.7.3-1 patch 2.7.6-7 @@ -134,7 +136,7 @@ vi 1:070224-3 weechat 2.4-1 which 2.21-3 wireless_tools 30.pre9-2 -wireshark-qt 3.0.1-1 +wireshark-qt 3.0.2-1 wkhtmltopdf 0.12.5-1 xautolock 2.2-5 xbindkeys 1.8.6-3