Xcode duplicate/delete line

前端 未结 22 1774
不思量自难忘°
不思量自难忘° 2020-12-04 04:59

Coming from Eclipse and having been used to duplicate lines all the time, it\'s pretty strange finding out that Xcode has no such function. Or does it?

I know it\'s

22条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 05:20

    As said above, close XCode and insert following to ~/Library/Application Support/Xcode/Key Bindings/ .pbxkeys inside in text section:

        ^D                                                                                                      
                                                                                                                    
            moveToLeftEndOfLine:                                                                               
            deleteToEndOfLine:                                                                                      
                                                                                                                   
        ^K                                                                                                      
                                                                                                                    
           selectLine:                                                                               
           copy:                                                                                     
           moveToEndOfLine:                                                                          
           insertNewline:                                                                            
           paste:                                                                                    
           deleteBackward:                                                                           
        
    

    Start XCode and enjoy CTRL-SHIFT-D and CTRL-SHIFT-K.
    If you want CTRL-D and CTRL-K, use ^d and ^k in key definitions instead. Ensure there are no duplicate key bindings in the file.

    Works fine for me with XCode 3.2

提交回复
热议问题