Skip to content

Commit

Permalink
添加文件搜索。
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 24, 2019
1 parent 069d9be commit ea3717c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "bundle/nerdtree"]
path = bundle/nerdtree
url = https://github.com/scrooloose/nerdtree
[submodule "bundle/ctrlp.vim"]
path = bundle/ctrlp.vim
url = https://github.com/ctrlpvim/ctrlp.vim
23 changes: 23 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,27 @@ nmap <Leader>tt :TagbarToggle<CR>

" >>>=========插件 vim-easymotion 配置============
map <Leader> <Plug>(easymotion-prefix)
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<


" >>>=========插件 ctrlpvim/ctrlp.vim 配置============
" 在没有显式启动目录的情况下调用时,
" CtrlP 将根据此变量设置其本地工作目录:
" a - 当前文件的目录,除非它是cwd的子目录
" r - 包含以下目录或文件之一的当前文件的最近祖先:.git .hg .svn .bzr _darcs
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows

" 忽略 .gitignore 中的文件
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" 使用 Vim 的 wildignore 和 CtrlP 自己的g `:ctrlp_custom_ignore` 排除文件和目录。
" 如果正在使用自定义列表命令,则会忽略排除项:
let g:ctrlp_custom_ignore = '\v(node_modules)'
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ vim搜索时默认是大小写敏感的,要想实现大小写不敏感的搜
set ignorecase
```

## 文件搜索

搜索文件有多个插件 [junegunn/fzf.vim](https://github.com/junegunn/fzf.vim)[Yggdroot/LeaderF](https://github.com/Yggdroot/LeaderF)[wincent/command-t](https://github.com/wincent/command-t)[kien/ctrlp.vim](https://github.com/kien/ctrlp.vim),这里使用的 [Ctrlp](https://github.com/kien/ctrlp.vim) 使用 <kbd>Ctrl</kbd><kbd>p</kbd> 启动文件搜索。

```bash
<ctrl+p> # 启动搜索
```

## 插件列表

这里面所有的插件,并不是都放到了我的 [.vimrc](./.vimrc) 文件中 .vimrc 配置文件中,是我个人喜欢并且习惯的配置。
Expand Down
1 change: 1 addition & 0 deletions bundle/ctrlp.vim
Submodule ctrlp.vim added at 2e773f
6 changes: 2 additions & 4 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ install_vim () {
if [[ -d "$HOME/.vimrc" ]]; then
if [[ "$(readlink $HOME/.vimrc)" =~ \.vimrc$ ]]; then
echo -e "${Blue}Installed .vimrc for vim${Color_off}"
# mv "$HOME/.vimrc" "$HOME/.vimrc_back"
# echo -e "${Blue}BackUp $HOME/.vimrc${Color_off}"
else
mv "$HOME/.vimrc" "$HOME/.vimrc_back"
echo -e "${Blue}BackUp $HOME/.vimrc${Color_off}"
ln -s "$HOME/.VimWeb/.vimrc" "$HOME/.vimrc"
echo -e "${Blue}Installed VimWeb/.vimrc for vim${Color_off}"
echo -e "${Blue}Installed .VimWeb/.vimrc for vim${Color_off}"
fi
else
ln -s "$HOME/.VimWeb/.vimrc" "$HOME/.vimrc"
echo -e "${Blue}Installed VimWeb/.vimrc for vim${Color_off}"
echo -e "${Blue}Installed .VimWeb/.vimrc for vim${Color_off}"
fi
}

Expand Down

0 comments on commit ea3717c

Please sign in to comment.