This PR adds filetype recognition for Objdump output files.
About objdump's file extensions, .objdump seems to be the most common among GitHub users. GitHub linguist claims that there's several other recognized extensions such as .c++-objdump, .cpp-objdump, .cppobjdump, and the like but they seemed to be pretty rare. I can include those as well if you'd like.
Though a bit uncommon, objdump files do have auto-generated comments so I've added that to runtime/ftplugin/objdump.vim. You can see a couple examples here: https://github.com/ColinKennedy/tree-sitter-objdump/blob/master/test/corpus/comment.txt
Please let me know if you'd like me to include anything for this PR
https://github.com/vim/vim/pull/13425
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns commented on this pull request.
In runtime/ftplugin/objdump.vim:
> @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Objdump +" Maintainer: Colin Kennedy <coli...@gmail.com> +" Last Change: 2023 October 25 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim
This cpo save/restore dance is only needed if using line continuations. So lines 10,11,17,18 can be deleted.
In runtime/ftplugin/objdump.vim:
> @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Objdump +" Maintainer: Colin Kennedy <coli...@gmail.com> +" Last Change: 2023 October 25 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:did_ftplugin = 1 + +setlocal commentstring=#\ %s
This option needs to be added to b:undo_ftplugin.
let b:undo_ftplugin = "setlocal cms<"
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@ColinKennedy pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@ColinKennedy commented on this pull request.
In runtime/ftplugin/objdump.vim:
> @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Objdump +" Maintainer: Colin Kennedy <coli...@gmail.com> +" Last Change: 2023 October 25 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim
Ah okay, yes there are no line continuations in objdump's grammar. It's a line-by-line format. Done!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
> @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Objdump +" Maintainer: Colin Kennedy <coli...@gmail.com
>
+" Last Change: 2023 October 25
+
+if exists("b:did_ftplugin")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+let b:did_ftplugin = 1
+
+setlocal commentstring=#\ %s
Done!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks. I have slightly amended your testfile however :)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()