Tag Info

Hot answers tagged

5

You have to escape the & sign. Try that: :s /é /\é /gc Notice, I don't know if it is desired, but your substitution only replaces é if it is followed by a space. To replace all é's, use that command (without the spaces): :s /é/\é/gc


5

You can use -exec along with find. Use the following command: find /home/user -type f -name 'important' -exec vi {} \;


4

Use: find ./ -name 'important.txt' -print0 | xargs -0 vi This works, and it's simple. If you don't need a pipe then you can try this: find ./ -name 'important.txt' -exec vi {} \;


4

That would be .vimrc located in your home folder. Do: vim ~/.vimrc Add: set number


3

You can use xclip. Lets say you have a file named file.txt and you have edited the file using vim and saved it. Now running the following will copy the content of the file to the clipboard: cat file.txt | xclip -selection c Now you can just paste the content of the file by any usual method. Remember, in this solution you need to save the changes you made ...


2

To add the character press the following keystrokes: ctrl-v down arrow (15 times or 15G to go to line number 15 directly) I (Capital letter) # esc To delete the character press the following keystrokes: ctrl-v down arrow (15 times or 15G to go to line number 15 directly) x Please pay attention to lower and capital letters. They are important in vim.


2

You can also use search and replace and add a range to it: :.,15s/^/#/ To undo just: :.,15s/^#//


2

I was able to solve the problem in two steps. Since vim had not been able to generate the required index from the compressed documentation, I extracted these files before re-running the indexer. As vim is able to deal with compressed documentation, I removed the extracted documents and adjusted the filenames of the index accordingly. #!/bin/bash #set -x ...


2

Add * wildcard after 'important', also you can use the following command: vim $(find /home/user -name "important*")


2

It appears that pi-rho's PPA has a broken build of Vim. Until this is fixed, it might be best to use another PPA, or no PPA at all. As an alternative, try the Vim Daily builds PPA, which apparently hasn't been updated in the last couple of weeks, but is still pretty current.


2

Should you? No, it doesn't make much of a difference. It's only ~2MB either way, so it's up to you.


1

You can have as many flavours of vim installed in you system like vim-basic(provided by default), vim-tiny, vim-gnome etc. You can then choose which binary to use by giving preference of one over another using update-alternatives. update-alternatives decides which binary to execute depending on your preference when vim is used. Basically the vim binary ...


1

If you wish to get the output of the find command (i.e. the list of files) in vim, then the following will have vim read from find's output: find /home/user -type f -name 'important' | vi - If you wish to open the files themselves, then xargs and find's -exec action are good options, as mentioned by other answers. However, for the -exec action you are ...


1

Your terminal emulator's colour palette might be different from that of the TTY's framebuffer. How can I change the TTY colors? The same applies to cursor type, since that can be set by the terminal emulator. How to change cursor shape, color, and blinkrate of Linux Console? How to stop cursor from blinking? As for the Shift, it is likely that the X window ...


1

You can try reinstalling GVim: sudo apt-get install --reinstall vim-gnome vim-gui-common vim-common vim-runtime In particular, I think you need the *-common and *-runtime package files.


1

The current (accepted) answer doesn't work if you switch files/buffers within one of your vim sessions. The title won't get updated. The following is enough to have automatically updated titles in gnome-terminal also when you switch files by using :e foo.txt, :b0, :b#, etc. Just place this in your ~/.vimrc file: autocmd BufEnter * let &titlestring = ' ...


1

Install xclip (if not installed already) then from user 1's session save the text you want to copy as a file (e.g. test.txt) and then run the following: cat test.txt | xclip -selection c This will copy the text to the clipboard. Now from User 2's session you can just paste the text into vim by any usual method like <CTL>+<SHIFT>+v.


1

There are many ways to do this is vim, i use this method. Run these commands in vim :vmap <F6> :!xclip -f -sel clip<CR> :map <F7> :-1r !xclip -o -sel clip<CR> Now F6 is mapped to copy and F7 is paste. Use V to select lines and use navigation buttons to mark the lines you want to copy. While hightlighted press F6 to copy into ...



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