Skip to content

andriichernenko/octopus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Octopus for Xcode

Octopus for Xcode is a source editor extension that adds several convenience features.

Features

Expand/Shrink selection

  • Expand selection selects the nearest scope that contains the current selection.
  • Shrink selection goes back to the previous selection.
expand-shrink.mov

Select next/previous/all occurrences

  • Select next/previous command finds the next/previous instance of the selected text in the current file and adds a selection for it. Unlike a similar feature built into Xcode, it allows you to backtrack if you end up selecting too many instances.
  • Select all occurrences selects all instances at once.
select-next-previous-all.mov

Format with SwiftFormat

This feature provides better Xcode integration with nicklockwood/SwiftFormat.

It combines the benefits of an Xcode extension, like:

  • formatting instantly by pressing a shortcut,
  • keeping the undo history for the formatted file,
  • formatting only selected code

with the benefits of formatting via command line:

  • automatically using the correct project-specific and folder-specific configs,
  • taking .swift-version into account.

Requirements

  • Xcode 16+
  • Swift code (Objective-C and other languages are not supported).

Octopus may work in Xcode versions as old as 8, but it has not been tested with anything older than Xcode 16.

Privacy policy

Octopus for Xcode doesn't collect or send any information, even analytics. Nothing ever leaves your computer.

Getting started

  1. Download Octopus.zip from the Releases page.

  2. Unzip the file, move Octopus.app to the Applications folder.

  3. Launch Octopus.app. This will automatically add a login item.

  4. On launch, Octopus will request accessibility permissions. Press the Open System Settings button:

    accessibility permission dialog

    Alternatively, go to Settings > Privacy & Security > Accessibility

    Enable the toggle for Octopus:

    accessibility permission page
  5. Open Settings > General > Login Settings & Extensions. Scroll down to the App Background Activity section and make sure the item for Octopus is enabled:

    login item app background activity

    While on the same page, scroll down to the Extensions section and select By Category. Then find the Xcode Source Editor item and press the "i" button next to it:

    login item extensions

    In the dialog that opens, make sure the Octopus extension is enabled:

    source editor-extension
  6. Start Xcode. When you open a project, you should see the Octopus submenu in the Editor menu:

  7. (Optional) Assign shortcuts for Octopus commands in Xcode settings (no shortcuts are assigned by default).

Installing updates

  1. Download the new version of Octopus from the Releases page.
  2. Quit Xcode and the Octopus app using the menu bar item.
  3. Replace Octopus.app in the Applications folder with the new version.
  4. Start Xcode and Octopus.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors