mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
Sync: from windows
This commit is contained in:
parent
2fa5801448
commit
485d7eada5
10 changed files with 722 additions and 540 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -42,3 +42,5 @@ tools/nushell/
|
|||
.venv/
|
||||
|
||||
platforms/win/komorebi/applications.json
|
||||
|
||||
gitconfig
|
||||
|
|
|
|||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -11,6 +11,7 @@
|
|||
"pip.conf": "python-misc",
|
||||
"*.kdl": "json",
|
||||
"gitconfig": "git",
|
||||
"gitconfig.example": "git",
|
||||
"nvim/init.lua": "vim",
|
||||
"markdownlint.json": "markdownlint",
|
||||
"wslconfig": "settings",
|
||||
|
|
|
|||
|
|
@ -2,30 +2,30 @@
|
|||
# Date: 2024-12-01
|
||||
# Author: js0ny
|
||||
# Set symlinks for dotfiles on Windows
|
||||
# 在 Windows 上设置 dotfiles 的符号链接
|
||||
# 在 Windows 上设置 配置文件的符号链接
|
||||
|
||||
$DOTFILES = Join-Path $env:UserProfile ".dotfiles"
|
||||
$DOTFILES = Join-Path $Env:UserProfile ".dotfiles"
|
||||
$BASE_COMMON = Join-Path $DOTFILES "common"
|
||||
$BASE_TOOLS = Join-Path $DOTFILES "tools"
|
||||
$BASE_WIN = Join-Path $DOTFILES "platforms" "win"
|
||||
$linkDots = @{
|
||||
"$BASE_WIN\wslconfig" = "$env:UserProfile\.wslconfig"
|
||||
"$BASE_WIN\wslconfig" = "$Env:UserProfile\.wslconfig"
|
||||
"$BASE_WIN\neovide.toml" = "$Env:AppData\neovide\config.toml"
|
||||
"$BASE_WIN\vsvimrc" = "$Env:Vim\.vsvimrc"
|
||||
"$BASE_WIN\komorebi" = "$env:KOMOREBI_CONFIG_HOME"
|
||||
"$BASE_COMMON\condarc.yaml" = "$env:XDG_CONFIG_HOME\conda\.condarc"
|
||||
"$BASE_COMMON\gitconfig" = "$env:UserProfile\.gitconfig"
|
||||
"$BASE_COMMON\glow.yaml" = "$env:AppData\glow\glow.yml"
|
||||
"$BASE_COMMON\haskeline" = "$env:UserProfile\.haskeline"
|
||||
"$BASE_COMMON\ideavimrc" = "$env:XDG_CONFIG_HOME\ideavim\ideavimrc"
|
||||
"$BASE_COMMON\lesskey" = "$env:LessKeyIn"
|
||||
"$BASE_COMMON\npmrc" = "$env:NPM_CONFIG_USERCONFIG"
|
||||
"$BASE_COMMON\NuGet.Config" = "$env:AppData\NuGet\NuGet.Config"
|
||||
"$BASE_COMMON\obsidian.vimrc" = "$env:UserProfile\Obsidian\.obsidian.vimrc"
|
||||
"$BASE_COMMON\pip.conf" = "$env:AppData\pip\pip.ini"
|
||||
"$BASE_COMMON\vimrc" = "$env:Vim\_vimrc"
|
||||
"$BASE_TOOLS\ipython" = "$env:IPYTHONDIR"
|
||||
"$BASE_TOOLS\nvim" = "$env:XDG_CONFIG_HOME\nvim"
|
||||
"$BASE_WIN\komorebi" = "$Env:KOMOREBI_CONFIG_HOME"
|
||||
"$BASE_COMMON\condarc.yaml" = "$Env:XDG_CONFIG_HOME\conda\.condarc"
|
||||
"$BASE_COMMON\gitconfig" = "$Env:UserProfile\.gitconfig"
|
||||
"$BASE_COMMON\glow.yaml" = "$Env:AppData\glow\glow.yml"
|
||||
"$BASE_COMMON\haskeline" = "$Env:UserProfile\.haskeline"
|
||||
"$BASE_COMMON\ideavimrc" = "$Env:XDG_CONFIG_HOME\ideavim\ideavimrc"
|
||||
"$BASE_COMMON\lesskey" = "$Env:LessKeyIn"
|
||||
"$BASE_COMMON\npmrc" = "$Env:NPM_CONFIG_USERCONFIG"
|
||||
"$BASE_COMMON\NuGet.Config" = "$Env:AppData\NuGet\NuGet.Config"
|
||||
"$BASE_COMMON\obsidian.vimrc" = "$Env:UserProfile\Obsidian\.obsidian.vimrc"
|
||||
"$BASE_COMMON\pip.conf" = "$Env:AppData\pip\pip.ini"
|
||||
"$BASE_COMMON\vimrc" = "$Env:Vim\_vimrc"
|
||||
"$BASE_TOOLS\ipython" = "$Env:IPYTHONDIR"
|
||||
"$BASE_TOOLS\nvim" = "$Env:XDG_CONFIG_HOME\nvim"
|
||||
}
|
||||
|
||||
# TODO: Auto create directories
|
||||
|
|
@ -35,4 +35,4 @@ foreach ($target in $linkDots.Keys) {
|
|||
New-Item -ItemType SymbolicLink -Target $target -Path $path -Force
|
||||
}
|
||||
|
||||
New-Item -ItemType SymbolicLink -Target "$BASE_WIN\Microsoft.PowerShell_profile.ps1" -Path "$env:UserProfile\Documents\PowerShell\Microsoft.PowerShell_profile.ps1" -Force
|
||||
New-Item -ItemType SymbolicLink -Target "$BASE_WIN\Microsoft.PowerShell_profile.ps1" -Path "$Env:UserProfile\Documents\PowerShell\Microsoft.PowerShell_profile.ps1" -Force
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ nnoremap <leader>rG :action Generate<CR>
|
|||
|
||||
""" Handling Ctrls """
|
||||
|
||||
sethandler <C-C> i:ide
|
||||
sethandler <C-V> n-v:vim i:ide
|
||||
sethandler <C-.> a:ide
|
||||
sethandler <A-<CR>> a:ide
|
||||
|
|
@ -72,3 +72,5 @@ ${function:wini} = { winget install $args }
|
|||
${function:winr} = { winget uninstall $args }
|
||||
${function:wins} = { winget search $args }
|
||||
${function:winu} = { winget upgrade $args }
|
||||
|
||||
${function:killp} = {ps | ? ProcessName -like $args | kill -Force}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,142 @@
|
|||
#Requires AutoHotkey v2.0
|
||||
|
||||
; #b::
|
||||
; Run '"C:\Program Files\Zotero\zotero.exe"'
|
||||
; return
|
||||
|
||||
; #f::
|
||||
; Run '"C:\Program Files\GPSoftware\Directory Opus\dopus.exe"'
|
||||
; return
|
||||
|
||||
; #q::
|
||||
; Send '!{F4}'
|
||||
; return
|
||||
|
||||
; #r::
|
||||
; Run '"C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\wt.exe"'
|
||||
; return
|
||||
|
||||
#h::
|
||||
Send '{Left}'
|
||||
return
|
||||
{
|
||||
Send("{Left}")
|
||||
}
|
||||
|
||||
#n::
|
||||
Send '{Down}'
|
||||
return
|
||||
{
|
||||
Send("{Down}")
|
||||
}
|
||||
|
||||
#e::
|
||||
Send '{Up}'
|
||||
return
|
||||
{
|
||||
Send("{Up}")
|
||||
}
|
||||
|
||||
#i::
|
||||
Send '{Right}'
|
||||
return
|
||||
{
|
||||
Send("{Right}")
|
||||
}
|
||||
|
||||
{
|
||||
Send("{Home}")
|
||||
}
|
||||
#a:: ; Vim-like navigation: Append
|
||||
{
|
||||
Send("{End}")
|
||||
}
|
||||
|
||||
#q:: ; Simulate cmd+q in macOS
|
||||
{
|
||||
Send("!{F4}")
|
||||
}
|
||||
|
||||
; 定义一个全局状态变量,标记是否触发了组合键
|
||||
global CapsLockState := false
|
||||
|
||||
; 当 CapsLock 作为修饰键与其他键一起使用时
|
||||
CapsLock & s:: {
|
||||
global CapsLockState
|
||||
CapsLockState := true
|
||||
Run("ShareX.exe -RectangleRegion")
|
||||
}
|
||||
|
||||
; 单独按下 CapsLock 时,发送 Esc
|
||||
CapsLock:: {
|
||||
global CapsLockState
|
||||
; 如果之前未使用组合键,则发送 Esc
|
||||
if not CapsLockState {
|
||||
Send("{Esc}")
|
||||
}
|
||||
CapsLockState := false ; 重置状态
|
||||
}
|
||||
|
||||
; 释放 CapsLock 时重置状态
|
||||
*CapsLock Up:: {
|
||||
global CapsLockState
|
||||
CapsLockState := false
|
||||
}
|
||||
|
||||
#HotIf WinActive('ahk_exe' 'QQ.exe')
|
||||
^n::
|
||||
{
|
||||
Send("^{Down}")
|
||||
}
|
||||
^h::
|
||||
{
|
||||
Send("^{Left}")
|
||||
}
|
||||
^i::
|
||||
{
|
||||
Send("^{Enter}")
|
||||
}
|
||||
^e::
|
||||
{
|
||||
Send("^{Up}")
|
||||
}
|
||||
#HotIf WinActive('ahk_exe' 'Weixin.exe')
|
||||
^n::
|
||||
{
|
||||
Send("{Down}")
|
||||
}
|
||||
^e::
|
||||
{
|
||||
Send("{Up}")
|
||||
}
|
||||
#HotIf WinActive('ahk_exe' 'Discord.exe')
|
||||
^n::
|
||||
{
|
||||
Send("^!{Down}")
|
||||
}
|
||||
^e::
|
||||
{
|
||||
Send("^!{Up}")
|
||||
}
|
||||
|
||||
#HotIf WinActive('ahk_exe' 'olk.exe')
|
||||
^n::
|
||||
{
|
||||
Send("{Down}")
|
||||
}
|
||||
^+n::
|
||||
{
|
||||
Send("^.")
|
||||
}
|
||||
^+e::
|
||||
{
|
||||
Send("^,")
|
||||
}
|
||||
^e::
|
||||
{
|
||||
Send("{Up}")
|
||||
}
|
||||
#HotIf WinActive('ahk_exe' 'SumatraPDF.exe')
|
||||
^\::
|
||||
{
|
||||
Send("{F12}")
|
||||
}
|
||||
#HotIf WinActive('ahk_exe' 'Flow.Launcher.exe')
|
||||
^a::
|
||||
{
|
||||
Send("{End}")
|
||||
}
|
||||
^+a::
|
||||
{
|
||||
Send("^a")
|
||||
}
|
||||
^l::
|
||||
{
|
||||
Send("{Home}")
|
||||
}
|
||||
^+BackSpace::
|
||||
{
|
||||
Send("^a{Backspace}")
|
||||
}
|
||||
#HotIf WinActive('ahk_exe' 'Obsidian.exe')
|
||||
^e::
|
||||
{
|
||||
Send("^p")
|
||||
}
|
||||
#HotIf
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
// Paste this into surfingkeys advanced settings
|
||||
// or use:
|
||||
// Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/browser/surfingkeys.js
|
||||
// Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/tools/browser/surfingkeys.js
|
||||
// TODO: Visual Mode
|
||||
|
||||
// #region Example
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
" Put this in OBSIDIAN_VAULT/.obsidian.vimrc
|
||||
set clipboard=unnamed " Sync with System Clipboard
|
||||
|
||||
" Word wrap
|
||||
noremap n gj
|
||||
noremap e gk
|
||||
" Colemak vim-like
|
||||
noremap n j
|
||||
noremap e k
|
||||
noremap i l
|
||||
|
||||
" Similar position to i
|
||||
|
|
@ -31,11 +31,21 @@ vnoremap * :addbold<CR> " Add bold to selection
|
|||
vnoremap _ :additalic<CR> " Add italic to selection
|
||||
vnoremap = :addhighlight " Add highlight to selection
|
||||
|
||||
""" Commands
|
||||
exmap write editor:save-file
|
||||
exmap w editor:save-file
|
||||
exmap q workspace:close-tab-group
|
||||
|
||||
exmap prevtab obcommand workspace:previous-tab
|
||||
exmap nexttab obcommand workspace:next-tab
|
||||
nnoremap H :prevtab<CR>
|
||||
nnoremap I :nexttab<CR>
|
||||
|
||||
exmap prevhist obcommand app:go-back
|
||||
exmap nexthist obcommand app:go-forward
|
||||
nnoremap gh :prevhist<CR>
|
||||
nnoremap gi :nexthist<CR>
|
||||
|
||||
exmap reload :source .obsidian.vimrc<CR>
|
||||
|
||||
unmap <Space>
|
||||
|
|
@ -48,12 +58,54 @@ map <Space>- :hsplit<CR>
|
|||
exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt
|
||||
map <Space>ai :chat<CR>
|
||||
|
||||
exmap omnisearch obcommand omnisearch:show-modal
|
||||
map <Space><Space> :omnisearch<CR>
|
||||
|
||||
exmap command-palette obcommand command-palette:open
|
||||
map <Space>: :command-palette<CR>
|
||||
|
||||
""" g-commands
|
||||
exmap tsource obcommand editor:toggle-source
|
||||
exmap tpreview obcommand markdown:toggle-preview
|
||||
nnoremap gs :tsource<CR>
|
||||
nnoremap gp :tpreview<CR>
|
||||
|
||||
exmap wl obcommand editor:focus-left
|
||||
exmap wr obcommand editor:focus-right
|
||||
exmap wt obcommand editor:focus-top
|
||||
exmap wb obcommand editor:focus-bottom
|
||||
|
||||
map <Space>h :wl<CR>
|
||||
map <Space>i :wr<CR>
|
||||
map <Space>n :wb<CR>
|
||||
map <Space>e :wt<CR>
|
||||
|
||||
exmap FoldToggle obcommand editor:toggle-fold
|
||||
exmap FoldLess obcommand editor:fold-less
|
||||
exmap FoldMore obcommand editor:fold-more
|
||||
exmap FoldAll obcommand editor:fold-all
|
||||
exmap UnfoldAll obcommand editor:unfold-all
|
||||
nnoremap za :FoldToggle<CR>
|
||||
nnoremap zr :FoldLess<CR>
|
||||
nnoremap zm :FoldMore<CR>
|
||||
nnoremap zM :FoldAll<CR>
|
||||
nnoremap zR :UnfoldAll<CR>
|
||||
|
||||
exmap switchany obcommand darlal-switcher-plus:switcher-plus:open
|
||||
exmap switchcmd obcommand darlal-switcher-plus:switcher-plus:open-commands
|
||||
exmap switchrecent obcommand darlal-switcher-plus:switcher-plus:open-related-items
|
||||
map <Space><Space> :switchany<CR>
|
||||
map <Space>: :switchcmd<CR>
|
||||
map <Space>fr :switchrecent<CR>
|
||||
|
||||
" <leader>b : +buffer
|
||||
exmap bd obcommand
|
||||
exmap DeleteOthers obcommand workspace:close-others
|
||||
map <Space>bd :bd<CR>
|
||||
map <Space>bX :DeleteOthers<CR>
|
||||
|
||||
" <leader>m : +major/markdown
|
||||
exmap addCallout obcommand editor:insert-callout
|
||||
map <Space>mb :addbold<CR>
|
||||
map <Space>mi :additalic<CR>
|
||||
map <Space>mc :addcode<CR>
|
||||
map <Space>md :adddel<CR>
|
||||
map <Space>mh :addhighlight<CR>
|
||||
map <Space>mp :tpreview<CR>
|
||||
map <Space>mo :addCallout<CR>
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ noremap J E
|
|||
noremap Y y$
|
||||
|
||||
" 分词版本的w和b,支持中文,需要插件
|
||||
" 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap`
|
||||
" 由于 VSCode Vim 的限制,递归解析存在缺陷,目前这种情况,2w 符合预期,但 dw 不符合预期
|
||||
" Comment if you don't use cjk or the plugin
|
||||
noremap w cjkWordHandler.cursorWordEndRight
|
||||
noremap b cjkWordHandler.cursorWordStartLeft
|
||||
nmap w cjkWordHandler.cursorWordEndRight
|
||||
nmap b cjkWordHandler.cursorWordStartLeft
|
||||
|
||||
" keep selection after indent (define in settings.json)
|
||||
" voremap < <gv
|
||||
|
|
@ -49,10 +51,13 @@ noremap gh editor.action.showDefinitionPreviewHover
|
|||
|
||||
noremap <leader><leader> workbench.action.quickOpen
|
||||
noremap <leader>: workbench.action.showCommands
|
||||
noremap <leader>E workbench.view.explorer
|
||||
|
||||
" <leader>q : +quit
|
||||
noremap <leader>qq :quit<CR>
|
||||
noremap <leader>qQ :qall<CR>
|
||||
noremap <leader>Q :quit<CR>
|
||||
|
||||
" <leader>w : +write/window
|
||||
noremap <leader>ww :write<CR>
|
||||
noremap <leader>wa :wall<CR>
|
||||
|
|
@ -66,6 +71,7 @@ noremap <leader>we workbench.action.focusAboveGroup
|
|||
noremap <leader>wE workbench.action.splitEditorUp
|
||||
noremap <leader>wi workbench.action.focusRightGroup
|
||||
noremap <leader>wI workbench.action.splitEditorRight
|
||||
|
||||
" <leader>f : +find/file
|
||||
noremap <leader>ff workbench.action.quickOpen
|
||||
noremap <leader>fF workbench.view.search
|
||||
|
|
@ -77,6 +83,7 @@ noremap <leader>fR workbench.action.openRecent
|
|||
noremap <leader>fs workbench.action.search.toggleQueryDetails
|
||||
noremap <leader>ft workbench.action.terminal.toggleTerminal
|
||||
noremap <leader>fx workbench.view.extensions
|
||||
|
||||
" <leader>p : +project (requires Project Manager extension)
|
||||
noremap <leader>pp projectManager.listProjects
|
||||
noremap <leader>pP projectManager.listAnyProjects#sideBarAny
|
||||
|
|
@ -87,12 +94,16 @@ noremap <leader>pF projectManager.filterProjectsByTag
|
|||
noremap <leader>pg projectManager.listGitProjects#sideBarGit
|
||||
noremap <leader>pr workbench.action.openRecent
|
||||
noremap <leader>ps projectManager.saveProject
|
||||
|
||||
" <leader>g : +git
|
||||
noremap <leader>gg workbench.view.scm
|
||||
noremap <leader>gS git.stageAll
|
||||
|
||||
" <leader>j : +jump
|
||||
noremap <leader>jj workbench.action.gotoLine
|
||||
|
||||
" <leader>l : +language (define in settings.json)
|
||||
|
||||
" <leader>u : +ui
|
||||
noremap <leader>ui workbench.action.selectTheme
|
||||
noremap <leader>uw editor.action.toggleWordWrap
|
||||
|
|
@ -117,14 +128,18 @@ noremap <leader>tC testing.debugCurrentTest
|
|||
noremap <leader>tx testing.cancelTestRun
|
||||
" <leader>d : +debug
|
||||
" <leader>h : +help
|
||||
|
||||
" <leader>c : +code
|
||||
noremap <leader>cr coderunner.run
|
||||
noremap <leader>cf editor.action.formatDocument
|
||||
noremap <leader>c<leader> editor.action.trimTrailingWhitespace
|
||||
noremap <leader>cs workbench.action.gotoSymbol
|
||||
noremap <leader>cS workbench.action.showAllSymbols
|
||||
|
||||
" <leader>b : +buffer
|
||||
noremap <leader>bb workbench.action.showAllEditors
|
||||
noremap <leader>bd :bdelete<CR>
|
||||
noremap <leader>bh :bprevious<CR>
|
||||
noremap <leader>bi :bnext<CR>
|
||||
|
||||
" 中文分词测试用例
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue