Coder Social home page Coder Social logo

evanthegrayt / vim-lovehandle Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 30 KB

🫶 A DadBod extension that helps switch database URLs by calling user-defined handles. Also handles setting DB URLs for SQL files based on file name.

License: MIT License

Vim Script 100.00%
dadbod database db plugin sql vim vim-dadbod vim-plugin

vim-lovehandle's Introduction

vim-lovehandle's People

Contributors

evanthegrayt avatar

Watchers

 avatar

vim-lovehandle's Issues

Ability to auto-init on DirChanged

Currently, you have to call :LHReload every time you change directories. There should be an option to enable auto-loading, probably on the DirChanged event.

Also, add documentation about :LHReload to readme so users can create their own autocmd.

Add rest of adapter generators

When generating the sql file contents, only postgres and mysql are supported. This should be easy; mariadb, for example, is the same syntax as mysql

show tables

describe users

Provide alternatives to set exrc

I've personally switched away from set exrc secure, and instead, I use this script.

augroup local_vimrc
  autocmd!
  autocmd VimEnter,BufRead *
        \ if s:should_load_local_vimrc() |
        \   source .vimrc |
        \   let g:projects_with_vimrc = 1 |
        \ endif
augroup END

function! s:should_load_local_vimrc() abort
  let l:projects_with_vimrc = ['project_directory'] " Obviously, set real directories.
  return index(l:ps_projects, fnamemodify(getcwd(), ':t')) >= 0 &&
        \   filereadable(".vimrc") &&
        \   get(g:, 'project_vimrc_sourced', 0) == 0
endfunction

You could also just set the g:lovehandle_list from this autocmd, but I keep my vimrc public and don't want DB info in there.

Consider changing commands to start with DB

LHList -> DBList, etc.

I initially went with LH to fit the name of the plugin, but in practice, it's unnecessarily convoluted. It extends dadbod, so it should be similar to its command. Not to mention, it's much easier to type.

I'm not 100% sure of this change though; comments are welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.