Tuesday, May 4, 2010

Install Vim-outliner on K/Ubuntu

I spoke of vim-outliner a few years ago and was recently reminded of it again while listening to the mintcast podcast regarding orgmode for emacs.

Orgmode seems to be fairly feature rich, but I never liked the whole key combination thing with emacs. To this day, I can't figured out how to close an emacs session. Vim just seems easier. It's a preference.

Vim-outliner doesn't seems to have all the features of orgmode on the great emacs OS, but it is good at what it does...outline. It seems to follow the Unix philosophy of doing one thing and doing it well, instead of the emacs philosophy of cram as much as possible into an app. So I attempted to install it on my Kubuntu 9.10 machine and it's not as simple as an aptitude install. So, here is how to get vim-outliner installed and set up on a current version of K/Ubuntu.

$ aptitude install vim-vimoutliner

Make sure you have vim-addon-manager installed. If not install it. Then,

$ sudo vim-addons -w install vimoutliner

Finally, make sure you have the following in your ~/.vimrc file, if you don't already,

filetype plugin indent on

To start vim-outliner, simply open vim with any file with the extention .otl, such as:

vim file.otl

and you're good to go. Please visit my prior post on vim-outliner for a quick tutorial or use vim's help to access the documentation by typing ":help vo" in an open vim session.

Friday, April 16, 2010

Stop the Corruption! - Putty and Screen

I use putty to make ssh connections to my home server when I'm forced to use MS Windows, such as when I'm at work. The first thing I do after connecting is start up screen, which opens several pre-assigned applications in "tabs". Putty's default settings seem to cause screen corruption with some applications, notably newsbeuter, finch, links, mc and hnb.




Not pretty.

This is simply fixed with 2 settings in putty. First, in the putty configuration tool go to "Terminal" and check the box for "Use background colour to erase screen". Then select "translation" found under the "Window" section and change the character set to "uft-8" using the drop down menu.

Here are the results:



Tuesday, April 13, 2010

Vim - Cut and Paste a Block of Text Between 2 Files

Vim is my editor of choice, but I would never consider myself an expert. So when I wanted to copy text from one text file to another in vim, I was challenged. Although I was frustrated for a brief moment, I remembered uncle google and he helped me with my conundrum. So here is how you cut and paste a section of text from one text file to another using vim.

First open your first text file in vim. Scroll down to the first line of the block of text you wish to copy and press "ma" (that is m followed by a, without the quotation marks). "m" marks the beginning of your block. The "a" makes the assignment of copying the text to buffer "a".

Now scroll to the end of the block of text you wish to copy and press "y'a" (again without the quotes). The "y" yanks the text block. The single quote in the middle, I guess designates the end of the block and "a" again identifies the buffer being used.

Next open the second text file by typing ":split filename.txt" (Remember no quotes). This will open the second text file in a split vim session window. Scroll to the line where you would like the text pasted and press "p" (You should know, don't include the quotes). This will paste the block of text on the line below the current cursor position. Save and your done.

Please leave comments with other examples of cutting and pasting in vim.
Enjoy.

Friday, April 2, 2010

Newsbeuter and Google Reader



If you go to the newsbeuter website you'll be told that it's the mutt of rss feed readers. It is text based and highly configurable. Newsbeuter is fairly easy to set up and configure. Just install newsbeuter using your distros package manager. It should be available on most distributions Ubuntu, Fedora, Opensuse, Arch, Slackware, Debian, etc.

Now that it's installed, just type newsbeuter in the terminal to start it. There's probably not much to see as we haven't added any RSS feeds yet, but I usually start an application before configuring it because usually there are configuration files that are created when an app first starts up. Press "q" to quit.

To add feeds open the ~/.newsbeuter/urls file and simply add your feed urls to that file. Save and close and you're good as gold. You can edit the ~/.newsbeuter/config file to customize your keybindings and other settings. See the man page for configuration options.

I recently learned that you can use newsbeuter to view your Google Reader feeds. To do this make sure you have the latest version of newsbeuter and simply add the following to your ~/.newsbeuter/config file.

urls-source "googlereader"
googlereader-login "your-googlereader-account"
googlereader-password "your-password"

Save and start newsbeuter. You now have your Google Reader Feeds.
Please see the newsbeuter documentation site for more configuration options.
Enjoy.

Tuesday, March 23, 2010

HTML Editors for Beginners

In about two weeks, I'll begin teaching an HTML class and I'll need a good HTML editor with syntax highlighting. I need something cross platform as I know that most students will be using Windows and at least one will be using a MAC. I, of course, will be using Linux. I prefer using vim.

Vim is great as I can run it at the command line, in a GUI (gvim) and on any OS you can think of. Within vim you can activate html syntax highlighting by simply typing:

:set syntax=html

That will add html syntax highlighting for only that session of vim. You will need to add "syntax on" in your .vimrc file for highlighting to be permanent.

Now as much as I love vim, I'm not going to have my students use it. This is an HTML class for the absolute beginner and introducing vim to the class is a hurdle I don't want to jump over. So, I'm leaning towards having my students use bluefish. Bluefish has several cool features including running on all three major platforms.

Any other suggestions for an HTML editor for beginners? What features do you like? What are your thoughts regarding bluefish?