annotate runtime/ftplugin/gitrebase.vim @ 33767:4913b4f5a133 v9.0.2104

patch 9.0.2104: wast filetype should be replaced by wat filetype Commit: https://github.com/vim/vim/commit/bc8f79d36a456054ed29f46585830af6d71f57c8 Author: rhysd <lin90162@yahoo.co.jp> Date: Tue Nov 14 16:46:07 2023 +0100 patch 9.0.2104: wast filetype should be replaced by wat filetype Problem: wast filetype should be replaced by wat filetype Solution: start using the official wat filetype name runtime: rename `wast` filetype to `wat` (Wasm text format) The problem is the name of the current filetype wast. When the plugin was initially created, the file extension for Wasm text format was not fixed and .wast was more popular. However, recently .wat became the official file extension for WebAssembly text (WAT) format and .wast is now a file extension for the unofficial WAST format, which is a superset of .wat for the convenience to describe the Wasm specification conformance tests. https://webassembly.js.org/docs/contrib-wat-vs-wast.html However for now, let's keep using the `wat` filetype even for the .wast extension, so that we at least do not lose the filetype settings and syntax highlighting. This can be adjusted later, if it turns out to have a separate need for. closes: #13533 Signed-off-by: rhysd <lin90162@yahoo.co.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 14 Nov 2023 17:15:03 +0100
parents 3e661b0cf500
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim filetype plugin
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: git rebase --interactive
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
4 " Last Change: 2022 Jan 05
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
5
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
6 " Only do this when not done yet for this buffer
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
7 if (exists("b:did_ftplugin"))
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
8 finish
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
9 endif
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
10
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
11 let b:did_ftplugin = 1
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
12
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
13 let &l:comments = ':' . (matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0]
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
14 let &l:commentstring = &l:comments[1] . ' %s'
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
15 setlocal formatoptions-=t
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2202
diff changeset
16 setlocal nomodeline
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
17 let b:undo_ftplugin = "setl com< cms< fo< ml<"
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
18
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
19 function! s:choose(word) abort
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
20 s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
21 endfunction
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
22
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
23 function! s:cycle(count) abort
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
24 let words = ['pick', 'edit', 'fixup', 'squash', 'reword', 'drop']
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
25 let index = index(map(copy(words), 'v:val[0]'), getline('.')[0])
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
26 let index = ((index < 0 ? 0 : index) + 10000 * len(words) + a:count) % len(words)
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
27 call s:choose(words[index])
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
28 endfunction
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
29
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
30 command! -buffer -bar -range Pick :<line1>,<line2>call s:choose('pick')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
31 command! -buffer -bar -range Squash :<line1>,<line2>call s:choose('squash')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
32 command! -buffer -bar -range Edit :<line1>,<line2>call s:choose('edit')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
33 command! -buffer -bar -range Reword :<line1>,<line2>call s:choose('reword')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
34 command! -buffer -bar -range Fixup :<line1>,<line2>call s:choose('fixup')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
35 command! -buffer -bar -range Drop :<line1>,<line2>call s:choose('drop')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
36 command! -buffer -count=1 -bar -bang Cycle call s:cycle(<bang>0 ? -<count> : <count>)
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
37
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
38 if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
39 finish
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
40 endif
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
41
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
42 nnoremap <buffer> <silent> <C-A> :<C-U><C-R>=v:count1<CR>Cycle<CR>
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
43 nnoremap <buffer> <silent> <C-X> :<C-U><C-R>=v:count1<CR>Cycle!<CR>
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
44
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18818
diff changeset
45 let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'"