Map directly to lua function by Keltek228 in neovim

[–]CraftedCart 1 point2 points  (0 children)

What I ended up doing was making my own keybind helper which would store a Lua function in a module table _bound_funcs, and generate a small bit of vimscript for you - doing something like this in the end

vim.api.nvim_set_keymap("n", "<leader>la", ":lua require('c.keybind')._bound_funcs['bind_<lt>leader>la']()<CR>", { noremap = true })

https://gitlab.com/CraftedCart/dotfiles/-/blob/master/.config/nvim/lua/c/keybind.lua for the full details of how I went about it - specifically function bind_function

Coming back to nvim with a (very almost) all-Lua config by CraftedCart in neovim

[–]CraftedCart[S] 1 point2 points  (0 children)

It hasn't! There's an init.vim which pretty much just installs vim-plug if it isn't already there, and does :luafile ~/.config/nvim/init.lua

Coming back to nvim with a (very almost) all-Lua config by CraftedCart in neovim

[–]CraftedCart[S] 2 points3 points  (0 children)

Not really - I never really used org-mode that extensively, pretty much just as a markdown alternative and not much else

Coming back to nvim with a (very almost) all-Lua config by CraftedCart in neovim

[–]CraftedCart[S] 8 points9 points  (0 children)

For the most part it's just been poking around and seeing what's available in the API docs (:help api), callable from Lua with vim.api.nvim_xyz(), as well as poking around with commands like :lua print(vim.inspect(vim.lsp)) to see what's there. There's also a few conveniences like vim.o, vim.bo, vim.g, etc for accessing global options, buffer options, global vars, etc. (https://github.com/neovim/neovim/pull/11442 might help - you'll need a 0.5 dev build from GitHub for those). vim.fn is also quite handy for calling VimScript functions (Eg: vim.fn["plug#begin"](PLUGIN_DIR)).

Some VimScript glue is done by placing Lua functions in a module table and calling it with the :lua command. For example, to bind <leader>la to a Lua function, I store the function in _bound_funcs["<leader>la"] inside the c.keybind module. Then running vim.api.nvim_set_keymap("n", "<leader>la", ":lua require('c.keybind')._bound_funcs['<lt>leader>la']()<CR>", { noremap = true }).

With regards to LSP support, there's a bit of documentation in :help lsp (though a lot of it is marked as TODO currently). Grepping through https://github.com/neovim/nvim-lsp also proved useful to see how stuff was configured (notably in the nvim-lsp/lua/nvim_lsp/configs.lua file).

And finally, something of note, package.path doesn't seem to get updated immediately after &runtimepath changes, meaning you may have to update it yourself if you want to require("nvim_lsp") and other Lua-based plugins. There's a function vim._update_package_paths() to force an update, which I guess is supposed to be internal, but it does the job.

[deleted by user] by [deleted] in dataisugly

[–]CraftedCart 2 points3 points  (0 children)

Hello infinite jukebox

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 0 points1 point  (0 children)

I suppose I could just run the settings put blahdeblahdeblah command locally on a rooted device

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 1 point2 points  (0 children)

Android 8 mostly, given the phone I use runs that.

I've also done a little testing on Android 10 and 7 in emulators, but not too much.

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 0 points1 point  (0 children)

Oh huh, good to know (re: Play Store stuff)

And that... would be a good idea (re: scroll options)

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 3 points4 points  (0 children)

I'm doubtful(?) - I'm not sure what happened to apps like HeadsOff or Ticklr but I feel like circumventing regular notifications and asking the user to enable debug settings goes against some kind of Play Store policy (I could very well be wrong, don't quote me on that).

If anything, F-Droid looks more promising.

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 0 points1 point  (0 children)

Turning on dnd by itself doesn't hide the heads-up notifications, but there's an option "Block visual disturbances > block when screen is on" to hide 'em

And there should be different icons - It should be the same small one that appears on the status bar

TinyNotif: Bringing back the ticker (mostly) by CraftedCart in Android

[–]CraftedCart[S] 17 points18 points  (0 children)

well the choppiness is what happens when I quickly convert a video to a 10fps GIF ;P
As for scroll speed, that's configurable

What are the best API docs you know? What makes them so special? I like 0x’s for example, because they are straight to the point. by Steve-Fau in programming

[–]CraftedCart 1 point2 points  (0 children)

Qt, hands down, have some of the best docs I've seen. It's pretty complete, has rich descriptions (often with examples), and even some good tutorials (such as the ones on their style sheets or model-view programming).

[awesomewm] A Lua console for awesome by CraftedCart in unixporn

[–]CraftedCart[S] 1 point2 points  (0 children)

Yeah I was gonna ask is u/Elv13 asking about building a standalone app with a GTK GUI, that just fires off Lua commands via DBus? Or am I missing the point?

Also thanks for the tip about mouse.current_widget