PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > [OT] Persistent Vim Folding
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

[OT] Persistent Vim Folding

Réponse
 
LinkBack Outils de la discussion
Vieux 25/01/2008, 09h40   #1
Amit Uttamchandani
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut [OT] Persistent Vim Folding

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
  Réponse avec citation
Vieux 25/01/2008, 10h40   #2
Kyle Barbour
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [OT] Persistent Vim Folding

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
  Réponse avec citation
Vieux 25/01/2008, 10h50   #3
Sridhar M.A.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [OT] Persistent Vim Folding

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-----

  Réponse avec citation
Vieux 25/01/2008, 14h50   #4
Brian McKee
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [OT] Persistent Vim Folding

-----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
  Réponse avec citation
Vieux 25/01/2008, 16h50   #5
Sridhar M.A.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [OT] Persistent Vim Folding

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-----

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h03.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13019 seconds with 13 queries