LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-21-2020, 08:34 PM   #1
thirtySeven
LQ Newbie
 
Registered: Jun 2020
Posts: 24

Rep: Reputation: Disabled
Readline in vi mode: How can I start in command mode instead of insert mode?


I would like to configure readline to always leave me in command mode after running a shell command.

Is this possible?
 
Old 06-22-2020, 01:53 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,809

Rep: Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870Reputation: 4870
https://www.geeksforgeeks.org/vi-editor-unix/
I do not really understand, vi will not go into insert mode automatically.
 
Old 06-22-2020, 02:18 AM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,135

Rep: Reputation: Disabled
@pan64. It's not about the vi editor, it's about the Readline vi mode.

@OP. Try putting this into your ~/.inputrc (untested):
Code:
$if editing-mode == vi
set keymap vi-command
$endif
Instead of vi-command, it may be just vi or vi-move. All three denote the same keymap.

Last edited by shruggy; 06-22-2020 at 02:32 AM.
 
Old 06-22-2020, 09:13 AM   #4
thirtySeven
LQ Newbie
 
Registered: Jun 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
@OP. Try putting this into your ~/.inputrc (untested):
keymap.[/QUOTE]

This did not work for me. I tried all possible combinations.

Last edited by thirtySeven; 06-22-2020 at 09:14 AM.
 
Old 06-22-2020, 09:16 AM   #5
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,135

Rep: Reputation: Disabled
And this?
Code:
$if Bash
set keymap vi-command
$endif
 
Old 06-22-2020, 09:35 AM   #6
thirtySeven
LQ Newbie
 
Registered: Jun 2020
Posts: 24

Original Poster
Rep: Reputation: Disabled
@shruggy
now I get this error.
Code:
readline: ~/.inputrc: line 17: endif: no key sequence terminator
. The only code not commented out in my ~/.inputrc file is what you have given me.

Last edited by thirtySeven; 06-22-2020 at 09:40 AM.
 
Old 06-22-2020, 09:55 AM   #7
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,135

Rep: Reputation: Disabled
Sorry. I don't know then.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patch for readline.SlackBuild to include rlfe (ReadLine Fron-End) tfonz Slackware 0 10-22-2016 11:45 AM
Readline variable horizontal-scroll-mode. stf92 Slackware 3 10-21-2013 08:34 PM
Vi: I want backspace to respond in insert mode and not in command mode: possible? stf92 Slackware 9 06-16-2011 11:05 PM
Using cat readline within cat readline while loop demxkn66 Programming 5 12-16-2007 05:10 PM
readline vi mode disabling tab-completion bryankaplan Linux - General 0 10-28-2006 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration