Shortcut to jump to a chunk in R Markdown? - rstudio

Is there a shortcut to jump to a chunk in a R Markdown (on a Mac)? I'm looking for a way to quickly go between one chunk to another.

I'm not completely sure this is possible on Mac, but in RStudio for Windows you can select to show the «document outline» in the IDE. Not really a shortcut perhaps, but it can easily be used to jump to different named chunks in the R Markdown document by clicking it.
By default, I believe the outline is set to only show «Sections» (i.e. ## Header here), so to enable it to show named chunks, go to Tools -> Global options -> R Markdown -> Show in document outline. Then set it to «Sections and Named Chunks»

fn + Command + Up/Down works on the latest RStudio. It also jumps to heading sections.

This preference option exists on the Mac desktop RStudio as well.

Related

RStudio: Move Code to Center of Editor

I am not sure if this is a reasonable expectation or whether there are other IDEs that have this feature, but when I am writing code in the RStudio editor, once I have written a sufficient amount of code, I am basically always editing at the bottom of the screen:
Is there a way to move the code to the middle of the screen without having to type "Enter" a bunch of times (trailing newlines are code too :-))?
You can keep scrolling by clicking an option in the settings:
Tools -> Global Options -> Code -> Display -> Allow scroll past end of document
This only affects scripts, and not the console.
So, uh.. you got some more of that fake internet points?

how to come back when you are reading code in Xcode?

I have been developing in zend studio and there is a feature I miss a lot in Xcode. When you are reading code in a main function and you want to go in a specific function to read something, you can click in the left area of your current line of code were your are, and a flag-mark appears in that line of code, so you can go anywere else in the code and it will be very easy to come back to that line of code you were before because there is a flag and you only have to click on it and you automatically go back. Does Anybody know a similar way to do this in Xcode?
Unfortunately, this feature was present in earlier versions of Xcode (up to Xcode3 IIRC) and was called "Bookmarks", but it was removed since then.
You can use breakpoints (and disable them) as a workaround, even if it's not perfect. I personally prefer using other tricks, like "Open Quickly" and named tabs.
Alternate trick 1 : "Open Quickly"
One trick is to use Command+Shift+O (or "File" menu > "Open Quickly") to quickly open a file. In the field that appears, you can type:
The name or parts of the name of a file.
Typing "MainViewController" will propose to jump to the MainViewController.h or MainViewController.m file.
Typing "MainVC" will work too, as well as "MainViewCtrl", as long as the order of the letters you type is the same as the full name.
Very handy to just type "ContTVCell" to open the ContactsTableViewCell.h file that is hidden deep in subgroups of my project for example
Similarly, you may also type the name or parts of the name of a symbol, especially a method name.
For example, typing tvcellforrow will list you all the definitions of -tableView:cellForRowAtIndexPath: it could find in your project and let to jump to the one you want
When typing (parts of) the name of a file, adding : followed by a number at the end will allow you to directly jump at the corresponding line
For example, typing mvc:50 will propose you to jump to line 50 of MainViewController.h or MainViewController.m
Another trick : using (named) tabs
Don't forget that you can open tabs in Xcode, which can be very handy in this kind of situation.
When you are editing a file at some interesting position, you can create a new tab to browse elsewhere and go at any other place… and then go back to your first tab to find the code where you left it at the time you switched to the other tab.
Don't forget that you can name your tabs (simply double-click on their title) to give them a more explicit title. You may then quite think of them as "named bookmarks" somehow
Likewise, don't forget that you can detach tabs in separate windows too, if you prefer (for example to keep them around and visible on your secondary screen while you edit another part of your code)
You can even combine this with the "Open Quickly" trick presented above: once you made the "Open Quickly" field appear and typed something into it, instead of just validating using the enter key:
use Alt+Shift+enter to let Xcode present you a small widget that let you choose where you want the file to open (in the current tab, in another tab, in the assistant editor, in a dedicated window…)
use Alt+enter to open the file using the alternate navigation defined in Xcode preferences (Xcode > Preferences > Navigation > Optional Navigation). By default, the behavior when opening a file while using the Alt key is to open the file in the Assistant Editor. Personally I changed that in my Xcode preferences as I prefer to make Xcode open the file in a separate tab instead, which makes Alt+clic much more useful.
Sure, all those tricks with "Open Quickly…" and "Tabs" do not replace the bookmarks feature that you are missing. But they are still nice alternate ways to jump quickly to any position in your code, even any specific line of any specific file in your project, wherever you are in Xcode (even without having to have the Project Navigator visible on the left part of your window), and let you have multiple editors in different tabs to go quickly back to a part of interest in your code
its on top of your editor i have added two pics just check them.
When you navigate to another place in Xcode, say, open a different file, or Command-click and jump to definition, you can go forward and back by swiping right or left on the trackpad with two fingers.
You can also use keyboard shortcuts: Ctrl+⌘+→ to go forward, or Ctrl+⌘+← to go back.
Finally, you can click triangular buttons at the top left in your edit area.
There is a go back button at the top left of the editor!
If that is not good enough, whar I do is misuse breakpoints to set flags in my code. The breakpoint navigator thus becomes a table of flags. It isn't much but there you are.

Is it possible to set Wordwrap in WebStorm? I need to set by default all the files should be in wordwraping

