dotvim/vimrc

145 lines
4.2 KiB
VimL
Raw Normal View History

2015-10-10 15:34:29 +02:00
""
"" Environment
""
2015-10-10 17:23:21 +02:00
" vim environment
2015-10-10 15:34:29 +02:00
set directory=$XDG_CACHE_HOME/vim,~/,/tmp
set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp
set viminfo+=n$XDG_CACHE_HOME/vim/viminfo
set rtp=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
2015-10-10 17:23:21 +02:00
" ctags data
set tags=$XDG_CACHE_HOME/vim/tags
" keep history
set undodir=$XDG_CACHE_HOME/vim/undo
set undofile
2013-11-22 18:20:32 +01:00
""
2015-10-10 15:34:29 +02:00
"" Plugins
2013-11-22 18:20:32 +01:00
""
2015-10-10 15:34:29 +02:00
set rtp+=$XDG_CACHE_HOME/vim/plugins/Vundle.vim
call vundle#begin('$XDG_CACHE_HOME/vim/plugins')
Plugin 'VundleVim/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'townk/vim-autoclose'
Plugin 'tpope/vim-fugitive'
Plugin 'sjl/gundo.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'tpope/vim-markdown'
Plugin 'ervandew/supertab'
Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/syntastic'
call vundle#end()
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
"" Mapping
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
" Windows navigation
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
map <F2> :GundoToggle<CR>
map <F3> :call ToggleSpell()<CR>
map <F5> :NERDTreeTabsToggle<CR>
map <F6> :TagbarToggle<CR>
map <D-e> :q!<CR>
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
""
"" Options
""
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set spell spelllang=it " Controllo ortografico...
set nospell " ...solo quando serve
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set nocompatible " Disabilita la compatibilità con vi
set backspace=2 " Fix per il DEL nel terminale
set hidden " Nasconde i buffers
set history=1000 " Aumenta la cronologia
set incsearch " Ricerca incrementale
set hlsearch " Evidenzia i risultati della ricerca
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set ignorecase " Ricerca case insensitive...
set smartcase " ...per i termini minuscoli
set laststatus=2 "
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set mouse=a " Abilita il supporto al mouse
set showcmd " Mostra il comando mentre lo digit
set ruler " Mostra la posizione della linea/colonna
set vb t_vb= " Disabilita i beep
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set nobackup " Disabilita i backup ~
set noswapfile " Disabilita i file di Swap
set writebackup " Abilita backup temporanei
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set wildmenu " Autocompletamento dei comandi
set encoding=utf-8 " Codifica
set nomodeline " Sicurezza
set tabpagemax=10 " Limita il numero di tab a 10
set showmatch " Evidenzia le parentesi selezionate
set ffs=unix,mac " Formato Unix e Mac per i file
set clipboard=unnamed " Integrazione con la clipboard
set ttyfast " Migliora il redrawing in xterm
filetype indent plugin on " Riconoscimento del tipo del file
set wildignore+=*/tmp/*,*.so,*.swp " Altri file da ignorare
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set shiftwidth=4 " Tab
set tabstop=4 "
set noexpandtab "
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
set number " Numerazione
set autoindent " Indentazione
set smartindent "
set noshowmode "
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
syntax on " Abilita il syntax-highlighter
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
syntax enable
hi NonText guifg=bg
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" Barra del titolo senza “-VIM”
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
"" Plugin options
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
" Lightline
source $XDG_CONFIG_HOME/vim/lightline.vim
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" Syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_enable_signs = 1
let g:syntastic_python_checkers = ["flake8", "python"]
let g:syntastic_python_python_exe = 'python3'
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" Tagbar
let g:tagbar_status_func = "TagbarStatusFunc"
let g:tagbar_compact = 1
let g:tagbar_iconchars = [">", ""]
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" MiniBufferExplorer
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" CtrlP
let g:ctrlp_clear_cache_on_exit=0
let g:ctrlp_custom_ignore = {"dir": "\v[\/]\.(git|hg|svn|ve)$"}
let g:ctrlp_status_func = {"main": "CtrlPStatusMain",
\"prog": "CtrlPStatusProg"}
2013-11-22 18:20:32 +01:00