Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support .editorconfig #292

Closed
matu3ba opened this issue Jan 6, 2023 · 5 comments · Fixed by #295
Closed

support .editorconfig #292

matu3ba opened this issue Jan 6, 2023 · 5 comments · Fixed by #295

Comments

@matu3ba
Copy link
Contributor

matu3ba commented Jan 6, 2023

see https://editorconfig.org/:

Only forward slashes (/, not backslashes) are used as path separators and octothorpes (#) or semicolons (;) 
are used for comments. Comments should go on their own lines.

Comments are prefixed with #

For the neovim helpage: :h editorconfig.

@numToStr
Copy link
Owner

numToStr commented Jan 7, 2023

PR welcome

@matu3ba
Copy link
Contributor Author

matu3ba commented Jan 7, 2023

I am not familiar with the in-documentation language highlighting or if you use it at all, but this would make things faster (probably also adding it into the README):

diff --git a/lua/Comment/ft.lua b/lua/Comment/ft.lua
index d5e4daf..4fab693 100644
--- a/lua/Comment/ft.lua
+++ b/lua/Comment/ft.lua
@@ -8,6 +8,9 @@
 ---'ios.swift' etc. The commentstring resolution will be done from left to right.
 ---For example, If the filetype is 'ansible.yaml' then 'ansible' commenstring will
 ---be used if found otherwise it'll fallback to 'yaml'. Read `:h 'filetype'`
+---or try locally in an opened file within vim cmdline:
+---:lua print(vim.bo.filetype)
+---:lua print(require("nvim-treesitter.parsers").filetype_to_parsername[vim.bo.filetype])
 ---@brief ]]

@numToStr
Copy link
Owner

numToStr commented Jan 7, 2023

I am not familiar with the in-documentation language highlighting or if you use it at all, but this would make things faster (probably also adding it into the README):

diff --git a/lua/Comment/ft.lua b/lua/Comment/ft.lua
index d5e4daf..4fab693 100644
--- a/lua/Comment/ft.lua
+++ b/lua/Comment/ft.lua
@@ -8,6 +8,9 @@
 ---'ios.swift' etc. The commentstring resolution will be done from left to right.
 ---For example, If the filetype is 'ansible.yaml' then 'ansible' commenstring will
 ---be used if found otherwise it'll fallback to 'yaml'. Read `:h 'filetype'`
+---or try locally in an opened file within vim cmdline:
+---:lua print(vim.bo.filetype)
+---:lua print(require("nvim-treesitter.parsers").filetype_to_parsername[vim.bo.filetype])
 ---@brief ]]

Huh? What's the point here? I thought you wanted to add to add support for editorconfig files(?)

@matu3ba
Copy link
Contributor Author

matu3ba commented Jan 7, 2023

Point being is that getting treesitter used filetype is not documented in :h filetype.

@numToStr
Copy link
Owner

numToStr commented Jan 7, 2023

There's also :h comment.ft.calculate to get filetype/lang using treesitter.

@numToStr numToStr linked a pull request Jan 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants