Git Product home page Git Product logo

dash.nvim's Introduction

Hi there, I'm Mat ๐Ÿ‘‹

I'm a software engineer, passionate about digital privacy, clean code, and dark themes ๐Ÿ˜Ž

Iโ€™m a Certified Scrum Master and currently working as a developer at 1Password. I'm an automation enthusiast, Neovim user, shell power-user, and I love my pets.

My favorite programming languages currently are Rust, Lua, and Nix. I like making Neovim plugins, command line tools, and other developer tools.

dash.nvim's People

Contributors

knpwrs avatar mrjones2014 avatar xomute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dash.nvim's Issues

Previews?

Is it possible to enable previews? Might only be possible in GUI vim since the docs are HTML documents.

Error on startup in macOS: module 'libdash_nvim' not found

The plugin was working at earlier points but since recent updates it stopped working. On the latest master as of today (791281f) and NVIM v0.6.0-dev+1984-g09e96fe60:

Error detected while processing $HOME/.dotfiles/vim/plugged/dash.nvim/plugin/dash.vim:
line   16:
E5108: Error executing lua 
$HOME/.vim/plugged/dash.nvim/lua/dash/config.lua:6: module 'libdash_nvim' not found:
        no field package.preload['libdash_nvim']
        no file './libdash_nvim.lua'
        no file '/usr/local/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/libdash_nvim.lua'
        no file '/usr/local/share/lua/5.1/libdash_nvim.lua'
        no file '/usr/local/share/lua/5.1/libdash_nvim/init.lua'
        no file '/usr/local/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/libdash_nvim.lua'
        no file '/usr/local/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/libdash_nvim/init.lua'
        no file './libdash_nvim.so'
        no file '/usr/local/lib/lua/5.1/libdash_nvim.so'
        no file '/usr/local/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/libdash_nvim.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

Environments: Mac OS 11.6, x86_64 (Intel)

This is because the prebuilt binary is only provided as *.so shared module; macOS would require *.dylib.

I think recent changes on the bin/ structure broke the plugin. (commit dfd928c, since v0.4.0)

Feature Request: Docs for word under cursor

I'm coming from dash.vim, which has a feature to search for the word under the cursor. (Optionally?) Having the telescope window auto-populate with that word would be helpful.

However, I found that this didn't always work as well as one would like, because the method searched could sometimes belong to quite a few different types of classes. For example, open in Ruby, which in Dash gives results for 36 objects. So my dream feature would be to use the LSP and/or Treesitter to lookup the docs for the method on the correct object type. In other words, var_that_is_a_tempfile.[o]pen (with the cursor on the o) would open the docs for specifically Tempfile.open.

Packer - Failed to install - git timeout, and no post install hook

Installing with packer with use({ 'mrjones2014/dash.nvim', requires = { 'nvim-telescope/telescope.nvim' }, run = 'make install' }), I get a "Failed to install" when running a PackerSync. Thereafter, I get "module "libdash_nvim" not found, did you set up Dash.nvim with make install as a post-install hook?"

Debugging a bit, I found two things:

  1. Git times out frequently: ...m/site/pack/packer/start/packer.nvim/lua/packer/jobs.lua:87: Killing git due to timeout!. Now, the connection I'm on is a little weak, but it still downloaded from github at ~500kb/s. I worked around this for now by increasing timeout to 120s (from 60s). None of my other plugins needed this, though...
  2. Having worked around that, the post install hook doesn't seem to run? After the packer sync, I guess it tries to load the module, because the debug log shows "Vim(lua):module "libdash_nvim" not found, did you set up Dash.nvim with make install as a post-install hook? See :h dash-install". So maybe that failing is preventing the hook from executing?

I solved the problem for now by cding to the dash dir and running make install manually.

Offload query building to the Rust backend

Right now the query building based on the buffer type happens in the telescope utils file. In order to support other fuzzy finders (see #25) we should offload that to the backend and make the Rust code responsible for building the query based on the filetype.

Most likely this requires putting the config module in the backend as well.

Fall back to google / stack overflow search, like Dash app?

In the case a search doesn't come up with anything, it would be nice if there would be a search the web fallback, like the Dash app has, so I don't have to go open my browser and type the same thing in again.

Awesome idea and execution by the way, this has sped me up so much, especially when working with a language I'm not too familiar with. Love it. Thank you ๐Ÿ™

Allow a way to do a one-off search without keywords

For example, in a typescript file, it will search with typescript keywords. But there should also be a way to do a search with no keywords. Possibly something like :Dash all or :Dash false or something. Not sure exactly how it should work.

Feature Request: Dash <args>

Feature request: It would be good to have :Dash <query> (e.g., :Dash blah blah) for a command that launches the telescope window with <query> as a initial query (like :DashWord).

Expand ~ in `dashAppPath` when calling `setup()`

When we call require('dash').setup({ dashAppPath = '~/Applications/Dash.app' }) we should expand the ~. Currently I don't think it gets expanded so you need to use os.getenv('HOME') instead of ~.

Experiment with exposing a Lua API directly from the Rust backend

There's a few different crates to support Lua bindings in Rust

We should experiment with writing a Lua API directly embedded into the Rust backend. This will likely be a lot faster than running it via the CLI with plenary.

Basically, the Rust backend should expose a single function, require('dash-backend').query({ dash_app_path = "/Applications/Dash.app", query1, query2, ... }) and return a Lua table directly, instead of outputting JSON on the command line.

Results sometimes wrongly return empty

I've got the React docset installed, and some searches work perfectly:

Screen Shot 2021-10-25 at 7 29 19 PM

But other searches return nothing:
Screen Shot 2021-10-25 at 7 29 46 PM

Compare the above to the Dash app results:

Screen Shot 2021-10-25 at 7 30 12 PM

I've looked briefly into how the query thing works and it looks like it calls "/Applications/Dash.app/Contents/Resources/dashAlfredWorkflow" with the query, I can confirm that it returns some results, here's what gets returned:

https://gist.github.com/marcusbuffett/b3490d47696c7240d3f77daa03aae245

Let me know if there's any debug info that could be useful.

Move `lua/dash/query-builder.lua` to the Rust backend

Instead of passing the full list of queries to the backend, we should be able to just pass the current file type, the prompt, and whether it was triggered with the bang (!).

This might require moving the config itself into the Rust code as well, but I'm not sure if/how that will work.

FZF/fzf-lua support (or generic datasource provider for other pickers)

Love this! I imagine that since you don't use fzf-lua you'd likely not want to spend time adding support. I haven't dove deep into this repo yet, so forgive me if this already exists.. would you be willing to add some sort of provider so that other pickers might be used?

Thanks!

(PS. I'd be interested in adding fzf-lua support if you were up for having that added)

consolidate constants

we have 2 constants files. now that rust lua module is working we should only have 1

Remove `ftdetect` files

The only one in there currently is handlebars filetype detection. If someone is using Handlebars, chances are they're also using a plugin for it, and filetype detection shouldn't be a concern of this plugin.

convert to snake_case

It seems in the Lua world, pretty much everything uses snake_case. Let's migrate everything from being camelCase to snake_case.

More intelligent `:DashWord` using LSP or TreeSitter

Original request from #26

my dream feature would be to use the LSP and/or Treesitter to lookup the docs for the method on the correct object type. In other words, var_that_is_a_tempfile.[o]pen (with the cursor on the o) would open the docs for specifically Tempfile.open.

I'm not sure how we'd implement this but I think it might be possible via LSP info or TreeSitter.

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.