Skip to content

Instantly share code, notes, and snippets.

@tinylamb
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save tinylamb/b6e5859ce7c143165bc5 to your computer and use it in GitHub Desktop.

Select an option

Save tinylamb/b6e5859ce7c143165bc5 to your computer and use it in GitHub Desktop.

Revisions

  1. tinylamb revised this gist Jul 10, 2014. 1 changed file with 3 additions and 11 deletions.
    14 changes: 3 additions & 11 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -80,12 +80,11 @@ if has('vim_starting')
    set runtimepath+=~/.vim/bundle/vundle.vim
    endif
    "set rtp+=~/.vim/bundle/vundle.vim

    call vundle#begin('/Users/tinylamb/.vim/bundle')

    " let Vundle manage Vundle,required!
    Plugin 'gmarik/Vundle.vim'


    " My Bundles here:
    " original repos on github
    "
    @@ -100,7 +99,6 @@ nnoremap <leader>\ :YcmCompleter GoToDefinitionElseDeclaration<CR>

    Plugin 'scrooloose/nerdtree'

    Plugin 'mattn/webapi-vim'

    Plugin 'mattn/gist-vim'
    @@ -112,7 +110,6 @@ Plugin 'plasticboy/vim-markdown'
    "--vim-markdown
    let g:vim_markdown_folding_disabled=1


    " plugin from http://vim-scripts.org/vim/scripts.html
    Plugin 'taglist.vim'
    "--taglist setting
    @@ -123,15 +120,11 @@ let Tlist_Exit_OnlyWindow = 1
    "只显示当前文件的tag结构
    let Tlist_Show_One_File = 1

    "Plugin 'word_complete.vim'

    Plugin 'c.vim'
    "--Csupport
    let g:C_SourceCodeExtensions = 'c C cpp CPP'


    Plugin 'L9'

    Plugin 'FuzzyFinder'

    Plugin 'winmanager'
    @@ -149,14 +142,13 @@ let g:winManagerWidth = 30

    Plugin 'NERD_tree-Project'
    Plugin 'bufexplorer.zip'
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'


    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'
    " All of your Plugins must be added before the following line
    call vundle#end()
    filetype plugin indent on " required!

    "
    " Brief help
    " :BundleList - list configured bundles
  2. tinylamb revised this gist Jul 10, 2014. 1 changed file with 115 additions and 73 deletions.
    188 changes: 115 additions & 73 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -1,96 +1,120 @@
    "vundle setting
    set nocompatible " be iMproved
    filetype off " required!
    set rtp+=~/.vim/bundle/vundle.vim
    call vundle#begin('/Users/tinylamb/.vim/bundle')

    " let Vundle manage Vundle,required!
    Plugin 'gmarik/Vundle.vim'

    " My Bundles here:
    " original repos on github
    Plugin 'Valloric/YouCompleteMe'
    Plugin 'scrooloose/nerdtree'
    Plugin 'mattn/webapi-vim'
    Plugin 'mattn/gist-vim'
    " plugin from http://vim-scripts.org/vim/scripts.html
    Plugin 'taglist.vim'
    Plugin 'word_complete.vim'
    Plugin 'c.vim'
    Plugin 'L9'
    Plugin 'FuzzyFinder'
    Plugin 'winmanager'
    Plugin 'NERD_tree-Project'
    Plugin 'bufexplorer.zip'
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'


    " All of your Plugins must be added before the following line
    call vundle#end()
    filetype plugin indent on " required!
    "
    " Brief help
    " :BundleList - list configured bundles
    " :BundleInstall(!) - install(update) bundles
    " :BundleSearch(!) foo - search(or refresh cache first) for foo
    " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
    " see :h vundle for more details or wiki for FAQ
    ""General {{{
    set nocompatible

    set encoding=utf-8
    ""set langmenu=zh_CN.UTF-8
    ""language message zh_CN.UTF-8

    "---偏好设置
    set number
    set ruler
    set mouse=a
    colorscheme desert
    set gfn=Consolas:h16
    set lines=36 columns=100
    winpos 246 73
    set showcmd
    set ignorecase
    set incsearch
    "chinese code
    set encoding=utf-8
    set langmenu=zh_CN.UTF-8
    language message zh_CN.UTF-8
    "filetype test
    :filetype plugin indent on
    set et
    set ci
    set shiftwidth=4
    "text width setting

    ""}}}

    ""Visual {{{
    syntax on

    set number
    autocmd ColorScheme * hi LineNr guifg=#636363

    set ruler
    set mouse=a
    set mousehide
    set showcmd

    autocmd FileType * setlocal textwidth=79 formatoptions+=t

    if has('gui_running')
    colorscheme desert
    set gfn=Consolas:h16
    set lines=36 columns=100
    winpos 246 73
    endif

    "---自动补全
    "auto complete
    autocmd ColorScheme * hi Pmenu guifg=#f6f3e8 guibg=#444444 ctermfg=230 ctermbg=238 cterm=none
    autocmd ColorScheme * hi PmenuSel guifg=#000000 guibg=#cae682 ctermfg=16 ctermbg=150 cterm=none
    "highlight PmenuSbar ctermfg=2 ctermbg=3 guifg=#ff0000 guibg=#00ff00
    "highlight PmenuThumb ctermfg=2 ctermbg=3 guifg=#ff0000 guibg=#00ff00

    ""}}}

    ""key mapping{{{

    inoremap ( ()<LEFT>
    inoremap [ []<LEFT>
    inoremap { {}<LEFT>
    inoremap " ""<LEFT>
    inoremap ' ''<LEFT>
    "define c function
    nmap \df yyGo<ESC>p$cw{<CR>


    "---快捷键设置
    ".taglist / winmanager
    ""map <silent> <F1> :TlistToggle<cr>
    map <silent> <F1> :WMToggle<cr>
    ".f2 to compile
    map <F2> :call OneFileMake()<CR>
    "fn + F1 open NerdTree
    nmap <silent> <F1> :WMToggle<cr>
    "fn + F2 to compile
    nmap <F2> :call OneFileMake()<CR>
    fun! OneFileMake()
    set makeprg=clang\ -W\ -o\ %<\ %
    if &filetype=="c"
    set makeprg=clang\ -W\ -o\ %<\ %
    elseif &filetype=="cpp"
    set makeprg=clang\ -W\ -o\ %<\ %\ -lstdc++
    endif
    execute "w"
    execute "make"
    execute "cw"
    endfunc
    ".f3 to run
    map <F3> :!./%< <CR>
    "fn + F3 to run
    nmap <F3> :!./%< <CR>
    ""}}}

    "" Scripts and Plugins {{{
    if has('vim_starting')
    set nocompatible
    filetype off
    set runtimepath+=~/.vim/bundle/vundle.vim
    endif
    "set rtp+=~/.vim/bundle/vundle.vim

    call vundle#begin('/Users/tinylamb/.vim/bundle')

    " let Vundle manage Vundle,required!
    Plugin 'gmarik/Vundle.vim'

    " My Bundles here:
    " original repos on github
    "
    Plugin 'Valloric/YouCompleteMe'
    "--YCM setting
    "add pure c
    autocmd FileType c :let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf_c.py'
    autocmd FileType cpp :let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf_cpp.py'
    let g:ycm_complete_in_comments = 0
    let g:ycm_filetype_whitelist = {'c':1 ,'cpp':1 ,'python':1}
    nnoremap <leader>\ :YcmCompleter GoToDefinitionElseDeclaration<CR>

    Plugin 'scrooloose/nerdtree'

    Plugin 'mattn/webapi-vim'

    Plugin 'mattn/gist-vim'
    "--Gist setting
    let g:gist_open_browser_after_post = 1

    "---插件设置

    Plugin 'plasticboy/vim-markdown'
    "--vim-markdown
    let g:vim_markdown_folding_disabled=1


    " plugin from http://vim-scripts.org/vim/scripts.html
    Plugin 'taglist.vim'
    "--taglist setting
    let Tlist_Ctags_Cmd ='/usr/local/bin/ctags'
    let Tlist_Use_Right_Window = 1
    @@ -99,15 +123,19 @@ let Tlist_Exit_OnlyWindow = 1
    "只显示当前文件的tag结构
    let Tlist_Show_One_File = 1

    "Plugin 'word_complete.vim'

    Plugin 'c.vim'
    "--Csupport
    let g:C_SourceCodeExtensions = 'c C cpp CPP'

    "YCM setting
    "add pure c
    let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
    let g:ycm_complete_in_comments = 0
    let g:ycm_filetype_whitelist = {'c':1 ,'cpp':1 ,'python':1}
    nnoremap <leader>\ :YcmCompleter GoToDefinitionElseDeclaration<CR>

    "winmanager setting
    Plugin 'L9'

    Plugin 'FuzzyFinder'

    Plugin 'winmanager'
    "--winmanager setting
    let g:NERDTree_title = "[NERDTree]"
    function! NERDTree_Start()
    exec "NERDTreeToggle"
    @@ -119,8 +147,22 @@ endfunction
    let g:winManagerWindowLayout="NERDTree|TagList,BufExplorer"
    let g:winManagerWidth = 30

    "Gist setting
    let g:gist_open_browser_after_post = 1
    Plugin 'NERD_tree-Project'
    Plugin 'bufexplorer.zip'
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'


    " All of your Plugins must be added before the following line
    call vundle#end()
    filetype plugin indent on " required!

    "
    " Brief help
    " :BundleList - list configured bundles
    " :BundleInstall(!) - install(update) bundles
    " :BundleSearch(!) foo - search(or refresh cache first) for foo
    " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
    "
    " see :h vundle for more details or wiki for FAQ

  3. tinylamb revised this gist Jun 17, 2014. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,6 @@ filetype plugin indent on " required!
    " :BundleInstall(!) - install(update) bundles
    " :BundleSearch(!) foo - search(or refresh cache first) for foo
    " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
    "
    " see :h vundle for more details or wiki for FAQ


    @@ -125,4 +124,3 @@ let g:gist_open_browser_after_post = 1




  4. tinylamb revised this gist Jun 17, 2014. No changes.
  5. tinylamb created this gist Jun 17, 2014.
    128 changes: 128 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,128 @@
    "vundle setting
    set nocompatible " be iMproved
    filetype off " required!
    set rtp+=~/.vim/bundle/vundle.vim
    call vundle#begin('/Users/tinylamb/.vim/bundle')

    " let Vundle manage Vundle,required!
    Plugin 'gmarik/Vundle.vim'

    " My Bundles here:
    " original repos on github
    Plugin 'Valloric/YouCompleteMe'
    Plugin 'scrooloose/nerdtree'
    Plugin 'mattn/webapi-vim'
    Plugin 'mattn/gist-vim'
    " plugin from http://vim-scripts.org/vim/scripts.html
    Plugin 'taglist.vim'
    Plugin 'word_complete.vim'
    Plugin 'c.vim'
    Plugin 'L9'
    Plugin 'FuzzyFinder'
    Plugin 'winmanager'
    Plugin 'NERD_tree-Project'
    Plugin 'bufexplorer.zip'
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'


    " All of your Plugins must be added before the following line
    call vundle#end()
    filetype plugin indent on " required!
    "
    " Brief help
    " :BundleList - list configured bundles
    " :BundleInstall(!) - install(update) bundles
    " :BundleSearch(!) foo - search(or refresh cache first) for foo
    " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
    "
    " see :h vundle for more details or wiki for FAQ


    "---偏好设置
    set number
    set ruler
    set mouse=a
    colorscheme desert
    set gfn=Consolas:h16
    set lines=36 columns=100
    winpos 246 73
    set showcmd
    set ignorecase
    set incsearch
    "chinese code
    set encoding=utf-8
    set langmenu=zh_CN.UTF-8
    language message zh_CN.UTF-8
    "filetype test
    :filetype plugin indent on
    set et
    set ci
    set shiftwidth=4



    "---自动补全
    autocmd ColorScheme * hi Pmenu guifg=#f6f3e8 guibg=#444444 ctermfg=230 ctermbg=238 cterm=none
    autocmd ColorScheme * hi PmenuSel guifg=#000000 guibg=#cae682 ctermfg=16 ctermbg=150 cterm=none
    "highlight PmenuSbar ctermfg=2 ctermbg=3 guifg=#ff0000 guibg=#00ff00
    "highlight PmenuThumb ctermfg=2 ctermbg=3 guifg=#ff0000 guibg=#00ff00
    inoremap ( ()<LEFT>
    inoremap [ []<LEFT>
    inoremap { {}<LEFT>
    inoremap " ""<LEFT>
    inoremap ' ''<LEFT>


    "---快捷键设置
    ".taglist / winmanager
    ""map <silent> <F1> :TlistToggle<cr>
    map <silent> <F1> :WMToggle<cr>
    ".f2 to compile
    map <F2> :call OneFileMake()<CR>
    fun! OneFileMake()
    set makeprg=clang\ -W\ -o\ %<\ %
    execute "w"
    execute "make"
    execute "cw"
    endfunc
    ".f3 to run
    map <F3> :!./%< <CR>
    "---插件设置

    "--taglist setting
    let Tlist_Ctags_Cmd ='/usr/local/bin/ctags'
    let Tlist_Use_Right_Window = 1
    "如果taglist是最后一个窗口就退出vim
    let Tlist_Exit_OnlyWindow = 1
    "只显示当前文件的tag结构
    let Tlist_Show_One_File = 1


    "YCM setting
    "add pure c
    let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
    let g:ycm_complete_in_comments = 0
    let g:ycm_filetype_whitelist = {'c':1 ,'cpp':1 ,'python':1}
    nnoremap <leader>\ :YcmCompleter GoToDefinitionElseDeclaration<CR>
    "winmanager setting
    let g:NERDTree_title = "[NERDTree]"
    function! NERDTree_Start()
    exec "NERDTreeToggle"
    endfunction

    function! NERDTree_IsValid()
    return 1
    endfunction
    let g:winManagerWindowLayout="NERDTree|TagList,BufExplorer"
    let g:winManagerWidth = 30

    "Gist setting
    let g:gist_open_browser_after_post = 1