Tabs not being recognized from RStudio text editor - text-files

If I create a simple Makefile in an Rstudio Text File:
graphic1.jpeg : mouse.csv graphic1.R
Rscript graphic1.R
It will not execute. I get the error message, "Makefile:2: *** missing separator. Stop." because the tab in line 2 is not really a tab.
If I edit the Text File in Text Wrangler, a real tab will be inserted and the file will execute.
I have updated my RStudio Preferences / Code to ensure that the box is unchecked for "insert spaces for tab".
Is this just a bug in RStudio text editor?

If you want to change this setting temporarily e.g. to tabulate a Makefile or a .tsv file, the fastest way is to only change the Project Options, do your stuff, and then revert it back.
The project options take precedence over Global Options, so changing the global ones only makes sense if you want to keep that option enabled for all future projects.

So I just learned from an R-Bloggers post by Jeffrey Hollister that there are two places in RStudio where I need to uncheck "Insert spaces for tab":
1) RStudio / Preferences / Code
2) Tools / Project Options / Code Editing
I am now up and running.

Related

Why does Visual Studio Code insert spaces when editing a Makefile and "editor.insertSpaces": "auto"?

make doesn't like spaces for the body of a target in a Makefile. Has to be a tab.
I changed "editor.insertSpaces" to "auto", thinking this would help. It didn't.
I had to set it to false in order to get the code working.
This is now possible with Language Specific Settings.
https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
To customize your editor by language, run the global command Preferences: Configure Language Specific Settings (command id: workbench.action.configureLanguageBasedSettings) from the Command Palette (⇧⌘P) which opens the language picker. Selecting the language you want, opens the Settings editor with the language entry where you can add applicable settings.
Once you have the editor open, enter the following configuration for [makefile]
{
"[makefile]": {
"editor.insertSpaces": false,
"editor.detectIndentation": false
}
}
VS Code does accurately guess the file type for a Makefile, but the language configuration does not specify tab style. There is an outstanding pull request that addresses this issue.
Before that PR lands, you may be able to fix this locally by editing the application itself. On OSX where applications are really just folders, you can find the language configuration for Makefiles in Visual Studio Code.app/Contents/Resources/app/extensions/make. Open up make.configuration.json and add "insertSpaces": false on line 2. That fixed it for me.
Visual Studio Code users that wish to use spaces as their indent character in the global configuration will have trouble editing Makefiles because it requires the user to use tabs as their indent character instead of spaces. Updating the configuration just to edit a few lines is not a viable solution IMO.
You can use the Command Palette (View > Command Palette) and type Convert Indentation to Tabs and hit Enter. You editor should now have updated all indentation to their corresponding tabs equivalent.

Disable Auto-Tab in Visual Studio via a dat file

I wrote a dat file for when I'm writing assembly to give me some syntax highlighting, the problem I am running into is that one way to do a comment in MASM is to use a semicolon and you typically tab a fair bit away from the actual code before you write the comment (at least I do). Well whenever I do this, it messes up all of the formatting in the .asm file because it tries to format the document whenever it sees a semicolon, I am wondering is there a way to turn off auto tabbing and other stuff via a dat file? I just know how to load a dat file that tells the editor some words to highlight, that's it.
Thanks in advance for any input on this :)
You can export the specific settings for a certain project and then import it later. This will save .vssettings XML format file.
Just define you tab setting before in Options dialog from the Tools menu, selecting the Text Editor -> Your prefered language-> Formatting -> General page, and unchecking relevant check- box ( in your case tabbing).
Then in Tools > Import and Export Settings , export the settings.
I hope it sort your issue.

Sublime MarkdownEditing plugin color scheme and line numbers

