-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
120 lines (102 loc) · 3.82 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
"" Pathogen
filetype off
call pathogen#infect()
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"" expand % matching
runtime macros/matchit.vim
"" normal options
set nocompatible " chose no compatibility with legacy vi
syntax enable " syntax highlighting on
set encoding=utf-8
set showcmd " display incomplete commands
filetype on " try to defect filetypes
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
set backspace=indent,eol,start " backspace through everyting in insert mode
au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
"" french keyboard settings
let mapleader = "ù"
"" Code folding
set foldmethod=indent
set foldlevel=99
""" comment and uncomment
"vnoremap # :s#^#\##<cr>
"vnoremap -# :s#^\###<cr>
"" moving around windows without ctrl + w first
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
"" task lists
map <leader>td <Plug>TaskList
"" revision history
map <leader>g :GundoToggle<CR>
"" syntax highlight and validation
" let g:pyflakes_use_quickfix = 0 " do not use the quickfix window
let g:pep8_map='<leader>8' " pep8 validation
"" tab completion and documentation [supertab]
au FileType python set omnifunc=pythoncomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
set completeopt=menuone,longest,preview
"" code navigation [file browser]
map <leader>n :NERDTreeToggle<CR>
"" [refactoring and go to definition]
map <leader>j :RopeGotoDefinition<CR>
map <leader>r :RopeRename<CR>
"" searching
nmap <leader>a <Esc>:Ack!
"" Git integration
set statusline=%{fugitive#statusline()}
"" test integration with makegreen (need to personalize)
map <leader>dt :set makeprg=python\ manage.py\ test\|:call MakeGreen()<CR>
"" [pytest], more complete than MakeGreen but MakeGreen should be enough here.
" Execute the tests
" nmap <silent><Leader>tf <Esc>:Pytest file<CR>
" nmap <silent><Leader>tc <Esc>:Pytest class<CR>
" nmap <silent><Leader>tm <Esc>:Pytest method<CR>
" cycle through test errors
" nmap <silent><Leader>tn <Esc>:Pytest next<CR>
" nmap <silent><Leader>tp <Esc>:Pytest previous<CR>
" nmap <silent><Leader>te <Esc>:Pytest error<CR>
""virtual environment support
" Add the virtualenv's site-packages to vim path
"py << EOF
"import os.path
"import sys
"import vim
"if 'VIRTUAL_ENV' in os.environ:
" project_base_dir = os.environ['VIRTUAL_ENV']
" sys.path.insert(0, project_base_dir)
" activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
" execfile(activate_this, dict(__file__=activate_this))
"EOF
" IMPORTANT: Uncomment one of the following lines to force
" using 256 colors (or 88 colors) if your terminal supports it,
" but does not automatically use 256 colors by default.
"set t_Co=256
"set t_Co=88
let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : '' }
colorscheme xoria256
" Make Vim recognize XTerm escape sequences for Page and Arrow
" " keys combined with modifiers such as Shift, Control, and Alt.
" " See http://www.reddit.com/r/vim/comments/1a29vk/_/c8tze8p
if &term =~ '^screen'
" Page keys http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ
execute "set t_kP=\e[5;*~"
execute "set t_kN=\e[6;*~"
" Arrow keys http://unix.stackexchange.com/a/34723
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" aboverequires a .tmux.conf
" setw -g xterm-keys on
" set -g default-terminal 'screen-256color'