安装独立的vim替换掉OSX默认
brew install mercurial
brew install vim
打开高亮渲染
在 ~/.vimrc
中配置
set nonu
syntax on
修复 mac 下 vim 无法使用delete删除文本的问题
在 ~/.vimrc
中配置
" fix mac vim delete error, so as set backspace=indent,eol,start
set backspace=2
安装 mvim 代替vi
本文还是使用独立的vim,所以后面没介绍mvim的相关配置
brew install macvim
使用 MacVim 替换系统自带的 Vim
alias vim=‘mvim -v’
安装 Vundle
=========
它的使用方法很简单,安装一个插件只需要在.vimrc按照规则中添加 Plugin 的名称,某些需要添加路径,之后在 Vim 中使用:PluginInstall既可以自动化安装。
- git 克隆 Vundle 工程到本地
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 修改.vimrc配置 Plugins。在.vimrc文件中添加如下内容
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin(‘~/some/path/here’)
" let Vundle manage Vundle, required
Plugin ‘VundleVim/Vundle.vim’
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append !
to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append !
to refresh local cache
" :PluginClean - confirms removal of unused plugins; append !
to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
保存后进入 vim
运行命令
:PluginInstall
vundle 命令
安装插件
:BundleInstall
更新插件
:BundleUpdate
清除不需要的插件
:BundleClean
列出当前的插件
:BundleList
搜索插件
:BundleSearch
注意
–
插件配置不要在 call vundle#end()
之前,不然插件无法生效
如果配置错误,需要重新配置后,在vim中运行 :PluginInstall
安装 YouCompleteMe
================
使用 Vundle 安装 YouCompleteMe
- 在
.vimrc
中添加如下内容 位置在call vundle#begin()
和call vundle#end()
之间
Bundle ‘Valloric/YouCompleteMe’
在vim中运行命令
:BundleInstall
编译 YouCompleteMe
编译过程需要CMake
brew install CMake
- 带 C-family languages 语义支持的版本
cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer
- 不带 C-family languages 语义支持的版本
cd ~/.vim/bundle/YouCompleteMe
./install.sh
- 带 C# 语义支持的版本
cd ~/.vim/bundle/YouCompleteMe
./install.sh --omnisharp-completer
- 带 Go 语言语义支持的版本
cd ~/.vim/bundle/YouCompleteMe
./install.sh --gocode-completer
配置 YCM
在.vimrc中添加配置
" 自动补全配置
set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致(参考VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自动关闭预览窗口
inoremap pumvisible() ? “<C-y>” : “<CR>” "回车即选中当前项
"上下左右键的行为 会显示其他信息
inoremap pumvisible() ? “<C-n>” : “<Down>”
inoremap pumvisible() ? “<C-p>” : “<Up>”
inoremap pumvisible() ? “<PageDown><C-p><C-n>” : “<PageDown>”
inoremap pumvisible() ? “<PageUp><C-p><C-n>” : “<PageUp>”
"youcompleteme 默认tab s-tab 和自动补全冲突
"let g:ycm_key_list_select_completion=[‘’]
let g:ycm_key_list_select_completion = [‘’]
"let g:ycm_key_list_previous_completion=[‘’]
let g:ycm_key_list_previous_completion = [‘’]
let g:ycm_confirm_extra_conf=0 "关闭加载.ycm_extra_conf.py提示
let g:ycm_collect_identifiers_from_tags_files=1 " 开启 YCM 基于标签引擎
let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项
let g:ycm_cache_omnifunc=0 " 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_seed_identifiers_with_syntax=1 " 语法关键字补全
nnoremap :YcmForceCompileAndDiagnostics "force recomile with syntastic
"nnoremap lo :lopen "open locationlist
"nnoremap lc :lclose "close locationlist
inoremap
"在注释输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0
nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration " 跳转到定义处
ctags
=====
用来遍历源代码文件生成tags文件,这些tags文件能被编辑器或其它工具用来快速查找定位源代码中的符号(tag/symbol),如变量名,函数名等
Install Ctags
brew update
brew install ctags-exuberant
Config ctags
最后
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长,自己不成体系的自学效果低效漫长且无助。
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点!不论你是刚入门Android开发的新手,还是希望在技术上不断提升的资深开发者,这些资料都将为你打开新的学习之门!
如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。**
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长,自己不成体系的自学效果低效漫长且无助。
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-AMRDIm9X-1714938272154)]
[外链图片转存中…(img-EQs89omJ-1714938272155)]
[外链图片转存中…(img-IQ2AhfR2-1714938272155)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点!不论你是刚入门Android开发的新手,还是希望在技术上不断提升的资深开发者,这些资料都将为你打开新的学习之门!
如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!