From 11ec2cb4c4ca290c71517867ad9369562078b094 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 24 May 2020 13:57:05 +0100 Subject: Add python configuration --- python/rc | 12 ++++++++++++ zsh/rc | 1 + 2 files changed, 13 insertions(+) create mode 100644 python/rc diff --git a/python/rc b/python/rc new file mode 100644 index 0000000..cb560be --- /dev/null +++ b/python/rc @@ -0,0 +1,12 @@ +# -*- mode: python -*- + +import atexit +import os +import readline + +history_file = os.path.join(os.getenv('XDG_CACHE_HOME'), 'python_history') +if os.path.exists(history_file): + readline.read_history_file(history_file) +readline.set_history_length(1000) +atexit.register(readline.write_history_file, history_file) +del atexit, history_file, os, readline diff --git a/zsh/rc b/zsh/rc index 7b46e61..04fc7fe 100644 --- a/zsh/rc +++ b/zsh/rc @@ -43,6 +43,7 @@ bindkey -e bindkey "^R" history-incremental-search-backward export EDITOR=vim +export PYTHONSTARTUP=${XDG_CONFIG_HOME}/python/rc export VISUAL=${EDITOR} setopt AUTO_CD -- cgit v1.2.3-70-g09d2