Sublime text plugin or command for moving back and forth between definition and reference - sublimetext

I want a sublime plugin or command from which i can move back and forth between a method reference and it's definition. So for example i am viewing a method methodA() and there is a method methodB() called inside methodA(), so what i want to be able to do is move to methodB()'s definition examine it and then move back to methodA(). So bascially i want to keep a sort of stack of method calls and want to move back when i have examined the method methodB(). I know that sublime text keeps a cursor position stack and you can use alt - to move back but i want a definition jump stack not cursor one.
I have tried to search for the required plugin and such but to no avail.
Btw I am using Sublime Text 4

Related

Sublime Text: disable refresh/replacement in 'Replace' function?

using the "Replace..." [Find menu] function a slide-in at the bottom appears with an option field/entry for "Find:" and below that one, one for "Replace:"
having completed a replace [eg "Find: abc", "Replace: xyz"] for instance by employing "Replace All" the very slide-in disappears
now for another, new, search, for instance within a document having selected a different, let's say word like "oha", that selection 'oha' is auto-copied over as new entry in "Find:" when using "Replace..." again. this is to say that now in "Find:" the entry does read "oha" tho didn't paste it manually in -- the "abc" entry fromthe previous search got replaced
however, the last entry in the "Replace:"-entry-field remains unchanged
it's the "Find:" entry that get's auto filled in w/out the option [as far as i could figure out]
and that exactly is my question about :
any option to modify Sublime's settings such that nothing gets changed/auto-copied/filled-in at "Find:" ?
pretty annoying behaviour, as i experience it, for instance when having to replace just a single character combi within similar text and each time the copy-selected text get's auto-copied/filled-in at "Find:" rather than leave it be till the usr opts to modify that entry from previous replace-calls
The Find and Find and Replace widgets automatically populate the Find box with either the current selection if there is one, or the previous value used in that box. This box is a dropdown, which contains the previous values used, so you can easily go back through your history in that window and not have to re-type a complicated regular expression, for example.
When the Find box opens pre-populated with a value, it is automatically selected, so to get rid of it all you have to do is hit Backspace or Delete. Alternatively, you can just begin typing your new search query, and it will erase the old one.
There is a setting in Sublime Text 4 that modifies this behavior:
// If true, the selected text will be copied into the find panel when it's
// shown.
// On Mac, this value is overridden in the platform specific settings.
"find_selected_text": true,
If you set "find_selected_text": false, in your user settings, you can disable this behavior.

How to disable the console cursor from moving automatically

Situation:
I am crating an console application for windows using rust. Fore that I use winapi and kernel32.
Lets say my cursor position within the console is at 4,4 (X,Y) then I print an character like print!("#"); at position 4,4. Then the console automatically moves the cursor one to the right 5,4 for the next character to be printed there.
Question
Is it possible to prevent this default behavior, and have the cursor stay at 4,4 instead of moving to the next cell, usingwinapi/kernel32? What I mean by that is that the console should not change cursor position in any case until I manually tell the console to change the cursor position to another cell.
Example or solution maybe in any language.

Using Accessorizer doesn't paste generated code

I'm trying to get into Accessorizer, but every time I am trying it, I run into the same problem. I select some code (for example, multiple #property statements), hit cmd-c and move my cursor to the place I want the generated code to be.
I now use Accessorizer's menu, select Implementation and my copied properties are pasted in, instead of #synthesize statements. As far as I can see, I followed the setup instructions precisely. I don't like the difficult to use shortcuts, so I would like to use the system menu, at least for now.
Ah, so you need to invoke the Accessorizer text service by pressing shift-alt-cmd-0 instead of cmd-c. That sends the text to Accessorizer. Only after you've done this, you can use the Action Menu / press shift-ctrl-cmd-0.

Find method references in Xcode

