Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. if &compatible
  2. set nocompatible " Be iMproved
  3. endif
  4.  
  5. " vim-plug configuration
  6. call plug#begin('~/.local/share/nvim/plugged')
  7.  
  8. Plug 'Shougo/denite.nvim'
  9.  
  10. Plug 'ctrlpvim/ctrlp.vim'
  11.  
  12. "Plug 'szw/vim-ctrlspace'
  13.  
  14. "Plug 'wincent/command-t'
  15.  
  16. "Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  17.  
  18. Plug 'tpope/vim-fugitive'
  19.  
  20. Plug 'benekastah/neomake'
  21.  
  22. Plug 'sbdchd/neoformat'
  23.  
  24. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  25.  
  26. Plug 'mattn/emmet-vim'
  27.  
  28. Plug 'jiangmiao/auto-pairs'
  29.  
  30. Plug 'scrooloose/nerdtree'
  31.  
  32. Plug 'scrooloose/nerdcommenter'
  33.  
  34. Plug 'xuyuanp/nerdtree-git-plugin'
  35.  
  36. Plug 'jistr/vim-nerdtree-tabs'
  37.  
  38. Plug 'pangloss/vim-javascript', {'for': ['javascript', 'javascript.jsx']}
  39.  
  40. Plug 'mxw/vim-jsx', {'for': ['javascript', 'javascript.jsx']}
  41.  
  42. "Plug 'jelera/vim-javascript-syntax'
  43.  
  44. "Plug 'othree/javascript-libraries-syntax.vim'
  45.  
  46. Plug 'airblade/vim-gitgutter'
  47.  
  48. Plug 'vim-airline/vim-airline'
  49.  
  50. Plug 'vim-airline/vim-airline-themes'
  51.  
  52. Plug 'marijnh/tern_for_vim'
  53.  
  54. Plug 'majutsushi/tagbar'
  55.  
  56. Plug 'godlygeek/tabular'
  57.  
  58. Plug 'ervandew/supertab'
  59.  
  60. Plug 'tpope/vim-surround'
  61.  
  62. "Plug 'nathanaelkane/vim-indent-guides'
  63.  
  64. Plug 'yggdroot/indentline'
  65.  
  66. "Plug 'terryma/vim-multiple-cursors'
  67.  
  68. Plug 'easymotion/vim-easymotion'
  69.  
  70. Plug 'tomasr/molokai'
  71.  
  72. Plug 'trusktr/seti.vim'
  73.  
  74. Plug 'ap/vim-css-color'
  75.  
  76. Plug 'lilydjwg/colorizer'
  77.  
  78. Plug 'lepture/vim-velocity'
  79.  
  80. "Plug 'vim-scripts/velocity.vim'
  81.  
  82. "Plug 'suan/vim-instant-markdown'
  83.  
  84. Plug 'othree/html5.vim'
  85.  
  86. "Plug 'christoomey/vim-tmux-navigator'
  87.  
  88. "Plug 'severin-lemaignan/vim-minimap'
  89.  
  90. "Plug 'myusuf3/numbers.vim'
  91.  
  92. Plug 'tpope/vim-abolish'
  93.  
  94. Plug 'tpope/vim-repeat'
  95.  
  96. Plug 'sjl/gundo.vim'
  97.  
  98. Plug 'sirver/ultisnips'
  99.  
  100. "Plug 'janko-m/vim-test'
  101.  
  102. Plug 'tpope/vim-sensible'
  103.  
  104. Plug 'flazz/vim-colorschemes'
  105.  
  106. call plug#end()
  107.  
  108. """"""""""""""""""""""""""""""""""""""""
  109. """"""""BASIC OPTIONS"""""""""""""""""""
  110. """"""""""""""""""""""""""""""""""""""""
  111. " Indentation Size
  112. set tabstop=4
  113. set softtabstop=4
  114. set shiftwidth=4
  115. set expandtab
  116. colorscheme molokai
  117. set background=dark
  118. let mapleader = ","
  119. noremap \ ,
  120. " Show row number
  121. set relativenumber
  122. set nu
  123. " Persistent undo history
  124. set undodir=~/.vim/undodir
  125. set undofile
  126. " Enables code folding based on our syntax file
  127. set foldmethod=syntax
  128.  
  129. "nnoremap <Leader>s :set spell<CR>:set spelllang=en_us<CR>
  130.  
  131. " Quickly insert an empty new line without entering insert mode
  132. nnoremap <Leader>o o<Esc>
  133. nnoremap <Leader>O O<Esc>
  134.  
  135. " Map Cmd-S to :w for conveniently saving file
  136. " Works in normal mode, must press Esc first
  137. :map <C-S> :w<CR>
  138. :imap <C-S> <Esc>:w<CR>
  139. " Works in insert mode, saves and puts back in insert mode
  140. "nmap <leader>w :w!<cr>
  141.  
  142. " Map Ctrl-G to u for undoing things
  143. :map <C-G> u<CR>
  144. :imap <C-G> <Esc>u<CR>
  145.  
  146. " Default GUI font
  147. "let g:Guifont="Source Code Pro:h14"
  148.  
  149. " Neomake
  150. " ESLint
  151. let g:neomake_javascript_enabled_makers = ['eslint']
  152. autocmd! BufWritePost * Neomake
  153.  
  154. " Use deoplete
  155. let g:deoplete#enable_at_startup = 1
  156.  
  157. " NERDTree
  158. " How can I map a specific key or shortcut to open NERDTree?
  159. map <C-n> :NERDTreeTabsToggle<CR>
  160.  
  161. " How can I open a NERDTree automatically when vim starts up?
  162. "autocmd vimenter * NERDTree
  163.  
  164. "How can I open a NERDTree automatically when vim starts up if no files were specified?
  165. autocmd StdinReadPre * let s:std_in=1
  166. autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
  167.  
  168. " How can I open NERDTree automatically when vim starts up on opening a directory?
  169. autocmd StdinReadPre * let s:std_in=1
  170. autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
  171.  
  172. " How can I close vim if the only window left open is a NERDTree?
  173. " autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  174.  
  175. " vim-javascript
  176. " Enable syntax highlighting for JSDocs.
  177. let g:javascript_plugin_jsdoc = 1
  178.  
  179. " Concealing Characters
  180. let g:javascript_conceal_function = "ƒ"
  181. let g:javascript_conceal_null = "ø"
  182. let g:javascript_conceal_this = "@"
  183. let g:javascript_conceal_return = "⇚"
  184. let g:javascript_conceal_undefined = "¿"
  185. let g:javascript_conceal_NaN = "ℕ"
  186. let g:javascript_conceal_prototype = "¶"
  187. let g:javascript_conceal_static = "•"
  188. let g:javascript_conceal_super = "Ω"
  189. let g:javascript_conceal_arrow_function = "⇒"
  190. "let g:javascript_conceal_noarg_arrow_function = "🞅"
  191. "let g:javascript_conceal_underscore_arrow_function = "🞅"
  192.  
  193. " vim-jsx
  194. " JSX syntax highlighting and indenting will be enabled for files with both
  195. " .jsx and .js extension
  196. let g:jsx_ext_required = 0
  197.  
  198. " airline
  199. let g:airline_left_sep = ''
  200. let g:airline_right_sep = ''
  201.  
  202. " airline theme
  203. let g:airline_theme='light'
  204.  
  205. " Javascript Library Syntax
  206. "let g:used_javascript_libs = 'react,vue,jquery,requirejs,chai,underscore'
  207. "autocmd BufReadPre *.js let b:javascript_lib_use_react = 1
  208. "autocmd BufReadPre *.vue let b:javascript_lib_use_vue = 1
  209.  
  210. " IndetLine
  211. " Toggles IndentLines on and off.
  212. nmap <Leader>i :IndentLinesToggle<CR>
  213. set conceallevel=1
  214. let g:indentLine_enabled = 1
  215. let g:indentLine_leadingSpaceEnabled = 1
  216. "let g:indentLine_setColors = 0
  217. "let g:indentLine_color_term = 239
  218. let g:indentLine_char = '¦'
  219. let g:indentLine_leadingSpaceChar = '·'
  220. let g:indentLine_conceallevel = 1
  221. let g:indentLine_setConceal = 0
  222. "let g:indentLine_showFirstIndentLevel = 1
  223.  
  224. " ctrlp
  225. " Ignore some folders and files for CtrlP indexing
  226. "let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
  227. "set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
  228. "let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
  229.  
  230. " Neoformat
  231. augroup fmt
  232. autocmd!
  233. autocmd BufWritePre *.js Neoformat prettier-eslint
  234. augroup END
  235. ":imap <Leader>f <ESC>:Neoformat prettier-eslint<CR>i
  236. ":map <Leader>f :Neoformat prettier-eslint<CR>
  237. autocmd FileType javascript set formatprg=prettier-eslint\ --stdin\ --prettier.tab-width\ 4\ --prettier.single-quote\ --prettier.parser\ babylon\
  238. let g:neoformat_try_formatprg = 1
  239. let g:neoformat_only_msg_on_error = 1
  240.  
  241. " Disable folding
  242. set nofoldenable
  243.  
  244. " Colors don't match on jsx closing tag
  245. highlight link xmlEndTag xmlTag
  246.  
  247. " Velocity Template
  248. "au BufNewFile,BufRead *.vm,*.html,*.htm,*.shtml,*.stm set ft=velocity
  249.  
  250. " Tagbar
  251. nmap <Leader>t :TagbarToggle<CR>
  252.  
  253. " Gundo
  254. nnoremap <Leader>u :GundoToggle<CR>
  255.  
  256. " Denite
  257. call denite#custom#source('file_rec', 'matchers', ['matcher_fuzzy', 'matcher_ignore_globs'])
  258. call denite#custom#filter('matcher_ignore_globs', 'ignore_globs',
  259. \ [ '*~', '*.o', '*.exe', '*.bak',
  260. \ '.DS_Store', '*.pyc', '*.sw[po]', '*.class',
  261. \ '.hg/', '.git/', '.bzr/', '.svn/',
  262. \ 'node_modules/', 'bower_components/', 'tmp/', 'log/', 'vendor/ruby',
  263. \ '.idea/', 'dist/', '.vscode/',
  264. \ 'tags', 'tags-*'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement