filetype on syntax on set nocompatible "Elimina ogni compatibilita' con VI, usa gli standard di VIM set viminfo='1000,f1,\"500 "ripristina le impostazioni precedenti (100 "file, 500 linee di registro, set autoindent "Indenta automaticamente le righe set smartindent "Indenta in modo INTELLIGENTE set autowrite set backspace=2 set background=dark set fileformat=unix set hidden set history=100 set laststatus=2 set magic "set noerrorbells set noautowrite "set nobackup set nostartofline set nowritebackup set ruler set shell=/bin/bash set showcmd set showmatch set showmode set smarttab set title set ttyfast set ttybuiltin set undolevels=10000 set wildchar= set incsearch "Ricerca MENTRE la parola viene digitata set ignorecase "Ricerca ignorando il CAPS lock set smartcase "Se e' presente ALMENO una maiuscola, usa il case, altrimenti usa IGNORECASE set vb t_vb= "Sostituisce il beep con un flash set nohls "NON evidenzia le parole trovate "Inizio impostazioni differenziate per tipo di file" if has("autocmd") " Quando vim e' usato in un terminale virtuale (tipo xterm), imposta il " titolo della finestra al nome del file che si sta visualizzando if !has("gui_running") auto BufEnter * let &titlestring="VIM - ".expand("%:p") endif " Nei file di testo e LaTeX limita la massima lunghezza della riga a 76 " caratteri. Imposta anche wrap e indentazione logici autocmd BufRead *.txt set tw=76 formatoptions=tcroqn2l autocmd BufRead *.tex set tw=76 " Impostazioni per la programmazione {{{ augroup prog au! au BufRead *.c,*.cc,*.cpp,*.h,*.java set formatoptions=croql cindent nowrap foldenable foldmethod=indent foldnestmax=1 "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "La riga SOPRA specifica le opzioni per i file C e C-like(C++, e Java) "cindent specifica che bisogna usare l'indentazione C "nowrap NON spezza le linee "foldenable abilita i fold "foldmethod=indent specifica che i fold vengono creati automaticamente in base al livello d'indentazione "foldnestmax=1 specifica che il massimo livello di fold e' 1 (ovvero non si "hanno 1000 'nested fold' au BufRead *.py set formatoptions=croql autoindent nowrap foldenable foldmethod=indent foldnestmax=3 "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "per il python "come la riga sopra ma aumenta il foldnestmax per il python au BufEnter *.java map :w\|:!javac % au BufEnter *.c map :w\|:!gcc % au BufEnter *.cc,*.cpp map :w\|:!g++ % au BufLeave *.java,*.c,*.cc unmap " Don't expand tabs to spaces in Makefiles " Nei Makefiles non espande i tabs a spazi au BufEnter [Mm]akefile* set noet au BufLeave [Mm]akefile* set et " Imposta il folding per il python au FileType python set nofoldenable foldmethod=indent augroup END " }}} " FINE impostazioni programmazione " Ri-legge la configurazione di Vim quando .vimrc viene salvato " {{{ augroup VimConfig au! autocmd BufWritePost ~/.vimrc so ~/.vimrc autocmd BufWritePost vimrc so ~/.vimrc augroup END " }}} endif " has("autocmd")