I am trying to use the a macro in xcode.
I type in a then hit escape and select it.
This is annoying because I have to hit page up 5 times to get to the a.
Is there a different key combination that will just let me use the a as typed without having to select it?
Have you changed your XCode defaults? I'm using 3.1.4 and I don't have to hit page up. Here are my exact key presses:
a
escape
enter
I can also hit escape first and start typing the macro name.
Edit: Argh! Your demon has infiltrated my XCode! ;) If I auto-complete some things, they become sticky as the new starting "a" macro--I can't even backspace and type "a" to use the first "a" macro. Each file has it's own persistent memory too, so switching files changes the default. Using a method or property or any other parsed symbol seems to have priority over the macros so the default will never go back to the initial "a" macro once you auto-complete a parsed symbol.
Pretty weird bug. I must not have seen it because I don't use macros much.
The only way I found to fix this is to change the "a" macro to some other auto-complete such as "ai". That way when you type "a" "escape", typing "i" next will select the macro you want even if there's a bad sticky default.
Start with this reference http://mcdevzone.com/2009/04/09/useful-xcode-tricks/
Then edit "~/Library/Application Support/Developer/Shared/Xcode/Specifications/TextMacros.xctxtmacro/Contents/Resources/ObjectiveC.xctxtmacro" and change the "CompletionPrefix = a;" to some other prefix.
When you restart XCode, the new prefix will work in place of the old "a" macro.
Related
I am curious if VS2013 has the possibility to make it's intellisense auto-complete a little more effective.
I am used to have classes like MyClassInCamelCase and MyClassAgainInCamelCase even MyClassYetAgainInCamelCase. The way intellisense works for me is that I type My and I get a list of the 3 possible classes that match this word. But things will be a lot easier if I could make it like a command prompt and hit some special key that will autocomplete the word until the next CamelCase word, so I could get "My", then "MyClass" and then the next character I type can define a unique word (or just hit ; for example and auto-complete the current selected word on the list).
Also, the possibility to navigate between CamelCase words will be of great help.
Does anyone knows if this is a hidden feature or something? Or if there are external plug-ins that can make this possible?
This might not directly answer your question, but note that with camel-cased type names, you can do better than to start typing the beginning of a type name (My):
Typing an enclosed part of the name:
Again will suggest MyClassAgainInCamelCase and MyClassYetAgainInCamelCase.
Yet will suggest just MyClassYetAgainInCamelCase.
Typing just the capitalized letters:
MCY will suggest MyClassYetAgainInCamelCase.
Both of these shortcuts can be combined, btw.
I think the hotkey combination is Ctrl + Space to open Intelisense, than Tab, Enter or Space to insert.
There is a complete word option in the Intelisense settings, check if that's toggled on.
I'm using Gvim in windows.
Normally, when we type some character then press Ctrl-n, vim will show some tag, but those tags just includes words which have been pre-typed in the current file.
Now, I need it working in a new language, and show the tag which has been defined in other files.
So, I create a new \\.ctags for this new language, and generate tags file by exuberant-ctags.
I can choose a function in current file, then press Ctrl-] to jump to the function definition, but this function was define in the other files. It is working very well.
I don't know how to make it show the tags which are generated by ctags when I type some character.
Please help me. Thanks very much.
My English is poor, I hope you can understand what I said.
CTRL-N is just the default completion (which completes from a variety of sources, including the open buffers and also the tags database). There are many more specialized completions (all starting with CTRL-X), among them tags completion, triggered via CTRL-X CTRL-], see :help i_CTRL-X_CTRL-]. If you've correctly configured the 'tags' option (so your tags database is found) and tags jumps do work, just start using that.
Some languages / filetypes also define a language-specific completion (for language keywords etc.), usually via the 'omnifunc' option and triggered by CTRL-X CTRL-O. You could write such yourself, too.
Xcode's auto-completion is often getting in my way by giving me argument placeholders when I already have them. Here's an example:
I want to change that second MoveToPoint to AddLineToPoint, so I delete part of the name, and hit control + space for the Show Completions command. I get something like:
You see the annoyance. I tab complete the name, but now I have to delete the 3 arguments, the commas, and the parentheses. This kind of thing annoys me and throws off my flow when writing code.
Ideally I'd like a way to delete these placeholders with one command, or have a separate auto-complete command, so along with Show Completions (control + space), I could bind something like Show Completions without Placeholders. Does anyone know how to do that?
XCode does support this actually. They call it "Select Previous Completion". Check it out here (under Code Sense).
You essentially just hit ⌃> (hold control and press >) for XCode to choose your previous completion. It think it only works well though if the new method you're calling takes the same number of arguments as the previous one.
Hope this helps
I'm trying to save a macro to the file I'm editing.
All goes well until I close and reopen the file. When I reopen the file, the pasted macro
<80><fc>^B Setup^M<80>
has become
■üSetup^M■
I assume this is encoding related but it's beyond me on how to resolve it.
Following are some settings that might be relevant:
fileformat=dos
fileformats=dos,unix
fileencoding=latin1
fileencodings=ucs-bom,utf-8,latin1
encoding=utf-8
Does anyone have an idea what I need to change to make it work?
Edit
I had no idea where the <80><fc>^B sequence was coming from.
It appears to be inserted into the macro when I type //***** Setup with the SHIFT key pressed up until the S from setup. The macro gets pasted as //*****<80><fc>^B Setup
Note 1: I use an Azerty keyboard. For the keys / and *, I need to press the shift key.
Note 2: A solution is to not hold the SHIFT key when typing the space character between //***** and Setup. Holding the shift key mearly has become an automatism when typing that pretty much used sequence.
you are using the gui with -W option? Then read that question. It is really related to it.
I want to try the following things in vim insert mode:
to have closing bracket/parenthesis inserted (after the cursor) every time I type the opening one
to have #{} inserted whenever I type # inside "" (optionally, inside %() too)
I know it is possible, but my competence in this part of vim does not even reach the self-starter level.
This script will do the first one (auto inserting the closing bracket and placing the cursor between the brackets.)
lh-brackets helps define brackets related mappings. It also provides a few functions aimed at defining context-sensitive mappings and abbreviations (see Map4TheseContext).
If in ruby %() is associated to a syntax highlighting, Map4TheseContext will also solve your last request. If not, you'll have to play with searchpair() to detect the current context. Let me know if you have troubles to come up with a working solution.