is there any way to set word-wrap for all new/existing files should be in word-wrapping.
i need to set by default all the file in word-wrapping like notepadd++.
Thanks in advance.
Settings/Preferences | Editor | General | Use soft wraps in editor -- this setting affects all files.
You can disable or enable this option on per file basis (until it's closed) via View | Active Editor | Use Soft Wraps
More recent version (compared to the versions available when this question was answered) also have these options available in the Editor's gutter menu (right click in the area where the line numbers/breakpoints/etc are).
P.S.
Settings screen has very nice feature -- quick search box (top left corner) -- it does wonders. It allows you to quickly narrow the search scope of the specific setting by it's name (keyword).
You can also use "Search anywhere" (Shift two times) as well as "Find Action" (Help | Find Action... Ctrl + Shift + A) to search for individual settings.
Webstorm 9.0.3 Evaluation version on Windows 7:
I know I'm a bit late coming here, but if like me, you find that there's no "Use soft wraps in editor" option when you look in Settings>Editor>, i just discovered you can apply 'soft wrap' to individual files:
Open the file,
Left click the left margin (where the line numbers are),
You'll see "Use Soft Wraps" as an option you can turn on.
It's not quite what I wanted (change settings to apply to all files), but it's something.
Yes, it is possible. I have webstorm 2016. Follow these step.
Step 1:
This step may vary depending on OS used. Just search for preferences. I have screenshot for Mac.
Step 2:
Click on Editor twice. Note that arrow will change to downward position as shown.
Step 3 :
Click on general and see the option Use soft wraps in editor.
Step 4:
Select it and click ok
Settings (Preferences on Mac) | Editor | General | Use soft wraps in editor
Although its an old thread but updating as someone may find it usefull. In version 9.0.1, you have to select General inside Editor and then Use soft wraps in editor
Settings(ctrl+alt+s)--->Editor--->general--->use soft wrap in editor

Can I quickly dial up font sizes for the VS IDE without a mouse?

Maybe this isn't a "programming question" per se, but it relates to the coding process:
One of the really neat features I like about the WPF-ized VS IDE is being able to hit Ctrl (I think it is) and thumb the mouse wheel to quickly change font size in the code editor.
For work (desktop PC) that works great, but at home, on my laptop, I can't figure out how to accomplish it (other than going into Properties or whatever and changing font size there, which is obviously way less "handy" (no pun intended)).
Is there a quick way to change edit font size without resorting to the dialog accessed via the menu?
You can set the shortcut in the Tools -> Options -> Environment -> Keyboard shortcuts for View.ZoomIn and View.ZoomOut. I think they are by default: CTRL + Shift + Comma for zoom out and CTRL + Shift + Period for zoom in .
http://weblogs.asp.net/jgalloway/archive/2010/04/15/visual-studio-2010-zooming-keyboard-commands-global-zoom.aspx
Tools -> Options -> Environment -> Format is the place where you can change as per your need
If you don't have a scroll wheel, you'll have to create your own macro to do this. Check out the first answer in this post:
Shortcut for changing font size in Visual Studio

Are these NotePad++ features available in TextMate?

I'm a NotePad++ user, new to TextMate.
There are some features that I really like in NP++ but couldn't figure out if TextMate support them.
Double click on a variable and have all instances highlighted
View 2 text windows side by side
Drag a file onto another opened Window
For this one, I don't know how to generate a screenshot ;-p. Basically, you can drag a file from Windows Explorer and drop it into NP++ to have it opened.
A lot of long time TextMate users are leaving TextMate land, actually. So, I'm not sure it's the right time to move to TextMate.
Emacs and Vim both do what you want and more. If you can afford the learning curve it's definitely worth it.
As for your question:
View 2 text windows side by side
You can have two or more windows for the same document. Assuming you are in a "project" right-click your file in the drawer and choose Open "foo.ext" in New Window. The two "views" contents are more or less in sync but doing cool things like columnar editing tends to break the syncing.
Due to how Mac OS X manages windows, the new window will probably be too large/too small and/or placed in a less than useful place. I use ShiftIt system wide to manage my windows and in such a case have them the same size side by side.
Double click on a variable and have all instances highlighted
What do you use this for? Is this visual highlight or non-contiguous selection?
Type ctrlw to select the word, then ⌘e to make the word your search term, then ⇧⌘f or Edit > Find > Find in Project… It will show all instances of the search term in another window. You can then "jump" to any occurence and do whatever you want.
If you only want to jump from occurence to occurence, select the word then type ⌘e then ⌘g to jump to the next occurence.
Another way is to type ctrls, a little text field appears at the bottom of your window where you can type a word and see its first occurence selected in real time. Repeatly typing ctrls will cycle through the occurences.
Drag a file onto another opened Window
You can drag & drop a file on TextMate's icon in the Dock. You can also right-click the file and choose Open with TextMate *or Open with…*. If you are in a "project" you can right-click and choose Add Existing Files…. Opening multiple files in TextMate will automatically create a "project" for you.
View 2 text windows side by side
I just tried this and it doesn't seem to recognize this functionality. the only time any sort of "add" icon came up was when I dragged the file into an open document and then released, but that resulted in adding the contents of the file into the document.
I just did a quick google search for "textmate split view" and it still doesn't seem to be supported according to some of the answers i found (one from macromates wiki).
Double click on a variable and have all instances highlighted
This also doesn't seem to be supported. This post suggests using the command + f (find), put the word into find, then command + g to jump to the next instance of that word.
There are definitely some things that can be added to textmate to make it more robust. If you are looking for something similar and are on a windows machine, you should check out e text editor. I loved that editor when I was working on a windows machine - split view is supported, but not sure about the highlighting. One thing that e also beats out textmate is the real time regular expression highlighting.

Resources