Eclipse调试:改变颜色, 背景与字体大小 和xml字体调整

来源:互联网 发布:淘宝买了东西店铺关 编辑:程序博客网 时间:2024/06/06 09:22
Eclipse背景颜色修改: 

操作界面默认颜色为白色。对于我们长期使用电脑编程的人来说,白色很刺激我们的眼睛,所以我经常会改变workspace的背景色,使眼睛舒服一些。设置方法如下: 
1、打开window->Preference,弹出Preference面板 
2、展开General标签,选中Editors选项,展开。 
3、选中 Test Editors,右边出现Test Editors面板。 面板中有这样一个选项:Appearance color options; 其中是各种板块颜色的设置,其中有一项是background color,根据自己的喜好选择颜色。 
4、 选中background color,勾掉System Default,点击'color',弹出颜色选择面板,选择喜好的颜色,单击确定。 
5、返回Test Editors,单击Apply即可。展开Test Editors,还有其他选项,比如对错误提示的颜色样式,如果你对此感兴趣也可尝试更改一下。 

背景颜色向你推荐:色调:85。饱和度:1 2 3。亮度:2 0 5 

文档都不再是刺眼的白底黑字,而是非常柔和的豆沙绿色,这个色调是眼科专家配置的,长时间使用会很有效的缓解眼睛疲劳保护眼睛。 

改变背景颜色
windows->Preferences->General->Editor->Text Editors
右边选择Appearance color options 
选Background color 选择背景颜色
选Current line highlight 来改变 当前选中行 的颜色

配色方案详细following: 



Eclipse字体大小调整: 
窗口(Window)-首选项(Preferences)-常规(General)-外观(Appearence)-颜色与字体(Colors And Fonts),在右边的对话框里选择Java - Java Editor Text Font,点击出现的修改(Change)按钮,可以设置显示在在主窗体中程序的字体大小,设置完之后点击右下角的应用(Apply),最后点击确定(OK)即可。 


eclipse中的汉字横着显示怎么解决

同一种字体有两种显示方式,比如Fixedsys Excelsior 3.01和@Fixedsys Excelsior 3.01,前一种汉字是竖着显示,后一种汉字是横着显示。preferences->java->Editor->Syntax Coloring中点击右上角的Colors and Fonts,在弹出的对话框中找到java->Java Edit Text Font,双击该字体,从中选择前面不带@的字体即可解决汉字横着的问题。




xml的字体大小调整: 
window--preferences--General--appearance--colors and fonts--Basic-- "Text font "  

然后点change,可以设置字体的大小



eclipse 改变颜色,背景

一款看上去十分舒服的代码配色,会让Coding过程变得惬意,让编写效率提升不少。而Eclipse默认的代码配色实在丑陋,除了关键字为褐色加粗、字符串为蓝色外,其余颜色均为黑色。在这样的配色中,最难分辨的就是局部变量和类型的私有字段(其他好歹可以通过大小写规则来判断,如果代码编写够规范的话)。而且过于单调的颜色,不容易刺激视觉神经乃至中枢神经,会增加疲劳感,带来困意。

为了改变这一现状,我们必须对Eclipse的代码配色进行更改。


我的代码颜色



改变字体颜色
windows->Preferences->Java->Editor->Syntax Coloring
右边选择Java 然后可以自由选择颜色了

Annotations(注释): 107, 147, 186  浅蓝色
Deprecated members(不建议使用的成员): 0, 0, 0  
Fields(字段): 128, 0, 128  紫色
KeyWord 'return'(关键字'return'): 255, 0, 0   红色
Keyword excluding 'return'(除了关键字以外的return): 255, 128 ,0  橙色
Local variable declarations(局部变量声明): 128, 128, 128   灰色
Method declarations(方法声明): 255, 128, 64    橙色
Method(方法): 0, 48, 96 暗浅蓝色
Operators and brackets(运算符与方括号): 255, 128, 0  橙色
Others(其他): 96 153, 0   深绿色
Static fields(静态字段): 33, 0, 189  深蓝色
Static Method invocations(静态方法调用): 77, 166 255  天蓝色 
Strings(字符串): 132, 26, 238   中天蓝色
Type variables(类型变量): 128, 0, 25   红罗色

学习从现在开始


第二方案

改变背景颜色(黑底背景的设置)
windows->Preferences->General->Editor->Text Editors
右边选择Appearance color options 
选Background color 选择背景颜色
选Current line highlight 来改变 当前选中行 的颜色

配色方案详细following: 
Annotations(注释): 107, 147, 186 
Deprecated members(不建议使用的成员): 0, 0, 0 
Fields(字段):128,255,0 绿色
KeyWord 'return'(关键字'return'): 255, 0, 0  红色
Keyword excluding 'return'(除了关键字以外的return): 255,80, 0  深深橘色
Local variable declarations(局部变量声明): 70,140,179  深蓝色
Method declarations(方法声明): 247,197,39  淡橘色
Method(方法): 241,196,54  深淡橘色
Operators and brackets(运算符与方括号): 255, 128, 0   深橘色
Others(其他): 126, 202, 0  淡绿色
Static fields(静态字段): 128,255,0 绿色
Static Method invocations(静态方法调用): 77, 166 255  
Strings(字符串):  89,196,196  墨蓝色
Type variables(类型变量): 222, 0, 25  红色




