-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
115 lines (88 loc) · 3.16 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
autocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(
filetype plugin indent on
syntax enable
set background=dark
call pathogen#runtime_append_all_bundles()
au FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType java set omnifunc=javacomplete#Complete
"autocmd FileType java set completefunc=javacomplete#CompleteParamsInfo
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
au FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
set completeopt=menuone,longest,preview
let g:SuperTabDefaultCompletionType = "context"
"autocmd FileType java let g:SuperTabDefaultCompletionType = "<C-N>"
let g:SuperTabContextDefaultCompletionType = "<c-n>"
set tags=~/tmp/tags
"Set the leader and change exit from esc to jj
let mapleader = ","
inoremap jj <ESC>
set backspace=indent,eol,start
set nocompatible
set ignorecase
set autoindent
set smartcase
set viminfo='10,\"100,:20,%,n~/.viminfo
"set textwidth=80
set softtabstop=4
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufNewFile,BufRead *.conf set ft=javascript
autocmd BufNewFile,BufRead *.config set ft=javascript
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=4
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
au BufRead,BufNewFile *.conf set shiftwidth=2
au BufRead,BufNewFile *.py,*.pyw set expandtab
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
" Nearest source control ancestor
let g:ctrlp_working_path_mode=2
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
:set laststatus=2
nmap <silent> <C-f> :CommandTFlush<CR>
nmap <C-k> D
nmap <C-y> p
nnoremap ; :
"Carriage Return to toggle between files in window
nnoremap <CR> :wa<CR><C-^>
"reformats and saves json file if you have json_reformat installed
map <leader>j <Esc>:%!json_reformat <CR>
"delete a word and insert
nnoremap di dwi
"Saving and quiting short-cuts
nnoremap <leader>w :w<CR>
nnoremap <leader>wq :wq<CR>
nnoremap <leader>q :q<CR>
nnoremap <leader>qq :q!<CR>
nnoremap <leader>p :set paste<CR>
nnoremap <leader>np :set nopaste<CR>
"hl search highlights as you search
set hlsearch
nnoremap <leader>k :nohlsearch<CR>
nnoremap <leader>c <leader>c<space>
" Folding set up
"set foldmethod=indent
"set nofoldenable
nnoremap <leader>l zR
nnoremap <leader>m zM
" Execute file being edited with <Shift> + e:
nnoremap <S-e> :w<CR>:!/opt/py27/bin/python %:p
nnoremap <S-e>v :w<CR>:!/opt/py27/bin/python %:p --verbose
nnoremap <leader>f :CommandTFlush<CR>
" remap the nerdcommenter toggle to just leader c
nnoremap <leader>a :Ack
nnoremap <F5> :GundoToggle<CR>
"Easier splits navigation - Remapped Caps Lock to Control
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <C-t> <C-w>l
nnoremap <leader>v <C-w>v<C-w>l
nnoremap <leader>d <C-w>-
nnoremap <leader>< <C-w><
nnoremap <leader>> <C-w>>
nnoremap <leader>k <C-w>+
nnoremap <leader>h :split<CR>
let g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict'