TextWrangler: teclas de atalho para mover a linha para cima / para baixo


Respostas:


4

Para o Mac OS X, é ctrl+ ou ctrl+ .

Pode ser necessário alterar as configurações das teclas de atalho do Controle da Missão (nas Preferências do Sistema), pois as duas teclas do teclado estão predefinidas.


1
Verificado, esta é a resposta correta
Alex

1
Funciona da mesma forma no BBEdit. O Text Wrangler foi "desativado" por Bare Bones (criadores do TextWrangler e BBEdit).
iaforek

2

Não há nada mencionado no manual (apenas caracteres e palavras do Exchange ).


Se o TextWrangler suportar o Cocoa Text System (que eu suspeito que não, mas ainda assim), você poderá criar o arquivo ~/Library/Keybindings/DefaultKeyBinding.dicte digitar o seguinte:

{
    "~\UF701" = (
        "moveToBeginningOfLine:",
        "deleteToEndOfLine:",
        "deleteForward:",
        "moveDown:",
        "yank:",
        "insertNewline:",
        "moveUp:"
    );
}

Isso adicionará o atalho Opt-DownArrowpara um comando de troca de linha (com a linha abaixo) a todos os aplicativos que suportam o sistema de texto Cocoa.


Se o TextWrangler não suportar isso: obtenha um editor de texto real. Até o TextMate suporta isso.
Daniel Beck

2

Eu não acho que o TextWrangler tenha isso incorporado.

Porém, você pode executar scripts de maçã no TextWrangler, para que isso funcione. Eu até encontrei alguns scripts para fazer isso.

Você precisará substituir o BBEdit pelo TextWrangler nos scripts de maçãs. Coloque os scripts em "~ / Library / Application Support / TextWrangler / Scripts /" e eles aparecerão no menu de scripts do TextWrangler. Clique em Janela -> Paletas -> Scripts para visualizar a paleta de scripts, onde é possível definir atalhos de teclado personalizados.


Se você deseja atribuir esses itens a Option-Up (⌥ ↑) e Down, você pode usar a preferência do sistema de teclado. O TextWrangler não me permitiu usar "Option" (⌥) como um modificador. Agora funciona muito elegante.
Klaas

0

A solução nathangs funciona muito bem. Mas o link fornecido não funciona mais. Então, aqui estão os scripts como texto simples. Basta colá-los no "AppleScript Editor" e salvá-los em ~ / Library / Application Support / TextWrangler / Scripts /

Funciona bem no Mountain Lion e com o TextWrangler 4.

MoveLineDown.scpt:

tell application "TextWrangler"
    set x to startLine of selection
    tell text 1 of window 1
        if x = (count of lines) then return
        set myline to contents of line x
        delete line x
        if length of line x = 0 then
            make line at line x with data "
"
            make line at line (x + 1) with data myline
        else
            make line at line x with data myline

        end if
        select insertion point before line (x + 1)
    end tell
end tell

MoveLineUp.scpt:

tell application "TextWrangler"
    set x to startLine of selection
    if x = 1 then
        beep
        return
    end if
    tell text 1 of window 1
        set oldCount to count of lines
        set myline to contents of line x
        delete line x
        if x = 2 then
            if length of line 1 = 0 then
                make line at beginning with data "
"
            end if
            make line at beginning with data myline
        else
            if length of line (x - 2) = 0 then
                make line at line (x - 2) with data "
"
                make line at line (x - 1) with data myline
            else
                make line at line (x - 2) with data myline
            end if
        end if
        select insertion point before line (x - 1)
    end tell
end tell
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.