diff --git a/EthanBrown.SublimeText2.UtilPackages/EthanBrown.SublimeText2.UtilPackages.nuspec b/EthanBrown.SublimeText2.UtilPackages/EthanBrown.SublimeText2.UtilPackages.nuspec new file mode 100644 index 0000000..7d827ab --- /dev/null +++ b/EthanBrown.SublimeText2.UtilPackages/EthanBrown.SublimeText2.UtilPackages.nuspec @@ -0,0 +1,97 @@ + + + + EthanBrown.SublimeText2.UtilPackages + Sublime Text 2 - Utility / Theme Tooling Packages + 0.0.1 + Various + Ethan Brown + A number of packages helpful for increased editor productivity, including Soda theme, a number of file manipulation and/or searching type commands. + Includes a number of very useful packages for Sublime Text 2. + + Included + =========================================================================== + + - AdvancedNewFile + https://github.com/skuroda/Sublime-AdvancedNewFile + + - ConsoleExec + https://github.com/joeyespo/sublimetext-console-exec + + - EncodingHelper + https://github.com/SublimeText/EncodingHelper + + - KeymapManager + https://github.com/welefen/KeymapManager + + - MoveTab + https://github.com/SublimeText/MoveTab + + - Navigation History + https://github.com/timjrobinson/SublimeNavigationHistory + + - Open Recent Files + https://github.com/spadgos/sublime-OpenRecentFiles + + - OpenSearchResult + https://github.com/abrookins/OpenSearchResult + + - RecentActiveFiles + https://github.com/jugyo/SublimeRecentActiveFiles + + - Search Anywhere + https://github.com/ericmartel/Sublime-Text-2-Search-Anywhere-Plugin + + - SideBarEnhancements + https://github.com/titoBouzout/SideBarEnhancements/ + + - Sublime Files + https://github.com/al63/SublimeFiles + + - Theme - Soda + https://github.com/buymeasoda/soda-theme + + Disables + =========================================================================== + - Caret History + - GotoRecent + - MultiTaskBuild + - Open Related + - QuickFileMove + - SublimeREPL + + Customized Key Bindings + =========================================================================== + https://github.com/Iristyle/SublimeKeyMap.Util + + Additional Package Preferences + =========================================================================== + SublimeFiles - Set terminal location, try ConEmu, Console2, Powershell, Cmd + + Additional User Preferences + =========================================================================== + Rules for + - closing empty window + - highlight modified tabs + - Soda theme + + http://github.com/Iristyle/ChocolateyPackages/ + SublimeText package editor + + false + https://raw.github.com/Iristyle/ChocolateyPackages/master/SublimeText2.app/Sublime_Text.png + + + + + + + + + + + + + diff --git a/EthanBrown.SublimeText2.UtilPackages/tools/Package Control.sublime-settings b/EthanBrown.SublimeText2.UtilPackages/tools/Package Control.sublime-settings new file mode 100644 index 0000000..b6990e1 --- /dev/null +++ b/EthanBrown.SublimeText2.UtilPackages/tools/Package Control.sublime-settings @@ -0,0 +1,28 @@ +{ + "installed_packages": + [ + "AdvancedNewFile", + "ConsoleExec", + "EncodingHelper", + "KeymapManager", + "MoveTab", + "Navigation History", + "Open Recent Files", + "OpenSearchResult", + "Package Control", + "RecentActiveFiles", + "Search Anywhere", + "SideBarEnhancements", + "Sublime Files", + "Theme - Soda", + "ZZZ.EthanBrown.SublimeKeyMap.Util" + ], + "package_name_map": { + "SublimeKeyMap.Util": "ZZZ.EthanBrown.SublimeKeyMap.Util" + }, + "repositories": + [ + "https://github.com/abrookins/OpenSearchResult", + "https://github.com/Iristyle/SublimeKeyMap.Util" + ] +} diff --git a/EthanBrown.SublimeText2.UtilPackages/tools/Preferences.sublime-settings b/EthanBrown.SublimeText2.UtilPackages/tools/Preferences.sublime-settings new file mode 100644 index 0000000..ab9f5e5 --- /dev/null +++ b/EthanBrown.SublimeText2.UtilPackages/tools/Preferences.sublime-settings @@ -0,0 +1,14 @@ +{ + "close_windows_when_empty": true, + "highlight_modified_tabs": true, + "ignored_packages": + [ + "Caret History", + "GotoRecent", + "MultiTaskBuild", + "Open Related", + "QuickFileMove", + "SublimeREPL" + ], + "theme": "Soda Dark.sublime-theme" +} diff --git a/EthanBrown.SublimeText2.UtilPackages/tools/SublimeFiles.sublime-settings b/EthanBrown.SublimeText2.UtilPackages/tools/SublimeFiles.sublime-settings new file mode 100644 index 0000000..e1e9278 --- /dev/null +++ b/EthanBrown.SublimeText2.UtilPackages/tools/SublimeFiles.sublime-settings @@ -0,0 +1,3 @@ +{ + "term_command": "{{term_command}}" +} diff --git a/EthanBrown.SublimeText2.UtilPackages/tools/chocolateyInstall.ps1 b/EthanBrown.SublimeText2.UtilPackages/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..6219ee4 --- /dev/null +++ b/EthanBrown.SublimeText2.UtilPackages/tools/chocolateyInstall.ps1 @@ -0,0 +1,47 @@ +$package = 'EthanBrown.SublimeText2.UtilPackages' + +function Get-CurrentDirectory +{ + $thisName = $MyInvocation.MyCommand.Name + [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) +} + +# simulate the unix command for finding things in path +# http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell +function Which([string]$cmd) +{ + Get-Command -ErrorAction "SilentlyContinue" $cmd | + Select -ExpandProperty Definition +} + +try { + . (Join-Path (Get-CurrentDirectory) 'JsonHelpers.ps1') + . (Join-Path (Get-CurrentDirectory) 'SublimeHelpers.ps1') + + $sublimeUserDataPath = Get-SublimeUserPath + $sublimeFilesFileName = 'SublimeFiles.sublime-settings' + $sublimeFiles = Join-Path (Get-CurrentDirectory) $sublimeFilesFileName + + # TODO: this doesn't actually work in the Sublime plugin right now, but might in the future + $ps = (Which powershell) + $psRoot = Split-Path $ps + + $escapedPs = $ps -replace '\\', '\\' + ([IO.File]::ReadAllText($sublimeFiles)) -replace '{{term_command}}', $escapedPs | + Out-File -FilePath (Join-Path $sublimeUserDataPath $sublimeFilesFileName) -Force -Encoding ASCII + + $packageControl = (Join-Path (Get-CurrentDirectory) 'Package Control.sublime-settings') + Merge-PackageControlSettings -FilePath $packageControl + + $preferences = (Join-Path (Get-CurrentDirectory) 'Preferences.sublime-settings') + Merge-Preferences -FilePath $preferences + + if (Get-Process -Name sublime_text -ErrorAction SilentlyContinue) + { + Write-Warning 'Please close and re-open Sublime Text to force packages to update' + } + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/core/JsonHelpers.ps1 b/core/JsonHelpers.ps1 index c7683ca..9ffcf38 100644 --- a/core/JsonHelpers.ps1 +++ b/core/JsonHelpers.ps1 @@ -127,7 +127,15 @@ function Merge-JsonSimpleMap $currentHash = $Destination.$Name $SimpleMap.PSObject.Properties | % { - $currentHash.($_.Name) = $_.Value + if (!$currentHash.($_.Name)) + { + $currentHash | + Add-Member -Name ($_.Name) -Value $_.Value -MemberType NoteProperty + } + else + { + $currentHash.($_.Name) = $_.Value + } } } }