summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/common.nix9
-rw-r--r--lib/pythonrc15
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/common.nix b/lib/common.nix
index 24e53e0..99cdbd8 100644
--- a/lib/common.nix
+++ b/lib/common.nix
@@ -18,6 +18,7 @@ in
LEDGER_FILE = "${homedir}/.hledger.journal";
XTERM_LOCALE = locale;
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
+ PYTHONSTARTUP = "${homedir}/.pythonrc";
};
# From the command line:
@@ -33,6 +34,14 @@ in
source = ./hledger.journal;
target = ".hledger.journal";
};
+ pythonrc = {
+ source = ./pythonrc;
+ target = ".pythonrc";
+ };
+ pdbrc = {
+ source = ./pythonrc;
+ target = ".pdbrc";
+ };
};
};
diff --git a/lib/pythonrc b/lib/pythonrc
new file mode 100644
index 0000000..ec59d2b
--- /dev/null
+++ b/lib/pythonrc
@@ -0,0 +1,15 @@
+import os
+import pdb
+import pprint
+import rlcompleter, readline
+import sys
+
+# enable tab completion
+readline.parse_and_bind("tab: complete")
+
+# also get tab completion in pdb
+pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
+
+# prettyprint with p()
+pp = pprint.PrettyPrinter(indent=4, width=80)
+p = pp.pprint