This solution will avoid double blank lines
:g/.\n\n\@!/norm o
The magic happens because we are denying a consecutive new line with \n\@!
:%s/^/=(line(".")%3==0?"\n":"")/g
| #!/bin/bash | |
| # Save this file as /usr/bin/apt-pac and chmod +x it. | |
| case "$1" in | |
| autoremove) | |
| pacman -Rns $(pacman -Qdtq); | |
| ;; |
| #sponsors_feature, #sponsors_index { | |
| width: 120px; | |
| } | |
| #sponsors_index { | |
| position: absolute; | |
| top: -2px; right: 0; | |
| } | |
| #sponsors_index h2 { | |
| background: #fff url('/images/components.png') -362px -579px; | |
| } |
| # copy this function into your shell, then check your settings | |
| installnumix (){ | |
| [ -d ~/.icons ] || mkdir ~/.icons | |
| [ -d ~/.themes ] || mkdir ~/.themes | |
| cd ~/.themes | |
| git clone https://github.com/numixproject/numix-gtk-theme.git | |
| cd ~/.icons | |
| git clone https://github.com/numixproject/numix-icon-theme.git | |
| git clone https://github.com/numixproject/numix-icon-theme-circle.git |
| # PS. The mouse and sticky keys indicators require xkbset to be installed, the clock requires the font LCDMono which is located here. | |
| # font lcd mono: https://www.dafont.com/lcd-lcd-mono.font | |
| alignment top_right | |
| color1 burlywood1 #Month color | |
| color2 burlywood4 #Year color | |
| color3 darkgoldenrod4 #Weekdays lived color | |
| color4 cornsilk #Current weekday color | |
| color5 darkgoldenrod1 #Weekdays yet to come color | |
| color6 darkorange3 #Days of month lived color |
| # | |
| # source: https://github.com/Eriner/zim | |
| # startup file read in interactive login shells | |
| # | |
| # The following code helps us by optimizing the existing framework. | |
| # This includes zcompile, zcompdump, etc. | |
| # | |
| ( | |
| # Function to determine the need of a zcompile. If the .zwc file |
| # This is my attempt to create a lazy loading for | |
| # fasdcd command "z", in this case | |
| # I would like to receive comments and tips to better understaingin the process of creating | |
| # lazy_load functions and how to apply this knowledge to improve zsh startup, specially | |
| # to improve compninit (zsh completion system) | |
| # sources: | |
| # https://kev.inburke.com/kevin/profiling-zsh-startup-time/ | |
| # https://github.com/benvan/sandboxd/blob/master/sandboxrc.example |
| # Function to show full git log | |
| # this function allows you to show a full | |
| # or paged log Full git log | |
| fgitlog (){ | |
| PRETTYFORMAT='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | |
| if [ ! -z "$1" ] && [ "$1"=="--no-pager" ]; then |
| # In order to get radio stations addresses I am normaly | |
| # get the url with "firefox download helper" show url option | |
| # the idea to use tee came from here: | |
| # source: https://shkspr.mobi/blog/2011/11/watching-and-simultaneously-saving-video-in-mplayer/ | |
| dumpwnyc () { | |
| station="wnyc" | |
| url="http://fm939.wnyc.org/wnycfm-tunein.aac" | |
| filename=${station}-$(date +%Y-%b-%d--%H.%Mhs).mp3 | |
| wget -O - "$url" | tee -ai "$filename" | mpg123 - |