Merge branch 'master' of git.coding.net:linklink/mynote

This commit is contained in:
light 2018-10-22 20:35:11 +08:00
commit 4cfdf821ac
3 changed files with 40 additions and 32 deletions

1
vim/ftplugin/cpp.vim Normal file
View File

@ -0,0 +1 @@
set tags+=~/.vim/systag

0
vim/ftplugin/python.vim Normal file
View File

View File

@ -1,10 +1,13 @@
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize " set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
"注释插件
Plugin 'scrooloose/nerdcommenter'
" git 插件
Plugin 'https://github.com/tpope/vim-fugitive.git'
Plugin 'https://github.com/plytophogy/vim-virtualenv.git' Plugin 'https://github.com/plytophogy/vim-virtualenv.git'
let g:virtualenv_directory = '/home/light/workspace/tens/' let g:virtualenv_directory = '/home/light/workspace/tens/'
@ -66,50 +69,34 @@ map <leader>6 :b 6<CR>
map <leader>7 :b 7<CR> map <leader>7 :b 7<CR>
map <leader>8 :b 8<CR> map <leader>8 :b 8<CR>
map <leader>9 :b 9<CR> map <leader>9 :b 9<CR>
map q :bd<CR>
" ctags 配置 " ctags 配置
map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f .tags .<CR><CR> :TlistUpdate<CR> map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=Python -f .tags .<CR><CR>
imap <F5> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f .tags .<CR><CR> :TlistUpdate<CR> imap <F5> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages-force=Python -f .tags .<CR><CR>
set tags=tags set tags=tags
set tags+=./.tags set tags+=./.tags
set tags+=~/.vim/systags
" ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/systags /usr/include /usr/local/include " ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/systags /usr/include /usr/local/include
"set tags = "set tags =
Plugin 'taglist.vim' Plugin 'https://github.com/majutsushi/tagbar.git'
"ctags 配置:F3快捷键显示程序中的各种tags包括变量和函数等。 "ctags 配置:F3快捷键显示程序中的各种tags包括变量和函数等。
map <F3> :TlistToggle<CR> map <F3> :TagbarToggle<CR>
let Tlist_Ctags_Cmd="/usr/bin/ctags" let g:tagbar_ctags_bin="/usr/bin/ctags"
let Tlist_Use_Right_Window=1
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_WinWidt=25
Plugin 'The-NERD-tree' Plugin 'The-NERD-tree'
"NERDTree 配置:F2快捷键显示当前目录树 "NERDTree 配置:F2快捷键显示当前目录树
map <F2> :NERDTreeToggle<CR> map <F2> :NERDTreeToggle<CR>
let NERDTreeWinSize=25 let NERDTreeWinSize=25
call vundle#end() " required call vundle#end() " required
filetype plugin indent on " required
map <C-A> ggVGY
map! <C-A> <Esc>ggVGY
map <F12> gg=G
" 选中状态下 Ctrl+c 复制
vmap <C-c> "+y
" 在文件外修改时自动加载
set autoread set autoread
" quickfix模式
" make 项目
autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr> autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
"代码补全
set completeopt=preview,menu
"允许插件
filetype plugin on
"共享剪贴板
set clipboard=unnamed
"从不备份 "从不备份
set nobackup set nobackup
"make 运行 "make 运行
@ -119,8 +106,6 @@ set autowrite
set ruler " 打开状态栏标尺 set ruler " 打开状态栏标尺
set cursorline " 突出显示当前行 set cursorline " 突出显示当前行
set magic " 设置魔术 set magic " 设置魔术
set guioptions-=T " 隐藏工具栏
set guioptions-=m " 隐藏菜单栏
"set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\ "set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
" 设置在状态行显示的信息 " 设置在状态行显示的信息
set foldcolumn=0 set foldcolumn=0
@ -130,7 +115,7 @@ set foldenable " 开始折叠
" 不要使用vi的键盘模式而是vim自己的 " 不要使用vi的键盘模式而是vim自己的
set nocompatible set nocompatible
" 语法高亮 " 语法高亮
set syntax=on syntax on
" 去掉输入错误的提示声音 " 去掉输入错误的提示声音
set noeb set noeb
" 在处理未保存或只读文件的时候,弹出确认 " 在处理未保存或只读文件的时候,弹出确认
@ -176,6 +161,7 @@ set laststatus=2
set cmdheight=2 set cmdheight=2
" 侦测文件类型 " 侦测文件类型
filetype on filetype on
set backspace=indent,eol,start
" 载入文件类型插件 " 载入文件类型插件
filetype plugin on filetype plugin on
" 为特定文件类型载入相关缩进文件 " 为特定文件类型载入相关缩进文件
@ -193,6 +179,8 @@ set backspace=2
" 允许backspace和光标键跨越行边界 " 允许backspace和光标键跨越行边界
set whichwrap+=<,>,h,l set whichwrap+=<,>,h,l
" 可以在buffer的任何地方使用鼠标类似office中在工作区双击鼠标定位 " 可以在buffer的任何地方使用鼠标类似office中在工作区双击鼠标定位
map <space>ma :set mouse=a<CR>
map <space>mc :set mouse=c<CR>
set mouse=a set mouse=a
set selection=exclusive set selection=exclusive
set selectmode=mouse,key set selectmode=mouse,key
@ -231,3 +219,22 @@ filetype plugin indent on
set completeopt=longest,menu set completeopt=longest,menu
" 打开文件时返回编辑的光标地点
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Delete trailing white space on save, useful for some filetypes ;)
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
if has("autocmd")
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces()
endif