Splitting Panes in XCode - I Wish I had My Emacs :( - xcode

I finally figured out how to split panes in Xcode, and I even finally found out that if I hold option when I split panes, I can do a vertical split too.
But I seem to have run into a bug. When I spawn a separate text editor and split panes within it, I can split panes horizontally, or vertically, but not both. Has anyone else run into this?
However, if I split within the main project window, which includes Groups & Files pane, I can split both ways.
What's the deal?
Oh how I wish I could just do Cocoa in emacs. C-x 0,2,3, and my favorite C-x C-f.
While I'm at it, how do I jump down a block, like I would do with ctrl-down in emacs?

That certainly seems to be a bug; you should file it with Apple.
Oh how I wish I could just do cocoa in emacs
What's stopping you? Cocoa code is just made up of text files like anything else. I've certainly never had any problems editing Objective-C in vi.

Related

How to split terminal into panes in macbook?

I am using iterm on my macbook and want to split it into multiple panes (both horizontally and vertically) like conemu. My end goal is to be able to type different git commands in each pane (conemu example). Is iterm capable of doing this?
If it's not possible with iterm, what are my other options?
I know you can "cmd + d" to split but then I only get the same terminal in 2 different panes.
Are you sue you are using iTerm? Any way I'll sugest to forget about it and use Terminal, for a macOS experience. iTerm remembers me of Linux, you have all the options but you'll spend all day configuring it and when finally is ok then some bug will hit and take your peace of mind How to exit alternate screen scrolling on iTerm2 Vim?.
This might help https://apple.stackexchange.com/questions/6504/how-do-split-panes-in-terminal-work. And #BennyPowers answer at https://superuser.com/questions/55459/how-to-get-vertical-split-of-terminal-in-mac-to-execute-different-actions.
I use the macOS native way to split vertically and GNU Screen (which came with macOS) to split horizontally. Execute screen then C-a S (to split into two regions), C-a TAB (to swith to the other region) and C-a c (to open bash).
You can even resize it with C-a : then type resize 10 i.e. and for more man screen.
When its done you exit andC-a k to destroy the window.
For completeness. A lot of people say tmux https://github.com/tmux/tmux/wiki is a better alternative to GNU Screen. I never tried afraid of the same experience I had with iTerm 2.

Prefered keystroke for ending NSTextView edit

Is there prefered keystroke for ending edit of an NSTextVIew? Obvious candidates are ESCape and Return with modifier key. I'd like this to be fairly intuitive and easy to type. Of course for people raised on Vim, Escape is the obvious choice.
Since I mentioned Vim, I thought I'd add my emacsish version:
For emacs I guess it might be C-x C-S. I would find this more convenient typing than ESC. But what would be the cocoa way?
Command+return is quite common for confirming multi-line input (this is used for example in Apple's iWork when editing a text frame).
In standard Cocoa text views, Esc triggers auto-completion suggestions (when applicable).
tab is the most popular to switch between different textfields and textviews and is considered as end of editing.
Also you can use any combination as per your likings, e.g. cmd+enter etc to move out of the textView.
But no to esc, it sends as something you are cancelling. However this is used in CUI as vim, but surely not in GUI for OSX and even for Windows.

Cocoa: simple tabs

Does any one know how to create a tab bar like this:
I mean that simple tab, without rounded corners or texture, with "Untitled" string
Is this a standard control? Or is there an open source library for such tabs? I think I saw it in a open source editor or something but totally forgot which one.
There are no doubt other ways to do this, but one I've used often in the past is PSMTabBarControl. It's been around for a while, and forked a few times. The version at https://github.com/dorianj/PSMTabBarControl can be used with Xcode 4.
Documentation can be found http://www.positivespinmedia.com/dev/PSMTabBarControl.html.

Is there a programmer's text editor for OS X with narrowing?

I think the title is essentially self-explanatory except for a necessary clarification and caveat:
Clarification
I'm not entirely sure if 'narrowing' is the universal term for the feature I'm referring to. What I mean is something like Emacs' 'narrow buffer', ie. the ability to select a region and quickly narrow the editor window to show only that region, and then after some edits to be able to quickly zoom out to see/edit the full file again. It's a feature I like, and find far more useful than code folding.
Caveat
Of course the answer is 'yes -- (X)Emacs' (and possibly vim?). But I'm looking for something other than vim or Emacs; almost certainly a more GUIsh one (think Textmate, TextWrangler etc).
My researches seem to suggest that the straightest answer is just 'no'. I haven't been able to find an editor that runs on OS X that supports narrowing, other than emacs.
I have however figured out a workaround that might be of interest for some scenarios, which is to use Hog Bay Software's QuickCursor in conjunction with one or more editors.
For example, I've tried setting up QuickCursor to fire up TextMate. So now when working in XCode, I can select the text I want to narrow to, hit the global hotkey I have set up, and the selected text pops up in a TextMate window. That can be edited, then a save and dismiss window pops the edited text back in XCode.
This also works if you're just working in TextMate (or, I imagine, one of the other editors that QuickCursor can control); ie. you can select select test in the editor, trigger QuickCursor to open the selected text in a new window, and later pop that text back to the original window.
I'm guessing this is not what you want, but you didn't specifically say so: Aquamacs? It's an emacsen with good integration with OS X (cut, paste, menus, toolbars, etc).

Vim Question Regarding Views

I have been reading a lot of the questions here on vim. I can't locate something that I want to do with vim but I am sure its possible.
I like vim(I am still new at it) using tabs and I have adjusted my vimrc so that H & L keys take me back and forth between tabs.
I was hoping to find a way to be able to use tab commands to open up a tab as output, so that if I am writing something in my case Ruby and I want to test it I could run it and flip to a new tab with the output. Or flip a tab to an interactive console to test code. This is possible?
As an aside is it possible to expand tabs to views so if I had two tabs open say script and output I could :spx or similar and have tabs come to split screen.
You can load the ruby output into a vim window in a couple of ways. One way would be to open a new split window and then load output of command:
" vimscript command to open new split window
wincmd n
" run ruby command and insert output at line 1
1,1!ruby foo.rb
alternatively you could get view the output on a new tab with a single window:
tabnew
1,1!ruby foo.rb
I know it's not the answer you want, but use buffers and ditch the tabs. I have a screencast going over how to use splits to manage your window.
http://lococast.net/archives/111
As for the ruby output, that seems like it might be covered here:
https://superuser.com/questions/133886/vim-displaying-code-output-in-a-new-window-a-la-textmate
In answer to your question about opening up a tab as output, I don't think there's any built in way to do this. There's the RunView plugin (see my answers to this question and this one), but I don't think that it supports using a separate tab (it works with a split window: what I think you refer to when you say 'view').
Regarding an interactive console: no, this is not possible. See :help design-not.
As for general use of Vim, try to get used to the idea of buffers and the fact that each 'view' (my term), whether it be a split window, a tab or whatever is just a means of looking at a particular buffer. You can have multiple views on a single buffer, so you can have a source file vertical split with two headers in one tab and the same source file vertically split with another header and a different bit of the same source file in another tab. This is very powerful once you get used to it. The Ctrl-W keyboard shortcuts are your friend (e.g. Ctrl-W, h to go left one window).
As for changing a tab into a split window, I don't think there's a direct way to do this (how would Vim know which tabs you wanted to join?). You can break a split into a tab with Ctrl-W + T, but to go back you'd have to create a couple of mappings. This is off the top of my head but something like this might work:
command! TakeThis let takebufnr = bufnr("")<CR>
command! SplitTaken exe 'split #' . takebufnr<CR>
nmap ,t :TakeThis<CR>
nmap ,s :SplitTaken<CR>
Then press ,t on the buffer you want to grab and ,s on the one you want to split with the 'taken' buffer.

Resources