idea 代码格式化 谷歌
Something has been annoying me for some time as I write this book in Google Docs: I want to be able to format text as code (Courier New) only using the keyboard. So I came up with this bookmarklet. It's one of those "works for me" so if it doesn't work for you feel free to modify and post here your version.
在Google Docs中编写本书时,有段时间让我感到烦恼:我希望仅使用键盘就能将文本设置为代码格式(Courier New)。 所以我想出了这个书签。 这是“为我工作”之一,因此,如果对您不起作用,请随时进行修改并在此处发布您的版本。
码 (Code)
Basically I attach an event (FF way, so won't work in IE) that listens to the keyboard combination ALT+x
and then calls the appropriate editor command:
基本上,我附加了一个事件(FF方式,因此在IE中将无法使用),该事件监听键盘组合键ALT+x
,然后调用适当的编辑器命令:
javascript:(
function(){
window.frames[1].document.addEventListener(
'keypress',
function(e){
if (e.altKey && e.charCode === 120){
EditorCommand('fontname', 'Courier New');
return false;
}
},
false);
}
)()
下载 (Download)
Right-click, bookmark:
右键单击,添加书签:
Alt+X
Alt + X
Tell your friends about this post on Facebook and Twitter
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
翻译自: https://www.phpied.com/google-docs-bookmaklet-to-format-code/
idea 代码格式化 谷歌