From e4500181e4358bb4bf4b3737e9894f1e62782e5f Mon Sep 17 00:00:00 2001 From: js0ny Date: Tue, 27 Aug 2024 13:12:35 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=8D=8E:=20Add=20script=20and=20specif?= =?UTF-8?q?y=20gdb=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ mac/.zshrc | 1 + powershell/scripts.ps1 | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 powershell/scripts.ps1 diff --git a/.gitignore b/.gitignore index 58064ae..6cea856 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ nvim/data nvim/lazy-lock.json nvim/lazyvim.json test/ +test.* *.gz *.tar +*.tgz *.zip \ No newline at end of file diff --git a/mac/.zshrc b/mac/.zshrc index 97462f8..f716d4f 100644 --- a/mac/.zshrc +++ b/mac/.zshrc @@ -92,6 +92,7 @@ alias c=code # Misc # alias cf=cfiles +alias gdb=aarch64-elf-gdb ### Functions ### diff --git a/powershell/scripts.ps1 b/powershell/scripts.ps1 new file mode 100644 index 0000000..49f47f0 --- /dev/null +++ b/powershell/scripts.ps1 @@ -0,0 +1,17 @@ +function CsvToMarkdown { + param( [string]$csv) + $counter = 0 + $column = $csv.Split("`n")[0].Split(",").Length + $aHeader = " --- |" + $header = "|" + $aHeader * $column + $csv.replace(",", " | ").Split("`n") | ForEach-Object { + if ($counter -eq 0) { + Write-Output "| $_ |" + $counter++ + Write-Output $header + } + else { + Write-Output "| $_ |" + } + } +} \ No newline at end of file From d400f65ae70b48f2fab8f75b2b62ab9b5fc17eac Mon Sep 17 00:00:00 2001 From: js0ny Date: Tue, 27 Aug 2024 13:16:51 +0800 Subject: [PATCH 2/7] Update PowerShell Structures --- .gitignore | 3 +- mac/Microsoft.PowerShell_profile.ps1 | 91 ++-------------------------- mac/readme.md | 0 powershell/bw.ps1 | 33 ---------- powershell/forex.ps1 | 28 --------- powershell/shared.ps1 | 86 ++++++++++++++++++++++++++ readme.md | 8 +-- win/Microsoft.PowerShell_profile.ps1 | 73 ++-------------------- 8 files changed, 100 insertions(+), 222 deletions(-) create mode 100644 mac/readme.md delete mode 100644 powershell/bw.ps1 delete mode 100644 powershell/forex.ps1 create mode 100644 powershell/shared.ps1 diff --git a/.gitignore b/.gitignore index 58064ae..bff7cd0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ nvim/lazyvim.json test/ *.gz *.tar -*.zip \ No newline at end of file +*.zip +*_private/ \ No newline at end of file diff --git a/mac/Microsoft.PowerShell_profile.ps1 b/mac/Microsoft.PowerShell_profile.ps1 index 548d261..8f92c79 100644 --- a/mac/Microsoft.PowerShell_profile.ps1 +++ b/mac/Microsoft.PowerShell_profile.ps1 @@ -2,100 +2,21 @@ $DOTFILES = "$HOME\.dotfiles" -### PSReadLine ### +### Load Configs ### -Set-PSReadLineOption -EditMode vi # Vi Keybindings -Set-PSReadLineOption -PredictionViewStyle ListView # Prediction View Style -Set-PSReadLineOption -PredictionSource HistoryAndPlugin # Prediction Source -Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Continuation Prompt +Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_} +Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_} -### Keybindings ### - -Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function ForwardWord - -### Navigator ### - -# Relative navigation # - -# ${function:~} = { Set-Location -Path ~ } cd is better -${function:...} = { Set-Location -Path ../.. } -${function:....} = { Set-Location -Path ../../.. } -${function:.....} = { Set-Location -Path ../../../.. } -${function:......} = { Set-Location -Path ../../../../.. } - -# Absolute navigation # - -${function:docs} = { Set-Location -Path ~/Documents } -${function:down} = { Set-Location -Path ~/Downloads } -${function:dt} = { Set-Location -Path ~/Desktop } -${function:mytmp} = { Set-Location -Path ~/Temp } -${function:one} = { Set-Location -Path ~/OneDrive } -${function:doku} = { Set-Location -Path ~/doku && Get-ChildItem } - -### Aliases ### +## Aliases ### # PowerShell Equivalents # -Set-Alias "touch" "New-Item" -Set-Alias "ll" "Get-ChildItem" Set-Alias "curl" "Invoke-WebRequest" Set-Alias "man" "Get-Help" Set-Alias "kill" "Stop-Process" +Set-Alias "open" "Invoke-Item" # Use ii instead of open # Dev # -${function:shcfg} = { code $PROFILE } ${function:zshcfg} = { nvim ~/.zshrc } -${function:bashcfg} = { nvim ~/.bashrc } -${function:reload} = { Invoke-Expression $PROFILE } -${function:csi} = { dotnet script } -${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } -Set-Alias "pwshcfg" "shcfg" -Set-Alias "cl" "clang" -Set-Alias "cl++" "clang++" -Set-Alias "clang" "clang -std=c99" -Set-Alias "clang++" "clang++ -std=c++2b" - -# Python & Conda # - -Set-Alias "python3" "python" -Set-Alias "pip3" "pip" -Set-Alias "py" "python" -Set-Alias "pyact" "conda activate" -Set-Alias "pylsenv" "conda env list" -Set-Alias "pydeact" "conda deactivate" -Set-Alias "pymkenv" "conda create --name" - -# Editors # - -Set-Alias "v" "nvim" -Set-Alias "c" "code" -Set-Alias "gvi" "neovide" - -# Miscs # - -Set-Alias mcd CreateAndSet-Directory - -### Functions ### - -function tc { param ( [string] $filename) - New-Item $filename && code $filename -} - -function tv { param ( [string] $filename) - New-Item $filename && nvim $filename -} - -function cdls { param( [string] $dirname) - Set-Location $dirname && Get-ChildItem -} - - - -### Modules ### - -Import-Module CompletionPredictor -# Import-Module syntax-highlighting - -### Misc ### - +${function:bashcfg} = { nvim ~/.bashrc } \ No newline at end of file diff --git a/mac/readme.md b/mac/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/powershell/bw.ps1 b/powershell/bw.ps1 deleted file mode 100644 index cde2fc4..0000000 --- a/powershell/bw.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -function Get-Password { - param ( - [Parameter(Mandatory = $true)] - [string]$Name, - [Boolean]$Hidden = $true - ) - $result = (bw list items --search $Name | ConvertFrom-Json).login | Select-Object -Property username, password - if ($result.Length -eq 0) { - Write-Host -ForegroundColor Red "No password found" - return - } - elseif ($result.Length -gt 1) { - Write-Host -ForegroundColor Red "More than one password found, please specify" - $counter = 0 - foreach ($username in $result.username) { - Write-Host "["$counter "]" $username - $counter++ - } - $selector = Read-Host -MaskInput "Select the username" - if ($result[$selector] -eq "") { - Write-Host -ForegroundColor Red "Invalid selection" - return - } - $result = $result[$selector] - } - if ($Hidden) { - Write-Host -ForegroundColor Green "Password copied to clipboard" - Set-Clipboard -Value $result.password - } else { - Write-Host $result - } - return $result -} \ No newline at end of file diff --git a/powershell/forex.ps1 b/powershell/forex.ps1 deleted file mode 100644 index 52664d4..0000000 --- a/powershell/forex.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$_userForexToday = (Get-Content ~/.forex | ConvertFrom-Json).conversion_rates - -function Update-ForexData { - ((Invoke-WebRequest "$_userForexUrl").Content | ConvertFrom-Json).conversion_rates > ~/.forex -} -function Get-ExchangeRate { - param ( - [string] $From, - [string] $To = "CNY", - [double] $Value = 1 - ) - if (-not $from) { - Get-ForexOverview - return - } - Write-Host $From : $To " " -NoNewline -ForegroundColor DarkGreen - ($Value * ($_userForexToday.$To / $_userForexToday.$From)) | Write-Host -ForegroundColor DarkBlue -} - -function Get-ForexOverview { - Get-ExchangeRate -From GBP -To CNY -Value 1 - Get-ExchangeRate -From USD -To CNY -Value 1 - Get-ExchangeRate -From HKD -To CNY -Value 1 - Get-ExchangeRate -From EUR -To CNY -Value 1 - Get-ExchangeRate -From CNY -To JPY -Value 1 -} - -Set-Alias "forex" "Get-ExchangeRate" \ No newline at end of file diff --git a/powershell/shared.ps1 b/powershell/shared.ps1 new file mode 100644 index 0000000..16de582 --- /dev/null +++ b/powershell/shared.ps1 @@ -0,0 +1,86 @@ +### PSReadLine ### + +Set-PSReadLineOption -EditMode vi # Vi Keybindings +Set-PSReadLineOption -PredictionViewStyle ListView +Set-PSReadLineOption -PredictionSource HistoryAndPlugin +Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " + +### Keybindings ### + +Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+f" -Function ForwardWord +Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+b" -Function BackwardWord +Set-PSReadLineKeyHandler -Chord "Alt+f" -Function ForwardChar +Set-PSReadLineKeyHandler -Chord "Ctrl+b" -Function BackwardChar +Set-PSReadLineKeyHandler -Chord "Ctrl+p" -Function HistorySearchBackward +Set-PSReadLineKeyHandler -Chord "Ctrl+n" -Function HistorySearchForward +Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine +Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine + +### Navigator ### + +# Relative navigation # + +# ${function:~} = { Set-Location -Path ~ } cd is better +${function:...} = { Set-Location -Path ..\.. } +${function:....} = { Set-Location -Path ..\..\.. } +${function:.....} = { Set-Location -Path ..\..\..\.. } +${function:......} = { Set-Location -Path ..\..\..\..\.. } + +# Absolute navigation # + +${function:docs} = { Set-Location -Path ~/Documents } +${function:down} = { Set-Location -Path ~/Downloads } +${function:dt} = { Set-Location -Path ~/Desktop } +${function:mytmp} = { Set-Location -Path ~/Temp } +${function:one} = { Set-Location -Path ~/OneDrive } +${function:doku} = { Set-Location -Path ~/doku && Get-ChildItem } + +### Alias ### + +# Shell Equivalents # + +Set-Alias "touch" "New-Item" +${function:ll} = { Get-ChildItem -Force } + +# Shell Configurations # + +${function:shcfg} = { code $PROFILE } +Set-Alias "pwshcfg" "shcfg" +${function:reload} = { . $PROFILE } +${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } + +# Editors # + +Set-Alias "v" "nvim" +Set-Alias "c" "code" +Set-Alias "gvi" "neovide" + +# File Creation # + +function mkcd { param ( [string] $dirname) mkdir $dirname && Set-Location $dirname } +function tc { param ( [string] $filename) New-Item $filename && code $filename } +function tv { param ( [string] $filename) New-Item $filename && nvim $filename } +function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem } + +### Dev ### + +# .NET # + +${function:csi} = { dotnet repl --default-kernel csharp} +${function:fsi} = { dotnet repl --default-kernel fsharp} + +# Python & Conda # + +Set-Alias "py" "python" +${function:pyact} = { conda activate $args[0] } +${function:pydact} = { conda deactivate } +${function:pylsenvs} = { conda env list } +${function:pymkenv} = { conda create --name $args[0] } +${function:pyrmenv} = { conda remove --name $args[0] --all } + +# C & C++ # + + +### Modules ### + +Import-Module CompletionPredictor \ No newline at end of file diff --git a/readme.md b/readme.md index ea90b33..6fd7612 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,7 @@ - [Windows](./win/readme.md) - [Linux](./linux/readme.md) +- [Mac](./mac/readme.md) - [Neovim](./nvim/readme.md) - [VSCode](./vscode/readme.md) @@ -14,10 +15,5 @@ - [pip](./pip.conf) - [npm](./.npmrc) +- [conda](./.condarc) - -### Scripts - -- [Install Neovim *nix](./install_nvim.sh) -- [Set Mirror *nix](./set_mirror.sh) -- [Set Mirror PowerShell](./set_mirror.ps1) \ No newline at end of file diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index 8cd0628..a98c81f 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -5,56 +5,13 @@ $DOTFILES = "$HOME\Documents\.dotfiles" ### Load Configs ### Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_} - -### PSReadLine ### - -Set-PSReadLineOption -EditMode vi # Vi Keybindings -Set-PSReadLineOption -PredictionViewStyle ListView # Prediction View Style -Set-PSReadLineOption -PredictionSource HistoryAndPlugin # Prediction Source -Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Continuation Prompt - -### Keybindings ### - -Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+f" -Function ForwardWord -Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+b" -Function BackwardWord -Set-PSReadLineKeyHandler -Chord "Alt+f" -Function ForwardChar -Set-PSReadLineKeyHandler -Chord "Ctrl+b" -Function BackwardChar -Set-PSReadLineKeyHandler -Chord "Ctrl+p" -Function HistorySearchBackward -Set-PSReadLineKeyHandler -Chord "Ctrl+n" -Function HistorySearchForward -Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine -Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine - -### Navigator ### - -# Relative navigation # - -# ${function:~} = { Set-Location -Path ~ } cd is better -${function:...} = { Set-Location -Path ..\.. } -${function:....} = { Set-Location -Path ..\..\.. } -${function:.....} = { Set-Location -Path ..\..\..\.. } -${function:......} = { Set-Location -Path ..\..\..\..\.. } - -# Absolute navigation # - -${function:docs} = { Set-Location -Path ~\Documents } -${function:down} = { Set-Location -Path ~\Downloads } -${function:dt} = { Set-Location -Path ~\Desktop } -${function:mytmp} = { Set-Location -Path ~\Temporary } -${function:one} = { Set-Location -Path ~\OneDrive } -${function:doku} = { Set-Location -Path ~\MyDocuments && Get-ChildItem } +Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_} ### Aliases ### # Shell Equivalents # -Set-Alias "touch" "New-Item" -function open { - if ($args.Count -eq 0) { - explorer.exe . - } else { - explorer.exe $args[0] - } -} +Set-Alias "open" "Invoke-Item" # Use ii instead of explorer.exe # Shell Configurations # @@ -62,11 +19,6 @@ ${function:shcfg} = { code $PROFILE } ${function:reload} = { . $PROFILE } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } Set-Alias "pwshcfg" "shcfg" - -# Dotnet # - -${function:csi} = { dotnet script } - # C & C++ # # Set-Alias "cl" "clang" @@ -78,13 +30,8 @@ ${function:csi} = { dotnet script } Set-Alias "python3" "python" Set-Alias "pip3" "pip" -Set-Alias "py" "python" -${function:pyact} = { conda activate $args[0] } -${function:pylsenvs} = { conda env list } -${function:pydact} = { conda deactivate } -${function:pymkenv} = { conda create --name $args[0] } -# # Git # +# Git # # Set-Alias "g" "git" # Set-Alias "ginit" "git init" @@ -104,26 +51,14 @@ ${function:pymkenv} = { conda create --name $args[0] } ${function:wsl1} = {wsl.exe --distribution Debian} ${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04} -# Editors # - -Set-Alias "v" "nvim" -Set-Alias "c" "code" -Set-Alias "gvi" "neovide" # Miscs # - -### Functions ### - -function mkcd { param ( [string] $dirname) mkdir $dirname && Set-Location $dirname} -function tc { param ( [string] $filename) New-Item $filename && code $filename } -function tv { param ( [string] $filename) New-Item $filename && nvim $filename } -function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem } - ### Modules ### Import-Module -Name Microsoft.WinGet.CommandNotFound #f45873b3-b655-43a6-b217-97c00aa0db58 Import-Module CompletionPredictor +# Import-Module syntax-highlighting # Buggy ### Misc ### From f43906adb6a0eb8c6ea160213f699b4128894803 Mon Sep 17 00:00:00 2001 From: js0ny Date: Fri, 4 Oct 2024 11:00:46 +0100 Subject: [PATCH 3/7] Update tmux and karabiner --- .tmux.conf | 34 ++++++++ mac/karabiner/caps_to_esc_lcmd.json | 26 ++++++ mac/karabiner/emacs_basic.json | 121 +++++++++++++++++++++++++++ mac/karabiner/fn-tab_to_cmd-tab.json | 24 ++++++ win/Microsoft.PowerShell_profile.ps1 | 4 + 5 files changed, 209 insertions(+) create mode 100644 .tmux.conf create mode 100644 mac/karabiner/caps_to_esc_lcmd.json create mode 100644 mac/karabiner/emacs_basic.json create mode 100644 mac/karabiner/fn-tab_to_cmd-tab.json diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..3f8b25a --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,34 @@ +# Prefix +# ----------------- +set-option -g prefix C-x +unbind C-b +bind C-x send-prefix + +# Index +# ----------------- +set -g base-index 1 +set -g pane-base-index 1 + +# History +# ----------------- +set -g history-limit 4096 + +# Reload Config +# ----------------- +bind r source-file ~/.tmux.conf \; display "Reloaded Config" + +# Vi Mode +# ----------------- +set -g status-keys vi +set-window-option -g mode-keys vi + +# Windows Management +# ----------------- +bind | split-window -h +unbind '"' +bind - split-window -v +unbind % +bind h select-pane -L + + + diff --git a/mac/karabiner/caps_to_esc_lcmd.json b/mac/karabiner/caps_to_esc_lcmd.json new file mode 100644 index 0000000..9723e0b --- /dev/null +++ b/mac/karabiner/caps_to_esc_lcmd.json @@ -0,0 +1,26 @@ +{ + "description": "CapsLock to ESC (alone) or LCommand (withKeys)", + "manipulators": [ + { + "from": { + "key_code": "caps_lock", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_command" + } + ], + "to_if_alone": [ + { + "key_code": "escape" + } + ], + "type": "basic" + } + ] +} \ No newline at end of file diff --git a/mac/karabiner/emacs_basic.json b/mac/karabiner/emacs_basic.json new file mode 100644 index 0000000..9e8764b --- /dev/null +++ b/mac/karabiner/emacs_basic.json @@ -0,0 +1,121 @@ +{ + "description": "lctrl + p/n/b/f/a/e to up/down/left/right/home/end", + "manipulators": [ + { + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow" + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow" + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow" + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow" + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": "command" + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "e", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": "command" + } + ], + "type": "basic" + } + ] +} \ No newline at end of file diff --git a/mac/karabiner/fn-tab_to_cmd-tab.json b/mac/karabiner/fn-tab_to_cmd-tab.json new file mode 100644 index 0000000..fadf814 --- /dev/null +++ b/mac/karabiner/fn-tab_to_cmd-tab.json @@ -0,0 +1,24 @@ +{ + "description": "Map fn+tab to cmd+tab", + "manipulators": [ + { + "from": { + "key_code": "tab", + "modifiers": { + "mandatory": [ + "fn" + ] + } + }, + "to": [ + { + "key_code": "tab", + "modifiers": [ + "left_command" + ] + } + ], + "type": "basic" + } + ] +} \ No newline at end of file diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index a98c81f..37c24b4 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -88,6 +88,10 @@ if (-not ($__lastStartup -eq $_currentDate)) { $_currentDate | Out-File -FilePath $SystemlogFilePath -Append } +Remove-Variable SystemlogFilePath +Remove-Variable __lastStartup +Remove-Variable _currentDate + ## Chocolatey ## $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" From bde5d89003b13bfdf3185e52754be09011cd2c81 Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 20 Oct 2024 19:53:23 +0100 Subject: [PATCH 4/7] 2024-10-20 19:53:11 UTC+1 --- nvim/.gitignore | 8 - nvim/.neoconf.json | 15 - nvim/LICENSE | 201 ------------- nvim/README.md | 4 - nvim/init.lua | 2 - nvim/lazy-lock.json | 55 ---- nvim/lazyvim.json | 20 -- nvim/lua/config/autocmds.lua | 3 - nvim/lua/config/keymaps.lua | 3 - nvim/lua/config/lazy.lua | 43 --- nvim/lua/config/options.lua | 12 - nvim/lua/plugins/colorscheme.lua | 55 ---- nvim/lua/plugins/dashboard.lua | 70 ----- nvim/lua/plugins/example.lua | 193 ------------ nvim/lua/plugins/fzf.lua | 228 -------------- nvim/lua/plugins/wakatime.lua | 3 - nvim/stylua.toml | 3 - pathlib.json | 19 -- win/WindowsTerminal.json | 499 ------------------------------- 19 files changed, 1436 deletions(-) delete mode 100644 nvim/.gitignore delete mode 100644 nvim/.neoconf.json delete mode 100644 nvim/LICENSE delete mode 100644 nvim/README.md delete mode 100644 nvim/init.lua delete mode 100644 nvim/lazy-lock.json delete mode 100644 nvim/lazyvim.json delete mode 100644 nvim/lua/config/autocmds.lua delete mode 100644 nvim/lua/config/keymaps.lua delete mode 100644 nvim/lua/config/lazy.lua delete mode 100644 nvim/lua/config/options.lua delete mode 100644 nvim/lua/plugins/colorscheme.lua delete mode 100644 nvim/lua/plugins/dashboard.lua delete mode 100644 nvim/lua/plugins/example.lua delete mode 100644 nvim/lua/plugins/fzf.lua delete mode 100644 nvim/lua/plugins/wakatime.lua delete mode 100644 nvim/stylua.toml delete mode 100644 pathlib.json delete mode 100644 win/WindowsTerminal.json diff --git a/nvim/.gitignore b/nvim/.gitignore deleted file mode 100644 index cc5457a..0000000 --- a/nvim/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -tt.* -.tests -doc/tags -debug -.repro -foo.* -*.log -data diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/nvim/LICENSE b/nvim/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/nvim/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/nvim/README.md b/nvim/README.md deleted file mode 100644 index 185280b..0000000 --- a/nvim/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# ๐Ÿ’ค LazyVim - -A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). -Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/nvim/init.lua b/nvim/init.lua deleted file mode 100644 index 2514f9e..0000000 --- a/nvim/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json deleted file mode 100644 index cabfdcc..0000000 --- a/nvim/lazy-lock.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "CopilotChat.nvim": { "branch": "canary", "commit": "6f143f210efd1f16d97c077b945c76b7d5fd0f8b" }, - "LazyVim": { "branch": "main", "commit": "12818a6cb499456f4903c5d8e68af43753ebc869" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, - "catppuccin": { "branch": "main", "commit": "ba5f4153a5dad99505baba936bd0373534400ac3" }, - "clangd_extensions.nvim": { "branch": "main", "commit": "a8500531c4ed3a207e744a374ea038744a0f93eb" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "25d48271e3d4404ba017cb92a37d3a681c1ad149" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "fzf-lua": { "branch": "main", "commit": "eb63a4bbfd203942737f76d4cf5424f6fb016a9d" }, - "gitsigns.nvim": { "branch": "main", "commit": "564849a17bf5c5569e0bae98c8328de9c7a1ed29" }, - "grug-far.nvim": { "branch": "main", "commit": "af2c8bba4faac4b47165005639573e4493e9d79e" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, - "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "markdown.nvim": { "branch": "main", "commit": "70ae5e9e517c930f74c3ad9e4ef325314967f2a0" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "fd69d5c782a28420d51b648a3d7fe88df569d391" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, - "mini.icons": { "branch": "main", "commit": "fe63fe080e76d80713557e5f0c65bc15b14b152d" }, - "mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" }, - "neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" }, - "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-jdtls": { "branch": "master", "commit": "6bfd1591583b02e742fc3a2f43393c4ea3b6d3c7" }, - "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, - "nvim-lspconfig": { "branch": "master", "commit": "e6528f4613c8db2e04be908eb2b5886d63f62a98" }, - "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-treesitter": { "branch": "master", "commit": "a7a3b9c10e8a5fe0da05ebb65db3ed1d164e612d" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "48128953949b51235ccada535f021a505fdaf3df" }, - "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, - "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "aad7bf06b4ca0de816b919d475a75b30f5f62b61" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" }, - "vim-wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" }, - "vimtex": { "branch": "master", "commit": "80c9bc179784c30192d482741a43f176c859daa1" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, - "yanky.nvim": { "branch": "main", "commit": "73215b77d22ebb179cef98e7e1235825431d10e4" } -} diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json deleted file mode 100644 index 22c8ac7..0000000 --- a/nvim/lazyvim.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extras": [ - "lazyvim.plugins.extras.coding.copilot", - "lazyvim.plugins.extras.coding.copilot-chat", - "lazyvim.plugins.extras.coding.luasnip", - "lazyvim.plugins.extras.coding.yanky", - "lazyvim.plugins.extras.editor.fzf", - "lazyvim.plugins.extras.lang.clangd", - "lazyvim.plugins.extras.lang.java", - "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.omnisharp", - "lazyvim.plugins.extras.lang.python", - "lazyvim.plugins.extras.lang.tex", - "lazyvim.plugins.extras.util.dot" - ], - "news": { - "NEWS.md": "6520" - }, - "version": 6 -} \ No newline at end of file diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua deleted file mode 100644 index 2c134f7..0000000 --- a/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua deleted file mode 100644 index 4aeb4bd..0000000 --- a/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,43 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - -if not (vim.uv or vim.loop).fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua deleted file mode 100644 index 9c2853a..0000000 --- a/nvim/lua/config/options.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here - -vim.g.autoformat = true -vim.g.lazygit_config = true - --- Tabs -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua deleted file mode 100644 index edf1225..0000000 --- a/nvim/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - { - "folke/tokyonight.nvim", - lazy = true, - opts = { style = "moon" }, - }, - { - "catppuccin/nvim", - lazy = true, - name = "catppuccin", - opts = { - integrations = { - aerial = true, - alpha = true, - cmp = true, - dashboard = true, - flash = true, - gitsigns = true, - headlines = true, - illuminate = true, - indent_blankline = { enabled = true }, - leap = true, - lsp_trouble = true, - mason = true, - markdown = true, - mini = true, - native_lsp = { - enabled = true, - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, - navic = { enabled = true, custom_bg = "lualine" }, - neotest = true, - neotree = true, - noice = true, - notify = true, - semantic_tokens = true, - telescope = true, - treesitter = true, - treesitter_context = true, - which_key = true, - }, - }, - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "catppuccin", - }, - }, -} diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua deleted file mode 100644 index 53f5b60..0000000 --- a/nvim/lua/plugins/dashboard.lua +++ /dev/null @@ -1,70 +0,0 @@ -return { - { - "nvimdev/dashboard-nvim", - lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. - opts = function() - local logo = [[ - - - โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— - โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• - โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• -โ–ˆโ–ˆ โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•”โ• -โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ - โ•šโ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• - - ]] - - logo = string.rep("\n", 8) .. logo .. "\n\n" - - local opts = { - theme = "doom", - hide = { - -- this is taken care of by lualine - -- enabling this messes up the actual laststatus setting after loading a file - statusline = false, - }, - config = { - header = vim.split(logo, "\n"), - -- stylua: ignore - center = { - { action = 'lua LazyVim.pick()()', desc = " Find File", icon = "๏€‚ ", key = "f" }, - { action = "ene | startinsert", desc = " New File", icon = "๏…› ", key = "n" }, - { action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "๏ƒ… ", key = "r" }, - { action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "๏€ข ", key = "g" }, - { action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "๏ฃ ", key = "c" }, - { action = 'lua require("persistence").load()', desc = " Restore Session", icon = "๎ˆ ", key = "s" }, - { action = "LazyExtras", desc = " Lazy Extras", icon = "๎ชŒ ", key = "x" }, - { action = "Lazy", desc = " Lazy", icon = "๓ฐ’ฒ ", key = "l" }, - { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = "๏ฆ ", key = "q" }, - }, - footer = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - return { "โšก Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } - end, - }, - } - - for _, button in ipairs(opts.config.center) do - button.desc = button.desc .. string.rep(" ", 43 - #button.desc) - button.key_format = " %s" - end - - -- open dashboard after closing lazy - if vim.o.filetype == "lazy" then - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(vim.api.nvim_get_current_win()), - once = true, - callback = function() - vim.schedule(function() - vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" }) - end) - end, - }) - end - - return opts - end, - }, -} diff --git a/nvim/lua/plugins/example.lua b/nvim/lua/plugins/example.lua deleted file mode 100644 index 4ad9825..0000000 --- a/nvim/lua/plugins/example.lua +++ /dev/null @@ -1,193 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, "๐Ÿ˜„") - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, -} diff --git a/nvim/lua/plugins/fzf.lua b/nvim/lua/plugins/fzf.lua deleted file mode 100644 index 4b56440..0000000 --- a/nvim/lua/plugins/fzf.lua +++ /dev/null @@ -1,228 +0,0 @@ -return { - { - "ibhagwan/fzf-lua", - cmd = "FzfLua", - opts = function(_, opts) - local config = require("fzf-lua.config") - local actions = require("fzf-lua.actions") - - -- Quickfix - config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept" - config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" - config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" - config.defaults.keymap.fzf["ctrl-x"] = "jump" - config.defaults.keymap.fzf["ctrl-f"] = "preview-page-down" - config.defaults.keymap.fzf["ctrl-b"] = "preview-page-up" - config.defaults.keymap.builtin[""] = "preview-page-down" - config.defaults.keymap.builtin[""] = "preview-page-up" - - -- Trouble - if LazyVim.has("trouble.nvim") then - config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open - end - - -- Toggle root dir / cwd - config.defaults.actions.files["ctrl-r"] = function(_, ctx) - local o = vim.deepcopy(ctx.__call_opts) - o.root = o.root == false - o.cwd = nil - o.buf = ctx.__CTX.bufnr - LazyVim.pick.open(ctx.__INFO.cmd, o) - end - config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] - config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir") - - -- use the same prompt for all - local defaults = require("fzf-lua.profiles.default-title") - local function fix(t) - t.prompt = t.prompt ~= nil and "๏„… " or nil - for _, v in pairs(t) do - if type(v) == "table" then - fix(v) - end - end - end - fix(defaults) - - local img_previewer ---@type string[]? - for _, v in ipairs({ - { cmd = "ueberzug", args = {} }, - { cmd = "chafa", args = { "{file}", "--format=symbols" } }, - { cmd = "viu", args = { "-b" } }, - }) do - if vim.fn.executable(v.cmd) == 1 then - img_previewer = vim.list_extend({ v.cmd }, v.args) - break - end - end - - return vim.tbl_deep_extend("force", defaults, { - fzf_colors = true, - fzf_opts = { - ["--no-scrollbar"] = false, - }, - defaults = { - -- formatter = "path.filename_first", - formatter = "path.dirname_first", - }, - previewers = { - builtin = { - extensions = { - ["png"] = img_previewer, - ["jpg"] = img_previewer, - ["jpeg"] = img_previewer, - ["gif"] = img_previewer, - ["webp"] = img_previewer, - }, - ueberzug_scaler = "fit_contain", - }, - }, - -- Custom LazyVim option to configure vim.ui.select - ui_select = function(fzf_opts, items) - return vim.tbl_deep_extend("force", fzf_opts, { - prompt = "๏„… ", - winopts = { - title = " " .. vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) .. " ", - title_pos = "center", - }, - }, fzf_opts.kind == "codeaction" and { - winopts = { - layout = "vertical", - -- height is number of items minus 15 lines for the preview, with a max of 80% screen height - height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16, - width = 0.5, - preview = not vim.tbl_isempty(LazyVim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and { - layout = "vertical", - vertical = "down:15,border-top", - hidden = "hidden", - } or { - layout = "vertical", - vertical = "down:15,border-top", - }, - }, - } or { - winopts = { - width = 0.5, - -- height is number of items, with a max of 80% screen height - height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5), - }, - }) - end, - winopts = { - width = 0.8, - height = 0.8, - row = 0.5, - col = 0.5, - preview = { - scrollchars = { "โ”ƒ", "" }, - }, - }, - files = { - cwd_prompt = false, - actions = { - ["alt-i"] = { actions.toggle_ignore }, - ["alt-h"] = { actions.toggle_hidden }, - }, - }, - grep = { - actions = { - ["alt-i"] = { actions.toggle_ignore }, - ["alt-h"] = { actions.toggle_hidden }, - }, - }, - lsp = { - symbols = { - symbol_hl = function(s) - return "TroubleIcon" .. s - end, - symbol_fmt = function(s) - return s:lower() .. "\t" - end, - child_prefix = false, - }, - code_actions = { - previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil, - }, - }, - }) - end, - config = function(_, opts) - require("fzf-lua").setup(opts) - end, - init = function() - LazyVim.on_very_lazy(function() - vim.ui.select = function(...) - require("lazy").load({ plugins = { "fzf-lua" } }) - local opts = LazyVim.opts("fzf-lua") or {} - require("fzf-lua").register_ui_select(opts.ui_select or nil) - return vim.ui.select(...) - end - end) - end, - keys = { - { "", "", ft = "fzf", mode = "t", nowait = true }, - { "", "", ft = "fzf", mode = "t", nowait = true }, - { - ",", - "FzfLua buffers sort_mru=true sort_lastused=true", - desc = "Switch Buffer", - }, - { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, - { ":", "FzfLua command_history", desc = "Command History" }, - { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, - -- find - { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, - { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, - { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, - { "fr", "FzfLua oldfiles", desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, - -- git - { "gc", "FzfLua git_commits", desc = "Commits" }, - { "gs", "FzfLua git_status", desc = "Status" }, - -- search - { 's"', "FzfLua registers", desc = "Registers" }, - { "sa", "FzfLua autocmds", desc = "Auto Commands" }, - { "sb", "FzfLua grep_curbuf", desc = "Buffer" }, - { "sc", "FzfLua command_history", desc = "Command History" }, - { "sC", "FzfLua commands", desc = "Commands" }, - { "sd", "FzfLua diagnostics_document", desc = "Document Diagnostics" }, - { "sD", "FzfLua diagnostics_workspace", desc = "Workspace Diagnostics" }, - { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, - { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, - { "sh", "FzfLua help_tags", desc = "Help Pages" }, - { "sH", "FzfLua highlights", desc = "Search Highlight Groups" }, - { "sj", "FzfLua jumps", desc = "Jumplist" }, - { "sk", "FzfLua keymaps", desc = "Key Maps" }, - { "sl", "FzfLua loclist", desc = "Location List" }, - { "sM", "FzfLua man_pages", desc = "Man Pages" }, - { "sm", "FzfLua marks", desc = "Jump to Mark" }, - { "sR", "FzfLua resume", desc = "Resume" }, - { "sq", "FzfLua quickfix", desc = "Quickfix List" }, - { "sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" }, - { "sW", LazyVim.pick("grep_cword", { root = false }), desc = "Word (cwd)" }, - { "sw", LazyVim.pick("grep_visual"), mode = "v", desc = "Selection (Root Dir)" }, - { "sW", LazyVim.pick("grep_visual", { root = false }), mode = "v", desc = "Selection (cwd)" }, - { "uC", LazyVim.pick("colorschemes"), desc = "Colorscheme with Preview" }, - { - "ss", - function() - require("fzf-lua").lsp_document_symbols({ - regex_filter = symbols_filter, - }) - end, - desc = "Goto Symbol", - }, - { - "sS", - function() - require("fzf-lua").lsp_live_workspace_symbols({ - regex_filter = symbols_filter, - }) - end, - desc = "Goto Symbol (Workspace)", - }, - }, - }, -} diff --git a/nvim/lua/plugins/wakatime.lua b/nvim/lua/plugins/wakatime.lua deleted file mode 100644 index 83b5793..0000000 --- a/nvim/lua/plugins/wakatime.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "wakatime/vim-wakatime", lazy = false }, -} diff --git a/nvim/stylua.toml b/nvim/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/pathlib.json b/pathlib.json deleted file mode 100644 index d58927a..0000000 --- a/pathlib.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - ".bashrc": "~/.bashrc", - ".zshrc": "~/.zshrc", - "nvim/": "~/.config/nvim/", - ".condarc": "~/.condarc", - ".gitconfig": "~/.gitconfig", - ".ideavimrc": "~/.ideavimrc", - "pip.conf": "~/.config/pip/pip.conf", - ".npmrc": "~/.npmrc", - "Microsoft.PowerShell_profile.ps1": { - "Mac": "~/.config/powershell/Microsoft.PowerShell_profile.ps1", - "Windows": "~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1" - }, - ".wslconfig": "~/.wslconfig", - "neovide.toml": { - "Mac": "~/.config/neovide/neovide.toml", - "Windows": "~/AppData/Local/neovide/neovide.toml" - } -} \ No newline at end of file diff --git a/win/WindowsTerminal.json b/win/WindowsTerminal.json deleted file mode 100644 index 05345f4..0000000 --- a/win/WindowsTerminal.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "$help": "https://aka.ms/terminal-documentation", - "$schema": "https://aka.ms/terminal-profiles-schema", - "actions": - [ - { - "command": "unbound", - "keys": "alt+shift+plus" - }, - { - "command": "unbound", - "keys": "alt+up" - }, - { - "command": "unbound", - "keys": "alt+down" - }, - { - "command": "unbound", - "keys": "alt+right" - }, - { - "command": "unbound", - "keys": "alt+left" - }, - { - "command": "unbound", - "keys": "alt+shift+up" - }, - { - "command": "unbound", - "keys": "alt+shift+down" - }, - { - "command": "unbound", - "keys": "alt+shift+right" - }, - { - "command": "unbound", - "keys": "alt+shift+left" - }, - { - "command": - { - "action": "copy", - "singleLine": false - }, - "keys": "ctrl+c" - }, - { - "command": - { - "action": "moveFocus", - "direction": "up" - }, - "keys": "ctrl+k" - }, - { - "command": "paste", - "keys": "ctrl+v" - }, - { - "command": - { - "action": "resizePane", - "direction": "up" - }, - "keys": "ctrl+shift+k" - }, - { - "command": "find", - "keys": "ctrl+shift+f" - }, - { - "command": - { - "action": "resizePane", - "direction": "left" - }, - "keys": "ctrl+shift+h" - }, - { - "command": - { - "action": "splitPane", - "split": "auto", - "splitMode": "duplicate" - }, - "keys": "alt+shift+d" - }, - { - "command": - { - "action": "splitPane", - "split": "right" - }, - "keys": "alt+shift+/" - }, - { - "command": - { - "action": "moveFocus", - "direction": "down" - }, - "keys": "ctrl+j" - }, - { - "command": - { - "action": "moveFocus", - "direction": "right" - }, - "keys": "ctrl+l" - }, - { - "command": - { - "action": "moveFocus", - "direction": "left" - }, - "keys": "ctrl+h" - }, - { - "command": - { - "action": "resizePane", - "direction": "down" - }, - "keys": "ctrl+shift+j" - }, - { - "command": - { - "action": "resizePane", - "direction": "right" - }, - "keys": "ctrl+shift+l" - } - ], - "autoHideWindow": false, - "centerOnLaunch": false, - "copyFormatting": "none", - "copyOnSelect": false, - "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", - "language": "zh-Hans", - "minimizeToNotificationArea": false, - "newTabMenu": - [ - { - "type": "remainingProfiles" - } - ], - "profiles": - { - "defaults": - { - "colorScheme": "One Half Dark", - "font": - { - "face": "CaskaydiaCove Nerd Font" - }, - "opacity": 100, - "useAcrylic": false - }, - "list": - [ - { - "backgroundImage": null, - "colorScheme": "One Half Dark", - "experimental.retroTerminalEffect": false, - "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", - "hidden": false, - "name": "PowerShell", - "opacity": 100, - "scrollbarState": "hidden", - "source": "Windows.Terminal.PowershellCore", - "useAcrylic": true - }, - { - "guid": "{3c5d580b-1c52-55ce-89c9-57119457e5a7}", - "hidden": false, - "name": "CMD VS 2022", - "source": "Windows.Terminal.VisualStudio" - }, - { - "guid": "{bc7a2d0e-eee9-5401-ae36-b35fa60deb22}", - "hidden": false, - "name": "PowerShell VS2022", - "source": "Windows.Terminal.VisualStudio" - }, - { - "colorScheme": "Campbell", - "commandline": "\"C:\\Users\\citoy\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.PowerShell_8wekyb3d8bbwe\\pwsh.exe\"", - "elevate": true, - "guid": "{6693d425-c727-46ba-8739-542bcf18769b}", - "hidden": false, - "icon": "ms-appx:///ProfileIcons/pwsh.png", - "name": "PowerShell Administrator", - "startingDirectory": "%USERPROFILE%" - }, - { - "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", - "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", - "hidden": false, - "name": "Windows PowerShell" - }, - { - "commandline": "%SystemRoot%\\System32\\cmd.exe", - "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", - "hidden": false, - "name": "\u547d\u4ee4\u63d0\u793a\u7b26" - }, - { - "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", - "hidden": false, - "name": "Azure Cloud Shell", - "source": "Windows.Terminal.Azure" - }, - { - "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}", - "hidden": false, - "name": "Debian", - "source": "Windows.Terminal.Wsl" - }, - { - "guid": "{17bf3de4-5353-5709-bcf9-835bd952a95e}", - "hidden": true, - "name": "Ubuntu-22.04", - "source": "Windows.Terminal.Wsl" - }, - { - "guid": "{e5a83caa-4c73-52b3-ae6b-bc438d721ef9}", - "hidden": false, - "name": "Ubuntu 22.04.3 LTS", - "source": "CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc" - } - ] - }, - "schemes": - [ - { - "background": "#0C0C0C", - "black": "#0C0C0C", - "blue": "#0037DA", - "brightBlack": "#767676", - "brightBlue": "#3B78FF", - "brightCyan": "#61D6D6", - "brightGreen": "#16C60C", - "brightPurple": "#B4009E", - "brightRed": "#E74856", - "brightWhite": "#F2F2F2", - "brightYellow": "#F9F1A5", - "cursorColor": "#FFFFFF", - "cyan": "#3A96DD", - "foreground": "#CCCCCC", - "green": "#13A10E", - "name": "Campbell", - "purple": "#881798", - "red": "#C50F1F", - "selectionBackground": "#FFFFFF", - "white": "#CCCCCC", - "yellow": "#C19C00" - }, - { - "background": "#012456", - "black": "#0C0C0C", - "blue": "#0037DA", - "brightBlack": "#767676", - "brightBlue": "#3B78FF", - "brightCyan": "#61D6D6", - "brightGreen": "#16C60C", - "brightPurple": "#B4009E", - "brightRed": "#E74856", - "brightWhite": "#F2F2F2", - "brightYellow": "#F9F1A5", - "cursorColor": "#FFFFFF", - "cyan": "#3A96DD", - "foreground": "#CCCCCC", - "green": "#13A10E", - "name": "Campbell Powershell", - "purple": "#881798", - "red": "#C50F1F", - "selectionBackground": "#FFFFFF", - "white": "#CCCCCC", - "yellow": "#C19C00" - }, - { - "background": "#282C34", - "black": "#282C34", - "blue": "#61AFEF", - "brightBlack": "#5A6374", - "brightBlue": "#61AFEF", - "brightCyan": "#56B6C2", - "brightGreen": "#98C379", - "brightPurple": "#C678DD", - "brightRed": "#E06C75", - "brightWhite": "#DCDFE4", - "brightYellow": "#E5C07B", - "cursorColor": "#FFFFFF", - "cyan": "#56B6C2", - "foreground": "#DCDFE4", - "green": "#98C379", - "name": "One Half Dark", - "purple": "#C678DD", - "red": "#E06C75", - "selectionBackground": "#FFFFFF", - "white": "#DCDFE4", - "yellow": "#E5C07B" - }, - { - "background": "#FAFAFA", - "black": "#383A42", - "blue": "#0184BC", - "brightBlack": "#4F525D", - "brightBlue": "#61AFEF", - "brightCyan": "#56B5C1", - "brightGreen": "#98C379", - "brightPurple": "#C577DD", - "brightRed": "#DF6C75", - "brightWhite": "#FFFFFF", - "brightYellow": "#E4C07A", - "cursorColor": "#4F525D", - "cyan": "#0997B3", - "foreground": "#383A42", - "green": "#50A14F", - "name": "One Half Light", - "purple": "#A626A4", - "red": "#E45649", - "selectionBackground": "#FFFFFF", - "white": "#FAFAFA", - "yellow": "#C18301" - }, - { - "background": "#002B36", - "black": "#002B36", - "blue": "#268BD2", - "brightBlack": "#073642", - "brightBlue": "#839496", - "brightCyan": "#93A1A1", - "brightGreen": "#586E75", - "brightPurple": "#6C71C4", - "brightRed": "#CB4B16", - "brightWhite": "#FDF6E3", - "brightYellow": "#657B83", - "cursorColor": "#FFFFFF", - "cyan": "#2AA198", - "foreground": "#839496", - "green": "#859900", - "name": "Solarized Dark", - "purple": "#D33682", - "red": "#DC322F", - "selectionBackground": "#FFFFFF", - "white": "#EEE8D5", - "yellow": "#B58900" - }, - { - "background": "#FDF6E3", - "black": "#002B36", - "blue": "#268BD2", - "brightBlack": "#073642", - "brightBlue": "#839496", - "brightCyan": "#93A1A1", - "brightGreen": "#586E75", - "brightPurple": "#6C71C4", - "brightRed": "#CB4B16", - "brightWhite": "#FDF6E3", - "brightYellow": "#657B83", - "cursorColor": "#002B36", - "cyan": "#2AA198", - "foreground": "#657B83", - "green": "#859900", - "name": "Solarized Light", - "purple": "#D33682", - "red": "#DC322F", - "selectionBackground": "#FFFFFF", - "white": "#EEE8D5", - "yellow": "#B58900" - }, - { - "background": "#000000", - "black": "#000000", - "blue": "#3465A4", - "brightBlack": "#555753", - "brightBlue": "#729FCF", - "brightCyan": "#34E2E2", - "brightGreen": "#8AE234", - "brightPurple": "#AD7FA8", - "brightRed": "#EF2929", - "brightWhite": "#EEEEEC", - "brightYellow": "#FCE94F", - "cursorColor": "#FFFFFF", - "cyan": "#06989A", - "foreground": "#D3D7CF", - "green": "#4E9A06", - "name": "Tango Dark", - "purple": "#75507B", - "red": "#CC0000", - "selectionBackground": "#FFFFFF", - "white": "#D3D7CF", - "yellow": "#C4A000" - }, - { - "background": "#FFFFFF", - "black": "#000000", - "blue": "#3465A4", - "brightBlack": "#555753", - "brightBlue": "#729FCF", - "brightCyan": "#34E2E2", - "brightGreen": "#8AE234", - "brightPurple": "#AD7FA8", - "brightRed": "#EF2929", - "brightWhite": "#EEEEEC", - "brightYellow": "#FCE94F", - "cursorColor": "#000000", - "cyan": "#06989A", - "foreground": "#555753", - "green": "#4E9A06", - "name": "Tango Light", - "purple": "#75507B", - "red": "#CC0000", - "selectionBackground": "#FFFFFF", - "white": "#D3D7CF", - "yellow": "#C4A000" - }, - { - "background": "#300A24", - "black": "#171421", - "blue": "#0037DA", - "brightBlack": "#767676", - "brightBlue": "#08458F", - "brightCyan": "#2C9FB3", - "brightGreen": "#26A269", - "brightPurple": "#A347BA", - "brightRed": "#C01C28", - "brightWhite": "#F2F2F2", - "brightYellow": "#A2734C", - "cursorColor": "#FFFFFF", - "cyan": "#3A96DD", - "foreground": "#FFFFFF", - "green": "#26A269", - "name": "Ubuntu-22.04-ColorScheme", - "purple": "#881798", - "red": "#C21A23", - "selectionBackground": "#FFFFFF", - "white": "#CCCCCC", - "yellow": "#A2734C" - }, - { - "background": "#300A24", - "black": "#171421", - "blue": "#0037DA", - "brightBlack": "#767676", - "brightBlue": "#08458F", - "brightCyan": "#2C9FB3", - "brightGreen": "#26A269", - "brightPurple": "#A347BA", - "brightRed": "#C01C28", - "brightWhite": "#F2F2F2", - "brightYellow": "#A2734C", - "cursorColor": "#FFFFFF", - "cyan": "#3A96DD", - "foreground": "#FFFFFF", - "green": "#26A269", - "name": "Ubuntu-ColorScheme", - "purple": "#881798", - "red": "#C21A23", - "selectionBackground": "#FFFFFF", - "white": "#CCCCCC", - "yellow": "#A2734C" - }, - { - "background": "#000000", - "black": "#000000", - "blue": "#000080", - "brightBlack": "#808080", - "brightBlue": "#0000FF", - "brightCyan": "#00FFFF", - "brightGreen": "#00FF00", - "brightPurple": "#FF00FF", - "brightRed": "#FF0000", - "brightWhite": "#FFFFFF", - "brightYellow": "#FFFF00", - "cursorColor": "#FFFFFF", - "cyan": "#008080", - "foreground": "#C0C0C0", - "green": "#008000", - "name": "Vintage", - "purple": "#800080", - "red": "#800000", - "selectionBackground": "#FFFFFF", - "white": "#C0C0C0", - "yellow": "#808000" - } - ], - "tabWidthMode": "compact", - "themes": [], - "useAcrylicInTabRow": true, - "windowingBehavior": "useNew" -} \ No newline at end of file From 488c69e301502f75e811e325b6f28abb5ad128f0 Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 20 Oct 2024 19:53:25 +0100 Subject: [PATCH 5/7] 2024-10-20 19:53:44 +0100 --- .gitignore | 3 +- .haskline | 3 + .markdownlint.json | 6 ++ .obsidian.vimrc | 74 +++++++++++++++++++ pip.conf | 2 +- powershell/shared.ps1 | 2 +- readme.md | 19 +---- surfingkeys.js | 103 +++++++++++++++++++++++++++ vscode/vscode.vimrc | 29 ++++++++ win/.wslconfig | 20 +++--- win/Microsoft.PowerShell_profile.ps1 | 47 ++++++++++++ win/neovide.toml | 3 +- 12 files changed, 279 insertions(+), 32 deletions(-) create mode 100644 .haskline create mode 100644 .markdownlint.json create mode 100644 .obsidian.vimrc create mode 100644 surfingkeys.js create mode 100644 vscode/vscode.vimrc diff --git a/.gitignore b/.gitignore index 1c942eb..35878af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -*_private/ +*private* .private.env.* nvim/tt.* nvim/.tests @@ -16,3 +16,4 @@ test.* *.tar *.zip *.tgz +WindowsTerminal.json \ No newline at end of file diff --git a/.haskline b/.haskline new file mode 100644 index 0000000..6750f58 --- /dev/null +++ b/.haskline @@ -0,0 +1,3 @@ +editMode: Vi +bind: ctrl-p up +bind: ctrl-n down \ No newline at end of file diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..f325493 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "line-length": false, + "no-inline-html": false, + "no-alt-text": false, + "ul-style": { "style": "dash" } +} \ No newline at end of file diff --git a/.obsidian.vimrc b/.obsidian.vimrc new file mode 100644 index 0000000..41199cc --- /dev/null +++ b/.obsidian.vimrc @@ -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 " ๅ‘ไธ‹ +noremap e " ๅ‘ไธŠ +noremap i " ๅ‘ๅณ + + +""" 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 " Add delete to selection +vnoremap ` c`"` " editor:toogle-code is buggy +vnoremap * :addbold " Add bold to selection +vnoremap _ :additalic " 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 +nnoremap I :nexttab + +exmap reload :source .obsidian.vimrc + +unmap +exmap vsplit obcommand workspace:split-vertical +exmap hsplit obcommand workspace:split-horizontal +map | :vsplit +map - :hsplit +map bd + +exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt +map ai :chat + +exmap omnisearch obcommand omnisearch:show-modal +map :omnisearch + +""" g-commands +exmap tsource obcommand editor:toggle-source +nnoremap gs :tsource diff --git a/pip.conf b/pip.conf index 883b782..27a69a5 100644 --- a/pip.conf +++ b/pip.conf @@ -1,2 +1,2 @@ [global] -index-url = https://pypi.tuna.tsinghua.edu.cn/simple \ No newline at end of file +# index-url = https://pypi.tuna.tsinghua.edu.cn/simple \ No newline at end of file diff --git a/powershell/shared.ps1 b/powershell/shared.ps1 index 16de582..bd7c77b 100644 --- a/powershell/shared.ps1 +++ b/powershell/shared.ps1 @@ -4,7 +4,6 @@ Set-PSReadLineOption -EditMode vi # Vi Keybindings Set-PSReadLineOption -PredictionViewStyle ListView Set-PSReadLineOption -PredictionSource HistoryAndPlugin Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " - ### Keybindings ### 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:pyrmenv} = { conda remove --name $args[0] --all } + # C & C++ # diff --git a/readme.md b/readme.md index 6fd7612..5cf4169 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,4 @@ -# .DOTFILES js0ny +# .dotfiles -## Navigator - -- [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) +Moving to *Colemak* diff --git a/surfingkeys.js b/surfingkeys.js new file mode 100644 index 0000000..7406ff4 --- /dev/null +++ b/surfingkeys.js @@ -0,0 +1,103 @@ +// Paste this into surfingkeys advanced settings + +/** Examples + +// an example to create a new mapping `ctrl-y` +api.mapkey('', '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(''); + +*/ +// 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. \ No newline at end of file diff --git a/vscode/vscode.vimrc b/vscode/vscode.vimrc new file mode 100644 index 0000000..5bab85e --- /dev/null +++ b/vscode/vscode.vimrc @@ -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 " ๅ‘ไธ‹ +noremap e " ๅ‘ไธŠ +noremap i " ๅ‘ๅณ diff --git a/win/.wslconfig b/win/.wslconfig index c128cdf..3a96c0c 100644 --- a/win/.wslconfig +++ b/win/.wslconfig @@ -1,11 +1,11 @@ -[wsl2] -networkingMode=mirrored -dnsTunneling=true -firewall=true -autoProxy=true +; [wsl2] +; networkingMode=mirrored +; dnsTunneling=true +; firewall=true +; autoProxy=true -[experimental] -# requires dnsTunneling but are also OPTIONAL -bestEffortDnsParsing=true -useWindowsDnsCache=true -hostAddressLoopback=true \ No newline at end of file +; [experimental] +; # requires dnsTunneling but are also OPTIONAL +; bestEffortDnsParsing=true +; useWindowsDnsCache=true +; hostAddressLoopback=true \ No newline at end of file diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index a98c81f..76f31bc 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -19,6 +19,7 @@ ${function:shcfg} = { code $PROFILE } ${function:reload} = { . $PROFILE } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } Set-Alias "pwshcfg" "shcfg" + # C & C++ # # Set-Alias "cl" "clang" @@ -51,6 +52,46 @@ Set-Alias "pip3" "pip" ${function:wsl1} = {wsl.exe --distribution Debian} ${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 # @@ -62,6 +103,12 @@ Import-Module CompletionPredictor ### 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 ## #region conda initialize diff --git a/win/neovide.toml b/win/neovide.toml index e1b21fb..19df476 100644 --- a/win/neovide.toml +++ b/win/neovide.toml @@ -8,8 +8,7 @@ tabs = true theme = "auto" title-hidden = true vsync = false -wsl = true -neovim-bin = "/opt/nvim-linux64/bin/nvim" +wsl = false [font] normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default From ef7f7d9e1405442e64726541ed0cdcf8a990b09e Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 20 Oct 2024 20:14:43 +0100 Subject: [PATCH 6/7] Sync from Mac: 2024-10-20 20:14 +0100 --- .DS_Store | Bin 8196 -> 8196 bytes mac/.zshrc | 3 ++- mac/shortcuts/finder_open.applescript | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 mac/shortcuts/finder_open.applescript diff --git a/.DS_Store b/.DS_Store index 69f643d6907232bb79f8bb1c98795d20cafcb776..6e6a9384714c12e4dd16be8d61cc8e3b1ffdc7cb 100644 GIT binary patch delta 64 zcmZp1XmOa}&&awlU^hP_>t-GS7IpzMaI#M<`2qlwl?m /dev/null; then - neovide "$target" + neovide "$target" & else echo "neovide is not installed" fi diff --git a/mac/shortcuts/finder_open.applescript b/mac/shortcuts/finder_open.applescript new file mode 100644 index 0000000..7ab435c --- /dev/null +++ b/mac/shortcuts/finder_open.applescript @@ -0,0 +1,4 @@ +tell application "Finder" + activate + make new Finder window +end tell From 0f456019d2c530514089b615e57dc501721e7761 Mon Sep 17 00:00:00 2001 From: js0ny Date: Wed, 30 Oct 2024 15:54:45 +0000 Subject: [PATCH 7/7] Initial Colemak Setup --- .gitignore | 3 +- .npmrc | 2 +- .obsidian.vimrc | 59 ++--- mac/Microsoft.PowerShell_profile.ps1 | 2 +- powershell/keymap.ps1 | 25 ++ powershell/modules.ps1 | 9 + powershell/prompt.ps1 | 86 +++++++ powershell/shared.ps1 | 34 +-- surfingkeys.js | 333 ++++++++++++++++++++++++--- vscode/vscode.vimrc | 48 ++-- win/.wslconfig | 19 +- win/Microsoft.PowerShell_profile.ps1 | 64 +---- win/readme.md | 9 +- win/setup_win.ps1 | 128 ++++++++++ win/setup_win_full.ps1 | 0 15 files changed, 611 insertions(+), 210 deletions(-) create mode 100644 powershell/keymap.ps1 create mode 100644 powershell/modules.ps1 create mode 100644 powershell/prompt.ps1 create mode 100644 win/setup_win.ps1 create mode 100644 win/setup_win_full.ps1 diff --git a/.gitignore b/.gitignore index 35878af..fbf3574 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ test.* *.tar *.zip *.tgz -WindowsTerminal.json \ No newline at end of file +WindowsTerminal.json +PowerToys/ \ No newline at end of file diff --git a/.npmrc b/.npmrc index 7549542..7bfb4b1 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -registry=https://registry.npmmirror.com +# registry=https://registry.npmmirror.com diff --git a/.obsidian.vimrc b/.obsidian.vimrc index 41199cc..585a791 100644 --- a/.obsidian.vimrc +++ b/.obsidian.vimrc @@ -1,42 +1,24 @@ " 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 " ๅ‘ไธ‹ -noremap e " ๅ‘ไธŠ -noremap i " ๅ‘ๅณ - - -""" 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 +" Word wrap +noremap n gj +noremap e gk +noremap i l + +" Similar position to i +noremap l i +noremap L I +" ne[k]st +noremap k n +noremap K N +" [j]ump +noremap j e +noremap J E + +" Y to yank to end of line +noremap Y y$ + """ Visual mode surrounding exmap addbold obcommand editor:toogle-bold exmap additalic obcommand editor:toogle-italic @@ -61,7 +43,7 @@ exmap vsplit obcommand workspace:split-vertical exmap hsplit obcommand workspace:split-horizontal map | :vsplit map - :hsplit -map bd +" map bd exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt map ai :chat @@ -69,6 +51,9 @@ map ai :chat exmap omnisearch obcommand omnisearch:show-modal map :omnisearch +exmap command-palette obcommand command-palette:open +map : :command-palette + """ g-commands exmap tsource obcommand editor:toggle-source nnoremap gs :tsource diff --git a/mac/Microsoft.PowerShell_profile.ps1 b/mac/Microsoft.PowerShell_profile.ps1 index 8f92c79..3d4e5d3 100644 --- a/mac/Microsoft.PowerShell_profile.ps1 +++ b/mac/Microsoft.PowerShell_profile.ps1 @@ -11,7 +11,7 @@ Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object # PowerShell Equivalents # -Set-Alias "curl" "Invoke-WebRequest" +# Set-Alias "curl" "Invoke-WebRequest" Set-Alias "man" "Get-Help" Set-Alias "kill" "Stop-Process" Set-Alias "open" "Invoke-Item" # Use ii instead of open diff --git a/powershell/keymap.ps1 b/powershell/keymap.ps1 new file mode 100644 index 0000000..f11c153 --- /dev/null +++ b/powershell/keymap.ps1 @@ -0,0 +1,25 @@ +# aka PSReadLine +# PSReadLineOptions +Set-PSReadLineOption -EditMode vi # Vi Keybindings +Set-PSReadLineOption -PredictionViewStyle ListView +Set-PSReadLineOption -PredictionSource HistoryAndPlugin +Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " +# PSReadLineKeyHandlers +## Colemak hnei +Set-PSReadLineKeyHandler -Chord "n" -Function NextHistory -ViMode Command +Set-PSReadLineKeyHandler -Chord "e" -Function PreviousHistory -ViMode Command +Set-PSReadLineKeyHandler -Chord "i" -Function ViForwardChar -ViMode Command +## Similar position to [i] in QWERTY +Set-PSReadLineKeyHandler -Chord "l" -Function ViInsertMode -ViMode Command +Set-PSReadlineKeyHandler -Chord "L" -Function ViInsertAtBegining -ViMode Command +## Ne{[k]s}t +Set-PSReadLineKeyHandler -Chord "k" -Function RepeatSearch -ViMode Command +Set-PSReadLineKeyHandler -Chord "K" -Function RepeatSearchBackward -ViMode Command +## [j]ump +Set-PSReadLineKeyHandler -Chord "j" -Function NextWordEnd -ViMode Command +Set-PSReadLineKeyHandler -Chord "J" -Function ViEndOfGlob -ViMode Command +## Use N to Join +Set-PSReadLineKeyHandler -Chord "N" -Function ViJoinLines -ViMode Command +Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape +Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine +Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine \ No newline at end of file diff --git a/powershell/modules.ps1 b/powershell/modules.ps1 new file mode 100644 index 0000000..6e0fe0c --- /dev/null +++ b/powershell/modules.ps1 @@ -0,0 +1,9 @@ +Import-Module -Name Terminal-Icons +Import-Module -Name CompletionPredictor +if ($IsWindows) { + # Chocolatey + $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } + # WinGet + Import-Module -Name Microsoft.WinGet.CommandNotFound #f45873b3-b655-43a6-b217-97c00aa0db58 +} \ No newline at end of file diff --git a/powershell/prompt.ps1 b/powershell/prompt.ps1 new file mode 100644 index 0000000..62f79c0 --- /dev/null +++ b/powershell/prompt.ps1 @@ -0,0 +1,86 @@ +$promptTime = $true +# $promptWeather = $false + +function prompt { + $prompt = "`e[35m" + # Time + if ($promptTime) { + $promptTime = Get-Date -Format HH:mm + $prompt += "`[$promptTime]" + } + # UserInfo + $prompt += " $Env:Username @ $Env:Userdomain" + # Directory + $promptCurrentDirectory = $(PWD).Path + $promptCurrentDirectory = $promptCurrentDirectory.Replace("$HOME", "~") + $prompt += "`e[0m in `e[33m$promptCurrentDirectory " + # Git + if ($(git rev-parse --is-inside-work-tree 2> $null) -eq "true") { + $prompt += "`e[32m`u{e702} $(git branch --show-current)" + } + # Conda + if ( $Env:CONDA_PROMPT_MODIFIER ) { + $promptConda = $Env:CONDA_PROMPT_MODIFIER.Replace("`(","").Replace(")","") + $pythonVersion = $(python --version).Split(" ")[1] + $prompt += " `e[33m`u{e73c} $promptConda $pythonVersion" + } + # Programming Language (by Get-ChildItem) + ## Python + if (Test-Path -Path "$PWD\pyproject.toml") { + $pythonVersion = $(python --version).Split(" ")[1] + $prompt += " `e[33m`u{e73c} $pythonVersion" + } + ## Node.js + if (Test-Path -Path "$PWD\package.json") { + $nodeVersion = $(node --version) + $prompt += " `e[32m`u{e3a0} $nodeVersion" + # Locked + if (Test-Path -Path "$PWD\yarn.lock" || Test-Path -Path "$PWD\package-lock.json") { + $prompt += "`u{f023}" + } + } + ## .NET + ### C Sharp + if (Test-Path -Path "$PWD\*.csproj") { + $dotnetVersion = $(dotnet --version) + $prompt += " `e[34m`u{e648} $dotnetVersion" + } + ### F Sharp + if (Test-Path -Path "$PWD\*.fsproj") { + $dotnetVersion = $(dotnet --version) + $prompt += " `e[35m`u{e65a} $dotnetVersion" + } + ## Rust + if (Test-Path -Path "$PWD\Cargo.toml") { + $rustVersion = $(cargo --version).Split(" ")[1] + $prompt += " `e[31m`u{e7a8} $rustVersion" + } + ## Java + if (Test-Path -Path "$PWD\pom.xml" || Test-Path -Path "$PWD\build.gradle") { + $javaVersion = $(java --version).Split(" ")[1] + $prompt += " `e[31m`u{e738} $javaVersion" + } + ## Makefile + if (Test-Path -Path "$PWD\Makefile") { + $prompt += " `e[32m`u{e673}" + } + if (Test-Path -Path "$PWD\CMakeLists.txt") { + $prompt += " `e[32m `u{e61d}" + } + # Docker + if (Test-Path -Path "$PWD\Dockerfile" || Test-Path -Path "$PWD\docker-compose.yml") { + $prompt += " `e[33m`u{f21f}" + } + # Weather + # if ( $global:promptWeather ) { + # $prompt += $(Write-WeatherCurrent -City "Edinburgh" -Country "UK" -Unit "metric" -Inline -Apikey $Env:WEATHER_API_KEY) + # } + # Error on last command + ## TODO: Seems does not work + if ($?) { + $prompt += "`n`e[32m PS > `e[0m" + } else { + $prompt += "`n`e[31m PS > `e[0m" + } + return $prompt +} \ No newline at end of file diff --git a/powershell/shared.ps1 b/powershell/shared.ps1 index bd7c77b..fabbb36 100644 --- a/powershell/shared.ps1 +++ b/powershell/shared.ps1 @@ -1,32 +1,16 @@ -### PSReadLine ### - -Set-PSReadLineOption -EditMode vi # Vi Keybindings -Set-PSReadLineOption -PredictionViewStyle ListView -Set-PSReadLineOption -PredictionSource HistoryAndPlugin -Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " -### Keybindings ### - -Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+f" -Function ForwardWord -Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+b" -Function BackwardWord -Set-PSReadLineKeyHandler -Chord "Alt+f" -Function ForwardChar -Set-PSReadLineKeyHandler -Chord "Ctrl+b" -Function BackwardChar -Set-PSReadLineKeyHandler -Chord "Ctrl+p" -Function HistorySearchBackward -Set-PSReadLineKeyHandler -Chord "Ctrl+n" -Function HistorySearchForward -Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine -Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine +### VARIABLES ### +$EDITOR = "code" ### Navigator ### # Relative navigation # - # ${function:~} = { Set-Location -Path ~ } cd is better ${function:...} = { Set-Location -Path ..\.. } ${function:....} = { Set-Location -Path ..\..\.. } ${function:.....} = { Set-Location -Path ..\..\..\.. } ${function:......} = { Set-Location -Path ..\..\..\..\.. } -# Absolute navigation # - +# Absolute navigation ${function:docs} = { Set-Location -Path ~/Documents } ${function:down} = { Set-Location -Path ~/Downloads } ${function:dt} = { Set-Location -Path ~/Desktop } @@ -37,25 +21,21 @@ ${function:doku} = { Set-Location -Path ~/doku && Get-ChildItem } ### Alias ### # Shell Equivalents # - Set-Alias "touch" "New-Item" ${function:ll} = { Get-ChildItem -Force } # Shell Configurations # - ${function:shcfg} = { code $PROFILE } Set-Alias "pwshcfg" "shcfg" ${function:reload} = { . $PROFILE } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } # Editors # - Set-Alias "v" "nvim" Set-Alias "c" "code" Set-Alias "gvi" "neovide" # File Creation # - function mkcd { param ( [string] $dirname) mkdir $dirname && Set-Location $dirname } function tc { param ( [string] $filename) New-Item $filename && code $filename } function tv { param ( [string] $filename) New-Item $filename && nvim $filename } @@ -64,13 +44,12 @@ function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem ### Dev ### # .NET # - ${function:csi} = { dotnet repl --default-kernel csharp} ${function:fsi} = { dotnet repl --default-kernel fsharp} # Python & Conda # - Set-Alias "py" "python" +Set-Alias "ipy" "ipython" ${function:pyact} = { conda activate $args[0] } ${function:pydact} = { conda deactivate } ${function:pylsenvs} = { conda env list } @@ -79,8 +58,3 @@ ${function:pyrmenv} = { conda remove --name $args[0] --all } # C & C++ # - - -### Modules ### - -Import-Module CompletionPredictor \ No newline at end of file diff --git a/surfingkeys.js b/surfingkeys.js index 7406ff4..b18c72e 100644 --- a/surfingkeys.js +++ b/surfingkeys.js @@ -1,4 +1,6 @@ // Paste this into surfingkeys advanced settings +// or use: +// Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/surfingkeys.js /** Examples @@ -17,29 +19,90 @@ api.unmap(''); */ // 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 +settings.showModeStatus = false; +// Keymap, reference https://github.com/texiwustion/colemak_config_for_surfingkeys/tree/main +const forward = { + add: function (key) { // ่ฝฌๅ‘ๅณๅฐ†่ขซ unmap ็š„้”ฎ + return api.map(`for${key}`, key) + }, + cancel: function (key) { // ๅˆ ้™ค่ฝฌๅ‘็”Ÿๆˆ็š„้”ฎ + api.unmap(`for${key}`) + api.unmap(key) + }, + use: function (key) { + return `for${key}` + } +} + +const colemak = { + forward: function (key) { // ่ฝฌๅ‘ๅณๅฐ†่ขซ unmap ็š„้”ฎ + api.map(key, `col${key}`) + api.unmap(`col${key}`) + + }, + use: function (key) { + return `col${key}` + }, + map: function (a, b) { + api.map(colemak.use(a), forward.use(b)) + } +} + +const forwardFactory = { + push: function (mapLists) { // forward original keys + for (let key in mapLists) { + forward.add(mapLists[key]) + } + }, + map: function (mapLists) { + for (let key in mapLists) { + colemak.map(key, mapLists[key]) + } + }, + pull: function (mapLists) { + for (let key in mapLists) { + forward.cancel(mapLists[key]) + } + for (let key in mapLists) { + colemak.forward(key) + } + } +} + +const mapLists = { + /// scroll page + // Arrow + 'n': 'j', + 'e': 'k', + 'i': 'l', + // l <-> i + 'l': 'i', + 'L': 'I', + // k <-> n + 'k': 'n', + 'K': 'N', + // j <-> e + 'j': 'e', + 'J': 'E', + // ็ผฉๆ”พ + 'zu': 'zi', + 'zo': 'ze', + 'zz': 'zr', +} + +forwardFactory.push(mapLists) +api.unmap('t') +forwardFactory.map(mapLists) +// ้ผ ๆ ‡็‚นๅ‡ป +api.unmap('gi') +api.unmap('[[') +api.unmap(']]') +api.unmap(';m') +api.unmap(';fs') +api.unmap('O') +api.unmap('C') +forwardFactory.pull(mapLists) -// 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) { @@ -62,42 +125,236 @@ api.addSearchAlias('r', 'Raindrop', 'https://app.raindrop.io/my/0/', 's', 'https }); -// Theme +// Theme, reference to https://github.com/Foldex/surfingkeys-config +api.Hints.style('border: solid 2px #4C566A; color:#A3BE8C; background: initial; background-color: #3B4252;'); +api.Hints.style("border: solid 2px #4C566A !important; padding: 1px !important; color: #E5E9F0 !important; background: #3B4252 !important;", "text"); +api.Visual.style('marks', 'background-color: #A3BE8C99;'); +api.Visual.style('cursor', 'background-color: #88C0D0;'); settings.theme = ` +fg: #E5E9F0; +bg: #3B4252; +bg-dark: #2E3440; +border: #4C566A; +main-fg: #88C0D0; +accent-fg: #A3BE8C; +info-fg: #5E81AC; +select: #4C566A; +/* ---------- Generic ---------- */ .sk_theme { - font-family: Input Sans Condensed, Charcoal, sans-serif; - font-size: 10pt; - background: #24272e; - color: #abb2bf; +background: var(--bg); +color: var(--fg); + background-color: var(--bg); + border-color: var(--border); + font-family: var(--font); + font-size: var(--font-size); + font-weight: var(--font-weight); } + +input { + font-family: var(--font); + font-weight: var(--font-weight); +} + .sk_theme tbody { - color: #fff; + color: var(--fg); } + .sk_theme input { - color: #d0d0d0; + color: var(--fg); } + +/* Hints */ +#sk_hints .begin { + color: var(--accent-fg) !important; +} + +#sk_tabs .sk_tab { + background: var(--bg-dark); + border: 1px solid var(--border); +} + +#sk_tabs .sk_tab_title { + color: var(--fg); +} + +#sk_tabs .sk_tab_url { + color: var(--main-fg); +} + +#sk_tabs .sk_tab_hint { + background: var(--bg); + border: 1px solid var(--border); + color: var(--accent-fg); +} + +.sk_theme #sk_frame { + background: var(--bg); + opacity: 0.2; + color: var(--accent-fg); +} + +/* ---------- Omnibar ---------- */ +/* Uncomment this and use settings.omnibarPosition = 'bottom' for Pentadactyl/Tridactyl style bottom bar */ +/* .sk_theme#sk_omnibar { + width: 100%; + left: 0; +} */ + +.sk_theme .title { + color: var(--accent-fg); +} + .sk_theme .url { - color: #61afef; + color: var(--main-fg); } + .sk_theme .annotation { - color: #56b6c2; + color: var(--accent-fg); } + .sk_theme .omnibar_highlight { - color: #528bff; + color: var(--accent-fg); } + .sk_theme .omnibar_timestamp { - color: #e5c07b; + color: var(--info-fg); } + .sk_theme .omnibar_visitcount { - color: #98c379; + color: var(--accent-fg); } + .sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) { - background: #303030; + background: var(--bg-dark); } + .sk_theme #sk_omnibarSearchResult ul li.focused { - background: #3e4452; + background: var(--border); } -#sk_status, #sk_find { - font-size: 20pt; + +.sk_theme #sk_omnibarSearchArea { + border-top-color: var(--border); + border-bottom-color: var(--border); +} + +.sk_theme #sk_omnibarSearchArea input, +.sk_theme #sk_omnibarSearchArea span { + font-size: var(--font-size); +} + +.sk_theme .separator { + color: var(--accent-fg); +} + +/* ---------- Popup Notification Banner ---------- */ +#sk_banner { + font-family: var(--font); + font-size: var(--font-size); + font-weight: var(--font-weight); + background: var(--bg); + border-color: var(--border); + color: var(--fg); + opacity: 0.9; +} + +/* ---------- Popup Keys ---------- */ +#sk_keystroke { + background-color: var(--bg); +} + +.sk_theme kbd .candidates { + color: var(--info-fg); +} + +.sk_theme span.annotation { + color: var(--accent-fg); +} + +/* ---------- Popup Translation Bubble ---------- */ +#sk_bubble { + background-color: var(--bg) !important; + color: var(--fg) !important; + border-color: var(--border) !important; +} + +#sk_bubble * { + color: var(--fg) !important; +} + +#sk_bubble div.sk_arrow div:nth-of-type(1) { + border-top-color: var(--border) !important; + border-bottom-color: var(--border) !important; +} + +#sk_bubble div.sk_arrow div:nth-of-type(2) { + border-top-color: var(--bg) !important; + border-bottom-color: var(--bg) !important; +} + +/* ---------- Search ---------- */ +#sk_status, +#sk_find { + font-size: var(--font-size); + border-color: var(--border); +} + +.sk_theme kbd { + background: var(--bg-dark); + border-color: var(--border); + box-shadow: none; + color: var(--fg); +} + +.sk_theme .feature_name span { + color: var(--main-fg); +} + +/* ---------- ACE Editor ---------- */ +#sk_editor { + background: var(--bg-dark) !important; + height: 50% !important; + /* Remove this to restore the default editor size */ +} + +.ace_dialog-bottom { + border-top: 1px solid var(--bg) !important; +} + +.ace-chrome .ace_print-margin, +.ace_gutter, +.ace_gutter-cell, +.ace_dialog { + background: var(--bg) !important; +} + +.ace-chrome { + color: var(--fg) !important; +} + +.ace_gutter, +.ace_dialog { + color: var(--fg) !important; +} + +.ace_cursor { + color: var(--fg) !important; +} + +.normal-mode .ace_cursor { + background-color: var(--fg) !important; + border: var(--fg) !important; + opacity: 0.7 !important; +} + +.ace_marker-layer .ace_selection { + background: var(--select) !important; +} + +.ace_editor, +.ace_dialog span, +.ace_dialog input { + font-family: var(--font); + font-size: var(--font-size); + font-weight: var(--font-weight); }`; // click `Save` button to make above settings to take effect. \ No newline at end of file diff --git a/vscode/vscode.vimrc b/vscode/vscode.vimrc index 5bab85e..ad3559a 100644 --- a/vscode/vscode.vimrc +++ b/vscode/vscode.vimrc @@ -1,29 +1,21 @@ -"vim.vimrc.path": "$HOME/.vscode.vimrc", // from vscode settings.json +" Put this in ~/.vscode.vimrc +" And go to vscode vim setting: + "vim.vimrc.path": "$HOME/.vscode.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 " ๅ‘ไธ‹ -noremap e " ๅ‘ไธŠ -noremap i " ๅ‘ๅณ +" Word wrap +noremap n gj +noremap e gk +noremap i l + +" Similar position to i +noremap l i +noremap L I +" ne[k]st +noremap k n +noremap K N +" [j]ump +noremap j e +noremap J E + +" Y to yank to end of line +noremap Y y$ \ No newline at end of file diff --git a/win/.wslconfig b/win/.wslconfig index 3a96c0c..6320c42 100644 --- a/win/.wslconfig +++ b/win/.wslconfig @@ -1,11 +1,10 @@ -; [wsl2] -; networkingMode=mirrored -; dnsTunneling=true -; firewall=true -; autoProxy=true +[wsl2] +networkingMode=mirrored +dnsTunneling=true +firewall=true +autoProxy=true -; [experimental] -; # requires dnsTunneling but are also OPTIONAL -; bestEffortDnsParsing=true -; useWindowsDnsCache=true -; hostAddressLoopback=true \ No newline at end of file +[experimental] +# requires dnsTunneling but are also OPTIONAL +bestEffortDnsParsing=true +hostAddressLoopback=true \ No newline at end of file diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index 72d2ccb..f818130 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -1,60 +1,33 @@ -### Variables ### - -$DOTFILES = "$HOME\Documents\.dotfiles" - ### Load Configs ### - +$DOTFILES = "$HOME\.dotfiles" Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_} Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_} ### Aliases ### # Shell Equivalents # - -Set-Alias "open" "Invoke-Item" # Use ii instead of explorer.exe +Set-Alias "grep" "Select-String" +${function:which} = { (Get-Command $args[0]).Path } # Shell Configurations # - ${function:shcfg} = { code $PROFILE } -${function:reload} = { . $PROFILE } +${function:reload} = { & $PROFILE } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } Set-Alias "pwshcfg" "shcfg" # C & C++ # - # Set-Alias "cl" "clang" # Set-Alias "clpp" "clang++" # ${function:clang} = { clang -std=c99 $args[0] } # ${function:clang++} = { clang -std=c++2b $args[0] } -# Python & Conda # - -Set-Alias "python3" "python" -Set-Alias "pip3" "pip" - -# Git # - -# Set-Alias "g" "git" -# Set-Alias "ginit" "git init" -# Set-Alias "ga" "git add" -# Set-Alias "gaa" "git add --all" -# Set-Alias "gc" "git commit --message" -# Set-Alias "gca" "git commit --all --message" -# Set-Alias "gcl" "git clone" -# Set-Alias "gclnh" "git clone --depth 1" -# Set-Alias "gs" "git status" -# Set-Alias "gpl" "git pull" -# Set-Alias "gps" "git push" - - # WSL # - ${function:wsl1} = {wsl.exe --distribution Debian} ${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04} +New-PSDrive -Name WSL -PSProvider FileSystem -Root \\wsl.localhost\Ubuntu-22.04 # Search Software # - -function Get-AppPackageListRemote { +function Find-AppPackageListRemote { param( [string]$Name ) @@ -68,16 +41,14 @@ function Get-AppPackageListRemote { Write-Host "=== choco ===" choco search $Name } - Set-Alias "pkgsearch" "Get-AppPackageListRemote" - function Get-AppPackageListLocal { winget list choco list scoop list } -# Toggle Theme # +# Toggle Theme # function Set-SystemTheme { $regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" $currentMode = Get-ItemProperty -Path $regPath -Name "AppsUseLightTheme" @@ -90,27 +61,14 @@ function Set-SystemTheme { Write-Host "ๅทฒๅˆ‡ๆขๅˆฐๆต…่‰ฒๆจกๅผ" } } - Set-Alias "theme" "Set-SystemTheme" # Miscs # -### Modules ### - -Import-Module -Name Microsoft.WinGet.CommandNotFound #f45873b3-b655-43a6-b217-97c00aa0db58 -Import-Module CompletionPredictor -# Import-Module syntax-highlighting # Buggy - ### 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 ## - #region conda initialize # !! Contents within this block are managed by 'conda init' !! If (Test-Path "$HOME\miniconda3\Scripts\conda.exe") { @@ -134,12 +92,6 @@ if (-not ($__lastStartup -eq $_currentDate)) { # ่ฎฐๅฝ•ๅฝ“ๅ‰ๆ—ฅๆœŸๅˆฐๆ—ฅๅฟ—ๆ–‡ไปถ $_currentDate | Out-File -FilePath $SystemlogFilePath -Append } - Remove-Variable SystemlogFilePath Remove-Variable __lastStartup -Remove-Variable _currentDate - -## Chocolatey ## - -$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" -if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } +Remove-Variable _currentDate \ No newline at end of file diff --git a/win/readme.md b/win/readme.md index f626b12..7f2740a 100644 --- a/win/readme.md +++ b/win/readme.md @@ -1,8 +1 @@ -# Configs for Windows - -## Navigator - -- [WSL Config](./.wslconfig) -- [Windows Terminal Config](./WindowsTerminal.json) -- [PowerShell Config](./Microsoft.PowerShell_profile.ps1) -- [Neovide](./neovide.toml) \ No newline at end of file +# Windows dotfiles \ No newline at end of file diff --git a/win/setup_win.ps1 b/win/setup_win.ps1 new file mode 100644 index 0000000..b8613e1 --- /dev/null +++ b/win/setup_win.ps1 @@ -0,0 +1,128 @@ +#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE +# Run with PowerShell 7 +# Use PowerShell as Administrator +winget install -e --id Git.Git +git clone https://github.com/js0ny/dotfiles.git ~\.dotfiles +Set-Location -Path ~\.dotfiles +Remove-Item -Force $PROFILE +$DOTFILES = "$HOME\.dotfiles" +New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" +. $PROFILE +# Install Scoop +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression +# Install Chocolatey +Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +# Set Dotfiles +New-Item -ItemType SymbolicLink -Path "~\.condarc" -Target "$DOTFILES\.condarc" +New-Item -ItemType SymbolicLink -Path "~\.gitconfig" -Target "$DOTFILES\.gitconfig" +New-Item -ItemType SymbolicLink -Path "~\.haskline" -Target "$DOTFILES\.haskline" +New-Item -ItemType SymbolicLink -Path "~\.ideavimrc" -Target "$DOTFILES\.ideavimrc" +New-Item -ItemType SymbolicLink -Path "~\.markdownlint.json" -Target "$DOTFILES\.markdownlint.json" +New-Item -ItemType SymbolicLink -Path "~\.npmrc" -Target "$DOTFILES\.npmrc" +New-Item -ItemType SymbolicLink -Path "~\.pip.conf" -Target "$DOTFILES\.pip.conf" +New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" +New-Item -ItemType SymbolicLink -Path "~\.vscode.vimrc" -Target "$DOTFILES\vscode\vscode.vimrc" +Get-ChildItem -Force -Filter .* | ForEach-Object { $_.Attributes += "Hidden" } # Hide dotfiles + +# Windows Terminal +if (Get-Command wt -ErrorAction SilentlyContinue) { + Write-Output "Windows Terminal (wt) installed" +} else { + winget install -e --id Microsoft.WindowsTerminal +} + +# Uninstall Windows Apps +Get-AppxPackage *solit* | Remove-AppxPackage # ็บธ็‰Œ +Get-AppxPackage *sound* | Remove-AppxPackage # ้Œ„้ŸณๆฉŸ +Get-AppxPackage *camera* | Remove-AppxPackage # ็›ธๆฉŸ +Get-AppxPackage *weather* | Remove-AppxPackage # ๅคฉๆฐฃ +Get-AppxPackage *Map* | Remove-AppxPackage # ๅœฐๅœ– +# Get-AppxPackage *clipchamp* | Remove-AppxPackage # ๅ…ถๅฏฆ้€™ๅ€‹้‚„่กŒ + +# Added Packages +scoop add bucket nerd-fonts +scoop add bucket extras + +# CLI Tools +winget install -e --id GnuWin32.Grep +winget install -e --id GnuWin32.Make +winget install -e --id GnuWin32.Which +winget install -e --id junegunn.fzf +winget install -e --id BurntSushi.ripgrep.MSVC +winget install -e --id JernejSimoncic.Wget +winget install -e --id GNU.Wget2 + +# File Management +winget install -e --id voidtools.Everything +winget install -e --id 7zip.7zip +winget install -e --id Bandisoft.Bandizip +winget install -e --id JohnMacFarlane.Pandoc +winget install -e --id SumatraPDF.SumatraPDF +winget install -e --id Google.GoogleDrive + +# System Enhancements +winget install -e --id Rem0o.FanControl +winget install -e --id Microsoft.PowerToys +winget install -e --id Guru3D.Afterburner +winget install -e --id Yuanli.uTools +winget install -e --id GeekUninstaller.GeekUninstaller +# winget install -e --id Flow-Launcher.Flow-Launcher +winget install -e --id AutoHotkey.AutoHotkey +winget install -e --id Mactype.Mactype +# winget install -e --id Nilesoft.Shell +# scoop install umi-ocr-paddle + +# Editor +winget install -e --id vim.vim +winget install -e --id Neovim.Neovim +winget install -e --id VSCodium.VSCodium +winget install -e --id Microsoft.VisualStudioCode +winget install -e --id Neovide.Neovide + +# Security +winget install -e --id Bitwarden.Bitwarden + +# PKM +winget install -e --id Obsidian.Obsidian +winget install -e --id B3log.SiYuan +winget install -e --id appmakes.Typora +winget install -e --id DigitalScholar.Zotero +winget install -e --id Anki.Anki +winget install -e --id Notion.Notion + +# Browser +winget install -e --id TheBrowserCompany.Arc +winget install -e --id Mozilla.Firefox.Nightly + +# Programming Languages +winget install -e --id Python.Python.3.12 +winget install -e --id Anaconda.Miniconda3 +winget install -e --id OpenJS.NodeJS +winget install -e --id Rustlang.Rustup +winget install -e --id Microsoft.DotNet.SDK.8 + +# Dev/IDE +winget install -e --id Docker.DockerDesktop +winget install -e --id JesseDuffield.lazygit + +# Gaming +winget install -e --id Valve.Steam + +# IME +winget install -e --id Rime.Weasel + +# Social +winget install -e --id 9N97ZCKPD60Q --source msstore # Unigram (Telegram client) +winget install -e --id Tencent.QQ.NT +winget install -e --id Tencent.WeChat + +# Others +winget install -e --id Appest.TickTick + +# Fonts +scoop install FiraCode-NF +scoop install CascadiaCode-NF +scoop install LXGWWenKai # ้œž้นœๆ–‡ๆฅท +scoop install LXGWWenKaiMono # ้œž้นœๆ–‡ๆฅทMono \ No newline at end of file diff --git a/win/setup_win_full.ps1 b/win/setup_win_full.ps1 new file mode 100644 index 0000000..e69de29