Skip to main content

Questions tagged [line-editor]

The line editor in shells and other command line programs

Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

I have some bindkey commands in my .zshrc file which behave as desired. I start tmux; the same .zshrc is run, including the bindkeys but they don't function. But then if I manually type them on the ...
artfulrobot's user avatar
  • 3,079
1 vote
1 answer
2k views

I have a hobby server with a significant numbr of USB hard drives. I have aggressive power management enabled, and a short spin-down timeout, as these drives are basically meant to be cold storage ...
FlamingKitties's user avatar
2 votes
1 answer
566 views

My ~/.zshrc: setopt histignoredups autoload -U history-search-end zle -N history-beginning-search-backward-end history-search-end zle -N history-beginning-search-forward-end history-search-end bindkey ...
user avatar
3 votes
1 answer
54 views

Sometimes when I reverse-search cmd in a shell I don't find a correct match and just want to execute search query as it is. Is there a way in bash/zsh and friends to execute it without discarding ...
Andrey Kuznetsov's user avatar
1 vote
2 answers
421 views

I am on macOS/darwin using a "default settings" zsh environment (no "oh-my-zsh" or any of that). Some developer tool I just installed apparently broke some keybinds that I use ...
NReilingh's user avatar
  • 124
2 votes
4 answers
2k views

I want to use a global substitution in Vim to delete everything up to https. Before The website is https://website.com The website is https://website.com The website is https://website.com After ...
5am's user avatar
  • 343
1 vote
1 answer
186 views

I used the script program to record an interactive session: $ script $ echo<-<-<-<-printf "hello\n" $ exit The sequence <- is representing the backspace character. I want the ...
André Werlang's user avatar
2 votes
1 answer
2k views

From what I have seen, both set -o emacs and bindkey -e are used to modify the behavior of your terminal line editor to emulate emacs whereas set -o vi and bindkey -v are used to emulate vi ...
grenmester's user avatar
1 vote
1 answer
665 views

I have been experiencing an unusual problem in the oh-my-zsh configuration in which the cursor gets out of sync with the text. (I normally work using screen in konsole. For instance on a new terminal ...
vfclists's user avatar
  • 7,919
0 votes
1 answer
580 views

It happens quite often to me, that while entering a complex command I realize that I need to enter some other commands first. Being a vi user, I'd love to 0 D, enter a different command and later ...
Philippos's user avatar
  • 13.8k
3 votes
2 answers
625 views

I've been using bash's edit-and-execute-command function: edit-and-execute-command (C-x C-e) Invoke an editor on the current command line, and execute the result as shell commands. Bash ...
Nathaniel M. Beaver's user avatar
1 vote
2 answers
1k views

I have a file which contains one line like this test1.CSV test2.CSV test3.CSV test4.CSV... I want to put a line break after each .CSV file name like so test1.CSV test2.CSV test3.CSV test4.CSV Thanks
Ayoub Hammami's user avatar
5 votes
2 answers
4k views

I (ab)use Alt + . to recover the last argument in a previous command (I'm using ZSH): for example, $ convert img.png img.pdf $ llpp (alt + .) # which produces llpp img.pdf but sometimes I review a ...
David's user avatar
  • 177
4 votes
4 answers
843 views

Suppose I do something like: ln a_file_with_a_long_filename.pdf ~/path/to/a/new/hardlink/a_file_with_a_long_filename_slightly_modified.pdf Is there a way to refer to and expand ...
student's user avatar
  • 18.9k
1 vote
2 answers
1k views

There's a nice CLI binutils utility for interpreting binary files, and outputting legible strings, in a cat-like fashion. It's called strings. If you try to cat a binary file, you'll see a bunch of ...
voices's user avatar
  • 1,342
1 vote
1 answer
117 views

In zsh, how do I refer to the grandparent directory with ... rather than ../.., and so forth? I used to have this in oh-my-zsh and prezto. PS. Ideally, M-3 . should yield ../../...
Toothrot's user avatar
  • 3,725
7 votes
2 answers
2k views

I have a common situation in the shell when a command is attempted command "/some/complex/and terrible/path" -vf --various --flags --and -- things --config-file="/some other/annoyingly/...
Steven Lu's user avatar
  • 2,432
0 votes
1 answer
257 views

In zsh, using oh-my-zsh and the robby-russell theme, under Fedora Core 23, I noticed that when I reverse-searched for commands in the command history and tried to edit the results, the display would ...
nzc's user avatar
  • 111
3 votes
1 answer
308 views

I run zsh on my machine. I was wondering if I can do text-replace in shell. For example fn[SPACE/TAB]should be replaced with function. On OSX there is the option of keyboard-shortcuts but they don't ...
CupOfCoffee's user avatar
3 votes
1 answer
1k views

There are 2 existing ways to get something like this easily: zsh's history-substring-search plugin bash's ctrl+r mode The problem with zsh is that it's not on many systems. The problem with bash's ...
Steven Lu's user avatar
  • 2,432
1 vote
1 answer
99 views

I have a Vim configuration that is somewhat unconventional. I bind Shift+H and Shift+L to move left by 7 characters and move right by 7 characters, respectively. This makes it easier for my brain to ...
Steven Lu's user avatar
  • 2,432
1 vote
1 answer
182 views

I want to bind terminal behavior to hotkeys without having to define escape sequences. I understand readline binds to characters instead of actual key presses. Can it also bind to the lower level ...
jiggunjer's user avatar
  • 479
3 votes
2 answers
574 views

Let's say I have a command called synopsis that takes the name of a command as an argument and prints out its syntax. Now I want to bind the synopsis to a key sequence. How can I pass the name of the ...
Nelson's user avatar
  • 33
3 votes
1 answer
959 views

I've been using bracketed paste in VIM which is excellent for ensuring pasted content gets into the editor un-modified without triggering actions (such as auto formatting, and auto closing parenthesis)...
Dave's user avatar
  • 211
25 votes
6 answers
3k views

I am not sure how to word this, but I often I find myself typing commands like this: cp /etc/prog/dir1/myconfig.yml /etc/prog/dir1/myconfig.yml.bak I usually just type out the path twice (with tab ...
user1028270's user avatar
  • 1,124
1 vote
1 answer
393 views

I am using oh-my-zsh's vi-mode plugin. Its working awesomely for regular terminal usage. How to extend this vi-mode to psql, irb etc? In bash I used to do this by adding commands in .inputrc I am ...
t0il3ts0ap's user avatar
20 votes
6 answers
1k views

I'd like to run the command foo --bar=baz <16 zeroes> How do I type the 16 zeroes efficiently*? If I hold Alt and press 1 6 0 it will repeat the next thing 160 times, which is not what I want. ...
Jonas Kölker's user avatar
18 votes
2 answers
11k views

I use zsh's menu-based tab completion. I press Tab once, and a list of possible completions appears. If I press Tab again, I can navigate this list with the arrow keys. However, is it possible to ...
Sparhawk's user avatar
  • 20.6k
2 votes
1 answer
398 views

I run Scheme either as: rlwrap scheme, option which let's me use up/down left/right arrows, but that disables tab. Or as scheme option that let's me indent commands with tab, but disables the arrows. ...
Pierre B's user avatar
  • 2,293
1 vote
1 answer
1k views

I can use Esc+. to get the last parameter of the previous command, but is there an equally convenient short-cut to get the second to last parameter?
wonderingnewbie's user avatar
1 vote
1 answer
320 views

This is a request for explanation or pointer to documentation. I'm a KornShell93 (ksh on Mac OS X or ksh93 elsewhere) user. I like the shell for its relative simplicity as an interactive shell and for ...
Kusalananda's user avatar
  • 356k
27 votes
1 answer
15k views

I made a mistake writing a command at the SQLite command prompt, which I now want to abort, this is how my command line looks sqlite> select * from todos' ...> ' ...> ;^C In this case, ...
the_velour_fog's user avatar
0 votes
2 answers
7k views

I'm using Linux Mint on a MacBook and on its keyboard the equivalent for the INSERT key is the combination Fn + RETURN. At the moment I can only see the intended behavior of this combination in GNU-...
Anton Harald's user avatar
3 votes
1 answer
704 views

In tcsh, the \eP and \eN commands take into account the whitespace-normalized prefix of the current line, not just the first word. For instance if my history contains git pull upstream feature-...
Greg Nisbet's user avatar
  • 3,166
2 votes
1 answer
1k views

This question was about how to delete the last word in bash with ctrl-backspace. As already mentioned there, different Linux distros (or different Unices in general) behave differently: Some produce ^...
viuser's user avatar
  • 2,754
3 votes
3 answers
5k views

If I use PC-BSD with the default shell (Korn) then Ctrl+r doesn't work. Why won't it work? Ctrl-r was introduced to search your history in the late 1970s or early 80s and my BSD still can't do it (...
Niklas Rosencrantz's user avatar
26 votes
2 answers
2k views

One of my favorite tricks in Bash is when I open my command prompt in a text editor. I do this (in vi mode) by pressing ESC v. When I do this, whatever is in my command prompt is now displayed in my $...
Tom Purl's user avatar
  • 455
7 votes
4 answers
2k views

If I want to move a file called longfile from /longpath/ to /longpath/morepath/ can I do something like mv (/longpath)/(longfile) $1/morepath/$2 i.e. can I let the bash know that it should remember a ...
Bananach's user avatar
  • 485
3 votes
2 answers
1k views

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
Axel Bregnsbo's user avatar
30 votes
4 answers
35k views

Putting on Debian 8.3 stty werase '^H' or on Arch Linux 2/2016 stty werase '^?' in .bashrc (for example) makes Ctrl-Backspace delete the last word in the terminal. Still it's not the same behavior ...
viuser's user avatar
  • 2,754
32 votes
1 answer
4k views

I was play around at the bash prompt, and pressed ESC followed by { , after which , the shell showed all the files for completion, in a fileglob string. Eg : If I had typed bash C followed by ESC+{ , ...
Prem's user avatar
  • 3,385
6 votes
2 answers
2k views

Is it possible to change text that appears after $PS1. It is what user inputs. I want to suggest some command hereafter my_function is run. Of Course I should be able to modify/delete it using ...
user avatar
6 votes
2 answers
2k views

If I unintentionally add a newline in a command, as far as I can tell, the only way to undo it is to press Ctrl+c and type the command again. For example: $ cat 'John's File' > ^C $ cat "John's ...
EmmaV's user avatar
  • 4,443
1 vote
1 answer
583 views

I've got in my .inputrc something like "\C-v": "script.sh " I use a link from my clipboard as a parameter for the script, so I type ctrl-v and then paste the link, and then hit enter. So I've seen ...
strudelkopf's user avatar
1 vote
1 answer
111 views

I'm currently running a Xubuntu image using VirtualBox and a strange issue just started occurring: I cannot enter a or c in a terminal or terminal emulator. A and C (that is, a/c + left/right Shift or ...
JAB's user avatar
  • 113
1 vote
1 answer
422 views

stty -a shows, speed 38400 baud; rows 39; columns 143; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt =...
user avatar
7 votes
1 answer
4k views

Often I fail to find something with reverse-i-search but want to keep what I have already written. For example, typing pdflatex fails to complete to pdflatex mydocument.tex. If I then cancel it with ...
Konrad Höffner's user avatar
3 votes
1 answer
269 views

I would like to pass whatever the user has typed in a bash shell to a command, when the user presses a keyboard binding|shortcut For example : Lets say Ctrl+b is our binding bind '"\C-b": "myCommand....
gyaani_guy's user avatar
8 votes
1 answer
2k views

How to move one editing row up (back) or down (forward) in a multi-line command in bash/readline? Somethnig like gj/gk in Vim.
Hans Ginzel's user avatar
5 votes
3 answers
286 views

I am on the bash shell and I want the output of a command to appear directly in the command prompt that appears after the command has executed ! Example of what I envision it, to illustrate my idea: ...
ledawg's user avatar
  • 151