-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
130 lines (108 loc) · 3.06 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
set nocompatible
"show whitespace characters
set list listchars=tab:»\ ,trail:.,eol:¶,nbsp:·
" makes the gutter show numbering relative to the current line.
set relativenumber
set ruler
set laststatus=2
if has("gui_running")
set guifont=Source_Code_Variable:h8:cDEFAULT
endif
syntax on
filetype off
if has("win32") || has("win16")
set rtp+=~/vimfiles/bundle/Vundle.vim
else
set rtp+=~/.vim/bundle/Vundle.vim
endif
call vundle#begin()
" Plug-in management
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'majutsushi/tagbar'
Plugin 'jeetsukumaran/vim-buffergator'
Plugin 'JavaScript-syntax'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-ragtag'
Plugin 'wellle/targets.vim'
Plugin 'godlygeek/tabular'
if has("gui_running")
Plugin 'altercation/vim-colors-solarized'
endif
call vundle#end()
" ---vundle END---
filetype plugin indent on
" setup for 'scrooloose/nerdtree'
map <Leader>n :NERDTreeToggle<CR>
" setup for 'majutsushi/tagbar'
nnoremap <leader>t :TagbarToggle<CR>
nnoremap <leader>T :TagbarToggle<CR>
" setup for 'jeetsukumaran/vim-buffergator'
let g:buffergator_suppress_keymaps=1
nnoremap <leader>b :BuffergatorOpen<CR>
nnoremap <leader>B :BuffergatorClose<CR>
if has("gui_running")
set background=dark
colorscheme solarized
endif
syntax on
filetype on
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
augroup filetypedetect
autocmd! BufRead,BufNewFile *.class silent setfiletype class
augroup END
" highlight occurrences of word under cursor
autocmd CursorMoved *.{js,java} exe printf('match Search /\V\<%s\>/', escape(expand('<cword>'), '/\'))
" use h/j/k/l like a good boy
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
"make a helpful alias for <ESC>
inoremap jj <ESC>
" get rid of the help key
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
function! WinMove(key)
let t:curwin = winnr()
exec "wincmd ".a:key
if (t:curwin == winnr()) "we havent moved
if (match(a:key,'[jk]')) "were we going up/down
wincmd v
else
wincmd s
endif
exec "wincmd ".a:key
endif
endfunction
"move through windows, and if necessary, create a new one
map <leader>h :call WinMove('h')<cr>
map <leader>k :call WinMove('k')<cr>
map <leader>l :call WinMove('l')<cr>
map <leader>j :call WinMove('j')<cr>
"move windows
map <leader>H :wincmd H<cr>
map <leader>K :wincmd K<cr>
map <leader>L :wincmd L<cr>
map <leader>J :wincmd J<cr>
"close current window
map <leader>wc :wincmd q<cr>
"rotate current window
map <leader>wr <C-W>r
"resize windows using arrow keys
nmap <left> :3wincmd <<cr>
nmap <right> :3wincmd ><cr>
nmap <up> :3wincmd +<cr>
nmap <down> :3wincmd -<cr>
cd ~
if has("win32") || has("win16")
autocmd GUIEnter * simalt ~x
endif