Skip to content

Instantly share code, notes, and snippets.

@htfy96
Created August 16, 2017 01:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save htfy96/0996ba99c87c9139f1ecbf55a5d5caf7 to your computer and use it in GitHub Desktop.
Save htfy96/0996ba99c87c9139f1ecbf55a5d5caf7 to your computer and use it in GitHub Desktop.
set shell=/bin/bash
syntax on
if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
filetype on
filetype plugin on
set autoindent
set nolazyredraw
set number
set shiftwidth=4
filetype off " required
" set the runtime path to include Vundle and initialize
call plug#begin('~/.nvim/bundle')
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
" The following are examples of different formats supported.
" Keep Plug commands between vundle#begin/end.
" plugin on GitHub repo
Plug 'posva/vim-vue', {'for': 'vue'}
Plug '2072/PHP-Indenting-for-vim', {'for': 'php'}
Plug 'editorconfig/editorconfig-vim'
Plug 'm2mdas/phpcomplete-extended', {'for': 'php'}
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/SyntaxRange'
Plug 'tpope/vim-fugitive'
Plug 'octol/vim-cpp-enhanced-highlight', {'for': 'cpp'}
Plug 'Mizuchi/STL-Syntax', {'for': 'cpp'}
Plug 'tpope/vim-markdown', {'for': 'markdown'}
Plug 'vim-scripts/Perfect-Dark'
Plug 'bling/vim-airline'
Plug 'mhinz/vim-startify'
Plug 'majutsushi/tagbar'
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeTabsToggle'] }
Plug 'scrooloose/nerdcommenter'
Plug 'tpope/vim-unimpaired'
Plug 'Shougo/vimshell.vim'
Plug 'xuhdev/SingleCompile'
Plug 'rust-lang/rust.vim', {'for': 'rust'}
Plug 'racer-rust/vim-racer', {'for': 'rust'}
"Plug 'scrooloose/syntastic'
"Plug 'Valloric/YouCompleteMe', {'do': 'python2 ./install.py --clang-completer'}
Plug 'benekastah/neomake'
Plug 'artur-shaik/vim-javacomplete2', {'for': 'java'}
Plug 'Shougo/vimproc.vim', {'do': 'make'}
Plug 'easymotion/vim-easymotion'
Plug 'othree/html5.vim', {'for': ['html', 'vue']}
Plug 'pangloss/vim-javascript', {'for': ['javascript', 'vue']}
Plug 'JulesWang/css.vim', {'for': ['css', 'vue']}
Plug 'mattn/jscomplete-vim', {'for': ['javascript', 'vue']}
Plug 'rking/ag.vim'
Plug 'mattn/webapi-vim', {'do': 'make'}
Plug 'mattn/gist-vim'
Plug 'ntpeters/vim-airline-colornum'
Plug 'gastonsimone/vim-dokumentary'
Plug 'EinfachToll/DidYouMean'
Plug 'tpope/vim-surround'
Plug 'godlygeek/csapprox'
Plug 'tpope/vim-rails', {'for': 'ruby'}
Plug 'vim-ruby/vim-ruby', {'for': 'ruby'}
Plug 'KabbAmine/zeavim.vim'
Plug 'mustache/vim-mustache-handlebars', {'for': ['html', 'vue']}
Plug 'def-lkb/vimbufsync'
Plug 'mxw/vim-jsx', {'for': ['javascript', 'jsx', 'vue']}
Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets'
Plug 'mattn/emmet-vim', {'for': ['html', 'vue']}
Plug 'lilydjwg/fcitx.vim'
Plug 'vim-scripts/a.vim'
Plug 'wannesm/wmgraphviz.vim'
Plug 'vim-scripts/matchit.zip'
Plug 'fatih/vim-go', {'for': 'go'}
" Plug 'Shougo/unite.vim'
Plug 'Shougo/denite.nvim'
Plug 'vim-scripts/gtags.vim'
Plug 'Shougo/deoplete.nvim'
Plug 'Rip-Rip/clang_complete', {'for': 'cpp'}
"Plug 'xaizek/vim-inccomplete'
Plug 'Shougo/neco-vim', {'for': 'vim'}
Plug 'Rip-Rip/clang_complete', {'for': 'cpp'}
Plug 'justinmk/vim-sneak'
"Plug 'lornix/vim-scrollbar'
Plug 'kassio/neoterm'
Plug 'ryanoasis/vim-devicons'
Plug 'haya14busa/incsearch.vim'
Plug 'haya14busa/incsearch-easymotion.vim'
Plug 'airblade/vim-rooter'
Plug 'jistr/vim-nerdtree-tabs', { 'on': ['NERDTreeToggle', 'NERDTreeTabsToggle'] }
Plug 'junegunn/rainbow_parentheses.vim'
Plug 'zchee/deoplete-jedi', {'for': 'python'}
Plug 'arakashic/chromatica.nvim', {'for': 'cpp'}
Plug 'rhysd/nyaovim-markdown-preview', {'for': 'markdown'}
call plug#end() " required
syntax on
set cursorline
set magic
" au VimEnter * set lines=37 columns=141
let g:rainbow#pairs = [['(', ')'], ['{', '}'], ['[', ']']]
autocmd FileType * RainbowParentheses
set timeout timeoutlen=3000 ttimeoutlen=100
" detect file type
filetype on
filetype indent plugin on
colorscheme PerfectDark
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"have Vim load indentation rules and plugins according to the detected filetype
filetype plugin indent on
endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set autowrite
set autoindent
set smartindent
set tabstop=4
set smarttab
set softtabstop=4
set noexpandtab!
set cindent
set cinoptions={0,1s,t0,n0,p2s,(03s,=.5s,>1s,=1s,:1s,l1
set showmatch
set linebreak
set whichwrap=b,s,<,>,[,]
set hidden " Hide buffers when they are abandoned
set mouse=a
set number
set history=50 " set command history to 50
set laststatus=2
set ruler
set showcmd
set showmode
"--find setting--
set incsearch
set hlsearch
set guifont=CamingoCode\ 11
let g:Guifont="CamingoCode\ 11"
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='luna'
let NERDTreeMinimalUI=1
let NERDTreeWinSize=25
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType java setlocal omnifunc=javacomplete#Complete
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
set guioptions=Pra
let g:vimshell_split_command = "vsplit"
let g:vimshell_popup_command = "vsplit"
let g:ycm_confirm_extra_conf = 0
let g:SingleCompile_showquickfixiferror = 1
let g:SingleCompile_silentcompileifshowquickfix = 1
" Key maps
noremap <F2> :NERDTreeTabsToggle<cr>
inoremap <F2> <C-o>:NERDTreeTabsToggle<cr>
nnoremap <F3> :Ttoggle<cr><C-w><C-w>A
inoremap <F3> <esc>:Ttoggle<cr><C-w><C-w>A
tnoremap <F3> <C-\><C-n>:Ttoggle<cr>
tnoremap <esc> <C-\><C-n>
tnoremap <C-w><C-w> <C-\><C-n><C-w><C-w>
noremap <F8> :Tagbar<cr>
inoremap <F8> <C-o>:Tagbar<cr>
noremap <F9> :SCCompile<cr>
inoremap <F9> <C-o>:SCCompile<cr>
noremap <S-F9> :make<cr>
inoremap <S-F9> <C-o>:make<cr>
noremap <C-F9> :SCCompileRun<cr>
inoremap <C-F9> <C-o>:SCCompileRun<cr>
noremap <F5> :!gnome-terminal -e 'bash -c %:p:r;read -p'<cr><cr>
inoremap <F5> <C-o>:!gnome-terminal -e 'bash -c %:p:r;read -p'<cr><cr>
noremap <C-F5> :!gnome-terminal -e 'bash -c "gdb %:p:r"'<cr><cr>
inoremap <C-F5> <C-o>:!gnome-terminal -e 'bash -c "gdb %:p:r"'<cr><cr>
noremap <F6> mpggvG$"+y`p
inoremap <F6> <C-o>mpggvG$"+y`p
noremap <A-n> :cnext<cr>
inoremap <A-n> <C-o>:cnext<cr>
noremap <A-p> :cprev<cr>
inoremap <A-p> <C-o>:cprev<cr>
noremap <A-h> :lcd %:h<cr>
inoremap <A-h> <left>
inoremap <A-j> <Down>
inoremap <A-k> <Up>
inoremap <A-l> <Right>
let g:syntastic_check_on_open = 1
let g:jsx_ext_required = 0
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:cpp_class_scope_highlight = 1
let g:startify_custom_header = map(split(system('fortune -s | cat'), '\n'), '" ". v:val') + ['','']
let g:unite_source_grep_max_candidates = 200
call denite#custom#var('file_rec', 'command',
\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
nnoremap <leader>/ :Denite grep:.<cr>
vnoremap <leader>/ y:Denite grep:.::<c-r>"<cr>
nnoremap <leader>t :Denite tab<cr>
nnoremap <leader>b :Denite buffer<cr>
nnoremap <leader>f :Denite file_rec<cr>
nnoremap <leader>l :Denite file<cr>
nnoremap <leader>j :Denite jump<cr>
let g:weather#area = 'shanghai,china'
let g:weather#appid = '51d68f0bedef9cd292167c334e26802d'
let cscopeprg = 'gtags-cscope'
let g:deoplete#enable_at_startup = 1
call deoplete#custom#set('_', 'matchers', ['matcher_head'])
"call deoplete#custom#set('_', 'ignore_filetype', ['c', 'cpp', 'python'])
inoremap <silent> <esc> <esc>:silent! call s:my_cr_function()<cr>
let g:inccomplete_showdirs = 1
"let g:deoplete#omni#input_patterns = {}
"let g:deoplete#omni#input_patterns.cpp = ['[^. *\t]\.\w*', '[^. *\t]\::\w*', '[^. *\t]\->\w*', '#include\s*[<"][^>"]*']
let g:deoplete#omni_patterns = {}
let g:deoplete#omni_patterns.cpp = '[^. *\t]\.\w*|[^. *\t]\::\w*|[^. *\t]\->\w*|#include\s*[<"][^>"]*'
let g:deoplete#omni#input_patterns={}
let g:deoplete#omni#input_patterns.cpp = ['[^. *\t]\.\w*','[^. *\t]\::\w*','[^. *\t]\->\w*','#include\s*[<"][^>"]*']
let g:deoplete#omni#input_patterns.php = '.+'
let g:clang_close_preview = 1
let g:clang_auto = 0
let g:clang_diagsopt = ''
let g:clang_verbose_pmenu = 1
let g:clang_pwheight = 4
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<BS>"
let g:clang_c_completeopt = 'menuone,preview,noselect,noinsert'
let g:clang_cpp_completeopt = 'menuone,preview,noselect,noinsert'
let g:clang_complete_auto = 0
let g:clang_auto_select = 0
let g:clang_omnicppcomplete_compliance = 0
let g:clang_make_default_keymappings = 0
let g:clang_use_library = 1
let g:clang_user_options = ' -std=c++14 -I/usr/include/c++/v1'
let g:inccomplete_addclosebracket = "none"
let g:inccomplete_autoselect = 0
autocmd BufWritePost * Neomake
"let g:scrollbar_thumb='|'
"let g:scrollbar_clear=' '
"highlight Scrollbar_thumb guibg=#444444
let g:neoterm_shell = "zsh"
let g:neoterm_position = "vertical"
let g:deoplete#enable_refresh_always = 1
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
let g:incsearch#auto_nohlsearch = 1
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
map z/ <Plug>(incsearch-easymotion-/)
map z? <Plug>(incsearch-easymotion-?)
map zg/ <Plug>(incsearch-easymotion-stay)
" Neovim-qt Guifont command
" Set the font to DejaVu Sans Mono:h13
let g:racer_cmd = "/home/lz/.cargo/bin/racer"
let $RUST_SRC_PATH="/usr/src/rust/src"
let g:tagbar_compact = 1
let g:tagbar_type_rust = {
\ 'ctagstype' : 'rust',
\ 'kinds' : [
\'n:Module',
\'s:Structural type',
\'i:Trait interface',
\'c:implementation',
\'f:Function',
\'g:Enum',
\'t:Type Alias',
\'v:Global variable',
\'M:Macro Definition',
\'m:Struct field',
\'e:Enum variant',
\'F:Method',
\]
\}
let GOPATH='/home/lz/code/gopath'
let g:neomake_cpp_enabled_makers=['clang']
let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-fsanitize=undefined","-g", "-O2", "-pthread", "-march=native"]
let g:python_host_prog = '/usr/bin/python2'
let g:python3_host_prog = '/usr/bin/python'
let g:markdown_fenced_languages = ['cpp', 'javascript', 'html', 'python', 'bash=sh']
let g:chromatica#highlight_feature_level = 0
let g:chromatica#compile_args = ["-std=c++14"]
let g:chromatica#enable_at_startup = 1
set tags+=~/kernelbuild/linux-4.8.1-raw/tags
let g:markdown_preview_eager = 1
" set guicursor=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment