Impostazioni default di VIM

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Avatar utente
acrive
Linux 2.x
Linux 2.x
Messaggi: 306
Iscritto il: mar 27 dic 2005, 0:24
Slackware: 12.0
Località: Brindisi <-> Bologna

Impostazioni default di VIM

Messaggio da acrive »

Salve a tutti.... ho un piccolo quesito..

adopero spesso VIM per editare, putroppo però di default VIM ha alcune impostazioni che non mi garbano.. infatti io prima di cominciare a lavorare attivo il syntax highligth e la compatibility mode..

Esiste un file dove impostare tutte queste cose in automatico?

Grazie!

Moro
Linux 1.x
Linux 1.x
Messaggi: 104
Iscritto il: mer 4 feb 2004, 0:00
Località: Faro, Portogallo
Contatta:

Messaggio da Moro »

Crea ~/.vimrc e mettici cio' che vuoi :)

samiel
Staff
Staff
Messaggi: 5511
Iscritto il: ven 16 gen 2004, 0:00
Nome Cognome: Mauro Sacchetto
Slackware: 13.0
Kernel: 2.26
Desktop: KDE
Distribuzione: anche Debian
Località: Venezia

Messaggio da samiel »

Prova questo:

" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2002 Sep 19
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set showmode
set showmatch
set textwidth=78
set mouse=a
" set encoding=utf-8
set encoding=ISO-8859-15
colorscheme blue
set gfn=Courier\ Bold\ 14
" map zz :w!<CR>:!aspell check %<CR>:e! %
" let spell_executable = "aspell"
" let spell_language_list = "it"
" let spell_auto_jump = 0

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on

" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!

" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78

" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif

augroup END

else

set autoindent " always set autoindenting on

endif " has("autocmd")


M.

Avatar utente
acrive
Linux 2.x
Linux 2.x
Messaggi: 306
Iscritto il: mar 27 dic 2005, 0:24
Slackware: 12.0
Località: Brindisi <-> Bologna

Messaggio da acrive »

grazie!!

Rispondi