Cambridge IT Courses Blog: 5 commands you need to know to use VI
VI: THE command line editor
The VI editor has powerful features to aid programmers and as it runs on the command line it makes it particularly useful if you need to edit files on a server. However, many beginning users avoid using VI because of the steep learning curve. That's why we'll show you 5 commands you need to know to use VI:
You open a file with:
If the file doesnt exist, it will be created!
VI ModesIn Vi you have to switch between three basic modes:
The Command mode is the normal mode you are in when you enter the VI.
5 useful VI commands:
Saving files:Go into Command mode (press "Esc" if in doubt), then type:
:wFollowed by "Enter".
To save and exit use:
VI Viewing options:With
:vsplit and :hsplityou can split the VI horizontal or vertical. With that function you can easily compare code or work on you HTML and CSS sheet at the same time
For line numbers you can use
:setnuto show them, or
:setnonuto hide them!
Copy and Delete:When you want to paste or copy code you can use
:y for 1 line or :y3 for 3lines
When you want to delete one or more lines use:
:d or :d3 for 3lines
Once you've mastered the basics get yourself a good 'cheat sheet' such as: http://bullium.com/support/vim.html And when you've used VI for a while writing code with shortcut commands will be much more efficient than a GUI/ mouse based text editor!
Posted by Deniz Gruenberger at 22:15 2011-05-21 | Trackbacks (0) | Comments (0)
Cambridge IT Courses Blog: Which text editor?
When you start programming it is quite important to choose a text editor which is right for you!
Vi is an advanced text editor with syntax highlighting.
Vi offers several "modes" for efficient editing. This makes vi a not very user-friendly application but it also has many advantages. The normal
mode binds alphanumeric keys to task-oriented commands. The visual mode highlights text. The command-line
mode offers more tools (for search and replace, etc.).
It is especially useful for remotely editing files on servers.
Official text editor of the GNOME desktop environment and the default for many Linux distributions. It has syntax highlighting and is suitable for programming, with support for several languages. It is extensible with plugins.
Currently it features:
PSPad is a freeware programmers editor in 8 languages for Microsoft Windows operating systems. Some features are highlighted syntax, ftp, projects and so on. Code explorer for Pascal, C/C++, INI, HTML, XML, PHP and more in development, internal web browser with APACHE support. Installation contains templates for HTML, PHP, Pascal, JScript, VBScript, MySQL, MS-Dos, Perl.
jEdit is a mature programmer's text editor with hundreds (counting the time developing plugins) of person-years of development behind it. While jEdit beats many expensive development tools for features and ease of use, it is released as free software with full source code, provided under the terms of the GPL 2.0.
Notepad++ is a free source code editor and Notepad replacement that supports several languages. Based on the powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment.
Text editors vs. IDEsIDEs provide some advantages, such as faster development of basic features and sometimes 'drag and drop' programming, but they also require some manual programming and often force you into a certain way of organising your code which might not be ideal for all projects. Let's have a look at which features Eclipse (a popular open source IDE) has over text editors:
Eclipse is an extensible development platform with runtimes and application frameworks for building, deploying and managing software across the entire software lifecycle. Many people know Eclipse as a Java IDE, but it is much more than that- Eclipse actually consists of over 60 different open-source projects which provide features for programming in many different languages.
Posted by Deniz Gruenberger at 17:57 2011-05-15 | Trackbacks (0) | Comments (0)
Cambridge IT Courses Blog
Articles, tips and tricks discussing technical issues related to our courses