Skip to content

Commit

Permalink
feat(mac): 和 win 键位对齐
Browse files Browse the repository at this point in the history
  • Loading branch information
shaddollxz committed Jan 1, 2024
1 parent 158a400 commit ad0536b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
17 changes: 17 additions & 0 deletions mac/main.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
;; 这里的配置每个模块都通用(因为最后都会被集成为一个文件)

;; 辅助键:
;; ! | means mandatory
;; # | means optional
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
;; E | right_option
;; R | right_shift
;; P | caps_lock
;; !! | mandatory command + control + optional + shift (hyper)
;; ## | optional any

;; 通过 osascript -e 'id of app "AppName"' 命令获得 app 的标识
{:applications {:browser ["^org\\.mozilla\\.firefox$" "^com\\.google\\.Chrome$" "^com\\.microsoft\\.edgemac$" "^com\\.apple\\.Safari$"]
:vscode ["^com\\.microsoft\\.VSCode$"]}
Expand Down
7 changes: 2 additions & 5 deletions mac/modules/mode-3.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
[:i :8 ["three_mode" 1]] ;; 8
[:o :8 ["three_mode" 1]] ;; 8
[:p :9 ["three_mode" 1]] ;; 9
[:h :0 ["three_mode" 1]] ;; 0
[:j :4 ["three_mode" 1]] ;; 4
[:h :4 ["three_mode" 1]] ;; 4
[:k :5 ["three_mode" 1]] ;; 5
[:l :6 ["three_mode" 1]] ;; 6
[:b :1 ["three_mode" 1]] ;; 1
[:n :2 ["three_mode" 1]] ;; 2
[:n :1 ["three_mode" 1]] ;; 1
[:m :2 ["three_mode" 1]] ;; 2
[:comma :3 ["three_mode" 1]] ;; 3
[:period :3 ["three_mode" 1]] ;; 3
[:spacebar :0 ["three_mode" 1]] ;; 0
[:r :!Fdelete_or_backspace ["three_mode" 1]] ;; delete
[:q :delete_or_backspace ["three_mode" 1]] ;; backspace
[:1 :delete_or_backspace ["three_mode" 1]] ;; backspace
]}
6 changes: 5 additions & 1 deletion mac/modules/mode-9.edn
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@
[:c [:!Cc ["nine_mode_sub_space" 0]] ["nine_mode" 1]]
[:v [:!Cv ["nine_mode_sub_space" 0]] ["nine_mode" 1]]
[:z [:!Cz ["nine_mode_sub_space" 0]] ["nine_mode" 1]]
[:y [:!Cs ["nine_mode_sub_space" 0]] ["nine_mode" 1]]]}

;; 展开收起代码块 按住 caps 是展开,不按住是收起
[:h :!COopen_bracket [:vscode ["nine_mode" 1] ["nine_mode_sub_caps" 0]]] ;; 收起代码块
[:h :!COclose_bracket [:vscode ["nine_mode" 1] ["nine_mode_sub_caps" 1]]] ;; 展开代码块
]}
2 changes: 2 additions & 0 deletions mac/modules/mode-caps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
;; vscode 中的场景
[:x :!Thyphen [:vscode ["caps_mode" 1]]] ;; 返回 ctrl + -
[:z :!SThyphen [:vscode ["caps_mode" 1]]] ;; 前进 shift + ctrl + -
[:j [:!Ck :!Cleft_arrow] [:vscode ["caps_mode" 1]]] ;; 分栏切换到左侧
[:l [:!Ck :!Cright_arrow] [:vscode ["caps_mode" 1]]] ;; 分栏切换到右侧
;; 有标签页的场景
[:c :!Cw ["caps_mode" 1]] ;; 关闭标签页
[:b :!CSt ["caps_mode" 1]] ;; 重新打开标签页
Expand Down

0 comments on commit ad0536b

Please sign in to comment.