Transformation from NetBeans to Sublime Text

No, I’m not that vi or Emacs fan. I use vim only when I have to debug something from terminal. I was using Netbeans since longtime. It’s a great IDE. The only major problem is it consumes memory too much. Moreover last few years I’ve been writing bash scripts frequently. Sometimes I had to check in some old Ruby codes. And nowadays for some modules I’m probably going to use Python. So to meet my customized requirements finally I concluded to switch to a lightweight editor. After brief encounters with different other editors, I soon found Sublime Text and have been using it ever since. Its real power comes from the ability to enhance its functionality using Package Control and creating custom settings.

There is a long list of packages to meet all of my needs; so I thought it’d be better to list all of them in a single place.

Installation steps

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
$ sudo apt-get update
$ sudo apt-get install sublime-text-installer

Package Controller needs to be installed at first . Unless otherwise specified, every package should be installed using Package Control. Once Package Control is installed, press ctrl+shift+p to open the Command Pallete. Then Install/ Remove Packages as per need. Primarily I started with the following-

1. GitGutter: Displays icons in the gutter area indicating inserted, modified or deleted lines.

2. Sublime Text Git: The cool thing is that like all other times we use the command palette, we don’t have to enter the entire command. Sublime Text will autocomplete things for us. So instead of typing git add -A, just type add and Sublime Text will know! Just another way to save few milliseconds.

3. Sidebar Enhancements: Extends the number of menu options in the sidebar, speeding up the overall workflow. Options such as “New file” and “Duplicate” are essential and should be part of ST3 out of the box. The “Delete” option alone makes it worth downloading.

4. All Autocomplete: Another useful package All Autocomplete.

5. Add Goto Defintion: Add mouse click “goto definition”.

$ vim ~/.config/sublime-text-3/Packages/User/Default.sublime-mousemap
        "button": "button1", 
        "count": 1, 
        "modifiers": ["ctrl"],
        "press_command": "drag_select",
        "command": "goto_definition"

6. DocBlockr: DocBlockr makes it simple to create new doc blocks, but more importantly, if we create a doc block just above a defined function, it will extract that function’s parameter information and pre-fill it in doc block.

7. PHP Companion: Look for PHP Companion in package control.

8. Anaconda: Turns Sublime Text 3 into a full featured Python IDE.
Here I had an issue with AutoCompletion configuration. To fix that I followed these steps

$ vim ~/.config/sublime-text-3/Packages/User/Python.sublime-settings
				"selector": "source.python - string - comment - constant.numeric",
				"characters": "."

$ rm ~/.config/sublime-text-3/Cache/Python/*

[Source: documentation]

A simple cheat sheet of Sublime Text keyboard shortcuts. Because saving even a few milliseconds with shortcuts can add up.

[Reminder: To open the console, press Ctrl+`]

Custom preferences can be added up in simple JSON format: Preferences -> Settings- user ->

	"detect_indentation": true,
	"draw_indent_guides": true,
	"ensure_newline_at_eof_on_save": true,
	"find_selected_text": true,
	"font_size": 10,
	"line_padding_bottom": 0,
	"line_padding_top": 0,
	"match_brackets": true,
	"match_brackets_angle": false,
	"match_brackets_braces": true,
	"match_brackets_content": true,
	"match_brackets_square": true,
	"remember_open_files": true,
	"remember_open_folders": true,
	"save_on_focus_lost": false,
	"scroll_past_end": false,
	"show_full_path": true,
	"show_minimap": false,
	"tab_size": 4,
	"trim_trailing_white_space_on_save": true,
	"word_wrap": true

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s