<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; vi</title> <atom:link href="http://www.ghacks.net/tag/vi/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Use gvim for a better vi experience</title><link>http://www.ghacks.net/2011/02/28/use-gvim-for-a-better-vi-experience/</link> <comments>http://www.ghacks.net/2011/02/28/use-gvim-for-a-better-vi-experience/#comments</comments> <pubDate>Mon, 28 Feb 2011 19:51:06 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[gvim]]></category> <category><![CDATA[text editor]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[vi]]></category> <category><![CDATA[vim]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=40444</guid> <description><![CDATA[If you edit configuration files by hand, or if you prefer a more &#8220;manual&#8221; approach to the process of writing, you most likely use a text editor. Of the available editors there exists everything from bare-bones, no frills editors all the way to highly complex feature-abundant editors (and everything in between). One of those editors [...]]]></description> <content:encoded><![CDATA[<p>If you edit configuration files by hand, or if you prefer a more &#8220;manual&#8221; approach to the process of writing, you most likely use a text editor. Of the available editors there exists everything from bare-bones, no frills editors all the way to highly complex feature-abundant editors (and everything in between). One of those editors was born out of a need to make one of the most powerful text editors available &#8211; vi.</p><p>For most users, vi offers too much with too little help. To that end, tools like Gvim were created. Gvim is a strange amalgamation of a standard text-based file editor and a graphical file editor. Its half vi half gedit. Let&#8217;s take a look at how this editor can help you out.</p><p><span
id="more-40444"></span> <strong>Installation</strong></p><p>The installation of Gvim is simple. I will demonstrate in Ubuntu. Since Gvim is found in the standard repositories, you can follow these steps:</p><ol><li>Open up a terminal window.</li><li>Issue the command <code>sudo apt-get install gvim</code>.</li><li>Type your sudo password and hit Enter.</li><li>Allow the installation to complete.</li></ol><p>You can find Gvim in the Ubuntu Software Center (or the Add/Remove Software tool for your distribution), but since Gvim is a text-based editor, why not install from command line?</p><p>After the installation is complete, you will be surprise to not find a menu entry for Gvim. So to start up Gvim hit Alt-F2 and enter the command <em>gvim</em> in the run dialog. When the application starts, you will see a nice hybrid tool that will make using vi much easier.</p><p><strong>Usage</strong></p><div
id="attachment_40445" class="wp-caption alignleft" style="width: 340px"><a
href="http://www.ghacks.net/wp-content/uploads/2011/02/gvim_main.png"><img
class="size-medium wp-image-40445 " src="http://www.ghacks.net/wp-content/uploads/2011/02/gvim_main-550x381.png" alt="" width="330" height="229" /></a><p
class="wp-caption-text">Figure 1</p></div><p>As you can see, in Figure 1, Gvim has the standard editing window, but with a few editions. The most obvious edition is the tool bar. Add to that tool bar a menu bar, and you have the makings for an actual user-friendly vi experience.</p><p>If you&#8217;ve never used vi, let me give you the gist of how you type and save a file&#8230;step by step.</p><ol><li>Open up vi.</li><li>Hit the &#8220;i&#8221; key to switch vi to &#8220;insert&#8221; mode.</li><li>Type your file.</li><li>Hit &#8220;Escape&#8221; to get out of &#8220;insert&#8221; mode.</li><li>Hit the Shift &#8220;:&#8221; to get to the command mode.</li><li>Type &#8220;wq&#8221; (no quotes) to save the file and exit.</li></ol><p>Quite a few steps just to save a text file right? Now, with Gvim, the same task looks like this:</p><ol><li>Open Gvim.</li><li>Hit the &#8220;i&#8221; key to go into &#8220;insert&#8221; mode.</li><li>Type your text.</li><li>Hit the Save button.</li><li>Give your file a name.</li></ol><p>That&#8217;s it. Although only one step shorter, but a heck of a lot user-friendlier.</p><p>But don&#8217;t Gvim only aids the simple tasks. Gvim also brings to the user some of the more challenging tasks such as:</p><ul><li>Spell checking.</li><li>Jump to tags.</li><li>Automatic syntax.</li><li>Color testing.</li><li>Window splitting.</li></ul><p>And much more&#8230;all from handy drop-down menus and tool-bar icons.  The developers of Gvim even thought to include a handy print button!</p><p><strong>Final thoughts</strong></p><p>If you have been wanting to give the vi editor a go, you can breathe a sigh of relief and enjoy a helpful hybrid version of vi that will have you editing like a power user.</p><p>&nbsp;</p><p>&nbsp;</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/02/28/use-gvim-for-a-better-vi-experience/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>vifm: Fast, lightweight, old school file manager</title><link>http://www.ghacks.net/2010/09/09/vifm-fast-lightweight-old-school-file-manager/</link> <comments>http://www.ghacks.net/2010/09/09/vifm-fast-lightweight-old-school-file-manager/#comments</comments> <pubDate>Thu, 09 Sep 2010 11:24:40 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[emelfm2]]></category> <category><![CDATA[file manager]]></category> <category><![CDATA[PCMan File Manager]]></category> <category><![CDATA[thunar]]></category> <category><![CDATA[vi]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=34087</guid> <description><![CDATA[Recently I have been covering some of the lighter weight file managers for the Linux operating system. We&#8217;ve seen PCMan File Manager and emelFM2 covered recently. I&#8217;ve also touched on Thunar numerous times. All of these file managers have two things in common: They are fast and they have GUIs. Today&#8217;s file manager shares the [...]]]></description> <content:encoded><![CDATA[<p>Recently I have been covering some of the lighter weight file managers for the Linux operating system. We&#8217;ve seen <a
title="PCMan File Manager" href="http://www.ghacks.net/2010/09/01/pc-file-manager-another-light-weight-file-manager/" target="_blank">PCMan File Manager</a> and <a
title="emelFM2" href="http://www.ghacks.net/2010/09/08/emelfm2-another-fast-file-manager/" target="_blank">emelFM2</a> covered recently. I&#8217;ve also touched on <a
title="Thunar" href="http://www.ghacks.net/index.php?s=thunar" target="_blank">Thunar</a> numerous times. All of these file managers have two things in common: They are fast and they have GUIs. Today&#8217;s file manager shares the speed, but not the GUI. This file manager is vifm. If you know your Linux you can probably assume the &#8220;vi&#8221; is associated with one of the most popular Linux editors, vi. That assumption is correct.</p><p>The vifm file manager is an ncurses-based file manager with vi keybindings. So if you are used to vi, you will have no problems using vifm. Now vifm is not heavily developed. In fact, the last release was August 7, 2009. But it&#8217;s still a worthy file manager for those looking for more text-based management tools. In this article, I will introduce you to one of the best text-based file managers.</p><p><span
id="more-34087"></span><strong>Features</strong></p><p>The vifm file manager can move around your file system hierarchy, copy files, delete files, copy files, paste files, search&#8230;and that&#8217;s about it. What more do you really need from a file manager? But best of all, vifm does this all quickly and efficiently. Now, let&#8217;s install and use.</p><p><strong>Installation</strong></p><p>Naturally we will be installing from command line. To do this in an apt-get based distribution (such as Ubuntu or Debian), you would do the following:</p><ol><li>Open up a terminal window.</li><li>Issue the command <em>sudo apt-get install vifm.</em></li><li>Type your sudo password and hit Enter.</li><li>Accept any dependencies by clicking &#8220;y&#8221;.</li><li>Watch the installation happen.</li></ol><p>In an rpm (or yum) based distribution (such as Fedora) you could install like so:</p><ol><li>Open up a terminal window.</li><li>Su to the root user.</li><li>Enter the command <em>yum install vifm</em>.</li><li>Accept any dependencies by clicking &#8220;y&#8221;.</li><li>Watch the installation happen.</li></ol><p>You are now ready to use vifm.</p><p><strong>Usage</strong></p><p><a
href="http://www.ghacks.net/wp-content/uploads/2010/09/vifm.png"><img
class="size-full wp-image-34089 alignleft" style="margin-left: 5px;margin-right: 5px" src="http://www.ghacks.net/wp-content/uploads/2010/09/vifm.png" alt="" width="400" height="281" /></a>You open vifm by enter the command <em>vifm</em> from within the terminal window. When you open the file manager you will see a two-paned window (see Figure 1). What you see highlighted is what is currently active. So in the case of Figure 1 the <strong>../</strong> is active. The ../ string of characters means go to the parent directory. So if you hit enter while that is selected you will go to the parent directory of the current directory (in the case of Figure 1 that would be <strong>/home/</strong>).</p><p>To move up and down the directory hierarchy you use the up and down arrow keys. To move back and forth between the panes you use the Tab key.</p><p>As you would expect, vifm works similarly to the vi editor &#8211; it has key combinations to take care of tasks. The most useful of these are:</p><ul><li>yy &#8211; Yank a file (or &#8220;copy&#8221; in modern parlance).</li><li>p &#8211; Put a file (or &#8220;paste&#8221; in modern parlance).</li><li>dd &#8211; Delete a file.</li><li>Enter &#8211; View a file (will not view binary files).</li><li>/ &#8211; Search for a file (the / character is followed by your search string).</li></ul><p>So, let&#8217;s say you want to copy a file in one directory and paste it into another. Here&#8217;s the steps for that process:</p><ol><li>Move the selection bar to the file you want to copy.</li><li>Hit &#8220;yy&#8221;.</li><li>Move the selection bar to the directory you want to copy the file to and hit Enter (you will then be inside of that directory).</li><li>Hit &#8220;p&#8221; and the file will copy.</li></ol><p>It&#8217;s actually quite simple.</p><p>When you want to quit vifm you have to go into command mode (just like vi) and hit the &#8220;:&#8221; key, type <em>quit</em>, and hit Enter. And, like any good Linux tool, you can get more help with vifm by typing <em>:help</em>.</p><p><strong>Final thoughts</strong></p><p>If you need a text based file manager, you can&#8217;t go wrong with vifm. Granted you will have to learn a new set of key combinations (unless you&#8217;re already used to vi), but the speed and efficiency of vifm makes up for the few keystrokes you will have to learn.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/09/09/vifm-fast-lightweight-old-school-file-manager/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Leafpad: Yet another Linux text editor</title><link>http://www.ghacks.net/2010/05/01/leafpad-yet-another-linux-text-editor/</link> <comments>http://www.ghacks.net/2010/05/01/leafpad-yet-another-linux-text-editor/#comments</comments> <pubDate>Sat, 01 May 2010 19:52:28 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[gedit]]></category> <category><![CDATA[kate]]></category> <category><![CDATA[leafpad]]></category> <category><![CDATA[nano]]></category> <category><![CDATA[text editors]]></category> <category><![CDATA[vi]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=25070</guid> <description><![CDATA[In my most recent series of articles I have been highlighting different Linux text editors. Why? Because a lot of users hate using text based editors. Although a big fan of the text-based editor (I like the simplicity and the speed), I can see where a solid GUI tool would be far more appealing to [...]]]></description> <content:encoded><![CDATA[<p>In my most recent series of articles I have been highlighting different Linux text editors. Why? Because a lot of users hate using text based editors. Although a big fan of the text-based editor (I like the simplicity and the speed), I can see where a solid GUI tool would be far more appealing to many users than the text-based editor.</p><p>So far I have covered Gedit (see &#8220;<a
title="Gedit: No more text-based editor for you" href="http://www.ghacks.net/2010/04/29/gedit-no-more-text-based-editor-for-you/" target="_blank">Gedit: No more text-based editor for you</a>&#8220;) and Kate (see &#8220;<a
title="Hello Kate, goodbye vi" href="http://www.ghacks.net/2010/04/30/hello-kate-goodbye-vi/" target="_blank">Hello Kate, goodbye vi</a>&#8220;). Both are solid entries in the text editor space. But they are certainly not the only tool in the toolbox. Today I will illustrate yet another GUI Linux editor, this time around &#8211; <a
title="Leafpad" href="http://tarot.freeshell.org/leafpad/" target="_blank">Leafpad</a>. Leafpad is a GTK+ editor that focuses on simplicity. And when I say simplicity, I mean <em>simplicity. </em>So much so that you would swear you were just using a text-based editor with a few built-in drop-down menus. But why would you want to use a tool that is so close to the &#8220;original&#8221; that you might as well be using said original (original being the text-based editor). Let&#8217;s find out.</p><p><span
id="more-25070"></span><strong>Features</strong></p><p>As I said, Leafpad is about simplicity&#8230;so bells and whistles aplenty it doesn&#8217;t have. Does that detract from its usability? No way. Leafpad is just as viable a solution as any tool in its category. But what does it offer?</p><ul><li>Codeset option.</li><li>Auto codeset detection.</li><li>Unlimitted Undo/Redo.</li><li>Auto/Multi-line Indent.</li><li>Display line numbers.</li><li>Drag and Drop text copy.</li><li>Printing.</li><li>Word wrap.</li><li>Find.</li><li>Jump to.</li></ul><p>And that&#8217;s about it. But it is one feature (Drag and Drop) that really sets Leafpad apart. Let&#8217;s take a look at installation and use first.</p><p><strong>Installation</strong></p><p>Installation is simple. Open up your package management tool, search for &#8220;leafpad&#8221;, mark for installation, click Apply to install. That&#8217;s it. Once installed you will find Leafpad in <strong>Applications &gt; Accessories</strong>.</p><p><strong>Usage</strong></p><div
id="attachment_25071" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/05/leafpad.png"><img
class="size-medium wp-image-25071 " src="http://www.ghacks.net/wp-content/uploads/2010/05/leafpad-500x366.png" alt="" width="300" height="220" /></a><p
class="wp-caption-text">Figure 1</p></div><p>Don&#8217;t panic. When you open up Leafpad it will look as if you just opened up a terminal window (see Figure 1).  The way I see Leafpad is the developers took what was best from a text-based editor and added a toolbar. It&#8217;s that simple.</p><p>It should be pretty apparent what you would do&#8230;you start typing your text! And when you are done you click <strong>File &gt; Save</strong> to save said text. Of course you could also add line numbers, auto indent, and word wrap from the Options menu.</p><p>But the best feature of this tool is the Drag and Drop. Say you are reading a handy tutorial here on Ghacks that wants you to create a configuration file. You could open up leafpad, highlight the text from the Ghacks article, and then drag that text to the open Leafpad window and the text will automatically copy! Now in some instances you will have to click <strong>Options &gt; Wordwrap</strong> or your text will be one continuous line (not good for configuration files or scipts).</p><p>That&#8217;s really about all there is to Leafpad.</p><p><strong>Final thoughts</strong></p><p>If you are looking for a tool somewhere between a text based and a GUI editor, leafpad is your tool. I have used Leafpad quite a bit and have nothing bad to say about it. It&#8217;s not fancy, it&#8217;s not bloated, it just does its job and does it well.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/05/01/leafpad-yet-another-linux-text-editor/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Using Cron to Automate Linux Tasks</title><link>http://www.ghacks.net/2009/01/11/using-cron-to-automate-linux-tasks/</link> <comments>http://www.ghacks.net/2009/01/11/using-cron-to-automate-linux-tasks/#comments</comments> <pubDate>Sun, 11 Jan 2009 21:32:12 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[automated tasks]]></category> <category><![CDATA[cron]]></category> <category><![CDATA[cron job]]></category> <category><![CDATA[crontab]]></category> <category><![CDATA[script automation]]></category> <category><![CDATA[vi]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=9823</guid> <description><![CDATA[Linux is one of the most flexible and useful operating systems available. One of the tools that places Linux at the top of the flexibility and usability scale is cron. The cron system allows you to automate tasks without the aid of third party software. But because few know how to use cron, it seems [...]]]></description> <content:encoded><![CDATA[<p>Linux is one of the most flexible and useful operating systems available. One of the tools that places Linux at the top of the flexibility and usability scale is cron. The cron system allows you to automate tasks without the aid of third party software. But because few know how to use cron, it seems too complex to bother with. Not so. The cron system is actually quite easy to use. Let&#8217;s take a look at cron.</p><p>The cron system works by reading various crontab files either found in a users&#8217; directory or within the <strong>/etc </strong>directory. These cron files can be edited with either the <em>crontab</em> command or by editing the various files within <strong>/etc</strong>. Only the root user can edit the <strong>/etc</strong> files because those files (found in the subdirectories <strong>/etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly, /etc/cron.monthly</strong>) are used for system services.  Instead of focusing on system services, I will illustrate how to automate the execution of a user-created bash script.</p><p><span
id="more-9823"></span>This imaginary bash script will be called <em>myscript.sh</em>. This script will be housed in <strong>/home/jlwallen/ </strong>and will have executable permission (by way of <em>chmod u+x myscript.sh</em>).  What we want to do is automate the execution of this script so that it executes once per day at the same time every day (we&#8217;ll say 7am).</p><p>Before we get into editing with crontab we first need to chat about how cron views time.The cron system looks at time like this:</p><ul><li><em>Minute(0-59)</em></li><li><em>Hour (0-23)</em></li><li><em>Day of the month (1-31)</em></li><li><em>Month (1-12)</em></li><li><em>Day of the week (0-6 with Sunday being 0)</em></li></ul><p>The structure of cron time looks like this:</p><p>Minute Hour Day of month Month Day of the week</p><p>The trick for cron is that when you do not have an entry for a section you add an &#8220;*&#8221;. So the time entry for a cron job that should run at 7am every day of the week would look like:</p><p><em>0 7 * * * </em></p><p>That is not the complete cron entry, just the time portion. Now, on to editing with crontab.</p><p><strong>Crontab</strong></p><p>Users edit their cron entries with the <em>crontab</em> command. The crontab command has a few switches:</p><ul><li>e &#8211; Edit your crontab</li><li>l &#8211; List your crontab</li><li>r &#8211; Delete all crontab entries</li></ul><p>To add a new crontab entry enter the command <em>crontab -e</em> which will place you in the vi text editor with your user crontab file opened. If you&#8217;re not familiar with vi I&#8217;ll give you the crash course as we edit the crontab.</p><p>First click the &#8220;i&#8221; key to go into the insert mode. You can now add text. Enter the cron entry to run the myscript.sh every day at 7am. This entry will look like:</p><p>* 7 * * * ~/myscript.sh</p><p>Now hit the Esc key to get out of the insert mode. Once out of insert mode you need to write the file and quite crontab. To do this hit the &#8220;:&#8221; key followed by &#8220;wq&#8221; (for write and quite). Finish the job by hitting the Enter key.</p><p>You should see &#8220;crontab: installing new crontab&#8221; at your bash prompt.</p><p>Congratulations, you&#8217;ve just created your first cron job!</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/01/11/using-cron-to-automate-linux-tasks/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> </channel> </rss>
