Easy breakpoints and other stuff for python.
This commit is contained in:
parent
254203a3df
commit
170060d491
|
@ -32,11 +32,11 @@ function! ChangePythonLineLength() abort
|
||||||
let &l:colorcolumn = l:line_length + 1
|
let &l:colorcolumn = l:line_length + 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ChangePythonLineLength()
|
" call ChangePythonLineLength()
|
||||||
|
|
||||||
let b:ale_linters = ['flake8']
|
let b:ale_linters = ['flake8']
|
||||||
let b:ale_fixers = [
|
let b:ale_fixers = [
|
||||||
\ 'remove_trailing_lines',
|
\ 'black',
|
||||||
\ 'autopep8',
|
\ 'autopep8',
|
||||||
\ 'yapf',
|
\ 'yapf',
|
||||||
\]
|
\]
|
||||||
|
@ -63,3 +63,21 @@ if !empty(s:virtualenv)
|
||||||
\ . ' ' . ale#Escape(ale#path#Dirname(s:virtualenv) . '/manage.py') . ' test'
|
\ . ' ' . ale#Escape(ale#path#Dirname(s:virtualenv) . '/manage.py') . ' test'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("g:python_debugger")
|
||||||
|
let g:python_debugger = 'ipdb'
|
||||||
|
endif
|
||||||
|
let g:python_debug_line = 'import ' . g:python_debugger . '; ' . g:python_debugger . '.set_trace()'
|
||||||
|
|
||||||
|
function! InsertBreakpoint() abort
|
||||||
|
let l:curr_indent = indent(line("."))
|
||||||
|
let l:line = ''
|
||||||
|
while l:curr_indent > 0
|
||||||
|
let l:line .= ' '
|
||||||
|
let l:curr_indent -= 1
|
||||||
|
endwhile
|
||||||
|
let l:line = l:line . g:python_debug_line
|
||||||
|
:put =l:line
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <leader>d :call InsertBreakpoint()<CR>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user