Ubuntu16.04 atom : Could not find 'uncrustify'. The program may not be installed.

在Ubuntu16.04上使用Atom时遇到'Could not find 'uncrustify'错误。尝试通过sudo apt安装和更新uncrustify,但问题仍然存在。通过git克隆uncrustify源码并编译,虽然解决了编译问题,但在配置文件后仍出现错误。最终,通过修改~/.uncrustify配置并解决快捷键冲突,成功使Atom beautify恢复正常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

atom : Could not find ‘uncrustify’. The program may not be installed.

sudo apt install linuxbrew-wrapper brew install homebrew/php/php-cs-fixer

Warning: /home/farfood/.linuxbrew/bin is not in your PATH. 结果是

==> Installing php-cs-fixer from homebrew/php
Error: undefined method `rebuild' for #<BottleSpecification:0x0000000228e180>
Please report this bug:
    https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting

sudo apt-get install uncrustify

问题还是没有解决:在atom中运行beautify还是出现了如下错误

Parsing: /tmp/input1161122-11997-c8z7uo.scb10dx6r as language CPP /tmp/input1161122-11997-c8z7uo.scb10dx6r:6 Garbage in col 9: 201c /tmp/input1161122-11997-c8z7uo.scb10dx6r:6 Garbage in col 26: 5c /tmp/input1161122-11997-c8z7uo.scb10dx6r:6 Garbage in col 28: 201d

我猜测可能是ubuntu安装的uncrustify版本太旧了

所以我要去下载一个新的试试。

git clone https://github.com/uncrustify/uncrustify.git

cd uncrustify/

cmake -DCMAKE_BUILD_TYPE=Release

遇到了问题

CMake Error at CMakeLists.txt:6 (message):

  In-source builds are not supported, please remove the `CMakeFiles'
  folder and `CMakeCache.txt', and create a folder for the build:
  mkdir build; cd build; cmake ..

按照提示删除相应文件,然后输入。

mkdir build 
cd build
cmke .. -DCMAKE_BUILD_TYPE=Release
make

which uncrustify
却没有反应

sudo make install
[100%] Built target uncrustify
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/uncrustify
-- Installing: /usr/local/share/man/man1/uncrustify.1
which uncrustify 
/usr/local/bin/uncrustify

结果还是出现了一些问题。
我看了看官网文档
把配置加入了~/.uncrustify
(⊙o⊙)…,过了一会就好了

不过还有快捷键问题:

ubuntu16.04按下ctrl-alt-b出现小键盘
那就不能使用atom-beautify的快捷键了。
解决方案
有人说使用fn+ESC就好了。
我试了下,不行,然后找到了下面的:

1. 在搜狗拼音输入法选择设置
2. 高级设置
3. 高级设置最底部,找到fcitx设置
4. 打开fcitx设置,选择Addon选项卡,取消选择虚拟键盘
5. 注销或重启电脑

我觉得这样子应该是就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值