Advertisement
SunDi3yansyah

Untitled

Sep 26th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. set encoding=utf-8
  2. set laststatus=2
  3. set number
  4. set tabstop=4
  5. set shiftwidth=4
  6. set softtabstop=4
  7. set expandtab
  8. set colorcolumn=+1
  9. set cursorline
  10. set ignorecase
  11. set smartcase
  12. set showmatch
  13. set hlsearch
  14. set gdefault
  15. set virtualedit=block
  16.  
  17. " Buffers, Backup & Co
  18. set undodir=~/.vim/tmp/undo//
  19. set backupdir=~/.vim/tmp/backup//
  20. set directory=~/.vim/tmp/swap//
  21. set backup
  22. set noswapfile
  23. set ruler
  24. set history=10000
  25. set undofile
  26. set undoreload=10000
  27. set title
  28. set autoindent
  29. set autoread
  30. set lazyredraw
  31. set mouse=a
  32.  
  33. " https://github.com/ryanoasis/vim-devicons
  34. set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11
  35. "set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 10
  36.  
  37. " https://github.com/lidashuang/colors-vim
  38. colorscheme molokai
  39. syntax on
  40. set t_Co=256
  41.  
  42. inoremap <c-a> <esc>I
  43. inoremap <c-e> <esc>A
  44.  
  45. " Return to the previously selected line in the file
  46. augroup line_return
  47. au!
  48. au BufReadPost *
  49. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  50. \ execute 'normal! g`"zvzz' |
  51. \ endif
  52. augroup END
  53.  
  54. " remove seach-highlights when pressing ,+<space>
  55. let mapleader=","
  56. noremap <leader><space> :noh<cr>: call clearmatches()<cr>
  57.  
  58. " reload .vimrc on saving
  59. au BufWritePost .vimrc so ~/.vimrc
  60.  
  61. " https://github.com/tpope/vim-pathogen
  62. execute pathogen#infect()
  63. call pathogen#infect('bundle/{}')
  64.  
  65. " https://github.com/bubujka/emmet-vim
  66. " Enable in different mode
  67. let g:user_emmet_mode='n' "only enable normal mode functions.
  68. let g:user_emmet_mode='inv' "enable all functions, which is equal to
  69. let g:user_emmet_mode='a' "enable all function in all mode.
  70. " Enable just for html/css
  71. let g:user_emmet_install_global = 0
  72. autocmd FileType html,css EmmetInstall
  73. " Redefine trigger key
  74. "let g:user_emmet_leader_key='<C-Z>'
  75. " Adding custom snippets
  76. "let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.snippets_custom.json')), "\n"))
  77.  
  78. " https://github.com/scrooloose/nerdtree
  79. autocmd vimenter * NERDTree
  80. autocmd StdinReadPre * let s:std_in=1
  81. autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
  82. map <C-n> :NERDTreeToggle<CR>
  83. let g:NERDTreeDirArrowExpandable = '▸'
  84. let g:NERDTreeDirArrowCollapsible = '▾'
  85.  
  86. " https://github.com/tiagofumo/vim-nerdtree-syntax-highlight
  87. let g:NERDTreeFileExtensionHighlightFullName = 1
  88. let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
  89.  
  90. " https://github.com/itchyny/lightline.vim
  91. let g:lightline = {
  92. \ 'colorscheme': 'wombat',
  93. \ 'active': {
  94. \ 'left': [ [ 'mode', 'paste' ],
  95. \ [ 'fugitive', 'filename' ] ]
  96. \ },
  97. \ 'component_function': {
  98. \ 'fugitive': 'LightLineFugitive',
  99. \ 'readonly': 'LightLineReadonly',
  100. \ 'modified': 'LightLineModified',
  101. \ 'filename': 'LightLineFilename',
  102. \ 'filetype': 'MyFiletype',
  103. \ 'fileformat': 'MyFileformat'
  104. \ },
  105. \ 'separator': { 'left': '⮀', 'right': '⮂' },
  106. \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
  107. \ }
  108.  
  109. function! LightLineModified()
  110. if &filetype == "help"
  111. return ""
  112. elseif &modified
  113. return "+"
  114. elseif &modifiable
  115. return ""
  116. else
  117. return ""
  118. endif
  119. endfunction
  120.  
  121. function! LightLineReadonly()
  122. if &filetype == "help"
  123. return ""
  124. elseif &readonly
  125. return "⭤"
  126. else
  127. return ""
  128. endif
  129. endfunction
  130.  
  131. function! LightLineFugitive()
  132. if exists("*fugitive#head")
  133. let branch = fugitive#head()
  134. return branch !=# '' ? '⭠ '.branch : ''
  135. endif
  136. return ''
  137. endfunction
  138.  
  139. function! LightLineFilename()
  140. return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
  141. \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') .
  142. \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
  143. endfunction
  144.  
  145. function! MyFiletype()
  146. return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
  147. endfunction
  148.  
  149. function! MyFileformat()
  150. return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
  151. endfunction
  152.  
  153. " http://vimawesome.com/plugin/nginx-vim
  154. au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement