2013-08-02 115 views
23

崇高的文本word_separator是:崇高文本word_separator駝峯

"word_separators": "./\\()\"'-:,.;<>[email protected]#$%^&*|+=[]{}`~?", 

我也想在駝峯情況的變化被認爲是變化的。有沒有設置/方法來做到這一點?

(例如在FooBar ctrl + bck_space中應該只刪除Bar)。

+4

按ALT代替CTRL – Taylan

+0

Alt + Delete鍵是不受約束。 – atamanroman

回答

40

在活動的任何人仍在尋找這個...

在您的默認鍵綁定,你會發現:

{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} }, 
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "word_ends", "forward": true} }, 
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} }, 
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} }, 

{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} }, 
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} }, 
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} }, 
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} }, 

使用ALT +方向將移動「子詞」,而不是「單詞」,這考慮到駝峯。我更喜歡在默認情況下,所以我已經將alt +方向集複製到我的用戶鍵盤綁定中,並用ctrl替換了alt的實例。瞧,ctrl +方向移動camelCase以及定義的單詞分隔符。

此外,我不確定是否使用subwords設置將考慮下劃線,我總是添加_到單詞分隔符只是爲了確保。

+1

作爲旁註:此設置似乎只適用於Windows。在Mac上,「Alt + Left」是「按字移動」的系統默認值 - 我必須在用戶定義的鍵綁定首選項中手動將'Super + Left'映射到'移動子字符' – Philipp

+0

子字詞分隔符只是' '並從大寫變成小寫。 'foo1bar'有1個子字,'foo1Bar'有2個子字(foo1 + Bar),'foo_bar'有2個子字(foo_ + bar) – Philipp

+0

@ Philipp對我來說Alt + Left也可以在OS X中使用。_下劃線)不是默認的單詞分隔符,因此您必須將其自己添加到Preferences.sublime-用戶設置中。 –

3

移動,而不是刪除使用ALT作品而已,但我發現一些作品相當不錯:

刪除前(ALT +刪除):

delete_subword.sublime-macro: 
[ 
    { 
     "command": "move", 
     "args": { 
     "by": "subwords", 
     "extend": true, 
     "forward": false 
     } 

    }, 
    { 
     "args": null, 
     "command": "left_delete" 
    } 
] 

刪除向後(alt +退格)

delete_subword_forward.sublime-macro: 
[ 
    { 
     "command": "move", 
     "args": { 
     "by": "subwords", 
     "extend": true, 
     "forward": true 
     } 
    }, 
    { 
     "args": null, 
     "command": "right_delete" 
    } 
] 

將它保存到您的用戶目錄中。現在,您綁定鍵是這樣的:

{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/User/delete_subword.sublime-macro"} }, 
{ "keys": ["alt+delete"], "command": "run_macro_file", "args": {"file": "Packages/User/delete_subword_forward.sublime-macro"} }, 

Source

0

Alt + W vim的模式崇高的文本3對我的作品穿越駝峯的話