-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
142 lines (109 loc) · 2.55 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
if version >= 700
" Pathogen (http://github.com/tpope/vim-pathogen)
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
endif
" Basics
"filetype off
if has("autocmd")
filetype plugin indent on
endif
set nocompatible
" Security
set modelines=0
" Tabs
set tabstop=4
set shiftwidth=4
set softtabstop=4
set noexpandtab
" Basic options
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest,full
set visualbell
"set cursorline
set ruler
set backspace=indent,eol,start
set laststatus=2
if version >= 730
"set relativenumber
set undofile
endif
" Backups
set backupdir=~/.vim/tmp/backup// " backups
set directory=~/.vim/tmp/swap// " swap files
set backup " enable backups
" Use Perl-style regexp
"nnoremap / /\v
"vnoremap / /\v
" Searching
set ignorecase
set smartcase
set incsearch
set showmatch
set nohlsearch
" Clear search by <leader><space>
nnoremap <leader><space> :let @/=''<cr>
" These would use <tab> instead of % to jump to matching bracket
"nnoremap <tab> %
"vnoremap <tab> %
set wrap
set textwidth=79
set formatoptions=croqln
"set formatoptions=qrn1
"macvim default: croql
" Color Display
colorscheme delek
if version >= 730
set colorcolumn=80
endif
" Custom commands
" Subversion command
com! Commit -nargs=1 !svn ci "%" -m '<args>'
" authorization.conf
:autocmd BufRead authorization.conf noremap <C-M> :w!<CR>:!cp % /Volumes/192.168.1.23/SVN/authorization.conf
" Strip all trailing whitespace
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Re-hardwrap paragraphs of text
nnoremap <leader>q gqip
" Re-selected pasted text
nnoremap <leader>v V`]
" Open .vimrc in split window
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
" Open a new split window
nnoremap <leader>w <C-w>v<C-w>l
" Sudo to write file
cmap w!! w !sudo tee % > /dev/null
" Change to file's directory
"nmap <silent> <leader>cd :cd %:p:h<cr>
" NERD Tree
map <F2> :NERDTreeToggle<cr>
let NERDTreeIgnore=['.vim$', '\~$', '.*\.pyc$']
" Taglist
" Note: May be necessary to override Tlist_Ctags_Cmd to point to a working
" ctags. If so, override the next line in vimrc.local.
" let Tlist_Ctags_Cmd='/usr/local/bin/ctags'
nmap <silent> <F3> :TlistToggle<cr>
" GUI
if has("gui_running")
colorscheme torte
" default macvim: egmrLtT
set guioptions=aermLt
" Set font
if has("macvim")
set guifont=Monaco:h12
elseif has("mac")
set guifont=Monaco:h12
else
" What font to set for Windows or Linux?
endif
" Screen size
set lines=50 columns=120
endif
" Load any local config
runtime vimrc.local