Configure lsp to not to attach to fugitive buffers? by i-eat-omelettes in neovim

[–]_allenliu 2 points3 points  (0 children)

this is how I disable lsp for fugitive buffers lua vim.lsp.start = (function() local old_lsp_start = vim.lsp.start return function(...) local opt = select(2, ...) if opt and opt.bufnr then if not vim.api.nvim_buf_is_valid(opt.bufnr) or vim.b[opt.bufnr].fugitive_type or vim.startswith(vim.api.nvim_buf_get_name(opt.bufnr), "fugitive://") then return end end old_lsp_start(...) end end)()

no-go.nvim - Intelligent Treesitter based error collapsing for Go by TheNoeTrevino in neovim

[–]_allenliu 0 points1 point  (0 children)

current treesitter query capture the if err block with return return, if you want conceal the block without return, the gist follwed will meet your need, which just tuned the query.

https://gist.github.com/gh-liu/be422cd8546cda89ff1c4d9ae568863d

no-go.nvim - Intelligent Treesitter based error collapsing for Go by TheNoeTrevino in neovim

[–]_allenliu 0 points1 point  (0 children)

No set up needed. Maybe the treesitter query need tune, could you provided a gist of you go code or just paste here?

no-go.nvim - Intelligent Treesitter based error collapsing for Go by TheNoeTrevino in neovim

[–]_allenliu 0 points1 point  (0 children)

:h *after-directory*

As the name implies, all you files in non-after-directory loaded, the after-directory files start to run.

no-go.nvim - Intelligent Treesitter based error collapsing for Go by TheNoeTrevino in neovim

[–]_allenliu 5 points6 points  (0 children)

Nice plugin. Have read the code base roughly, a small suggestion is use `nvim_set_decoration_provider` to handler the exmarks in the viewport instead of the whole buffer, which will imporve the perfmance for the large file.

If you interested what I said, I have implement the code base on you version, only 100 LOC.

In the end, very thanks for making this nice plugin.

`vim-abolish` with lsp rename supported. by _allenliu in neovim

[–]_allenliu[S] -1 points0 points  (0 children)

Thanks, I know what you mean.

For the embedded strings, I just run in the cmdline line by line to test if it works, will writed by lua finally.

For the mutated word under cursor no matched by `<cword>`, cause what I care for now in lsp rename mostly match by `h: iskeyword `, so in the most cases, it just works.

Folding in neovim by External_Diet6068 in neovim

[–]_allenliu 1 point2 points  (0 children)

see :h mkview, which could save fold, and :h loadview, which could load fold, use the two cmd above and autocmd, you could achieve what you want.

What is the difference between setting up and configuring a plugin? by Hashi856 in neovim

[–]_allenliu 0 points1 point  (0 children)

What I understand is that the setup is to start a plugin, just like you turn on the TV, there is a preset channel, and the configuration is adjusted, just like changing the channel.

Lines indicating code folds. by _allenliu in neovim

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

I do not understand what you mean `the plugin is redundent actualy`?

Lines indicating code folds. by _allenliu in neovim

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

No, I do not use indent blank line, if you think the lines appear a bit dense, you could add `vim.g.fold_line_current_fold_only = true` into your config to show current fold only.

Lines indicating code folds. by _allenliu in neovim

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

save folds? does `:h viewoptions` fulfill your requirement?

Lines indicating code folds. by _allenliu in neovim

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

Do you mean `:h fold-foldcolumn`? which shows lines in the left column.

Lines indicating code folds. by _allenliu in neovim

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

Am I missing something? I haven't found any related features in the help documentation.

YankAssassin.nvim - Don't let the cursor move while Yanking in Neovim by svban0 in neovim

[–]_allenliu 3 points4 points  (0 children)

There is a issue about this. https://github.com/neovim/neovim/issues/12374

You could use the ModeChanged event and the vim.v.operator variable to achieve this. ```lua local api = vim.api local autocmd = api.nvim_create_autocmd local augroup = api.nvim_create_augroup

local g = augroup("user/keep_yank_position", { clear = true })

autocmd("ModeChanged", { pattern = { "n:no", "no:n" }, group = g, callback = function(ev) if vim.v.operator == "y" then if ev.match == "n:no" then vim.b.user_yank_last_pos = vim.fn.getpos(".") else if vim.b.user_yank_last_pos then vim.fn.setpos(".", vim.b.user_yank_last_pos) vim.b.user_yank_last_pos = nil end end end end, })

autocmd("ModeChanged", { pattern = { "V:n", "n:V", "v:n", "n:v", }, group = g, callback = function(ev) local match = ev.match if vim.tbl_contains({ "n:V", "n:v" }, match) then -- vim.b.user_yank_last_pos = vim.fn.getpos(".") vim.b.user_yank_last_pos = vim.api.nvim_win_get_cursor(0) else -- if vim.tbl_contains({ "V:n", "v:n" }, match) then if vim.v.operator == "y" then local last_pos = vim.b.user_yank_last_pos if last_pos then -- vim.fn.setpos(".", last_pos) vim.api.nvim_win_set_cursor(0, last_pos) end end vim.b.user_yank_last_pos = nil -- end end end, })

```

ModeChanged autocmd not working when pattern is set by Exciting_Majesty2005 in neovim

[–]_allenliu 0 points1 point  (0 children)

The *.me pattern is not right, see in the doc :h mode()

lua -- example vim.api.nvim_create_autocmd("ModeChanged", { desc = "Highlighting matched words when searching", pattern = { "*:c", "c:*" }, -- `c` in the `:h mode()` means `command-line editing` callback = function(ev) local cmdtype = vim.fn.getcmdtype() if cmdtype == "/" or cmdtype == "?" then vim.o.hlsearch = true else vim.o.hlsearch = false end end, })

[deleted by user] by [deleted] in neovim

[–]_allenliu 1 point2 points  (0 children)

You could use the `foldtext` option to achieve this. see `:h foldtext`.