Showing posts with label editor. Show all posts
Showing posts with label editor. Show all posts

Friday, October 2, 2009

My VIM .vimrc file for working with Python

Here is the VIM .vimrc file that I use to work with Python.
syntax on
set nu
set ts=4
set sw=4
set sts=4
set autoindent
set smartindent
set expandtab
set smarttab
It will

  1. Display the line number.

  2. Set tab stop to 4.

  3. Enable you to use < and > to indent or unindent a block in visual mode.

  4. Insert spaces instead of tab, when pressing the tab button.

Friday, September 18, 2009

LaTeX editor with live preview pane for Ubuntu/Linux

Gummi
Gummi is a lightweight LaTeX editor written in Python/GTK+ released as open-source software under a dual MIT/Beerware license, and was written by a BSc student of Artificial Intelligence at the University of Amsterdam, Alexander van der Mey.

The main feature of Gummi is that the Preview Pane will update as you are typing. In my opinion, this feature is good if you are learning LaTeX.

Give Gummi a try, and tell me your opinion.

Click here to download.

Tuesday, July 14, 2009

How to use multiple windows in Vim

This article provides some tips on how to use multiple windows in Vim.

Start Vim with n multiple windows

  1. n verticals windows.
    vim -On filenames
  2. n horizontal windows.
    vim -on filenames
Note: n is the number of windows.

Close a window

  1. Close the current window.
    Ctrl+W c
  2. Close the current window. If it is the only window left, quit Vim.
    Ctrl+W q

Split a window

  1. Split horizontally the current file.
    Ctrl+W s
  2. Split horizontally and open a file.
    :sp filename
  3. Split vertically the current file.
    Ctrl+W v
  4. Split vertically and open a file.
    :vsp filename

Move the cursor between windows

  1. Move to the right window from the current windows.
    Ctrl+W l
  2. Move to the left window from the current windows.
    Ctrl+W h
  3. Move to the top window from the current windows.
    Ctrl+W k
  4. Move to the bottom window from the current windows.
    Ctrl+W j
  5. Move to the next window below the current one. If no below window exist, move to the top window.
    Ctrl+W w

Rotate windows location

  1. Move the current window to the right.
    Ctrl+W L
  2. Move the current window to the left.
    Ctrl+W H
  3. Move the current window to the top.
    Ctrl+W K
  4. Move the current window to the bottom.
    Ctrl+W J

Window resizing

Resizing windows can be made by using the mouse as well as the following commands.
  1. Make all windows equal in height.
    Ctrl+W =
  2. Increase height.
    Ctrl+W +
  3. Decrease height.
    Ctrl+W -
Note: Thanks to Ferd T-H, resizing could also be done by using
Ctrl+W < or >

Conclusion

I hope that these commands are enough for you to start using windows in Vim. However, if you know some good command(s) to please don’t hesitate to leave a comment.

Friday, May 29, 2009

How to show line number and set tab size in vi or vim

To show line number:
:set number

To stop displaying the line number:
:set nonumber

To set tab size to 4:
:set ts=4