January 2021 Archives

Sun Jan 10 08:02:11 PST 2021

Spell Checking in Vi (Vim)

I have been making more use of 'vi' to create documents containing written text recently. One problem with this is the lack of integrated spell checking in 'vi' - so I had a look for 'solutions' to this problem (or nice workarounds, at least). 'aspell' is straightforward to use - it does not do the highlighting that people have come to expect though. Checking around on this - I found that 'vi' has integrated spell check highlighting (nobody told me!).

Here is a simple .vimrc file that allows you to format a section of text '=', apply aspell to the entire file, switch on vi's spell checking, and turn on and off integrated 'vi' spell checking using the '+' and '-' keys (sometimes you do not want to have the highlighting of the spell check.

map = !}fmt -w 60 -d ''^M
map ^T :w!^M:!aspell check %^M:e! %^M
set spell
map + :setlocal spell^M
map - :setlocal nospell^M

Here the '^' symbol indicates a character sequence that begins with 'control-v' followed by the control character that you want to enter - e.g. 'enter' or 'control-t'. So ^T is entered as 'control-v control-t' and ^M as control-v enter'.

When you have these lines in your ~/.vimrc file, the following functions are enabled in vi.

'=' will run the 'fmt' program on the current paragraph and format this text at a width of 60 characters

'control-t' will run aspell on the current file. Aspell will take you through possible miss-spellings and allow you to correct them or accept corrected spellings.

'+' turns on interactive spell checking as is now built into vi.

'-' turns off interactive spell checking as is now built into vi.


Posted by ZFS | Permanent link | File under: linux, general, bash

Sun Jan 3 21:52:40 PST 2021

The Bic BU2 Grip Mechanism

Bic created their own unique retraction system for pens. This uses a plastic latch which stops the push button from springing open when the pen is in use.

Here is a picture of the internals of a Bic BU2 Grip pen - showing the two plastic parts that make up the button and latch. The refill has a spring that pushes on the button and allows the latch to operate.

The Bic BU2 internals (click for a larger image)
(Bic BU2 internals)

I believe that the same mechanism is used in the classic Bic M10 Clic type ballpoint pens. You can extract the push button and latch by pressing the protruding part of the latch into the body of the pen. If you push far enough the button will come free from the pen body. To reassemble the pen, put the latch into the correct position inside the push button, and push it into the pen until it engages with the slot in the pen body.

The sketch shows how the latch uperates.

 
 
The Bic retraction mechanism (click for a larger image)
(Bic ballpoint pen mechanism)
 
 

What is nice about the Bic mechanism is that it relies on the springiness of plastic!


Posted by ZFS | Permanent link | File under: general

Sun Jan 3 20:34:15 PST 2021

2021 Planner

Here is a simple DIY planner for 2021: 2021-DIY-Planner.pdf.

If you have access to a printer that can print on both sides of a piece of paper, you can print yourself a letter sized, two pages per week, 2021 planner using this file. You can then hole punch the pages and put the planner in a binder.

To create this, I used an awk program to write PostScript for the main planner and ps2pdf to convert the PostScript into a PDF. The initial calendar pages came from a combination of another awk program and the cal program.


Posted by ZFS | Permanent link | File under: planner_update, linux, diy, general