其他色彩配置参考: http://www.fengfly.com/plus/view-173150-1.html
在workspace的目录中,找到 .metadata/.plugins/org.eclipse.core.runtime/.settings/ 目录,然后把两个文件给替换一下就可以了。 
对了,替换完之后还得手动设置一次字体。我是用Consolas 14pts的 
org.eclipse.ui.editors.prefs 
#Wed Dec 23 14:31:26 CST 2009secondaryIPColor=45,70,56AbstractTextEditor.Color.Background=25,25,25eclipse.preferences.version=1spacesForTabs=truewriteOccurrenceIndicationColor=61,63,37AbstractTextEditor.Color.Foreground.SystemDefault=falseAbstractTextEditor.Color.Foreground=128,255,0AbstractTextEditor.Color.SelectionBackground=65,76,59currentIPColor=45,70,56overviewRuler_migration=migrated_3.1lineNumberRuler=truedeletionIndicationColor=255,0,0searchResultIndicationColor=51,51,79currentLineColor=34,34,32AbstractTextEditor.Color.SelectionForeground=255,255,255printMarginColor=192,192,192occurrenceIndicationColor=72,72,72AbstractTextEditor.Color.SelectionBackground.SystemDefault=falseAbstractTextEditor.Color.Background.SystemDefault=falselineNumberColor=0,128,192AbstractTextEditor.Color.FindScope=25,25,25AbstractTextEditor.Color.SelectionForeground.SystemDefault=false

