From 3b37c8194ea7a630b0e1e8a74e2420f3a6d870a4 Mon Sep 17 00:00:00 2001 From: Andy Kipp Date: Fri, 23 Feb 2024 14:17:47 +0100 Subject: [PATCH] Update rc_awesome.xsh --- xontrib/rc_awesome.xsh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xontrib/rc_awesome.xsh b/xontrib/rc_awesome.xsh index 71a779d..0d7f008 100644 --- a/xontrib/rc_awesome.xsh +++ b/xontrib/rc_awesome.xsh @@ -244,10 +244,14 @@ if ON_LINUX or ON_DARWIN: # Example of history search alias for sqlite history backend - # You can use it ordinarily: `history-search "cd /"` - # Or as a macro call: `history-search! cd /` - aliases['history-search'] = """sqlite3 $XONSH_HISTORY_FILE @("SELECT inp FROM xonsh_history WHERE inp LIKE '%" + $arg0 + "%' AND inp NOT LIKE 'history-%' ORDER BY tsb DESC LIMIT 10");""" - + # You can use it ordinarily: `hs "cd /"` + # Or as a macro call: `hs! cd /` + aliases |= { + # history search + 'hs': """sqlite3 $XONSH_HISTORY_FILE @("SELECT inp FROM xonsh_history WHERE inp LIKE '%" + $arg0 + "%' AND inp NOT LIKE 'history-%' ORDER BY tsb DESC LIMIT 10");""", + # history in dir + 'hd': """sqlite3 $XONSH_HISTORY_FILE @(f"SELECT inp FROM xonsh_history WHERE cwd LIKE '%{$PWD}%' AND inp NOT LIKE 'history-%' ORDER BY tsb DESC LIMIT 10");""", + } # # Example of binding the hotkeys - https://xon.sh/tutorial_ptk.html