SHARE
TWEET

Untitled

a guest Jul 17th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. " Plugin
  2. call plug#begin('~/.vim/plugged')
  3. Plug 'mhinz/vim-startify'
  4. Plug 'skielbasa/vim-material-monokai'
  5. Plug 'mhartington/oceanic-next'
  6. Plug 'lifepillar/vim-solarized8'
  7. Plug 'itchyny/lightline.vim'
  8. Plug 'scrooloose/nerdtree'
  9. Plug 'Yggdroot/LeaderF'
  10. Plug 'mileszs/ack.vim'
  11. Plug 'mattn/emmet-vim'
  12. Plug 'scrooloose/nerdcommenter'
  13. Plug 'tpope/vim-surround'
  14. Plug 'tpope/vim-repeat'
  15. Plug 'jiangmiao/auto-pairs'
  16. Plug 'luochen1990/rainbow'
  17. " Plug 'bounceme/poppy.vim'
  18. Plug 'iamcco/markdown-preview.nvim'
  19. Plug 'easymotion/vim-easymotion'
  20. Plug 'ntpeters/vim-better-whitespace'
  21. Plug 'prettier/vim-prettier'
  22. " Plug 'pangloss/vim-javascript'
  23. Plug 'maxmellon/vim-jsx-pretty'
  24. call plug#end()
  25.  
  26. " theme
  27. set background=dark
  28. colorscheme OceanicNext
  29. set termguicolors
  30.  
  31. " base
  32. syntax on
  33. filetype on                     " filetype check
  34. filetype plugin on              " Enable filetype plugins
  35. filetype indent on
  36. set history=1000
  37. set nocompatible                " don't bother with vi compatibility
  38. set autoread                    " reload files when changed on disk
  39. set shortmess=atOI
  40. set wildmenu
  41. set noswapfile
  42. set magic                       " for regular expressions turn magic on
  43. set foldmethod=indent
  44. set foldlevel=99
  45.  
  46. " show
  47. set guifont=input:h14
  48. set colorcolumn=280             " Highlight Column
  49. set linebreak
  50. set ruler                       " show the current row and column
  51. set noshowmode
  52. set number                      " show line numbers
  53. set showcmd                     " display incomplete commands
  54. set showmode                    " display current modes
  55. set showmatch                   " jump to matches when entering parentheses
  56. set matchtime=2                 " tenths of a second to show the matching parenthesis
  57. set laststatus=2
  58. set cursorcolumn
  59. set cursorline
  60. set guioptions=
  61.  
  62. " search
  63. set hlsearch                    " highlight searches
  64. set incsearch                   " do incremental searching, search as you type
  65. set ignorecase                  " ignore case when searching
  66. set smartcase                   " no ignorecase if Uppercase char present
  67. nnoremap <CR> :noh<CR>
  68.  
  69. " indent and tab
  70. set autoindent
  71. set smartindent
  72. set shiftwidth=2
  73. set tabstop=2
  74. set softtabstop=2               " insert mode tab and backspace use 2 spaces
  75. set smarttab
  76. set expandtab                   " expand tabs to spaces
  77. set shiftround
  78.  
  79. autocmd FileType python :set tabstop=4 shiftwidth=4 tabstop=4
  80.  
  81. " ============= key mapping ===============
  82.  
  83. let mapleader = "\<Space>"
  84.  
  85. noremap Y "*y
  86.  
  87. inoremap jk <esc>
  88.  
  89. vnoremap < <gv
  90. vnoremap > >gv
  91.  
  92. noremap H ^
  93. noremap L $
  94.  
  95. nnoremap <c-j> <c-w>j
  96. nnoremap <c-k> <c-w>k
  97. nnoremap <c-l> <c-w>l
  98. nnoremap <c-h> <c-w>h
  99.  
  100. nnoremap <Tab> gt
  101. nnoremap <S-Tab> gT
  102. nnoremap <silent> <S-t> :tabnew<CR>
  103.  
  104. noremap <leader>z :bp<CR>
  105. noremap <leader>x :bn<CR>
  106.  
  107. " =============== plugins =================
  108.  
  109. " lightline.vim
  110. let g:lightline = {'colorscheme': 'solarized'}
  111.  
  112. " nerdtree
  113. noremap <C-n> :NERDTreeToggle<CR>
  114.  
  115. " LeaderF
  116. let g:Lf_ShortcutB = '<leader><leader>b'
  117. let g:Lf_DefaultMode = 'NameOnly'
  118.  
  119. " ack.vim
  120. nnoremap <Leader>a :Ack<Space>
  121.  
  122. " emmet-vim
  123. let g:user_emmet_leader_key = ';'
  124. let g:user_emmet_settings = {
  125. \    'javascript': {
  126. \        'extends': 'html',
  127. \        'empty_element_suffix': ' />',
  128. \        'snippets': {
  129. \            're': "import React from \"react\"",
  130. \            'f1' : "(|) => {\n\t|\n}",
  131. \            'f2' : "(|) => (\n\t|\n)",
  132. \        }
  133. \    },
  134. \}
  135.  
  136. " nerdcommenter
  137. let g:NERDSpaceDelims = 1
  138.  
  139. " vim-better-whitespace
  140. let g:strip_whitespace_on_save=1
  141.  
  142. " rainbow
  143. let g:rainbow_active = 1
  144.  
  145. " poppy.vim
  146. " au! cursormoved *.js call PoppyInit()
  147.  
  148. " markdown-preview
  149. nmap <C-p> <Plug>MarkdownPreview
  150.  
  151. " vim-easymotion
  152. map <Leader> <Plug>(easymotion-prefix)
  153. map <Leader>h <Plug>(easymotion-linebackward)
  154. map <Leader>l <Plug>(easymotion-lineforward)
  155.  
  156. " vim-prettier
  157. let g:prettier#quickfix_enabled = 0
  158. let g:prettier#config#bracket_spacing = 'true'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top