Default shortcut for Replace-Next in Atom? - atom-editor

Regardless of whether it were supposedly possible to customize this shortcut in the user preferences file (*) : is there actually a default shortcut for Replace/Replace-Next ? Following shows there is no hover-help on it:
(*) After many attempts I have never been successful for the keymap.cson to be respected by Atom. It just gets ignored. Thus I want to use whatever is the default binding for Replace[/-Next] .

No, there is no default shortcut for "Replace Next", only one for "Replace All" (ctrl+enter or ⌘+enter).
But there is a built-in command for it. Putting this in my keymap.cson file works for me:
'atom-text-editor':
'alt-cmd-e': 'find-and-replace:replace-next'
I found this example from here:
https://github.com/bronson/dotfiles/blob/master/.atom/keymap.cson
All of the default settings are here:
https://github.com/atom/find-and-replace/blob/master/keymaps/find-and-replace.cson
It sounds like you already know this, but just for reference, you can find your keymap.cson file by going to Settings (ctrl+, or ⌘+,), and clicking the "Open Config Folder" button.
If your keymap.cson is being ignored, I would start to diagnose the problem by commenting out everything except those two lines in order to see if another setting in keymap.cson is broken.

Related

Preventing markdown cells from un-rendering (Jupyter): showEditorForReadOnlyMarkdow

