repo
stringlengths
5
75
commit
stringlengths
40
40
message
stringlengths
6
18.2k
diff
stringlengths
60
262k
nblock/config
a84df40cb51d823934d36d25e57dcf74b624cce1
Split workspaces accross the usual 2 monitor setup.
diff --git a/config/i3/config b/config/i3/config index cdd8e0f..d1c512c 100644 --- a/config/i3/config +++ b/config/i3/config @@ -1,183 +1,195 @@ # i3 config file (v4) # nblock (at) archlinux (dot) us # # Please see http://i3wm.org/docs/userguide.html for a complete reference! # window title font font pango:Bitstream Vera Sans Mono 10 # use Mouse+Mod4 to drag floating windows to their wanted position floating_modifier Mod4 # start a terminal bindsym Mod4+Return exec urxvtc # kill focused window bindsym Mod4+Shift+c kill # start dmenu (a program launcher) bindsym Mod4+x exec "$HOME/bin/dmenu_multi" # change focus bindsym Mod4+n focus left bindsym Mod4+r focus right bindsym Mod4+t focus up bindsym Mod4+d focus down # move focused window bindsym Mod4+Shift+n move left bindsym Mod4+Shift+r move right bindsym Mod4+Shift+t move up bindsym Mod4+Shift+d move down # switch to next/prev workspace # TODO switch to other screens bindsym Mod4+Left workspace prev bindsym Mod4+Right workspace next #bindsym Mod4+Up focus up #bindsym Mod4+Down focus down # # move container and workspaces to a different screen bindsym Mod4+Shift+Left move container to output left bindsym Mod4+Shift+Right move container to output right bindsym Mod4+Shift+Up move workspace to output left bindsym Mod4+Shift+Down move workspace to output right # split in horizontal/vertical orientation bindsym Mod4+h split h bindsym Mod4+v split v # enter fullscreen mode for the focused container bindsym Mod4+f fullscreen # change container layout (stacked, tabbed, toggle split) bindsym Mod4+s layout stacking bindsym Mod4+w layout tabbed bindsym Mod4+e layout toggle split # toggle tiling / floating bindsym Mod4+Shift+space floating toggle # change focus between tiling / floating windows bindsym Mod4+space focus mode_toggle # focus the parent container bindsym Mod4+a focus parent # focus the child container bindsym Mod4+i focus child +# use a 2 monitor split setup where each screen has an equal amount of workspaces +workspace 1 output HDMI1 +workspace 2 output HDMI1 +workspace 3 output HDMI1 +workspace 4 output HDMI1 +workspace 5 output HDMI1 +workspace 6 output LVDS1 +workspace 7 output LVDS1 +workspace 8 output LVDS1 +workspace 9 output LVDS1 +workspace 10 output LVDS1 + # switch to workspace bindsym Mod4+1 workspace 1 bindsym Mod4+2 workspace 2 bindsym Mod4+3 workspace 3 bindsym Mod4+4 workspace 4 bindsym Mod4+5 workspace 5 bindsym Mod4+6 workspace 6 bindsym Mod4+7 workspace 7 bindsym Mod4+8 workspace 8 bindsym Mod4+9 workspace 9 bindsym Mod4+0 workspace 10 # move focused container to workspace bindsym Mod4+Shift+1 move container to workspace 1 bindsym Mod4+Shift+2 move container to workspace 2 bindsym Mod4+Shift+3 move container to workspace 3 bindsym Mod4+Shift+4 move container to workspace 4 bindsym Mod4+Shift+5 move container to workspace 5 bindsym Mod4+Shift+6 move container to workspace 6 bindsym Mod4+Shift+7 move container to workspace 7 bindsym Mod4+Shift+8 move container to workspace 8 bindsym Mod4+Shift+9 move container to workspace 9 bindsym Mod4+Shift+0 move container to workspace 10 # quickly navigate back to previous window workspace_auto_back_and_forth yes # reload the configuration file bindsym Mod4+Shift+q reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym Mod4+Shift+y restart # exit i3 (logs you out of your X session) bindsym Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" # resize window (you can also use the mouse for that) mode "resize" { # These bindings trigger as soon as you enter the resize mode # Pressing left will shrink the window’s width. # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. bindsym n resize shrink width 10 px or 10 ppt bindsym r resize grow width 10 px or 10 ppt bindsym r resize shrink height 10 px or 10 ppt bindsym t resize grow height 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym Mod4+y mode "resize" # valid for my Thinkpad bindsym XF86ScreenSaver exec "i3lock -d -c 000000" bindsym XF86AudioMute exec "amixer sset PCM toggle" bindsym XF86AudioRaiseVolume exec "amixer set PCM 2%+" bindsym XF86AudioLowerVolume exec "amixer set PCM 2%-" bindsym XF86AudioNext exec "cmus-remote --next" bindsym XF86AudioPrev exec "cmus-remote --prev" bindsym XF86AudioPlay exec "cmus-remote --pause" bindsym XF86AudioStop exec "cmus-remote --stop" bindsym XF86Sleep exec "systemctl suspend" bindsym XF86WebCam exec "$HOME/bin/bluetooth-toggle.sh" bindsym XF86TouchpadToggle exec "$HOME/bin/touchpad-toggle.sh" # currently unused #bindsym XF86Tools exec "something" #bindsym XF86Calculator exec "something" #bindsym XF86Launch1 exec "something" # ThinkVantage #bindsym XF86Display exec "something" # fn - f7 # focus popular clients by title/class bindsym Mod4+Mod1+f [class="(?i)firefox"] focus bindsym Mod4+Mod1+t [class="(?i)thunderbird"] focus bindsym Mod4+Mod1+p [class="(?i)pidgin"] focus bindsym Mod4+Mod1+k [class="(?i)keepassx"] focus bindsym Mod4+Mod1+c [title="(?i)cmus"] focus bindsym Mod4+Mod1+n [title="(?i)newsbeuter"] focus bindsym Mod4+Mod1+j [title="(?i)jdownloader"] focus # colors # class border backgr. text indicator client.focused #4c7899 #285577 #ffffff #ff0000 client.focused_inactive #333333 #5f676a #ffffff #484e50 client.unfocused #333333 #222222 #888888 #292d2e client.urgent #2f343a #900000 #ffffff #900000 # wallpaper exec --no-startup-id feh --bg-scale "$HOME/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" # The status bar bar { status_command i3status position top # use anothor font to get the separator in a different color font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 colors { statusline #00ff00 # color_class border backg. text focused_workspace #4c7899 #285577 #00ff00 active_workspace #333333 #5f676a #ffffff inactive_workspace #333333 #222222 #888888 urgent_workspace #2f343a #900000 #ffffff } }
nblock/config
b9a527c5a02009f67e875827815f4b2e181d9a51
Switch primary
diff --git a/bin/screenon b/bin/screenon index 8b8a2aa..1682add 100755 --- a/bin/screenon +++ b/bin/screenon @@ -1,3 +1,3 @@ #!/bin/bash -xrandr --output HDMI1 --mode 1920x1080 --pos 0x0 --output LVDS1 --mode 1440x900 --pos 1920x0 --primary +xrandr --output HDMI1 --mode 1920x1080 --pos 0x0 --primary --output LVDS1 --mode 1440x900 --pos 1920x0 #awsetbg -R ~/bilder/wallpaper/1920x1080/
nblock/config
f8bdaa919be50fdaf80ca35bc1648e1743463950
Move workspaces/containers via bindings.
diff --git a/config/i3/config b/config/i3/config index 5266928..cdd8e0f 100644 --- a/config/i3/config +++ b/config/i3/config @@ -1,184 +1,183 @@ # i3 config file (v4) # nblock (at) archlinux (dot) us # # Please see http://i3wm.org/docs/userguide.html for a complete reference! # window title font font pango:Bitstream Vera Sans Mono 10 # use Mouse+Mod4 to drag floating windows to their wanted position floating_modifier Mod4 # start a terminal bindsym Mod4+Return exec urxvtc # kill focused window bindsym Mod4+Shift+c kill # start dmenu (a program launcher) bindsym Mod4+x exec "$HOME/bin/dmenu_multi" # change focus bindsym Mod4+n focus left bindsym Mod4+r focus right bindsym Mod4+t focus up bindsym Mod4+d focus down # move focused window bindsym Mod4+Shift+n move left bindsym Mod4+Shift+r move right bindsym Mod4+Shift+t move up bindsym Mod4+Shift+d move down # switch to next/prev workspace # TODO switch to other screens bindsym Mod4+Left workspace prev bindsym Mod4+Right workspace next #bindsym Mod4+Up focus up #bindsym Mod4+Down focus down # -# move windows to different workspaces -# TODO switch to other screens -bindsym Mod4+Shift+Left move workspace to output left -bindsym Mod4+Shift+Right move workspace to output right -#bindsym Mod4+Shift+Up move up -#bindsym Mod4+Shift+Down move down +# move container and workspaces to a different screen +bindsym Mod4+Shift+Left move container to output left +bindsym Mod4+Shift+Right move container to output right +bindsym Mod4+Shift+Up move workspace to output left +bindsym Mod4+Shift+Down move workspace to output right # split in horizontal/vertical orientation bindsym Mod4+h split h bindsym Mod4+v split v # enter fullscreen mode for the focused container bindsym Mod4+f fullscreen # change container layout (stacked, tabbed, toggle split) bindsym Mod4+s layout stacking bindsym Mod4+w layout tabbed bindsym Mod4+e layout toggle split # toggle tiling / floating bindsym Mod4+Shift+space floating toggle # change focus between tiling / floating windows bindsym Mod4+space focus mode_toggle # focus the parent container bindsym Mod4+a focus parent # focus the child container bindsym Mod4+i focus child # switch to workspace bindsym Mod4+1 workspace 1 bindsym Mod4+2 workspace 2 bindsym Mod4+3 workspace 3 bindsym Mod4+4 workspace 4 bindsym Mod4+5 workspace 5 bindsym Mod4+6 workspace 6 bindsym Mod4+7 workspace 7 bindsym Mod4+8 workspace 8 bindsym Mod4+9 workspace 9 bindsym Mod4+0 workspace 10 # move focused container to workspace bindsym Mod4+Shift+1 move container to workspace 1 bindsym Mod4+Shift+2 move container to workspace 2 bindsym Mod4+Shift+3 move container to workspace 3 bindsym Mod4+Shift+4 move container to workspace 4 bindsym Mod4+Shift+5 move container to workspace 5 bindsym Mod4+Shift+6 move container to workspace 6 bindsym Mod4+Shift+7 move container to workspace 7 bindsym Mod4+Shift+8 move container to workspace 8 bindsym Mod4+Shift+9 move container to workspace 9 bindsym Mod4+Shift+0 move container to workspace 10 # quickly navigate back to previous window workspace_auto_back_and_forth yes # reload the configuration file bindsym Mod4+Shift+q reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym Mod4+Shift+y restart # exit i3 (logs you out of your X session) bindsym Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" # resize window (you can also use the mouse for that) mode "resize" { # These bindings trigger as soon as you enter the resize mode # Pressing left will shrink the window’s width. # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. bindsym n resize shrink width 10 px or 10 ppt bindsym r resize grow width 10 px or 10 ppt bindsym r resize shrink height 10 px or 10 ppt bindsym t resize grow height 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym Mod4+y mode "resize" # valid for my Thinkpad bindsym XF86ScreenSaver exec "i3lock -d -c 000000" bindsym XF86AudioMute exec "amixer sset PCM toggle" bindsym XF86AudioRaiseVolume exec "amixer set PCM 2%+" bindsym XF86AudioLowerVolume exec "amixer set PCM 2%-" bindsym XF86AudioNext exec "cmus-remote --next" bindsym XF86AudioPrev exec "cmus-remote --prev" bindsym XF86AudioPlay exec "cmus-remote --pause" bindsym XF86AudioStop exec "cmus-remote --stop" bindsym XF86Sleep exec "systemctl suspend" bindsym XF86WebCam exec "$HOME/bin/bluetooth-toggle.sh" bindsym XF86TouchpadToggle exec "$HOME/bin/touchpad-toggle.sh" # currently unused #bindsym XF86Tools exec "something" #bindsym XF86Calculator exec "something" #bindsym XF86Launch1 exec "something" # ThinkVantage #bindsym XF86Display exec "something" # fn - f7 # focus popular clients by title/class bindsym Mod4+Mod1+f [class="(?i)firefox"] focus bindsym Mod4+Mod1+t [class="(?i)thunderbird"] focus bindsym Mod4+Mod1+p [class="(?i)pidgin"] focus bindsym Mod4+Mod1+k [class="(?i)keepassx"] focus bindsym Mod4+Mod1+c [title="(?i)cmus"] focus bindsym Mod4+Mod1+n [title="(?i)newsbeuter"] focus bindsym Mod4+Mod1+j [title="(?i)jdownloader"] focus # colors # class border backgr. text indicator client.focused #4c7899 #285577 #ffffff #ff0000 client.focused_inactive #333333 #5f676a #ffffff #484e50 client.unfocused #333333 #222222 #888888 #292d2e client.urgent #2f343a #900000 #ffffff #900000 # wallpaper exec --no-startup-id feh --bg-scale "$HOME/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" # The status bar bar { status_command i3status position top # use anothor font to get the separator in a different color font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 colors { statusline #00ff00 # color_class border backg. text focused_workspace #4c7899 #285577 #00ff00 active_workspace #333333 #5f676a #ffffff inactive_workspace #333333 #222222 #888888 urgent_workspace #2f343a #900000 #ffffff } }
nblock/config
6263c3c653610d11f499ce7181a3ebb222d66607
Add wallpaper.
diff --git a/config/i3/config b/config/i3/config index 481a7c5..5266928 100644 --- a/config/i3/config +++ b/config/i3/config @@ -1,181 +1,184 @@ # i3 config file (v4) # nblock (at) archlinux (dot) us # # Please see http://i3wm.org/docs/userguide.html for a complete reference! # window title font font pango:Bitstream Vera Sans Mono 10 # use Mouse+Mod4 to drag floating windows to their wanted position floating_modifier Mod4 # start a terminal bindsym Mod4+Return exec urxvtc # kill focused window bindsym Mod4+Shift+c kill # start dmenu (a program launcher) bindsym Mod4+x exec "$HOME/bin/dmenu_multi" # change focus bindsym Mod4+n focus left bindsym Mod4+r focus right bindsym Mod4+t focus up bindsym Mod4+d focus down # move focused window bindsym Mod4+Shift+n move left bindsym Mod4+Shift+r move right bindsym Mod4+Shift+t move up bindsym Mod4+Shift+d move down # switch to next/prev workspace # TODO switch to other screens bindsym Mod4+Left workspace prev bindsym Mod4+Right workspace next #bindsym Mod4+Up focus up #bindsym Mod4+Down focus down # # move windows to different workspaces # TODO switch to other screens bindsym Mod4+Shift+Left move workspace to output left bindsym Mod4+Shift+Right move workspace to output right #bindsym Mod4+Shift+Up move up #bindsym Mod4+Shift+Down move down # split in horizontal/vertical orientation bindsym Mod4+h split h bindsym Mod4+v split v # enter fullscreen mode for the focused container bindsym Mod4+f fullscreen # change container layout (stacked, tabbed, toggle split) bindsym Mod4+s layout stacking bindsym Mod4+w layout tabbed bindsym Mod4+e layout toggle split # toggle tiling / floating bindsym Mod4+Shift+space floating toggle # change focus between tiling / floating windows bindsym Mod4+space focus mode_toggle # focus the parent container bindsym Mod4+a focus parent # focus the child container bindsym Mod4+i focus child # switch to workspace bindsym Mod4+1 workspace 1 bindsym Mod4+2 workspace 2 bindsym Mod4+3 workspace 3 bindsym Mod4+4 workspace 4 bindsym Mod4+5 workspace 5 bindsym Mod4+6 workspace 6 bindsym Mod4+7 workspace 7 bindsym Mod4+8 workspace 8 bindsym Mod4+9 workspace 9 bindsym Mod4+0 workspace 10 # move focused container to workspace bindsym Mod4+Shift+1 move container to workspace 1 bindsym Mod4+Shift+2 move container to workspace 2 bindsym Mod4+Shift+3 move container to workspace 3 bindsym Mod4+Shift+4 move container to workspace 4 bindsym Mod4+Shift+5 move container to workspace 5 bindsym Mod4+Shift+6 move container to workspace 6 bindsym Mod4+Shift+7 move container to workspace 7 bindsym Mod4+Shift+8 move container to workspace 8 bindsym Mod4+Shift+9 move container to workspace 9 bindsym Mod4+Shift+0 move container to workspace 10 # quickly navigate back to previous window workspace_auto_back_and_forth yes # reload the configuration file bindsym Mod4+Shift+q reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym Mod4+Shift+y restart # exit i3 (logs you out of your X session) bindsym Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" # resize window (you can also use the mouse for that) mode "resize" { # These bindings trigger as soon as you enter the resize mode # Pressing left will shrink the window’s width. # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. bindsym n resize shrink width 10 px or 10 ppt bindsym r resize grow width 10 px or 10 ppt bindsym r resize shrink height 10 px or 10 ppt bindsym t resize grow height 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym Mod4+y mode "resize" # valid for my Thinkpad bindsym XF86ScreenSaver exec "i3lock -d -c 000000" bindsym XF86AudioMute exec "amixer sset PCM toggle" bindsym XF86AudioRaiseVolume exec "amixer set PCM 2%+" bindsym XF86AudioLowerVolume exec "amixer set PCM 2%-" bindsym XF86AudioNext exec "cmus-remote --next" bindsym XF86AudioPrev exec "cmus-remote --prev" bindsym XF86AudioPlay exec "cmus-remote --pause" bindsym XF86AudioStop exec "cmus-remote --stop" bindsym XF86Sleep exec "systemctl suspend" bindsym XF86WebCam exec "$HOME/bin/bluetooth-toggle.sh" bindsym XF86TouchpadToggle exec "$HOME/bin/touchpad-toggle.sh" # currently unused #bindsym XF86Tools exec "something" #bindsym XF86Calculator exec "something" #bindsym XF86Launch1 exec "something" # ThinkVantage #bindsym XF86Display exec "something" # fn - f7 # focus popular clients by title/class bindsym Mod4+Mod1+f [class="(?i)firefox"] focus bindsym Mod4+Mod1+t [class="(?i)thunderbird"] focus bindsym Mod4+Mod1+p [class="(?i)pidgin"] focus bindsym Mod4+Mod1+k [class="(?i)keepassx"] focus bindsym Mod4+Mod1+c [title="(?i)cmus"] focus bindsym Mod4+Mod1+n [title="(?i)newsbeuter"] focus bindsym Mod4+Mod1+j [title="(?i)jdownloader"] focus # colors # class border backgr. text indicator client.focused #4c7899 #285577 #ffffff #ff0000 client.focused_inactive #333333 #5f676a #ffffff #484e50 client.unfocused #333333 #222222 #888888 #292d2e client.urgent #2f343a #900000 #ffffff #900000 +# wallpaper +exec --no-startup-id feh --bg-scale "$HOME/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" + # The status bar bar { status_command i3status position top # use anothor font to get the separator in a different color font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 colors { statusline #00ff00 # color_class border backg. text focused_workspace #4c7899 #285577 #00ff00 active_workspace #333333 #5f676a #ffffff inactive_workspace #333333 #222222 #888888 urgent_workspace #2f343a #900000 #ffffff } }
nblock/config
439806aa59d27758e3fab2e1f17de4d215c45b00
Add i3 configuration.
diff --git a/config/i3/config b/config/i3/config new file mode 100644 index 0000000..481a7c5 --- /dev/null +++ b/config/i3/config @@ -0,0 +1,181 @@ +# i3 config file (v4) +# nblock (at) archlinux (dot) us +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +# window title font +font pango:Bitstream Vera Sans Mono 10 + +# use Mouse+Mod4 to drag floating windows to their wanted position +floating_modifier Mod4 + +# start a terminal +bindsym Mod4+Return exec urxvtc + +# kill focused window +bindsym Mod4+Shift+c kill + +# start dmenu (a program launcher) +bindsym Mod4+x exec "$HOME/bin/dmenu_multi" + +# change focus +bindsym Mod4+n focus left +bindsym Mod4+r focus right +bindsym Mod4+t focus up +bindsym Mod4+d focus down + +# move focused window +bindsym Mod4+Shift+n move left +bindsym Mod4+Shift+r move right +bindsym Mod4+Shift+t move up +bindsym Mod4+Shift+d move down + +# switch to next/prev workspace +# TODO switch to other screens +bindsym Mod4+Left workspace prev +bindsym Mod4+Right workspace next +#bindsym Mod4+Up focus up +#bindsym Mod4+Down focus down # + +# move windows to different workspaces +# TODO switch to other screens +bindsym Mod4+Shift+Left move workspace to output left +bindsym Mod4+Shift+Right move workspace to output right +#bindsym Mod4+Shift+Up move up +#bindsym Mod4+Shift+Down move down + +# split in horizontal/vertical orientation +bindsym Mod4+h split h +bindsym Mod4+v split v + +# enter fullscreen mode for the focused container +bindsym Mod4+f fullscreen + +# change container layout (stacked, tabbed, toggle split) +bindsym Mod4+s layout stacking +bindsym Mod4+w layout tabbed +bindsym Mod4+e layout toggle split + +# toggle tiling / floating +bindsym Mod4+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym Mod4+space focus mode_toggle + +# focus the parent container +bindsym Mod4+a focus parent + +# focus the child container +bindsym Mod4+i focus child + +# switch to workspace +bindsym Mod4+1 workspace 1 +bindsym Mod4+2 workspace 2 +bindsym Mod4+3 workspace 3 +bindsym Mod4+4 workspace 4 +bindsym Mod4+5 workspace 5 +bindsym Mod4+6 workspace 6 +bindsym Mod4+7 workspace 7 +bindsym Mod4+8 workspace 8 +bindsym Mod4+9 workspace 9 +bindsym Mod4+0 workspace 10 + +# move focused container to workspace +bindsym Mod4+Shift+1 move container to workspace 1 +bindsym Mod4+Shift+2 move container to workspace 2 +bindsym Mod4+Shift+3 move container to workspace 3 +bindsym Mod4+Shift+4 move container to workspace 4 +bindsym Mod4+Shift+5 move container to workspace 5 +bindsym Mod4+Shift+6 move container to workspace 6 +bindsym Mod4+Shift+7 move container to workspace 7 +bindsym Mod4+Shift+8 move container to workspace 8 +bindsym Mod4+Shift+9 move container to workspace 9 +bindsym Mod4+Shift+0 move container to workspace 10 + +# quickly navigate back to previous window +workspace_auto_back_and_forth yes + +# reload the configuration file +bindsym Mod4+Shift+q reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym Mod4+Shift+y restart +# exit i3 (logs you out of your X session) +bindsym Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym n resize shrink width 10 px or 10 ppt + bindsym r resize grow width 10 px or 10 ppt + bindsym r resize shrink height 10 px or 10 ppt + bindsym t resize grow height 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym Mod4+y mode "resize" + +# valid for my Thinkpad +bindsym XF86ScreenSaver exec "i3lock -d -c 000000" +bindsym XF86AudioMute exec "amixer sset PCM toggle" +bindsym XF86AudioRaiseVolume exec "amixer set PCM 2%+" +bindsym XF86AudioLowerVolume exec "amixer set PCM 2%-" +bindsym XF86AudioNext exec "cmus-remote --next" +bindsym XF86AudioPrev exec "cmus-remote --prev" +bindsym XF86AudioPlay exec "cmus-remote --pause" +bindsym XF86AudioStop exec "cmus-remote --stop" +bindsym XF86Sleep exec "systemctl suspend" +bindsym XF86WebCam exec "$HOME/bin/bluetooth-toggle.sh" +bindsym XF86TouchpadToggle exec "$HOME/bin/touchpad-toggle.sh" +# currently unused +#bindsym XF86Tools exec "something" +#bindsym XF86Calculator exec "something" +#bindsym XF86Launch1 exec "something" # ThinkVantage +#bindsym XF86Display exec "something" # fn - f7 + +# focus popular clients by title/class +bindsym Mod4+Mod1+f [class="(?i)firefox"] focus +bindsym Mod4+Mod1+t [class="(?i)thunderbird"] focus +bindsym Mod4+Mod1+p [class="(?i)pidgin"] focus +bindsym Mod4+Mod1+k [class="(?i)keepassx"] focus +bindsym Mod4+Mod1+c [title="(?i)cmus"] focus +bindsym Mod4+Mod1+n [title="(?i)newsbeuter"] focus +bindsym Mod4+Mod1+j [title="(?i)jdownloader"] focus + +# colors +# class border backgr. text indicator +client.focused #4c7899 #285577 #ffffff #ff0000 +client.focused_inactive #333333 #5f676a #ffffff #484e50 +client.unfocused #333333 #222222 #888888 #292d2e +client.urgent #2f343a #900000 #ffffff #900000 + +# The status bar +bar { + status_command i3status + position top + # use anothor font to get the separator in a different color + font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 + + colors { + statusline #00ff00 + + # color_class border backg. text + focused_workspace #4c7899 #285577 #00ff00 + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + } +} diff --git a/config/i3/run_in_terminal b/config/i3/run_in_terminal new file mode 100644 index 0000000..3403d5a --- /dev/null +++ b/config/i3/run_in_terminal @@ -0,0 +1,3 @@ +rtorrent +newsbeuter +cmus diff --git a/config/i3status/config b/config/i3status/config new file mode 100644 index 0000000..40c0f8d --- /dev/null +++ b/config/i3status/config @@ -0,0 +1,36 @@ +general { + output_format = i3bar + colors = true + interval = 5 +} + +order += "load" +order += "battery 0" +order += "cpu_temperature 0" +order += "volume master" +order += "time" + +load { + format = "load: %1min" +} + +cpu_temperature 0 { + format = "temp: %degrees °C" +} + +battery 0 { + format = "bat: %status %percentage %remaining" + threshold_type = "percentage" + low_threshold = 20 +} + +volume master { + format = "vol: %volume" + device = "default" + mixer = "PCM" + mixer_idx = 0 +} + +time { + format = "%a, %d.%m.%y %H:%M" +}
nblock/config
ea4cc0f5c45f9dd20d27029699bb74308afa444c
Remove awesome.
diff --git a/cmus/autosave b/cmus/autosave index a2071fa..abadec2 100644 --- a/cmus/autosave +++ b/cmus/autosave @@ -1,142 +1,158 @@ set aaa_mode=album set altformat_current= %F set altformat_playlist= %f%= %d set altformat_title=%f set altformat_trackwin= %f%= %d set auto_reshuffle=false set buffer_seconds=10 +set color_cmdline_attr=default set color_cmdline_bg=default set color_cmdline_fg=default +set color_cur_sel_attr=default set color_error=lightred set color_info=lightyellow set color_separator=green +set color_statusline_attr=default set color_statusline_bg=240 set color_statusline_fg=white +set color_titleline_attr=default set color_titleline_bg=240 set color_titleline_fg=white +set color_win_attr=default set color_win_bg=default set color_win_cur=gray +set color_win_cur_sel_attr=default set color_win_cur_sel_bg=166 set color_win_cur_sel_fg=237 set color_win_dir=blue set color_win_fg=yellow +set color_win_inactive_cur_sel_attr=default set color_win_inactive_cur_sel_bg=252 set color_win_inactive_cur_sel_fg=lightyellow +set color_win_inactive_sel_attr=default set color_win_inactive_sel_bg=252 set color_win_inactive_sel_fg=black +set color_win_sel_attr=default set color_win_sel_bg=237 set color_win_sel_fg=166 +set color_win_title_attr=default set color_win_title_bg=252 set color_win_title_fg=black set confirm_run=true set continue=true +set device=/dev/cdrom set display_artist_sort_name=false set dsp.alsa.device=default set dsp.ao.buffer_size=16384 set dsp.ao.driver= set dsp.ao.wav_counter=1 set dsp.ao.wav_dir=/home/flo set dsp.oss.device= set format_current= %a - [%02n] %t - %l [%y] %= %F set format_playlist= %-20a %02n. %t%= %y %d set format_playlist_va= %-20A %3n. %t (%a)%= %y %d set format_title=%a - %l - %t (%y) set format_trackwin= %02n. %t%= %y %d set format_trackwin_va=%3n. %t (%a)%= %y %d +set icecast_default_charset=ISO-8859-1 set id3_default_charset=ISO-8859-1 set lib_sort=artist album discnumber tracknumber title filename set mixer.alsa.channel=PCM set mixer.alsa.device=default set mixer.oss.channel=PCM set mixer.oss.device= set mixer.pulse.restore_volume=1 set output_plugin=alsa set passwd= set pl_sort= -set play_library=false +set play_library=true set play_sorted=true set repeat=true set repeat_current=false set replaygain=disabled set replaygain_limit=true set replaygain_preamp=6.000000 set resume=true +set scroll_offset=2 set set_term_title=false +set show_current_bitrate=false set show_hidden=false -set show_remaining_time=true +set show_remaining_time=false set shuffle=true +set skip_track_info=false set smart_artist_sort=true set softvol=false set softvol_state=100 100 set status_display_program=/home/flo/development/cmus-notify/cmus-notify +set wrap_search=true bind browser backspace browser-up bind browser i toggle show_hidden bind common + vol +10% bind common , seek -1m bind common - vol -10% bind common . seek +1m bind common 1 view tree bind common 2 view sorted bind common 3 view playlist bind common 4 view queue bind common 5 view browser bind common 6 view filters bind common 7 view settings bind common = vol +10% bind common C toggle continue bind common D win-remove bind common E win-add-Q bind common G win-bottom bind common I echo {} bind common L push live-filter bind common M toggle play_library bind common N search-prev bind common P win-mv-before bind common [ vol +1 +0 bind common ] vol +0 +1 bind common ^B win-page-up bind common ^C echo Type :quit<enter> to exit cmus. bind common ^F win-page-down bind common ^L refresh bind common a win-add-l bind common b player-next bind common c player-pause bind common delete win-remove bind common down win-down bind common e win-add-q bind common end win-bottom bind common enter win-activate bind common g win-top bind common h seek -5 bind common home win-top bind common i win-sel-cur bind common j win-down bind common k win-up bind common l seek +5 bind common left seek -5 bind common m toggle aaa_mode bind common n search-next bind common o toggle play_sorted bind common p win-mv-after bind common page_down win-page-down bind common page_up win-page-up bind common r toggle repeat bind common right seek +5 bind common s toggle shuffle bind common space win-toggle bind common t toggle show_remaining_time bind common tab win-next bind common u win-update bind common up win-up bind common v player-stop bind common x player-play bind common y win-add-p bind common z player-prev bind common { vol -1 -0 bind common } vol -0 -1 fset 90s=date>=1990&date<2000 fset missing-tag=!~T fset mp3=filename="*.mp3" fset ogg=filename="*.ogg" fset ogg-or-mp3=ogg|mp3 factivate diff --git a/config/awesome/icons/LICENSE b/config/awesome/icons/LICENSE deleted file mode 100644 index ce5da9d..0000000 --- a/config/awesome/icons/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -All 'awesome' icons in this package were created by Adrian C. (anrxc). -They are licensed under the same terms as the awesome distribution itself -- GNU General Public License version 2. To view a human-readable summary -of this license, visit: http://creativecommons.org/licenses/GPL/2.0/ - -The widget icons with the exception of: 'chat', 'crypt', 'power' and -'rss' icons (which were made by me) were originally made by 'sm4tik' -for purposes of 'dzen', I could not find any licensing information -attached to those original bitmaps. Assuming they are in the public -domain I am licensing the widget icons under the terms of the -Creative Commons Attribution-Share Alike license. To view a copy of -this license, visit: http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/config/awesome/icons/layouts/dwindle.png b/config/awesome/icons/layouts/dwindle.png deleted file mode 100644 index 1aa4bf2..0000000 Binary files a/config/awesome/icons/layouts/dwindle.png and /dev/null differ diff --git a/config/awesome/icons/layouts/fairh.png b/config/awesome/icons/layouts/fairh.png deleted file mode 100644 index e176bb3..0000000 Binary files a/config/awesome/icons/layouts/fairh.png and /dev/null differ diff --git a/config/awesome/icons/layouts/fairv.png b/config/awesome/icons/layouts/fairv.png deleted file mode 100644 index 7c0a92c..0000000 Binary files a/config/awesome/icons/layouts/fairv.png and /dev/null differ diff --git a/config/awesome/icons/layouts/floating.png b/config/awesome/icons/layouts/floating.png deleted file mode 100644 index a399092..0000000 Binary files a/config/awesome/icons/layouts/floating.png and /dev/null differ diff --git a/config/awesome/icons/layouts/fullscreen.png b/config/awesome/icons/layouts/fullscreen.png deleted file mode 100644 index a0c795c..0000000 Binary files a/config/awesome/icons/layouts/fullscreen.png and /dev/null differ diff --git a/config/awesome/icons/layouts/magnifier.png b/config/awesome/icons/layouts/magnifier.png deleted file mode 100644 index bca6db9..0000000 Binary files a/config/awesome/icons/layouts/magnifier.png and /dev/null differ diff --git a/config/awesome/icons/layouts/max.png b/config/awesome/icons/layouts/max.png deleted file mode 100644 index 96a237a..0000000 Binary files a/config/awesome/icons/layouts/max.png and /dev/null differ diff --git a/config/awesome/icons/layouts/spiral.png b/config/awesome/icons/layouts/spiral.png deleted file mode 100644 index 8f5aeed..0000000 Binary files a/config/awesome/icons/layouts/spiral.png and /dev/null differ diff --git a/config/awesome/icons/layouts/tile.png b/config/awesome/icons/layouts/tile.png deleted file mode 100644 index 3fcc904..0000000 Binary files a/config/awesome/icons/layouts/tile.png and /dev/null differ diff --git a/config/awesome/icons/layouts/tilebottom.png b/config/awesome/icons/layouts/tilebottom.png deleted file mode 100644 index dfe7832..0000000 Binary files a/config/awesome/icons/layouts/tilebottom.png and /dev/null differ diff --git a/config/awesome/icons/layouts/tileleft.png b/config/awesome/icons/layouts/tileleft.png deleted file mode 100644 index c5decfd..0000000 Binary files a/config/awesome/icons/layouts/tileleft.png and /dev/null differ diff --git a/config/awesome/icons/layouts/tiletop.png b/config/awesome/icons/layouts/tiletop.png deleted file mode 100644 index b251661..0000000 Binary files a/config/awesome/icons/layouts/tiletop.png and /dev/null differ diff --git a/config/awesome/icons/taglist/squarefz.png b/config/awesome/icons/taglist/squarefz.png deleted file mode 100644 index 0927720..0000000 Binary files a/config/awesome/icons/taglist/squarefz.png and /dev/null differ diff --git a/config/awesome/icons/taglist/squarez.png b/config/awesome/icons/taglist/squarez.png deleted file mode 100644 index 9b41c26..0000000 Binary files a/config/awesome/icons/taglist/squarez.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/close_focus.png b/config/awesome/icons/titlebar/close_focus.png deleted file mode 100644 index 02565b9..0000000 Binary files a/config/awesome/icons/titlebar/close_focus.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/close_normal.png b/config/awesome/icons/titlebar/close_normal.png deleted file mode 100644 index 1a52f0e..0000000 Binary files a/config/awesome/icons/titlebar/close_normal.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/floating_focus_active.png b/config/awesome/icons/titlebar/floating_focus_active.png deleted file mode 100644 index 63d900b..0000000 Binary files a/config/awesome/icons/titlebar/floating_focus_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/floating_focus_inactive.png b/config/awesome/icons/titlebar/floating_focus_inactive.png deleted file mode 100644 index 6a16857..0000000 Binary files a/config/awesome/icons/titlebar/floating_focus_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/floating_normal_active.png b/config/awesome/icons/titlebar/floating_normal_active.png deleted file mode 100644 index 2442274..0000000 Binary files a/config/awesome/icons/titlebar/floating_normal_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/floating_normal_inactive.png b/config/awesome/icons/titlebar/floating_normal_inactive.png deleted file mode 100644 index 78487d7..0000000 Binary files a/config/awesome/icons/titlebar/floating_normal_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/maximized_focus_active.png b/config/awesome/icons/titlebar/maximized_focus_active.png deleted file mode 100644 index 834f106..0000000 Binary files a/config/awesome/icons/titlebar/maximized_focus_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/maximized_focus_inactive.png b/config/awesome/icons/titlebar/maximized_focus_inactive.png deleted file mode 100644 index 34f0fce..0000000 Binary files a/config/awesome/icons/titlebar/maximized_focus_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/maximized_normal_active.png b/config/awesome/icons/titlebar/maximized_normal_active.png deleted file mode 100644 index 19ce21b..0000000 Binary files a/config/awesome/icons/titlebar/maximized_normal_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/maximized_normal_inactive.png b/config/awesome/icons/titlebar/maximized_normal_inactive.png deleted file mode 100644 index 76a1ab7..0000000 Binary files a/config/awesome/icons/titlebar/maximized_normal_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/ontop_focus_active.png b/config/awesome/icons/titlebar/ontop_focus_active.png deleted file mode 100644 index 776d586..0000000 Binary files a/config/awesome/icons/titlebar/ontop_focus_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/ontop_focus_inactive.png b/config/awesome/icons/titlebar/ontop_focus_inactive.png deleted file mode 100644 index 6f96fad..0000000 Binary files a/config/awesome/icons/titlebar/ontop_focus_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/ontop_normal_active.png b/config/awesome/icons/titlebar/ontop_normal_active.png deleted file mode 100644 index 8d10c9b..0000000 Binary files a/config/awesome/icons/titlebar/ontop_normal_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/ontop_normal_inactive.png b/config/awesome/icons/titlebar/ontop_normal_inactive.png deleted file mode 100644 index 2b949a1..0000000 Binary files a/config/awesome/icons/titlebar/ontop_normal_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/sticky_focus_active.png b/config/awesome/icons/titlebar/sticky_focus_active.png deleted file mode 100644 index 1726f90..0000000 Binary files a/config/awesome/icons/titlebar/sticky_focus_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/sticky_focus_inactive.png b/config/awesome/icons/titlebar/sticky_focus_inactive.png deleted file mode 100644 index 09837c8..0000000 Binary files a/config/awesome/icons/titlebar/sticky_focus_inactive.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/sticky_normal_active.png b/config/awesome/icons/titlebar/sticky_normal_active.png deleted file mode 100644 index b0dd58e..0000000 Binary files a/config/awesome/icons/titlebar/sticky_normal_active.png and /dev/null differ diff --git a/config/awesome/icons/titlebar/sticky_normal_inactive.png b/config/awesome/icons/titlebar/sticky_normal_inactive.png deleted file mode 100644 index ab08c92..0000000 Binary files a/config/awesome/icons/titlebar/sticky_normal_inactive.png and /dev/null differ diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua deleted file mode 100644 index d61cc63..0000000 --- a/config/awesome/rc.lua +++ /dev/null @@ -1,536 +0,0 @@ --- {{{ License --- rc.lua, works with awesome 3.5 on Arch Linux --- author: nblock <nblock [at] archlinux.us> --- based on multiple rc.lua files from different awesome users --- --- This work is licensed under the Creative Commons Attribution Share --- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ --- }}} - --- {{{ Load libraries --- Standard awesome library -local gears = require("gears") -local awful = require("awful") -awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") --- Widget and layout library -local wibox = require("wibox") --- Theme handling library -local beautiful = require("beautiful") --- Notification library -local naughty = require("naughty") -local menubar = require("menubar") -local vicious = require("vicious") - --- local variables -local home = os.getenv("HOME") -local exec = awful.util.spawn -local sexec = awful.util.spawn_with_shell ---}}} - --- {{{ Error handling --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} - --- {{{ Modkey and default layout --- Themes define colours, icons, and wallpapers ---beautiful.init("/usr/share/awesome/themes/default/theme.lua") -beautiful.init(home .. "/.config/awesome/zenburn.lua") - --- This is used later as the default terminal and editor to run. -terminal = "urxvtc" -editor = "vim" -shell = "/bin/zsh" -editor_cmd = terminal .. " -e " .. editor - --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- If you do not like this or do not have such a key, --- I suggest you to remap Mod4 to another key using xmodmap or other tools. --- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" - --- Table of layouts to cover with awful.layout.inc, order matters. -local layouts = -{ - awful.layout.suit.floating, - awful.layout.suit.tile, - awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.tile.top, - awful.layout.suit.fair, - awful.layout.suit.fair.horizontal, - awful.layout.suit.spiral, - awful.layout.suit.spiral.dwindle, - awful.layout.suit.max, - awful.layout.suit.max.fullscreen, - awful.layout.suit.magnifier -} --- }}} - --- {{{ Wallpaper -if beautiful.wallpaper then - for s = 1, screen.count() do - gears.wallpaper.maximized(beautiful.wallpaper, s, true) - end -end --- }}} - --- {{{ Tags --- Define a tag table which hold all screen tags. -tags = {} -for s = 1, screen.count() do - -- Each screen has its own tag table. - tags[s] = awful.tag({ - "1 download", "2 mail", "3 chat", - "4 music", "5 news", "6 web", - 7, 8, 9 }, s, - {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 - layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 - layouts[2], layouts[2], layouts[2] -- 7, 8, 9 - }) -end --- }}} - --- {{{ Menu --- Create a laucher widget and a main menu -myawesomemenu = { - { "manual", terminal .. " -e man awesome" }, - { "edit config", editor_cmd .. " " .. awesome.conffile }, - { "restart", awesome.restart }, - { "quit", awesome.quit } -} - -mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal } - } - }) - --- Menubar configuration -menubar.utils.terminal = terminal -- Set the terminal for applications that require it --- }}} - --- {{{ Wibox --- Seperator -local separator = wibox.widget.textbox() -separator:set_markup(" <span foreground='red'>•</span> ") - --- cmus widget (global, to access it via cmus-notify) -cmuswidget = wibox.widget.textbox() -cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='#00FF00'>-</span>") - --- Date and time -local datewidget = wibox.widget.textbox() -vicious.register(datewidget, vicious.widgets.date, "<span foreground='#00FF00'>%a, %d.%m.%y - %H:%M</span>", 60) - --- CPU load -local cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='#00FF00'>$2%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$3%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$4%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$5%</span>") - --- CPU temperature -local thermalwidget = wibox.widget.textbox() -vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='#00FF00'>$1°C</span>", 20, "thermal_zone0") - --- Battery state -local batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='#00FF00'>$1$2%</span>", 60, "BAT0") - --- Volume widget -local volwidget = wibox.widget.textbox() -vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='#00FF00'>$1%</span>", 1, 'PCM') - --- Create a wibox for each screen and add it -mywibox = {} -mypromptbox = {} -mylayoutbox = {} -mytaglist = {} -mytaglist.buttons = awful.util.table.join( - awful.button({ }, 1, awful.tag.viewonly), - awful.button({ modkey }, 1, awful.client.movetotag), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, awful.client.toggletag), - awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) - ) -mytasklist = {} -mytasklist.buttons = awful.util.table.join( - awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - -- Without this, the following - -- :isvisible() makes no sense - c.minimized = false - if not c:isvisible() then - awful.tag.viewonly(c:tags()[1]) - end - -- This will also un-minimize - -- the client, if needed - client.focus = c - c:raise() - end - end), - awful.button({ }, 3, function () - if instance then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ width=250 }) - end - end), - awful.button({ }, 4, function () - awful.client.focus.byidx(1) - if client.focus then client.focus:raise() end - end), - awful.button({ }, 5, function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end)) - -for s = 1, screen.count() do - -- Create a promptbox for each screen - mypromptbox[s] = awful.widget.prompt() - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - mylayoutbox[s] = awful.widget.layoutbox(s) - mylayoutbox[s]:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), - awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) - -- Create a taglist widget - mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) - - -- Create a tasklist widget - mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - - -- Create the wibox - mywibox[s] = awful.wibox({ position = "top", screen = s }) - - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(mylayoutbox[s]) - left_layout:add(mytaglist[s]) - left_layout:add(mypromptbox[s]) - - -- Widgets that are aligned to the right - local right_layout = wibox.layout.fixed.horizontal() - right_layout:add(cmuswidget) - right_layout:add(separator) - right_layout:add(cpuwidget) - right_layout:add(separator) - right_layout:add(thermalwidget) - right_layout:add(separator) - right_layout:add(batwidget) - right_layout:add(separator) - right_layout:add(volwidget) - right_layout:add(separator) - right_layout:add(datewidget) - if s == screen.count() then right_layout:add(wibox.widget.systray()) end - - -- Now bring it all together (with the tasklist in the middle) - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_middle(mytasklist[s]) - layout:set_right(right_layout) - - mywibox[s]:set_widget(layout) -end --- }}} - --- {{{ Mouse bindings -root.buttons(awful.util.table.join( - awful.button({ }, 3, function () mymainmenu:toggle() end), - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) -)) --- }}} - --- {{{ Key bindings -globalkeys = awful.util.table.join( - -- key bindings for fn keys - awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), - awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), - awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), - awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), - awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), - awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), - awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up - awful.key({}, "XF86Tools", function() sexec("") end ), - awful.key({}, "XF86Calculator", function() sexec("") end ), - awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage - awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 - awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 - awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 - awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 - awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 - - -- default keybindings - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - - awful.key({ modkey, }, "n", - function () - awful.client.focus.byidx( 1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "w", function () mymainmenu:show() end), - - -- Layout manipulation - awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end), - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, "Control" }, "r", awesome.restart), - awful.key({ modkey, "Shift" }, "q", awesome.quit), - - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), - awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), - - awful.key({ modkey, "Control" }, "n", awful.client.restore), - - -- Prompt - awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), - - awful.key({ modkey, "Shift" }, "x", - function () - awful.prompt.run({ prompt = "Run Lua code: " }, - mypromptbox[mouse.screen].widget, - awful.util.eval, nil, - awful.util.getdir("cache") .. "/history_eval") - end), - - -- Run stuff in a Terminal - awful.key({ modkey }, "x", - function () - awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, - function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) - end), - - -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end) -) - -clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), - awful.key({ modkey, }, "o", awful.client.movetoscreen ), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end), - awful.key({ modkey, }, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c.maximized_vertical = not c.maximized_vertical - end) -) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)) -end - --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, keynumber do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) - end - end)) -end - -clientbuttons = awful.util.table.join( - awful.button({ }, 1, function (c) client.focus = c; c:raise() end), - awful.button({ modkey }, 1, awful.mouse.client.move), - awful.button({ modkey }, 3, awful.mouse.client.resize)) - --- Set keys -root.keys(globalkeys) --- }}} - --- {{{ Rules -awful.rules.rules = { - -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - keys = clientkeys, - buttons = clientbuttons } }, - --floating apps - { rule = { class = "pinentry-qt4" }, - properties = { floating = true } }, - { rule = { class = "pinentry-gtk-2" }, - properties = { floating = true } }, - { rule = { class = "Gimp" }, - properties = { floating = true } }, - --apptags - { rule = { class = "JDownloader" }, - properties = { tag = tags[screen.count()][1],switchtotag = false } }, - { rule = { instance = "rtorrent" }, - properties = { tag = tags[screen.count()][1],switchtotag = false } }, - -- mail - { rule = { class = "Thunderbird" }, - properties = { tag = tags[screen.count()][2],switchtotag = false } }, - --pidgin - { rule = { class = "Pidgin" }, - properties = { tag = tags[1][3],switchtotag = false } }, - -- cmus - { rule = { instance = "cmus" }, - properties = { tag = tags[screen.count()][4],switchtotag = false } }, - -- news - { rule = { instance = "newsbeuter" }, - properties = { tag = tags[screen.count()][5],switchtotag = false } }, -} --- }}} - --- {{{ Signals --- Signal function to execute when a new client appears. -client.connect_signal("manage", function (c, startup) - -- Add a titlebar - -- awful.titlebar.add(c, { modkey = modkey }) - -- remove gaps - c.size_hints_honor = false - -- Enable sloppy focus - c:connect_signal("mouse::enter", function(c) - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end - end) - - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if not c.size_hints.user_position and not c.size_hints.program_position then - awful.placement.no_overlap(c) - awful.placement.no_offscreen(c) - end - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- Widgets that are aligned to the right - local right_layout = wibox.layout.fixed.horizontal() - right_layout:add(awful.titlebar.widget.floatingbutton(c)) - right_layout:add(awful.titlebar.widget.maximizedbutton(c)) - right_layout:add(awful.titlebar.widget.stickybutton(c)) - right_layout:add(awful.titlebar.widget.ontopbutton(c)) - right_layout:add(awful.titlebar.widget.closebutton(c)) - - -- The title goes in the middle - local title = awful.titlebar.widget.titlewidget(c) - title:buttons(awful.util.table.join( - awful.button({ }, 1, function() - client.focus = c - c:raise() - awful.mouse.client.move(c) - end), - awful.button({ }, 3, function() - client.focus = c - c:raise() - awful.mouse.client.resize(c) - end) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) - end -end) - -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) --- }}} - --- {{{ Autostart -os.execute("blueman-applet &") --- }}} - --- vim: fdm=marker fdl=0 sts=4 ai diff --git a/config/awesome/zenburn.lua b/config/awesome/zenburn.lua deleted file mode 100644 index 88345d0..0000000 --- a/config/awesome/zenburn.lua +++ /dev/null @@ -1,149 +0,0 @@ -------------------------------- --- "Zenburn" awesome theme -- --- By Adrian C. (anrxc) -- -------------------------------- - --- Alternative icon sets and widget icons: --- * http://awesome.naquadah.org/wiki/Nice_Icons - --- {{{ Required libraries -local awful = require("awful") --- }}} - --- {{{ Main -theme = {} -theme._icondir = awful.util.getdir("config") .. "/icons" -theme.wallpaper = os.getenv("HOME") .. "/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" --- }}} - --- {{{ Styles -theme.font = "sans 8" - --- {{{ Colors -theme.fg_normal = "#DCDCCC" -theme.fg_focus = "#00FF00" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#3F3F3F" -theme.bg_systray = theme.bg_normal --- }}} - --- {{{ Borders -theme.border_width = "1" -theme.border_normal = "#3F3F3F" -theme.border_focus = "#FF0000" -theme.border_marked = "#CC9393" --- }}} - --- {{{ Titlebars -theme.titlebar_bg_focus = "#3F3F3F" -theme.titlebar_bg_normal = "#3F3F3F" -theme.titlebar_widget_height = "16" --- }}} - --- There are other variable sets --- overriding the default one when --- defined, the sets are: --- [taglist|tasklist]_[bg|fg]_[focus|urgent] --- titlebar_[normal|focus] --- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- Example: ---theme.taglist_bg_focus = "#CC9393" --- }}} - --- {{{ Widgets --- You can add as many variables as --- you wish and access them by using --- beautiful.variable in your rc.lua ---theme.fg_widget = "#AECF96" ---theme.fg_center_widget = "#88A175" ---theme.fg_end_widget = "#FF5656" ---theme.bg_widget = "#494B4F" ---theme.border_widget = "#3F3F3F" --- }}} - --- {{{ Mouse finder -theme.mouse_finder_color = "#CC9393" --- mouse_finder_[timeout|animate_timeout|radius|factor] --- }}} - --- {{{ Menu --- Variables set for theming the menu: --- menu_[bg|fg]_[normal|focus] --- menu_[border_color|border_width] -theme.menu_height = "16" -theme.menu_width = "100" --- }}} - --- {{{ Icons --- {{{ Taglist -theme.taglist_squares_sel = "/usr/share/awesome/themes/zenburn/taglist/squarefz.png" -theme.taglist_squares_unsel = "/usr/share/awesome/themes/zenburn/taglist/squarez.png" ---theme.taglist_squares_resize = "false" --- }}} - --- {{{ Misc -theme.awesome_icon = "/usr/share/awesome/themes/zenburn/awesome-icon.png" -theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" -theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" --- }}} - --- {{{ Layout icons -theme.layout_tile = theme._icondir .. "/layouts/tile.png" -theme.layout_tileleft = theme._icondir .. "/layouts/tileleft.png" -theme.layout_tilebottom = theme._icondir .. "/layouts/tilebottom.png" -theme.layout_tiletop = theme._icondir .. "/layouts/tiletop.png" -theme.layout_fairv = theme._icondir .. "/layouts/fairv.png" -theme.layout_fairh = theme._icondir .. "/layouts/fairh.png" -theme.layout_spiral = theme._icondir .. "/layouts/spiral.png" -theme.layout_dwindle = theme._icondir .. "/layouts/dwindle.png" -theme.layout_max = theme._icondir .. "/layouts/max.png" -theme.layout_fullscreen = theme._icondir .. "/layouts/fullscreen.png" -theme.layout_magnifier = theme._icondir .. "/layouts/magnifier.png" -theme.layout_floating = theme._icondir .. "/layouts/floating.png" --- }}} - --- {{{ Widget icons -theme.widget_cpu = theme._icondir .. "/taskbar/cpu.png" -theme.widget_bat = theme._icondir .. "/taskbar/bat.png" -theme.widget_mem = theme._icondir .. "/taskbar/mem.png" -theme.widget_fs = theme._icondir .. "/taskbar/disk.png" -theme.widget_net = theme._icondir .. "/taskbar/down.png" -theme.widget_netup = theme._icondir .. "/taskbar/up.png" -theme.widget_wifi = theme._icondir .. "/taskbar/wifi.png" -theme.widget_mail = theme._icondir .. "/taskbar/mail.png" -theme.widget_vol = theme._icondir .. "/taskbar/vol.png" -theme.widget_org = theme._icondir .. "/taskbar/cal.png" -theme.widget_date = theme._icondir .. "/taskbar/time.png" -theme.widget_crypto = theme._icondir .. "/taskbar/crypto.png" -theme.widget_sep = theme._icondir .. "/taskbar/separator.png" --- }}} - --- {{{ Titlebar icons -theme.titlebar_close_button_focus = theme._icondir .. "/titlebar/close_focus.png" -theme.titlebar_close_button_normal = theme._icondir .. "/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = theme._icondir .. "/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = theme._icondir .. "/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = theme._icondir .. "/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = theme._icondir .. "/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = theme._icondir .. "/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = theme._icondir .. "/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = theme._icondir .. "/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = theme._icondir .. "/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = theme._icondir .. "/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = theme._icondir .. "/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = theme._icondir .. "/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = theme._icondir .. "/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = theme._icondir .. "/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = theme._icondir .. "/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_inactive = theme._icondir .. "/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_inactive = theme._icondir .. "/titlebar/maximized_normal_inactive.png" --- }}} --- }}} - -return theme
nblock/config
b89ff1d1badfc6ba4675d779a4e6cc26708a85b3
Add dmenu_multi and newsbeuter_links.
diff --git a/bin/dmenu_multi b/bin/dmenu_multi new file mode 100755 index 0000000..0390dde --- /dev/null +++ b/bin/dmenu_multi @@ -0,0 +1,17 @@ +#!/bin/sh +cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} +if [ -d "$cachedir" ]; then + cache=$cachedir/dmenu_run +else + cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ +fi +APP=$( + IFS=: + if stest -dqr -n "$cache" $PATH; then + stest -flx $PATH | sort -u | tee "$cache" | dmenu "$@" + else + dmenu "$@" < "$cache" + fi +) + +grep -q -w "$APP" "$HOME/.config/i3/run_in_terminal" && urxvtc -e $APP || echo $APP | ${SHELL:-"$SHELL"} & diff --git a/bin/newsbeuter_links b/bin/newsbeuter_links new file mode 100755 index 0000000..38b1f52 --- /dev/null +++ b/bin/newsbeuter_links @@ -0,0 +1,9 @@ +#!/bin/sh +#FF3.5 (requires config: browser.tabs.loadDivertedInBackground to be 'true') + +if echo "$1" | grep -e jpg$ -e jpeg$ -e gif$ -e png$ +then + feh "$1" & +else + firefox "$1" +fi
nblock/config
c0349e3ab2117c5bb617e228ff4ce3ee08caf2e6
Switch to i3wm.
diff --git a/xinitrc b/xinitrc index 88709ad..d3031f4 100644 --- a/xinitrc +++ b/xinitrc @@ -1,8 +1,8 @@ #!/bin/sh eval "$(gpg-agent --daemon --enable-ssh-support)" urxvtd -q -f -o xrdb -load ~/.Xresources xmodmap .Xmodmap & setxkbmap -layout de -variant neo nm-applet --sm-disable & -exec dbus-launch awesome +exec i3
nblock/config
a7eca0aa883e63bf2c729f8cdbb3a42357a4ac54
Add smartcase and restore_view to vim.
diff --git a/vimrc b/vimrc index df4536b..6da678d 100644 --- a/vimrc +++ b/vimrc @@ -1,212 +1,215 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs +set ignorecase " ignore the case on searches +set smartcase " lowerspace search will ignore case, uppercase will honor the case set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' Bundle 'vim-scripts/AutoTag' +Bundle 'vim-scripts/restore_view.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> map <leader>cf [[kV][,c<space><CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" let g:UltiSnipsDontReverseSearchPath="1" let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] py import sys; sys.path.append("/home/flo/.vim/nblock-snippets") "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 " tagbar latex support let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } " tagbar mediawiki support autocmd FileType mediawiki :!ctags % let g:tagbar_type_mediawiki = { \ 'ctagstype' : 'mediawiki', \ 'kinds' : [ \ 'h:header', \ ], \ 'sort' : 0 \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
ac05fd625c1979ae20c0bef0cd705d19138fb076
Do not set title in uxrvtc.
diff --git a/Xdefaults b/Xdefaults index 4692d41..86a3a06 100644 --- a/Xdefaults +++ b/Xdefaults @@ -1,30 +1,29 @@ !URxvt settings !!--[Urxvt Options]--! -URxvt*title: urxvtc URxvt*termName: rxvt-unicode-256color URxvt*cursorBlink: true URxvt*urgentOnBell: true URxvt*scrollBar: false URxvt*boldMode: false URxvt*imLocale: de_AT.UTF-8 URxvt*loginShell: true URxvt*borderless: false URxvt*jumpScroll: true URxvt*saveLines: 5000 URxvt*transparent: false URxvt*fading: 0% URxvt*scrollTtyKeypress:true URxvt*internalBorder: 0 URxvt*utf8: 1 !--[Urls /launching/marking/yanking]--! URxvt*perl-ext: default,matcher URxvt*url-launcher: /usr/bin/firefox URxvt*matcher.button: 1 URxvt*matcher.pattern.1:\\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-] !--[Fonts]--! URxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13:antialias=false URxvt*italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true:antialias=false URxvt*boldFont: xft:Bitstream Vera Sans Mono:bold:autohint=true:antialias=false URxvt*boldItalicFont: xft:Bitstream Vera Sans Mono:bold:italic:autohint=true:antialias=false
nblock/config
a1c4a17b0ec47f1355433f04e1eda32d82b6ee54
Revert "use tor directly"
diff --git a/config/newsbeuter/config b/config/newsbeuter/config index 1024684..49168f5 100644 --- a/config/newsbeuter/config +++ b/config/newsbeuter/config @@ -1,83 +1,84 @@ #newsbeuter 2.4 config - notizblock #color <element> <foreground color> <background color> [<attribute> ...] color listnormal yellow default color listfocus color166 color237 bold color info color237 color250 color background red default color article yellow default -#newsbeuter via tor + +#newsbeuter via proxy +#in this case -> polipo (tor) use-proxy yes -proxy-type socks5 -proxy localhost:9050 +proxy localhost:8118 download-retries 4 download-timeout 30 #reload stuff reload-threads 10 #parallel reload threads. auto-reload yes #auto reload stuff reload-time 20 #min refresh-on-startup yes #use this useragent to get osvdb feed user-agent "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)" #various max-items 200 #number of feeds to hold in db goto-next-feed yes #FF3.5 (requires config: browser.tabs.loadDivertedInBackground to be 'true') browser "firefox -new-tab %u > /dev/null 2>&1" cleanup-on-quit yes #cleanup is always nice #visibility of feeds show-read-feeds no #list read feeds ? show-read-articles no #list read articles ? #files (~/.local/share/newsbeuter and ~/.config/newsbeuter) save-path "~/" #where to save feeds #kill files ignore-article "*" "title =~ \"CSI\"" ignore-article "*" "title =~ \"more rss feeds from\"" ignore-article "*" "title =~ \"[iI]P[ao]d\"" ignore-article "*" "title =~ \"iPhone\"" ignore-article "*" "title =~ \"Windows Phone 7\"" ignore-article "*" "title =~ \"Alm\"" ignore-article "http://lwn.net/headlines/rss" "title =~ \"\[\$\]\"" #key bindings bind-key c next-unread-feed bind-key x prev-unread-feed bind-key m toggle-article-read bind-key ^B pageup bind-key ^F pagedown bind-key H pageup bind-key L pagedown bind-key k up bind-key j down bind-key d save bind-key s sort bind-key S revsort bind-key O open-in-browser bind-key o open-in-browser-and-mark-read bind-key b bookmark #bookmark bookmark-cmd "~/bin/instapaper.py" #layout datetime-format "%d.%m %H:%M" text-width 0 #max text width to render html display-article-progress yes show-keymap-hint no #keyboard hints ? always-display-description true #feedlist-format "%4i %n %11u %t article-sort-order date # parameter syntax: <sortfield>[-<direction>] articlelist-format "%4i %f %D %?T?|%-17T| ?%t" #always download this feed -> ignore last-modification timestamp always-download "http://www.movie-blog.org/feed/rss" #reset unread flag when feed gets updated after reading reset-unread-on-update "http://blog.fefe.de/rss.xml?html"
nblock/config
bc1072dab9c5bb890328ef69e6ad66311aa1322a
use tor directly
diff --git a/config/newsbeuter/config b/config/newsbeuter/config index 49168f5..1024684 100644 --- a/config/newsbeuter/config +++ b/config/newsbeuter/config @@ -1,84 +1,83 @@ #newsbeuter 2.4 config - notizblock #color <element> <foreground color> <background color> [<attribute> ...] color listnormal yellow default color listfocus color166 color237 bold color info color237 color250 color background red default color article yellow default - -#newsbeuter via proxy -#in this case -> polipo (tor) +#newsbeuter via tor use-proxy yes -proxy localhost:8118 +proxy-type socks5 +proxy localhost:9050 download-retries 4 download-timeout 30 #reload stuff reload-threads 10 #parallel reload threads. auto-reload yes #auto reload stuff reload-time 20 #min refresh-on-startup yes #use this useragent to get osvdb feed user-agent "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)" #various max-items 200 #number of feeds to hold in db goto-next-feed yes #FF3.5 (requires config: browser.tabs.loadDivertedInBackground to be 'true') browser "firefox -new-tab %u > /dev/null 2>&1" cleanup-on-quit yes #cleanup is always nice #visibility of feeds show-read-feeds no #list read feeds ? show-read-articles no #list read articles ? #files (~/.local/share/newsbeuter and ~/.config/newsbeuter) save-path "~/" #where to save feeds #kill files ignore-article "*" "title =~ \"CSI\"" ignore-article "*" "title =~ \"more rss feeds from\"" ignore-article "*" "title =~ \"[iI]P[ao]d\"" ignore-article "*" "title =~ \"iPhone\"" ignore-article "*" "title =~ \"Windows Phone 7\"" ignore-article "*" "title =~ \"Alm\"" ignore-article "http://lwn.net/headlines/rss" "title =~ \"\[\$\]\"" #key bindings bind-key c next-unread-feed bind-key x prev-unread-feed bind-key m toggle-article-read bind-key ^B pageup bind-key ^F pagedown bind-key H pageup bind-key L pagedown bind-key k up bind-key j down bind-key d save bind-key s sort bind-key S revsort bind-key O open-in-browser bind-key o open-in-browser-and-mark-read bind-key b bookmark #bookmark bookmark-cmd "~/bin/instapaper.py" #layout datetime-format "%d.%m %H:%M" text-width 0 #max text width to render html display-article-progress yes show-keymap-hint no #keyboard hints ? always-display-description true #feedlist-format "%4i %n %11u %t article-sort-order date # parameter syntax: <sortfield>[-<direction>] articlelist-format "%4i %f %D %?T?|%-17T| ?%t" #always download this feed -> ignore last-modification timestamp always-download "http://www.movie-blog.org/feed/rss" #reset unread flag when feed gets updated after reading reset-unread-on-update "http://blog.fefe.de/rss.xml?html"
nblock/config
8cd14b4893c2ee9474a655411cc924971c79e4f2
use a lighter green
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 4a14c02..d61cc63 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,536 +1,536 @@ -- {{{ License -- rc.lua, works with awesome 3.5 on Arch Linux -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") awful.autofocus = require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") local vicious = require("vicious") -- local variables local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell --}}} -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) if awesome.startup_errors then naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, there were errors during startup!", text = awesome.startup_errors }) end -- Handle runtime errors after startup do local in_error = false awesome.connect_signal("debug::error", function (err) -- Make sure we don't go into an endless error loop if in_error then return end in_error = true naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, an error happened!", text = err }) in_error = false end) end -- }}} -- {{{ Modkey and default layout -- Themes define colours, icons, and wallpapers --beautiful.init("/usr/share/awesome/themes/default/theme.lua") beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" shell = "/bin/zsh" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier } -- }}} -- {{{ Wallpaper if beautiful.wallpaper then for s = 1, screen.count() do gears.wallpaper.maximized(beautiful.wallpaper, s, true) end end -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 layouts[2], layouts[2], layouts[2] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Wibox -- Seperator local separator = wibox.widget.textbox() separator:set_markup(" <span foreground='red'>•</span> ") -- cmus widget (global, to access it via cmus-notify) cmuswidget = wibox.widget.textbox() -cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='#00FF04'>-</span>") +cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='#00FF00'>-</span>") -- Date and time local datewidget = wibox.widget.textbox() -vicious.register(datewidget, vicious.widgets.date, "<span foreground='#00FF04'>%a, %d.%m.%y - %H:%M</span>", 60) +vicious.register(datewidget, vicious.widgets.date, "<span foreground='#00FF00'>%a, %d.%m.%y - %H:%M</span>", 60) -- CPU load local cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='#00FF04'>$2%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$3%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$4%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$5%</span>") +vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='#00FF00'>$2%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$3%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$4%</span><span foreground='orange'> - </span><span foreground='#00FF00'>$5%</span>") -- CPU temperature local thermalwidget = wibox.widget.textbox() -vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='#00FF04'>$1°C</span>", 20, "thermal_zone0") +vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='#00FF00'>$1°C</span>", 20, "thermal_zone0") -- Battery state local batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='#00FF04'>$1$2%</span>", 60, "BAT0") +vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='#00FF00'>$1$2%</span>", 60, "BAT0") -- Volume widget local volwidget = wibox.widget.textbox() -vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='#00FF04'>$1%</span>", 1, 'PCM') +vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='#00FF00'>$1%</span>", 1, 'PCM') -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} mylayoutbox = {} mytaglist = {} mytaglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) ) mytasklist = {} mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else -- Without this, the following -- :isvisible() makes no sense c.minimized = false if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end -- This will also un-minimize -- the client, if needed client.focus = c c:raise() end end), awful.button({ }, 3, function () if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width=250 }) end end), awful.button({ }, 4, function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end)) for s = 1, screen.count() do -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) -- Create a taglist widget mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s }) -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(mylayoutbox[s]) left_layout:add(mytaglist[s]) left_layout:add(mypromptbox[s]) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(cmuswidget) right_layout:add(separator) right_layout:add(cpuwidget) right_layout:add(separator) right_layout:add(thermalwidget) right_layout:add(separator) right_layout:add(batwidget) right_layout:add(separator) right_layout:add(volwidget) right_layout:add(separator) right_layout:add(datewidget) if s == screen.count() then right_layout:add(wibox.widget.systray()) end -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(mytasklist[s]) layout:set_right(right_layout) mywibox[s]:set_widget(layout) end -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( -- key bindings for fn keys awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- default keybindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), -- Prompt awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey, "Shift" }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) end), -- Menubar awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end local titlebars_enabled = false if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(awful.titlebar.widget.iconwidget(c)) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(awful.titlebar.widget.floatingbutton(c)) right_layout:add(awful.titlebar.widget.maximizedbutton(c)) right_layout:add(awful.titlebar.widget.stickybutton(c)) right_layout:add(awful.titlebar.widget.ontopbutton(c)) right_layout:add(awful.titlebar.widget.closebutton(c)) -- The title goes in the middle local title = awful.titlebar.widget.titlewidget(c) title:buttons(awful.util.table.join( awful.button({ }, 1, function() client.focus = c c:raise() awful.mouse.client.move(c) end), awful.button({ }, 3, function() client.focus = c c:raise() awful.mouse.client.resize(c) end) )) -- Now bring it all together local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_right(right_layout) layout:set_middle(title) awful.titlebar(c):set_widget(layout) end end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai
nblock/config
534bdfbe6e966fae745ded5402307ad64146d7be
use a lighter green
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index ae59fd6..4a14c02 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,536 +1,536 @@ -- {{{ License -- rc.lua, works with awesome 3.5 on Arch Linux -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") awful.autofocus = require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") local vicious = require("vicious") -- local variables local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell --}}} -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) if awesome.startup_errors then naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, there were errors during startup!", text = awesome.startup_errors }) end -- Handle runtime errors after startup do local in_error = false awesome.connect_signal("debug::error", function (err) -- Make sure we don't go into an endless error loop if in_error then return end in_error = true naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, an error happened!", text = err }) in_error = false end) end -- }}} -- {{{ Modkey and default layout -- Themes define colours, icons, and wallpapers --beautiful.init("/usr/share/awesome/themes/default/theme.lua") beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" shell = "/bin/zsh" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier } -- }}} -- {{{ Wallpaper if beautiful.wallpaper then for s = 1, screen.count() do gears.wallpaper.maximized(beautiful.wallpaper, s, true) end end -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 layouts[2], layouts[2], layouts[2] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Wibox -- Seperator local separator = wibox.widget.textbox() separator:set_markup(" <span foreground='red'>•</span> ") -- cmus widget (global, to access it via cmus-notify) cmuswidget = wibox.widget.textbox() -cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='green'>-</span>") +cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='#00FF04'>-</span>") -- Date and time local datewidget = wibox.widget.textbox() -vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 60) +vicious.register(datewidget, vicious.widgets.date, "<span foreground='#00FF04'>%a, %d.%m.%y - %H:%M</span>", 60) -- CPU load local cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") +vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='#00FF04'>$2%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$3%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$4%</span><span foreground='orange'> - </span><span foreground='#00FF04'>$5%</span>") -- CPU temperature local thermalwidget = wibox.widget.textbox() -vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") +vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='#00FF04'>$1°C</span>", 20, "thermal_zone0") -- Battery state local batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") +vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='#00FF04'>$1$2%</span>", 60, "BAT0") -- Volume widget local volwidget = wibox.widget.textbox() -vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') +vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='#00FF04'>$1%</span>", 1, 'PCM') -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} mylayoutbox = {} mytaglist = {} mytaglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) ) mytasklist = {} mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else -- Without this, the following -- :isvisible() makes no sense c.minimized = false if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end -- This will also un-minimize -- the client, if needed client.focus = c c:raise() end end), awful.button({ }, 3, function () if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width=250 }) end end), awful.button({ }, 4, function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end)) for s = 1, screen.count() do -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) -- Create a taglist widget mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s }) -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(mylayoutbox[s]) left_layout:add(mytaglist[s]) left_layout:add(mypromptbox[s]) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(cmuswidget) right_layout:add(separator) right_layout:add(cpuwidget) right_layout:add(separator) right_layout:add(thermalwidget) right_layout:add(separator) right_layout:add(batwidget) right_layout:add(separator) right_layout:add(volwidget) right_layout:add(separator) right_layout:add(datewidget) if s == screen.count() then right_layout:add(wibox.widget.systray()) end -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(mytasklist[s]) layout:set_right(right_layout) mywibox[s]:set_widget(layout) end -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( -- key bindings for fn keys awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- default keybindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), -- Prompt awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey, "Shift" }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) end), -- Menubar awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end local titlebars_enabled = false if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(awful.titlebar.widget.iconwidget(c)) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(awful.titlebar.widget.floatingbutton(c)) right_layout:add(awful.titlebar.widget.maximizedbutton(c)) right_layout:add(awful.titlebar.widget.stickybutton(c)) right_layout:add(awful.titlebar.widget.ontopbutton(c)) right_layout:add(awful.titlebar.widget.closebutton(c)) -- The title goes in the middle local title = awful.titlebar.widget.titlewidget(c) title:buttons(awful.util.table.join( awful.button({ }, 1, function() client.focus = c c:raise() awful.mouse.client.move(c) end), awful.button({ }, 3, function() client.focus = c c:raise() awful.mouse.client.resize(c) end) )) -- Now bring it all together local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_right(right_layout) layout:set_middle(title) awful.titlebar(c):set_widget(layout) end end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai
nblock/config
2b43f86fe09f4e1aa7eaa3d76f902621c22ac987
upstream changes for urxvt-9.16
diff --git a/Xdefaults b/Xdefaults index 11e096a..4692d41 100644 --- a/Xdefaults +++ b/Xdefaults @@ -1,30 +1,30 @@ !URxvt settings !!--[Urxvt Options]--! URxvt*title: urxvtc URxvt*termName: rxvt-unicode-256color URxvt*cursorBlink: true URxvt*urgentOnBell: true URxvt*scrollBar: false URxvt*boldMode: false URxvt*imLocale: de_AT.UTF-8 URxvt*loginShell: true URxvt*borderless: false URxvt*jumpScroll: true URxvt*saveLines: 5000 URxvt*transparent: false URxvt*fading: 0% URxvt*scrollTtyKeypress:true URxvt*internalBorder: 0 URxvt*utf8: 1 !--[Urls /launching/marking/yanking]--! URxvt*perl-ext: default,matcher -URxvt*urlLauncher: /usr/bin/firefox +URxvt*url-launcher: /usr/bin/firefox URxvt*matcher.button: 1 URxvt*matcher.pattern.1:\\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-] !--[Fonts]--! URxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13:antialias=false URxvt*italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true:antialias=false URxvt*boldFont: xft:Bitstream Vera Sans Mono:bold:autohint=true:antialias=false URxvt*boldItalicFont: xft:Bitstream Vera Sans Mono:bold:italic:autohint=true:antialias=false
nblock/config
bc1c52a806fa30e254bba6b517994e6675243648
display systray on last drawn screen
diff --git a/bin/screenoff b/bin/screenoff index 94faa37..e49224a 100755 --- a/bin/screenoff +++ b/bin/screenoff @@ -1,3 +1,3 @@ #!/bin/bash xrandr --output HDMI1 --off --output LVDS1 --mode 1440x900 --pos 0x0 --primary -awsetbg -R ~/bilder/wallpaper/1400x1050/ +#awsetbg -R ~/bilder/wallpaper/1400x1050/ diff --git a/bin/screenon b/bin/screenon index 4dd0fe7..8b8a2aa 100755 --- a/bin/screenon +++ b/bin/screenon @@ -1,3 +1,3 @@ #!/bin/bash xrandr --output HDMI1 --mode 1920x1080 --pos 0x0 --output LVDS1 --mode 1440x900 --pos 1920x0 --primary -awsetbg -R ~/bilder/wallpaper/1920x1080/ +#awsetbg -R ~/bilder/wallpaper/1920x1080/ diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 79fa3d0..ae59fd6 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,536 +1,536 @@ -- {{{ License -- rc.lua, works with awesome 3.5 on Arch Linux -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") awful.autofocus = require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") local vicious = require("vicious") -- local variables local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell --}}} -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) if awesome.startup_errors then naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, there were errors during startup!", text = awesome.startup_errors }) end -- Handle runtime errors after startup do local in_error = false awesome.connect_signal("debug::error", function (err) -- Make sure we don't go into an endless error loop if in_error then return end in_error = true naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, an error happened!", text = err }) in_error = false end) end -- }}} -- {{{ Modkey and default layout -- Themes define colours, icons, and wallpapers --beautiful.init("/usr/share/awesome/themes/default/theme.lua") beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" shell = "/bin/zsh" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier } -- }}} -- {{{ Wallpaper if beautiful.wallpaper then for s = 1, screen.count() do gears.wallpaper.maximized(beautiful.wallpaper, s, true) end end -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 layouts[2], layouts[2], layouts[2] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Wibox -- Seperator local separator = wibox.widget.textbox() separator:set_markup(" <span foreground='red'>•</span> ") -- cmus widget (global, to access it via cmus-notify) cmuswidget = wibox.widget.textbox() cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='green'>-</span>") -- Date and time local datewidget = wibox.widget.textbox() vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 60) -- CPU load local cpuwidget = wibox.widget.textbox() vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") -- CPU temperature local thermalwidget = wibox.widget.textbox() vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") -- Battery state local batwidget = wibox.widget.textbox() vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") -- Volume widget local volwidget = wibox.widget.textbox() vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} mylayoutbox = {} mytaglist = {} mytaglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) ) mytasklist = {} mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else -- Without this, the following -- :isvisible() makes no sense c.minimized = false if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end -- This will also un-minimize -- the client, if needed client.focus = c c:raise() end end), awful.button({ }, 3, function () if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width=250 }) end end), awful.button({ }, 4, function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end)) for s = 1, screen.count() do -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) -- Create a taglist widget mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s }) -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(mylayoutbox[s]) left_layout:add(mytaglist[s]) left_layout:add(mypromptbox[s]) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(cmuswidget) right_layout:add(separator) right_layout:add(cpuwidget) right_layout:add(separator) right_layout:add(thermalwidget) right_layout:add(separator) right_layout:add(batwidget) right_layout:add(separator) right_layout:add(volwidget) right_layout:add(separator) right_layout:add(datewidget) - if s == 1 then right_layout:add(wibox.widget.systray()) end + if s == screen.count() then right_layout:add(wibox.widget.systray()) end -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(mytasklist[s]) layout:set_right(right_layout) mywibox[s]:set_widget(layout) end -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( -- key bindings for fn keys awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- default keybindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), -- Prompt awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey, "Shift" }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) end), -- Menubar awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end local titlebars_enabled = false if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(awful.titlebar.widget.iconwidget(c)) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(awful.titlebar.widget.floatingbutton(c)) right_layout:add(awful.titlebar.widget.maximizedbutton(c)) right_layout:add(awful.titlebar.widget.stickybutton(c)) right_layout:add(awful.titlebar.widget.ontopbutton(c)) right_layout:add(awful.titlebar.widget.closebutton(c)) -- The title goes in the middle local title = awful.titlebar.widget.titlewidget(c) title:buttons(awful.util.table.join( awful.button({ }, 1, function() client.focus = c c:raise() awful.mouse.client.move(c) end), awful.button({ }, 3, function() client.focus = c c:raise() awful.mouse.client.resize(c) end) )) -- Now bring it all together local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_right(right_layout) layout:set_middle(title) awful.titlebar(c):set_widget(layout) end end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai
nblock/config
3f824ff8464601df966c9df0985518267c23fa27
add test-awesome-config
diff --git a/bin/test-awesome-config.sh b/bin/test-awesome-config.sh new file mode 100755 index 0000000..957d84c --- /dev/null +++ b/bin/test-awesome-config.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# script xepyhr-awesome +# author: dante4d <[email protected]> +Xephyr -ac -br -noreset -screen 800x600 :1 & +sleep 1 +DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua
nblock/config
286b3318db1ad162af160cde703f05783c7ed13a
new place for the layoutbox
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 7cd6f12..79fa3d0 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,536 +1,536 @@ -- {{{ License -- rc.lua, works with awesome 3.5 on Arch Linux -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") awful.autofocus = require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") local vicious = require("vicious") -- local variables local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell --}}} -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) if awesome.startup_errors then naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, there were errors during startup!", text = awesome.startup_errors }) end -- Handle runtime errors after startup do local in_error = false awesome.connect_signal("debug::error", function (err) -- Make sure we don't go into an endless error loop if in_error then return end in_error = true naughty.notify({ preset = naughty.config.presets.critical, title = "Oops, an error happened!", text = err }) in_error = false end) end -- }}} -- {{{ Modkey and default layout -- Themes define colours, icons, and wallpapers --beautiful.init("/usr/share/awesome/themes/default/theme.lua") beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" shell = "/bin/zsh" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier } -- }}} -- {{{ Wallpaper if beautiful.wallpaper then for s = 1, screen.count() do gears.wallpaper.maximized(beautiful.wallpaper, s, true) end end -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 layouts[2], layouts[2], layouts[2] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Wibox -- Seperator local separator = wibox.widget.textbox() separator:set_markup(" <span foreground='red'>•</span> ") -- cmus widget (global, to access it via cmus-notify) cmuswidget = wibox.widget.textbox() cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='green'>-</span>") -- Date and time local datewidget = wibox.widget.textbox() vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 60) -- CPU load local cpuwidget = wibox.widget.textbox() vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") -- CPU temperature local thermalwidget = wibox.widget.textbox() vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") -- Battery state local batwidget = wibox.widget.textbox() vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") -- Volume widget local volwidget = wibox.widget.textbox() vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} mylayoutbox = {} mytaglist = {} mytaglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) ) mytasklist = {} mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else -- Without this, the following -- :isvisible() makes no sense c.minimized = false if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end -- This will also un-minimize -- the client, if needed client.focus = c c:raise() end end), awful.button({ }, 3, function () if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width=250 }) end end), awful.button({ }, 4, function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end)) for s = 1, screen.count() do -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) -- Create a taglist widget mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s }) -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(mylayoutbox[s]) left_layout:add(mytaglist[s]) left_layout:add(mypromptbox[s]) - left_layout:add(mylayoutbox[s]) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(cmuswidget) right_layout:add(separator) right_layout:add(cpuwidget) right_layout:add(separator) right_layout:add(thermalwidget) right_layout:add(separator) right_layout:add(batwidget) right_layout:add(separator) right_layout:add(volwidget) right_layout:add(separator) right_layout:add(datewidget) if s == 1 then right_layout:add(wibox.widget.systray()) end -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(mytasklist[s]) layout:set_right(right_layout) mywibox[s]:set_widget(layout) end -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( -- key bindings for fn keys awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- default keybindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), -- Prompt awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey, "Shift" }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) end), -- Menubar awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end local titlebars_enabled = false if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(awful.titlebar.widget.iconwidget(c)) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(awful.titlebar.widget.floatingbutton(c)) right_layout:add(awful.titlebar.widget.maximizedbutton(c)) right_layout:add(awful.titlebar.widget.stickybutton(c)) right_layout:add(awful.titlebar.widget.ontopbutton(c)) right_layout:add(awful.titlebar.widget.closebutton(c)) -- The title goes in the middle local title = awful.titlebar.widget.titlewidget(c) title:buttons(awful.util.table.join( awful.button({ }, 1, function() client.focus = c c:raise() awful.mouse.client.move(c) end), awful.button({ }, 3, function() client.focus = c c:raise() awful.mouse.client.resize(c) end) )) -- Now bring it all together local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_right(right_layout) layout:set_middle(title) awful.titlebar(c):set_widget(layout) end end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai
nblock/config
d16169a002ba6eb95306bcc3339640c279489559
add virtualenvwrapper
diff --git a/zshrc b/zshrc index 690ce16..c21391e 100644 --- a/zshrc +++ b/zshrc @@ -1,228 +1,232 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt PROMPT_SUBST # Enables additional prompt extentions unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } #set TERM only for ssh alias ssh='env TERM=rxvt-unicode ssh' # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward #edit current line in vim autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; *.tar.xz) tar -Jxf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf" + +# virtualenvwrapper +export WORKON_HOME=~/.virtualenvs +source /usr/bin/virtualenvwrapper.sh
nblock/config
9ab59a6c0f6f4b60aecbaeb0e9edd07246493ced
add vim key bindings for copying/pasting
diff --git a/tmux.conf b/tmux.conf index 7b899ba..1cf6b7e 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,31 +1,34 @@ #use vim mode setw -g mode-keys vi +bind -t vi-copy v begin-selection +bind -t vi-copy y copy-selection +bind -t vi-copy Escape cancel #lower escape time set -s escape-time 1 #start indices from 1 to match up with vim set -g base-index 1 setw -g pane-base-index 1 #enable mouse setw -g mode-mouse on #moving between panes bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R #better mappings for splitting unbind % bind | split-window -h bind - split-window -v #resizing panes bind -r H resize-pane -L 5 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'"
nblock/config
ee90a181270dcd0c9c5478eef95a13a28cfd4666
migrate rc.lua to awesome 3.5
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index cc26bf8..7cd6f12 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,460 +1,536 @@ -- {{{ License --- rc.lua, works with awesome 3.4.9 (Arch Linux) +-- rc.lua, works with awesome 3.5 on Arch Linux -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library -require("awful") -require("awful.autofocus") -require("awful.rules") +local gears = require("gears") +local awful = require("awful") +awful.rules = require("awful.rules") +awful.autofocus = require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") -- Theme handling library -require("beautiful") +local beautiful = require("beautiful") -- Notification library -require("naughty") -vicious = require("vicious") --- }}} +local naughty = require("naughty") +local menubar = require("menubar") +local vicious = require("vicious") + +-- local variables +local home = os.getenv("HOME") +local exec = awful.util.spawn +local sexec = awful.util.spawn_with_shell +--}}} + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end --- {{{ Variable definitions -local home = os.getenv("HOME") -local exec = awful.util.spawn -local sexec = awful.util.spawn_with_shell +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} +-- {{{ Modkey and default layout -- Themes define colours, icons, and wallpapers +--beautiful.init("/usr/share/awesome/themes/default/theme.lua") beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" -editor = "vim" +editor = "vim" +shell = "/bin/zsh" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. -layouts = +local layouts = { - awful.layout.suit.tile, --1 - awful.layout.suit.tile.left, --2 - awful.layout.suit.tile.bottom, --3 - awful.layout.suit.tile.top, --4 - awful.layout.suit.fair, --5 - awful.layout.suit.fair.horizontal, --6 - awful.layout.suit.spiral, --7 - awful.layout.suit.spiral.dwindle, --8 - awful.layout.suit.max, --9 - awful.layout.suit.max.fullscreen, --10 - awful.layout.suit.magnifier, --11 - awful.layout.suit.floating --12 + awful.layout.suit.floating, + awful.layout.suit.tile, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier } -- }}} +-- {{{ Wallpaper +if beautiful.wallpaper then + for s = 1, screen.count() do + gears.wallpaper.maximized(beautiful.wallpaper, s, true) + end +end +-- }}} + -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. - tags[s] = awful.tag({ - "1 download", "2 mail", "3 chat", - "4 music", "5 news", "6 web", + tags[s] = awful.tag({ + "1 download", "2 mail", "3 chat", + "4 music", "5 news", "6 web", 7, 8, 9 }, s, - {layouts[3], layouts[1], layouts[1], -- Tags: 1, 2, 3 - layouts[1], layouts[1], layouts[1], -- 4, 5 ,6 - layouts[1], layouts[1], layouts[1] -- 7, 8, 9 + {layouts[4], layouts[2], layouts[2], -- Tags: 1, 2, 3 + layouts[2], layouts[2], layouts[2], -- 4, 5 ,6 + layouts[2], layouts[2], layouts[2] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, - { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" }, + { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) -mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), - menu = mymainmenu }) +-- Menubar configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Wibox --- {{{ Widgets configuration --- {{{ Reusable separators -local spacer = widget({ type = "textbox", name = "spacer" }) -local separator = widget({ type = "textbox", name = "separator" }) -spacer.text = " " -separator.text = " <span foreground='red'>•</span> " --- }}} +-- Seperator +local separator = wibox.widget.textbox() +separator:set_markup(" <span foreground='red'>•</span> ") + +-- cmus widget (global, to access it via cmus-notify) +cmuswidget = wibox.widget.textbox() +cmuswidget:set_markup("<span foreground='orange'>music: </span><span foreground='green'>-</span>") +-- Date and time +local datewidget = wibox.widget.textbox() +vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 60) --- {{{ CPU load -local cpuwidget = widget({ type = "textbox" }) +-- CPU load +local cpuwidget = wibox.widget.textbox() vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") --- }}} - --- {{{ CPU temperature -local thermalwidget = widget({ type = "textbox" }) + +-- CPU temperature +local thermalwidget = wibox.widget.textbox() vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") --- }}} --- {{{ Battery state --- Widget icon --- baticon = widget({ type = "imagebox", name = "baticon" }) --- baticon.image = image(beautiful.widget_bat) -local batwidget = widget({ type = "textbox" }) +-- Battery state +local batwidget = wibox.widget.textbox() vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") --- }}} - --- {{{ Date and time -local datewidget = widget({ type = "textbox" }) -vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 5) --- }}} --- {{{ Volume widget -local volwidget = widget({ type = "textbox" }) +-- Volume widget +local volwidget = wibox.widget.textbox() vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') --- }}} --- {{{ cmus widget -cmus = widget({ type = "textbox", name = "cmus" }) -cmus.text = "<span foreground='orange'>music: </span><span foreground='green'>-</span>" --- }}} - --- {{{ System tray -systray = widget({ type = "systray" }) --- }}} --- }}} - --- {{{ Wibox initialisation -local wibox = {} -local promptbox = {} -local layoutbox = {} -local taglist = {} -taglist.buttons = awful.util.table.join( +-- Create a wibox for each screen and add it +mywibox = {} +mypromptbox = {} +mylayoutbox = {} +mytaglist = {} +mytaglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev)) - -local tasklist = {} -tasklist.buttons = awful.util.table.join( - awful.button({ }, 1, - function(c) - if not c:isvisible() then - awful.tag.viewonly(c:tags()[1]) - end - client.focus = c - c:raise() - end), - awful.button({ }, 3, - function() - if instance then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ width = 250 }) - end - end), - awful.button({ }, 4, - function() - awful.client.focus.byidx(1) - if client.focus then - client.focus:raise() - end - end), - awful.button({ }, 5, - function() - awful.client.focus.byidx(-1) - if client.focus then - client.focus:raise() - end - end) -) + awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) + ) +mytasklist = {} +mytasklist.buttons = awful.util.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() then + awful.tag.viewonly(c:tags()[1]) + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + c:raise() + end + end), + awful.button({ }, 3, function () + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ width=250 }) + end + end), + awful.button({ }, 4, function () + awful.client.focus.byidx(1) + if client.focus then client.focus:raise() end + end), + awful.button({ }, 5, function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end)) for s = 1, screen.count() do - -- Create a promptbox - promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) - -- Create a layoutbox - layoutbox[s] = awful.widget.layoutbox(s) - layoutbox[s]:buttons(awful.util.table.join( + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt() + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = awful.widget.layoutbox(s) + mylayoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end) - )) - + awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) -- Create a taglist widget - taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, taglist.buttons) + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a tasklist widget - tasklist[s] = awful.widget.tasklist( - function(c) - return awful.widget.tasklist.label.currenttags(c, s) - end, - tasklist.buttons - ) + mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the wibox - wibox[s] = awful.wibox({ - position = "top", screen = s, - fg = beautiful.fg_normal, bg = beautiful.bg_normal, height=beautiful.widget_height - }) - -- Add widgets to the wibox - wibox[s].widgets = {{ - launcher, taglist[s], layoutbox[s], promptbox[s], - layout = awful.widget.layout.horizontal.leftright - }, - s == screen.count() and systray or nil, - spacer, datewidget, - separator, volwidget, - separator, batwidget, - separator, cpuwidget, - separator, thermalwidget, - separator, cmus, - separator, tasklist[s], - layout = awful.widget.layout.horizontal.rightleft - } + mywibox[s] = awful.wibox({ position = "top", screen = s }) + + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(mytaglist[s]) + left_layout:add(mypromptbox[s]) + left_layout:add(mylayoutbox[s]) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + right_layout:add(cmuswidget) + right_layout:add(separator) + right_layout:add(cpuwidget) + right_layout:add(separator) + right_layout:add(thermalwidget) + right_layout:add(separator) + right_layout:add(batwidget) + right_layout:add(separator) + right_layout:add(volwidget) + right_layout:add(separator) + right_layout:add(datewidget) + if s == 1 then right_layout:add(wibox.widget.systray()) end + + -- Now bring it all together (with the tasklist in the middle) + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_middle(mytasklist[s]) + layout:set_right(right_layout) + + mywibox[s]:set_widget(layout) end -- }}} --- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( + -- key bindings for fn keys awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), - awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage + awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 - awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 + awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 - -- awful.key({}, "XF86MyComputer", function() sexec(commands.fileman) end ), - -- awful.key({}, "XF86Mail", function() sexec(commands.mail) end ), - -- awful.key({}, "XF86HomePage", function() sexec(commands.browser) end ), - -- awful.key({}, "XF86Sleep", function() sexec(commands.lock) end ), - -- awful.key({"Control", "Mod1"}, "l", function() sexec(commands.lock) end ), - --default bindings + -- default keybindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), + awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program - awful.key({ modkey, }, "Return", function () exec(terminal) end), + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, "Control" }, "n", awful.client.restore), + -- Prompt - awful.key({ modkey }, "r", function () promptbox[mouse.screen]:run() end), + awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), + + awful.key({ modkey, "Shift" }, "x", + function () + awful.prompt.run({ prompt = "Run Lua code: " }, + mypromptbox[mouse.screen].widget, + awful.util.eval, nil, + awful.util.getdir("cache") .. "/history_eval") + end), + -- Run stuff in a Terminal - awful.key({ modkey }, "x", function () - awful.prompt.run({ prompt = "Run in Terminal: " }, promptbox[mouse.screen].widget, - function (prog) - sexec(terminal .. " -name " .. prog .. " -e /bin/zsh -c " .. prog) - end) - end) + awful.key({ modkey }, "x", + function () + awful.prompt.run({ prompt = "Run in Terminal: " }, mypromptbox[mouse.screen].widget, + function (prog) sexec(terminal .. " -name " .. prog .. " -e " .. shell .. " -c " .. prog) end) + end), + + -- Menubar + awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), - awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), - awful.key({ modkey, }, "j", function (c) c.minimized = not c.minimized end), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); + keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, - focus = true, + focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags - --downloading stuff { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. -client.add_signal("manage", function (c, startup) +client.connect_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false - -- Enable sloppy focus - c:add_signal("mouse::enter", function(c) + c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end + + local titlebars_enabled = false + if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(awful.titlebar.widget.iconwidget(c)) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + right_layout:add(awful.titlebar.widget.floatingbutton(c)) + right_layout:add(awful.titlebar.widget.maximizedbutton(c)) + right_layout:add(awful.titlebar.widget.stickybutton(c)) + right_layout:add(awful.titlebar.widget.ontopbutton(c)) + right_layout:add(awful.titlebar.widget.closebutton(c)) + + -- The title goes in the middle + local title = awful.titlebar.widget.titlewidget(c) + title:buttons(awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + )) + + -- Now bring it all together + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_right(right_layout) + layout:set_middle(title) + + awful.titlebar(c):set_widget(layout) + end end) -client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai diff --git a/config/awesome/zenburn.lua b/config/awesome/zenburn.lua index 82b631f..88345d0 100644 --- a/config/awesome/zenburn.lua +++ b/config/awesome/zenburn.lua @@ -1,150 +1,149 @@ ------------------------------- -- "Zenburn" awesome theme -- -- By Adrian C. (anrxc) -- ------------------------------- -- Alternative icon sets and widget icons: -- * http://awesome.naquadah.org/wiki/Nice_Icons -- {{{ Required libraries local awful = require("awful") -- }}} -- {{{ Main theme = {} theme._icondir = awful.util.getdir("config") .. "/icons" -theme._homedir = os.getenv("HOME") -theme.wallpaper_cmd = { "awsetbg theme._homedir .. bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" } +theme.wallpaper = os.getenv("HOME") .. "/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" -- }}} -- {{{ Styles theme.font = "sans 8" -- {{{ Colors theme.fg_normal = "#DCDCCC" theme.fg_focus = "#00FF00" theme.fg_urgent = "#CC9393" theme.bg_normal = "#3F3F3F" theme.bg_focus = "#1E2320" theme.bg_urgent = "#3F3F3F" theme.bg_systray = theme.bg_normal -- }}} -- {{{ Borders theme.border_width = "1" theme.border_normal = "#3F3F3F" theme.border_focus = "#FF0000" theme.border_marked = "#CC9393" -- }}} -- {{{ Titlebars theme.titlebar_bg_focus = "#3F3F3F" theme.titlebar_bg_normal = "#3F3F3F" theme.titlebar_widget_height = "16" -- }}} -- There are other variable sets -- overriding the default one when -- defined, the sets are: -- [taglist|tasklist]_[bg|fg]_[focus|urgent] -- titlebar_[normal|focus] -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] -- Example: --theme.taglist_bg_focus = "#CC9393" -- }}} -- {{{ Widgets -- You can add as many variables as -- you wish and access them by using -- beautiful.variable in your rc.lua --theme.fg_widget = "#AECF96" --theme.fg_center_widget = "#88A175" --theme.fg_end_widget = "#FF5656" --theme.bg_widget = "#494B4F" --theme.border_widget = "#3F3F3F" -- }}} -- {{{ Mouse finder theme.mouse_finder_color = "#CC9393" -- mouse_finder_[timeout|animate_timeout|radius|factor] -- }}} -- {{{ Menu -- Variables set for theming the menu: -- menu_[bg|fg]_[normal|focus] -- menu_[border_color|border_width] theme.menu_height = "16" theme.menu_width = "100" -- }}} -- {{{ Icons -- {{{ Taglist theme.taglist_squares_sel = "/usr/share/awesome/themes/zenburn/taglist/squarefz.png" theme.taglist_squares_unsel = "/usr/share/awesome/themes/zenburn/taglist/squarez.png" --theme.taglist_squares_resize = "false" -- }}} -- {{{ Misc theme.awesome_icon = "/usr/share/awesome/themes/zenburn/awesome-icon.png" theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" -- }}} -- {{{ Layout icons theme.layout_tile = theme._icondir .. "/layouts/tile.png" theme.layout_tileleft = theme._icondir .. "/layouts/tileleft.png" theme.layout_tilebottom = theme._icondir .. "/layouts/tilebottom.png" theme.layout_tiletop = theme._icondir .. "/layouts/tiletop.png" theme.layout_fairv = theme._icondir .. "/layouts/fairv.png" theme.layout_fairh = theme._icondir .. "/layouts/fairh.png" theme.layout_spiral = theme._icondir .. "/layouts/spiral.png" theme.layout_dwindle = theme._icondir .. "/layouts/dwindle.png" theme.layout_max = theme._icondir .. "/layouts/max.png" theme.layout_fullscreen = theme._icondir .. "/layouts/fullscreen.png" theme.layout_magnifier = theme._icondir .. "/layouts/magnifier.png" theme.layout_floating = theme._icondir .. "/layouts/floating.png" -- }}} -- {{{ Widget icons theme.widget_cpu = theme._icondir .. "/taskbar/cpu.png" theme.widget_bat = theme._icondir .. "/taskbar/bat.png" theme.widget_mem = theme._icondir .. "/taskbar/mem.png" theme.widget_fs = theme._icondir .. "/taskbar/disk.png" theme.widget_net = theme._icondir .. "/taskbar/down.png" theme.widget_netup = theme._icondir .. "/taskbar/up.png" theme.widget_wifi = theme._icondir .. "/taskbar/wifi.png" theme.widget_mail = theme._icondir .. "/taskbar/mail.png" theme.widget_vol = theme._icondir .. "/taskbar/vol.png" theme.widget_org = theme._icondir .. "/taskbar/cal.png" theme.widget_date = theme._icondir .. "/taskbar/time.png" theme.widget_crypto = theme._icondir .. "/taskbar/crypto.png" theme.widget_sep = theme._icondir .. "/taskbar/separator.png" -- }}} -- {{{ Titlebar icons theme.titlebar_close_button_focus = theme._icondir .. "/titlebar/close_focus.png" theme.titlebar_close_button_normal = theme._icondir .. "/titlebar/close_normal.png" theme.titlebar_ontop_button_focus_active = theme._icondir .. "/titlebar/ontop_focus_active.png" theme.titlebar_ontop_button_normal_active = theme._icondir .. "/titlebar/ontop_normal_active.png" theme.titlebar_ontop_button_focus_inactive = theme._icondir .. "/titlebar/ontop_focus_inactive.png" theme.titlebar_ontop_button_normal_inactive = theme._icondir .. "/titlebar/ontop_normal_inactive.png" theme.titlebar_sticky_button_focus_active = theme._icondir .. "/titlebar/sticky_focus_active.png" theme.titlebar_sticky_button_normal_active = theme._icondir .. "/titlebar/sticky_normal_active.png" theme.titlebar_sticky_button_focus_inactive = theme._icondir .. "/titlebar/sticky_focus_inactive.png" theme.titlebar_sticky_button_normal_inactive = theme._icondir .. "/titlebar/sticky_normal_inactive.png" theme.titlebar_floating_button_focus_active = theme._icondir .. "/titlebar/floating_focus_active.png" theme.titlebar_floating_button_normal_active = theme._icondir .. "/titlebar/floating_normal_active.png" theme.titlebar_floating_button_focus_inactive = theme._icondir .. "/titlebar/floating_focus_inactive.png" theme.titlebar_floating_button_normal_inactive = theme._icondir .. "/titlebar/floating_normal_inactive.png" theme.titlebar_maximized_button_focus_active = theme._icondir .. "/titlebar/maximized_focus_active.png" theme.titlebar_maximized_button_normal_active = theme._icondir .. "/titlebar/maximized_normal_active.png" theme.titlebar_maximized_button_focus_inactive = theme._icondir .. "/titlebar/maximized_focus_inactive.png" theme.titlebar_maximized_button_normal_inactive = theme._icondir .. "/titlebar/maximized_normal_inactive.png" -- }}} -- }}} return theme
nblock/config
db3927eb20c6e08fffdb2e856e47e59022e6f371
migrate zenburn for awesome 3.5
diff --git a/config/awesome/zenburn.lua b/config/awesome/zenburn.lua index 057fce1..82b631f 100644 --- a/config/awesome/zenburn.lua +++ b/config/awesome/zenburn.lua @@ -1,144 +1,150 @@ ------------------------------- -- "Zenburn" awesome theme -- -- By Adrian C. (anrxc) -- ------------------------------- -- Alternative icon sets and widget icons: -- * http://awesome.naquadah.org/wiki/Nice_Icons +-- {{{ Required libraries +local awful = require("awful") +-- }}} + -- {{{ Main theme = {} -theme.confdir = awful.util.getdir("config") -theme.wallpaper_cmd = { "awsetbg /home/flo/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" } +theme._icondir = awful.util.getdir("config") .. "/icons" +theme._homedir = os.getenv("HOME") +theme.wallpaper_cmd = { "awsetbg theme._homedir .. bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" } -- }}} -- {{{ Styles theme.font = "sans 8" -- {{{ Colors theme.fg_normal = "#DCDCCC" theme.fg_focus = "#00FF00" theme.fg_urgent = "#CC9393" theme.bg_normal = "#3F3F3F" theme.bg_focus = "#1E2320" theme.bg_urgent = "#3F3F3F" +theme.bg_systray = theme.bg_normal -- }}} -- {{{ Borders theme.border_width = "1" theme.border_normal = "#3F3F3F" theme.border_focus = "#FF0000" theme.border_marked = "#CC9393" -- }}} -- {{{ Titlebars theme.titlebar_bg_focus = "#3F3F3F" theme.titlebar_bg_normal = "#3F3F3F" theme.titlebar_widget_height = "16" -- }}} -- There are other variable sets -- overriding the default one when -- defined, the sets are: -- [taglist|tasklist]_[bg|fg]_[focus|urgent] -- titlebar_[normal|focus] -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] -- Example: --theme.taglist_bg_focus = "#CC9393" -- }}} -- {{{ Widgets -- You can add as many variables as -- you wish and access them by using -- beautiful.variable in your rc.lua --theme.fg_widget = "#AECF96" --theme.fg_center_widget = "#88A175" --theme.fg_end_widget = "#FF5656" --theme.bg_widget = "#494B4F" --theme.border_widget = "#3F3F3F" -- }}} -- {{{ Mouse finder theme.mouse_finder_color = "#CC9393" -- mouse_finder_[timeout|animate_timeout|radius|factor] -- }}} -- {{{ Menu -- Variables set for theming the menu: -- menu_[bg|fg]_[normal|focus] -- menu_[border_color|border_width] theme.menu_height = "16" theme.menu_width = "100" -- }}} -- {{{ Icons -- {{{ Taglist theme.taglist_squares_sel = "/usr/share/awesome/themes/zenburn/taglist/squarefz.png" theme.taglist_squares_unsel = "/usr/share/awesome/themes/zenburn/taglist/squarez.png" --theme.taglist_squares_resize = "false" -- }}} -- {{{ Misc theme.awesome_icon = "/usr/share/awesome/themes/zenburn/awesome-icon.png" theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" -- }}} -- {{{ Layout icons -theme.layout_tile = theme.confdir .. "/icons/layouts/tile.png" -theme.layout_tileleft = theme.confdir .. "/icons/layouts/tileleft.png" -theme.layout_tilebottom = theme.confdir .. "/icons/layouts/tilebottom.png" -theme.layout_tiletop = theme.confdir .. "/icons/layouts/tiletop.png" -theme.layout_fairv = theme.confdir .. "/icons/layouts/fairv.png" -theme.layout_fairh = theme.confdir .. "/icons/layouts/fairh.png" -theme.layout_spiral = theme.confdir .. "/icons/layouts/spiral.png" -theme.layout_dwindle = theme.confdir .. "/icons/layouts/dwindle.png" -theme.layout_max = theme.confdir .. "/icons/layouts/max.png" -theme.layout_fullscreen = theme.confdir .. "/icons/layouts/fullscreen.png" -theme.layout_magnifier = theme.confdir .. "/icons/layouts/magnifier.png" -theme.layout_floating = theme.confdir .. "/icons/layouts/floating.png" +theme.layout_tile = theme._icondir .. "/layouts/tile.png" +theme.layout_tileleft = theme._icondir .. "/layouts/tileleft.png" +theme.layout_tilebottom = theme._icondir .. "/layouts/tilebottom.png" +theme.layout_tiletop = theme._icondir .. "/layouts/tiletop.png" +theme.layout_fairv = theme._icondir .. "/layouts/fairv.png" +theme.layout_fairh = theme._icondir .. "/layouts/fairh.png" +theme.layout_spiral = theme._icondir .. "/layouts/spiral.png" +theme.layout_dwindle = theme._icondir .. "/layouts/dwindle.png" +theme.layout_max = theme._icondir .. "/layouts/max.png" +theme.layout_fullscreen = theme._icondir .. "/layouts/fullscreen.png" +theme.layout_magnifier = theme._icondir .. "/layouts/magnifier.png" +theme.layout_floating = theme._icondir .. "/layouts/floating.png" -- }}} -- {{{ Widget icons -theme.widget_cpu = theme.confdir .. "/icons/taskbar/cpu.png" -theme.widget_bat = theme.confdir .. "/icons/taskbar/bat.png" -theme.widget_mem = theme.confdir .. "/icons/taskbar/mem.png" -theme.widget_fs = theme.confdir .. "/icons/taskbar/disk.png" -theme.widget_net = theme.confdir .. "/icons/taskbar/down.png" -theme.widget_netup = theme.confdir .. "/icons/taskbar/up.png" -theme.widget_wifi = theme.confdir .. "/icons/taskbar/wifi.png" -theme.widget_mail = theme.confdir .. "/icons/taskbar/mail.png" -theme.widget_vol = theme.confdir .. "/icons/taskbar/vol.png" -theme.widget_org = theme.confdir .. "/icons/taskbar/cal.png" -theme.widget_date = theme.confdir .. "/icons/taskbar/time.png" -theme.widget_crypto = theme.confdir .. "/icons/taskbar/crypto.png" -theme.widget_sep = theme.confdir .. "/icons/taskbar/separator.png" +theme.widget_cpu = theme._icondir .. "/taskbar/cpu.png" +theme.widget_bat = theme._icondir .. "/taskbar/bat.png" +theme.widget_mem = theme._icondir .. "/taskbar/mem.png" +theme.widget_fs = theme._icondir .. "/taskbar/disk.png" +theme.widget_net = theme._icondir .. "/taskbar/down.png" +theme.widget_netup = theme._icondir .. "/taskbar/up.png" +theme.widget_wifi = theme._icondir .. "/taskbar/wifi.png" +theme.widget_mail = theme._icondir .. "/taskbar/mail.png" +theme.widget_vol = theme._icondir .. "/taskbar/vol.png" +theme.widget_org = theme._icondir .. "/taskbar/cal.png" +theme.widget_date = theme._icondir .. "/taskbar/time.png" +theme.widget_crypto = theme._icondir .. "/taskbar/crypto.png" +theme.widget_sep = theme._icondir .. "/taskbar/separator.png" -- }}} -- {{{ Titlebar icons -theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png" -theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png" +theme.titlebar_close_button_focus = theme._icondir .. "/titlebar/close_focus.png" +theme.titlebar_close_button_normal = theme._icondir .. "/titlebar/close_normal.png" + +theme.titlebar_ontop_button_focus_active = theme._icondir .. "/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = theme._icondir .. "/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = theme._icondir .. "/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = theme._icondir .. "/titlebar/ontop_normal_inactive.png" + +theme.titlebar_sticky_button_focus_active = theme._icondir .. "/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = theme._icondir .. "/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = theme._icondir .. "/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = theme._icondir .. "/titlebar/sticky_normal_inactive.png" + +theme.titlebar_floating_button_focus_active = theme._icondir .. "/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = theme._icondir .. "/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = theme._icondir .. "/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = theme._icondir .. "/titlebar/floating_normal_inactive.png" + +theme.titlebar_maximized_button_focus_active = theme._icondir .. "/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = theme._icondir .. "/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = theme._icondir .. "/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = theme._icondir .. "/titlebar/maximized_normal_inactive.png" -- }}} -- }}} return theme
nblock/config
4969f0212574ffc350e8b91e9ea1e9f2eda7e506
add mediwiki support in vim
diff --git a/ctags b/ctags index 9530624..1891ced 100644 --- a/ctags +++ b/ctags @@ -1,18 +1,25 @@ --langdef=latex --langmap=latex:.tex --regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/part \2/s,part/ --regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/part \1/s,part/ --regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/ \2/s,chapter/ --regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/ \1/s,chapter/ --regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\. \2/s,section/ --regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\. \1/s,section/ --regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\. \2/s,subsection/ --regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\. \1/s,subsection/ --regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\.\. \2/s,subsubsection/ --regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\.\. \1/s,subsubsection/ --regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic/ --regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/L,listing/ --regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/ --regex-latex=/\\ref[[:space:]]*\{([^}]+)\}/\1/r,ref/ --regex-latex=/\\pageref[[:space:]]*\{([^}]+)\}/\1/p,pageref/ --regex-make=/^([^:# \t]+)[ \t]*[:]{1,2}/\1/t,targets/ +--langdef=mediawiki +--langmap=mediawiki:.wiki +--regex-mediawiki=/^=[[:space:]]?([^=]+)[[:space:]]?=$/\1/h,header/ +--regex-mediawiki=/^==[[:space:]]?([^=]+)[[:space:]]?==$/. \1/h,header/ +--regex-mediawiki=/^===[[:space:]]?([^=]+)[[:space:]]?===$/. \1/h,header/ +--regex-mediawiki=/^====[[:space:]]?([^=]+)[[:space:]]?====$/. \1/h,header/ +--regex-mediawiki=/^=====[[:space:]]?([^=]+)[[:space:]]?=====$/. \1/h,header/ diff --git a/vimrc b/vimrc index 7ebb7cb..df4536b 100644 --- a/vimrc +++ b/vimrc @@ -1,202 +1,212 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' Bundle 'vim-scripts/AutoTag' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> map <leader>cf [[kV][,c<space><CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" let g:UltiSnipsDontReverseSearchPath="1" let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] py import sys; sys.path.append("/home/flo/.vim/nblock-snippets") "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 -" tagbar +" tagbar latex support let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } +" tagbar mediawiki support +autocmd FileType mediawiki :!ctags % +let g:tagbar_type_mediawiki = { + \ 'ctagstype' : 'mediawiki', + \ 'kinds' : [ + \ 'h:header', + \ ], + \ 'sort' : 0 + \ } + "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
c0d504c8fac117ad183383a1ff6ff8f79cba3e1b
rework backup-android script
diff --git a/bin/backup-android b/bin/backup-android index 2b7bb37..5d1aa6a 100755 --- a/bin/backup-android +++ b/bin/backup-android @@ -1,50 +1,59 @@ #!/bin/zsh -#a simple script to backup android phones +# a simple script to backup android phones MARKER="backup-android.marker" BASE="/media" DST="$HOME/backup/android" RSYNC="/usr/bin/rsync" -#copy titanium backup function backup_titanium { DST_TITANIUM="$DST/titanium-backup" - if [[ ! -d $DST_TITANIUM ]];then mkdir $DST_TITANIUM;fi + if [[ ! -d "$DST_TITANIUM" ]]; then mkdir "$DST_TITANIUM";fi $RSYNC -av "$SRC/TitaniumBackup/" "$DST_TITANIUM/`date +'%Y-%m-%d'`" } -#copy clockworkmod-backup function backup_clockworkmod { $RSYNC -av "$SRC/clockworkmod/backup/" "$DST/clockworkmod-backup" } -#do the work +function copy_passwordsafe { + $RSYNC -av "$HOME/passwords.kdb" "$SRC/keepassx/" +} + +function backup_osmtracker { + TMP="$SRC/osmtracker" + if [[ -d "$TMP" ]]; then + cd "$TMP" + ls | grep -P "^[0-9]{4}-[0-9]{2}-[0-9]{2}" | xargs -I '{}' mv '{}' $HOME/osm/'{}' + fi +} + +########################################################################### +# to the hard work # +########################################################################### #search $BASE for marker foreach item in `ls $BASE`;do - if [ -e $BASE/$item/$MARKER ];then SRC="$BASE/$item";fi + if [ -e "$BASE/$item/$MARKER" ];then SRC="$BASE/$item";fi done if [[ ${SRC} == "" ]]; then echo "could not find a valid android device under $BASE. Make sure it is mounted." return -1 fi -#get the owner of the device OWNER=`cat "$SRC/$MARKER"` +DST="$DST/$OWNER" case "$OWNER" in -"flo" | "tina") - DST="$DST/$OWNER" +"flo") backup_titanium backup_clockworkmod + backup_osmtracker + copy_passwordsafe ;; -"flo") - #mv osmtracker in osm-folder - cd "$SRC/osmtracker" - ls | grep -P "^[0-9]{4}-[0-9]{2}-[0-9]{2}" | xargs -I '{}' mv '{}' $HOME/osm/'{}' - - #copy passwords to device - $RSYNC -av "$HOME/passwords.kdb" "$SRC/keepassx/" +"tina") + backup_titanium + backup_clockworkmod ;; *) - echo "no owner found in $SRC/$MARKER" + echo "no owner found in $SRC/$MARKER." ;; esac
nblock/config
331fd1461ee3de44d1c937abc535f656f0c7a7a7
default to neo
diff --git a/xinitrc b/xinitrc index 5a6caa8..88709ad 100644 --- a/xinitrc +++ b/xinitrc @@ -1,8 +1,8 @@ #!/bin/sh eval "$(gpg-agent --daemon --enable-ssh-support)" urxvtd -q -f -o xrdb -load ~/.Xresources xmodmap .Xmodmap & -setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll +setxkbmap -layout de -variant neo nm-applet --sm-disable & exec dbus-launch awesome
nblock/config
660ac4347ff8d6a5d2f1f28b089ce7f8ab25bbbb
add AutoTag to vim
diff --git a/vimrc b/vimrc index 9ec155b..df51d99 100644 --- a/vimrc +++ b/vimrc @@ -1,200 +1,201 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' +Bundle 'vim-scripts/AutoTag' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" let g:UltiSnipsDontReverseSearchPath="1" let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
d8048e2640f78f943efad9bbe289cbe05791a9d5
use another method to set the remote TERM
diff --git a/tmux.conf b/tmux.conf index 87b95a6..b910862 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,15 +1,14 @@ setw -g mode-keys vi set-window-option -g mode-mouse on bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R unbind % bind | split-window -h bind ? split-window -v bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'" - diff --git a/xinitrc b/xinitrc index 9dc988c..c42f8da 100644 --- a/xinitrc +++ b/xinitrc @@ -1,8 +1,8 @@ #!/bin/sh eval "$(gpg-agent --daemon --enable-ssh-support)" urxvtd -q -f -o xrdb -load ~/.Xresources xmodmap .Xmodmap & -#setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll +setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll nm-applet --sm-disable & exec ck-launch-session dbus-launch awesome diff --git a/zshrc b/zshrc index bce51f9..690ce16 100644 --- a/zshrc +++ b/zshrc @@ -1,225 +1,228 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt PROMPT_SUBST # Enables additional prompt extentions unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 -export TERM=rxvt-unicode +export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } +#set TERM only for ssh +alias ssh='env TERM=rxvt-unicode ssh' + # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward #edit current line in vim autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; *.tar.xz) tar -Jxf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
b3b9616b501ac02f6ece2d9e122d2fb15685c801
use external repo for snippets
diff --git a/install.sh b/install.sh index 015228e..7b682a4 100755 --- a/install.sh +++ b/install.sh @@ -1,34 +1,29 @@ #!/bin/sh set -e #set -x #link files for item in `find $PWD -maxdepth 1 -mindepth 1 -type f \( ! -iname "install.sh" ! -iname "README.markdown" \) -printf "%P\n"`;do ln -snf "$PWD/$item" "$HOME/.$item" done #process .config for item in `find "$PWD/config" -maxdepth 1 -mindepth 1 -printf "%P\n"`;do ln -snf "$PWD/config/$item" "$HOME/.config/$item" done -#process .vim -for item in `find "$PWD/vim" -maxdepth 1 -mindepth 1 -printf "%P\n"`;do - ln -snf "$PWD/vim/$item" "$HOME/.vim/$item" -done - #solarized-task ln -snf "$PWD/solarized-task" "$HOME/.solarized-task" #bin ln -snf "$PWD/bin" "$HOME/bin" #cmus ln -snf "$PWD/cmus" "$HOME/.cmus" #change login shell to zsh if ! grep -q "^$USER:.*zsh$" /etc/passwd; then echo "Changing login shell for $USER to zsh ..." chsh -s `which zsh` fi diff --git a/vim/nblock-snippets/all.snippets b/vim/nblock-snippets/all.snippets deleted file mode 100644 index 3fbd4ba..0000000 --- a/vim/nblock-snippets/all.snippets +++ /dev/null @@ -1,15 +0,0 @@ -snippet author "My name and email" -Florian Preinstorfer <[email protected]> -endsnippet - -snippet date "current date" -`date +%d.%m.%Y` -endsnippet - -snippet time "current time" -`date +%H:%M` -endsnippet - -snippet datetime "current date and time" -`date "+%d.%m.%Y - %H:%M"` -endsnippet diff --git a/vim/nblock-snippets/c.snippets b/vim/nblock-snippets/c.snippets deleted file mode 100644 index 90318c8..0000000 --- a/vim/nblock-snippets/c.snippets +++ /dev/null @@ -1,105 +0,0 @@ - -########################################################################### -# TextMate Snippets # -########################################################################### -snippet def "#ifndef ... #define ... #endif" -#ifndef ${1/([A-Za-z0-9_]+).*/$1/} -#define ${1:SYMBOL} ${2:value} -#endif -endsnippet - -snippet #if "#if #endif" !b -#if ${1:0} -${VISUAL:code}$0 -#endif -endsnippet - -snippet inc "#include local header (inc)" -#include "${1:`!p snip.rv = snip.basename + '.h'`}" -endsnippet - -snippet Inc "#include <> (Inc)" -#include <${1:.h}> -endsnippet - -snippet mark "#pragma mark (mark)" -#if 0 -${1:#pragma mark - -}#pragma mark $2 -#endif - -$0 -endsnippet - -snippet main "main() (main)" -int main(int argc, char const *argv[]){ - ${0:/* code */} - return 0; -} -endsnippet - -snippet for "for int loop (fori)" -for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}){ - ${0:/* code */} -} -endsnippet - -snippet enum "Enumeration" -enum ${1:name} { $0 }; -endsnippet - -snippet once "Include header once only guard" -#ifndef ${1:`!p -if not snip.c: - import random, string - name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper() - rand = ''.join(random.sample(string.ascii_letters+string.digits, 8)) - snip.rv = ('%s_%s' % (name,rand)).upper() -else: - snip.rv = snip.c`} -#define $1 - -${0} - -#endif /* end of include guard: $1 */ - -endsnippet - -snippet td "Typedef" -typedef ${1:int} ${2:MyCustomType}; -endsnippet - -snippet do "do...while loop (do)" -do { - ${0:/* code */} -} while(${1:/* condition */}); -endsnippet - -snippet while "while loop (while)" -while(${1:/* condition */}){ - ${0:/* code */} -} -endsnippet - -snippet fprintf "fprintf ..." -fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/} -endsnippet - -snippet if "if .. (if)" -if (${1:/* condition */}) -{ - ${0:/* code */} -} -endsnippet - -snippet printf "printf .. (printf)" -printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/} -endsnippet - -snippet st "struct" -struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}{ - ${0:/* data */} -}; -endsnippet - -# vim:ft=snippets: diff --git a/vim/nblock-snippets/dokuwiki.snippets b/vim/nblock-snippets/dokuwiki.snippets deleted file mode 100644 index 4ea3f7c..0000000 --- a/vim/nblock-snippets/dokuwiki.snippets +++ /dev/null @@ -1,88 +0,0 @@ -global !p -def complete (t, opts): - if t: - opts = [m[len(t):] for m in opts if m.startswith(t)] - if len(opts) == 1: - return opts[0] - return "(" + "|".join(opts) + ")" -endglobal - -snippet h1 "Header Level 1" b -====== ${VISUAL}$1 ====== -$0 -endsnippet - -snippet h2 "Header Level 2" b -===== ${VISUAL}$1 ===== -$0 -endsnippet - -snippet h3 "Header Level 3" b -==== ${VISUAL}$1 ==== -$0 -endsnippet - -snippet h4 "Header Level 4" b -=== ${VISUAL}$1 === -$0 -endsnippet - -snippet h5 "Header Level 5" b -== ${VISUAL}$1 == -$0 -endsnippet - -snippet ** "bold text" -**${VISUAL}$1** -$0 -endsnippet - -snippet // "italic text" -//${VISUAL}$1// -endsnippet - -snippet __ "underlined text" -__${VISUAL}$1__ -endsnippet - -snippet '' "monospaced text" -''${VISUAL}$1'' -endsnippet - -snippet del "deleted text" -<del>${VISUAL}$1</del> -endsnippet - -snippet sup "superscript text" -<sup>${VISUAL}$1</sup> -endsnippet - -snippet sub "subscript text" -<sub>${VISUAL}$1</sub> -endsnippet - -snippet * "bulletpoint list" b - * ${VISUAL}$1 -endsnippet - -snippet - "ordered list" b - - ${VISUAL}$1 -endsnippet - -snippet code "code" -<code> -${VISUAL}$1 -</code> -endsnippet - -snippet link "a link to another ressource" -[[${VISUAL}$1|$2]] -endsnippet - -snippet res "external ressources such as images and files" -{{${VISUAL}$1|$2}} -endsnippet - -snippet ~~ "control macro" -~~$1`!p snip.rv=complete(t[1], ['NOTOC', 'NOCACHE'])`~~ -endsnippet diff --git a/vimrc b/vimrc index 77fb464..9ec155b 100644 --- a/vimrc +++ b/vimrc @@ -1,199 +1,200 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" +let g:UltiSnipsDontReverseSearchPath="1" let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
f3ef168b9846034b3cd3e77b9426469085afe352
remove ultisnips dist
diff --git a/cmus/autosave b/cmus/autosave index c55c325..a2071fa 100644 --- a/cmus/autosave +++ b/cmus/autosave @@ -1,142 +1,142 @@ set aaa_mode=album set altformat_current= %F set altformat_playlist= %f%= %d set altformat_title=%f set altformat_trackwin= %f%= %d set auto_reshuffle=false set buffer_seconds=10 set color_cmdline_bg=default set color_cmdline_fg=default set color_error=lightred set color_info=lightyellow set color_separator=green set color_statusline_bg=240 set color_statusline_fg=white set color_titleline_bg=240 set color_titleline_fg=white set color_win_bg=default set color_win_cur=gray set color_win_cur_sel_bg=166 set color_win_cur_sel_fg=237 set color_win_dir=blue set color_win_fg=yellow set color_win_inactive_cur_sel_bg=252 set color_win_inactive_cur_sel_fg=lightyellow set color_win_inactive_sel_bg=252 set color_win_inactive_sel_fg=black set color_win_sel_bg=237 set color_win_sel_fg=166 set color_win_title_bg=252 set color_win_title_fg=black set confirm_run=true set continue=true set display_artist_sort_name=false set dsp.alsa.device=default set dsp.ao.buffer_size=16384 set dsp.ao.driver= set dsp.ao.wav_counter=1 set dsp.ao.wav_dir=/home/flo set dsp.oss.device= set format_current= %a - [%02n] %t - %l [%y] %= %F set format_playlist= %-20a %02n. %t%= %y %d set format_playlist_va= %-20A %3n. %t (%a)%= %y %d set format_title=%a - %l - %t (%y) set format_trackwin= %02n. %t%= %y %d set format_trackwin_va=%3n. %t (%a)%= %y %d set id3_default_charset=ISO-8859-1 set lib_sort=artist album discnumber tracknumber title filename set mixer.alsa.channel=PCM set mixer.alsa.device=default set mixer.oss.channel=PCM set mixer.oss.device= set mixer.pulse.restore_volume=1 set output_plugin=alsa set passwd= set pl_sort= -set play_library=true +set play_library=false set play_sorted=true set repeat=true set repeat_current=false set replaygain=disabled set replaygain_limit=true set replaygain_preamp=6.000000 set resume=true set set_term_title=false set show_hidden=false set show_remaining_time=true set shuffle=true set smart_artist_sort=true set softvol=false set softvol_state=100 100 set status_display_program=/home/flo/development/cmus-notify/cmus-notify bind browser backspace browser-up bind browser i toggle show_hidden bind common + vol +10% bind common , seek -1m bind common - vol -10% bind common . seek +1m bind common 1 view tree bind common 2 view sorted bind common 3 view playlist bind common 4 view queue bind common 5 view browser bind common 6 view filters bind common 7 view settings bind common = vol +10% bind common C toggle continue bind common D win-remove bind common E win-add-Q bind common G win-bottom bind common I echo {} bind common L push live-filter bind common M toggle play_library bind common N search-prev bind common P win-mv-before bind common [ vol +1 +0 bind common ] vol +0 +1 bind common ^B win-page-up bind common ^C echo Type :quit<enter> to exit cmus. bind common ^F win-page-down bind common ^L refresh bind common a win-add-l bind common b player-next bind common c player-pause bind common delete win-remove bind common down win-down bind common e win-add-q bind common end win-bottom bind common enter win-activate bind common g win-top bind common h seek -5 bind common home win-top bind common i win-sel-cur bind common j win-down bind common k win-up bind common l seek +5 bind common left seek -5 bind common m toggle aaa_mode bind common n search-next bind common o toggle play_sorted bind common p win-mv-after bind common page_down win-page-down bind common page_up win-page-up bind common r toggle repeat bind common right seek +5 bind common s toggle shuffle bind common space win-toggle bind common t toggle show_remaining_time bind common tab win-next bind common u win-update bind common up win-up bind common v player-stop bind common x player-play bind common y win-add-p bind common z player-prev bind common { vol -1 -0 bind common } vol -0 -1 fset 90s=date>=1990&date<2000 fset missing-tag=!~T fset mp3=filename="*.mp3" fset ogg=filename="*.ogg" fset ogg-or-mp3=ogg|mp3 factivate diff --git a/vim/ultisnips-dist/README b/vim/ultisnips-dist/README deleted file mode 100644 index eafd086..0000000 --- a/vim/ultisnips-dist/README +++ /dev/null @@ -1,21 +0,0 @@ -This directory contains the main scripts that come bundled with UltiSnips. - -Standing On The Shoulders of Giants -=================================== - -The snippets have been collected from various other project which I want to -express my gratitude for. My main source for inspiration where the following -two projects: - - TextMate: http://svn.textmate.org/trunk/Bundles/ - SnipMate: http://code.google.com/p/snipmate/ - -All snippets from those sources were copied and cleaned up, so that they are - - not using shell script, only python (so they are cross platform compatible) - - not using any feature that UltiSnips doesn't offer - -UltiSnips has seen contributions by various individuals. Those contributions -have been merged into this collection seamlessly and without further comments. - --- vim:ft=rst:nospell: - diff --git a/vim/ultisnips-dist/all.snippets b/vim/ultisnips-dist/all.snippets deleted file mode 100644 index 8844e28..0000000 --- a/vim/ultisnips-dist/all.snippets +++ /dev/null @@ -1,112 +0,0 @@ -# This file contains snippets that are always defined. I personally -# have snippets for signatures and often needed texts - -############## -# NICE BOXES # -############## -global !p -import string, vim - -""" Maps a filetype to comment format used for boxes. -Automatically filled during usage""" -_commentDict = { } - -def _parse_comments(s): - """ Parses vim's comments option to extract comment format """ - i = iter(s.split(",")) - - rv = [] - try: - while True: - # get the flags and text of a comment part - flags,text = i.next().split(':', 1) - - if len(flags) == 0: - if len(text) == 1: - rv.append((text,text,text, "")) - # parse 3-part comment, but ignore those with O flag - elif flags[0] == 's' and 'O' not in flags: - ctriple = [] - indent = "" - - if flags[-1] in string.digits: - indent = " " * int(flags[-1]) - ctriple.append(text) - - flags,text = i.next().split(':', 1) - assert(flags[0] == 'm') - ctriple.append(text) - - flags,text = i.next().split(':', 1) - assert(flags[0] == 'e') - ctriple.append(text) - ctriple.append(indent) - - rv.append(ctriple) - - elif flags[0] == 'b': - if len(text) == 1: - rv.insert(0, (text,text,text, "")) - - except StopIteration: - return rv - -def _get_comment_format(): - """ Returns a 4-element tuple representing the comment format for - the current file. """ - - ft = vim.eval("&filetype") - # check if the comment dict has the format for the current file - if _commentDict.has_key(ft): - return _commentDict[ft] - - # otherwise parse vim's comments and add it for later use - commentformat = _parse_comments(vim.eval("&comments"))[0] - _commentDict[ft] = commentformat - - return commentformat - - -def make_box(twidth, bwidth = None): - if bwidth is None: - bwidth = twidth + 2 - b,m,e,i = _get_comment_format() - sline = b + m + bwidth*m + 2*m - nspaces = (bwidth - twidth)//2 - mlines = i + m + " " + " "*nspaces - mlinee = " " + " "*(bwidth-twidth-nspaces) + m - eline = i + 2*m + bwidth*m + m + e - return sline, mlines, mlinee, eline -endglobal - -snippet box "A nice box with the current comment symbol" b -`!p -box = make_box(len(t[1])) -snip.rv = box[0] + '\n' + box[1] -`${1:content}`!p -box = make_box(len(t[1])) -snip.rv = box[2] + '\n' + box[3]` -$0 -endsnippet - -snippet bbox "A nice box over the full width" b -`!p -box = make_box(len(t[1]), 71) -snip.rv = box[0] + '\n' + box[1] -`${1:content}`!p -box = make_box(len(t[1]), 71) -snip.rv = box[2] + '\n' + box[3]` -$0 -endsnippet - -########################## -# LOREM IPSUM GENERATORS # -########################## -snippet lorem "Lorem Ipsum - 50 Words" b -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod -tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At -vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, -no sea takimata sanctus est Lorem ipsum dolor sit amet. -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/bindzone.snippets b/vim/ultisnips-dist/bindzone.snippets deleted file mode 100644 index 034ccde..0000000 --- a/vim/ultisnips-dist/bindzone.snippets +++ /dev/null @@ -1,27 +0,0 @@ -global !p -def newsoa(): - import datetime - now = datetime.datetime.now() - # return standard SOA formatted serial for today - return now.strftime("%Y%m%d00") -endglobal - -snippet zone "Bootstrap a new Bind zonefile" b -$TTL 86400 -@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.( - `!p snip.rv = newsoa()`; serial - 21600; refresh every 6 hours - 3600; retry after one hour - 604800; expire after a week - 86400 ); minimum TTL of 1 day - - IN NS ns01.$1. - IN MX 10 mail.$1. - -ns01.$1 IN A -mail.$1 IN A -endsnippet - -snippet A "Insert A Record" b -${1:hostname} IN A ${2:ip} -endsnippet diff --git a/vim/ultisnips-dist/coffee.snippets b/vim/ultisnips-dist/coffee.snippets deleted file mode 100644 index 8f347f1..0000000 --- a/vim/ultisnips-dist/coffee.snippets +++ /dev/null @@ -1,90 +0,0 @@ -# From the TextMate bundle - -snippet fun "Function" b -${1:name} = (${2:args}) -> - ${0:# body...} -endsnippet - -snippet bfun "Function (bound)" b -${1:(${2:args}) }=> - ${0:# body...} -endsnippet - -snippet if "If" b -if ${1:condition} - ${0:# body...} -endsnippet - -snippet ife "If .. Else" b -if ${1:condition} - ${2:# body...} -else - ${3:# body...} -endsnippet - -snippet elif "Else if" b -else if ${1:condition} - ${0:# body...} -endsnippet - -snippet ifte "Ternary if" b -if ${1:condition} then ${2:value} else ${3:other} -endsnippet - -snippet unl "Unless" b -${1:action} unless ${2:condition} -endsnippet - -snippet fora "Array Comprehension" b -for ${1:name} in ${2:array} - ${0:# body...} -endsnippet - -snippet foro "Object Comprehension" b -for ${1:key}, ${2:value} of ${3:Object} - ${0:# body...} -endsnippet - -snippet forr "Range Comprehension (inclusive)" b -for ${1:name} in [${2:start}..${3:finish}]${4: by ${5:step}} - ${0:# body...} -endsnippet - -snippet forrex "Range Comprehension (exclusive)" b -for ${1:name} in [${2:start}...${3:finish}]${4: by ${5:step}} - ${0:# body...} -endsnippet - -snippet swi "Switch" b -switch ${1:object} - when ${2:value} - ${0:# body...} -endsnippet - -snippet cla "Class" b -class ${1:ClassName}${2: extends ${3:Ancestor}} - - ${4:constructor: (${5:args}) -> - ${6:# body...}} - $7 -endsnippet - -snippet try "Try .. Catch" b -try - $1 -catch ${2:error} - $3 -endsnippet - -snippet req "Require" b -${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'}) -endsnippet - -snippet # "Interpolated Code" -#{$1}$0 -endsnippet - -snippet log "Log" b -console.log ${1:"${2:msg}"} -endsnippet - diff --git a/vim/ultisnips-dist/coffee_jasmine.snippets b/vim/ultisnips-dist/coffee_jasmine.snippets deleted file mode 100644 index 47d1e6b..0000000 --- a/vim/ultisnips-dist/coffee_jasmine.snippets +++ /dev/null @@ -1,163 +0,0 @@ -# -# CoffeeScript versions -- adapted from the JS TextMate bundle + additions -# for some jasmine-jquery matchers -# -extends coffee - -snippet des "Describe (coffee)" b -describe '${1:description}', -> - $0 -endsnippet - -snippet it "it (coffee)" b -it '${1:description}', -> - $0 -endsnippet - -snippet bef "before each (coffee)" b -beforeEach -> - $0 -endsnippet - -snippet aft "after each (coffee)" b -afterEach -> - $0 -endsnippet - -snippet any "any (coffee)" b -jasmine.any($1) -endsnippet - -snippet ru "runs (coffee)" b -runs -> - $0 -endsnippet - -snippet wa "waits (coffee)" b -waits($1) -endsnippet - -snippet ex "expect (coffee)" b -expect(${1:target})$0 -endsnippet - -snippet ee "expect to equal (coffee)" b -expect(${1:target}).toEqual(${2:value}) -endsnippet - -snippet em "expect to match (coffee)" b -expect(${1:target}).toMatch(${2:pattern}) -endsnippet - -snippet eha "expect to have attribute (coffee)" b -expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'}) -endsnippet - -snippet et "expect to be truthy (coffee)" b -expect(${1:target}).toBeTruthy() -endsnippet - -snippet ef "expect to be falsy (coffee)" b -expect(${1:target}).toBeFalsy() -endsnippet - -snippet ed "expect to be defined (coffee)" b -expect(${1:target}).toBeDefined() -endsnippet - -snippet en "expect to be null (coffee)" b -expect(${1:target}).toBeNull() -endsnippet - -snippet ec "expect to contain (coffee)" b -expect(${1:target}).toContain(${2:value}) -endsnippet - -snippet ev "expect to be visible (coffee)" b -expect(${1:target}).toBeVisible() -endsnippet - -snippet eh "expect to be hidden (coffee)" b -expect(${1:target}).toBeHidden() -endsnippet - -snippet notx "expect not (coffee)" b -expect(${1:target}).not$0 -endsnippet - -snippet note "expect not to equal (coffee)" b -expect(${1:target}).not.toEqual(${2:value}) -endsnippet - -snippet notm "expect not to match (coffee)" b -expect(${1:target}).not.toMatch(${2:pattern}) -endsnippet - -snippet notha "expect to not have attribute (coffee)" b -expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'}) -endsnippet - -snippet nott "expect not to be truthy (coffee)" b -expect(${1:target}).not.toBeTruthy() -endsnippet - -snippet notf "expect not to be falsy (coffee)" b -expect(${1:target}).not.toBeFalsy() -endsnippet - -snippet notd "expect not to be defined (coffee)" b -expect(${1:target}).not.toBeDefined() -endsnippet - -snippet notn "expect not to be null (coffee)" b -expect(${1:target}).not.toBeNull() -endsnippet - -snippet notc "expect not to contain (coffee)" b -expect(${1:target}).not.toContain(${2:value}) -endsnippet - -snippet notv "expect not to be visible (coffee)" b -expect(${1:target}).not.toBeVisible() -endsnippet - -snippet noth "expect not to be hidden (coffee)" b -expect(${1:target}).not.toBeHidden() -endsnippet - -snippet s "spy on (coffee)" b -spyOn(${1:object}, "${2:method}")$0 -endsnippet - -snippet sr "spy on and return (coffee)" b -spyOn(${1:object}, "${2:method}").andReturn(${3:arguments}) -endsnippet - -snippet st "spy on and throw (coffee)" b -spyOn(${1:object}, "${2:method}").andThrow(${3:exception}) -endsnippet - -snippet sct "spy on and call through (coffee)" b -spyOn(${1:object}, "${2:method}").andCallThrough() -endsnippet - -snippet scf "spy on and call fake (coffee)" b -spyOn(${1:object}, "${2:method}").andCallFake(${3:function}) -endsnippet - -snippet esc "expect was called (coffee)" b -expect(${1:target}).wasCalled() -endsnippet - -snippet escw "expect was called with (coffee)" b -expect(${1:target}).wasCalledWith(${2:arguments}) -endsnippet - -snippet notsc "expect was not called (coffee)" b -expect(${1:target}).wasNotCalled() -endsnippet - -snippet noscw "expect was not called with (coffee)" b -expect(${1:target}).wasNotCalledWith(${2:arguments}) -endsnippet - diff --git a/vim/ultisnips-dist/cpp.snippets b/vim/ultisnips-dist/cpp.snippets deleted file mode 100644 index 9d2eb86..0000000 --- a/vim/ultisnips-dist/cpp.snippets +++ /dev/null @@ -1,52 +0,0 @@ -extends c - -########################################################################### -# TextMate Snippets # -########################################################################### -snippet beginend "$1.begin(), $1.end() (beginend)" -${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end() -endsnippet - -snippet cl "class .. (class)" -class ${1:`!p snip.rv = snip.basename or "name"`} -{ -public: - ${1/(\w+).*/$1/} (${2:arguments}); - virtual ~${1/(\w+).*/$1/} (); - -private: - ${0:/* data */} -}; -endsnippet - -snippet ns "namespace .. (namespace)" -namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`} -{ - $0 -}${1/.+/ \/* /m}$1${1/.+/ *\/ /m} -endsnippet - -snippet readfile "read file (readF)" -std::vector<char> v; -if (FILE *fp = fopen(${1:"filename"}, "r")) -{ - char buf[1024]; - while(size_t len = fread(buf, 1, sizeof(buf), fp)) - v.insert(v.end(), buf, buf + len); - fclose(fp); -} -endsnippet - -snippet map "std::map (map)" -std::map<${1:key}, ${2:value}> map$0; -endsnippet - -snippet vector "std::vector (v)" -std::vector<${1:char}> v$0; -endsnippet - -snippet tp "template <typename ..> (template)" -template <typename ${1:_InputIter}> -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/css.snippets b/vim/ultisnips-dist/css.snippets deleted file mode 100644 index d14d51c..0000000 --- a/vim/ultisnips-dist/css.snippets +++ /dev/null @@ -1,405 +0,0 @@ -########################################################################### -# Most of these came from TextMate # -########################################################################### - -snippet ! "!important CSS (!)" -${1:!important} -endsnippet - -snippet fixed "Fixed Position Bottom 100% wide IE6" -${2:bottom: auto;}top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-${1:THE HEIGHT OF THIS THING IN PIXELS})); -${3:left: expression(eval(document.documentElement.scrollLeft)); -}${4:width: expression(eval(document.documentElement.clientWidth));}$0 -endsnippet - -snippet background "background-attachment: scroll:fixed (background)" -background-attachment: ${1:scroll/fixed};$0 -endsnippet - -snippet background "background-color: color-hex (background)" -background-color: #${1:DDD};$0 -endsnippet - -snippet background "background-color: color-name (background)" -background-color: ${1:red};$0 -endsnippet - -snippet background "background-color: color-rgb (background)" -background-color: rgb(${1:255},${2:255},${3:255});$0 -endsnippet - -snippet background "background-color: transparent (background)" -background-color: transparent;$0 -endsnippet - -snippet background "background-image: none (background)" -background-image: none;$0 -endsnippet - -snippet background "background-image: url (background)" -background-image: url($1);$0 -endsnippet - -snippet background "background-position: position (background)" -background-position: ${1:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0 -endsnippet - -snippet background "background-repeat: r:r-x:r-y:n-r (background)" -background-repeat: ${1:repeat/repeat-x/repeat-y/no-repeat};$0 -endsnippet - -snippet background "background: color image repeat attachment position (background)" -background:${6: #${1:DDD}} url($2) ${3:repeat/repeat-x/repeat-y/no-repeat} ${4:scroll/fixed} ${5:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0 -endsnippet - -snippet border "border-bottom-color: size style color (border)" -border-bottom-color: #${1:999};$0 -endsnippet - -snippet border "border-bottom-style: size style color (border)" -border-bottom-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 -endsnippet - -snippet border "border-bottom-width: size style color (border)" -border-bottom-width: ${1:1}px ${2:solid} #${3:999};$0 -endsnippet - -snippet border "border-bottom: size style color (border)" -border-bottom: ${1:1}px ${2:solid} #${3:999};$0 -endsnippet - -snippet border "border-color: color (border)" -border-color: ${1:999};$0 -endsnippet - -snippet border "border-left-color: color (border)" -border-right-color: #${1:999};$0 -endsnippet - -snippet border "border-left-style: style (border)" -border-left-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 -endsnippet - -snippet border "border-left-width: size (border)" -border-left-width: ${1:1}px -endsnippet - -snippet border "border-left: size style color (border)" -border-left: ${1:1}px ${2:solid} #${3:999};$0 -endsnippet - -snippet border "border-right-color: color (border)" -border-right-color: #${1:999};$0 -endsnippet - -snippet border "border-right-style: style (border)" -border-right-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 -endsnippet - -snippet border "border-right-width: size (border)" -border-right-width: ${1:1}px -endsnippet - -snippet border "border-right: size style color (border)" -border-right: ${1:1}px ${2:solid} #${3:999};$0 -endsnippet - -snippet border "border-style: style (border)" -border-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 -endsnippet - -snippet border "border-top-color: color (border)" -border-top-color: #${1:999};$0 -endsnippet - -snippet border "border-top-style: style (border)" -border-top-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 -endsnippet - -snippet border "border-top-width: size (border)" -border-top-width: ${1:1}px -endsnippet - -snippet border "border-top: size style color (border)" -border-top: ${1:1}px ${2:solid} #${3:999};$0 -endsnippet - -snippet border "border-width: width (border)" -border-width: ${1:1px};$0 -endsnippet - -snippet border "border: size style color (border)" -border: ${1:1px} ${2:solid} #${3:999};$0 -endsnippet - -snippet clear "clear: value (clear)" -clear: ${1:left/right/both/none};$0 -endsnippet - -snippet color "color: color-hex (color)" -color: #${1:DDD};$0 -endsnippet - -snippet color "color: color-name (color)" -color: ${1:red};$0 -endsnippet - -snippet color "color: color-rgb (color)" -color: rgb(${1:255},${2:255},${3:255});$0 -endsnippet - -snippet cursor "cursor: type (cursor)" -cursor: ${1:default/auto/crosshair/pointer/move/*-resize/text/wait/help};$0 -endsnippet - -snippet cursor "cursor: url (cursor)" -cursor: url($1);$0 -endsnippet - -snippet direction "direction: ltr|rtl (direction)" -direction: ${1:ltr|rtl};$0 -endsnippet - -snippet display "display: block (display)" -display: block;$0 -endsnippet - -snippet display "display: common-types (display)" -display: ${1:none/inline/block/list-item/run-in/compact/marker};$0 -endsnippet - -snippet display "display: inline (display)" -display: inline;$0 -endsnippet - -snippet display "display: table-types (display)" -display: ${1:table/inline-table/table-row-group/table-header-group/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption};$0 -endsnippet - -snippet float "float: left:right:none (float)" -float: ${1:left/right/none};$0 -endsnippet - -snippet font "font-family: family (font)" -font-family: ${1:Arial, "MS Trebuchet"}, ${2:sans-}serif;$0 -endsnippet - -snippet font "font-size: size (font)" -font-size: ${1:100%};$0 -endsnippet - -snippet font "font-style: normal:italic:oblique (font)" -font-style: ${1:normal/italic/oblique};$0 -endsnippet - -snippet font "font-variant: normal:small-caps (font)" -font-variant: ${1:normal/small-caps};$0 -endsnippet - -snippet font "font-weight: weight (font)" -font-weight: ${1:normal/bold};$0 -endsnippet - -snippet font "font: style variant weight size:line-height font -family (font)" -font: ${1:normal/italic/oblique} ${2:normal/small-caps} ${3:normal/bold} ${4:1em/1.5em} ${5:Arial}, ${6:sans-}serif;$0 -endsnippet - -snippet font "font: size font (font)" -font: ${1:75%} ${2:"Lucida Grande", "Trebuchet MS", Verdana,} ${3:sans-}serif;$0 -endsnippet - -snippet letter "letter-spacing: length-em (letter)" -letter-spacing: $1em;$0 -endsnippet - -snippet letter "letter-spacing: length-px (letter)" -letter-spacing: $1px;$0 -endsnippet - -snippet list "list-style-image: url (list)" -list-style-image: url($1);$0 -endsnippet - -snippet list "list-style-position: pos (list)" -list-style-position: ${1:inside/outside};$0 -endsnippet - -snippet list "list-style-type: asian (list)" -list-style-type: ${1:cjk-ideographic/hiragana/katakana/hiragana-iroha/katakana-iroha};$0 -endsnippet - -snippet list "list-style-type: marker(list)" -list-style-type: ${1:none/disc/circle/square};$0 -endsnippet - -snippet list "list-style-type: numeric (list)" -list-style-type: ${1:decimal/decimal-leading-zero/zero};$0 -endsnippet - -snippet list "list-style-type: other (list)" -list-style-type: ${1:hebrew/armenian/georgian};$0 -endsnippet - -snippet list "list-style-type: roman-alpha-greek (list)" -list-style-type: ${1:lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-latin/upper-latin};$0 -endsnippet - -snippet list "list-style: type position image (list)" -list-style: ${1:none/disc/circle/square/decimal/zero} ${2:inside/outside} url($3);$0 -endsnippet - -snippet margin "margin-bottom: length (margin)" -margin-bottom: ${1:20px};$0 -endsnippet - -snippet margin "margin-left: length (margin)" -margin-left: ${1:20px};$0 -endsnippet - -snippet margin "margin-right: length (margin)" -margin-right: ${1:20px};$0 -endsnippet - -snippet margin "margin-top: length (margin)" -margin-top: ${1:20px};$0 -endsnippet - -snippet margin "margin: all (margin)" -margin: ${1:20px};$0 -endsnippet - -snippet margin "margin: T R B L (margin)" -margin: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0 -endsnippet - -snippet margin "margin: V H (margin)" -margin: ${1:20px} ${2:0px};$0 -endsnippet - -snippet marker "marker-offset: auto (marker)" -marker-offset: auto;$0 -endsnippet - -snippet marker "marker-offset: length (marker)" -marker-offset: ${1:10px};$0 -endsnippet - -snippet overflow "overflow: type (overflow)" -overflow: ${1:visible/hidden/scroll/auto};$0 -endsnippet - -snippet padding "padding-bottom: length (margin)" -padding-bottom: ${1:20px};$0 -endsnippet - -snippet padding "padding-left: length (margin)" -padding-left: ${1:20px};$0 -endsnippet - -snippet padding "padding-right: length (margin)" -padding-right: ${1:20px};$0 -endsnippet - -snippet padding "padding-top: length (margin)" -padding-top: ${1:20px};$0 -endsnippet - -snippet padding "padding: T R B L (padding)" -padding: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0 -endsnippet - -snippet padding "padding: V H (padding)" -padding: ${1:20px} ${2:0px};$0 -endsnippet - -snippet padding "padding: all (padding)" -padding: ${1:20px};$0 -endsnippet - -snippet position "position: type (position)" -position: ${1:static/relative/absolute/fixed};$0 -endsnippet - -snippet { "properties { } ( } )" -{ - /* $1 */ - $0 - -endsnippet - -snippet scrollbar "scrollbar" -scrollbar-base-color: ${1:#CCCCCC};${2: -scrollbar-arrow-color: ${3:#000000}; -scrollbar-track-color: ${4:#999999}; -scrollbar-3dlight-color: ${5:#EEEEEE}; -scrollbar-highlight-color: ${6:#FFFFFF}; -scrollbar-face-color: ${7:#CCCCCC}; -scrollbar-shadow-color: ${9:#999999}; -scrollbar-darkshadow-color: ${8:#666666};} -endsnippet - -snippet selection "selection" -$1::-moz-selection, -$1::selection { - color: ${2:inherit}; - background: ${3:inherit}; -} -endsnippet - -snippet text "text-align: left:center:right (txt)" -text-align: ${1:left/right/center/justify};$0 -endsnippet - -snippet text "text-decoration: none:underline:overline:line-through:blink (text)" -text-decoration: ${1:none/underline/overline/line-through/blink};$0 -endsnippet - -snippet text "text-indent: length (text)" -text-indent: ${1:10}px;$0 -endsnippet - -snippet text "text-shadow: color-hex x y blur (text)" -text-shadow: #${1:DDD} ${2:10px} ${3:10px} ${4:2px};$0 -endsnippet - -snippet text "text-shadow: color-rgb x y blur (text)" -text-shadow: rgb(${1:255},${2:255},${3:255}) ${4:10px} ${5:10px} ${6:2px};$0 -endsnippet - -snippet text "text-shadow: none (text)" -text-shadow: none;$0 -endsnippet - -snippet text "text-transform: capitalize:upper:lower (text)" -text-transform: ${1:capitalize/uppercase/lowercase};$0 -endsnippet - -snippet text "text-transform: none (text)" -text-transform: none;$0 -endsnippet - -snippet vertical "vertical-align: type (vertical)" -vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0 -endsnippet - -snippet visibility "visibility: type (visibility)" -visibility: ${1:visible/hidden/collapse};$0 -endsnippet - -snippet white "white-space: normal:pre:nowrap (white)" -white-space: ${1:normal/pre/nowrap};$0 -endsnippet - -snippet word "word-spacing: length (word)" -word-spacing: ${1:10px};$0 -endsnippet - -snippet word "word-spacing: normal (word)" -word-spacing: normal;$0 -endsnippet - -snippet z "z-index: index (z)" -z-index: $1;$0 -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/django.snippets b/vim/ultisnips-dist/django.snippets deleted file mode 100644 index 59b77c5..0000000 --- a/vim/ultisnips-dist/django.snippets +++ /dev/null @@ -1,236 +0,0 @@ -# Generic Tags -snippet % -{% ${1} %}${2} -endsnippet - -snippet %% -{% ${1:tag_name} %} - ${2} -{% end$1 %} -endsnippet - -snippet { -{{ ${1} }}${2} -endsnippet - -# Template Tags - -snippet autoescape -{% autoescape ${1:off} %} - ${2} -{% endautoescape %} -endsnippet - -snippet block -{% block ${1} %} - ${2} -{% endblock %} -endsnippet - -snippet # -{# ${1:comment} #} -endsnippet - -snippet comment -{% comment %} - ${1} -{% endcomment %} -endsnippet - -snippet cycle -{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %} -endsnippet - -snippet debug -{% debug %} -endsnippet - -snippet extends -{% extends "${1:base.html}" %} -endsnippet - -snippet filter -{% filter ${1} %} - ${2} -{% endfilter %} -endsnippet - -snippet firstof -{% firstof ${1} %} -endsnippet - -snippet for -{% for ${1} in ${2} %} - ${3} -{% endfor %} -endsnippet - -snippet empty -{% empty %} - ${1} -endsnippet - -snippet if -{% if ${1} %} - ${2} -{% endif %} -endsnippet - -snippet else -{% else %} - ${1} -endsnippet - -snippet ifchanged -{% ifchanged %}${1}{% endifchanged %} -endsnippet - -snippet ifequal -{% ifequal ${1} ${2} %} - ${3} -{% endifequal %} -endsnippet - -snippet ifnotequal -{% ifnotequal ${1} ${2} %} - ${3} -{% endifnotequal %} -endsnippet - -snippet include -{% include "${1}" %} -endsnippet - -snippet load -{% load ${1} %} -endsnippet - -snippet now -{% now "${1:jS F Y H:i}" %} -endsnippet - -snippet regroup -{% regroup ${1} by ${2} as ${3} %} -endsnippet - -snippet spaceless -{% spaceless %}${1}{% endspaceless %} -endsnippet - -snippet ssi -{% ssi ${1} %} -endsnippet - -snippet trans -{% trans "${1:string}" %} -endsnippet - -snippet url -{% url ${1} as ${2} %} -endsnippet - -snippet widthratio -{% widthratio ${1:this_value} ${2:max_value} ${3:100} %} -endsnippet - -snippet with -{% with ${1} as ${2} %} -endsnippet - -# Template Filters - -# Note: Since SnipMate can't determine which template filter you are -# expanding without the "|" character, these do not add the "|" -# character. These save a few keystrokes still. - -# Note: Template tags that take no arguments are not implemented. - -snippet add -add:"${1}" -endsnippet - -snippet center -center:"${1}" -endsnippet - -snippet cut -cut:"${1}" -endsnippet - -snippet date -date:"${1}" -endsnippet - -snippet default -default:"${1}" -endsnippet - -snippet defaultifnone -default_if_none:"${1}" -endsnippet - -snippet dictsort -dictsort:"${1}" -endsnippet - -snippet dictsortrev -dictsortreversed:"${1}" -endsnippet - -snippet divisibleby -divisibleby:"${1}" -endsnippet - -snippet floatformat -floatformat:"${1}" -endsnippet - -snippet getdigit -get_digit:"${1}" -endsnippet - -snippet join -join:"${1}" -endsnippet - -snippet lengthis -length_is:"${1}" -endsnippet - -snippet pluralize -pluralize:"${1}" -endsnippet - -snippet removetags -removetags:"${1}" -endsnippet - -snippet slice -slice:"${1}" -endsnippet - -snippet stringformat -stringformat:"${1}" -endsnippet - -snippet time -time:"${1}" -endsnippet - -snippet truncatewords -truncatewords:${1} -endsnippet - -snippet truncatewordshtml -truncatewords_html:${1} -endsnippet - -snippet urlizetrunc -urlizetrunc:${1} -endsnippet - -snippet wordwrap -wordwrap:${1} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/erlang.snippets b/vim/ultisnips-dist/erlang.snippets deleted file mode 100644 index 7823162..0000000 --- a/vim/ultisnips-dist/erlang.snippets +++ /dev/null @@ -1,98 +0,0 @@ -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### - -snippet pat "Case:Receive:Try Clause" -${1:pattern}${2: when ${3:guard}} ->; - ${4:body} -endsnippet - -snippet beh "Behaviour Directive" --behaviour (${1:behaviour}). -endsnippet - -snippet case "Case Expression" -case ${1:expression} of - ${2:pattern}${3: when ${4:guard}} -> - ${5:body} -end -endsnippet - -snippet def "Define Directive" --define (${1:macro}${2: (${3:param})}, ${4:body}). -endsnippet - -snippet exp "Export Directive" --export ([${1:function}/${2:arity}]). -endsnippet - -snippet fun "Fun Expression" -fun - (${1:pattern})${2: when ${3:guard}} -> - ${4:body} -end -endsnippet - -snippet fu "Function" -${1:function} (${2:param})${3: when ${4:guard}} -> - ${5:body} -endsnippet - -snippet if "If Expression" -if - ${1:guard} -> - ${2:body} -end -endsnippet - -snippet ifdef "Ifdef Directive" --ifdef (${1:macro}). -endsnippet - -snippet ifndef "Ifndef Directive" --ifndef (${1:macro}). -endsnippet - -snippet imp "Import Directive" --import (${1:module}, [${2:function}/${3:arity}]). -endsnippet - -snippet inc "Include Directive" --include ("${1:file}"). -endsnippet - -snippet mod "Module Directive" --module (${1:`!p snip.rv = snip.basename or "module"`}). -endsnippet - -snippet rcv "Receive Expression" -receive -${1: ${2:pattern}${3: when ${4:guard}} -> - ${5:body}} -${6:after - ${7:expression} -> - ${8:body}} -end -endsnippet - -snippet rec "Record Directive" --record (${1:record}, {${2:field}${3: = ${4:value}}}). -endsnippet - -snippet try "Try Expression" -try${1: ${2:expression}${3: of - ${4:pattern}${5: when ${6:guard}} -> - ${7:body}}} -${8:catch - ${9:pattern}${10: when ${11:guard}} -> - ${12:body}} -${13:after - ${14:body}} -end -endsnippet - -snippet undef "Undef Directive" --undef (${1:macro}). -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/eruby.snippets b/vim/ultisnips-dist/eruby.snippets deleted file mode 100644 index 1fdcfc1..0000000 --- a/vim/ultisnips-dist/eruby.snippets +++ /dev/null @@ -1,279 +0,0 @@ -# TextMate added these variables to cope with changes in ERB handling -# in different versions of Rails -- for instance, Rails 3 automatically -# strips whitespace so that it's no longer necessary to use a form like -# <% end -%>, but if you're still maintaining Rails 2 projects, you -# can't omit the minus sign and get the same behavior. -# -# The following regex replace substitutes the function below for the -# TextMate variable references after the snippets are converted: -# -# /\v\$\{(TM_RAILS_TEMPLATE_([^_]+)_RUBY_([^_\s]+))\}/`!p textmate_var('\1', snip)`/g -# -global !p -def textmate_var(var, snip): - lookup = dict( - TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '), - TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'), - TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', ' %>'), - TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'), - TM_RAILS_TEMPLATE_END_RUBY_BLOCK = 'end' - ) - - snip.rv = lookup[var] - return -endglobal - - -########################################################################### -# GENERATED FROM get_tm_snippets.py + REGEX REPLACE # -########################################################################### - -snippet fi "<%= Fixtures.identify(:symbol) %>" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`Fixtures.identify(:${1:name})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`$0 -endsnippet - -snippet ft "form_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` -endsnippet - -snippet end "end (ERB)" -<% end -%> -endsnippet - -snippet for "for loop (ERB)" -<% if !${1:list}.blank? %> - <% for ${2:item} in ${1} %> - $3 - <% end %> -<% else %> - $4 -<% end %> - -endsnippet - -snippet ffcb "form_for check_box" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffff "form_for file_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffhf "form_for hidden_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffl "form_for label 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffpf "form_for password_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffrb "form_for radio_box 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffs "form_for submit 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffta "form_for text_area 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet fftf "form_for text_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet fields "fields_for" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`fields_for :${1:model}, @${2:$1} do |$1|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` -endsnippet - -snippet f. "f_fields_for (nff)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`f.fields_for :${1:attribute} do |${2:f}|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` -endsnippet - -snippet f. "f.checkbox" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.file_field" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.hidden_field" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.label" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.password_field" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.radio_box" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.submit" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.text_area" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet f. "f.text_field" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffe "form_for with errors" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`error_messages_for :${1:model}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` - -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` -endsnippet - -snippet ff "form_for" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` -endsnippet - -snippet ist "image_submit_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_submit_tag("${1:agree.png}"${2:${3:, :id => "${4:${1/^(\w+)(\.\w*)?$/$1/}}"}${5:, :name => "${6:${1/^(\w+)(\.\w*)?$/$1/}}"}${7:, :class => "${8:${1/^(\w+)(\.\w*)?$/$1/}-button}"}${9:, :disabled => ${10:false}}})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet it "image_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_tag "$1${2:.png}"${3:${4:, :title => "${5:title}"}${6:, :class => "${7:class}"}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet layout "layout" -layout "${1:template_name}"${2:${3:, :only => ${4:[:${5:action}, :${6:action}]}}${7:, :except => ${8:[:${9:action}, :${10:action}]}}} -endsnippet - -snippet jit "javascript_include_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`javascript_include_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lia "link_to (action)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet liai "link_to (action, id)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:edit}", :id => ${3:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lic "link_to (controller)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lica "link_to (controller, action)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet licai "link_to (controller, action, id)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:edit}", :id => ${4:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet linpp "link_to (nested path plural)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:${10}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet linp "link_to (nested path)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lipp "link_to (path plural)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${4:model}s_path}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lip "link_to (path)" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:${12}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet lim "link_to model" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:model}.${2:name}, ${3:${4:$1}_path(${14:$1})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet hide "page.hide (*ids)" -page.hide ${1:"${2:id(s)}"} -endsnippet - -snippet ins "page.insert_html (position, id, partial)" -page.insert_html :${1:top}, ${2:"${3:id}"}, :${4:partial => "${5:template}"} -endsnippet - -snippet rep "page.replace (id, partial)" -page.replace ${1:"${2:id}"}, :${3:partial => "${4:template}"} -endsnippet - -snippet reph "page.replace_html (id, partial)" -page.replace_html ${1:"${2:id}"}, :${3:partial => "${4:template}"} -endsnippet - -snippet show "page.show (*ids)" -page.show ${1:"${2:id(s)}"} -endsnippet - -snippet tog "page.toggle (*ids)" -page.toggle ${1:"${2:id(s)}"} -endsnippet - -snippet vis "page.visual_effect (effect, id)" -page.visual_effect :${1:toggle_slide}, ${2:"${3:DOM ID}"} -endsnippet - -snippet rp "render (partial) (rp)" -render :partial => "${1:item}" -endsnippet - -snippet rpc "render (partial,collection) (rpc)" -render :partial => "${1:item}", :collection => ${2:@$1s} -endsnippet - -snippet rpl "render (partial,locals) (rpl)" -render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1}$0 } -endsnippet - -snippet rpo "render (partial,object) (rpo)" -render :partial => "${1:item}", :object => ${2:@$1} -endsnippet - -snippet rps "render (partial,status) (rps)" -render :partial => "${1:item}", :status => ${2:500} -endsnippet - -snippet slt "stylesheet_link_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`stylesheet_link_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet st "submit_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet else "else (ERB)" -<% else %> - -endsnippet - -snippet if "if (ERB)" -<% if ${1:condition} %>$0 -endsnippet - -snippet lf "link_to_function" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/go.snippets b/vim/ultisnips-dist/go.snippets deleted file mode 100644 index ea46931..0000000 --- a/vim/ultisnips-dist/go.snippets +++ /dev/null @@ -1,107 +0,0 @@ -# Snippets for Go - -# when to abbriviate and when not? -# b doesn't work here, because it ignores whitespace -# optional local name? -snippet /^import/ "Import declaration" r -import ( - "${1:package}" -) -endsnippet - -snippet /^package/ "Package declaration" r -// Package $1 provides ... -package ${1:main} -endsnippet - -# Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle -snippet /^cons/ "Constants declaration" r -const ( - ${1:constant}${2/(.+)/ /}${2:type} = ${0:value} -) -endsnippet - -snippet /^con/ "Constant declaration" r -const ${1:name}${2/(.+)/ /}${2:type} = ${0:value} -endsnippet - -snippet iota "Iota constant generator" b -const ( - ${1:constant}${2/(.+)/ /}${2:type} = iota -) -endsnippet - -# statements -snippet for "For loop" !b -for ${1:condition}${1/(.+)/ /}{ - ${0:${VISUAL}} -} -endsnippet - -snippet forr "For range loop" !b -for ${2:name} := range ${1:collection} { - ${0:${VISUAL}} -} -endsnippet - -snippet if "If statement" !b -if ${1:condition}${1/(.+)/ /}{ - ${0:${VISUAL}} -} -endsnippet - -snippet switch "Switch statement" !b -switch ${1:expression}${1/(.+)/ /}{ -case${0} -} -endsnippet - -snippet case "Case clause" !b -case ${1:condition}: - ${0:${VISUAL}} -endsnippet - -snippet default "Default clause" !b -default: - ${0:${VISUAL}} -endsnippet - -# functions -snippet /^main/ "Main function" r -func main() { - ${0:${VISUAL}} -} -endsnippet - -snippet /^meth/ "Method" r -func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} { - ${0:${VISUAL}} -} -endsnippet - -snippet func "Function" b -func ${1:name}(${2:params})${3/(.+)/ /}${3:type} { - ${0:${VISUAL}} -} -endsnippet - -# types and variables -snippet map "Map type" !b -map[${1:keytype}]${2:valtype} -endsnippet - -snippet : "Variable declaration :=" !b -${1:name} := ${0:value} -endsnippet - -snippet var "Variable declaration" !b -var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}} -endsnippet - -snippet vars "Variables declaration" !b -var ( - ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} } -) -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/haskell.snippets b/vim/ultisnips-dist/haskell.snippets deleted file mode 100644 index eb7b2c6..0000000 --- a/vim/ultisnips-dist/haskell.snippets +++ /dev/null @@ -1,61 +0,0 @@ -snippet if "if ... then ... else ..." -if ${1:condition} - then ${2:expression} - else ${3:expression} -endsnippet - -snippet case "case ... of ..." -case ${1:expression} of - ${2:pattern} -> ${3:expression} - ${4:pattern} -> ${5:expression} -endsnippet - -snippet :: "Type signature" -${1:name} :: ${2:Type} -> ${3:Type} -endsnippet - -snippet => "Type constraint" -(${1:Class} ${2:Type var}) => ${3:$2} -endsnippet - -snippet def "Function definition" -${1:name} :: ${2:Type} -> ${3:Type} -endsnippet - -snippet def[] "Function definition for list patterns" -${1:name} :: [${2:Type}] -> ${3:Type} -$1 [] = ${4:undefined} -$1 ${5:(x:xs)} = ${6:undefined} -endsnippet - -snippet = "Function clause" -${1:name} ${2:pattern} = ${3:undefined} -endsnippet - -snippet 2= "Function clause" -${1:name} ${2:pattern} = ${3:undefined} -$1 ${4:pattern} = ${5:undefined} -endsnippet - -snippet 3= "Function clause" -${1:name} ${2:pattern} = ${3:undefined} -$1 ${4:pattern} = ${5:undefined} -$1 ${6:pattern} = ${7:undefined} -endsnippet - -snippet | "Guard" -| ${1:predicate} = ${2:undefined} -endsnippet - -snippet \ "Lambda expression" -\ ${1:pattern} -> ${2:expression} -endsnippet - -snippet [|] "List comprehension" -[${3:foo }$1 | ${1:x} <- ${2:xs} ] -endsnippet - -snippet let "let ... in ..." -let ${1:name} = ${2:expression} -in ${3:expression} -endsnippet diff --git a/vim/ultisnips-dist/help.snippets b/vim/ultisnips-dist/help.snippets deleted file mode 100644 index bd0bb12..0000000 --- a/vim/ultisnips-dist/help.snippets +++ /dev/null @@ -1,30 +0,0 @@ -# Snippets for VIM Help Files - -global !p -def sec_title(snip, t): - file_start = snip.fn.split('.')[0] - sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-') - return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1])) -endglobal - -snippet sec "Section marker" b -============================================================================== -${1:SECTION}`!p snip.rv = sec_title(snip, t)` - -$0 -endsnippet - -snippet ssec "Sub section marker" b -${1:Subsection}`!p snip.rv = sec_title(snip, t) -snip += "-"*len(t[1])` - -$0 -endsnippet - -snippet sssec "Subsub Section marker" b -${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)` - -$0 -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/html.snippets b/vim/ultisnips-dist/html.snippets deleted file mode 100644 index 1a7f569..0000000 --- a/vim/ultisnips-dist/html.snippets +++ /dev/null @@ -1,300 +0,0 @@ -########################################################################### -# TextMate Snippets # -########################################################################### - -global !p -def x(snip): - if snip.ft.startswith("x"): - snip.rv = '/' - else: - snip.rv = "" -endglobal - -############ -# Doctypes # -############ -snippet doctype "DocType XHTML 1.0 Strict" b -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -endsnippet - -snippet doctype "DocType XHTML 1.0 Transitional" b -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -endsnippet - -snippet doctype "DocType XHTML 1.1" b -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - -endsnippet - -snippet doctype "HTML - 4.0 Transitional (doctype)" b -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - -endsnippet - -snippet doctype "HTML - 5.0 (doctype)" b -<!DOCTYPE html> - -endsnippet - -############# -# Shortcuts # -############# -snippet down "Down (down)" -&#x2193; -endsnippet - -snippet enter "Enter (enter)" -&#x2305; -endsnippet - -snippet escape "Escape (escape)" -&#x238B; -endsnippet - -snippet shift "Shift (shift)" -&#x21E7; -endsnippet - -snippet tab "Tab (tab)" -&#x21E5; -endsnippet - -snippet up "Up (up)" -&#x2191; -endsnippet - -snippet return "Return (return)" -&#x21A9; -endsnippet - -snippet right "Right (right)" -&#x2192; -endsnippet - -snippet left "Left (left)" -&#x2190; -endsnippet - -snippet option "Option (option)" -&#x2325; -endsnippet - -####################### -# Conditional inserts # -####################### -snippet ! "IE Conditional Comment: Internet Explorer 5_0 only" -<!--[if IE 5.0]>${1:IE Conditional Comment: Internet Explorer 5.0 only }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 5_5 only" -<!--[if IE 5.5000]>${1:IE Conditional Comment: Internet Explorer 5.5 only }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 5_x" -<!--[if lt IE 6]>${1:IE Conditional Comment: Internet Explorer 5.x }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 6 and below" -<!--[if lte IE 6]>${1:IE Conditional Comment: Internet Explorer 6 and below }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 6 only" -<!--[if IE 6]>${1:IE Conditional Comment: Internet Explorer 6 only }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 7+" -<!--[if gte IE 7]>${1:IE Conditional Comment: Internet Explorer 7 and above }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer" -<!--[if IE]>${1: IE Conditional Comment: Internet Explorer }<![endif]-->$0 -endsnippet - -snippet ! "IE Conditional Comment: NOT Internet Explorer" -<!--[if !IE]><!-->${1: IE Conditional Comment: NOT Internet Explorer }<!-- <![endif]-->$0 -endsnippet - -############# -# HTML TAGS # -############# -snippet input "Input with Label" -<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p x(snip)`> - -endsnippet - -snippet input "XHTML <input>" -<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p x(snip)`> -endsnippet - - -snippet opt "Option" -<option${1: value="${2:option}"}>${3:$2}</option> -endsnippet - -snippet select "Select Box" -<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}> - <option${9: value="${10:option1}"}>${11:$10}</option> - <option${12: value="${13:option2}"}>${14:$13}</option>${15:} - $0 -</select> -endsnippet - - -snippet textarea "XHTML <textarea>" -<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea> -endsnippet - -snippet mailto "XHTML <a mailto: >" -<a href="mailto:${1:[email protected]}?subject=${2:feedback}">${3:email me}</a> -endsnippet - -snippet base "XHTML <base>" -<base href="$1"${2: target="$3"}`!p x(snip)`> -endsnippet - -snippet body "XHTML <body>" -<body id="${1:`!p -snip.rv = snip.fn and 'Hallo' or 'Nothin' -`}"${2: onload="$3"}> - $0 -</body> -endsnippet - -snippet div "XHTML <div>" -<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`> - $0 -</div> -endsnippet - -snippet form "XHTML <form>" -<form action="${1:`!p -snip.rv = (snip.basename or 'unnamed') + '_submit' -`}" method="${2:get}" accept-charset="utf-8"> - $0 - - <p><input type="submit" value="Continue →"`!p x(snip)`></p> -</form> -endsnippet - -snippet h1 "XHTML <h1>" -<h1 id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}">${1}</h1> -endsnippet - -snippet head "XHTML <head>" -<head> - <meta http-equiv="Content-type" content="text/html; charset=utf-8"`!p x(snip)`> - <title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title> - $0 -</head> -endsnippet - -snippet link "XHTML <link>" -<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p x(snip)`> -endsnippet - -snippet meta "XHTML <meta>" -<meta name="${1:name}" content="${2:content}"`!p x(snip)`> -endsnippet - -snippet scriptsrc "XHTML <script src...>" -<script src="$1" type="text/javascript" charset="${3:utf-8}"></script> -endsnippet - -snippet script "XHTML <script>" -<script type="text/javascript" charset="utf-8"> - $0 -</script> -endsnippet - -snippet style "XHTML <style>" -<style type="text/css" media="screen"> - $0 -</style> -endsnippet - -snippet table "XHTML <table>" -<table border="${1:0}"${2: cellspacing="${3:5}" cellpadding="${4:5}"}> - <tr><th>${5:Header}</th></tr> - <tr><td>${0:Data}</td></tr> -</table> -endsnippet - -snippet a "Link" -<a href="${1:http://www.${2:url.com}}"${3: target="_blank"}>${4:Anchor Text}</a> -endsnippet - -snippet p "paragraph" -<p>$0</p> -endsnippet - -snippet li "list item" -<li></li> -endsnippet - -snippet ul "unordered list" -<ul> -$0 -</ul> -endsnippet - -snippet td "table cell" -<td>$0</td> -endsnippet - -snippet tr "table row" -<tr>$0</tr> -endsnippet - -snippet title "XHTML <title>" -<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title> -endsnippet - -snippet fieldset "Fieldset" -<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}> - <legend>$1</legend> - - $0 -</fieldset> -endsnippet - -snippet movie "Embed QT movie (movie)" b -<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> - <param name="src" value="$1"`!p x(snip)`> - <param name="controller" value="$4"`!p x(snip)`> - <param name="autoplay" value="$5"`!p x(snip)`> - <embed src="${1:movie.mov}" - width="${2:320}" height="${3:240}" - controller="${4:true}" autoplay="${5:true}" - scale="tofit" cache="true" - pluginspage="http://www.apple.com/quicktime/download/" - `!p x(snip)`> -</object> -endsnippet - -snippet html5 "HTML5 Template" -<!DOCTYPE html> -<html> -<head> - <title>${1}</title> - <meta charset="utf-8" /> -</head> -<body> - <header> - ${2} - </header> - <content> - ${3} - </content> - <footer> - ${4} - </footer> -</body> -</html> -endsnippet -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/htmldjango.snippets b/vim/ultisnips-dist/htmldjango.snippets deleted file mode 100644 index 9df5f78..0000000 --- a/vim/ultisnips-dist/htmldjango.snippets +++ /dev/null @@ -1 +0,0 @@ -extends html, django diff --git a/vim/ultisnips-dist/java.snippets b/vim/ultisnips-dist/java.snippets deleted file mode 100644 index 6e1b3ff..0000000 --- a/vim/ultisnips-dist/java.snippets +++ /dev/null @@ -1,212 +0,0 @@ -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### - -# Many of the snippets here use a global option called -# "g:ultisnips_java_brace_style" which, if set to "nl" will put a newline -# before '{' braces. - -global !p -def nl(snip): - if snip.opt("g:ultisnips_java_brace_style", "") == "nl": - snip += "" - else: - snip.rv += " " -endglobal - -snippet ab "abstract" b -abstract -endsnippet - -snippet as "assert" b -assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0 -endsnippet - -snippet br "break" -break; - -endsnippet - -snippet cs "case" b -case $1: - $2 -$0 -endsnippet - -snippet ca "catch" b -catch (${1:Exception} ${2:e})`!p nl(snip)`{ - $0 -} -endsnippet - -snippet cl "class" b -class ${1:`!p -snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{ - $0 -} -endsnippet - -snippet cos "constant string" b -static public final String ${1:var} = "$2";$0 -endsnippet - -snippet co "constant" b -static public final ${1:String} ${2:var} = $3;$0 -endsnippet - -snippet de "default" b -default: - $0 -endsnippet - -snippet elif "else if" b -else if ($1)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet /el(se)?/ "else" br -else`!p nl(snip)`{ - $0 -} -endsnippet - -snippet fi "final" b -final -endsnippet - -snippet fore "for (each)" b -for ($1 : $2)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet for "for" b -for ($1; $2; $3)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet if "if" b -if ($1)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet imt "import junit_framework_TestCase;" b -import junit.framework.TestCase; -$0 -endsnippet - -snippet im "import" b -import -endsnippet - -snippet in "interface" b -interface ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }{ - $0 -} -endsnippet - -snippet j.b "java_beans_" i -java.beans. -endsnippet - -snippet j.i "java_io" i -java.io. -endsnippet - -snippet j.m "java_math" i -java.math. -endsnippet - -snippet j.n "java_net_" i -java.net. -endsnippet - -snippet j.u "java_util_" i -java.util. -endsnippet - -snippet main "method (main)" b -public static void main(String[] args)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet m "method" b -${1:void} ${2:method}($3) ${4:throws $5 }{ - $0 -} - -endsnippet - -snippet pa "package" b -package -endsnippet - -snippet p "print" b -System.out.print($1);$0 -endsnippet - -snippet pl "println" b -System.out.println($1);$0 -endsnippet - -snippet pr "private" b -private -endsnippet - -snippet po "protected" b -protected -endsnippet - -snippet pu "public" b -public -endsnippet - -snippet re "return" b -return -endsnippet - -snippet st "static" -static -endsnippet - -snippet sw "switch" b -switch ($1)`!p nl(snip)`{ - $0 -} -endsnippet - -snippet sy "synchronized" -synchronized -endsnippet - -snippet tc "test case" -public class ${1:`!p snip.rv = snip.basename or "untitled"`} extends ${2:TestCase}`!p nl(snip)`{ - $0 -} -endsnippet - -snippet t "test" b -public void test${1:Name}() throws Exception`!p nl(snip)`{ - $0 -} -endsnippet - -snippet th "throw" b -throw $0 -endsnippet - -snippet v "variable" b -${1:String} ${2:var}${3: = ${0:null}}; -endsnippet - -snippet wh "while" b -while ($1)`!p nl(snip)`{ - $0 -} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/javascript.snippets b/vim/ultisnips-dist/javascript.snippets deleted file mode 100644 index e4e7f7a..0000000 --- a/vim/ultisnips-dist/javascript.snippets +++ /dev/null @@ -1,65 +0,0 @@ -########################################################################### -# TextMate Snippets # -########################################################################### -snippet get "Get Elements" -getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2') -endsnippet - -snippet '':f "object method string" -'${1:${2:#thing}:${3:click}}': function(element){ - $0 -}${10:,} -endsnippet - -snippet :f "Object Method" -${1:method_name}: function(${3:attribute}){ - $0 -}${10:,} -endsnippet - -snippet :, "Object Value JS" -${1:value_name}:${0:value}, -endsnippet - -snippet : "Object key key: 'value'" -${1:key}: ${2:"${3:value}"}${4:, } -endsnippet - -snippet proto "Prototype (proto)" -${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) ,,{ - ${0:// body...} -}; - -endsnippet - -snippet for "for (...) {...} (faster)" -for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2--){ - ${3:$1[$2]}$0 -}; -endsnippet - -snippet for "for (...) {...}" -for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { - ${3:$1[$2]}$0 -}; -endsnippet - -snippet fun "function (fun)" -function ${1:function_name} (${2:argument}) { - ${0:// body...} -} -endsnippet - -snippet ife "if ___ else" -if (${1:true}) {$0} else{}; -endsnippet - -snippet if "if" -if (${1:true}) {$0}; -endsnippet - -snippet timeout "setTimeout function" -setTimeout(function() {$0}${2:}, ${1:10}); -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/javascript_jasmine.snippets b/vim/ultisnips-dist/javascript_jasmine.snippets deleted file mode 100644 index 49e38a3..0000000 --- a/vim/ultisnips-dist/javascript_jasmine.snippets +++ /dev/null @@ -1,168 +0,0 @@ -# -# JavaScript versions -- from the TextMate bundle + some additions -# for jasmine-jquery matchers -# -extends javascript - -snippet des "Describe (js)" b -describe('${1:description}', function() { - $0 -}); -endsnippet - -snippet it "it (js)" b -it('${1:description}', function() { - $0 -}); -endsnippet - -snippet bef "before each (js)" b -beforeEach(function() { - $0 -}); -endsnippet - -snippet aft "after each (js)" b -afterEach(function() { - $0 -}); -endsnippet - -snippet any "any (js)" b -jasmine.any($1) -endsnippet - -snippet ru "runs (js)" b -runs(function() { - $0 -}); -endsnippet - -snippet wa "waits (js)" b -waits($1); -endsnippet - -snippet ex "expect (js)" b -expect(${1:target})$0; -endsnippet - -snippet ee "expect to equal (js)" b -expect(${1:target}).toEqual(${2:value}); -endsnippet - -snippet em "expect to match (js)" b -expect(${1:target}).toMatch(${2:pattern}); -endsnippet - -snippet eha "expect to have attribute (js)" b -expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'}); -endsnippet - -snippet et "expect to be truthy (js)" b -expect(${1:target}).toBeTruthy(); -endsnippet - -snippet ef "expect to be falsy (js)" b -expect(${1:target}).toBeFalsy(); -endsnippet - -snippet ed "expect to be defined (js)" b -expect(${1:target}).toBeDefined(); -endsnippet - -snippet en "expect to be null (js)" b -expect(${1:target}).toBeNull(); -endsnippet - -snippet ec "expect to contain (js)" b -expect(${1:target}).toContain(${2:value}); -endsnippet - -snippet ev "expect to be visible (js)" b -expect(${1:target}).toBeVisible(); -endsnippet - -snippet eh "expect to be hidden (js)" b -expect(${1:target}).toBeHidden(); -endsnippet - -snippet notx "expect not (js)" b -expect(${1:target}).not$0; -endsnippet - -snippet note "expect not to equal (js)" b -expect(${1:target}).not.toEqual(${2:value}); -endsnippet - -snippet notm "expect not to match (js)" b -expect(${1:target}).not.toMatch(${2:pattern}); -endsnippet - -snippet notha "expect to not have attribute (js)" b -expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'}); -endsnippet - -snippet nott "expect not to be truthy (js)" b -expect(${1:target}).not.toBeTruthy(); -endsnippet - -snippet notf "expect not to be falsy (js)" b -expect(${1:target}).not.toBeFalsy(); -endsnippet - -snippet notd "expect not to be defined (js)" b -expect(${1:target}).not.toBeDefined(); -endsnippet - -snippet notn "expect not to be null (js)" b -expect(${1:target}).not.toBeNull(); -endsnippet - -snippet notc "expect not to contain (js)" b -expect(${1:target}).not.toContain(${2:value}); -endsnippet - -snippet notv "expect not to be visible (js)" b -expect(${1:target}).not.toBeVisible(); -endsnippet - -snippet noth "expect not to be hidden (js)" b -expect(${1:target}).not.toBeHidden(); -endsnippet - -snippet s "spy on (js)" b -spyOn(${1:object}, '${2:method}')$0; -endsnippet - -snippet sr "spy on and return (js)" b -spyOn(${1:object}, '${2:method}').andReturn(${3:arguments}); -endsnippet - -snippet st "spy on and throw (js)" b -spyOn(${1:object}, '${2:method}').andThrow(${3:exception}); -endsnippet - -snippet sct "spy on and call through (js)" b -spyOn(${1:object}, '${2:method}').andCallThrough(); -endsnippet - -snippet scf "spy on and call fake (js)" b -spyOn(${1:object}, '${2:method}').andCallFake(${3:function}); -endsnippet - -snippet esc "expect was called (js)" b -expect(${1:target}).wasCalled(); -endsnippet - -snippet escw "expect was called with (js)" b -expect(${1:target}).wasCalledWith(${2:arguments}); -endsnippet - -snippet notsc "expect was not called (js)" b -expect(${1:target}).wasNotCalled(); -endsnippet - -snippet noscw "expect was not called with (js)" b -expect(${1:target}).wasNotCalledWith(${2:arguments}); -endsnippet - diff --git a/vim/ultisnips-dist/jinja2.snippets b/vim/ultisnips-dist/jinja2.snippets deleted file mode 100644 index 6fef6ed..0000000 --- a/vim/ultisnips-dist/jinja2.snippets +++ /dev/null @@ -1,209 +0,0 @@ - -# http://jinja.pocoo.org/ - -# jinja2 is a full featured template engine for Python. It has full -# unicode support, an optional integrated sandboxed execution -# environment, widely used and BSD licensed. - -# possible extends: -#extends html - - -snippet block "block" b -{% block ${1:name} %} - $2 -{% endblock $1 %} -endsnippet - - -snippet {{ "variable" b -{{ $1 }} -endsnippet - - -snippet {# "comment" b -{# $1 #} -endsnippet - - -snippet # "comment" b -{# $1 #} -endsnippet - - -snippet raw "escaped block" b -{% raw %} - $1 -{% endraw %} -endsnippet - - -snippet extends "extends" b -{% extends "${1:template}" %} -endsnippet - - -snippet include "include" b -{% include "${1:template}" %} -endsnippet - - -snippet import "import" b -{% import "${1:template}" %} -endsnippet - - -snippet from "from/import/as" b -{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %} -endsnippet - - -snippet filter "filter" b -{% filter ${1:filter} %} - $2 -{% endfilter %} -endsnippet - - -# Being able to quickly remove the whole 'else' block seems faster to me than -# choosing between 'for' and 'for/else' snippets from the menu. -# snippet for "for" b -# {% for ${1:item} in ${2:sequence} %} -# $3${4: -# {% else %} -# $5} -# {% endfor %} -# endsnippet - - -snippet for "for" b -{% for ${1:item} in ${2:sequence} %} - $3 -{% endfor %} -endsnippet - - -snippet for "for/else" b -{% for ${1:item} in ${2:sequence} %} - $3 -{% else %} - $4 -{% endfor %} -endsnippet - - -snippet if "if" b -{% if ${1:expr} %} - $2 -{% endif %} -endsnippet - - -snippet if "if/else" b -{% if ${1:expr} %} - $2 -{% else %} - $3 -{% endif %} -endsnippet - - -snippet if "if/elif/else" b -{% if ${1:expr} %} - $2 -{% elif %} - $3 -{% else %} - $4 -{% endif %} -endsnippet - - -snippet macro "macro" b -{% macro ${1:name}(${2:args}) %} - $3 -{% endmacro %} -endsnippet - - -snippet call "call" b -{% call ${1:name}(${2:args}) %} - $3 -{% endcall %} -endsnippet - - -snippet set "set" b -{% set ${1:name} = ${2:'value'} %} -endsnippet - - -snippet trans "translation" b -{% trans %} - $1 -{% endtrans %} -endsnippet - - -snippet with "with" b -{% with %} - $1 -{% endwith %} -endsnippet - - -snippet autoescape "autoescape" b -{% autoescape ${1:true} %} - $2 -{% endautoescape %} -endsnippet - -# Filters -# @todo: expand only when snippet is preceeded by a | - -snippet batch "batch items" w -batch(linecount=$1, fill_with=${2:None}) -endsnippet - - -snippet dictsort "sort and yield (key, value) pairs" w -dictsort(case_sensitive=${1:False}, by=${2:'key'}) -endsnippet - - -snippet round "round number" w -round(precision=${1:0}, method=${2:'common|ceil|floor'}) -endsnippet - - -snippet urlize "convert plain-text url to <a/>" w -urlize(trim_url_limit=${1:None}, nofollow=${2:False}) -endsnippet - - -snippet wordwrap "wordwrap" w -wordwrap(width=${1:79}, break_long_words=${2:True}) -endsnippet - - -snippet truncate "truncate" w -truncate(lenght=${1:79}, killwords=${2:False}, end=${3:'...''}) -endsnippet - - -snippet sum "sum of sequence of numbers + start" w -sum(attribute=${1:None}, start=${2:0}) -endsnippet - - -snippet sort "sort an iterable" w -sort(reverse=${1:False}, case_sensitive=${2:False}, attribute=${3:None}) -endsnippet - - -snippet indent "indent" w -indent(width=${1:4}, indentfirst=${2:False}) -endsnippet - - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/json.snippets b/vim/ultisnips-dist/json.snippets deleted file mode 100644 index 81e6561..0000000 --- a/vim/ultisnips-dist/json.snippets +++ /dev/null @@ -1,19 +0,0 @@ -snippet s "String" b -"${1:key}": "${0:value}", -endsnippet - -snippet n "number" b -"${1:key}": ${0:value}, -endsnippet - -snippet a "Array" b -[ - ${VISUAL}$0 -], -endsnippet -snippet o "Object" b -{ - ${VISUAL}$0 -}, -endsnippet - diff --git a/vim/ultisnips-dist/lua.snippets b/vim/ultisnips-dist/lua.snippets deleted file mode 100644 index 1b82a24..0000000 --- a/vim/ultisnips-dist/lua.snippets +++ /dev/null @@ -1,37 +0,0 @@ -################################# -# Snippets for the Lua language # -################################# -snippet #! "Shebang header" b -#!/usr/bin/env lua -$0 -endsnippet - -snippet !fun(ction)?! "New function" br -function ${1:new_function}(${2:args}) - $0 -end -endsnippet - -snippet forp "pair for loop" b -for ${1:name},${2:val} in pairs(${3:table_name}) do - $0 -end -endsnippet - -snippet fori "ipair for foop" b -for ${1:idx},${2:val} in ipairs(${3:table_name}) do - $0 -end -endsnippet - -snippet for "numeric for loop" b -for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do - $0 -end -endsnippet - -snippet local "local x = 1" -local ${1:x} = ${0:1} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/mako.snippets b/vim/ultisnips-dist/mako.snippets deleted file mode 100644 index 92a7be3..0000000 --- a/vim/ultisnips-dist/mako.snippets +++ /dev/null @@ -1,90 +0,0 @@ -################# -# From snipmate # -################# -snippet def "definition" b -<%def name="${1:name}"> - ${2:} -</%def> -endsnippet - -snippet call "call" b -<%call expr="${1:name}"> - ${2:} -</%call> -endsnippet - -snippet doc "doc" b -<%doc> - ${1:} -</%doc> -endsnippet - -snippet text "text" b -<%text> - ${1:} -</%text> -endsnippet - -snippet for "for" b -% for ${1:i} in ${2:iter}: - ${3:} -% endfor -endsnippet - -snippet if "if " b -% if ${1:condition}: - ${2:} -% endif -endsnippet - -snippet if "if/else" b -% if ${1:condition}: - ${2:} -% else: - ${3:} -% endif -endsnippet - -snippet try "try" b -% try: - ${1:} -% except${2:}: - ${3:pass} -% endtry -endsnippet - -snippet wh "wh" b -% while ${1:}: - ${2:} -% endwhile -endsnippet - -snippet $ "$" i -${${1:}} -endsnippet - -snippet <% "<%" b -<% ${1:} %> -endsnippet - -snippet <!% "<!%" b -<!% ${1:} %> -endsnippet - -snippet inherit "inherit" b -<%inherit file="${1:filename}" /> -endsnippet - -snippet include "include" b -<%include file="${1:filename}" /> -endsnippet - -snippet namespace "namespace" b -<%namespace file="${1:name}" /> -endsnippet - -snippet page "page" b -<%page args="${1:}" /> -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/markdown.snippets b/vim/ultisnips-dist/markdown.snippets deleted file mode 100644 index c3189b8..0000000 --- a/vim/ultisnips-dist/markdown.snippets +++ /dev/null @@ -1,44 +0,0 @@ -########################################################################### -# SNIPPETS for MARKDOWN # -########################################################################### - -########################### -# Sections and Paragraphs # -########################### -snippet sec "Section" b -# ${1:Section Name} # -$0 -endsnippet - -snippet ssec "Sub Section" b -## ${1:Section Name} ## -$0 -endsnippet - -snippet sssec "SubSub Section" b -### ${1:Section Name} ### -$0 -endsnippet - -snippet par "Paragraph" b -#### ${1:Paragraph Name} #### -$0 -endsnippet - -snippet spar "Paragraph" b -##### ${1:Paragraph Name} ##### -$0 -endsnippet - -################ -# Common stuff # -################ -snippet link "Link to something" -[${1:${VISUAL:Text}}](${3:http://${2:www.url.com}})$0 -endsnippet - -snippet img "Image" -![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0 -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/objc.snippets b/vim/ultisnips-dist/objc.snippets deleted file mode 100644 index 0c67664..0000000 --- a/vim/ultisnips-dist/objc.snippets +++ /dev/null @@ -1,270 +0,0 @@ -########################################################################### -# TextMate Snippets # -########################################################################### - -snippet imp "#import (imp)" b -#import "${1:`!p snip.rv = re.sub(r'\..*$', '.h', fn)`}" -endsnippet - -snippet Imp "#import <> (Imp)" -#import <${1:Cocoa/Cocoa.h}> -endsnippet - -snippet cl "020 Class (objc)" -@interface ${1:`!p -if len(fn): - snip.rv = re.sub(r'\..*$', '', fn) -else: - snip.rv = "object" -`} : ${2:NSObject} -{ -} -@end - -@implementation $1 -- (id)init -{ - if((self = [super init])) - {$0 - } - return self; -} -@end -endsnippet - -snippet array "NSArray (array)" -NSMutableArray *${1:array} = [NSMutableArray array]; -endsnippet - -snippet dict "NSDictionary (dict)" -NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary]; -endsnippet - -snippet forarray "for NSArray loop (forarray)" -unsigned int ${1:object}Count = [${2:array} count]; - -for(unsigned int index = 0; index < $1Count; index += 1) -{ - ${3:id} $1 = [$2 objectAtIndex:index]; - $0 -} -endsnippet - -snippet objacc "Object Accessors (objacc)" -- (${1:id})${2:thing} -{ - return $2; -} - -- (void)set${2/./\u$0/}:($1)aValue -{ - $0${1/( \*)?$/(?1:$1: )/}old${2/./\u$0/} = $2; - $2 = [aValue retain]; - [old${2/./\u$0/} release]; -} -endsnippet - -snippet sel "@selector" -@selector(${1:method}:) -endsnippet - -snippet cdacc "CoreData Accessors Implementation" -- (${1:id})${2:attribute} -{ - [self willAccessValueForKey:@"$2"]; - $1 value = [self primitiveValueForKey:@"$2"]; - [self didAccessValueForKey:@"$2"]; - return value; -} - -- (void)set${2/./\u$0/}:($1)aValue -{ - [self willChangeValueForKey:@"$2"]; - [self setPrimitiveValue:aValue forKey:@"$2"]; - [self didChangeValueForKey:@"$2"]; -} -endsnippet - -snippet delegate "Delegate Responds to Selector" -if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})]) - [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:<>)(?4::)(?5: :)/g}}]; - -endsnippet - -snippet thread "Detach New NSThread" -[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}] -endsnippet - -snippet ibo "IBOutlet (ibo)" -IBOutlet ${1:NSSomeClass} *${2:${1/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; -endsnippet - -snippet I "Initialize Implementation (I)" -+ (void)initialize -{ - [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: - $0@"value", @"key", - nil]]; -} -endsnippet - -snippet bind "Key:value binding (bind)" -bind:@"${1:binding}" toObject:${2:observableController} withKeyPath:@"${3:keyPath}" options:${4:nil} -endsnippet - -snippet arracc "LoD array (arracc)" -- (void)addObjectTo${1:Things}:(${2:id})anObject -{ - [${3:${1/./\l$0/}} addObject:anObject]; -} - -- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i -{ - [$3 insertObject:anObject atIndex:i]; -} - -- ($2)objectIn$1AtIndex:(unsigned int)i -{ - return [$3 objectAtIndex:i]; -} - -- (unsigned int)indexOfObjectIn$1:($2)anObject -{ - return [$3 indexOfObject:anObject]; -} - -- (void)removeObjectFrom$1AtIndex:(unsigned int)i -{ - [$3 removeObjectAtIndex:i]; -} - -- (unsigned int)countOf$1 -{ - return [$3 count]; -} - -- (NSArray *${1/./\l$0/} -{ - return $3; -} - -- (void)set$1:(NSArray *)new$1 -{ - [$3 setArray:new$1]; -} -endsnippet - -snippet arracc "LoD array interface (arracc)" -- (void)addObjectTo${1:Things}:(${2:id})anObject; -- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i; -- ($2)objectIn$1AtIndex:(unsigned int)i; -- (unsigned int)indexOfObjectIn$1:($2)anObject; -- (void)removeObjectFrom$1AtIndex:(unsigned int)i; -- (unsigned int)countOf$1; -- (NSArray *)${1/./\l$0/}; -- (void)set$1:(NSArray *)new$1; -endsnippet - -snippet focus "Lock Focus" -[self lockFocus]; -$0 -[self unlockFocus]; -endsnippet - -snippet pool "NSAutoreleasePool (pool)" -NSAutoreleasePool *pool = [NSAutoreleasePool new]; -$0 -[pool drain]; -endsnippet - -snippet log "NSLog (log) 2" -NSLog(@"$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/} -endsnippet - -snippet alert "NSRunAlertPanel (alert)" -int choice = NSRunAlertPanel(@"${1:Something important!}", @"${2:Something important just happend, and now I need to ask you, do you want to continue?}", @"${3:Continue}", @"${4:Cancel}", nil); -if(choice == NSAlertDefaultReturn) // "$3" -{ - $0; -} -else if(choice == NSAlertAlternateReturn) // "$4" -{ - -} -endsnippet - -snippet format "NSString stringWithFormat (format)" -[NSString stringWithFormat:@"$1", $2]$0 -endsnippet - -snippet objacc "Object Accessors Interface (objacc)" -- (${1:id})${2:thing}; -- (void)set${2/./\u$0/}:($1)aValue; -endsnippet - -snippet prop "Property" -@property (${1/^(e)$|.*/(?1:r)/}${1:r}${1/^(?:(r)|(e)|(c)|(a))$|.*/(?1:etain)(?2:adonly)(?3:opy)(?4:ssign)/}) ${2:NSSomeClass}$ *${3:${2/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; -endsnippet - -snippet getprefs "Read from defaults (getprefs)" -[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}]; -endsnippet - -snippet obs "Register for Notification" -[[NSNotificationCenter defaultCenter] addObserver:${1:self} selector:@selector(${3:${2/^([A-Z]{2})?(.+?)(Notification)?$/\l$2/}}:) name:${2:NSWindowDidBecomeMainNotification} object:${4:nil}]; -endsnippet - -snippet responds "Responds to Selector" -if ([${1:self} respondsToSelector:@selector(${2:someSelector:})]) -{ - [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}]; -} -endsnippet - -snippet gsave "Save and Restore Graphics Context (gsave)" -[NSGraphicsContext saveGraphicsState]; -$0 -[NSGraphicsContext restoreGraphicsState]; - -endsnippet - -snippet acc "Scalar Accessors (acc)" -- (${1:unsigned int})${2:thing} -{ - return ${3:$2}; -} - -- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/} -{ - $3 = new${2/./\u$0/}; -} -endsnippet - -snippet acc "Scalar Accessors Interface (acc)" -- (${1:unsigned int})${2:thing}; -- (void)set${2/./\u$0/}:($1)new${2/./\u$0/}; -endsnippet - -snippet stracc "String Accessors (stracc)" -- (NSString *)${1:thing} -{ - return ${2:$1}; -} - -- (void)set${1/.*/\u$0/}:(NSString *)/})${3:a${1/.*/\u$0/}} -{ - $3 = [$3 copy]; - [$2 release]; - $2 = $3; -} -endsnippet - -snippet syn "Synthesize" -@synthesize ${1:property}; -endsnippet - -snippet setprefs "Write to defaults (setprefs)" -[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}]; -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/perl.snippets b/vim/ultisnips-dist/perl.snippets deleted file mode 100644 index 6a9e8f9..0000000 --- a/vim/ultisnips-dist/perl.snippets +++ /dev/null @@ -1,127 +0,0 @@ -########################################################################### -# TextMate Snippets # -########################################################################### -snippet ife "Conditional if..else (ife)" -if ($1) { - ${2:# body...} -} else { - ${3:# else...} -} - -endsnippet - -snippet ifee "Conditional if..elsif..else (ifee)" -if ($1) { - ${2:# body...} -} elsif ($3) { - ${4:# elsif...} -} else { - ${5:# else...} -} - -endsnippet - -snippet xunless "Conditional one-line (unless)" -${1:expression} unless ${2:condition}; - -endsnippet - -snippet xif "Conditional one-line (xif)" -${1:expression} if ${2:condition}; - -endsnippet - -snippet sub "Function (sub)" -sub ${1:function_name} { - ${2:# body...} -} - -endsnippet - -snippet xfore "Loop one-line (xforeach)" -${1:expression} foreach @${2:array}; - -endsnippet - -snippet xwhile "Loop one-line (xwhile)" -${1:expression} while ${2:condition}; - -endsnippet - -snippet test "Test" -#!/usr/bin/perl -w - -use strict; -use Test::More tests => ${1:1}; -use ${2:ModuleName}; - -ok(${3:assertion}); - -endsnippet - -snippet class "class" -package ${1:ClassName}; - -${2:use base qw(${3:ParentClass});}${2/.+/\n\n/}sub new { - my $class = shift; - $class = ref $class if ref $class; - my $self = bless {}, $class; - $self; -} - -1; - -endsnippet - -snippet eval "eval" -eval { - ${1:# do something risky...} -}; -if ($@) { - ${2:# handle failure...} -} - -endsnippet - -snippet for "for" -for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) { - ${3:# body...} -} - -endsnippet - -snippet fore "foreach" -foreach ${1:my $${2:x}} (@${3:array}) { - ${4:# body...} -} - -endsnippet - -snippet if "if" -if ($1) { - ${2:# body...} -} - -endsnippet - -snippet slurp "slurp" -my $${1:var}; -{ local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE } - -endsnippet - -snippet unless "unless" -unless ($1) { - ${2:# body...} -} - -endsnippet - -snippet while "while" -while ($1) { - ${2:# body...} -} - -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/php.snippets b/vim/ultisnips-dist/php.snippets deleted file mode 100644 index 40461d2..0000000 --- a/vim/ultisnips-dist/php.snippets +++ /dev/null @@ -1,258 +0,0 @@ -## Snippets from SnipMate, taken from -## https://github.com/scrooloose/snipmate-snippets.git - -snippet array "array" -$${1:arrayName} = array('${2}' => ${3});${4} -endsnippet - -snippet def "def" -define('${1}'${2});${3} -endsnippet - -snippet do "do" -do { - ${2:// code... } -} while (${1:/* condition */});" -endsnippet - -snippet doc_f "doc_f" -/** - * $2 - * @return ${4:void} - * @author ${5:`!v g:snips_author`} - **/ -${1:public }function ${2:someFunc}(${3}) -{${6} -} -endsnippet - -snippet doc_i "doc_i" -/** - * $1 - * @package ${2:default} - * @author ${3:`!v g:snips_author`} - **/ -interface ${1:someClass} -{${4} -} // END interface $1" -endsnippet - -snippet else "else" -else { - ${1:// code...} -} -endsnippet - -snippet for "for" -for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4:// code...} -} -endsnippet - -snippet foreachk "foreachk" -foreach ($${1:variable} as $${2:key} => $${3:value}){ - ${4:// code...} -} -endsnippet - -snippet get "get" -$_GET['${1}']${2} -endsnippet - -snippet if "if" -if (${1:/* condition */}) { - ${2:// code...} -} -endsnippet - -snippet inc "inc" -include '${1:file}';${2} -endsnippet - -snippet log "log" -error_log(var_export(${1}, true));${2} -endsnippet - -snippet post "post" -$_POST['${1}']${2} -endsnippet - -snippet req1 "req1" -require_once '${1:file}';${2} -endsnippet - -snippet session "session" -$_SESSION['${1}']${2} -endsnippet - -snippet t "t" -$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5} -endsnippet - -snippet var "var" -var_export(${1});${2} -endsnippet - -snippet getter "PHP Class Getter" !b -/* - * Getter for $1 - */ -public function get${1/\w+\s*/\u$0/}() -{ - return $this->$1;$2 -} -$4 -endsnippet - -snippet setter "PHP Class Setter" !b -/* - * Setter for $1 - */ -public function set${1/\w+\s*/\u$0/}($$1) -{ - $this->$1 = $$1;$3 - ${4:return $this;} -} -$0 -endsnippet - -snippet gs "PHP Class Getter Setter" !b -protected $$1 - -/* - * Getter for $1 - */ -public function get${1/\w+\s*/\u$0/}() -{ - return $this->$1;$2 -} - -/* - * Setter for $1 - */ -public function set${1/\w+\s*/\u$0/}($$1) -{ - $this->$1 = $$1;$3 - ${4:return $this;} -} -$0 -endsnippet - -snippet pub "Public function" !b -public function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet pro "Protected function" !b -protected function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet pri "Private function" !b -private function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet pubs "Public static function" !b -public static function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet pros "Protected static function" !b -protected static function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet pris "Private static function" !b -private static function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet - -snippet fu "Function snip" !b -function ${1:name}(${2:$param}) -{ - ${VISUAL}${3:return null;} -} -$0 -endsnippet -# :vim:ft=snippets - -snippet fore "Foreach loop" -foreach ($${1:variable} as $${3:value}){ - ${VISUAL}${4} -} -$0 -endsnippet - -snippet new "New class instance" !b -$$1 = new $1($2); -$0 -endsnippet - - -snippet ife "if else" -if (${1:/* condition */}) { - ${2:// code...} -} else { - ${3:// code...} -} -$0 -endsnippet - - -snippet class "Class declaration template" !b -/** - * Class ${1:`!p snip.rv=snip.fn.capitalize().split('.')[0]`} - * @author $2 - */ -class $1 -{ - public function ${3:__construct}(${4:$options}) - { - ${4:// code} - } -} -$0 -endsnippet - -snippet pr "Dumb debug helper in HTML" -echo '<pre>' . var_export($1, 1) . '</pre>';$0 -endsnippet - -snippet pc "Dumb debug helper in cli" -var_export($1);$0 -endsnippet - -# Symfony 2 based snippets -snippet sfa "Symfony 2 Controller action" -/** -* @Route("/${1:route_name}", name="$1") -* @Template() -*/ -public function $1Action($2) -{ - $3 - return ${4:array();}$0 -} -endsnippet - -# :vim:ft=snippets: - diff --git a/vim/ultisnips-dist/puppet.snippets b/vim/ultisnips-dist/puppet.snippets deleted file mode 100644 index 68ae0fe..0000000 --- a/vim/ultisnips-dist/puppet.snippets +++ /dev/null @@ -1,78 +0,0 @@ -# Snippets for Puppet - -snippet /^class/ "Class declaration" r -class ${1:name} { - ${0:# body} -} -endsnippet - -snippet File "Defaults for file" b -File { - owner => ${1:username}, - group => ${2:groupname}, -} -endsnippet - -# Resource types -snippet package "Package resource type" b -package { "${1:name}": - ensure => ${2:installed}, -} -endsnippet - -snippet file "File resource type" b -file { "${1:name}": - source => "puppet://${2:path}", - mode => ${3:mode}, -endsnippet - -snippet group "Group resource type" b -group { "${1:groupname}": - ensure => ${3:present}, - gid => ${2:gid}, -endsnippet - -snippet user "user resource type" b -group { "${1:username}": - ensure => ${2:present}, - uid => ${3:uid}, - gid => ${4:gid}, - comment => ${5:gecos}, - home => ${6:homedirectory}, - managehome => false, - require => Group["${7:group"], -endsnippet - -snippet exec "Exec resource type" b -exec { "${1:command}": - refreshonly => true, -} -endsnippet - -snippet cron "Cron resource type" b -cron { "${1:name}": - user => ${2:user}, - command => "${3:command}", - minute => ${3:minute}, - hour => ${4:hour}, -} -endsnippet - -snippet mount "Mount resource type" b -mount { "${1:path}": - device => "${2:/dev}", - fstype => "${3:filesystem}", - ensure => mounted, - options => "rw,errors=remount-ro", -} -endsnippet - -snippet service "Service resource type" b -service { "${1:name}": - hasstatus => true, - enable => true, - ensure => running, -} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/python.snippets b/vim/ultisnips-dist/python.snippets deleted file mode 100644 index 462bf20..0000000 --- a/vim/ultisnips-dist/python.snippets +++ /dev/null @@ -1,463 +0,0 @@ -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### - -#! header -snippet #! "Shebang header for python scripts" b -#!/usr/bin/env python -# encoding: utf-8 -$0 -endsnippet - -snippet ifmain "ifmain" b -if __name__ == '__main__': - ${1:main()}$0 -endsnippet - - -########## -# COMMON # -########## - -# The smart def and smart class snippets use a global option called -# "g:ultisnips_python_style" which, if set to "doxygen" will use doxygen -# style comments in docstrings. - -global !p - -NORMAL = 0x1 -DOXYGEN = 0x2 -SPHINX = 0x3 - -def get_args(arglist): - args = [arg.split('=')[0].strip() for arg in arglist.split(',') if arg] - args = [arg for arg in args if arg and arg != "self"] - - return args - - -def get_style(snip): - style = snip.opt("g:ultisnips_python_style", "normal") - - if style == "doxygen": return DOXYGEN - elif style == "sphinx": return SPHINX - else: return NORMAL - - -def format_arg(arg, style): - if style == DOXYGEN: - return "@param %s @todo" % arg - elif style == SPHINX: - return ":param %s: @todo" % arg - elif style == NORMAL: - return ":%s: @todo" % arg - - -def format_return(style): - if style == DOXYGEN: - return "@return: @todo" - elif style in (NORMAL, SPHINX): - return ":returns: @todo" - - -def write_docstring_args(args, snip): - if not args: - snip.rv += ' """' - return - - snip.rv += '\n' + snip.mkline('', indent='') - - style = get_style(snip) - - for arg in args: - snip += format_arg(arg, style) - - -def write_init_body(args, parents, snip): - parents = [p.strip() for p in parents.split(",")] - parents = [p for p in parents if p != 'object'] - - for p in parents: - snip += p + ".__init__(self)" - - if parents: - snip.rv += '\n' + snip.mkline('', indent='') - - for arg in args: - snip += "self._%s = %s" % (arg, arg) - - -def write_slots_args(args, snip): - args = ['"%s"' % arg for arg in args] - snip += '__slots__ = (%s,)' % ', '.join(args) - -endglobal - -######################################## -# Class & Special Method Name Snippets # -######################################## - -snippet class "class with docstrings" b -class ${1:MyClass}(${2:object}): - """${3:Docstring for $1 }""" - - def __init__(self$4): - """${5:@todo: to be defined}`!p -snip.rv = "" -snip >> 2 - -args = get_args(t[4]) - -write_docstring_args(args, snip) -if args: - snip.rv += '\n' + snip.mkline('', indent='') - snip += '"""' - -write_init_body(args, t[2], snip) -` - $0 -endsnippet - - -snippet slotclass "class with slots and docstrings" b -class ${1:MyClass}(${2:object}): - """${3:Docstring for $1 }""" -`!p -snip >> 1 -args = get_args(t[4]) -write_slots_args(args, snip) -` - - def __init__(self$4): - """${5:@todo: to be defined}`!p -snip.rv = "" -snip >> 2 - -args = get_args(t[4]) - -write_docstring_args(args, snip) -if args: - snip.rv += '\n' + snip.mkline('', indent='') - snip += '"""' - -write_init_body(args, t[2], snip) -` - $0 -endsnippet - - -snippet contain "methods for emulating a container type" b -def __len__(self): - ${1:pass} - -def __getitem__(self, key): - ${2:pass} - -def __setitem__(self, key, value): - ${3:pass} - -def __delitem__(self, key): - ${4:pass} - -def __iter__(self): - ${5:pass} - -def __reversed__(self): - ${6:pass} - -def __contains__(self, item): - ${7:pass} -endsnippet - - -snippet context "context manager methods" b -def __enter__(self): - ${1:pass} - -def __exit__(self, exc_type, exc_value, traceback): - ${2:pass} -endsnippet - - -snippet attr "methods for customizing attribute access" b -def __getattr__(self, name): - ${1:pass} - -def __setattr__(self, name, value): - ${2:pass} - -def __delattr__(self, name): - ${3:pass} -endsnippet - - -snippet desc "methods implementing descriptors" b -def __get__(self, instance, owner): - ${1:pass} - -def __set__(self, instance, value): - ${2:pass} - -def __delete__(self, instance): - ${3:pass} -endsnippet - - -snippet cmp "methods implementing rich comparison" -def __eq__(self, other): - ${1:pass} - -def __ne__(self, other): - ${2:pass} - -def __lt__(self, other): - ${3:pass} - -def __le__(self, other): - ${4:pass} - -def __gt__(self, other): - ${5:pass} - -def __ge__(self, other): - ${6:pass} - -def __cmp__(self, other): - ${7:pass} -endsnippet - - -snippet repr "methods implementing string representation" -def __repr__(self): - ${1:pass} - -def __str__(self): - ${2:pass} - -def __unicode__(self): - ${3:pass} -endsnippet - - -# note: reflected operands and augmented arithmeitc assignements have been -# intentionally ommited to reduce verbosity. -snippet numeric "methods for emulating a numeric type" b -def __add__(self, other): - ${1:pass} - -def __sub__(self, other): - ${2:pass} - -def __mul__(self, other): - ${3:pass} - -def __div__(self, other): - ${4:pass} - -def __truediv__(self, other): - ${5:pass} - -def __floordiv__(self, other): - ${6:pass} - - -def __mod__(self, other): - ${7:pass} - -def __divmod__(self, other): - ${8:pass} - -def __pow__(self, other): - ${9:pass} - - -def __lshift__(self, other): - ${10:pass} - -def __rshift__(self, other): - ${11:pass} - -def __and__(self, other): - ${12:pass} - -def __xor__(self, other): - ${13:pass} - -def __or__(self, other): - ${14:pass} - - -def __neg__(self): - ${15:pass} - -def __pos__(self): - ${16:pass} - -def __abs__(self): - ${17:pass} - -def __invert__(self): - ${18:pass} - - -def __complex__(self): - ${19:pass} - -def __int__(self): - ${20:pass} - -def __long__(self): - ${21:pass} - -def __float__(self): - ${22:pass} - - -def __oct__(self): - ${22:pass} - -def __hex__(self): - ${23:pass} - - -def __index__(self): - ${24:pass} - -def __coerce__(self, other): - ${25:pass} -endsnippet - -snippet def "function with docstrings" b -def ${1:function}(`!p -if snip.indent: - snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}): - """${4:@todo: Docstring for $1}`!p -snip.rv = "" -snip >> 1 - -args = get_args(t[2]) -if args: - write_docstring_args(args, snip) - -style = get_style(snip) -snip += format_return(style) -snip.rv += '\n' + snip.mkline('', indent='') -snip += '"""' ` - ${0:pass} -endsnippet - - -# doesn't expand when there is a word in front -snippet /(^|(?<=\W))\./ "self." r -self. -endsnippet - -snippet from "from module import name" b -from ${1:module} import ${2:Stuff} -endsnippet - - -############## -# PROPERTIES # -############## -snippet roprop "Read Only Property" b -@property -def ${1:property}(self): - ${2:return self._$1}$0 -endsnippet - -snippet rwprop "Read write property" b -def ${1:property}(): - ${2/.+/(?0:""")/}${2:The RW property $1}${2/.+/(?0:"""\n )/}def fget(self): - return self._$1$0 - def fset(self, value): - self._$1 = value - return locals() -$1 = property(**$1()) -endsnippet - - -########################## -# Try / Except / Finally # -########################## -snippet try "Try / Except" b -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} -endsnippet - -snippet try "Try / Except / Else" b -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} -else: - ${5:pass} -endsnippet - -snippet try "Try / Except / Finally" b -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} -finally: - ${5:pass} -endsnippet - -snippet try "Try / Except / Else / Finally" b -try: - ${1:pass} -except${2: ${3:Exception}, ${4:e}}: - ${5:raise} -else: - ${6:pass} -finally: - ${7:pass} -endsnippet - - -##################### -# Assertions & Tests # -##################### - -snippet pdb "Set PDB breakpoint" b -import pdb; pdb.set_trace() -endsnippet - -snippet ae "Assert equal" b -self.assertEqual(${1:first},${2:second}) -endsnippet - -snippet at "Assert True" b -self.assertTrue(${0:exp}) -endsnippet - -snippet af "Assert False" b -self.assertFalse(${1:expression}) -endsnippet - -snippet aae "Assert almost equal" b -self.assertAlmostEqual(${1:first},${2:second}) -endsnippet - -snippet ar "Assert raises" b -self.assertRaises(${1:exception}, ${2:func}${3/.+/, /}${3:arguments}) -endsnippet - - -snippet testcase "pyunit testcase" b -class Test${1:Class}(${2:unittest.TestCase}): - """${3:Test case docstring}""" - - def setUp(self): - ${4:pass} - - def tearDown(self): - ${5:pass} - - def test_${6:name}(self): - ${7:pass} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/rails.snippets b/vim/ultisnips-dist/rails.snippets deleted file mode 100644 index 9e0e29f..0000000 --- a/vim/ultisnips-dist/rails.snippets +++ /dev/null @@ -1,906 +0,0 @@ -########################################################################### -# GENERATED FROM get_tm_snippets.py # -########################################################################### - -snippet anaf "accepts_nested_attributes_for" -accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc \{ |obj| ${5:obj.blank?} \}}} - -endsnippet - -snippet tcbi "Create binary column" -t.binary :${1:title}${2:, :limit => ${3:2}.megabytes} -$0 -endsnippet - -snippet tcb "Create boolean column" -t.boolean :${1:title} -$0 -endsnippet - -snippet cla "Create controller class" -class ${1:Model}Controller < ApplicationController - before_filter :find_${2:model} - - $0 - - private - def find_${2} - @$2 = ${3:$1}.find(params[:id]) if params[:id] - end -end -endsnippet - -snippet tcda "Create date column" -t.date :${1:title} -$0 -endsnippet - -snippet tcdt "Create datetime column" -t.datetime :${1:title} -$0 -endsnippet - -snippet tcd "Create decimal column" -t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}} -$0 -endsnippet - -snippet tcf "Create float column" -t.float :${1:title} -$0 -endsnippet - -snippet cla "Create functional test class" -require 'test_helper' - -class ${1:Model}ControllerTest < ActionController::TestCase - test$0 -end - -endsnippet - -snippet tci "Create integer column" -t.integer :${1:title} -$0 -endsnippet - -snippet tcl "Create lock_version column" -t.integer :lock_version, :null => false, :default => 0 -$0 -endsnippet - -# FIXME: handling literal bracket pair inside of nested tab groups? -snippet tcr "Create references column" -t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}} -$0 -endsnippet - -snippet resources "Create resources controller class" -class ${1:Model}sController < ApplicationController - before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy] - - # GET /${1/./\l$0/}s - # GET /${1/./\l$0/}s.xml - def index - @${1/./\l$0/}s = ${1:Model}.all - - respond_to do |wants| - wants.html # index.html.erb - wants.xml { render :xml => @${1/./\l$0/}s } - end - end - - # GET /${1/./\l$0/}s/1 - # GET /${1/./\l$0/}s/1.xml - def show - respond_to do |wants| - wants.html # show.html.erb - wants.xml { render :xml => @${1/./\l$0/} } - end - end - - # GET /${1/./\l$0/}s/new - # GET /${1/./\l$0/}s/new.xml - def new - @${1/./\l$0/} = ${1:Model}.new - - respond_to do |wants| - wants.html # new.html.erb - wants.xml { render :xml => @${1/./\l$0/} } - end - end - - # GET /${1/./\l$0/}s/1/edit - def edit - end - - # POST /${1/./\l$0/}s - # POST /${1/./\l$0/}s.xml - def create - @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}]) - - respond_to do |wants| - if @${1/./\l$0/}.save - flash[:notice] = '${1:Model} was successfully created.' - wants.html { redirect_to(@${1/./\l$0/}) } - wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} } - else - wants.html { render :action => "new" } - wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } - end - end - end - - # PUT /${1/./\l$0/}s/1 - # PUT /${1/./\l$0/}s/1.xml - def update - respond_to do |wants| - if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}]) - flash[:notice] = '${1:Model} was successfully updated.' - wants.html { redirect_to(@${1/./\l$0/}) } - wants.xml { head :ok } - else - wants.html { render :action => "edit" } - wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } - end - end - end - - # DELETE /${1/./\l$0/}s/1 - # DELETE /${1/./\l$0/}s/1.xml - def destroy - @${1/./\l$0/}.destroy - - respond_to do |wants| - wants.html { redirect_to(${1/./\l$0/}s_url) } - wants.xml { head :ok } - end - end - - private - def find_${1/./\l$0/} - @${1/./\l$0/} = ${1:Model}.find(params[:id]) - end - -end - -endsnippet - -snippet tcs "Create string column" -t.string :${1:title} -$0 -endsnippet - -snippet tct "Create text column" -t.text :${1:title} -$0 -endsnippet - -snippet tcti "Create time column" -t.time :${1:title} -$0 -endsnippet - -snippet tcts "Create timestamp column" -t.timestamp :${1:title} -$0 -endsnippet - -snippet tctss "Create timestamps columns" -t.timestamps -$0 -endsnippet - -snippet mcol "Migration Create Column (mcc)" -t.column ${1:title}, :${2:string} -$0 -endsnippet - -snippet mccc "Migration Create Column Continue (mccc)" -t.column ${1:title}, :${2:string} -mccc$0 -endsnippet - -snippet mtab "Migration Drop Create Table (mdct)" -drop_table :${1:table}${2: [press tab twice to generate create_table]} -endsnippet - -snippet mcol "Migration Remove and Add Column (mrac)" -remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]} -endsnippet - -snippet rdb "RAILS_DEFAULT_LOGGER.debug (rdb)" -RAILS_DEFAULT_LOGGER.debug "${1:message}"$0 -endsnippet - -snippet tre "Table column(s) rename" -t.rename(:${1:old_column_name}, :${2:new_column_name}) -$0 -endsnippet - -snippet art "Test Assert Redirected To (art)" -assert_redirected_to ${2::action => "${1:index}"} -endsnippet - -snippet asre "Test Assert Response (are)" -assert_response :${1:success}, @response.body$0 -endsnippet - -snippet aftc "after_create" -after_create -endsnippet - -snippet aftd "after_destroy" -after_destroy -endsnippet - -snippet afts "after_save" -after_save -endsnippet - -snippet aftu "after_update" -after_update -endsnippet - -snippet aftv "after_validation" -after_validation -endsnippet - -snippet aftvoc "after_validation_on_create" -after_validation_on_create -endsnippet - -snippet aftvou "after_validation_on_update" -after_validation_on_update -endsnippet - -snippet asg "assert(var = assigns(:var))" -assert(${1:var} = assigns(:${1}), "Cannot find @${1}") -$0 -endsnippet - -snippet asd "assert_difference" -assert_difference "${1:Model}.${2:count}", ${3:1} do - $0 -end -endsnippet - -snippet asnd "assert_no_difference" -assert_no_difference "${1:Model}.${2:count}" do - $0 -end -endsnippet - -snippet artnpp "assert_redirected_to (nested path plural)" -assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})} -endsnippet - -snippet artnp "assert_redirected_to (nested path)" -assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})} -endsnippet - -snippet artpp "assert_redirected_to (path plural)" -assert_redirected_to ${10:${2:model}s_path} -endsnippet - -snippet artp "assert_redirected_to (path)" -assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})} -endsnippet - -snippet asrj "assert_rjs" -assert_rjs :${1:replace}, ${2:"${3:dom id}"} -endsnippet - -snippet ass "assert_select" -assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do - $0 -end} -endsnippet - -snippet befc "before_create" -before_create -endsnippet - -snippet befd "before_destroy" -before_destroy -endsnippet - -snippet befs "before_save" -before_save -endsnippet - -snippet befu "before_update" -before_update -endsnippet - -snippet befv "before_validation" -before_validation -endsnippet - -snippet befvoc "before_validation_on_create" -before_validation_on_create -endsnippet - -snippet befvou "before_validation_on_update" -before_validation_on_update -endsnippet - -snippet bt "belongs_to (bt)" -belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} -endsnippet - -snippet crw "cattr_accessor" -cattr_accessor :${0:attr_names} -endsnippet - -snippet defcreate "def create - resource" -def create - @${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1]) - $0 - respond_to do |wants| - if @$1.save - flash[:notice] = '$2 was successfully created.' - wants.html { redirect_to(@$1) } - wants.xml { render :xml => @$1, :status => :created, :location => @$1 } - else - wants.html { render :action => "new" } - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } - end - end -end - -endsnippet - -snippet test "test do..end" -test "${1:something interesting}" do - $0 -end -endsnippet - -snippet deftg "def get request" -def test_should_get_${1:action} - ${2:@${3:model} = ${4:$3s}(:${5:fixture_name}) - }get :${1}${6:, :id => @$3.to_param} - assert_response :success - $0 -end -endsnippet - -snippet deftp "def post request" -def test_should_post_${1:action} - ${3:@$2 = ${4:$2s}(:${5:fixture_name}) - }post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 } - assert_response :redirect - -end -endsnippet - -snippet fina "find(:all)" -find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) -endsnippet - -snippet finf "find(:first)" -find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) -endsnippet - -snippet fini "find(id)" -find(${1:id}) -endsnippet - -snippet fine "find_each" -find_each(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}| - $0 -end -endsnippet - -snippet finb "find_in_batches" -find_in_batches(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}s| - $4s.each do |$4| - $0 - end -end -endsnippet - -snippet habtm "has_and_belongs_to_many (habtm)" -has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"} -endsnippet - -snippet hm "has_many (hm)" -has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"} -endsnippet - -snippet hmt "has_many (through)" -has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}} -endsnippet - -snippet hmd "has_many :dependent => :destroy" -has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0 -endsnippet - -snippet ho "has_one (ho)" -has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} -endsnippet - -snippet logd "logger.debug" -${1:Rails.}logger.debug { "${1:message}" }$0 -endsnippet - -snippet loge "logger.error" -logger.error { "${1:message}" }$0 -endsnippet - -snippet logf "logger.fatal" -logger.fatal { "${1:message}" }$0 -endsnippet - -snippet logi "logger.info" -logger.info { "${1:message}" }$0 -endsnippet - -snippet logw "logger.warn" -logger.warn { "${1:message}" }$0 -endsnippet - -snippet mp "map(&:sym_proc)" -map(&:${1:id}) -endsnippet - -snippet mapca "map.catch_all" -${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}" - -endsnippet - -snippet map "map.named_route" -${1:map}.${2:connect} '${3::controller/:action/:id}' -endsnippet - -snippet mapr "map.resource" -${1:map}.resource :${2:resource}${10: do |${11:$2}| - $0 -end} -endsnippet - -snippet maprs "map.resources" -${1:map}.resources :${2:resource}${10: do |${11:$2}| - $0 -end} -endsnippet - -snippet mapwo "map.with_options" -${1:map}.with_options :${2:controller} => '${3:thing}' do |${4:$3}| - $0 -end - -endsnippet - -snippet mrw "mattr_accessor" -mattr_accessor :${0:attr_names} -endsnippet - -snippet ncl "named_scope lambda" -named_scope :name, lambda { |${1:param}| { :conditions => ${3:['${4:${5:field} = ?}', ${6:$1}]} } } - -endsnippet - -snippet nc "named_scope" -named_scope :name${1:, :joins => :${2:table}}, :conditions => ${3:['${4:${5:field} = ?}', ${6:true}]} - -endsnippet - -snippet dscope "default_scope" -default_scope ${1:order(${2:'${3:created_at DESC}'})} -endsnippet - -snippet flash "flash[...]" -flash[:${1:notice}] = "${2:Successfully created...}"$0 -endsnippet - -snippet rea "redirect_to (action)" -redirect_to :action => "${1:index}" -endsnippet - -snippet reai "redirect_to (action, id)" -redirect_to :action => "${1:show}", :id => ${0:@item} -endsnippet - -snippet rec "redirect_to (controller)" -redirect_to :controller => "${1:items}" -endsnippet - -snippet reca "redirect_to (controller, action)" -redirect_to :controller => "${1:items}", :action => "${2:list}" -endsnippet - -snippet recai "redirect_to (controller, action, id)" -redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@item} -endsnippet - -snippet renpp "redirect_to (nested path plural)" -redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})}) -endsnippet - -snippet renp "redirect_to (nested path)" -redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}) -endsnippet - -snippet repp "redirect_to (path plural)" -redirect_to(${2:${10:model}s_path}) -endsnippet - -snippet rep "redirect_to (path)" -redirect_to(${2:${12:model}_path(${13:@}${14:${12}})}) -endsnippet - -snippet reb "redirect_to :back" -redirect_to :back -endsnippet - -snippet ra "render (action)... (ra)" -render :action => "${1:action}" -endsnippet - -snippet ral "render (action,layout) (ral)" -render :action => "${1:action}", :layout => "${2:layoutname}" -endsnippet - -snippet rf "render (file) (rf)" -render :file => "${1:filepath}" -endsnippet - -snippet rfu "render (file,use_full_path) (rfu)" -render :file => "${1:filepath}", :use_full_path => ${2:false} -endsnippet - -snippet ri "render (inline) (ri)" -render :inline => "${1:<%= 'hello' %>}" -endsnippet - -snippet ril "render (inline,locals) (ril)" -render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"$4 } -endsnippet - -snippet rit "render (inline,type) (rit)" -render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml} -endsnippet - -snippet rl "render (layout) (rl)" -render :layout => "${1:layoutname}" -endsnippet - -snippet rn "render (nothing) (rn)" -render :nothing => ${1:true} -endsnippet - -snippet rns "render (nothing,status) (rns)" -render :nothing => ${1:true}, :status => ${2:401} -endsnippet - -snippet rt "render (text) (rt)" -render :text => "${1:text to render...}" -endsnippet - -snippet rtl "render (text,layout) (rtl)" -render :text => "${1:text to render...}", :layout => "${2:layoutname}" -endsnippet - -snippet rtlt "render (text,layout => true) (rtlt)" -render :text => "${1:text to render...}", :layout => ${2:true} -endsnippet - -snippet rts "render (text,status) (rts)" -render :text => "${1:text to render...}", :status => ${2:401} -endsnippet - -snippet ru "render (update)" -render :update do |${2:page}| - $2.$0 -end -endsnippet - -snippet rest "respond_to" -respond_to do |wants| - wants.${1:html}${2: { $0 \}} -end -endsnippet - -snippet resw "respond_with" -respond_with(${1:@${2:model}})${3: do |format| - format.${4:html} { $0 \} -end} -endsnippet - -# FIXME -snippet returning "returning do |variable| ... end" -returning ${1:variable} do${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${2:v}${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/} - $0 -end -endsnippet - -snippet t. "t.binary (tcbi)" -t.binary :${1:title}${2:, :limit => ${3:2}.megabytes} -t.$0 -endsnippet - -snippet t. "t.boolean (tcb)" -t.boolean :${1:title} -t.$0 -endsnippet - -snippet t. "t.date (tcda)" -t.date :${1:title} -t.$0 -endsnippet - -snippet t. "t.datetime (tcdt)" -t.datetime :${1:title} -t.$0 -endsnippet - -snippet t. "t.decimal (tcd)" -t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}} -t.$0 -endsnippet - -snippet t. "t.float (tcf)" -t.float :${1:title} -t.$0 -endsnippet - -snippet t. "t.integer (tci)" -t.integer :${1:title} -t.$0 -endsnippet - -snippet t. "t.lock_version (tcl)" -t.integer :lock_version, :null => false, :default => 0 -t.$0 -endsnippet - -snippet t. "t.references (tcr)" -t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}} -t.$0 -endsnippet - -snippet t. "t.rename (tre)" -t.rename(:${1:old_column_name}, :${2:new_column_name}) -t.$0 -endsnippet - -snippet t. "t.string (tcs)" -t.string :${1:title} -t.$0 -endsnippet - -snippet t. "t.text (tct)" -t.text :${1:title} -t.$0 -endsnippet - -snippet t. "t.time (tcti)" -t.time :${1:title} -t.$0 -endsnippet - -snippet t. "t.timestamp (tcts)" -t.timestamp :${1:title} -t.$0 -endsnippet - -snippet t. "t.timestamps (tctss)" -t.timestamps -t.$0 -endsnippet - -snippet vaoif "validates_acceptance_of if" -validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }} -endsnippet - -snippet vao "validates_acceptance_of" -validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}} -endsnippet - -snippet va "validates_associated (va)" -validates_associated :${1:attribute}${2:, :on => :${3:create}} -endsnippet - -snippet vaif "validates_associated if (vaif)" -validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }} -endsnippet - -snippet vc "validates_confirmation_of (vc)" -validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"} -endsnippet - -snippet vcif "validates_confirmation_of if (vcif)" -validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }} -endsnippet - -snippet ve "validates_exclusion_of (ve)" -validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"} -endsnippet - -snippet veif "validates_exclusion_of if (veif)" -validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }} -endsnippet - -snippet vfif "validates_format_of if" -validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }} -endsnippet - -snippet vf "validates_format_of" -validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"} -endsnippet - -snippet viif "validates_inclusion_of if" -validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }} -endsnippet - -snippet vi "validates_inclusion_of" -validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"} -endsnippet - -snippet vl "validates_length_of (vl)" -validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"} -endsnippet - -snippet vlif "validates_length_of if" -validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }} -endsnippet - -snippet vnif "validates_numericality_of if" -validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }} -endsnippet - -snippet vn "validates_numericality_of" -validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"} -endsnippet - -snippet vp "validates_presence_of (vp)" -validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"} -endsnippet - -snippet vpif "validates_presence_of if (vpif) 2" -validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }} -endsnippet - -snippet vu "validates_uniqueness_of (vu)" -validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"} -endsnippet - -snippet vuif "validates_uniqueness_of if (vuif)" -validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }} -endsnippet - -snippet verify "verify -- render" -verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"} - -endsnippet - -snippet verify "verify -- redirect" -verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'} - -endsnippet - -snippet wants "wants_format" -wants.${1:js|xml|html}${2: { $0 \}} -endsnippet - -snippet xdelete "xhr delete" -xhr :delete, :${1:destroy}, :id => ${2:1}$0 -endsnippet - -snippet xget "xhr get" -xhr :get, :${1:show}${2:, :id => ${3:1}}$0 -endsnippet - -snippet xpost "xhr post" -xhr :post, :${1:create}, :${2:object} => { $3 } -endsnippet - -snippet xput "xhr put" -xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0 -endsnippet - -snippet finl "find(:last)" -find(:last${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) -endsnippet - -snippet sweeper "Create sweeper class" -class ${1:Model}Sweeper < ActionController::Caching::Sweeper - observe ${1:Model} - - def after_save(${1/./\l$0/}) - expire_cache(${1/./\l$0/}) - end - - def after_destroy(${1/./\l$0/}) - expire_cache(${1/./\l$0/}) - end - - private - - def expire_cache(${1/./\l$0/}) - ${0:expire_page ${1/./\l$0/}s_path - expire_page ${1/./\l$0/}_path(${1/./\l$0/})} - end - -end -endsnippet - -snippet col "collection routes" -collection do - ${1:get :${2:action}} - ${3:put :${4:action}} - ${5:post :${6:action}} - ${7:delete :${8:action}} -end -endsnippet - -snippet format "format (respond_with)" -format.${1:html|xml|json|js|any} { $0 } -endsnippet - -snippet gem "gem" -gem '${1:name}'${2:${3:, "${4:1.0}"}${5:${6:, :require => ${7:"${8:$1}"}}${9:, :group => :${10:test}}}} -endsnippet - -snippet gemg "gem :git" -gem '${1:paperclip}', :git => "${2:git://github.com/thoughtbot/paperclip.git}"${3:, :branch => "${4:rails3}"} -endsnippet - -snippet match "match" -match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: => '${9:$2}#${10:$4}'${11:, :as => :${12:$10}}} -endsnippet - -snippet member "member routes" -member do - ${1:get :${2:action}} - ${3:put :${4:action}} - ${5:post :${6:action}} - ${7:delete :${8:action}} -end -endsnippet - -snippet res "resources" -resources :${1:posts}${2: do - $3 -end} -endsnippet - -snippet scope "scope" -scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}}) -endsnippet - -snippet scopel "scope lambda" -scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} => ${6:"${7:value}"}})} } -endsnippet - -snippet scopee "scope with extension" -scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do - def ${7:method_name} - $0 - end -end -endsnippet - -snippet sb "scoped_by" -scoped_by_${1:attribute}(${2:id}) -endsnippet - -snippet setup "setup do..end" -setup do - $0 -end -endsnippet - -snippet trans "Translation snippet" -I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0} -endsnippet - -snippet route_spec -it 'routes to #${1:action}' do - ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6} -end -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/rst.snippets b/vim/ultisnips-dist/rst.snippets deleted file mode 100644 index 7174510..0000000 --- a/vim/ultisnips-dist/rst.snippets +++ /dev/null @@ -1,61 +0,0 @@ - - -########################################################################### -# General Stuff # -########################################################################### -snippet part "Part" b -`!p snip.rv = len(t[1])*'#'` -${1:Part name} -`!p snip.rv = len(t[1])*'#'` - -$0 -endsnippet - -snippet sec "Section" b -${1:Section name} -`!p snip.rv = len(t[1])*'='` - -$0 -endsnippet - -snippet ssec "Subsection" b -${1:Section name} -`!p snip.rv = len(t[1])*'-'` - -$0 -endsnippet - -snippet sssec "Subsubsection" b -${1:Section name} -`!p snip.rv = len(t[1])*'^'` - -$0 -endsnippet - -snippet chap "Chapter" b -`!p snip.rv = len(t[1])*'*'` -${1:Chapter name} -`!p snip.rv = len(t[1])*'*'` - -$0 -endsnippet - -snippet para "Paragraph" b -${1:Paragraph name} -`!p snip.rv = len(t[1])*'"'` - -$0 -endsnippet - -########################################################################### -# More Specialized Stuff. # -########################################################################### -snippet cb "Code Block" b -.. code-block:: ${1:lua} - - ${2:code} - -$0 -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/ruby.snippets b/vim/ultisnips-dist/ruby.snippets deleted file mode 100644 index 6336589..0000000 --- a/vim/ultisnips-dist/ruby.snippets +++ /dev/null @@ -1,568 +0,0 @@ -snippet "^#!" "#!/usr/bin/env ruby" r -#!/usr/bin/env ruby -$0 -endsnippet - - -snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r -# encoding: UTF-8 -$0 -endsnippet - - - -snippet If "<command> if <expression>" -${1:command} if ${0:expression} -endsnippet - - - -snippet Unless "<command> unless <expression>" -${1:command} unless ${0:expression} -endsnippet - - - -snippet if "if <condition> ... end" -if ${1:condition} - ${2:# TODO} -end -endsnippet - - - -snippet ife "if <condition> ... else ... end" -if ${1:condition} - ${2:# TODO} -else - ${3:# TODO} -end -endsnippet - - - -snippet ifee "if <condition> ... elseif <condition> ... else ... end" -if ${1:condition} - ${2:# TODO} -elsif ${3:condition} - ${4:# TODO} -else - ${0:# TODO} -end -endsnippet - - - -snippet unless "unless <condition> ... end" -unless ${1:condition} - ${0:# TODO} -end -endsnippet - - - -snippet unlesse "unless <condition> ... else ... end" -unless ${1:condition} - ${2:# TODO} -else - ${0:# TODO} -end -endsnippet - - - -snippet unlesee "unless <condition> ... elseif <condition> ... else ... end" -unless ${1:condition} - ${2:# TODO} -elsif ${3:condition} - ${4:# TODO} -else - ${0:# TODO} -end -endsnippet - - - -snippet "\b(de)?f" "def <name>..." r -def ${1:function_name}${2: ${3:*args}} - ${0:# TODO} -end -endsnippet - - - -snippet defi "def initialize ..." -def initialize${1: ${2:*args}} - ${0:# TODO} -end -endsnippet - - - -snippet defr "def <name> ... rescue ..." -def ${1:function_name}${2: ${3:*args}} - ${4:# TODO} -rescue - ${0:# TODO} -end -endsnippet - - - -snippet For "(<from>..<to>).each { |<i>| <block> }" -(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} } -endsnippet - - - -snippet for "(<from>..<to>).each do |<i>| <block> end" -(${1:from}..${2:to}).each do |${3:i}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Merge!" ".merge!(<other_hash>) { |<key>,<oldval>,<newval>| <block> }" r -`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) { |${2:key},${3:oldval},${4:newval}| ${5:block} } -endsnippet - - - -snippet "(\S+)\.merge!" ".merge!(<other_hash>) do |<key>,<oldval>,<newval>| <block> end" r -`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) do |${2:key},${3:oldval},${4:newval}| - ${0:block} -end -endsnippet - - - -snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |<key>,<value>| <block> }" r -`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3:# TODO} } -endsnippet - - - -snippet "(\S+)\.del(ete)?_?if" ".delete_if do |<key>,<value>| <block> end" r -`!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Keep_?if" ".keep_if { |<key>,<value>| <block> }" r -`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3:# TODO} } -endsnippet - - - -snippet "(\S+)\.keep_?if" ".keep_if do <key>,<value>| <block> end" r -`!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Reject" ".reject { |<key>,<value>| <block> }" r -`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3:# TODO} } -endsnippet - - - -snippet "(\S+)\.reject" ".reject do <key>,<value>| <block> end" r -`!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Select" ".select { |<item>| <block>}" r -`!p snip.rv=match.group(1)`.select { |${1:item}| ${2:block} } -endsnippet - - - -snippet "(\S+)\.select" ".select do |<item>| <block> end" r -`!p snip.rv=match.group(1)`.select do |${1:item}| - ${0:block} -end -endsnippet - - - -snippet "(\S+)\.Sort" ".sort { |<a>,<b>| <block> }" r -`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3:# TODO} } -endsnippet - - - -snippet "(\S+)\.sort" ".sort do |<a>,<b>| <block> end" r -`!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Each_?k(ey)?" ".each_key { |<key>| <block> }" r -`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2:# TODO} } -endsnippet - - - -snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| <block> end" r -`!p snip.rv=match.group(1)`.each_key do |${1:key}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Each_?val(ue)?" ".each_value { |<value>| <block> }" r -`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2:# TODO} } -endsnippet - - - -snippet "(\S+)\.each_?val(ue)?" ".each_value do |<value>| <block> end" r -`!p snip.rv=match.group(1)`.each_value do |${1:value}| - ${0:# TODO} -end -endsnippet - - - -snippet Each "<elements>.each { |<element>| <block> }" -${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} } -endsnippet - - - -snippet each "<elements>.each do |<element>| <block> end" -${1:elements}.each do |${2:${1/s$//}}| - ${0:# TODO} -end -endsnippet - - - -snippet each_?s(lice)? "<array>.each_slice(n) do |slice| <block> end" -each_slice(${1:2}) do |${2:slice}| - ${0:# TODO} -end -endsnippet - - - -snippet Each_?s(lice)? "<array>.each_slice(n) { |slice| <block> }" -each_slice(${1:2}) { |${2:slice}| ${3:# TODO} } -endsnippet - - - - -snippet "(\S+)\.Map" ".map { |<element>| <block> }" r -`!p snip.rv=match.group(1)`.map { |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| ${2:# TODO} } -endsnippet - - - -snippet "(\S+)\.map" ".map do |<element>| <block> end" r -`!p snip.rv=match.group(1)`.map do |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Rev(erse)?_?each" ".reverse_each { |<element>| <block> }" r -`!p snip.rv=match.group(1)`.reverse_each { |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| ${2:# TODO} } -endsnippet - - - -snippet "(\S+)\.rev(erse)?_?each" ".reverse_each do |<element>| <block> end" r -`!p snip.rv=match.group(1)`.reverse_each do |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.Each" ".each { |<element>| <block> }" r -`!p snip.rv=match.group(1)`.each { |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| ${2:# TODO} } -endsnippet - - - -snippet "(\S+)\.each" ".each do |<element>| <block> end" r -`!p snip.rv=match.group(1)`.each do |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`}| - ${0:# TODO} -end -endsnippet - - - - -snippet "(\S+)\.Each_w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r -`!p snip.rv=match.group(1)`.each_with_index { |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`},${2:i}| ${3:# TODO} }$0 -endsnippet - - - -snippet "(\S+)\.each_?w(ith)?_?i(ndex)?" ".each_with_index do |<element>,<i>| <block> end" r -`!p snip.rv=match.group(1)`.each_with_index do |${1:`!p -element_name = match.group(1).lstrip('$@') -ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) -try: - wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) - snip.rv = wmatch.group(1).lower() -except: - snip.rv = 'element' -`},${2:i}| - ${0:# TODO} -end -endsnippet - - - - -snippet "(\S+)\.Each_?p(air)?" ".each_pair { |<key>,<value>| <block> }" r -`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3:# TODO} } -endsnippet - - - -snippet "(\S+)\.each_?p(air)?" ".each_pair do |<key>,<value>| <block> end" r -`!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}| - ${0:# TODO} -end -endsnippet - - - -snippet "(\S+)\.sub" ".sub(<expression>) { <block> }" r -`!p snip.rv=match.group(1)`.sub(${1:expression}) { ${2:"replace_with"} } -endsnippet - - - -snippet "(\S+)\.gsub" ".gsub(<expression>) { <block> }" r -`!p snip.rv=match.group(1)`.gsub(${1:expression}) { ${2:"replace_with"} } -endsnippet - - - -snippet "(\S+)\.index" ".index { |item| <block> }" r -`!p snip.rv=match.group(1)`.index { |${1:item}| ${2:block} } -endsnippet - - - -snippet "(\S+)\.Index" ".index do |item| ... end" r -`!p snip.rv=match.group(1)`.index do |${1:item}| - ${0:block} -end -endsnippet - - - -snippet do "do |<key>| ... end" i -do ${1:|${2:key}|} - $0 -end -endsnippet - - - -snippet Do "do ... end" i -do - $0 -end -endsnippet - - -snippet until "until <expression> ... end" -until ${1:expression} - ${0:# TODO} -end -endsnippet - - - -snippet Until "begin ... end until <expression>" -begin - ${0:# TODO} -end until ${1:expression} -endsnippet - - - -snippet while "while <expression> ... end" -while ${1:expression} - ${0:# TODO} -end -endsnippet - - - -snippet While "begin ... end while <expression>" -begin - ${0:# TODO} -end while ${1:expression} -endsnippet - - - -snippet "\b(r|attr)" "attr_reader :<attr_names>" r -attr_reader :${0:attr_names} -endsnippet - - - -snippet "\b(w|attr)" "attr_writer :<attr_names>" r -attr_writer :${0:attr_names} -endsnippet - - - -snippet "\b(rw|attr)" "attr_accessor :<attr_names>" r -attr_accessor :${0:attr_names} -endsnippet - - - -snippet begin "begin ... rescue ... end" -begin - ${1:# TODO} -rescue - ${0:# TODO} -end -endsnippet - - - -snippet begin "begin ... rescue ... else ... ensure ... end" -begin - ${1:# Raise exception} -rescue Exception => e - puts e.message - puts e.backtrace.inspect - ${2:# Rescue} -else - ${3:# other exception} -ensure - ${0:# always excute} -end -endsnippet - - - -snippet rescue -rescue Exception => e - puts e.message - puts e.backtrace.inspect - ${0:# Rescue} -endsnippet - - - -snippet "\b(case|sw(itch)?)" "case <variable> when <expression> ... end" r -case ${1:variable} -when ${2:expression} -$0 -end -endsnippet - - - -snippet alias "alias :<new_name> :<old_name>" -alias :${1:new_name} :${2:old_name} -endsnippet - - - -snippet class "class <class_name> def initialize ... end end" -class ${1:class_name} - def initialize ${2:*args} - $0 - end -end -endsnippet - - - -snippet module "module" -module ${1:module_name} - $0 -end -endsnippet - - - -snippet ### -=begin - $0 -=end -endsnippet - -# vim: set ts=2 sw=2 expandtab: diff --git a/vim/ultisnips-dist/sh.snippets b/vim/ultisnips-dist/sh.snippets deleted file mode 100644 index 1085d86..0000000 --- a/vim/ultisnips-dist/sh.snippets +++ /dev/null @@ -1,71 +0,0 @@ - -########################################################################### -# TextMate Snippets # -########################################################################### -snippet #! -#!/bin/sh - -endsnippet - -snippet !env "#!/usr/bin/env (!env)" -#!/usr/bin/env bash - -endsnippet - -snippet temp "Tempfile" -${1:TMPFILE}="$(mktemp -t ${2:`!p -snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled" -`})" -${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}} - -endsnippet - -snippet case "case .. esac (case)" -case ${1:word} in - ${2:pattern} ) - $0;; -esac -endsnippet - -snippet elif "elif .. (elif)" -elif ${2:[[ ${1:condition} ]]}; then - ${0:#statements} -endsnippet - -snippet for "for ... done (for)" -for (( i = 0; i < ${1:10}; i++ )); do - ${0:#statements} -done -endsnippet - -snippet forin "for ... in ... done (forin)" -for ${1:i}${2/.+/ in /}${2:words}; do - ${0:#statements} -done -endsnippet - -snippet here "here document (here)" -<<-${2:'${1:TOKEN}'} - $0 -${1/['"`](.+)['"`]/$1/} -endsnippet - -snippet if "if ... then (if)" -if ${2:[[ ${1:condition} ]]}; then - ${0:#statements} -fi -endsnippet - -snippet until "until ... (done)" -until ${2:[[ ${1:condition} ]]}; do - ${0:#statements} -done -endsnippet - -snippet while "while ... (done)" -while ${2:[[ ${1:condition} ]]}; do - ${0:#statements} -done -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/snippets.snippets b/vim/ultisnips-dist/snippets.snippets deleted file mode 100644 index 414f350..0000000 --- a/vim/ultisnips-dist/snippets.snippets +++ /dev/null @@ -1,23 +0,0 @@ -######################### -# SNIPPETS for SNIPPETS # -######################### - -# We use a little hack so that the snippet is expanded -# and parsed correctly -snippet snip "Snippet definition" ! -`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:!b} -$0 -`!p snip.rv = "endsnippet"` -endsnippet - -snippet global "Global snippet" ! -`!p snip.rv = "global"` !p -$0 -`!p snip.rv = "endglobal"` -endsnippet - -snippet vis "${VISUAL}" i -\$\{VISUAL${1:${2:default}${3:/transform/}}\} -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/tcl.snippets b/vim/ultisnips-dist/tcl.snippets deleted file mode 100644 index 2cb1f34..0000000 --- a/vim/ultisnips-dist/tcl.snippets +++ /dev/null @@ -1,50 +0,0 @@ -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### -snippet for "for... (for)" b -for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} { - ${4} -} - -endsnippet - -snippet foreach "foreach... (foreach)" -foreach ${1:var} ${2:\$list} { - ${3} -} - -endsnippet - -snippet if "if... (if)" b -if {${1:condition}} { - ${2} -} - -endsnippet - -snippet proc "proc... (proc)" b -proc ${1:name} {${2:args}} \ -{ - ${3} -} - -endsnippet - -snippet switch "switch... (switch)" b -switch ${1:-exact} -- ${2:\$var} { - ${3:match} { - ${4} - } - default {${5}} -} - -endsnippet - -snippet while "while... (while)" b -while {${1:condition}} { - ${2} -} - -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/tex.snippets b/vim/ultisnips-dist/tex.snippets deleted file mode 100644 index d6e62fc..0000000 --- a/vim/ultisnips-dist/tex.snippets +++ /dev/null @@ -1,125 +0,0 @@ -extends texmath - -########################################################################### -# LATEX SNIPPETS # -########################################################################### - -snippet r "\ref{}" w -\ref{$1} -endsnippet - -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### - -################# -# GENERAL STUFF # -################# -snippet "b(egin)?" "begin{} / end{}" br -\begin{${1:something}} - ${0:${VISUAL}} -\end{$1} -endsnippet - -#################### -# TABULARS, ARRAYS # -#################### - -snippet tab -\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}} -$0${2/((?<=.)c|l|r)|./(?1: & )/g} -\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}} -endsnippet - -######################## -# ENUM, DESCR, ITEMIZE # -######################## -snippet enum "Enumerate" b -\begin{enumerate} - \item $0 -\end{enumerate} -endsnippet - -snippet item "Itemize" b -\begin{itemize} - \item $0 -\end{itemize} -endsnippet - -snippet desc "Description" b -\begin{description} - \item[$1] $0 -\end{description} -endsnippet - -##################################### -# SECTIONS, CHAPTERS AND THERE LIKE # -##################################### - -snippet part "Part" b -\part{${1:part name}} -\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/g}}} - -${0} - -% part $2 (end) -endsnippet - -snippet cha "Chapter" b -\chapter{${1:chapter name}} -\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% chapter $2 (end) -endsnippet - -snippet sec "Section" b -\section{${1:section name}} -\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% section $2 (end) -endsnippet - - -snippet sub "Subsection" b -\subsection{${1:subsection name}} -\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% subsection $2 (end) -endsnippet - -snippet ssub "Subsubsection" b -\subsubsection{${1:subsubsection name}} -\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% subsubsection $2 (end) - -endsnippet - -snippet par "Paragraph" b -\paragraph{${1:paragraph name}} -\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% paragraph $2 (end) -endsnippet - - -snippet subp "Subparagraph" b -\subparagraph{${1:subparagraph name}} -\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} - -${0} - -% subparagraph $2 (end) -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/texmath.snippets b/vim/ultisnips-dist/texmath.snippets deleted file mode 100644 index 03589f0..0000000 --- a/vim/ultisnips-dist/texmath.snippets +++ /dev/null @@ -1,54 +0,0 @@ -############## -# MATH STUFF # -############## -snippet eq "Equation" b -\begin{equation} - $0 -\end{equation} -endsnippet - -snippet eqnn "Equation without number" b -\begin{equation*} - $0 -\end{equation*} -endsnippet - -snippet eqa "Equation array" b -\begin{eqnarray} - $1 & $2 & $0 -\end{eqnarray} -endsnippet - -snippet eqann "Equation array without numbers" b -\begin{eqnarray*} - $1 & $2 & $0 -\end{eqnarray*} - -endsnippet -snippet frac "Fraction" w -\frac{${1:${VISUAL:nom}}}{${2:denom}} -endsnippet - -snippet mat "Smart Matrix" -\begin{${1:p/b/v/V/B/small}matrix} - $0 -\end{$1matrix} -endsnippet - -snippet lr( "left( right)" w -\left( ${1:${VISUAL}} \right) -endsnippet - -snippet lr| "left| right|" w -\left| ${1:${VISUAL}} \right| -endsnippet - -snippet lr{ "left\{ right\}" w -\left\\{ ${1:${VISUAL}} \right\\} -endsnippet - -snippet lr[ "left[ right]" w -\left[ ${1:${VISUAL}} \right] -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/vim.snippets b/vim/ultisnips-dist/vim.snippets deleted file mode 100644 index f4c37f0..0000000 --- a/vim/ultisnips-dist/vim.snippets +++ /dev/null @@ -1,58 +0,0 @@ -########################################################################### -# SnipMate Snippets # -########################################################################### -snippet header -" File: ${1:`!v expand('%:t')`} -" Author: ${2:`!v g:snips_author`} -" Description: ${3} -${4:" Last Modified: `!v strftime("%B %d, %Y")`} - -$0 -endsnippet - -snippet gvar "Global / configuration variable" -if !exists("g:${1:MyUltraImportantVar}") - let g:$1 = ${2:"${3:<tab>}"} -endif -endsnippet - -snippet guard -if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700} - finish -endif -let $1 = 1${3} -endsnippet - -snippet f -fun ${1:function_name}(${2}) - ${3:" code} -endf -endsnippet - -snippet for -for ${1:needle} in ${2:haystack} - ${3:" code} -endfor -endsnippet - -snippet wh -while ${1:condition} - ${2:" code} -endw -endsnippet - -snippet if -if ${1:condition} - ${2:" code} -endif -endsnippet - -snippet ife -if ${1:condition} - ${2} -else - ${3} -endif -endsnippet - -# vim:ft=snippets: diff --git a/vim/ultisnips-dist/xhtml.snippets b/vim/ultisnips-dist/xhtml.snippets deleted file mode 100644 index cc31dbc..0000000 --- a/vim/ultisnips-dist/xhtml.snippets +++ /dev/null @@ -1 +0,0 @@ -extends html diff --git a/vimrc b/vimrc index 03e0a26..77fb464 100644 --- a/vimrc +++ b/vimrc @@ -1,199 +1,199 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" -let g:UltiSnipsSnippetDirectories=["nblock-snippets", "ultisnips-dist"] +let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
fb8997527c460aec24c6dbb3503009d1e57a3a0b
add utf8 support in urxvt
diff --git a/Xdefaults b/Xdefaults index e0ce885..11e096a 100644 --- a/Xdefaults +++ b/Xdefaults @@ -1,29 +1,30 @@ !URxvt settings !!--[Urxvt Options]--! URxvt*title: urxvtc URxvt*termName: rxvt-unicode-256color URxvt*cursorBlink: true URxvt*urgentOnBell: true URxvt*scrollBar: false URxvt*boldMode: false URxvt*imLocale: de_AT.UTF-8 URxvt*loginShell: true URxvt*borderless: false URxvt*jumpScroll: true URxvt*saveLines: 5000 URxvt*transparent: false URxvt*fading: 0% URxvt*scrollTtyKeypress:true URxvt*internalBorder: 0 +URxvt*utf8: 1 !--[Urls /launching/marking/yanking]--! URxvt*perl-ext: default,matcher URxvt*urlLauncher: /usr/bin/firefox URxvt*matcher.button: 1 URxvt*matcher.pattern.1:\\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-] !--[Fonts]--! URxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13:antialias=false URxvt*italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true:antialias=false URxvt*boldFont: xft:Bitstream Vera Sans Mono:bold:autohint=true:antialias=false URxvt*boldItalicFont: xft:Bitstream Vera Sans Mono:bold:italic:autohint=true:antialias=false
nblock/config
6e6fa4836fc0d49bf6cab62e8a2d07b321fac547
configure split windows bindings in tmux
diff --git a/tmux.conf b/tmux.conf index 8b3a4e6..87b95a6 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,11 +1,15 @@ setw -g mode-keys vi set-window-option -g mode-mouse on bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R +unbind % +bind | split-window -h +bind ? split-window -v + bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'"
nblock/config
2799319bdc5afe95ed5085f62fc7c0b5151f10eb
add ultisnips-dist
diff --git a/install.sh b/install.sh index 7b682a4..015228e 100755 --- a/install.sh +++ b/install.sh @@ -1,29 +1,34 @@ #!/bin/sh set -e #set -x #link files for item in `find $PWD -maxdepth 1 -mindepth 1 -type f \( ! -iname "install.sh" ! -iname "README.markdown" \) -printf "%P\n"`;do ln -snf "$PWD/$item" "$HOME/.$item" done #process .config for item in `find "$PWD/config" -maxdepth 1 -mindepth 1 -printf "%P\n"`;do ln -snf "$PWD/config/$item" "$HOME/.config/$item" done +#process .vim +for item in `find "$PWD/vim" -maxdepth 1 -mindepth 1 -printf "%P\n"`;do + ln -snf "$PWD/vim/$item" "$HOME/.vim/$item" +done + #solarized-task ln -snf "$PWD/solarized-task" "$HOME/.solarized-task" #bin ln -snf "$PWD/bin" "$HOME/bin" #cmus ln -snf "$PWD/cmus" "$HOME/.cmus" #change login shell to zsh if ! grep -q "^$USER:.*zsh$" /etc/passwd; then echo "Changing login shell for $USER to zsh ..." chsh -s `which zsh` fi diff --git a/vim/nblock-snippets/all.snippets b/vim/nblock-snippets/all.snippets new file mode 100644 index 0000000..3fbd4ba --- /dev/null +++ b/vim/nblock-snippets/all.snippets @@ -0,0 +1,15 @@ +snippet author "My name and email" +Florian Preinstorfer <[email protected]> +endsnippet + +snippet date "current date" +`date +%d.%m.%Y` +endsnippet + +snippet time "current time" +`date +%H:%M` +endsnippet + +snippet datetime "current date and time" +`date "+%d.%m.%Y - %H:%M"` +endsnippet diff --git a/vim/nblock-snippets/c.snippets b/vim/nblock-snippets/c.snippets new file mode 100644 index 0000000..90318c8 --- /dev/null +++ b/vim/nblock-snippets/c.snippets @@ -0,0 +1,105 @@ + +########################################################################### +# TextMate Snippets # +########################################################################### +snippet def "#ifndef ... #define ... #endif" +#ifndef ${1/([A-Za-z0-9_]+).*/$1/} +#define ${1:SYMBOL} ${2:value} +#endif +endsnippet + +snippet #if "#if #endif" !b +#if ${1:0} +${VISUAL:code}$0 +#endif +endsnippet + +snippet inc "#include local header (inc)" +#include "${1:`!p snip.rv = snip.basename + '.h'`}" +endsnippet + +snippet Inc "#include <> (Inc)" +#include <${1:.h}> +endsnippet + +snippet mark "#pragma mark (mark)" +#if 0 +${1:#pragma mark - +}#pragma mark $2 +#endif + +$0 +endsnippet + +snippet main "main() (main)" +int main(int argc, char const *argv[]){ + ${0:/* code */} + return 0; +} +endsnippet + +snippet for "for int loop (fori)" +for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}){ + ${0:/* code */} +} +endsnippet + +snippet enum "Enumeration" +enum ${1:name} { $0 }; +endsnippet + +snippet once "Include header once only guard" +#ifndef ${1:`!p +if not snip.c: + import random, string + name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper() + rand = ''.join(random.sample(string.ascii_letters+string.digits, 8)) + snip.rv = ('%s_%s' % (name,rand)).upper() +else: + snip.rv = snip.c`} +#define $1 + +${0} + +#endif /* end of include guard: $1 */ + +endsnippet + +snippet td "Typedef" +typedef ${1:int} ${2:MyCustomType}; +endsnippet + +snippet do "do...while loop (do)" +do { + ${0:/* code */} +} while(${1:/* condition */}); +endsnippet + +snippet while "while loop (while)" +while(${1:/* condition */}){ + ${0:/* code */} +} +endsnippet + +snippet fprintf "fprintf ..." +fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/} +endsnippet + +snippet if "if .. (if)" +if (${1:/* condition */}) +{ + ${0:/* code */} +} +endsnippet + +snippet printf "printf .. (printf)" +printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/} +endsnippet + +snippet st "struct" +struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}{ + ${0:/* data */} +}; +endsnippet + +# vim:ft=snippets: diff --git a/vim/nblock-snippets/dokuwiki.snippets b/vim/nblock-snippets/dokuwiki.snippets new file mode 100644 index 0000000..4ea3f7c --- /dev/null +++ b/vim/nblock-snippets/dokuwiki.snippets @@ -0,0 +1,88 @@ +global !p +def complete (t, opts): + if t: + opts = [m[len(t):] for m in opts if m.startswith(t)] + if len(opts) == 1: + return opts[0] + return "(" + "|".join(opts) + ")" +endglobal + +snippet h1 "Header Level 1" b +====== ${VISUAL}$1 ====== +$0 +endsnippet + +snippet h2 "Header Level 2" b +===== ${VISUAL}$1 ===== +$0 +endsnippet + +snippet h3 "Header Level 3" b +==== ${VISUAL}$1 ==== +$0 +endsnippet + +snippet h4 "Header Level 4" b +=== ${VISUAL}$1 === +$0 +endsnippet + +snippet h5 "Header Level 5" b +== ${VISUAL}$1 == +$0 +endsnippet + +snippet ** "bold text" +**${VISUAL}$1** +$0 +endsnippet + +snippet // "italic text" +//${VISUAL}$1// +endsnippet + +snippet __ "underlined text" +__${VISUAL}$1__ +endsnippet + +snippet '' "monospaced text" +''${VISUAL}$1'' +endsnippet + +snippet del "deleted text" +<del>${VISUAL}$1</del> +endsnippet + +snippet sup "superscript text" +<sup>${VISUAL}$1</sup> +endsnippet + +snippet sub "subscript text" +<sub>${VISUAL}$1</sub> +endsnippet + +snippet * "bulletpoint list" b + * ${VISUAL}$1 +endsnippet + +snippet - "ordered list" b + - ${VISUAL}$1 +endsnippet + +snippet code "code" +<code> +${VISUAL}$1 +</code> +endsnippet + +snippet link "a link to another ressource" +[[${VISUAL}$1|$2]] +endsnippet + +snippet res "external ressources such as images and files" +{{${VISUAL}$1|$2}} +endsnippet + +snippet ~~ "control macro" +~~$1`!p snip.rv=complete(t[1], ['NOTOC', 'NOCACHE'])`~~ +endsnippet diff --git a/vim/ultisnips-dist/README b/vim/ultisnips-dist/README new file mode 100644 index 0000000..eafd086 --- /dev/null +++ b/vim/ultisnips-dist/README @@ -0,0 +1,21 @@ +This directory contains the main scripts that come bundled with UltiSnips. + +Standing On The Shoulders of Giants +=================================== + +The snippets have been collected from various other project which I want to +express my gratitude for. My main source for inspiration where the following +two projects: + + TextMate: http://svn.textmate.org/trunk/Bundles/ + SnipMate: http://code.google.com/p/snipmate/ + +All snippets from those sources were copied and cleaned up, so that they are + - not using shell script, only python (so they are cross platform compatible) + - not using any feature that UltiSnips doesn't offer + +UltiSnips has seen contributions by various individuals. Those contributions +have been merged into this collection seamlessly and without further comments. + +-- vim:ft=rst:nospell: + diff --git a/vim/ultisnips-dist/all.snippets b/vim/ultisnips-dist/all.snippets new file mode 100644 index 0000000..8844e28 --- /dev/null +++ b/vim/ultisnips-dist/all.snippets @@ -0,0 +1,112 @@ +# This file contains snippets that are always defined. I personally +# have snippets for signatures and often needed texts + +############## +# NICE BOXES # +############## +global !p +import string, vim + +""" Maps a filetype to comment format used for boxes. +Automatically filled during usage""" +_commentDict = { } + +def _parse_comments(s): + """ Parses vim's comments option to extract comment format """ + i = iter(s.split(",")) + + rv = [] + try: + while True: + # get the flags and text of a comment part + flags,text = i.next().split(':', 1) + + if len(flags) == 0: + if len(text) == 1: + rv.append((text,text,text, "")) + # parse 3-part comment, but ignore those with O flag + elif flags[0] == 's' and 'O' not in flags: + ctriple = [] + indent = "" + + if flags[-1] in string.digits: + indent = " " * int(flags[-1]) + ctriple.append(text) + + flags,text = i.next().split(':', 1) + assert(flags[0] == 'm') + ctriple.append(text) + + flags,text = i.next().split(':', 1) + assert(flags[0] == 'e') + ctriple.append(text) + ctriple.append(indent) + + rv.append(ctriple) + + elif flags[0] == 'b': + if len(text) == 1: + rv.insert(0, (text,text,text, "")) + + except StopIteration: + return rv + +def _get_comment_format(): + """ Returns a 4-element tuple representing the comment format for + the current file. """ + + ft = vim.eval("&filetype") + # check if the comment dict has the format for the current file + if _commentDict.has_key(ft): + return _commentDict[ft] + + # otherwise parse vim's comments and add it for later use + commentformat = _parse_comments(vim.eval("&comments"))[0] + _commentDict[ft] = commentformat + + return commentformat + + +def make_box(twidth, bwidth = None): + if bwidth is None: + bwidth = twidth + 2 + b,m,e,i = _get_comment_format() + sline = b + m + bwidth*m + 2*m + nspaces = (bwidth - twidth)//2 + mlines = i + m + " " + " "*nspaces + mlinee = " " + " "*(bwidth-twidth-nspaces) + m + eline = i + 2*m + bwidth*m + m + e + return sline, mlines, mlinee, eline +endglobal + +snippet box "A nice box with the current comment symbol" b +`!p +box = make_box(len(t[1])) +snip.rv = box[0] + '\n' + box[1] +`${1:content}`!p +box = make_box(len(t[1])) +snip.rv = box[2] + '\n' + box[3]` +$0 +endsnippet + +snippet bbox "A nice box over the full width" b +`!p +box = make_box(len(t[1]), 71) +snip.rv = box[0] + '\n' + box[1] +`${1:content}`!p +box = make_box(len(t[1]), 71) +snip.rv = box[2] + '\n' + box[3]` +$0 +endsnippet + +########################## +# LOREM IPSUM GENERATORS # +########################## +snippet lorem "Lorem Ipsum - 50 Words" b +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod +tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At +vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, +no sea takimata sanctus est Lorem ipsum dolor sit amet. +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/bindzone.snippets b/vim/ultisnips-dist/bindzone.snippets new file mode 100644 index 0000000..034ccde --- /dev/null +++ b/vim/ultisnips-dist/bindzone.snippets @@ -0,0 +1,27 @@ +global !p +def newsoa(): + import datetime + now = datetime.datetime.now() + # return standard SOA formatted serial for today + return now.strftime("%Y%m%d00") +endglobal + +snippet zone "Bootstrap a new Bind zonefile" b +$TTL 86400 +@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.( + `!p snip.rv = newsoa()`; serial + 21600; refresh every 6 hours + 3600; retry after one hour + 604800; expire after a week + 86400 ); minimum TTL of 1 day + + IN NS ns01.$1. + IN MX 10 mail.$1. + +ns01.$1 IN A +mail.$1 IN A +endsnippet + +snippet A "Insert A Record" b +${1:hostname} IN A ${2:ip} +endsnippet diff --git a/vim/ultisnips-dist/coffee.snippets b/vim/ultisnips-dist/coffee.snippets new file mode 100644 index 0000000..8f347f1 --- /dev/null +++ b/vim/ultisnips-dist/coffee.snippets @@ -0,0 +1,90 @@ +# From the TextMate bundle + +snippet fun "Function" b +${1:name} = (${2:args}) -> + ${0:# body...} +endsnippet + +snippet bfun "Function (bound)" b +${1:(${2:args}) }=> + ${0:# body...} +endsnippet + +snippet if "If" b +if ${1:condition} + ${0:# body...} +endsnippet + +snippet ife "If .. Else" b +if ${1:condition} + ${2:# body...} +else + ${3:# body...} +endsnippet + +snippet elif "Else if" b +else if ${1:condition} + ${0:# body...} +endsnippet + +snippet ifte "Ternary if" b +if ${1:condition} then ${2:value} else ${3:other} +endsnippet + +snippet unl "Unless" b +${1:action} unless ${2:condition} +endsnippet + +snippet fora "Array Comprehension" b +for ${1:name} in ${2:array} + ${0:# body...} +endsnippet + +snippet foro "Object Comprehension" b +for ${1:key}, ${2:value} of ${3:Object} + ${0:# body...} +endsnippet + +snippet forr "Range Comprehension (inclusive)" b +for ${1:name} in [${2:start}..${3:finish}]${4: by ${5:step}} + ${0:# body...} +endsnippet + +snippet forrex "Range Comprehension (exclusive)" b +for ${1:name} in [${2:start}...${3:finish}]${4: by ${5:step}} + ${0:# body...} +endsnippet + +snippet swi "Switch" b +switch ${1:object} + when ${2:value} + ${0:# body...} +endsnippet + +snippet cla "Class" b +class ${1:ClassName}${2: extends ${3:Ancestor}} + + ${4:constructor: (${5:args}) -> + ${6:# body...}} + $7 +endsnippet + +snippet try "Try .. Catch" b +try + $1 +catch ${2:error} + $3 +endsnippet + +snippet req "Require" b +${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'}) +endsnippet + +snippet # "Interpolated Code" +#{$1}$0 +endsnippet + +snippet log "Log" b +console.log ${1:"${2:msg}"} +endsnippet + diff --git a/vim/ultisnips-dist/coffee_jasmine.snippets b/vim/ultisnips-dist/coffee_jasmine.snippets new file mode 100644 index 0000000..47d1e6b --- /dev/null +++ b/vim/ultisnips-dist/coffee_jasmine.snippets @@ -0,0 +1,163 @@ +# +# CoffeeScript versions -- adapted from the JS TextMate bundle + additions +# for some jasmine-jquery matchers +# +extends coffee + +snippet des "Describe (coffee)" b +describe '${1:description}', -> + $0 +endsnippet + +snippet it "it (coffee)" b +it '${1:description}', -> + $0 +endsnippet + +snippet bef "before each (coffee)" b +beforeEach -> + $0 +endsnippet + +snippet aft "after each (coffee)" b +afterEach -> + $0 +endsnippet + +snippet any "any (coffee)" b +jasmine.any($1) +endsnippet + +snippet ru "runs (coffee)" b +runs -> + $0 +endsnippet + +snippet wa "waits (coffee)" b +waits($1) +endsnippet + +snippet ex "expect (coffee)" b +expect(${1:target})$0 +endsnippet + +snippet ee "expect to equal (coffee)" b +expect(${1:target}).toEqual(${2:value}) +endsnippet + +snippet em "expect to match (coffee)" b +expect(${1:target}).toMatch(${2:pattern}) +endsnippet + +snippet eha "expect to have attribute (coffee)" b +expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'}) +endsnippet + +snippet et "expect to be truthy (coffee)" b +expect(${1:target}).toBeTruthy() +endsnippet + +snippet ef "expect to be falsy (coffee)" b +expect(${1:target}).toBeFalsy() +endsnippet + +snippet ed "expect to be defined (coffee)" b +expect(${1:target}).toBeDefined() +endsnippet + +snippet en "expect to be null (coffee)" b +expect(${1:target}).toBeNull() +endsnippet + +snippet ec "expect to contain (coffee)" b +expect(${1:target}).toContain(${2:value}) +endsnippet + +snippet ev "expect to be visible (coffee)" b +expect(${1:target}).toBeVisible() +endsnippet + +snippet eh "expect to be hidden (coffee)" b +expect(${1:target}).toBeHidden() +endsnippet + +snippet notx "expect not (coffee)" b +expect(${1:target}).not$0 +endsnippet + +snippet note "expect not to equal (coffee)" b +expect(${1:target}).not.toEqual(${2:value}) +endsnippet + +snippet notm "expect not to match (coffee)" b +expect(${1:target}).not.toMatch(${2:pattern}) +endsnippet + +snippet notha "expect to not have attribute (coffee)" b +expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'}) +endsnippet + +snippet nott "expect not to be truthy (coffee)" b +expect(${1:target}).not.toBeTruthy() +endsnippet + +snippet notf "expect not to be falsy (coffee)" b +expect(${1:target}).not.toBeFalsy() +endsnippet + +snippet notd "expect not to be defined (coffee)" b +expect(${1:target}).not.toBeDefined() +endsnippet + +snippet notn "expect not to be null (coffee)" b +expect(${1:target}).not.toBeNull() +endsnippet + +snippet notc "expect not to contain (coffee)" b +expect(${1:target}).not.toContain(${2:value}) +endsnippet + +snippet notv "expect not to be visible (coffee)" b +expect(${1:target}).not.toBeVisible() +endsnippet + +snippet noth "expect not to be hidden (coffee)" b +expect(${1:target}).not.toBeHidden() +endsnippet + +snippet s "spy on (coffee)" b +spyOn(${1:object}, "${2:method}")$0 +endsnippet + +snippet sr "spy on and return (coffee)" b +spyOn(${1:object}, "${2:method}").andReturn(${3:arguments}) +endsnippet + +snippet st "spy on and throw (coffee)" b +spyOn(${1:object}, "${2:method}").andThrow(${3:exception}) +endsnippet + +snippet sct "spy on and call through (coffee)" b +spyOn(${1:object}, "${2:method}").andCallThrough() +endsnippet + +snippet scf "spy on and call fake (coffee)" b +spyOn(${1:object}, "${2:method}").andCallFake(${3:function}) +endsnippet + +snippet esc "expect was called (coffee)" b +expect(${1:target}).wasCalled() +endsnippet + +snippet escw "expect was called with (coffee)" b +expect(${1:target}).wasCalledWith(${2:arguments}) +endsnippet + +snippet notsc "expect was not called (coffee)" b +expect(${1:target}).wasNotCalled() +endsnippet + +snippet noscw "expect was not called with (coffee)" b +expect(${1:target}).wasNotCalledWith(${2:arguments}) +endsnippet + diff --git a/vim/ultisnips-dist/cpp.snippets b/vim/ultisnips-dist/cpp.snippets new file mode 100644 index 0000000..9d2eb86 --- /dev/null +++ b/vim/ultisnips-dist/cpp.snippets @@ -0,0 +1,52 @@ +extends c + +########################################################################### +# TextMate Snippets # +########################################################################### +snippet beginend "$1.begin(), $1.end() (beginend)" +${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end() +endsnippet + +snippet cl "class .. (class)" +class ${1:`!p snip.rv = snip.basename or "name"`} +{ +public: + ${1/(\w+).*/$1/} (${2:arguments}); + virtual ~${1/(\w+).*/$1/} (); + +private: + ${0:/* data */} +}; +endsnippet + +snippet ns "namespace .. (namespace)" +namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`} +{ + $0 +}${1/.+/ \/* /m}$1${1/.+/ *\/ /m} +endsnippet + +snippet readfile "read file (readF)" +std::vector<char> v; +if (FILE *fp = fopen(${1:"filename"}, "r")) +{ + char buf[1024]; + while(size_t len = fread(buf, 1, sizeof(buf), fp)) + v.insert(v.end(), buf, buf + len); + fclose(fp); +} +endsnippet + +snippet map "std::map (map)" +std::map<${1:key}, ${2:value}> map$0; +endsnippet + +snippet vector "std::vector (v)" +std::vector<${1:char}> v$0; +endsnippet + +snippet tp "template <typename ..> (template)" +template <typename ${1:_InputIter}> +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/css.snippets b/vim/ultisnips-dist/css.snippets new file mode 100644 index 0000000..d14d51c --- /dev/null +++ b/vim/ultisnips-dist/css.snippets @@ -0,0 +1,405 @@ +########################################################################### +# Most of these came from TextMate # +########################################################################### + +snippet ! "!important CSS (!)" +${1:!important} +endsnippet + +snippet fixed "Fixed Position Bottom 100% wide IE6" +${2:bottom: auto;}top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-${1:THE HEIGHT OF THIS THING IN PIXELS})); +${3:left: expression(eval(document.documentElement.scrollLeft)); +}${4:width: expression(eval(document.documentElement.clientWidth));}$0 +endsnippet + +snippet background "background-attachment: scroll:fixed (background)" +background-attachment: ${1:scroll/fixed};$0 +endsnippet + +snippet background "background-color: color-hex (background)" +background-color: #${1:DDD};$0 +endsnippet + +snippet background "background-color: color-name (background)" +background-color: ${1:red};$0 +endsnippet + +snippet background "background-color: color-rgb (background)" +background-color: rgb(${1:255},${2:255},${3:255});$0 +endsnippet + +snippet background "background-color: transparent (background)" +background-color: transparent;$0 +endsnippet + +snippet background "background-image: none (background)" +background-image: none;$0 +endsnippet + +snippet background "background-image: url (background)" +background-image: url($1);$0 +endsnippet + +snippet background "background-position: position (background)" +background-position: ${1:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0 +endsnippet + +snippet background "background-repeat: r:r-x:r-y:n-r (background)" +background-repeat: ${1:repeat/repeat-x/repeat-y/no-repeat};$0 +endsnippet + +snippet background "background: color image repeat attachment position (background)" +background:${6: #${1:DDD}} url($2) ${3:repeat/repeat-x/repeat-y/no-repeat} ${4:scroll/fixed} ${5:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0 +endsnippet + +snippet border "border-bottom-color: size style color (border)" +border-bottom-color: #${1:999};$0 +endsnippet + +snippet border "border-bottom-style: size style color (border)" +border-bottom-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 +endsnippet + +snippet border "border-bottom-width: size style color (border)" +border-bottom-width: ${1:1}px ${2:solid} #${3:999};$0 +endsnippet + +snippet border "border-bottom: size style color (border)" +border-bottom: ${1:1}px ${2:solid} #${3:999};$0 +endsnippet + +snippet border "border-color: color (border)" +border-color: ${1:999};$0 +endsnippet + +snippet border "border-left-color: color (border)" +border-right-color: #${1:999};$0 +endsnippet + +snippet border "border-left-style: style (border)" +border-left-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 +endsnippet + +snippet border "border-left-width: size (border)" +border-left-width: ${1:1}px +endsnippet + +snippet border "border-left: size style color (border)" +border-left: ${1:1}px ${2:solid} #${3:999};$0 +endsnippet + +snippet border "border-right-color: color (border)" +border-right-color: #${1:999};$0 +endsnippet + +snippet border "border-right-style: style (border)" +border-right-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 +endsnippet + +snippet border "border-right-width: size (border)" +border-right-width: ${1:1}px +endsnippet + +snippet border "border-right: size style color (border)" +border-right: ${1:1}px ${2:solid} #${3:999};$0 +endsnippet + +snippet border "border-style: style (border)" +border-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 +endsnippet + +snippet border "border-top-color: color (border)" +border-top-color: #${1:999};$0 +endsnippet + +snippet border "border-top-style: style (border)" +border-top-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0 +endsnippet + +snippet border "border-top-width: size (border)" +border-top-width: ${1:1}px +endsnippet + +snippet border "border-top: size style color (border)" +border-top: ${1:1}px ${2:solid} #${3:999};$0 +endsnippet + +snippet border "border-width: width (border)" +border-width: ${1:1px};$0 +endsnippet + +snippet border "border: size style color (border)" +border: ${1:1px} ${2:solid} #${3:999};$0 +endsnippet + +snippet clear "clear: value (clear)" +clear: ${1:left/right/both/none};$0 +endsnippet + +snippet color "color: color-hex (color)" +color: #${1:DDD};$0 +endsnippet + +snippet color "color: color-name (color)" +color: ${1:red};$0 +endsnippet + +snippet color "color: color-rgb (color)" +color: rgb(${1:255},${2:255},${3:255});$0 +endsnippet + +snippet cursor "cursor: type (cursor)" +cursor: ${1:default/auto/crosshair/pointer/move/*-resize/text/wait/help};$0 +endsnippet + +snippet cursor "cursor: url (cursor)" +cursor: url($1);$0 +endsnippet + +snippet direction "direction: ltr|rtl (direction)" +direction: ${1:ltr|rtl};$0 +endsnippet + +snippet display "display: block (display)" +display: block;$0 +endsnippet + +snippet display "display: common-types (display)" +display: ${1:none/inline/block/list-item/run-in/compact/marker};$0 +endsnippet + +snippet display "display: inline (display)" +display: inline;$0 +endsnippet + +snippet display "display: table-types (display)" +display: ${1:table/inline-table/table-row-group/table-header-group/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption};$0 +endsnippet + +snippet float "float: left:right:none (float)" +float: ${1:left/right/none};$0 +endsnippet + +snippet font "font-family: family (font)" +font-family: ${1:Arial, "MS Trebuchet"}, ${2:sans-}serif;$0 +endsnippet + +snippet font "font-size: size (font)" +font-size: ${1:100%};$0 +endsnippet + +snippet font "font-style: normal:italic:oblique (font)" +font-style: ${1:normal/italic/oblique};$0 +endsnippet + +snippet font "font-variant: normal:small-caps (font)" +font-variant: ${1:normal/small-caps};$0 +endsnippet + +snippet font "font-weight: weight (font)" +font-weight: ${1:normal/bold};$0 +endsnippet + +snippet font "font: style variant weight size:line-height font -family (font)" +font: ${1:normal/italic/oblique} ${2:normal/small-caps} ${3:normal/bold} ${4:1em/1.5em} ${5:Arial}, ${6:sans-}serif;$0 +endsnippet + +snippet font "font: size font (font)" +font: ${1:75%} ${2:"Lucida Grande", "Trebuchet MS", Verdana,} ${3:sans-}serif;$0 +endsnippet + +snippet letter "letter-spacing: length-em (letter)" +letter-spacing: $1em;$0 +endsnippet + +snippet letter "letter-spacing: length-px (letter)" +letter-spacing: $1px;$0 +endsnippet + +snippet list "list-style-image: url (list)" +list-style-image: url($1);$0 +endsnippet + +snippet list "list-style-position: pos (list)" +list-style-position: ${1:inside/outside};$0 +endsnippet + +snippet list "list-style-type: asian (list)" +list-style-type: ${1:cjk-ideographic/hiragana/katakana/hiragana-iroha/katakana-iroha};$0 +endsnippet + +snippet list "list-style-type: marker(list)" +list-style-type: ${1:none/disc/circle/square};$0 +endsnippet + +snippet list "list-style-type: numeric (list)" +list-style-type: ${1:decimal/decimal-leading-zero/zero};$0 +endsnippet + +snippet list "list-style-type: other (list)" +list-style-type: ${1:hebrew/armenian/georgian};$0 +endsnippet + +snippet list "list-style-type: roman-alpha-greek (list)" +list-style-type: ${1:lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-latin/upper-latin};$0 +endsnippet + +snippet list "list-style: type position image (list)" +list-style: ${1:none/disc/circle/square/decimal/zero} ${2:inside/outside} url($3);$0 +endsnippet + +snippet margin "margin-bottom: length (margin)" +margin-bottom: ${1:20px};$0 +endsnippet + +snippet margin "margin-left: length (margin)" +margin-left: ${1:20px};$0 +endsnippet + +snippet margin "margin-right: length (margin)" +margin-right: ${1:20px};$0 +endsnippet + +snippet margin "margin-top: length (margin)" +margin-top: ${1:20px};$0 +endsnippet + +snippet margin "margin: all (margin)" +margin: ${1:20px};$0 +endsnippet + +snippet margin "margin: T R B L (margin)" +margin: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0 +endsnippet + +snippet margin "margin: V H (margin)" +margin: ${1:20px} ${2:0px};$0 +endsnippet + +snippet marker "marker-offset: auto (marker)" +marker-offset: auto;$0 +endsnippet + +snippet marker "marker-offset: length (marker)" +marker-offset: ${1:10px};$0 +endsnippet + +snippet overflow "overflow: type (overflow)" +overflow: ${1:visible/hidden/scroll/auto};$0 +endsnippet + +snippet padding "padding-bottom: length (margin)" +padding-bottom: ${1:20px};$0 +endsnippet + +snippet padding "padding-left: length (margin)" +padding-left: ${1:20px};$0 +endsnippet + +snippet padding "padding-right: length (margin)" +padding-right: ${1:20px};$0 +endsnippet + +snippet padding "padding-top: length (margin)" +padding-top: ${1:20px};$0 +endsnippet + +snippet padding "padding: T R B L (padding)" +padding: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0 +endsnippet + +snippet padding "padding: V H (padding)" +padding: ${1:20px} ${2:0px};$0 +endsnippet + +snippet padding "padding: all (padding)" +padding: ${1:20px};$0 +endsnippet + +snippet position "position: type (position)" +position: ${1:static/relative/absolute/fixed};$0 +endsnippet + +snippet { "properties { } ( } )" +{ + /* $1 */ + $0 + +endsnippet + +snippet scrollbar "scrollbar" +scrollbar-base-color: ${1:#CCCCCC};${2: +scrollbar-arrow-color: ${3:#000000}; +scrollbar-track-color: ${4:#999999}; +scrollbar-3dlight-color: ${5:#EEEEEE}; +scrollbar-highlight-color: ${6:#FFFFFF}; +scrollbar-face-color: ${7:#CCCCCC}; +scrollbar-shadow-color: ${9:#999999}; +scrollbar-darkshadow-color: ${8:#666666};} +endsnippet + +snippet selection "selection" +$1::-moz-selection, +$1::selection { + color: ${2:inherit}; + background: ${3:inherit}; +} +endsnippet + +snippet text "text-align: left:center:right (txt)" +text-align: ${1:left/right/center/justify};$0 +endsnippet + +snippet text "text-decoration: none:underline:overline:line-through:blink (text)" +text-decoration: ${1:none/underline/overline/line-through/blink};$0 +endsnippet + +snippet text "text-indent: length (text)" +text-indent: ${1:10}px;$0 +endsnippet + +snippet text "text-shadow: color-hex x y blur (text)" +text-shadow: #${1:DDD} ${2:10px} ${3:10px} ${4:2px};$0 +endsnippet + +snippet text "text-shadow: color-rgb x y blur (text)" +text-shadow: rgb(${1:255},${2:255},${3:255}) ${4:10px} ${5:10px} ${6:2px};$0 +endsnippet + +snippet text "text-shadow: none (text)" +text-shadow: none;$0 +endsnippet + +snippet text "text-transform: capitalize:upper:lower (text)" +text-transform: ${1:capitalize/uppercase/lowercase};$0 +endsnippet + +snippet text "text-transform: none (text)" +text-transform: none;$0 +endsnippet + +snippet vertical "vertical-align: type (vertical)" +vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0 +endsnippet + +snippet visibility "visibility: type (visibility)" +visibility: ${1:visible/hidden/collapse};$0 +endsnippet + +snippet white "white-space: normal:pre:nowrap (white)" +white-space: ${1:normal/pre/nowrap};$0 +endsnippet + +snippet word "word-spacing: length (word)" +word-spacing: ${1:10px};$0 +endsnippet + +snippet word "word-spacing: normal (word)" +word-spacing: normal;$0 +endsnippet + +snippet z "z-index: index (z)" +z-index: $1;$0 +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/django.snippets b/vim/ultisnips-dist/django.snippets new file mode 100644 index 0000000..59b77c5 --- /dev/null +++ b/vim/ultisnips-dist/django.snippets @@ -0,0 +1,236 @@ +# Generic Tags +snippet % +{% ${1} %}${2} +endsnippet + +snippet %% +{% ${1:tag_name} %} + ${2} +{% end$1 %} +endsnippet + +snippet { +{{ ${1} }}${2} +endsnippet + +# Template Tags + +snippet autoescape +{% autoescape ${1:off} %} + ${2} +{% endautoescape %} +endsnippet + +snippet block +{% block ${1} %} + ${2} +{% endblock %} +endsnippet + +snippet # +{# ${1:comment} #} +endsnippet + +snippet comment +{% comment %} + ${1} +{% endcomment %} +endsnippet + +snippet cycle +{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %} +endsnippet + +snippet debug +{% debug %} +endsnippet + +snippet extends +{% extends "${1:base.html}" %} +endsnippet + +snippet filter +{% filter ${1} %} + ${2} +{% endfilter %} +endsnippet + +snippet firstof +{% firstof ${1} %} +endsnippet + +snippet for +{% for ${1} in ${2} %} + ${3} +{% endfor %} +endsnippet + +snippet empty +{% empty %} + ${1} +endsnippet + +snippet if +{% if ${1} %} + ${2} +{% endif %} +endsnippet + +snippet else +{% else %} + ${1} +endsnippet + +snippet ifchanged +{% ifchanged %}${1}{% endifchanged %} +endsnippet + +snippet ifequal +{% ifequal ${1} ${2} %} + ${3} +{% endifequal %} +endsnippet + +snippet ifnotequal +{% ifnotequal ${1} ${2} %} + ${3} +{% endifnotequal %} +endsnippet + +snippet include +{% include "${1}" %} +endsnippet + +snippet load +{% load ${1} %} +endsnippet + +snippet now +{% now "${1:jS F Y H:i}" %} +endsnippet + +snippet regroup +{% regroup ${1} by ${2} as ${3} %} +endsnippet + +snippet spaceless +{% spaceless %}${1}{% endspaceless %} +endsnippet + +snippet ssi +{% ssi ${1} %} +endsnippet + +snippet trans +{% trans "${1:string}" %} +endsnippet + +snippet url +{% url ${1} as ${2} %} +endsnippet + +snippet widthratio +{% widthratio ${1:this_value} ${2:max_value} ${3:100} %} +endsnippet + +snippet with +{% with ${1} as ${2} %} +endsnippet + +# Template Filters + +# Note: Since SnipMate can't determine which template filter you are +# expanding without the "|" character, these do not add the "|" +# character. These save a few keystrokes still. + +# Note: Template tags that take no arguments are not implemented. + +snippet add +add:"${1}" +endsnippet + +snippet center +center:"${1}" +endsnippet + +snippet cut +cut:"${1}" +endsnippet + +snippet date +date:"${1}" +endsnippet + +snippet default +default:"${1}" +endsnippet + +snippet defaultifnone +default_if_none:"${1}" +endsnippet + +snippet dictsort +dictsort:"${1}" +endsnippet + +snippet dictsortrev +dictsortreversed:"${1}" +endsnippet + +snippet divisibleby +divisibleby:"${1}" +endsnippet + +snippet floatformat +floatformat:"${1}" +endsnippet + +snippet getdigit +get_digit:"${1}" +endsnippet + +snippet join +join:"${1}" +endsnippet + +snippet lengthis +length_is:"${1}" +endsnippet + +snippet pluralize +pluralize:"${1}" +endsnippet + +snippet removetags +removetags:"${1}" +endsnippet + +snippet slice +slice:"${1}" +endsnippet + +snippet stringformat +stringformat:"${1}" +endsnippet + +snippet time +time:"${1}" +endsnippet + +snippet truncatewords +truncatewords:${1} +endsnippet + +snippet truncatewordshtml +truncatewords_html:${1} +endsnippet + +snippet urlizetrunc +urlizetrunc:${1} +endsnippet + +snippet wordwrap +wordwrap:${1} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/erlang.snippets b/vim/ultisnips-dist/erlang.snippets new file mode 100644 index 0000000..7823162 --- /dev/null +++ b/vim/ultisnips-dist/erlang.snippets @@ -0,0 +1,98 @@ +########################################################################### +# TEXTMATE SNIPPETS # +########################################################################### + +snippet pat "Case:Receive:Try Clause" +${1:pattern}${2: when ${3:guard}} ->; + ${4:body} +endsnippet + +snippet beh "Behaviour Directive" +-behaviour (${1:behaviour}). +endsnippet + +snippet case "Case Expression" +case ${1:expression} of + ${2:pattern}${3: when ${4:guard}} -> + ${5:body} +end +endsnippet + +snippet def "Define Directive" +-define (${1:macro}${2: (${3:param})}, ${4:body}). +endsnippet + +snippet exp "Export Directive" +-export ([${1:function}/${2:arity}]). +endsnippet + +snippet fun "Fun Expression" +fun + (${1:pattern})${2: when ${3:guard}} -> + ${4:body} +end +endsnippet + +snippet fu "Function" +${1:function} (${2:param})${3: when ${4:guard}} -> + ${5:body} +endsnippet + +snippet if "If Expression" +if + ${1:guard} -> + ${2:body} +end +endsnippet + +snippet ifdef "Ifdef Directive" +-ifdef (${1:macro}). +endsnippet + +snippet ifndef "Ifndef Directive" +-ifndef (${1:macro}). +endsnippet + +snippet imp "Import Directive" +-import (${1:module}, [${2:function}/${3:arity}]). +endsnippet + +snippet inc "Include Directive" +-include ("${1:file}"). +endsnippet + +snippet mod "Module Directive" +-module (${1:`!p snip.rv = snip.basename or "module"`}). +endsnippet + +snippet rcv "Receive Expression" +receive +${1: ${2:pattern}${3: when ${4:guard}} -> + ${5:body}} +${6:after + ${7:expression} -> + ${8:body}} +end +endsnippet + +snippet rec "Record Directive" +-record (${1:record}, {${2:field}${3: = ${4:value}}}). +endsnippet + +snippet try "Try Expression" +try${1: ${2:expression}${3: of + ${4:pattern}${5: when ${6:guard}} -> + ${7:body}}} +${8:catch + ${9:pattern}${10: when ${11:guard}} -> + ${12:body}} +${13:after + ${14:body}} +end +endsnippet + +snippet undef "Undef Directive" +-undef (${1:macro}). +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/eruby.snippets b/vim/ultisnips-dist/eruby.snippets new file mode 100644 index 0000000..1fdcfc1 --- /dev/null +++ b/vim/ultisnips-dist/eruby.snippets @@ -0,0 +1,279 @@ +# TextMate added these variables to cope with changes in ERB handling +# in different versions of Rails -- for instance, Rails 3 automatically +# strips whitespace so that it's no longer necessary to use a form like +# <% end -%>, but if you're still maintaining Rails 2 projects, you +# can't omit the minus sign and get the same behavior. +# +# The following regex replace substitutes the function below for the +# TextMate variable references after the snippets are converted: +# +# /\v\$\{(TM_RAILS_TEMPLATE_([^_]+)_RUBY_([^_\s]+))\}/`!p textmate_var('\1', snip)`/g +# +global !p +def textmate_var(var, snip): + lookup = dict( + TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '), + TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'), + TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', ' %>'), + TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'), + TM_RAILS_TEMPLATE_END_RUBY_BLOCK = 'end' + ) + + snip.rv = lookup[var] + return +endglobal + + +########################################################################### +# GENERATED FROM get_tm_snippets.py + REGEX REPLACE # +########################################################################### + +snippet fi "<%= Fixtures.identify(:symbol) %>" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`Fixtures.identify(:${1:name})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`$0 +endsnippet + +snippet ft "form_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` + $0 +`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +endsnippet + +snippet end "end (ERB)" +<% end -%> +endsnippet + +snippet for "for loop (ERB)" +<% if !${1:list}.blank? %> + <% for ${2:item} in ${1} %> + $3 + <% end %> +<% else %> + $4 +<% end %> + +endsnippet + +snippet ffcb "form_for check_box" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffff "form_for file_field 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffhf "form_for hidden_field 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffl "form_for label 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffpf "form_for password_field 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffrb "form_for radio_box 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffs "form_for submit 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffta "form_for text_area 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet fftf "form_for text_field 2" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet fields "fields_for" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`fields_for :${1:model}, @${2:$1} do |$1|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` + $0 +`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +endsnippet + +snippet f. "f_fields_for (nff)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`f.fields_for :${1:attribute} do |${2:f}|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` + $0 +`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +endsnippet + +snippet f. "f.checkbox" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.file_field" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.hidden_field" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.label" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.password_field" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.radio_box" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.submit" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.text_area" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet f. "f.text_field" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet ffe "form_for with errors" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`error_messages_for :${1:model}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` + +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` + $0 +`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +endsnippet + +snippet ff "form_for" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` + $0 +`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +endsnippet + +snippet ist "image_submit_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_submit_tag("${1:agree.png}"${2:${3:, :id => "${4:${1/^(\w+)(\.\w*)?$/$1/}}"}${5:, :name => "${6:${1/^(\w+)(\.\w*)?$/$1/}}"}${7:, :class => "${8:${1/^(\w+)(\.\w*)?$/$1/}-button}"}${9:, :disabled => ${10:false}}})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet it "image_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_tag "$1${2:.png}"${3:${4:, :title => "${5:title}"}${6:, :class => "${7:class}"}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet layout "layout" +layout "${1:template_name}"${2:${3:, :only => ${4:[:${5:action}, :${6:action}]}}${7:, :except => ${8:[:${9:action}, :${10:action}]}}} +endsnippet + +snippet jit "javascript_include_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`javascript_include_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lia "link_to (action)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet liai "link_to (action, id)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:edit}", :id => ${3:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lic "link_to (controller)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lica "link_to (controller, action)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet licai "link_to (controller, action, id)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:edit}", :id => ${4:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet linpp "link_to (nested path plural)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:${10}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet linp "link_to (nested path)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lipp "link_to (path plural)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${4:model}s_path}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lip "link_to (path)" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:${12}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet lim "link_to model" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:model}.${2:name}, ${3:${4:$1}_path(${14:$1})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet hide "page.hide (*ids)" +page.hide ${1:"${2:id(s)}"} +endsnippet + +snippet ins "page.insert_html (position, id, partial)" +page.insert_html :${1:top}, ${2:"${3:id}"}, :${4:partial => "${5:template}"} +endsnippet + +snippet rep "page.replace (id, partial)" +page.replace ${1:"${2:id}"}, :${3:partial => "${4:template}"} +endsnippet + +snippet reph "page.replace_html (id, partial)" +page.replace_html ${1:"${2:id}"}, :${3:partial => "${4:template}"} +endsnippet + +snippet show "page.show (*ids)" +page.show ${1:"${2:id(s)}"} +endsnippet + +snippet tog "page.toggle (*ids)" +page.toggle ${1:"${2:id(s)}"} +endsnippet + +snippet vis "page.visual_effect (effect, id)" +page.visual_effect :${1:toggle_slide}, ${2:"${3:DOM ID}"} +endsnippet + +snippet rp "render (partial) (rp)" +render :partial => "${1:item}" +endsnippet + +snippet rpc "render (partial,collection) (rpc)" +render :partial => "${1:item}", :collection => ${2:@$1s} +endsnippet + +snippet rpl "render (partial,locals) (rpl)" +render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1}$0 } +endsnippet + +snippet rpo "render (partial,object) (rpo)" +render :partial => "${1:item}", :object => ${2:@$1} +endsnippet + +snippet rps "render (partial,status) (rps)" +render :partial => "${1:item}", :status => ${2:500} +endsnippet + +snippet slt "stylesheet_link_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`stylesheet_link_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet st "submit_tag" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +snippet else "else (ERB)" +<% else %> + +endsnippet + +snippet if "if (ERB)" +<% if ${1:condition} %>$0 +endsnippet + +snippet lf "link_to_function" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/go.snippets b/vim/ultisnips-dist/go.snippets new file mode 100644 index 0000000..ea46931 --- /dev/null +++ b/vim/ultisnips-dist/go.snippets @@ -0,0 +1,107 @@ +# Snippets for Go + +# when to abbriviate and when not? +# b doesn't work here, because it ignores whitespace +# optional local name? +snippet /^import/ "Import declaration" r +import ( + "${1:package}" +) +endsnippet + +snippet /^package/ "Package declaration" r +// Package $1 provides ... +package ${1:main} +endsnippet + +# Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle +snippet /^cons/ "Constants declaration" r +const ( + ${1:constant}${2/(.+)/ /}${2:type} = ${0:value} +) +endsnippet + +snippet /^con/ "Constant declaration" r +const ${1:name}${2/(.+)/ /}${2:type} = ${0:value} +endsnippet + +snippet iota "Iota constant generator" b +const ( + ${1:constant}${2/(.+)/ /}${2:type} = iota +) +endsnippet + +# statements +snippet for "For loop" !b +for ${1:condition}${1/(.+)/ /}{ + ${0:${VISUAL}} +} +endsnippet + +snippet forr "For range loop" !b +for ${2:name} := range ${1:collection} { + ${0:${VISUAL}} +} +endsnippet + +snippet if "If statement" !b +if ${1:condition}${1/(.+)/ /}{ + ${0:${VISUAL}} +} +endsnippet + +snippet switch "Switch statement" !b +switch ${1:expression}${1/(.+)/ /}{ +case${0} +} +endsnippet + +snippet case "Case clause" !b +case ${1:condition}: + ${0:${VISUAL}} +endsnippet + +snippet default "Default clause" !b +default: + ${0:${VISUAL}} +endsnippet + +# functions +snippet /^main/ "Main function" r +func main() { + ${0:${VISUAL}} +} +endsnippet + +snippet /^meth/ "Method" r +func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} { + ${0:${VISUAL}} +} +endsnippet + +snippet func "Function" b +func ${1:name}(${2:params})${3/(.+)/ /}${3:type} { + ${0:${VISUAL}} +} +endsnippet + +# types and variables +snippet map "Map type" !b +map[${1:keytype}]${2:valtype} +endsnippet + +snippet : "Variable declaration :=" !b +${1:name} := ${0:value} +endsnippet + +snippet var "Variable declaration" !b +var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}} +endsnippet + +snippet vars "Variables declaration" !b +var ( + ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} } +) +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/haskell.snippets b/vim/ultisnips-dist/haskell.snippets new file mode 100644 index 0000000..eb7b2c6 --- /dev/null +++ b/vim/ultisnips-dist/haskell.snippets @@ -0,0 +1,61 @@ +snippet if "if ... then ... else ..." +if ${1:condition} + then ${2:expression} + else ${3:expression} +endsnippet + +snippet case "case ... of ..." +case ${1:expression} of + ${2:pattern} -> ${3:expression} + ${4:pattern} -> ${5:expression} +endsnippet + +snippet :: "Type signature" +${1:name} :: ${2:Type} -> ${3:Type} +endsnippet + +snippet => "Type constraint" +(${1:Class} ${2:Type var}) => ${3:$2} +endsnippet + +snippet def "Function definition" +${1:name} :: ${2:Type} -> ${3:Type} +endsnippet + +snippet def[] "Function definition for list patterns" +${1:name} :: [${2:Type}] -> ${3:Type} +$1 [] = ${4:undefined} +$1 ${5:(x:xs)} = ${6:undefined} +endsnippet + +snippet = "Function clause" +${1:name} ${2:pattern} = ${3:undefined} +endsnippet + +snippet 2= "Function clause" +${1:name} ${2:pattern} = ${3:undefined} +$1 ${4:pattern} = ${5:undefined} +endsnippet + +snippet 3= "Function clause" +${1:name} ${2:pattern} = ${3:undefined} +$1 ${4:pattern} = ${5:undefined} +$1 ${6:pattern} = ${7:undefined} +endsnippet + +snippet | "Guard" +| ${1:predicate} = ${2:undefined} +endsnippet + +snippet \ "Lambda expression" +\ ${1:pattern} -> ${2:expression} +endsnippet + +snippet [|] "List comprehension" +[${3:foo }$1 | ${1:x} <- ${2:xs} ] +endsnippet + +snippet let "let ... in ..." +let ${1:name} = ${2:expression} +in ${3:expression} +endsnippet diff --git a/vim/ultisnips-dist/help.snippets b/vim/ultisnips-dist/help.snippets new file mode 100644 index 0000000..bd0bb12 --- /dev/null +++ b/vim/ultisnips-dist/help.snippets @@ -0,0 +1,30 @@ +# Snippets for VIM Help Files + +global !p +def sec_title(snip, t): + file_start = snip.fn.split('.')[0] + sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-') + return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1])) +endglobal + +snippet sec "Section marker" b +============================================================================== +${1:SECTION}`!p snip.rv = sec_title(snip, t)` + +$0 +endsnippet + +snippet ssec "Sub section marker" b +${1:Subsection}`!p snip.rv = sec_title(snip, t) +snip += "-"*len(t[1])` + +$0 +endsnippet + +snippet sssec "Subsub Section marker" b +${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)` + +$0 +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/html.snippets b/vim/ultisnips-dist/html.snippets new file mode 100644 index 0000000..1a7f569 --- /dev/null +++ b/vim/ultisnips-dist/html.snippets @@ -0,0 +1,300 @@ +########################################################################### +# TextMate Snippets # +########################################################################### + +global !p +def x(snip): + if snip.ft.startswith("x"): + snip.rv = '/' + else: + snip.rv = "" +endglobal + +############ +# Doctypes # +############ +snippet doctype "DocType XHTML 1.0 Strict" b +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +endsnippet + +snippet doctype "DocType XHTML 1.0 Transitional" b +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +endsnippet + +snippet doctype "DocType XHTML 1.1" b +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> + +endsnippet + +snippet doctype "HTML - 4.0 Transitional (doctype)" b +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +endsnippet + +snippet doctype "HTML - 5.0 (doctype)" b +<!DOCTYPE html> + +endsnippet + +############# +# Shortcuts # +############# +snippet down "Down (down)" +&#x2193; +endsnippet + +snippet enter "Enter (enter)" +&#x2305; +endsnippet + +snippet escape "Escape (escape)" +&#x238B; +endsnippet + +snippet shift "Shift (shift)" +&#x21E7; +endsnippet + +snippet tab "Tab (tab)" +&#x21E5; +endsnippet + +snippet up "Up (up)" +&#x2191; +endsnippet + +snippet return "Return (return)" +&#x21A9; +endsnippet + +snippet right "Right (right)" +&#x2192; +endsnippet + +snippet left "Left (left)" +&#x2190; +endsnippet + +snippet option "Option (option)" +&#x2325; +endsnippet + +####################### +# Conditional inserts # +####################### +snippet ! "IE Conditional Comment: Internet Explorer 5_0 only" +<!--[if IE 5.0]>${1:IE Conditional Comment: Internet Explorer 5.0 only }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer 5_5 only" +<!--[if IE 5.5000]>${1:IE Conditional Comment: Internet Explorer 5.5 only }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer 5_x" +<!--[if lt IE 6]>${1:IE Conditional Comment: Internet Explorer 5.x }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer 6 and below" +<!--[if lte IE 6]>${1:IE Conditional Comment: Internet Explorer 6 and below }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer 6 only" +<!--[if IE 6]>${1:IE Conditional Comment: Internet Explorer 6 only }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer 7+" +<!--[if gte IE 7]>${1:IE Conditional Comment: Internet Explorer 7 and above }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: Internet Explorer" +<!--[if IE]>${1: IE Conditional Comment: Internet Explorer }<![endif]-->$0 +endsnippet + +snippet ! "IE Conditional Comment: NOT Internet Explorer" +<!--[if !IE]><!-->${1: IE Conditional Comment: NOT Internet Explorer }<!-- <![endif]-->$0 +endsnippet + +############# +# HTML TAGS # +############# +snippet input "Input with Label" +<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p x(snip)`> + +endsnippet + +snippet input "XHTML <input>" +<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p x(snip)`> +endsnippet + + +snippet opt "Option" +<option${1: value="${2:option}"}>${3:$2}</option> +endsnippet + +snippet select "Select Box" +<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}> + <option${9: value="${10:option1}"}>${11:$10}</option> + <option${12: value="${13:option2}"}>${14:$13}</option>${15:} + $0 +</select> +endsnippet + + +snippet textarea "XHTML <textarea>" +<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea> +endsnippet + +snippet mailto "XHTML <a mailto: >" +<a href="mailto:${1:[email protected]}?subject=${2:feedback}">${3:email me}</a> +endsnippet + +snippet base "XHTML <base>" +<base href="$1"${2: target="$3"}`!p x(snip)`> +endsnippet + +snippet body "XHTML <body>" +<body id="${1:`!p +snip.rv = snip.fn and 'Hallo' or 'Nothin' +`}"${2: onload="$3"}> + $0 +</body> +endsnippet + +snippet div "XHTML <div>" +<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`> + $0 +</div> +endsnippet + +snippet form "XHTML <form>" +<form action="${1:`!p +snip.rv = (snip.basename or 'unnamed') + '_submit' +`}" method="${2:get}" accept-charset="utf-8"> + $0 + + <p><input type="submit" value="Continue →"`!p x(snip)`></p> +</form> +endsnippet + +snippet h1 "XHTML <h1>" +<h1 id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}">${1}</h1> +endsnippet + +snippet head "XHTML <head>" +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8"`!p x(snip)`> + <title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title> + $0 +</head> +endsnippet + +snippet link "XHTML <link>" +<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p x(snip)`> +endsnippet + +snippet meta "XHTML <meta>" +<meta name="${1:name}" content="${2:content}"`!p x(snip)`> +endsnippet + +snippet scriptsrc "XHTML <script src...>" +<script src="$1" type="text/javascript" charset="${3:utf-8}"></script> +endsnippet + +snippet script "XHTML <script>" +<script type="text/javascript" charset="utf-8"> + $0 +</script> +endsnippet + +snippet style "XHTML <style>" +<style type="text/css" media="screen"> + $0 +</style> +endsnippet + +snippet table "XHTML <table>" +<table border="${1:0}"${2: cellspacing="${3:5}" cellpadding="${4:5}"}> + <tr><th>${5:Header}</th></tr> + <tr><td>${0:Data}</td></tr> +</table> +endsnippet + +snippet a "Link" +<a href="${1:http://www.${2:url.com}}"${3: target="_blank"}>${4:Anchor Text}</a> +endsnippet + +snippet p "paragraph" +<p>$0</p> +endsnippet + +snippet li "list item" +<li></li> +endsnippet + +snippet ul "unordered list" +<ul> +$0 +</ul> +endsnippet + +snippet td "table cell" +<td>$0</td> +endsnippet + +snippet tr "table row" +<tr>$0</tr> +endsnippet + +snippet title "XHTML <title>" +<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title> +endsnippet + +snippet fieldset "Fieldset" +<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}> + <legend>$1</legend> + + $0 +</fieldset> +endsnippet + +snippet movie "Embed QT movie (movie)" b +<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> + <param name="src" value="$1"`!p x(snip)`> + <param name="controller" value="$4"`!p x(snip)`> + <param name="autoplay" value="$5"`!p x(snip)`> + <embed src="${1:movie.mov}" + width="${2:320}" height="${3:240}" + controller="${4:true}" autoplay="${5:true}" + scale="tofit" cache="true" + pluginspage="http://www.apple.com/quicktime/download/" + `!p x(snip)`> +</object> +endsnippet + +snippet html5 "HTML5 Template" +<!DOCTYPE html> +<html> +<head> + <title>${1}</title> + <meta charset="utf-8" /> +</head> +<body> + <header> + ${2} + </header> + <content> + ${3} + </content> + <footer> + ${4} + </footer> +</body> +</html> +endsnippet +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/htmldjango.snippets b/vim/ultisnips-dist/htmldjango.snippets new file mode 100644 index 0000000..9df5f78 --- /dev/null +++ b/vim/ultisnips-dist/htmldjango.snippets @@ -0,0 +1 @@ +extends html, django diff --git a/vim/ultisnips-dist/java.snippets b/vim/ultisnips-dist/java.snippets new file mode 100644 index 0000000..6e1b3ff --- /dev/null +++ b/vim/ultisnips-dist/java.snippets @@ -0,0 +1,212 @@ +########################################################################### +# TEXTMATE SNIPPETS # +########################################################################### + +# Many of the snippets here use a global option called +# "g:ultisnips_java_brace_style" which, if set to "nl" will put a newline +# before '{' braces. + +global !p +def nl(snip): + if snip.opt("g:ultisnips_java_brace_style", "") == "nl": + snip += "" + else: + snip.rv += " " +endglobal + +snippet ab "abstract" b +abstract +endsnippet + +snippet as "assert" b +assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0 +endsnippet + +snippet br "break" +break; + +endsnippet + +snippet cs "case" b +case $1: + $2 +$0 +endsnippet + +snippet ca "catch" b +catch (${1:Exception} ${2:e})`!p nl(snip)`{ + $0 +} +endsnippet + +snippet cl "class" b +class ${1:`!p +snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{ + $0 +} +endsnippet + +snippet cos "constant string" b +static public final String ${1:var} = "$2";$0 +endsnippet + +snippet co "constant" b +static public final ${1:String} ${2:var} = $3;$0 +endsnippet + +snippet de "default" b +default: + $0 +endsnippet + +snippet elif "else if" b +else if ($1)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet /el(se)?/ "else" br +else`!p nl(snip)`{ + $0 +} +endsnippet + +snippet fi "final" b +final +endsnippet + +snippet fore "for (each)" b +for ($1 : $2)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet for "for" b +for ($1; $2; $3)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet if "if" b +if ($1)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet imt "import junit_framework_TestCase;" b +import junit.framework.TestCase; +$0 +endsnippet + +snippet im "import" b +import +endsnippet + +snippet in "interface" b +interface ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }{ + $0 +} +endsnippet + +snippet j.b "java_beans_" i +java.beans. +endsnippet + +snippet j.i "java_io" i +java.io. +endsnippet + +snippet j.m "java_math" i +java.math. +endsnippet + +snippet j.n "java_net_" i +java.net. +endsnippet + +snippet j.u "java_util_" i +java.util. +endsnippet + +snippet main "method (main)" b +public static void main(String[] args)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet m "method" b +${1:void} ${2:method}($3) ${4:throws $5 }{ + $0 +} + +endsnippet + +snippet pa "package" b +package +endsnippet + +snippet p "print" b +System.out.print($1);$0 +endsnippet + +snippet pl "println" b +System.out.println($1);$0 +endsnippet + +snippet pr "private" b +private +endsnippet + +snippet po "protected" b +protected +endsnippet + +snippet pu "public" b +public +endsnippet + +snippet re "return" b +return +endsnippet + +snippet st "static" +static +endsnippet + +snippet sw "switch" b +switch ($1)`!p nl(snip)`{ + $0 +} +endsnippet + +snippet sy "synchronized" +synchronized +endsnippet + +snippet tc "test case" +public class ${1:`!p snip.rv = snip.basename or "untitled"`} extends ${2:TestCase}`!p nl(snip)`{ + $0 +} +endsnippet + +snippet t "test" b +public void test${1:Name}() throws Exception`!p nl(snip)`{ + $0 +} +endsnippet + +snippet th "throw" b +throw $0 +endsnippet + +snippet v "variable" b +${1:String} ${2:var}${3: = ${0:null}}; +endsnippet + +snippet wh "while" b +while ($1)`!p nl(snip)`{ + $0 +} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/javascript.snippets b/vim/ultisnips-dist/javascript.snippets new file mode 100644 index 0000000..e4e7f7a --- /dev/null +++ b/vim/ultisnips-dist/javascript.snippets @@ -0,0 +1,65 @@ +########################################################################### +# TextMate Snippets # +########################################################################### +snippet get "Get Elements" +getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2') +endsnippet + +snippet '':f "object method string" +'${1:${2:#thing}:${3:click}}': function(element){ + $0 +}${10:,} +endsnippet + +snippet :f "Object Method" +${1:method_name}: function(${3:attribute}){ + $0 +}${10:,} +endsnippet + +snippet :, "Object Value JS" +${1:value_name}:${0:value}, +endsnippet + +snippet : "Object key key: 'value'" +${1:key}: ${2:"${3:value}"}${4:, } +endsnippet + +snippet proto "Prototype (proto)" +${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) ,,{ + ${0:// body...} +}; + +endsnippet + +snippet for "for (...) {...} (faster)" +for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2--){ + ${3:$1[$2]}$0 +}; +endsnippet + +snippet for "for (...) {...}" +for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { + ${3:$1[$2]}$0 +}; +endsnippet + +snippet fun "function (fun)" +function ${1:function_name} (${2:argument}) { + ${0:// body...} +} +endsnippet + +snippet ife "if ___ else" +if (${1:true}) {$0} else{}; +endsnippet + +snippet if "if" +if (${1:true}) {$0}; +endsnippet + +snippet timeout "setTimeout function" +setTimeout(function() {$0}${2:}, ${1:10}); +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/javascript_jasmine.snippets b/vim/ultisnips-dist/javascript_jasmine.snippets new file mode 100644 index 0000000..49e38a3 --- /dev/null +++ b/vim/ultisnips-dist/javascript_jasmine.snippets @@ -0,0 +1,168 @@ +# +# JavaScript versions -- from the TextMate bundle + some additions +# for jasmine-jquery matchers +# +extends javascript + +snippet des "Describe (js)" b +describe('${1:description}', function() { + $0 +}); +endsnippet + +snippet it "it (js)" b +it('${1:description}', function() { + $0 +}); +endsnippet + +snippet bef "before each (js)" b +beforeEach(function() { + $0 +}); +endsnippet + +snippet aft "after each (js)" b +afterEach(function() { + $0 +}); +endsnippet + +snippet any "any (js)" b +jasmine.any($1) +endsnippet + +snippet ru "runs (js)" b +runs(function() { + $0 +}); +endsnippet + +snippet wa "waits (js)" b +waits($1); +endsnippet + +snippet ex "expect (js)" b +expect(${1:target})$0; +endsnippet + +snippet ee "expect to equal (js)" b +expect(${1:target}).toEqual(${2:value}); +endsnippet + +snippet em "expect to match (js)" b +expect(${1:target}).toMatch(${2:pattern}); +endsnippet + +snippet eha "expect to have attribute (js)" b +expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'}); +endsnippet + +snippet et "expect to be truthy (js)" b +expect(${1:target}).toBeTruthy(); +endsnippet + +snippet ef "expect to be falsy (js)" b +expect(${1:target}).toBeFalsy(); +endsnippet + +snippet ed "expect to be defined (js)" b +expect(${1:target}).toBeDefined(); +endsnippet + +snippet en "expect to be null (js)" b +expect(${1:target}).toBeNull(); +endsnippet + +snippet ec "expect to contain (js)" b +expect(${1:target}).toContain(${2:value}); +endsnippet + +snippet ev "expect to be visible (js)" b +expect(${1:target}).toBeVisible(); +endsnippet + +snippet eh "expect to be hidden (js)" b +expect(${1:target}).toBeHidden(); +endsnippet + +snippet notx "expect not (js)" b +expect(${1:target}).not$0; +endsnippet + +snippet note "expect not to equal (js)" b +expect(${1:target}).not.toEqual(${2:value}); +endsnippet + +snippet notm "expect not to match (js)" b +expect(${1:target}).not.toMatch(${2:pattern}); +endsnippet + +snippet notha "expect to not have attribute (js)" b +expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'}); +endsnippet + +snippet nott "expect not to be truthy (js)" b +expect(${1:target}).not.toBeTruthy(); +endsnippet + +snippet notf "expect not to be falsy (js)" b +expect(${1:target}).not.toBeFalsy(); +endsnippet + +snippet notd "expect not to be defined (js)" b +expect(${1:target}).not.toBeDefined(); +endsnippet + +snippet notn "expect not to be null (js)" b +expect(${1:target}).not.toBeNull(); +endsnippet + +snippet notc "expect not to contain (js)" b +expect(${1:target}).not.toContain(${2:value}); +endsnippet + +snippet notv "expect not to be visible (js)" b +expect(${1:target}).not.toBeVisible(); +endsnippet + +snippet noth "expect not to be hidden (js)" b +expect(${1:target}).not.toBeHidden(); +endsnippet + +snippet s "spy on (js)" b +spyOn(${1:object}, '${2:method}')$0; +endsnippet + +snippet sr "spy on and return (js)" b +spyOn(${1:object}, '${2:method}').andReturn(${3:arguments}); +endsnippet + +snippet st "spy on and throw (js)" b +spyOn(${1:object}, '${2:method}').andThrow(${3:exception}); +endsnippet + +snippet sct "spy on and call through (js)" b +spyOn(${1:object}, '${2:method}').andCallThrough(); +endsnippet + +snippet scf "spy on and call fake (js)" b +spyOn(${1:object}, '${2:method}').andCallFake(${3:function}); +endsnippet + +snippet esc "expect was called (js)" b +expect(${1:target}).wasCalled(); +endsnippet + +snippet escw "expect was called with (js)" b +expect(${1:target}).wasCalledWith(${2:arguments}); +endsnippet + +snippet notsc "expect was not called (js)" b +expect(${1:target}).wasNotCalled(); +endsnippet + +snippet noscw "expect was not called with (js)" b +expect(${1:target}).wasNotCalledWith(${2:arguments}); +endsnippet + diff --git a/vim/ultisnips-dist/jinja2.snippets b/vim/ultisnips-dist/jinja2.snippets new file mode 100644 index 0000000..6fef6ed --- /dev/null +++ b/vim/ultisnips-dist/jinja2.snippets @@ -0,0 +1,209 @@ + +# http://jinja.pocoo.org/ + +# jinja2 is a full featured template engine for Python. It has full +# unicode support, an optional integrated sandboxed execution +# environment, widely used and BSD licensed. + +# possible extends: +#extends html + + +snippet block "block" b +{% block ${1:name} %} + $2 +{% endblock $1 %} +endsnippet + + +snippet {{ "variable" b +{{ $1 }} +endsnippet + + +snippet {# "comment" b +{# $1 #} +endsnippet + + +snippet # "comment" b +{# $1 #} +endsnippet + + +snippet raw "escaped block" b +{% raw %} + $1 +{% endraw %} +endsnippet + + +snippet extends "extends" b +{% extends "${1:template}" %} +endsnippet + + +snippet include "include" b +{% include "${1:template}" %} +endsnippet + + +snippet import "import" b +{% import "${1:template}" %} +endsnippet + + +snippet from "from/import/as" b +{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %} +endsnippet + + +snippet filter "filter" b +{% filter ${1:filter} %} + $2 +{% endfilter %} +endsnippet + + +# Being able to quickly remove the whole 'else' block seems faster to me than +# choosing between 'for' and 'for/else' snippets from the menu. +# snippet for "for" b +# {% for ${1:item} in ${2:sequence} %} +# $3${4: +# {% else %} +# $5} +# {% endfor %} +# endsnippet + + +snippet for "for" b +{% for ${1:item} in ${2:sequence} %} + $3 +{% endfor %} +endsnippet + + +snippet for "for/else" b +{% for ${1:item} in ${2:sequence} %} + $3 +{% else %} + $4 +{% endfor %} +endsnippet + + +snippet if "if" b +{% if ${1:expr} %} + $2 +{% endif %} +endsnippet + + +snippet if "if/else" b +{% if ${1:expr} %} + $2 +{% else %} + $3 +{% endif %} +endsnippet + + +snippet if "if/elif/else" b +{% if ${1:expr} %} + $2 +{% elif %} + $3 +{% else %} + $4 +{% endif %} +endsnippet + + +snippet macro "macro" b +{% macro ${1:name}(${2:args}) %} + $3 +{% endmacro %} +endsnippet + + +snippet call "call" b +{% call ${1:name}(${2:args}) %} + $3 +{% endcall %} +endsnippet + + +snippet set "set" b +{% set ${1:name} = ${2:'value'} %} +endsnippet + + +snippet trans "translation" b +{% trans %} + $1 +{% endtrans %} +endsnippet + + +snippet with "with" b +{% with %} + $1 +{% endwith %} +endsnippet + + +snippet autoescape "autoescape" b +{% autoescape ${1:true} %} + $2 +{% endautoescape %} +endsnippet + +# Filters +# @todo: expand only when snippet is preceeded by a | + +snippet batch "batch items" w +batch(linecount=$1, fill_with=${2:None}) +endsnippet + + +snippet dictsort "sort and yield (key, value) pairs" w +dictsort(case_sensitive=${1:False}, by=${2:'key'}) +endsnippet + + +snippet round "round number" w +round(precision=${1:0}, method=${2:'common|ceil|floor'}) +endsnippet + + +snippet urlize "convert plain-text url to <a/>" w +urlize(trim_url_limit=${1:None}, nofollow=${2:False}) +endsnippet + + +snippet wordwrap "wordwrap" w +wordwrap(width=${1:79}, break_long_words=${2:True}) +endsnippet + + +snippet truncate "truncate" w +truncate(lenght=${1:79}, killwords=${2:False}, end=${3:'...''}) +endsnippet + + +snippet sum "sum of sequence of numbers + start" w +sum(attribute=${1:None}, start=${2:0}) +endsnippet + + +snippet sort "sort an iterable" w +sort(reverse=${1:False}, case_sensitive=${2:False}, attribute=${3:None}) +endsnippet + + +snippet indent "indent" w +indent(width=${1:4}, indentfirst=${2:False}) +endsnippet + + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/json.snippets b/vim/ultisnips-dist/json.snippets new file mode 100644 index 0000000..81e6561 --- /dev/null +++ b/vim/ultisnips-dist/json.snippets @@ -0,0 +1,19 @@ +snippet s "String" b +"${1:key}": "${0:value}", +endsnippet + +snippet n "number" b +"${1:key}": ${0:value}, +endsnippet + +snippet a "Array" b +[ + ${VISUAL}$0 +], +endsnippet +snippet o "Object" b +{ + ${VISUAL}$0 +}, +endsnippet + diff --git a/vim/ultisnips-dist/lua.snippets b/vim/ultisnips-dist/lua.snippets new file mode 100644 index 0000000..1b82a24 --- /dev/null +++ b/vim/ultisnips-dist/lua.snippets @@ -0,0 +1,37 @@ +################################# +# Snippets for the Lua language # +################################# +snippet #! "Shebang header" b +#!/usr/bin/env lua +$0 +endsnippet + +snippet !fun(ction)?! "New function" br +function ${1:new_function}(${2:args}) + $0 +end +endsnippet + +snippet forp "pair for loop" b +for ${1:name},${2:val} in pairs(${3:table_name}) do + $0 +end +endsnippet + +snippet fori "ipair for foop" b +for ${1:idx},${2:val} in ipairs(${3:table_name}) do + $0 +end +endsnippet + +snippet for "numeric for loop" b +for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do + $0 +end +endsnippet + +snippet local "local x = 1" +local ${1:x} = ${0:1} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/mako.snippets b/vim/ultisnips-dist/mako.snippets new file mode 100644 index 0000000..92a7be3 --- /dev/null +++ b/vim/ultisnips-dist/mako.snippets @@ -0,0 +1,90 @@ +################# +# From snipmate # +################# +snippet def "definition" b +<%def name="${1:name}"> + ${2:} +</%def> +endsnippet + +snippet call "call" b +<%call expr="${1:name}"> + ${2:} +</%call> +endsnippet + +snippet doc "doc" b +<%doc> + ${1:} +</%doc> +endsnippet + +snippet text "text" b +<%text> + ${1:} +</%text> +endsnippet + +snippet for "for" b +% for ${1:i} in ${2:iter}: + ${3:} +% endfor +endsnippet + +snippet if "if " b +% if ${1:condition}: + ${2:} +% endif +endsnippet + +snippet if "if/else" b +% if ${1:condition}: + ${2:} +% else: + ${3:} +% endif +endsnippet + +snippet try "try" b +% try: + ${1:} +% except${2:}: + ${3:pass} +% endtry +endsnippet + +snippet wh "wh" b +% while ${1:}: + ${2:} +% endwhile +endsnippet + +snippet $ "$" i +${${1:}} +endsnippet + +snippet <% "<%" b +<% ${1:} %> +endsnippet + +snippet <!% "<!%" b +<!% ${1:} %> +endsnippet + +snippet inherit "inherit" b +<%inherit file="${1:filename}" /> +endsnippet + +snippet include "include" b +<%include file="${1:filename}" /> +endsnippet + +snippet namespace "namespace" b +<%namespace file="${1:name}" /> +endsnippet + +snippet page "page" b +<%page args="${1:}" /> +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/markdown.snippets b/vim/ultisnips-dist/markdown.snippets new file mode 100644 index 0000000..c3189b8 --- /dev/null +++ b/vim/ultisnips-dist/markdown.snippets @@ -0,0 +1,44 @@ +########################################################################### +# SNIPPETS for MARKDOWN # +########################################################################### + +########################### +# Sections and Paragraphs # +########################### +snippet sec "Section" b +# ${1:Section Name} # +$0 +endsnippet + +snippet ssec "Sub Section" b +## ${1:Section Name} ## +$0 +endsnippet + +snippet sssec "SubSub Section" b +### ${1:Section Name} ### +$0 +endsnippet + +snippet par "Paragraph" b +#### ${1:Paragraph Name} #### +$0 +endsnippet + +snippet spar "Paragraph" b +##### ${1:Paragraph Name} ##### +$0 +endsnippet + +################ +# Common stuff # +################ +snippet link "Link to something" +[${1:${VISUAL:Text}}](${3:http://${2:www.url.com}})$0 +endsnippet + +snippet img "Image" +![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0 +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/objc.snippets b/vim/ultisnips-dist/objc.snippets new file mode 100644 index 0000000..0c67664 --- /dev/null +++ b/vim/ultisnips-dist/objc.snippets @@ -0,0 +1,270 @@ +########################################################################### +# TextMate Snippets # +########################################################################### + +snippet imp "#import (imp)" b +#import "${1:`!p snip.rv = re.sub(r'\..*$', '.h', fn)`}" +endsnippet + +snippet Imp "#import <> (Imp)" +#import <${1:Cocoa/Cocoa.h}> +endsnippet + +snippet cl "020 Class (objc)" +@interface ${1:`!p +if len(fn): + snip.rv = re.sub(r'\..*$', '', fn) +else: + snip.rv = "object" +`} : ${2:NSObject} +{ +} +@end + +@implementation $1 +- (id)init +{ + if((self = [super init])) + {$0 + } + return self; +} +@end +endsnippet + +snippet array "NSArray (array)" +NSMutableArray *${1:array} = [NSMutableArray array]; +endsnippet + +snippet dict "NSDictionary (dict)" +NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary]; +endsnippet + +snippet forarray "for NSArray loop (forarray)" +unsigned int ${1:object}Count = [${2:array} count]; + +for(unsigned int index = 0; index < $1Count; index += 1) +{ + ${3:id} $1 = [$2 objectAtIndex:index]; + $0 +} +endsnippet + +snippet objacc "Object Accessors (objacc)" +- (${1:id})${2:thing} +{ + return $2; +} + +- (void)set${2/./\u$0/}:($1)aValue +{ + $0${1/( \*)?$/(?1:$1: )/}old${2/./\u$0/} = $2; + $2 = [aValue retain]; + [old${2/./\u$0/} release]; +} +endsnippet + +snippet sel "@selector" +@selector(${1:method}:) +endsnippet + +snippet cdacc "CoreData Accessors Implementation" +- (${1:id})${2:attribute} +{ + [self willAccessValueForKey:@"$2"]; + $1 value = [self primitiveValueForKey:@"$2"]; + [self didAccessValueForKey:@"$2"]; + return value; +} + +- (void)set${2/./\u$0/}:($1)aValue +{ + [self willChangeValueForKey:@"$2"]; + [self setPrimitiveValue:aValue forKey:@"$2"]; + [self didChangeValueForKey:@"$2"]; +} +endsnippet + +snippet delegate "Delegate Responds to Selector" +if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})]) + [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:<>)(?4::)(?5: :)/g}}]; + +endsnippet + +snippet thread "Detach New NSThread" +[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}] +endsnippet + +snippet ibo "IBOutlet (ibo)" +IBOutlet ${1:NSSomeClass} *${2:${1/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; +endsnippet + +snippet I "Initialize Implementation (I)" ++ (void)initialize +{ + [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: + $0@"value", @"key", + nil]]; +} +endsnippet + +snippet bind "Key:value binding (bind)" +bind:@"${1:binding}" toObject:${2:observableController} withKeyPath:@"${3:keyPath}" options:${4:nil} +endsnippet + +snippet arracc "LoD array (arracc)" +- (void)addObjectTo${1:Things}:(${2:id})anObject +{ + [${3:${1/./\l$0/}} addObject:anObject]; +} + +- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i +{ + [$3 insertObject:anObject atIndex:i]; +} + +- ($2)objectIn$1AtIndex:(unsigned int)i +{ + return [$3 objectAtIndex:i]; +} + +- (unsigned int)indexOfObjectIn$1:($2)anObject +{ + return [$3 indexOfObject:anObject]; +} + +- (void)removeObjectFrom$1AtIndex:(unsigned int)i +{ + [$3 removeObjectAtIndex:i]; +} + +- (unsigned int)countOf$1 +{ + return [$3 count]; +} + +- (NSArray *${1/./\l$0/} +{ + return $3; +} + +- (void)set$1:(NSArray *)new$1 +{ + [$3 setArray:new$1]; +} +endsnippet + +snippet arracc "LoD array interface (arracc)" +- (void)addObjectTo${1:Things}:(${2:id})anObject; +- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i; +- ($2)objectIn$1AtIndex:(unsigned int)i; +- (unsigned int)indexOfObjectIn$1:($2)anObject; +- (void)removeObjectFrom$1AtIndex:(unsigned int)i; +- (unsigned int)countOf$1; +- (NSArray *)${1/./\l$0/}; +- (void)set$1:(NSArray *)new$1; +endsnippet + +snippet focus "Lock Focus" +[self lockFocus]; +$0 +[self unlockFocus]; +endsnippet + +snippet pool "NSAutoreleasePool (pool)" +NSAutoreleasePool *pool = [NSAutoreleasePool new]; +$0 +[pool drain]; +endsnippet + +snippet log "NSLog (log) 2" +NSLog(@"$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/} +endsnippet + +snippet alert "NSRunAlertPanel (alert)" +int choice = NSRunAlertPanel(@"${1:Something important!}", @"${2:Something important just happend, and now I need to ask you, do you want to continue?}", @"${3:Continue}", @"${4:Cancel}", nil); +if(choice == NSAlertDefaultReturn) // "$3" +{ + $0; +} +else if(choice == NSAlertAlternateReturn) // "$4" +{ + +} +endsnippet + +snippet format "NSString stringWithFormat (format)" +[NSString stringWithFormat:@"$1", $2]$0 +endsnippet + +snippet objacc "Object Accessors Interface (objacc)" +- (${1:id})${2:thing}; +- (void)set${2/./\u$0/}:($1)aValue; +endsnippet + +snippet prop "Property" +@property (${1/^(e)$|.*/(?1:r)/}${1:r}${1/^(?:(r)|(e)|(c)|(a))$|.*/(?1:etain)(?2:adonly)(?3:opy)(?4:ssign)/}) ${2:NSSomeClass}$ *${3:${2/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; +endsnippet + +snippet getprefs "Read from defaults (getprefs)" +[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}]; +endsnippet + +snippet obs "Register for Notification" +[[NSNotificationCenter defaultCenter] addObserver:${1:self} selector:@selector(${3:${2/^([A-Z]{2})?(.+?)(Notification)?$/\l$2/}}:) name:${2:NSWindowDidBecomeMainNotification} object:${4:nil}]; +endsnippet + +snippet responds "Responds to Selector" +if ([${1:self} respondsToSelector:@selector(${2:someSelector:})]) +{ + [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}]; +} +endsnippet + +snippet gsave "Save and Restore Graphics Context (gsave)" +[NSGraphicsContext saveGraphicsState]; +$0 +[NSGraphicsContext restoreGraphicsState]; + +endsnippet + +snippet acc "Scalar Accessors (acc)" +- (${1:unsigned int})${2:thing} +{ + return ${3:$2}; +} + +- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/} +{ + $3 = new${2/./\u$0/}; +} +endsnippet + +snippet acc "Scalar Accessors Interface (acc)" +- (${1:unsigned int})${2:thing}; +- (void)set${2/./\u$0/}:($1)new${2/./\u$0/}; +endsnippet + +snippet stracc "String Accessors (stracc)" +- (NSString *)${1:thing} +{ + return ${2:$1}; +} + +- (void)set${1/.*/\u$0/}:(NSString *)/})${3:a${1/.*/\u$0/}} +{ + $3 = [$3 copy]; + [$2 release]; + $2 = $3; +} +endsnippet + +snippet syn "Synthesize" +@synthesize ${1:property}; +endsnippet + +snippet setprefs "Write to defaults (setprefs)" +[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}]; +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/perl.snippets b/vim/ultisnips-dist/perl.snippets new file mode 100644 index 0000000..6a9e8f9 --- /dev/null +++ b/vim/ultisnips-dist/perl.snippets @@ -0,0 +1,127 @@ +########################################################################### +# TextMate Snippets # +########################################################################### +snippet ife "Conditional if..else (ife)" +if ($1) { + ${2:# body...} +} else { + ${3:# else...} +} + +endsnippet + +snippet ifee "Conditional if..elsif..else (ifee)" +if ($1) { + ${2:# body...} +} elsif ($3) { + ${4:# elsif...} +} else { + ${5:# else...} +} + +endsnippet + +snippet xunless "Conditional one-line (unless)" +${1:expression} unless ${2:condition}; + +endsnippet + +snippet xif "Conditional one-line (xif)" +${1:expression} if ${2:condition}; + +endsnippet + +snippet sub "Function (sub)" +sub ${1:function_name} { + ${2:# body...} +} + +endsnippet + +snippet xfore "Loop one-line (xforeach)" +${1:expression} foreach @${2:array}; + +endsnippet + +snippet xwhile "Loop one-line (xwhile)" +${1:expression} while ${2:condition}; + +endsnippet + +snippet test "Test" +#!/usr/bin/perl -w + +use strict; +use Test::More tests => ${1:1}; +use ${2:ModuleName}; + +ok(${3:assertion}); + +endsnippet + +snippet class "class" +package ${1:ClassName}; + +${2:use base qw(${3:ParentClass});}${2/.+/\n\n/}sub new { + my $class = shift; + $class = ref $class if ref $class; + my $self = bless {}, $class; + $self; +} + +1; + +endsnippet + +snippet eval "eval" +eval { + ${1:# do something risky...} +}; +if ($@) { + ${2:# handle failure...} +} + +endsnippet + +snippet for "for" +for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) { + ${3:# body...} +} + +endsnippet + +snippet fore "foreach" +foreach ${1:my $${2:x}} (@${3:array}) { + ${4:# body...} +} + +endsnippet + +snippet if "if" +if ($1) { + ${2:# body...} +} + +endsnippet + +snippet slurp "slurp" +my $${1:var}; +{ local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE } + +endsnippet + +snippet unless "unless" +unless ($1) { + ${2:# body...} +} + +endsnippet + +snippet while "while" +while ($1) { + ${2:# body...} +} + +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/php.snippets b/vim/ultisnips-dist/php.snippets new file mode 100644 index 0000000..40461d2 --- /dev/null +++ b/vim/ultisnips-dist/php.snippets @@ -0,0 +1,258 @@ +## Snippets from SnipMate, taken from +## https://github.com/scrooloose/snipmate-snippets.git + +snippet array "array" +$${1:arrayName} = array('${2}' => ${3});${4} +endsnippet + +snippet def "def" +define('${1}'${2});${3} +endsnippet + +snippet do "do" +do { + ${2:// code... } +} while (${1:/* condition */});" +endsnippet + +snippet doc_f "doc_f" +/** + * $2 + * @return ${4:void} + * @author ${5:`!v g:snips_author`} + **/ +${1:public }function ${2:someFunc}(${3}) +{${6} +} +endsnippet + +snippet doc_i "doc_i" +/** + * $1 + * @package ${2:default} + * @author ${3:`!v g:snips_author`} + **/ +interface ${1:someClass} +{${4} +} // END interface $1" +endsnippet + +snippet else "else" +else { + ${1:// code...} +} +endsnippet + +snippet for "for" +for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { + ${4:// code...} +} +endsnippet + +snippet foreachk "foreachk" +foreach ($${1:variable} as $${2:key} => $${3:value}){ + ${4:// code...} +} +endsnippet + +snippet get "get" +$_GET['${1}']${2} +endsnippet + +snippet if "if" +if (${1:/* condition */}) { + ${2:// code...} +} +endsnippet + +snippet inc "inc" +include '${1:file}';${2} +endsnippet + +snippet log "log" +error_log(var_export(${1}, true));${2} +endsnippet + +snippet post "post" +$_POST['${1}']${2} +endsnippet + +snippet req1 "req1" +require_once '${1:file}';${2} +endsnippet + +snippet session "session" +$_SESSION['${1}']${2} +endsnippet + +snippet t "t" +$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5} +endsnippet + +snippet var "var" +var_export(${1});${2} +endsnippet + +snippet getter "PHP Class Getter" !b +/* + * Getter for $1 + */ +public function get${1/\w+\s*/\u$0/}() +{ + return $this->$1;$2 +} +$4 +endsnippet + +snippet setter "PHP Class Setter" !b +/* + * Setter for $1 + */ +public function set${1/\w+\s*/\u$0/}($$1) +{ + $this->$1 = $$1;$3 + ${4:return $this;} +} +$0 +endsnippet + +snippet gs "PHP Class Getter Setter" !b +protected $$1 + +/* + * Getter for $1 + */ +public function get${1/\w+\s*/\u$0/}() +{ + return $this->$1;$2 +} + +/* + * Setter for $1 + */ +public function set${1/\w+\s*/\u$0/}($$1) +{ + $this->$1 = $$1;$3 + ${4:return $this;} +} +$0 +endsnippet + +snippet pub "Public function" !b +public function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pro "Protected function" !b +protected function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pri "Private function" !b +private function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pubs "Public static function" !b +public static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pros "Protected static function" !b +protected static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pris "Private static function" !b +private static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet fu "Function snip" !b +function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet +# :vim:ft=snippets + +snippet fore "Foreach loop" +foreach ($${1:variable} as $${3:value}){ + ${VISUAL}${4} +} +$0 +endsnippet + +snippet new "New class instance" !b +$$1 = new $1($2); +$0 +endsnippet + + +snippet ife "if else" +if (${1:/* condition */}) { + ${2:// code...} +} else { + ${3:// code...} +} +$0 +endsnippet + + +snippet class "Class declaration template" !b +/** + * Class ${1:`!p snip.rv=snip.fn.capitalize().split('.')[0]`} + * @author $2 + */ +class $1 +{ + public function ${3:__construct}(${4:$options}) + { + ${4:// code} + } +} +$0 +endsnippet + +snippet pr "Dumb debug helper in HTML" +echo '<pre>' . var_export($1, 1) . '</pre>';$0 +endsnippet + +snippet pc "Dumb debug helper in cli" +var_export($1);$0 +endsnippet + +# Symfony 2 based snippets +snippet sfa "Symfony 2 Controller action" +/** +* @Route("/${1:route_name}", name="$1") +* @Template() +*/ +public function $1Action($2) +{ + $3 + return ${4:array();}$0 +} +endsnippet + +# :vim:ft=snippets: + diff --git a/vim/ultisnips-dist/puppet.snippets b/vim/ultisnips-dist/puppet.snippets new file mode 100644 index 0000000..68ae0fe --- /dev/null +++ b/vim/ultisnips-dist/puppet.snippets @@ -0,0 +1,78 @@ +# Snippets for Puppet + +snippet /^class/ "Class declaration" r +class ${1:name} { + ${0:# body} +} +endsnippet + +snippet File "Defaults for file" b +File { + owner => ${1:username}, + group => ${2:groupname}, +} +endsnippet + +# Resource types +snippet package "Package resource type" b +package { "${1:name}": + ensure => ${2:installed}, +} +endsnippet + +snippet file "File resource type" b +file { "${1:name}": + source => "puppet://${2:path}", + mode => ${3:mode}, +endsnippet + +snippet group "Group resource type" b +group { "${1:groupname}": + ensure => ${3:present}, + gid => ${2:gid}, +endsnippet + +snippet user "user resource type" b +group { "${1:username}": + ensure => ${2:present}, + uid => ${3:uid}, + gid => ${4:gid}, + comment => ${5:gecos}, + home => ${6:homedirectory}, + managehome => false, + require => Group["${7:group"], +endsnippet + +snippet exec "Exec resource type" b +exec { "${1:command}": + refreshonly => true, +} +endsnippet + +snippet cron "Cron resource type" b +cron { "${1:name}": + user => ${2:user}, + command => "${3:command}", + minute => ${3:minute}, + hour => ${4:hour}, +} +endsnippet + +snippet mount "Mount resource type" b +mount { "${1:path}": + device => "${2:/dev}", + fstype => "${3:filesystem}", + ensure => mounted, + options => "rw,errors=remount-ro", +} +endsnippet + +snippet service "Service resource type" b +service { "${1:name}": + hasstatus => true, + enable => true, + ensure => running, +} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/python.snippets b/vim/ultisnips-dist/python.snippets new file mode 100644 index 0000000..462bf20 --- /dev/null +++ b/vim/ultisnips-dist/python.snippets @@ -0,0 +1,463 @@ +########################################################################### +# TEXTMATE SNIPPETS # +########################################################################### + +#! header +snippet #! "Shebang header for python scripts" b +#!/usr/bin/env python +# encoding: utf-8 +$0 +endsnippet + +snippet ifmain "ifmain" b +if __name__ == '__main__': + ${1:main()}$0 +endsnippet + + +########## +# COMMON # +########## + +# The smart def and smart class snippets use a global option called +# "g:ultisnips_python_style" which, if set to "doxygen" will use doxygen +# style comments in docstrings. + +global !p + +NORMAL = 0x1 +DOXYGEN = 0x2 +SPHINX = 0x3 + +def get_args(arglist): + args = [arg.split('=')[0].strip() for arg in arglist.split(',') if arg] + args = [arg for arg in args if arg and arg != "self"] + + return args + + +def get_style(snip): + style = snip.opt("g:ultisnips_python_style", "normal") + + if style == "doxygen": return DOXYGEN + elif style == "sphinx": return SPHINX + else: return NORMAL + + +def format_arg(arg, style): + if style == DOXYGEN: + return "@param %s @todo" % arg + elif style == SPHINX: + return ":param %s: @todo" % arg + elif style == NORMAL: + return ":%s: @todo" % arg + + +def format_return(style): + if style == DOXYGEN: + return "@return: @todo" + elif style in (NORMAL, SPHINX): + return ":returns: @todo" + + +def write_docstring_args(args, snip): + if not args: + snip.rv += ' """' + return + + snip.rv += '\n' + snip.mkline('', indent='') + + style = get_style(snip) + + for arg in args: + snip += format_arg(arg, style) + + +def write_init_body(args, parents, snip): + parents = [p.strip() for p in parents.split(",")] + parents = [p for p in parents if p != 'object'] + + for p in parents: + snip += p + ".__init__(self)" + + if parents: + snip.rv += '\n' + snip.mkline('', indent='') + + for arg in args: + snip += "self._%s = %s" % (arg, arg) + + +def write_slots_args(args, snip): + args = ['"%s"' % arg for arg in args] + snip += '__slots__ = (%s,)' % ', '.join(args) + +endglobal + +######################################## +# Class & Special Method Name Snippets # +######################################## + +snippet class "class with docstrings" b +class ${1:MyClass}(${2:object}): + """${3:Docstring for $1 }""" + + def __init__(self$4): + """${5:@todo: to be defined}`!p +snip.rv = "" +snip >> 2 + +args = get_args(t[4]) + +write_docstring_args(args, snip) +if args: + snip.rv += '\n' + snip.mkline('', indent='') + snip += '"""' + +write_init_body(args, t[2], snip) +` + $0 +endsnippet + + +snippet slotclass "class with slots and docstrings" b +class ${1:MyClass}(${2:object}): + """${3:Docstring for $1 }""" +`!p +snip >> 1 +args = get_args(t[4]) +write_slots_args(args, snip) +` + + def __init__(self$4): + """${5:@todo: to be defined}`!p +snip.rv = "" +snip >> 2 + +args = get_args(t[4]) + +write_docstring_args(args, snip) +if args: + snip.rv += '\n' + snip.mkline('', indent='') + snip += '"""' + +write_init_body(args, t[2], snip) +` + $0 +endsnippet + + +snippet contain "methods for emulating a container type" b +def __len__(self): + ${1:pass} + +def __getitem__(self, key): + ${2:pass} + +def __setitem__(self, key, value): + ${3:pass} + +def __delitem__(self, key): + ${4:pass} + +def __iter__(self): + ${5:pass} + +def __reversed__(self): + ${6:pass} + +def __contains__(self, item): + ${7:pass} +endsnippet + + +snippet context "context manager methods" b +def __enter__(self): + ${1:pass} + +def __exit__(self, exc_type, exc_value, traceback): + ${2:pass} +endsnippet + + +snippet attr "methods for customizing attribute access" b +def __getattr__(self, name): + ${1:pass} + +def __setattr__(self, name, value): + ${2:pass} + +def __delattr__(self, name): + ${3:pass} +endsnippet + + +snippet desc "methods implementing descriptors" b +def __get__(self, instance, owner): + ${1:pass} + +def __set__(self, instance, value): + ${2:pass} + +def __delete__(self, instance): + ${3:pass} +endsnippet + + +snippet cmp "methods implementing rich comparison" +def __eq__(self, other): + ${1:pass} + +def __ne__(self, other): + ${2:pass} + +def __lt__(self, other): + ${3:pass} + +def __le__(self, other): + ${4:pass} + +def __gt__(self, other): + ${5:pass} + +def __ge__(self, other): + ${6:pass} + +def __cmp__(self, other): + ${7:pass} +endsnippet + + +snippet repr "methods implementing string representation" +def __repr__(self): + ${1:pass} + +def __str__(self): + ${2:pass} + +def __unicode__(self): + ${3:pass} +endsnippet + + +# note: reflected operands and augmented arithmeitc assignements have been +# intentionally ommited to reduce verbosity. +snippet numeric "methods for emulating a numeric type" b +def __add__(self, other): + ${1:pass} + +def __sub__(self, other): + ${2:pass} + +def __mul__(self, other): + ${3:pass} + +def __div__(self, other): + ${4:pass} + +def __truediv__(self, other): + ${5:pass} + +def __floordiv__(self, other): + ${6:pass} + + +def __mod__(self, other): + ${7:pass} + +def __divmod__(self, other): + ${8:pass} + +def __pow__(self, other): + ${9:pass} + + +def __lshift__(self, other): + ${10:pass} + +def __rshift__(self, other): + ${11:pass} + +def __and__(self, other): + ${12:pass} + +def __xor__(self, other): + ${13:pass} + +def __or__(self, other): + ${14:pass} + + +def __neg__(self): + ${15:pass} + +def __pos__(self): + ${16:pass} + +def __abs__(self): + ${17:pass} + +def __invert__(self): + ${18:pass} + + +def __complex__(self): + ${19:pass} + +def __int__(self): + ${20:pass} + +def __long__(self): + ${21:pass} + +def __float__(self): + ${22:pass} + + +def __oct__(self): + ${22:pass} + +def __hex__(self): + ${23:pass} + + +def __index__(self): + ${24:pass} + +def __coerce__(self, other): + ${25:pass} +endsnippet + +snippet def "function with docstrings" b +def ${1:function}(`!p +if snip.indent: + snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}): + """${4:@todo: Docstring for $1}`!p +snip.rv = "" +snip >> 1 + +args = get_args(t[2]) +if args: + write_docstring_args(args, snip) + +style = get_style(snip) +snip += format_return(style) +snip.rv += '\n' + snip.mkline('', indent='') +snip += '"""' ` + ${0:pass} +endsnippet + + +# doesn't expand when there is a word in front +snippet /(^|(?<=\W))\./ "self." r +self. +endsnippet + +snippet from "from module import name" b +from ${1:module} import ${2:Stuff} +endsnippet + + +############## +# PROPERTIES # +############## +snippet roprop "Read Only Property" b +@property +def ${1:property}(self): + ${2:return self._$1}$0 +endsnippet + +snippet rwprop "Read write property" b +def ${1:property}(): + ${2/.+/(?0:""")/}${2:The RW property $1}${2/.+/(?0:"""\n )/}def fget(self): + return self._$1$0 + def fset(self, value): + self._$1 = value + return locals() +$1 = property(**$1()) +endsnippet + + +########################## +# Try / Except / Finally # +########################## +snippet try "Try / Except" b +try: + ${1:pass} +except ${2:Exception}, ${3:e}: + ${4:raise $3} +endsnippet + +snippet try "Try / Except / Else" b +try: + ${1:pass} +except ${2:Exception}, ${3:e}: + ${4:raise $3} +else: + ${5:pass} +endsnippet + +snippet try "Try / Except / Finally" b +try: + ${1:pass} +except ${2:Exception}, ${3:e}: + ${4:raise $3} +finally: + ${5:pass} +endsnippet + +snippet try "Try / Except / Else / Finally" b +try: + ${1:pass} +except${2: ${3:Exception}, ${4:e}}: + ${5:raise} +else: + ${6:pass} +finally: + ${7:pass} +endsnippet + + +##################### +# Assertions & Tests # +##################### + +snippet pdb "Set PDB breakpoint" b +import pdb; pdb.set_trace() +endsnippet + +snippet ae "Assert equal" b +self.assertEqual(${1:first},${2:second}) +endsnippet + +snippet at "Assert True" b +self.assertTrue(${0:exp}) +endsnippet + +snippet af "Assert False" b +self.assertFalse(${1:expression}) +endsnippet + +snippet aae "Assert almost equal" b +self.assertAlmostEqual(${1:first},${2:second}) +endsnippet + +snippet ar "Assert raises" b +self.assertRaises(${1:exception}, ${2:func}${3/.+/, /}${3:arguments}) +endsnippet + + +snippet testcase "pyunit testcase" b +class Test${1:Class}(${2:unittest.TestCase}): + """${3:Test case docstring}""" + + def setUp(self): + ${4:pass} + + def tearDown(self): + ${5:pass} + + def test_${6:name}(self): + ${7:pass} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/rails.snippets b/vim/ultisnips-dist/rails.snippets new file mode 100644 index 0000000..9e0e29f --- /dev/null +++ b/vim/ultisnips-dist/rails.snippets @@ -0,0 +1,906 @@ +########################################################################### +# GENERATED FROM get_tm_snippets.py # +########################################################################### + +snippet anaf "accepts_nested_attributes_for" +accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc \{ |obj| ${5:obj.blank?} \}}} + +endsnippet + +snippet tcbi "Create binary column" +t.binary :${1:title}${2:, :limit => ${3:2}.megabytes} +$0 +endsnippet + +snippet tcb "Create boolean column" +t.boolean :${1:title} +$0 +endsnippet + +snippet cla "Create controller class" +class ${1:Model}Controller < ApplicationController + before_filter :find_${2:model} + + $0 + + private + def find_${2} + @$2 = ${3:$1}.find(params[:id]) if params[:id] + end +end +endsnippet + +snippet tcda "Create date column" +t.date :${1:title} +$0 +endsnippet + +snippet tcdt "Create datetime column" +t.datetime :${1:title} +$0 +endsnippet + +snippet tcd "Create decimal column" +t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}} +$0 +endsnippet + +snippet tcf "Create float column" +t.float :${1:title} +$0 +endsnippet + +snippet cla "Create functional test class" +require 'test_helper' + +class ${1:Model}ControllerTest < ActionController::TestCase + test$0 +end + +endsnippet + +snippet tci "Create integer column" +t.integer :${1:title} +$0 +endsnippet + +snippet tcl "Create lock_version column" +t.integer :lock_version, :null => false, :default => 0 +$0 +endsnippet + +# FIXME: handling literal bracket pair inside of nested tab groups? +snippet tcr "Create references column" +t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}} +$0 +endsnippet + +snippet resources "Create resources controller class" +class ${1:Model}sController < ApplicationController + before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy] + + # GET /${1/./\l$0/}s + # GET /${1/./\l$0/}s.xml + def index + @${1/./\l$0/}s = ${1:Model}.all + + respond_to do |wants| + wants.html # index.html.erb + wants.xml { render :xml => @${1/./\l$0/}s } + end + end + + # GET /${1/./\l$0/}s/1 + # GET /${1/./\l$0/}s/1.xml + def show + respond_to do |wants| + wants.html # show.html.erb + wants.xml { render :xml => @${1/./\l$0/} } + end + end + + # GET /${1/./\l$0/}s/new + # GET /${1/./\l$0/}s/new.xml + def new + @${1/./\l$0/} = ${1:Model}.new + + respond_to do |wants| + wants.html # new.html.erb + wants.xml { render :xml => @${1/./\l$0/} } + end + end + + # GET /${1/./\l$0/}s/1/edit + def edit + end + + # POST /${1/./\l$0/}s + # POST /${1/./\l$0/}s.xml + def create + @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}]) + + respond_to do |wants| + if @${1/./\l$0/}.save + flash[:notice] = '${1:Model} was successfully created.' + wants.html { redirect_to(@${1/./\l$0/}) } + wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} } + else + wants.html { render :action => "new" } + wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } + end + end + end + + # PUT /${1/./\l$0/}s/1 + # PUT /${1/./\l$0/}s/1.xml + def update + respond_to do |wants| + if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}]) + flash[:notice] = '${1:Model} was successfully updated.' + wants.html { redirect_to(@${1/./\l$0/}) } + wants.xml { head :ok } + else + wants.html { render :action => "edit" } + wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } + end + end + end + + # DELETE /${1/./\l$0/}s/1 + # DELETE /${1/./\l$0/}s/1.xml + def destroy + @${1/./\l$0/}.destroy + + respond_to do |wants| + wants.html { redirect_to(${1/./\l$0/}s_url) } + wants.xml { head :ok } + end + end + + private + def find_${1/./\l$0/} + @${1/./\l$0/} = ${1:Model}.find(params[:id]) + end + +end + +endsnippet + +snippet tcs "Create string column" +t.string :${1:title} +$0 +endsnippet + +snippet tct "Create text column" +t.text :${1:title} +$0 +endsnippet + +snippet tcti "Create time column" +t.time :${1:title} +$0 +endsnippet + +snippet tcts "Create timestamp column" +t.timestamp :${1:title} +$0 +endsnippet + +snippet tctss "Create timestamps columns" +t.timestamps +$0 +endsnippet + +snippet mcol "Migration Create Column (mcc)" +t.column ${1:title}, :${2:string} +$0 +endsnippet + +snippet mccc "Migration Create Column Continue (mccc)" +t.column ${1:title}, :${2:string} +mccc$0 +endsnippet + +snippet mtab "Migration Drop Create Table (mdct)" +drop_table :${1:table}${2: [press tab twice to generate create_table]} +endsnippet + +snippet mcol "Migration Remove and Add Column (mrac)" +remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]} +endsnippet + +snippet rdb "RAILS_DEFAULT_LOGGER.debug (rdb)" +RAILS_DEFAULT_LOGGER.debug "${1:message}"$0 +endsnippet + +snippet tre "Table column(s) rename" +t.rename(:${1:old_column_name}, :${2:new_column_name}) +$0 +endsnippet + +snippet art "Test Assert Redirected To (art)" +assert_redirected_to ${2::action => "${1:index}"} +endsnippet + +snippet asre "Test Assert Response (are)" +assert_response :${1:success}, @response.body$0 +endsnippet + +snippet aftc "after_create" +after_create +endsnippet + +snippet aftd "after_destroy" +after_destroy +endsnippet + +snippet afts "after_save" +after_save +endsnippet + +snippet aftu "after_update" +after_update +endsnippet + +snippet aftv "after_validation" +after_validation +endsnippet + +snippet aftvoc "after_validation_on_create" +after_validation_on_create +endsnippet + +snippet aftvou "after_validation_on_update" +after_validation_on_update +endsnippet + +snippet asg "assert(var = assigns(:var))" +assert(${1:var} = assigns(:${1}), "Cannot find @${1}") +$0 +endsnippet + +snippet asd "assert_difference" +assert_difference "${1:Model}.${2:count}", ${3:1} do + $0 +end +endsnippet + +snippet asnd "assert_no_difference" +assert_no_difference "${1:Model}.${2:count}" do + $0 +end +endsnippet + +snippet artnpp "assert_redirected_to (nested path plural)" +assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})} +endsnippet + +snippet artnp "assert_redirected_to (nested path)" +assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})} +endsnippet + +snippet artpp "assert_redirected_to (path plural)" +assert_redirected_to ${10:${2:model}s_path} +endsnippet + +snippet artp "assert_redirected_to (path)" +assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})} +endsnippet + +snippet asrj "assert_rjs" +assert_rjs :${1:replace}, ${2:"${3:dom id}"} +endsnippet + +snippet ass "assert_select" +assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do + $0 +end} +endsnippet + +snippet befc "before_create" +before_create +endsnippet + +snippet befd "before_destroy" +before_destroy +endsnippet + +snippet befs "before_save" +before_save +endsnippet + +snippet befu "before_update" +before_update +endsnippet + +snippet befv "before_validation" +before_validation +endsnippet + +snippet befvoc "before_validation_on_create" +before_validation_on_create +endsnippet + +snippet befvou "before_validation_on_update" +before_validation_on_update +endsnippet + +snippet bt "belongs_to (bt)" +belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} +endsnippet + +snippet crw "cattr_accessor" +cattr_accessor :${0:attr_names} +endsnippet + +snippet defcreate "def create - resource" +def create + @${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1]) + $0 + respond_to do |wants| + if @$1.save + flash[:notice] = '$2 was successfully created.' + wants.html { redirect_to(@$1) } + wants.xml { render :xml => @$1, :status => :created, :location => @$1 } + else + wants.html { render :action => "new" } + wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } + end + end +end + +endsnippet + +snippet test "test do..end" +test "${1:something interesting}" do + $0 +end +endsnippet + +snippet deftg "def get request" +def test_should_get_${1:action} + ${2:@${3:model} = ${4:$3s}(:${5:fixture_name}) + }get :${1}${6:, :id => @$3.to_param} + assert_response :success + $0 +end +endsnippet + +snippet deftp "def post request" +def test_should_post_${1:action} + ${3:@$2 = ${4:$2s}(:${5:fixture_name}) + }post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 } + assert_response :redirect + +end +endsnippet + +snippet fina "find(:all)" +find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) +endsnippet + +snippet finf "find(:first)" +find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) +endsnippet + +snippet fini "find(id)" +find(${1:id}) +endsnippet + +snippet fine "find_each" +find_each(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}| + $0 +end +endsnippet + +snippet finb "find_in_batches" +find_in_batches(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}s| + $4s.each do |$4| + $0 + end +end +endsnippet + +snippet habtm "has_and_belongs_to_many (habtm)" +has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"} +endsnippet + +snippet hm "has_many (hm)" +has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"} +endsnippet + +snippet hmt "has_many (through)" +has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}} +endsnippet + +snippet hmd "has_many :dependent => :destroy" +has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0 +endsnippet + +snippet ho "has_one (ho)" +has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} +endsnippet + +snippet logd "logger.debug" +${1:Rails.}logger.debug { "${1:message}" }$0 +endsnippet + +snippet loge "logger.error" +logger.error { "${1:message}" }$0 +endsnippet + +snippet logf "logger.fatal" +logger.fatal { "${1:message}" }$0 +endsnippet + +snippet logi "logger.info" +logger.info { "${1:message}" }$0 +endsnippet + +snippet logw "logger.warn" +logger.warn { "${1:message}" }$0 +endsnippet + +snippet mp "map(&:sym_proc)" +map(&:${1:id}) +endsnippet + +snippet mapca "map.catch_all" +${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}" + +endsnippet + +snippet map "map.named_route" +${1:map}.${2:connect} '${3::controller/:action/:id}' +endsnippet + +snippet mapr "map.resource" +${1:map}.resource :${2:resource}${10: do |${11:$2}| + $0 +end} +endsnippet + +snippet maprs "map.resources" +${1:map}.resources :${2:resource}${10: do |${11:$2}| + $0 +end} +endsnippet + +snippet mapwo "map.with_options" +${1:map}.with_options :${2:controller} => '${3:thing}' do |${4:$3}| + $0 +end + +endsnippet + +snippet mrw "mattr_accessor" +mattr_accessor :${0:attr_names} +endsnippet + +snippet ncl "named_scope lambda" +named_scope :name, lambda { |${1:param}| { :conditions => ${3:['${4:${5:field} = ?}', ${6:$1}]} } } + +endsnippet + +snippet nc "named_scope" +named_scope :name${1:, :joins => :${2:table}}, :conditions => ${3:['${4:${5:field} = ?}', ${6:true}]} + +endsnippet + +snippet dscope "default_scope" +default_scope ${1:order(${2:'${3:created_at DESC}'})} +endsnippet + +snippet flash "flash[...]" +flash[:${1:notice}] = "${2:Successfully created...}"$0 +endsnippet + +snippet rea "redirect_to (action)" +redirect_to :action => "${1:index}" +endsnippet + +snippet reai "redirect_to (action, id)" +redirect_to :action => "${1:show}", :id => ${0:@item} +endsnippet + +snippet rec "redirect_to (controller)" +redirect_to :controller => "${1:items}" +endsnippet + +snippet reca "redirect_to (controller, action)" +redirect_to :controller => "${1:items}", :action => "${2:list}" +endsnippet + +snippet recai "redirect_to (controller, action, id)" +redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@item} +endsnippet + +snippet renpp "redirect_to (nested path plural)" +redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})}) +endsnippet + +snippet renp "redirect_to (nested path)" +redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}) +endsnippet + +snippet repp "redirect_to (path plural)" +redirect_to(${2:${10:model}s_path}) +endsnippet + +snippet rep "redirect_to (path)" +redirect_to(${2:${12:model}_path(${13:@}${14:${12}})}) +endsnippet + +snippet reb "redirect_to :back" +redirect_to :back +endsnippet + +snippet ra "render (action)... (ra)" +render :action => "${1:action}" +endsnippet + +snippet ral "render (action,layout) (ral)" +render :action => "${1:action}", :layout => "${2:layoutname}" +endsnippet + +snippet rf "render (file) (rf)" +render :file => "${1:filepath}" +endsnippet + +snippet rfu "render (file,use_full_path) (rfu)" +render :file => "${1:filepath}", :use_full_path => ${2:false} +endsnippet + +snippet ri "render (inline) (ri)" +render :inline => "${1:<%= 'hello' %>}" +endsnippet + +snippet ril "render (inline,locals) (ril)" +render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"$4 } +endsnippet + +snippet rit "render (inline,type) (rit)" +render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml} +endsnippet + +snippet rl "render (layout) (rl)" +render :layout => "${1:layoutname}" +endsnippet + +snippet rn "render (nothing) (rn)" +render :nothing => ${1:true} +endsnippet + +snippet rns "render (nothing,status) (rns)" +render :nothing => ${1:true}, :status => ${2:401} +endsnippet + +snippet rt "render (text) (rt)" +render :text => "${1:text to render...}" +endsnippet + +snippet rtl "render (text,layout) (rtl)" +render :text => "${1:text to render...}", :layout => "${2:layoutname}" +endsnippet + +snippet rtlt "render (text,layout => true) (rtlt)" +render :text => "${1:text to render...}", :layout => ${2:true} +endsnippet + +snippet rts "render (text,status) (rts)" +render :text => "${1:text to render...}", :status => ${2:401} +endsnippet + +snippet ru "render (update)" +render :update do |${2:page}| + $2.$0 +end +endsnippet + +snippet rest "respond_to" +respond_to do |wants| + wants.${1:html}${2: { $0 \}} +end +endsnippet + +snippet resw "respond_with" +respond_with(${1:@${2:model}})${3: do |format| + format.${4:html} { $0 \} +end} +endsnippet + +# FIXME +snippet returning "returning do |variable| ... end" +returning ${1:variable} do${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${2:v}${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/} + $0 +end +endsnippet + +snippet t. "t.binary (tcbi)" +t.binary :${1:title}${2:, :limit => ${3:2}.megabytes} +t.$0 +endsnippet + +snippet t. "t.boolean (tcb)" +t.boolean :${1:title} +t.$0 +endsnippet + +snippet t. "t.date (tcda)" +t.date :${1:title} +t.$0 +endsnippet + +snippet t. "t.datetime (tcdt)" +t.datetime :${1:title} +t.$0 +endsnippet + +snippet t. "t.decimal (tcd)" +t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}} +t.$0 +endsnippet + +snippet t. "t.float (tcf)" +t.float :${1:title} +t.$0 +endsnippet + +snippet t. "t.integer (tci)" +t.integer :${1:title} +t.$0 +endsnippet + +snippet t. "t.lock_version (tcl)" +t.integer :lock_version, :null => false, :default => 0 +t.$0 +endsnippet + +snippet t. "t.references (tcr)" +t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}} +t.$0 +endsnippet + +snippet t. "t.rename (tre)" +t.rename(:${1:old_column_name}, :${2:new_column_name}) +t.$0 +endsnippet + +snippet t. "t.string (tcs)" +t.string :${1:title} +t.$0 +endsnippet + +snippet t. "t.text (tct)" +t.text :${1:title} +t.$0 +endsnippet + +snippet t. "t.time (tcti)" +t.time :${1:title} +t.$0 +endsnippet + +snippet t. "t.timestamp (tcts)" +t.timestamp :${1:title} +t.$0 +endsnippet + +snippet t. "t.timestamps (tctss)" +t.timestamps +t.$0 +endsnippet + +snippet vaoif "validates_acceptance_of if" +validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }} +endsnippet + +snippet vao "validates_acceptance_of" +validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}} +endsnippet + +snippet va "validates_associated (va)" +validates_associated :${1:attribute}${2:, :on => :${3:create}} +endsnippet + +snippet vaif "validates_associated if (vaif)" +validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }} +endsnippet + +snippet vc "validates_confirmation_of (vc)" +validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"} +endsnippet + +snippet vcif "validates_confirmation_of if (vcif)" +validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }} +endsnippet + +snippet ve "validates_exclusion_of (ve)" +validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"} +endsnippet + +snippet veif "validates_exclusion_of if (veif)" +validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }} +endsnippet + +snippet vfif "validates_format_of if" +validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }} +endsnippet + +snippet vf "validates_format_of" +validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"} +endsnippet + +snippet viif "validates_inclusion_of if" +validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }} +endsnippet + +snippet vi "validates_inclusion_of" +validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"} +endsnippet + +snippet vl "validates_length_of (vl)" +validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"} +endsnippet + +snippet vlif "validates_length_of if" +validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }} +endsnippet + +snippet vnif "validates_numericality_of if" +validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }} +endsnippet + +snippet vn "validates_numericality_of" +validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"} +endsnippet + +snippet vp "validates_presence_of (vp)" +validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"} +endsnippet + +snippet vpif "validates_presence_of if (vpif) 2" +validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }} +endsnippet + +snippet vu "validates_uniqueness_of (vu)" +validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"} +endsnippet + +snippet vuif "validates_uniqueness_of if (vuif)" +validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }} +endsnippet + +snippet verify "verify -- render" +verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"} + +endsnippet + +snippet verify "verify -- redirect" +verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'} + +endsnippet + +snippet wants "wants_format" +wants.${1:js|xml|html}${2: { $0 \}} +endsnippet + +snippet xdelete "xhr delete" +xhr :delete, :${1:destroy}, :id => ${2:1}$0 +endsnippet + +snippet xget "xhr get" +xhr :get, :${1:show}${2:, :id => ${3:1}}$0 +endsnippet + +snippet xpost "xhr post" +xhr :post, :${1:create}, :${2:object} => { $3 } +endsnippet + +snippet xput "xhr put" +xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0 +endsnippet + +snippet finl "find(:last)" +find(:last${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]}) +endsnippet + +snippet sweeper "Create sweeper class" +class ${1:Model}Sweeper < ActionController::Caching::Sweeper + observe ${1:Model} + + def after_save(${1/./\l$0/}) + expire_cache(${1/./\l$0/}) + end + + def after_destroy(${1/./\l$0/}) + expire_cache(${1/./\l$0/}) + end + + private + + def expire_cache(${1/./\l$0/}) + ${0:expire_page ${1/./\l$0/}s_path + expire_page ${1/./\l$0/}_path(${1/./\l$0/})} + end + +end +endsnippet + +snippet col "collection routes" +collection do + ${1:get :${2:action}} + ${3:put :${4:action}} + ${5:post :${6:action}} + ${7:delete :${8:action}} +end +endsnippet + +snippet format "format (respond_with)" +format.${1:html|xml|json|js|any} { $0 } +endsnippet + +snippet gem "gem" +gem '${1:name}'${2:${3:, "${4:1.0}"}${5:${6:, :require => ${7:"${8:$1}"}}${9:, :group => :${10:test}}}} +endsnippet + +snippet gemg "gem :git" +gem '${1:paperclip}', :git => "${2:git://github.com/thoughtbot/paperclip.git}"${3:, :branch => "${4:rails3}"} +endsnippet + +snippet match "match" +match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: => '${9:$2}#${10:$4}'${11:, :as => :${12:$10}}} +endsnippet + +snippet member "member routes" +member do + ${1:get :${2:action}} + ${3:put :${4:action}} + ${5:post :${6:action}} + ${7:delete :${8:action}} +end +endsnippet + +snippet res "resources" +resources :${1:posts}${2: do + $3 +end} +endsnippet + +snippet scope "scope" +scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}}) +endsnippet + +snippet scopel "scope lambda" +scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} => ${6:"${7:value}"}})} } +endsnippet + +snippet scopee "scope with extension" +scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do + def ${7:method_name} + $0 + end +end +endsnippet + +snippet sb "scoped_by" +scoped_by_${1:attribute}(${2:id}) +endsnippet + +snippet setup "setup do..end" +setup do + $0 +end +endsnippet + +snippet trans "Translation snippet" +I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0} +endsnippet + +snippet route_spec +it 'routes to #${1:action}' do + ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6} +end +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/rst.snippets b/vim/ultisnips-dist/rst.snippets new file mode 100644 index 0000000..7174510 --- /dev/null +++ b/vim/ultisnips-dist/rst.snippets @@ -0,0 +1,61 @@ + + +########################################################################### +# General Stuff # +########################################################################### +snippet part "Part" b +`!p snip.rv = len(t[1])*'#'` +${1:Part name} +`!p snip.rv = len(t[1])*'#'` + +$0 +endsnippet + +snippet sec "Section" b +${1:Section name} +`!p snip.rv = len(t[1])*'='` + +$0 +endsnippet + +snippet ssec "Subsection" b +${1:Section name} +`!p snip.rv = len(t[1])*'-'` + +$0 +endsnippet + +snippet sssec "Subsubsection" b +${1:Section name} +`!p snip.rv = len(t[1])*'^'` + +$0 +endsnippet + +snippet chap "Chapter" b +`!p snip.rv = len(t[1])*'*'` +${1:Chapter name} +`!p snip.rv = len(t[1])*'*'` + +$0 +endsnippet + +snippet para "Paragraph" b +${1:Paragraph name} +`!p snip.rv = len(t[1])*'"'` + +$0 +endsnippet + +########################################################################### +# More Specialized Stuff. # +########################################################################### +snippet cb "Code Block" b +.. code-block:: ${1:lua} + + ${2:code} + +$0 +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/ruby.snippets b/vim/ultisnips-dist/ruby.snippets new file mode 100644 index 0000000..6336589 --- /dev/null +++ b/vim/ultisnips-dist/ruby.snippets @@ -0,0 +1,568 @@ +snippet "^#!" "#!/usr/bin/env ruby" r +#!/usr/bin/env ruby +$0 +endsnippet + + +snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r +# encoding: UTF-8 +$0 +endsnippet + + + +snippet If "<command> if <expression>" +${1:command} if ${0:expression} +endsnippet + + + +snippet Unless "<command> unless <expression>" +${1:command} unless ${0:expression} +endsnippet + + + +snippet if "if <condition> ... end" +if ${1:condition} + ${2:# TODO} +end +endsnippet + + + +snippet ife "if <condition> ... else ... end" +if ${1:condition} + ${2:# TODO} +else + ${3:# TODO} +end +endsnippet + + + +snippet ifee "if <condition> ... elseif <condition> ... else ... end" +if ${1:condition} + ${2:# TODO} +elsif ${3:condition} + ${4:# TODO} +else + ${0:# TODO} +end +endsnippet + + + +snippet unless "unless <condition> ... end" +unless ${1:condition} + ${0:# TODO} +end +endsnippet + + + +snippet unlesse "unless <condition> ... else ... end" +unless ${1:condition} + ${2:# TODO} +else + ${0:# TODO} +end +endsnippet + + + +snippet unlesee "unless <condition> ... elseif <condition> ... else ... end" +unless ${1:condition} + ${2:# TODO} +elsif ${3:condition} + ${4:# TODO} +else + ${0:# TODO} +end +endsnippet + + + +snippet "\b(de)?f" "def <name>..." r +def ${1:function_name}${2: ${3:*args}} + ${0:# TODO} +end +endsnippet + + + +snippet defi "def initialize ..." +def initialize${1: ${2:*args}} + ${0:# TODO} +end +endsnippet + + + +snippet defr "def <name> ... rescue ..." +def ${1:function_name}${2: ${3:*args}} + ${4:# TODO} +rescue + ${0:# TODO} +end +endsnippet + + + +snippet For "(<from>..<to>).each { |<i>| <block> }" +(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} } +endsnippet + + + +snippet for "(<from>..<to>).each do |<i>| <block> end" +(${1:from}..${2:to}).each do |${3:i}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Merge!" ".merge!(<other_hash>) { |<key>,<oldval>,<newval>| <block> }" r +`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) { |${2:key},${3:oldval},${4:newval}| ${5:block} } +endsnippet + + + +snippet "(\S+)\.merge!" ".merge!(<other_hash>) do |<key>,<oldval>,<newval>| <block> end" r +`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) do |${2:key},${3:oldval},${4:newval}| + ${0:block} +end +endsnippet + + + +snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |<key>,<value>| <block> }" r +`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3:# TODO} } +endsnippet + + + +snippet "(\S+)\.del(ete)?_?if" ".delete_if do |<key>,<value>| <block> end" r +`!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Keep_?if" ".keep_if { |<key>,<value>| <block> }" r +`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3:# TODO} } +endsnippet + + + +snippet "(\S+)\.keep_?if" ".keep_if do <key>,<value>| <block> end" r +`!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Reject" ".reject { |<key>,<value>| <block> }" r +`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3:# TODO} } +endsnippet + + + +snippet "(\S+)\.reject" ".reject do <key>,<value>| <block> end" r +`!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Select" ".select { |<item>| <block>}" r +`!p snip.rv=match.group(1)`.select { |${1:item}| ${2:block} } +endsnippet + + + +snippet "(\S+)\.select" ".select do |<item>| <block> end" r +`!p snip.rv=match.group(1)`.select do |${1:item}| + ${0:block} +end +endsnippet + + + +snippet "(\S+)\.Sort" ".sort { |<a>,<b>| <block> }" r +`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3:# TODO} } +endsnippet + + + +snippet "(\S+)\.sort" ".sort do |<a>,<b>| <block> end" r +`!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Each_?k(ey)?" ".each_key { |<key>| <block> }" r +`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2:# TODO} } +endsnippet + + + +snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| <block> end" r +`!p snip.rv=match.group(1)`.each_key do |${1:key}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Each_?val(ue)?" ".each_value { |<value>| <block> }" r +`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2:# TODO} } +endsnippet + + + +snippet "(\S+)\.each_?val(ue)?" ".each_value do |<value>| <block> end" r +`!p snip.rv=match.group(1)`.each_value do |${1:value}| + ${0:# TODO} +end +endsnippet + + + +snippet Each "<elements>.each { |<element>| <block> }" +${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} } +endsnippet + + + +snippet each "<elements>.each do |<element>| <block> end" +${1:elements}.each do |${2:${1/s$//}}| + ${0:# TODO} +end +endsnippet + + + +snippet each_?s(lice)? "<array>.each_slice(n) do |slice| <block> end" +each_slice(${1:2}) do |${2:slice}| + ${0:# TODO} +end +endsnippet + + + +snippet Each_?s(lice)? "<array>.each_slice(n) { |slice| <block> }" +each_slice(${1:2}) { |${2:slice}| ${3:# TODO} } +endsnippet + + + + +snippet "(\S+)\.Map" ".map { |<element>| <block> }" r +`!p snip.rv=match.group(1)`.map { |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| ${2:# TODO} } +endsnippet + + + +snippet "(\S+)\.map" ".map do |<element>| <block> end" r +`!p snip.rv=match.group(1)`.map do |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Rev(erse)?_?each" ".reverse_each { |<element>| <block> }" r +`!p snip.rv=match.group(1)`.reverse_each { |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| ${2:# TODO} } +endsnippet + + + +snippet "(\S+)\.rev(erse)?_?each" ".reverse_each do |<element>| <block> end" r +`!p snip.rv=match.group(1)`.reverse_each do |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.Each" ".each { |<element>| <block> }" r +`!p snip.rv=match.group(1)`.each { |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| ${2:# TODO} } +endsnippet + + + +snippet "(\S+)\.each" ".each do |<element>| <block> end" r +`!p snip.rv=match.group(1)`.each do |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`}| + ${0:# TODO} +end +endsnippet + + + + +snippet "(\S+)\.Each_w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r +`!p snip.rv=match.group(1)`.each_with_index { |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`},${2:i}| ${3:# TODO} }$0 +endsnippet + + + +snippet "(\S+)\.each_?w(ith)?_?i(ndex)?" ".each_with_index do |<element>,<i>| <block> end" r +`!p snip.rv=match.group(1)`.each_with_index do |${1:`!p +element_name = match.group(1).lstrip('$@') +ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) +try: + wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1)) + snip.rv = wmatch.group(1).lower() +except: + snip.rv = 'element' +`},${2:i}| + ${0:# TODO} +end +endsnippet + + + + +snippet "(\S+)\.Each_?p(air)?" ".each_pair { |<key>,<value>| <block> }" r +`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3:# TODO} } +endsnippet + + + +snippet "(\S+)\.each_?p(air)?" ".each_pair do |<key>,<value>| <block> end" r +`!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}| + ${0:# TODO} +end +endsnippet + + + +snippet "(\S+)\.sub" ".sub(<expression>) { <block> }" r +`!p snip.rv=match.group(1)`.sub(${1:expression}) { ${2:"replace_with"} } +endsnippet + + + +snippet "(\S+)\.gsub" ".gsub(<expression>) { <block> }" r +`!p snip.rv=match.group(1)`.gsub(${1:expression}) { ${2:"replace_with"} } +endsnippet + + + +snippet "(\S+)\.index" ".index { |item| <block> }" r +`!p snip.rv=match.group(1)`.index { |${1:item}| ${2:block} } +endsnippet + + + +snippet "(\S+)\.Index" ".index do |item| ... end" r +`!p snip.rv=match.group(1)`.index do |${1:item}| + ${0:block} +end +endsnippet + + + +snippet do "do |<key>| ... end" i +do ${1:|${2:key}|} + $0 +end +endsnippet + + + +snippet Do "do ... end" i +do + $0 +end +endsnippet + + +snippet until "until <expression> ... end" +until ${1:expression} + ${0:# TODO} +end +endsnippet + + + +snippet Until "begin ... end until <expression>" +begin + ${0:# TODO} +end until ${1:expression} +endsnippet + + + +snippet while "while <expression> ... end" +while ${1:expression} + ${0:# TODO} +end +endsnippet + + + +snippet While "begin ... end while <expression>" +begin + ${0:# TODO} +end while ${1:expression} +endsnippet + + + +snippet "\b(r|attr)" "attr_reader :<attr_names>" r +attr_reader :${0:attr_names} +endsnippet + + + +snippet "\b(w|attr)" "attr_writer :<attr_names>" r +attr_writer :${0:attr_names} +endsnippet + + + +snippet "\b(rw|attr)" "attr_accessor :<attr_names>" r +attr_accessor :${0:attr_names} +endsnippet + + + +snippet begin "begin ... rescue ... end" +begin + ${1:# TODO} +rescue + ${0:# TODO} +end +endsnippet + + + +snippet begin "begin ... rescue ... else ... ensure ... end" +begin + ${1:# Raise exception} +rescue Exception => e + puts e.message + puts e.backtrace.inspect + ${2:# Rescue} +else + ${3:# other exception} +ensure + ${0:# always excute} +end +endsnippet + + + +snippet rescue +rescue Exception => e + puts e.message + puts e.backtrace.inspect + ${0:# Rescue} +endsnippet + + + +snippet "\b(case|sw(itch)?)" "case <variable> when <expression> ... end" r +case ${1:variable} +when ${2:expression} +$0 +end +endsnippet + + + +snippet alias "alias :<new_name> :<old_name>" +alias :${1:new_name} :${2:old_name} +endsnippet + + + +snippet class "class <class_name> def initialize ... end end" +class ${1:class_name} + def initialize ${2:*args} + $0 + end +end +endsnippet + + + +snippet module "module" +module ${1:module_name} + $0 +end +endsnippet + + + +snippet ### +=begin + $0 +=end +endsnippet + +# vim: set ts=2 sw=2 expandtab: diff --git a/vim/ultisnips-dist/sh.snippets b/vim/ultisnips-dist/sh.snippets new file mode 100644 index 0000000..1085d86 --- /dev/null +++ b/vim/ultisnips-dist/sh.snippets @@ -0,0 +1,71 @@ + +########################################################################### +# TextMate Snippets # +########################################################################### +snippet #! +#!/bin/sh + +endsnippet + +snippet !env "#!/usr/bin/env (!env)" +#!/usr/bin/env bash + +endsnippet + +snippet temp "Tempfile" +${1:TMPFILE}="$(mktemp -t ${2:`!p +snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled" +`})" +${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}} + +endsnippet + +snippet case "case .. esac (case)" +case ${1:word} in + ${2:pattern} ) + $0;; +esac +endsnippet + +snippet elif "elif .. (elif)" +elif ${2:[[ ${1:condition} ]]}; then + ${0:#statements} +endsnippet + +snippet for "for ... done (for)" +for (( i = 0; i < ${1:10}; i++ )); do + ${0:#statements} +done +endsnippet + +snippet forin "for ... in ... done (forin)" +for ${1:i}${2/.+/ in /}${2:words}; do + ${0:#statements} +done +endsnippet + +snippet here "here document (here)" +<<-${2:'${1:TOKEN}'} + $0 +${1/['"`](.+)['"`]/$1/} +endsnippet + +snippet if "if ... then (if)" +if ${2:[[ ${1:condition} ]]}; then + ${0:#statements} +fi +endsnippet + +snippet until "until ... (done)" +until ${2:[[ ${1:condition} ]]}; do + ${0:#statements} +done +endsnippet + +snippet while "while ... (done)" +while ${2:[[ ${1:condition} ]]}; do + ${0:#statements} +done +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/snippets.snippets b/vim/ultisnips-dist/snippets.snippets new file mode 100644 index 0000000..414f350 --- /dev/null +++ b/vim/ultisnips-dist/snippets.snippets @@ -0,0 +1,23 @@ +######################### +# SNIPPETS for SNIPPETS # +######################### + +# We use a little hack so that the snippet is expanded +# and parsed correctly +snippet snip "Snippet definition" ! +`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:!b} +$0 +`!p snip.rv = "endsnippet"` +endsnippet + +snippet global "Global snippet" ! +`!p snip.rv = "global"` !p +$0 +`!p snip.rv = "endglobal"` +endsnippet + +snippet vis "${VISUAL}" i +\$\{VISUAL${1:${2:default}${3:/transform/}}\} +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/tcl.snippets b/vim/ultisnips-dist/tcl.snippets new file mode 100644 index 0000000..2cb1f34 --- /dev/null +++ b/vim/ultisnips-dist/tcl.snippets @@ -0,0 +1,50 @@ +########################################################################### +# TEXTMATE SNIPPETS # +########################################################################### +snippet for "for... (for)" b +for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} { + ${4} +} + +endsnippet + +snippet foreach "foreach... (foreach)" +foreach ${1:var} ${2:\$list} { + ${3} +} + +endsnippet + +snippet if "if... (if)" b +if {${1:condition}} { + ${2} +} + +endsnippet + +snippet proc "proc... (proc)" b +proc ${1:name} {${2:args}} \ +{ + ${3} +} + +endsnippet + +snippet switch "switch... (switch)" b +switch ${1:-exact} -- ${2:\$var} { + ${3:match} { + ${4} + } + default {${5}} +} + +endsnippet + +snippet while "while... (while)" b +while {${1:condition}} { + ${2} +} + +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/tex.snippets b/vim/ultisnips-dist/tex.snippets new file mode 100644 index 0000000..d6e62fc --- /dev/null +++ b/vim/ultisnips-dist/tex.snippets @@ -0,0 +1,125 @@ +extends texmath + +########################################################################### +# LATEX SNIPPETS # +########################################################################### + +snippet r "\ref{}" w +\ref{$1} +endsnippet + +########################################################################### +# TEXTMATE SNIPPETS # +########################################################################### + +################# +# GENERAL STUFF # +################# +snippet "b(egin)?" "begin{} / end{}" br +\begin{${1:something}} + ${0:${VISUAL}} +\end{$1} +endsnippet + +#################### +# TABULARS, ARRAYS # +#################### + +snippet tab +\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}} +$0${2/((?<=.)c|l|r)|./(?1: & )/g} +\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}} +endsnippet + +######################## +# ENUM, DESCR, ITEMIZE # +######################## +snippet enum "Enumerate" b +\begin{enumerate} + \item $0 +\end{enumerate} +endsnippet + +snippet item "Itemize" b +\begin{itemize} + \item $0 +\end{itemize} +endsnippet + +snippet desc "Description" b +\begin{description} + \item[$1] $0 +\end{description} +endsnippet + +##################################### +# SECTIONS, CHAPTERS AND THERE LIKE # +##################################### + +snippet part "Part" b +\part{${1:part name}} +\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/g}}} + +${0} + +% part $2 (end) +endsnippet + +snippet cha "Chapter" b +\chapter{${1:chapter name}} +\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% chapter $2 (end) +endsnippet + +snippet sec "Section" b +\section{${1:section name}} +\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% section $2 (end) +endsnippet + + +snippet sub "Subsection" b +\subsection{${1:subsection name}} +\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% subsection $2 (end) +endsnippet + +snippet ssub "Subsubsection" b +\subsubsection{${1:subsubsection name}} +\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% subsubsection $2 (end) + +endsnippet + +snippet par "Paragraph" b +\paragraph{${1:paragraph name}} +\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% paragraph $2 (end) +endsnippet + + +snippet subp "Subparagraph" b +\subparagraph{${1:subparagraph name}} +\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} + +${0} + +% subparagraph $2 (end) +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/texmath.snippets b/vim/ultisnips-dist/texmath.snippets new file mode 100644 index 0000000..03589f0 --- /dev/null +++ b/vim/ultisnips-dist/texmath.snippets @@ -0,0 +1,54 @@ +############## +# MATH STUFF # +############## +snippet eq "Equation" b +\begin{equation} + $0 +\end{equation} +endsnippet + +snippet eqnn "Equation without number" b +\begin{equation*} + $0 +\end{equation*} +endsnippet + +snippet eqa "Equation array" b +\begin{eqnarray} + $1 & $2 & $0 +\end{eqnarray} +endsnippet + +snippet eqann "Equation array without numbers" b +\begin{eqnarray*} + $1 & $2 & $0 +\end{eqnarray*} + +endsnippet +snippet frac "Fraction" w +\frac{${1:${VISUAL:nom}}}{${2:denom}} +endsnippet + +snippet mat "Smart Matrix" +\begin{${1:p/b/v/V/B/small}matrix} + $0 +\end{$1matrix} +endsnippet + +snippet lr( "left( right)" w +\left( ${1:${VISUAL}} \right) +endsnippet + +snippet lr| "left| right|" w +\left| ${1:${VISUAL}} \right| +endsnippet + +snippet lr{ "left\{ right\}" w +\left\\{ ${1:${VISUAL}} \right\\} +endsnippet + +snippet lr[ "left[ right]" w +\left[ ${1:${VISUAL}} \right] +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/vim.snippets b/vim/ultisnips-dist/vim.snippets new file mode 100644 index 0000000..f4c37f0 --- /dev/null +++ b/vim/ultisnips-dist/vim.snippets @@ -0,0 +1,58 @@ +########################################################################### +# SnipMate Snippets # +########################################################################### +snippet header +" File: ${1:`!v expand('%:t')`} +" Author: ${2:`!v g:snips_author`} +" Description: ${3} +${4:" Last Modified: `!v strftime("%B %d, %Y")`} + +$0 +endsnippet + +snippet gvar "Global / configuration variable" +if !exists("g:${1:MyUltraImportantVar}") + let g:$1 = ${2:"${3:<tab>}"} +endif +endsnippet + +snippet guard +if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700} + finish +endif +let $1 = 1${3} +endsnippet + +snippet f +fun ${1:function_name}(${2}) + ${3:" code} +endf +endsnippet + +snippet for +for ${1:needle} in ${2:haystack} + ${3:" code} +endfor +endsnippet + +snippet wh +while ${1:condition} + ${2:" code} +endw +endsnippet + +snippet if +if ${1:condition} + ${2:" code} +endif +endsnippet + +snippet ife +if ${1:condition} + ${2} +else + ${3} +endif +endsnippet + +# vim:ft=snippets: diff --git a/vim/ultisnips-dist/xhtml.snippets b/vim/ultisnips-dist/xhtml.snippets new file mode 100644 index 0000000..cc31dbc --- /dev/null +++ b/vim/ultisnips-dist/xhtml.snippets @@ -0,0 +1 @@ +extends html diff --git a/vimrc b/vimrc index 77fb464..03e0a26 100644 --- a/vimrc +++ b/vimrc @@ -1,199 +1,199 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" -let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] +let g:UltiSnipsSnippetDirectories=["nblock-snippets", "ultisnips-dist"] "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' "gnupg.vim let g:GPGUsePipes = 1 " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
f665210140ed8facf4e4f8267abe97bbef247852
add tar.xz support
diff --git a/zshrc b/zshrc index c67d99d..3426abd 100644 --- a/zshrc +++ b/zshrc @@ -1,225 +1,225 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt PROMPT_SUBST # Enables additional prompt extentions unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward #edit current line in vim autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; - *.tar.xz tar -Jxf "$1" ;; + *.tar.xz) tar -Jxf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
3eb1cdca78d6389c743d00974141e3f88a17d168
fix a bug in awesome config and add tar.xz support
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 6db1f3e..cc26bf8 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -1,460 +1,460 @@ -- {{{ License -- rc.lua, works with awesome 3.4.9 (Arch Linux) -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library require("awful") require("awful.autofocus") require("awful.rules") -- Theme handling library require("beautiful") -- Notification library require("naughty") -require("vicious") +vicious = require("vicious") -- }}} -- {{{ Variable definitions local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell -- Themes define colours, icons, and wallpapers beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. layouts = { awful.layout.suit.tile, --1 awful.layout.suit.tile.left, --2 awful.layout.suit.tile.bottom, --3 awful.layout.suit.tile.top, --4 awful.layout.suit.fair, --5 awful.layout.suit.fair.horizontal, --6 awful.layout.suit.spiral, --7 awful.layout.suit.spiral.dwindle, --8 awful.layout.suit.max, --9 awful.layout.suit.max.fullscreen, --10 awful.layout.suit.magnifier, --11 awful.layout.suit.floating --12 } -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[3], layouts[1], layouts[1], -- Tags: 1, 2, 3 layouts[1], layouts[1], layouts[1], -- 4, 5 ,6 layouts[1], layouts[1], layouts[1] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), menu = mymainmenu }) -- }}} -- {{{ Wibox -- {{{ Widgets configuration -- {{{ Reusable separators local spacer = widget({ type = "textbox", name = "spacer" }) local separator = widget({ type = "textbox", name = "separator" }) spacer.text = " " separator.text = " <span foreground='red'>•</span> " -- }}} -- {{{ CPU load local cpuwidget = widget({ type = "textbox" }) vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") -- }}} -- {{{ CPU temperature local thermalwidget = widget({ type = "textbox" }) vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") -- }}} -- {{{ Battery state -- Widget icon -- baticon = widget({ type = "imagebox", name = "baticon" }) -- baticon.image = image(beautiful.widget_bat) local batwidget = widget({ type = "textbox" }) vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") -- }}} -- {{{ Date and time local datewidget = widget({ type = "textbox" }) vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 5) -- }}} -- {{{ Volume widget local volwidget = widget({ type = "textbox" }) vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') -- }}} -- {{{ cmus widget cmus = widget({ type = "textbox", name = "cmus" }) cmus.text = "<span foreground='orange'>music: </span><span foreground='green'>-</span>" -- }}} -- {{{ System tray systray = widget({ type = "systray" }) -- }}} -- }}} -- {{{ Wibox initialisation local wibox = {} local promptbox = {} local layoutbox = {} local taglist = {} taglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev)) local tasklist = {} tasklist.buttons = awful.util.table.join( awful.button({ }, 1, function(c) if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end client.focus = c c:raise() end), awful.button({ }, 3, function() if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width = 250 }) end end), awful.button({ }, 4, function() awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function() awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end) ) for s = 1, screen.count() do -- Create a promptbox promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) -- Create a layoutbox layoutbox[s] = awful.widget.layoutbox(s) layoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end) )) -- Create a taglist widget taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, taglist.buttons) -- Create a tasklist widget tasklist[s] = awful.widget.tasklist( function(c) return awful.widget.tasklist.label.currenttags(c, s) end, tasklist.buttons ) -- Create the wibox wibox[s] = awful.wibox({ position = "top", screen = s, fg = beautiful.fg_normal, bg = beautiful.bg_normal, height=beautiful.widget_height }) -- Add widgets to the wibox wibox[s].widgets = {{ launcher, taglist[s], layoutbox[s], promptbox[s], layout = awful.widget.layout.horizontal.leftright }, s == screen.count() and systray or nil, spacer, datewidget, separator, volwidget, separator, batwidget, separator, cpuwidget, separator, thermalwidget, separator, cmus, separator, tasklist[s], layout = awful.widget.layout.horizontal.rightleft } end -- }}} -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- awful.key({}, "XF86MyComputer", function() sexec(commands.fileman) end ), -- awful.key({}, "XF86Mail", function() sexec(commands.mail) end ), -- awful.key({}, "XF86HomePage", function() sexec(commands.browser) end ), -- awful.key({}, "XF86Sleep", function() sexec(commands.lock) end ), -- awful.key({"Control", "Mod1"}, "l", function() sexec(commands.lock) end ), --default bindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () exec(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), -- Prompt awful.key({ modkey }, "r", function () promptbox[mouse.screen]:run() end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, promptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e /bin/zsh -c " .. prog) end) end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), awful.key({ modkey, }, "j", function (c) c.minimized = not c.minimized end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)); end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = true, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags --downloading stuff { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.add_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:add_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end end) client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai diff --git a/zshrc b/zshrc index 859aa3c..c67d99d 100644 --- a/zshrc +++ b/zshrc @@ -1,224 +1,225 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt PROMPT_SUBST # Enables additional prompt extentions unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward #edit current line in vim autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; + *.tar.xz tar -Jxf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
39a63b769ad50b2e20ee085b4ff60a233a20d386
remove config alias
diff --git a/zshrc b/zshrc index b4fcaa2..859aa3c 100644 --- a/zshrc +++ b/zshrc @@ -1,225 +1,224 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt PROMPT_SUBST # Enables additional prompt extentions unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' -alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward #edit current line in vim autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
6432e1a2a63697962430a4ad981b646b9df3309f
refactor to new directory
diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 72e8ffc..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/.vim/after/syntax/tex.vim b/.vim/after/syntax/tex.vim deleted file mode 100644 index 70ff7eb..0000000 --- a/.vim/after/syntax/tex.vim +++ /dev/null @@ -1 +0,0 @@ -:setlocal isk+=:,- diff --git a/.Xdefaults b/Xdefaults similarity index 100% rename from .Xdefaults rename to Xdefaults diff --git a/.Xmodmap b/Xmodmap similarity index 100% rename from .Xmodmap rename to Xmodmap diff --git a/.Xresources b/Xresources similarity index 100% rename from .Xresources rename to Xresources diff --git a/bin/backup-android b/bin/backup-android new file mode 100755 index 0000000..2b7bb37 --- /dev/null +++ b/bin/backup-android @@ -0,0 +1,50 @@ +#!/bin/zsh +#a simple script to backup android phones +MARKER="backup-android.marker" +BASE="/media" +DST="$HOME/backup/android" +RSYNC="/usr/bin/rsync" + +#copy titanium backup +function backup_titanium { + DST_TITANIUM="$DST/titanium-backup" + if [[ ! -d $DST_TITANIUM ]];then mkdir $DST_TITANIUM;fi + $RSYNC -av "$SRC/TitaniumBackup/" "$DST_TITANIUM/`date +'%Y-%m-%d'`" +} + +#copy clockworkmod-backup +function backup_clockworkmod { + $RSYNC -av "$SRC/clockworkmod/backup/" "$DST/clockworkmod-backup" +} + +#do the work +#search $BASE for marker +foreach item in `ls $BASE`;do + if [ -e $BASE/$item/$MARKER ];then SRC="$BASE/$item";fi +done +if [[ ${SRC} == "" ]]; then + echo "could not find a valid android device under $BASE. Make sure it is mounted." + return -1 +fi + +#get the owner of the device +OWNER=`cat "$SRC/$MARKER"` + +case "$OWNER" in +"flo" | "tina") + DST="$DST/$OWNER" + backup_titanium + backup_clockworkmod + ;; +"flo") + #mv osmtracker in osm-folder + cd "$SRC/osmtracker" + ls | grep -P "^[0-9]{4}-[0-9]{2}-[0-9]{2}" | xargs -I '{}' mv '{}' $HOME/osm/'{}' + + #copy passwords to device + $RSYNC -av "$HOME/passwords.kdb" "$SRC/keepassx/" + ;; +*) + echo "no owner found in $SRC/$MARKER" + ;; +esac diff --git a/bin/instapaper.py b/bin/instapaper.py new file mode 100755 index 0000000..bfa8f76 --- /dev/null +++ b/bin/instapaper.py @@ -0,0 +1,62 @@ +#!/usr/bin/python2 +# encoding: utf-8 +""" + instapaper.com cli client +""" + +import re +import sys +import os +import instapaperlib +from optparse import OptionParser +from getpass import getpass + +def main(): + """ + main method + """ + # initialize parser + usage = "usage: %prog [-u USER] [-p PASSWORD] [-t TITLE] [-s selection] url" + parser = OptionParser(usage, version="%prog "+instapaperlib.__version__) + parser.add_option("-u", "--user", action="store", dest="user", + metavar="USER", help="instapaper username") + parser.add_option("-p", "--password", action="store", dest="password", + metavar="USER", help="instapaper password") + parser.add_option("-t", "--title", action="store", dest="title", + metavar="TITLE", help="title of the link to add") + parser.add_option("-s", "--selection", action="store", dest="selection", + metavar="SELECTION", help="short text for description") + + (options, args) = parser.parse_args() + + if not len(args) > 0: + parser.error("What do you want to read later?") + + if not options.user: + # auth regex + login = re.compile("(.+?):(.+)") + try: + config = open(os.path.expanduser("~") + "/.instapaperrc") + for line in config: + matches = login.match(line) + if matches: + user = matches.group(1).strip() + password = matches.group(2).strip() + except IOError: + parser.error("No login information present.") + sys.exit(-1) + else: + user = options.user + # make sure all parameters are present + if not options.password: + password = getpass() + else: + password = options.password + + (status, text) = instapaperlib.add_item(user, password, args[0], + options.title, options.selection) + if status != 201: + print text + +if __name__ == "__main__": + main() diff --git a/bin/vboxbuild b/bin/vboxbuild new file mode 100755 index 0000000..dab3214 --- /dev/null +++ b/bin/vboxbuild @@ -0,0 +1,6 @@ +#!/bin/bash +ARCH=$(uname -m) +KERNEL=$(uname -r) +VBOX=$(pacman -Q virtualbox |cut -d ' ' -f2 |sed 's/.\{2\}$//') +sudo dkms install vboxhost/$VBOX -k $KERNEL/$ARCH +sudo modprobe vboxdrv diff --git a/.cmus/autosave b/cmus/autosave similarity index 100% rename from .cmus/autosave rename to cmus/autosave diff --git a/.cmus/notizblock.theme b/cmus/notizblock.theme similarity index 100% rename from .cmus/notizblock.theme rename to cmus/notizblock.theme diff --git a/.config/awesome/icons/LICENSE b/config/awesome/icons/LICENSE similarity index 100% rename from .config/awesome/icons/LICENSE rename to config/awesome/icons/LICENSE diff --git a/.config/awesome/icons/layouts/dwindle.png b/config/awesome/icons/layouts/dwindle.png similarity index 100% rename from .config/awesome/icons/layouts/dwindle.png rename to config/awesome/icons/layouts/dwindle.png diff --git a/.config/awesome/icons/layouts/fairh.png b/config/awesome/icons/layouts/fairh.png similarity index 100% rename from .config/awesome/icons/layouts/fairh.png rename to config/awesome/icons/layouts/fairh.png diff --git a/.config/awesome/icons/layouts/fairv.png b/config/awesome/icons/layouts/fairv.png similarity index 100% rename from .config/awesome/icons/layouts/fairv.png rename to config/awesome/icons/layouts/fairv.png diff --git a/.config/awesome/icons/layouts/floating.png b/config/awesome/icons/layouts/floating.png similarity index 100% rename from .config/awesome/icons/layouts/floating.png rename to config/awesome/icons/layouts/floating.png diff --git a/.config/awesome/icons/layouts/fullscreen.png b/config/awesome/icons/layouts/fullscreen.png similarity index 100% rename from .config/awesome/icons/layouts/fullscreen.png rename to config/awesome/icons/layouts/fullscreen.png diff --git a/.config/awesome/icons/layouts/magnifier.png b/config/awesome/icons/layouts/magnifier.png similarity index 100% rename from .config/awesome/icons/layouts/magnifier.png rename to config/awesome/icons/layouts/magnifier.png diff --git a/.config/awesome/icons/layouts/max.png b/config/awesome/icons/layouts/max.png similarity index 100% rename from .config/awesome/icons/layouts/max.png rename to config/awesome/icons/layouts/max.png diff --git a/.config/awesome/icons/layouts/spiral.png b/config/awesome/icons/layouts/spiral.png similarity index 100% rename from .config/awesome/icons/layouts/spiral.png rename to config/awesome/icons/layouts/spiral.png diff --git a/.config/awesome/icons/layouts/tile.png b/config/awesome/icons/layouts/tile.png similarity index 100% rename from .config/awesome/icons/layouts/tile.png rename to config/awesome/icons/layouts/tile.png diff --git a/.config/awesome/icons/layouts/tilebottom.png b/config/awesome/icons/layouts/tilebottom.png similarity index 100% rename from .config/awesome/icons/layouts/tilebottom.png rename to config/awesome/icons/layouts/tilebottom.png diff --git a/.config/awesome/icons/layouts/tileleft.png b/config/awesome/icons/layouts/tileleft.png similarity index 100% rename from .config/awesome/icons/layouts/tileleft.png rename to config/awesome/icons/layouts/tileleft.png diff --git a/.config/awesome/icons/layouts/tiletop.png b/config/awesome/icons/layouts/tiletop.png similarity index 100% rename from .config/awesome/icons/layouts/tiletop.png rename to config/awesome/icons/layouts/tiletop.png diff --git a/.config/awesome/icons/taglist/squarefz.png b/config/awesome/icons/taglist/squarefz.png similarity index 100% rename from .config/awesome/icons/taglist/squarefz.png rename to config/awesome/icons/taglist/squarefz.png diff --git a/.config/awesome/icons/taglist/squarez.png b/config/awesome/icons/taglist/squarez.png similarity index 100% rename from .config/awesome/icons/taglist/squarez.png rename to config/awesome/icons/taglist/squarez.png diff --git a/.config/awesome/icons/titlebar/close_focus.png b/config/awesome/icons/titlebar/close_focus.png similarity index 100% rename from .config/awesome/icons/titlebar/close_focus.png rename to config/awesome/icons/titlebar/close_focus.png diff --git a/.config/awesome/icons/titlebar/close_normal.png b/config/awesome/icons/titlebar/close_normal.png similarity index 100% rename from .config/awesome/icons/titlebar/close_normal.png rename to config/awesome/icons/titlebar/close_normal.png diff --git a/.config/awesome/icons/titlebar/floating_focus_active.png b/config/awesome/icons/titlebar/floating_focus_active.png similarity index 100% rename from .config/awesome/icons/titlebar/floating_focus_active.png rename to config/awesome/icons/titlebar/floating_focus_active.png diff --git a/.config/awesome/icons/titlebar/floating_focus_inactive.png b/config/awesome/icons/titlebar/floating_focus_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/floating_focus_inactive.png rename to config/awesome/icons/titlebar/floating_focus_inactive.png diff --git a/.config/awesome/icons/titlebar/floating_normal_active.png b/config/awesome/icons/titlebar/floating_normal_active.png similarity index 100% rename from .config/awesome/icons/titlebar/floating_normal_active.png rename to config/awesome/icons/titlebar/floating_normal_active.png diff --git a/.config/awesome/icons/titlebar/floating_normal_inactive.png b/config/awesome/icons/titlebar/floating_normal_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/floating_normal_inactive.png rename to config/awesome/icons/titlebar/floating_normal_inactive.png diff --git a/.config/awesome/icons/titlebar/maximized_focus_active.png b/config/awesome/icons/titlebar/maximized_focus_active.png similarity index 100% rename from .config/awesome/icons/titlebar/maximized_focus_active.png rename to config/awesome/icons/titlebar/maximized_focus_active.png diff --git a/.config/awesome/icons/titlebar/maximized_focus_inactive.png b/config/awesome/icons/titlebar/maximized_focus_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/maximized_focus_inactive.png rename to config/awesome/icons/titlebar/maximized_focus_inactive.png diff --git a/.config/awesome/icons/titlebar/maximized_normal_active.png b/config/awesome/icons/titlebar/maximized_normal_active.png similarity index 100% rename from .config/awesome/icons/titlebar/maximized_normal_active.png rename to config/awesome/icons/titlebar/maximized_normal_active.png diff --git a/.config/awesome/icons/titlebar/maximized_normal_inactive.png b/config/awesome/icons/titlebar/maximized_normal_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/maximized_normal_inactive.png rename to config/awesome/icons/titlebar/maximized_normal_inactive.png diff --git a/.config/awesome/icons/titlebar/ontop_focus_active.png b/config/awesome/icons/titlebar/ontop_focus_active.png similarity index 100% rename from .config/awesome/icons/titlebar/ontop_focus_active.png rename to config/awesome/icons/titlebar/ontop_focus_active.png diff --git a/.config/awesome/icons/titlebar/ontop_focus_inactive.png b/config/awesome/icons/titlebar/ontop_focus_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/ontop_focus_inactive.png rename to config/awesome/icons/titlebar/ontop_focus_inactive.png diff --git a/.config/awesome/icons/titlebar/ontop_normal_active.png b/config/awesome/icons/titlebar/ontop_normal_active.png similarity index 100% rename from .config/awesome/icons/titlebar/ontop_normal_active.png rename to config/awesome/icons/titlebar/ontop_normal_active.png diff --git a/.config/awesome/icons/titlebar/ontop_normal_inactive.png b/config/awesome/icons/titlebar/ontop_normal_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/ontop_normal_inactive.png rename to config/awesome/icons/titlebar/ontop_normal_inactive.png diff --git a/.config/awesome/icons/titlebar/sticky_focus_active.png b/config/awesome/icons/titlebar/sticky_focus_active.png similarity index 100% rename from .config/awesome/icons/titlebar/sticky_focus_active.png rename to config/awesome/icons/titlebar/sticky_focus_active.png diff --git a/.config/awesome/icons/titlebar/sticky_focus_inactive.png b/config/awesome/icons/titlebar/sticky_focus_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/sticky_focus_inactive.png rename to config/awesome/icons/titlebar/sticky_focus_inactive.png diff --git a/.config/awesome/icons/titlebar/sticky_normal_active.png b/config/awesome/icons/titlebar/sticky_normal_active.png similarity index 100% rename from .config/awesome/icons/titlebar/sticky_normal_active.png rename to config/awesome/icons/titlebar/sticky_normal_active.png diff --git a/.config/awesome/icons/titlebar/sticky_normal_inactive.png b/config/awesome/icons/titlebar/sticky_normal_inactive.png similarity index 100% rename from .config/awesome/icons/titlebar/sticky_normal_inactive.png rename to config/awesome/icons/titlebar/sticky_normal_inactive.png diff --git a/.config/awesome/rc.lua b/config/awesome/rc.lua similarity index 100% rename from .config/awesome/rc.lua rename to config/awesome/rc.lua diff --git a/config/awesome/zenburn.lua b/config/awesome/zenburn.lua new file mode 100644 index 0000000..057fce1 --- /dev/null +++ b/config/awesome/zenburn.lua @@ -0,0 +1,144 @@ +------------------------------- +-- "Zenburn" awesome theme -- +-- By Adrian C. (anrxc) -- +------------------------------- + +-- Alternative icon sets and widget icons: +-- * http://awesome.naquadah.org/wiki/Nice_Icons + +-- {{{ Main +theme = {} +theme.confdir = awful.util.getdir("config") +theme.wallpaper_cmd = { "awsetbg /home/flo/bilder/wallpaper/1440x900/arch_wall-by_kpolicano-1440x900.jpg" } +-- }}} + +-- {{{ Styles +theme.font = "sans 8" + +-- {{{ Colors +theme.fg_normal = "#DCDCCC" +theme.fg_focus = "#00FF00" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#3F3F3F" +theme.bg_focus = "#1E2320" +theme.bg_urgent = "#3F3F3F" +-- }}} + +-- {{{ Borders +theme.border_width = "1" +theme.border_normal = "#3F3F3F" +theme.border_focus = "#FF0000" +theme.border_marked = "#CC9393" +-- }}} + +-- {{{ Titlebars +theme.titlebar_bg_focus = "#3F3F3F" +theme.titlebar_bg_normal = "#3F3F3F" +theme.titlebar_widget_height = "16" +-- }}} + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- Example: +--theme.taglist_bg_focus = "#CC9393" +-- }}} + +-- {{{ Widgets +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.fg_widget = "#AECF96" +--theme.fg_center_widget = "#88A175" +--theme.fg_end_widget = "#FF5656" +--theme.bg_widget = "#494B4F" +--theme.border_widget = "#3F3F3F" +-- }}} + +-- {{{ Mouse finder +theme.mouse_finder_color = "#CC9393" +-- mouse_finder_[timeout|animate_timeout|radius|factor] +-- }}} + +-- {{{ Menu +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_height = "16" +theme.menu_width = "100" +-- }}} + +-- {{{ Icons +-- {{{ Taglist +theme.taglist_squares_sel = "/usr/share/awesome/themes/zenburn/taglist/squarefz.png" +theme.taglist_squares_unsel = "/usr/share/awesome/themes/zenburn/taglist/squarez.png" +--theme.taglist_squares_resize = "false" +-- }}} + +-- {{{ Misc +theme.awesome_icon = "/usr/share/awesome/themes/zenburn/awesome-icon.png" +theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" +theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" +-- }}} + +-- {{{ Layout icons +theme.layout_tile = theme.confdir .. "/icons/layouts/tile.png" +theme.layout_tileleft = theme.confdir .. "/icons/layouts/tileleft.png" +theme.layout_tilebottom = theme.confdir .. "/icons/layouts/tilebottom.png" +theme.layout_tiletop = theme.confdir .. "/icons/layouts/tiletop.png" +theme.layout_fairv = theme.confdir .. "/icons/layouts/fairv.png" +theme.layout_fairh = theme.confdir .. "/icons/layouts/fairh.png" +theme.layout_spiral = theme.confdir .. "/icons/layouts/spiral.png" +theme.layout_dwindle = theme.confdir .. "/icons/layouts/dwindle.png" +theme.layout_max = theme.confdir .. "/icons/layouts/max.png" +theme.layout_fullscreen = theme.confdir .. "/icons/layouts/fullscreen.png" +theme.layout_magnifier = theme.confdir .. "/icons/layouts/magnifier.png" +theme.layout_floating = theme.confdir .. "/icons/layouts/floating.png" +-- }}} + +-- {{{ Widget icons +theme.widget_cpu = theme.confdir .. "/icons/taskbar/cpu.png" +theme.widget_bat = theme.confdir .. "/icons/taskbar/bat.png" +theme.widget_mem = theme.confdir .. "/icons/taskbar/mem.png" +theme.widget_fs = theme.confdir .. "/icons/taskbar/disk.png" +theme.widget_net = theme.confdir .. "/icons/taskbar/down.png" +theme.widget_netup = theme.confdir .. "/icons/taskbar/up.png" +theme.widget_wifi = theme.confdir .. "/icons/taskbar/wifi.png" +theme.widget_mail = theme.confdir .. "/icons/taskbar/mail.png" +theme.widget_vol = theme.confdir .. "/icons/taskbar/vol.png" +theme.widget_org = theme.confdir .. "/icons/taskbar/cal.png" +theme.widget_date = theme.confdir .. "/icons/taskbar/time.png" +theme.widget_crypto = theme.confdir .. "/icons/taskbar/crypto.png" +theme.widget_sep = theme.confdir .. "/icons/taskbar/separator.png" +-- }}} + +-- {{{ Titlebar icons +theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png" +theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png" + +theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png" + +theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png" + +theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png" + +theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png" +-- }}} +-- }}} + +return theme diff --git a/.config/dircolors/dircolors.256dark b/config/dircolors/dircolors.256dark similarity index 100% rename from .config/dircolors/dircolors.256dark rename to config/dircolors/dircolors.256dark diff --git a/.config/newsbeuter/config b/config/newsbeuter/config similarity index 100% rename from .config/newsbeuter/config rename to config/newsbeuter/config diff --git a/.ctags b/ctags similarity index 100% rename from .ctags rename to ctags diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..7b682a4 --- /dev/null +++ b/install.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e +#set -x + +#link files +for item in `find $PWD -maxdepth 1 -mindepth 1 -type f \( ! -iname "install.sh" ! -iname "README.markdown" \) -printf "%P\n"`;do + ln -snf "$PWD/$item" "$HOME/.$item" +done + +#process .config +for item in `find "$PWD/config" -maxdepth 1 -mindepth 1 -printf "%P\n"`;do + ln -snf "$PWD/config/$item" "$HOME/.config/$item" +done + +#solarized-task +ln -snf "$PWD/solarized-task" "$HOME/.solarized-task" + +#bin +ln -snf "$PWD/bin" "$HOME/bin" + +#cmus +ln -snf "$PWD/cmus" "$HOME/.cmus" + +#change login shell to zsh +if ! grep -q "^$USER:.*zsh$" /etc/passwd; then + echo "Changing login shell for $USER to zsh ..." + chsh -s `which zsh` +fi diff --git a/.pentadactylrc b/pentadactylrc similarity index 100% rename from .pentadactylrc rename to pentadactylrc diff --git a/.rtorrent.rc b/rtorrent.rc similarity index 100% rename from .rtorrent.rc rename to rtorrent.rc diff --git a/.solarized-task/solarized-dark-256.theme b/solarized-task/solarized-dark-256.theme similarity index 100% rename from .solarized-task/solarized-dark-256.theme rename to solarized-task/solarized-dark-256.theme diff --git a/.solarized-task/solarized-light-256.theme b/solarized-task/solarized-light-256.theme similarity index 100% rename from .solarized-task/solarized-light-256.theme rename to solarized-task/solarized-light-256.theme diff --git a/.taskrc b/taskrc similarity index 100% rename from .taskrc rename to taskrc diff --git a/.tmux.conf b/tmux.conf similarity index 100% rename from .tmux.conf rename to tmux.conf diff --git a/.vimrc b/vimrc similarity index 100% rename from .vimrc rename to vimrc diff --git a/.xinitrc b/xinitrc similarity index 100% rename from .xinitrc rename to xinitrc diff --git a/.zprofile b/zprofile similarity index 100% rename from .zprofile rename to zprofile diff --git a/.zshrc b/zshrc similarity index 100% rename from .zshrc rename to zshrc
nblock/config
5455eebddf805d90d097c7b6d425b65f5462c959
add tmux.conf
diff --git a/.cmus/autosave b/.cmus/autosave index 156c4a8..c55c325 100644 --- a/.cmus/autosave +++ b/.cmus/autosave @@ -1,142 +1,142 @@ -set aaa_mode=artist +set aaa_mode=album set altformat_current= %F set altformat_playlist= %f%= %d set altformat_title=%f set altformat_trackwin= %f%= %d set auto_reshuffle=false set buffer_seconds=10 set color_cmdline_bg=default set color_cmdline_fg=default set color_error=lightred set color_info=lightyellow set color_separator=green set color_statusline_bg=240 set color_statusline_fg=white set color_titleline_bg=240 set color_titleline_fg=white set color_win_bg=default set color_win_cur=gray set color_win_cur_sel_bg=166 set color_win_cur_sel_fg=237 set color_win_dir=blue set color_win_fg=yellow set color_win_inactive_cur_sel_bg=252 set color_win_inactive_cur_sel_fg=lightyellow set color_win_inactive_sel_bg=252 set color_win_inactive_sel_fg=black set color_win_sel_bg=237 set color_win_sel_fg=166 set color_win_title_bg=252 set color_win_title_fg=black set confirm_run=true set continue=true set display_artist_sort_name=false set dsp.alsa.device=default set dsp.ao.buffer_size=16384 set dsp.ao.driver= set dsp.ao.wav_counter=1 set dsp.ao.wav_dir=/home/flo set dsp.oss.device= set format_current= %a - [%02n] %t - %l [%y] %= %F set format_playlist= %-20a %02n. %t%= %y %d set format_playlist_va= %-20A %3n. %t (%a)%= %y %d set format_title=%a - %l - %t (%y) set format_trackwin= %02n. %t%= %y %d set format_trackwin_va=%3n. %t (%a)%= %y %d set id3_default_charset=ISO-8859-1 set lib_sort=artist album discnumber tracknumber title filename set mixer.alsa.channel=PCM set mixer.alsa.device=default set mixer.oss.channel=PCM set mixer.oss.device= set mixer.pulse.restore_volume=1 set output_plugin=alsa set passwd= set pl_sort= set play_library=true set play_sorted=true set repeat=true set repeat_current=false set replaygain=disabled set replaygain_limit=true set replaygain_preamp=6.000000 set resume=true set set_term_title=false set show_hidden=false set show_remaining_time=true set shuffle=true set smart_artist_sort=true set softvol=false set softvol_state=100 100 set status_display_program=/home/flo/development/cmus-notify/cmus-notify bind browser backspace browser-up bind browser i toggle show_hidden bind common + vol +10% bind common , seek -1m bind common - vol -10% bind common . seek +1m bind common 1 view tree bind common 2 view sorted bind common 3 view playlist bind common 4 view queue bind common 5 view browser bind common 6 view filters bind common 7 view settings bind common = vol +10% bind common C toggle continue bind common D win-remove bind common E win-add-Q bind common G win-bottom bind common I echo {} bind common L push live-filter bind common M toggle play_library bind common N search-prev bind common P win-mv-before bind common [ vol +1 +0 bind common ] vol +0 +1 bind common ^B win-page-up bind common ^C echo Type :quit<enter> to exit cmus. bind common ^F win-page-down bind common ^L refresh bind common a win-add-l bind common b player-next bind common c player-pause bind common delete win-remove bind common down win-down bind common e win-add-q bind common end win-bottom bind common enter win-activate bind common g win-top bind common h seek -5 bind common home win-top bind common i win-sel-cur bind common j win-down bind common k win-up bind common l seek +5 bind common left seek -5 bind common m toggle aaa_mode bind common n search-next bind common o toggle play_sorted bind common p win-mv-after bind common page_down win-page-down bind common page_up win-page-up bind common r toggle repeat bind common right seek +5 bind common s toggle shuffle bind common space win-toggle bind common t toggle show_remaining_time bind common tab win-next bind common u win-update bind common up win-up bind common v player-stop bind common x player-play bind common y win-add-p bind common z player-prev bind common { vol -1 -0 bind common } vol -0 -1 fset 90s=date>=1990&date<2000 fset missing-tag=!~T fset mp3=filename="*.mp3" fset ogg=filename="*.ogg" fset ogg-or-mp3=ogg|mp3 factivate diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..8b3a4e6 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,11 @@ + +setw -g mode-keys vi +set-window-option -g mode-mouse on + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'" + diff --git a/.vimrc b/.vimrc index 8af772f..77fb464 100644 --- a/.vimrc +++ b/.vimrc @@ -1,196 +1,199 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'fs111/pydoc.vim' Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'scrooloose/syntastic' Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " UltiSnip let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsListSnippets="<leader><tab>" let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] "syntastic let g:syntastic_error_symbol='E' let g:syntastic_style_error_symbol='e' let g:syntastic_warning_symbol='W' let g:syntastic_style_warning_symbol='w' " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' +"gnupg.vim +let g:GPGUsePipes = 1 + " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized diff --git a/.zshrc b/.zshrc index 0c99816..b4fcaa2 100644 --- a/.zshrc +++ b/.zshrc @@ -1,219 +1,225 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing -setopt prompt_subst # Enables additional prompt extentions +setopt PROMPT_SUBST # Enables additional prompt extentions +unsetopt NOMATCH # print no error on no matches stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME' alias t='task' alias ta='task add' alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward +#edit current line in vim +autoload -U edit-command-line +zle -N edit-command-line +bindkey -M vicmd v edit-command-line + # tmux ? bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` - IPV4=`curl -s ipv4.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` + IPV4=`curl -s ifconfig.me/ip` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then - echo "IPv4: -" + echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
d497d050a2c32cd8ed67818f7e5d5e72026f7535
enable ck-launch-session and dbus-launch to get nm-applet working
diff --git a/.xinitrc b/.xinitrc index fc396b1..9dc988c 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,8 +1,8 @@ #!/bin/sh eval "$(gpg-agent --daemon --enable-ssh-support)" urxvtd -q -f -o -ck-launch-session nm-applet & xrdb -load ~/.Xresources xmodmap .Xmodmap & #setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll -exec awesome +nm-applet --sm-disable & +exec ck-launch-session dbus-launch awesome
nblock/config
4bfa3007b0cc3d1c2058f13da2f6de366eb3e28e
switch from xptemplate to ultisnip; add syntastic
diff --git a/.vimrc b/.vimrc index 6d74522..8af772f 100644 --- a/.vimrc +++ b/.vimrc @@ -1,193 +1,196 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' -Bundle 'paster.vim' Bundle 'fs111/pydoc.vim' +Bundle 'paster.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' -Bundle 'drmingdrmer/xptemplate' -Bundle 'file:///$HOME/development/xptemplate-snippets' +Bundle 'scrooloose/syntastic' +Bundle 'SirVer/ultisnips' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex +" UltiSnip +let g:UltiSnipsExpandTrigger="<tab>" +let g:UltiSnipsJumpForwardTrigger="<tab>" +let g:UltiSnipsJumpBackwardTrigger="<s-tab>" +let g:UltiSnipsListSnippets="<leader><tab>" +let g:UltiSnipsSnippetDirectories=["UltiSnips", "nblock-snippets"] + +"syntastic +let g:syntastic_error_symbol='E' +let g:syntastic_style_error_symbol='e' +let g:syntastic_warning_symbol='W' +let g:syntastic_style_warning_symbol='w' + " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption -" xptemplate -" custom settings in xptemplate/personal/ftplugin/ -let g:xptemplate_key = '<Plug>triggerxpt' -let g:xptemplate_key_pum_only = '<C-r><Tab>' -let g:xptemplate_nav_prev = '<S-Tab>' -inoremap <Plug>closePUM <C-v><C-v><BS> -imap <TAB> <Plug>closePUM<Plug>triggerxpt -let g:xptemplate_fallback = 'nore:<TAB>' -let g:xptemplate_vars = "SParg=" - " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
97d717751bc3c6a0958d655b9a66d6d5d92150d9
fix download dir in rtorrent
diff --git a/.rtorrent.rc b/.rtorrent.rc index 58c38aa..1421889 100644 --- a/.rtorrent.rc +++ b/.rtorrent.rc @@ -1,112 +1,112 @@ # This is an example resource file for rTorrent. Copy to # ~/.rtorrent.rc and enable/modify the options as needed. Remember to # uncomment the options you wish to enable. # Maximum and minimum number of peers to connect to per torrent. min_peers = 40 max_peers = 100 # Same as above but for seeding completed torrents (-1 = same as downloading) min_peers_seed = 10 max_peers_seed = 50 # Maximum number of simultanious uploads per torrent. #max_uploads = 15 # Global upload and download rate in KiB. "0" for unlimited. #download_rate = 0 #upload_rate = 0 # Default directory to save the downloaded torrents. -directory = ~/download/rtorrent/tmp +directory = ~/download/rtorrent/ # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? session = ~/download/rtorrent/tmp/.session #move completed files system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/download/rtorrent;d.set_directory=~/download/rtorrent" # Watch a directory for new torrents, and stop those that have been deleted. schedule = watch_directory,10,10,load_start=~/download/rtorrent/watch/*.torrent #schedule = tied_directory,10,10,start_tied= schedule = untied_directory,10,10,close_untied= # Close torrents when diskspace is low. schedule = low_diskspace,5,60,close_low_diskspace=100M # Change the limits, the defaults should be sufficient. ratio.min.set=100 ratio.max.set=300 ratio.upload.set=20M # Changing the command triggered when the ratio is reached. system.method.set = group.seeding.ratio.command, d.close=, d.erase= # The ip address reported to the tracker. ip = 127.0.0.1 ip = rakshasa.no # The ip address the listening socket and outgoing connections is # bound to. #bind = 127.0.0.1 #bind = rakshasa.no # Port range to use for listening. #port_range = 6890-6999 # Start opening ports at a random position within the port range. #port_random = no # Check hash for finished torrents. Might be usefull until the bug is # fixed that causes lack of diskspace not to be properly reported. #check_hash = no # Set whetever the client should try to connect to UDP trackers. use_udp_trackers = yes # Alternative calls to bind and ip that should handle dynamic ip's. #schedule = ip_tick,0,1800,ip=rakshasa #schedule = bind_tick,0,1800,bind=rakshasa # Encryption options, set to none (default) or any combination of the following: # allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext # # The example value allows incoming encrypted connections, starts unencrypted # outgoing connections but retries with encryption if they fail, preferring # plaintext to RC4 encryption after the encrypted handshake # encryption = allow_incoming,enable_retry,prefer_plaintext # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". For DHT to work, a session directory must be defined. # dht = on # UDP port to use for DHT. # dht_port = 6881 # Enable peer exchange (for torrents not marked private) # peer_exchange = yes # # Do not modify the following parameters unless you know what you're doing. # # Hash read-ahead controls how many MB to request the kernel to read # ahead. If the value is too low the disk may not be fully utilized, # while if too high the kernel might not be able to keep the read # pages in memory thus end up trashing. #hash_read_ahead = 10 # Interval between attempts to check the hash, in milliseconds. #hash_interval = 100 # Number of attempts to check the hash while using the mincore status, # before forcing. Overworked systems might need lower values to get a # decent hash checking rate. #hash_max_tries = 10
nblock/config
cf6b71fc546decc3ee009a20afa70b3e87d0711f
enable ssh support for gpg-agent
diff --git a/.xinitrc b/.xinitrc index eab8d92..fc396b1 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,8 +1,8 @@ #!/bin/sh -eval "$(gpg-agent --daemon)" +eval "$(gpg-agent --daemon --enable-ssh-support)" urxvtd -q -f -o ck-launch-session nm-applet & xrdb -load ~/.Xresources xmodmap .Xmodmap & #setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll exec awesome
nblock/config
a1e3b43584c89f0aaf6d533b7042ae815f510062
fix neo vs. urxvt bug
diff --git a/.Xresources b/.Xresources index 5abdfba..3a9ff10 100644 --- a/.Xresources +++ b/.Xresources @@ -1,78 +1,98 @@ +! neo vs. urxvt vs. vim: +! http://wiki.neo-layout.org/ticket/182 +URxvt.keysym.KP_Add: + +URxvt.keysym.KP_Subtract: - +URxvt.keysym.KP_Multiply: * +URxvt.keysym.KP_Divide : / +URxvt.keysym.KP_Decimal : . +URxvt.keysym.KP_Separator : , +URxvt.keysym.KP_1: 1 +URxvt.keysym.KP_2: 2 +URxvt.keysym.KP_3: 3 +URxvt.keysym.KP_4: 4 +URxvt.keysym.KP_5: 5 +URxvt.keysym.KP_6: 6 +URxvt.keysym.KP_7: 7 +URxvt.keysym.KP_8: 8 +URxvt.keysym.KP_9: 9 +URxvt.keysym.KP_0: 0 + + !! from: https://raw.github.com/altercation/solarized/master/xresources-colors-solarized/Xresources !! drop in Solarized colorscheme for Xresources/Xdefaults !!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB !!--------- ------- ---- ------- ----------- ---------- ----------- ----------- !!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 !!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 !!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 !!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 !!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 !!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 !!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93 !!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 !!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 !!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 !!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 !!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 !!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 !!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 !!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 !!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 #define S_base03 #002b36 #define S_base02 #073642 #define S_base01 #586e75 #define S_base00 #657b83 #define S_base0 #839496 #define S_base1 #93a1a1 #define S_base2 #eee8d5 #define S_base3 #fdf6e3 #define S_yellow #b58900 #define S_orange #cb4b16 #define S_red #dc322f #define S_magenta #d33682 #define S_violet #6c71c4 #define S_blue #268bd2 #define S_cyan #2aa198 #define S_green #859900 *background: S_base03 *foreground: S_base00 *fading: 40 *fadeColor: S_base03 *cursorColor: S_base1 *pointerColorBackground:S_base01 *pointerColorForeground:S_base1 !! black dark/light *color0: S_base02 *color8: S_base03 !! red dark/light *color1: S_red *color9: S_orange !! green dark/light *color2: S_green *color10: S_base01 !! yellow dark/light *color3: S_yellow *color11: S_base00 !! blue dark/light *color4: S_blue *color12: S_base0 !! magenta dark/light *color5: S_magenta *color13: S_violet !! cyan dark/light *color6: S_cyan *color14: S_base1 !! white dark/light *color7: S_base2 *color15: S_base3 diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index aa95bbb..6db1f3e 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -1,461 +1,460 @@ -- {{{ License -- rc.lua, works with awesome 3.4.9 (Arch Linux) -- author: nblock <nblock [at] archlinux.us> -- based on multiple rc.lua files from different awesome users -- -- This work is licensed under the Creative Commons Attribution Share -- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ -- }}} -- {{{ Load libraries -- Standard awesome library require("awful") require("awful.autofocus") require("awful.rules") -- Theme handling library require("beautiful") -- Notification library require("naughty") require("vicious") -- }}} -- {{{ Variable definitions local home = os.getenv("HOME") local exec = awful.util.spawn local sexec = awful.util.spawn_with_shell -- Themes define colours, icons, and wallpapers beautiful.init(home .. "/.config/awesome/zenburn.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" editor = "vim" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. layouts = { awful.layout.suit.tile, --1 awful.layout.suit.tile.left, --2 awful.layout.suit.tile.bottom, --3 awful.layout.suit.tile.top, --4 awful.layout.suit.fair, --5 awful.layout.suit.fair.horizontal, --6 awful.layout.suit.spiral, --7 awful.layout.suit.spiral.dwindle, --8 awful.layout.suit.max, --9 awful.layout.suit.max.fullscreen, --10 awful.layout.suit.magnifier, --11 awful.layout.suit.floating --12 } -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. tags[s] = awful.tag({ "1 download", "2 mail", "3 chat", "4 music", "5 news", "6 web", 7, 8, 9 }, s, {layouts[3], layouts[1], layouts[1], -- Tags: 1, 2, 3 layouts[1], layouts[1], layouts[1], -- 4, 5 ,6 layouts[1], layouts[1], layouts[1] -- 7, 8, 9 }) end -- }}} -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" }, { "restart", awesome.restart }, { "quit", awesome.quit } } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), menu = mymainmenu }) -- }}} -- {{{ Wibox -- {{{ Widgets configuration -- {{{ Reusable separators local spacer = widget({ type = "textbox", name = "spacer" }) local separator = widget({ type = "textbox", name = "separator" }) spacer.text = " " separator.text = " <span foreground='red'>•</span> " -- }}} -- {{{ CPU load local cpuwidget = widget({ type = "textbox" }) vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") -- }}} -- {{{ CPU temperature local thermalwidget = widget({ type = "textbox" }) vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") -- }}} -- {{{ Battery state -- Widget icon -- baticon = widget({ type = "imagebox", name = "baticon" }) -- baticon.image = image(beautiful.widget_bat) local batwidget = widget({ type = "textbox" }) vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") -- }}} -- {{{ Date and time local datewidget = widget({ type = "textbox" }) vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 5) -- }}} -- {{{ Volume widget local volwidget = widget({ type = "textbox" }) vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') -- }}} -- {{{ cmus widget cmus = widget({ type = "textbox", name = "cmus" }) cmus.text = "<span foreground='orange'>music: </span><span foreground='green'>-</span>" -- }}} -- {{{ System tray systray = widget({ type = "systray" }) -- }}} -- }}} -- {{{ Wibox initialisation local wibox = {} local promptbox = {} local layoutbox = {} local taglist = {} taglist.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev)) local tasklist = {} tasklist.buttons = awful.util.table.join( awful.button({ }, 1, function(c) if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end client.focus = c c:raise() end), awful.button({ }, 3, function() if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width = 250 }) end end), awful.button({ }, 4, function() awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function() awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end) ) - for s = 1, screen.count() do -- Create a promptbox promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) -- Create a layoutbox layoutbox[s] = awful.widget.layoutbox(s) layoutbox[s]:buttons(awful.util.table.join( awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end) )) -- Create a taglist widget taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, taglist.buttons) -- Create a tasklist widget tasklist[s] = awful.widget.tasklist( function(c) return awful.widget.tasklist.label.currenttags(c, s) end, tasklist.buttons ) -- Create the wibox wibox[s] = awful.wibox({ position = "top", screen = s, - fg = beautiful.fg_normal, bg = beautiful.bg_normal + fg = beautiful.fg_normal, bg = beautiful.bg_normal, height=beautiful.widget_height }) -- Add widgets to the wibox wibox[s].widgets = {{ launcher, taglist[s], layoutbox[s], promptbox[s], layout = awful.widget.layout.horizontal.leftright }, s == screen.count() and systray or nil, spacer, datewidget, - separator, volwidget, + separator, volwidget, separator, batwidget, separator, cpuwidget, separator, thermalwidget, separator, cmus, - separator, tasklist[s], + separator, tasklist[s], layout = awful.widget.layout.horizontal.rightleft } end -- }}} -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up awful.key({}, "XF86Tools", function() sexec("") end ), awful.key({}, "XF86Calculator", function() sexec("") end ), awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 -- awful.key({}, "XF86MyComputer", function() sexec(commands.fileman) end ), -- awful.key({}, "XF86Mail", function() sexec(commands.mail) end ), -- awful.key({}, "XF86HomePage", function() sexec(commands.browser) end ), -- awful.key({}, "XF86Sleep", function() sexec(commands.lock) end ), -- awful.key({"Control", "Mod1"}, "l", function() sexec(commands.lock) end ), --default bindings awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "n", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () exec(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), -- Prompt awful.key({ modkey }, "r", function () promptbox[mouse.screen]:run() end), -- Run stuff in a Terminal awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run in Terminal: " }, promptbox[mouse.screen].widget, function (prog) sexec(terminal .. " -name " .. prog .. " -e /bin/zsh -c " .. prog) end) end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), awful.key({ modkey, }, "j", function (c) c.minimized = not c.minimized end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)); end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = true, keys = clientkeys, buttons = clientbuttons } }, --floating apps { rule = { class = "pinentry-qt4" }, properties = { floating = true } }, { rule = { class = "pinentry-gtk-2" }, properties = { floating = true } }, { rule = { class = "Gimp" }, properties = { floating = true } }, --apptags --downloading stuff { rule = { class = "JDownloader" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, { rule = { instance = "rtorrent" }, properties = { tag = tags[screen.count()][1],switchtotag = false } }, -- mail { rule = { class = "Thunderbird" }, properties = { tag = tags[screen.count()][2],switchtotag = false } }, --pidgin { rule = { class = "Pidgin" }, properties = { tag = tags[1][3],switchtotag = false } }, -- cmus { rule = { instance = "cmus" }, properties = { tag = tags[screen.count()][4],switchtotag = false } }, -- news { rule = { instance = "newsbeuter" }, properties = { tag = tags[screen.count()][5],switchtotag = false } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.add_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- remove gaps c.size_hints_honor = false -- Enable sloppy focus c:add_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end end) client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} -- {{{ Autostart ---os.execute("blueman-applet &") +os.execute("blueman-applet &") -- }}} -- vim: fdm=marker fdl=0 sts=4 ai diff --git a/.vimrc b/.vimrc index 09b1eb6..6d74522 100644 --- a/.vimrc +++ b/.vimrc @@ -1,191 +1,193 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'paster.vim' Bundle 'fs111/pydoc.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'drmingdrmer/xptemplate' Bundle 'file:///$HOME/development/xptemplate-snippets' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'Lokaltog/vim-powerline' +Bundle 'sjl/gundo.vim' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> +nnoremap <F9> :GundoToggle<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " xptemplate " custom settings in xptemplate/personal/ftplugin/ let g:xptemplate_key = '<Plug>triggerxpt' let g:xptemplate_key_pum_only = '<C-r><Tab>' let g:xptemplate_nav_prev = '<S-Tab>' inoremap <Plug>closePUM <C-v><C-v><BS> imap <TAB> <Plug>closePUM<Plug>triggerxpt let g:xptemplate_fallback = 'nore:<TAB>' let g:xptemplate_vars = "SParg=" " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized diff --git a/.zshrc b/.zshrc index 63f4907..0c99816 100644 --- a/.zshrc +++ b/.zshrc @@ -1,212 +1,219 @@ # load arch default settings if [ -r /etc/profile ] ; then . /etc/profile fi # history and directory stack config HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 DIRSTACKSIZE=100 setopt HIST_IGNORE_SPACE # commands with at least one space get ignored setopt INC_APPEND_HISTORY # share history between sessions setopt HIST_IGNORE_ALL_DUPS # ignore history dups setopt AUTO_PUSHD # use automated directory stack setopt PUSHD_IGNORE_DUPS # ignore directory stack dups # colors -eval `dircolors .config/dircolors/dircolors.256dark` +eval `dircolors $HOME/.config/dircolors/dircolors.256dark` # stuff setopt AUTOCD # autocd into dirs setopt EXTENDEDGLOB # use extended globbing setopt CORRECTALL # use autocorrection for commands and args setopt NOBEEP # avoid "beep"ing setopt prompt_subst # Enables additional prompt extentions stty stop "" # disable <ctrl-s> and <ctrl-q> # environment variables export EDITOR=vim export BROWSER=firefox export LANG=de_AT.UTF-8 export TERM=rxvt-unicode-256color export GPG_TTY=`tty` PATH=$HOME/bin:$PATH typeset -U PATH # colors autoload -U colors && colors # set color vars for COLOR in RED GREEN BLUE YELLOW; do eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done C_RESET="%{${reset_color}%}"; # autocompletion autoload -U compinit compinit zstyle ':completion:*' menu select # menu driven autocomplete zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' accept-exact '*(N)' # version control info autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" zstyle ':vcs_info:*' branchformats "%b:%r" function precmd { vcs_info 'prompt' } # default prompt PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' RPROMPT='${vcs_info_msg_0_}' # prompt for loops PROMPT2='{%_} ' # prompt for selections PROMPT3='{ … } ' # So far I don't use "setopt xtrace", so I don't need this prompt PROMPT4='' # auto extension alias alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR # no autocorrection for mv and cp alias mv='nocorrect mv' alias cp='nocorrect cp' # normal alias alias ls='ls --color=auto -F' alias ll='ls -lh' alias la='ls -a' alias e=$EDITOR alias se='sudo $EDITOR' alias grep='grep --color=auto' alias p='sudo pacman' alias y='yaourt' alias popt='sudo pacman-optimize && sync' alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' alias R='y -Rscn' alias Syu='y -Syu' alias S='y -S' alias Ss='y -Ss' alias clean='y -Qdt && y -Scc' alias su='su -' alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME' +alias t='task' +alias ta='task add' +alias tl='task list' # alias for git alias ga='git add' alias gpush='git push' alias gs='git status -sb' alias gd='git diff' alias gdc='git diff --cached' alias gm='git commit -m' alias gma='git commit -am' alias gb='git branch' alias gc='git checkout' alias gra='git remote add' alias grr='git remote rm' alias gpull='git pull' alias gcl='git clone' alias gl='git log' alias glo='git log --oneline --graph --decorate' gldate() { before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` git log --oneline --graph --decorate --since="$before" --until="$1" } # key bindings (vim mode) bindkey -v bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "\^H" backward-delete-word # completion in the middle of a line bindkey '^i' expand-or-complete-prefix bindkey '^R' history-incremental-search-backward bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward +# tmux ? +bindkey "^[[1~" beginning-of-line +bindkey "^[[4~" end-of-line + # hashes hash -d da=~/fh-hagenberg/da # extract various files with x $arg function x() { if [ -f "$1" ] ; then case "$1" in *.tar.bz2) tar xjf "$1" ;; *.tar.gz) tar xzf "$1" ;; *.tar.bz) tar xzf "$1" ;; *.tar.Z) tar xzf "$1" ;; *.bz2) bunzip2 "$1" ;; *.rar) unrar x "$1" ;; *.gz) gunzip "$1" ;; *.jar) unzip "$1" ;; *.tar) tar xf "$1" ;; *.tbz2) tar xjf "$1" ;; *.tgz) tar xzf "$1" ;; *.zip) unzip "$1" ;; *.Z) uncompress "$1" ;; *.7z) 7z x "$1" ;; *) echo "'$1' cannot be extracted." ;; esac else echo "'$1' is not a valid archive." fi } # generate a random password function random(){ < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; } # obtain public ip addresses (v4 and v6) if available function hostip(){ IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` IPV4=`curl -s ipv4.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` if [ -z "$IPV6" ]; then echo "IPv6: -" else echo "IPv6: ${IPV6}" fi if [ -z "$IPV4" ]; then echo "IPv4: -" else echo "IPv4: ${IPV4}" fi } # serve local dir via http function serve(){ SERVE_PORT=8080 echo "listening on:" ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' python -m http.server $SERVE_PORT 1>/dev/null unset $SERVE_PORT } # a shortcut for cropping pages with pdfcrop function crop() pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf"
nblock/config
fc2f44bdca682b33236a427fa595a240549f2f40
add taskwarrior
diff --git a/.solarized-task/solarized-dark-256.theme b/.solarized-task/solarized-dark-256.theme new file mode 100644 index 0000000..4001868 --- /dev/null +++ b/.solarized-task/solarized-dark-256.theme @@ -0,0 +1,74 @@ +############################################################################### +# Taskwarrior solarized-dark-256 theme created by Stefan A. Keel. +# +# For use with taskwarrior - a command line task list manager created by +# Paul Beckingham, Federico Hernandez. <http://taskwarrior.org> +# +# Colors used are based on the Solarized palette created by Ethan Schoonover +# <http://ethanschoonover.com/solarized> +# +# This theme was designed to work with a terminal application that is using +# a Solarized "Dark" color theme, otherwise colors will look odd. +# Solarized includes themes for iTerm2, OSX Terminal.app, and Xresources. +# Others are also available, i.e.: +# Gnome Terminal <https://github.com/sigurdga/gnome-terminal-colors-solarized> +# +# Colors 0 through 15 in this theme are based on the 16 color positions defined +# in the Xresources file distributed with the Solarized color palette. Some +# of the colors used are "named" in order to use the bold feature. The color +# "name" is based on the color's original name as the terminal understands it. +# +# This theme is free to use, modify, redistribute, or simply giggle at. It is +# distributed with absolutely no warranty of servicability or guarantee. +# +################################################################################ +color=on + +color.active=bold red +color.alternate=on black #color0 + +color.blocked=color0 on color10 + +color.burndown.done=color0 on color4 +color.burndown.pending=color0 on color1 +color.burndown.started=color0 on color9 + +color.calendar.due=color0 on color9 +color.calendar.due.today=color0 on color1 +color.calendar.holiday=color0 on color3 +color.calendar.overdue=color0 on color5 +color.calendar.today=color0 on color4 +color.calendar.weekend=on color0 +color.calendar.weeknumber=color4 + +color.debug=color6 +color.due=color9 +color.due.today=color1 +color.overdue=color5 +color.footnote=color6 +color.header=color4 + +color.history.add=color0 on color1 +color.history.delete=color0 on color3 +color.history.done=color0 on color10 + +color.pri.H=bold blue #color14 +color.pri.M=bold yellow #color12 +color.pri.L=bold green #color11 +color.pri.none= + +color.project.none= +color.recurring=color4 + +color.summary.background=on color0 +color.summary.bar=color0 on color6 + +color.sync.added=color14 +color.sync.changed=color9 +color.sync.rejected=color13 + +color.tag.none= +color.tagged=color10 + +color.undo.after=color2 +color.undo.before=color1 diff --git a/.solarized-task/solarized-light-256.theme b/.solarized-task/solarized-light-256.theme new file mode 100644 index 0000000..578480e --- /dev/null +++ b/.solarized-task/solarized-light-256.theme @@ -0,0 +1,74 @@ +############################################################################### +# Taskwarrior solarized-light-256 theme created by Stefan A. Keel. +# +# For use with taskwarrior - a command line task list manager created by +# Paul Beckingham, Federico Hernandez. <http://taskwarrior.org> +# +# Colors used are based on the Solarized palette created by Ethan Schoonover +# <http://ethanschoonover.com/solarized> +# +# This theme was designed to work with a terminal application that is using +# a Solarized "Light" color theme, otherwise colors will look odd. +# Solarized includes themes for iTerm2, OSX Terminal.app, and Xresources. +# Others are also available, i.e.: +# Gnome Terminal <https://github.com/sigurdga/gnome-terminal-colors-solarized> +# +# Colors 0 through 15 in this theme are based on the 16 color positions defined +# in the Xresources file distributed with the Solarized color palette. Some +# of the colors used are "named" in order to use the bold feature. The color +# "name" is based on the color's original name as the terminal understands it. +# +# This theme is free to use, modify, redistribute, or simply giggle at. It is +# distributed with absolutely no warranty of servicability or guarantee. +# +################################################################################# +color=on + +color.active=bold red #color9 +color.alternate=on white #color7 (allows bold for alternate rows) + +color.blocked=on color14 + +color.burndown.done=color0 on color4 +color.burndown.pending=color0 on color1 +color.burndown.started=color0 on color9 + +color.calendar.due=color7 on color9 +color.calendar.due.today=color7 on color1 +color.calendar.holiday=color7 on color3 +color.calendar.overdue=color7 on color5 +color.calendar.today=color7 on color4 +color.calendar.weekend=on color7 +color.calendar.weeknumber=color14 + +color.debug=color3 +color.due=color9 +color.due.today=color1 +color.overdue=color5 +color.footnote=color2 +color.header=color2 + +color.history.add=color0 on color1 +color.history.delete=color0 on color3 +color.history.done=color14 on color0 + +color.pri.H=bold black #color0 +color.pri.M=bold yellow #color11 +color.pri.L=bold cyan #color14 +color.pri.none= + +color.project.none= +color.recurring=color4 + +color.summary.background=on color7 +color.summary.bar=color0 on color6 + +color.sync.added=color10 +color.sync.changed=color9 +color.sync.rejected=color13 + +color.tag.none= +color.tagged=color14 + +color.undo.after=color2 +color.undo.before=color1 diff --git a/.taskrc b/.taskrc new file mode 100644 index 0000000..06989cf --- /dev/null +++ b/.taskrc @@ -0,0 +1,31 @@ +# [Created by task 1.9.4 1/16/2012 21:12:11] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-faq', +# 'man task-tutorial', 'man task-color', 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=/~/.task + +# Date Settings +weekstart=Monday +dateformat=D.M.Y +dateformat.report=D.M.Y +dateformat.holiday=YMD +dateformat.annotation=D.M.Y +report.X.dateformat=D.M.Y + +# sync +merge.autopush=yes +merge.default.uri=ssh://nblock/~/.task/ +push.default.uri=ssh://nblock/~/.task/ +pull.default.uri=ssh://nblock/~/.task/ + +# theme support +include /~/.solarized-task/solarized-dark-256.theme
nblock/config
6d0a1359e0b3fcb3273e502b43de97448955b885
add vim-powerline
diff --git a/.vimrc b/.vimrc index 7f17cbc..09b1eb6 100644 --- a/.vimrc +++ b/.vimrc @@ -1,191 +1,191 @@ " File: .vimrc " Author: nblock <nblock [/at\] archlinux DOT us> " Description: just another .vimrc " Last Modified: Dezember 10th, 2011 set nocompatible set nobackup set nowritebackup set noswapfile set showmode " always display current mode set showcmd " always display current command set showmatch " show matching brackets (),{},[] set mat=3 " show matching brackets for 0.3 seconds set encoding=utf-8 " use utf-8 everywhere set fileencoding=utf-8 " use utf-8 everywhere set termencoding=utf-8 " use utf-8 everywhere set backspace=indent,eol,start " more flexible backspace set mouse=a " enable mouse usage in all modes set incsearch " jump to match during searching set hlsearch " highlight search set ttyfast " fast terminal connection set scrolloff=4 " 4 lines above/below cursor when scrolling set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol set nomodeline " use secure modeline set tabpagemax=30 " 30 instead of 10 concurrent tabs set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos " use a terminal title set title set titlestring=%F\ [vim] " tab settings set tabstop=2 " tab character amount set expandtab " tabs as space set autoindent set smartindent " smart autoindenting on a new line set shiftwidth=2 " set spaces for autoindent set softtabstop=2 " statusline set laststatus=2 set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y " vundle settings filetype off "required by vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "plugins managed by vundle Bundle 'gmarik/vundle' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-speeddating' Bundle 'godlygeek/tabular' Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' Bundle 'matchit.zip' Bundle 'paster.vim' Bundle 'fs111/pydoc.vim' Bundle 'majutsushi/tagbar' Bundle 'git://git.wincent.com/command-t.git' Bundle 'ciaranm/securemodelines' Bundle 'scrooloose/nerdcommenter' Bundle 'AutoComplPop' Bundle 'drmingdrmer/xptemplate' Bundle 'file:///$HOME/development/xptemplate-snippets' Bundle 'nblock/vim-dokuwiki' Bundle 'SudoEdit.vim' Bundle 'altercation/vim-colors-solarized' -Bundle 'TeX-PDF' +Bundle 'Lokaltog/vim-powerline' filetype plugin indent on " required by vundle " switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "de", "en" ] function! MySpellLang() " loop through languages let g:myLang = g:myLang + 1 if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif if g:myLang == 0 | set nospell | endif if g:myLang == 1 | setlocal spell spelllang=de | endif if g:myLang == 2 | setlocal spell spelllang=en | endif echo "language:" g:myLangList[g:myLang] endf " call the python version that is specified in the shebang " in Arch Linux, `python` is Python 3.x function! ExecSpecifiedPython() let lc = getline(1) " check if shebang is present if stridx(lc, "python") == -1 let py = '!/usr/bin/python2 "%"' " default to python2 else let lc = substitute(lc,"#", "", "g") let lc = substitute(lc,"env ", "", "g") let py = lc . ' "%"' endif exec py endfunction " cleaning up function! Preserve(command) " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: execute a:command " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " shortcuts and mappings let mapleader = "," nnoremap <F2> :set invpaste paste?<CR> imap <F2> <C-O><F2> set pastetoggle=<F2> map <F3> :nohlsearch<CR> autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> map <F6> :w<CR>:!make<CR> vmap <F9> :!xclip -f -sel clip<CR> map <F10> :-1r !xclip -o -sel clip<CR> nnoremap <silent> <F11> :TagbarToggle<CR> map <F12> <C-]> map <F7> :call MySpellLang()<CR> imap <F7> <C-o>:call MySpellLang()<CR> nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> nmap <leader>= :call Preserve("normal gg=G")<CR> " switch between buffers nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>h <C-w>h nnoremap <leader>l <C-w>l nnoremap <leader>w <C-w>w nnoremap <leader><space> <C-w>r " enable very magic forward/backward search nnoremap / /\v vnoremap / /\v nnoremap ? ?\v vnoremap ? ?\v let g:tex_flavor = "latex" " assume latex as default tex " vim-pydiction filetype plugin on let g:pydiction_location = '/usr/share/pydiction/complete-dict' " tagbar autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes let g:tagbar_type_tex = { \ 'ctagstype' : 'latex', \ 'kinds' : [ \ 's:sections', \ 'g:graphics', \ 'l:labels', \ 'r:refs:1', \ 'L:listings', \ 'p:pagerefs:1' \ ], \ 'sort' : 0, \ } "AutoComplPop let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption " xptemplate " custom settings in xptemplate/personal/ftplugin/ let g:xptemplate_key = '<Plug>triggerxpt' let g:xptemplate_key_pum_only = '<C-r><Tab>' let g:xptemplate_nav_prev = '<S-Tab>' inoremap <Plug>closePUM <C-v><C-v><BS> imap <TAB> <Plug>closePUM<Plug>triggerxpt let g:xptemplate_fallback = 'nore:<TAB>' let g:xptemplate_vars = "SParg=" " settings for different filetypes autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes " colorscheme settings syntax enable set background=dark colorscheme solarized
nblock/config
b0938d16c8ff89b86463006bb11dd0e7cd0d4743
no longer restart stopped torrents
diff --git a/.Xdefaults b/.Xdefaults new file mode 100644 index 0000000..e0ce885 --- /dev/null +++ b/.Xdefaults @@ -0,0 +1,29 @@ +!URxvt settings +!!--[Urxvt Options]--! +URxvt*title: urxvtc +URxvt*termName: rxvt-unicode-256color +URxvt*cursorBlink: true +URxvt*urgentOnBell: true +URxvt*scrollBar: false +URxvt*boldMode: false +URxvt*imLocale: de_AT.UTF-8 +URxvt*loginShell: true +URxvt*borderless: false +URxvt*jumpScroll: true +URxvt*saveLines: 5000 +URxvt*transparent: false +URxvt*fading: 0% +URxvt*scrollTtyKeypress:true +URxvt*internalBorder: 0 + +!--[Urls /launching/marking/yanking]--! +URxvt*perl-ext: default,matcher +URxvt*urlLauncher: /usr/bin/firefox +URxvt*matcher.button: 1 +URxvt*matcher.pattern.1:\\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-] + +!--[Fonts]--! +URxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13:antialias=false +URxvt*italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true:antialias=false +URxvt*boldFont: xft:Bitstream Vera Sans Mono:bold:autohint=true:antialias=false +URxvt*boldItalicFont: xft:Bitstream Vera Sans Mono:bold:italic:autohint=true:antialias=false diff --git a/.Xmodmap b/.Xmodmap new file mode 100644 index 0000000..c5894fb --- /dev/null +++ b/.Xmodmap @@ -0,0 +1,4 @@ +keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle +keycode 113 = XF86AudioMute NoSymbol XF86AudioMute + +!keycode 248 toggle microphone diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..5abdfba --- /dev/null +++ b/.Xresources @@ -0,0 +1,78 @@ +!! from: https://raw.github.com/altercation/solarized/master/xresources-colors-solarized/Xresources +!! drop in Solarized colorscheme for Xresources/Xdefaults + +!!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB +!!--------- ------- ---- ------- ----------- ---------- ----------- ----------- +!!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 +!!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 +!!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 +!!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 +!!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 +!!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 +!!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93 +!!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 +!!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 +!!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 +!!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 +!!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 +!!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 +!!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 +!!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 +!!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 + +#define S_base03 #002b36 +#define S_base02 #073642 +#define S_base01 #586e75 +#define S_base00 #657b83 +#define S_base0 #839496 +#define S_base1 #93a1a1 +#define S_base2 #eee8d5 +#define S_base3 #fdf6e3 +#define S_yellow #b58900 +#define S_orange #cb4b16 +#define S_red #dc322f +#define S_magenta #d33682 +#define S_violet #6c71c4 +#define S_blue #268bd2 +#define S_cyan #2aa198 +#define S_green #859900 + +*background: S_base03 +*foreground: S_base00 +*fading: 40 +*fadeColor: S_base03 +*cursorColor: S_base1 +*pointerColorBackground:S_base01 +*pointerColorForeground:S_base1 + +!! black dark/light +*color0: S_base02 +*color8: S_base03 + +!! red dark/light +*color1: S_red +*color9: S_orange + +!! green dark/light +*color2: S_green +*color10: S_base01 + +!! yellow dark/light +*color3: S_yellow +*color11: S_base00 + +!! blue dark/light +*color4: S_blue +*color12: S_base0 + +!! magenta dark/light +*color5: S_magenta +*color13: S_violet + +!! cyan dark/light +*color6: S_cyan +*color14: S_base1 + +!! white dark/light +*color7: S_base2 +*color15: S_base3 diff --git a/.cmus/autosave b/.cmus/autosave new file mode 100644 index 0000000..156c4a8 --- /dev/null +++ b/.cmus/autosave @@ -0,0 +1,142 @@ +set aaa_mode=artist +set altformat_current= %F +set altformat_playlist= %f%= %d +set altformat_title=%f +set altformat_trackwin= %f%= %d +set auto_reshuffle=false +set buffer_seconds=10 +set color_cmdline_bg=default +set color_cmdline_fg=default +set color_error=lightred +set color_info=lightyellow +set color_separator=green +set color_statusline_bg=240 +set color_statusline_fg=white +set color_titleline_bg=240 +set color_titleline_fg=white +set color_win_bg=default +set color_win_cur=gray +set color_win_cur_sel_bg=166 +set color_win_cur_sel_fg=237 +set color_win_dir=blue +set color_win_fg=yellow +set color_win_inactive_cur_sel_bg=252 +set color_win_inactive_cur_sel_fg=lightyellow +set color_win_inactive_sel_bg=252 +set color_win_inactive_sel_fg=black +set color_win_sel_bg=237 +set color_win_sel_fg=166 +set color_win_title_bg=252 +set color_win_title_fg=black +set confirm_run=true +set continue=true +set display_artist_sort_name=false +set dsp.alsa.device=default +set dsp.ao.buffer_size=16384 +set dsp.ao.driver= +set dsp.ao.wav_counter=1 +set dsp.ao.wav_dir=/home/flo +set dsp.oss.device= +set format_current= %a - [%02n] %t - %l [%y] %= %F +set format_playlist= %-20a %02n. %t%= %y %d +set format_playlist_va= %-20A %3n. %t (%a)%= %y %d +set format_title=%a - %l - %t (%y) +set format_trackwin= %02n. %t%= %y %d +set format_trackwin_va=%3n. %t (%a)%= %y %d +set id3_default_charset=ISO-8859-1 +set lib_sort=artist album discnumber tracknumber title filename +set mixer.alsa.channel=PCM +set mixer.alsa.device=default +set mixer.oss.channel=PCM +set mixer.oss.device= +set mixer.pulse.restore_volume=1 +set output_plugin=alsa +set passwd= +set pl_sort= +set play_library=true +set play_sorted=true +set repeat=true +set repeat_current=false +set replaygain=disabled +set replaygain_limit=true +set replaygain_preamp=6.000000 +set resume=true +set set_term_title=false +set show_hidden=false +set show_remaining_time=true +set shuffle=true +set smart_artist_sort=true +set softvol=false +set softvol_state=100 100 +set status_display_program=/home/flo/development/cmus-notify/cmus-notify +bind browser backspace browser-up +bind browser i toggle show_hidden +bind common + vol +10% +bind common , seek -1m +bind common - vol -10% +bind common . seek +1m +bind common 1 view tree +bind common 2 view sorted +bind common 3 view playlist +bind common 4 view queue +bind common 5 view browser +bind common 6 view filters +bind common 7 view settings +bind common = vol +10% +bind common C toggle continue +bind common D win-remove +bind common E win-add-Q +bind common G win-bottom +bind common I echo {} +bind common L push live-filter +bind common M toggle play_library +bind common N search-prev +bind common P win-mv-before +bind common [ vol +1 +0 +bind common ] vol +0 +1 +bind common ^B win-page-up +bind common ^C echo Type :quit<enter> to exit cmus. +bind common ^F win-page-down +bind common ^L refresh +bind common a win-add-l +bind common b player-next +bind common c player-pause +bind common delete win-remove +bind common down win-down +bind common e win-add-q +bind common end win-bottom +bind common enter win-activate +bind common g win-top +bind common h seek -5 +bind common home win-top +bind common i win-sel-cur +bind common j win-down +bind common k win-up +bind common l seek +5 +bind common left seek -5 +bind common m toggle aaa_mode +bind common n search-next +bind common o toggle play_sorted +bind common p win-mv-after +bind common page_down win-page-down +bind common page_up win-page-up +bind common r toggle repeat +bind common right seek +5 +bind common s toggle shuffle +bind common space win-toggle +bind common t toggle show_remaining_time +bind common tab win-next +bind common u win-update +bind common up win-up +bind common v player-stop +bind common x player-play +bind common y win-add-p +bind common z player-prev +bind common { vol -1 -0 +bind common } vol -0 -1 +fset 90s=date>=1990&date<2000 +fset missing-tag=!~T +fset mp3=filename="*.mp3" +fset ogg=filename="*.ogg" +fset ogg-or-mp3=ogg|mp3 +factivate diff --git a/.cmus/notizblock.theme b/.cmus/notizblock.theme new file mode 100644 index 0000000..431189e --- /dev/null +++ b/.cmus/notizblock.theme @@ -0,0 +1,23 @@ +set color_cmdline_bg=default +set color_cmdline_fg=default +set color_error=lightred +set color_info=lightyellow +set color_separator=green +set color_statusline_bg=240 +set color_statusline_fg=white +set color_titleline_bg=240 +set color_titleline_fg=white +set color_win_bg=default +set color_win_cur=gray +set color_win_cur_sel_bg=166 +set color_win_cur_sel_fg=237 +set color_win_dir=blue +set color_win_fg=yellow +set color_win_inactive_cur_sel_bg=252 +set color_win_inactive_cur_sel_fg=lightyellow +set color_win_inactive_sel_bg=252 +set color_win_inactive_sel_fg=black +set color_win_sel_bg=237 +set color_win_sel_fg=166 +set color_win_title_bg=252 +set color_win_title_fg=black diff --git a/.config/awesome/icons/LICENSE b/.config/awesome/icons/LICENSE new file mode 100644 index 0000000..ce5da9d --- /dev/null +++ b/.config/awesome/icons/LICENSE @@ -0,0 +1,12 @@ +All 'awesome' icons in this package were created by Adrian C. (anrxc). +They are licensed under the same terms as the awesome distribution itself +- GNU General Public License version 2. To view a human-readable summary +of this license, visit: http://creativecommons.org/licenses/GPL/2.0/ + +The widget icons with the exception of: 'chat', 'crypt', 'power' and +'rss' icons (which were made by me) were originally made by 'sm4tik' +for purposes of 'dzen', I could not find any licensing information +attached to those original bitmaps. Assuming they are in the public +domain I am licensing the widget icons under the terms of the +Creative Commons Attribution-Share Alike license. To view a copy of +this license, visit: http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/.config/awesome/icons/layouts/dwindle.png b/.config/awesome/icons/layouts/dwindle.png new file mode 100644 index 0000000..1aa4bf2 Binary files /dev/null and b/.config/awesome/icons/layouts/dwindle.png differ diff --git a/.config/awesome/icons/layouts/fairh.png b/.config/awesome/icons/layouts/fairh.png new file mode 100644 index 0000000..e176bb3 Binary files /dev/null and b/.config/awesome/icons/layouts/fairh.png differ diff --git a/.config/awesome/icons/layouts/fairv.png b/.config/awesome/icons/layouts/fairv.png new file mode 100644 index 0000000..7c0a92c Binary files /dev/null and b/.config/awesome/icons/layouts/fairv.png differ diff --git a/.config/awesome/icons/layouts/floating.png b/.config/awesome/icons/layouts/floating.png new file mode 100644 index 0000000..a399092 Binary files /dev/null and b/.config/awesome/icons/layouts/floating.png differ diff --git a/.config/awesome/icons/layouts/fullscreen.png b/.config/awesome/icons/layouts/fullscreen.png new file mode 100644 index 0000000..a0c795c Binary files /dev/null and b/.config/awesome/icons/layouts/fullscreen.png differ diff --git a/.config/awesome/icons/layouts/magnifier.png b/.config/awesome/icons/layouts/magnifier.png new file mode 100644 index 0000000..bca6db9 Binary files /dev/null and b/.config/awesome/icons/layouts/magnifier.png differ diff --git a/.config/awesome/icons/layouts/max.png b/.config/awesome/icons/layouts/max.png new file mode 100644 index 0000000..96a237a Binary files /dev/null and b/.config/awesome/icons/layouts/max.png differ diff --git a/.config/awesome/icons/layouts/spiral.png b/.config/awesome/icons/layouts/spiral.png new file mode 100644 index 0000000..8f5aeed Binary files /dev/null and b/.config/awesome/icons/layouts/spiral.png differ diff --git a/.config/awesome/icons/layouts/tile.png b/.config/awesome/icons/layouts/tile.png new file mode 100644 index 0000000..3fcc904 Binary files /dev/null and b/.config/awesome/icons/layouts/tile.png differ diff --git a/.config/awesome/icons/layouts/tilebottom.png b/.config/awesome/icons/layouts/tilebottom.png new file mode 100644 index 0000000..dfe7832 Binary files /dev/null and b/.config/awesome/icons/layouts/tilebottom.png differ diff --git a/.config/awesome/icons/layouts/tileleft.png b/.config/awesome/icons/layouts/tileleft.png new file mode 100644 index 0000000..c5decfd Binary files /dev/null and b/.config/awesome/icons/layouts/tileleft.png differ diff --git a/.config/awesome/icons/layouts/tiletop.png b/.config/awesome/icons/layouts/tiletop.png new file mode 100644 index 0000000..b251661 Binary files /dev/null and b/.config/awesome/icons/layouts/tiletop.png differ diff --git a/.config/awesome/icons/taglist/squarefz.png b/.config/awesome/icons/taglist/squarefz.png new file mode 100644 index 0000000..0927720 Binary files /dev/null and b/.config/awesome/icons/taglist/squarefz.png differ diff --git a/.config/awesome/icons/taglist/squarez.png b/.config/awesome/icons/taglist/squarez.png new file mode 100644 index 0000000..9b41c26 Binary files /dev/null and b/.config/awesome/icons/taglist/squarez.png differ diff --git a/.config/awesome/icons/titlebar/close_focus.png b/.config/awesome/icons/titlebar/close_focus.png new file mode 100644 index 0000000..02565b9 Binary files /dev/null and b/.config/awesome/icons/titlebar/close_focus.png differ diff --git a/.config/awesome/icons/titlebar/close_normal.png b/.config/awesome/icons/titlebar/close_normal.png new file mode 100644 index 0000000..1a52f0e Binary files /dev/null and b/.config/awesome/icons/titlebar/close_normal.png differ diff --git a/.config/awesome/icons/titlebar/floating_focus_active.png b/.config/awesome/icons/titlebar/floating_focus_active.png new file mode 100644 index 0000000..63d900b Binary files /dev/null and b/.config/awesome/icons/titlebar/floating_focus_active.png differ diff --git a/.config/awesome/icons/titlebar/floating_focus_inactive.png b/.config/awesome/icons/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..6a16857 Binary files /dev/null and b/.config/awesome/icons/titlebar/floating_focus_inactive.png differ diff --git a/.config/awesome/icons/titlebar/floating_normal_active.png b/.config/awesome/icons/titlebar/floating_normal_active.png new file mode 100644 index 0000000..2442274 Binary files /dev/null and b/.config/awesome/icons/titlebar/floating_normal_active.png differ diff --git a/.config/awesome/icons/titlebar/floating_normal_inactive.png b/.config/awesome/icons/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..78487d7 Binary files /dev/null and b/.config/awesome/icons/titlebar/floating_normal_inactive.png differ diff --git a/.config/awesome/icons/titlebar/maximized_focus_active.png b/.config/awesome/icons/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..834f106 Binary files /dev/null and b/.config/awesome/icons/titlebar/maximized_focus_active.png differ diff --git a/.config/awesome/icons/titlebar/maximized_focus_inactive.png b/.config/awesome/icons/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..34f0fce Binary files /dev/null and b/.config/awesome/icons/titlebar/maximized_focus_inactive.png differ diff --git a/.config/awesome/icons/titlebar/maximized_normal_active.png b/.config/awesome/icons/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..19ce21b Binary files /dev/null and b/.config/awesome/icons/titlebar/maximized_normal_active.png differ diff --git a/.config/awesome/icons/titlebar/maximized_normal_inactive.png b/.config/awesome/icons/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..76a1ab7 Binary files /dev/null and b/.config/awesome/icons/titlebar/maximized_normal_inactive.png differ diff --git a/.config/awesome/icons/titlebar/ontop_focus_active.png b/.config/awesome/icons/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..776d586 Binary files /dev/null and b/.config/awesome/icons/titlebar/ontop_focus_active.png differ diff --git a/.config/awesome/icons/titlebar/ontop_focus_inactive.png b/.config/awesome/icons/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..6f96fad Binary files /dev/null and b/.config/awesome/icons/titlebar/ontop_focus_inactive.png differ diff --git a/.config/awesome/icons/titlebar/ontop_normal_active.png b/.config/awesome/icons/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..8d10c9b Binary files /dev/null and b/.config/awesome/icons/titlebar/ontop_normal_active.png differ diff --git a/.config/awesome/icons/titlebar/ontop_normal_inactive.png b/.config/awesome/icons/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..2b949a1 Binary files /dev/null and b/.config/awesome/icons/titlebar/ontop_normal_inactive.png differ diff --git a/.config/awesome/icons/titlebar/sticky_focus_active.png b/.config/awesome/icons/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..1726f90 Binary files /dev/null and b/.config/awesome/icons/titlebar/sticky_focus_active.png differ diff --git a/.config/awesome/icons/titlebar/sticky_focus_inactive.png b/.config/awesome/icons/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..09837c8 Binary files /dev/null and b/.config/awesome/icons/titlebar/sticky_focus_inactive.png differ diff --git a/.config/awesome/icons/titlebar/sticky_normal_active.png b/.config/awesome/icons/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..b0dd58e Binary files /dev/null and b/.config/awesome/icons/titlebar/sticky_normal_active.png differ diff --git a/.config/awesome/icons/titlebar/sticky_normal_inactive.png b/.config/awesome/icons/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..ab08c92 Binary files /dev/null and b/.config/awesome/icons/titlebar/sticky_normal_inactive.png differ diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua new file mode 100644 index 0000000..aa95bbb --- /dev/null +++ b/.config/awesome/rc.lua @@ -0,0 +1,461 @@ +-- {{{ License +-- rc.lua, works with awesome 3.4.9 (Arch Linux) +-- author: nblock <nblock [at] archlinux.us> +-- based on multiple rc.lua files from different awesome users +-- +-- This work is licensed under the Creative Commons Attribution Share +-- Alike License: http://creativecommons.org/licenses/by-sa/3.0/ +-- }}} + +-- {{{ Load libraries +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("vicious") +-- }}} + +-- {{{ Variable definitions +local home = os.getenv("HOME") +local exec = awful.util.spawn +local sexec = awful.util.spawn_with_shell + +-- Themes define colours, icons, and wallpapers +beautiful.init(home .. "/.config/awesome/zenburn.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "urxvtc" +editor = "vim" +editor_cmd = terminal .. " -e " .. editor + +-- Default modkey. +-- Usually, Mod4 is the key with a logo between Control and Alt. +-- If you do not like this or do not have such a key, +-- I suggest you to remap Mod4 to another key using xmodmap or other tools. +-- However, you can use another modifier like Mod1, but it may interact with others. +modkey = "Mod4" + +-- Table of layouts to cover with awful.layout.inc, order matters. +layouts = +{ + awful.layout.suit.tile, --1 + awful.layout.suit.tile.left, --2 + awful.layout.suit.tile.bottom, --3 + awful.layout.suit.tile.top, --4 + awful.layout.suit.fair, --5 + awful.layout.suit.fair.horizontal, --6 + awful.layout.suit.spiral, --7 + awful.layout.suit.spiral.dwindle, --8 + awful.layout.suit.max, --9 + awful.layout.suit.max.fullscreen, --10 + awful.layout.suit.magnifier, --11 + awful.layout.suit.floating --12 +} +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = awful.tag({ + "1 download", "2 mail", "3 chat", + "4 music", "5 news", "6 web", + 7, 8, 9 }, s, + {layouts[3], layouts[1], layouts[1], -- Tags: 1, 2, 3 + layouts[1], layouts[1], layouts[1], -- 4, 5 ,6 + layouts[1], layouts[1], layouts[1] -- 7, 8, 9 + }) +end +-- }}} + +-- {{{ Menu +-- Create a laucher widget and a main menu +myawesomemenu = { + { "manual", terminal .. " -e man awesome" }, + { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" }, + { "restart", awesome.restart }, + { "quit", awesome.quit } +} + +mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) +-- }}} + +-- {{{ Wibox +-- {{{ Widgets configuration +-- {{{ Reusable separators +local spacer = widget({ type = "textbox", name = "spacer" }) +local separator = widget({ type = "textbox", name = "separator" }) +spacer.text = " " +separator.text = " <span foreground='red'>•</span> " +-- }}} + + +-- {{{ CPU load +local cpuwidget = widget({ type = "textbox" }) +vicious.register(cpuwidget, vicious.widgets.cpu, "<span foreground='orange'>load: </span><span foreground='green'>$2%</span><span foreground='orange'> - </span><span foreground='green'>$3%</span><span foreground='orange'> - </span><span foreground='green'>$4%</span><span foreground='orange'> - </span><span foreground='green'>$5%</span>") +-- }}} + +-- {{{ CPU temperature +local thermalwidget = widget({ type = "textbox" }) +vicious.register(thermalwidget, vicious.widgets.thermal, "<span foreground='orange'>temp: </span><span foreground='green'>$1°C</span>", 20, "thermal_zone0") +-- }}} + +-- {{{ Battery state +-- Widget icon +-- baticon = widget({ type = "imagebox", name = "baticon" }) +-- baticon.image = image(beautiful.widget_bat) +local batwidget = widget({ type = "textbox" }) +vicious.register(batwidget, vicious.widgets.bat, "<span foreground='orange'>bat: </span><span foreground='green'>$1$2%</span>", 60, "BAT0") +-- }}} + +-- {{{ Date and time +local datewidget = widget({ type = "textbox" }) +vicious.register(datewidget, vicious.widgets.date, "<span foreground='green'>%a, %d.%m.%y - %H:%M</span>", 5) +-- }}} + +-- {{{ Volume widget +local volwidget = widget({ type = "textbox" }) +vicious.register(volwidget, vicious.widgets.volume, "<span foreground='orange'>vol: </span><span foreground='green'>$1%</span>", 1, 'PCM') +-- }}} + +-- {{{ cmus widget +cmus = widget({ type = "textbox", name = "cmus" }) +cmus.text = "<span foreground='orange'>music: </span><span foreground='green'>-</span>" +-- }}} + +-- {{{ System tray +systray = widget({ type = "systray" }) +-- }}} +-- }}} + +-- {{{ Wibox initialisation +local wibox = {} +local promptbox = {} +local layoutbox = {} +local taglist = {} +taglist.buttons = awful.util.table.join( + awful.button({ }, 1, awful.tag.viewonly), + awful.button({ modkey }, 1, awful.client.movetotag), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, awful.client.toggletag), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev)) + +local tasklist = {} +tasklist.buttons = awful.util.table.join( + awful.button({ }, 1, + function(c) + if not c:isvisible() then + awful.tag.viewonly(c:tags()[1]) + end + client.focus = c + c:raise() + end), + awful.button({ }, 3, + function() + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ width = 250 }) + end + end), + awful.button({ }, 4, + function() + awful.client.focus.byidx(1) + if client.focus then + client.focus:raise() + end + end), + awful.button({ }, 5, + function() + awful.client.focus.byidx(-1) + if client.focus then + client.focus:raise() + end + end) +) + + +for s = 1, screen.count() do + -- Create a promptbox + promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- Create a layoutbox + layoutbox[s] = awful.widget.layoutbox(s) + layoutbox[s]:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), + awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end) + )) + + -- Create a taglist widget + taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, taglist.buttons) + + -- Create a tasklist widget + tasklist[s] = awful.widget.tasklist( + function(c) + return awful.widget.tasklist.label.currenttags(c, s) + end, + tasklist.buttons + ) + + -- Create the wibox + wibox[s] = awful.wibox({ + position = "top", screen = s, + fg = beautiful.fg_normal, bg = beautiful.bg_normal + }) + -- Add widgets to the wibox + wibox[s].widgets = {{ + launcher, taglist[s], layoutbox[s], promptbox[s], + layout = awful.widget.layout.horizontal.leftright + }, + s == screen.count() and systray or nil, + spacer, datewidget, + separator, volwidget, + separator, batwidget, + separator, cpuwidget, + separator, thermalwidget, + separator, cmus, + separator, tasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} +-- }}} + +-- {{{ Mouse bindings +root.buttons(awful.util.table.join( + awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = awful.util.table.join( + awful.key({}, "XF86AudioMute", function() sexec("amixer sset PCM toggle") end ), + awful.key({}, "XF86AudioRaiseVolume", function() sexec("amixer set PCM 2%+") end ), + awful.key({}, "XF86AudioLowerVolume", function() sexec("amixer set PCM 2%-") end ), + awful.key({}, "XF86AudioNext", function() sexec("cmus-remote --next") end ), + awful.key({}, "XF86AudioPrev", function() sexec("cmus-remote --prev") end ), + awful.key({}, "XF86AudioPlay", function() sexec("cmus-remote --pause") end ), + awful.key({}, "XF86AudioStop", function() sexec("scrot -e 'mv $f ~/bilder/screenshots'") end ), --fn - up + awful.key({}, "XF86Tools", function() sexec("") end ), + awful.key({}, "XF86Calculator", function() sexec("") end ), + awful.key({}, "XF86Launch1", function() sexec("") end ), --ThinkVantage + awful.key({}, "XF86ScreenSaver", function() sexec("xlock -mode blank") end ), --fn - f2 + awful.key({}, "XF86Sleep", function() sexec("sudo pm-suspend") end ), --fn - f4 + awful.key({}, "XF86WebCam", function() sexec("~/bin/bluetooth-toggle.sh") end ), --fn - f6 + awful.key({}, "XF86Display", function() sexec("") end ), --fn - f7 + awful.key({}, "XF86TouchpadToggle", function() sexec("~/bin/touchpad-toggle.sh") end ), --fn - f8 + -- awful.key({}, "XF86MyComputer", function() sexec(commands.fileman) end ), + -- awful.key({}, "XF86Mail", function() sexec(commands.mail) end ), + -- awful.key({}, "XF86HomePage", function() sexec(commands.browser) end ), + -- awful.key({}, "XF86Sleep", function() sexec(commands.lock) end ), + -- awful.key({"Control", "Mod1"}, "l", function() sexec(commands.lock) end ), + + --default bindings + awful.key({ modkey, }, "Left", awful.tag.viewprev ), + awful.key({ modkey, }, "Right", awful.tag.viewnext ), + awful.key({ modkey, }, "Escape", awful.tag.history.restore), + + awful.key({ modkey, }, "n", + function () + awful.client.focus.byidx( 1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "k", + function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "n", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "Return", function () exec(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + + -- Prompt + awful.key({ modkey }, "r", function () promptbox[mouse.screen]:run() end), + -- Run stuff in a Terminal + awful.key({ modkey }, "x", function () + awful.prompt.run({ prompt = "Run in Terminal: " }, promptbox[mouse.screen].widget, + function (prog) + sexec(terminal .. " -name " .. prog .. " -e /bin/zsh -c " .. prog) + end) + end) +) + +clientkeys = awful.util.table.join( + awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), + awful.key({ modkey, }, "o", awful.client.movetoscreen ), + awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), + awful.key({ modkey, }, "j", function (c) c.minimized = not c.minimized end), + awful.key({ modkey, }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical + end) +) + +-- Compute the maximum number of digit we need, limited to 9 +keynumber = 0 +for s = 1, screen.count() do + keynumber = math.min(9, math.max(#tags[s], keynumber)); +end + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewtoggle(tags[screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.movetotag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end)) +end + +clientbuttons = awful.util.table.join( + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button({ modkey }, 1, awful.mouse.client.move), + awful.button({ modkey }, 3, awful.mouse.client.resize)) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = true, + keys = clientkeys, + buttons = clientbuttons } }, + --floating apps + { rule = { class = "pinentry-qt4" }, + properties = { floating = true } }, + { rule = { class = "pinentry-gtk-2" }, + properties = { floating = true } }, + { rule = { class = "Gimp" }, + properties = { floating = true } }, + --apptags + --downloading stuff + { rule = { class = "JDownloader" }, + properties = { tag = tags[screen.count()][1],switchtotag = false } }, + { rule = { instance = "rtorrent" }, + properties = { tag = tags[screen.count()][1],switchtotag = false } }, + -- mail + { rule = { class = "Thunderbird" }, + properties = { tag = tags[screen.count()][2],switchtotag = false } }, + --pidgin + { rule = { class = "Pidgin" }, + properties = { tag = tags[1][3],switchtotag = false } }, + -- cmus + { rule = { instance = "cmus" }, + properties = { tag = tags[screen.count()][4],switchtotag = false } }, + -- news + { rule = { instance = "newsbeuter" }, + properties = { tag = tags[screen.count()][5],switchtotag = false } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.add_signal("manage", function (c, startup) + -- Add a titlebar + -- awful.titlebar.add(c, { modkey = modkey }) + -- remove gaps + c.size_hints_honor = false + + -- Enable sloppy focus + c:add_signal("mouse::enter", function(c) + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end + end) + + if not startup then + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- awful.client.setslave(c) + + -- Put windows in a smart way, only if they does not set an initial position. + if not c.size_hints.user_position and not c.size_hints.program_position then + awful.placement.no_overlap(c) + awful.placement.no_offscreen(c) + end + end +end) + +client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} + +-- {{{ Autostart +--os.execute("blueman-applet &") +-- }}} + +-- vim: fdm=marker fdl=0 sts=4 ai diff --git a/.config/dircolors/dircolors.256dark b/.config/dircolors/dircolors.256dark new file mode 100644 index 0000000..db0378e --- /dev/null +++ b/.config/dircolors/dircolors.256dark @@ -0,0 +1,258 @@ + +# Dark 256 color solarized theme for the color GNU ls utility. +# Used and tested with dircolors (GNU coreutils) 8.5 +# +# @author {@link http://sebastian.tramp.name Sebastian Tramp} +# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL) +# +# More Information at +# https://github.com/seebi/dircolors-solarized + +# Term Section +TERM Eterm +TERM ansi +TERM color-xterm +TERM con132x25 +TERM con132x30 +TERM con132x43 +TERM con132x60 +TERM con80x25 +TERM con80x28 +TERM con80x30 +TERM con80x43 +TERM con80x50 +TERM con80x60 +TERM cons25 +TERM console +TERM cygwin +TERM dtterm +TERM eterm-color +TERM gnome +TERM gnome-256color +TERM jfbterm +TERM konsole +TERM kterm +TERM linux +TERM linux-c +TERM mach-color +TERM mlterm +TERM putty +TERM rxvt +TERM rxvt-256color +TERM rxvt-cygwin +TERM rxvt-cygwin-native +TERM rxvt-unicode +TERM rxvt-unicode256 +TERM rxvt-unicode-256color +TERM screen +TERM screen-256color +TERM screen-256color-bce +TERM screen-bce +TERM screen-w +TERM screen.linux +TERM vt100 +TERM xterm +TERM xterm-16color +TERM xterm-256color +TERM xterm-88color +TERM xterm-color +TERM xterm-debian + +## Documentation +# +# standard colors +# +# Below are the color init strings for the basic file types. A color init +# string consists of one or more of the following numeric codes: +# Attribute codes: +# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed +# Text color codes: +# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white +# Background color codes: +# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white +# +# +# 256 color support +# see here: http://www.mail-archive.com/[email protected]/msg11030.html) +# +# Text 256 color coding: +# 38;5;COLOR_NUMBER +# Background 256 color coding: +# 48;5;COLOR_NUMBER + +## Special files + +NORMAL 00;38;5;244 # no color code at all +#FILE 00 # regular file: use no color at all +RESET 0 # reset to "normal" color +DIR 00;38;5;33 # directory 01;34 +LINK 01;38;5;37 # symbolic link. (If you set this to 'target' instead of a + # numerical value, the color is as for the file pointed to.) +MULTIHARDLINK 00 # regular file with more than one link +FIFO 48;5;230;38;5;136;01 # pipe +SOCK 48;5;230;38;5;136;01 # socket +DOOR 48;5;230;38;5;136;01 # door +BLK 48;5;230;38;5;244;01 # block device driver +CHR 48;5;230;38;5;244;01 # character device driver +ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file +SETUID 48;5;160;38;5;230 # file that is setuid (u+s) +SETGID 48;5;136;38;5;230 # file that is setgid (g+s) +CAPABILITY 30;41 # file with capability +STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w) +OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky +STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable +# This is for files with execute permission: +EXEC 01;38;5;64 + +## Archives or compressed (violet + bold for compression) +.tar 00;38;5;61 +.tgz 01;38;5;61 +.arj 01;38;5;61 +.taz 01;38;5;61 +.lzh 01;38;5;61 +.lzma 01;38;5;61 +.tlz 01;38;5;61 +.txz 01;38;5;61 +.zip 01;38;5;61 +.z 01;38;5;61 +.Z 01;38;5;61 +.dz 01;38;5;61 +.gz 01;38;5;61 +.lz 01;38;5;61 +.xz 01;38;5;61 +.bz2 01;38;5;61 +.bz 01;38;5;61 +.tbz 01;38;5;61 +.tbz2 01;38;5;61 +.tz 01;38;5;61 +.deb 01;38;5;61 +.rpm 01;38;5;61 +.jar 01;38;5;61 +.rar 01;38;5;61 +.ace 01;38;5;61 +.zoo 01;38;5;61 +.cpio 01;38;5;61 +.7z 01;38;5;61 +.rz 01;38;5;61 +.apk 01;38;5;61 + +# Image formats (yellow) +.jpg 00;38;5;136 +.JPG 00;38;5;136 #stupid but needed +.jpeg 00;38;5;136 +.gif 00;38;5;136 +.bmp 00;38;5;136 +.pbm 00;38;5;136 +.pgm 00;38;5;136 +.ppm 00;38;5;136 +.tga 00;38;5;136 +.xbm 00;38;5;136 +.xpm 00;38;5;136 +.tif 00;38;5;136 +.tiff 00;38;5;136 +.png 00;38;5;136 +.svg 00;38;5;136 +.svgz 00;38;5;136 +.mng 00;38;5;136 +.pcx 00;38;5;136 +.dl 00;38;5;136 +.xcf 00;38;5;136 +.xwd 00;38;5;136 +.yuv 00;38;5;136 +.cgm 00;38;5;136 +.emf 00;38;5;136 +.eps 00;38;5;136 +.CR2 00;38;5;136 +.ico 00;38;5;136 + +# Files of special interest (base1 + bold) +.tex 01;38;5;245 +.rdf 01;38;5;245 +.owl 01;38;5;245 +.n3 01;38;5;245 +.ttl 01;38;5;245 +.nt 01;38;5;245 +.torrent 01;38;5;245 +*Makefile 01;38;5;245 +*Rakefile 01;38;5;245 +*build.xml 01;38;5;245 +*rc 01;38;5;245 +*1 01;38;5;245 +.nfo 01;38;5;245 +*README 01;38;5;245 +*README.txt 01;38;5;245 +*readme.txt 01;38;5;245 +*README.md 01;38;5;245 +*README.markdown 01;38;5;245 +*ini 01;38;5;245 +*yml 01;38;5;245 +*cfg 01;38;5;245 +*conf 01;38;5;245 + +# "unimportant" files as logs and backups (base01) +.log 00;38;5;240 +.bak 00;38;5;240 +.aux 00;38;5;240 +.bbl 00;38;5;240 +.blg 00;38;5;240 +*~ 00;38;5;240 +*# 00;38;5;240 +.part 00;38;5;240 +.incomplete 00;38;5;240 +.swp 00;38;5;240 +.tmp 00;38;5;240 +.temp 00;38;5;240 +.o 00;38;5;240 +.pyc 00;38;5;240 +.class 00;38;5;240 +.cache 00;38;5;240 + +# Audio formats (orange) +.aac 00;38;5;166 +.au 00;38;5;166 +.flac 00;38;5;166 +.mid 00;38;5;166 +.midi 00;38;5;166 +.mka 00;38;5;166 +.mp3 00;38;5;166 +.mpc 00;38;5;166 +.ogg 00;38;5;166 +.ra 00;38;5;166 +.wav 00;38;5;166 +.m4a 00;38;5;166 +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axa 00;38;5;166 +.oga 00;38;5;166 +.spx 00;38;5;166 +.xspf 00;38;5;166 + +# Video formats (as audio + bold) +.mov 01;38;5;166 +.mpg 01;38;5;166 +.mpeg 01;38;5;166 +.m2v 01;38;5;166 +.mkv 01;38;5;166 +.ogm 01;38;5;166 +.mp4 01;38;5;166 +.m4v 01;38;5;166 +.mp4v 01;38;5;166 +.vob 01;38;5;166 +.qt 01;38;5;166 +.nuv 01;38;5;166 +.wmv 01;38;5;166 +.asf 01;38;5;166 +.rm 01;38;5;166 +.rmvb 01;38;5;166 +.flc 01;38;5;166 +.avi 01;38;5;166 +.fli 01;38;5;166 +.flv 01;38;5;166 +.gl 01;38;5;166 +.m2ts 01;38;5;166 +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axv 01;38;5;166 +.anx 01;38;5;166 +.ogv 01;38;5;166 +.ogx 01;38;5;166 + + diff --git a/.config/newsbeuter/config b/.config/newsbeuter/config new file mode 100644 index 0000000..49168f5 --- /dev/null +++ b/.config/newsbeuter/config @@ -0,0 +1,84 @@ +#newsbeuter 2.4 config - notizblock + +#color <element> <foreground color> <background color> [<attribute> ...] +color listnormal yellow default +color listfocus color166 color237 bold +color info color237 color250 +color background red default +color article yellow default + + +#newsbeuter via proxy +#in this case -> polipo (tor) +use-proxy yes +proxy localhost:8118 +download-retries 4 +download-timeout 30 + +#reload stuff +reload-threads 10 #parallel reload threads. +auto-reload yes #auto reload stuff +reload-time 20 #min +refresh-on-startup yes + +#use this useragent to get osvdb feed +user-agent "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)" + +#various +max-items 200 #number of feeds to hold in db +goto-next-feed yes +#FF3.5 (requires config: browser.tabs.loadDivertedInBackground to be 'true') +browser "firefox -new-tab %u > /dev/null 2>&1" +cleanup-on-quit yes #cleanup is always nice + +#visibility of feeds +show-read-feeds no #list read feeds ? +show-read-articles no #list read articles ? + +#files (~/.local/share/newsbeuter and ~/.config/newsbeuter) +save-path "~/" #where to save feeds + +#kill files +ignore-article "*" "title =~ \"CSI\"" +ignore-article "*" "title =~ \"more rss feeds from\"" +ignore-article "*" "title =~ \"[iI]P[ao]d\"" +ignore-article "*" "title =~ \"iPhone\"" +ignore-article "*" "title =~ \"Windows Phone 7\"" +ignore-article "*" "title =~ \"Alm\"" +ignore-article "http://lwn.net/headlines/rss" "title =~ \"\[\$\]\"" + +#key bindings +bind-key c next-unread-feed +bind-key x prev-unread-feed +bind-key m toggle-article-read +bind-key ^B pageup +bind-key ^F pagedown +bind-key H pageup +bind-key L pagedown +bind-key k up +bind-key j down +bind-key d save +bind-key s sort +bind-key S revsort +bind-key O open-in-browser +bind-key o open-in-browser-and-mark-read +bind-key b bookmark + +#bookmark +bookmark-cmd "~/bin/instapaper.py" + +#layout +datetime-format "%d.%m %H:%M" +text-width 0 #max text width to render html +display-article-progress yes +show-keymap-hint no #keyboard hints ? +always-display-description true +#feedlist-format "%4i %n %11u %t +article-sort-order date # parameter syntax: <sortfield>[-<direction>] +articlelist-format "%4i %f %D %?T?|%-17T| ?%t" + +#always download this feed -> ignore last-modification timestamp +always-download "http://www.movie-blog.org/feed/rss" + +#reset unread flag when feed gets updated after reading +reset-unread-on-update "http://blog.fefe.de/rss.xml?html" diff --git a/.ctags b/.ctags new file mode 100644 index 0000000..9530624 --- /dev/null +++ b/.ctags @@ -0,0 +1,18 @@ +--langdef=latex +--langmap=latex:.tex +--regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/part \2/s,part/ +--regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/part \1/s,part/ +--regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/ \2/s,chapter/ +--regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/ \1/s,chapter/ +--regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\. \2/s,section/ +--regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\. \1/s,section/ +--regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\. \2/s,subsection/ +--regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\. \1/s,subsection/ +--regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\.\. \2/s,subsubsection/ +--regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\.\. \1/s,subsubsection/ +--regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic/ +--regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/L,listing/ +--regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/ +--regex-latex=/\\ref[[:space:]]*\{([^}]+)\}/\1/r,ref/ +--regex-latex=/\\pageref[[:space:]]*\{([^}]+)\}/\1/p,pageref/ +--regex-make=/^([^:# \t]+)[ \t]*[:]{1,2}/\1/t,targets/ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +* diff --git a/.pentadactylrc b/.pentadactylrc new file mode 100644 index 0000000..eb08132 --- /dev/null +++ b/.pentadactylrc @@ -0,0 +1,9 @@ +" File: .pentadactylrc +" Author: nblock <nblock [/at\] archlinux DOT us> +" Description: +" Last Modified: September 15, 2011 + +"default search engine is duckduckgo (keyword: ddg) +set defsearch=ddg + +" vim:set ft=vim diff --git a/.rtorrent.rc b/.rtorrent.rc new file mode 100644 index 0000000..58c38aa --- /dev/null +++ b/.rtorrent.rc @@ -0,0 +1,112 @@ +# This is an example resource file for rTorrent. Copy to +# ~/.rtorrent.rc and enable/modify the options as needed. Remember to +# uncomment the options you wish to enable. + +# Maximum and minimum number of peers to connect to per torrent. +min_peers = 40 +max_peers = 100 + +# Same as above but for seeding completed torrents (-1 = same as downloading) +min_peers_seed = 10 +max_peers_seed = 50 + +# Maximum number of simultanious uploads per torrent. +#max_uploads = 15 + +# Global upload and download rate in KiB. "0" for unlimited. +#download_rate = 0 +#upload_rate = 0 + +# Default directory to save the downloaded torrents. +directory = ~/download/rtorrent/tmp + +# Default session directory. Make sure you don't run multiple instance +# of rtorrent using the same session directory. Perhaps using a +# relative path? +session = ~/download/rtorrent/tmp/.session + +#move completed files +system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/download/rtorrent;d.set_directory=~/download/rtorrent" +# Watch a directory for new torrents, and stop those that have been deleted. +schedule = watch_directory,10,10,load_start=~/download/rtorrent/watch/*.torrent +#schedule = tied_directory,10,10,start_tied= +schedule = untied_directory,10,10,close_untied= + +# Close torrents when diskspace is low. +schedule = low_diskspace,5,60,close_low_diskspace=100M + +# Change the limits, the defaults should be sufficient. +ratio.min.set=100 +ratio.max.set=300 +ratio.upload.set=20M + +# Changing the command triggered when the ratio is reached. +system.method.set = group.seeding.ratio.command, d.close=, d.erase= + +# The ip address reported to the tracker. +ip = 127.0.0.1 +ip = rakshasa.no + +# The ip address the listening socket and outgoing connections is +# bound to. +#bind = 127.0.0.1 +#bind = rakshasa.no + +# Port range to use for listening. +#port_range = 6890-6999 + +# Start opening ports at a random position within the port range. +#port_random = no + +# Check hash for finished torrents. Might be usefull until the bug is +# fixed that causes lack of diskspace not to be properly reported. +#check_hash = no + +# Set whetever the client should try to connect to UDP trackers. +use_udp_trackers = yes + +# Alternative calls to bind and ip that should handle dynamic ip's. +#schedule = ip_tick,0,1800,ip=rakshasa +#schedule = bind_tick,0,1800,bind=rakshasa + +# Encryption options, set to none (default) or any combination of the following: +# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext +# +# The example value allows incoming encrypted connections, starts unencrypted +# outgoing connections but retries with encryption if they fail, preferring +# plaintext to RC4 encryption after the encrypted handshake +# +encryption = allow_incoming,enable_retry,prefer_plaintext + +# Enable DHT support for trackerless torrents or when all trackers are down. +# May be set to "disable" (completely disable DHT), "off" (do not start DHT), +# "auto" (start and stop DHT as needed), or "on" (start DHT immediately). +# The default is "off". For DHT to work, a session directory must be defined. +# +dht = on + +# UDP port to use for DHT. +# +dht_port = 6881 + +# Enable peer exchange (for torrents not marked private) +# +peer_exchange = yes + +# +# Do not modify the following parameters unless you know what you're doing. +# + +# Hash read-ahead controls how many MB to request the kernel to read +# ahead. If the value is too low the disk may not be fully utilized, +# while if too high the kernel might not be able to keep the read +# pages in memory thus end up trashing. +#hash_read_ahead = 10 + +# Interval between attempts to check the hash, in milliseconds. +#hash_interval = 100 + +# Number of attempts to check the hash while using the mincore status, +# before forcing. Overworked systems might need lower values to get a +# decent hash checking rate. +#hash_max_tries = 10 diff --git a/.vim/after/syntax/tex.vim b/.vim/after/syntax/tex.vim new file mode 100644 index 0000000..70ff7eb --- /dev/null +++ b/.vim/after/syntax/tex.vim @@ -0,0 +1 @@ +:setlocal isk+=:,- diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..7f17cbc --- /dev/null +++ b/.vimrc @@ -0,0 +1,191 @@ +" File: .vimrc +" Author: nblock <nblock [/at\] archlinux DOT us> +" Description: just another .vimrc +" Last Modified: Dezember 10th, 2011 + +set nocompatible +set nobackup +set nowritebackup +set noswapfile +set showmode " always display current mode +set showcmd " always display current command +set showmatch " show matching brackets (),{},[] +set mat=3 " show matching brackets for 0.3 seconds +set encoding=utf-8 " use utf-8 everywhere +set fileencoding=utf-8 " use utf-8 everywhere +set termencoding=utf-8 " use utf-8 everywhere +set backspace=indent,eol,start " more flexible backspace +set mouse=a " enable mouse usage in all modes +set incsearch " jump to match during searching +set hlsearch " highlight search +set ttyfast " fast terminal connection +set scrolloff=4 " 4 lines above/below cursor when scrolling +set listchars=tab:▸\ ,eol:¬ " different symbols for tabs and eol +set nomodeline " use secure modeline +set tabpagemax=30 " 30 instead of 10 concurrent tabs +set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos + +" use a terminal title +set title +set titlestring=%F\ [vim] + +" tab settings +set tabstop=2 " tab character amount +set expandtab " tabs as space +set autoindent +set smartindent " smart autoindenting on a new line +set shiftwidth=2 " set spaces for autoindent +set softtabstop=2 + +" statusline +set laststatus=2 +set statusline=%<%F\ %h%m%r%=%k\ %-10.(%l/%L,%c%V%)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y + +" vundle settings +filetype off "required by vundle +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() + +"plugins managed by vundle +Bundle 'gmarik/vundle' +Bundle 'tpope/vim-surround' +Bundle 'tpope/vim-repeat' +Bundle 'tpope/vim-speeddating' +Bundle 'godlygeek/tabular' +Bundle 'git://gitorious.org/vim-gnupg/vim-gnupg.git' +Bundle 'matchit.zip' +Bundle 'paster.vim' +Bundle 'fs111/pydoc.vim' +Bundle 'majutsushi/tagbar' +Bundle 'git://git.wincent.com/command-t.git' +Bundle 'ciaranm/securemodelines' +Bundle 'scrooloose/nerdcommenter' +Bundle 'AutoComplPop' +Bundle 'drmingdrmer/xptemplate' +Bundle 'file:///$HOME/development/xptemplate-snippets' +Bundle 'nblock/vim-dokuwiki' +Bundle 'SudoEdit.vim' +Bundle 'altercation/vim-colors-solarized' +Bundle 'TeX-PDF' + +filetype plugin indent on " required by vundle + +" switch spellcheck languages +let g:myLang = 0 +let g:myLangList = [ "nospell", "de", "en" ] +function! MySpellLang() + " loop through languages + let g:myLang = g:myLang + 1 + if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif + if g:myLang == 0 | set nospell | endif + if g:myLang == 1 | setlocal spell spelllang=de | endif + if g:myLang == 2 | setlocal spell spelllang=en | endif + echo "language:" g:myLangList[g:myLang] +endf + +" call the python version that is specified in the shebang +" in Arch Linux, `python` is Python 3.x +function! ExecSpecifiedPython() + let lc = getline(1) + + " check if shebang is present + if stridx(lc, "python") == -1 + let py = '!/usr/bin/python2 "%"' " default to python2 + else + let lc = substitute(lc,"#", "", "g") + let lc = substitute(lc,"env ", "", "g") + let py = lc . ' "%"' + endif + exec py +endfunction + +" cleaning up +function! Preserve(command) + " Preparation: save last search, and cursor position. + let _s=@/ + let l = line(".") + let c = col(".") + " Do the business: + execute a:command + " Clean up: restore previous search history, and cursor position + let @/=_s + call cursor(l, c) +endfunction + +" shortcuts and mappings +let mapleader = "," +nnoremap <F2> :set invpaste paste?<CR> +imap <F2> <C-O><F2> +set pastetoggle=<F2> +map <F3> :nohlsearch<CR> +autocmd FileType python map <F5> :w<CR>:call ExecSpecifiedPython()<CR> +autocmd FileType tex map <F5> :w<CR>:!latexmk -pdf "%"<CR> +map <F6> :w<CR>:!make<CR> +vmap <F9> :!xclip -f -sel clip<CR> +map <F10> :-1r !xclip -o -sel clip<CR> +nnoremap <silent> <F11> :TagbarToggle<CR> +map <F12> <C-]> +map <F7> :call MySpellLang()<CR> +imap <F7> <C-o>:call MySpellLang()<CR> +nmap <leader>$ :call Preserve("%s/\\s\\+$//e")<CR> +nmap <leader>= :call Preserve("normal gg=G")<CR> + +" switch between buffers +nnoremap <leader>j <C-w>j +nnoremap <leader>k <C-w>k +nnoremap <leader>h <C-w>h +nnoremap <leader>l <C-w>l +nnoremap <leader>w <C-w>w +nnoremap <leader><space> <C-w>r + +" enable very magic forward/backward search +nnoremap / /\v +vnoremap / /\v +nnoremap ? ?\v +vnoremap ? ?\v + +let g:tex_flavor = "latex" " assume latex as default tex + +" vim-pydiction +filetype plugin on +let g:pydiction_location = '/usr/share/pydiction/complete-dict' + +" tagbar +autocmd BufWinEnter *.py,*.tex,*.c nested TagbarOpen "open tagbar on certain filetypes +let g:tagbar_type_tex = { + \ 'ctagstype' : 'latex', + \ 'kinds' : [ + \ 's:sections', + \ 'g:graphics', + \ 'l:labels', + \ 'r:refs:1', + \ 'L:listings', + \ 'p:pagerefs:1' + \ ], + \ 'sort' : 0, + \ } + +"AutoComplPop +let g:acp_behaviorKeywordLength=4 "start matching after 4 consecutive chars -> less cpu consumption + +" xptemplate +" custom settings in xptemplate/personal/ftplugin/ +let g:xptemplate_key = '<Plug>triggerxpt' +let g:xptemplate_key_pum_only = '<C-r><Tab>' +let g:xptemplate_nav_prev = '<S-Tab>' +inoremap <Plug>closePUM <C-v><C-v><BS> +imap <TAB> <Plug>closePUM<Plug>triggerxpt +let g:xptemplate_fallback = 'nore:<TAB>' +let g:xptemplate_vars = "SParg=" + +" settings for different filetypes +autocmd BufNewFile,BufRead PKGBUILD setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab +autocmd FileType tex setlocal textwidth=120 tabstop=2 shiftwidth=2 softtabstop=2 expandtab smartindent autoindent +autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab smartindent autoindent foldmethod=indent +autocmd FileType python setlocal omnifunc=pythoncomplete#Complete " change omnifunc for python +autocmd BufWritePre *.py,*.tex :call Preserve("%s/\\s\\+$//e") " clean up whitespaces for certain filetypes + +" colorscheme settings +syntax enable +set background=dark +colorscheme solarized diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..eab8d92 --- /dev/null +++ b/.xinitrc @@ -0,0 +1,8 @@ +#!/bin/sh +eval "$(gpg-agent --daemon)" +urxvtd -q -f -o +ck-launch-session nm-applet & +xrdb -load ~/.Xresources +xmodmap .Xmodmap & +#setxkbmap -layout de,de -variant neo,basic -model pc106 -option -option grp:sclk_toggle -option grp_led:scroll +exec awesome diff --git a/.zprofile b/.zprofile new file mode 100644 index 0000000..9985e09 --- /dev/null +++ b/.zprofile @@ -0,0 +1 @@ +. $HOME/.zshrc diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..63f4907 --- /dev/null +++ b/.zshrc @@ -0,0 +1,212 @@ +# load arch default settings +if [ -r /etc/profile ] ; then +. /etc/profile +fi + +# history and directory stack config +HISTFILE=~/.zsh_history +HISTSIZE=10000 +SAVEHIST=10000 +DIRSTACKSIZE=100 +setopt HIST_IGNORE_SPACE # commands with at least one space get ignored +setopt INC_APPEND_HISTORY # share history between sessions +setopt HIST_IGNORE_ALL_DUPS # ignore history dups +setopt AUTO_PUSHD # use automated directory stack +setopt PUSHD_IGNORE_DUPS # ignore directory stack dups + +# colors +eval `dircolors .config/dircolors/dircolors.256dark` + +# stuff +setopt AUTOCD # autocd into dirs +setopt EXTENDEDGLOB # use extended globbing +setopt CORRECTALL # use autocorrection for commands and args +setopt NOBEEP # avoid "beep"ing +setopt prompt_subst # Enables additional prompt extentions +stty stop "" # disable <ctrl-s> and <ctrl-q> + +# environment variables +export EDITOR=vim +export BROWSER=firefox +export LANG=de_AT.UTF-8 +export TERM=rxvt-unicode-256color +export GPG_TTY=`tty` +PATH=$HOME/bin:$PATH +typeset -U PATH + +# colors +autoload -U colors && colors + +# set color vars +for COLOR in RED GREEN BLUE YELLOW; do + eval CN_$COLOR='%{$fg[${(L)COLOR}]%}' + eval CB_$COLOR='%{$fg_bold[${(L)COLOR}]%}' +done +C_RESET="%{${reset_color}%}"; + +# autocompletion +autoload -U compinit +compinit +zstyle ':completion:*' menu select # menu driven autocomplete +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache +zstyle ':completion:*' accept-exact '*(N)' + +# version control info +autoload -Uz vcs_info +zstyle ':vcs_info:*' enable git svn +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' unstagedstr "${CN_RED}▶" # red sign if there are unstaged changes +zstyle ':vcs_info:*' stagedstr "${CN_YELLOW}▶" # yellow sign if there are staged changes +zstyle ':vcs_info:*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${C_RESET}" +zstyle ':vcs_info:(git):*' formats "${CN_GREEN}%s${CB_BLUE}@${CB_RED}%b${CN_BLUE}:${CB_RED}%u%c${C_RESET}" +zstyle ':vcs_info:*' branchformats "%b:%r" +function precmd { + vcs_info 'prompt' +} + +# default prompt +PROMPT=$'${CN_GREEN}%n${CB_BLUE}@${CB_RED}%m ${CN_BLUE}%~ ${CB_GREEN}$ ${C_RESET}' +RPROMPT='${vcs_info_msg_0_}' + +# prompt for loops +PROMPT2='{%_} ' + +# prompt for selections +PROMPT3='{ … } ' + +# So far I don't use "setopt xtrace", so I don't need this prompt +PROMPT4='' + +# auto extension alias +alias -s txt=$EDITOR +alias -s PKGBUILD=$EDITOR + +# no autocorrection for mv and cp +alias mv='nocorrect mv' +alias cp='nocorrect cp' + +# normal alias +alias ls='ls --color=auto -F' +alias ll='ls -lh' +alias la='ls -a' +alias e=$EDITOR +alias se='sudo $EDITOR' +alias grep='grep --color=auto' +alias p='sudo pacman' +alias y='yaourt' +alias popt='sudo pacman-optimize && sync' +alias info='echo Dependencies: && pacman -Qd | wc -l && echo Explicitly: && pacman -Qe | wc -l && echo Total: && pacman -Q | wc -l' +alias R='y -Rscn' +alias Syu='y -Syu' +alias S='y -S' +alias Ss='y -Ss' +alias clean='y -Qdt && y -Scc' +alias su='su -' +alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME' + +# alias for git +alias ga='git add' +alias gpush='git push' +alias gs='git status -sb' +alias gd='git diff' +alias gdc='git diff --cached' +alias gm='git commit -m' +alias gma='git commit -am' +alias gb='git branch' +alias gc='git checkout' +alias gra='git remote add' +alias grr='git remote rm' +alias gpull='git pull' +alias gcl='git clone' +alias gl='git log' +alias glo='git log --oneline --graph --decorate' +gldate() { + before=`date -d "$(date +$1) -1 day" +'%Y-%m-%d'` + git log --oneline --graph --decorate --since="$before" --until="$1" +} + +# key bindings (vim mode) +bindkey -v +bindkey "\e[7~" beginning-of-line +bindkey "\e[8~" end-of-line +bindkey "\e[5~" beginning-of-history +bindkey "\e[6~" end-of-history +bindkey "\e[3~" delete-char +bindkey "\e[2~" quoted-insert +bindkey "\e[5C" forward-word +bindkey "\eOc" emacs-forward-word +bindkey "\e[5D" backward-word +bindkey "\eOd" emacs-backward-word +bindkey "\ee[C" forward-word +bindkey "\ee[D" backward-word +bindkey "\^H" backward-delete-word + +# completion in the middle of a line +bindkey '^i' expand-or-complete-prefix +bindkey '^R' history-incremental-search-backward +bindkey '\e[A' history-beginning-search-backward +bindkey '\e[B' history-beginning-search-forward + +# hashes +hash -d da=~/fh-hagenberg/da + +# extract various files with x $arg +function x() +{ + if [ -f "$1" ] ; then + case "$1" in + *.tar.bz2) tar xjf "$1" ;; + *.tar.gz) tar xzf "$1" ;; + *.tar.bz) tar xzf "$1" ;; + *.tar.Z) tar xzf "$1" ;; + *.bz2) bunzip2 "$1" ;; + *.rar) unrar x "$1" ;; + *.gz) gunzip "$1" ;; + *.jar) unzip "$1" ;; + *.tar) tar xf "$1" ;; + *.tbz2) tar xjf "$1" ;; + *.tgz) tar xzf "$1" ;; + *.zip) unzip "$1" ;; + *.Z) uncompress "$1" ;; + *.7z) 7z x "$1" ;; + *) echo "'$1' cannot be extracted." ;; + esac + else + echo "'$1' is not a valid archive." + fi +} + +# generate a random password +function random(){ + < /dev/urandom tr -dc '[](){}?!.,;_A-Z-a-z-0-9' | head -c${1:-20};echo; +} + +# obtain public ip addresses (v4 and v6) if available +function hostip(){ + IPV6=`curl -s ipv6.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` + IPV4=`curl -s ipv4.icanhazipv6.com |grep my_address |sed -e 's/.*>\(.*\)<\/p>/\1/'` + if [ -z "$IPV6" ]; then + echo "IPv6: -" + else + echo "IPv6: ${IPV6}" + fi + if [ -z "$IPV4" ]; then + echo "IPv4: -" + else + echo "IPv4: ${IPV4}" + fi +} + +# serve local dir via http +function serve(){ + SERVE_PORT=8080 + echo "listening on:" + ip addr s | grep -Eo 'inet [^/]*' | sort | uniq |awk -v P=$SERVE_PORT '{print " - " $2 ":" P}' + python -m http.server $SERVE_PORT 1>/dev/null + unset $SERVE_PORT +} + +# a shortcut for cropping pages with pdfcrop +function crop() + pdfcrop --pdftexcmd pdflatex --margins 2 "$1" "${1%.pdf}-cropped.pdf" diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..23e20d3 --- /dev/null +++ b/README.markdown @@ -0,0 +1,12 @@ +Arch Linux Configs +============= + +Clean +============= +![Arch 2011-02-24](http://ompldr.org/vN2poYg) +<p>[Full Version](http://ompldr.org/vN2poYg)</p> + +Dirty +============= +![Arch 2011-02-24](http://ompldr.org/vN2poZA) +<p>[Full Version](http://ompldr.org/vN2poZA)</p> diff --git a/bin/bluetooth-toggle.sh b/bin/bluetooth-toggle.sh new file mode 100755 index 0000000..4eeb937 --- /dev/null +++ b/bin/bluetooth-toggle.sh @@ -0,0 +1,6 @@ +#!/bin/bash +if [ `rfkill list 1 |grep "Soft blocked: yes" |wc -l` -eq 0 ]; then + sudo rfkill block 1 +else + sudo rfkill unblock 1 +fi diff --git a/bin/screenoff b/bin/screenoff new file mode 100755 index 0000000..94faa37 --- /dev/null +++ b/bin/screenoff @@ -0,0 +1,3 @@ +#!/bin/bash +xrandr --output HDMI1 --off --output LVDS1 --mode 1440x900 --pos 0x0 --primary +awsetbg -R ~/bilder/wallpaper/1400x1050/ diff --git a/bin/screenon b/bin/screenon new file mode 100755 index 0000000..4dd0fe7 --- /dev/null +++ b/bin/screenon @@ -0,0 +1,3 @@ +#!/bin/bash +xrandr --output HDMI1 --mode 1920x1080 --pos 0x0 --output LVDS1 --mode 1440x900 --pos 1920x0 --primary +awsetbg -R ~/bilder/wallpaper/1920x1080/ diff --git a/bin/touchpad-toggle.sh b/bin/touchpad-toggle.sh new file mode 100755 index 0000000..5de34bc --- /dev/null +++ b/bin/touchpad-toggle.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ `synclient -l | grep TouchpadOff | cut -b 31-32` -ne 0 ]; then + synclient TouchpadOff=0 + xinput set-int-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 8 0 +else + synclient TouchpadOff=1 + xinput set-int-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 8 1 +fi
stevan/sort-tree-naturally
abcdb3e3fdcbd000758a13511e56741f85740689
Add in Sort::Tree::Naturally
diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..0f28d97 --- /dev/null +++ b/Build.PL @@ -0,0 +1,3 @@ +# Dear Distribution Packager. This use of require is intentional. +# Module::Install detects Build.PL usage and acts accordingly. +require 'Makefile.PL'; diff --git a/Changes b/Changes new file mode 100644 index 0000000..308937e --- /dev/null +++ b/Changes @@ -0,0 +1,5 @@ +Revision history for Sort-Tree-Naturally + +0.0.1 Thu Oct 4 17:23:10 2007 + Initial release. + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..92d13dd --- /dev/null +++ b/MANIFEST @@ -0,0 +1,12 @@ +Build.PL +Changes +MANIFEST +META.yml # Will be created by "make dist" +Makefile.PL +README +lib/Sort/Tree/Naturally.pm +t/00.load.t +t/kwalitee.t +t/perlcritic.t +t/pod-coverage.t +t/pod.t diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..d554fb5 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,16 @@ +# Load the Module::Install bundled in ./inc/ +use inc::Module::Install; + +# Define metadata +name 'Sort-Tree-Naturally'; +all_from 'lib/Sort/Tree/Naturally.pm'; + +# Specific dependencies +# requires 'Moose' => '0.25'; + +build_requires 'Test::More' => '0.42'; + +no_index 'directory' => 'ex'; + +auto_install; +WriteAll; diff --git a/README b/README new file mode 100644 index 0000000..c490d17 --- /dev/null +++ b/README @@ -0,0 +1,47 @@ +Sort-Tree-Naturally version 0.0.1 + +[ REPLACE THIS... + + The README is used to introduce the module and provide instructions on + how to install the module, any machine dependencies it may have (for + example C compilers and installed libraries) and any other information + that should be understood before the module is installed. + + A README file is required for CPAN modules since CPAN extracts the + README file from a module distribution so that people browsing the + archive can use it get an idea of the modules uses. It is usually a + good idea to provide version information here so that people can + decide whether fixes for the module are worth downloading. +] + + +INSTALLATION + +To install this module, run the following commands: + + perl Makefile.PL + make + make test + make install + + +Alternatively, to install with Module::Build, you can use the following commands: + + perl Build.PL + ./Build + ./Build test + ./Build install + + + +DEPENDENCIES + +None. + + +COPYRIGHT AND LICENCE + +Copyright (C) 2007, Chris Prather + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. diff --git a/bin/sort_tree.pl b/bin/sort_tree.pl new file mode 100644 index 0000000..cfe10d5 --- /dev/null +++ b/bin/sort_tree.pl @@ -0,0 +1,3 @@ +#!/usr/bin/env perl -w +use Sort::Tree::Naturally; +Sort::Tree::Naturally->new_with_options->run; diff --git a/lib/Sort/Tree/Naturally.pm b/lib/Sort/Tree/Naturally.pm new file mode 100644 index 0000000..48014c1 --- /dev/null +++ b/lib/Sort/Tree/Naturally.pm @@ -0,0 +1,219 @@ +package Sort::Tree::Naturally; +use strict; +our $VERSION = '0.0.1'; +use Moose; +use Sort::Naturally qw(ncmp); +use File::Slurp qw(write_file); +use Tree::Parser; +use Tree::Simple::Visitor::Sort; + +with qw(MooseX::Getopt); + +has input => ( + metaclass => 'MooseX::Getopt::Meta::Attribute', + isa => 'Str', + is => 'ro', + required => 1, + cmd_alias => [qw(i)], +); + +has output => ( + metaclass => 'MooseX::Getopt::Meta::Attribute', + isa => 'Str', + is => 'ro', + required => 1, + cmd_alias => [qw(o)], +); + +has _parser => ( + isa => 'Tree::Parser', + is => 'ro', + lazy => 1, + default => sub { + my $p = Tree::Parser->new( $_[0]->input ); + $p->useTabIndentedFilters; + return $p; + }, + handles => [qw(parse deparse)], +); + +has _tree => ( + isa => 'Tree::Simple', + is => 'ro', + lazy => 1, + default => sub { $_[0]->parse }, + handles => { sort_with => 'accept', }, +); + +has _sorter => ( + isa => 'Object', + is => 'ro', + accessor => 'sorter', + lazy => 1, + default => sub { + my $v = Tree::Simple::Visitor::Sort->new(); + $v->setSortFunction( + sub ($$) { ncmp( $_[0]->getNodeValue(), $_[1]->getNodeValue() ) } ); + return $v; + }, +); + +sub run { + my ($self) = @_; + $self->sort_with( $self->sorter ); + write_file( $self->output, scalar $self->deparse ); +} + +__PACKAGE__->new_with_options->run unless caller; + +no Moose; # unimport Moose's keywords so they won't accidentally become methods +1; # Magic true value required at end of module +__END__ + +=head1 NAME + +Sort::Tree::Naturally - [One line description of module's purpose here] + + +=head1 VERSION + +This document describes Sort::Tree::Naturally version 0.0.1 + + +=head1 SYNOPSIS + + use Sort::Tree::Naturally; + +=for author to fill in: + Brief code example(s) here showing commonest usage(s). + This section will be as far as many users bother reading + so make it as educational and exeplary as possible. + + +=head1 DESCRIPTION + +=for author to fill in: + Write a full description of the module and its features here. + Use subsections (=head2, =head3) as appropriate. + + +=head1 INTERFACE + +=for author to fill in: + Write a separate section listing the public components of the modules + interface. These normally consist of either subroutines that may be + exported, or methods that may be called on objects belonging to the + classes provided by the module. + + +=head1 DIAGNOSTICS + +=for author to fill in: + List every single error and warning message that the module can + generate (even the ones that will "never happen"), with a full + explanation of each problem, one or more likely causes, and any + suggested remedies. + +=over + +=item C<< Error message here, perhaps with %s placeholders >> + +[Description of error here] + +=item C<< Another error message here >> + +[Description of error here] + +[Et cetera, et cetera] + +=back + + +=head1 CONFIGURATION AND ENVIRONMENT + +=for author to fill in: + A full explanation of any configuration system(s) used by the + module, including the names and locations of any configuration + files, and the meaning of any environment variables or properties + that can be set. These descriptions must also include details of any + configuration language used. + +Sort::Tree::Naturally requires no configuration files or environment variables. + + +=head1 DEPENDENCIES + +=for author to fill in: + A list of all the other modules that this module relies upon, + including any restrictions on versions, and an indication whether + the module is part of the standard Perl distribution, part of the + module's distribution, or must be installed separately. ] + +None. + + +=head1 INCOMPATIBILITIES + +=for author to fill in: + A list of any modules that this module cannot be used in conjunction + with. This may be due to name conflicts in the interface, or + competition for system or program resources, or due to internal + limitations of Perl (for example, many modules that use source code + filters are mutually incompatible). + +None reported. + + +=head1 BUGS AND LIMITATIONS + +=for author to fill in: + A list of known problems with the module, together with some + indication Whether they are likely to be fixed in an upcoming + release. Also a list of restrictions on the features the module + does provide: data types that cannot be handled, performance issues + and the circumstances in which they may arise, practical + limitations on the size of data sets, special cases that are not + (yet) handled, etc. + +No bugs have been reported. + +Please report any bugs or feature requests to +C<[email protected]>, or through the web interface at +L<http://rt.cpan.org>. + + +=head1 AUTHOR + +Chris Prather C<< <[email protected]> >> + + +=head1 LICENCE AND COPYRIGHT + +Copyright (c) 2007, Chris Prather C<< <[email protected]> >>. All rights reserved. + +This module is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. See L<perlartistic>. + + +=head1 DISCLAIMER OF WARRANTY + +BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH +YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR, OR CORRECTION. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE +LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, +OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE +THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. diff --git a/sorted.tree b/sorted.tree new file mode 100644 index 0000000..f1dd23e --- /dev/null +++ b/sorted.tree @@ -0,0 +1,14 @@ +1 + 1.1 + 1.2 + 1.2.1 + 1.2.2 + 1.3 + 2 + 2.1 + 3 + 3.1 + 3.2 + 3.3 + 4 + 4.1 \ No newline at end of file diff --git a/t/00.load.t b/t/00.load.t new file mode 100644 index 0000000..318f96a --- /dev/null +++ b/t/00.load.t @@ -0,0 +1,7 @@ +use Test::More tests => 1; + +BEGIN { +use_ok( 'Sort::Tree::Naturally' ); +} + +diag( "Testing Sort::Tree::Naturally $Sort::Tree::Naturally::VERSION" ); diff --git a/t/data/unsorted.tree b/t/data/unsorted.tree new file mode 100644 index 0000000..b53c4f7 --- /dev/null +++ b/t/data/unsorted.tree @@ -0,0 +1,14 @@ +1 + 1.3 + 1.2 + 1.2.2 + 1.2.1 + 1.1 + 4 + 4.1 + 2 + 2.1 + 3 + 3.3 + 3.2 + 3.1 \ No newline at end of file diff --git a/t/kwalitee.t b/t/kwalitee.t new file mode 100644 index 0000000..70d73f1 --- /dev/null +++ b/t/kwalitee.t @@ -0,0 +1,7 @@ +#!perl + +use Test::More; +eval "use Test::Kwalitee"; +plan skip_all => "Test::Kwalitee not installed; skipping" if $@; + +Test::Perl::Critic::all_critic_ok(); diff --git a/t/perlcritic.t b/t/perlcritic.t new file mode 100644 index 0000000..74238e7 --- /dev/null +++ b/t/perlcritic.t @@ -0,0 +1,7 @@ +#!perl + +use Test::More; +eval "use Test::Perl::Critic"; +plan skip_all => "Test::Perl::Critic required for testing PBP compliance" if $@; + +Test::Perl::Critic::all_critic_ok(); diff --git a/t/pod-coverage.t b/t/pod-coverage.t new file mode 100644 index 0000000..703f91d --- /dev/null +++ b/t/pod-coverage.t @@ -0,0 +1,6 @@ +#!perl -T + +use Test::More; +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; +all_pod_coverage_ok(); diff --git a/t/pod.t b/t/pod.t new file mode 100644 index 0000000..976d7cd --- /dev/null +++ b/t/pod.t @@ -0,0 +1,6 @@ +#!perl -T + +use Test::More; +eval "use Test::Pod 1.14"; +plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; +all_pod_files_ok();
brentgreeff/should_pricot
e5e624be609fff751d9b0a16d3437ec1bb8b878f
Add reference to funktional testing lib.
diff --git a/README.rdoc b/README.rdoc index cdd9856..9f60bf3 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,51 +1,58 @@ = ShouldPricot Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors. Requires Hpricot. Designed for use with ActiveSupport::TestCase (Test/Unit) == Install gem install should_pricot (or use bundler) == Example * I want to test something appears on the page: element('h1').should_be_present * I want to test something does not appear: element('#power_user a[@href="/create/havok"]').should_be_missing * I want to check an elements contents: element('.intro p').should_be 'Welcome' * I want to count the number of times something appears: count('ol#girlfriends li').should_be 6 * You can also pass a regex element("div.wicked").should_be /containg this/ * Even better element('.date').should_contain "today" * You can also pass in html element("div.wicked", some_html).should_be_present Please refer to the Hpricot library for more examples of the kind of selectors available. + +== Funktional + +Designed to be used with the funktional testing library which provides +contexts and class level assertions on top of Test:Unit. + + Mad props to Kid80 for the regex matching patch. Copyright (c) 2009 [Brent Greeff], released under the MIT license
brentgreeff/should_pricot
d94e84993e461dde40c02ac9e7f8deb5c6e50666
Bumped gemspec.
diff --git a/should_pricot.gemspec b/should_pricot.gemspec index 4e78344..73ebfb7 100644 --- a/should_pricot.gemspec +++ b/should_pricot.gemspec @@ -1,32 +1,32 @@ Gem::Specification.new do |s| s.name = %q{should_pricot} - s.version = "3.0.1" + s.version = "3.0.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Brent Greeff"] s.date = %q{2010-10-30} s.description = %q{Rails testing assertions for checking your html is generated correctly.} s.email = %q{[email protected]} s.extra_rdoc_files = [ "MIT-LICENSE", "README.rdoc" ] s.files = [ "MIT-LICENSE", "README.rdoc", "Rakefile", "VERSION", "lib/should_pricot.rb", "lib/should_pricot/count_assertion.rb", "lib/should_pricot/element_assertion.rb", "lib/should_pricot/test_helper_methods.rb", "test/should_pricot_test.rb", "test/test_helper.rb" ] s.homepage = %q{http://github.com/brentgreeff/should_pricot} s.rdoc_options = ["--charset=UTF-8"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.6} s.summary = %q{Rails testing assertions for checking your html is generated correctly.} s.add_dependency 'hpricot' end
brentgreeff/should_pricot
228e7b1e12475470199ff8bbbbdbf8277d6ebff5
Added hpricot as a dependency, was assuming it was installed. bumped gemspec.
diff --git a/should_pricot.gemspec b/should_pricot.gemspec index c874e7a..4e78344 100644 --- a/should_pricot.gemspec +++ b/should_pricot.gemspec @@ -1,31 +1,32 @@ Gem::Specification.new do |s| s.name = %q{should_pricot} - s.version = "3.0.0" + s.version = "3.0.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Brent Greeff"] s.date = %q{2010-10-30} s.description = %q{Rails testing assertions for checking your html is generated correctly.} s.email = %q{[email protected]} s.extra_rdoc_files = [ "MIT-LICENSE", "README.rdoc" ] s.files = [ "MIT-LICENSE", "README.rdoc", "Rakefile", "VERSION", "lib/should_pricot.rb", "lib/should_pricot/count_assertion.rb", "lib/should_pricot/element_assertion.rb", "lib/should_pricot/test_helper_methods.rb", "test/should_pricot_test.rb", "test/test_helper.rb" ] s.homepage = %q{http://github.com/brentgreeff/should_pricot} s.rdoc_options = ["--charset=UTF-8"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.6} s.summary = %q{Rails testing assertions for checking your html is generated correctly.} + s.add_dependency 'hpricot' end
brentgreeff/should_pricot
7a7cd5c2226946adcabf14933f92503a2a076ded
Bumped gemspec to V3, (Rails 3 compatible).
diff --git a/should_pricot.gemspec b/should_pricot.gemspec index efdd383..c874e7a 100644 --- a/should_pricot.gemspec +++ b/should_pricot.gemspec @@ -1,31 +1,31 @@ Gem::Specification.new do |s| s.name = %q{should_pricot} - s.version = "2.0.0" + s.version = "3.0.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Brent Greeff"] s.date = %q{2010-10-30} s.description = %q{Rails testing assertions for checking your html is generated correctly.} s.email = %q{[email protected]} s.extra_rdoc_files = [ "MIT-LICENSE", "README.rdoc" ] s.files = [ "MIT-LICENSE", "README.rdoc", "Rakefile", "VERSION", "lib/should_pricot.rb", "lib/should_pricot/count_assertion.rb", "lib/should_pricot/element_assertion.rb", "lib/should_pricot/test_helper_methods.rb", "test/should_pricot_test.rb", "test/test_helper.rb" ] s.homepage = %q{http://github.com/brentgreeff/should_pricot} s.rdoc_options = ["--charset=UTF-8"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.6} s.summary = %q{Rails testing assertions for checking your html is generated correctly.} end
brentgreeff/should_pricot
83fc69c25c18ae006896e738d1672f15bf386b54
Changed require 'test_help' to 'rails/test_help'.
diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index ca25669..a0707b9 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,8 +1,8 @@ -require 'test_help' +require 'rails/test_help' require 'hpricot' require File.join(File.dirname(__FILE__), "should_pricot", "count_assertion") require File.join(File.dirname(__FILE__), "should_pricot", "element_assertion") require File.join(File.dirname(__FILE__), "should_pricot", "test_helper_methods") ActiveSupport::TestCase.send(:include, ShouldPricot::TestHelperMethods)
brentgreeff/should_pricot
ae8e46a851be819b07efcd54ba9d4ae9d5603030
Fixed deprecation warnings, Rails.root, env etc.
diff --git a/init.rb b/init.rb index 9d883b6..4cce353 100644 --- a/init.rb +++ b/init.rb @@ -1,3 +1,3 @@ -if RAILS_ENV.eql? 'test' +if Rails.env.eql? 'test' require File.join(File.dirname(__FILE__), "lib", "should_pricot") end diff --git a/test/test_helper.rb b/test/test_helper.rb index cb13d37..b72d21f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,13 +1,16 @@ require 'rubygems' require 'active_support' require 'active_support/test_case' require 'test/unit' -ENV['RAILS_ENV'] = 'test' -ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..' +Rails.env = 'test' +Rails.root ||= File.dirname(__FILE__) + '/../../../..' -require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb')) +# ENV['RAILS_ENV'] = 'test' +# ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..' + +require File.expand_path(File.join(Rails.root, 'config/environment.rb')) ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") require File.dirname(__FILE__) + '/../rails/init.rb'
brentgreeff/should_pricot
0594aeb3b0666af4254b687d32f5ee5ff325cdbb
Ignoring gem files.
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c111b33 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.gem
brentgreeff/should_pricot
2a846b9e2fcbb4b2d71b30ea3f9cf6622f349b38
Added VERSION and gemspec files.
diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..227cea2 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.0.0 diff --git a/should_pricot.gemspec b/should_pricot.gemspec new file mode 100644 index 0000000..efdd383 --- /dev/null +++ b/should_pricot.gemspec @@ -0,0 +1,31 @@ +Gem::Specification.new do |s| + s.name = %q{should_pricot} + s.version = "2.0.0" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Brent Greeff"] + s.date = %q{2010-10-30} + s.description = %q{Rails testing assertions for checking your html is generated correctly.} + s.email = %q{[email protected]} + s.extra_rdoc_files = [ + "MIT-LICENSE", + "README.rdoc" + ] + s.files = [ + "MIT-LICENSE", + "README.rdoc", + "Rakefile", + "VERSION", + "lib/should_pricot.rb", + "lib/should_pricot/count_assertion.rb", + "lib/should_pricot/element_assertion.rb", + "lib/should_pricot/test_helper_methods.rb", + "test/should_pricot_test.rb", + "test/test_helper.rb" + ] + s.homepage = %q{http://github.com/brentgreeff/should_pricot} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.6} + s.summary = %q{Rails testing assertions for checking your html is generated correctly.} +end
brentgreeff/should_pricot
15a365fcf137455b320134176cb8ab4a4e43ba51
Got the require paths wrong.
diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index 8bc811c..ca25669 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,8 +1,8 @@ require 'test_help' require 'hpricot' -require File.join(File.dirname(__FILE__), "lib", "should_pricot", "count_assertion") -require File.join(File.dirname(__FILE__), "lib", "should_pricot", "element_assertion") -require File.join(File.dirname(__FILE__), "lib", "should_pricot", "test_helper_methods") +require File.join(File.dirname(__FILE__), "should_pricot", "count_assertion") +require File.join(File.dirname(__FILE__), "should_pricot", "element_assertion") +require File.join(File.dirname(__FILE__), "should_pricot", "test_helper_methods") ActiveSupport::TestCase.send(:include, ShouldPricot::TestHelperMethods)
brentgreeff/should_pricot
0f621775cf48afbb88e3e5d08b0685b4f1fce8b3
Moved the require statements into the should_pricot.rb base file. Moved the helper methods into their own module.
diff --git a/init.rb b/init.rb index 34aa1cd..9d883b6 100644 --- a/init.rb +++ b/init.rb @@ -1,10 +1,3 @@ if RAILS_ENV.eql? 'test' - require 'test_help' - require 'hpricot' - require File.join(File.dirname(__FILE__), "lib", "should_pricot") - require File.join(File.dirname(__FILE__), "lib", "should_pricot", "count_assertion") - require File.join(File.dirname(__FILE__), "lib", "should_pricot", "element_assertion") - - ActiveSupport::TestCase.send(:include, ShouldPricot) end diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index 352652c..8bc811c 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,20 +1,8 @@ -module ShouldPricot - - def element(selector, passed_html = nil) - @passed_html = passed_html - ElementAssertion.new(selector, get_html, self) - end - - def count(selector, passed_html = nil) - @passed_html = passed_html - CountAssertion.new(selector, get_html, self) - end - - private - - def get_html - return Hpricot(@passed_html) if @passed_html - @html || @html = Hpricot(@response.body) - end - -end +require 'test_help' +require 'hpricot' + +require File.join(File.dirname(__FILE__), "lib", "should_pricot", "count_assertion") +require File.join(File.dirname(__FILE__), "lib", "should_pricot", "element_assertion") +require File.join(File.dirname(__FILE__), "lib", "should_pricot", "test_helper_methods") + +ActiveSupport::TestCase.send(:include, ShouldPricot::TestHelperMethods) diff --git a/lib/should_pricot/test_helper_methods.rb b/lib/should_pricot/test_helper_methods.rb new file mode 100644 index 0000000..5f38252 --- /dev/null +++ b/lib/should_pricot/test_helper_methods.rb @@ -0,0 +1,21 @@ +module ShouldPricot + module TestHelperMethods + + def element(selector, passed_html = nil) + @passed_html = passed_html + ElementAssertion.new(selector, get_html, self) + end + + def count(selector, passed_html = nil) + @passed_html = passed_html + CountAssertion.new(selector, get_html, self) + end + + private + + def get_html + return Hpricot(@passed_html) if @passed_html + @html || @html = Hpricot(@response.body) + end + end +end
brentgreeff/should_pricot
20714c500b3918cd399064b8bd8639b435eb4850
Fixed bug in element('#x').should_contain. Needs to check if the element exists before checking contents.
diff --git a/lib/should_pricot/element_assertion.rb b/lib/should_pricot/element_assertion.rb index 6702c9b..1ca656a 100644 --- a/lib/should_pricot/element_assertion.rb +++ b/lib/should_pricot/element_assertion.rb @@ -1,37 +1,39 @@ module ShouldPricot class ElementAssertion def initialize(selector, html, test_instance) @selector = selector @test = test_instance @element = html.at(selector) end def should_be(expected) should_be_present if expected.is_a? Regexp assert_match expected, @element.inner_html.strip else assert_equal expected, @element.inner_html.strip end end def should_contain(expected) + should_be_present + assert_match expected, @element.inner_html.strip end def should_be_present assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" end def should_be_missing assert @element.nil?, "element : '#{@selector}' is present" end private def method_missing(method, *args) @test.send method, *args end end end
brentgreeff/should_pricot
5aeb14bf523e530141c89ec349a15e6ce572fa64
Added should_contain
diff --git a/README.rdoc b/README.rdoc index 6327a11..5866b62 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,41 +1,45 @@ = ShouldPricot Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors. Requires Hpricot. Designed for use with ActiveSupport::TestCase (Test/Unit) == Example * I want to test something appears on the page: element('h1').should_be_present * I want to test something does not appear: element('#power_user a[@href="/create/havok"]').should_be_missing * I want to check an elements contents: element('.intro p').should_be 'Welcome' * I want to count the number of times something appears: count('ol#girlfriends li').should_be 6 * You can also pass a regex - element("div.wicked").should_be /fuzzy match this/ + element("div.wicked").should_be /containg this/ + +* Even better + + element('.date').should_contain "today" * You can also pass in html element("div.wicked", some_html).should_be_present Please refer to the Hpricot library for more examples of the kind of selectors available. Mad props to Kid80 for the regex matching patch. Copyright (c) 2009 [Brent Greeff], released under the MIT license diff --git a/lib/should_pricot/element_assertion.rb b/lib/should_pricot/element_assertion.rb index 8430a66..6702c9b 100644 --- a/lib/should_pricot/element_assertion.rb +++ b/lib/should_pricot/element_assertion.rb @@ -1,33 +1,37 @@ module ShouldPricot class ElementAssertion def initialize(selector, html, test_instance) @selector = selector @test = test_instance @element = html.at(selector) end def should_be(expected) should_be_present if expected.is_a? Regexp assert_match expected, @element.inner_html.strip else assert_equal expected, @element.inner_html.strip end end + def should_contain(expected) + assert_match expected, @element.inner_html.strip + end + def should_be_present assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" end def should_be_missing assert @element.nil?, "element : '#{@selector}' is present" end private def method_missing(method, *args) @test.send method, *args end end end
brentgreeff/should_pricot
f9f87fc38f0cc41e3c608b41d40c24d8fc4ce40c
Fixed bug in passed html assertions.
diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index c05d86a..352652c 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,20 +1,20 @@ module ShouldPricot def element(selector, passed_html = nil) @passed_html = passed_html ElementAssertion.new(selector, get_html, self) end def count(selector, passed_html = nil) @passed_html = passed_html CountAssertion.new(selector, get_html, self) end private def get_html - return @passed_html if @passed_html + return Hpricot(@passed_html) if @passed_html @html || @html = Hpricot(@response.body) end end
brentgreeff/should_pricot
970b4114d8d77eef582e7e4189ed3c47b6a8ce6f
Incorporated kid80's regex matching.
diff --git a/README.rdoc b/README.rdoc index 2f4c5bf..6327a11 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,34 +1,41 @@ = ShouldPricot Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors. Requires Hpricot. Designed for use with ActiveSupport::TestCase (Test/Unit) == Example * I want to test something appears on the page: element('h1').should_be_present * I want to test something does not appear: element('#power_user a[@href="/create/havok"]').should_be_missing * I want to check an elements contents: element('.intro p').should_be 'Welcome' * I want to count the number of times something appears: count('ol#girlfriends li').should_be 6 +* You can also pass a regex + + element("div.wicked").should_be /fuzzy match this/ + * You can also pass in html element("div.wicked", some_html).should_be_present Please refer to the Hpricot library for more examples of the kind of selectors available. +Mad props to Kid80 for the regex matching patch. + + Copyright (c) 2009 [Brent Greeff], released under the MIT license diff --git a/lib/should_pricot/element_assertion.rb b/lib/should_pricot/element_assertion.rb index d9effb9..8430a66 100644 --- a/lib/should_pricot/element_assertion.rb +++ b/lib/should_pricot/element_assertion.rb @@ -1,28 +1,33 @@ module ShouldPricot class ElementAssertion def initialize(selector, html, test_instance) @selector = selector @test = test_instance @element = html.at(selector) end def should_be(expected) should_be_present - assert_equal expected, @element.inner_html.strip + + if expected.is_a? Regexp + assert_match expected, @element.inner_html.strip + else + assert_equal expected, @element.inner_html.strip + end end def should_be_present assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" end def should_be_missing assert @element.nil?, "element : '#{@selector}' is present" end private def method_missing(method, *args) @test.send method, *args end end end
brentgreeff/should_pricot
c3035b1b1eba8f2ebe7ecb0be36fdc4952d52183
Extended should_b to take some html to assert on.
diff --git a/README.rdoc b/README.rdoc index 12a66af..2f4c5bf 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,30 +1,34 @@ = ShouldPricot Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors. Requires Hpricot. Designed for use with ActiveSupport::TestCase (Test/Unit) == Example * I want to test something appears on the page: element('h1').should_be_present * I want to test something does not appear: element('#power_user a[@href="/create/havok"]').should_be_missing * I want to check an elements contents: element('.intro p').should_be 'Welcome' * I want to count the number of times something appears: count('ol#girlfriends li').should_be 6 +* You can also pass in html + + element("div.wicked", some_html).should_be_present + Please refer to the Hpricot library for more examples of the kind of selectors available. Copyright (c) 2009 [Brent Greeff], released under the MIT license diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index 9607469..c05d86a 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,17 +1,20 @@ module ShouldPricot - def element(selector) - ElementAssertion.new(selector, html, self) + def element(selector, passed_html = nil) + @passed_html = passed_html + ElementAssertion.new(selector, get_html, self) end - def count(selector) - CountAssertion.new(selector, html, self) + def count(selector, passed_html = nil) + @passed_html = passed_html + CountAssertion.new(selector, get_html, self) end private - def html + def get_html + return @passed_html if @passed_html @html || @html = Hpricot(@response.body) end end
brentgreeff/should_pricot
ac8144b447dfd8f6947344a8162d4f058615ada1
Refactored should_pricot into seperate files.
diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb index 1a1933d..9607469 100644 --- a/lib/should_pricot.rb +++ b/lib/should_pricot.rb @@ -1,61 +1,17 @@ module ShouldPricot def element(selector) ElementAssertion.new(selector, html, self) end def count(selector) CountAssertion.new(selector, html, self) end private def html @html || @html = Hpricot(@response.body) end - class ElementAssertion - def initialize(selector, html, test_instance) - @selector = selector - @test_instance = test_instance - @element = html.at(selector) - end - - def should_be(expected) - should_be_present - assert_equal expected, @element.inner_html.strip - end - - def should_be_present - assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" - end - - def should_be_missing - assert @element.nil?, "element : '#{@selector}' is present" - end - - private - - def method_missing(method, *args) - @test_instance.send method, *args - end - end - - class CountAssertion - def initialize(selector, html, test_instance) - @test_instance = test_instance - @elements = (html/selector) - end - - def should_be(expected) - assert_equal expected, @elements.size - end - - private - - def method_missing(method, *args) - @test_instance.send method, *args - end - end - end diff --git a/lib/should_pricot/count_assertion.rb b/lib/should_pricot/count_assertion.rb new file mode 100644 index 0000000..4e3ccc6 --- /dev/null +++ b/lib/should_pricot/count_assertion.rb @@ -0,0 +1,12 @@ +module ShouldPricot + class CountAssertion + def initialize(selector, html, test_instance) + @test = test_instance + @elements = (html/selector) + end + + def should_be(expected) + @test.assert_equal expected, @elements.size + end + end +end diff --git a/lib/should_pricot/element_assertion.rb b/lib/should_pricot/element_assertion.rb new file mode 100644 index 0000000..d9effb9 --- /dev/null +++ b/lib/should_pricot/element_assertion.rb @@ -0,0 +1,28 @@ +module ShouldPricot + class ElementAssertion + def initialize(selector, html, test_instance) + @selector = selector + @test = test_instance + @element = html.at(selector) + end + + def should_be(expected) + should_be_present + assert_equal expected, @element.inner_html.strip + end + + def should_be_present + assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" + end + + def should_be_missing + assert @element.nil?, "element : '#{@selector}' is present" + end + + private + + def method_missing(method, *args) + @test.send method, *args + end + end +end diff --git a/rails/init.rb b/rails/init.rb index 925ccd9..34aa1cd 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,7 +1,10 @@ if RAILS_ENV.eql? 'test' require 'test_help' require 'hpricot' - require 'should_pricot' + + require File.join(File.dirname(__FILE__), "lib", "should_pricot") + require File.join(File.dirname(__FILE__), "lib", "should_pricot", "count_assertion") + require File.join(File.dirname(__FILE__), "lib", "should_pricot", "element_assertion") ActiveSupport::TestCase.send(:include, ShouldPricot) end
brentgreeff/should_pricot
9496ad845f81fffa8f94ffcc0089348cde78667a
Moved readme to rdoc stylin.
diff --git a/README b/README deleted file mode 100644 index 7b68a81..0000000 --- a/README +++ /dev/null @@ -1,27 +0,0 @@ -ShouldPricot -============ - -Test the html in your functional tests -using the wicked Hpricot CSS / XPath selectors. -Requires Hpricot. -Designed for use with ActiveSupport::TestCase (Test/Unit) - -Example -======= - -I want to test something appears on the page: - element('h1').should_be_present - -I want to test something does not appear: - element('#power_user a[@href="/create/havok"]').should_be_missing - -I want to check an elements contents: - element('.intro p').should_be 'Welcome' - -I want to count the number of times something appears: - count('ol#girlfriends li').should_be 6 - -Please refer to the Hpricot library for more examples -of the kind of selectors available. - -Copyright (c) 2009 [Brent Greeff], released under the MIT license diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..12a66af --- /dev/null +++ b/README.rdoc @@ -0,0 +1,30 @@ += ShouldPricot + +Test the html in your functional tests +using the wicked Hpricot CSS / XPath selectors. +Requires Hpricot. +Designed for use with ActiveSupport::TestCase (Test/Unit) + +== Example + +* I want to test something appears on the page: + + element('h1').should_be_present + +* I want to test something does not appear: + + element('#power_user a[@href="/create/havok"]').should_be_missing + +* I want to check an elements contents: + + element('.intro p').should_be 'Welcome' + +* I want to count the number of times something appears: + + count('ol#girlfriends li').should_be 6 + + +Please refer to the Hpricot library for more examples +of the kind of selectors available. + +Copyright (c) 2009 [Brent Greeff], released under the MIT license
brentgreeff/should_pricot
d118a402f9f5f795e3031225a9dfe7389db46e38
Created the should_pricot testing helpers.
diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..9376605 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009 [name of plugin creator] + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..7b68a81 --- /dev/null +++ b/README @@ -0,0 +1,27 @@ +ShouldPricot +============ + +Test the html in your functional tests +using the wicked Hpricot CSS / XPath selectors. +Requires Hpricot. +Designed for use with ActiveSupport::TestCase (Test/Unit) + +Example +======= + +I want to test something appears on the page: + element('h1').should_be_present + +I want to test something does not appear: + element('#power_user a[@href="/create/havok"]').should_be_missing + +I want to check an elements contents: + element('.intro p').should_be 'Welcome' + +I want to count the number of times something appears: + count('ol#girlfriends li').should_be 6 + +Please refer to the Hpricot library for more examples +of the kind of selectors available. + +Copyright (c) 2009 [Brent Greeff], released under the MIT license diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ae66e2a --- /dev/null +++ b/Rakefile @@ -0,0 +1,23 @@ +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +desc 'Default: run unit tests.' +task :default => :test + +desc 'Test the should_pricot plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = true +end + +desc 'Generate documentation for the should_pricot plugin.' +Rake::RDocTask.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'ShouldPricot' + rdoc.options << '--line-numbers' << '--inline-source' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/install.rb b/install.rb new file mode 100644 index 0000000..f7732d3 --- /dev/null +++ b/install.rb @@ -0,0 +1 @@ +# Install hook code here diff --git a/lib/should_pricot.rb b/lib/should_pricot.rb new file mode 100644 index 0000000..1a1933d --- /dev/null +++ b/lib/should_pricot.rb @@ -0,0 +1,61 @@ +module ShouldPricot + + def element(selector) + ElementAssertion.new(selector, html, self) + end + + def count(selector) + CountAssertion.new(selector, html, self) + end + + private + + def html + @html || @html = Hpricot(@response.body) + end + + class ElementAssertion + def initialize(selector, html, test_instance) + @selector = selector + @test_instance = test_instance + @element = html.at(selector) + end + + def should_be(expected) + should_be_present + assert_equal expected, @element.inner_html.strip + end + + def should_be_present + assert @element.is_a?(Hpricot::Elem), "element : '#{@selector}' is missing" + end + + def should_be_missing + assert @element.nil?, "element : '#{@selector}' is present" + end + + private + + def method_missing(method, *args) + @test_instance.send method, *args + end + end + + class CountAssertion + def initialize(selector, html, test_instance) + @test_instance = test_instance + @elements = (html/selector) + end + + def should_be(expected) + assert_equal expected, @elements.size + end + + private + + def method_missing(method, *args) + @test_instance.send method, *args + end + end + +end diff --git a/rails/init.rb b/rails/init.rb new file mode 100644 index 0000000..925ccd9 --- /dev/null +++ b/rails/init.rb @@ -0,0 +1,7 @@ +if RAILS_ENV.eql? 'test' + require 'test_help' + require 'hpricot' + require 'should_pricot' + + ActiveSupport::TestCase.send(:include, ShouldPricot) +end diff --git a/tasks/should_pricot_tasks.rake b/tasks/should_pricot_tasks.rake new file mode 100644 index 0000000..2f5974f --- /dev/null +++ b/tasks/should_pricot_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :should_pricot do +# # Task goes here +# end diff --git a/test/debug.log b/test/debug.log new file mode 100644 index 0000000..cae8b50 --- /dev/null +++ b/test/debug.log @@ -0,0 +1 @@ +# Logfile created on Tue Jul 14 17:35:07 +0100 2009 by / diff --git a/test/should_pricot_test.rb b/test/should_pricot_test.rb new file mode 100644 index 0000000..6cb8842 --- /dev/null +++ b/test/should_pricot_test.rb @@ -0,0 +1,11 @@ +require File.dirname(__FILE__) + '/test_helper.rb' + +class ShouldPricotTest < ActionController::TestCase + + private + + def deny(expected_to_be_false, message = '') + assert ! expected_to_be_false, message + end + +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..cb13d37 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,13 @@ +require 'rubygems' +require 'active_support' +require 'active_support/test_case' +require 'test/unit' + +ENV['RAILS_ENV'] = 'test' +ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..' + +require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb')) + +ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") + +require File.dirname(__FILE__) + '/../rails/init.rb' diff --git a/uninstall.rb b/uninstall.rb new file mode 100644 index 0000000..9738333 --- /dev/null +++ b/uninstall.rb @@ -0,0 +1 @@ +# Uninstall hook code here
tnc/rac
048704f7db804146ae1ea64ea5a36b5c6c73124b
fix installation instructions
diff --git a/README.md b/README.md index a6328cf..a8037de 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,44 @@ # RabbitMQ Administration Console # *RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. See [here](http://twitpic.com/1mvo8o) for a screenshot. ## Installation ## Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) Get the source code of RAC: - > git clone http://github.com/tnc/rac + > git clone http://github.com/tnc/rac.git > cd rac Get the source code of limonade: > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root. The admin console has been tested in the same server that runs the RabbitMQ process. ## Configuration ## Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *host* and *cookie* to suit those of your system. ## Credits: ## _Design_: Neil Fang _PHP Code_: Alvaro Videla _RabbitMQ logo taken from_: http://www.rabbitmq.com/ ## TODO ## * Improve Error Handling * Add security for several tasks allowed in the admin console * Implement more commands to display information like the server status \ No newline at end of file
tnc/rac
47b6d8eed655e9ded613dbba786d9c638185bc0a
bug fix for session management
diff --git a/web/index.php b/web/index.php index 262ef1b..07faa36 100644 --- a/web/index.php +++ b/web/index.php @@ -1,46 +1,48 @@ <?php +session_name('rac'); +session_start(); require_once(__DIR__ . '/../lib/vendor/limonade/lib/limonade.php'); require_once(__DIR__ . '/../lib/helpers.php'); function configure() { init_servers_config(); option('env', ENV_DEVELOPMENT); option('limonade_dir', __DIR__ . '/../lib/vendor/limonade/lib'); option('lib_dir', __DIR__ . '/../lib'); option('controllers_dir', __DIR__ .'/../controllers'); option('views_dir', __DIR__ .'/../views'); } function before($route) { layout('layout.html.php'); } dispatch_post('/switch_server', 'switch_server'); dispatch('/', 'list_vhosts'); dispatch('/vhost_permissions/:vhost', 'list_vhost_permissions'); dispatch('/add_vhost', 'add_vhost_form'); dispatch_post('/add_vhost', 'add_vhost'); dispatch_post('/delete_vhost', 'delete_vhost'); dispatch('/list_consumers/:vhost', 'list_consumers'); dispatch('/exchanges/:vhost', 'list_exchanges'); dispatch('/queues/:vhost', 'list_queues'); dispatch('/bindings/:vhost', 'list_bindings'); dispatch('/list_connections', 'list_connections'); dispatch('/list_channels', 'list_channels'); dispatch('/list_users', 'list_users'); dispatch('/user_permissions/:user', 'user_permissions'); run(); ?> \ No newline at end of file
tnc/rac
e3801e4bb867cb55e52ceeb6700dcadd991a23a5
new design for the server switcher control
diff --git a/views/layout.html.php b/views/layout.html.php index 3f9e5e5..9d23706 100644 --- a/views/layout.html.php +++ b/views/layout.html.php @@ -1,58 +1,61 @@ <?php extract($vars); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>RabbitMQ Admin Console</title> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" charset="utf-8"> function delete_vhost(vhost, vhostEl){ $.ajax({ type: "POST", url: "/delete_vhost", data: {name: vhost}, success: function(data) { if(data == 'OK') { alert('Vhost ' + vhost + 'Deleted'); $(vhostEl).parent().parent().remove(); } else { alert('Vhost ' + vhost + "Cant't be Deleted"); } } }); } </script> <link rel="stylesheet" type="text/css" media="screen" href="/style/style.css" /> </head> <body> <div id="page"> <h1 id="top"> - <form id="server_form" action="/switch_server" method="POST" accept-charset="utf-8"> - <select id='server_id' name='server_id' change="" style="float:right"> - <?php foreach($RABBIT_SERVERS as $k => $server): ?> - <option value="<?php echo $k; ?>" <?php echo (get_server_id() == $k) ? 'selected="true"' : ''; ?>><?php echo $server['host']; ?></option> - <?php endforeach; ?> - </select> - </form> - <script type="text/javascript" charset="utf-8"> - $('#server_id').change(function() { - $('#server_form').submit(); - }); - </script> <a href="/"><img src="/img/rabbitmqlogonostrap.png" /></a><a href="/">Administration Console</a> </h1> - <ul id="menu"> - <li><a href="/">Vhosts</a></li> - <li><a href="/list_users">Users</a></li> - <li><a href="/list_connections">Connections</a></li> - <li><a href="/list_channels">Channels</a></li> - </ul> + <div id="menu"> + <ul> + <li><a href="/">Vhosts</a></li> + <li><a href="/list_users">Users</a></li> + <li><a href="/list_connections">Connections</a></li> + <li><a href="/list_channels">Channels</a></li> + </ul> + <strong class="subject">Switch Server:</strong> + <form id="server_form" action="/switch_server" method="POST" accept-charset="utf-8"> + <select id="server_id" name="server_id" change=""> + <?php foreach($RABBIT_SERVERS as $k => $server): ?> + <option value="<?php echo $k; ?>" <?php echo (get_server_id() == $k) ? 'selected="true"' : ''; ?>><?php echo $server['host']; ?></option> + <?php endforeach; ?> + </select> + </form> + <script type="text/javascript" charset="utf-8"> + $('#server_id').change(function() { + $('#server_form').submit(); + }); + </script> + </div> <div id="content"> <?php echo $content; ?> </div> <div class="clear"> <!----> </div> </div> </body> </html> \ No newline at end of file diff --git a/web/style/style.css b/web/style/style.css index bd9195e..28bf46e 100644 --- a/web/style/style.css +++ b/web/style/style.css @@ -1,185 +1,198 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; } body { color:#333; font-size:12px; line-height:1.5em; font-family:Arial, Helvetica, sans-serif; text-align:center; background:#efefef; } /**main**/ :focus { outline:0; } html, body { height:100%; width:100%; } /**tables still need 'cellspacing="0"'**/ table { border-collapse:separate; border-spacing:0; } caption, th, td { font-weight:normal; } blockquote:before, blockquote:after, q:before, q:after { content:""; } blockquote, q { quotes:"" ""; } img { border:0; } a { color:#C00; cursor:pointer; } a:hover, p.greyBox a:hover { color:#FF6600 } .noBorder { border:0; } /**ie6**/ h1, h2, h3, h4, h5, h6 { font-size:100%; font-weight:normal; font-family:Arial, Helvetica, sans-serif; } ol, ul { list-style:none; margin:0; padding:0; } ol, ul, dl { position:relative; } dl dt { font-weight:bold; } dl dd { padding-bottom:5px; } /**align**/ .boxCenter { text-align:center; } .left { float:left; } .right { float:right; } /**clearer**/ .clear { clear:both; } .noClear { clear:none; } /**commen**/ .button { padding:3px 10px; color:#FFF; background:#F60; border:1px #900 solid; border-color: #ffd6ba #900 #900 #ffd6ba } .button:hover { - color:#FC3; + color:#ffe8a3; background:#ff802b } /**main**/ #page { width:1000px; margin:15px auto; text-align:left; background:#FFF url(/img/menu_bg.gif) repeat-y 1px 1px; padding:0 10px 10px; border:1px #CCC solid; } #top { margin:0 -9px 5px; border-top:1px #FFF solid; border-bottom:3px #F60 solid; padding:5px 10px 3px; background:#FFF } #top a { margin-right:9px; text-decoration:none; color:#333; font-size:14px; } /**menu**/ -#menu { - width:200px; +#menu{ + width:204px; float:left; + margin:5px auto; +} +#menu ul { + display:block; border:1px #CCC solid; padding:1px 1px 0; - margin:5px auto; - background:#FFF + background:#FFF; + margin-bottom:5px; } -#menu li { +#menu ul li { line-height:26px; height:26px; background:#efefef; margin-bottom:1px; } -#menu li a { +#menu ul li a { display:block; text-indent:15px; font-size:14px; color:#F60; text-decoration:none } -#menu li a:hover { +#menu ul li a:hover { background:#F60; color:#FFF } +#menu strong.subject{ + display:block; + color:#333; +} +#menu select#server_id{ + width:204px; + border:1px #CCC solid; + padding:2px; + color:#555 +} /**content**/ #content { width:773px; margin-bottom:10px; float:right; } #content h2 { height:26px; line-height:26px; font-size:14px; font-weight:bold; } #content table.form { width:100%; border:1px #CCC solid; margin-bottom:10px; padding-right:1px } table.form th, table.form td { padding:0 0 0 10px; line-height:28px; height:28px; background:#efefef; border-bottom:1px #FFF solid; border-left:1px #FFF solid; text-align:left; - text-transform: capitalize } table.form th { background:#888; color:#FFF; font-weight:bold; border-top:1px #FFF solid; } table.form tr:hover td { background:#FFC }
tnc/rac
ecab5a025c23a6c715bf75232e27f5986e2c0a16
uses limonade session auto start
diff --git a/web/index.php b/web/index.php index fa0ee79..262ef1b 100644 --- a/web/index.php +++ b/web/index.php @@ -1,48 +1,46 @@ <?php -session_start(); - require_once(__DIR__ . '/../lib/vendor/limonade/lib/limonade.php'); require_once(__DIR__ . '/../lib/helpers.php'); function configure() { init_servers_config(); option('env', ENV_DEVELOPMENT); option('limonade_dir', __DIR__ . '/../lib/vendor/limonade/lib'); option('lib_dir', __DIR__ . '/../lib'); option('controllers_dir', __DIR__ .'/../controllers'); option('views_dir', __DIR__ .'/../views'); } function before($route) { layout('layout.html.php'); } dispatch_post('/switch_server', 'switch_server'); dispatch('/', 'list_vhosts'); dispatch('/vhost_permissions/:vhost', 'list_vhost_permissions'); dispatch('/add_vhost', 'add_vhost_form'); dispatch_post('/add_vhost', 'add_vhost'); dispatch_post('/delete_vhost', 'delete_vhost'); dispatch('/list_consumers/:vhost', 'list_consumers'); dispatch('/exchanges/:vhost', 'list_exchanges'); dispatch('/queues/:vhost', 'list_queues'); dispatch('/bindings/:vhost', 'list_bindings'); dispatch('/list_connections', 'list_connections'); dispatch('/list_channels', 'list_channels'); dispatch('/list_users', 'list_users'); dispatch('/user_permissions/:user', 'user_permissions'); run(); ?> \ No newline at end of file
tnc/rac
c635c8fbbff0a0548f5ffa43211aaf541892e765
add note about server configuration
diff --git a/README.md b/README.md index 681b0df..a6328cf 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,44 @@ # RabbitMQ Administration Console # *RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. See [here](http://twitpic.com/1mvo8o) for a screenshot. ## Installation ## Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) Get the source code of RAC: > git clone http://github.com/tnc/rac > cd rac Get the source code of limonade: > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root. The admin console has been tested in the same server that runs the RabbitMQ process. ## Configuration ## -Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *RABBITMQ_HOST* and *RABBITMQ_COOKIE* to suit those of your system. +Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *host* and *cookie* to suit those of your system. ## Credits: ## _Design_: Neil Fang _PHP Code_: Alvaro Videla _RabbitMQ logo taken from_: http://www.rabbitmq.com/ ## TODO ## * Improve Error Handling * Add security for several tasks allowed in the admin console * Implement more commands to display information like the server status \ No newline at end of file
tnc/rac
a1727b0fb5449e1a8dcef59c848c6870b6ba4707
adds support for several rabbitmq servers
diff --git a/config/config.php.sample b/config/config.php.sample index cd5bb63..16a1dc3 100644 --- a/config/config.php.sample +++ b/config/config.php.sample @@ -1,4 +1,16 @@ <?php -define('RABBITMQ_HOST', '[email protected]'); -define('RABBITMQ_COOKIE', 'COOKIE_HERE'); \ No newline at end of file +$RABBIT_SERVERS = array( + array( + 'host' => '[email protected]', + 'cookie' => 'COOKIE_HERE' + ), + array( + 'host' => '[email protected]', + 'cookie' => 'COOKIE_HERE' + ), + array( + 'host' => '[email protected]', + 'cookie' => 'COOKIE_HERE' + ) + ); \ No newline at end of file diff --git a/controllers/servers.php b/controllers/servers.php new file mode 100644 index 0000000..2e4960d --- /dev/null +++ b/controllers/servers.php @@ -0,0 +1,8 @@ +<?php + +function switch_server() +{ + $server = isset($_POST['server_id']) ? (int) $_POST['server_id'] : 0; + $_SESSION['server_id'] = $server; + header("Location: " . $_SERVER['HTTP_REFERER']); +} \ No newline at end of file diff --git a/lib/helpers.php b/lib/helpers.php new file mode 100644 index 0000000..76709d4 --- /dev/null +++ b/lib/helpers.php @@ -0,0 +1,14 @@ +<?php + +function init_servers_config() +{ + include_once(__DIR__ . '/../config/config.php'); + set('RABBIT_SERVERS', $RABBIT_SERVERS); + define('RABBITMQ_HOST', $RABBIT_SERVERS[get_server_id()]['host']); + define('RABBITMQ_COOKIE', $RABBIT_SERVERS[get_server_id()]['cookie']); +} + +function get_server_id() +{ + return isset($_SESSION['server_id']) ? $_SESSION['server_id'] : 0; +} \ No newline at end of file diff --git a/views/layout.html.php b/views/layout.html.php index e1afb21..3f9e5e5 100644 --- a/views/layout.html.php +++ b/views/layout.html.php @@ -1,44 +1,58 @@ <?php extract($vars); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>RabbitMQ Admin Console</title> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" charset="utf-8"> function delete_vhost(vhost, vhostEl){ $.ajax({ type: "POST", url: "/delete_vhost", data: {name: vhost}, success: function(data) { if(data == 'OK') { alert('Vhost ' + vhost + 'Deleted'); $(vhostEl).parent().parent().remove(); } else { alert('Vhost ' + vhost + "Cant't be Deleted"); } } }); } </script> <link rel="stylesheet" type="text/css" media="screen" href="/style/style.css" /> </head> <body> <div id="page"> - <h1 id="top"><a href="/"><img src="/img/rabbitmqlogonostrap.png" /></a><a href="/">Administration Console</a></h1> + <h1 id="top"> + <form id="server_form" action="/switch_server" method="POST" accept-charset="utf-8"> + <select id='server_id' name='server_id' change="" style="float:right"> + <?php foreach($RABBIT_SERVERS as $k => $server): ?> + <option value="<?php echo $k; ?>" <?php echo (get_server_id() == $k) ? 'selected="true"' : ''; ?>><?php echo $server['host']; ?></option> + <?php endforeach; ?> + </select> + </form> + <script type="text/javascript" charset="utf-8"> + $('#server_id').change(function() { + $('#server_form').submit(); + }); + </script> + <a href="/"><img src="/img/rabbitmqlogonostrap.png" /></a><a href="/">Administration Console</a> + </h1> <ul id="menu"> <li><a href="/">Vhosts</a></li> <li><a href="/list_users">Users</a></li> <li><a href="/list_connections">Connections</a></li> <li><a href="/list_channels">Channels</a></li> </ul> <div id="content"> - <?php echo $content; ?> + <?php echo $content; ?> </div> <div class="clear"> <!----> </div> </div> </body> -</html> +</html> \ No newline at end of file diff --git a/web/index.php b/web/index.php index 8eef793..fa0ee79 100644 --- a/web/index.php +++ b/web/index.php @@ -1,42 +1,48 @@ <?php +session_start(); + require_once(__DIR__ . '/../lib/vendor/limonade/lib/limonade.php'); -require_once(__DIR__ . '/../config/config.php'); +require_once(__DIR__ . '/../lib/helpers.php'); function configure() { + init_servers_config(); + option('env', ENV_DEVELOPMENT); option('limonade_dir', __DIR__ . '/../lib/vendor/limonade/lib'); option('lib_dir', __DIR__ . '/../lib'); option('controllers_dir', __DIR__ .'/../controllers'); option('views_dir', __DIR__ .'/../views'); } function before($route) { layout('layout.html.php'); } +dispatch_post('/switch_server', 'switch_server'); + dispatch('/', 'list_vhosts'); dispatch('/vhost_permissions/:vhost', 'list_vhost_permissions'); dispatch('/add_vhost', 'add_vhost_form'); dispatch_post('/add_vhost', 'add_vhost'); dispatch_post('/delete_vhost', 'delete_vhost'); dispatch('/list_consumers/:vhost', 'list_consumers'); dispatch('/exchanges/:vhost', 'list_exchanges'); dispatch('/queues/:vhost', 'list_queues'); dispatch('/bindings/:vhost', 'list_bindings'); dispatch('/list_connections', 'list_connections'); dispatch('/list_channels', 'list_channels'); dispatch('/list_users', 'list_users'); dispatch('/user_permissions/:user', 'user_permissions'); run(); ?> \ No newline at end of file
tnc/rac
ba48f978491fa2ed112fafbd38670291262101b8
adds a note about admin console installation
diff --git a/README.md b/README.md index eec8c5c..681b0df 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,44 @@ # RabbitMQ Administration Console # *RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. See [here](http://twitpic.com/1mvo8o) for a screenshot. ## Installation ## Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) Get the source code of RAC: > git clone http://github.com/tnc/rac > cd rac Get the source code of limonade: > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade -Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root +Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root. + +The admin console has been tested in the same server that runs the RabbitMQ process. ## Configuration ## Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *RABBITMQ_HOST* and *RABBITMQ_COOKIE* to suit those of your system. ## Credits: ## _Design_: Neil Fang _PHP Code_: Alvaro Videla _RabbitMQ logo taken from_: http://www.rabbitmq.com/ ## TODO ## * Improve Error Handling * Add security for several tasks allowed in the admin console * Implement more commands to display information like the server status \ No newline at end of file
tnc/rac
b77db89930ccc2ad775b07ff75392d3d2bd9caa4
adds link to screenshot
diff --git a/README.md b/README.md index f2305af..eec8c5c 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,42 @@ # RabbitMQ Administration Console # *RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. +See [here](http://twitpic.com/1mvo8o) for a screenshot. + ## Installation ## Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) Get the source code of RAC: > git clone http://github.com/tnc/rac > cd rac Get the source code of limonade: > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root ## Configuration ## Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *RABBITMQ_HOST* and *RABBITMQ_COOKIE* to suit those of your system. ## Credits: ## _Design_: Neil Fang _PHP Code_: Alvaro Videla _RabbitMQ logo taken from_: http://www.rabbitmq.com/ + + ## TODO ## * Improve Error Handling * Add security for several tasks allowed in the admin console * Implement more commands to display information like the server status \ No newline at end of file
tnc/rac
bb62b62341ea2626f0e03db2e1d7c3ae4358a3bb
new LICENSE file
diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..16759e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010 The NetCircle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file
tnc/rac
f04d4281240c649c649593ed86fcbfa74f8bab7d
improves readme
diff --git a/README.md b/README.md index 745ff54..f2305af 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,38 @@ # RabbitMQ Administration Console # *RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. ## Installation ## Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) Get the source code of RAC: > git clone http://github.com/tnc/rac > cd rac Get the source code of limonade: > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root ## Configuration ## Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *RABBITMQ_HOST* and *RABBITMQ_COOKIE* to suit those of your system. ## Credits: ## _Design_: Neil Fang + _PHP Code_: Alvaro Videla + _RabbitMQ logo taken from_: http://www.rabbitmq.com/ ## TODO ## * Improve Error Handling * Add security for several tasks allowed in the admin console * Implement more commands to display information like the server status \ No newline at end of file
tnc/rac
445aea2944588cba990a2e777da1f8f68da72471
first import
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae85d97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +lib/vendor/* +./sync.sh +config/config.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..745ff54 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# RabbitMQ Administration Console # + +*RAC* is an administration console for RabbitMQ. Is written in PHP and uses the [PHP Erlang Bridge Extension](http://code.google.com/p/mypeb/) to communicate with [RabbitMQ](http://www.rabbitmq.com/) + +RAC PHP code is structure around [Limonade](http://github.com/sofadesign/limonade), which is a lightweight PHP framework. + +## Installation ## + +Install the PHP Erlang Bridge Extension from [here](http://code.google.com/p/mypeb/) + +Get the source code of RAC: + + > git clone http://github.com/tnc/rac + > cd rac + +Get the source code of limonade: + + > git clone http://github.com/sofadesign/limonade.git lib/vendor/limonade + +Setup an Apache Virtual host or your Nginx to use the project's web folder as the document root + +## Configuration ## + +Copy the file _config/config.php.sample to _config/config.php_ and edit the values for *RABBITMQ_HOST* and *RABBITMQ_COOKIE* to suit those of your system. + +## Credits: ## + +_Design_: Neil Fang +_PHP Code_: Alvaro Videla +_RabbitMQ logo taken from_: http://www.rabbitmq.com/ + +## TODO ## + +* Improve Error Handling +* Add security for several tasks allowed in the admin console +* Implement more commands to display information like the server status \ No newline at end of file diff --git a/config/config.php.sample b/config/config.php.sample new file mode 100644 index 0000000..cd5bb63 --- /dev/null +++ b/config/config.php.sample @@ -0,0 +1,4 @@ +<?php + +define('RABBITMQ_HOST', '[email protected]'); +define('RABBITMQ_COOKIE', 'COOKIE_HERE'); \ No newline at end of file diff --git a/controllers/channels.php b/controllers/channels.php new file mode 100644 index 0000000..e180d23 --- /dev/null +++ b/controllers/channels.php @@ -0,0 +1,13 @@ +<?php + +function list_channels() +{ + $channel = new Channel(ErlangBridge::getInstance()->getConnection()); + + $rs = $channel->list_channels(); + + set('info', $rs[0]); + + return render('channels.html.php'); +} +?> \ No newline at end of file diff --git a/controllers/connections.php b/controllers/connections.php new file mode 100644 index 0000000..4578fff --- /dev/null +++ b/controllers/connections.php @@ -0,0 +1,13 @@ +<?php + +function list_connections() +{ + $connection = new Connection(ErlangBridge::getInstance()->getConnection()); + + $rs = $connection->list_connections(); + + set('info', $rs[0]); + + return render('connections.html.php'); +} +?> \ No newline at end of file diff --git a/controllers/exchanges.php b/controllers/exchanges.php new file mode 100644 index 0000000..05e9e2f --- /dev/null +++ b/controllers/exchanges.php @@ -0,0 +1,46 @@ +<?php +function list_exchanges(){ + + $exchange = new Exchange(ErlangBridge::getInstance()->getConnection()); + + $rs = $exchange->info_all(base64_decode(params('vhost'))); + + $info = array(); + + foreach($rs[0] as $k=>$v) + { + $tmp = array(); + foreach($v as $k2=>$v2) + { + + if(is_array($v2[1]) && count($v2[1]) > 0) + { + $tmp[$v2[0]] = $v2[1][count($v2[1])-1]; + } + else + { + $tmp[$v2[0]] = $v2[1]; + } + } + $info[] = $tmp; + } + + set('info', $info); + + return render('exchanges.html.php'); +} + +function list_bindings() +{ + $exchange = new Exchange(ErlangBridge::getInstance()->getConnection()); + + $rs = $exchange->list_bindings(base64_decode(params('vhost'))); + + $info = array(); + + $info = $rs[0]; + + set('info', $info); + + return render('bindings.html.php'); +} \ No newline at end of file diff --git a/controllers/queues.php b/controllers/queues.php new file mode 100644 index 0000000..30fa508 --- /dev/null +++ b/controllers/queues.php @@ -0,0 +1,31 @@ +<?php +function list_queues(){ + + $queue = new Queue(ErlangBridge::getInstance()->getConnection()); + + $rs = $queue->info_all(base64_decode(params('vhost')), array('name', 'messages', 'consumers', 'durable', 'auto_delete', 'memory')); + + $info = array(); + + foreach($rs[0] as $k=>$v) + { + $tmp = array(); + foreach($v as $info_item) + { + if(is_array($info_item[1])) + { + $tmp[$info_item[0]] = $info_item[1][3]; + } + else + { + $tmp[$info_item[0]] = $info_item[1]; + } + } + + $info[] = $tmp; + } + + set('info', $info); + + return render('queues.html.php'); +} \ No newline at end of file diff --git a/controllers/users.php b/controllers/users.php new file mode 100644 index 0000000..3d12d9e --- /dev/null +++ b/controllers/users.php @@ -0,0 +1,25 @@ +<?php + +function list_users() +{ + $user = new User(ErlangBridge::getInstance()->getConnection()); + + $rs = $user->list_users(); + + set('info', $rs[0]); + + return render('users.html.php'); +} + +function user_permissions() +{ + $user = new User(ErlangBridge::getInstance()->getConnection()); + + $rs = $user->list_user_permissions(base64_decode(params('user'))); + + set('info', $rs[0]); + + return render('user_permissions.html.php'); +} + +?> \ No newline at end of file diff --git a/controllers/vhosts.php b/controllers/vhosts.php new file mode 100644 index 0000000..026733a --- /dev/null +++ b/controllers/vhosts.php @@ -0,0 +1,79 @@ +<?php + +function list_vhosts() +{ + + $vhost = new Vhost(ErlangBridge::getInstance()->getConnection()); + $rs = $vhost->list_vhosts(); + + set('vhosts', $rs[0]); + + return render('vhosts.html.php'); +} + +function add_vhost_form($error = '') +{ + $name = params('name'); + if(!empty($name)) + { + die($name); + } + + set_or_default('error', $error, false); + return render('add_vhost.html.php'); +} + +function add_vhost() +{ + $name = $_POST['name']; + + if(!empty($name)) + { + $vhost = new Vhost(ErlangBridge::getInstance()->getConnection()); + $rs = $vhost->add($name); + header("Location: /"); + } + else + { + return add_vhost_form('You must provide the vhost name'); + } +} + +function delete_vhost() +{ + $name = base64_decode($_POST['name']); + + if(!empty($name) && $name != "/") + { + $vhost = new Vhost(ErlangBridge::getInstance()->getConnection()); + $vhost->delete($name); + + return json("OK"); + } + else + { + return json("KO"); + } +} + +function list_vhost_permissions() +{ + $vhost = new Vhost(ErlangBridge::getInstance()->getConnection()); + + $rs = $vhost->list_vhost_permissions(base64_decode(params('vhost'))); + + set('info', $rs[0]); + + return render('vhost_permissions.html.php'); +} + +function list_consumers() +{ + $queue = new Queue(ErlangBridge::getInstance()->getConnection()); + + $rs = $queue->list_consumers(base64_decode(params('vhost'))); + + set('info', $rs[0]); + + return render('list_consumers.html.php'); +} \ No newline at end of file diff --git a/lib/AMQPElement.class.php b/lib/AMQPElement.class.php new file mode 100644 index 0000000..3a6ba47 --- /dev/null +++ b/lib/AMQPElement.class.php @@ -0,0 +1,22 @@ +<?php + +class AMQPElement +{ + protected $conn; + + public function __construct($conn) + { + $this->conn = $conn; + } + + public function call($module, $function, $args) + { + $result = peb_rpc($module, $function, $args, $this->conn); + return peb_decode($result); + } + + public function array2AtomFormat($items) + { + return implode(', ', array_fill(0, count($items), '~a')); + } +} \ No newline at end of file diff --git a/lib/Channel.class.php b/lib/Channel.class.php new file mode 100644 index 0000000..d3c1a8b --- /dev/null +++ b/lib/Channel.class.php @@ -0,0 +1,18 @@ +<?php + +class Channel extends AMQPElement +{ + protected $info_items = array( + 'pid', 'user', 'transactional', 'consumer_count', 'messages_unacknowledged' + ); + + public function list_channels($info_items = array()) + { + $items = empty($items) ? $this->info_items : $items; + + $x = peb_encode("[[" . $this->array2AtomFormat($items) . "]]", + array(array($items))); + + return $this->call('rabbit_channel', 'info_all', $x); + } +} \ No newline at end of file diff --git a/lib/Connection.class.php b/lib/Connection.class.php new file mode 100644 index 0000000..28bf1f4 --- /dev/null +++ b/lib/Connection.class.php @@ -0,0 +1,18 @@ +<?php + +class Connection extends AMQPElement +{ + protected $info_items = array( + 'user', 'peer_address', 'peer_port', 'state' + ); + + public function list_connections($info_items = array()) + { + $items = empty($items) ? $this->info_items : $items; + + $x = peb_encode("[[" . $this->array2AtomFormat($items) . "]]", + array(array($items))); + + return $this->call('rabbit_networking', 'connection_info_all', $x); + } +} \ No newline at end of file diff --git a/lib/ErlangBridge.class.php b/lib/ErlangBridge.class.php new file mode 100644 index 0000000..e0bebda --- /dev/null +++ b/lib/ErlangBridge.class.php @@ -0,0 +1,34 @@ +<?php + +class ErlangBridge +{ + protected static $instance = null; + protected $link; + + protected function __construct() + {} + + public static function getInstance() + { + if(null === self::$instance) + { + self::$instance = new ErlangBridge(); + } + + return self::$instance; + } + + public function getConnection() + { + if(!$this->link) + { + $this->link = peb_connect(RABBITMQ_HOST, RABBITMQ_COOKIE); + if(!$this->link) + { + throw new Exception("can't connect to Erlang Node"); + } + } + + return $this->link; + } +} \ No newline at end of file diff --git a/lib/Exchange.class.php b/lib/Exchange.class.php new file mode 100644 index 0000000..686a878 --- /dev/null +++ b/lib/Exchange.class.php @@ -0,0 +1,35 @@ +<?php +class Exchange extends AMQPElement +{ + protected $info_items = array( + 'name', + 'type', + 'durable', + 'auto_delete', + 'arguments' + ); + + public function list_exchanges($vhost = "/") + { + $x = peb_encode("[~b]", array(array($vhost))); + return $this->call('rabbit_exchange', 'list', $x); + } + + public function list_bindings($vhost = "/") + { + $x = peb_encode("[~b]", array(array($vhost))); + return $this->call('rabbit_exchange', 'list_bindings', $x); + } + + public function info_all($vhost, $items = array()) + { + $items = empty($items) ? $this->info_items : $items; + + $x = peb_encode("[~b, [" . $this->array2AtomFormat($items) . "]]", array(array( + $vhost, + $items + ))); + + return $this->call('rabbit_exchange', 'info_all', $x); + } +} \ No newline at end of file diff --git a/lib/Queue.class.php b/lib/Queue.class.php new file mode 100644 index 0000000..f913e89 --- /dev/null +++ b/lib/Queue.class.php @@ -0,0 +1,55 @@ +<?php + +class Queue extends AMQPElement +{ + protected $info_items = array( + 'name', + 'durable', + 'auto_delete', + 'arguments', + 'messages_ready', + 'messages_unacknowledged', + 'messages_uncommitted', + 'messages', + 'acks_uncommitted', + 'consumers', + 'transactions', + 'memory', + ); + + public function list_queues($vhost = "/") + { + $x = peb_encode("[~b]", array(array($vhost))); + return $this->call("rabbit_amqqueue", "list", $x); + } + + public function info_all($vhost, $items = array()) + { + $items = empty($items) ? $this->info_items : $items; + + $x = peb_encode("[~b, [" . $this->array2AtomFormat($items) . "]]", array(array( + $vhost, + $items + ))); + + return $this->call("rabbit_amqqueue", "info_all", $x); + } + + public function stat_all() + { + $x = peb_encode("[]", array(array())); + return $this->call('rabbit_amqqueue', 'stat_all', $x); + } + + public function list_consumers($vhost) + { + $x = peb_encode("[~b]", array(array($vhost))); + return $this->call('rabbit_amqqueue', 'consumers_all', $x); + } + + public function delete($queue_name) + { + $x = peb_encode("[~b]", array(array($queue_name))); + return $this->call('rabbit_amqqueue', 'internal_delete', $x); + } +} \ No newline at end of file diff --git a/lib/User.class.php b/lib/User.class.php new file mode 100644 index 0000000..5cb9167 --- /dev/null +++ b/lib/User.class.php @@ -0,0 +1,39 @@ +<?php + +class User extends AMQPElement +{ + public function add_user($username, $password) + { + $x = peb_encode("[~b, ~b]", array(array($username, $password))); + + return $this->call('rabbit_access_control', 'add_user', $x); + } + + public function delete_user($username) + { + $x = peb_encode("[~b]", array(array($username))); + + return $this->call('rabbit_access_control', 'delete_user', $x); + } + + public function change_password($usernames, $newpassword) + { + $x = peb_encode("[~b, ~b]", array(array($username, $password))); + + return $this->call('rabbit_access_control', 'change_password', $x); + } + + public function list_users() + { + $x = peb_encode("[]", array(array())); + + return $this->call('rabbit_access_control', 'list_users', $x); + } + + public function list_user_permissions($user) + { + $x = peb_encode("[~b]", array(array($user))); + + return $this->call('rabbit_access_control', 'list_user_permissions', $x); + } +} \ No newline at end of file diff --git a/lib/Vhost.class.php b/lib/Vhost.class.php new file mode 100644 index 0000000..fd214d8 --- /dev/null +++ b/lib/Vhost.class.php @@ -0,0 +1,32 @@ +<?php + +class Vhost extends AMQPElement +{ + public function add($vhost) + { + $x = peb_encode("[~b]", array(array($vhost))); + + return $this->call('rabbit_access_control', 'add_vhost', $x); + } + + public function delete($vhost) + { + $x = peb_encode("[~b]", array(array($vhost))); + + return $this->call('rabbit_access_control', 'delete_vhost', $x); + } + + public function list_vhosts() + { + $x = peb_encode("[]", array(array())); + + return $this->call('rabbit_access_control', 'list_vhosts', $x); + } + + public function list_vhost_permissions($vhost) + { + $x = peb_encode("[~b]", array(array($vhost))); + + return $this->call('rabbit_access_control', 'list_vhost_permissions', $x); + } +} \ No newline at end of file diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..e932fb8 --- /dev/null +++ b/sync.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +rsync -r -v . alvaro@snowball:/srv/www/alvaro/rabbitadmin \ No newline at end of file diff --git a/views/add_vhost.html.php b/views/add_vhost.html.php new file mode 100644 index 0000000..a289e16 --- /dev/null +++ b/views/add_vhost.html.php @@ -0,0 +1,11 @@ +<?php if(!empty($error)): ?> + +<p><?php echo $error; ?></p> +<?php endif; ?> +<form action="/add_vhost" method="post" accept-charset="utf-8"> + <p> + <input type="text" name="name"> + </input> + <input type="submit" value="Add"> + </p> +</form> diff --git a/views/bindings.html.php b/views/bindings.html.php new file mode 100644 index 0000000..663a05f --- /dev/null +++ b/views/bindings.html.php @@ -0,0 +1,23 @@ +<h2>Bindings:</h2> +<?php if(empty($info)): ?> + <p>No Bindings to display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>Exchange</th> + <th>Queue</th> + <th>Routing Key</th> + </tr> + </thead> + <?php foreach($info as $binding): ?> + <tbody> + <tr> + <td><?php echo $binding[0][3]; ?></td> + <td><?php echo $binding[1][3]; ?></td> + <td><?php echo $binding[2]; ?></td> + </tr> + </tbody> + <?php endforeach; ?> + </table> +<?php endif; ?> \ No newline at end of file diff --git a/views/channels.html.php b/views/channels.html.php new file mode 100644 index 0000000..959f828 --- /dev/null +++ b/views/channels.html.php @@ -0,0 +1,25 @@ +<h2>Channels:</h2> +<?php if(empty($info)): ?> +<p>No Channels to Display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>User</th> + <th>Transactional</th> + <th>Consumer Count</th> + <th>Msgs Unacked</th> + </tr> + </thead> + <?php foreach($info as $item): ?> + <tbody> + <tr> + <td><?php echo $item[1][1]; ?></td> + <td><?php echo $item[2][1]; ?></td> + <td><?php echo $item[3][1]; ?></td> + <td><?php echo $item[4][1]; ?></td> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif;?> diff --git a/views/connections.html.php b/views/connections.html.php new file mode 100644 index 0000000..714ba66 --- /dev/null +++ b/views/connections.html.php @@ -0,0 +1,25 @@ +<h2>Connections:</h2> +<?php if(empty($info)): ?> +<p>No Connections to Display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>User</th> + <th>Peer Address</th> + <th>Peer Port</th> + <th>State</th> + </tr> + </thead> + <?php foreach($info as $item): ?> + <tbody> + <tr> + <td><?php echo $item[0][1]; ?></td> + <td><?php echo implode('.', $item[1][1]); ?></td> + <td><?php echo $item[2][1]; ?></td> + <td><?php echo $item[3][1]; ?></td> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/views/exchanges.html.php b/views/exchanges.html.php new file mode 100644 index 0000000..c60c0a7 --- /dev/null +++ b/views/exchanges.html.php @@ -0,0 +1,25 @@ +<h2>Exchanges:</h2> +<?php if(empty($info)): ?> +<p>No Exchanges to display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>Name:</th> + <th>Type:</th> + <th>Durable:</th> + <th>Auto Delete:</th> + </tr> + </thead> + <?php foreach($info as $exchange): ?> + <tbody> + <tr> + <td><?php echo $exchange['name']; ?></td> + <td><?php echo $exchange['type']; ?></td> + <td><?php echo $exchange['durable']; ?></td> + <td><?php echo $exchange['auto_delete']; ?></td> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> \ No newline at end of file diff --git a/views/layout.html.php b/views/layout.html.php new file mode 100644 index 0000000..e1afb21 --- /dev/null +++ b/views/layout.html.php @@ -0,0 +1,44 @@ +<?php extract($vars); ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>RabbitMQ Admin Console</title> +<script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> +<script type="text/javascript" charset="utf-8"> + function delete_vhost(vhost, vhostEl){ + $.ajax({ + type: "POST", + url: "/delete_vhost", + data: {name: vhost}, + success: function(data) { + if(data == 'OK') { + alert('Vhost ' + vhost + 'Deleted'); + $(vhostEl).parent().parent().remove(); + } else { + alert('Vhost ' + vhost + "Cant't be Deleted"); + } + } + }); + } + </script> +<link rel="stylesheet" type="text/css" media="screen" href="/style/style.css" /> +</head> +<body> +<div id="page"> + <h1 id="top"><a href="/"><img src="/img/rabbitmqlogonostrap.png" /></a><a href="/">Administration Console</a></h1> + <ul id="menu"> + <li><a href="/">Vhosts</a></li> + <li><a href="/list_users">Users</a></li> + <li><a href="/list_connections">Connections</a></li> + <li><a href="/list_channels">Channels</a></li> + </ul> + <div id="content"> + <?php echo $content; ?> + </div> + <div class="clear"> + <!----> + </div> +</div> +</body> +</html> diff --git a/views/list_consumers.html.php b/views/list_consumers.html.php new file mode 100644 index 0000000..428e276 --- /dev/null +++ b/views/list_consumers.html.php @@ -0,0 +1,21 @@ +<h2>Consumers:</h2> +<?php if(empty($info)): ?> +<p>No Consumers to display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>Queue:</th> + <th>Consumer Tag:</th> + </tr> + </thead> + <?php foreach($info as $consumer): ?> + <tbody> + <tr> + <td><?php echo $consumer[0][3]; ?></td> + <td><?php echo $consumer[2]; ?></td> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/views/queues.html.php b/views/queues.html.php new file mode 100644 index 0000000..cb8bce8 --- /dev/null +++ b/views/queues.html.php @@ -0,0 +1,29 @@ +<h2>Queues:</h2> +<?php if(empty($info)): ?> + <p>No Queues to display</p> +<?php else: ?> + <table cellspacing="0" class="form"> + <thead> + <tr> + <th>Name:</th> + <th>Messages:</th> + <th>Consumers:</th> + <th>Durable:</th> + <th>Auto Delete:</th> + <th>Memory:</th> + </tr> + </thead> + <?php foreach($info as $queue): ?> + <tbody> + <tr> + <td><?php echo $queue['name']; ?></td> + <td><?php echo $queue['messages']; ?></td> + <td><?php echo $queue['consumers']; ?></td> + <td><?php echo $queue['durable']; ?></td> + <td><?php echo $queue['auto_delete']; ?></td> + <td><?php echo $queue['memory']; ?></td> + </tr> + </tbody> + <?php endforeach; ?> + </table> +<?php endif; ?> \ No newline at end of file diff --git a/views/user_permissions.html.php b/views/user_permissions.html.php new file mode 100644 index 0000000..5133334 --- /dev/null +++ b/views/user_permissions.html.php @@ -0,0 +1,24 @@ +<h2>User Permissions</h2> +<?php if(empty($info)): ?> +<p>No Permissions to Display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>Vhost</th> + <th>Configure</th> + <th>Write</th> + <th>Read</th> + </tr> + </thead> + <?php foreach($info as $item): ?> + <tbody> + <tr> + <?php foreach($item as $value): ?> + <td><?php echo $value; ?></td> + <?php endforeach; ?> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/views/users.html.php b/views/users.html.php new file mode 100644 index 0000000..0a0432d --- /dev/null +++ b/views/users.html.php @@ -0,0 +1,15 @@ +<h2>Users</h2> +<?php if(empty($info)): ?> +<p>No Users to Display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <?php foreach($info as $item): ?> + <tbody> + <tr> + <td>Name:&nbsp;&nbsp;<strong><?php echo $item; ?></strong></td> + <td><a href="/user_permissions/<?php echo base64_encode($item); ?>">permissions</a></td> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/views/vhost_permissions.html.php b/views/vhost_permissions.html.php new file mode 100644 index 0000000..5832aed --- /dev/null +++ b/views/vhost_permissions.html.php @@ -0,0 +1,24 @@ +<h2>Vhost Permissions</h2> +<?php if(empty($info)): ?> +<p>No Permissions to Display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <thead> + <tr> + <th>User</th> + <th>Configure</th> + <th>Write</th> + <th>Read</th> + </tr> + </thead> + <?php foreach($info as $item): ?> + <tbody> + <tr> + <?php foreach($item as $value): ?> + <td><?php echo $value; ?></td> + <?php endforeach; ?> + </tr> + </tbody> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/views/vhosts.html.php b/views/vhosts.html.php new file mode 100644 index 0000000..75088b6 --- /dev/null +++ b/views/vhosts.html.php @@ -0,0 +1,26 @@ +<h2>Vhosts:</h2> +<?php if(empty($vhosts)): ?> +<p>No vhosts to display</p> +<?php else: ?> +<table cellspacing="0" class="form"> + <tbody> + <?php foreach($vhosts as $k=>$v): ?> + <tr> + <td>Name:&nbsp;&nbsp;&nbsp;<strong><?php echo $v ?></strong></td> + <td><a href="/queues/<?php echo base64_encode($v);?>">Queues</a></td> + <td><a href="/exchanges/<?php echo base64_encode($v);?>">Exchanges</a></td> + <td><a href="/bindings/<?php echo base64_encode($v);?>">Bindings</a></td> + <td><a href="/vhost_permissions/<?php echo base64_encode($v);?>">Permissions</a></td> + <td><a href="/list_consumers/<?php echo base64_encode($v);?>">Consumers</a></td> + <td><?php if($v == '/'): ?> + &nbsp; + <?php else: ?> + <a href="#" onclick="delete_vhost('<?php echo base64_encode($v);?>', this); return false;">Delete</a> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> +</table> +<?php endif; ?> +<a href="/add_vhost" class="button">Add vhosts</a> \ No newline at end of file diff --git a/web/.htaccess b/web/.htaccess new file mode 100644 index 0000000..73c8d19 --- /dev/null +++ b/web/.htaccess @@ -0,0 +1,13 @@ +<IfModule mod_rewrite.c> + Options +FollowSymlinks + Options +Indexes + RewriteEngine on + # RewriteBase /my_app/ # if your app is in a subfolder + + # test string is a valid files + RewriteCond %{SCRIPT_FILENAME} !-f + # test string is a valid directory + RewriteCond %{SCRIPT_FILENAME} !-d + + RewriteRule ^(.*)$ index.php?/$1 [NC,L] +</IfModule> \ No newline at end of file diff --git a/web/img/menu_bg.gif b/web/img/menu_bg.gif new file mode 100644 index 0000000..b1ad09f Binary files /dev/null and b/web/img/menu_bg.gif differ diff --git a/web/img/rabbitmqlogonostrap.png b/web/img/rabbitmqlogonostrap.png new file mode 100644 index 0000000..b5c1d43 Binary files /dev/null and b/web/img/rabbitmqlogonostrap.png differ diff --git a/web/index.php b/web/index.php new file mode 100644 index 0000000..8eef793 --- /dev/null +++ b/web/index.php @@ -0,0 +1,42 @@ +<?php + +require_once(__DIR__ . '/../lib/vendor/limonade/lib/limonade.php'); +require_once(__DIR__ . '/../config/config.php'); + +function configure() +{ + option('env', ENV_DEVELOPMENT); + option('limonade_dir', __DIR__ . '/../lib/vendor/limonade/lib'); + option('lib_dir', __DIR__ . '/../lib'); + option('controllers_dir', __DIR__ .'/../controllers'); + option('views_dir', __DIR__ .'/../views'); +} + +function before($route) +{ + layout('layout.html.php'); +} + +dispatch('/', 'list_vhosts'); +dispatch('/vhost_permissions/:vhost', 'list_vhost_permissions'); +dispatch('/add_vhost', 'add_vhost_form'); +dispatch_post('/add_vhost', 'add_vhost'); +dispatch_post('/delete_vhost', 'delete_vhost'); +dispatch('/list_consumers/:vhost', 'list_consumers'); + +dispatch('/exchanges/:vhost', 'list_exchanges'); + +dispatch('/queues/:vhost', 'list_queues'); + +dispatch('/bindings/:vhost', 'list_bindings'); + +dispatch('/list_connections', 'list_connections'); + +dispatch('/list_channels', 'list_channels'); + +dispatch('/list_users', 'list_users'); +dispatch('/user_permissions/:user', 'user_permissions'); + +run(); + +?> \ No newline at end of file diff --git a/web/js/jquery-1.4.2.min.js b/web/js/jquery-1.4.2.min.js new file mode 100644 index 0000000..7c24308 --- /dev/null +++ b/web/js/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? +e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= +j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, +"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= +true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| +c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", +L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, +"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ +a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], +d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== +a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& +!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= +true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", +i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", +" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= +this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= +e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= +null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, +"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= +a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, +isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= +{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; +if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& +!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, +toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, +u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), +function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; +if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; +for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- +1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, +CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, +relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= +l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; +h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= +m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| +!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= +h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, +gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; +c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? +a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& +this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| +u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== +1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); +this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], +"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, +animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= +j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); +this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| +c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? +function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= +this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; +k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& +f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/web/style/style.css b/web/style/style.css new file mode 100644 index 0000000..bd9195e --- /dev/null +++ b/web/style/style.css @@ -0,0 +1,185 @@ +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { + margin:0; + padding:0; + border:0; + outline:0; + font-size:100%; + vertical-align:baseline; +} +body { + color:#333; + font-size:12px; + line-height:1.5em; + font-family:Arial, Helvetica, sans-serif; + text-align:center; + background:#efefef; +} +/**main**/ +:focus { + outline:0; +} +html, body { + height:100%; + width:100%; +} +/**tables still need 'cellspacing="0"'**/ +table { + border-collapse:separate; + border-spacing:0; +} +caption, th, td { + font-weight:normal; +} +blockquote:before, blockquote:after, q:before, q:after { + content:""; +} +blockquote, q { + quotes:"" ""; +} +img { + border:0; +} +a { + color:#C00; + cursor:pointer; +} +a:hover, p.greyBox a:hover { + color:#FF6600 +} +.noBorder { + border:0; +} +/**ie6**/ +h1, h2, h3, h4, h5, h6 { + font-size:100%; + font-weight:normal; + font-family:Arial, Helvetica, sans-serif; +} +ol, ul { + list-style:none; + margin:0; + padding:0; +} +ol, ul, dl { + position:relative; +} +dl dt { + font-weight:bold; +} +dl dd { + padding-bottom:5px; +} +/**align**/ +.boxCenter { + text-align:center; +} +.left { + float:left; +} +.right { + float:right; +} +/**clearer**/ +.clear { + clear:both; +} +.noClear { + clear:none; +} +/**commen**/ +.button { + padding:3px 10px; + color:#FFF; + background:#F60; + border:1px #900 solid; + border-color: #ffd6ba #900 #900 #ffd6ba +} +.button:hover { + color:#FC3; + background:#ff802b +} +/**main**/ +#page { + width:1000px; + margin:15px auto; + text-align:left; + background:#FFF url(/img/menu_bg.gif) repeat-y 1px 1px; + padding:0 10px 10px; + border:1px #CCC solid; +} +#top { + margin:0 -9px 5px; + border-top:1px #FFF solid; + border-bottom:3px #F60 solid; + padding:5px 10px 3px; + background:#FFF +} +#top a { + margin-right:9px; + text-decoration:none; + color:#333; + font-size:14px; +} +/**menu**/ +#menu { + width:200px; + float:left; + border:1px #CCC solid; + padding:1px 1px 0; + margin:5px auto; + background:#FFF +} +#menu li { + line-height:26px; + height:26px; + background:#efefef; + margin-bottom:1px; +} +#menu li a { + display:block; + text-indent:15px; + font-size:14px; + color:#F60; + text-decoration:none +} +#menu li a:hover { + background:#F60; + color:#FFF +} +/**content**/ +#content { + width:773px; + margin-bottom:10px; + float:right; +} +#content h2 { + height:26px; + line-height:26px; + font-size:14px; + font-weight:bold; +} +#content table.form { + width:100%; + border:1px #CCC solid; + margin-bottom:10px; + padding-right:1px +} +table.form th, table.form td { + padding:0 0 0 10px; + line-height:28px; + height:28px; + background:#efefef; + border-bottom:1px #FFF solid; + border-left:1px #FFF solid; + text-align:left; + text-transform: capitalize +} +table.form th { + background:#888; + color:#FFF; + font-weight:bold; + border-top:1px #FFF solid; +} +table.form tr:hover td { + background:#FFC +}
manzke/de.devsurf.maven
aaa970d61c151810d3345ef3b7d9a7e9620d816a
[maven-release-plugin] prepare for next development iteration
diff --git a/pom.xml b/pom.xml index 651485e..581d578 100644 --- a/pom.xml +++ b/pom.xml @@ -1,304 +1,304 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format> <implementation.build>${maven.build.timestamp}</implementation.build> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.6</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> <version>2.4</version> <configuration> <tagListOptions> <tagClasses> <tagClass> <displayName>Todo Work</displayName> <tags> <tag> <matchString>TODO</matchString> <matchType>ignoreCase</matchType> </tag> <tag> <matchString>FIXME</matchString> <matchType>ignoreCase</matchType> </tag> </tags> </tagClass> </tagClasses> </tagListOptions> </configuration> </plugin> </plugins> </reporting> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.0-beta-1</version> <executions> <execution> <id>enforce-java</id> <phase>validate</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireJavaVersion> <version>[1.5,)</version> </requireJavaVersion> <requireMavenVersion> <version>[2.2.0,)</version> </requireMavenVersion> <requirePluginVersions> <message>Best Practice is to always define plugin versions!</message> <banLatest>true</banLatest> <banRelease>true</banRelease> <banSnapshots>true</banSnapshots> <phases>clean,deploy,site</phases> </requirePluginVersions> </rules> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.1</version> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.1.2</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar-no-fork</goal> </goals> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </execution> </executions> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/com/saperion/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> <!-- Add Later <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> <resource> <directory>${basedir}</directory> <targetPath>META-INF</targetPath> <includes> <include>LICENSE</include> <include>NOTICE</include> </includes> </resource> </resources> --> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>sonatype-nexus-releases</id> <name>Sonatype Nexus Releases</name> <url>https://oss.sonatype.org/content/repositories/releases/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
56aac595ea70cf00afe8ac100ffeedb8b50bf526
[maven-release-plugin] prepare release 1.4
diff --git a/pom.xml b/pom.xml index e661dad..651485e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,304 +1,304 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.4-SNAPSHOT</version> + <version>1.4</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format> <implementation.build>${maven.build.timestamp}</implementation.build> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.6</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> <version>2.4</version> <configuration> <tagListOptions> <tagClasses> <tagClass> <displayName>Todo Work</displayName> <tags> <tag> <matchString>TODO</matchString> <matchType>ignoreCase</matchType> </tag> <tag> <matchString>FIXME</matchString> <matchType>ignoreCase</matchType> </tag> </tags> </tagClass> </tagClasses> </tagListOptions> </configuration> </plugin> </plugins> </reporting> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.0-beta-1</version> <executions> <execution> <id>enforce-java</id> <phase>validate</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireJavaVersion> <version>[1.5,)</version> </requireJavaVersion> <requireMavenVersion> <version>[2.2.0,)</version> </requireMavenVersion> <requirePluginVersions> <message>Best Practice is to always define plugin versions!</message> <banLatest>true</banLatest> <banRelease>true</banRelease> <banSnapshots>true</banSnapshots> <phases>clean,deploy,site</phases> </requirePluginVersions> </rules> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.1</version> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.1.2</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar-no-fork</goal> </goals> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> <manifestEntries> <Implementation-Build>${implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> </manifestEntries> </archive> </configuration> </execution> </executions> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/com/saperion/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> <!-- Add Later <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> <resource> <directory>${basedir}</directory> <targetPath>META-INF</targetPath> <includes> <include>LICENSE</include> <include>NOTICE</include> </includes> </resource> </resources> --> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>sonatype-nexus-releases</id> <name>Sonatype Nexus Releases</name> <url>https://oss.sonatype.org/content/repositories/releases/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
7ecacaf22694422a2d32c36513f695866d7b3cc3
changed reporting
diff --git a/pom.xml b/pom.xml index 9764700..e661dad 100644 --- a/pom.xml +++ b/pom.xml @@ -1,133 +1,304 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.4-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format> <implementation.build>${maven.build.timestamp}</implementation.build> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> - <build> - <plugins> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.7</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.6</version> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.4</version> + <configuration> + <tagListOptions> + <tagClasses> + <tagClass> + <displayName>Todo Work</displayName> + <tags> + <tag> + <matchString>TODO</matchString> + <matchType>ignoreCase</matchType> + </tag> + <tag> + <matchString>FIXME</matchString> + <matchType>ignoreCase</matchType> + </tag> + </tags> + </tagClass> + </tagClasses> + </tagListOptions> + </configuration> + </plugin> + </plugins> + </reporting> + + <build> + <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> - </plugin> - <plugin> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-beta-1</version> + <executions> + <execution> + <id>enforce-java</id> + <phase>validate</phase> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireJavaVersion> + <version>[1.5,)</version> + </requireJavaVersion> + <requireMavenVersion> + <version>[2.2.0,)</version> + </requireMavenVersion> + <requirePluginVersions> + <message>Best Practice is to always define plugin versions!</message> + <banLatest>true</banLatest> + <banRelease>true</banRelease> + <banSnapshots>true</banSnapshots> + <phases>clean,deploy,site</phases> + </requirePluginVersions> + </rules> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.3.1</version> + <configuration> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + <manifestEntries> + <Implementation-Build>${implementation.build}</Implementation-Build> + <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> + <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> + </manifestEntries> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.1.2</version> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar-no-fork</goal> + </goals> + <configuration> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + <manifestEntries> + <Implementation-Build>${implementation.build}</Implementation-Build> + <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> + <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> + </manifestEntries> + </archive> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.7</version> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + </goals> + <configuration> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + <manifestEntries> + <Implementation-Build>${implementation.build}</Implementation-Build> + <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK> + <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK> + </manifestEntries> + </archive> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> - <email>[email protected]</email> + <email>[email protected]</email> </properties> <includes> - <include>**/de/devsurf/**/*.java</include> + <include>**/com/saperion/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> - </plugins> + </plugins> + +<!-- Add Later + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + + <resource> + <directory>${basedir}</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>LICENSE</include> + <include>NOTICE</include> + </includes> + </resource> + </resources> + --> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> - <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> - <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> + <repository> + <id>sonatype-nexus-releases</id> + <name>Sonatype Nexus Releases</name> + <url>https://oss.sonatype.org/content/repositories/releases/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> </repositories> </project>
manzke/de.devsurf.maven
3d8c0ab7b927153723488d5a79bb967e31efe9e3
extended the inherited properties
diff --git a/pom.xml b/pom.xml index 3e552bc..9764700 100644 --- a/pom.xml +++ b/pom.xml @@ -1,129 +1,133 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.4-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> + <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format> + <implementation.build>${maven.build.timestamp}</implementation.build> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> - </plugins> + </plugins> </build> + <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
a06c3245362193fb32248a5032a4c6b90a9876ce
[maven-release-plugin] prepare for next development iteration
diff --git a/pom.xml b/pom.xml index 47eb48b..3e552bc 100644 --- a/pom.xml +++ b/pom.xml @@ -1,129 +1,129 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.3</version> + <version>1.4-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
923d23aada40308b089a2a40c2a8089ead9e3ff8
[maven-release-plugin] prepare release 1.3
diff --git a/pom.xml b/pom.xml index 7da89a2..47eb48b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,130 +1,129 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.3-SNAPSHOT</version> + <version>1.3</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
49afee46c5e272f1cddfd7cd2e38939b42edc761
remove gpg plugin
diff --git a/pom.xml b/pom.xml index 8b1eba9..7da89a2 100644 --- a/pom.xml +++ b/pom.xml @@ -1,129 +1,130 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.3-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
284d41bcb3ecf95f6cdc6fd45706a22c6b92814e
[maven-release-plugin] prepare for next development iteration
diff --git a/pom.xml b/pom.xml index cf071c7..8b1eba9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,129 +1,129 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.2</version> + <version>1.3-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
8bb32fbdc9626ff16ed47774f49890ee88647360
[maven-release-plugin] prepare release 1.2
diff --git a/pom.xml b/pom.xml index c112947..cf071c7 100644 --- a/pom.xml +++ b/pom.xml @@ -1,130 +1,129 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.2-SNAPSHOT</version> + <version>1.2</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
ad9901d0ebade009d66c7f110ff45013db8ce25f
only include de.devsurf package for license scanning
diff --git a/pom.xml b/pom.xml index b842f47..c112947 100644 --- a/pom.xml +++ b/pom.xml @@ -1,130 +1,130 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.2-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> - <include>**/*.java</include> + <include>**/de/devsurf/**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </repository> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
manzke/de.devsurf.maven
74a3fdc4d0945725eb5ea444b5feb5f517cdd946
added basedir
diff --git a/pom.xml b/pom.xml index 6a4539e..b842f47 100644 --- a/pom.xml +++ b/pom.xml @@ -1,104 +1,130 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.2-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> - <main.basedir>${project.basedir}</main.basedir> + <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> + <repositories> + <repository> + <id>maven2-repository.dev.java.net</id> + <name>Java.net Repository for Maven</name> + <url>http://download.java.net/maven/2/</url> + <layout>default</layout> + </repository> + <repository> + <id>maven-repository.dev.java.net</id> + <name>Java.net Maven 1 Repository (legacy)</name> + <url>http://download.java.net/maven/1</url> + <layout>legacy</layout> + </repository> + <repository> + <id>sonatype-nexus-snapshots</id> + <name>Sonatype Nexus Snapshots</name> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> </project>
manzke/de.devsurf.maven
33f82c89e628dfc25978f5936042cfd98e7de5a3
adjusted .gitignore
diff --git a/.gitignore b/.gitignore index 7d7df9a..7154b61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,48 @@ # Compiled source # ################### *.com *.class *.dll *.exe *.o *.so # Packages # ############ # it's better to unpack these files and commit the raw source # git has its own built in compression methods *.7z *.dmg *.gz *.iso *.jar *.rar *.tar *.zip # Logs and databases # ###################### *.log *.sql *.sqlite # OS generated files # ###################### .DS_Store? ehthumbs.db Icon? Thumbs.db *.settings .settings/* */.settings/* **/.settings **/*.settings */target/* +**/target/* +target/* */bin/* +**/bin/* *.classpath +*.mymetadata #*.project \ No newline at end of file
manzke/de.devsurf.maven
116944c5d94006a0fc0a22ddf11c8da5db131a9c
[maven-release-plugin] prepare for next development iteration
diff --git a/pom.xml b/pom.xml index 75c4887..6a4539e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,104 +1,104 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.1</version> + <version>1.2-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
cd010494346bd8d06a188c52571b1383e91dcfc6
[maven-release-plugin] prepare release 1.1
diff --git a/pom.xml b/pom.xml index 95ac46a..75c4887 100644 --- a/pom.xml +++ b/pom.xml @@ -1,104 +1,104 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.1-SNAPSHOT</version> + <version>1.1</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
90ee8ec280b589116b957d13883c246966b7ab58
fixed pom.xml issue
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d7df9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite + +# OS generated files # +###################### +.DS_Store? +ehthumbs.db +Icon? +Thumbs.db + +*.settings +.settings/* +*/.settings/* +**/.settings +**/*.settings +*/target/* +*/bin/* +*.classpath +#*.project \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000..eddffc8 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>de.devsurf.maven</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/pom.xml b/pom.xml index 13b55a0..95ac46a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,102 +1,104 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>1.1-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> + <main.basedir>${project.basedir}</main.basedir> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> + <role>Owner</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>3.8.1</version> + <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> - <inherited>false</inherited> + <inherited>true</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> - <header>${basedir}/etc/header.txt</header> + <header>${main.basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
39b6c8e5fc12422e2421c083c677e494163df2a6
[maven-release-plugin] prepare for next development iteration
diff --git a/pom.xml b/pom.xml index d3b458e..13b55a0 100644 --- a/pom.xml +++ b/pom.xml @@ -1,102 +1,102 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.0</version> + <version>1.1-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>false</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
4ccc4b2971ba2f3baead17312af360323db4d1ae
[maven-release-plugin] prepare release 1.0
diff --git a/pom.xml b/pom.xml index a0dec5f..d3b458e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,102 +1,102 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>0.1-SNAPSHOT</version> + <version>1.0</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>false</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
5512fe2bc89b933d36af442aa78bcbefdc3c9591
added apache license header
diff --git a/pom.xml b/pom.xml index d3b458e..a0dec5f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,102 +1,102 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>1.0</version> + <version>0.1-SNAPSHOT</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>false</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
f55fc280d68c9c4c8c10e8c87ab2337a970c1d80
added apache license header
diff --git a/etc/header.txt b/etc/header.txt new file mode 100644 index 0000000..37d0357 --- /dev/null +++ b/etc/header.txt @@ -0,0 +1,13 @@ +Copyright (C) ${year} ${owner} <${email}> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file
manzke/de.devsurf.maven
71fbc50369dcaefb246186515333bdef1d9a4597
added apache license header
diff --git a/pom.xml b/pom.xml index 645380a..d3b458e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,103 +1,102 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> - <version>0.0.1-SNAPSHOT</version> + <version>1.0</version> <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>false</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
aa67b4f7b6328bf1d7ad341a7d046bed893083f5
added packaging to pom
diff --git a/pom.xml b/pom.xml index 146e4d1..645380a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,103 +1,103 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>5</version> </parent> <groupId>de.devsurf.maven</groupId> <artifactId>de.devsurf.maven</artifactId> <version>0.0.1-SNAPSHOT</version> - <packaging>jar</packaging> + <packaging>pom</packaging> <name>de.devsurf.maven</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <scm> <url>[email protected]:manzke/de.devsurf.maven.git</url> <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> </scm> <properties> <scm.branch>master</scm.branch> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <developers> <developer> <name>Daniel Manzke</name> <email>[email protected]</email> <url>http://www.devsurf.mp</url> <roles> <role>Developer</role> <role>Contributor</role> </roles> <properties> <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> </properties> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>${maven.compiler.source}</source> <target>${maven.compiler.target}</target> </configuration> </plugin> <plugin> <inherited>false</inherited> <groupId>com.google.code.maven-license-plugin</groupId> <artifactId>maven-license-plugin</artifactId> <version>1.4.0</version> <configuration> <header>${basedir}/etc/header.txt</header> <failIfMissing>true</failIfMissing> <aggregate>true</aggregate> <properties> <owner>Daniel Manzke</owner> <year>2010</year> <email>[email protected]</email> </properties> <includes> <include>**/*.java</include> </includes> </configuration> <executions> <execution> <id>check-headers</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
manzke/de.devsurf.maven
e83d2147c4889256a9c3120d30834ef0af89680d
initial import
diff --git a/.project b/.project new file mode 100644 index 0000000..eddffc8 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>de.devsurf.maven</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..146e4d1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,103 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.sonatype.oss</groupId> + <artifactId>oss-parent</artifactId> + <version>5</version> + </parent> + + <groupId>de.devsurf.maven</groupId> + <artifactId>de.devsurf.maven</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>de.devsurf.maven</name> + <url>http://maven.apache.org</url> + + <licenses> + <license> + <name>Apache License 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + </license> + </licenses> + + <scm> + <url>[email protected]:manzke/de.devsurf.maven.git</url> + <connection>scm:git:[email protected]:manzke/de.devsurf.maven.git</connection> + <developerConnection>scm:git:[email protected]:manzke/de.devsurf.maven.git</developerConnection> + </scm> + + <properties> + <scm.branch>master</scm.branch> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.6</maven.compiler.source> + <maven.compiler.target>1.6</maven.compiler.target> + </properties> + + <developers> + <developer> + <name>Daniel Manzke</name> + <email>[email protected]</email> + <url>http://www.devsurf.mp</url> + <roles> + <role>Developer</role> + <role>Contributor</role> + </roles> + <properties> + <picUrl>https://www.xing.com/img/users/8/d/2/e054f8ad2.6432019.jpg</picUrl> + </properties> + </developer> + </developers> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.1</version> + <configuration> + <source>${maven.compiler.source}</source> + <target>${maven.compiler.target}</target> + </configuration> + </plugin> + <plugin> + <inherited>false</inherited> + <groupId>com.google.code.maven-license-plugin</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>1.4.0</version> + <configuration> + <header>${basedir}/etc/header.txt</header> + <failIfMissing>true</failIfMissing> + <aggregate>true</aggregate> + <properties> + <owner>Daniel Manzke</owner> + <year>2010</year> + <email>[email protected]</email> + </properties> + <includes> + <include>**/*.java</include> + </includes> + </configuration> + <executions> + <execution> + <id>check-headers</id> + <phase>verify</phase> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/src/main/java/de/devsurf/maven/App.java b/src/main/java/de/devsurf/maven/App.java new file mode 100644 index 0000000..5463975 --- /dev/null +++ b/src/main/java/de/devsurf/maven/App.java @@ -0,0 +1,13 @@ +package de.devsurf.maven; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/test/java/de/devsurf/maven/AppTest.java b/src/test/java/de/devsurf/maven/AppTest.java new file mode 100644 index 0000000..32cdabb --- /dev/null +++ b/src/test/java/de/devsurf/maven/AppTest.java @@ -0,0 +1,38 @@ +package de.devsurf.maven; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}
wsmoak/npanday-wix-plugin
395596573cd121c4f676d6106817d765996f7f92
Allow configuration of multiple .wixobj files and the output file. More updates to change name to wix-maven-plugin.
diff --git a/src/it/IT002/pom.xml b/src/it/IT002/pom.xml index f7c9ca6..8a944c6 100755 --- a/src/it/IT002/pom.xml +++ b/src/it/IT002/pom.xml @@ -1,27 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>npanday.examples</groupId> <artifactId>IT002</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>NPanday WiX Plugin Integation Test 002</name> <description> Simple integration test to execute light on a sample .wixobj file. Based on tutorial at http://www.tramontana.co.hu/wix/ </description> <build> <plugins> <plugin> <groupId>npanday.plugin</groupId> <artifactId>wix-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> - <objectFile>Sample.wixobj</objectFile> + <objectFiles> + <objectFile>Sample.wixobj</objectFile> + </objectFiles> </configuration> </plugin> </plugins> </build> </project> diff --git a/src/main/java/npanday/plugin/wix/LightMojo.java b/src/main/java/npanday/plugin/wix/LightMojo.java index 3ae418a..54a1b26 100755 --- a/src/main/java/npanday/plugin/wix/LightMojo.java +++ b/src/main/java/npanday/plugin/wix/LightMojo.java @@ -1,71 +1,87 @@ package npanday.plugin.wix; /* * Copyright --- * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.DefaultExecutor; import org.apache.commons.exec.ExecuteException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import java.io.File; import java.io.IOException; /** * Goal which executes WiX light to create a .msi file. * * @goal light * * @phase package */ public class LightMojo extends AbstractMojo { /** - * Location of the WiX object file. - * @parameter expression="${objectFile}" + * Location of the WiX object files. + * @parameter expression="${objectFiles}" * @required */ - private File objectFile; + private File[] objectFiles; + + /** + * Output file + * @parameter expression="${outputFile}" + */ + private String outputFile; public void execute() throws MojoExecutionException { - File f = objectFile; - if ( !f.exists() ) - { - throw new MojoExecutionException( "Source file does not exist " + objectFile ); + String paths = ""; + for (int x = 0; x < objectFiles.length; x++) { + File f = objectFiles[x]; + if ( !f.exists() ) + { + throw new MojoExecutionException( "Object file does not exist " + objectFiles[x] ); + } else { + paths = paths + objectFiles[x].getAbsolutePath() + " "; + } } try { - String line = "light " + objectFile.getAbsolutePath(); + String line = "light " + paths; + + if (outputFile != null) { + line = line + " -o " + outputFile; + } + CommandLine commandLine = CommandLine.parse(line); DefaultExecutor executor = new DefaultExecutor(); int exitValue = executor.execute(commandLine); if ( exitValue != 0 ) { - throw new MojoExecutionException( "Problem executing candle, return code " + exitValue ); + throw new MojoExecutionException( "Problem executing light, return code " + exitValue ); } } catch (ExecuteException e) { - throw new MojoExecutionException( "Problem executing candle", e ); + throw new MojoExecutionException( "Problem executing light", e ); } catch (IOException e ) { - throw new MojoExecutionException( "Problem executing candle", e ); + throw new MojoExecutionException( "Problem executing light", e ); } } } diff --git a/src/site/apt/usage/candle.apt b/src/site/apt/usage/candle.apt index 5a2dbd7..24e3c56 100644 --- a/src/site/apt/usage/candle.apt +++ b/src/site/apt/usage/candle.apt @@ -1,35 +1,35 @@ ----- Candle Mojo Usage ----- Candle Mojo Usage Brief examples on how to use the candle goal. * The <<<candle>>> mojo If you want to convert a WiX Source (.wxs) file into a WiX Object (.wixobj) file, use this configuration in your pom: +---+ <project> ... <build> <plugins> <plugin> <groupId>npanday.plugin</groupId> - <artifactId>npanday-wix-plugin</artifactId> + <artifactId>wix-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <sourceFiles> <sourceFile>Sample.wxs</sourceFile> </sourceFiles> </configuration> </plugin> </plugins> ... </build> ... </project> +---+ Generally this will be done in a separate module with pom packaging. \ No newline at end of file diff --git a/src/site/apt/usage/light.apt b/src/site/apt/usage/light.apt index 2a3352b..7bbc999 100644 --- a/src/site/apt/usage/light.apt +++ b/src/site/apt/usage/light.apt @@ -1,33 +1,60 @@ ----- Light Mojo Usage ----- Light Mojo Usage Brief examples on how to use the light goal. * The <<<light>>> mojo - If you want to convert a WiX Object (.wixobj) file into a MSI (.msi) file, use this configuration in your pom: + If you want to convert a single WiX Object (.wixobj) file into a MSI (.msi) file, use this configuration in your pom: +---+ <project> ... <build> <plugins> <plugin> <groupId>npanday.plugin</groupId> <artifactId>npanday-wix-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <objectFile>Sample.wixobj</objectFile> </configuration> </plugin> </plugins> ... </build> ... </project> +---+ + If you want to convert multiple WiX Object (.wixobj) files into a MSI (.msi) file, use this configuration in your pom: + ++---+ +<project> + ... + <build> + <plugins> + <plugin> + <groupId>npanday.plugin</groupId> + <artifactId>wix-maven-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <configuration> + <objectFiles> + <objectFile>Sample.wixobj</objectFile> + <objectFile>Another.wixobj</objectFile> + </objectFiles> + <outputFile>SampleInstaller.msi</outputFile> + </configuration> + </plugin> + </plugins> + ... + </build> +... +</project> ++---+ + + Generally this will be done in a separate module with pom packaging. \ No newline at end of file
wsmoak/npanday-wix-plugin
037a9cf7de4c4bf93c933045510223bc31e4733c
Change plugin name to wix-maven-plugin as discussed on the forum.
diff --git a/pom.xml b/pom.xml index b6f9009..3876745 100644 --- a/pom.xml +++ b/pom.xml @@ -1,63 +1,63 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>npanday.plugin</groupId> - <artifactId>npanday-wix-plugin</artifactId> + <artifactId>wix-maven-plugin</artifactId> <packaging>maven-plugin</packaging> <version>1.0-SNAPSHOT</version> - <name>npanday-wix-plugin Maven Mojo</name> + <name>wix-maven-plugin Maven Mojo</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-exec</artifactId> <version>1.0</version> </dependency> </dependencies> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>2.4.3</version> </plugin> </plugins> </reporting> <build> <plugins> <plugin> <artifactId>maven-invoker-plugin</artifactId> <version>1.3</version> <configuration> <projectsDirectory>src/it</projectsDirectory> <cloneProjectsTo>target/it</cloneProjectsTo> <pomIncludes> <pomInclude>*/pom.xml</pomInclude> </pomIncludes> <localRepositoryPath>target/local-repo</localRepositoryPath> <postBuildHookScript>verify.bsh</postBuildHookScript> </configuration> <executions> <execution> <id>integration-test</id> <goals> <goal>install</goal> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> diff --git a/src/it/IT001/goals.txt b/src/it/IT001/goals.txt index 1d2b0f8..a5f2995 100755 --- a/src/it/IT001/goals.txt +++ b/src/it/IT001/goals.txt @@ -1 +1 @@ -npanday.plugin:npanday-wix-plugin:candle +npanday.plugin:wix-maven-plugin:candle diff --git a/src/it/IT001/pom.xml b/src/it/IT001/pom.xml index 01fca4a..5b14789 100755 --- a/src/it/IT001/pom.xml +++ b/src/it/IT001/pom.xml @@ -1,29 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>npanday.examples</groupId> <artifactId>IT001</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>NPanday WiX Plugin Integation Test 001</name> <description> Simple integration test to execute candle on a sample .wxs file. Based on tutorial at http://www.tramontana.co.hu/wix/ </description> <build> <plugins> <plugin> <groupId>npanday.plugin</groupId> - <artifactId>npanday-wix-plugin</artifactId> + <artifactId>wix-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <sourceFiles> <sourceFile>Sample.wxs</sourceFile> </sourceFiles> </configuration> </plugin> </plugins> </build> </project> diff --git a/src/it/IT002/goals.txt b/src/it/IT002/goals.txt index 8298fe8..f884d23 100755 --- a/src/it/IT002/goals.txt +++ b/src/it/IT002/goals.txt @@ -1 +1 @@ -npanday.plugin:npanday-wix-plugin:light +npanday.plugin:wix-maven-plugin:light diff --git a/src/it/IT002/pom.xml b/src/it/IT002/pom.xml index d6ad57d..f7c9ca6 100755 --- a/src/it/IT002/pom.xml +++ b/src/it/IT002/pom.xml @@ -1,27 +1,27 @@ <?xml version="1.0" encoding="utf-8"?> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>npanday.examples</groupId> <artifactId>IT002</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>NPanday WiX Plugin Integation Test 002</name> <description> Simple integration test to execute light on a sample .wixobj file. Based on tutorial at http://www.tramontana.co.hu/wix/ </description> <build> <plugins> <plugin> <groupId>npanday.plugin</groupId> - <artifactId>npanday-wix-plugin</artifactId> + <artifactId>wix-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <objectFile>Sample.wixobj</objectFile> </configuration> </plugin> </plugins> </build> </project>
wsmoak/npanday-wix-plugin
2e260c850e131ee52c5ce1f22e277086c096d904
Fix parameter after making sourceFiles plural
diff --git a/src/main/java/npanday/plugin/wix/CandleMojo.java b/src/main/java/npanday/plugin/wix/CandleMojo.java index d163e9a..9f8f28b 100755 --- a/src/main/java/npanday/plugin/wix/CandleMojo.java +++ b/src/main/java/npanday/plugin/wix/CandleMojo.java @@ -1,75 +1,75 @@ package npanday.plugin.wix; /* * Copyright --- * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.DefaultExecutor; import org.apache.commons.exec.ExecuteException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import java.io.File; import java.io.IOException; /** * Goal which executes WiX candle to create a .wixobj file. * * @goal candle * * @phase package */ public class CandleMojo extends AbstractMojo { /** - * Location of the WiX source file. - * @parameter expression="${sourceFile}" + * Location of the WiX source files. + * @parameter expression="${sourceFiles}" * @required */ private File[] sourceFiles; public void execute() throws MojoExecutionException { String paths = ""; for (int x = 0; x < sourceFiles.length; x++) { File f = sourceFiles[x]; if ( !f.exists() ) { throw new MojoExecutionException( "Source file does not exist " + sourceFiles[x] ); } else { paths = paths + sourceFiles[x].getAbsolutePath() + " "; } } try { String line = "candle " + paths; CommandLine commandLine = CommandLine.parse(line); DefaultExecutor executor = new DefaultExecutor(); int exitValue = executor.execute(commandLine); if ( exitValue != 0 ) { throw new MojoExecutionException( "Problem executing candle, return code " + exitValue ); } } catch (ExecuteException e) { throw new MojoExecutionException( "Problem executing candle", e ); } catch (IOException e ) { throw new MojoExecutionException( "Problem executing candle", e ); } } }