📄 keywords
字号:
#!/bin/bash## This script (which relies on ebrowse)# builds a set of keywords composed of# your C++ classnames. These keywords# will then be highlighted in emacs.# This only works for class names which# begin with a capital letter!# Here is the format for adding c/c++ keywords..#(font-lock-add-keywords 'c++-mode# '( ("\\<\\(real\\|foo\\|bar\\)\\>" . font-lock-type-face) ) )# Set the output filenameelisp_file=keywords.elcompiled_elisp_file=keywords.elc# Set the location of the files to checkfiles_location="../../../s3/include/*.h ../../include/*/*.h"# Write the elisp file headerecho "(provide 'keywords)" > $elisp_fileecho "(font-lock-add-keywords 'c++-mode " >> $elisp_fileecho -n " '( (\"\\\\<\\\\(Real\\\\|Complex\\\\|Number\\\\|" >> $elisp_file# Get the class list and declare an array of class namesclass_list=`/usr/bin/ebrowse --very-verbose --output-file=/dev/null $files_location`counter=0declare -a class_array# Get the enum listenum_list=`grep enum $files_location -h | grep "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]" | grep -v include | grep "{" | cut -d" " -f 4`# Get the namespace listnamespace_list=`grep namespace $files_location -h | grep "{" | cut -d" " -f 2`namespace_list=$namespace_list" libMeshPrivateData"# Throw the classes into the class_array.for i in $class_list $enum_list $namespace_list; do name=`echo $i | grep "^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]" | grep -v include` if test "x$name" != "x"; then class_array[$counter]=$name counter=$[$counter+1] fi donesentinel=$[$counter-1]# Go through the array, put the names into the filefor j in $(seq 0 $sentinel); do if test $j == $sentinel; then echo -n "${class_array[$j]}\\\\)\\\\>\" " >> $elisp_file else echo -n "${class_array[$j]}\\\\|" >> $elisp_file fi done# Add the footerecho " . font-lock-type-face) ) )" >> $elisp_file# Make the compiled version of this elisp using# emacs' batch mode:emacs --batch --no-site-file -f batch-byte-compile $elisp_file# Move the file we just created to our personal .elisp dirmv $elisp_file $compiled_elisp_file ~/.elisp/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -