Skip to content

Instantly share code, notes, and snippets.

@phaberest
Created May 16, 2015 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaberest/b0eab03e83db8fd7dc01 to your computer and use it in GitHub Desktop.
Save phaberest/b0eab03e83db8fd7dc01 to your computer and use it in GitHub Desktop.
My vim config
" GENERALE
set backup " Permette i backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
call pathogen#infect() " use pathogen
"call pathogen#runtime_append_all_bundles() " use pathogen
colorscheme badwolf " https://github.com/sjl/badwolf/
syntax enable " enable syntax processing
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
" UI
set mouse=a " Impedisce la copia dei numeri in selezione
" Set this to the name of your terminal that supports mouse codes.
" Must be one of: xterm, xterm2, netterm, dec, jsbterm, pterm
set ttymouse=xterm2
set number " show line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
filetype indent on " load filetype-specific indent files
set wildmenu " visual autocomplete for command menu
" This is a pretty cool feature I didn't know Vim had.
" You know how Vim automatically autocompletes things
" like filenames when you, for instance, run :e ~/.vim<TAB> ?
" Well it will provide a graphical menu of all the matches
" you can cycle through if you turn on wildmenu.
set lazyredraw " redraw only when we need to.
set showmatch " highlight matching [{()}]
" SEARCH
set incsearch " search as characters are entered
set hlsearch " highlight matches
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
" MOVIMENTI
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move to beginning/end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
" highlight last inserted text
nnoremap gV `[v`]
" It visually selects the block of characters you added last
" time you were in INSERT mode.
let mapleader="," " leader is comma
" jk is escape (premuti contemporaneamente)
inoremap jk <esc>
" toggle gundo
nnoremap <leader>u :GundoToggle<CR>
" Serve gundo.vim https://github.com/sjl/gundo.vim.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment