MySQL의 화면에 vim-like k를 갖습니다
-
23-08-2019 - |
문제
이 질문은 기반입니다 이 스레드.
문제: 커서가 단어의 시작 부분에있을 때 MySQL 매뉴얼에 액세스하려면
Ctrl-A Esc Ctrl-m
M가 생각 나게합니다 중YSQL.
MySQL 매뉴얼을 위해 화면에서 VIM과 같은 K를 어떻게 만들 수 있습니까?
해결책
Man Pages를 설치했다고 가정합니다 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
그런 다음 키 바인딩이 작동해야합니다. 다른 프로그램을 사용하여 다른 프로그램을 사용하는 경우 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>
Vim의 K 명령과 유사한 인터페이스를 사용하여 쉘 명령을 실행할 수 있습니다. 가장 깨끗한 방법은 아니지만 사용함으로써 :!
VIM을 완전히 떠나지 않고 주어진 용어에 대해 MySQL 매뉴얼을 신속하게 호출 할 수 있어야합니다.
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'