Advertisement
Guest User

Untitled

a guest
Apr 16th, 2013
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. " TODO:
  2. " copy-paste without delete: http://stackoverflow.com/questions/11993851/vim-how-to-delete-not-cut
  3.  
  4. " Pathogen
  5. call pathogen#infect()
  6.  
  7. " Misc
  8. syntax enable
  9. filetype plugin indent on
  10. set ic
  11. set incsearch
  12. set cindent
  13. set autochdir
  14. set wildmenu
  15. set ignorecase smartcase
  16. set autoindent
  17. set virtualedit=all
  18. set nowrap
  19. :cabbr desk /Users/maxime/Desktop
  20. au BufRead,BufNewFile *.md set filetype=markdown
  21.  
  22. " Absolute line numbers when we’re in insert mode
  23. " Relative numbers when we’re in normal mode
  24. set relativenumber
  25. autocmd InsertEnter * :set number
  26. autocmd InsertLeave * :set relativenumber
  27.  
  28. " Don't clutter my dirs up with swp and tmp files
  29. set backupdir=~/.tmp
  30. set directory=~/.tmp
  31.  
  32. " Look
  33. set background=dark
  34. colorscheme solarized
  35. :set guifont=Menlo\ Regular:h18
  36.  
  37. " Shortcuts
  38. let mapleader = ","
  39. nmap k gk
  40. nmap j gj
  41. noremap <Leader>i magg=G`azz
  42. noremap <Leader>vi :tabe ~/.vimrc<CR>
  43. noremap <Leader>cs :tabe ~/Code/VimCheatSheet.md<CR>
  44. noremap <C-F> :tabn<CR>
  45. noremap <C-D> :tabp<CR>
  46. noremap <C-A> 30zh
  47. noremap <C-S> 30zl
  48. noremap <Leader>r :call RenameFile()<cr>
  49.  
  50. " Code folding settings
  51. set foldmethod=indent "fold based on indent
  52. set foldnestmax=10 "deepest fold is 10 levels
  53. set nofoldenable "dont fold by default
  54. set foldlevel=1 "this is just what i use
  55.  
  56. " Autocompletion
  57. autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
  58. autocmd FileType php set omnifunc=phpcomplete#CompletePHP
  59. autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  60. autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  61.  
  62. " Making autocompletion work with jk
  63. inoremap <expr> j ((pumvisible())?("\<C-n>"):("j"))
  64. inoremap <expr> k ((pumvisible())?("\<C-p>"):("k"))
  65.  
  66. " Don't add the comment prefix when I hit enter or o/O on a comment line.
  67. set formatoptions-=or
  68.  
  69. " Renaming a file
  70. function! RenameFile()
  71. let old_name = expand('%')
  72. let new_name = input('New file name: ', expand('%'), 'file')
  73. if new_name != '' && new_name != old_name
  74. exec ':saveas ' . new_name
  75. exec ':silent !rm ' . old_name
  76. redraw!
  77. endif
  78. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement