-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
108 lines (84 loc) · 2.59 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
call pathogen#infect()
filetype off
filetype plugin indent on
set nocompatible
set modelines=0
" Spaces not tabs
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set showcmd " Show (partial) command in status line.
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
set mouse=nc " Enable mouse usage (normal and command modes only)
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set number
"set relativenumber
set undodir=~/.vim/undodir
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload
" Use normal regexes for searching
nnoremap / /\v
vnoremap / /\v
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set gdefault " Applies substitutions globally on lines
set showmatch " Show matching brackets.
set incsearch " Incremental search
set hlsearch " Highlight search
" Clear search highlight with \<space>
nnoremap <leader><space> :noh<cr>
" Jump between matching bracket with the tab character
nnoremap <tab> %
vnoremap <tab> %
nnoremap <leader>n :NERDTree<cr>
vnoremap <leader>n :NERDTree<cr>
" Wrap lines
set wrap
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
"Invisible character colors
highlight NonText guifg=#222222
highlight SpecialKey guifg=#222222
" Disable the help key
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" Save when losing focus
au FocusLost * :wa
" Shortcut to trim trailing whitespace
nnoremap <leader>W :%s/\s\+$//g<cr>:let @/=''<CR>
" Shortcut to order css properties
nnoremap <leader>S ?{<CR>jV/^\s*\}?$<CR>k:sort<CR>:noh<CR>
"Code completion
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
if has("gui_running")
set guifont=Monospace\ 8
set background=dark
colorscheme solarized
else
set t_Co=256
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
endif