Skip to content

Commit d475127

Browse files
committed
feat: Add case-sensitive search option for tmux easymotion
1 parent 9a16b45 commit d475127

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ set -g @easymotion-debug 'false'
3737

3838
# Performance logging - writes timing info to ~/easymotion.log (default: false)
3939
set -g @easymotion-perf 'false'
40+
41+
# Case sensitive search (default: false)
42+
set -g @easymotion-case-sensitive 'false'
4043
```
4144

4245

easymotion.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# Configuration from environment
1616
HINTS = os.environ.get('TMUX_EASYMOTION_HINTS', 'asdfghjkl;')
17+
CASE_SENSITIVE = os.environ.get('TMUX_EASYMOTION_CASE_SENSITIVE', 'false').lower() == 'true'
1718
VERTICAL_BORDER = os.environ.get('TMUX_EASYMOTION_VERTICAL_BORDER', '│')
1819
HORIZONTAL_BORDER = os.environ.get('TMUX_EASYMOTION_HORIZONTAL_BORDER', '─')
1920
USE_CURSES = os.environ.get(
@@ -491,7 +492,10 @@ def find_matches(panes, search_ch):
491492
# Search each position in the line
492493
pos = 0
493494
while pos < len(line):
494-
idx = line.lower().find(search_ch.lower(), pos)
495+
if CASE_SENSITIVE:
496+
idx = line.find(search_ch, pos)
497+
else:
498+
idx = line.lower().find(search_ch.lower(), pos)
495499
if idx == -1:
496500
break
497501

easymotion.tmux

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ HORIZONTAL_BORDER=$(get_tmux_option "@easymotion-horizontal-border" "─")
2020
USE_CURSES=$(get_tmux_option "@easymotion-use-curses" "false")
2121
DEBUG=$(get_tmux_option "@easymotion-debug" "false")
2222
PERF=$(get_tmux_option "@easymotion-perf" "false")
23+
CASE_SENSITIVE=$(get_tmux_option "@easymotion-case-sensitive" "false")
2324

2425
# Execute Python script with environment variables
2526
tmux bind $(get_tmux_option "@easymotion-key" "s") run-shell "TMUX_EASYMOTION_HINTS='$HINTS' \
@@ -28,4 +29,5 @@ tmux bind $(get_tmux_option "@easymotion-key" "s") run-shell "TMUX_EASYMOTION_HI
2829
TMUX_EASYMOTION_USE_CURSES='$USE_CURSES' \
2930
TMUX_EASYMOTION_DEBUG='$DEBUG' \
3031
TMUX_EASYMOTION_PERF='$PERF' \
32+
TMUX_EASYMOTION_CASE_SENSITIVE='$CASE_SENSITIVE' \
3133
$CURRENT_DIR/easymotion.py"

0 commit comments

Comments
 (0)