Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. " Vundle
  2. " ---------------------------------
  3. set nocompatible " be iMproved, required
  4. filetype off " required
  5.  
  6. " set the runtime path to include Vundle and initialize
  7. set rtp+=~/.vim/bundle/Vundle.vim
  8. let path='~/.vim/bundle'
  9. call vundle#begin()
  10.  
  11. " let Vundle manage Vundle, required
  12. Plugin 'gmarik/Vundle.vim'
  13. " ctrlp
  14. Plugin 'kien/ctrlp'
  15. " NERDcommenter
  16. Plugin 'scrooloose/nerdcommenter'
  17.  
  18. " All of your Plugins must be added before the following line
  19. call vundle#end() " required
  20. filetype plugin indent on " required
  21.  
  22.  
  23. " File Encoding
  24. " ---------------------------------
  25. set enc=utf-8
  26.  
  27.  
  28. " Misc Settings
  29. " ---------------------------------
  30. let g:ctrlp_working_path_mode = '0'
  31. let g:mustache_abbreviations = 1
  32.  
  33.  
  34. " GIT
  35. " ---------------------------------
  36. let g:git_branch_status_head_current=1
  37. let g:git_branch_status_nogit=""
  38. let g:git_branch_status_text=" "
  39. let g:git_branch_status_ignore_remotes=1
  40.  
  41.  
  42. " Status bar and Linenumbers
  43. " ---------------------------------
  44. " Make the command line two lines heigh and change the statusline display to
  45. " something that looks useful.
  46. set cmdheight=1
  47. set laststatus=2
  48. set number
  49. set statusline=%t "tail of the filename
  50. set statusline+=%h "help file flag
  51. set statusline+=%m "modified flag
  52. set statusline+=%r "read only flag
  53. set statusline+=%= "left/right separator
  54. set statusline+=%c, "cursor column
  55. set statusline+=%l/%L "cursor line/total lines
  56. set statusline+=\ %P "percent through file
  57. set statusline+=\ [%{strlen(&fenc)?&fenc:'none'}] "file encoding
  58. "set statusline+=%{&ff}] "file format
  59. "set statusline+=%y "filetype
  60.  
  61.  
  62. " Set File Types
  63. " ---------------------------------
  64. autocmd BufNewFile,BufRead *.html,*.htm,*.hbs,*.master,*.aspx,*.ascx,*.ejs setlocal ft=html
  65. autocmd BufNewFile,BufRead *.json setlocal ft=javascript
  66. autocmd BufNewFile,BufRead *.less setlocal ft=less
  67. autocmd BufNewFile,BufRead *.txt setlocal ft=rst
  68.  
  69.  
  70. " Tab Settings
  71. " ---------------------------------
  72. set expandtab
  73. set shiftwidth=2 tabstop=2 softtabstop=2 smartindent!
  74.  
  75.  
  76. " Functions
  77. " ---------------------------------
  78. " Toggle mouse state
  79. fu! DoToggleMouse()
  80. if !exists("s:old_mouse")
  81. let s:old_mouse = "a"
  82. endif
  83.  
  84. if &mouse == ""
  85. let &mouse = s:old_mouse
  86. echo "Mouse is for Vim (" . &mouse . ")"
  87. else
  88. let s:old_mouse = &mouse
  89. let &mouse=""
  90. echo "Mouse is for terminal"
  91. endif
  92. endfunction
  93.  
  94.  
  95. " Set Commands
  96. " ---------------------------------
  97. command! ToggleMouse call DoToggleMouse()
  98.  
  99.  
  100. " Global Key Mappings
  101. " ---------------------------------
  102. let mapleader=";"
  103. map r :redo<CR>
  104. map <leader>r :%s:
  105. map <Leader>m :ToggleMouse<CR>
  106. nnoremap <silent> cf :FufFileWithCurrentBufferDir<CR>
  107. nnoremap <silent> <space> :CtrlPBuffer<CR>
  108. nnoremap <silent> \ :CtrlP [starting-directory]<CR>
  109. nnoremap <leader>p :set pastetoggle<CR>
  110. nnoremap <leader>c :nohl<CR>
  111. nnoremap <Leader>t :noautocmd vimgrep /TODO/j **/*.coffee<CR>:cw<CR>
  112. nnoremap <Leader>tr :ccl<CR>
  113. nnoremap <Leader>to :cope<CR>
  114. nnoremap n nzz
  115. nnoremap N Nzz
  116.  
  117. " Normal State Key Mappings
  118. " ---------------------------------
  119. nmap <Tab> :tabnext<CR>
  120. nmap <S-Tab> :tabprevious<CR>
  121.  
  122. " Visual State Key Mappings
  123. " ---------------------------------
  124. vmap <Tab> >gv
  125. vmap <S-Tab> <gv
  126.  
  127.  
  128. " Final Settings
  129. " ---------------------------------
  130. let html_no_rendering=1
  131. set scrolloff=10
  132. set hlsearch
  133. set incsearch
  134. set nobackup
  135. set noswapfile
  136. set ignorecase
  137. set smartcase
  138. set hidden
  139. set history=10000
  140. syntax on
  141.  
  142. colorscheme Tomorrow-Night
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement