Tuesday, February 23, 2016

Youtube fullscreen with xmonad

Source
import XMonad.Hooks.EwmhDesktops

main = do
    xmonad $ ewmh defaultConfig
        ...
        , handleEventHook = fullscreenEventHook <+> handleEventHook defaultConfig

Toggle layout with X Window System

setxkbmap -option "ctrl:nocaps"
setxkbmap -layout "us,ru" -option "grp:lalt_lshift_toggle"
Where to place the code

Caps Lock as Ctrl with X Window System

First way

 setxkbmap -option "ctrl:nocaps"

Second way

 xmodmap -e "remove Lock = Caps_Lock"
 xmodmap -e "keysym Caps_Lock = Control_L"
 xmodmap -e "add Control = Control_L"

Where to place the code

The code is to be placed in ~/.xsession. If a login manager is used, it should call XSession. For example,
$ cat /usr/share/xsessions/xmonad.desktop
[Desktop Entry]
Name=XMonad
Comment=Lightweight tiling window manager
Exec=/etc/X11/Xsession
Icon=
Type=XSession

Tuesday, October 14, 2014

How to paste into vim from external buffer without broking formatting

When I paste to vim some text from external buffer, e.g. using Ctrl-Shift-V in a terminal, the formatting is often broken. Use:
:set paste
Then paste the text. When you are done:
:set nopaste

Thursday, May 22, 2014

Changing Firefox Tab Cycle Order

  1. about:config in address bar
  2. Set "browser.ctrlTab.previews" to "true" (double-click)
Source

Wednesday, May 21, 2014

svn diff wrapper for vim with correct file names

#!/bin/sh

# use vimdiff to view diffs
DIFF="/usr/bin/vim -d -R"


NUM=$#  # number of arguments
LEFT=${6} # old file
RIGHT=${7} # new file
L_TITLE=${3} # actual name and revision of old file
R_TITLE=${5} # actual name and revision of new file

L_TITLE=`echo $L_TITLE | tr -s ' ' | sed 's/ /\\\\ /g'`
R_TITLE=`echo $R_TITLE | tr -s ' ' | sed 's/ /\\\\ /g'`

$DIFF $LEFT $RIGHT -c "setl stl=$L_TITLE | wincmd W | setl stl=$R_TITLE"