From a929bde64b4cbfb15e6352b78f61d6fd53c5e9cc Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Mon, 6 Jun 2022 13:13:15 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 + buildenv.sh | 88 ++++++++++++++++++++++++++++++++++++++ config_in/activate.sh | 13 ++++++ config_in/fish/config.fish | 19 ++++++++ config_in/nvim/init.vim | 14 ++++++ config_in/omf/bundle | 2 + config_in/omf/channel | 1 + config_in/omf/theme | 1 + 8 files changed, 140 insertions(+) create mode 100644 .gitignore create mode 100755 buildenv.sh create mode 100755 config_in/activate.sh create mode 100644 config_in/fish/config.fish create mode 100644 config_in/nvim/init.vim create mode 100644 config_in/omf/bundle create mode 100644 config_in/omf/channel create mode 100644 config_in/omf/theme diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d0b1c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.mbenv +/mbenv.tar.xz diff --git a/buildenv.sh b/buildenv.sh new file mode 100755 index 0000000..f16e5be --- /dev/null +++ b/buildenv.sh @@ -0,0 +1,88 @@ +#/bin/bash + +# Folder definitions +BASE=$(pwd) +export CONFIG_IN=$(pwd)/config_in +export MB_ENV_BASE=$(pwd)/.mbenv +export INSTALL_TMP_DIR=$(pwd)/tmp_install + +export XDG_CONFIG_HOME=${MB_ENV_BASE}/config +export XDG_DATA_HOME=${MB_ENV_BASE}/local/share + +# create folders +mkdir $MB_ENV_BASE +mkdir $INSTALL_TMP_DIR +mkdir $XDG_CONFIG_HOME +mkdir -p $XDG_DATA_HOME + + +# ------------------------------------------- fish shell ----------------------------------------------------------- + +# portable fish: https://github.com/xxh/fish-portable +cd $MB_ENV_BASE +PORTABLE_FISH=https://github.com/xxh/fish-portable/releases/download/3.4.1/fish-portable-musl-alpine-Linux-x86_64.tar.gz +curl -L $PORTABLE_FISH | tar xz +cp -r ${CONFIG_IN}/fish ${XDG_CONFIG_HOME} + +# ------------------------------------------- oh my fish ----------------------------------------------------------- + +export OMF_CHANNEL=stable +export OMF_PATH=$XDG_DATA_HOME/omf +export OMF_CONFIG=$XDG_CONFIG_HOME/omf +FISH_EXE=${MB_ENV_BASE}/bin/fish + +cp -r ${CONFIG_IN}/omf ${XDG_CONFIG_HOME} +cd $INSTALL_TMP_DIR +curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install > install_omf +${FISH_EXE} install_omf --noninteractive +${FISH_EXE} -c "omf install" + + +# ------------------------------------------- bat ----------------------------------------------------------- + +cd ${INSTALL_TMP_DIR} +curl -L https://github.com/sharkdp/bat/releases/download/v0.21.0/bat-v0.21.0-x86_64-unknown-linux-musl.tar.gz | tar xz +cd bat* +cp bat ${MB_ENV_BASE}/bin +mkdir $XDG_CONFIG_HOME/fish/completions +cp autocomplete/bat.fish $XDG_CONFIG_HOME/fish/completions/bat.fish + +# -------------------------------------------- vim --------------------------------------------------------------- + +#curl -L https://github.com/dtschan/vim-static/releases/download/v8.1.1045/vim > $MB_ENV_BASE/bin/vim +#chmod u+x $MB_ENV_BASE/bin/vim +#mkdir $XDG_CONFIG_HOME/vim +#cp ${CONFIG_IN}/.vimrc $XDG_CONFIG_HOME/vim/vimrc +#curl -fLo $XDG_CONFIG_HOME/vim/autoload/plug.vim --create-dirs \ +# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + + +cd ${INSTALL_TMP_DIR} +curl -L https://github.com/neovim/neovim/releases/download/v0.7.0/nvim.appimage > nvim.appimage +chmod u+x nvim.appimage +./nvim.appimage --appimage-extract +cd squashfs-root/usr +cp ./bin/* ${MB_ENV_BASE}/bin/ +cp -r ./lib/* ${MB_ENV_BASE}/lib/ +cp -r ./share/nvim ${MB_ENV_BASE}/share/ +cp -r ${CONFIG_IN}/nvim ${XDG_CONFIG_HOME} + +curl -fLo "${XDG_DATA_HOME}"/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + +cd ${MB_ENV_BASE} +ln -s nvim vi +ln -s nvim vim + + +# ------------------------------------------- configs ----------------------------------------------------------- + +cp ${CONFIG_IN}/activate.sh $MB_ENV_BASE # activation script + + +# ------------------------------------------- pack and cleanup ---------------------------------------------------- + +cd $BASE +tar -cJf mbenv.tar.xz .mbenv +rm -rf ${MB_ENV_BASE} +rm -rf ${INSTALL_TMP_DIR} \ No newline at end of file diff --git a/config_in/activate.sh b/config_in/activate.sh new file mode 100755 index 0000000..e8782f9 --- /dev/null +++ b/config_in/activate.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export MB_ENV_BASE=$(pwd) + +export XDG_CONFIG_HOME=${MB_ENV_BASE}/config +export XDG_DATA_HOME=${MB_ENV_BASE}/local/share +export PATH=${MB_ENV_BASE}/bin:${PATH} +export TERM=xterm-256color + + + + +${MB_ENV_BASE}/bin/fish.sh diff --git a/config_in/fish/config.fish b/config_in/fish/config.fish new file mode 100644 index 0000000..c70d14c --- /dev/null +++ b/config_in/fish/config.fish @@ -0,0 +1,19 @@ +if status is-interactive + # Commands to run in interactive sessions can go here +end + +function fish_user_key_bindings + for mode in insert default visual + bind -M $mode \cf forward-char + end + bind -M insert jk "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end" +end + +set -x VIRTUAL_ENV_DISABLE_PROMPT 1 + +set -x theme_color_scheme nord +set -x theme_nerd_fonts yes +set -x fish_prompt_pwd_dir_length 0 + +fish_vi_key_bindings +fish_user_key_bindings \ No newline at end of file diff --git a/config_in/nvim/init.vim b/config_in/nvim/init.vim new file mode 100644 index 0000000..253fe70 --- /dev/null +++ b/config_in/nvim/init.vim @@ -0,0 +1,14 @@ +" goto normal mode with jk +inoremap jk + +" remove search highlighting when pressing esc +map :noh + + + +" --------- Plugins ---------- +call plug#begin() + +Plug 'justinmk/vim-sneak' + +call plug#end() \ No newline at end of file diff --git a/config_in/omf/bundle b/config_in/omf/bundle new file mode 100644 index 0000000..abef50c --- /dev/null +++ b/config_in/omf/bundle @@ -0,0 +1,2 @@ +theme bobthefish +theme default diff --git a/config_in/omf/channel b/config_in/omf/channel new file mode 100644 index 0000000..2bf5ad0 --- /dev/null +++ b/config_in/omf/channel @@ -0,0 +1 @@ +stable diff --git a/config_in/omf/theme b/config_in/omf/theme new file mode 100644 index 0000000..ff8a58d --- /dev/null +++ b/config_in/omf/theme @@ -0,0 +1 @@ +bobthefish