للحصول على VIM-Like K في الشاشة MySQL
-
23-08-2019 - |
سؤال
ويستند هذا السؤال هذا الموضوع.
مشكلة: للوصول إلى دليل MySQL عندما يكون المؤشر في بداية الكلمة
Ctrl-A Esc Ctrl-m
حيث يذكر م ميسخل.
كيف يمكنك بناء VIM-Like K في الشاشة كتيبات MySQL؟
المحلول
على افتراض أنك قمت بتثبيت صفحات الرجل من موقع وثائق MySQL:
وضع ما يلي في /path/to/mysql-help.screen
:
# mysql-help.screen
# prevent messages from slowing this down
msgminwait 0
# copy term starting at cursor
copy
stuff " e "
# write term to a file
writebuf /tmp/screen-copied-term
# open that file in man in a new screen window
# (use `read` to pause on error, so user can see error message)
screen /bin/sh -c 'man `cat /tmp/screen-copied-term` || read'
# turn message waiting back on
msgminwait 1
# vi: ft=screen
ثم أضف هذا إلى ~/.screenrc
# Have CTRL-A ESC put you in a mode to accept commands in the 'escaped' class
bind \033 command -c escaped
# add CTRL-M as an 'escaped' class command to run the given screen script
bind -c escaped ^M source /path/to/mysql-help.screen
ثم يجب أن تعمل keybinding الخاص بك. إذا كنت تستخدم برنامجا مختلفا لعرض دليل غير ذلك man
, ، سيكون عليك تغيير البرنامج النصي وفقا لذلك.
ال man
تتضمن صفحات MySQL التي وجدتها في الرابط أعلاه فقط وثائق الأوامر التالية:
mysqlbug
mysqlhotcopy
perror
mysqldump
resolveip
mysqltest_embedded
mysql_setpermission
mysql_client_test
mysql_find_rows
mysql_fix_privilege_tables
mysql_waitpid
mysql_config
mysql_client_test_embedded
myisampack
replace
msql2mysql
make_win_bin_dist
my_print_defaults
mysql
-stress
-test
.pl
mysqlaccess
mysql_secure_installation
mysql
.server
mysql_convert_table_format
mysql_zap
mysql_fix_extensions
myisamlog
myisam_ftdump
mysqlbinlog
mysql_install_db
resolve_stack_dump
mysqlslap
mysql
-test
-run
.pl
mysqld_safe
mysqladmin
mysqlshow
mysql_tzinfo_to_sql
mysqltest
mysqlbackup
mysqld_multi
mysql
mysqldumpslow
mysqlcheck
mysql_upgrade
mysqlimport
comp_err
mysqld
myisamchk
innochecksum
قد ترغب أيضا في النظر في إضافة
zombie kr
لك .screenrc
, ، بحيث إذا قمت بتشغيل الدليل على مصطلح أنه لا يتعرف عليه، فلن تغلق الشاشة تلقائيا النافذة (وإخفاء رسالة الخطأ).
نصائح أخرى
بينما لست متأكدا من كيفية بدء تشغيلك لإنشاء غلاف ل VIM للقيام بالضبط ما تريد، قد أقدم اقتراحا حول كيفية تحقيق تأثير مماثل مع وظيفة مدمجة في VIM.
:! <command>
سوف تتيح لك تشغيل أوامر Shell مع واجهة مماثلة أمر Vim's K. قد لا تكون أنظف طريقة للقيام بذلك، ولكن باستخدام :!
يجب أن تكون قادرا على استدعاء أدلة MySQL لمصطلح معين بسرعة دون مغادرة VIM بالكامل.
إذا كنت بحاجة فعلا إلى كتابة البرنامج المساعد الخاص بك ل VIM، هذه المقالة قد تكون قادرة على إعطائك بعض المؤشرات والعموم في مكان البدء.
آمل أن يساعد هذا!
أحب إعادة تدوير الخيوط الخاصة بي بحيث يمكنني قراءة أدلة بسهولة. أقترح التحسين التالي لأمر Rampion.
انتعاش
screen /bin/sh -c 'man `cat /tmp/screen-copied-term` || read'
أنا
screen /bin/sh -c 'man `cat /tmp/screen-copied-term` > /tmp/manual | less /tmp/manual'