Coder Social home page Coder Social logo

marvinxcode's Introduction

Marvin for Xcode

####Marvin is a plugin for Xcode, it adds a large collection of text selections, duplication and deletion commands.

Accessible via Xcode -> Edit -> Marvin

It includes the following commands (some might seem obvious but some need a little more detail to describe its function and value).

  • Delete Line
  • Duplicate Line
  • Join Line
  • Move To EOL and Insert LF
  • Select Current Word
  • Select Line Contents
    • This differs a bit from Select Line as it will exclude whitespace characters until it reaches the first valid character at both the beginning and end of the current line
  • Select Next Word
  • Select Previous Word
  • Select Word Above
  • Select Word Below
  • Sort lines

As an added bonus, on save, Marvin also

  • Magically cleans up whitespace on save.
  • Adds a LF at the end of the document

Install via Alcatraz

  • Install plugin and restart Xcode.

Build from Source

  • Build the Xcode project. The plug-in will automatically be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins.

  • Relaunch Xcode.

To uninstall, just remove the plugin from ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins and restart Xcode.

Customize

You can configure Marvin's keyboard shortcuts by adding them to System Preferences > Keyboard > Shortcuts. Note that the Menu Title needs to match Marvin commands

Keyboard Shortcuts

Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create pull request

Thanks

A big shout out goes out to Benoît Bourdon @benoitsan. He made BBUncrustifyPlugin-Xcode which includes private Xcode headers and some convenience methods that is being used in this project. Without his tremendous work this might not have ever happened.

marvinxcode's People

Contributors

dev4dev avatar dppeak avatar mkerley avatar onmyway133 avatar zenangst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

marvinxcode's Issues

Enable configuration of keyboard shortcuts or disabling of certain ones?

Is there a way that keyboard shortcuts can be configured or changed? In the extension Ctrl-A key is mapped to select previous word, however Ctrl-A is a common emacs-style shortcut used to move the cursor to the beginning of the line (and works in most places in OS X). I'd love to just be able to use the extension for Delete, Duplicate and Join line but need to disable it for now as it hinders the text navigation I'm used to with Ctrl-A.

Crash when duplicating a line in a locked file

Hi - just discovered a crashing bug reproducible 100% of the time. It happens if you try to Duplicate a Line in a file that's locked (e.g. a file in the Cocoapods project of your workspace)

Here is the stack-trace:

Process:               Xcode [71369]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               7.2 (9548)
Build Info:            IDEFrameworks-9548000000000000~7
App Item ID:           497799835
App External ID:       814662604
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [71369]
User ID:               501

PlugIn Path:             /Users/USER/Library/Application Support/Developer/*/MarvinPlugin
PlugIn Identifier:       com.zenangst.MarvinPlugin
PlugIn Version:          2.0.3 (2.0.3)

Date/Time:             2016-01-27 10:10:40.630 +0100
OS Version:            Mac OS X 10.11.2 (15C50)
Report Version:        11
Anonymous UUID:        DC78A84E-6DC5-2379-5D5D-C308488B71D6

Sleep/Wake UUID:       DB3CF102-C6FC-4671-B756-2720B781A991

Time Awake Since Boot: 480000 seconds
Time Since Wake:       3300 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
Sending duplicateLineAction to <MarvinPlugin.MarvinPlugin: 0x7fdbc6e420a0> from <NSMenuItem: 0x7fdbc60c5ec0 Duplicate Line>
ProductBuildVersion: 7C68
Performing @selector(duplicateLineAction) from sender NSMenuItem 0x7fdbc60c5ec0

Global Trace Buffer (reverse chronological seconds):
209.095491   CFNetwork                  0x00007fff8e614a5b TCP Conn 0x7fdbc6114400 SSL Handshake DONE
209.553910   CFNetwork                  0x00007fff8e614937 TCP Conn 0x7fdbc6114400 starting SSL negotiation
209.554100   CFNetwork                  0x00007fff8e613303 TCP Conn 0x7fdbc6114400 complete. fd: 45, err: 0
209.555208   CFNetwork                  0x00007fff8e6a1b1d TCP Conn 0x7fdbc6114400 event 1. err: 0
209.751340   CFNetwork                  0x00007fff8e6125d3 TCP Conn 0x7fdbc6114400 started
209.852453   CFNetwork                  0x00007fff8e5d621a Creating default cookie storage with process/bundle identifier
209.852463   CFNetwork                  0x00007fff8e5d61b2 Faulting in CFHTTPCookieStorage singleton
209.852463   CFNetwork                  0x00007fff8e5d6041 Faulting in NSHTTPCookieStorage singleton
209.863260   CFNetwork                  0x00007fff8e6d3654 NSURLConnection finished with error - code -1100

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.zenangst.MarvinPlugin       0x000000011657c686 _TFC12MarvinPlugin12XcodeManager9lineRangefS0_FT_VSC8_NSRange + 2918 (XcodeManager.swift:167)
1   com.zenangst.MarvinPlugin       0x0000000116582870 _TFC12MarvinPlugin12MarvinPlugin19duplicateLineActionfS0_FT_T_ + 416 (MarvinPlugin.swift:158)
2   com.zenangst.MarvinPlugin       0x0000000116583306 _TToFC12MarvinPlugin12MarvinPlugin19duplicateLineActionfS0_FT_T_ + 22
3   libsystem_trace.dylib           0x00007fff9b6b007a _os_activity_initiate + 75
4   com.apple.AppKit                0x00007fff9e60351d -[NSApplication sendAction:to:from:] + 460
5   com.apple.dt.DVTKit             0x0000000109d6dac7 __37-[DVTApplication sendAction:to:from:]_block_invoke + 379
6   com.apple.dt.DVTFoundation      0x000000010978c9a5 DVTInvokeWithFailureHint + 83
7   com.apple.dt.DVTKit             0x0000000109c3f1f7 -[DVTApplication sendAction:to:from:] + 335
8   com.apple.AppKit                0x00007fff9e6032b7 -[NSMenuItem _corePerformAction] + 336
9   com.apple.AppKit                0x00007fff9e603017 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
10  libsystem_trace.dylib           0x00007fff9b6b007a _os_activity_initiate + 75
11  com.apple.AppKit                0x00007fff9e601f05 -[NSMenu performKeyEquivalent:] + 357
12  com.apple.AppKit                0x00007fff9e6010aa -[NSApplication _handleKeyEquivalent:] + 920
13  com.apple.AppKit                0x00007fff9e51950f -[NSApplication sendEvent:] + 4274
14  com.apple.dt.IDEKit             0x000000010a9dec6d -[IDEApplication sendEvent:] + 739
15  com.apple.AppKit                0x00007fff9e44c03a -[NSApplication run] + 796
16  com.apple.AppKit                0x00007fff9e3ce520 NSApplicationMain + 1176
17  libdyld.dylib                   0x00007fff960295ad start + 1

Crash when deleting the last line of a file

Until now I was sure that this issue is reliantly reproducable. However this is not the case, as I could not reproduce it right now.
I will watch out for further crashes and see if I can provide some useful crash reports!

Proper Save

Proper save not working in Xcode 6.1.1 it not remove trailing whitespace.

Show how to map to keyboards

I have to show every time I want to tell someone that Proper Save is the thing, and I have to add and find this screenshot every single time. Please consider improving your documentation to include a section that explains how to do this.

screen shot 2015-03-05 at 1 51 50 pm

Default shortcuts

I think it's better to remove some default shortcuts and let the user setup them by himself. For example I use ^A as "go to start of line" and I don't like that it's overwritten with plugins one.

Improve README on how to use

I think we should add these to the README for an easy usage

  • Accessible via Edit -> Marvin
  • Keyboard shortcuts (in System Preferences) names should match Marvin commands
  • Automatically adds a LF at the end of document

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.