I like to utilize Markdown for a lot of the text that I write. To that end I wanted to try out the MarkdownEditing plugin for Sublime Text 3, but am having some user experience issues:
I cannot figure out how to change the color scheme such that it affects the MarkdownEditing syntax editor. Changes to .Packages\User\Preferences.sublime-settings do not effect display settings when in this syntax highlighting mode. However, those changes are reflected in other tabs. How do I change the color scheme when making use of the MarkdownEditing syntax highlighting?
How do I turn on line numbers when making use of this syntax plugin?
TL;DR
If you are using Markdown GFM syntax, open/create "Data/Packages/User/Markdown.sublime-settings" and add:
{
"color_scheme": "Packages/your/custom.tmTheme",
"line_numbers": true
}
See menu: Preferences > Package Settings > MarkdownEditing.
There are 3 different settings there for 3 different syntaxes. First check what "default" settings does and then undo it in "user" settings.
To stop the MarkdownEditing package from overriding your color scheme on Markdown files:
Open Preferences > Settings - User
Find your color_scheme line - e.g. it looks like
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
Copy the entire line
Open Preferences > Package Settings > Markdown Editing > Markdown GFM Settings - Default
Comment out the other color_scheme lines by adding // in front of them
Paste your line instead
Save the file
Markdown files will now use your regular color scheme rather than using their own scheme just for .md files.
If you get an error about "Error trying to parse settings", make sure your line ends with a , if there are lines below it, and does not end with , if it is the last line.
This was one of the most annoying things about this plugin when I installed it a while back, so I promptly got rid of it. However, before doing so, I figured out how to solve your problems. First, since you're using ST3, you'll need to install the quite-useful PackageResourceViewer plugin. Open the Command Palette (CtrlShiftP on Windows), type in prv to bring up the PackageResourceViewer options, and select Extract Package. Scroll down and select MarkdownEditing, hit Enter, and you're all set. You can now open Packages/MarkdownEditing (Packages should be in C:\Users\username\AppData\Roaming\Sublime Text 3, also available by selecting Preferences -> Browse Packages...) in the sidebar and browse through all the different .sublime-settings files for the different syntaxes and for the main plugin, changing things as you want. The syntax-specific files use all the same options found in Preferences -> Settings-Default, so for example you can set "line_numbers": true to turn line numbering back on, and change the value of "color_scheme" to your preferred value.
I had another packaged named Markdownlight which was overriding the color scheme. I had to uninstall it before the color_scheme in the MarkdownEditing user settings took affect.

How do I activate the Zen coding key bindings in Sublime Text 2?

I just downloaded the Zen coding package for Sublime Text 2, but I can't figure out how to activate it.
I already have it in Netbeans, and here you just have to press CTR+ALT+N, but this doesn't work in the Sublime editor.
Google didn't yield any results, so I'm asking here.
Can someone tell me how to activate the Zen coding function?
press Ctrl+Alt+Enter and you'll get a text input box at the bottom of the screen, titled: Enter Koan:. as you type the zen expression into the box it will simultaneously unfold on the screen.
Alternatively, you can type the zen expression in the editor and press tab to expand it. Be sure not to leave any spaces inside the expression or after it.
I have been using Sublime Text 2 beta, build 2139 on Windows (but I'm also pretty sure this should work on Mac OS and Linux too) and here's how I got it to work:
After installing Sublime Text 2 itself, install Package Control
for Sublime Text 2. This is an add-on that allows you to easily
manage another add-ons.
I couldn't get the first installation option to work so I went for
the manual method. On my installation there was no folder called
"Installed packages", instead I've used "Pristine Packages" folder
which seemed to contain other, already installed extensions.
Restart Sublime Text 2
With Package Control installed open Sublime Text 2 editor and choose Preferences -> Package Control -> Package Control : Install Package from the menu. Hit "Enter" and there should be a list of packages available for installation displayed on the screen. Start typing "Zen" and Zen-Coding will be presented. When selected hit "Enter" again, status bar on the bottom of the screen will be showing installation progress.
When it's done - restart Sublime Text 2 one last time. Now, you can expand Zen-Coding abbreviations with 'ctrl+space' or 'tab'.
Remember it will only work in the saved file, with extension "html". (in particular - it won't work on the new document you've just created).
I hope this helps
To expand your zencoding, just press TAB. However, for a full list of all the keybindings, look in your Zencoding folder for a file called "Default (NAME_OF_YOUR_OPERATING_SYSTEM).sublime-keymaps". To get to the package, go to "Preferences > Browse Packages > zencoding".
Ctrl + Opt (Alt on a PC) + Enter. Check out the video.
See this post : Zen coding downloading trouble
and my comments for detailed instructions.
Also, after an upgrade, just replace the folder with the original one from
http://dl.dropbox.com/u/1292831/ZenCoding.zip
Good Luck ..
Download this one; https://github.com/sergeche/zencoding-sublime
It works on SublimeText2 2.0.1 build 2217 windows.
After install Emmet package, remember to restart sublime editor and save a file first to try it!. I thought it wasn't working after install, but it just needs a saved file to work on it.

Aptana Studio 3 - Syntax highlighting for Handlebars files

How do I get Aptana to apply the same syntax highlighting and auto-complete that exists on .html files to my files that end in .handlebars?
I'm assuming there must be some setting in Preferences to allow this, but I'm not seeing it.
If it helps, I'm using version 3.0.7.2011
Ok, recently figured this one out.
Under Windows > Preferences select General > Editors > File Associations.
Here, you can simple add whatever extension you want, then the editor that you want to apply it to.
Here's a screenshot:
After you click "Ok" you will have whatever syntax highlighting or code completion that the editor you specified has.

Resources