Saturday, December 24, 2011

The most common commands used in Vim

Movement commands
CommandDescription
hmove left
jmove down
kmove up
lmove right
ctrl + bpage up
ctrl + fpage down
$move to end of the line
0move to beginning of the line
^move to the first non-blank character of the line
Gjump to end of the file
ggjump to beginning of the file
10Ggot to line
wmove foward to the word
bmove backward to the beginnig of a word
}jump foward one paragraph
{jump backward one paragraph

Editing commands
CommandDescription
dcut
ycopy
ppaste
dddelete line
yycopy line
uundo
redredo
~upper or lower case
istart insert mode at cursor
Iinsert at the beginnig of the line
aappend after cursor
Aappend the end of the line
eaappend the end of the word

Search commands
CommandDescription
/textsearch forward in the document for text
nmove foward to the search result
Nmove backward to the search result

File editing commands
CommandDescription
wwrite to file
eopen file
pwdshow current directory
cdswitch Vim to directory
:browse eopen dialog
:qclose
:q!close and drop changes
Folding commands
CommandDescription
zRopen all
zMclose all
zoopen
zcclose
Other commands
CommandDescription
:set listdisplay whitespaces
:set nolistdisplays normaly
:copenopens error window
:cclosecloses error window
:set expandtabto insert space characters whenever the tab key is pressed
:retabto change all the existing tab characters to match the current tab settings
:TlistToggleopens the taglist window

Tuesday, October 11, 2011

Scrum

Scrum is an agile approach to software development. Scrum doesn't provides complete, detailed descriptions of how everything is to be done on the project, much is left up to the software development team. This is done because the team will know best how to solve the problem they are presented. 

Scrum relies on a self-organizing, cross-functional team. The scrum team is self-organizing in that there is no overall team leader who decides which person will do which task or how a problem will be solved. Those are issues that are decided by the team as a whole. The team is cross-functional so that everyone necessary to take a feature from idea to implementation is involved.

These agile development teams are supported by two specific individuals: a scrum master and a product owner.

Scrum projects make progress in a series of sprints, which are timeboxed iterations no more than a month long.



To read more about Scrum visit this site.

Snippets in Vim

A snippet is a piece of often-typed text that you can insert into your document using a trigger word followed by a <Tab>. To have this functionality in my Vim I use snipMate plugin.

 For a quick introduction, see this screencast:

Monday, October 10, 2011

Friday, October 7, 2011

Vim file navigation

To navigate through directories and to open files I use NERDTree plugin. The plugin opens small buffer on the left which contains the file system tree.

If you want to pull up NERDTree so it's always visible docked to the left of your Vim window you can type:
:NERDTree

Also NERDTree allows to modify the file system tree. Hit key 'm' and it will open menu with some option.

To refresh the file system tree simple hit key 'r'.

Friday, September 30, 2011

Recursive removal

Remove all files and directories (recursive removal):
rm -rf /tmp/foo
Remove all files from current directory use this command:
rm -f *

Vim configuration

To use vim, you should install vim package:
sudo apt-get install vim

If you prefer to use GUI based vim, you should install vim-gnome package:
sudo apt-get install vim-gnome

vim is a highly configurable editor. A list of files and their locations are given below.

  • ~/.vimrc is the vim configuration file which vim reads on startup
  • ~/.gvimrc is the gvim configuration file which gvim reads on startup. It's best to keep only gui specific settings here, as it will take preference over the settings in your .vimrc file.
  • ~/.vim/ is the directory in which the user can add utility plugins, syntax highlighting plugins, and indent plugins.