Doorgaan naar hoofdcontent

VIM tips & tricks 2: "Adding and Subtracting numbers"

One of the coolest features in Vim is to easily change a number by either an addition or a subtraction of the number on the cursor

In normal mode you type <C-a> for adding one or <C-x> for subtracting one

it even gets better if you add a number before your <C-a> it will use that number to add to the number on the cursor!

Reacties

Populaire posts van deze blog

Add Costum Keyboard Layout to XFCE

How to create this keyboard layout for Xfce : Works also on Mate!!!!   It is a lightly modified version of the dvorak programmers layout. I changed the lower left row. So you can easily undo, cut, copy & paste         with your left hand and keep the other hand on your mouse. Step 1. Edit file: /usr/share/X11/xkb/symbols/us Insert this snippit: // programmer Dvorak wim's style, by Wim Stockman <wim.stockman at gmail dot com> // Main features: Numbers are in shift position (like French), symbols have been // switch position of z x c v to the bottom left for easy shortcut handling partial alphanumeric_keys xkb_symbols "dvp-wim" { include "us(dvorak)" name[Group1] = "English (programmer Dvorak Wims style ZXCV)"; // Unmodified Shift AltGr Shift+AltGr // symbols row, left side key <TLDE> { [ dollar, asciitilde, dead_tilde ] }; key <AE01> { [ ampersand, percent ] }; key <AE02> { [ bracketleft, 7, currency ],

Awk Tips & Tricks: print a "," at the end of the line EXCEPT the last one!

Small AWK idiomatic tip. If you want to add a char at the end of each line.EXCEPT the last one. for instance you are generating an array. awk NR>1 {printf(",\n");} {printf($0);} TLDR; The NR stands for number record, the line it is processing usually. the printf statement prints out without the ORS( output record separator) usually newline (\n) char. END;

Converting HEIC , HEIF files with Image Magick

Convert alle HEIC files in a directory to PNG file First off all you have to compile imagemagick from source with heic support and some other libs: Here are the instructions for this: cd /usr/src sudo git clone https://github.com/strukturag/libde265.git sudo git clone https://github.com/strukturag/libheif.git cd libde265/ sudo ./autogen.sh sudo ./configure sudo make sudo make install cd /usr/src/libheif/ sudo ./autogen.sh sudo ./configure sudo make sudo make install cd /usr/src/ sudo wget https://www.imagemagick.org/download/ImageMagick.tar.gz sudo tar xf ImageMagick.tar.gz cd ImageMagick-7* sudo ./configure --with-heic=yes sudo make sudo make install sudo ldconfig if you want to convert all files in a directory to png from heic. For some reason mogrify from imagemagick refuses. So I had to do it with convert: for file in *.HEIC; do convert $file $file.PNG; done The only drawback with convert is that it changes the date of the new files to th