Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quickfix location #26

Merged
merged 2 commits into from May 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.mdown
Expand Up @@ -54,6 +54,9 @@ To customize the location of your flake8 binary, set `g:flake8_cmd`:

let g:flake8_cmd="/opt/strangebin/flake8000"

To customize the location of quick fix window, set `g:flake8_quickfix_location`:

let g:flake8_quickfix_location="topleft"

Tips
----
Expand Down
8 changes: 7 additions & 1 deletion ftplugin/python_flake8.vim
Expand Up @@ -61,6 +61,12 @@ if !exists("*Flake8()")
let s:flake8_max_complexity=""
endif

if exists("g:flake8_quickfix_location")
let s:flake8_quickfix_location=g:flake8_quickfix_location
else
let s:flake8_quickfix_location="belowright"
endif

" perform the grep itself
let &grepformat="%f:%l:%c: %m\,%f:%l: %m"
let &grepprg=s:flake8_cmd.s:flake8_builtins_opt.s:flake8_ignores.s:flake8_max_line_length.s:flake8_max_complexity
Expand All @@ -73,7 +79,7 @@ if !exists("*Flake8()")
" open cwindow
let has_results=getqflist() != []
if has_results
execute 'belowright copen'
execute s:flake8_quickfix_location." copen"
setlocal wrap
nnoremap <buffer> <silent> c :cclose<CR>
nnoremap <buffer> <silent> q :cclose<CR>
Expand Down