Just to be clear, I can copy and paste just fine from my web browsers to sublime text. The problem is if I save the code snippet (I just pasted) to a file, then, try to execute the script, my command-interpreter (powershell, for example) complains about: ‘Out-Host’ (from the code snippet shown below).
The font I’m using for the Windows command-line Powershell is Consolas (one of two available fonts for powershell or windows legacy command interpreter). So, it’s not like I’m using an unusual/unpopular font. My Sublime font also uses an extremely popular Windows font, Lucida Console (which is also one of the 2 compatible fonts meant for Windows command-line).
So, since ALL the code snippets I copy and paste (from any website) are specifically meant for Powershell, what’s causing the problem?
All I want to do is for Powershell to automatically save the text I paste into it into a Windows command-line friendly character set; without the extra hassle of trying to convert charactersets manually. I’m hoping that’s not too much to expect from Sublime Text.
stackoverflow.com/questions/1078 … 71#1083771
EDIT: It looks like the problem is revolved around “smartquote incompatibility”. Im hoping there’s a way for sublime text to know how to handle smartquotes.
I did find a forum post to show how to make a “straight quote” setting for sublime text. Straighten Quotes option? I am successfully able to use the new added Edit menu option “Staighten Quotes” to resolve the issue. Very simple! I have a feeling this is about as automatic as it gets for dealing with these kinds of characters. I’m not sure if there’s a way to have that automatically happen when those characters are detected.
PS: How do make Sublime Forums send me an email when people reply to my posts? I dont see an option like that anywhere.
[code]function more2
{
param(
[Parameter(ValueFromPipeline=$true)]
[System.Management.Automation.PSObject]$InputObject
)
begin
{
$type = [System.Management.Automation.CommandTypes]::Cmdlet
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(‘Out-Host’, $type)
$scriptCmd = {& $wrappedCmd @PSBoundParameters -Paging }
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
}
process
{
try
{
$steppablePipeline.Process($_)
}
catch
{
break;
}
}
end
{
$steppablePipeline.End()
}
#.ForwardHelpTargetName Out-Host
#.ForwardHelpCategory Cmdlet
}
New-Alias more more2[/code]