Tag Archive: Bash

Use Vim as a simple IDE

Vim already has all functionalities to use it as an IDE.

Vim already has all functionalities to use it as an IDE.

Everybody can install an IDE and use it, but how to use vim as an IDE? I’ll show you settings, shortcuts and features of vim, which turns it into an IDE without using plugins or magic, just plain vim features.

These are the features I’ll focus on:

  • Features out of the box:
    • Basic usages: Open, save, close, …
    • File explorer
    • Create tabs and use them
    • Split the window
  • Navigation in vim:
    • Find, replace, …
    • Jump (e.g. to the next occurrence, definition, …)
  • Build and run software
    • Debugging
  • Create own settings:
    • Line numbers, syntax highlighting, highlight cursor line, …
    • Auto completion in a drop-down menu

These are all adjustments to vim.

Basic usage

Even if you should be familiar with the modes in vim, here’re are some basic commands:

Open a file (without tabs): :e /path/to/file
Save a file: :w
Close a file: :q and without saving :q!
Show information on a command: :help command

Built-in File explorer

(more…)

Parsing command line arguments in Bash

Parsing arguments is not that difficult. Not even in bash scripts.

Parsing arguments is not that difficult. Not even in bash scripts.

There’re many ways to parse arguments that were passed to a bash script. I’ll show two similar methods to parse the parameter schema -o /foo/ and --output=/foo/. The second example can also handle commands.

String manipulation just using Bash

If you’re not familiar with manipulation of string (like ${var#=*} or similar) keep on reading. We’ll select sub-strings from the arguments in the following scripts. The command to do so looks like this: ${<VARIABLE><SPLIT-CHARS><REGEX>}

The split chars define what the result is, which is always one single string. There’re four different ones: (more…)