Sync from Windows

This commit is contained in:
js0ny 2025-02-13 01:28:55 +00:00
parent 1804960bfc
commit 73f008458a
8 changed files with 85 additions and 25 deletions

View file

@ -108,7 +108,8 @@ global g_ControlRepeatDetected := false
~*^F9::
~*^F10::
~*^F11::
~*^F12:: {
~*^F12::
{
global g_AbortSendEsc
g_AbortSendEsc := true
}

43
platforms/win/ahk/Tab.ahk Normal file
View file

@ -0,0 +1,43 @@
#Requires AutoHotkey v2.0
#SingleInstance Force
Tab Up:: Send '{Tab ' (A_PriorKey = 'Tab' ? 1 : times) '}'
Tab:: global times := ''
#HotIf GetKeyState('Tab', 'P')
h::Left
n::Down
e::Up
i::Right
H::Home
I::End
u::PgUp
d::PgDn
1::F1
2::F2
3::F3
4::F4
5::F5
6::F6
7::F7
8::F8
9::F9
0::F10
-::F11
=::F12
+:: global times .= ThisHotkey
#HotIf
Enter Up:: Send '{Enter ' (A_PriorKey = 'Enter' ? 1 : times) '}'
Enter:: global times := ''
#HotIf GetKeyState('Enter', 'P')
b:: {
Run("vivaldi.exe")
}
t:: {
Run("wezterm-gui.exe")
}
c:: {
Run("code.exe")
}

View file

@ -189,7 +189,7 @@ const mapLists = {
e: "k",
i: "l",
// l <-> i
l: "i",
l: "gi", // Focus on first input box by default
L: "I",
// k <-> n
k: "n",
@ -209,7 +209,7 @@ const mapLists = {
// gh/gi -> Prev/Next History
gh: "S",
gi: "D",
gl: "gi", // Focus on first input box
gl: "i", // Use `gl` to search and focus on input box
// t -> Open Link in New Tab
t: "gf",
// 缩放
@ -322,7 +322,7 @@ searchAliases.forEach(([alias, name, url]) => {
// #region Site-specific
// This is a global keymap
mapkey(",s", "[s]hare without parameter", function () {
mapkey("yY", "yank link without parameter", function () {
const url = new URL(window.location.href);
Clipboard.write(url.origin + url.pathname);
});
@ -359,11 +359,11 @@ mapkey(",e", "Edit last input", function () {
var btn = qs("div.ds-icon-button");
btn[btn.length - 5].click();
}, { domain: /chat.deepseek.com/ });
mapkey(",y", "Yank last oupput", function () {
mapkey(",y", "[y]ank last oupput", function () {
var btn = qs("div.ds-icon-button");
btn[btn.length - 4].click();
}, { domain: /chat.deepseek.com/ });
mapkey(",r", "Regenerate last output", function () {
mapkey(",r", "[r]egenerate last output", function () {
var btn = qs("div.ds-icon-button");
btn[btn.length - 3].click();
}, { domain: /chat.deepseek.com/ });
@ -425,7 +425,8 @@ mapkey(",p", "Switch to GitHub Page", function () {
repo = href.split("/")[4];
window.location.href = gh.pageLink(owner, repo);
}, { domain: /github.com/ });
mapkey(",r", "Copy short [r]efeference owner/repo", function () {
/// This might be useful for Vim plugins
mapkey(",y", "[y]ank short refeference owner/repo", function () {
const href = window.location.href;
owner = href.split("/")[3];
repo = href.split("/")[4];
@ -475,10 +476,7 @@ mapkey(",S", "Open Source in GitHub (New Page)", function () {
/**
* 0 - 网络
* 1 - 学术
* 2 - 数学
* 3 - 写作
* 4 - 视频
* 5 - 社交
* 2 - 社交
*/
const perplexityFocusOn = function (n) {
q("div.rounded-md").querySelectorAll("span")[1].click()
@ -492,7 +490,7 @@ mapkey(",b", "Add Perplexity [b]ookmark", function () {
q("div.sticky.left-0").querySelectorAll("button")[2].click()
}, { domain: /perplexity.ai/ });
mapkey(",w", "Toggle [w]riting/[w]eb Search", function () {
perplexityFocusOn(3);
perplexityFocusOn(0);
}, { domain: /perplexity.ai/ });
mapkey(",s", "[s]tart Generating", function () {
var btns = qs("span.grow button");
@ -502,7 +500,7 @@ mapkey(",y", "[y]ank Last Output", function () {
var toolbars = qs("div.mt-sm");
var last = toolbars[toolbars.length - 1];
var btns = last.querySelectorAll("button");
btns[4].click();
btns[5].click();
}, { domain: /perplexity.ai/ });
mapkey(",r", "Change model to [r]egenerate last output", function () {
var toolbars = qs("div.mt-sm");

View file

@ -20,4 +20,5 @@
;; Swap ; and :
(map! :leader
";" #'execute-extended-command
":" #'pp-eval-expression)
":" #'pp-eval-expression
"f h" #'consult-recent-file)

View file

@ -178,7 +178,7 @@
;;zig ; C, but simpler
:email
(mu4e +org +gmail)
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)

View file

@ -24,7 +24,7 @@
;;
(setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELLED(c@)")
(setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAIT(w@/!)" "|" "DONE(d@/!)" "CANCELLED(c@)")
(sequence "[ ](T)" "[-](P)" "[?](Q)" "|" "[X](D)")))
;; Keymaps
@ -40,7 +40,9 @@
(setq org-capture-templates
'(("t" "Task" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Tasks")
"* TODO %?\n %U\n %a\n %i"
:empty-lines 1)))
:empty-lines 1)
("n" "Note" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Notes"))
))
)
@ -64,3 +66,12 @@
:m "N" #'org-agenda-priority-up
:m "E" #'org-agenda-priority-down
:m "i" #'evil-forward-char)
;; (use-package! org-download
;; :after org
;; :custom
;; (setq org-download-screenshot-method
;; "pwsh.exe -File 'D:\\script.ps1'")
;; )

View file

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: unnumbered
# key: unnumbered
# --
:PROPERTIES:
:UNNUMBERED: t
:END:

View file

@ -1,4 +1,4 @@
local mode_arrow = { "n", "v", "s", "x" }
local mode_arrow = { "n", "v", "s", "x", "o" }
local keymaps_basic = { -- Modification of Original Keymap - Colemak
-- https://github.com/LazyVim/LazyVim/blob/d1529f650fdd89cb620258bdeca5ed7b558420c7/lua/lazyvim/config/keymaps.lua#L8
@ -56,17 +56,16 @@ local keymaps_basic = { -- Modification of Original Keymap - Colemak
{ mode = mode_arrow, keys = "i", cmd = "l", opts = { desc = "Right", silent = true } },
{ keys = "H", cmd = ":bprevious<CR>", opts = { desc = "Previous Buffer" } },
{ keys = "I", cmd = ":bnext<CR>", opts = { desc = "Next Buffer" } },
{ keys = "N", cmd = "5j", opts = { desc = "Up 5 Lines" } },
{ keys = "E", cmd = "5e", opts = { desc = "Down 5 Lines" } },
{ mode = mode_arrow, keys = "N", cmd = "5j", opts = { desc = "Up 5 Lines" } },
{ mode = mode_arrow, keys = "E", cmd = "5e", opts = { desc = "Down 5 Lines" } },
{ keys = "Y", cmd = "y$", opts = { desc = "Yank to End of Line" } },
{ keys = "E", cmd = "5k" },
-- Text object implementation
{ mode = { "n", "o", "x" }, keys = "l", cmd = "i", opts = { desc = "Insert" } },
{ keys = "L", cmd = "I", opts = { desc = "Insert at Start of Line" } },
{ keys = "k", cmd = "n", opts = { desc = "Next Search" } },
{ keys = "K", cmd = "N", opts = { desc = "Previous Search" } },
{ keys = "j", cmd = "e", opts = { desc = "jump to end of word" } },
{ keys = "J", cmd = "E", opts = { desc = "jump to end of WORD" } },
{ mode = mode_arrow, keys = "k", cmd = "n", opts = { desc = "Next Search" } },
{ mode = mode_arrow, keys = "K", cmd = "N", opts = { desc = "Previous Search" } },
{ mode = mode_arrow, keys = "j", cmd = "e", opts = { desc = "jump to end of word" } },
{ mode = mode_arrow, keys = "J", cmd = "E", opts = { desc = "jump to end of WORD" } },
-- https://github.com/LazyVim/LazyVim/blob/d1529f650fdd89cb620258bdeca5ed7b558420c7/lua/lazyvim/config/keymaps.lua#L60
{ keys = "<Esc>", cmd = "<Cmd>nohlsearch<Bar>diffupdate<CR>", opts = { desc = "Clear Search Highlight" } },
}