Advertisement
Guest User

Untitled

a guest
Oct 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.87 KB | None | 0 0
  1. set nocompatible
  2. set encoding=utf-8
  3. set guifont=Iosevka:h9
  4.  
  5. if empty(glob('~/.vim/autoload/plug.vim'))
  6.   silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  7.     \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  8.   autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  9. endif
  10.  
  11. call plug#begin('~/.vim/bundle')
  12. " Interface
  13. Plug 'itchyny/lightline.vim'
  14. Plug 'airblade/vim-gitgutter'
  15. Plug 'bling/vim-bufferline'
  16.  
  17. " Utility
  18. Plug 'w0rp/ale'
  19. Plug 'tpope/vim-fugitive'
  20. Plug 'lilydjwg/colorizer', { 'on': 'ColorHighlight' }
  21. Plug '/usr/local/opt/fzf'
  22. Plug 'junegunn/fzf.vim'
  23.  
  24. Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
  25. Plug 'junegunn/goyo.vim', {'for': 'markdown' }
  26. Plug 'iamcco/markdown-preview.vim', { 'for': 'markdown' }
  27. call plug#end()
  28.  
  29. " Basic Config.
  30. set backspace=indent,eol,start  " Backspace like normal
  31. set hidden                      " Hide buffer (file) instead of abandoning when switching to another buffer
  32. set wildmenu                    " Command-line autocompletion
  33. set showmatch                   " Highlight ([{}])
  34. set lazyredraw
  35. set mouse=n
  36.  
  37. filetype on
  38. filetype plugin on
  39. filetype indent on
  40. set smartindent
  41.  
  42. " 4 spaces tabs
  43. set shiftwidth=4
  44. set tabstop=4
  45. set expandtab
  46. set smarttab
  47.  
  48. " Search
  49. set ignorecase                  " Ignore case wgeb searching
  50. set smartcase                   " If there is an uppercase in your search term search case sensitive again
  51. set incsearch                   " Highlight search when results typing
  52. set hlsearch                    " Highlight search results
  53.  
  54. " Beep
  55. set noerrorbells
  56.  
  57. " UI
  58. set number relativenumber       " Display line numbers
  59. set cursorline
  60. set nowrap                      " Wrap lines when they are too long
  61. set noshowmode                  " Hide --MODE--
  62.  
  63. set scrolloff=5                 " Display at least 5 lines around your cursor (for scrolling)
  64. set guioptions=
  65.  
  66. if has('termguicolors')
  67.   let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
  68.   let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
  69.   set termguicolors
  70. endif
  71. colorscheme base16-material-palenight
  72. set background=dark
  73.  
  74. " Mappings
  75. map <up> <nop>
  76. map <down> <nop>
  77. map <left> <nop>
  78. map <right> <nop>
  79. nnoremap j gj
  80. nnoremap k gk
  81. let mapleader=' '
  82. nnoremap <leader>f :Files<CR>
  83. nnoremap <leader>l :Lines<CR>
  84. nnoremap <leader>a :Rg<CR>
  85. nnoremap <leader>b :Buffers<CR>
  86. nnoremap <leader>g :Goyo<CR>
  87.  
  88. " Lightline
  89. set laststatus=2
  90. set showtabline=2
  91. let g:lightline = {
  92.     \ 'colorscheme': 'material_palenight',
  93.     \ 'active': {
  94.     \   'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename', 'modified' ] ]
  95.     \  },
  96.     \ 'tabline': {
  97.     \   'left': [ [ 'bufferline' ] ],
  98.     \   'right':[ [ 'gitbranch' ] ]
  99.     \ },
  100.     \ 'component': {
  101.     \   'lineinfo': '%3l:%-2v'
  102.     \ },
  103.     \ 'component_function': {
  104.     \   'gitbranch': 'Lightline_GitBranch'
  105.     \ },
  106.     \ 'component_expand': {
  107.     \   'bufferline': 'Lightline_Bufferline',
  108.     \ },
  109.     \ 'component_type': {
  110.     \   'bufferline': 'tabsel',
  111.     \ },
  112.     \ 'mode_map': {
  113.     \   'n': 'N', 'i': 'I', 'R': 'R', 'v': 'V', 'V': 'VL', "\<C-v>": 'VB',
  114.     \   'c': 'COMMAND', 's': 'SELECT', 'S': 'S-LINE', "\<C-s>": 'S-BLOCK', 't': 'TERMINAL'
  115.     \ },
  116.     \ 'separator': { 'left': '', 'right': '' },
  117.     \ 'subseparator': { 'left': '|', 'right': '|' },
  118.     \ 'enable': { 'statusline':1, 'tabline':1 },
  119.     \}
  120.  
  121. function! Lightline_GitBranch()
  122.     if exists('fugitive#head')
  123.         let branch = fugitive#head()
  124.         return branch !=# '' ? ' '.branch : ''
  125.     endif
  126.     return 'Buffers'
  127. endfunction
  128.  
  129. function! Lightline_Bufferline()
  130.     call bufferline#refresh_status()
  131.     return [ g:bufferline_status_info.before, g:bufferline_status_info.current, g:bufferline_status_info.after]
  132. endfunction
  133.  
  134. " Bufferline
  135. let g:bufferline_echo = 0
  136. let g:bufferline_active_buffer_left = ''
  137. let g:bufferline_active_buffer_right = ''
  138. let g:bufferline_modified = ' +'
  139.  
  140. " Markdown
  141. autocmd User GoyoEnter set wrap linebreak nolist
  142. let g:goyo_width = "85%"
  143. let g:goyo_height = '90%'
  144. set conceallevel=2
  145.  
  146. " FZF
  147. let g:fzf_colors =
  148. \ { 'fg':      ['fg', 'Normal'],
  149.   \ 'bg':      ['bg', 'Normal'],
  150.   \ 'hl':      ['fg', 'Comment'],
  151.   \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
  152.   \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
  153.   \ 'hl+':     ['fg', 'Statement'],
  154.   \ 'info':    ['fg', 'PreProc'],
  155.   \ 'border':  ['fg', 'Ignore'],
  156.   \ 'prompt':  ['fg', 'Conditional'],
  157.   \ 'pointer': ['fg', 'Exception'],
  158.   \ 'marker':  ['fg', 'Keyword'],
  159.   \ 'spinner': ['fg', 'Label'],
  160.   \ 'header':  ['fg', 'Comment'] }
  161.  
  162. let g:is_transparent = 0
  163. function! Toggle_transparent()
  164.     if g:is_transparent == 0
  165.         hi Normal guibg=NONE
  166.         hi LineNr guifg=#676E95 guibg=NONE
  167.         let g:is_transparent = 1
  168.     else
  169.         set background=dark
  170.         let g:is_transparent = 0
  171.     endif
  172. endfunction
  173. nnoremap <C-t> :call Toggle_transparent()<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement