forked from icalvete/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
102 lines (87 loc) · 2.35 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
"
" The first time run:
"
" git clone https://github.com/gmarik/vundle.git ~/dotfiles/vim/bundle/vundle
" vim -u ~/dotfiles/bundles.vim +BundleInstall +q
"
source ~/dotfiles/bundles.vim
syntax on
set hlsearch
set incsearch
set number
set cursorline
set ruler
set ai
set si
set backspace=indent,eol,start
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
runtime! macros/matchit.vi
"colorscheme vibrantink
colorscheme vividchalk
"colorscheme solarized
"set background=dark
"colorscheme codeschool
" Mappings
let mapleader = ","
nmap <Leader>. <C-w>w
:map <C-d> :NERDTreeToggle<CR>
" Highlight on/off
map <F2> :set hls!<CR><Bar>:echo "HLSearch: " . strpart("OffOn", 3 * &hlsearch, 3)<CR>
map! <F2> <ESC><F2>i"
" Number lines on/off
map <F3> :set number!<CR>
map! <F3> <ESC><F3> i
" Make trailing space visible
map <F4> :set hls<CR>/\s\+$<CR>
map! <F4> <ESC><F4>i"
inoremap <M-o> <Esc>o
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
let g:ragtag_global_maps=1
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_signs=1
let g:Powerline_symbols='fancy'
" first, enable status line always
set laststatus=2
set noshowmode
set encoding=utf-8
set t_Co=256
" Return the syntax highlight group under the cursor ''
function! StatuslineCurrentHighlight()
let name = synIDattr(synID(line('.'),col('.'),1),'name')
if name == ''
return ''
else
return '[' . name . ']'
endif
endfunction
function! InitializeDirectories()
let separator = "."
let parent = $HOME
let prefix = '.vim'
let dir_list = {
\ 'backup': 'backupdir',
\ 'views': 'viewdir',
\ 'swap': 'directory' }
if has('persistent_undo')
let dir_list['undo'] = 'undodir'
endif
for [dirname, settingname] in items(dir_list)
let directory = parent . '/' . prefix . dirname . "/"
if exists("*mkdir")
if !isdirectory(directory)
call mkdir(directory)
endif
endif
if !isdirectory(directory)
echo "Warning: Unable to create backup directory: " . directory
echo "Try: mkdir -p " . directory
else
let directory = substitute(directory, " ", "\\\\ ", "g")
exec "set " . settingname . "=" . directory
endif
endfor
endfunction
call InitializeDirectories()