I am finding Visual Studio Code to be very useful as a light IDE and editor for C++ and Python code on Linux.
Some keyboard shortcuts that I find useful:
Ctrl + B: Toggle sidebar
Ctrl + P: Search for file to open
Ctrl + Shift + F: Search for text in files
Ctrl + Shift + P: Editor commands
Ctrl + G: Jump to line number
Ctrl + Tab: Switch between open editors
Ctrl + Shift + O: Jump to symbol in current file
Ctrl + T: Jump to symbol in current workspace
Ctrl + `: Open terminal
F12: Go to definition
Ctrl + Alt + -: Go back
Ctrl + /: Toggle line comment
Alt + Shift + 1: Toggle between vertical and horizontal split windows
Some user interface tips:
Single click on filenames in the Side Bar opens files into the same editor tab, replacing the earlier one. This is useful when browsing through files. Notice that the filename is in italics on the editor tab in this mode.
Double click on filenames in the Side Bar opens file in a new editor tab. The file owns that editor tab. Notice that the filename is not in italics on the editor tab.
Ctrl + single click on filename in Side Bar to open it in existing editor tab in second vertical split.
Ctrl + double click on filename in Side Bar to open it in new editor tab in second vertical split. This file will own the tab.
What if you opened a file using single click, but now wish it owned the tab, so that it will not be replaced when you open next file? Aha, Visual Studio Code has you covered! Double click the filename on the tab. You will see that the italics is removed. The file now owns this tab.
MATLAB has keyboard shortcuts to switch to any of the different types of windows it displays. These shortcuts are hard-coded and cannot be configured or changed from the Preferences.
Some of the shortcuts I find useful are:
- Command window:
Ctrl + 0
Ctrl + Shift + 0
Ctrl + 3
- Variables editor:
Ctrl + Shift + 3
The full list can be seen at the bottom of this page.
Tried with: MATLAB R2014a and Ubuntu 14.04
Byobu has support for a long list of keyboard shortcuts. The full list of keybindings can be found listed in
/usr/share/byobu/keybindings/f-keys.tmux. However, you may find that one or more of those do not work. For example, I found that pressing
Shift+F1 to view help and pressing
Ctrl+F2 to do a horizontal split did not work.
There are many reasons why Byobu is not receiving or failing on executing the hotkey you are pressing.
One possibility is that your desktop environment, window manager or terminal program is already using that keyboard shortcut. You will need to disable those keyboard shortcuts for it to work in Byobu. This was how I got
Ctrl+F2 working in Byobu.
Here are some places where you can check:
- XFCE: Check in Keyboard -> Application Shortcuts. Also check in Window Manager -> Keyboard.
- KDE: Check in Global Keyboard Shortcuts.
Another possibility is that Byobu is receiving the keybinding you pressed, but it is executing a shell command that is failing.
This was the case for
Shift-F1 to fail, the culprit was my Fish shell. The command executed by this hotkey can be seen in
/usr/share/byobu/keybindings/f-keys.tmux. It is executing a command that will work only in Sh or Bash.
To override this, I created a
~/.byobu/keybindings.tmux, copied the line and edited to add a
sh -c prefix to it so that it used the correct shell.
Tried with: Byobu 5.74 and Ubuntu 14.04
Whisker Menu in XFCE is the equivalent of the Start menu in Windows. You get it by clicking the mouse icon in the top-left corner.
The default keyboard shortcut to activate this is
Ctrl + Esc. For anyone who has used Windows or Unity before, this can be an irritating shortcut to remember. Why not just set this to the
That is easy. Go to Settings -> Keyboard -> Application Shortcuts. For the command
xfce4-popup-whiskermenu, change it to the
Win key. That is it!
Tried with: XFCE 4.12 and Ubuntu 15.04
I sometimes run Ubuntu inside a VirtualBox virtual machine. In this Ubuntu, to switch from graphical window manager to the first virtual console, press
Host + F1. By default, the
Host key in VirtualBox is assigned to
Right Ctrl key. So, I press
Right Ctrl + F1. To get back to graphical window manager, switch to the 7th virtual console:
Right Ctrl + F7.
Tried with: VirtualBox 4.3.20
Eclipse CDT and NSight Eclipse Edition both do not have a default keyboard shortcut for Build Project. They do have
Ctrl + B for Build All, which builds all the projects in the Workspace. This is a surprising omission considering how frequently Build Project needs to be used by a C++ or CUDA developer.
You can assign a new keyboard shortcut for Build Project, by going to Window > Preferences > General > Keys. On my computers, I just remove the
Ctrl + B shortcut for Build All and assign it to Build Project.
Tried with: Eclipse 3.7.2, Eclipse CDT 8.0.2 and Ubuntu 12.04 LTS
Fish has a lot of useful keyboard shortcuts that can be used to edit or change the commandline. The shortcuts I find useful are:
Ctrl+c: Clear the command line
Ctrl+l: Clear the terminal screen and show a fresh command prompt
Ctrl+w: Delete the word to the left of the cursor. This is useful for cases where you use Fish to bring back an old command and want to just change the last parameter.
Alt+Right: Move back and forward in directory history. The PWD shown in the prompt autoupdates while you press these keys. Just stop when you have reached the directory you want. This is a killer feature cause it makes switching back and forth between directories so easy!
Tried with: Fish 2.0.0 and Ubuntu 14.04
Byobu is a program that makes using terminal multiplexers really easy. A terminal multiplexer is like a windowing system for console programs. Byobu uses tmux by default, but can be configured to use GNU screen too.
Byobu allows you have many console windows or programs running at the same time. You can detach from Byobu and later restore the session, with all your terminals and programs running intact. This is similar to hibernating and restarting an OS back.
- When opened, Byobu opens with your default shell. The bottom line of Byobu is like a taskbar and shows currently open windows (or tabs). You can see the default window (or tab) numbered 0 there.
- To open a new session named foo, use the command:
byobu -S foo
Byobu uses the function keys for almost all its operations.
F2: Open a new window or tab. This means that a new shell session is opened in that window. This window is numbered 1, as seen at the bottom.
F4: Switch forward and backward between open windows.
Ctrl+A d: Detach from Byobu. Puts you back at the shell. All the windows and the shells inside them are still running. You get back to them whenever you want.
F7: Toggle mode to scroll through history. Once in this mode, use cursor keys or Page Up or Page Down to scroll through history. To search back or forward in the history, use slash or question mark (just like in Vim). Press Enter to get out of this mode.
F8: Rename the current window. The name is shown at the bottom of each window. This is very useful to distinguish work you are doing in each window.
Ctrl + F2: Create a vertical split window
Shift + F2: Create a horizontal split window
Shift + F3 or
Shift + F4: Switch forward and backward between split windows
F9: Change the settings using its inbuilt Curses GUI dialog.
Alt + F12: Toggle mouse support. More details in this post.
Shift + F12: Toggle function keys. This is useful when you want to use the function keys in a terminal application.
You can see these keyboard shortcuts defined in the
Tried with: Byobu 5.77 and Ubuntu 14.04
Unity is the name of the graphical interface in Ubuntu. There is a handy way to view a list of the keyboard shortcuts supported in Unity. Just press and hold the Win key. A list of keyboard shortcuts will be displayed.
Some of the keyboard shortcuts not listed there:
Ctrl + Win + d: Show desktop. Press again to restore back the windows.
Tried with: Ubuntu 14.04
Nautilus is the file explorer in Ubuntu. One keyboard shortcut to open it is Win + 1. This will only work if Nautilus is locked to the Launcher and it is the first icon below the Dash icon.
Another is to just use the Dash. Press the Win key, which opens the Dash. Now type the letters of the word nautilus until it appears as the first icon in the search results and then press Enter.
Tried with: Ubuntu 12.04.1 LTS