Is there a way in Xcode to find all the places where a method or property has been been called?
In Eclipse, for example, you can right-click a method and select Find references. Is there anything similar in Xcode?
Select the method you're interested in, or position the text cursor within it.
Open the "Related Files" menu via the icon at the top-left of the Editor. (It's the button immediately to the left of the back button).
Go to the "Callers" submenu for a list of all methods that call the selected method, and click any of them to jump to that file and method.
In pictures...
A couple of notes:
You can do this for properties too.
Note that when you select a calling method from the Callers menu to jump to where your method was called, Xcode highlights only the first call. Each calling method will only show up in the 'Callers' list once, even if it contains many calls to your method. So if you're trying to make some change at every place in your application where a method is called, be careful not to miss some in places where a calling method contains two calls to the method you're interested in.
Yes, open the Assistant editor and instead of Counterparts select Callers.
Select function, press cmd-shift-A, "Callers"
As of XCode 4.5 you can click on "Show find options" within the search field of the Search Navigator. There you can specify "Symbol References"
Place the insertion point in a method invocation or declaration and choose Find > Find Selected Symbol In Project. For multipart selectors this will only highlight the first part but searching does seem to work relatively reliably. You can also use Find Call Hierarchy which highlights the entire line instead.
The corresponding contextual menu item (Find Selected Symbol in Workspace) also works, but it's a bit trickier to make work properly. Make sure no text gets selected otherwise it'll search for the selected word rather than the entire selector. To do so, you can click with the left mouse button prior to clicking with the right mouse button (or Control-clicking) in the same location. There's no such issue with the contextual Find Call Hierarchy.
With xcode 4 you can now right click on references and select "jump to definition."

Fastest way to "jump back" to a file in TextMate?

Often, when I am reading code or debugging, I want the ability to quickly jump around files. I especially want to "go back" to where I was. I know about "Command+T", "Command+Shift+T", and, bookmarks. But, I cannot figure out a way to jump around files quickly.
UPDATE: I do not think I my question was clear enough judging by two answers given. Specifically, I am looking for a way to "jump back" to where I was in a file. I know how to navigate in TextMate (in general). I want to know if TextMate has a "jump back" key binding.
It's subtle.
The command-T thing has the files listed in Most Recently Used order.
So, you can go command-T return to get back to your last file real quick. At first I couldn't find it either.
I don't think there's a go to last edit location as there is in, say, IDEA/RubyMine.
Courtesy of MacroMates.com
2.3 Moving Between Files (With Grace)
When working with projects there are a few ways to move between the open files.
The most straightforward way is by clicking on the file tab you need. This can also be done from the keyboard by pressing ⌘1-9, which will switch to file tab 1-9.
You can also use ⌥⌘← and ⌥⌘→ to select the file tab to the left or right of the current one.
It is possible to re-arrange the file tabs by using the mouse to drag-sort them (click and hold the mouse button on a tab and then drag it to the new location). This should make it possible to arrange them so that keyboard switching is more natural.
One more key is ⌥⌘↑ which cycles through text files with the same base name as the current file. This is mainly useful when working with languages which have an interface file (header) and implementation file (source).
When you want to move to a file which is not open you can use the Go to File… action in the Navigation menu (bound to ⌘T). This opens a window like the one shown below.
Go To File
This window lists all text files in the project sorted by last use, which means pressing return will open (or go to) the last file you worked on. So using it this way makes for easy switching to the most recently used file.
You can enter a filter string to narrow down the number of files shown. This filter string is matched against the filenames as an abbreviation and the files are sorted according to how well they match the given abbreviation. For example in the picture above the filter string is otv and TextMate determines that OakTextView.h is the best match for that (by placing it at the top).
The file I want is OakTextView.mm which ranks as #2. But since I have already corrected it in the past, TextMate has learned that this is the match that should go together with the otv filter string, i.e. it is adaptive and learns from your usage patterns.
If you have a project window open, you can leave frequently-accessed files open (in tabs), and then use ⌘+1-9 to jump to open tabs.

Resources