diff --git a/bin/install.sh b/bin/install.sh old mode 100644 new mode 100755 index 0f10909..bf53e3b --- a/bin/install.sh +++ b/bin/install.sh @@ -1,12 +1,22 @@ -#!/usr/bin/fish +#!/usr/bin/bash +set -eu -# test working directory +# ========================================================= +# check executing location +# ========================================================= +if [ ! -d "bin" -a ! -d "dotfiles" ]; then + echo "Wrong execution location" + echo "Please run this script on dotfiles root folder." + exit 1 +fi -# symlink -#ln -s ~/.config/fish/config.fish dotfiles/fish/config.fish -cp ~/.config/fish/config.fish (pwd)/dotfiles/fish/config.fish -ln -sf (pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish -ln -sf (pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml -ln -sf (pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua -ln -sf (pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua +# ========================================================= +# links +# ========================================================= +ln -sf $(pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish +ln -sf $(pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml +ln -sf $(pwd)/dotfiles/tmux.conf ~/.tmux.conf + +ln -sf $(pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua +ln -sf $(pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua \ No newline at end of file diff --git a/bin/install_ubuntu.sh b/bin/install_ubuntu.sh new file mode 100644 index 0000000..b11fb91 --- /dev/null +++ b/bin/install_ubuntu.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash -euo + diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 30155a4..590b7dd 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -19,10 +19,29 @@ if status is-interactive source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true end +# starship +starship init fish | source + +function set_win_title + echo -ne "\033]0; (basename "$PWD") \007" +end +set starship_precmd_uesr_func "set_win_title" + +# keychain +set -x SHELL fish +keychain --eval --quiet -Q id_rsa, id_ed25519 | source +set -x SHELL bash + +# opam +# source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true +opam env --shell fish | source # key bindings bind \b backward-kill-word + +# env +set -x LESS '-i -r -M -R -S -W -z-4 -x4' # save fish log to my custom file set -gx my_fish_history "$HOME/my_fish_history.txt" function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_fish_history" diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 2b5eea2..4a085fb 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -1,3 +1,4 @@ +--print("init.lua loaded") ----------------------------------------------------------- -- basic configurations vim.o.number = true