defm03

vimrc -- dag

Jul 10th, 2013
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.81 KB | None | 0 0
  1. " Use vim settings,
  2. set nocompatible
  3.  
  4. " colors
  5. syntax on
  6. colorscheme zenburn
  7.  
  8. " Editing behaviour
  9. set showmode
  10. set nowrap
  11. set tabstop=4
  12. set softtabstop=4
  13. set backspace=indent,eol,start
  14. set number
  15. set showmatch
  16. set ignorecase
  17. set smartcase
  18. set hlsearch
  19. set incsearch
  20. set gdefault
  21. set pastetoggle=<F2>
  22. set mouse=a
  23. set formatoptions+=1
  24.  
  25. " Editor layout
  26. set termencoding=utf-8
  27. set encoding=utf-8
  28. set laststatus=2
  29. set cmdheight=1
  30.  
  31. " Vim behaviour
  32. set history=1000
  33. set undolevels=1000
  34. set nobackup
  35. set noswapfile
  36. set wildmenu
  37. set wildmode=list:full
  38. set wildignore=*.swp,*.bak,*.pyc,*.class
  39. set showcmd
  40. set nomodeline
  41. set cursorline
  42.  
  43. " Shortcut mappings
  44. nnoremap ; :
  45. nnoremap H 0
  46. nnoremap L $
  47.  
  48. " pulse search
  49. nnoremap n n:call PulseCursorLine()<cr>
  50. nnoremap N N:call PulseCursorLine()<cr>
  51.  
  52. " Quickly get out of insert mode
  53. inoremap jj <Esc>
  54.  
  55. " Restore cursor position upon reopening files
  56. autocmd BufReadPost *
  57.     \ if line("'\"") > 0 && line("'\"") <= line("$") |
  58.     \   exe "normal! g`\"" |
  59.     \ endif
  60.  
  61. " cool cursor position indicator
  62.  
  63. function! PulseCursorLine()
  64.     let current_window = winnr()
  65.  
  66.     windo set nocursorline
  67.     execute current_window . 'wincmd w'
  68.  
  69.     setlocal cursorline
  70.  
  71.     redir => old_hi
  72.         silent execute 'hi CursorLine'
  73.     redir END
  74.     let old_hi = split(old_hi, '\n')[0]
  75.     let old_hi = substitute(old_hi, 'xxx', '', '')
  76.  
  77.     hi CursorLine guibg=#3a3a3a
  78.     redraw
  79.     sleep 20m
  80.  
  81.     hi CursorLine guibg=#4a4a4a
  82.     redraw
  83.     sleep 30m
  84.  
  85.     hi CursorLine guibg=#3a3a3a
  86.     redraw
  87.     sleep 30m
  88.  
  89.     hi CursorLine guibg=#2a2a2a
  90.     redraw
  91.     sleep 20m
  92.  
  93.     execute 'hi ' . old_hi
  94.  
  95.     windo set cursorline
  96.     execute current_window . 'wincmd w'
  97. endfunction
  98.  
  99. " Powerline configuration
  100. let g:Powerline_symbols = 'fancy'
Advertisement
Add Comment
Please, Sign In to add comment