following this post and the issues tab regarding this problem I have found that to make a cell that is set to "editable":false not be able to be un-rendered I need to set showEditorForReadOnlyMarkdown to false.
It is not clear to me how to actualy do this, and how to make it permanant.
This is what I have tried so far:
I have found that throught Jupyter-Lab I can go to settings->advanced settings editor->JSON Settings Editor and change this setting, but the change is permanant only for My Jupyter-Lab environment -- opening up the notebook elsewhere will not save this setting.
Setting "showEditorForReadOnlyMarkdown":false in the cell or notebook metadata via a local jupyter notebook doesnt do anything.
Ultimatley, as the notebooks I am making are for learning purposes, I would like all cells that are uneditable to be permanantly rendered as to minimize issues and/or confusion.
Any help will be appreciated. Thank you.
For any others looking for the currently available per-Jupyter-lab setting that Iddo mentions above, to do it through the GUI it's "Settings" -> "JSON Settings Editor" (icon at top-right of initial Settings tab), then it's found in "Notebook" near the bottom (this is in JupyterLab 3.6.0). I couldn't edit it in place, not sure if that was just me, but could add to the User Preferences box on the right, e.g.:
{
"showEditorForReadOnlyMarkdown" : false
}
One way it can be done programmatically is by creating/modifying this overrides json file to hold:
{
"#jupyterlab/notebook-extension:tracker": {
"showEditorForReadOnlyMarkdown" : false
}
}
(This not an answer to the question, but I can't "comment" due to not having enough reputation points, so had to put this here as an "Answer" ¯\_(ツ)_/¯)

Atom.io find in project not working

I am trying to use the "find in project" feature of Atom editor.
I am coming from sublime and assumed that opening a folder is the equivalent of opening a project. Is this assumption correct?
If so, then I have a project open. I then search from a string using "Find in project". I am certain the string exists, and the file type is not ignored, yet it still returns no result.
I ran into this issue, and it only affected one project - a project in a git repo.
I checked the settings of the search field.. they were fine.
My issue was, as #fab313 mentioned above, as the setting in Core > Exclude VCS ignored paths.
Once I unchecked that box (Atom menu, Preferences, Core).. all project searches worked fine!
I had this same problem and I found that I accidentally clicked some of the settings boxes in the bottom right.
You just want to make sure you know which boxes are checked.
If I check one of those boxes (making them blue) then my CTRL/Command + F will only find a single result.
The settings will look like this and cause the problems for me:

Brackets - unable to edit defaultPreferences.json file (trying to set linting to jshint but not jslint)

I am running Brackets on a macbook pro and when I press cmd+, and try to edit the defaultPreferences.json file, it does not allow me to make any changes to the file (nothing happens when I type). If I restart Brackets I can edit the file, but after closing and re-opening the preferences file, the changes are reverted.
I have tried editing the json file with TextEdit while Brackets is closed, but Brackets still likes to reverse the changes.
I had similar issue , and i did open issue at Bracket's GitHub repository and here is the solution from its developers:-
defaultPreferences.json is a read-only file: take the options you
want to modify and copy them to the brackets.json file on the other
pane. This will override the defaults. You will also see code hints
while typing the values in to brackets.json which will help picking
the correct options.
Now it is also available to install brackets-preferences plugin and edit from there. Once installed go to View -> Preferences in your Brackets interface to edit preferences.

Set a shortcut in Atom editor for Go To Definition using go-plus

How can I set a shortcut in Atom editor for Go To Definition using go-plus. Thanks for your help in advance.
By default, the go-plus package uses Alt+Cmd+G to trigger the Go To Definition binding (as can be seen here). This binding will only work in files that use the Go grammar. Since Cmd is only available on Mac OS X, I don't know what keybinding other operating systems will use by default.
To redefine the keybinding, do the following:
Open the Atom Preferences, select the Keybindings section.
In the Search field, type 'go' to filter the list of keybindings.
Click the Copy icon next to the golang:godef keybinding.
Click the your keymap file link at the top.
This will open your keymap.cson file. Go to the end of the file and paste the copied content:
'atom-text-editor[data-grammar="source go"]:not(.mini)':
'alt-cmd-g': 'golang:godef'
Edit the keybinding to your liking and safe the file.
To verify the new keybinding, open the Key Binding Resolver view by selecting the Packages > Key Binding Resolver > Toggle menu entry. Open a Go file and press the keybinding you assigned, then watch the Key Binding Resolver view to see any conflicts.

How to bookmark code in XCode 4?

I couldn't find a way to put a bookmark inside the code in XCode 4. I know about the #pragma mark thing but it's not what I'm looking for. What I need is something that I can put and remove with a mouse click and navigate amongst with next and previous, like in VS.
Is there anything that I'm missing?
Bookmarks seem to have gone the way of the dinosaur in Xcode 4. This wouldn't have been so bad had the jump-to-bookmark popup above the editor in previous versions not also disappeared. The best replacement currently seems to be to use breakpoints (disabled individually, of course) and navigate with the Breakpoint Navigator.
Shortcut to breakpoints is Cmd + 8. Once there use arrow keys
File a bug report at http://bugreporter.apple.com if you feel something like this should be brought back.
Write below comment in your source file that you want bookmarked.
//<##>
And you can navigate to next / previous with: '^/' or '^?'
<##> means "placeholder of code snippet"
^/ means "jump to next placeholder"
^? means "jump to previous placeholder"
thanks
Another option, if anyone is still interested. The following directives will both produce a compiler warning that you can use as a bookmark:
#pragma message "<# message #>"
or
#warning <# message #>
If you want to place bookmarks using your mouse: create a code snippet with one of the 2 directives above. Drag & drop it to the line in your source file that you want bookmarked.
Navigate to next/previous with: Cmd-' and Cmd-Shift-'
In Xcode 4.4, if you leave a comment with this format:
// TODO: Your text here
it will be added as a listing in the jump bar alongside the list of methods in your current file, and then you can jump straight to that comment from that menu.
The simplest technique is to use a comment prepended by // TODO and then search, which allows you to jump through the issues from the navigator. Pretty hard to beat that technique.
I personally don't like using break points for bookmarks because it is not easy to enter notes. I use breakpoints as breakpoints, and prefer not to mix them up with bookmarks.
Anyhow, if you want to get a bit fancier you could get xcode to generate warnings // TODO: some message or // FIXME: some message that can be navigated in the issue navigator. I took the instructions below from this site:
Instructions
Head over to your project's item in the Project Navigator (usually at the very top)
Find your target in the list of targets on the left, select it
Head over to the "Build Phases" tab.
Click the "Add Build Phase" in the bottom right of this screen.
In the editor that appears insert the bash script shown below.
Now just build and you'll see all your //TODO: and //FIXME: comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.
Bash Script For "Run Script" Build Phase
KEYWORDS="TODO:|FIXME:|\?\?\?:|!!!:"
find "${SRCROOT}" ( -name ".h" -or -name ".m" ) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original //TODO: or //FIXME:
Extra pro tip: Make sure you're using phrases to describe your //TODO: comments like //TODO: Handle this error gracefully, and things like that. The phrases will show up in the issues list beside each warning.
Credit for the little tidbit should go to "Tim" on the Cocos2D forums, (found after Googling for a bit), I believe his solution originally was intended for Xcode 3 and didn't work if you had spaces in your path name, my script here doesn't have those restrictions, still he should get full credit here's his original post.
Like npellow's answer to this question of mine, appCode by JetBrains has also made this possible. So, this may be another reason to use appCode instead of Xcode4, except that it won't be free later in time.
My method:
type in grammar error code in the previous line.....
After changing something in other place, I can go back to the previous place because the grammer error line will show a red line in the right side scroll bar. It indicate the place.
It is not elegant but unless there is a bookmark feature, this is the way i am using at the moment
You can install an Xcode plugin called "XBookmark".
This plugin provide features below :
Toggle Bookmark
Show Bookmarks
Next Bookmark
Previous Bookmark
How to install XBookmark:
Install Alcatraz.
Search XBookmark from Window->Package Manager and click Install.
Restart Xcode.
Now, you can see menus about bookmarks in the Edit Menu.
PS : This plugin is open source.

Resources