diff --git a/.profile.ps1 b/.profile.ps1 index ea933c5..f336ed1 100644 --- a/.profile.ps1 +++ b/.profile.ps1 @@ -17,6 +17,26 @@ Set-Alias -Name python3 -Value python # Functions +function d-up { + docker compose up --build -d +} +function d-bash { + docker exec -it "$1" /bin/bash +} +function d-down { + docker compose down -v +} +function d-down-up { + d-down + d-up +} +function d-logs { + docker compose logs -f -t +} +function d-ps { + docker compose ps -a +} + function cdli { Set-Location "C:\repos\litium" } diff --git a/AppData/Local/nvim/lua/config/options.lua b/AppData/Local/nvim/lua/config/options.lua index c08ef0e..d96fc18 100644 --- a/AppData/Local/nvim/lua/config/options.lua +++ b/AppData/Local/nvim/lua/config/options.lua @@ -64,3 +64,10 @@ vim.opt.scrolloff = 10 -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.opt.confirm = true + +-- set LF instead of CRLF +vim.opt.fileformats = { 'unix', 'dos' } +vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { + pattern = { '*.sh', '*.xml' }, + command = 'setlocal ff=unix', +}) diff --git a/AppData/Local/nvim/lua/kickstart/plugins/neo-tree.lua b/AppData/Local/nvim/lua/kickstart/plugins/neo-tree.lua index 4f9c905..aa707d9 100644 --- a/AppData/Local/nvim/lua/kickstart/plugins/neo-tree.lua +++ b/AppData/Local/nvim/lua/kickstart/plugins/neo-tree.lua @@ -23,6 +23,19 @@ return { }, }, filesystem = { + follow_current_file = { + enabled = true, + }, + filtered_items = { + always_show = { + '.gitignore', + '.gitattributes', + }, + always_show_by_pattern = { + '.gitlab*', + '*.env', + }, + }, window = { mappings = { ['\\'] = 'close_window', diff --git a/AppData/Local/nvim/lua/plugins/nvim-lspconfig.lua b/AppData/Local/nvim/lua/plugins/nvim-lspconfig.lua index 72763b4..5202f69 100644 --- a/AppData/Local/nvim/lua/plugins/nvim-lspconfig.lua +++ b/AppData/Local/nvim/lua/plugins/nvim-lspconfig.lua @@ -256,6 +256,8 @@ return { powershell_es = {}, intelephense = {}, bashls = {}, + docker_language_server = {}, + docker_compose_language_service = {}, } -- Ensure the servers and tools above are installed diff --git a/requirements.ps1 b/requirements.ps1 index 68c27f3..aeab961 100644 --- a/requirements.ps1 +++ b/requirements.ps1 @@ -1,3 +1,144 @@ +param ( + [Alias('h', '?')] + [switch]$Help, + [Alias('no-winget')] + [switch]$NoWinget, + [Alias('only-winget')] + [switch]$OnlyWinget, + [Alias('install-extras')] + [switch]$Extras, + [Alias('only-extras')] + [switch]$OnlyExtras, + [Alias('no-choco')] + [switch]$NoChoco, + [Alias('only-choco')] + [switch]$OnlyChoco, + [Alias('no-powershell')] + [switch]$NoPowershell, + [Alias('only-powershell')] + [switch]$OnlyPowershell, + [Alias('no-pip')] + [switch]$NoPip, + [Alias('only-pip')] + [switch]$OnlyPip, + [Alias('no-npm')] + [switch]$NoNpm, + [Alias('only-npm')] + [switch]$OnlyNpm, + [Alias('no-fonts')] + [switch]$NoFonts, + [Alias('only-fonts')] + [switch]$OnlyFonts, + [Alias('no-wallpaper')] + [switch]$NoWallpaper, + [Alias('only-wallpaper')] + [switch]$OnlyWallpaper +) + +if ($Help) +{ + @" +requirements.ps1 – Install system requirements + +USAGE: + requirements.ps1 [options] + +OPTIONS: + -no-winget Disable installation via winget + -no-choco Disable installation via Chocolatey + -no-powershell Disable PowerShell module installation + -no-pip Disable Python pip package installation + -install-extras Install optional / extra components + -help, -h, -? Show this help message and exit + +NOTES: + • Use single-dash options for best compatibility: + -no-winget -no-choco + + • Double-dash options (--no-winget) only work in PowerShell 7+ (pwsh) + +EXAMPLES: + requirements.ps1 -no-winget -no-choco + requirements.ps1 -install-extras + pwsh requirements.ps1 --no-winget --no-pip +"@ + exit 0 +} + +function Write-Divider +{ + Write-Host "################################################################################" +} + +$Flags = [ordered]@{ + WingetEnabled = -not $NoWinget + ExtrasEnabled = $Extras + ChocoEnabled = -not $NoChoco + PowershellEnabled = -not $NoPowershell + PipEnabled = -not $NoPip + NpmEnabled = -not $NoNpm + FontsEnabled = -not $NoFonts + WallpaperEnabled = -not $NoWallpaper +} + +function Reset-Flags +{ + foreach ($key in @($Flags.Keys)) + { + $Flags[$key] = $false + } +} + +if ($OnlyWinget) +{ + Reset-Flags + $Flags.WingetEnabled = $true +} +if ($OnlyExtras) +{ + Reset-Flags + $Flags.ExtrasEnabled = $true +} +if ($OnlyChoco) +{ + Reset-Flags + $Flags.ChocoEnabled = $true +} +if ($OnlyPowershell) +{ + Reset-Flags + $Flags.PowershellEnabled = $true +} +if ($OnlyPip) +{ + Reset-Flags + $Flags.PipEnabled = $true +} +if ($OnlyNpm) +{ + Reset-Flags + $Flags.NpmEnabled = $true +} +if ($OnlyFonts) +{ + Reset-Flags + $Flags.FontsEnabled = $true +} +if ($OnlyWallpaper) +{ + Reset-Flags + $Flags.WallpaperEnabled = $true +} + +Write-Host "These providers are enabled:" +foreach ($key in $Flags.Keys) +{ + if ($Flags[$key]) + { + Write-Host $key + } +} + # Install requirements via winget # Important stuff $packages = @( @@ -16,50 +157,113 @@ $packages = @( "Python.Python.3.10", # isort "JernejSimoncic.Wget", # nvim "7zip.7zip" # nvim - "rustlang.rustup" + "rustlang.rustup", + "Mozilla.Firefox" ) - -foreach ($package in $packages) -{ - winget install $package -} - -# Install latest node LTS -fnm install 22 -fnm use 22 - -cd ~ - -npm install # mostly nvim deps - -## Nvim requirements from choco, needs to be run as admin -Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig" - -## Nvim requirements from pip -python -m pip install debugpy neovim pillow - -## Git posh -Install-Module posh-git -Scope CurrentUser -Force - -# extras, make flag for these - -$packages = @( +$ExtraPackages = @( "mRemoteNG.mRemoteNG", - "mozilla.firefox.developeredition", "Microsoft.VisualStudio.2022.Community", "JetBrains.Resharper", "Microsoft.powertoys", "spotify.spotify", "microsoft.azuredatastudio", "mozilla.thunderbird", - "yubico.authenticator", "Postman.Postman", "docker.dockerdesktop" ) -# Iterate through each package and install it -foreach ($package in $packages) +if ($Flags.WingetEnabled) { - winget install $package + Write-Divider + Write-Host "Installing Winget Packages" + foreach ($package in $packages) + { + winget install $package + } } +if ($Flags.ExtrasEnabled) +{ + Write-Divider + Write-Host "Installing Extra Winget Packages" + foreach ($package in $ExtraPackages) + { + winget install $package + } +} + +if ($Flags.NpmEnabled) +{ + Write-Divider + Write-Host "Installing Npm Packages" + fnm install 22 + fnm use 22 + Set-Location ~ + npm install +} + +if ($Flags.ChocoEnabled) +{ + Write-Divider + Write-Host "Installing Chocolatey Packages" + ## Nvim requirements from choco, needs to be run as admin + Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig" +} + +if ($Flags.PipEnabled) +{ + Write-Divider + Write-Host "Installing pip Packages" + ## Nvim requirements from pip + python -m pip install debugpy neovim pillow +} + +if ($Flags.PowershellEnabled) +{ + Write-Divider + Write-Host "Installing Powershell Packages" + ## Git posh + Install-Module posh-git -Scope CurrentUser -Force +} + +if ($Flags.FontsEnabled) +{ + Write-Divider + Write-Host "Installing Fonts" + Set-Location ~ + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip + mkdir ~\fonts + Copy-Item ~\JetBrainsMono.zip ~\fonts\JetBrainsMono.zip + Set-Location ~\fonts | Out-Null + unzip JetBrainsMono.zip + Remove-Item JetBrainsMono.zip + $FontsPath = "$HOME\fonts" + + $shell = New-Object -ComObject Shell.Application + $fonts = $shell.Namespace(0x14) + + Get-ChildItem $FontsPath -Include *.ttf,*.otf -File | ForEach-Object { + $fonts.CopyHere($_.FullName) + } + Set-Location ~ + Remove-Item ~\fonts -Force -Recurse| Out-Null +} + +if ($Flags.WallpaperEnabled) +{ + Write-Divider + Write-Host "Setting Wallpaper" + Add-Type @" +using System; +using System.Runtime.InteropServices; +public class Wallpaper { + [DllImport("user32.dll", SetLastError = true)] + public static extern bool SystemParametersInfo( + int uAction, int uParam, string lpvParam, int fuWinIni); +} +"@ -ErrorAction SilentlyContinue + + [Wallpaper]::SystemParametersInfo(20, 0, "$HOME\wallpaper.png", 0x03) | Out-Null +} +Write-Divider +Write-Host "Done!"