Skip to content

Commit b8cce86

Browse files
committed
Add "g:pymode_options_*" stuff
1 parent be3ffb8 commit b8cce86

File tree

4 files changed

+95
-21
lines changed

4 files changed

+95
-21
lines changed

Changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
## 2011-10-28 0.3.2
5+
-------------------
6+
* Add 'g:pymode_options_*' stuff, for ability
7+
to disable default pymode options for python buffers
8+
49
## 2011-10-27 0.3.1
510
-------------------
611
* Add 'g:pymode_rope_always_show_complete_menu' option

README.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ Default values: ::
168168
" Auto fix vim python paths if virtualenv enabled
169169
let g:pymode_virtualenv = 1
170170

171-
.. note:: See also :help ropevim.txt
171+
" Set default pymode python indent options
172+
let g:pymode_options_indent = 1
173+
174+
" Set default pymode python fold options
175+
let g:pymode_options_fold = 1
176+
177+
" Set default pymode python other options
178+
let g:pymode_options_other = 1
172179

173180

174181
Default keys
@@ -205,7 +212,7 @@ PyLintToggle Enable, disable pylint
205212
-------------- -------------
206213
PyLint Check current buffer
207214
-------------- -------------
208-
Pyrun Check current buffer
215+
Pyrun Run current buffer in python
209216
============== =============
210217

211218
.. note:: See also :help ropevim.txt

doc/pymode.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ PythonMode. These options should be set in your vimrc.
7272

7373
|'pymode_utils_whitespaces'| Remove unused whitespaces
7474

75+
|'pymode_options_indent'| Set default pymode options for
76+
python indentation
77+
78+
|'pymode_options_fold'| Set default pymode options for
79+
python folding
80+
81+
|'pymode_options_other'| Set default pymode options for
82+
python codding
83+
7584

7685
Note:
7786
Also see |ropevim.txt|
@@ -214,6 +223,49 @@ Default: 1.
214223

215224
Autoremove unused whitespaces
216225

226+
------------------------------------------------------------------------------
227+
*'pymode_options_indent'*
228+
Values: 0 or 1.
229+
Default: 1.
230+
231+
If this option is set to 1, pymode enable next options for python buffers: >
232+
233+
setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class
234+
setlocal cindent
235+
setlocal tabstop=4
236+
setlocal softtabstop=4
237+
setlocal shiftwidth=4
238+
setlocal shiftround
239+
setlocal smartindent
240+
setlocal smarttab
241+
setlocal expandtab
242+
setlocal autoindent
243+
<
244+
------------------------------------------------------------------------------
245+
*'pymode_options_fold'*
246+
Values: 0 or 1.
247+
Default: 1.
248+
249+
If this option is set to 1, pymode enable next options for python buffers: >
250+
251+
setlocal foldlevelstart=99
252+
setlocal foldlevel=99
253+
setlocal foldmethod=indent
254+
<
255+
------------------------------------------------------------------------------
256+
*'pymode_options_other'*
257+
Values: 0 or 1.
258+
Default: 1.
259+
260+
If this option is set to 1, pymode enable next options for python buffers: >
261+
262+
setlocal complete+=t
263+
setlocal formatoptions-=t
264+
setlocal number
265+
setlocal nowrap
266+
setlocal textwidth=80
267+
<
268+
217269

218270
==============================================================================
219271
3. Default Keys ~

ftplugin/python/pymode.vim

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,35 @@ if helpers#SafeVar('b:pymode', 1)
22
finish
33
endif
44

5-
" Python Options
6-
setlocal complete+=t
7-
setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class
8-
setlocal cindent
9-
setlocal foldlevelstart=99
10-
setlocal foldlevel=99
11-
setlocal foldmethod=indent
12-
setlocal formatoptions-=t
13-
setlocal nowrap
14-
setlocal number
15-
setlocal textwidth=80
16-
setlocal tabstop=4
17-
setlocal softtabstop=4
18-
setlocal shiftwidth=4
19-
setlocal shiftround
20-
setlocal smartindent
21-
setlocal smarttab
22-
setlocal expandtab
23-
setlocal autoindent
5+
" Python indent options
6+
if !helpers#SafeVar('g:pymode_options_indent', 1) || g:pymode_options_indent
7+
setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class
8+
setlocal cindent
9+
setlocal tabstop=4
10+
setlocal softtabstop=4
11+
setlocal shiftwidth=4
12+
setlocal shiftround
13+
setlocal smartindent
14+
setlocal smarttab
15+
setlocal expandtab
16+
setlocal autoindent
17+
endif
18+
19+
" Python fold options
20+
if !helpers#SafeVar('g:pymode_options_fold', 1) || g:pymode_options_fold
21+
setlocal foldlevelstart=99
22+
setlocal foldlevel=99
23+
setlocal foldmethod=indent
24+
endif
25+
26+
" Python other options
27+
if !helpers#SafeVar('g:pymode_options_other', 1) || g:pymode_options_other
28+
setlocal complete+=t
29+
setlocal formatoptions-=t
30+
setlocal number
31+
setlocal nowrap
32+
setlocal textwidth=80
33+
endif
2434

2535
" Fix path for project
2636
if g:pymode

0 commit comments

Comments
 (0)