From 377bb20f357edcccb5958b2b4e7bfcaae176d646 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Wed, 23 Oct 2019 23:09:28 +0200 Subject: [PATCH 1/3] Resolve compatibility issues; Transition to fish --- .vim.zsh | 49 ------------------------------------------------- .zshrc | 12 ------------ 2 files changed, 61 deletions(-) delete mode 100644 .vim.zsh diff --git a/.vim.zsh b/.vim.zsh deleted file mode 100644 index 59de9a0..0000000 --- a/.vim.zsh +++ /dev/null @@ -1,49 +0,0 @@ -bindkey -v - -terminfo_down_sc=$terminfo[cud1]$terminfo[cud1]$terminfo[cuu1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1]$terminfo[cud1] -#terminfo_down_sc=$terminfo[cud1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1] - -function insert-mode () { echo "%S%F{cyan} -- INSERT -- %f%s" } -function normal-mode () { echo "%S%F{green} -- NORMAL -- %f%s" } - -precmd () { - PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %F{green}%~%f %(!.#.$) " -} - -function zle-keymap-select () { - VI_KEYMAP=$KEYMAP - - case ${VI_KEYMAP} in - (vicmd) VI_MODE="$(normal-mode)" ;; - (main|viins) VI_MODE="$(insert-mode)" ;; - (*) VI_MODE="$(insert-mode)" ;; - esac - - [[ -n "$VI_MODE_KEEP_CURSOR" ]] || if [[ "$VI_KEYMAP" == "vicmd" ]]; then - print -n '\e[1 q' - else - print -n '\e[5 q' - fi - - PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %B%F{cyan}%~%f%b %(!.#.$) " - - zle reset-prompt - zle -R -} - -function zle-line-init() { - zle -K viins -} - -preexec () { print -rn -- $terminfo[el]; } - -zle -N zle-line-init -zle -N zle-keymap-select - -function _vi_mode_reset_cursor() { - [[ -n "$VI_MODE_KEEP_CURSOR" ]] || print -n '\e[1 q' -} -autoload -U add-zsh-hook -add-zsh-hook preexec _vi_mode_reset_cursor - -export KEYTIMEOUT=1 diff --git a/.zshrc b/.zshrc index 239be3c..5aea3b8 100644 --- a/.zshrc +++ b/.zshrc @@ -24,12 +24,6 @@ function zle-keymap-select () { (*) VI_MODE="$(insert-mode)" ;; esac - [[ -n "$VI_MODE_KEEP_CURSOR" ]] || if [[ "$VI_KEYMAP" == "vicmd" ]]; then - print -n '\e[1 q' - else - print -n '\e[5 q' - fi - PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %B%F{cyan}%~%f%b %(!.#.$) " zle reset-prompt @@ -45,12 +39,6 @@ preexec () { print -rn -- $terminfo[el]; } zle -N zle-line-init zle -N zle-keymap-select -function _vi_mode_reset_cursor() { - [[ -n "$VI_MODE_KEEP_CURSOR" ]] || print -n '\e[1 q' -} -autoload -U add-zsh-hook -add-zsh-hook preexec _vi_mode_reset_cursor - export KEYTIMEOUT=1 alias ll='ls -alF' From 059a3b9f27e37511e9aa158eb9e1432ebd7d4ab1 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Wed, 23 Oct 2019 23:10:42 +0200 Subject: [PATCH 2/3] Update bashrc for compatibility reasons --- .bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bashrc b/.bashrc index ae6e393..45a795e 100644 --- a/.bashrc +++ b/.bashrc @@ -118,6 +118,7 @@ fi export SSH_AUTH_SOCK="$(gpgconf --list-dir socketdir)/S.gpg-agent.ssh" export GPG_TTY=$(tty) +gpg-connect-agent updatestartuptty /bye export EDITOR=nvim export TERMINAL=gnome-terminal From 3de13fc2bc4c0f2bf0c0e13686425e072cb3dcff Mon Sep 17 00:00:00 2001 From: DustVoice Date: Thu, 24 Oct 2019 00:48:10 +0200 Subject: [PATCH 3/3] Complete 'compatibility' scripts and transition to fish! --- .bash_aliases | 2 +- .config/fish/config.fish | 17 ++++++++++++ .config/fish/fish_variables | 36 +++++++++++++++++++++++++ .config/fish/functions/fish_prompt.fish | 13 +++++++++ .config/fish/functions/l.fish | 3 +++ .config/fish/functions/la.fish | 3 +++ .config/fish/functions/ll.fish | 3 +++ .zshrc | 2 +- 8 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 .config/fish/config.fish create mode 100644 .config/fish/fish_variables create mode 100644 .config/fish/functions/fish_prompt.fish create mode 100644 .config/fish/functions/l.fish create mode 100644 .config/fish/functions/la.fish create mode 100644 .config/fish/functions/ll.fish diff --git a/.bash_aliases b/.bash_aliases index d78c3bd..28f166f 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,5 +1,5 @@ # some more ls aliases -alias ll='ls -alF' +alias ll='ls -alhF' alias la='ls -A' alias l='ls -CF' diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..51ac5a4 --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,17 @@ +set fish_prompt_pwd_dir_length 0 + +set -x SSH_AUTH_SOCK (gpgconf --list-dir socketdir)'/S.gpg-agent.ssh' +set -x GPG_TTY (tty) +gpg-connect-agent updatestartuptty /bye > /dev/null + +set -x EDITOR 'nvim' +set -x TERMINAL 'gnome-terminal' + +set -x PATH "$HOME/bin" "$HOME/.local/bin" "$HOME/JUCE" $PATH +set -x JUCE_PATH "$HOME/JUCE" +set -x FRUT_PATH "$HOME/FRUT" + +set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH +set -x CXXFLAGS '-std=c++14' + +set -x LIBGL_ALWAYS_INDIRECT 1 diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables new file mode 100644 index 0000000..4625d8f --- /dev/null +++ b/.config/fish/fish_variables @@ -0,0 +1,36 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_init_2_39_8:\x1d +SETUVAR __fish_init_2_3_0:\x1d +SETUVAR __fish_init_3_x:\x1d +SETUVAR fish_color_autosuggestion:969896 +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:b294bb +SETUVAR fish_color_comment:f0c674 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:b294bb +SETUVAR fish_color_error:cc6666 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:81a2be +SETUVAR fish_color_quote:b5bd68 +SETUVAR fish_color_redirection:8abeb7 +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_cursor_default:block +SETUVAR fish_cursor_insert:line +SETUVAR fish_cursor_replace_one:underscore +SETUVAR fish_greeting: +SETUVAR fish_key_bindings:fish_vi_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..9e8ef5f --- /dev/null +++ b/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,13 @@ +function fish_prompt --description 'Write out the prompt' + if test (id -u) -eq 0 + set prompt_symbol '#' + else + set prompt_symbol '$' + end + + if test -z $WINDOW + printf '%s%s@%s%s %s%s%s %s ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color green) (prompt_pwd) (set_color normal) $prompt_symbol + else + printf '%s%s@%s%s%s (%s)%s%s%s %s ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color white) (echo $WINDOW) (set_color green) (prompt_pwd) (set_color normal) $prompt_symbol + end +end diff --git a/.config/fish/functions/l.fish b/.config/fish/functions/l.fish new file mode 100644 index 0000000..e1c7d5c --- /dev/null +++ b/.config/fish/functions/l.fish @@ -0,0 +1,3 @@ +function l + ls -CF $argv +end diff --git a/.config/fish/functions/la.fish b/.config/fish/functions/la.fish new file mode 100644 index 0000000..000833e --- /dev/null +++ b/.config/fish/functions/la.fish @@ -0,0 +1,3 @@ +function la + ls -A $argv +end diff --git a/.config/fish/functions/ll.fish b/.config/fish/functions/ll.fish new file mode 100644 index 0000000..4a69023 --- /dev/null +++ b/.config/fish/functions/ll.fish @@ -0,0 +1,3 @@ +function ll + ls -alhF $argv +end diff --git a/.zshrc b/.zshrc index 5aea3b8..0097200 100644 --- a/.zshrc +++ b/.zshrc @@ -41,7 +41,7 @@ zle -N zle-keymap-select export KEYTIMEOUT=1 -alias ll='ls -alF' +alias ll='ls -alhF' alias la='ls -A' alias l='ls -CF'