├── bin ├── dnglab.exe └── RunHidden.exe ├── README.md ├── install.ps1 ├── TempSettingsBackup.json ├── .gitconfig ├── LICENSE ├── sync-data.ps1 ├── auto-hot-key.ahk ├── nvim └── init.lua ├── Microsoft.PowerShell_profile.ps1 └── windows-terminal └── settings.json /bin/dnglab.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cutbypham/dotfiles/HEAD/bin/dnglab.exe -------------------------------------------------------------------------------- /bin/RunHidden.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cutbypham/dotfiles/HEAD/bin/RunHidden.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Config for windows, nothing fancy, minimal nvim for coding, pwsh for easy life in windows 2 | 3 | The fedora linux config backup in the v4 tag for the fancy programming focus 4 | 5 | **Windows Apps:** 6 | - https://github.com/nulloy/nulloy (Music player) 7 | 8 | **Firefox** 9 | 10 | ```js 11 | full-screen-api.transition-duration.enter = "0 0" 12 | full-screen-api.transition-duration.leave = "0 0" 13 | ``` 14 | -------------------------------------------------------------------------------- /install.ps1: -------------------------------------------------------------------------------- 1 | winget install --id=yt-dlp.yt-dlp -e 2 | winget install --id=sharkdp.fd -e 3 | winget install --id=mbuilov.sed -e 4 | winget install --id=junegunn.fzf -e 5 | winget install --id=BurntSushi.ripgrep.MSVC -e 6 | winget install --id=MilosParipovic.OneCommander -e 7 | winget install --id=Obsidian.Obsidian -e 8 | winget install --id=OBSProject.OBSStudio -e 9 | winget install --id=jurplel.qView -e 10 | winget install neovim 11 | winget install hwmonitor 12 | cp .gitconfig ~\ 13 | -------------------------------------------------------------------------------- /TempSettingsBackup.json: -------------------------------------------------------------------------------- 1 | { 2 | "userSettings": { 3 | "PC_REM": { 4 | "OCTaskmaster.Properties.Settings": { 5 | "AutoScroll": "True", 6 | "ClearCompleted": "False", 7 | "CloseOnComplete": "True", 8 | "ConcurrentJobs": "16", 9 | "HideOnClose": "True", 10 | "KeepFolderDate": "True", 11 | "ShowJobDetailsPane": "False", 12 | "TaskbarDisplayEnabled": "True", 13 | "TaskmasterMode": "update", 14 | "ThemeName": "Dark", 15 | "WindowExpandedWidth": "800", 16 | "WindowPlacement": "{\"length\":44,\"flags\":0,\"showCmd\":1,\"ptMinPosition\":\"-1, -1\",\"ptMaxPosition\":\"-1, -1\",\"rcNormalPosition\":\"989, 246, 1369, 466\"}" 17 | } 18 | }, 19 | "roaming": { 20 | "OCTaskmaster.Properties.Settings": { 21 | "KeepFileDates": "True", 22 | "KeepFolderDate": "True" 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = cutbypham 3 | email = cutbypham@gmail.com 4 | 5 | [core] 6 | editor = nvim 7 | whitespace = fix 8 | excludesfile = ~/.gitignore 9 | 10 | [merge] 11 | tool = vimdiff 12 | 13 | [mergetool] 14 | prompt = true 15 | 16 | [mergetool "vimdiff"] 17 | cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' 18 | 19 | [difftool] 20 | prompt = false 21 | 22 | [diff] 23 | tool = vimdiff 24 | colorMoved = zebra 25 | 26 | [credential "https://github.com"] 27 | helper = !/usr/bin/gh auth git-credential 28 | 29 | [pull] 30 | rebase = true 31 | 32 | [fetch] 33 | prune = true 34 | 35 | [pager] 36 | diff = delta 37 | log = delta 38 | reflog = delta 39 | show = delta 40 | 41 | [delta] 42 | light = true 43 | side-by-side = true 44 | line-numbers = true 45 | 46 | [apply] 47 | whitespace = fix 48 | 49 | [color] 50 | ui = true 51 | diff = true 52 | status = true 53 | branch = true 54 | interactive = true 55 | [filter "lfs"] 56 | clean = git-lfs clean -- %f 57 | smudge = git-lfs smudge -- %f 58 | process = git-lfs filter-process 59 | required = true 60 | [http] 61 | postBuffer = 524288000 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /sync-data.ps1: -------------------------------------------------------------------------------- 1 | function auto-git-commit() { 2 | git add . 3 | git commit -m "Auto commit" 4 | git pull 5 | git push 6 | } 7 | 8 | cd E:\Music\Club_DJ 9 | yt-dlp --external-downloader aria2c --external-downloader-args '-x 8 -j 2' --download-archive archive.txt --extract-audio --audio-format mp3 --embed-thumbnail --embed-metadata --add-metadata -o "%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLg3vjVhK1vnb1Cmhctb4ZtlCidx2Y1iTR" 10 | cd E:\Music\Bar_DJ 11 | yt-dlp --external-downloader aria2c --external-downloader-args '-x 8 -j 2' --download-archive archive.txt --extract-audio --audio-format mp3 --embed-thumbnail --embed-metadata --add-metadata -o "%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLg3vjVhK1vnbSSaCPsCygbh-_8jbnx0e6" 12 | cd - 13 | 14 | cp $profile ~\repos\dotfiles\ 15 | cp C:\Users\master\AppData\Local\nvim\init.lua ~\repos\dotfiles\nvim 16 | cp C:\Users\master\.gitconfig ~\repos\dotfiles\ 17 | cp C:\Users\master\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json ~\repos\dotfiles\windows-terminal\ 18 | cp C:\Users\master\AppData\Roaming\Mozilla\Firefox\Profiles\3wr0grx7.default-release\user.js ~\repos\dotfiles\ 19 | 20 | cd C:\Users\master\repos\dotfiles 21 | auto-git-commit 22 | 23 | cd C:\Users\master\repos\rss-to-email-once-a-day 24 | auto-git-commit 25 | 26 | cd C:\Users\master\repos\davinci-resolve\ 27 | auto-git-commit 28 | 29 | ############################################################# 30 | ############################################################# 31 | ############################################################# 32 | 33 | $LogFile = "C:\Users\master\Documents\sync-data-log.txt" 34 | 35 | function Write-Log { 36 | param([string]$Message) 37 | $timestamp = Get-Date -Format "yyyy/MM/dd HH:mm:ss" 38 | $entry = "$timestamp $Message" 39 | Add-Content -Path $LogFile -Value $entry -Encoding UTF8 40 | } 41 | 42 | Write-Log "Script finished" 43 | -------------------------------------------------------------------------------- /auto-hot-key.ahk: -------------------------------------------------------------------------------- 1 | ;#KeyHistory 2 | #Persistent 3 | #noenv 4 | #singleinstance force 5 | #installmousehook 6 | #installkeybdhook 7 | #MaxHotkeysPerInterval 9999 8 | setbatchlines -1 9 | listlines off 10 | sendmode input 11 | setworkingdir %a_scriptdir% 12 | CoordMode, Mouse, Screen 13 | 14 | #o::suspend 15 | 16 | #ifwinactive, ahk_exe onecommander.exe 17 | !s::send ^{tab} 18 | !w::send ^+{tab} 19 | ^e::send {f2} 20 | #ifwinactive 21 | 22 | #ifwinactive, ahk_exe Sononym.exe 23 | ^f:: 24 | Send ^f 25 | sleep 100 26 | Send ^a 27 | return 28 | !f:: 29 | send !{backspace} 30 | return 31 | #ifwinactive 32 | 33 | #SingleInstance, Force 34 | 35 | `; & d:: 36 | send +v 37 | send {del} 38 | return 39 | `; & j:: 40 | send +v 41 | send ^+, 42 | return 43 | `; & l:: 44 | send +v 45 | send ^+. 46 | return 47 | `; & 3:: 48 | send m 49 | send {esc} 50 | send {del} 51 | return 52 | 53 | `;::send {;} 54 | +`;::send +{;} 55 | !`;::send !{;} 56 | #`;::send #{;} 57 | #ifwinactive 58 | 59 | #ifwinactive ahk_exe chrome.exe 60 | ^o::send ^+a 61 | !t::send !+c 62 | !w::send ^{pgup} 63 | !s::send ^{pgdn} 64 | 65 | !d::send !{left} 66 | !e::send !{right} 67 | #ifwinactive 68 | 69 | #ifwinactive ahk_exe windowsterminal.exe 70 | !w::send ^{pgup} 71 | !s::send ^{pgdn} 72 | 73 | f13::^+t 74 | #ifwinactive 75 | 76 | movingwindowtootherdisplay() { 77 | send #+{left} 78 | sysget, monitors, monitorcount 79 | 80 | sysget, monitorcount, monitorcount 81 | sysget, monitorprimary, monitorprimary 82 | 83 | current := 0 84 | loop, %monitorcount% 85 | { 86 | sysget, monitor, monitor, %a_index% 87 | coordmode, mouse, screen 88 | mousegetpos, mousex, mousey 89 | if ( (mousex >= monitorleft) && (mousex < monitorright) && (mousey >= monitortop) && (mousey < monitorbottom) ) 90 | { 91 | current := a_index 92 | currentrx := (mousex - monitorleft) / (monitorright - monitorleft) 93 | currentry := (mousey - monitortop) / (monitorbottom - monitortop) 94 | break 95 | } 96 | } 97 | next := current + 1 98 | 99 | if (next > monitorcount) 100 | next := 1 101 | sysget, monitor, monitor, %next% 102 | 103 | newx := monitorleft + currentrx*(monitorright - monitorleft) 104 | newy := monitortop + currentry*(monitorbottom - monitortop) 105 | 106 | dllcall("setcursorpos", "int", newx, "int", newy) 107 | dllcall("setcursorpos", "int", newx, "int", newy) 108 | } 109 | 110 | JumpCursorBetweenMonitors() { 111 | MouseGetPos, MouseX, MouseY ; Get current mouse position 112 | SysGet, MonitorCount, MonitorCount ; Get number of monitors 113 | 114 | if (MonitorCount < 2) { 115 | MsgBox, You need at least two monitors for this script to work. 116 | return 117 | } 118 | 119 | ; Get dimensions of both monitors 120 | SysGet, M1, Monitor, 1 121 | SysGet, M2, Monitor, 2 122 | 123 | ; Determine which monitor the mouse is currently on 124 | if (MouseX >= M1Left && MouseX <= M1Right && MouseY >= M1Top && MouseY <= M1Bottom) { 125 | ; Move to monitor 2 126 | NewX := MouseX - M1Left + M2Left 127 | NewY := MouseY - M1Top + M2Top 128 | MouseMove, NewX, NewY 129 | } else { 130 | ; Move to monitor 1 131 | NewX := MouseX - M2Left + M1Left 132 | NewY := MouseY - M2Top + M1Top 133 | MouseMove, NewX, NewY 134 | } 135 | } 136 | 137 | togglemaxwindow() 138 | { 139 | winget, winstate, minmax, a 140 | if (winstate = 1) 141 | { 142 | winrestore, a 143 | } 144 | else 145 | { 146 | winmaximize, a 147 | } 148 | } 149 | 150 | tab & e::run, "f:\projects\" 151 | tab & w::run, "c:\users\master\downloads\" 152 | tab & r::run, "e:\render\" 153 | tab & 2::run, "e:\obs\" 154 | tab & 3::run, "c:\users\master\" 155 | tab & 4::run, "f:\Sound" 156 | 157 | tab & wheeldown::volume_up 158 | tab & wheelup::volume_down 159 | tab & =::volume_up 160 | tab & -::volume_down 161 | 162 | tab & ]:: 163 | send ^#v 164 | sleep 250 165 | send {enter} 166 | sleep 250 167 | send {esc} 168 | return 169 | 170 | tab & \:: 171 | send ^#v 172 | sleep 250 173 | send {down} 174 | sleep 250 175 | send {enter} 176 | sleep 250 177 | send {esc} 178 | return 179 | 180 | tab::tab 181 | 182 | space & bs::send ^#c 183 | 184 | space & a::^#1 185 | space & s::^#2 186 | space & d::^#3 187 | space & f::^#4 188 | space & q::^#5 189 | space & w::^#6 190 | 191 | space & v::^!v 192 | 193 | space & u::pgup 194 | space & p::pgdn 195 | 196 | space & z::movingwindowtootherdisplay() 197 | 198 | space & rbutton::RButton 199 | 200 | space & f13::bs 201 | space & g::delete 202 | 203 | space & i::home 204 | space & o::end 205 | 206 | space & k::up 207 | space & j::down 208 | space & l::right 209 | space & h::left 210 | 211 | space & tab:: 212 | send {mbutton} 213 | send !{f4} 214 | return 215 | 216 | space & 0::reload 217 | 218 | space::send {space} 219 | +space::send +{space} 220 | !space::send !{space} 221 | #space::send #{space} 222 | ^space::send ^{space} 223 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = " " 2 | vim.g.maplocalleader = " " 3 | vim.keymap.set("n", ";;", ":q!") 4 | vim.keymap.set("n", ";s", ":w") 5 | 6 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 7 | if not vim.loop.fs_stat(lazypath) then 8 | vim.fn.system({ 9 | "git", 10 | "clone", 11 | "--filter=blob:none", 12 | "https://github.com/folke/lazy.nvim.git", 13 | "--branch=stable", -- latest stable release 14 | lazypath, 15 | }) 16 | end 17 | vim.opt.rtp:prepend(lazypath) 18 | 19 | require("lazy").setup({ 20 | { 21 | "romainl/vim-cool", 22 | }, 23 | { 24 | "stevearc/oil.nvim", 25 | opts = { 26 | skip_confirm_for_simple_edits = true, 27 | view_options = { 28 | show_hidden = true, 29 | }, 30 | keymaps = { 31 | ["q"] = { 32 | callback = function() 33 | require("oil").close() 34 | vim.cmd("close") 35 | end, 36 | }, 37 | }, 38 | }, 39 | }, 40 | { 41 | "nvim-lua/plenary.nvim", 42 | event = "VeryLazy", 43 | }, 44 | { 45 | "nvim-pack/nvim-spectre", 46 | requires = { {'nvim-lua/plenary.nvim'} }, 47 | event = "VeryLazy", 48 | cmd = "Spectre", 49 | opts = { open_cmd = "noswapfile vnew" }, 50 | -- stylua: ignore 51 | keys = { 52 | { "r", function() require("spectre").open() end, desc = "Replace in files (Spectre)" }, 53 | }, 54 | }, 55 | { 56 | 'nvim-telescope/telescope.nvim', tag = '0.1.4', 57 | requires = { {'nvim-lua/plenary.nvim'} }, 58 | event = "VeryLazy", 59 | } 60 | }) 61 | 62 | vim.opt.background = "light" 63 | vim.cmd('colorscheme shine') 64 | 65 | local builtin = require('telescope.builtin') 66 | vim.keymap.set('n', 'f', builtin.find_files, {}) 67 | vim.keymap.set('n', 'g', builtin.live_grep, {}) 68 | vim.keymap.set('n', 'b', builtin.buffers, {}) 69 | vim.keymap.set('n', ';', builtin.commands, {}) 70 | 71 | vim.opt.clipboard = "unnamedplus" 72 | 73 | vim.opt.mouse = "a" 74 | vim.opt.swapfile = false 75 | vim.opt.completeopt = "menuone,noinsert,noselect" 76 | 77 | vim.opt.number = true 78 | vim.opt.relativenumber = true 79 | vim.opt.showmatch = true 80 | vim.opt.ignorecase = true 81 | vim.opt.smartcase = true 82 | vim.opt.wrap = true 83 | vim.opt.linebreak = true 84 | vim.opt.showbreak = "↪" 85 | vim.opt.scrolloff = 5 86 | vim.opt.termguicolors = true 87 | vim.opt.statusline = " %F %m %< %= %r %q" 88 | vim.opt.cursorline = true 89 | vim.opt.laststatus = 0 90 | vim.opt.winbar = "%=%F" 91 | vim.opt.shell = "pwsh.exe" 92 | 93 | vim.opt.hidden = true 94 | vim.opt.history = 100 95 | vim.opt.lazyredraw = true 96 | vim.opt.updatetime = 100 97 | vim.opt.undofile = true 98 | 99 | vim.opt.tabstop = 4 100 | vim.opt.softtabstop = 4 101 | vim.opt.shiftwidth = 4 102 | vim.opt.expandtab = true 103 | vim.opt.smartindent = true 104 | 105 | vim.keymap.set("n", "n", "nzzzv") 106 | vim.keymap.set("n", "N", "Nzzzv") 107 | vim.keymap.set("n", "*", "*zz") 108 | vim.keymap.set("n", "#", "#zz") 109 | 110 | vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 111 | vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 112 | 113 | vim.keymap.set("n", "", "<") 114 | vim.keymap.set("n", "", "-") 115 | vim.keymap.set("n", "", "+") 116 | vim.keymap.set("n", "", ">") 117 | 118 | vim.keymap.set("x", "<", "", ">gv") 120 | 121 | vim.keymap.set("n", "gf", ":cd %:h:edit ") 122 | 123 | vim.keymap.set("n", "", "") 124 | 125 | vim.keymap.set("n", "k", "s:e %:h", { silent = true }) 126 | 127 | vim.keymap.set("n", "h", "v:e %:h", { silent = true }) 128 | 129 | vim.api.nvim_command [[command! -nargs=0 CopyFullFilePath let @+ = expand('%:p')]] 130 | vim.api.nvim_command [[command! -nargs=0 EditNeovimConfig edit C:\Users\master\AppData\Local\nvim\init.lua]] 131 | vim.api.nvim_command [[command! -nargs=0 EditPowerShellConfig edit C:\Users\master\Documents\PowerShell\Microsoft.PowerShell_profile.ps1]] 132 | vim.api.nvim_command [[command! -nargs=0 EditNote edit C:\Users\master\Documents\note.txt]] 133 | vim.api.nvim_command [[command! -nargs=0 EditWindowsTerminalConfig edit C:\Users\master\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json]] 134 | vim.api.nvim_command [[command! -nargs=0 EditDataSync edit C:\Users\master\repos\dotfiles\sync-data.ps1]] 135 | vim.api.nvim_command [[command! -nargs=0 EditAutoHotkey edit C:\Users\master\repos\dotfiles\auto-hot-key.ahk]] 136 | vim.api.nvim_command [[command! -nargs=0 EditAutoHotkeySnippets edit C:\Users\master\repos\dotfiles\lib\snippets.ahk]] 137 | vim.api.nvim_command [[command! -nargs=0 EditFirefoxProfile edit C:\Users\master\AppData\Roaming\Mozilla\Firefox\Profiles\3wr0grx7.default-release\user.js]] 138 | vim.api.nvim_command [[command! -nargs=0 EditRSS edit C:\Users\master\repos\rss-to-email-once-a-day\src\feeds.ts]] 139 | 140 | local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) 141 | 142 | vim.api.nvim_create_autocmd("TextYankPost", { 143 | callback = function() 144 | vim.highlight.on_yank() 145 | end, 146 | group = highlight_group, 147 | pattern = "*", 148 | }) 149 | 150 | vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, { 151 | callback = function() 152 | local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline") 153 | if ok and cl then 154 | vim.wo.cursorline = true 155 | vim.api.nvim_win_del_var(0, "auto-cursorline") 156 | end 157 | end, 158 | }) 159 | 160 | vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, { 161 | callback = function() 162 | local cl = vim.wo.cursorline 163 | if cl then 164 | vim.api.nvim_win_set_var(0, "auto-cursorline", cl) 165 | vim.wo.cursorline = false 166 | end 167 | end, 168 | }) 169 | 170 | -- Restore cursor position 171 | vim.api.nvim_create_autocmd({ "BufReadPost" }, { 172 | pattern = { "*" }, 173 | callback = function() 174 | vim.api.nvim_exec('silent! normal! g`"zv', false) 175 | end, 176 | }) 177 | -------------------------------------------------------------------------------- /Microsoft.PowerShell_profile.ps1: -------------------------------------------------------------------------------- 1 | Set-PSReadLineOption -EditMode vi 2 | 3 | $env:EDITOR = 'nvim' 4 | 5 | function Restart-Explorer { 6 | Stop-Process -ProcessName explorer -Force 7 | Start-Process explorer.exe 8 | } 9 | 10 | function dji { 11 | $proxyPath = ".\proxy" 12 | 13 | # Check if "proxy" folder exists; if not, create it 14 | if (-not (Test-Path -Path $proxyPath)) { 15 | New-Item -ItemType Directory -Path $proxyPath 16 | } 17 | 18 | # Get all .LRF files in the current directory 19 | $lrfFiles = Get-ChildItem -Path . -Filter *.LRF 20 | 21 | foreach ($file in $lrfFiles) { 22 | # Define new file name with .mp4 extension 23 | $newName = [System.IO.Path]::ChangeExtension($file.Name, ".mp4") 24 | 25 | # Move and rename file to proxy folder 26 | Move-Item -Path $file.FullName -Destination (Join-Path -Path $proxyPath -ChildPath $newName) 27 | } 28 | exit 29 | } 30 | 31 | function v() { 32 | nvim . 33 | } 34 | 35 | function edit-startscript() { 36 | nvim "C:\Users\master\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\startup-script.bat" 37 | } 38 | 39 | function change-dir-fzf() { 40 | $folder = fd --type directory --exclude scoop --exclude go --exclude .vscode --exclude bundle --exclude .git --exclude gems --exclude node_modules | fzf --height 50% --min-height 20 --reverse 41 | Set-Location $folder 42 | } 43 | Set-Alias c change-dir-fzf 44 | 45 | function cc() { 46 | cd 47 | change-dir-fzf 48 | } 49 | 50 | function firefox-profile() { 51 | cd C:\Users\master\AppData\Roaming\Mozilla\Firefox\Profiles\ouyze0q0.default 52 | } 53 | 54 | function edit-file-fzf() { 55 | $file = fd --hidden --type file . | fzf --height 50% --min-height 20 --reverse 56 | nvim $file 57 | } 58 | Set-Alias e edit-file-fzf 59 | 60 | function edit-powershell-config() { nvim $profile } 61 | 62 | function edit-nvim-config() { nvim C:\Users\master\AppData\Local\nvim\init.lua } 63 | 64 | function d() { 65 | aria2c --max-connection-per-server=16 --split=10 --enable-http-pipelining=true --max-overall-download-limit=0 --file-allocation=falloc --disk-cache=32M --seed-time=0 "$args" 66 | } 67 | 68 | function update-dotfiles() { 69 | cp $profile ~\repos\dotfiles\ 70 | cp C:\Users\master\AppData\Local\nvim\init.lua ~\repos\dotfiles\nvim 71 | cd ~\repos\dotfiles\ 72 | git add Microsoft.PowerShell_profile.ps1 73 | git add nvim\init.lua 74 | git commit -m "pwsh, nvim" 75 | git push 76 | git add . 77 | git commit -m "👌Auto commit" 78 | git pull 79 | git push 80 | cd - 81 | } 82 | 83 | Import-Module PSReadLine 84 | Set-PSReadLineOption -PredictionViewStyle ListView 85 | Set-PSReadLineOption -PredictionSource History 86 | 87 | function q() { Exit } 88 | 89 | function s() { git status --short --branch } 90 | 91 | function git-commit { 92 | git status --short --branch 93 | git diff 94 | git add . 95 | git commit 96 | } 97 | Set-Alias a git-commit 98 | 99 | function auto-git-commit() { 100 | git add . 101 | git commit -m "👌Auto commit" 102 | git pull 103 | git push 104 | } 105 | Set-Alias aa auto-git-commit 106 | 107 | function auto-git-commit-format() { 108 | pnpm format 109 | git add . 110 | git commit -m "👌Auto commit" 111 | git pull 112 | git push 113 | } 114 | Set-Alias aaa auto-git-commit-format 115 | 116 | function p() { git push } 117 | 118 | function Get-ChildItem-Hidden() { Get-ChildItem -Force } 119 | Set-Alias ls Get-ChildItem-Hidden 120 | Set-Alias l Get-ChildItem-Hidden 121 | 122 | function Get-ChildItem-Hidden-Wide() { Get-ChildItem -Force | Format-Wide } 123 | Set-Alias la Get-ChildItem-Hidden-Wide 124 | 125 | function .. { Set-location .. } 126 | 127 | function ... { Set-location .. ; Set-location .. } 128 | 129 | function tmp() { 130 | Set-location -Path $env:temp 131 | } 132 | 133 | function dow() { 134 | Set-location -Path $env:USERPROFILE\Downloads\ 135 | } 136 | 137 | function doc() { 138 | Set-location -Path $env:USERPROFILE\Documents\ 139 | } 140 | 141 | function which ($command) { 142 | Get-Command -Name $command -ErrorAction SilentlyContinue | 143 | Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue 144 | } 145 | 146 | function update() { 147 | winget upgrade --all --force 148 | update-dotfiles 149 | } 150 | 151 | function download-video( ) { 152 | yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' $args 153 | } 154 | Set-Alias dv download-video 155 | Set-Alias y yt-dlp 156 | 157 | function download-audio() { 158 | yt-dlp --extract-audio --continue --add-metadata --embed-thumbnail --audio-format mp3 --audio-quality 0 --metadata-from-title="%(artist)s - %(title)s" "$args" 159 | } 160 | Set-Alias da download-audio 161 | 162 | function download-thumbnail() { 163 | yt-dlp --skip-download --write-thumbnail --convert-thumbnails png "$args" 164 | } 165 | Set-Alias dt download-thumbnail 166 | 167 | function download-music() { 168 | yt-dlp --cookies-from-browser firefox --download-archive archive.txt --extract-audio --audio-format mp3 --embed-thumbnail --embed-metadata --add-metadata -o "%(title)s.%(ext)s" "$args" 169 | } 170 | Set-Alias dm download-music 171 | 172 | function download-youtube-video-to-watch-offline() { 173 | mkdir ~\Downloads\YouTube\ > $null 2>&1 174 | cd ~\Downloads\YouTube\ 175 | yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' (Get-Clipboard) 176 | cd - 177 | } 178 | function yy() { 179 | download-youtube-video-to-watch-offline 180 | exit 181 | } 182 | 183 | function ls-mb() { 184 | ls | Select-Object Name, @{Name="MegaBytes";Expression={$_.Length / 1MB}} 185 | } 186 | 187 | function ls-kb() { 188 | ls | Select-Object Name, @{Name="KiloBytes";Expression={$_.Length / 1KB}} 189 | } 190 | 191 | new-alias grep select-string 192 | 193 | new-alias unzip Expand-Archive 194 | 195 | Set-PSReadLineOption -EditMode Windows 196 | $PSDefaultParameterValues['Out-File:NoClobber'] = $true 197 | function Set-Location { 198 | param( 199 | [string]$Path 200 | ) 201 | Microsoft.PowerShell.Management\Set-Location $Path 202 | Write-Host "`e]9;9;$(Get-Location)`a" 203 | } 204 | 205 | Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { 206 | param($wordToComplete, $commandAst, $cursorPosition) 207 | [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() 208 | $Local:word = $wordToComplete.Replace('"', '""') 209 | $Local:ast = $commandAst.ToString().Replace('"', '""') 210 | winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { 211 | [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) 212 | } 213 | } 214 | 215 | # Import the Chocolatey Profile that contains the necessary code to enable 216 | # tab-completions to function for `choco`. 217 | # Be aware that if you are missing these lines from your profile, tab completion 218 | # for `choco` will not function. 219 | # See https://ch0.co/tab-completion for details. 220 | $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" 221 | if (Test-Path($ChocolateyProfile)) { 222 | Import-Module "$ChocolateyProfile" 223 | } 224 | -------------------------------------------------------------------------------- /windows-terminal/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$help": "https://aka.ms/terminal-documentation", 3 | "$schema": "https://aka.ms/terminal-profiles-schema", 4 | "actions": 5 | [ 6 | { 7 | "command": 8 | { 9 | "action": "copy", 10 | "singleLine": false 11 | }, 12 | "id": "User.copy.644BA8F2" 13 | }, 14 | { 15 | "command": "paste", 16 | "id": "User.paste" 17 | }, 18 | { 19 | "command": 20 | { 21 | "action": "prevTab" 22 | }, 23 | "id": "User.prevTab.0" 24 | }, 25 | { 26 | "command": "duplicateTab", 27 | "id": "User.duplicateTab" 28 | }, 29 | { 30 | "command": 31 | { 32 | "action": "splitPane", 33 | "split": "auto", 34 | "splitMode": "duplicate" 35 | }, 36 | "id": "User.splitPane.A6751878" 37 | }, 38 | { 39 | "command": "find", 40 | "id": "User.find" 41 | }, 42 | { 43 | "command": 44 | { 45 | "action": "commandPalette" 46 | }, 47 | "id": "User.commandPalette.D3F0B923" 48 | }, 49 | { 50 | "command": 51 | { 52 | "action": "nextTab" 53 | }, 54 | "id": "User.nextTab.0" 55 | } 56 | ], 57 | "copyFormatting": "none", 58 | "copyOnSelect": true, 59 | "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", 60 | "disableAnimations": true, 61 | "keybindings": 62 | [ 63 | { 64 | "id": null, 65 | "keys": "ctrl+tab" 66 | }, 67 | { 68 | "id": null, 69 | "keys": "ctrl+shift+d" 70 | }, 71 | { 72 | "id": null, 73 | "keys": "ctrl+shift+tab" 74 | }, 75 | { 76 | "id": "User.copy.644BA8F2", 77 | "keys": "ctrl+c" 78 | }, 79 | { 80 | "id": "User.find", 81 | "keys": "ctrl+shift+f" 82 | }, 83 | { 84 | "id": null, 85 | "keys": "ctrl+v" 86 | }, 87 | { 88 | "id": null, 89 | "keys": "alt+shift+d" 90 | }, 91 | { 92 | "id": "User.duplicateTab", 93 | "keys": "ctrl+shift+t" 94 | }, 95 | { 96 | "id": "User.commandPalette.D3F0B923", 97 | "keys": "ctrl+shift+p" 98 | }, 99 | { 100 | "id": "User.splitPane.A6751878", 101 | "keys": "alt+/" 102 | }, 103 | { 104 | "id": "User.nextTab.0", 105 | "keys": "ctrl+pgdn" 106 | }, 107 | { 108 | "id": "User.prevTab.0", 109 | "keys": "ctrl+pgup" 110 | } 111 | ], 112 | "launchMode": "maximized", 113 | "newTabMenu": 114 | [ 115 | { 116 | "type": "remainingProfiles" 117 | } 118 | ], 119 | "profiles": 120 | { 121 | "defaults": 122 | { 123 | "colorScheme": "Github Light" 124 | }, 125 | "list": 126 | [ 127 | { 128 | "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 129 | "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", 130 | "hidden": false, 131 | "name": "Windows PowerShell" 132 | }, 133 | { 134 | "commandline": "%SystemRoot%\\System32\\cmd.exe", 135 | "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", 136 | "hidden": false, 137 | "name": "Command Prompt" 138 | }, 139 | { 140 | "commandline": "\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" -nologo", 141 | "font": 142 | { 143 | "face": "JetBrains Mono NL", 144 | "size": 11 145 | }, 146 | "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", 147 | "hidden": false, 148 | "name": "PowerShell", 149 | "source": "Windows.Terminal.PowershellCore" 150 | }, 151 | { 152 | "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", 153 | "hidden": false, 154 | "name": "Azure Cloud Shell", 155 | "source": "Windows.Terminal.Azure" 156 | }, 157 | { 158 | "guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}", 159 | "hidden": false, 160 | "name": "Git Bash", 161 | "source": "Git" 162 | } 163 | ] 164 | }, 165 | "schemes": 166 | [ 167 | { 168 | "background": "#000000", 169 | "black": "#0C0C0C", 170 | "blue": "#0037DA", 171 | "brightBlack": "#767676", 172 | "brightBlue": "#3B78FF", 173 | "brightCyan": "#61D6D6", 174 | "brightGreen": "#16C60C", 175 | "brightPurple": "#B4009E", 176 | "brightRed": "#E74856", 177 | "brightWhite": "#F2F2F2", 178 | "brightYellow": "#F9F1A5", 179 | "cursorColor": "#FFFFFF", 180 | "cyan": "#3A96DD", 181 | "foreground": "#FFFFFF", 182 | "green": "#13A10E", 183 | "name": "Color Scheme 18", 184 | "purple": "#881798", 185 | "red": "#C50F1F", 186 | "selectionBackground": "#FFFFFF", 187 | "white": "#CCCCCC", 188 | "yellow": "#C19C00" 189 | }, 190 | { 191 | "background": "#FFFFFF", 192 | "black": "#24292F", 193 | "blue": "#0969DA", 194 | "brightBlack": "#57606A", 195 | "brightBlue": "#218BFF", 196 | "brightCyan": "#3192AA", 197 | "brightGreen": "#1A7F37", 198 | "brightPurple": "#A475F9", 199 | "brightRed": "#A40E26", 200 | "brightWhite": "#8C959F", 201 | "brightYellow": "#633C01", 202 | "cursorColor": "#1F2328", 203 | "cyan": "#1B7C83", 204 | "foreground": "#1F2328", 205 | "green": "#116329", 206 | "name": "Github Light", 207 | "purple": "#8250DF", 208 | "red": "#CF222E", 209 | "selectionBackground": "#BBDFFF", 210 | "white": "#6E7781", 211 | "yellow": "#4D2D00" 212 | }, 213 | { 214 | "background": "#282828", 215 | "black": "#282828", 216 | "blue": "#458588", 217 | "brightBlack": "#928374", 218 | "brightBlue": "#83A598", 219 | "brightCyan": "#8EC07C", 220 | "brightGreen": "#B8BB26", 221 | "brightPurple": "#D3869B", 222 | "brightRed": "#FB4934", 223 | "brightWhite": "#EBDBB2", 224 | "brightYellow": "#FABD2F", 225 | "cursorColor": "#FFFFFF", 226 | "cyan": "#689D6A", 227 | "foreground": "#EBDBB2", 228 | "green": "#98971A", 229 | "name": "Gruvbox Dark", 230 | "purple": "#B16286", 231 | "red": "#CC241D", 232 | "selectionBackground": "#FFFFFF", 233 | "white": "#A89984", 234 | "yellow": "#D79921" 235 | }, 236 | { 237 | "background": "#282C34", 238 | "black": "#282C34", 239 | "blue": "#61AFEF", 240 | "brightBlack": "#5A6374", 241 | "brightBlue": "#61AFEF", 242 | "brightCyan": "#56B6C2", 243 | "brightGreen": "#98C379", 244 | "brightPurple": "#C678DD", 245 | "brightRed": "#E06C75", 246 | "brightWhite": "#DCDFE4", 247 | "brightYellow": "#E5C07B", 248 | "cursorColor": "#FFFFFF", 249 | "cyan": "#56B6C2", 250 | "foreground": "#DCDFE4", 251 | "green": "#98C379", 252 | "name": "One Half Dark (Copy 2)", 253 | "purple": "#C678DD", 254 | "red": "#E06C75", 255 | "selectionBackground": "#FFFFFF", 256 | "white": "#DCDFE4", 257 | "yellow": "#E5C07B" 258 | }, 259 | { 260 | "background": "#282C34", 261 | "black": "#282C34", 262 | "blue": "#61AFEF", 263 | "brightBlack": "#5A6374", 264 | "brightBlue": "#61AFEF", 265 | "brightCyan": "#56B6C2", 266 | "brightGreen": "#98C379", 267 | "brightPurple": "#C678DD", 268 | "brightRed": "#E06C75", 269 | "brightWhite": "#DCDFE4", 270 | "brightYellow": "#E5C07B", 271 | "cursorColor": "#FFFFFF", 272 | "cyan": "#56B6C2", 273 | "foreground": "#DCDFE4", 274 | "green": "#98C379", 275 | "name": "One Half Dark (Copy 3)", 276 | "purple": "#C678DD", 277 | "red": "#E06C75", 278 | "selectionBackground": "#FFFFFF", 279 | "white": "#DCDFE4", 280 | "yellow": "#E5C07B" 281 | }, 282 | { 283 | "background": "#282C34", 284 | "black": "#282C34", 285 | "blue": "#61AFEF", 286 | "brightBlack": "#5A6374", 287 | "brightBlue": "#61AFEF", 288 | "brightCyan": "#56B6C2", 289 | "brightGreen": "#98C379", 290 | "brightPurple": "#C678DD", 291 | "brightRed": "#E06C75", 292 | "brightWhite": "#DCDFE4", 293 | "brightYellow": "#E5C07B", 294 | "cursorColor": "#FFFFFF", 295 | "cyan": "#56B6C2", 296 | "foreground": "#DCDFE4", 297 | "green": "#98C379", 298 | "name": "One Half Dark (Copy 4)", 299 | "purple": "#C678DD", 300 | "red": "#E06C75", 301 | "selectionBackground": "#FFFFFF", 302 | "white": "#DCDFE4", 303 | "yellow": "#E5C07B" 304 | }, 305 | { 306 | "background": "#282C34", 307 | "black": "#282C34", 308 | "blue": "#61AFEF", 309 | "brightBlack": "#5A6374", 310 | "brightBlue": "#61AFEF", 311 | "brightCyan": "#56B6C2", 312 | "brightGreen": "#98C379", 313 | "brightPurple": "#C678DD", 314 | "brightRed": "#E06C75", 315 | "brightWhite": "#DCDFE4", 316 | "brightYellow": "#E5C07B", 317 | "cursorColor": "#FFFFFF", 318 | "cyan": "#56B6C2", 319 | "foreground": "#DCDFE4", 320 | "green": "#98C379", 321 | "name": "One Half Dark (Copy)", 322 | "purple": "#C678DD", 323 | "red": "#E06C75", 324 | "selectionBackground": "#FFFFFF", 325 | "white": "#DCDFE4", 326 | "yellow": "#E5C07B" 327 | } 328 | ], 329 | "theme": "system", 330 | "themes": [], 331 | "windowingBehavior": "useAnyExisting" 332 | } 333 | --------------------------------------------------------------------------------