How can I make Coda auto indent between function brackets? - macos

I've been trying out Coda for the Mac. I really like it, except for one thing. It does no auto indention between brackets. I'm use to having other editors I use to automatically close brackets and tab indent for me. Does anyone know how to make it do this? I really want to love Coda, but to me, this is a deal breaker if I can't get it to do this.

Download TEA for Coda from here. Once installed you can use cmd+shift+enter which will move to next line and indent. Hope this helps.
(TEA is no longer maintained but is still very robust in my experience)

Related

Cant write or delete two open curly brackets {{ in netbeans

I am using the PHP framework Laravel, which is the best PHP Framework, however If I try to write two {{ then it does not work, netbeans won't let me!
How can I write {{ in netbeans?
I just notice that I can also not delete them If I copy paste them in!
I can't even undo to remove it.
I am using the latest version of netbeans (8.2).
UPDATE #1:
After closing and reopening the file, it works again?
I think I experienced a strange bug.
UPDATE #2:
Today the same bug happened and closing and reopening did not helped
UPDATE #3:
It is a bug: https://netbeans.org/bugzilla/show_bug.cgi?id=268719
Try disabling the Knockout JS and AngularJS editor support plugins and restarting.
I had the same issue and found this solution on the bug tracker.
edit: Follow the screenshots attached to disable the plugins. I couldn't figure out how to change the language of my Netbeans to english, so I hope the screenshots are easy to follow.
Step-by-step screenshots
I ran into the same issue, and worse- unable do anything with double brackets or php tags. My suggestions:
Restart It's worked so far for me, but it's not a real solution.
External Editor You can try resolving any offending code in a basic text editor. But again, a bothersome workaround.
Autocomplete Options If you can recreate the problem, you can toy with disabling options under Tools > Options > Editor > Code Completion. (I would assume under PHP.) (I'll update if/when I run into it again.)
Different IDE: I love Netbeans, but support for Laravel just isn't there (yet?).
If you need a PHP Framework, Netbeans is equipped for quite a few. (You can see this under Tools > Options > PHP. You'll note Laravel is not listed.)
If you need Laravel, you may need a new IDE. This list is right off the top of Google, but it lists Netbeans, mostly due to the code completion add-on. https://www.dunebook.com/5-best-ide-laravel-ide-with-laravel-ide-helper/
I encounter this problem too, seems to be a bug on the NetBeans 8.2 as it never happened on my previous NetBeans versions.
A work around on this would be to
open a single curly brace first e.g href="{foo/bar"
close with two curly braces e.g href="{foo/bar}}"
Then go back and add the second opening brace. e.g href="{{foo/bar}}"
Hope it works for you and hope the bug get's fixed asap.
Sharing my quick workaround:
start by typing:
{}
select both braces
drag the selected text (the two braces) with the mouse, so cursor will be between the two braces.
press Ctrl (to copy instead of move)
"drop" it (release the mouse).
you should now have:
{{}}

How to use code formatter in Xcode for Swift?

Xcode code formatter Swift
I'm trying to auto format my code written in Swift. It's necessary if you're working in team and using CVS and don't want to merge for hours.
Ctrl+I just makes an indent, but for example i want to have proper space between functions and just all the stuff like in Clang.
The reformat code command in xcode is Ctrl-I, not Cmd-I and it appears to work just fine.
I write a extension app about format Swift code: Swimat
There has two way to install
brew cask install swimat
Clone this repo, build and restart Xcode.
See https://github.com/Jintin/Swimat for more information
In Xcode [Objective-C, Swift]:
1) ⌘+A: highlight code
2) ⌃+I: reformat code
⌃+i: reformat code
Ctrl+i: fix code indentation
Eventhough it has good IntelliSense, xcode sucks at code formatting generally.Wish it was better.
Apple has to spend so much effort in this in order to make it VS level good.
Xcode and Swift 2.0: Per file, Cmd-A then Ctl-I. Ctl-I works for what is highlighted, Cmd-A highlights all. Just be careful not to accidentally delete all your source after the Ctl-A!
SwiftFormat is a popular code formatter for swift. It has an extension for Xcode, which can be accessed from the Editor menu.
Quote from the SwiftFormat readme:
SwiftFormat is a code library and command-line tool for reformatting
swift code on macOS or Linux.
SwiftFormat goes above and beyond what you might expect from a code
formatter. In addition to adjusting white space it can insert or
remove implicit self, remove redundant parentheses, and correct many
other deviations from the standard Swift idioms.
(I know the question says Xcode but)
personally this is another reason to use AppCode alongside Xcode.
While Xcode only fixes the indentation for Swift code, as mentioned in the question, AppCode at least handles spaces too. Somewhat relatedly it removes indents from empty lines by default.
AppCode's Swift support definitely isn't perfect yet and you still need to check the code in both, but it's still worth it because of better navigation and things like this.
The command in xcode is ctrl-i to format code, not cmd-i.
I would suggest using sublime text with the swift plugin, which will allow you to hotkey the code formatting.
https://sublime.wbond.net/packages/Swift
Select lines, then press Ctrl+I.

Automatically fetch links with Sublime Text?

This is kind of a random question, but in Textmate, there was a really nice feature. You could highlight a URL, press a keyboard shortcut, and it would automatically create for you.
I just searched tirelessly for about a half hour trying to find a similar package that would do it, but I can't seem to think of what search term to even look for. Anyone know off the top of their head a package that does this? I really loved that feature; it would hit the other website, grab the title attribute, and drop it in for you.
Any advice would be much appreciated!
I don't think you can do that easily with standard sublime abilities. But I've found a package that is inspired by Textmate and it's called HyperlinkHelper.
Simply install via PackageControl, restart sublime and you are ready to go. The default keyboard shortcut for generating a hyperlink out of the current selection is STRG+ALT+L. Tested it in sublime 2 and works perfectly.

Lightweight editor for Mac that highlights all occurrences of a word

My question is similar to this one: How to highlight all occurrences of a word in an Emacs buffer
In Notepad++ editor, there's a convenient feature: if you select a word in your text (not necessarily a keyword), the word is highlighted throughout the text. Is there any similar way in a lightweight editor for Mac? I've tried Textwrangler and jedit, but they don't seem to have this very useful feature.
Thanks for all the tips. I've tried out the various alternatives and ended up finding that jEdit has a good plugin for this feature: The "Highlight (Buffer scope)" option in the "Highlight" plugi
The only Mac text editor I know of that does this is Xcode, but I wouldn't exactly describe this as "lightweight".
You could to this in TextMate - not out of the box - but you could implement it fairly easily with whatever scripting language youre good with (ruby is whats normally used). There might even already be a plugin/bundle in the repository.
I'm not sure how willing you are, but you can look into writing a highlight plug-in for textWrangler.
I think you'll need the BBE-sdk. Here's their blurb on developing plugins: http://www.barebones.com/support/develop/
vim, running in a Terminal is very lightweight and will do this.
vim file.txt
:set hlsearch
/word
If you only like GUI apps there is MacVim out there for downloading.

Is there a way to completely disable copy/paste functionality in Visual Studio?

I'm looking for a way to completely disable the copy/paste functionality in Visual Studio (2005 if it matters). The reason behind this request is that I want to prevent myself from doing too much copy/paste while coding.
Thanks to all for your answers!
No. Use self-discipline instead.
Yes, there is a way.
Download AutoHotKey. Save this as GoAwayN00b.ahk and double click it.
#ifWinActive, ahk_class wndclass_desked_gsk
^c::
^v:: MsgBox Go away n00b !
Additionally, you may want to provide visualisation for xtra stimulation. Save this picture and display it on hotkey press (left for exercise):
alt text http://images.paraorkut.com/img/funnypics/images/g/go_away_noob-12269.jpg
BTW, copy/paste + CLCL = FTW. I don't use VS without it.
EDIT:
Alternativelly, you can Customize Keyboard (right click toolbar -> Customize->Keyboard) and delete Edit.Copy and Edit.Paste hotkies.
However, above script works with any VS and on any computer while this solution needs to be setup individually.
The other day my daughter asked if I had a duller saw so she wouldn't cut herself as easily while pruning some bushes. Of course now it takes longer to prune the bushes...
As asked: The other day my daughter asked if I had a duller saw so she wouldn't cut herself as easily while pruning some bushes. Of course now it takes longer to prune the bushes... Refactored.
For dull saw she asked
No injury while pruning
Free time now all gone
I think you missed the point of the article but in you really want to, here are some resources for battle copypasta.
As Jeff lines out in his current blog entry, copy&paste itself is not the problem, but how you use it. As copy&paste can also be used to speed up "typing"/editing, you shouldn't disable it.
Prise your C button out of the keyboard.
Copy and paste is a valuable tool. You should be careful about what you copy and paste, but you don't need to disable it. Just watch what you're doing.
Don't forget to disable CTRL-drag as well!
Maybe you can find some sort of util that allows you to global remap key combinations. Then all you have to do is re-map the copy/paste combinations do to something else. Just an idea.
Although I think you are crazy for wanting to do it. :)
Write a small service program that will monitor clipboard changes and upon notification replace the clipboard text with "Content protection from lazy asses".

Resources