Showing posts with label IDE. Show all posts
Showing posts with label IDE. Show all posts

Tuesday, February 12, 2013

VIM Quick Command Tutorial #2

DESCRIPTION: Marks are useful when you are working in various places of a file or working in various files. You may need to jump to that place quite frequently. At this situation marks just do great.
1. List all marks
 :marks - Shows a list of marks

2. Marked file places, and global file places
 m - start marking
  a-z - for places within file
  A-Z - for places within global

3. Go to specified mark
 g' - start mark selection
  a-z - for places within file
  A-Z - for places within global
 i.e. g'C will go to C marked file place
      g'c will go to c marked place within the file

4. Deleting marks
 :delmarks a b C V - deletes the provided marks i.e. a b C and V
DESCRIPTION: Now about some buffers. These are files loaded in your current session of VIM.
5. List all buffers
 :buffers - to see all buffers list in current session

6. Working with buffer(s)
 :b 1 - b stands for buffer and 1 stands for the buffer number.
  This will load the buffer number 1 to your VIM window
  Alternatively you can give the name of the file and
  press <tab> to crawl all the relative names.

7. Deleting buffer(s)
 :bdelete! N1 N2 ...
 :bdelete! {bufname}
  N1 N2 stands for buffer number to delete
  alternatively you can give the buffer name and press
   <tab> to select the exact file you want to unload from
   buffer list

VIM Quick Command Tutorial #1

There are 3 basic modes in VIM.
a) <Esc> - Normal
b) i - Insert
c) v - Visual
1. Opening Vim
 vim            - open
 vim [filename] - open a file

2. Quit, and save
 :q! - quit without saving
 :q - quit
 :w - write
 :wq or :x - write and quit

3. Cursor moving
  k       up
 h l  left right
  j      down

 ^ - content beginning of the line
 $ - end of line
 w - move by a word
 b - move backward by a ward
 gg - go to the head of the file
 <shift>+g - go to the end of the file
 :number - to line number of 

 { - previous paragraph
 } - next paragraph

4. Editing feature
 i - insert before the cursor
 a - append after the cursor
 o - new line below
 O - new line above

5. Copy(Yank), paste, and delete
 yy - copy the whole line
 yw - copy the word
 y^ - copy to the beginning of line from cursor position
 y$ - copy to the end of the line from cursor position

 p - paste
 np - where n represents number of times to paste

 dd - delete the current line
 dw - delete the current word
 d^ - delete to the beginning of the line from cursor position
 d$ - delete to the end of the line from cursor position

6. Visual mode
 v - select within line
 V - select lines

7. Formating
 < - shift back  > - shift forward
 == auto indent

8. Repeating
 . - repeats the previous command

Format JSON string in VIM

I need to format a JSON string in a better human readable way. How do I do it? It's easy, use the following Vim command:

:%!python -m json.tool

That all :).


Tuesday, October 18, 2011

Get TextMate Features And Styles In Gedit With GMate

GMate is a collection of plugins, themes/styles and other improvements to get TextMate like features in Gedit.

To install GMate in Ubuntu, use the following commands:

sudo apt-add-repository ppa:ubuntu-on-rails/ppa
sudo apt-get update
sudo apt-get install gedit-gmate

This package will not replace Gedit! It will only add some themes and plugins you can enable/disable from the Gedit preferences.

For more info and other Linux distributions installation instructions, see https://github.com/gmate/gmate#readme


Sunday, January 30, 2011

NetBeans IDE and Dark Theme

I've been trying to get NetBeans IDE to work with a Dark Theme for a while, and I finally found something of my use.

Get the following files:
  1. Download NimROD Look And Feel
  2. Download Night.theme
Follow these simple steps:
  1. Copy those files (nimrodlf-1.2.jar, Night.theme) inside a directory "MyNBTheme" or as u like. Place it inside NetBeans folder (C:/Program Files/NetBeans  6.9.1/MyNBTheme).
  2. Create a new shortcut for netbeans.exe found inside C:/Program Files/NetBeans  6.9.1/bin/
  3. Right click on the shortcut; go to Properties; edit the Target field as the following: "C:\Program Files\NetBeans 6.9.1\bin\netbeans.exe" -cp:p "C:/Program Files/NetBeans 6.9.1/MyNBTheme/nimrodlf-1.2.jar" --laf com.nilo.plaf.nimrod.NimRODLookAndFeel -J-Dnimrodlf.themeFile="C:/Program Files/NetBeans 6.9.1/MyNBTheme/Night.theme"
  4. Press OK
  5. Start your NetBeans IDE with the new shortcut just created.
  6. Inside IDE go to Tools -> Options -> Fonts & Colors; and select "Norway Today" as editor theme.
Thanks and enjoy.