{"id":109,"date":"2010-01-12T17:21:29","date_gmt":"2010-01-12T16:21:29","guid":{"rendered":"http:\/\/demeringo.ovh.org\/blog\/?p=109"},"modified":"2010-01-12T17:21:29","modified_gmt":"2010-01-12T16:21:29","slug":"ksh-vi-mode-auto-complete","status":"publish","type":"post","link":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=109","title":{"rendered":"KSH vi mode (auto complete)"},"content":{"rendered":"<p>Daily, I log into unix servers where the only installed shell is KSH.<br \/>\nI really miss the the auto-completion provided by the &#8216;tab&#8217; key of BASH shells.<\/p>\n<p>Something similar can be activated on KSH, by setting it to to the so called &#8216;VI&#8217; mode.<\/p>\n<pre lang='sh'>\r\nset -o vi\r\n<\/pre>\n<p>in your .profile or .login scripts.<br \/>\nYou can now enjoy the vi editor commands (and more) right from the command prompt.<\/p>\n<p>To envoke the editor, simply hit the ESC key. Just like going from input mode to command mode inside of vi. Some of the more useful key strokes:<\/p>\n<p>ESC+\\ = autocomplete, will complete upto the non-unique character.<br \/>\nESC+* = space delimited list of all files that match the pattern you started with.<br \/>\nESC+\/str = search the commandline history for str.<br \/>\nESC+n = search for the next occurance of str.<br \/>\nESC+k = go back one in the commandline history.<br \/>\nESC+j = go forward one in the commandline history.<br \/>\nESC+$ = go to the end of the current line<br \/>\nESC+0 = go to the beginning of the current line<br \/>\nESC+i = return to insert mode<br \/>\nESC+A = append to the end of the current line<br \/>\nESC+I = insert from the beginning of the current line<br \/>\nESC+fx = move cursor to the right until the next occurance of x<br \/>\nESC+Fx = move cursor to the left until the next occurance of x<br \/>\nESC+x = delete character under cursor and place it in the buffer<br \/>\nESC+p = place the contents of the buffer after the cursor<br \/>\n(combining the last two keystrokes)<br \/>\nESC+xp = transpose two characters (I use this alot)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Daily, I log into unix servers where the only installed shell is KSH. I really miss the the auto-completion provided by the &#8216;tab&#8217; key of BASH shells. Something similar can be activated on KSH, by setting it to to the so called &#8216;VI&#8217; mode. set -o vi in your .profile or .login scripts. You can &hellip; <a href=\"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=109\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;KSH vi mode (auto complete)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[20,18],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5WcEf-1L","_links":{"self":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/109"}],"collection":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=109"}],"version-history":[{"count":1,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":166,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions\/166"}],"wp:attachment":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}