Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Beyond the Basics
This page lists and describes a few of the more advanced things you can do with Diakonos.
Fuzzy file find
By default fuzzy file finding is on. When you specify a file to open with
Ctrl-O, you only have to type a few of the distinguishing characters of the file or path, and then select the file from the list of matches. For example, to open a filepath
lib/application/module/filename.rb, you could just type
mo/fil. Set the session directory (
Alt-S D) to tell Diakonos where to do the fuzzy file finding from. Use the
fuzzy_file_find.ignore configuration directive to filter out directories from the fuzzy file find.
If fuzzy file finding is not your thing, you can use tab completion to traverse down paths. The up and down arrow keys are also available for selecting a file from the presented list of directory contents. Press Enter to open the highlighted file. Press
Ctrl-W to delete the right-most path component on the input line (i.e. travel up the path).
Ctrl-K deletes the whole line so you can start over.
Open at a specific line
When opening files (whether when starting Diakonos, or with
Ctrl-O), provide a line number by suffixing the filename with a colon and a number. e.g.
some/file.rb:56 Diakonos can parse the stack trace output of some languages (such as Ruby and Python), so it is unnecessary to clean up stack trace lines: Simply double click a file with line number from a stack trace, then paste it to Diakonos. e.g. Diakonos understands
Alt-G to grep the current buffer.
Alt-Shift-G to grep all buffers at once.
Ctrl-Alt-G to grep within a directory. When typing in the expression to grep for, matches are shown while you type. Use F6 and F5 to increase or decrease the amount of context shown around each match. Use the arrow keys to select a match and press Enter to jump to the selected match.
Search within selection
After selecting text, all find functions (including replace functions) restrict themselves to searching only within the selected area.
Search while searching
While typing in a search expression with a find function, Diakonos will jump to and highlight matches as you type.
Shift-F3 also work while typing (before you press Enter to submit the search).
Regexp groups in replacement
Groups in search expressions (captured with parentheses) can be referred to in replacements using \1, \2, etc.
Select code blocks
Alt-space to select the block of code containing the current line (for non-empty lines). Press
Alt-space more times to select increasingly outer code blocks.
Ctrl-space twice to select the current word. Press
Ctrl-space more times to expand the selection to include more words.
Alt-Shift-M B to switch to block (rectangular) selection.
Alt-Shift-M N to return to normal selection.
Process text with Ruby
Select some lines. Press
F7, then enter any Ruby code that operates on a
line variable. The Ruby code is executed on every line. Or: select some lines and press
Alt-F7. The given Ruby code is executed on an Array containing the selected lines, represented by a
F2 to run a shell command and get the results in a new buffer.
F8 to run a shell command and see the exit status (discard output).
Shift-F2 to run arbitrary Ruby code.
Alt-M to start or stop macro recording.
F4 to play back the last recorded macro.
Delete to, from or within
Ctrl-D T and then type a character to delete from the cursor up to the next instance of that character. Press
Ctrl-D F and then type a character to delete from the previous instance of that character up to the cursor. Press
Ctrl-D I and then type a character to delete between the nearest instances of that character. If a bracket character is typed, Diakonos will delete between matching opposite brackets (e.g. between
To diff two sets of lines, copy the first set to the clipboard, then select the second set and press
Ctrl-W to close the diff buffer.)
Alt-Shift-C to toggle the context line on and off. The context line shows the outermost blocks surrounding the current line. This feature mostly obviates the need for code folding.
Ctrl-J to jump back to a previous location.
Ctrl-L to jump forward.
Select some lines, then press
Alt-A to align source code into columns. Useful for prettifying multi-line hashes, arrays, assignment, etc.
Ctrl-B 1 to renumber the current buffer to buffer 1. Same idea for 2, 3, etc.
Alt-C to close XML and HTML tags. This can be configured for any language.
Type the beginning of a word, then press
Alt-E to complete it using the words found in the current buffer.
Comment out, uncomment
Alt-#) to comment out the current line or selection.
Alt-@) to uncomment.
Alt-Shift-I to manually indent and unindent the current line or selection.