Tag Info

Hot answers tagged

4

You almost have it with your second command. You did it correctly with the first, just use the same shell sequence expansion: vim directory_{0..10}/results/output.txt You should see something in the shell about opening 11 files. Then you can use vim to iterate through each one.


2

Try this: esc + b + i esc puts you in normal mode b goes to the beginning of the previous word i puts you in insert mode.


2

In normal mode, type b + i with your cursor at the end of "this".


2

You can still do basically the same thing from visual mode. Once you have the area selected, hit the following1: :'>,'> !tee >(xsel -b) You need to pipe to tee so that the contents of your selected area isn't cleared. 1Adapted from here.


2

If the extra :w<enter> is the only insertion in that place I use ESC + u (undo). If not it's just as long as yours but depending on personal preferences/habits it might be faster: ESC + up arrow + J (join) + left arrow + left arrow + x + x (delete current char). Technically the longer sequence can be saved as a macro and then invoked with just ESC + ...


2

C-o u C-o: normal state for one command u: undo Note: this might undo more than you want depending on how much you changed.


2

Note in several Debian based distros the symbolic link in /bin/vi is to 'busybox' and not vim at all. In some cases this can be OK but the features busybox provides are a minimum set and for some reason seem to vary on how busybox was compiled. If vim is installed it usually replaces the busybox link -- but sometimes not so -- busybox may still be linked ...


1

You can surround it by quotes to stop vim from calculating the result echo '-1 -1'


1

I find that adding the file to the top of the window using, set title in the .vimrc, is less obnoxious then always having the status bar taking up a full line at the bottom.


1

With set backspace=2, you should be able to just press Backspace three times.


1

Turns out this is infuriatingly easy: use the "v" command to highlight the text area you want. Immediately press the "!" command, followed by your command. So the sequence is "v" "!"


1

I've found solution here. In general: Run PuTTY Configuration. In the left pane, select Terminal, Features. Put a check mark next to "Disable application keypad mode". In the left pane, select Session. Save the settings.


1

You'll have spaces at the end of the line when selecting and copying from the terminal if the application displayed spaces at that spot. Applications may display spaces in order to erase what was there before. Terminals have commands to delete a whole line or delete characters to the right of the cursor; applications choose between that and displaying spaces ...


1

Copy & pasting from a terminal screen is never going to be fully reliable because it's dealing with screen output instead of original source material. If some applications echo text to the terminal in an unusual fashion and it results in the terminal not being able to guess what the original text was, there's probably not much you or the terminal can do ...


1

You can do it with command line version of put: :put z The full syntax is :[line]pu[t] [x]. Please see :help :put for more information. On a side note: Vim geeks' den is this way.


1

As you're already using it, I'd recommend tmux as fully supports copy and paste - see the manual page for more information. You can see the current key bindings by using the tmux list-keys command - look for the begin-selection, copy-selection and paste-buffer commands in that list. By default, the bindings are: [ - Start copy/paste mode h, j, k, l - vi ...


1

It seems, you messed up /etc/profile. Normally PATH is defined in /etc/profile and $HOME/.profile.



Only top voted, non community-wiki answers of a minimum length are eligible