12 changed files with 3062 additions and 0 deletions
@ -0,0 +1,126 @@
|
||||
"1.1 |
||||
|
||||
loadplugins '\.(js|penta)$' |
||||
group user |
||||
highlight Addon:nth-child(2n+1) background: rgba(0, 43, 54, .04); |
||||
highlight -link=s_red_back Bell |
||||
highlight -link=s_cyan Boolean color: red; |
||||
highlight -link=s_blue Button display: inline-block; font-weight: bold; cursor: pointer; color: black; text-decoration: none; |
||||
highlight -link=s_base1,s_base00 Comment color: gray; |
||||
highlight -link=s_base1 CompDesc color: gray; width: 62%; padding-left: 1em; |
||||
highlight CompItem:nth-child(2n+1) background: rgba(0, 43, 54, .04); |
||||
highlight -link=s_base3,s_magenta_back CompItem[selected] |
||||
highlight -link=s_base3,s_comp_title CompTitle |
||||
highlight -link=s_comp_sep CompTitleSep height: 2px; |
||||
highlight -link=s_base01 Disabled color: gray !important; |
||||
highlight Download:nth-child(2n+1) background: rgba(0, 43, 54, .04); |
||||
highlight -link=s_base3,s_orange_back EditorBlink1 |
||||
highlight -link=s_base01 EditorBlink2 |
||||
highlight -link=s_base2,s_base3_back EditorEditing |
||||
highlight -link=s_base2,s_base3_back EditorEditing>* |
||||
highlight -link=s_base3,s_red_back EditorError |
||||
highlight -link=s_blue Enabled color: blue; |
||||
highlight -link=s_base3,s_magenta_back ErrorMsg |
||||
highlight -link=s_green Filter font-weight: bold; |
||||
highlight FontFixed font-family: "Terminus" !important; font-size: 14px !important; |
||||
highlight -link=s_blue_back FrameIndicator background-color: red; opacity: 0.5; z-index: 999999; position: fixed; top: 0; bottom: 0; left: 0; right: 0; |
||||
highlight -link=s_blue Function color: navy; |
||||
highlight -link=FontCode,s_cyan HelpArg color: #6A97D4; |
||||
highlight -link=s_base00,s_base3_back HelpBody display: block; margin: 1em auto; max-width: 100ex; padding-bottom: 1em; margin-bottom: 4em; border-bottom-width: 1px; |
||||
highlight HelpBorder border-color: #93a1a1 !important; border-width: 0px; border-style: solid; |
||||
highlight -link=FontCode,s_orange HelpEx display: inline-block; color: #527BBD; |
||||
highlight -link=s_yellow HelpHead font-weight: bold; color: #527BBD; clear: both; |
||||
highlight -link=s_magenta HelpInfoLabel display: inline-block; width: 6em; color: magenta; font-weight: bold; vertical-align: text-top; |
||||
highlight -link=FontCode,s_green HelpKey color: #102663; |
||||
highlight -link=s_red HelpKeyword font-weight: bold; color: navy; |
||||
highlight HelpLink[href] color: #268bd2; |
||||
highlight -link=s_green HelpNewsTag font-style: normal; position: absolute; left: 100%; padding-left: 1em; color: #527BBD; opacity: .6; white-space: pre; |
||||
highlight -link=s_magenta HelpNote color: red; font-weight: bold; |
||||
highlight -link=FontCode,s_cyan HelpOpt color: #106326; |
||||
highlight -link=FontCode,s_cyan HelpOptionalArg color: #6A97D4; |
||||
highlight -link=FontCode,s_cyan HelpSpec display: block; margin-left: -10em; float: left; clear: left; color: #527BBD; margin-right: 1em; |
||||
highlight -link=FontCode,s_violet HelpString color: green; font-weight: normal; |
||||
highlight -link=FontCode,s_red HelpTag display: inline-block; color: #527BBD; margin-left: 1ex; font-weight: normal; |
||||
highlight -link=FontCode,s_blue HelpTopic color: #102663; |
||||
highlight -link=s_blue HelpType margin-right: 2ex; |
||||
highlight -link=s_magenta HelpWarning color: red; font-weight: bold; |
||||
highlight -link=HelpXMLBase HelpXML display: inline-block; border: none; |
||||
highlight -link=FontCode,s_base0,s_base03_back HelpXMLBase white-space: pre; color: #C5F779; background-color: #444444; font-family: Terminus, Fixed, monospace; padding: 7px; |
||||
highlight -link=HelpXMLBase HelpXMLBlock display: block; margin-left: 2em; border: none; |
||||
highlight -link=s_base03 Hint font: "Terminus"; margin: -.2ex; padding: 0 0 0 1px; outline: 1px solid rgba(0, 43, 54, .5); background: rgba(253, 246, 227, .8); color: black; font-family: "Terminus" !important; font-size: 14 !important; |
||||
highlight -link=s_base3,s_magenta_back HintActive |
||||
highlight -link=s_base3,s_blue_back HintElem |
||||
highlight -link=s_blue Indicator color: blue; width: 1.5em; text-align: center; |
||||
highlight -link=s_base00 InfoMsg |
||||
highlight -link=s_yellow Keyword color: red; |
||||
highlight -link=s_base3,s_base2_back LineNr |
||||
highlight -link=s_base0,s_base03_back LinkInfo color: black; position: absolute; left: 100%; padding: 1ex; margin: -1ex -1em; background: rgba(255, 255, 255, .8); border-radius: 1ex; |
||||
highlight -link=s_base00,s_base3_back Message |
||||
highlight -link=s_base01 ModeMsg |
||||
highlight MoreMsg color: inherit !important; background: white !important; background-color: inherit !important; |
||||
highlight -link=s_blue,s_base3_back NonText color: blue; background: transparent !important; min-height: 16px; padding-left: 2px; |
||||
highlight -link=s_base00,s_base3_back Normal |
||||
highlight -link=s_blue Null color: blue; |
||||
highlight -link=s_blue Number color: blue; |
||||
highlight -link=s_green Object color: maroon; |
||||
highlight -link=s_base1 Preview color: gray; |
||||
highlight -link=s_cyan Question |
||||
highlight s_base0 color: #839496 !important; |
||||
highlight s_base0_back background-color: #839496 !important; |
||||
highlight s_base00 color: #657b83 !important; |
||||
highlight s_base00_back background-color: #657b83 !important; |
||||
highlight s_base01 color: #586e75 !important; |
||||
highlight s_base01_back background-color: #586e75 !important; |
||||
highlight s_base02 color: #073642 !important; |
||||
highlight s_base02_back background-color: #073642 !important; |
||||
highlight s_base03 color: #002b36 !important; |
||||
highlight s_base03_back background-color: #002b36 !important; |
||||
highlight s_base1 color: #93a1a1 !important; |
||||
highlight s_base1_back background-color: #93a1a1 !important; |
||||
highlight s_base2 color: #eee8d5 !important; |
||||
highlight s_base2_back background-color: #eee8d5 !important; |
||||
highlight s_base3 color: #fdf6e3 !important; |
||||
highlight s_base3_back background-color: #fdf6e3 !important; |
||||
highlight s_blue color: #268bd2 !important; |
||||
highlight s_blue_back background-color: #268bd2 !important; |
||||
highlight s_comp_sep background: -moz-linear-gradient(60deg, #2aa198, #fdf6e3) !important; |
||||
highlight s_comp_title background: -moz-linear-gradient(60deg, #839496, #fdf6e3) !important; |
||||
highlight s_cyan color: #2aa198 !important; |
||||
highlight s_cyan_back background-color: #2aa198 !important; |
||||
highlight s_green color: #859900 !important; |
||||
highlight s_green_back background-color: #859900 !important; |
||||
highlight s_magenta color: #d33682 !important; |
||||
highlight s_magenta_back background-color: #d33682 !important; |
||||
highlight s_orange color: #cb4b16 !important; |
||||
highlight s_orange_back background-color: #cb4b16 !important; |
||||
highlight s_red color: #dc322f !important; |
||||
highlight s_red_back background-color: #dc322f !important; |
||||
highlight s_violet color: #6c71c4 !important; |
||||
highlight s_violet_back background-color: #6c71c4 !important; |
||||
highlight s_yellow color: #b58900 !important; |
||||
highlight s_yellow_back background-color: #b58900 !important; |
||||
highlight -link=s_base3,s_orange_back StatusLineBroken |
||||
highlight -link=s_base3,s_violet_back StatusLineExtended |
||||
highlight -link=s_base00,s_base2_back StatusLineNormal |
||||
highlight -link=s_base3,s_blue_back StatusLineSecure |
||||
highlight StatusQuestion color: inherit !important; background: transparent !important; background-color: inherit !important; |
||||
highlight -link=s_base3,s_magenta_back StatusWarningMsg |
||||
highlight -link=s_base3 TabIconNumber cursor: default; width: 16px; margin: 0 2px 0 -18px !important; font-weight: bold; color: white; text-align: center; text-shadow: #002b36 -1px 0 1px, #002b36 0 1px 1px, #002b36 1px 0 1px, #002b36 0 -1px 1px; |
||||
highlight -link=s_blue Tag color: blue; |
||||
highlight -link=s_red Title color: magenta; font-weight: bold; |
||||
highlight -link=s_base1 URL |
||||
highlight -link=s_base1 URLExtra |
||||
highlight UsageItem:nth-of-type(2n) background: rgba(0, 43, 54, .04); |
||||
highlight -link=s_base3,s_yellow_back WarningMsg |
||||
map -count -modes=n -silent d -builtin <Nop> |
||||
map -count -modes=n <C-a> -builtin <Nop> |
||||
map -count -modes=n,v <C-h> -builtin <count><C-p> |
||||
map -count -modes=n,v <C-l> -builtin <count><C-n> |
||||
set editor=/usr/bin/gvim |
||||
set guioptions=s |
||||
set hintkeys=fdsaghjkl; |
||||
set hlfind |
||||
set noincfind |
||||
set showtabline=always |
||||
|
||||
" vim: set ft=pentadactyl: |
@ -0,0 +1,499 @@
|
||||
-- Standard awesome library |
||||
local gears = require('gears') |
||||
local awful = require('awful') |
||||
awful.rules = require('awful.rules') |
||||
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') |
||||
|
||||
-- enable testing if file exists |
||||
function ifexists(name) |
||||
local f=io.open(name,'r') |
||||
if f ~= nil then io.close(f) return true else return false end |
||||
end |
||||
|
||||
-- {{{ 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 |
||||
-- }}} |
||||
|
||||
-- {{{ Variable definitions |
||||
-- Themes define colours, icons, and wallpapers |
||||
beautiful.init('/home/von/vdotfiles/theme.lua') |
||||
theme.border_width = 1 |
||||
theme.font = 'Terminus 9' |
||||
|
||||
-- set wallpaper |
||||
local wallpaper = '/home/von/Pictures/wallpaper.png' |
||||
if ifexists(wallpaper) then |
||||
theme.wallpaper = wallpaper |
||||
end |
||||
|
||||
-- This is used later as the default terminal and editor to run. |
||||
terminal = 'roxterm' |
||||
editor = os.getenv('EDITOR') or '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. |
||||
local layouts = |
||||
{ |
||||
awful.layout.suit.floating, |
||||
awful.layout.suit.tile, |
||||
awful.layout.suit.tile.bottom, |
||||
awful.layout.suit.max, |
||||
awful.layout.suit.magnifier |
||||
} |
||||
-- }}} |
||||
|
||||
-- {{{ Wallpaper |
||||
if beautiful.wallpaper then |
||||
for s = 1, screen.count() do |
||||
gears.wallpaper.centered(beautiful.wallpaper, s) |
||||
end |
||||
end |
||||
-- }}} |
||||
|
||||
-- {{{ Tags |
||||
-- Provide tag names and layout settings if we wish to define them |
||||
tags = {} |
||||
for s = 1, screen.count() do |
||||
tags[s] = { name = {}, layout = {} } |
||||
end |
||||
-- screen 1 |
||||
--tags[1].name = |
||||
--{ |
||||
-- [1] = '1:browser', |
||||
-- [2] = '2:terminal', |
||||
-- [3] = '3:terminal', |
||||
-- [4] = '4:float', |
||||
-- [9] = '9:mail' |
||||
--} |
||||
tags[1].layout = |
||||
{ |
||||
[1] = layouts[2], |
||||
[4] = layouts[1], |
||||
[5] = layouts[1] |
||||
} |
||||
-- screens 2+ |
||||
if screen.count() >= 2 then |
||||
--tags[2].name = |
||||
--{ |
||||
-- [3] = '3:float', |
||||
--} |
||||
tags[2].layout = |
||||
{ |
||||
[3] = layouts[1] |
||||
} |
||||
end |
||||
-- Fill the missing values with defaults |
||||
for s = 1, screen.count() do |
||||
for tag = 1, 9 do |
||||
tags[s].name[tag] = tags[s].name[tag] or tag |
||||
tags[s].layout[tag] = tags[s].layout[tag] or layouts[3] |
||||
end |
||||
end |
||||
-- Set tags instances in wm |
||||
for s = 1, screen.count() do |
||||
tags[s] = awful.tag(tags[s].name, s, tags[s].layout) |
||||
end |
||||
-- }}} |
||||
|
||||
-- {{{ Menu |
||||
-- Create a laucher widget and a main menu |
||||
restartmenu = { |
||||
{ 'restart', awesome.restart } |
||||
} |
||||
quitmenu = { |
||||
{ 'quit', awesome.quit } |
||||
} |
||||
|
||||
mymainmenu = awful.menu({ items = { { 'restart', restartmenu, beautiful.awesome_icon }, |
||||
{ 'quit', quitmenu, beautiful.awesome_icon } |
||||
} |
||||
}) |
||||
|
||||
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, |
||||
menu = mymainmenu }) |
||||
|
||||
-- Menubar configuration |
||||
menubar.utils.terminal = terminal -- Set the terminal for applications that require it |
||||
-- }}} |
||||
|
||||
-- {{{ Wibox |
||||
-- Create a textclock widget |
||||
mytextclock = awful.widget.textclock('%a %d %H:%M') |
||||
mytextclock:set_font('Terminus Bold 11') |
||||
mytextbox = wibox.widget.textbox() |
||||
mytextbox:set_text('') |
||||
mytextbox:set_font('Terminus 9') |
||||
|
||||
-- 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({ }, 5, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), |
||||
awful.button({ }, 4, 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.noempty, 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', height = '16', screen = s }) |
||||
|
||||
local left_layout = wibox.layout.fixed.horizontal() |
||||
local right_layout = wibox.layout.fixed.horizontal() |
||||
if s == 1 then |
||||
left_layout:add(mytextbox) |
||||
right_layout:add(mypromptbox[s]) |
||||
right_layout:add(mytaglist[s]) |
||||
if screen.count() == 1 then |
||||
right_layout:add(wibox.widget.systray()) |
||||
right_layout:add(mytextclock) |
||||
end |
||||
right_layout:add(mylayoutbox[s]) |
||||
elseif s == 2 then |
||||
left_layout:add(mylayoutbox[s]) |
||||
left_layout:add(mytextclock) |
||||
left_layout:add(wibox.widget.systray()) |
||||
left_layout:add(mytaglist[s]) |
||||
left_layout:add(mypromptbox[s]) |
||||
else |
||||
left_layout:add(mytaglist[s]) |
||||
left_layout:add(mypromptbox[s]) |
||||
right_layout:add(mylayoutbox[s]) |
||||
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({ }, 5, awful.tag.viewnext), |
||||
awful.button({ }, 4, awful.tag.viewprev) |
||||
)) |
||||
-- }}} |
||||
|
||||
-- {{{ Key bindings |
||||
globalkeys = awful.util.table.join( |
||||
awful.key({ modkey, }, 'Up', function () awful.screen.focus_relative( 1) end), |
||||
awful.key({ modkey, }, 'Down', function () awful.screen.focus_relative(-1) end), |
||||
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, }, 'j', |
||||
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' }, 'j', function () awful.client.swap.byidx( 1) end), |
||||
awful.key({ modkey, 'Shift' }, 'k', function () awful.client.swap.byidx( -1) end), |
||||
awful.key({ modkey, 'Control' }, 'j', 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), |
||||
awful.key({ 'Mod1', }, 'Tab', |
||||
function () |
||||
awful.client.focus.byidx(-1) |
||||
if client.focus then |
||||
client.focus:raise() |
||||
end |
||||
end), |
||||
awful.key({ 'Mod1', 'Shift' }, 'Tab', |
||||
function () |
||||
awful.client.focus.byidx(1) |
||||
if client.focus then |
||||
client.focus:raise() |
||||
end |
||||
end), |
||||
|
||||
-- Standard program |
||||
--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({ 'Mod1', }, 'F2', function () mypromptbox[mouse.screen]:run() end), |
||||
|
||||
awful.key({ modkey, }, 'e', |
||||
function () |
||||
awful.prompt.run({ prompt = 'Run Lua code: ' }, |
||||
mypromptbox[mouse.screen].widget, |
||||
awful.util.eval, nil, |
||||
awful.util.getdir('cache') .. '/history_eval') |
||||
end), |
||||
-- Menubar |
||||
awful.key({ modkey, }, 'p', function () menubar.show() end), |
||||
-- Glbal commands |
||||
awful.key({ modkey, }, 'x', function () awful.util.spawn(terminal) end), |
||||
awful.key({ modkey, }, 'q', function () awful.util.spawn('/home/von/.local/bin/ticket_watch') end), |
||||
awful.key({ modkey, }, 'z', function () awful.util.spawn('dm-tool lock') end), |
||||
awful.key({ modkey, }, 'F6', function () awful.util.spawn('/home/von/touchpad_hotkey.sh') end), |
||||
awful.key({ }, 'Print', function () awful.util.spawn('xfce4-screenshooter -ws /home/von/screenshots') end), |
||||
awful.key({ modkey, }, 'Print', function () awful.util.spawn('xfce4-screenshooter -fs /home/von/screenshots') end) |
||||
-- screenshot via scrot (might be useful at some point |
||||
-- awful.key({ }, 'Print', function() awful.util.spawn('scrot /home/von/screenshots/%Y-%m-%d_%H-%M_all.png') 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, }, '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, }, 's', function (c) c.sticky = not c.sticky 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) |
||||
) |
||||
|
||||
-- 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, 9 do |
||||
globalkeys = awful.util.table.join(globalkeys, |
||||
awful.key({ modkey }, '#' .. i + 9, |
||||
function () |
||||
local screen = mouse.screen |
||||
local tag = awful.tag.gettags(screen)[i] |
||||
if tag then |
||||
awful.tag.viewonly(tag) |
||||
end |
||||
end), |
||||
awful.key({ modkey, 'Control' }, '#' .. i + 9, |
||||
function () |
||||
local screen = mouse.screen |
||||
local tag = awful.tag.gettags(screen)[i] |
||||
if tag then |
||||
awful.tag.viewtoggle(tag) |
||||
end |
||||
end), |
||||
awful.key({ modkey, 'Shift' }, '#' .. i + 9, |
||||
function () |
||||
if client.focus then |
||||
local tag = awful.tag.gettags(client.focus.screen)[i] |
||||
if tag then |
||||
awful.client.movetotag(tag) |
||||
end |
||||
end |
||||
end), |
||||
awful.key({ modkey, 'Control', 'Shift' }, '#' .. i + 9, |
||||
function () |
||||
if client.focus then |
||||
local tag = awful.tag.gettags(client.focus.screen)[i] |
||||
if tag then |
||||
awful.client.toggletag(tag) |
||||
end |
||||
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 only rules class based rules |
||||
{ rule_any = { class = { 'pinentry', 'Skype', 'Deadbeef', 'Pavucontrol', 'Qmmp', 'Vncviewer', 'plugin-container', 'mpv' }, instance = { 'sun-awt-X11-XFramePeer' } }, |
||||
properties = { floating = true } }, |
||||
-- Mostly floating rules, we want to keep them separately since it's easier to manage |
||||
-- firefox |
||||
{ rule = { class = 'Firefox' }, except = { instance = 'Navigator' }, |
||||
properties = { floating = true } }, |
||||
-- ardour3 |
||||
{ rule = { class = 'Ardour' }, except = { instance = 'ardour_editor' }, |
||||
properties = { floating = true } }, |
||||
-- Remove gaps between terminal windows: |
||||
-- roxterm |
||||
{ rule = { class = 'Roxterm' }, |
||||
properties = { size_hints_honor = false } }, |
||||
-- Specific desktops rules: place windows only on specific tags by default |
||||
-- steam |
||||
{ rule = { class = 'Steam' }, |
||||
properties = { tag = tags[1][4] } }, |
||||
-- games |
||||
{ rule_any = { class = { 'dota_linux', 'hl2_linux', 'Strife', 'ck2', 'Pandora', 'witcher2', 'Symphony.bin.x86_64', 'Civ5XP', 'game.x86_64', 'deponia_tcj' }, instance = { 'Civ4BeyondSword.exe', 'KB.exe' } }, |
||||
properties = { border_width = 0, |
||||
floating = true, |
||||
tag = tags[1][5] } } |
||||
} |
||||
-- }}} |
||||
|
||||
-- {{{ Signals |
||||
-- Signal function to execute when a new client appears. |
||||
client.connect_signal('manage', function (c, startup) |
||||
-- Enable sloppy focus |
||||
c:connect_signal('mouse::enter', function(c) |
||||
if (awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.layout.get(c.screen) ~= awful.layout.suit.floating) |
||||
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.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 |
||||
-- don't forget you sync this file |
||||
-- this shit runs every time you restart your wm, dumbass. |
||||
awful.util.spawn_with_shell('setxkbmap -layout us,ru -variant altgr-intl,typewriter -option grp:caps_toggle,compose:menu,grp_led:scroll') |
||||
awful.util.spawn_with_shell('xrdb /home/von/.Xresources') |
||||
if ifexists('/home/von/.autostart') then |
||||
awful.util.spawn_with_shell('/home/von/.autostart') |
||||
end |
||||
-- }}} |
@ -0,0 +1,26 @@
|
||||
#term xterm |
||||
termcapinfo urxvt* ti@:te@ |
||||
terminfo urxvt* ti@:te@ |
||||
termcapinfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' |
||||
terminfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' |
||||
#termcapinfo xterm* ks@:ke@ |
||||
#terminfo xterm* ks@:ke@ |
||||
startup_message off |
||||
hardstatus off |
||||
defscrollback 10000 |
||||
vbell on |
||||
vbell_msg "vbell on %n" |
||||
vbellwait 900 |
||||
bell_msg "bell on %n" |
||||
autodetach on |
||||
defbce on |
||||
altscreen on |
||||
activity "activity on %n" |
||||
#hardstatus alwayslastline |
||||
caption always '%{= kw}[ %{kw}%-w%{bW}%n %t%{kw}%+w%{kW} %-=][ %{kr}%l%{kw} ]' |
||||
#shelltitle "$ |zsh" |
||||
#bindkey ^[q prev |
||||
#bindkey ^[w next |
||||
#bindkey ^[a screen |
||||
#bindkey ^[[1;3D prev |
||||
#bindkey ^[[1;3C next |
@ -0,0 +1,124 @@
|
||||
--------------------------------- |
||||
-- "Solarized" awesome theme -- |
||||
-- By Gwenhael Le Moine -- |
||||
--------------------------------- |
||||
|
||||
-- Alternative icon sets and widget icons: |
||||
-- * http://awesome.naquadah.org/wiki/Nice_Icons |
||||
|
||||
-- {{{ Main |
||||
theme = {} |
||||
theme.default_themes_path = "/usr/share/awesome/themes" |
||||
theme.wallpaper_cmd = { "awsetbg "..theme.default_themes_path.."/zenburn/zenburn-background.png" } |
||||
theme.colors = {} |
||||
theme.colors.base3 = "#002b36ff" |
||||
theme.colors.base2 = "#073642ff" |
||||
theme.colors.base1 = "#586e75ff" |
||||
theme.colors.base0 = "#657b83ff" |
||||
theme.colors.base00 = "#839496ff" |
||||
theme.colors.base01 = "#93a1a1ff" |
||||
theme.colors.base02 = "#eee8d5ff" |
||||
theme.colors.base03 = "#fdf6e3ff" |
||||
theme.colors.yellow = "#b58900ff" |
||||
theme.colors.orange = "#cb4b16ff" |
||||
theme.colors.red = "#dc322fff" |
||||
theme.colors.magenta = "#d33682ff" |
||||
theme.colors.violet = "#6c71c4ff" |
||||
theme.colors.blue = "#268bd2ff" |
||||
theme.colors.cyan = "#2aa198ff" |
||||
theme.colors.green = "#859900ff" |
||||
-- }}} |
||||
|
||||
-- {{{ Styles |
||||
theme.font = "Terminus 9" |
||||
|
||||
-- {{{ Colors |
||||
theme.fg_normal = theme.colors.base02 |
||||
theme.fg_focus = theme.colors.base03 |
||||
theme.fg_urgent = theme.colors.base3 |
||||
|
||||
theme.bg_normal = theme.colors.base3 |
||||
theme.bg_focus = theme.colors.base1 |
||||
theme.bg_urgent = theme.colors.red |
||||
theme.bg_systray = theme.bg_normal |
||||
-- }}} |
||||
|
||||
-- {{{ Borders |
||||
theme.border_width = "2" |
||||
theme.border_normal = theme.bg_normal |
||||
theme.border_focus = theme.bg_focus |
||||
theme.border_marked = theme.bg_urgent |
||||
-- }}} |
||||
|
||||
-- {{{ Titlebars |
||||
theme.titlebar_bg_focus = theme.bg_focus |
||||
theme.titlebar_bg_normal = theme.bg_normal |
||||
-- }}} |
||||
|
||||
-- {{{ Mouse finder |
||||
theme.mouse_finder_color = theme.colors.green |
||||
-- 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 = "15" |
||||
theme.menu_width = "100" |
||||
-- }}} |
||||
|
||||
-- {{{ Icons |
||||
-- {{{ Taglist |
||||
theme.taglist_squares_sel = theme.default_themes_path.."/zenburn/taglist/squarefz.png" |
||||
theme.taglist_squares_unsel = theme.default_themes_path.."/zenburn/taglist/squarez.png" |
||||
--theme.taglist_squares_resize = "false" |
||||
-- }}} |
||||
|
||||
-- {{{ Misc |
||||
theme.awesome_icon = theme.default_themes_path.."/zenburn/awesome-icon.png" |
||||
theme.menu_submenu_icon = theme.default_themes_path.."/default/submenu.png" |
||||
-- }}} |
||||
|
||||
-- {{{ Layout |
||||
theme.layout_tile = theme.default_themes_path.."/zenburn/layouts/tile.png" |
||||
theme.layout_tileleft = theme.default_themes_path.."/zenburn/layouts/tileleft.png" |
||||
theme.layout_tilebottom = theme.default_themes_path.."/zenburn/layouts/tilebottom.png" |
||||
theme.layout_tiletop = theme.default_themes_path.."/zenburn/layouts/tiletop.png" |
||||
theme.layout_fairv = theme.default_themes_path.."/zenburn/layouts/fairv.png" |
||||
theme.layout_fairh = theme.default_themes_path.."/zenburn/layouts/fairh.png" |
||||
theme.layout_spiral = theme.default_themes_path.."/zenburn/layouts/spiral.png" |
||||
theme.layout_dwindle = theme.default_themes_path.."/zenburn/layouts/dwindle.png" |
||||
theme.layout_max = theme.default_themes_path.."/zenburn/layouts/max.png" |
||||
theme.layout_fullscreen = theme.default_themes_path.."/zenburn/layouts/fullscreen.png" |
||||
theme.layout_magnifier = theme.default_themes_path.."/zenburn/layouts/magnifier.png" |
||||
theme.layout_floating = theme.default_themes_path.."/zenburn/layouts/floating.png" |
||||
-- }}} |
||||
|
||||
-- {{{ Titlebar |
||||
theme.titlebar_close_button_focus = theme.default_themes_path.."/zenburn/titlebar/close_focus.png" |
||||
theme.titlebar_close_button_normal = theme.default_themes_path.."/zenburn/titlebar/close_normal.png" |
||||
|
||||
theme.titlebar_ontop_button_focus_active = theme.default_themes_path.."/zenburn/titlebar/ontop_focus_active.png" |
||||
theme.titlebar_ontop_button_normal_active = theme.default_themes_path.."/zenburn/titlebar/ontop_normal_active.png" |
||||
theme.titlebar_ontop_button_focus_inactive = theme.default_themes_path.."/zenburn/titlebar/ontop_focus_inactive.png" |
||||
theme.titlebar_ontop_button_normal_inactive = theme.default_themes_path.."/zenburn/titlebar/ontop_normal_inactive.png" |
||||
|
||||
theme.titlebar_sticky_button_focus_active = theme.default_themes_path.."/zenburn/titlebar/sticky_focus_active.png" |
||||
theme.titlebar_sticky_button_normal_active = theme.default_themes_path.."/zenburn/titlebar/sticky_normal_active.png" |
||||
theme.titlebar_sticky_button_focus_inactive = theme.default_themes_path.."/zenburn/titlebar/sticky_focus_inactive.png" |
||||
theme.titlebar_sticky_button_normal_inactive = theme.default_themes_path.."/zenburn/titlebar/sticky_normal_inactive.png" |
||||
|
||||
theme.titlebar_floating_button_focus_active = theme.default_themes_path.."/zenburn/titlebar/floating_focus_active.png" |
||||
theme.titlebar_floating_button_normal_active = theme.default_themes_path.."/zenburn/titlebar/floating_normal_active.png" |
||||
theme.titlebar_floating_button_focus_inactive = theme.default_themes_path.."/zenburn/titlebar/floating_focus_inactive.png" |
||||
theme.titlebar_floating_button_normal_inactive = theme.default_themes_path.."/zenburn/titlebar/floating_normal_inactive.png" |
||||
|
||||
theme.titlebar_maximized_button_focus_active = theme.default_themes_path.."/zenburn/titlebar/maximized_focus_active.png" |
||||
theme.titlebar_maximized_button_normal_active = theme.default_themes_path.."/zenburn/titlebar/maximized_normal_active.png" |
||||
theme.titlebar_maximized_button_focus_inactive = theme.default_themes_path.."/zenburn/titlebar/maximized_focus_inactive.png" |
||||
theme.titlebar_maximized_button_normal_inactive = theme.default_themes_path.."/zenburn/titlebar/maximized_normal_inactive.png" |
||||
-- }}} |
||||
-- }}} |
||||
|
||||
return theme |
@ -0,0 +1,142 @@
|
||||
" Vim color file |
||||
" |
||||
" Name: xoria256.vim |
||||
" Version: 1.5 |
||||
" Maintainer: Dmitriy Y. Zotikov (xio) <xio@ungrund.org> |
||||
" |
||||
" Should work in recent 256 color terminals. 88-color terms like urxvt are |
||||
" NOT supported. |
||||
" |
||||
" Don't forget to install 'ncurses-term' and set TERM to xterm-256color or |
||||
" similar value. |
||||
" |
||||
" Color numbers (0-255) see: |
||||
" http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html |
||||
" |
||||
" For a specific filetype highlighting rules issue :syntax list when a file of |
||||
" that type is opened. |
||||
|
||||
" Initialization {{{ |
||||
if &t_Co != 256 && ! has("gui_running") |
||||
echomsg "" |
||||
echomsg "err: please use GUI or a 256-color terminal (so that t_Co=256 could be set)" |
||||
echomsg "" |
||||
finish |
||||
endif |
||||
|
||||
set background=dark |
||||
|
||||
hi clear |
||||
|
||||
if exists("syntax_on") |
||||
syntax reset |
||||
endif |
||||
|
||||
let colors_name = "xoria256" |
||||
"}}} |
||||
" Colours {{{1 |
||||
"" General {{{2 |
||||
hi Normal ctermfg=252 guifg=#d0d0d0 ctermbg=234 guibg=#1c1c1c cterm=none gui=none |
||||
hi Cursor ctermbg=214 guibg=#ffaf00 |
||||
hi CursorColumn ctermbg=238 guibg=#444444 |
||||
hi CursorLine ctermbg=237 guibg=#3a3a3a cterm=none gui=none |
||||
hi Error ctermfg=15 guifg=#ffffff ctermbg=1 guibg=#800000 |
||||
hi ErrorMsg ctermfg=15 guifg=#ffffff ctermbg=1 guibg=#800000 |
||||
hi FoldColumn ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212 |
||||
hi Folded ctermfg=255 guifg=#eeeeee ctermbg=60 guibg=#5f5f87 |
||||
hi IncSearch ctermfg=0 guifg=#000000 ctermbg=223 guibg=#ffdfaf cterm=none gui=none |
||||
hi LineNr ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212 |
||||
hi MatchParen ctermfg=188 guifg=#dfdfdf ctermbg=68 guibg=#5f87df cterm=bold gui=bold |
||||
" TODO |
||||
" hi MoreMsg |
||||
hi NonText ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212 cterm=bold gui=bold |
||||
hi Pmenu ctermfg=0 guifg=#000000 ctermbg=250 guibg=#bcbcbc |
||||
hi PmenuSel ctermfg=255 guifg=#eeeeee ctermbg=243 guibg=#767676 |
||||
hi PmenuSbar ctermbg=252 guibg=#d0d0d0 |
||||
hi PmenuThumb ctermfg=243 guifg=#767676 |
||||
hi Search ctermfg=0 guifg=#000000 ctermbg=149 guibg=#afdf5f |
||||
hi SignColumn ctermfg=248 guifg=#a8a8a8 |
||||
hi SpecialKey ctermfg=77 guifg=#5fdf5f |
||||
hi SpellBad ctermfg=160 guifg=fg ctermbg=bg cterm=underline guisp=#df0000 |
||||
hi SpellCap ctermfg=189 guifg=#dfdfff ctermbg=bg guibg=bg cterm=underline gui=underline |
||||
hi SpellRare ctermfg=168 guifg=#df5f87 ctermbg=bg guibg=bg cterm=underline gui=underline |
||||
hi SpellLocal ctermfg=98 guifg=#875fdf ctermbg=bg guibg=bg cterm=underline gui=underline |
||||
hi StatusLine ctermfg=15 guifg=#ffffff ctermbg=239 guibg=#4e4e4e cterm=bold gui=bold |
||||
hi StatusLineNC ctermfg=249 guifg=#b2b2b2 ctermbg=237 guibg=#3a3a3a cterm=none gui=none |
||||
hi TabLine ctermfg=fg guifg=fg ctermbg=242 guibg=#666666 cterm=none gui=none |
||||
hi TabLineFill ctermfg=fg guifg=fg ctermbg=237 guibg=#3a3a3a cterm=none gui=none |
||||
" FIXME |
||||
hi Title ctermfg=225 guifg=#ffdfff |
||||
hi Todo ctermfg=0 guifg=#000000 ctermbg=184 guibg=#dfdf00 |
||||
hi Underlined ctermfg=39 guifg=#00afff cterm=underline gui=underline |
||||
hi VertSplit ctermfg=237 guifg=#3a3a3a ctermbg=237 guibg=#3a3a3a cterm=none gui=none |
||||
" hi VIsualNOS ctermfg=24 guifg=#005f87 ctermbg=153 guibg=#afdfff cterm=none gui=none |
||||
" hi Visual ctermfg=24 guifg=#005f87 ctermbg=153 guibg=#afdfff |
||||
hi Visual ctermfg=255 guifg=#eeeeee ctermbg=96 guibg=#875f87 |
||||
" hi Visual ctermfg=255 guifg=#eeeeee ctermbg=24 guibg=#005f87 |
||||
hi VisualNOS ctermfg=255 guifg=#eeeeee ctermbg=60 guibg=#5f5f87 |
||||
hi WildMenu ctermfg=0 guifg=#000000 ctermbg=150 guibg=#afdf87 cterm=bold gui=bold |
||||
|
||||
"" Syntax highlighting {{{2 |
||||
hi Comment ctermfg=244 guifg=#808080 |
||||
hi Constant ctermfg=229 guifg=#ffffaf |
||||
hi Identifier ctermfg=182 guifg=#dfafdf cterm=none |
||||
hi Ignore ctermfg=238 guifg=#444444 |
||||
hi Number ctermfg=180 guifg=#dfaf87 |
||||
hi PreProc ctermfg=150 guifg=#afdf87 |
||||
hi Special ctermfg=174 guifg=#df8787 |
||||
hi Statement ctermfg=110 guifg=#87afdf cterm=none gui=none |
||||
hi Type ctermfg=146 guifg=#afafdf cterm=none gui=none |
||||
|
||||
"" Special {{{2 |
||||
""" .diff {{{3 |
||||
hi diffAdded ctermfg=150 guifg=#afdf87 |
||||
hi diffRemoved ctermfg=174 guifg=#df8787 |
||||
""" vimdiff {{{3 |
||||
hi diffAdd ctermfg=bg guifg=bg ctermbg=151 guibg=#afdfaf |
||||
"hi diffDelete ctermfg=bg guifg=bg ctermbg=186 guibg=#dfdf87 cterm=none gui=none |
||||
hi diffDelete ctermfg=bg guifg=bg ctermbg=246 guibg=#949494 cterm=none gui=none |
||||
hi diffChange ctermfg=bg guifg=bg ctermbg=181 guibg=#dfafaf |
||||
hi diffText ctermfg=bg guifg=bg ctermbg=174 guibg=#df8787 cterm=none gui=none |
||||
""" HTML {{{3 |
||||
" hi htmlTag ctermfg=146 guifg=#afafdf |
||||
" hi htmlEndTag ctermfg=146 guifg=#afafdf |
||||
hi htmlTag ctermfg=244 |
||||
hi htmlEndTag ctermfg=244 |
||||
hi htmlArg ctermfg=182 guifg=#dfafdf |
||||
hi htmlValue ctermfg=187 guifg=#dfdfaf |
||||
hi htmlTitle ctermfg=254 ctermbg=95 |
||||
" hi htmlArg ctermfg=146 |
||||
" hi htmlTagName ctermfg=146 |
||||
" hi htmlString ctermfg=187 |
||||
""" django {{{3 |
||||
hi djangoVarBlock ctermfg=180 |
||||
hi djangoTagBlock ctermfg=150 |
||||
hi djangoStatement ctermfg=146 |
||||
hi djangoFilter ctermfg=174 |
||||
""" python {{{3 |
||||
hi pythonExceptions ctermfg=174 |
||||
""" NERDTree {{{3 |
||||
hi Directory ctermfg=110 guifg=#87afdf |
||||
hi treeCWD ctermfg=180 guifg=#dfaf87 |
||||
hi treeClosable ctermfg=174 guifg=#df8787 |
||||
hi treeOpenable ctermfg=150 guifg=#afdf87 |
||||
hi treePart ctermfg=244 guifg=#808080 |
||||
hi treeDirSlash ctermfg=244 guifg=#808080 |
||||
hi treeLink ctermfg=182 guifg=#dfafdf |
||||
|
||||
""" VimDebug {{{3 |
||||
" FIXME |
||||
" you may want to set SignColumn highlight in your .vimrc |
||||
" :help sign |
||||
" :help SignColumn |
||||
|
||||
" hi currentLine term=reverse cterm=reverse gui=reverse |
||||
" hi breakPoint term=NONE cterm=NONE gui=NONE |
||||
" hi empty term=NONE cterm=NONE gui=NONE |
||||
|
||||
" sign define currentLine linehl=currentLine |
||||
" sign define breakPoint linehl=breakPoint text=>> |
||||
" sign define both linehl=currentLine text=>> |
||||
" sign define empty linehl=empty |
||||
|
@ -0,0 +1,438 @@
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||
" svndiff (C) 2007 Ico Doornekamp |
||||
" |
||||
" This program is free software; you can redistribute it and/or modify it |
||||
" under the terms of the GNU General Public License as published by the Free |
||||
" Software Foundation; either version 2 of the License, or (at your option) |
||||
" any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, but WITHOUT |
||||
" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
||||
" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
||||
" more details. |
||||
" |
||||
" Introduction |
||||
" ------------ |
||||
" |
||||
" NOTE: This plugin is unix-only! |
||||
" |
||||
" An small vim 7.0 plugin for showing RCS diff information in a file while |
||||
" editing. This plugin runs a diff between the current buffer and the original |
||||
" file from the version control system, and shows coloured signs indicating |
||||
" where the buffer differs from the original file from the repository. The |
||||
" original text is not shown, only signs are used to indicate where changes were |
||||
" made. With proper key bindings configured, fast navigation between changed |
||||
" blocks is also provided. |
||||
" |
||||
" Despite the name 'svndiff' this plugin supports the following RCS systems: |
||||
" |
||||
" - CVS |
||||
" - Fossil |
||||
" - Git |
||||
" - Mercurial |
||||
" - Perforce / p4 |
||||
" - Subversion |
||||
" |
||||
" The type of RCS will be detected when first issuing a svndiff command on |
||||
" the file. |
||||
" |
||||
" The following symbols and syntax highlight groups are used for the signs: |
||||
" |
||||
" > DiffAdd: Newly added lines. (default=blue) |
||||
" |
||||
" ! DiffChange: Lines which are changed from the original. (default=cyan) |
||||
" |
||||
" < DiffDel: Applied to the lines directly above and below a deleted block |
||||
" (default=magenta) |
||||
" |
||||
" Usage |
||||
" ----- |
||||
" |
||||
" The plugin defines one function: Svndiff(). This function figures out the |
||||
" difference between the current buffer and it's RCS original, and adds the |
||||
" signs at the places where the buffer differs from the original file from svn |
||||
" or git. You'll need to call this function after making changes to update the |
||||
" highlighting. |
||||
" |
||||
" The function takes one argument specifying an additional action to perform: |
||||
" |
||||
" "prev" : jump to the previous different block |
||||
" "next" : jump to the next different block |
||||
" "clear" : clean up all signs |
||||
" |
||||
" You might want to map some keys to run the Svndiff function. For |
||||
" example, add to your .vimrc: |
||||
" |
||||
" noremap <F3> :call Svndiff("prev")<CR> |
||||
" noremap <F4> :call Svndiff("next")<CR> |
||||
" noremap <F5> :call Svndiff("clear")<CR> |
||||
" |
||||
" |
||||
" Configuration |
||||
" ------------- |
||||
" |
||||
" The following configuration variables are availabe: |
||||
" |
||||
" * g:svndiff_autoupdate |
||||
" |
||||
" If this variable is defined, svndiff will automatically update the signs |
||||
" when the user stops typing for a short while, and when leaving insert |
||||
" mode. This might slow things down on large files, so use with caution. |
||||
" The vim variable 'updatetime' can be used to set the auto-update interval, |
||||
" but note that changing this variable other effects as well. (refer to the |
||||
" vim docs for more info) |
||||
" To use, add to your .vimrc: |
||||
" |
||||
" let g:svndiff_autoupdate = 1 |
||||
" |
||||
" * g:svndiff_one_sign_delete |
||||
" |
||||
" Normally, two 'delete' signs are placed around the location where |
||||
" text was deleted. When this variable is defined, only one sign is |
||||
" placed, above the location of the deleted text. |
||||
" To use, add to your .vimrc: |
||||
" |
||||
" let g:svndiff_one_sign_delete = 1 |
||||
" |
||||
" Colors |
||||
" ------ |
||||
" |
||||
" Personally, I find the following colours more intuitive for diff colours: |
||||
" red=deleted, green=added, yellow=changed. If you want to use these colours, |
||||
" try adding the following lines to your .vimrc |
||||
" |
||||
" hi DiffAdd ctermfg=0 ctermbg=2 guibg='green' |
||||
" hi DiffDelete ctermfg=0 ctermbg=1 guibg='red' |
||||
" hi DiffChange ctermfg=0 ctermbg=3 guibg='yellow' |
||||
" |
||||
" Changelog |
||||
" --------- |
||||
" |
||||
" 1.0 2007-04-02 Initial version |
||||
" |
||||
" 1.1 2007-04-02 Added goto prev/next diffblock commands |
||||
" |
||||
" 1.2 2007-06-14 Updated diff arguments from -u0 (obsolete) to -U0 |
||||
" |
||||
" 2.0 2007-08-16 Changed from syntax highlighting to using signs, thanks |
||||
" to Noah Spurrier for the idea. NOTE: the name of the |
||||
" function changed from Svndiff_show() to Svndiff(), so |
||||
" you might need to update your .vimrc mappings! |
||||
" |
||||
" 3.0 2008-02-02 Redesign with some ideas from Jan Bezdekovsky. The |
||||
" diff is only updated when the buffer actually changes, |
||||
" cleanup of signs is now done properly and some info |
||||
" about each diff block is printed in the status line. |
||||
" |
||||
" 3.1 2008-02-04 Fixed bug that broke plugin in non-english locales, thanks |
||||
" to Bernhard Walle for the patch |
||||
" |
||||
" 3.2 2008-02-27 The latest rewrite broke vim 6 compatiblity. The plugin |
||||
" is now simply disabled for older vim versions to avoid |
||||
" a lot of warnings when loading. |
||||
" |
||||
" 4.0 2008-11-24 Added GIT support. The RCS type is now detected (svn/git) |
||||
" |
||||
" 4.1 2008-11-25 Added CVS support. |
||||
" |
||||
" 4.2 2009-07-31 Added support for proper handling of non-unix file formats |
||||
" which use different newline conventions (dos, mac) |
||||
" |
||||
" 4.3 2010-05-08 Added support for Mercurial, fixed git support (thanks |
||||
" Frankovskyi Bogdan) |
||||
" |
||||
" 4.4 2011-03-30 Added support for perforce/p4 (thanks, Timandahaf) |
||||
" |
||||
" 4.5 2011-10-09 Bugfix when trying to use svndiff in a new fileless buffer |
||||
" (Frankovskyi Bogdan) |
||||
" |
||||
" 4.6 2012-06-02 Added support for the Fossil SCM (Andrea Federico |
||||
" Grisotto) |
||||
" |
||||
" 4.7 2013-04-25 Fixed git diff when not in top git directory |
||||
" |
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||
|
||||
if v:version < 700 |
||||
finish |
||||
endif |
||||
|
||||
" Globals for this plugin |
||||
|
||||
let s:sign_base = 200000 " Base for our sign id's, hoping to avoid colisions |
||||
let s:is_active = {} " dictionary with buffer names that have svndiff active |
||||
let s:rcs_type = {} " RCS type, will be autodetected to one of svn/git/hg/cvs/p4 |
||||
let s:rcs_cmd = {} " Shell command to execute to get contents of clean file from RCS |
||||
let s:diff_signs = {} " dict with list of ids of all signs, per file |
||||
let s:diff_blocks = {} " dict with list of ids of first line of each diff block, per file |
||||
let s:changedtick = {} " dict with changedticks of each buffer since last invocation |
||||
let s:newline = {} " dict with newline character of each buffer |
||||
|
||||
" Commands to execute to get current file contents in various rcs systems |
||||
|
||||
let s:rcs_cmd_svn = "svn cat '%s'" |
||||
let s:rcs_cmd_git = "git cat-file -p HEAD:$(git ls-files --full-name '%s')" |
||||
let s:rcs_cmd_hg = "hg cat '%s'" |
||||
let s:rcs_cmd_cvs = "cvs -q update -p '%s'" |
||||
let s:rcs_cmd_p4 = "p4 print '%s'" |
||||
let s:rcs_cmd_fossil = "fossil finfo -p '%s'" |
||||
|
||||
" |
||||
" Do the diff and update signs. |
||||
" |
||||
|
||||
function s:Svndiff_update(...) |
||||
|
||||
let fname = bufname("%") |
||||
|
||||
if ! exists("s:is_active[fname]") |
||||
return 0 |
||||
end |
||||
|
||||
" Guess RCS type for this file |
||||
|
||||
if ! has_key(s:rcs_type, fname) |
||||
|
||||
" skip new files created in vim buffer |
||||
|
||||
if ! filereadable(fname) |
||||
return 0 |
||||
end |
||||
|
||||
let info = system("LANG=C svn info " . fname) |
||||
if match(info, "Path") != -1 |
||||
let s:rcs_type[fname] = "svn" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_svn |
||||
end |
||||
|
||||
let info = system("git status " . fname) |
||||
if v:shell_error == 0 |
||||
let s:rcs_type[fname] = "git" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_git |
||||
end |
||||
|
||||
let info = system("fossil status " . fname) |
||||
if v:shell_error == 0 |
||||
let s:rcs_type[fname] = "fossil" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_fossil |
||||
end |
||||
|
||||
let info = system("cvs st " . fname) |
||||
if v:shell_error == 0 |
||||
let s:rcs_type[fname] = "cvs" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_cvs |
||||
end |
||||
|
||||
let info = system("hg status " . fname) |
||||
if v:shell_error == 0 |
||||
let s:rcs_type[fname] = "hg" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_hg |
||||
end |
||||
|
||||
let info = system("p4 fstat " . fname) |
||||
if match(info, "depotFile") != -1 |
||||
let s:rcs_type[fname] = "p4" |
||||
let s:rcs_cmd[fname] = s:rcs_cmd_p4 |
||||
end |
||||
end |
||||
|
||||
" Could not detect RCS type, print message and exit |
||||
|
||||
if ! has_key(s:rcs_type, fname) |
||||
echom "Svndiff: Warning, file " . fname . " is not managed by a supported versioning system!" |
||||
unlet s:is_active[fname] |
||||
return |
||||
end |
||||
|
||||
" Find newline characters for the current file |
||||
|
||||
if ! has_key(s:newline, fname) |
||||
let l:ff_to_newline = { "dos": "\r\n", "unix": "\n", "mac": "\r" } |
||||
let s:newline[fname] = l:ff_to_newline[&l:fileformat] |
||||
echom s:newline[fname] |
||||
end |
||||
|
||||
" Check if the changedticks changed since the last invocation of this |
||||
" function. If nothing changed, there's no need to update the signs. |
||||
|
||||
if exists("s:changedtick[fname]") && s:changedtick[fname] == b:changedtick |
||||
return 1 |
||||
end |
||||
let s:changedtick[fname] = b:changedtick |
||||
|
||||
" The diff has changed since the last time, so we need to update the signs. |
||||
" This is where the magic happens: pipe the current buffer contents to a |
||||
" shell command calculating the diff in a friendly parsable format. |
||||
|
||||
let contents = join(getbufline("%", 1, "$"), s:newline[fname]) |
||||
let diff = system("diff -U0 <(" . substitute(s:rcs_cmd[fname], "%s", fname, "") . ") <(cat;echo)", contents) |
||||
|
||||
" clear the old signs |
||||
|
||||
call s:Svndiff_clear() |
||||
|
||||
" Parse the output of the diff command and put signs at changed, added and |
||||
" removed lines |
||||
|
||||
for line in split(diff, '\n') |
||||
|
||||
let part = matchlist(line, '@@ -\([0-9]*\),*\([0-9]*\) +\([0-9]*\),*\([0-9]*\) @@') |
||||
|
||||
if ! empty(part) |
||||
let old_from = part[1] |
||||
let old_count = part[2] == '' ? 1 : part[2] |
||||
let new_from = part[3] |
||||
let new_count = part[4] == '' ? 1 : part[4] |
||||
|
||||
" Figure out if text was added, removed or changed. |
||||
|
||||
if old_count == 0 |
||||
let from = new_from |
||||
let to = new_from + new_count - 1 |
||||
let name = 'svndiff_add' |
||||
let info = new_count . " lines added" |
||||
elseif new_count == 0 |
||||
let from = new_from |
||||
let to = new_from |
||||
let name = 'svndiff_delete' |
||||
let info = old_count . " lines deleted" |
||||
if ! exists("g:svndiff_one_sign_delete") |
||||
let to += 1 |
||||
endif |
||||
else |
||||
let from = new_from |
||||
let to = new_from + new_count - 1 |
||||
let name = 'svndiff_change' |
||||
let info = new_count . " lines changed" |
||||
endif |
||||
|
||||
let id = from + s:sign_base |
||||
let s:diff_blocks[fname] += [{ 'id': id, 'info': info }] |
||||
|
||||
" Add signs to mark the changed lines |
||||
|
||||
let line = from |
||||
while line <= to |
||||
let id = line + s:sign_base |
||||
exec 'sign place ' . id . ' line=' . line . ' name=' . name . ' file=' . fname |
||||
let s:diff_signs[fname] += [id] |
||||
let line = line + 1 |
||||
endwhile |
||||
|
||||
endif |
||||
endfor |
||||
|
||||
endfunction |
||||
|
||||
|
||||
|
||||
" |
||||
" Remove all signs we placed earlier |
||||
" |
||||
|
||||
function s:Svndiff_clear(...) |
||||
let fname = bufname("%") |
||||
if exists("s:diff_signs[fname]") |
||||
for id in s:diff_signs[fname] |
||||
|