How Can I Edit Storyboard Source Without Losing Formatting? - xcode

Sometimes it is very convenient to open a storyboard as source and edit the xml. Almost exclusively I will be moving things around. For instance: I will change the order of the scenes in the document outline.
Whenever I cut from one spot and then paste into another all of the line indentation is lost; all lines begin in column 0. I must then tediuosly restore the indentation with a series of select -> Cmd-] operations.
Does anyone know how to prevent this and/or how to easily restore the indentation?

Related

How to navigate back to the last cursor position with respect to *same* file in Visual Studio Code?

Alt+Left navigate backs to the last cursor position and if the last cursor position was in a different file then it navigates to that file.
But, I want to navigate to the last cursor position with respect to the currently focused file only. It is really useful when I have 2 split file editors and want to navigate back exclusive to each other.
Is it possible?
I hope you understand the question, let me know if further explanation is required.
Basic Functionality
You can use the cursor undo / cursor redo commands via the command palette.
Undo also comes with a keyboard shortcut by default (Mac: cmd+u, Windows/Linux: ctrl+u), and you can configure a keybinding for redo.
Advanced Functionality
Note, however, that the file's cursor history is only saved while it has focus in an editor group. So if you have split editors, multiple focused files can have their own cursor history saved. And if the same file is opened and focused in two different editor groups, it has two different cursor history states.
But as soon as you focus another file in an editor group, the previously focused file will lose its cursor history (in that editor group).
The VSCode team is currently working on a variety of open issues to improve local history across the board, but I don't believe that saving cursor history for blurred (or closed) files is in the plans yet. If you need that functionality, you may want to create a feature request.
Note, with VSCode 1.40 (Oct. 2019):
The Soft Undo command has been renamed to Cursor Undo
This action is useful, for example when using Ctrl+D to select the next match and going one time too far, as it undoes only the last cursor state change.
Additionally, we now have added Cursor Redo, which redoes the previously undone cursor state change.

DataGrip current statement highlighting

I installed DataGrip and spent a couple hours getting rid of bells and whistles that distract me from editing sql, like the lightbulb. I'm down to this one that for my life I can't figure, so when I move around with the caret, the editor comes up with what it thinks is the current statement and draws a thin border around it, say if it's a line ending in a semicolon, it will border just that line, but if I have several statements each not ending in semicolon, it will think they all make up a single one and draw the rectangle around the whole thing. This in itself is distracting, plus if I hit Enter within the border, it will indent differently according to what it thinks the whole thing is. I just want Enter to go to a new line at the 0, leftmost position.
Is there any way to turn the whole feature off completely?
Apart from that, does anyone know if it's possible to get DataGrip to display the number of rows affected after an INSERT or UPDATE, like most other tools do?
I'm using it with Postgresql. Thank you in advance!
cpp_developer! (By the way, what do you think about CLion? :)
There are several questions in one, let's get answers one by one.
Lightbulb: there is no UI for getting rid of it, but there is the way. It is described in this ticket: https://youtrack.jetbrains.com/issue/IDEA-94381
TLDR:
Following line should be added to the
$IDE_CONFIG_HOME/options/editor.xml then:
<option name="SHOW_INTENTION_BULB" value="false" />
Line showing the current statement.
It can be removed, like any other color/font thing: A small helpful action. For now it is only present in the Find Action menu (Ctrl/Cmd+Shift+A), but as usual, you can assign any shortcut to it.
This action will navigate you to the settings which are relevant to the context under the caret. If there are several of them, just choose one. In your case "Statement to execute". Then remove it or make white.
Smart indenting. Just turn this off:
Number of INSERTed and UPDATEd rows can be found in Output tab. But please, run them in batch mode -> context menu "Run %your_console%.sql"

Reformatting code in text mate to established code conventions - Visual studio's ctrl K+D equivalent on Text Mate

Can anyone tell me if there's a quick way to format your code in Text Mate, similar to pressing ctrl K+D in Visual studio?
Thanks!
Edit by Damien_The_Unbeliever:
For those not familiar with Ctrl K+D, it doesn't just indent code - it reformats it using the generally established formatting conventions in the editor - it may replace spaces with tabs or vice-versa for the indentation, ensure code is consistently indented, move braces to separate lines, etc.
TextMate reindenting and reformatting varies a little depending on the language you're using.
You can generally use the Text menu, that depending wether you have an active selection or not it will show you different commands under it. For example, if you have selected a section of code, there will be a Indent Selection menu item. If you have no active selection, it will be Indent Line.
To have this working properly, be sure to select the current language, if it isn't assigned yet (like on unsaved documents). If you're working with HTML, it will simply indent the lines depending on what's above it. It will keep line breaks intact.
If you need something to break out tags on new lines and properly format the document, you should use the Tidy command that is found in the Bundles menu, under HTML (or simply by using the shortcut CTRL+SHIFT+H. If you have a selection active at the moment that you use it, it will simply reindent that section. If instead you have no selection, it will properly reformat the whole document, including checking for tag validity and other errors.
The Bundles for other language have similar commands, like XML (still Tidy) and Javascript (that has a Reformat Document command).
As an ending note, I simply suggest to look into the Bundles menu; there are many little gems in it. ;)
Did you look in the menu bar? Under Text you have a couple of Reformat… entries that may fit your needs.
Beside these native features, some bundles — like the JavaScript one — have custom Reformat… commands : click on the little cog button at the bottom and explore your current language's bundle's content.

Disable auto-indent certain items in Visual Studio 2005?

I don't mind most of the way that VS2005 auto-indents (or auto-formats) my C++ code, but certain items I don't want it to automatically indent. Like #define statements for example. It takes them and shoves them all the way to the left side of the screen, no matter how deep into my scope I type them. That's really really annoying.
Is there some way to alter this behaviour, besides completely disabling auto-indent/format?
If you have only a few examples you want to change (and don't mind re-correcting the indentation when there are whole section or file reformats), you can change the indentation to what you want, then move off the line.
The formatted indentation will return, but you can Undo (Ctrl+Z) and the indentation you want will return. (Note I haven't actually tested this in the C++ editor.)
As long as you don't mind "correcting" the indentation every time you edit the line (and the other times the whole section is reformatted), this allows you to have some lines alternately indented.
Try go to Options -> Text Editor -> C/C++ -> Tabs -> Indenting and change it to Block. When selected, new lines are automatically indented. The insertion point is placed at the same starting point as the preceding line.

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