Sensible plugin for Vim

Sensible is a super simple plugin for Vim by Tim Pope. It is nothing but a set of sensible settings for your vimrc. It is a great way to start off on a new system where you do not have access to your fully featured vimrc. I only wish he explained some of the choices he made for the options in this file.

If I have a local account on the remote or new computer, I find it far easier to just replicate my vimrc, and other dot files, using GNU Stow.

Advertisements

Orage Panel Clock

Since all the displays are widescreen now, I like to utilize all the available vertical space for my apps. So, I keep the XFCE Panel on the left side in a vertical orientation. This worked great for everything, except the panel clock. The width of the Panel was too less for the clock to show time in digital mode. And in analog mode, the hour hand of the clock is quite confusing to read.

I was wallowing in this situation until I discovered the Orage Panel Clock. This XFCE Panel plugin can be added just like any other Panel plugin.

Installing Orage is easy:

$ sudo apt install orage

After this it will appear in the Panel plugins list, so can be added just like any other plugin.

Features I love about the Orage plugin clock:

  • The digital display can be rotated 90 degrees clockwise or anti-clockwise. This is perfect if your Panel is vertical.
  • The foreground and background colors and font and font size of the display can be configured.
  • Multiple lines of clock display can be configured. For example, Line 1 can be the hour and Line 2 can be the minutes.
  • Tooltip when mouse is hovered over clock can be configured to show anything you want.
  • Clicking the clock shows the Orage calendar.

Tried with: Orage 4.12.1 and Ubuntu 14.04

Clipman

Clipman is a clipboard manager for XFCE. There is also a plugin for it that can be used to integrate it into the XFCE Panel.

To install Clipman and its panel plugin:

$ sudo apt install xfce4-clipman-plugin

I like to have Clipman plugin always around in my Panel. To do this, right-click on the Panel, choose Panel -> Add New Items and add Clipman.

Some of its settings that I configure:

  • Increase the number of copied items in history
  • Enable sync selections. This connects clipman to the default X11 clipboard. If not, only stuff you explicitly copy can be explicitly pasted. Middle-click to paste will not work as expected.
  • Choose to paste instantly on Shift + Insert. This means that when I click on an item in history list, it is directly pasted into my last focused application.

Tried with: Clipman 1.2.5-1 and Ubuntu 14.04

Absolute minimal plugins required by Audacious

Audacious is a minimal audio player, but even it ships with lots of plugins. And most of these are enabled out of the box, especially on older versions of Audacious! I like to run it with the absolute minimal plugins.

The only plugins I require in Audacious 3.6.2:

  • Input
    • MPG123 Plugin: Required to decode and playback MP3 files.
  • Playlist
    • Audacious Playlists (audpl): Required to maintain the files you added as a playlist inside Audacious.

The only plugins I require in Audacious 3.4.3:

  • Transport
    • File IO Plugin: Required to open and read audio files.
  • Playlist
    • Audacious Playlists (audpl): Required to maintain the files you added as a playlist inside Audacious.
  • Input
    • MPG123 Plugin: Required to decode and playback MP3 files.

Tried with: Ubuntu 14.04

Enhanced syntax highlighting for C++ using Vim Syntax Extra

Vim ships with the syntax highlighting rules for C and C++. This is a curse in disguise, because those rules are extremely old and they only highlight the keywords. This means that any C or C++ source file looks pretty much like plain text, no matter which color scheme you apply.

Vim Syntax Extra is a plugin that fixes this by adding more syntax rules for C and C++. There is a visible difference only in the syntax highlighting once this plugin is installed. Add its Github URL using any of your favorite Vim plugin manager and restart Vim to enjoy it 🙂

Tried with: Vim 7.4 and Ubuntu 14.04

How to use CPPCheck with Eclipse CDT

The biggest problem of C++ code is bugs. Bugs can slip through even when compiling code with all warnings turned on. A useful tool in the arsenal of a C++ programmer is CPPCheck, a static analysis tool. You are in luck if you are using Eclipse CDT because the CPPChEclipse plugin makes using CPPCheck with your C++ project very easy.

  • First install CPPCheck:
$ sudo apt install cppcheck
  • Install CPPChEclipse in Eclipse CDT by adding the URL http://cppcheclipse.eclipselabs.org.codespot.com/svn/update/ to Help -> Install New Software. Your Eclipse will restart after the installation.

  • Go to Window -> Preferences -> C/C++ -> CPPChEclipse. First, set the path of CPPCheck to /usr/bin/cppcheck. In the Problems subsection, choose the types of problems you want to be reported about (warnings, errors, style problems). In the Settings subsection, choose the C and C++ standard versions you want to be applied. You can also indicate the CPPCheck use the include paths used by your project (this is very useful).

  • To run CPPCheck on a project, right-click on its name in the Project Explorer and choose CPPCheck -> Run CPPCheck. The default keyboard shortcut for this is Shift + Ctrl + C. After CPPCheck runs, you can view the problems it has reported in the Problems view at the bottom of Eclipse.

Tried with: CPPCheck 1.61, CPPChEclipse 1.0.0, Eclipse 4.4.2 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

Vim-ASCIIDoc plugin

Vim-ASCIIDoc is a useful plugin for Vim if you frequently edit ASCIIDoc files.

Install

In addition, to the Vim-ASCIIDoc plugin, it also requires the installation of Vimple and Asif, two plugins by the same author.

Usage

  • Plugin sets the compiler by default to asciidoc.

  • If you want to use asciidoctor as compiler, use the command :compiler asciidoctor

  • If you want to set the default compiler, add this line to Vimrc:

https://gist.github.com/ashwin/51f47a0fd7c6508d5740

  • If you use asciidoctor as compiler, the plugin will keep complaining that it needs to know the themes directory for this compiler. To set the themes directory, I set this in my Vimrc:

  • Once the compiler is set correctly, you can build a ASCIIDoc file by typing :make

Tried with: Vim 7.4 and Ubuntu 14.04

Easy Align plugin for Vim

20150402_tabular

Easy Align is a plugin for Vim that makes it super easy to align your code along certain whitespace or characters. Unlike the Tabular plugin, Easy Align is actually easy to use, not requiring you to create and recall esoteric-looking arguments.

Below are a few examples of how I typically use this plugin. For everything below, first visually mark out the lines, press : followed by command given below:

  • To align text based on space characters as delimiter:
    • Align on first delimiter: EasyAlign \
    • Align on second delimiter: EasyAlign 2\
    • Align on all delimiters: EasyAlign *\
  • To align based on equals character as delimiter. For example, a block of assignment statements in C++. I visually block it and use the command: EasyAlign=

  • To align based on comma character as delimiter. For example, a block of function calls in C++ along their multiple comma characters: EasyAlign*,

  • To align a block of function parameters, one on each line: EasyAlign-\

The logic behind these commands is straightforward and is explained in the table of examples on the plugin’s Github page.

Tried with: Vim 7.4 and Ubuntu 14.04

Alternate Files plugin for Vim

The Alternate Files plugin for Vim is simply called A.vim. It does a single, but very useful job for C and C++ files: it allows you to switch or alternate back and forth between source and header files.

  • If you are in foo.cpp source file and you type the command :A, Vim opens the corresponding foo.h header file. Vice versa.

Tried with: Vim 7.4 and Ubuntu 14.04