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 | set nocompatible
syntax on
" Vundle magic
let hasVundle = 1
if !filereadable(expand('~/.vim/bundle/Vundle.vim/README.md'))
echo "Installing Vundle\n"
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
let hasVundle = 0
endif
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'ervandew/supertab'
Plugin 'google/vim-searchindex'
Plugin 'jiangmiao/auto-pairs'
Plugin 'rakr/vim-one'
Plugin 'rbgrouleff/bclose.vim'
Plugin 'roblillack/vim-bufferlist'
Plugin 'scrooloose/syntastic'
Plugin 'vim-scripts/indentpython.vim'
if hasVundle == 0
:PluginInstall
end
call vundle#end()
filetype plugin indent on
" Line & column numbers
set number
set ruler
" Indentation & co.
set autoindent
set expandtab
au BufNewFile,BufRead *.py
\ set autoindent |
\ set colorcolumn=80 |
\ set expandtab |
\ set fileformat=unix |
\ set filetype=python |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set tabstop=4 |
" UTF8 or die
set encoding=utf8
" Show trailing whitespaces and tabs
set list lcs=trail:·,tab:»·
" Color scheme & font
set background=dark
colorscheme one
set gfn=Hack:h12 " Inconsolata:h14
" Misc
let g:SuperTabDefaultCompletionType = "<c-n>"
let g:SuperTabLongestHighlight = 1
set clipboard=unnamed " Enable clipboard features
set complete-=i
set hlsearch " Highlight search results
set mouse=a " Enable mouse features
set whichwrap+=<,>,h,l,[,] " Go to previous/next line when at end of line
set wildignore+=aws/*,logs/*,*.so,*.swp,*/tmp/*,*virtualenv*,*.zip
" Key bindings
nmap <C-k> :call BufferList()<CR>
nmap <C-b> :Bclose<CR>
nmap <C-p> :CtrlP .<CR>
cabbrev cws %s/\s\+$//e " Clear whitespaces
command! W w
" Allow Shift+Arrow text selection
nmap <S-Up> v<Up>
nmap <S-Down> v<Down>
nmap <S-Left> v<Left>
nmap <S-Right> v<Right>
vmap <S-Up> <Up>
vmap <S-Down> <Down>
vmap <S-Left> <Left>
vmap <S-Right> <Right>
imap <S-Up> <ESC>v<Up>
imap <S-Down> <ESC>v<Down>
imap <S-Left> <ESC>v<Left>
imap <S-Right> <ESC>v<Right>
if has("gui_macvim")
" Do not show scrollbars
set guioptions-=l
set guioptions-=r
" Allow tabs navigation
nmap <C-Tab> :tabnext<CR>
nmap <C-S-Tab> :tabprev<CR>
imap <C-Tab> <ESC>:tabnext<CR>
imap <C-S-Tab> <ESC>:tabprev<CR>
endif
|