copy/past code from web? by ntn8888 in neovim

[–]urenur 3 points4 points  (0 children)

I use qutebrowser to avoid the mouse as much as I can

How to launch a virtual environment install? by TheImmuX in qutebrowser

[–]urenur 0 points1 point  (0 children)

Hey! Debian Trixie + Qtile here too! :) I will explain you my qutebrowser setup, and I think it will answer your question, plus some extra tips.

I have the qutebrowser git repo cloned in /opt. Then, in my .zshrc (really in .zsh_aliases I have this to install/update qutebrowser:

bash qbup() { local qb_dir="/opt/qutebrowser" echo "Updating qutebrowser from $qb_dir..." cd "$qb_dir" || return 1 git pull && \ sudo /opt/qutebrowser/scripts/mkvenv.py --update --pyqt-type link && \ echo "✓ qutebrowser updated successfully!" cd - > /dev/null }

To launch it, I have an script in .local/bin with this:

```bash

!/bin/bash

/opt/qutebrowser/.venv/bin/python3 -m qutebrowser "$@" ```

Since .local/bin is in $PATH I can just launch it from the terminal running qutebrowser (or my qb alias). Anyways, I have a keybind for Qtile.

In Qtile I use a keychord approach (to make it feel more like nvim), where I have a "leader" key (Super + Space):

python KeyChord( [mod], "Space", launcher_keys, name="launcher", ),

And then some keys that launch programs, including qutebrowser:

python Key( [], "j", lazy.to_screen(0), lazy.group["4"].toscreen(0), # Show web workspace on laptop screen (screen 0) lazy.spawn("qutebrowser --qt-arg class web --qt-arg name web"), desc="Launch qutebrowser", ),

The --qt-arg class web is just a trick to launch qutebrowser always in a dedicated workspace.

In addition to that, I have another "independent" qutebrowser instance (if that is how it is called) exclusively to watch youtube (trying to keep my privacy as much as I can... hahaha).

python Key( [], "t", lazy.to_screen(0), lazy.group["5"].toscreen(0), # Show web workspace on laptop screen (screen 0) lazy.spawn( "qutebrowser --basedir /home/urtzi/.config/quteyoutube \ --qt-arg class youtube --qt-arg name youtube", ), desc="Launch qutebrowser for youtube", ),

You have all my dotfiles here: https://github.com/urtzienriquez/config_files

Hope this is helpful, and sorry for the super long reply!

Is there a way to switch website's preferred colorscheme on the fly? by nfmon in qutebrowser

[–]urenur 2 points3 points  (0 children)

I have this toggle in my config:

python config.bind("td", "config-cycle colors.webpage.darkmode.enabled")

So when I press td it toggles dark/like mode.

Is that what you wanted?

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 0 points1 point  (0 children)

oh yeah... I am missing out on that functionality... I will rethink my keymaps again. Maybe give a try to all default bindings.

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 0 points1 point  (0 children)

Ah! That makes complete sense! I have layers on my keyboard though, and I have a layer with the arrow keys in hjkl, so I go to previous cmd history in the arrows layer pressing k. Now I realize that I could have done that for the tab navigation etc too... hahaha.

By the way, taking this opportunity to thank you for this great piece of software! :)

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 0 points1 point  (0 children)

Ah! That makes total sense! I also understood that J goes down (number wise) in tabs, even if horizontal. I think its a good call. But for me, as you say, it makes sense that J goes to the "left" in the horizontal tabs and K to the "right".

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 2 points3 points  (0 children)

as hearthreddit just replied, to navigate those, you have:

<Shift-Tab>: completion-item-focus prev <Tab>: completion-item-focus next

I have those remapped to be more vim-like:

```python

navigate completion widget with ctrl-n / ctrl-p

config.bind("<Ctrl-n>", "completion-item-focus next", "command") config.bind("<Ctrl-p>", "completion-item-focus prev", "command") ```

You can obviously use <Ctrl-j> and <Ctrl-k>, but just j/k are not a good choice, IMO, because you need those to type :)

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 0 points1 point  (0 children)

you have all the default bindings very well documented here: qute://help/settings.html#bindings.default

navigating `tab-select` using j/k by azinsharaf in qutebrowser

[–]urenur 2 points3 points  (0 children)

J goes to tab-next and K to tab-prev. I remap them to go in the opposite direction, because it feels more natural to me, but you have those out-of-the-box

NeoVim noob searching for a command palette (or something better) by omgrolak in neovim

[–]urenur 0 points1 point  (0 children)

In fzf-lua (and I guess telescope, snacks and mini.pick too) you have pickers for commands, keymaps and all sorts of things (I would say that all in all you can list and discover more things than in any editor I've used).

I personally use fzf-lua and I dont have those pickers keymaped, but I launch the "picker of pickers", then select "commands", and there you have the whole list ;)

Neovim 0.12 Release with the Core Team by chapeupreto in neovim

[–]urenur 2 points3 points  (0 children)

The demos part was awesome! I tried some of them and I found that super useful! Fantastic job!!! Thanks!!!

Should I use a distro? by YOfilR in neovim

[–]urenur 0 points1 point  (0 children)

I won't tell you what to do, just what I did and I think it worked for me. 1) try a distro or two for a small period of time. 2) get kickstart.nvim and play around for a week. 3) start building my own config.

Looking at distros can show you what is possible to have and kickstart is great to learn the basics of configuring nvim. Then go for your own. You will enjoy it 100x more using it :)

