-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdot.vimrc
More file actions
148 lines (113 loc) · 2.91 KB
/
Copy pathdot.vimrc
File metadata and controls
148 lines (113 loc) · 2.91 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
" iMproved
set nocompatible
" numbered lines
set number
" tabs have a width of 4
set softtabstop=4
" display tab characters with a width of 4
set tabstop=4
" indent lines by this width
set shiftwidth=4
" autoindent new line
set autoindent
" round indent
set shiftround
" set incremental search
set incsearch
" do not wrap lines
set nowrap
" allow backspace to delete chars
set bs=2
" insert tabs as spaces
set expandtab
" file type detection and smart indent
filetype plugin indent on
" always show the status line as the second last line
set laststatus=2
" Set line width
set textwidth=80
" Set hilight for search
set hlsearch
" set a sane hilight color
hi Search cterm=NONE ctermfg=black ctermbg=lightblue
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" vundle
if isdirectory(expand('$HOME/.vim/bundle/vundle'))
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" vundle bundles
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/syntastic'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'Lokaltog/powerline'
Bundle 'tpope/vim-surround'
Bundle 'nvie/vim-flake8'
Bundle 'hynek/vim-python-pep8-indent'
" powerline init
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
" syntax
Bundle 'rodjek/vim-puppet'
" syntastic use flake8
let g:syntastic_python_checkers = ['flake8', 'python']
endif
" enable syntax highlighting
syntax on
" case insensitive search
set ignorecase
set smartcase
" clear search highlights
noremap <silent><leader>/ :nohls<cr>
" show column marker
if exists('+colorcolumn')
set colorcolumn=80
highlight ColorColumn ctermbg=235
endif
" directory for swap files
set directory=~/.vim/swap
" Set 256 colors
set t_Co=256
" disable arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" disable home, end, pageup, pagedown
noremap <home> <nop>
noremap <end> <nop>
noremap <pageup> <nop>
noremap <pagedown> <nop>
inoremap <home> <nop>
inoremap <end> <nop>
inoremap <pageup> <nop>
inoremap <pagedown> <nop>
" map jj to escape
inoremap jj <Esc>
" hidden buffers
set hidden
" indent/outdent to nearest tabstops
set shiftround
" Show unbreakable spaces
"set list listchars=nbsp:¬,tab:>-,extends:»,precedes:«,trail:•
set list listchars=nbsp:¬,tab:>-,extends:»,precedes:«