-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
176 lines (158 loc) · 4.09 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
"pathogen
execute pathogen#infect()
call pathogen#incubate()
call pathogen#helptags()
" Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
syntax on
filetype off " required!
set nocompatible " be iMproved
filetype plugin on
filetype plugin indent on
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set dictionary+=/usr/share/dict/words
set incsearch
set ignorecase
set smartcase
set noswapfile
set showcmd
"Setting Font
"Programming Font
set guifont=Fira\ Mono\ 12
colorscheme Monokai
"Code Folding Settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
"My-Bundles
Bundle "jiangmiao/auto-pairs"
Bundle "Rip-Rip/clang_complete"
Bundle "wincent/Command-T"
Bundle "kien/ctrlp.vim"
Bundle "Lokaltog/vim-easymotion"
Bundle "davidhalter/jedi-vim"
Bundle "terryma/vim-multiple-cursors"
Bundle "Shougo/neocomplcache.vim"
Bundle "scrooloose/nerdtree"
Bundle "ervandew/supertab"
Bundle "scrooloose/syntastic"
Bundle "vim-scripts/taglist.vim"
Bundle "aperezdc/vim-template"
Bundle "vim-scripts/tComment"
Bundle "tpope/vim-fugitive"
Bundle "Lokaltog/vim-powerline"
Bundle "tpope/vim-sensible"
Bundle "tpope/vim-surround"
Bundle "Valloric/YouCompleteMe"
Bundle "mrinterweb/vim-visual-surround.git"
Bundle "beyondmarc/opengl.vim"
Bundle "vim-scripts/TwitVim"
Bundle "vim-scripts/a.vim"
Bundle "milkypostman/vim-togglelist"
Bundle "majutsushi/tagbar"
Bundle "sagarrakshe/CoVim"
Bundle "sagarrakshe/ack.vim"
Bundle "honza/vim-snippets"
Bundle "jceb/vim-orgmode"
Bundle "tpope/vim-vinegar"
Bundle "junegunn/goyo.vim"
Bundle "amix/vim-zenroom2"
" change the mapleader from \ to ,
let mapleader=","
"Mapped Keys
map <leader>l :setlocal number!<CR>
map <leader>o :set paste!<CR>
map <C-Tab> gt
map <C-S-Tab> gT
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-h> <C-w>h
map <C-u> <C-w>l
map Q :q!
"Insert Mode Mapping
imap jj <Esc>
inoremap ;<cr> <end>;
inoremap :<cr> <end>:
inoremap <Space><cr> <end><cr>
inoremap <Space><Space><cr> <end>
inoremap ,, <ESC>f"i<Right>,
inoremap ,<cr> <ESC>f'i<Right>,
inoremap )) <ESC>f)i<Right>
inoremap ]] <esc>f]i<right>
" Normal Mode Mapping
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
nmap <silent> <C-D> :NERDTreeToggle<CR>
nmap <F8> :TagbarToggle<CR>
nmap gmail :!vmail<CR>
nmap bash :ConqueTermSplit bash
" nmap <F5> :Errors<CR>
noremap j gj
noremap k gk
noremap <silent> <C-S> : update<CR>
noremap <silent> <C-N> : tabnew<CR>
noremap <silent><F5> : update<CR>
noremap <C-L> :nohl<CR><C-L>
noremap + <C-a>
noremap - <C-x>
nnoremap ; :
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
" Visual Move Mapping
vnoremap ( <ESC>`>a)<ESC>`<i(<ESC>
vnoremap { <ESC>`>a}<ESC>`<i{<ESC>
vnoremap " <ESC>`>a"<ESC>`<i"<ESC>
vnoremap ' <ESC>`>a'<ESC>`<i'<ESC>
vnoremap ) <ESC>`>a)<ESC>`<i(<ESC>
vnoremap } <ESC>`>a}<ESC>`<i{<ESC>
" Command-line Mapping
cnoremap <C-a> <Home>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
cnoremap <C-d> <Delete>
cnoremap <M-b> <S-Left>
cnoremap <M-f> <S-Right>
cnoremap <M-d> <S-right><Delete>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>f <S-Right>
cnoremap <Esc>d <S-right><Delete>
cnoremap <C-g> <C-c>
"Save file as root from vim
cmap W w !sudo tee % >/dev/null
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'
let g:pydiction_location = '/home/sagar/.vim/bundle/Pydiction/complete-dict'
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:jedi#popup_select_first = 0
" mapped <F5> to display error in quickfix window
function! ToggleQuickFix()
if exists("g:qwindow")
lclose
unlet g:qwindow
else
try
Errors
let g:qwindow = 1
catch
echo "No Errors found!"
endtry
endif
endfunction
nmap <script> <silent> <F5> :call ToggleQuickFix()<CR>
function! Myscript()
python<<EOF
import vim
try:
import vlc
vim.current.buffer.append("Math")
except:
vim.current.buffer.append("No Math")
EOF
endfunction