-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
142 lines (112 loc) · 2.91 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
" ------------------------
" pathogen settings
" ------------------------
execute pathogen#infect()
Helptags
" assoc drupal files to php
if has("autocmd")
augroup module
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.test set filetype=php
autocmd BufRead,BufNewFile *.inc set filetype=php
autocmd BufRead,BufNewFile *.profile set filetype=php
autocmd BufRead,BufNewFile *.view set filetype=php
augroup END
endif
" php completion and settings
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP
let php_sql_query=1
let php_htmlInStrings=1
set t_Co=256
syntax enable
let g:solarized_termcolors=256
set background=light
colorscheme solarized
" colorscheme distinguished
" colorscheme zenburn
filetype plugin indent on
" ------------------------
" options
" ------------------------
" disable old vi backward compatibily stuff
set nocompatible
" prevent security leaks
set modelines=0
" always show current mode
set showmode
" always show entered commands
set showcmd
" tab settings
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" better case sensitive search
set ignorecase
set smartcase
" show relative line numbers
set relativenumber
set number
" enable auto indent
set autoindent
" better command line completion
set wildmenu
" visualbell instead of beeping
set visualbell
" visual helping finding cursor
set cursorline
" improve smoothness
set ttyfast
" handle long lines correctly
set wrap
set textwidth=80
set formatoptions=qrn1
set colorcolumn=81
" reduce delay on esc
set timeoutlen=200
" ------------------------
" key mapping
" ------------------------
" disable arrow keys in all modes
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
" use jk in autocompletion box
inoremap <expr> j ((pumvisible())?("\<C-n>"):("j"))
inoremap <expr> k ((pumvisible())?("\<C-p>"):("k"))
" NERDTree Toggle
nmap <C-n> :NERDTreeTabsToggle<CR>
" Tagbar Toggle
nmap <C-y> :TagbarToggle<CR>
" Natural Window Movement
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" ------------------------
" Different Cursor Shapes depending on Current Mode
" ------------------------
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Super Tab Settings
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
let g:SuperTabClosePreviewOnPopupClose = 1
" NERDTree Settings
let g:NERDTreeShowHidden=1
" Tagbar Settings
let g:tagbar_width = 55
" CtrlP Settings
:let g:ctrlp_max_files=0