1. " ------------------ PLUGINS -----------------
  2. filetype plugin on
  3.  
  4. set rtp+=~/.vim/bundle/vundle/
  5. call vundle#rc()
  6.  
  7. Bundle 'gmarik/vundle'
  8. Bundle 'chrisbra/SudoEdit.vim'
  9. Bundle 'ervandew/supertab'
  10. Bundle 'kien/ctrlp.vim'
  11. Bundle 'nanotech/jellybeans.vim'
  12. Bundle 'itchyny/lightline.vim'
  13. Bundle 'bling/vim-bufferline'
  14. Bundle 'scrooloose/nerdcommenter'
  15. Bundle 'scrooloose/nerdtree'
  16. Bundle 'Townk/vim-autoclose'
  17. Bundle 'tpope/vim-fugitive'
  18. Bundle 'tpope/vim-surround'
  19. Bundle 'vim-scripts/Align'
  20. Bundle 'lilydjwg/colorizer'
  21. Bundle 'sjl/gundo.vim'
  22. Bundle 'Lokaltog/vim-easymotion'
  23. Bundle 'corntrace/bufexplorer'
  24. Bundle 'msanders/snipmate.vim'
  25.  
  26. " -------------------GUI ---------------------
  27. colorscheme jellybeans
  28. if has('gui_running')
  29. set guifont=xft:Inconsolata\ for\ Powerline\ 10
  30. endif
  31. scriptencoding utf-8
  32. set encoding=utf-8
  33.  
  34. " ------------------ GLOBAL ------------------
  35. let mapleader=","
  36. syntax on
  37. set hidden
  38. set wildmenu
  39. set showcmd
  40. set hlsearch
  41.  
  42. " ----------------- USABILITY ----------------
  43. set ignorecase
  44. set smartcase
  45. set backspace=indent,eol,start
  46. set nostartofline
  47. set ruler
  48. set laststatus=2
  49. set confirm
  50. set visualbell
  51. set t_vb=
  52. set mouse=a
  53. set cmdheight=2
  54. set number
  55. set notimeout ttimeout ttimeoutlen=200
  56. set pastetoggle=<F11>
  57.  
  58. " ---------------- INDENT -------------------
  59. set autoindent
  60. set shiftwidth=2
  61. set tabstop=2
  62.  
  63. " --------------- MAPPINGS ------------------
  64. map Y y$
  65. nnoremap <C-L> :nohl<CR><C-L>
  66.  
  67. " --------------- LIGHTLINE -----------------
  68. let g:lightline = {
  69. \ 'colorscheme': 'landscape',
  70. \ 'mode_map': { 'c': 'NORMAL' },
  71. \ 'active': {
  72. \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
  73. \ },
  74. \ 'component_function': {
  75. \ 'modified': 'MyModified',
  76. \ 'readonly': 'MyReadonly',
  77. \ 'fugitive': 'MyFugitive',
  78. \ 'filename': 'MyFilename',
  79. \ 'fileformat': 'MyFileformat',
  80. \ 'filetype': 'MyFiletype',
  81. \ 'fileencoding': 'MyFileencoding',
  82. \ 'mode': 'MyMode',
  83. \ },
  84. \ 'separator': { 'left': '⮀', 'right': '⮂' },
  85. \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
  86. \ }
  87.  
  88. function! MyModified()
  89. return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-'
  90. endfunction
  91.  
  92. function! MyReadonly()
  93. return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? '⭤' : ''
  94. endfunction
  95.  
  96. function! MyFilename()
  97. return ('' != MyReadonly() ? MyReadonly() . ' ' : '') .
  98. \ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
  99. \ &ft == 'unite' ? unite#get_status_string() :
  100. \ &ft == 'vimshell' ? vimshell#get_status_string() :
  101. \ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
  102. \ ('' != MyModified() ? ' ' . MyModified() : '')
  103. endfunction
  104.  
  105. function! MyFugitive()
  106. if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
  107. let _ = fugitive#head()
  108. return strlen(_) ? '⭠'._ : ''
  109. endif
  110. return ''
  111. endfunction
  112.  
  113. function! MyFileformat()
  114. return winwidth(0) > 70 ? &fileformat : ''
  115. endfunction
  116.  
  117. function! MyFiletype()
  118. return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
  119. endfunction
  120.  
  121. function! MyFileencoding()
  122. return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
  123. endfunction
  124.  
  125. function! MyMode()
  126. return winwidth(0) > 60 ? lightline#mode() : ''
  127. endfunction