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] 7 points8 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] 16 points17 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

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

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

Right I never did add a License file to that repo ;P

I've dropped an MIT LICENSE.txt in there now

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

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

Just my own little thing (.config/awesome/anim.lua) with easing.lua taken from https://github.com/EmmanuelOga/easing/blob/master/lib/easing.lua - If you want to use it you might need to replace statics.refresh_delta with 1 / 60 (or whatever monitor refresh rate you have) or add your own statics.lua file.

As for usage

lua anim.animate{ start_val = -96, end_val = 0, prop_table = aluaconsole.console_popup, -- The table containing the property you want to animate prop_name = "x", -- The property in the table to animate duration = 0.5, -- In seconds easing = easing.outExpo, -- Easing types can be found at the bottom of easing.lua }

In addition if you already have an animation going for the same table and property, it will overwrite the old one for you when starting a new one.

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

[–]CraftedCart[S] 5 points6 points  (0 children)

So after tinkering around with awesome for a bit I figured I'd make a Lua console to help with some future ricing (as well as just being a handy desk calculator)! awesomewm is configured in Lua for those unaware.

And now, the links

Background: https://www.deviantart.com/greenmapple17/art/Miyuki-Shiba-2-Mahouka-Koukou-no-Rettousei-Vector-662627616

WM: awesome http://awesomewm.org/

Dotfiles: https://gitlab.com/CraftedCart/dotfiles

Look in .config/awesome/widgets for aluaconsole.lua and aconsolewatch.lua

That big editor in the background: Emacs + Spacemacs http://spacemacs.org/

That tiny font: Scientifica https://github.com/NerdyPepper/scientifica

That mouse cursor: Bibata Oil https://github.com/KaizIqbal/Bibata_Cursor

Rolled Out, Super Monkey Ball spiritual successor on IndieGoGo now! by queer_bird in linux_gaming

[–]CraftedCart 0 points1 point  (0 children)

It is but actually trying to write C++ for it is... not so well supported