forked from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
102 lines (73 loc) · 1.72 KB
/
vimrc
File metadata and controls
102 lines (73 loc) · 1.72 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
set nocompatible " not vi compatible
"--------------
"" Load pathogen
"--------------
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
source ~/.vim/bundle/a.vim
filetype plugin indent on
set number
set tags+=/usr/local/share/ctags/qt4
set mouse=a
let mapleader=","
let maplocalleader=","
filetype indent on
set shiftwidth=4
set ts=4
set expandtab
set splitright
set pastetoggle=<F2>
set hlsearch
" fast escape
inoremap jk <esc>
" uppercase word
inoremap <c-u> <esc>vbU
" switch between .h/.cpp
nnoremap <leader>a :A<CR>
" tab complete
inoremap <tab> <c-n>
"
""------------------
" Syntax and indent
" "------------------
syntax on " turn on syntax highlighting
set showmatch " show matching braces when text indicator is over them
set number " line numbers
vmap <Left> <gv
vmap <Right> <gv
color desert
" vimrc controls
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" switch between .h/.cpp
nnoremap <leader>a :A<CR>
" fast split screen navigation
nnoremap <c-w><c-w> iNOPENOPENOPENOPE<esc>
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>
" fast make
nnoremap <leader>m :wa<cr> :Make<cr>
nnoremap <leader>mm :wa<cr> :make -j12<cr>
nnoremap <leader>mc :wa<cr> :make check -j12<cr>
" swap lines
nnoremap _ ddkP
nnoremap - ddp
" operator parens, brackets, quotes
onoremap p i(
" fast semicolon
nnoremap <leader>; mqA;<esc>`q
map <C-n> :NERDTreeToggle<cr>
nnoremap <leader>C :call ColorToggle()<cr>
let g:desert_on = 1
function! ColorToggle()
if g:desert_on
color delek
let g:desert_on = 0
else
color desert
let g:desert_on = 1
endif
endfunction