|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hey guys,
Been using Vim/GVim a lot recently and I am loving it! I recently started using the folding feature. I created a bunch of folds but when I quit GVim and restart it..all the folds are gone! Is there anyway to store the folds, so the next time I launch the same document, it stays? Thanks to all the Vim Gurus out there. Amit -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Jan 25, 2008 1:39 AM, Amit Uttamchandani <atu13439@csun.edu> wrote:
> Hey guys, > > Been using Vim/GVim a lot recently and I am loving it! > > I recently started using the folding feature. I created a bunch of folds but when I quit GVim and restart it..all the folds are gone! > > Is there anyway to store the folds, so the next time I launch the same document, it stays? > > Thanks to all the Vim Gurus out there. > > Amit Looking at the vim documentation, it looks like you use the :mkview and :loadview commands (:mkview before you exit the file, :loadview once you reopen it). I've never done this, so your mileage may vary. http://www.vim.org/htmldoc/usr_28.html#28.4 Kyle Barbour -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Fri, Jan 25, 2008 at 01:39:13AM -0800, Amit Uttamchandani wrote:
> Hey guys, > > Been using Vim/GVim a lot recently and I am loving it! > > I recently started using the folding feature. I created a bunch of folds but when I quit GVim and restart it..all the folds are gone! > > Is there anyway to store the folds, so the next time I launch the samedocument, it stays? > It can be done. Add this to ~/.vimrc : set modeline set fdm=marker Of course, this presumes, that you want the fold method as marker. There are other methods. Another suggestion: You can always include your vim settings as a comment at the end of your file(s) so that they are preserved always. E.g., for a (la)tex, I have this line : % vim:tw=72:et:sw=2:ts=2:fdm=marker Similarly for a php file you can have // vim:tw=72:et:sw=2:ts=2:fdm=marker This route is quite effective and I have set up vim to add these lines automatically whenever I create a php/tex/c/whatever file I create. HTH, Regards, -- Sridhar M.A. GPG KeyID : F6A35935 Fingerprint: D172 22C4 7CDC D9CD 62B5 55C1 2A69 D5D8 F6A3 5935 BOFH excuse #436: Daemon escaped from pentagram -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHmb3RKmnV2PajWTURAkCIAJ90kbZRakL30ENJFfRBY+ MtOgKaSACgiCHj 9WlFF+4wANmm3RMGTVKoGiA= =+LgZ -----END PGP SIGNATURE----- |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On 25-Jan-08, at 5:45 AM, Sridhar M.A. wrote: > I have set up vim to add these lines > automatically whenever I create a php/tex/c/whatever file I create. > Share details please.... :-) Brian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Verify this email or encrypt your email for free - see gnupg.org iD8DBQFHmfU3GnOmb9xIQHQRAtBvAKDZb21o//GXc3il1OxwUfrWAnLRZQCg3IRH URUDneeC4vr0179FfuiLdtQ= =uLt8 -----END PGP SIGNATURE----- -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Fri, Jan 25, 2008 at 09:41:59AM -0500, Brian McKee wrote:
> On 25-Jan-08, at 5:45 AM, Sridhar M.A. wrote: > >> I have set up vim to add these lines >> automatically whenever I create a php/tex/c/whatever file I create. >> > Share details please.... :-) > You asked for it :-) Here is a snippet of my ~/.vimrc. "Open a new tab map <f12> <esc>:tabnew<cr> set tabpagemax=5 set tw=72 et sw=2 ts=2 set pastetoggle=<f11> set ruler set fo+=n " Format numbered lists automagically syntax on set modeline set viminfo='10,\"100,:20,%,n~/.viminfo au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm'\"")|else|exe "norm $"|endif|endif " Add some skeletal structure au BufNewFile *.tex 0read ~/.vim/skel.tex au BufNewFile *.html 0read ~/.vim/skel.html au BufNewFile *.php 0read ~/.vim/skel.php Create a directory ~/.vim and put the above files there. I will just paste the tex and php files for your reference : skel.tex \documentclass{article} % \usepackage[body={6in,9in}]{geometry} \usepackage[dvips]{graphicx} \usepackage{enumerate} \usepackage{pifont} \usepackage{textcomp} \usepackage{hyperref} \usepackage{comment} \usepackage{booktabs} %\usepackage{chemsym} %\usepackage{setspace} \voffset-.5in \hoffset-.5in \newcommand{\hb}[2]{\mbox{#1$\cdots$#2}} \newcommand{\Deg}{$^\circ$} \newcommand{\ml}[2]{\multicolumn{#1}{l}{#2}} \newcommand{\mr}[2]{\multicolumn{#1}{r}{#2}} \newcommand{\mc}[2]{\multicolumn{#1}{c}{#2}} \begin{document} \end{document} % vim:tw=72:et:sw=2:ts=2:fdm=marker skel.php <?php // vim: tw=0:nowrap:fdm=marker: ?> With those lines, whenever you open a new tex/php file, these things get pasted/inserted. Please add stuff that you might want in addition to what I have. Regards, -- Sridhar M.A. GPG KeyID : F6A35935 Fingerprint: D172 22C4 7CDC D9CD 62B5 55C1 2A69 D5D8 F6A3 5935 A woman, especially if she have the misfortune of knowing anything, should conceal it as well as she can. -- Jane Austen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHmhHEKmnV2PajWTURApRnAKCOh/Ci+HsfKihBtmuak1WlHqc5gwCfa3Dm fkX2dpDY0eGqx3GDJ0+14OI= =Eu9l -----END PGP SIGNATURE----- |
|
![]() |
| Outils de la discussion | |
|
|