As I am a user of vimium, it turns out I had the capabilities already shipped with it even though I wasn't aware that it existed.
- Search the starting point by:
/yourSeach
- Press enter.
- Enable visual mode via:
v
, and visual mode on a line basis via Shift + V
- Select text by vim navigation keys, aka: h, j, k, l, b, e, w, $ (I especially like shift + w, as it goes to the end of the next word)
- Yank via
y
You now can switch the context and paste the text via Ctrl+V
There also seems to be a caret mode, yet as of yet I somtimes don't see the current place of the cursor, which is why I prefer the search-first approach as of now.
There is a set of shortcuts for terminal , and they are organized around the current cursor position.
- You can use CtrlK shortcut to cut the text from cursor to end of line
- CtrlU cuts from current position to beginning of line.
- Paste with CtrlY
These two are pretty useful in particular when you want to either copy the command or its arguments.
If you are proficient with vim
text editor, you can edit the command you want in a more powerful way by evoking vim
with fc
command.
For using the command outside the terminal, you might want to use xclip
command (not installed by default) . For instance,
$ echo "some_command" | xclip -sel clip
Once you have xclip
you can add the following function to your .bashrc
file
to_clipboard() {
xclip -sel clip <<<"$@"
}
What this does is it will copy whatever you put in front to clip board. You can use that in combination with the shortcuts above to cut test, paste it in front of the function, and it will be added to your clipboard. Small example
$ to_clipboard echo 'hello world'
Best Answer
When you keep holding down the ctrl key and press space you can move around with the arrow keys and select no consectuive files. Only downside of that, at least for me is, i dont have a file selection when moving and have to count the files, but that can be the case that im using an pretty old Laptop.