Sublime Text 3 Change Syntax Coloring? - syntax-highlighting

I recently installed Sublime 3, and it's a really neat program, but I haven't been able to find out how to change the colors of the syntax(i.e. block comments, etc)
I've opened Default.sublime-package in Notepad++, and I've found the "Monokai" section(the color scheme I'm using), but even if I change the colors for comments, or even the background, when I open Sublime 3, the colors aren't what I changed them to. I've looked at similar questions on Stack Overflow, but the solutions posted didn't work, and I haven't been able to find anything on Google either.
How can I change the coloring of the syntax, background, etc in Sublime 3?

Use Sublime themes. Monokai is a default theme. You can download any theme you want (for example, from this site: http://devthemez.com/themes/sublime-text-2) and install it. Sublime Text 2 themes mostly work for version 3 either.
First, install Package Control. Instructions: https://sublime.wbond.net/installation. It is simple:
press Ctrl+`
paste provided string and press Enter.
Then clone repository with the theme you want (you need to have some version control system installed, usually it is Git).
In terminal:
Linux: cd ~/.config/sublime-text-3/Packages
Mac: cd ~/Library/Application Support/Sublime Text 3/Packages
Windows: cd %appdata%\Sublime Text 3\Packages
If repository is in GitHub, use git: (example with Argonaut theme from devthemez.com, link is provided below)
git clone git://github.com/pwaleczek/Argonaut.git 'Theme - Argonaut'
Then final step:
In Sublime, open Preferences -> Settings-User and paste appropriate code provided by theme developer: (again, example for Argonaut theme)
{
"theme": "Argonaut.sublime-theme",
"color_scheme": "Packages/Theme - Argonaut/Argonaut.tmTheme"
}
Examples were for Argonaut theme: https://github.com/pwaleczek/Argonaut (this page also contain some sort of instructions for installation).

Related

Vim Devicons Icon glitch on MacVim and Terminal Vim

As I was setting up my ~/.vimrc, I installed Plugin 'ryanoasis/vim-devicons' (https://github.com/ryanoasis/vim-devicons) and Plugin 'preservim/nerdtree' (https://github.com/preservim/nerdtree) - I ran into a problem. I couldn't see the desired Python file icons for any of my Python (.py) files in Nerd Tree window in Terminal Vim and Mac Vim.
The solution to this problem is rather simple as someone did figured it out already. (https://github.com/ryanoasis/vim-devicons/issues/198)
I am sharing this information on StackOverflow community for a quicker reference.
For seeing the file type specific icons in a File browser like Nerd Tree in Vim,
first please install - NERD FONT
(https://github.com/ryanoasis/nerd-fonts#font-installation)
by using the command:
brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font
Final step -
For Terminal Vim: (Mac OS)
Change Terminal font to Hack Nerd Font
For Mac Vim: (GUI Vim)
Add this line to your vimrc file -
set guifont=hack_nerd_font:h21
(h21 sets the font size - change it any value based on your preference)
(save the changes to the vimrc file with command :wq)

Windows: text file became binary

I am working on a QML project with Qt Creator 4.0.0 on Windows 10.
At one point I had a blue screen, and after rebooting, the file on which I was working became binary: impossible to open it on a text editor (including vim) or to see its text content.
I tried to change the file extension, to change the encoding in Sublime Text... nothing helped.
When asking for a git diff:
$ git diff qml/file.qml
Binary files a/qml/file.qml and b/qml/file.qml differ
Does anybody have any idea about how to retrieve the file?

Powerline (tmuxline and vim-airline) not showing the right characters [iTerm2, Mac OS X]

so I'm using tmuxline and vim-airline because I don't know how to install powerline for iTerm 2
Anyway they should be looking like tabs but there are characters here not showing. Can anyone help me out?
My question has been answered. Thanks guys!
For future viewers who might encounter the same problem. All you have to do is the following:
Write this in your terminal (iTerm2 etc...)
git clone https://github.com/powerline/fonts.git
Now find that file (usually ~/)
cd powerline/fonts
Then type
./install.sh
After that go to your terminals preferences (usually cmd+,) and go to profiles > profilename > Font (Change Font) > Search for "Powerline" and all the installed fonts for powerline should appear > apply.
Use Anti-aliased if you want, and you can separate into two different fonts so that you only need the powerline font for 'Non-ASCII', and your preferred font in 'Font'
Did you install the patched font, as mentioned in Installation on OS X?
Install downloaded patched font by double-clicking the font file in
Finder, then clicking Install this font in the preview window.
Despite the link is to powerline installation manual, vim-airline also suggests to install that font.
You need special fonts for tmux powerline. You can easily install them from the command line:
git clone https://github.com/powerline/fonts.git
sudo ./fonts/install.sh
Then you change fonts in iTerm2 (both regular and non-ASCII fonts).

Colors slightly off in "solarized" color scheme

I have installed the Solarized color-theme using package.el in the latest version of Emacs (24.3), but the colors seem to be off (the contrast seems to be too low)
My Solarized installation:
The screenshot from the website:
I read the following in the Emacs color-theme Solarized documentation on the GitHub repository:
If you are going to use Solarized in Terminal mode (i.e. not in a GUI
version like Cocoa or X11 Emacs), please please please consider
setting your terminal emulator's colorscheme to use the Solarized
palette.
...
The Solarized repository includes palettes for some popular terminal
emulator as well as Xdefaults; or you can download them from the
official Solarized homepage.
...
Again, I recommend just changing your terminal colors to Solarized
values either manually or via one of the many terminal schemes
available for import.
This made me wonder if I am suffering from this problem. However the snapshot above is from Emacs on a GUI (Gtk) (i.e. not from running Emacs with -nw option)
Either way: How can I change my terminal emulator's colorscheme to use Solarized values? I have git cloned the solarized repository but I don't know what I am supposed to do with it.
In case it matters:
I do not have admin access to the machine where Emacs is installed
I am running the latest stable version of Emacs.
I connect remotely with ssh -X from a GNOME terminal from Ubuntu (latest version) on my local machine. GNOME terminal seems to be version 3.6.0ubuntu.
Solorized was initially created for VIM. Mods for other editors weren't written by Ethan Schoonover.
If you look at the full image you posted on the website it says VIM on the top. So basically it works as it should in emacs) I have tried solorized both on vim and on emacs and I should say it works perfectly fine in VIM.

What is the full path to the Packages folder for Sublime text 2 on Mac OS Lion

I'm not seeing this question anywhere so I can only assume I'm doing something really stupid but...
What is the full path to the "Packages" folder for Sublime Text 2. I'm looking to install a new theme.
When I go to
/Applications/Sublime Text 2.app/
There is a "Contents" Folder only
Inside that is:
Frameworks Info.plist MacOS Resources SharedSupport
/Users/{user}/Library/Application Support/Sublime Text 2/Packages
Get to it quickly from within Sublime via the menu at Sublime Text 2... Preferences... Browse Packages
A useful shortcut from inside Sublime Text:
cmd-shift-P --> Browse Packages
Now open user folder.
Sublime 2
According to the documentation, in Sublime 2, the package directory is located under the data directory. That directory should be on these locations:
Windows: %APPDATA%\Sublime Text 2
OS X: ~/Library/Application Support/Sublime Text 2
Linux: ~/.config/sublime-text-2
This information is available here (archive link).
Sublime 3
For Sublime 3, the locations are the following:
Windows: %APPDATA%\Sublime Text 3
OS X: ~/Library/Application Support/Sublime Text 3
Linux: ~/.config/sublime-text-3
This information is available here (archive link).
For the portable version the documentation above states: "If you’re using the portable version (Windows only), look for Application/Data. Here, Application refers to the directory to which you’ve extracted the compressed portable files and where the executable resides.
Note that the Data directory only exists with that name in the portable version. In full installations, it is one of the locations indicated above."
Sublime 4
For Sublime 4, when cleanly installed, the locations are the following:
Windows: %APPDATA%\Sublime Text
OS X: ~/Library/Application Support/Sublime Text
Linux: ~/.config/sublime-text
According to this, if Sublime 4 is installed on top of Sublime 3, it uses the ST3 directory. (archive link)
More documentation about Sublime packages here (archive link).
1. Solution
Open Sublime Text console → paste in opened field:
sublime.packages_path()
→ Enter. You get result in console output.
2. Relevance
This answer is relevant for April 2018. In the future, the data of this answer may be obsolete.
3. Not recommended
I'm not recommended #osiris answer. Arguments:
In new versions of Sublime Text and/or operating systems (e.g. Sublime Text 4, macOS 14) paths may be changed.
It doesn't take portable Sublime Text on Windows. In portable Sublime Text on Windows another path of Packages folder.
It less simple.
4. Additional link
How to get current … in Sublime Text
You can browse package folder below method.
Use Sublime Text 2 menu : Preferences\Browse Packages
In Windows 7 : C:\Users\%username%\AppData\Roaming\Sublime Text 2\Packages (equals %appdata%\Sublime Text 2\Packages)

Resources