vim学习及配置

~/.vimrc

set tabstop=4
set softtabstop=4
set shiftwidth=4

set ts=4
set expandtab
set autoindent
set hlsearch
set showmode
set nofoldenable

syntax enable
syntax on
set encoding=utf8
set fileencoding=utf8
language messages zh_CN.utf-8

set tags+=tags,tags.vendors
map <F2> :NERDTreeToggle<CR>
map <F3> :set number<CR>
map <F12> :!ctags -f tags.vendors vendor<CR>
map <F4> :!ctags app<CR>

autocmd BufWritePost *.php silent execute “![ -d app ] && ctags app”

function! IPhpInsertUse()
call PhpInsertUse()
call feedkeys(‘a’, ‘n’)
endfunction
autocmd FileType php inoremap <Leader>u <Esc>:call IPhpInsertUse()<CR>
autocmd FileType php noremap <Leader>u :call PhpInsertUse()<CR>
function! IPhpExpandClass()
call PhpExpandClass()
call feedkeys(‘a’, ‘n’)
endfunction
autocmd FileType php inoremap <Leader>e <Esc>:call IPhpExpandClass()<CR>
autocmd FileType php noremap <Leader>e :call PhpExpandClass()<CR>

let g:php_namespace_sort_after_insert = 1
autocmd FileType php set omnifunc=phpcomplete#CompletePHP

colorscheme solarized

if has (‘gui_running’)
set background=light
else
set background=dark
set t_Co=256
endif

let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
hi IndentGuidesOdd ctermbg=darkgray
hi IndentGuidesEven ctermbg=darkgray

set shell=sh
let g:NERDTreeShowIgnoredStatus = 0

let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "✹",
    \ "Staged"    : "✚",
    \ "Untracked" : "✭",
    \ "Renamed"   : "➜",
    \ "Unmerged"  : "═",
    \ "Deleted"   : "✖",
    \ "Dirty"     : "✗",
    \ "Clean"     : "✔︎",
    \ 'Ignored'   : '☒',
    \ "Unknown"   : "?"
    \ }

let g:solarized_termcolors=256
"设置颜色为256色,默认为16
let g:solarized_termtrans=0
"设置背景色为透明,使用终端的背景色
let g:solarized_degrade=0
"强制使用256级色彩,只用于测试,默认为0
let g:solarized_bold=1
"使用粗体,默认为1
let g:solarized_underline=1
"使用下划线,默认为1
let g:solarized_italic=1
"使用斜体,默认为1
let g:solarized_contrast="normal"
"设置对比度,默认为normal,还可以设置为low或者high
let g:solarized_visibility="normal"
"设置空白符的可见性,默认为normal,还可以设置为low或者high
let g:solarized_hitrail=0
"光标高亮时,空白符仍可见,默认为0
let g:solarized_menu=1
"启用solarized_menu菜单,默认为1
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap < <><ESC>i
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap { {}<ESC>i<CR><ESC>O 

~/.bashrc

if [ -e /lib/terminfo/x/xterm-256color ]
then
export TERM=’xterm-256color’
else
export TERM=’xterm-color’
fi

~/.ctags

-R
–languages=php
–php-kinds=cif
–exclude=*test*
–exclude=vendor/*/vendor
–fields=+aimS

添加lua支持

sudo apt install vim-nox

插件

ctags

NERDTree

arnaud-lb/vim-php-namespace

shawncplus/phpcomplete

indent_guides

phpns

Xuyuanp/nerdtree-git-plugin

altercation/vim-colors-solarized

preservim/nerdcommenter

总结:

◈ 安装 03%

◈ 新手指南 04%

◈ 移动光标 05%

◈ 退出 08%

◈ 删除 08%

◈ 修改 10%

◈ 撤销 11%

◈ 复制粘贴剪切 12%

◈ 状态 13%

◈ 查找 13%

◈ 替换 15%

◈ 折叠 16%

◈ 执行外部命令 17%

◈ .vimrc 18%

◈ 基本配置 23%

◈ 取消备份 23%

◈ 文件编码 23%

◈ 显示行号 24%

◈ 取消换行 24%

◈ 显示光标当前位置 25%

◈ 设置缩进 25%

◈ 突出显示当前行 26%

◈ 查找 27%

◈ 左下角显示当前 vim 模式 27%

◈ 代码折叠 28%

◈ 主题 29%

◈ 插件配置 32%

◈ 树形目录 32%

◈ 代码,引号,路径补全 46%

◈ 语法高亮,检查 50%

◈ 文件,代码搜索 56%

◈ 加强版状态栏 59%

◈ 代码注释 63%

◈ git 69%

◈ Markdown 71%

◈ Emmet 74%

◈ html 5 76%

◈ css 3 77%

◈ JavaScipt 82%

◈ React 91%

◈ Prettier 93%

◈ 总结 97%