Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[vim] probleme de tabulation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
mcsky2
Guru
Guru


Joined: 25 Aug 2005
Posts: 312

PostPosted: Tue May 19, 2009 3:38 pm    Post subject: [vim] probleme de tabulation Reply with quote

Bonjour,
J'ai un probleme recurent avec vim sous gentoo et les tabulations.
Lorsque je copie un script à la souris qui a des tabulations simples, dans un autre fichier, ces tabulations s'incrémentent d'un a chaque ligne.
Est ce que quelqu'un sait comment désactiver ce phénomène. Je suppose que c'est dans /etc/vim/vimrc
Exemple

Code:
     toto
     toto
     toto


devient

Code:
     toto
           toto
                  toto


Merci d'avance pour vos réponses
Back to top
View user's profile Send private message
ppg
Apprentice
Apprentice


Joined: 05 Oct 2008
Posts: 178
Location: Toulouse

PostPosted: Tue May 19, 2009 3:55 pm    Post subject: Reply with quote

de mémoire il faut désactiver l'auto indentation :
Code:
:set noai


Ou ajouter set noai au ~/.vimrc (enfin j'utilise emacs maintenant, alors je me souviens plus bien omment on fait).
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Tue May 19, 2009 4:29 pm    Post subject: Reply with quote

juste avant de coller (et de se mettre en insert mode) tu peux faire:
Code:
:set paste


puis après, tu peux revenir en normal
Code:
:set nopaste

_________________
The End of the Internet!
Back to top
View user's profile Send private message
GentooUser@Clubic
l33t
l33t


Joined: 01 Nov 2004
Posts: 829

PostPosted: Wed May 20, 2009 1:04 am    Post subject: Reply with quote

Perso j'ai mappé ça sur la touche F12

Code:
" Passe en mode paste avec la touche <F12>
set pastetoggle=<F12>
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed May 20, 2009 5:29 am    Post subject: Reply with quote

Idem, (sauf que c'est la touche F10... ), le même binding est également disponible en insert mode:
Code:
nmap <silent> <F10> :set hls!<CR>
imap <silent> <F10> <c-o>:set hls!<CR>

_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum