You are not logged in.
Pages: 1
I'm in the process of writing my final dissertation (am I late!), and I need a particularly useful feature.
I'm using LaTeX in Vim, and I would like to know if Vim has the feature of storing copied buffers to fetch them when needed (for example, pasting what I have copied 3 "copies" ago). I remember Emacs has something similar. I tried to google for it, but couldn't find anything, and I have not much time to dig this at the moment.
Is there anyone so kind as to point me to the right direction?
Thanks
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
What you're looking for is the '"' (double-quote) key. '"ay' to yank something to the 'a' register, then '"ap' to put it. You can use any letter, so you have 52 registers to work with. You do need to remember to store the yank in a register, so that's one downside compared to Emacs's kill ring.
Vim also has something closer to the kill ring in some ways: registers 1 through 9 store recent deletes and changes, but not yanks.
Last edited by skymt (2008-05-07 16:16:24)
Offline
Thanks as lot
I can definitely see the downside here: I will have to manually save all the yanks I need, even when I don't know whether I will need them again. However I guess I could make this automatic (i.e. saving whatever I yank in a register, a-Z, alphabetically), knowing how Vim scripting works. I will do it when I have more time.
For now I could take advantage of the delete function, which is the one Emacs uses anyway: when you kill text, you delete it, and you kill it even when you only want to copy it, so you will need to paste it back. So, ho do I access the delete registers?
Thank you
Last edited by finferflu (2008-05-07 16:21:43)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
So, ho do I access the delete registers?
p
Haven't been here in a while. Still rocking Arch.
Offline
Ah, ok, so
"3p
pastes the third before the last deleted text.
Got it, thanks
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
There is also the yankring.vim plugin if you like the way emacs kill ring works. Hit p to paste the last and then C-p to cycle backwards.
Offline
If your goal is to avoid typing long LaTeX names, try vim's automatic completion feature: when in insert mode, start typing the word, then press Ctrl-n. No memory required --human memory, that is.
Offline
If your goal is to avoid typing long LaTeX names, try vim's automatic completion feature: when in insert mode, start typing the word, then press Ctrl-n. No memory required --human memory, that is.
Sweet, didn't know that one, thanks peets
Haven't been here in a while. Still rocking Arch.
Offline
community/vim-supertab 0.45-1
A Vim plugin that allows you to use the tab key to do all insert completion
This plugin will let you complete with Tab key. It also supports changing of completition type. (word, line, omnicomplete, etc)
Offline
@ nj
Thanks for that, I'll look into that
@ peets
Thanks for the suggestion, but I wasn't looking for autocompletion. I knew that "trick" even though I don't find pressing Ctrl-n very comfy, which leads me to:
@ Husio
That's a very interesting plugin, but then I make extensive use of the TAB key (for writing bib files). So how would I actually insert a tab?
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
i believe that supertab only shows it's menu if you are on a word or currently typing a word. tabbing in whitespace is no problem.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
How about the end of a word? Or do I have to insert a space before tabbing?
I guess I'll only have to try it out and see...
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Supertab is smart, but you should probably get used to the built in vim completion. You're going to hit a machine that has vim but no supertab plugin and feel stranded.
C-p and C-n will attempt to match the word with the "previous" or "next" word in the document.
Additionally, vim7 has super-duper completion for some things (:help ins-completion). My personal favorite is C-x,C-f which will complete files. Try "/usr/bin/C-x,C-f"
Offline
I already know C-p and C-n, but they're uncomfy and it's just quicker for me to actually type the word in most cases.
As for the file names, I think I will find that useful when once learn some coding (or perhaps editing some config files, thinking about it). Thanks for the tips
Now I'm in the uni library, and FTP is blocked, so I can't install anything via repos.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
I used to type all C-<something> shortcuts with the left hand. Works well for the keys that are on the left side of my QWERTY keyboard (C-z, C-c, C-a, etc.) I found C-n very uncomfortable too. Now I do it with two hands, and it's not harder than using shift to type capital letter, WHICH WE ALL DO EFFORTLESSLY.
I must admit that I use C-space at work in this horrible program called eclipse. I should try and fix javacomplete.
Offline
OK, now I have a bit more time to dedicate to this, since it is also getting pretty annoying.
So, ever since I installed yankring, I keep getting the following message whenever I start Vim:
YR: The yankring can only persist if the viminfo setting has a "!"
Press ENTER or type command to continue
What does that mean? I have no clue.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Put one of these lines in your .vimrc
" tell yankring not to persist between different vim sessions
" the yankring will be cleared every time vim is opened
let g:yankring_persist = 0
" store global variables in .viminfo, for yankring to persist between different vim sessions
set viminfo+=!
Offline
You might also find :reg useful, since it lists out the current registers. However, these include deleted / cut lines and not just yanked lines (like yankring).
Arch on a Thinkpad T400s
Offline
Thanks for your help
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Pages: 1