Free and Open Under the Steeple

April 29, 2008

VIM Tip - Copy and Paste

Filed under: Uncategorized — mowestusa @ 6:00 pm
Tags: ,
Honestly, when I use vim, I’m at the command line. If I want to edit text while in Gnome, I will open a terminal in order to use vim, no gvim or gedit for me.

My personal tastes have gotten in the way of my productivity. When writing a longer email or important document, I will use vim, as my writing tool of choice. After completing my edits, I will need to transfer the document from vim to usually a GUI app which I will use to format the document or into a web email text form. This creates a problem, because the terminal will only let you select and copy the text currently showing in the terminal window. To capture the whole document, I often need multiple copy and paste sessions. I figured that suffering would be my only option as I refuse to use GUI text editors.

However, in a moment of frustration after taking four copy and paste sessions to move a document into an email form, I did a search. I found the following on the vim wiki, http://vim.wikia.com/wiki/GNU/Linux_clipboard_copy/paste_with_xclip.

Using Fedora 8 I installed xclip to gain this functionality, by running the command as root:

yum install xclipThen check the comments to the wiki article. I could not get the original key bindings given in the article to work. However, adding the following commands to .vimrc from the comments in the wiki article, did work.

vmap <F6> :!xclip -f -sel clip<CR>
map <F7> :-1r !xclip -o -sel clip<CR>

So while in Visual mode in vim, select the whole document. Then press F6. To go in the opposite direction, simply copy text in a GUI application, and press F7 while in Command mode in vim, making sure that the cursor is at the point where you want the text inserted.

I guess this will keep me using the CLI version of vim a little longer. :-)

April 26, 2008

Trying New Site

Filed under: Uncategorized — mowestusa @ 1:19 am
Tags:
I will try www.wordpress.com as my home for this blog.

Good bloggers work hard to keep a constant flow of content. Good bloggers also find a system which makes their blogging an easy habit to keep. I have not been a good blogger, but this change is one more step in the direction of being a better blogger. Perhaps, hopeful bloggers will learn a little something from this post too.

Reasons for the Change:
1. I love vim and I love Asciidoc as a plain text mark-up tool. Using vim as my writing canvas, makes writing just a little bit easier. Asciidoc is an amazing tool which gives formatting power to plain text documents. Unfortunately, my favorite tools stood in the way of easily editing and adding posts to my blog. I am sure that if I knew any programing at all, even just simple bash scripting, I could have solved the short comings of my favorite tools, and the extra steps involved in publishing my blog.

In order to publish my blog I would: 1) Add to the plain text document which was done in Asciidoc mark-up. 2) I would run the bash script included with Asciidoc that produces the Asciidoc homepage with a few changes to the layout1.conf file. 3) I would FTP all of the changed pages to my free shell account at http://mowestusa.nixsyspaus.org. 4) I would copy the post to http://www.linuxquestions.org site so it would be there as well. The main advantage in posting to www.linuxquestions.org was for the benefit of having my blog posts in an RSS feed.

I had no way to use my favorite tools, and have a seamless update of my blog with an updated RSS feed too. I liked using vim and Asciidoc, but I did not like having those extra steps and no RSS feed on my main site. At first I tried to find a way to add an RSS feed to my plain HTML pages, but that did not seem easy to do, without additional steps.

2. A worthy solution which appealed to my thrifty nature, involved using only www.linuxquestions.org as my primary blog site. I would have my RSS feed. I would have some Linux user traffic. I would add content to one of the best sources for Linux information on the Internet. However, the feature set for blogs at www.linuxquestions.org are spartan. I wrote to Jeremy asking for a few little features, but haven’t seen those improvements in the last year. I don’t fault Jeremy because he has established certain rules about the way in which www.linuxquestions.org is run. I’m not sure if my improvements even fit with his vision for the site, so I can understand that those ideas will not be implemented. I asked for the title to allow more characters and being allowed to add a small graphic, which would allow for just a little personalization of your blog. Another reason why www.linuxquestions.org would not become the permanent home, is the dependence on a web form as the means of adding posts. I wanted the option of writing my posts off line on my desktop, and then uploading the posts to the site. Because of dumb mistakes, server time outs, and Firefox crashes, I have lost posts to forums and blogs in the past when depending on web forms.

My solution is a new site, and a new tool. I could have installed WordPress on my http://mowestusa.nixsyspaus.org site, but I didn’t want to worry about security updates. So I used the www.wordpress.com account I had set up months ago, when Chess Griffin was on www.wordpress.com, and on the desktop I use another favorite app, Tomboy (found here: http://www.gnome.org/projects/tomboy/plugins.html) with a special Blogposter plug-in (found here: http://flukkost.nu/blog/tomboyblogposter/).

Now I have a fun desktop offline application, with an easy way to upload the finished post in one program. I doubt it will make me a good blogger, but maybe, just maybe, I will be a better blogger. :-)

Blog at WordPress.com.