Why is Textmate treating *.rb files as PlainText - ruby

Been using Textmate 2 for ages. Usually keep it on the nightly builds. A couple of weeks ago it started sporadically treating all my *.rb files as plaintext. And as of the latest release build - it treats all my *.rb files as Plaintext. :(
I've tried:
Turning off all the syntax highlighters, restarting TM and reinstalling them
Uninstalling TM; reinstalling the App
Using only the actual releases, instead of nightly builds
After uninstalling all language packs, it correctly asks to install coffeescript, javascript, json, etc when I open those files. However, it does not ask for a *.rb file.
I've searched the TM mailing list and found nothing similar.
*.rake, *.rbx and all the other file types listed in the Ruby Language pack are recognized as ruby.
Any ideas?

When you open a file and manually change the file type via the status bar then TextMate 2 will remember this binding (for all files using same extension) in ~/Library/Application Support/TextMate/Global.tmProperties.
There are a few options to undo a stored file type binding:
Open a *.rb file and select Ruby via the status bar.
Edit ~/Library/Application Support/TextMate/Global.tmProperties to remove anything that sets fileType for *.rb. Such entry would look like:
[ *.rb ]
fileType = text.plain
Delete ~/Library/Application Support/TextMate/Global.tmProperties.

Quit TextMate
Remove /Library/Application Support/TextMate
Remove ~/Library/Application Support/TextMate
Launch TextMate
Open a *.rb file
Profit!

Related

Sublime 3: last session not saved

So I have reinstalled my Ubuntu to newer version and then I migrated sublime 3 configuration that I used. Everything seem to be saved like it was before, but it looks like sublime just do not save a session that it was at.
Every time I close sublime, when I open, I always get one file opened that I had used before at some time. It does not matter what I had opened recently, it always opens same file.
To be specific, it is bashrc file (if that matters at all).
Now if I reopen sublime, then close bashrc file, then open project, when I reopen again, I do not even see that project was added. I can't use alt+ctrl+p, because it does not remember that I even opened any project.
I looks like session is fixed on one state somehow.
Sublime build I'm using is: 3126
Update:
When migrating sublime settings, I copied this directory sublime-text-3/Packages/User (that comes from ~/.config/sublime-text-3/Packages/User). It had settings files and some custom snippets.
I ran into this same issue on linux. From https://web.archive.org/web/20191102071813/http://docs.sublimetext.info/en/latest/getting_started/install.html
run the following command:
sudo chown -R $USER:$USER /home/$USER/.config/sublime-text-3

Sublime Text 3 overwrites manually installed package in OSX

Following instructions to manually install arduino IDE here
Reason for manual installation is because package manager has an older version of the plugin (10 months).
After placing it in ../Packages, I open ST3 and watch Finder. Initially, the folder extracted is named "Stino-new-stino". A folder is created at ../Packages/User/Stino with what seems to be options for the topmenu, and then the Stino-new-stino folder is deleted.
Tried to put extracted folder into ../Installed Packages, as well as ../Packages/User, but doesn't get detected.
Also noticed that my TomorrowTheme package got moved into my ../Packages/User/SublimeLinter.
I removed SublimeLinter and it still seems to be happening so I'm thinking it's an ST3 thing.
There was some funky beta code happening and had to remove package-metadata.json for it to stop deleting itself.

How to get Mac OSX Finder to preview programming text files that don't have .txt or .text extension?

Programming obviously involves lots of text file usage. You often want to see what you did somewhere else in some other program, without loading up that whole program into your current IDE of choice.
If I copy a text file from say fred.cpp to fred.cpp.text, I can view the contents of the file from the Finder's preview. But I don't want to have copy or rename all my development files.
In a 2003 (!) post on MacOSHints, there is an instruction to do this
find . -name *.xml -exec SetFile -t TEXT {} ;
(in that case, for *.xml files), but this didn't work for me due to issues with the exec command. But in any case, surely there's a better way to do it from the GUI?
Either way though: a command-line or a GUI solution would be great, thanks!
Update: I didn't manage to get qlcolorcode to work properly on the latest MacOS (10.15+) so I switched to this one.
https://github.com/sbarex/SourceCodeSyntaxHighlight
which can be installed with
brew install --cask --no-quarantine syntax-highlight
Original answer below
2 years late but you can use
https://github.com/anthonygelibert/QLColorCode
install via brew cask
brew cask install qlcolorcode
or
brew install --cask qlcolorcode
(if you have a newer brew.)
for more nice usages of the quicklook, check this repo
https://github.com/sindresorhus/quick-look-plugins
There is the Textmate QuickLook plugin which only works with Textmate running.
Pro: Syntax Highlighting
Contra: Only with (non-free) Textmate running
Alternatively: QLStephen
QLStephen is an Apple OSX QuickLook plugin that lets you view plain text files without a file extension.
But it works for all plain text files (even with extension).
Pro: Stable and free
Contra: No syntax highlighting

Sublime Text 3 System Package Location?

Where are system packages located in ST3? I'm well aware of these two:
~/Library/Application Support/Sublime Text 3/Packages
~/Library/Application Support/Sublime Text 3/Installed Packages
But I can't find where packages such as HTML or PHP are located. These are system packages that I want to edit. I've seen a number of articles suggesting that I copy the default package, let's say the HTML package for example, to my 'Packages' directory and edit it how I like. I just can't find the package to copy...
I'm running OSX 10.8.5 (Mountain Lion), ST3 Build 3047.
Thanks!
Pristine packages in OS X are located in /Applications/Sublime Text.app/Contents/MacOS/Packages. If you're going to be fooling around with the contents of them, I very strongly recommend using the PackageResourceViewer plugin. It does all the moving, unzipping, and renaming behind the scenes, and if you set the "single_command": false option you'll get all the options you need in the Command Palette. I can't recommend it enough, it's made my life so much easier!
(No, I didn't write it...)
One more bit of advice - don't change any of the pristine packages. Other stuff depends on them, and weird things can break in unexpected ways if you outright delete any of them. Instead, use PRV, and/or create identically-named folders in your ~/Library/Application Support/Sublime Text 3/Packages folder, and override individual files by placing modified versions there instead.
Good luck!

After much reading, I still can't get Pathogen to load a plugin under Windows

For gVim 7.3.46 on Windows 7 64-bit fully updated (I run gVim 7.3.46 because it adds a reliable instance of "Edit with Vim" to the Windows context menu.)
Despite having read an abundance of articles (many of them which repeat the others) I can't get Pathogen to load a vim plugin that already works fine if I don't use Pathogen.
The problem seems to be the location of Pathogen's "bundle" folder as follows:
· IF I place the mru.vim (Most Recently Used Files) plugin in "D:\Program Files (x86)\Vim\vim73\plugin", THEN MRU works just fine — typing :MRU returns a list of recently used files
. IF I place mru.vim in a folder named "bundle", then place the bundle folder in "D:\Program Files (x86)\Vim\vimfiles", or other locations listed below, typing MRU returns "E492 : Not an editor command : MRU"
MY ENVIRONMENT:
· In Windows 7 64-bit, Vim / gVim 7.3.46 is installed in "D:\Program Files (x86)\Vim\vim73\gvim.exe" (Yes, "D", not "C").
· In gVIM, typing :e $VIM returns the following four-lines:
../
vim73/
vimfiles/
_vimrc
· In "D:\Program Files (x86)\Vim\vimfiles\autoload\", I have pathogen.vim. In this location gVim starts without error, and typing :pathogen#helptags() returns no error (one article I read indicated that command was one way to tell if Pathogen was installed correctly).
· My _vimrc file includes the lines:
syntax on
execute pathogen#infect()
filetype plugin indent on
MY PROBLEM:
I've tried copying the bundle folder containing mru.vim to:
· D:\Program Files (x86)\Vim\vimfiles (reputedly the "correct" location for Windows)
· D:\Program Files (x86)\Vim
· D:\Program Files (x86)\Vim\vim73
Multiple articles identify the first entry in that list as the correct location for the bundle folder in a Windows system. That is to say, that in Windows unlike *ix, one evidently does NOT "bury" the bundle folder somewhere down in the *ix .vim folder, or Windows ..\users[userName] folder, or the like(?)
All of those locations for "bundle" produce the same response to typing :MRU — "E492 : Not an editor command : MRU".
I'm at wits end. Any ideas anyone?
(By the by, thanks but I do NOT want to use Vundle / Github / Curl or any other network related solution. I don't use all that many gVim plugins, and the ones I do use I want to download and copy into the bundle folder myself rather than have an unwanted network process involved in that.)
Cheers & thanks for your help,
Riley
SFO
mru.vim should be placed in the bundle folder such that the path is
D:\Program Files (x86)\Vim\vimfiles\bundle\mru\plugin\mru.vim
Although it should really be placed inside vimfiles in your home directory not Program Files
$HOME\vimfiles\bundle\mru\plugin\mru.vim
Pathogen makes it so that every folder in bundle is part of the vim runtime path. This allows every plugin in the bundle folder to have a clean environment for it to store all related files.
For example if you had two plugins that had more than one file (for example they both came with documentation).
Then the file structure of the vimfiles folder would look something like this.
vimfiles/
plugin/
plugin1.vim
plugin2.vim
doc/
plugin1.txt
plugin2.txt
But what happens when you want to remove one of the plugins you need to go find each and everyone of the files (and you might miss some).
With Pathogen installed your directory structure would probably look something like this.
vimfiles/
bundle/
plugin1/
plugin/
plugin1.vim
doc/
plugin1.txt
plugin2/
plugin/
plugin2.vim
doc/
plugin2.txt
Pathogen appends all of the folders under the bundle folder to the vim runtime path. This allows vim to find the files and vim is none the wiser that its not in the usual place.
This also allows for easier removal of plugins. You don't have to go searching for all the files that came with the plugin you just need to remove the relevant folder from the bundle folder.
Just for completion sake. (You don't need to do this if you don't want to)
Installation.
If you used git you can now go to the github page for vim-scripts and find the plugin you want. Since you were interested in using mru the link to the mru plugin is https://github.com/vim-scripts/mru.vim
Now to install the plugin you just need to go into the bundle folder and run
git clone https://github.com/vim-scripts/mru.vim
All the scripts in the vim scripts repository have the proper structure that pathogen is expecting so after running that one command you are done installing the plugin.

Resources