mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
2024-10-20 19:53:44 +0100
This commit is contained in:
parent
bde5d89003
commit
488c69e301
12 changed files with 279 additions and 32 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
*_private/
|
*private*
|
||||||
.private.env.*
|
.private.env.*
|
||||||
nvim/tt.*
|
nvim/tt.*
|
||||||
nvim/.tests
|
nvim/.tests
|
||||||
|
|
@ -16,3 +16,4 @@ test.*
|
||||||
*.tar
|
*.tar
|
||||||
*.zip
|
*.zip
|
||||||
*.tgz
|
*.tgz
|
||||||
|
WindowsTerminal.json
|
||||||
3
.haskline
Normal file
3
.haskline
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
editMode: Vi
|
||||||
|
bind: ctrl-p up
|
||||||
|
bind: ctrl-n down
|
||||||
6
.markdownlint.json
Normal file
6
.markdownlint.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"line-length": false,
|
||||||
|
"no-inline-html": false,
|
||||||
|
"no-alt-text": false,
|
||||||
|
"ul-style": { "style": "dash" }
|
||||||
|
}
|
||||||
74
.obsidian.vimrc
Normal file
74
.obsidian.vimrc
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
" Put this in OBSIDIAN_VAULT/.obsidian.vimrc
|
||||||
|
|
||||||
|
" Colemak 方向键映射 (hnei)
|
||||||
|
nnoremap k n
|
||||||
|
nnoremap K N
|
||||||
|
nnoremap j e
|
||||||
|
vnoremap j e
|
||||||
|
nnoremap l i
|
||||||
|
nnoremap N J
|
||||||
|
nnoremap E K
|
||||||
|
nnoremap I L
|
||||||
|
nnoremap J E
|
||||||
|
vnoremap J E
|
||||||
|
nnoremap L I
|
||||||
|
nnoremap k n
|
||||||
|
nnoremap K N
|
||||||
|
nnoremap j e
|
||||||
|
vnoremap j e
|
||||||
|
nnoremap l i
|
||||||
|
nnoremap N J
|
||||||
|
nnoremap E K
|
||||||
|
nnoremap I L
|
||||||
|
nnoremap J E
|
||||||
|
vnoremap J E
|
||||||
|
nnoremap L I
|
||||||
|
" 方向键映射
|
||||||
|
noremap n <Down> " 向下
|
||||||
|
noremap e <Up> " 向上
|
||||||
|
noremap i <Right> " 向右
|
||||||
|
|
||||||
|
|
||||||
|
""" Word wrap cursor movement
|
||||||
|
nmap j gj
|
||||||
|
nmap k gk
|
||||||
|
|
||||||
|
nmap Y y$ " Use Y to yank to the EOL
|
||||||
|
|
||||||
|
set clipboard=unnamed " Sync with System Clipboard
|
||||||
|
|
||||||
|
""" Visual mode surrounding
|
||||||
|
exmap addbold obcommand editor:toogle-bold
|
||||||
|
exmap additalic obcommand editor:toogle-italic
|
||||||
|
exmap addhighlight obcommand editor:toogle-highlight
|
||||||
|
exmap addcode obcommand editor:toogle-code
|
||||||
|
exmap adddel obcommand editor:toogle-strikethrough
|
||||||
|
vnoremap ~ :adddel<CR> " Add delete to selection
|
||||||
|
vnoremap ` c`<C-r>"`<Esc> " editor:toogle-code is buggy
|
||||||
|
vnoremap * :addbold<CR> " Add bold to selection
|
||||||
|
vnoremap _ :additalic<CR> " Add italic to selection
|
||||||
|
vnoremap = :addhighlight " Add highlight to selection
|
||||||
|
|
||||||
|
exmap prevtab obcommand workspace:previous-tab
|
||||||
|
exmap nexttab obcommand workspace:next-tab
|
||||||
|
nnoremap H :prevtab<CR>
|
||||||
|
nnoremap I :nexttab<CR>
|
||||||
|
|
||||||
|
exmap reload :source .obsidian.vimrc<CR>
|
||||||
|
|
||||||
|
unmap <Space>
|
||||||
|
exmap vsplit obcommand workspace:split-vertical
|
||||||
|
exmap hsplit obcommand workspace:split-horizontal
|
||||||
|
map <Space>| :vsplit<CR>
|
||||||
|
map <Space>- :hsplit<CR>
|
||||||
|
map <Space>bd
|
||||||
|
|
||||||
|
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>
|
||||||
|
|
||||||
|
""" g-commands
|
||||||
|
exmap tsource obcommand editor:toggle-source
|
||||||
|
nnoremap gs :tsource<CR>
|
||||||
2
pip.conf
2
pip.conf
|
|
@ -1,2 +1,2 @@
|
||||||
[global]
|
[global]
|
||||||
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
|
# index-url = https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
@ -4,7 +4,6 @@ Set-PSReadLineOption -EditMode vi # Vi Keybindings
|
||||||
Set-PSReadLineOption -PredictionViewStyle ListView
|
Set-PSReadLineOption -PredictionViewStyle ListView
|
||||||
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
|
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
|
||||||
Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > "
|
Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > "
|
||||||
|
|
||||||
### Keybindings ###
|
### Keybindings ###
|
||||||
|
|
||||||
Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+f" -Function ForwardWord
|
Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+f" -Function ForwardWord
|
||||||
|
|
@ -78,6 +77,7 @@ ${function:pylsenvs} = { conda env list }
|
||||||
${function:pymkenv} = { conda create --name $args[0] }
|
${function:pymkenv} = { conda create --name $args[0] }
|
||||||
${function:pyrmenv} = { conda remove --name $args[0] --all }
|
${function:pyrmenv} = { conda remove --name $args[0] --all }
|
||||||
|
|
||||||
|
|
||||||
# C & C++ #
|
# C & C++ #
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
19
readme.md
19
readme.md
|
|
@ -1,19 +1,4 @@
|
||||||
# .DOTFILES js0ny
|
# .dotfiles
|
||||||
|
|
||||||
## Navigator
|
Moving to *Colemak*
|
||||||
|
|
||||||
- [Windows](./win/readme.md)
|
|
||||||
- [Linux](./linux/readme.md)
|
|
||||||
- [Mac](./mac/readme.md)
|
|
||||||
|
|
||||||
- [Neovim](./nvim/readme.md)
|
|
||||||
- [VSCode](./vscode/readme.md)
|
|
||||||
|
|
||||||
- [IdeaVim](./.ideavimrc)
|
|
||||||
|
|
||||||
- [Git](./.gitconfig)
|
|
||||||
|
|
||||||
- [pip](./pip.conf)
|
|
||||||
- [npm](./.npmrc)
|
|
||||||
- [conda](./.condarc)
|
|
||||||
|
|
||||||
|
|
|
||||||
103
surfingkeys.js
Normal file
103
surfingkeys.js
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
// Paste this into surfingkeys advanced settings
|
||||||
|
|
||||||
|
/** Examples
|
||||||
|
|
||||||
|
// an example to create a new mapping `ctrl-y`
|
||||||
|
api.mapkey('<ctrl-y>', 'Show me the money', function() {
|
||||||
|
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
|
||||||
|
});
|
||||||
|
|
||||||
|
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
|
||||||
|
api.map('gt', 'T');
|
||||||
|
|
||||||
|
|
||||||
|
// an example to remove mapkey `Ctrl-i`
|
||||||
|
api.unmap('<ctrl-i>');
|
||||||
|
|
||||||
|
*/
|
||||||
|
// Settings
|
||||||
|
settings.language = "zh-CN" ;
|
||||||
|
settings.showModeStatus = true;
|
||||||
|
// Colemak hjkl (hnei)
|
||||||
|
// map('h', 'h') // left no change
|
||||||
|
api.map('n', 'j') // down
|
||||||
|
api.vmap('n', 'j') // down
|
||||||
|
api.map('e', 'k') // up
|
||||||
|
api.vmap('e', 'k') // up
|
||||||
|
api.map('i', 'l') // right
|
||||||
|
api.vmap('i', 'l') // right
|
||||||
|
// DELETED map j -> e : use j to scroll up half page
|
||||||
|
api.vmap('j', 'e') // end of word
|
||||||
|
api.map('k', 'n') // search next word (Original Position of n)
|
||||||
|
api.vmap('k', 'n') // search next word (Original Position of n)
|
||||||
|
api.map('l', 'i') // insert mode, similar position to original i
|
||||||
|
api.vmap('l', 'i') // insert mode, similar position to original i
|
||||||
|
api.map('L', 'I') // insert mode with vim popup, similar pos to I
|
||||||
|
|
||||||
|
// Prev/Next Page (WASD-like left-hand navigation)
|
||||||
|
api.map('A', 'E')
|
||||||
|
api.map('S', 'R')
|
||||||
|
// map('d', 'd') for scroll down half page
|
||||||
|
api.map('j', 'u') //scrool up half page
|
||||||
|
api.map('T', 'C') // Open in new tab
|
||||||
|
|
||||||
|
// Search Alias
|
||||||
|
api.addSearchAlias('f', 'Felo', 'https://felo.ai/search?q=', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
|
||||||
|
var res = JSON.parse(response.text);
|
||||||
|
return res.map(function(r){
|
||||||
|
return r.phrase;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
api.addSearchAlias('p', 'Perplexity', 'https://www.perplexity.ai/?q=', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
|
||||||
|
var res = JSON.parse(response.text);
|
||||||
|
return res.map(function(r){
|
||||||
|
return r.phrase;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
api.addSearchAlias('r', 'Raindrop', 'https://app.raindrop.io/my/0/', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
|
||||||
|
var res = JSON.parse(response.text);
|
||||||
|
return res.map(function(r){
|
||||||
|
return r.phrase;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Theme
|
||||||
|
settings.theme = `
|
||||||
|
.sk_theme {
|
||||||
|
font-family: Input Sans Condensed, Charcoal, sans-serif;
|
||||||
|
font-size: 10pt;
|
||||||
|
background: #24272e;
|
||||||
|
color: #abb2bf;
|
||||||
|
}
|
||||||
|
.sk_theme tbody {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.sk_theme input {
|
||||||
|
color: #d0d0d0;
|
||||||
|
}
|
||||||
|
.sk_theme .url {
|
||||||
|
color: #61afef;
|
||||||
|
}
|
||||||
|
.sk_theme .annotation {
|
||||||
|
color: #56b6c2;
|
||||||
|
}
|
||||||
|
.sk_theme .omnibar_highlight {
|
||||||
|
color: #528bff;
|
||||||
|
}
|
||||||
|
.sk_theme .omnibar_timestamp {
|
||||||
|
color: #e5c07b;
|
||||||
|
}
|
||||||
|
.sk_theme .omnibar_visitcount {
|
||||||
|
color: #98c379;
|
||||||
|
}
|
||||||
|
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
|
||||||
|
background: #303030;
|
||||||
|
}
|
||||||
|
.sk_theme #sk_omnibarSearchResult ul li.focused {
|
||||||
|
background: #3e4452;
|
||||||
|
}
|
||||||
|
#sk_status, #sk_find {
|
||||||
|
font-size: 20pt;
|
||||||
|
}`;
|
||||||
|
// click `Save` button to make above settings to take effect.</ctrl-i></ctrl-y>
|
||||||
29
vscode/vscode.vimrc
Normal file
29
vscode/vscode.vimrc
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
"vim.vimrc.path": "$HOME/.vscode.vimrc", // from vscode settings.json
|
||||||
|
|
||||||
|
" Colemak 方向键映射 (hnei)
|
||||||
|
nnoremap k n
|
||||||
|
nnoremap K N
|
||||||
|
nnoremap j e
|
||||||
|
vnoremap j e
|
||||||
|
nnoremap l i
|
||||||
|
nnoremap N J
|
||||||
|
nnoremap E K
|
||||||
|
nnoremap I L
|
||||||
|
nnoremap J E
|
||||||
|
vnoremap J E
|
||||||
|
nnoremap L I
|
||||||
|
nnoremap k n
|
||||||
|
nnoremap K N
|
||||||
|
nnoremap j e
|
||||||
|
vnoremap j e
|
||||||
|
nnoremap l i
|
||||||
|
nnoremap N J
|
||||||
|
nnoremap E K
|
||||||
|
nnoremap I L
|
||||||
|
nnoremap J E
|
||||||
|
vnoremap J E
|
||||||
|
nnoremap L I
|
||||||
|
" 方向键映射
|
||||||
|
noremap n <Down> " 向下
|
||||||
|
noremap e <Up> " 向上
|
||||||
|
noremap i <Right> " 向右
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
[wsl2]
|
; [wsl2]
|
||||||
networkingMode=mirrored
|
; networkingMode=mirrored
|
||||||
dnsTunneling=true
|
; dnsTunneling=true
|
||||||
firewall=true
|
; firewall=true
|
||||||
autoProxy=true
|
; autoProxy=true
|
||||||
|
|
||||||
[experimental]
|
; [experimental]
|
||||||
# requires dnsTunneling but are also OPTIONAL
|
; # requires dnsTunneling but are also OPTIONAL
|
||||||
bestEffortDnsParsing=true
|
; bestEffortDnsParsing=true
|
||||||
useWindowsDnsCache=true
|
; useWindowsDnsCache=true
|
||||||
hostAddressLoopback=true
|
; hostAddressLoopback=true
|
||||||
|
|
@ -19,6 +19,7 @@ ${function:shcfg} = { code $PROFILE }
|
||||||
${function:reload} = { . $PROFILE }
|
${function:reload} = { . $PROFILE }
|
||||||
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
||||||
Set-Alias "pwshcfg" "shcfg"
|
Set-Alias "pwshcfg" "shcfg"
|
||||||
|
|
||||||
# C & C++ #
|
# C & C++ #
|
||||||
|
|
||||||
# Set-Alias "cl" "clang"
|
# Set-Alias "cl" "clang"
|
||||||
|
|
@ -51,6 +52,46 @@ Set-Alias "pip3" "pip"
|
||||||
${function:wsl1} = {wsl.exe --distribution Debian}
|
${function:wsl1} = {wsl.exe --distribution Debian}
|
||||||
${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04}
|
${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04}
|
||||||
|
|
||||||
|
# Search Software #
|
||||||
|
|
||||||
|
function Get-AppPackageListRemote {
|
||||||
|
param(
|
||||||
|
[string]$Name
|
||||||
|
)
|
||||||
|
if (-not $Name) {
|
||||||
|
Write-Host "Please provide a package name."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Write-Host "Searching for $Name..."
|
||||||
|
Write-Host "=== winget ==="
|
||||||
|
winget search $Name
|
||||||
|
Write-Host "=== choco ==="
|
||||||
|
choco search $Name
|
||||||
|
}
|
||||||
|
|
||||||
|
Set-Alias "pkgsearch" "Get-AppPackageListRemote"
|
||||||
|
|
||||||
|
function Get-AppPackageListLocal {
|
||||||
|
winget list
|
||||||
|
choco list
|
||||||
|
scoop list
|
||||||
|
}
|
||||||
|
# Toggle Theme #
|
||||||
|
|
||||||
|
function Set-SystemTheme {
|
||||||
|
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||||
|
$currentMode = Get-ItemProperty -Path $regPath -Name "AppsUseLightTheme"
|
||||||
|
if ($currentMode.AppsUseLightTheme -eq 1) {
|
||||||
|
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 0
|
||||||
|
Write-Host "已切换到深色模式"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 1
|
||||||
|
Write-Host "已切换到浅色模式"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Set-Alias "theme" "Set-SystemTheme"
|
||||||
|
|
||||||
# Miscs #
|
# Miscs #
|
||||||
|
|
||||||
|
|
@ -62,6 +103,12 @@ Import-Module CompletionPredictor
|
||||||
|
|
||||||
### Misc ###
|
### Misc ###
|
||||||
|
|
||||||
|
${function:qwen} = "ollama run qwen2.5:14b"
|
||||||
|
|
||||||
|
# ## Oh-My-Posh ##
|
||||||
|
|
||||||
|
# Oh-My-Posh init pwsh --config "$HOME\AppData\Local\Programs\oh-my-posh\themes\tokyonight_storm.omp.json" | Invoke-Expression
|
||||||
|
|
||||||
## Conda ##
|
## Conda ##
|
||||||
|
|
||||||
#region conda initialize
|
#region conda initialize
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ tabs = true
|
||||||
theme = "auto"
|
theme = "auto"
|
||||||
title-hidden = true
|
title-hidden = true
|
||||||
vsync = false
|
vsync = false
|
||||||
wsl = true
|
wsl = false
|
||||||
neovim-bin = "/opt/nvim-linux64/bin/nvim"
|
|
||||||
|
|
||||||
[font]
|
[font]
|
||||||
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
|
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue