Directory history in the Fish shell

The Fish shell makes it very easy to jump around in your directory history. This is the list of directories that you had changed to using the cd command.

  • Fish supports jumping back to the previous directory, just like in Bash: cd -

  • To view the directory history: dirh You can see your current directory highlighted in color in this list.

  • To move to the next and previous directory in your history, use the nextd and prevd commands.

  • Typing these commands is too much? Not to worry, at an empty Fish prompt, you can cycle to your previous and next directories by just pressing the Alt + Left and Alt + Right keys.

  • Note: The Alt + Left and Alt + Right shortcuts might have been grabbed by your terminal program, like GNOME Terminal. They need to be freed for this to work. I use Terminator, where I disabled these keybindings by right-clicking in the terminal -> Preferences -> Keybindings.

Tried with: Fish 2.2b1, Terminator 0.97-2 and Ubuntu 14.04

Eclipse Content Assist not working

20150528_content_assist

Problem

When using a fresh install of Eclipse CDT I found that the content assist was not working. This is the feature similar to autocomplete in Visual Studio, where you get completion proposals on pressing Ctrl + Space while typing code.

Solution

Go to Window -> Preferences -> Editor -> Content Assist -> Advanced and enable Parsing-based Proposals. Click Apply. Content assist should start working immediately. No restart of Eclipse required.

Tried with: Eclipse 4.4.2 and Ubuntu 14.04

Ruby install error: OpenSSL missing

Problem

I was building and installing Ruby from source as described in this post. The installation failed with this error:

The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Solution

To fix this error, install the package that has OpenSSL header and library files required for Ruby to build its OpenSSL extension. On Ubuntu, do this:

$ sudo apt install libssl-dev

Ruby should build and install without any problem after this.

Tried with: Ruby 2.1.5 and Ubuntu 14.04

How to full screen in Eclipse using plugin

Eclipse has no option to display in full screen mode! By full screen mode, we mean that Eclipse occupies the entire display, with the Dash (on the left) and Panel (on the top) hidden. This is typically achieved in other applications by pressing F11. Note that, there is a maximize mode where the current Edtitor window is maximized, but this is different from full screen.

Thankfully, this can be achieved using the Eclipse Full Screen plugin.

  1. Download the plugin zip file from here.

  2. Unzip the file and copy the .jar file to the plugins directory of your Eclipse.

  3. Close Eclipse and start it again.

  4. To go full screen, click Window -> Full Screen or use the keyboard shortcut Ctrl + Alt + Z.

Tried with: Eclipse Full Screen 1.0.7, Eclipse 4.4.2 and Ubuntu 14.04

How to set default font in LibreOffice Calc

LibreOffice Calc is an excellent open-source replacement for the popular spreadsheet program Microsoft Excel. One irritation for me is that the default font and font size it uses are not what I would like. To set your own font, font size and other text formatting as default it takes a few steps as described below.

  1. Open LibreOffice Calc. It opens with a new spreadsheet document.

  2. First, we set our font as default for this spreadsheet document: Go to Format -> Styles and Formatting. Right-click on Default and choose Modify. In the Font tab, set the font, font size and other formatting options that you would like to be the default. Click OK.

  3. We now save this format as a template: Go to File -> Templates -> Save As Template. Choose My Templates and click Save. Give your template a name.

  4. Finally, we make our template as the default template: Go to File -> Templates -> Manage. In the Spreadsheets tab, click on your template and click Set as default. We are done! :)

All new spreadsheets created by Libreoffice Calc will now have the default font set in this template. Note that this is the font that will also be used for comments in Calc.

Tried with: LibreOffice 4.2.8.2 and Ubuntu 14.04

How to use ZealLookup plugin for Eclipse

Zeal is an offline documentation browser which can be used to lookup help for most popular libraries and APIs. The ZealLookup plugin (also called ZealEclipsePlugin) enables you to lookup help in Zeal right from inside Eclipse! :-)

Install

  • Shutdown Eclipse.
  • Download the plugin .jar file from here and place it in the plugins directory of your Eclipse installation.
  • Start Eclipse.

Usage

  • You need to configure a keyboard shortcut for ZealLookup. Go to Window -> Preferences -> General -> Keys. Look for Lookup in Zeal command and set a keyboard shortcut for it.

  • I use Vrapper, so I set the keyboard shortcut as \z which is the same as what I use to call Zeal from within Vim.

  • To lookup a word in Zeal: highlight the word and press the keyboard shortcut you have set earlier. Zeal should open with the documentation for the word. I found that sometimes Zeal stays in the background, but it has looked up the word.

  • For use with Vrapper, I mark the current word using viw (visually mark inner word) and then press the ZealLookup keyboard shortcut.

Tried with: ZealLookup 1.0.0, Eclipse 4.4.2 and Ubuntu 14.04

How to use Synergy in Ubuntu

20150522_synergy

Synergy is a tool that can be used to share a keyboard and mouse across multiple computers. In this post, I will describe how I used Synergy to share a keyboard and mouse between two computers running Ubuntu.

Install

  • Server is the computer whose keyboard and mouse you want to always use.

  • Client is the computer whose display you want to control using the server’s keyboard and mouse.

  • Make sure the server and client are connected on the same wireless network or LAN. Make sure you can ping the server from the client and the client from the server.

  • Install Synergy on both the server and the client computers:

$ sudo apt install synergy

Setup the server

  • Type Synergy in the Dash or synergy at the shell to open the GUI of Synergy.

  • Choose the Server option. Choose an encryption method from the dropdown and provide a password.

  • In the main dialog, make sure Configure interactively is chosen.

  • Click on Configure server. In the Screens and links tab, you should be able to see a blue display, which represents the server. Drag down the blue display (in the top-right corner) to a box neighboring the server display. This new display you added represents the client. My client display on my desk is to the left of my server, so I dragged the blue display and placed it to the left of the server display.

  • Double-click on the display you added. In the Screen Settings dialog, provide a Screen name to the client. This can be anything, it is just used in the grid of displays. Add an alias: you have to give the hostname or IP address of the client here.

  • Click Start to start the server. It will minimize to the system tray at the top.

Setup the client

  • Type Synergy in the Dash or synergy at the shell to open the GUI of Synergy.

  • Choose the Client option. Choose the encryption method from the dropdown and password that you had used on the server. They have to be the same!

  • In the main dialog, type in the IP address of the server and press Start. Your client is now connected to the server! :-)

Usage

  • Remember that I have placed my client to the left of the server in the grid. So, when I want to switch to my client display, I hit the mouse to the left side of the display on my server. It will appear in the client! All the keys I type on the server keyboard now appear in the client. To switch back, hit the mouse to the right side of the client display.

Tried with: Synergy 1.4.12 and Ubuntu 14.04