// Depeche View configuration file, http://stahlworks.com/dev/
config-version 136
// Every line starting with "//" is a remark, and ignored by dview.
// Every block surrounded by /* and */ is a remark block.
/*
This file must be placed in the same directory as dview.exe,
especially when running dview from USB stick. Alternatively,
it may be placed in one of the directories specified by
the PATH environment variable.
On every change in this file, restart dview to apply the changes.
For some changes like the background, it is sufficient to click
on the config button, to have them applied without restart.
Every setting can also be set via environment variable DVIEW_CONFIG,
e.g. SET DVIEW_CONFIG=maxload:200,case:no,searchseq:yes,autoreload:no
Env. variables, if present, have priority over config file settings.
*/
// linux: linux users MUST activate the following setting:
// linux yes
// amount of memory that dview may use for loading text before
// a warning pops up. by default, dview tries to calculate this
// value automatically, therefore set it only if required.
// maxload 200 // megabytes
// default setting for case sensitive search mode
case no
// when searching foo*bar, shall the sequence "bar after foo"
// be enforced in search results or not?
searchseq yes
// check and autoreload loaded files whenever the window is reactivated?
autoreload no
// go into filtered view automatically whenever you search something?
autofilter no
// enable one click search or not from startup
// oneclicksearch yes // default is no
// enable user defined hotkeys from startup
// userkeys yes // default is yes
// maximum delay after typing before search starts.
// set to 400, 200 or 100 to get a fast feeling on fast machines.
// delay 800 // milliseconds
// while the mouse cursor is in the bookmark area, search delay
// is changed temporarily to the following value, to allow easy
// remark creation and search within bookmarks (default=3000).
// set this to -1 to block searches completely while mouse on bookmarks.
// set this to 0 to disable any search delay while mouse on bookmarks.
// mousebookdelay 3000 // milliseconds
// the window size defaults to nearly the whole desktop.
// only if you want to change this to a FIXED size and location,
// activate the following setting:
// area xpos:ypos:width:height:ydelta
// e.g.
// area 20:20:800:500:20
// display contents of files during load
// loadshow yes // or shift+click during load
// loadshowbrightness 200 // display brightness, 0 ... 255
// disable support for german umlauts when selecting words for search
// noumlauts yes
// by default, dview tries to identify the correct tab size automatically.
// to disable this automated detection, set a default tab size here:
// tabsize 8
// which bookmark set should be opened on startup?
// startbmset 1 // from 1 to 9
// by default, text display is blocked by visible bookmarks.
// press CTRL+SHIFT+Q or set the following to allow text
// being displayed over bookmarks. bookmark display is then
// controlled by mouse gestures: leave bookmarks to the left
// or bottom to show them permanently or not.
// textoverbook yes
// with autoload, on reactivation of it's window, dview scans all files
// for changes. with an overloaded system, this can take rather long,
// blocking dview itself. therefore there is a default limit of 15 sec
// for such scans, which can be changed here. this value is not valid
// for manual reloads (by clicking reload button or pressing F5).
// reload-scan-max-time 30 // seconds
// time that $mouseword in a script is highlighted:
// wordshowtime 3000 // msec, 0=off
// on activation of the following, keeping alt pressed
// highlights the word under cursor temporarily.
// wordshowdelay 500
// case sensitive word highlighting
// markcase yes
// --------------- font configuration ----------------
/*
font used for main text display:
mainfont name,width,height,weight,linespacing
name = any name like Courier, Arial etc.
width = of characters, usually between 6 and 20
height = of characters, usually between 10 and 30
weight = from 400 for normal chars to 1200 for bold
linespacing = space between lines, -10 to 10
only FIXED PITCH fonts are allowed,
i.e. all characters must have the same width.
*/
// mainfont Fixedsys,8,9,0,0 // default (Windows)
// mainfont Courier New,8,18,600,-4 // default (Linux)
/*
If you select a font in dview using "..." and then the "font" button,
- you will get an estimation for the above line in the right bottom log.
in most cases, you have to reduce width, increase weight, and reduce
the linespacing a bit, until you have a proper looking font.
- there can be a blank line left at the bottom of the window,
but this should be gone after restart.
*/
// second font used for main text display:
// use CTRL+J within dview to toggle between them.
// mainfont2 Courier New,16,31,700,0 // default: a larger font
// bookfont is a small font used for bookmarks, as well as right bottom log
// and error messages. it can be selected in dview by right-click on "font".
// for bookmarks, variable-width fonts are also possible.
// bookfont Arial,8,12,500,0 // default
// second font used for bookmarks:
// use CTRL+SHIFT+J within dview to toggle between them.
// bookfont2 Courier New,10,20,800,0 // default: a larger font
// ------ background image ------
// name of a .jpg background image file. if a relative name (without "\")
// is specified, the PATH is searched for the image.
// background back.jpg
// should the background image be aligned to the desktop,
// or to the bottom right corner of every dview window?
// background-align desktop // or window
// change left and right side of background image?
// backflip yes
// if the image is smaller than the desktop, it is repeated (tiled)
// by default. set the following to avoid this:
// backrepeat no
// if the image is repeated, shall it be reversed or not?
// backreprev yes
// the background image is displayed pale to keep the text readable.
// specify here how pale it should be, within range 1 (image clearly visible)
// to 30 (completely unvisible). changed also by CTRL+B within dview,
// or (under Windows) by Alt+LMouse vertical movements on blank space.
// backpale 10
// ----------- user defined commands (dvscript) ------------
/*
any "on key" command can consist of a single or multiple lines.
single line command example:
on key ctrl+f9 echo "my test"
multi line command example:
on key shift+f9
echo "foo"
echo "bar"
echo "test"
when using multiple lines
- the 2nd, 3rd etc. line must be started by whitespace (blanks).
- each line must be started with the same number of blanks,
i.e. they must have the same indentation.
(for exceptions to this rule see examples below)
supported commands : // [] means an optional value
set findmask // change find mask in current window
set pathmask // change path mask in current window
set nearby.findmask // same in 2nd window (if any)
echo // print string to log console
reload [$relfile] // reload current file, or check all files
[nearby.]activate // activate current or nearby window
sleep [-quiet] msec // delay execution for a no. of milliseconds
mark add color expr // [XE] add highlight of expr in the given color
mark toggle col expr // [XE] toggle highlight
mark reset // [XE] reset all highlights
set clipline // [XE] copy a one-line text into clipboard
// about the mark commands: color can be red, green, blue,
// yellow, cyan, magenta, Red, Green, Blue ... Magenta,
// or "any" to select a cyclic color just as with double control.
run mycmd myparms // run an external command, WAIT for completion.
// -> this will BLOCK dview until the command ends!
// -> if mycmd or myparms may contain blanks,
// always add "" quotes around them!
// BAD:
// run c:\program files\editor.exe $relfile
// -> if there is a c:\program.exe, that one will be run.
// -> if $relfile contains blanks, editor.exe will be confused.
// GOOD:
// run "c:\program files\editor.exe" "$relfile"
runback yourcommand // run an external command, without waiting.
// -> preferred over "run" if it's the only command on your hotkey.
// NOTE: if the window focus is lost during "run",
// add another script line with "activate".
// NOTE: under LINUX, run can only run other WINDOWS applications
// which must be available in the WINE PATH (linux shell PATH
// is ignored). to edit this path, type "wine regedit" and
// search for "path" somewhere under System...Environment.
supported base keys : f7, f9, f10 ... f12, shift+f7, ctrl+f7,
ctrl+shift+f7, ...
// NOTE: when specifying combinations of ctrl and shift,
// use alphabetical sequence: first ctrl, then shift.
extended keys : f5, f6, f8
[XE] a,b,c, ..., x,y,z, alt+1 to alt+6
// NOTE: if you redefine extended keys, some Depeche View base
// functions may no longer be accessible by those keys.
supported variables :
$findmask // current find field content
$pathmask // current path field content
$curfile // displayed name of selected file
$absfile // absolute name of it, like C:\...
$relfile // filename without any path (foo.txt)
$fnbase // filename without extension (foo )
$fnext // filename's extension ( txt)
$curpath // path of curfile
$abspath // path of absfile
$mouseword // current word under cursor
$mouseline // current text line under cursor (w/o blanks)
$clipline // [XE] first line of ASCII clipboard text, if any
to insert just the $ character in your command, type $$.
[XE] means this feature is available only with Depeche View XE.
*/
/*
EXAMPLES. To use, copy them outside the "/*" block.
always keep EXACTLY the given format, including blanks,
intendation, and keeping the "" quotes where they are!
// f9 default: edit a file using notepad
on key f9 runback notepad "$curfile"
// f11 default: show current file's directory in explorer
on key f11 runback explorer "$abspath"
// f12 default: open any document by it's associated application
on key f12 runback cmd /C "$curfile"
on key f7
set findmask = "class* $findmask OR class* $findmask:"
set pathmask = ".hpp OR .h"
on key shift+f7
set findmask = "::$findmask"
set pathmask = ".cpp OR .c"
on key ctrl+shift+f7
set nearby.findmask = "class* $mouseword"
set nearby.pathmask = ".hpp OR .h"
*/
/*
this example requires Swiss File Knife (sfk.exe)
within the same directory as dview. note that the text
from "run sfk" to "+pause" will be joined together
into one large command, because
- "filter" has a deeper indentation then "run".
- "filter" ... "+pause" lines have the same indentation.
"echo" has the same indentation as "run", and therefore
it is executed as a separate command.
*/
/*
on key f9
run sfk
filter $curfile
-+class
-!;
+pause
echo filtering done
// search current word as class in other view
on key shift+f9
set nearby.findmask = "class* $mouseword OR class* $mouseword: NOT ;"
set nearby.pathmask = ".hpp OR .h"
// search current word as method in other view
on key shift+f10
set nearby.findmask = "::$mouseword"
set nearby.pathmask = ".cpp OR .c OR .hpp"
// reformatting of a tab separated trace file
on key ctrl+f12
run sfk pause "about to filter $absfile - ctrl+c to stop"
+filter $absfile -spat
-![:entry:] -![:exit:]
-sep "\t"
-rep _fooprocess_foo_ -rep _barprocess_bar_
-form "$03col2 $7.7col5$col6 $col9"
-write -yes
reload $absfile
// convert clipboard text: change all "_" to "*"
on key shift+f12
run sfk fromclip +filt -rep "x_x*x" +toclip
echo underscores replaced by stars.
// [XE] add highlight for some triple character phrases
on key f9
mark add red "[>]"
mark add yellow "[<]"
// [XE] (un)highlight the line under the mouse cursor
on key f10
mark toggle any "$mouseline"
// [XE] use sfk to split the mouseword by it's "_" characters,
// then search "*" combined expression in nearby view.
// note that this example uses 'x' as separator character,
// to avoid syntax problems with / and * (end of remark).
on key alt+1
set clipline = "$mouseword"
run sfk fromclip +filt -rep "x_x*x" -rep "x x*x" +toclip
activate
set nearby.findmask = "$clipline"
set nearby.pathmask = ".cpp OR .c"
*/
/*
optional block: settings used only with linux mode.
this can make sense if you want to use the same config
from an usb stick both on windows and linux systems.
context linux
// executes the following lines only under linux
mainfont Courier New,8,18,600,-4
// border width and height of window
borderwidth 10
borderheight 30
// back to normal context:
context any
*/
// syntax highlighting color definitions:
// colorname RRGGBB
color shl-keys1 0000D0 // keywords group 1, blue color
color shl-keys2 0000D0 // group 2
color shl-keys3 0000D0 // group 3
color shl-keys4 0000D0 // group 4
color shl-keys5 0000D0 // group 5
color shl-keys6 F06000 // group 6, orange
color shl-remarks 008060 // remark lines and blocks
color shl-strings 707070 // string literals
/*
Depeche View comes with simple built-in syntax highlighting (SHL)
for the following languages:
"cpp" for file extensions "h hpp c cpp cc cxx c++"
"java" for file extensions "jav java jsp"
"xml" for file extensions "html xml php shtml jsp"
"sql" for file extensions "sql"
"css" for file extensions "css"
Through this config file, you can add SHL for additional languages.
Formal syntax per language:
word1 word2 word3 ...
word7 word8 word9 ...
...
Where can you get read-to-use SHL definitions? Unfortunately,
there is no standard; an SHL definition always consists of two parts:
1) heuristic logic programmed within a tool.
for example, a rule like "lines starting with # in c++ code
are no remark but should still be shown in a different color".
2) keyword lists and options, used by that logic.
for example: if else endif for while return ...
The problem is part 1), which cannot be copied from somewhere else.
Depeche View's language highlighting definition syntax looks similar
to a Notepad++ "langs.xml" file, but using keyword lists from such
a file will produce incomplete highlighting. they contain very simple
keywords, requiring much additional logic NOT given in the langs.xml.
So if you copy stuff from langs.xml, always expect much manual rework.
The commercial texteditor UltraEdit uses word lists that require
few additional logic. Just google for "UltraEdit wordfiles".
It shouldn't be too difficult to manually convert a few of those definitions
(remove all options not supported by dview, like delimiters or indent strings).
// syntax highlighting example: own "cpp" definition (overrides dview built-in default)
// NOTE: you MUST remove the blank in "/ *" and "* /" to make this example work.
class delete friend inline new operator private protected public this virtual
if else switch case default break goto return for while do continue typedef sizeof NULL try catch throw namespace operator true false
void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool friend inline template
#define #defined #error #include #elif #if #line #else #ifdef #pragma #endif #ifndef #undef
// example: register .foo and .bar file extensions to use
// the built-in XML highlighting.
NOTE: the blocks accept some kind of relaxed XML,
meaning you can even write keyword lists like:
< >
as long as the phrase "" is not part of your actual keywords contents.
*/