Ubuntu中bash自动补全忽略大小写


Ubuntu中bash自动补全忽略大小写


大多数人在使用 Bash 时,都会对其进行改造,因为默认的设置真的好难用~

编辑 ~/.inputrc 文件设置 (实测Ubuntu14是   /etc/.inputrc   文件)


文件末尾添加如下代码:

# do not show hidden files in the list
set match-hidden-files off
 
# auto complete ignoring case
set show-all-if-ambiguous on
set completion-ignore-case on

"\e[A": history-search-backward
"\e[B": history-search-forward

解释:

show-all-if-ambiguous : 默认情况下,按下两次 <tab> 才会出现提示,现在只需要一次了。
match-hidden-files : 不显示隐藏文件,特别是当你在 Home 目录时,你会觉得眼前好干净。
completion-ignore-case : 在自动补全时忽略大小写
history-search-* : 输入某个命令的一部分时,按上下箭头,会匹配关于这个这命令最近的使用历史。


更多 Bash 定制请参考:

https://wiki.ubuntu.com/Spec/EnhancedBash


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu 上使用 Vim 编辑器时,可以通过以下步骤启用自动补全代码功能: 1. 安装 Vim 插件管理器 Vundle: ```bash git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim ``` 2. 在 `~/.vimrc` 文件添加以下内容: ```vim set nocompatible " be iMproved, required filetype off " required set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'Valloric/YouCompleteMe' call vundle#end() " required filetype plugin indent on " required let g:ycm_autoclose_preview_window_after_completion=1 let g:ycm_min_num_of_chars_for_completion=2 let g:ycm_collect_identifiers_from_comments_and_strings=1 let g:ycm_complete_in_strings=1 let g:ycm_complete_in_comments=1 let g:ycm_key_invoke_completion='<C-Space>' let g:ycm_confirm_extra_conf=0 let g:ycm_add_preview_to_completeopt=1 let g:ycm_show_diagnostics_ui=1 let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' let g:ycm_python_binary_path='/usr/bin/python3' let g:ycm_server_python_interpreter='/usr/bin/python3' let g:ycm_server_keep_logfiles=0 let g:ycm_server_log_level=3 ``` 3. 打开 Vim 并执以下命令安装插件: ``` :PluginInstall ``` 4. 安装 YCM(YouCompleteMe)插件的依赖项: ```bash sudo apt install build-essential cmake python3-dev ``` 5. 在 `~/.vim/bundle/YouCompleteMe/` 目录下执以下命令安装 YCM 插件: ```bash python3 install.py --clang-completer ``` 安装完成后,重新打开 Vim,在 C++ 文件输入代码时,按下 `Ctrl + Space` 键即可触发自动补全代码功能。如果需要更改自动补全的选项,可以修改 `~/.vimrc` 文件的配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值