Skip to content

Commit

Permalink
Update rc_awesome.xsh
Browse files Browse the repository at this point in the history
  • Loading branch information
anki-code authored Feb 23, 2024
1 parent c4eeb79 commit 3b37c81
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xontrib/rc_awesome.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b37c81

Please sign in to comment.