දිගු විධාන වේගයෙන් සැරිසරන්නේ කෙසේද?


143

මම දිගු විධානයන් ඇතුළත් කළ යුතු විට ලිනක්ස් සීඑල්අයි සංචලනය වේගවත් කිරීමට ක්‍රමයක් තිබේද? මම දැන් ඊතල භාවිතා කරමි, සහ - මට දිගු විධානයක් තිබේ නම්, විධානය ආරම්භයේ සිට මැදට යාමට යම් කාලයක් ගත වේ.

ඊතල භාවිතා නොකර විධානය මැදට පනින්න උදාහරණයක් තිබේද?

Answers:


184

රීඩ්ලයින් පුස්තකාලය විසින් සපයනු ලබන ප්‍රයෝජනවත් රේඛා සංස්කරණ යතුරු බන්ධන කිහිපයක් :

  • Ctrl+ A: පේළියේ ආරම්භයට යන්න
  • Ctrl+ E: පේළියේ කෙළවරට යන්න
  • Alt+ B: එක් වචනයක් පසුපසට යන්න
  • Alt+ F: එක් වචනයක් ඉදිරියට යන්න
  • Ctrl+ U: පේළියේ ආරම්භයට මකන්න
  • Ctrl+ K: පේළියේ අවසානයට මකන්න
  • Alt+ D: වචනයේ අවසානයට මකන්න

7
+1 සමහර හේතු නිසා ctrl- ඊතල ක්‍රියා නොකරන විට පවා මෙය ක්‍රියාත්මක වේ. සටහන් කිරීම වටී, screenපරිශීලකයින් සඳහා , Ctrl-A Ctrl-A A. බවට පත්වේ
enzotib

3
මකාදැමීම අහෝසි කිරීමට (හෝ එය මකා දැමීමෙන් පෙළ
ගෙනයන්න

7
Ctrl + දකුණු ඊතලය, Ctrl + වම් ඊතලය සඳහන් කිරීම වටී.
මැක්

3
උබුන්ටු හි Gnome සහ GnomeTerminal භාවිතා Alt-Aකර කර්සරය චලනය කරනවා වෙනුවට මෙනුව විවෘත කරයි. ඔබ Alt-AGnome සමඟ භාවිතා කරන්නේ කෙසේද? මම කිව්වේ, Gnome යනු පෙරනිමිය, එබැවින් මෙය කියවන ඕනෑම අයෙකු Gnome හි පර්යන්තයක් ධාවනය කරනු ඇත.
ජේසන්

1
ඔබ SSH හරහා OS X සිට උබුන්ටු වෙත සම්බන්ධ වන්නේ නම් ඔබට Ctrl වෙනුවට "Esc" භාවිතා කිරීමට සිදුවනු ඇත. උදා: Esc-A, Esc-E සහ යනාදිය. ITerm සහ Terminal සඳහා මෙය සත්‍ය වේ.
ෆ්‍රෙඩ් ක්ලවුසන්

80

මෙතැන් සිට තවත් කෙටිමං කිහිපයක්

Ctrl + a  – Go to the start of the command line
Ctrl + e  – Go to the end of the command line
Ctrl + k  – Delete from cursor to the end of the command line
Ctrl + u  – Delete from cursor to the start of the command line
Ctrl + w  – Delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y  – Paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – Move between start of command line and current cursor position (and back again)
Alt  + b  – Move backward one word (or go to start of word the cursor is currently on)
Alt  + f  – Move forward one word (or go to end of word the cursor is currently on)
Alt  + d  – Delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt  + c  – Capitalize to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt  + u  – Make uppercase from cursor to end of word
Alt  + l  – Make lowercase from cursor to end of word
Alt  + t  – Swap current word with previous
Ctrl + f  – Move forward one character
Ctrl + b  – Move backward one character
Ctrl + d  – Delete character under the cursor
Ctrl + h  – Delete character before the cursor
Ctrl + t  – Swap character under cursor with the previous one

1
මෙම සරල, චිට්-චැට්-අඩු ලැයිස්තුවට ස්තූතියි.
neverMind9

14

ඔබ vi [m] සහ bash භාවිතා කරන්නෙක් නම්, set editing-mode viඔබේ ~/.inputrcහෝ /etc/inputrcලිපිගොනු වලට එකතු කිරීමෙන් කියවීම් රේඛාව (bash විසින් භාවිතා කරනු ලැබේ) vi-style සංස්කරණය භාවිතා කිරීම ඔබට ප්‍රයෝජනවත් විය හැකිය . නැතහොත්, ඔබට bash විධානය ක්‍රියාත්මක කිරීමෙන් vi-style සංස්කරණය කළ set -o viහැකිය. ~/.bashrcහැසිරීම දිගටම පවත්වා ගැනීමට ඔබේ ගොනුවට විධානය එක් කරන්න .

ඔබ zsh පරිශීලකයෙකු නම්, vi-style සංස්කරණය සඳහා bindkey -vඔබේ .zshrcගොනුවට එක් කරන්න .


8

කර්සරය යතුරු භාවිතා නොකර විශේෂයෙන් මැදට පනින්න ක්‍රමයක් ගැන මම නොදනිමි. කෙසේ වෙතත්, Ctrlහිස් සිට හිස් දක්වා ගමන් කිරීමට + කර්සරය යතුර භාවිතා කිරීම මට නිර්දේශ කළ හැකිය (එනම්, එක් වචනයකින් තවත් වචනයකට පනින්න).


1

පහත දැක්වෙන කේත-ස්නිපටය ඔබේ .bashrc හි මූලාශ්‍ර කරන්න. Ctrl-a ආරම්භයට පනින අතර Ctrl-a එබීමෙන් නැවතත් මැදට පනිනවා.

jump_mid() {
    if [ "$READLINE_POINT" -eq "0" ]; then
        LEN=${#READLINE_LINE}
        POS=$(($LEN / 2))
        READLINE_POINT=$POS
    else
        READLINE_POINT=0
    fi
}
bind -x '"\C-a" : jump_mid'

නැතහොත් ඔබට කෙලින්ම මැදට පනින්න Ctrl-Something භාවිතා කිරීමට අවශ්‍ය නම්, කේතය පහත පරිදි වෙනස් කරන්න:

jump_mid() {
    LEN=${#READLINE_LINE}
    POS=$(($LEN / 2))
    READLINE_POINT=$POS
}

එය Ctrl-a ට වඩා වෙනස් දෙයකට බැඳ තබන්න.

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.