about summary refs log blame commit diff stats
path: root/res/config.toml
blob: d7186c24d1b724bb761bf9b32708204cd5653743 (plain) (tree)
1
2
3
4
5
6
7
8
9
       
                            
                   
                
                     
 

           
                  
 

                                                        
                        
 
          
           
                    






                                   





                                         

                    
                                       

                      
 

                 

                                                                        


                                          
                                          



                                     
 

                        
                
 
         

                    

                             
                   
                        
                      
                              
                      
                   
                


                                 







                               
 

               
                                                                                                                                  
 
      
            
                 







                                    

                                   
                             





                                

                                    

                                         
                             
                                
                                


                                 









                                  

                                

        
                              




                                                                     


                         




















                                             

                                  

                              

                                 

                     
                                     
                          
                    
                          
                                                
                    

                     
                        
                                                           
                                                         
                        








                                        
                        





                                                                     
                           










                                                                                           
                           
                           
                          
                                   
                          

                                   
                       

                               

                              

                        



                                                                  
         
       
                                                    


                                                                                     

   

                                                                  
       
                                     





                                                                                     










                                                                                     







                                                                                       
                                    
 
   
                       

      




















                            

                       
         



                                                        
   



                          
[start]
visual-home = "about:chawan"
startup-script = ""
headless = false
console-buffer = true

[search]
wrap = true
ignore-case = true

[encoding]
document-charset = ["utf-8", "sjis", "euc-jp", "latin2"]
display-charset = "auto"

[external]
mailcap = [
	"~/.mailcap"
]
mime-types = [
	"~/.mime.types",
	"/etc/mime.types",
	"/usr/etc/mime.types",
	"/usr/local/etc/mime.types"
]
urimethodmap = [
	"~/.urimethodmap",
	"~/.w3m/urimethodmap",
	"/etc/urimethodmap",
	"/usr/local/etc/w3m/urimethodmap"
]
tmpdir = "/tmp/cha"
editor = "vi %s +%d"
cgi-dir = "${%CHA_LIBEXEC_DIR}/cgi-bin"
download-dir = "/tmp/"
w3m-cgi-compat = false

[network]
max-redirect = 10
prepend-scheme = "https://"
prepend-https = true # deprecated, kept only for backwards-compatibility
default-headers = {
	User-Agent = "chawan",
	Accept = "text/html,text/*;q=0.5",
	Accept-Encoding = "gzip, deflate",
	Accept-Language = "en;q=1.0",
	Pragma = "no-cache",
	Cache-Control = "no-cache"
}

[input]
vi-numeric-prefix = true
use-mouse = true

[display]
color-mode = "auto"
format-mode = "auto"
no-format-mode = ["overline"]
emulate-overline = true
alt-screen = "auto"
highlight-color = "cyan"
highlight-marks = true
double-width-ambiguous = false
minimum-contrast = 100
force-clear = false
set-title = true
default-background-color = "auto"
default-foreground-color = "auto"
query-da1 = true
columns = 80
lines = 24
pixels-per-column = 9
pixels-per-line = 18
force-columns = false
force-lines = false
force-pixels-per-column = false
force-pixels-per-line = false

[[omnirule]]
match = '^ddg:'
substitute-url = '(x) => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))'

[page]
q = 'quit()'
C-z = 'suspend()'
h = 'n => pager.cursorLeft(n)'
j = 'n => pager.cursorDown(n)'
k = 'n => pager.cursorUp(n)'
l = 'n => pager.cursorRight(n)'
'M-[D' = 'n => pager.cursorLeft(n)'
'M-[B' = 'n => pager.cursorDown(n)'
'M-[A' = 'n => pager.cursorUp(n)'
'M-[C' = 'n => pager.cursorRight(n)'
'0' = 'pager.cursorLineBegin()'
'^' = 'pager.cursorLineTextStart()'
'$' = 'pager.cursorLineEnd()'
b = 'pager.cursorViWordBegin()'
e = 'pager.cursorViWordEnd()'
w = 'pager.cursorNextViWord()'
B = 'pager.cursorBigWordBegin()'
E = 'pager.cursorBigWordEnd()'
W = 'pager.cursorNextBigWord()'
'[' = 'n => pager.cursorPrevLink(n)'
']' = 'n => pager.cursorNextLink(n)'
'{' = 'n => pager.cursorPrevParagraph(n)'
'}' = 'n => pager.cursorNextParagraph(n)'
H = 'n => pager.cursorTop(n)'
M = '() => pager.cursorMiddle()'
L = 'n => pager.cursorBottom(n)'
g0 = 'pager.cursorLeftEdge()'
gc = 'pager.cursorMiddleColumn()'
'g$' = 'pager.cursorRightEdge()'
C-d = 'n => pager.halfPageDown(n)'
C-u = 'n => pager.halfPageUp(n)'
C-f = 'n => pager.pageDown(n)'
C-b = 'n => pager.pageUp(n)'
'M-[6~' = 'n => pager.pageDown(n)'
'M-[5~' = 'n => pager.pageUp(n)'
'zH'= 'n => pager.pageLeft(n)'
'zL' = 'n => pager.pageRight(n)'
'<' = 'n => pager.pageLeft(n)'
'>' = 'n => pager.pageRight(n)'
C-e = 'n => pager.scrollDown(n)'
C-y = 'n => pager.scrollUp(n)'
sE = '''
() => {
	const url = pager.url;
	pager.extern(pager.getEditorCommand(url.protocol == "file:" ?
		url.pathname :
		pager.cacheFile));
}
'''
sC-m = 'pager.saveLink()'
sC-j = 'pager.saveLink()'
sS = 'pager.saveSource()'
m = '''
async () => {
	const c = await pager.askChar("m");
	if (c.charCodeAt() != 3) /* ctrl-c */
		pager.setMark(c);
}
'''
'`' = '''
async () => {
	const c = await pager.askChar('`');
	if (c.charCodeAt() != 3) /* C-c */
		pager.gotoMark(c);
}
'''
"'" = '''
async () => {
	const c = await pager.askChar('`');
	if (c.charCodeAt() != 3) /* C-c */
		pager.gotoMarkY(c);
}
'''
'zh'= 'n => pager.scrollLeft(n)'
'zl' = 'n => pager.scrollRight(n)'
J = 'n => pager.scrollDown(n)'
K = 'n => pager.scrollUp(n)'
'-'= 'n => pager.scrollLeft(n)'
'+' = 'n => pager.scrollRight(n)'
C-m = 'pager.click()'
C-j = 'pager.click()'
I = 'pager.gotoURL(pager.hoverImage)'
M-u = 'pager.dupeBuffer()'
C-l = 'pager.load()'
C-k = 'pager.load("ddg:")'
M-b = 'pager.loadSubmit("~/.w3m/bookmark.html")'
U = 'pager.reload()'
r = 'pager.redraw()'
R = 'pager.reshape()'
M-C-c = 'pager.cancel()'
gg = 'n => n ? pager.gotoLine(n) : pager.cursorFirstLine()'
G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()'
M-g = 'pager.gotoLine()'
'z.' = 'n => pager.centerLineBegin(n)'
'zC-m' = 'n => pager.raisePageBegin(n)'
'zC-j' = 'n => pager.raisePageBegin(n)'
'z-' = 'n => pager.lowerPageBegin(n)'
zz = 'n => pager.centerLine(n)'
'zt' = 'n => pager.raisePage(n)'
'zb' = 'n => pager.lowerPage(n)'
'z+' = 'n => pager.nextPageBegin(n)'
'z^' = 'n => pager.previousPageBegin(n)'
C-g = 'pager.lineInfo()'
v = 'n => pager.cursorToggleSelection(n)'
V = 'n => pager.cursorToggleSelection(n, {selectionType: "line"})'
C-v = 'n => pager.cursorToggleSelection(n, {selectionType: "block"})'
y = '''
async () => {
	if (!pager.currentSelection) {
		feedNext();
		return;
	}
	const text = await pager.getSelectionText(pager.currentSelection);
	if (pager.externInto('xsel -bi', text))
		pager.alert("Copied selection to clipboard.");
	else
		pager.alert("Failed to copy selection to clipboard. (Is xsel installed?)");
	pager.cursorToggleSelection();
}
'''
'\' = 'pager.toggleSource()'
D = 'pager.discardBuffer()'
M-d = 'pager.discardTree()'
',' = 'pager.prevBuffer()'
'M-,' = 'pager.prevSiblingBuffer()'
'.' = 'pager.nextBuffer()'
'M-.' = 'pager.nextSiblingBuffer()'
'M-/' = 'pager.parentBuffer()'
M-c = 'pager.command()'
'/' = 'pager.isearchForward()'
'?' = 'pager.isearchBackward()'
n = 'n => pager.searchNext(n)'
N = 'n => pager.searchPrev(n)'
c = 'pager.peek()'
u = 'pager.peekCursor()'
C-w = '''
config.search.wrap = !config.search.wrap;
pager.alert("Wrap search " + (config.search.wrap ? "on" : "off"));
'''
M-y = '''
() => {
	if (pager.externInto('xsel -bi', pager.url))
		pager.alert("Copied URL to clipboard.");
	else
		pager.alert("Failed to copy URL to clipboard. (Is xsel installed?)");
}
'''
yc = '() => pager.alert("Please use `yu` to copy URLs instead!");'
yu = '''
() => {
	const link = pager.hoverLink;
	if (!link)
		pager.alert("Please move the cursor above a link and try again.");
	else if (pager.externInto('xsel -bi', link))
		pager.alert("Copied URL to clipboard.");
	else
		pager.alert("Failed to copy URL to clipboard. (Is xsel installed?)");
}
'''
yI = '''
() => {
	const link = pager.hoverImage;
	if (!link)
		pager.alert("Please move the cursor above an image and try again.");
	else if (pager.externInto('xsel -bi', link))
		pager.alert("Copied URL to clipboard.");
	else
		pager.alert("Failed to copy URL to clipboard. (Is xsel installed?)");
}
'''
M-p = '''
() => {
	const s = pager.externCapture('xsel -bo');
	if (s === null)
		pager.alert("Failed to read URL from clipboard. (Is xsel installed?)");
	else
		pager.loadSubmit(s);
}
'''
':' = 'pager.markURL()'

[line]
C-m = 'line.submit()'
C-j = 'line.submit()'
C-h = 'line.backspace()'
'C-?' = 'line.backspace()'
C-d = 'line.delete()'
C-c = 'line.cancel()'
M-b = 'line.prevWord()'
M-f = 'line.nextWord()'
C-b = 'line.backward()'
C-f = 'line.forward()'
C-u = 'line.clear()'
C-_ = 'line.clear()'
M-k = 'line.clear()'
C-k = 'line.kill()'
C-w = 'line.clearWord()'
M-C-h = 'line.clearWord()'
'M-C-?' = 'line.clearWord()'
M-d = 'line.killWord()'
C-a = 'line.begin()'
C-e = 'line.end()'
C-v = 'line.escape()'
C-p = 'line.prevHist()'
C-n = 'line.nextHist()'
M-c = '''
if ((pager.commandMode = consoleBuffer != pager.buffer))
	console.show();
else
	console.hide();
'''
'M-[D' = 'line.backward()'
'M-[B' = 'line.nextHist()'
'M-[A' = 'line.prevHist()'
'M-[C' = 'line.forward()'