Author

The Archives

  • 09.04.10
    Vim. Key mapping shell | n0str0m0 | (0)
    Maps are a way to create an association between a set of key strokes and a set of actions. They are really powerful. However, in this post, I will not explain them in the deepest detail. If you need further information, you will need a good Vim manual. As it happens with abbreviations, maps can be used regardless of the mode you are in Vim or they can be restricted to a certain operation mode. They work the same way in every mode. Type :help :map to know which map commands work in which mode. First off, :map ... ... <Esc>OM       <CR> <Esc>Ol ...
  • 07.30.10
    Vim. Saving keystrokes: abbreviations shell | n0str0m0 | (1)
    Welcome to a new issue of this short Vim tutorial! As we saw in previous posts, Vim is the perfect tool if you want to save time in your daily work. It helps you in the write-compile-debug cycle, it indents and autoindents code, it is extremely powerful for searching, replacing and many other frequent tasks. In this post I will introduce an interesting feature meant to make you type less: abbreviations. Abbreviations are, as their name indicates, a way to create an association between a short set of characters and a piece of text (or a command). Abbreviations can be used in insert, replace ...
  • 07.03.10
    Which package does this file belong to? cmd | n0str0m0 | (0)
    On FreeBSD, we use the pkg_info command this way: $pkg_info -W /usr/local/bin/mysql /usr/local/bin/mysql was installed by package mysql-client-5.5.2 Enjoy!
  • 04.15.10
    IPCS shell | n0str0m0 | (0)
    ipcs shows the status of SYSV inter process communication facilities. $ ipcs -s ------ Semaphore Arrays -------- key semid owner perms nsems 0xdd3adabd 0 fernape 600 1 I had forgotten about this command but I remembered it when we ran out of semaphores in our Linux system two days ago. Other ...
  • 03.19.10
    Shell scripting for Nautilus shell | n0str0m0 | (0)
    It has been a while since I wrote my last post. Sorry for the delay, but I was a bit busy lately. In this post, I shall explain how to get the most of your nautilus file manager by using shell scripts. Nautilus provides some facilities available from shell scripts. Combining them with a small utility called zenity can improve your daily tasks. Nautilus has the ability of executing shell scripts applying them to the selected files. The executable scripts are those present in the following directory: ~/.gnome2/nautilus-scripts Every script present in that directory will be shown in the "Scripts" entry of the contextual ...
  • 01.22.10
    Vim for programmers (III) shell | n0str0m0 | (0)
    Welcome to the last "Vim for programmers" issue. Ironically, in this issue I will show you some nice characteristics despite they are not specific of programming. However they make much more sense when they are applied to programming. Getting C help This first feature is oriented directly to C programming. In most UNIX systems, there is a collection of system manual pages available with the command "man". Although I will not explain man in detail (you can read more here (or type man man) it is worth saying it shows information about the command, system call, file, etc passed as parameter. ...
  • 01.07.10
    Vim for programmers (II) shell | n0str0m0 | (1)
    In the first part of this series, we visited some Vim features that help us in programming. In this second issue, I will show you some other important things you should know to really appreciate the power of Vim. Completion Completion is not a programming specific feature in Vim, however it is in programming where I find it to be more useful. There are several completion options, but I will explain the ones I find more interesting. Completion is a sub mode of insert mode. This means the commands are applied while being in insert mode. Line completion: Ctrl-x ...
  • 12.31.09
    Make Love cmd | n0str0m0 | (0)
    In FreeBSD: $ cd /usr/src $ make love Enjoy the output. Merry Christmas! Source: psybermonkey
  • 12.07.09
    Vim for programmers (I) shell | n0str0m0 | (1)
    Vim is suitable for a myriad of applications. However, it is in programming where it specially shines. Vim offers facilities that make the programming workflow especially easy and efficient. Some people use newer editors (or IDEs) just because they think Vim lacks some new cool features. That is not the case as I will show you in this issue. (I will use C source files in the examples, but most of the information in this post is applicable regardless of the language programming you use) Syntax highlighting Vim supports syntax highlighting for hundreds of file types. Having a look at /usr/share/vim/vim64/syntax (this is ...
  • 11.01.09
    Vim. Editing multiple files shell | n0str0m0 | (0)
    In previous issues, we have edited one file at a time. We did this because there were other points of interest at that time. However, Vim can handle more than one file at a time using several different techniques including buffers, viewports and tabs last one, since Vim 7. In this issue we take a look at these handy mechanisms that will speed up your work. Buffers We can think of a buffer as a place inside Vim where a file is loaded. In the following example, I will use a couple of files: $ cat file1 file2 This is file 1 This is ...