org.eclipse.jdt.ui.prefs 
#Sun Mar 21 22:41:48 CST 2010pf_coloring_argument=128,255,0sp_cleanup.remove_private_constructors=truesemanticHighlighting.methodDeclarationName.enabled=truesp_cleanup.sort_members_all=falsesp_cleanup.format_source_code=falsesp_cleanup.never_use_blocks=falsesemanticHighlighting.enum.enabled=truesp_cleanup.remove_unused_private_members=falsesp_cleanup.use_this_for_non_static_field_access=falsesp_cleanup.remove_unnecessary_casts=trueorg.eclipse.jdt.ui.text.code_templates_migrated=truepf_coloring_key=255,200,0sp_cleanup.add_missing_nls_tags=falsesemanticHighlighting.localVariableDeclaration.enabled=truesemanticHighlighting.interface.enabled=truesp_cleanup.remove_trailing_whitespaces=falsecontent_assist_autoactivation_triggers_java=.abcdefghijklmnopqrstuvwxyzsemanticHighlighting.inheritedMethodInvocation.color=227,183,53sp_cleanup.always_use_blocks=truesp_cleanup.add_missing_methods=falseLexicalSortingAction.isChecked=truesemanticHighlighting.typeParameter.color=205,177,173org.eclipse.jdt.ui.editor.tab.width=sp_cleanup.always_use_this_for_non_static_field_access=falsesp_cleanup.never_use_parentheses_in_expressions=truebreadcrumb.org.eclipse.jdt.ui.JavaPerspective=truesourceHoverBackgroundColor=255,255,225java_keyword_return=236,108,30org.eclipse.pde.ui.ExternalPluginLibrariesFilter1=truespelling_user_dictionary_encoding=spelling_locale_initialized=trueorg.eclipse.jdt.ui.text.custom_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*=truecontent_assist_proposals_background=255,255,255semanticHighlighting.method.color=247,197,39semanticHighlighting.interface.color=255,128,128semanticHighlighting.method.enabled=truesp_cleanup.make_variable_declarations_final=trueorg.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsTempFiles=truesp_cleanup.on_save_use_additional_actions=falsesp_cleanup.remove_unnecessary_nls_tags=falseorg.eclipse.jdt.ui.overrideannotation=trueorg.eclipse.jdt.ui.text.templates_migrated=truecontent_assist_parameters_foreground=230,230,230spelling_ignore_non_letters=truejava_string=89,196,196spelling_ignore_digits=truesemanticHighlighting.parameterVariable.enabled=trueorg.eclipse.jdt.ui.javadoclocations.migrated=truejava_doc_tag=64,149,108semanticHighlighting.staticMethodInvocation.color=255,255,255org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter=truespelling_ignore_single_letters=trueCustomFiltersActionGroup.org.eclipse.jdt.ui.PackageExplorer.TAG_DUMMY_TO_TEST_EXISTENCE=storedViewPreferenceshoverModifierMasks=org.eclipse.jdt.ui.BestMatchHover;0;org.eclipse.jdt.internal.debug.ui.JavaDebugHover;0;org.eclipse.jdt.ui.ProblemHover;0;org.eclipse.jdt.ui.NLSStringHover;327680;org.eclipse.jdt.ui.JavadocHover;0;org.eclipse.jdt.ui.JavaSourceHover;131072;org.eclipse.jdt.ui.AnnotationHover;0;sp_cleanup.convert_to_enhanced_for_loop=falsesp_cleanup.always_use_parentheses_in_expressions=falsesp_cleanup.use_parentheses_in_expressions=falsepf_coloring_assignment=255,255,255sp_cleanup.remove_unused_private_methods=truesemanticHighlighting.class.color=255,128,192sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=truesp_cleanup.always_use_this_for_non_static_method_access=falsetabWidthPropagated=truejava_comment_task_tag=64,128,128sp_cleanup.qualify_static_method_accesses_with_declaring_class=falseorg.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter=truesemanticHighlighting.deprecatedMember.color=255,255,255sp_cleanup.add_default_serial_version_id=trueorg.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter=truesp_cleanup.make_private_fields_final=truejava_doc_link=0,128,255org.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsConnections=truesp_cleanup.add_serial_version_id=falsesp_cleanup.add_missing_deprecated_annotations=truespelling_ignore_urls=truesemanticHighlighting.annotation.color=192,192,192pf_coloring_value=255,255,255semanticHighlighting.typeArgument.enabled=truesemanticHighlighting.abstractMethodInvocation.color=241,196,54sp_cleanup.add_missing_annotations=trueorg.eclipse.jdt.ui.gettersetter.use.is=trueorg.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>lastRecentlyUsedFilters=org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter,spelling_ignore_mixed=truesemanticHighlighting.staticField.color=255,255,255org.eclipse.jface.textfont=1|Consolas|14.25|0|WINDOWS|1|-19|0|0|0|400|0|0|0|0|3|2|1|49|Consolas;sp_cleanup.add_missing_override_annotations=truesp_cleanup.remove_unused_private_types=truesp_cleanup.organize_imports=truesemanticHighlighting.typeParameter.enabled=truesp_cleanup.remove_unused_imports=falsesemanticHighlighting.staticFinalField.color=128,255,0semanticHighlighting.abstractMethodInvocation.enabled=truesp_cleanup.add_generated_serial_version_id=falsesemanticHighlighting.localVariable.color=70,140,179sp_cleanup.qualify_static_member_accesses_with_declaring_class=falsesp_cleanup.use_this_for_non_static_method_access=falsecontent_assist_parameters_background=0,0,0sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=truecontent_assist_disabled_computers=org.eclipse.jdt.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000semanticHighlighting.inheritedMethodInvocation.enabled=truesp_cleanup.make_local_variable_final=falsesp_cleanup.remove_trailing_whitespaces_all=truejava_multi_line_comment=0,128,64semanticHighlighting.parameterVariable.color=64,128,0sp_cleanup.format_source_code_changes_only=falsesp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=trueorg.eclipse.jdt.ui.formatterprofiles.version=11useAnnotationsPrefPage=truesp_cleanup.remove_unused_private_fields=truesp_cleanup.use_blocks=falseuseQuickDiffPrefPage=truefontPropagated=truejava_keyword=236,105,30java_single_line_comment=0,128,64semanticHighlighting.localVariable.enabled=trueorg.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter=truesemanticHighlighting.enum.color=64,128,0sp_cleanup.remove_trailing_whitespaces_ignore_empty=falseeclipse.preferences.version=1sp_cleanup.sort_members=falsejava_doc_keyword=0,128,0semanticHighlighting.localVariableDeclaration.color=70,140,179hoverModifiers=org.eclipse.jdt.ui.BestMatchHover;0;org.eclipse.jdt.internal.debug.ui.JavaDebugHover;\!0;org.eclipse.jdt.ui.ProblemHover;\!0;org.eclipse.jdt.ui.NLSStringHover;Ctrl+Alt;org.eclipse.jdt.ui.JavadocHover;\!0;org.eclipse.jdt.ui.JavaSourceHover;Shift;org.eclipse.jdt.ui.AnnotationHover;\!0;java_bracket=255,255,255semanticHighlighting.class.enabled=truespelling_ignore_sentence=truesp_cleanup.make_type_abstract_if_missing_method=falsesp_cleanup.qualify_static_field_accesses_with_declaring_class=falsespelling_ignore_upper=truesp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=truesemanticHighlighting.staticFinalField.enabled=truesemanticHighlighting.methodDeclarationName.color=241,196,56sp_cleanup.use_blocks_only_for_return_and_throw=falsejava_operator=255,255,255sp_cleanup.correct_indentation=falsejava_default=255,255,255sp_cleanup.make_parameters_final=falsecontent_assist_number_of_computers=18sp_cleanup.remove_unused_local_variables=falsespelling_ignore_ampersand_in_properties=trueorg.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter=trueorg.eclipse.jdt.ui.exception.name=econtent_assist_proposals_foreground=255,146,66java_doc_default=64,149,108semanticHighlighting.field.color=97,139,239org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter=trueproposalOrderMigrated=truesemanticHighlighting.typeArgument.color=217,176,172spelling_ignore_java_strings=true


这样不会干扰Eclipse的全局配置,比较灵活。 

截图一张 

原创粉丝点击