-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
174 lines (128 loc) · 4.45 KB
/
vimrc
File metadata and controls
174 lines (128 loc) · 4.45 KB
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
" ############# OmniCppComplete ###############
" This activates OmniCppComplete
:filetype plugin on
set nocp
filetype plugin on
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview
" configure tags - add additional tags here or comment out not-used ones
set tags+=~/.vim/tags/cpp
set tags+=~/.vim/tags/latex
"set tags+=~/.vim/tags/sdl
"set tags+=~/.vim/tags/qt4
" build tags of your own project with Ctrl-F12
" p
map <C-F12> :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
command LatexTags !ctags -R --sort=yes --latex-kinds=+p --fields=+iaS --extra=+q .<CR>
" ############## VUNDLE #######################
" Vundle - Install using git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
Bundle 'refactor'
" My Bundles here:
" original repos on github
" Bundle 'tpope/vim-fugitive'
" Bundle 'Lokaltog/vim-easymotion'
Bundle 'scrooloose/nerdtree'
"Bundle 'quark-zju/vim-cpp-auto-include'
Bundle 'jcf/vim-latex'
" Bundle 'yandy/vim-omnicppcomplete'
" Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" Bundle 'tpope/vim-rails.git'
" Bundle 'joonty/vim-phpqa'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'xolox/vim-session'
"Bundle 'FindFile'
" Bundle 'project.tar.gz'
" non github repos
" Bundle 'git://git.wincent.com/command-t.git'
" " ...
"
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve)removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
" ##################### LATEX
let g:Tex_DefaultTargetFormat='pdf'
" ############## PERSONAL ################
" " Makes .h files use cpp syntax
autocmd FileType *.h setlocal ft=cpp
autocmd BufNewFile,BufReadPost *.h,*.ino,*.pde set filetype=cpp"
map <F3> :wa<CR>:make<CR>
map <C-F3> :wa<CR>:chdir ../<CR>:make<CR>
noremap æ [
noremap ø ]
map ø <C-]>
inoremap <C-S> <Esc>:wa<CR>
nnoremap <C-S> :wa<CR>
map ½ $
imap ½ $
set showcmd
set number
" Following is from http://stackoverflow.com/questions/1445992/vim-file-navigation
" Window movements; I do this often enough to warrant using up M-arrows on this"
nnoremap <M-Right> <C-W><Right>
nnoremap <M-Left> <C-W><Left>
nnoremap <M-Up> <C-W><Up>
nnoremap <M-Down> <C-W><Down>
" Open window below instead of above"
nnoremap <C-W>N :let sb=&sb<BAR>set sb<BAR>new<BAR>let &sb=sb<CR>
" Vertical equivalent of C-w-n and C-w-N"
nnoremap <C-w>v :vnew<CR>
nnoremap <C-w>V :let spr=&spr<BAR>set nospr<BAR>vnew<BAR>let &spr=spr<CR>
" I open new windows to warrant using up C-M-arrows on this"
nmap <C-M-Up> <C-w>n
nmap <C-M-Down> <C-w>N
nmap <C-M-Right> <C-w>v
nmap <C-M-Left> <C-w>V
map <F2> mrgg=G'r
"Put these in an autocmd group, so that we can delete them easily.
"augroup vimrcEx
"au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
"augroup END
" ### FOLDING ###
set foldmethod=syntax
set foldnestmax=3
set foldlevel=1000
command Vimrc execute "e ~/.vimrc"
colorscheme jellybeans
" ###### CPPP AUTO COMPLETE #######
" autocmd BufWritePre /home/pseudo/repos/sw802f13/code/*/**.cpp :ruby CppAutoInclude::process
" #### indentation ####
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab