Skip to content

Instantly share code, notes, and snippets.

@dinhmai74
Last active November 18, 2019 23:59
Show Gist options
  • Save dinhmai74/a0fada59f15f5b253d121335144ccfd6 to your computer and use it in GitHub Desktop.
Save dinhmai74/a0fada59f15f5b253d121335144ccfd6 to your computer and use it in GitHub Desktop.
nvim init file
set shell=zsh " Set bash as the prompt for Vim
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler " show the cursor position all the tim
set showcmd " display incomplete commands
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
set noshowmode
set timeoutlen=1000
set ttimeoutlen=0
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
set inccommand=nosplit
set scrolloff=3
set list listchars=tab:»·,trail:· " Display extra whitespace characters
set hidden
set inccommand=nosplit
" Line numbers
set number
set numberwidth=5
set nocompatible
set autowrite " Automatically :write before running commands
filetype off " required
call plug#begin('~/.local/share/nvim/plugged')
"theme
"
Plug 'sheerun/vim-polyglot'
Plug 'trevordmiller/nova-vim'
Plug 'itchyny/lightline.vim' "beauty line
Plug 'terryma/vim-multiple-cursors'
"Mangers file
Plug 'airblade/vim-rooter'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
"Better vim
Plug 'tpope/vim-surround'
Plug 'easymotion/vim-easymotion' "find word
Plug 'kabbamine/vcoolor.vim' "find good color
"Snippets
Plug 'honza/vim-snippets'
Plug 'tmhedberg/SimpylFold' "fold code
Plug 'chun-yang/auto-pairs' "insert,or delete brackets,parents,quote in pairs
Plug 'alvan/vim-closetag' "auto close tags
"react snippets
Plug 'mxw/vim-jsx'
"html snippets
Plug 'rstacruz/sparkup'
"css
Plug 'mattn/emmet-vim'
Plug 'ap/vim-css-color'
"Beautyvim
Plug 'bling/vim-airline'
"js syntax
Plug 'jelera/vim-javascript-syntax'
Plug 'pangloss/vim-javascript'
Plug 'isruslan/vim-es6'
"typescript
Plug 'leafgarland/typescript-vim'
"react syntax
Plug 'jaxbot/syntastic-react'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'mtscout6/vim-cjsx'
Plug 'jsx/jsx.vim'
Plug 'jsx/jsx'
Plug 'vim-syntastic/syntastic'
Plug 'w0rp/ale'
"Suggestion
Plug 'SirVer/ultisnips'
Plug 'strml/jsxhint'
Plug 'epilande/vim-es2015-snippets'
Plug 'epilande/vim-react-snippets'
call plug#end()
"install deoplete for nvim
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
set runtimepath+=~/.vim/plugged/deoplete.nvim
let g:deoplete#enable_at_startup = 1
let g:deoplete#file#enable_buffer_path = 1
filetype plugin indent on " required
syntax enable
set encoding=utf-8
set nu
"set close tag
:set tabstop=2
:set shiftwidth=2
:set expandtab
"set tab to go next suggestion instead of ctrl-n
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
map <C-m> :NERDTreeToggle<CR>
nmap ev :tabedit $MYVIMRC<CR>
"swap screen
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
nnoremap <c-h> <c-w>h
"custom airblad/vim-rooter
"let g:rooter_change_directory_for_non_project_files = 'current'
"set path to relative
:autocmd InsertEnter * let save_cwd = getcwd() | set autochdir
:autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd)
" easymotion
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
"
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
map N <Plug>(easymotion-prev)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
" Mouse ( see :help mouse-using )
syntax enable
set mouse=nvic
colorscheme nova
set autoread
au CursorHold * checktime
autocmd BufEnter,FocusGained * checktime
" Clipbord
set clipboard+=unnamedplus " use clipboard ( see : help clipboard )
"set tab to go next suggestion instead of ctrl-n
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" filenames like *.xml, *.xhtml, ...
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.js,*jsx,*.ts'
let g:closetag_emptyTags_caseSensitive = 1
let g:vcoolor_map = '<C-c>'
"Quick fold
nnoremap <space> za
nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>
set foldmethod=indent
set foldlevel=99
set encoding=utf-8
let g:jsx_ext_required = 0
let g:jsx_pragma_required = 1
"ultisnips
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsSnippetDirectories = ['~/.config/nvim/UltiSnips', 'UltiSnips']
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
set pastetoggle=<F2>
"syntastic for react settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_typescript_checkers = ['tslint', 'tsc']
let g:syntastic_javascript_eslint_exe = 'npm run lint --'
let g:ale_fixers = {
\ 'javascript': [
\ 'eslint',
\ 'prettier',
\ 'tslint',
\ 'flow'
\ ],
\}
let g:ale_linters = {
\ 'javascript': ['eslint','flow'],
\}
let g:ale_fix_on_save = 1
nmap <F8> <Plug>(ale_fix)
"deoplete- flow setting
function! StrTrim(txt)
return substitute(a:txt, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
endfunction
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if g:flow_path != 'flow not found'
let g:deoplete#sources#flow#flow_bin = g:flow_path
endif
" Use a slightly slimmer error pointer
let g:ale_sign_error = '✖'
hi ALEErrorSign guifg=#DF8C8C
let g:ale_sign_warning = '⚠'
hi ALEWarningSign guifg=#F2C38F
"typescript setitng
let g:typescript_opfirst='\%([<>=,?^%|*/&]\|\([-:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)'
let g:typescript_compiler_binary = 'tsc'
let g:typescript_compiler_options = ''
" Specify a directory for plugins
set notermguicolors
set shell=zsh " Set bash as the prompt for Vim
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set number
set numberwidth=5
set nowritebackup
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler " show the cursor position all the tim
set showcmd " display incomplete commands
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
set noshowmode
set timeoutlen=1000
set ttimeoutlen=0
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
set inccommand=nosplit
set scrolloff=3
set listchars=tab:▸\ ,trail:· " Display extra whitespace characters
set hidden
set inccommand=nosplit
filetype off " required
call plug#begin('~/.vim/plugged')
" solid sytanc
Plug 'sheerun/vim-polyglot'
Plug 'itchyny/lightline.vim' "beauty line
Plug 'tmhedberg/SimpylFold' "fold code
" jsx highlight"
Plug 'maxmellon/vim-jsx-pretty'
Plug 'frazrepo/vim-rainbow'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'jiangmiao/auto-pairs'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
Plug 'luochen1990/rainbow'
"Better vim
Plug 'tpope/vim-surround'
Plug 'easymotion/vim-easymotion'
Plug 'alvan/vim-closetag' "auto close tags
Plug 'bling/vim-airline'
Plug 'vim-syntastic/syntastic'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
Plug 'ctrlpvim/ctrlp.vim' " fuzzy find files
Plug 'scrooloose/nerdcommenter'
Plug 'terryma/vim-multiple-cursors'
"Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'christoomey/vim-tmux-navigator'
Plug 'morhetz/gruvbox'
Plug 'HerringtonDarkholme/yats.vim' " TS Syntax
" Initialize plugin system
call plug#end()
inoremap jk <ESC>
nmap <C-m> :NERDTreeToggle<CR>
"vmap ++ <plug>NERDCommenterToggle
"nmap ++ <plug>NERDCommenterToggle
" open NERDTree automatically
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * NERDTree
"let g:NERDTreeGitStatusWithFlags = 1
"let g:WebDevIconsUnicodeDecorateFolderNodes = 1
"let g:NERDTreeGitStatusNodeColorization = 1
"let g:NERDTreeColorMapCustom = {
"\ "Staged" : "#0ee375",
"\ "Modified" : "#d9bf91",
"\ "Renamed" : "#51C9FC",
"\ "Untracked" : "#FCE77C",
"\ "Unmerged" : "#FC51E6",
"\ "Dirty" : "#FFBD61",
"\ "Clean" : "#87939A",
"\ "Ignored" : "#808080"
"\ }
let g:NERDTreeIgnore = ['^node_modules$']
" vim-prettier
"let g:prettier#quickfix_enabled = 0
"let g:prettier#quickfix_auto_focus = 0
" prettier command for coc
command! -nargs=0 Prettier :CocCommand prettier.formatFile
" run prettier on save
"let g:prettier#autoformat = 0
"autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
" ctrlp
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
" j/k will move virtual lines (lines that wrap)
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
set smarttab
set cindent
set tabstop=2
set shiftwidth=2
" always uses spaces instead of tab characters
set expandtab
" sync open file with NERDTree
" " Check if NERDTree is open or active
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
" file, and we're not in vimdiff
function! SyncTree()
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction
" Highlight currently open buffer in NERDTree
autocmd BufEnter * call SyncTree()
" coc config
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-prettier',
\ 'coc-json',
\ ]
" from readme
" if hidden is not set, TextEdit might fail.
set hidden " Some servers have issues with backup files, see #649 set nobackup set nowritebackup " Better display for messages set cmdheight=2 " You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Or use `complete_info` if your vim support it, like:
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap for rename current word
nmap <F2> <Plug>(coc-rename)
" Remap for format selected region
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap for do codeAction of current line
nmap <leader>ac <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf <Plug>(coc-fix-current)
" Create mappings for function text object, requires document symbols feature of languageserver.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
" Use <C-d> for select selections ranges, needs server support, like: coc-tsserver, coc-python
nmap <silent> <C-d> <Plug>(coc-range-select)
xmap <silent> <C-d> <Plug>(coc-range-select)
" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" use `:OR` for organize import of current buffer
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add status line support, for integration with other plugin, checkout `:h coc-status`
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Using CocList
" Show all diagnostics
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
nmap ev :tabedit $MYVIMRC<CR>
colorscheme gruvbox
let g:jsx_ext_required = 1
let g:jsx_pragma_required = 1
"ultisnips
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsSnippetDirectories = ['~/.config/nvim/UltiSnips', 'UltiSnips']
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.js,*.tsx'
set autochdir
map <C-o> :NERDTreeToggle %<CR>
"set path to relative
:autocmd InsertEnter * let save_cwd = getcwd() | set autochdir
:autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd)
" easymotion
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
"
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
map N <Plug>(easymotion-prev)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
set autoread
"Quick fold
set foldmethod=indent
set foldlevel=99
set shell=zsh " Set bash as the prompt for Vim
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
set noshowmode
set timeoutlen=1000
set ttimeoutlen=0
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
set scrolloff=3
set list listchars=tab:»·,trail:· " Display extra whitespace characters
set hidden
set inccommand=nosplit
" Line numbers
set number
set numberwidth=5
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
"set rtp+=~/.vim/bundle/Vundle.vim
call plug#begin('~/.vim/plugged')
" theme
Plug 'sheerun/vim-polyglot'
Plug 'trevordmiller/nova-vim'
"syntax
Plug 'tpope/vim-fugitive'
Plug 'jelera/vim-javascript-syntax'
Plug 'raimon49/requirements.txt.vim'
Plug 'itchyny/lightline.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'stegtmeyer/find-complete'
"-----python -----""
Plug 'klen/python-mode'
Plug 'vim-scripts/indentpython.vim'
Plug 'hdima/python-syntax'
Plug 'hynek/vim-python-pep8-indent'
Plug 'mitsuhiko/vim-python-combined'
Plug 'mitsuhiko/vim-jinja'
Plug 'jmcantrell/vim-virtualenv'
" " Snippets are separated from the engine. Add this if you want them:
Plug 'honza/vim-snippets'
Plug 'godlygeek/tabular'
Plug 'bling/vim-airline'
Plug 'majutsushi/tagbar'
Plug 'tmhedberg/SimpylFold'
Plug 'davidhalter/jedi-vim'
Plug 'shawncplus/phpcomplete.vim'
Plug 'airblade/vim-rooter'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'mtscout6/vim-cjsx'
Plug 'jsx/jsx.vim'
Plug 'chun-yang/auto-pairs'
Plug 'alvan/vim-closetag'
Plug 'jaxbot/syntastic-react'
Plug 'jsx/jsx'
Plug 'strml/jsxhint'
Plug 'pangloss/vim-javascript'
Plug 'tomasr/molokai'
Plug 'mxw/vim-jsx'
Plug 'epilande/vim-react-snippets'
Plug 'tpope/vim-surround'
Plug 'kabbamine/vcoolor.vim'
Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
Plug 'ascenator/L9', {'name': 'newL9'}
Plug 'scrooloose/nerdtree'
Plug 'mattn/emmet-vim'
Plug 'ap/vim-css-color'
Plug 'easymotion/vim-easymotion'
Plug 'wincent/command-t'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'freeo/vim-kalisi'
Plug 'w0ng/vim-hybrid'
Plug 'isruslan/vim-es6'
"neovim react native
Plug 'sbdchd/neoformat'
Plug 'flowtype/vim-flow'
Plug 'vim-syntastic/syntastic'
Plug 'w0rp/ale'
"react syntax checking
Plug 'w0rp/ale'
Plug 'skywind3000/asyncrun.vim'
"Suggestion
Plug 'SirVer/ultisnips'
Plug 'strml/jsxhint'
Plug 'epilande/vim-es2015-snippets'
Plug 'epilande/vim-react-snippets'
Plug 'flowtype/vim-flow'
call plug#end()
filetype plugin indent on " required
set nu
map <C-m> :NERDTreeToggle<CR>
nmap ev :tabedit $MYVIMRC<CR>
"ultisnips
let g:UltiSnipsExpandTrigger="<c-j>"
"let g:UltiSnipsJumpForwardTrigger="<c-b>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsSnippetDirectories = ['~/.config/nvim/UltiSnips', 'UltiSnips']
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" <Leader>w{char} to move to {char}
map <Leader>w <Plug>(easymotion-bd-f)
set encoding=utf-8
nmap <Leader>w <Plug>(easymotion-overwin-f)
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:AutoPairsFlyMode = 0
let g:AutoPairsShortcutBackInsert = '<M-b>'
let g:user_emmet_leader_key='<C-y>'
let g:jsx_ext_required = 0
let g:jsx_pragma_required = 1
let g:syntastic_javascript_checkers = ['eslint']
set expandtab ts=4 sw=4 ai
let python_highlight_all = 1
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
set foldmethod=indent
set foldlevel=99
set encoding=utf-8
nnoremap <space> za
nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>
" filenames like *.xml, *.xhtml, ...
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.js'
let g:closetag_emptyTags_caseSensitive = 1
"colorscheme OceanicNext
colorscheme nova
:set guifont=Anonymous_Pro\ 18
let g:vcoolor_map = '<C-c>'
set laststatus=2
set ttimeoutlen=50
nmap <F7> :TagbarToggle<CR>
" easymotion
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
"
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1
set runtimepath+=~/.vim/plugged/deoplete.nvim
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#deoplete_onmni_patterns = get(g:, 'deoplete#force_omni_input_patterns', {})
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>"
let g:deoplete#sources = {}
let g:deoplete#sources._=['omni', 'buffer', 'member', 'tag', 'ultisnips', 'file']
filetype plugin on
set omnifunc=syntaxcomplete#Complete
set autoread
au CursorHold * checktime
autocmd BufEnter,FocusGained * checktime
"eslint setting
:set notermguicolors
:set termguicolors
:autocmd InsertEnter * let save_cwd = getcwd() | set autochdir
:autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd)
set tabstop=2
set shiftwidth=2
set expandtab
"syntastic for react settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let g:ale_fixers = {
\ 'javascript': [
\ 'eslint',
\ 'prettier',
\ 'flow'
\ ],
\}
let g:ale_linters = {
\ 'javascript': ['eslint','flow'],
\}
let b:ale_fixers = ['prettier', 'eslint']
let g:ale_fix_on_save = 1
nmap <F8> <Plug>(ale_fix)
"deoplete- flow setting
function! StrTrim(txt)
return substitute(a:txt, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
endfunction
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if g:flow_path != 'flow not found'
let g:deoplete#sources#flow#flow_bin = g:flow_path
endif
" Use a slightly slimmer error pointer
let g:ale_sign_error = '✖'
hi ALEErrorSign guifg=#DF8C8C
let g:ale_sign_warning = '⚠'
hi ALEWarningSign guifg=#F2C38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment