SHARE
TWEET

Untitled

a guest Sep 15th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set encoding=utf-8
  2. set history=3001
  3.  
  4. set tabstop=4
  5. set tabstop=4
  6. set shiftwidth=4
  7. set expandtab
  8.  
  9. " set signcolumn=no                            " force the signcolumn to disappear
  10. set signcolumn=yes                         " force the signcolumn to appear
  11. " set signcolumn=auto                        " return the signcolumn to the default behaviour
  12. syntax enable
  13. syntax on
  14. set hls
  15. set termguicolors
  16.  
  17. " vundle
  18. filetype off
  19. set nocompatible
  20. set rtp+=~/.vim/bundle/Vundle.vim
  21. call vundle#begin()
  22. Plugin 'gmarik/Vundle.vim'
  23. Plugin 'fatih/vim-go'
  24. Plugin 'dracula/vim'
  25. Plugin 'Valloric/YouCompleteMe'
  26. Plugin 'zxqfl/tabnine-vim'
  27. Plugin 'HerringtonDarkholme/yats.vim'
  28. Plugin 'maxmellon/vim-jsx-pretty'
  29. Plugin 'prettier/vim-prettier', { 'do': 'yarn install', 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
  30. " Plugin 'itchyny/lightline.vim'
  31. Plugin 'vim-airline/vim-airline'
  32. Plugin 'vim-airline/vim-airline-themes'
  33. Plugin 'scrooloose/nerdtree'
  34. Plugin 'airblade/vim-gitgutter'
  35. Plugin 'tpope/vim-commentary'
  36. call vundle#end()
  37. filetype plugin indent on
  38.  
  39. set numberwidth=4
  40. set runtimepath+=$HOME/.vim/plugins/vim-gitgutter
  41. let g:gitgutter_async = 0
  42. let g:gitgutter_enabled = 0
  43. set autochdir
  44. let NERDTreeChDirMode=2
  45. au VimEnter NERD_tree_1 enew | execute 'NERDTree '.argv()[0]
  46.  
  47. let g:jsx_ext_required = 1
  48. let g:jsx_pragma_required = 1
  49. let g:typescript_compiler_binary = 'tsc'
  50. let g:typescript_compiler_options = ''
  51.  
  52. let g:airline#extensions#tabline#enabled = 1
  53. " lightline
  54. let g:lightline = {
  55.       \ 'colorscheme': 'one',
  56.       \ 'active': {
  57.       \   'left': [ [ 'mode', 'paste' ],
  58.       \             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
  59.       \ },
  60.       \ 'component_function': {
  61.       \   'gitbranch': 'fugitive#head'
  62.       \ },
  63.       \ }
  64. " set laststatus=2
  65.  
  66. " NERDTree
  67. let g:NERDTreeIndicatorMapCustom = {
  68.     \ "Modified"  : "✹",
  69.     \ "Staged"    : "✚",
  70.     \ "Untracked" : "✭",
  71.     \ "Renamed"   : "➜",
  72.     \ "Unmerged"  : "═",
  73.     \ "Deleted"   : "✖",
  74.     \ "Dirty"     : "✗",
  75.     \ "Clean"     : "✔︎",
  76.     \ 'Ignored'   : '☒',
  77.     \ "Unknown"   : "?"
  78.     \ }
  79.  
  80.  
  81. " YouCompleteMe
  82. let g:ycm_use_clangd = 0
  83.  
  84. " Prettier
  85. let g:prettier#autoformat = 1
  86.  
  87. " vim-go
  88. let g:go_test_timeout = '30s'
  89. let g:go_def_mode = 'gopls'
  90. let g:go_fmt_command = "goimports"
  91. let g:go_highlight_extra_types = 1
  92. let g:go_highlight_functions = 1
  93. let g:go_highlight_function_parameters = 1
  94. let g:go_highlight_function_calls = 1
  95. let g:go_highlight_structs = 1
  96. let g:go_highlight_types = 1
  97. let g:go_highlight_fields = 1
  98. let g:go_highlight_operators = 1
  99. let g:go_highlight_build_constraints = 1
  100. let g:go_highlight_generate_tags = 1
  101. let g:go_highlight_format_strings = 1
  102. let g:go_highlight_variable_declarations = 1
  103. let g:go_highlight_variable_assignments = 1
  104.  
  105. " Dracula 主題
  106. let g:dracula_colorterm = 0                 " 背景
  107. let g:dracula_italic = 0
  108. colorscheme dracula
  109.  
  110. highlight LineNr guifg=#BD93F9 guibg=#303030
  111.  
  112. " typescript-react 自定義設定
  113. hi! link jsxTagName                         DraculaPink
  114. hi! link jsxAttrib                          DraculaGreenItalic
  115. hi! link jsxComponentName                   DraculaCyanItalic
  116. hi! link typescriptBOMWindowMethod          Normal
  117.  
  118. " golang 自定義設定
  119. hi! link goType                             DraculaPink
  120. hi! link goSignedInts                       DraculaPink
  121. hi! link goUnsignedInts                     DraculaPink
  122. hi! link goFloats                           DraculaPink
  123. hi! link goComplexes                        DraculaPink
  124. hi! link goTypeName                         DraculaCyanItalic
  125. hi! link goReceiverType                     DraculaCyanItalic
  126. hi! link goTypeConstructor                  DraculaCyanItalic
  127. " hi! link goParamType                        DraculaCyan
  128. hi! link goBuiltins                         DraculaCyan
  129. hi! link goFunctionCall                     DraculaCyan
  130. hi! link goParen                            DraculaCyan
  131. hi! link goFormatSpecifier                  DraculaPurple
  132. hi! link goVarAssign                        Normal
  133. hi! link goVarDefs                          Normal
  134.  
  135. " 顯示 tab 或空白字元
  136. set listchars=tab:→\ ,space:\ ,extends:⟩,precedes:⟨
  137. set list
  138.  
  139. set noerrorbells             " No beeps
  140. set number                   " Show line numbers
  141. set noswapfile               " Don't use swapfile
  142. set showcmd                  " Show me what I'm typing
  143. set nobackup                 " Don't create annoying backup files
  144. set splitright               " Split vertical windows right to the current windows
  145. set splitbelow               " Split horizontal windows below to the current windows
  146. set autowrite                " Automatically save before :next, :make etc.
  147. set hidden
  148. set fileformats=unix,dos,mac " Prefer Unix over Windows over OS 9 formats
  149. set noshowmatch              " Do not show matching brackets by flickering
  150. set noshowmode               " We show the mode with airline or lightline
  151. set ignorecase               " Search case insensitive...
  152. set smartcase                " ... but not it begins with upper case
  153. set completeopt=menu,menuone
  154. set nocursorcolumn           " speed up syntax highlighting
  155. set cursorline               " show the focus line
  156. set updatetime=300
  157. set pumheight=10             " Completion window max size
  158. set conceallevel=2           " Concealed text is completely hidden
  159. set nowrap
  160. set autoread
  161.  
  162. " Keyboard mapping
  163. nnoremap <C-c> "+yy
  164. nnoremap <C-v> "+p
  165. nnoremap <A-Down> :m+<CR>==
  166. nnoremap <A-Up> :m .-2<CR>==
  167. nnoremap <ESC>j :m+<CR>==
  168. nnoremap <ESC>k :m .-2<CR>==
  169. nnoremap <F2> :set nu!<CR>
  170. nnoremap <F4> :set list!<CR>
  171. nnoremap <F5> :GitGutterToggle<CR>
  172. nnoremap <F3> :set hlsearch!<CR>
  173. nnoremap <F9> :NERDTreeToggle<CR>
  174. nnoremap <leader>n :NERDTree .<CR>
  175.  
  176. " Output the current syntax group
  177. nnoremap <f10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
  178. \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
  179. \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<cr>
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