Since I migrated from awesome 3.4 to 3.5 I am unable to remove titlebar from youtube videos when maximising fullscreen.
In awesome 3.4 I used to put:
{ rule = { instance = "plugin-container" },
properties = { floating = true } },
and that works. However in version 3.5 the titlebar "plugin-container" remains. I even tried the following without much success:
{ rule = { instance = "plugin-container" },
properties = { floating = true } ,
callback = function (c) awful.titlebar(c, {size = 0}) end },
However the function works when I hooked it to a keybinding:
awful.key({ modkey, }, "w",
function (c) awful.titlebar(c, {size = 0}) end
I know for sure that the rule works because it makes the window floating but does not execute the call to the function, so I am really perplexed to what is the issue here.
Thank you,
I just had the same problem, here's a config section which does the wanted behavior:
{ rule = { instance = "plugin-container" },
properties = { floating = true },
callback = awful.titlebar.hide },
May be a little bit late, but I think it's worth documenting.
Related
I'm using nvim-cmpto have a contextual window to display my LSP suggestions and my snippets but when I open multiple buffers, I have an issue : the same source is added multiple times to nvim-cmp causing the same result to be repeated in the popup.
For example, here is the result of :CmpStatus: after a few minutes of work.
# ready source names
- vsnip
- buffer
- nvim_lsp:pylsp
- vsnip
- nvim_lsp:pylsp
- nvim_lsp:pylsp
Here is my nvim-cmpconfig :
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
...
sources = {
{ name = 'vsnip' },
{ name = 'nvim_lua' },
{ name = 'nvim_lsp' },
{ name = 'buffer', keyword_length = 3 }
},
}
Does anyone know how to adress this issue ? Is it a problem with my configuration ?
In your cmp configuration, you can use the dup keyword for vim_item with the formatting option / format function. See help for complete-item for explanations (:help complete-item).
cmp.setup({
formatting = {
format = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = '[LSP]',
vsnip = '[Snippet]',
nvim_lua = '[Nvim Lua]',
buffer = '[Buffer]',
})[entry.source.name]
vim_item.dup = ({
vsnip = 0,
nvim_lsp = 0,
nvim_lua = 0,
buffer = 0,
})[entry.source.name] or 0
return vim_item
end
}
})
You can see details in this feature request for nvim-cmp plugin.
I had the same problem and managed to solve the issue by realizing that cmp is somehow installed twice.
Try removing or better first renaming the cmp-packages in the plugged directory, for example
cmp-nvim-lsp to cmp-nvim-lsp_not
cml-nvim-buffer to cmp-nvim-buffer_not
etc.
This did the job for me.
I'm trying to write my own NeoVim Lua based config, stripped down to the minimum I need and with the goal to understand at least most of the config. LSP setup is working fine and is the only source I configured for nvim-cmp:
local cmp = require("cmp")
cmp.setup {
sources = {
{ name = 'nvim_lsp' }
}
}
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
After some startup delay the completion is working in the sense that I see popups with proposed completions, based on information from LSP.
But I cannot select any of the proposed completions. I can just continue to type which reduces the proposed completions, but I cannot use tab, arrow keys, ... to select an entry from the popup. I saw in the docs that one can define keyboard mappings but cannot make sense out of them. They are all rather sophisticated, require a snippet package to be installed, ...
I would prefer to select the next completion via tab and to navigate them via arrow key. "Enter" should select the current one.
Could somebody show me a minimal configuration for this setup or point me to more "basic" docs?
Nvim-cmp requires you to set the mapping for tab and other keys explicitly, here is my working example:
local cmp = require'cmp'
local lspkind = require'lspkind'
cmp.setup({
snippet = {
expand = function(args)
-- For `ultisnips` user.
vim.fn["UltiSnips#Anon"](args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-e>'] = cmp.mapping.abort(),
['<Esc>'] = cmp.mapping.close(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
}),
sources = {
{ name = 'nvim_lsp' }, -- For nvim-lsp
{ name = 'ultisnips' }, -- For ultisnips user.
{ name = 'nvim_lua' }, -- for nvim lua function
{ name = 'path' }, -- for path completion
{ name = 'buffer', keyword_length = 4 }, -- for buffer word completion
{ name = 'omni' },
{ name = 'emoji', insert = true, } -- emoji completion
},
completion = {
keyword_length = 1,
completeopt = "menu,noselect"
},
view = {
entries = 'custom',
},
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
menu = ({
nvim_lsp = "[LSP]",
ultisnips = "[US]",
nvim_lua = "[Lua]",
path = "[Path]",
buffer = "[Buffer]",
emoji = "[Emoji]",
omni = "[Omni]",
}),
}),
},
})
This is working great for me. The mapping part corresponds to the config for key mapping in the table. You can tweak your conf based on my config to make it work for you.
I'm trying to access the properties of the following widget:
local cpu_widget = wibox.widget{
{
max_value = 100,
paddings = 1,
border_width = 2,
widget = wibox.widget.progressbar,
},
{
font = beautiful.font_type .. "8",
widget = wibox.widget.textbox,
},
forced_height = 100,
forced_width = 20,
direction = 'east',
layout = wibox.container.rotate,
}
I've tried through the conventional way, using cpu_widget[1].value or cpu_widget[2].text, but that didn't work.
Any thoughts on how I could do that?
See the "Accessing Widgets" on https://awesomewm.org/doc/api/documentation/03-declarative-layout.md.html (I can't seem to link to this section directly)
Basically: You can add id = "bar" and id = "text" to your widgets and use these identifiers to retrieve the widgets again.
In case Elv13 ever sees this answer: You did great work on the docs!
My OS is Arch Linux, the edition of Lua is 5.4.4
I'm trying to configure the neovim pluging, nvim-tree. And my configuration Lua file are as follow.
local status, nvim_tree = pcall(require, "nvim-tree")
if not status then
vim.notify("can't find nvim-tree")
return
end
local list_keys = require('keybindings').nvimTreeList
nvim_tree.setup ({
auto_close = true,
git = {
enable = false
},
update_cwd = true,
update_focused_file = {
enable = true,
update_cwd = true
},
filters = {
dotfiles = true,
custom = {"node_modules"}
},
view = {
width = 30,
side = "left",
hide_root_folder = false,
auto_resize = true,
mappings = {
custom_only = false,
list = list_keys
},
number = false,
relativenumber = false,
signcolumn = "yes"
}
})
When opening neovim, there is an error message said that:
Error detected while processing ~/.config/nvim/init.lua:
E5113: Error while calling lua chunk:
~/.config/nvim/lua/plugin-config/nvim-tree.lua:10: attempt to call field 'setup' (a nil value)
stack traceback:
~/.config/nvim/lua/plugin-config/nvim-tree.lua:10: in main chunk
[C]: in function 'require'
~/.config/nvim/init.lua:10: in main chunk
But the nvim-tree can be used normally.
I had try to fixed it by changing the file into the way which described in the https://github.com/kyazdani42/nvim-tree.lua
require'nvim-tree'.setup { }
but it led to more error, because I used the
require("plugin-config.nvim-tree")
in the init.lua, the will have conflict.
So how can I fix this problem?
I got a similar error with that plugin. So I leave a trivial tip. Although I found you are better trained than me on the vim. Just in case.
Try this.
:checkhealth
It answered me the plugin needs upper version like 0.7.0 and that was correct in my case. I didn't even need the 'neovim NIGHTLY'.
I used to use a rule like this in Awesome WM 3.5:
{
rule = { class = "wm_kybrd_fcns.py" },
properties = { floating = true },
callback = function (c)
c:tags({
tags[1][1],
tags[1][2],
tags[1][3],
tags[1][4],
tags[1][5]
})
end
},
to show this application on all tags, but this no longer works. I looked around, but didn't find a good place that showcased what other people have done with their rc.lua config files in version 4.0.
I tried this:
{
rule = { class = "wm_kybrd_fcns.py" },
properties = { floating = true },
callback = function (c)
local s = awful.screen.focused()
c:tags({
s.tags[1],
s.tags[2],
s.tags[3],
s.tags[4],
s.tags[5]
})
end
},
which worked fine on awesome.restart, but after the next reboot I ended up with garbled icon images all over my wibar particularly in the tags region. That went away when I commented out the new rule.
the next reboot I ended up with garbled icon images all over my wibar particularly in the tags region
That's usually a bug with some graphics driver. There is a fix in X11 that improves it, but it is too new to be on your computer yet. You can run Awesome with --no-argb or use compton to mitigate the issue.
Your code should work, however 4.0+ has a simpler version:
{
rule = { class = "wm_kybrd_fcns.py" },
properties = { floating = true },
screen = awful.screen.focused,
tags = { "1", "2", "3", "4", "5" }
},
This is assuming the tag names are numeric, change it to fit you needs.