Skip to content

Commit

Permalink
Add option for scratch buffer config (fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
martingms committed Mar 16, 2018
1 parent f4568b4 commit e2f5393
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ let g:vipsql_shell_prompt = "> "
" What `vim` command to use when opening the scratch buffer
let g:vipsql_new_buffer_cmd = "rightbelow split"
" Commands executed after opening the scratch buffer
" Chain multiple commands together with `|` like so:
" "setlocal buftype=nofile | setlocal nowrap"
let g:vipsql_new_buffer_config = 'setlocal buftype=nofile'
" Whether or not the vipsql-buffer should automatically scroll to the bottom
" on new input.
let g:vipsql_auto_scroll_enabled = 1
Expand Down
6 changes: 5 additions & 1 deletion plugin/vipsql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if !exists('g:vipsql_new_buffer_cmd')
let g:vipsql_new_buffer_cmd = 'rightbelow split'
end

if !exists('g:vipsql_new_buffer_config')
let g:vipsql_new_buffer_config = 'setlocal buftype=nofile'
end

if !exists('g:vipsql_log_prefix')
let g:vipsql_log_prefix = 'vipsql: '
end
Expand Down Expand Up @@ -154,7 +158,7 @@ function! s:NewBuffer(name)
" Splits a new buffer from current with given name, goes back to calling
" buffer and returns bufnr.
exec g:vipsql_new_buffer_cmd . ' ' . a:name
setlocal buftype=nofile
exec g:vipsql_new_buffer_config

let new_bufnr = bufnr('%')

Expand Down

0 comments on commit e2f5393

Please sign in to comment.