kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.54k stars 94 forks source link

feat(ui): customize dbout winheight #179

Closed namnd closed 1 year ago

namnd commented 1 year ago

Often the time, the query result is big. It would be nice if we can customize the window height of the dbout buffer

kristijanhusak commented 1 year ago

Thanks for the PR. The idea is good, but this is just a simple autocmd that you can easily add to your config since it's filetype specific. There's no need to have it configurable through the plugin.

andres-lowrie commented 8 months ago

In case anyone finds this from a web search, here's how you can add write the autocmd if you're using neovim:

  {
    'kristijanhusak/vim-dadbod-ui',
    dependencies = {
      { 'tpope/vim-dadbod',                     lazy = true },
      { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true },
    },
    cmd = {
      'DBUI',
      'DBUIToggle',
      'DBUIAddConnection',
      'DBUIFindBuffer',
    },
    config = function()
      vim.api.nvim_create_autocmd({ "BufReadPost" }, {
        pattern = { "*.dbout" },
        callback = function()
          vim.api.nvim_exec2([[
          exe ':resize 40'
          ]], {})
        end
      })
    end,
    init = function()
      -- DBUI configuration
    end,
  },