gpt4 book ai didi

javascript - 在 VIM 中快速切换 CoffeeScript 和 JavaScript 文件

转载 作者:行者123 更新时间:2023-11-29 10:20:47 25 4
gpt4 key购买 nike

遗憾的是,我是 Vimscript 的新手,未能编写从 .coffee 文件切换到相应的 .js 文件的函数。

我想知道是否有人已经这样做过?

我知道 vim-coffee-script 插件的函数 :CoffeeCompile watch 但是你看到的文件不是你本地存储的真实文件。

如果有这样的功能会很酷(如果您将 .coffee.js 文件存储在同一目录中):

function! GoToJS()
" get current file path in a string variable
" change the .coffee extention to a .js extention
" open the .js file
endfunction

像这样的东西真的很酷-

最佳答案

试试 vim 插件 a.vim .它是可配置的。将这些添加到 .vimrc:

let g:alternateExtensions_coffee = 'js'
let g:alternateExtensions_js = 'coffee'

关于javascript - 在 VIM 中快速切换 CoffeeScript 和 JavaScript 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12491543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com