Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
25

Make Vim look like Sublime Text 2?

I am working to make a switch from SB2 to vim. Currently I am going through vimtutor to do some exercises then it dawned on me that I needed color when it is time for me to code.

For C++ and Python, how can I make it so that my "if"s, "while"s and "return"s are red.
Return types are blue, etc?

Is there a plugin that I can use in vimrc? Or do I have to do this manually. Mind you I don't just want to install any ol' theme because I really like the default sublime text 2 colors.

Thanks

65 comments
78% Upvoted
This thread is archived
New comments cannot be posted and votes cannot be cast
level 1
level 2

Great color scheme, looks extremely similar to inkpot though.

level 3

The default on that page IS Inkpot. There are also hundreds of others.

level 4

haha, went full retard there for a sec...

level 1
28 points · 6 years ago

To be honest, I didn't understand your request completely as the way to achieve

my "if"s, "while"s and "return"s are red

Return types are blue, etc?

is by turning syntax on and using a colorscheme.

  • Identify the color scheme you like in Sublime Text 2. AFAIK, the default color scheme it uses is monokai; it also matches your description. Download it and put it under $HOME/.vim/color

  • Enable syntax highlighting. Put "syntax on" in your vimrc

level 1
[deleted]
10 points · 6 years ago

In your ~/.vimrc:

filetype plugin indent on
syntax on

Then look around the web for a cool colorscheme, there are many hundreds.

level 1
5 points · 6 years ago · edited 6 years ago

You're looking for Sublime Text 2's default color scheme, which is Monokai. You can see this yourself by going into sublime text 2>Preferences>Color Scheme.

To get the equivalent in vim, just download monokai.vim (you can find it by googling "monokai vim") and putting it in your ~/.vim/colors directory. Then you'll want to change the colorscheme in vim by typing ":colo Monokai". The :colo is short for :colorscheme. If you want to have this color scheme every time you start up vim, put these three lines in your .vimrc file:

syntax enable

set background=dark

colorscheme Monokai

Note: Different people will have ported this color scheme in different ways so you'll find a few different github repositories with their own version of "monokai.vim". You don't really have to worry about this. Here's the version of monokai that I use: https://github.com/sickill/vim-monokai

You could also use molokai which is very similar.

level 1
16 points · 6 years ago

I would suggest installing Solarized. It is a fantastic color scheme.

level 2
-11 points · 6 years ago(9 children)
level 3

To each their own...I used to switch color schemes every month or two until I started using Solarized, which I've stuck with for a year now with no desire to change. And yes, I probably stare at it at least 6 hours a day, pretty much every day.

For the record, I'm using the light background and also use redshift, which automagically adjusts the color temperature of my screen based on the time of day.

level 4

Why do you like redshift?

level 5

It eases eye strain, the bright white light that comes from monitors causes eye strain faster than a warmer, more natural light. redshifting light makes it "warmer" and thus, more comfortable.

level 3
4 points · 6 years ago

Why do you say that? I'm just curious.

level 4

I said that because I hate solarized. I find that it is difficult to read text with it compared to colorschemes like jellybeans or xoria256. Of course, I realize that whether or not something is good is subjective, I just get annoyed any time I see someone recommending solarized.

level 5
3 points · 6 years ago

Yeah that makes sense. I had to tweak the Solarized settings to get it working well. By default the contrast is far too low.

level 3
2 points · 6 years ago

Really? I use Solarized at work, and really like it. Much better than the defaults, at any rate.

What would you suggest instead?

I should probably lrn2read. I'll check those out.

level 3

I tend to switch color schemes every so often. I have liked solarized because the dark and light backgrounds are inverses of each other. I have also found it to work really well with diffs. If you think it looks good in screen cap but not in use maybe it's a config error? Just curious as to the reason you don't like it. Also wondering how xoria256 looks in vim diff.

level 3

How confrontational. I agree though, that I've tried the solarized schemes and find them very hard to use, and yes, Jellybeans works for me. Just because something's hipstertastic doesn't mean it's not good though, and I'd personally rank solarized well above most of the "classic" schemes.

level 1

Try the colorscheme Molokai for vim. It's close to SB2 I think.

level 1
3 points · 6 years ago

I rather want to change the topic to How to make sublime text 2 work like vim :P j/k

The colorscheme used in Sublime Text 2 is Monokai. You can try this one : https://github.com/jaromero/vim-monokai-refined

level 2
Original Poster1 point · 6 years ago

still being fugly : (

level 3
3 points · 6 years ago

This is my vim http://i.imgur.com/K7jGkjF.png

You can get the configuration here https://github.com/rhacker/dotFiles

level 1
2 points · 6 years ago

If you currently see colors in your code then syntax highlighting is already on. To see the current highlight colors, type :hi

You can learn all about how to customize this system with :help hi

You can quickly make these changes permanent by putting them in your vimrc. If you end up with lots of them and want to make it neater, you can later pull these commands into your own colorscheme file

level 1
2 points · 6 years ago

If you're in MacVim or gVim add:

set linespace=2

To your ~/.gvimrc file.

level 1

Nobody mentioned?

level 1
level 2

Here's something even better: TagBar

level 3

That is pepper hot. Thanks!

level 3

Thank you! I'll play around with this this weekend. :)

level 3

This is cool, but I'm curious about how it's useful. I'm not questioning that is. I just don't know what I'd do with it. How do you use it?

level 2

Impossible. Also what is that feature even good for? I never understood why that would be beneficial. So you can see all your code? Okay, why do you need to see where you are in the file?

level 3

For a visual person, it just provides a nice overview of where I am in a document. I work on a C++ protein CAD project that has classes with 1000-3000 lines of code split between dozens of functions.

It's like asking "Why is there a minimap when you play FPSs or RPGs?". The answer seems rather obvious.

level 4
2 points · 6 years ago · edited 6 years ago

No, it's not obvious at all. Of course it's a "nice overview" of where you are, but so what? What benefit is that? So you have 3000 lines in a class. How does a minimap help you navigate that? You can't read any of it in the minimap. Excuse me for not "getting" it.

edit: also, check it: http://www.vim.org/scripts/script.php?script_id=2888

r/vim

77.4k Members143 Online
For Vim enthusiasts and anyone interested in Vim.
Top Posts From The r/vim Community
Continue browsing in r/vim
Community Details

77.4k

Members

143

Online

For Vim enthusiasts and anyone interested in Vim.

r/vim Rules
1.
No keyboard photos
2.
Be sure your `vimrc` follow "best practices"
3.
Before asking question try `:help` and `:helpgrep`
Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.