From 3b8ce96db13a80091ca541d8e50cebb93e41f88c Mon Sep 17 00:00:00 2001 From: Samuel Ortion Date: Thu, 10 Aug 2023 19:45:10 +0200 Subject: [PATCH] feat: Switch to emacs as main editor --- .aliases | 15 ++++++++++++--- .loadenv.sh | 21 +++++++++++---------- Makefile | 11 ++++++++--- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.aliases b/.aliases index 53fa1ce..a79895d 100644 --- a/.aliases +++ b/.aliases @@ -2,20 +2,29 @@ alias o="evince2" alias pro="cd ~/Documents/Projects" alias doc="cd ~/Documents" -alias vim="nvim" alias activenv="mamba activate hic2023py3.11" -alias int="cd ~/Documents/cours/licence/L3/stage/pasteur/project/" +alias int="cd ~/Documents/cours/licence/L3/stage/pasteur/projects/" +alias blog="cd ~/Documents/Projects/myself/log/" + +# Print field name from header with the field rank +csv_fields() { + local delimiter + delimiter="${2:-\t}" + local file + file="${1}" + head -n 1 "${file}" | tr "${delimiter}" "\n" | awk '{print NR, $0}' +} export templates_dir="~/Documents/Projects/templates" alias new.td='copier "$templates_dir/latex/td.template"' alias new.cm='copier "$templates_dir/latex/cm.template"' alias new.letter='copier "$templates_dir/latex/letter.template"' -alias taquin.sync="rsync -azvu '/home/sortion/Documents/cours/licence/L3/S6/intelligence artificielle/DM/DM2/taquin/' leon.talpa:/home/sortion/Documents/Projects/taquin/ && rsync -azvu leon.talpa:/home/sortion/Documents/Projects/taquin/ '/home/sortion/Documents/cours/licence/L3/S6/intelligence artificielle/DM/DM2/taquin/'" pdfcompress () { gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile="$2" "$1"; } colorinvert() { convert "$1" -channel RGB -negate "$(echo $1 | sed 's/\./-inv\./')" + } diff --git a/.loadenv.sh b/.loadenv.sh index 7853988..efeb62e 100644 --- a/.loadenv.sh +++ b/.loadenv.sh @@ -1,8 +1,9 @@ -export LUA_PATH='/usr/share/lua/5.4/?.lua;/usr/share/lua/5.4/?/init.lua;/usr/lib64/lua/5.4/?.lua;/usr/lib64/lua/5.4/?/init.lua;./?.lua;./?/init.lua;/home/sortion/.luarocks/share/lua/5.4/?.lua;/home/sortion/.luarocks/share/lua/5.4/?/init.lua' -export LUA_CPATH='/usr/lib64/lua/5.4/?.so;/usr/lib64/lua/5.4/loadall.so;./?.so;/home/sortion/.luarocks/lib/lua/5.4/?.so;/usr/lib/lua/5.4/?.so' -export PATH='/home/sortion/.luarocks/bin:/home/sortion/.julia/bin:/home/sortion/.nvm/versions/node/v17.9.1/bin:/home/sortion/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/opt/quarto-1.3.433/bin:/home/sortion/.local/bin:/home/sortion/bin:/home/sortion/.antigen/bundles/robbyrussell/oh-my-zsh/lib:/home/sortion/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/sortion/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/home/sortion/Documents/cours/tools/bin/:/usr/games/' +export PATH="/home/$USER/.luarocks/bin:/home/$USER/.julia/bin:/home/$USER/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/$USER/.local/bin:/home/$USER/bin:/home/$USER/Documents/cours/tools/bin/:/usr/games/:/home/$USER/.config/emacs/bin/" -export EDITOR=vim +# export EDITOR=vim +export ALTERNATE_EDITOR="" +export EDITOR="emacsclient -t" # $EDITOR opens in terminal +export VISUAL="emacsclient -c -a emacs" # $VISUAL opens in GUI mode # nvm export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" @@ -19,19 +20,19 @@ eval $(thefuck --alias) # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/home/sortion/.local/share/mambaforge/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)" +__conda_setup="$('/home/$USER/.local/share/mambaforge/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else - if [ -f "/home/sortion/.local/share/mambaforge/etc/profile.d/conda.sh" ]; then - . "/home/sortion/.local/share/mambaforge/etc/profile.d/conda.sh" + if [ -f "/home/$USER/.local/share/mambaforge/etc/profile.d/conda.sh" ]; then + . "/home/$USER/.local/share/mambaforge/etc/profile.d/conda.sh" else - export PATH="/home/sortion/.local/share/mambaforge/bin:$PATH" + export PATH="/home/$USER/.local/share/mambaforge/bin:$PATH" fi fi unset __conda_setup -if [ -f "/home/sortion/.local/share/mambaforge/etc/profile.d/mamba.sh" ]; then - . "/home/sortion/.local/share/mambaforge/etc/profile.d/mamba.sh" +if [ -f "/home/$USER/.local/share/mambaforge/etc/profile.d/mamba.sh" ]; then + . "/home/$USER/.local/share/mambaforge/etc/profile.d/mamba.sh" fi # <<< conda initialize <<< diff --git a/Makefile b/Makefile index ac9e125..6dfd420 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ all: pull install pull: git pull -install: antigen source fish +install: antigen source emacs nvim -source: fishcfg +source: fish cp ~/.dotfiles/.aliases ~/.aliases cp ~/.dotfiles/.zshrc ~/.zshrc cp ~/.dotfiles/.loadenv.sh ~/.loadenv.sh @@ -13,13 +13,18 @@ source: fishcfg cp ~/.dotfiles/.gitconfig ~/.gitconfig cp ~/.dotfiles/.latexmkrc ~/.latexmkrc -fishcfg: + +fish: mkdir -p ~/.config/fish cp ./.config/fish/config.fish ~/.config/fish/config.fish cp ./.aliases.fish ~/.aliases.fish cp ./.config/starship.toml ~/.config/starship.toml nvim: + git clone ssh://gitea@forge.chapril.org:222/sortion/nvim.conf ~/.config/nvim/ + +emacs: + git clone ssh://gitea@forge.chapril.org:222/sortion/.emacs.d.git ~/.emacs.d/ antigen: git clone https://github.com/zsh-users/antigen.git