-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
120 lines (103 loc) · 2.8 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 setup (python)
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"Folding
set foldmethod=indent
set foldlevel=99
" Window movements
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
"Tasklists \td
map <leader>td <Plug>TaskList
"Revision history \g
map <leader>g :GundoToggle<CR>
"Syntax highlighting and validation
syntax on
filetype on
filetype plugin indent on
let g:pyflakes_use_quickfix = 0
"PEP8 code consistency \8
let g:pep8_map='<leader>8'
"Python tab completion
au FileType python set omnifunc=pythoncomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
set completeopt=menuone,longest,preview
"Python refactoring
map <leader>j :RopeGotoDefinition<CR>
map <leader>r :RopeRename<CR>
" ex command for toggling hex mode - define mapping if desired
command -bar Hexmode call ToggleHex()
" helper function to toggle hex mode
function ToggleHex()
" hex mode should be considered a read-only operation
" save values for modified and read-only for restoration later,
" and clear the read-only flag for now
let l:modified=&mod
let l:oldreadonly=&readonly
let &readonly=0
let l:oldmodifiable=&modifiable
let &modifiable=1
if !exists("b:editHex") || !b:editHex
" save old options
let b:oldft=&ft
let b:oldbin=&bin
" set new options
setlocal binary " make sure it overrides any textwidth, etc.
let &ft="xxd"
" set status
let b:editHex=1
" switch to hex editor
%!xxd
else
" restore old options
let &ft=b:oldft
if !b:oldbin
setlocal nobinary
endif
" set status
let b:editHex=0
" return to normal editing
%!xxd -r
endif
" restore values for modified and read only state
let &mod=l:modified
let &readonly=l:oldreadonly
let &modifiable=l:oldmodifiable
endfunction
filetype plugin indent on
set nu
"set spell
"set cursorline
"set mouse=a
set ruler
set incsearch
set laststatus=2
set scrolloff=10
if has("gui_running")
set guifont=Mensch\ 10
colorscheme darkblue
endif
function! CurDir()
let curdir = substitute(getcwd(), '/Users/mozes', "~/", "g")
let curdir = substitute(curdir, '/homes/mozes', "~/", "g")
return curdir
endfunction
function! HasPaste()
if &paste
return 'PASTE MODE '
else
return ''
endif
endfunction
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c
if !exists("autocommands_loaded")
let autocommands_loaded = 1
autocmd BufRead,BufNewFile,FileReadPost *.py source ~/.vim/python
endif
" This beauty remembers where you were the last time you edited the file, and returns to the same position.
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
autocmd BufRead *.py inoremap # X<c-h>#
let python_highlight_all = 1