[vim/vim] Added the objdump file/text format (PR #13425)

46 views
Skip to first unread message

Colin Kennedy

unread,
Oct 26, 2023, 1:00:06 AM10/26/23
to vim/vim, Subscribed

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.

About runtime/ftplugin/objdump.vim

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


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/13425

Commit Summary

  • 97cba63 Added the objdump file/text format

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13425@github.com>

dkearns

unread,
Oct 26, 2023, 10:28:36 AM10/26/23
to vim/vim, Subscribed

@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.Message ID: <vim/vim/pull/13425/review/1699793252@github.com>

Colin Kennedy

unread,
Oct 26, 2023, 11:22:41 AM10/26/23
to vim/vim, Push

@ColinKennedy pushed 1 commit.

  • 3cb87ec PR #13425 note - Removed unneeded lines. Added b:undo_ftplugin


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13425/push/15579036057@github.com>

Colin Kennedy

unread,
Oct 26, 2023, 11:24:47 AM10/26/23
to vim/vim, Subscribed

@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.Message ID: <vim/vim/pull/13425/review/1699938692@github.com>

Colin Kennedy

unread,
Oct 26, 2023, 11:24:53 AM10/26/23
to vim/vim, Subscribed

@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
+
+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.Message ID: <vim/vim/pull/13425/review/1699938894@github.com>

Christian Brabandt

unread,
Oct 26, 2023, 5:04:34 PM10/26/23
to vim/vim, Subscribed

Closed #13425 via 10407df.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13425/issue_event/10784790555@github.com>

Christian Brabandt

unread,
Oct 26, 2023, 5:04:36 PM10/26/23
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/13425/c1781891744@github.com>

Reply all
Reply to author
Forward
0 new messages