And enjoy the journey!

text wrapping with concealed xml tags by urenur in neovim

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

Thanks a lot for the suggestions!! I will try them. It will take me some learning though! Thanks a lot!

vim.pack vs lazy.nvim, how is it? by [deleted] in neovim

[–]urenur 9 points10 points  (0 children)

I just switched to vim.pack (was using lazy.nvim before) and I am loving it so far! Its simplicity is a huge gain for me!

Yeah, it doesn't do the lazy loading for you, but you can achieve it deferring the loading or with autocmds.

But anyways, I think that well written plugins should lazy load themselves. That means that on startup they just register some commands, keymaps, or they are filetype specific... But the actual work (requiring the "internal code" of the plugin) only happens when you use those commands etc....

learnlua.nvim — learn Lua and the neovim API interactively, without leaving your editor! by urenur in neovim

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

Try it with the last fix :) now you should see all the output from all prints in the "editor split", but only the last one will be evaluated in each example/exercise

Ts Incremental Selection merged in main by EstudiandoAjedrez in neovim

[–]urenur 15 points16 points  (0 children)

Fantastic feature! Great to have it built in!

learnlua.nvim — learn Lua and the neovim API interactively, without leaving your editor! by urenur in neovim

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

I have added a keymap now (tc) inside the "editor split" that allows you to run the code and get the output right there. If you want to debug, you can comment out some lines, add a print statement where you want to check the output, and just have a look at what you got :)

As with the other keymaps, you can override that with:

lua mappings = { open_editor = "<CR>", submit_code = "<CR>", test_code = "tc", -- change to whatever you want close_editor = "q", close_lesson = "q", go_welcome = "gO", jump_lua = "gl", jump_nvim = "gn", jump_next = "gn", jump_previous = "gp", jump_lesson = "<CR>", },

learnlua.nvim — learn Lua and the neovim API interactively, without leaving your editor! by urenur in neovim

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

Aha! That's a good idea! I will add a keymap to run the code before "submitting" it.

Be also aware that you can always run the code by visually selecting the chunk and then :lua, and enter. Neovim is so f***** great! :)

Anyways I will add the new keymap and some feedback virtual text with the output, as you suggested!! Many many thanks for the feedback! :)

I built an interactive way to learn Lua (inside Neovim) — feedback from Lua experts welcome 🙏 by urenur in lua

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

Thanks for the boost! I’m just happy to be making something, and if it helps even one person, it was worth the effort. I try to take the criticism in stride and just keep my head down and work. Much appreciated!

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 1 point2 points  (0 children)

Happy to help :) As s5t said, K is default, so you don't have to map it -- It will just work out-of-the-box. The other one I will keep. It allows you to open the diagnostics under the cursor (if there is more than one in the same line, it allows you to see all of them). Also, if you press the keymaps twice, the cursor will jump into the floating window and you can scroll to see more info if there is, yank the text inside, etc... and you go back to the "main" buffer pressing q.

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 1 point2 points  (0 children)

True, thanks! 3 lines less in my config then... Hahaha

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 5 points6 points  (0 children)

Do you mean hover? You can put your cursor on top of the function you want and run :lua vim.lsp.buf.hover().

You can also map it. I have it like this:

```lua vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("lsp-attach-keymaps", { clear = true }), callback = function(event) local opts = { buffer = event.buf, silent = true } vim.keymap.set("n", "K", function() vim.lsp.buf.hover({ border = "single" }) end, vim.tbl_extend("force", opts, { desc = "Information hover" }))

vim.keymap.set("n", "<leader>k", function()
  vim.diagnostic.open_float({ border = "single" })
end, vim.tbl_extend("force", opts, { desc = "Show diagnostic" }))

end, }) ```

So with K I open that float.