Comments (2)
Thanks for the hint! I dug a bit deeper and in the same doc it says:
- Q: How can I disable LSP formatting when using the |gq| command?
A: To use the default internal formatting method and bypass the LSP client's
'formatexpr', use |gw| instead.
Alternatively you can completely disable LSP formatting with gq by
unsetting 'formatexpr':vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) vim.bo[args.buf].formatexpr = nil end, })
Doing the suggestion from the docs works for me!
from comment.nvim.
So I had this same issue, and after I uninstalled this plugin to test, I was still facing it. I think the problem is with lsp-config however
:h lsp-config
shows the following
formatexpr' is set to |vim.lsp.formatexpr()| if both 'formatprg' and
'formatexpr' are empty. This allows to format lines via |gq| if the language
server supports it.
and for me formatprg
is empty but formatexpr
is not
:set formatexpr
:set formatprg
# the expression is set to
formatexpr=v:lua.vim.lsp.formatexpr()
so I'm thinking this is a problem with lsp and how I have that configured and not this plugin given the test I did by uninstalling it and also quickly looking at the mappings be set by this plugin gq
isn't mentioned anywhere, so I'm leaning towards lsp
Hope that helps and lmk if you find a solve for this
also. When I do gww
instead of gqq
it kinda works but it's not respecting the column width, I'm diving through the docs to try and understand how all the things interplay... muscle memory is too strong to change 😂
from comment.nvim.
Related Issues (20)
- Add blockwise comment support for verilog/systemverilog
- Support templ HOT 1
- How to support context filetype?
- Uses `//` as commentstring in html HOT 4
- NOT A BUG/ISSUE [a gen qs] HOT 2
- How to just do comment or uncomment?
- Willing to accept a PR if I add a setup option "default commentstring"? HOT 2
- comment config working on arch but not on linux (arch) HOT 1
- Retain visual mode after commenting HOT 1
- [BUG] When I try to comment linewise in visual mode, unrelated or extra code gets commented HOT 5
- Adding a FOSS license HOT 2
- Not working for typescript react HOT 1
- BUG: fails silently in absence of LuaJIT HOT 1
- ft.set() not working for blade files defaults to html comments HOT 1
- Support inline commenting of wrapped shell commands
- Toggler remap with <leader>/ not working HOT 2
- Feat request: Toggle code block by pressing a key in a single line (context aware)
- Feature request: Option to start comment before indentation
- Is this still needed with Neovim 0.10? HOT 10
- Comments inside Twig files are always using HTML syntax
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comment.nvim.