You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.3KB

  1. " Execute pathogen
  2. execute pathogen#infect()
  3. " Load NERDTree plugin only if opening vim without a file
  4. "autocmd VimEnter * NERDTree
  5. "autocmd StdinReadPre * let s:std_in=1
  6. "autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
  7. " Open NERDTree with Ctrl+n / Toggle
  8. map <C-n> :NERDTreeToggle<CR>
  9. " close vim if the only window left open is a NERDTree
  10. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
  11. " Remember position in file
  12. if has("autocmd")
  13. au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  14. endif
  15. " Set the clipboard so all vim instances share the same copy/paste buffer
  16. set clipboard=unnamed
  17. " Enable syntax highlighting
  18. syntax on
  19. " Show line numbers
  20. "set number
  21. " Set line number color
  22. " Get colors here:
  23. " http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim
  24. highlight LineNr ctermfg=220 guifg=#ffd700
  25. " Highlight current line and disable highlighting in insert mode
  26. set cursorline
  27. hi CursorLine cterm=NONE ctermbg=17 ctermfg=white guibg=#00005f guifg=white
  28. "hi CursorColumn cterm=NONE ctermbg=17 ctermfg=white guibg=#00005f guifg=white
  29. augroup CursorLine
  30. au!
  31. au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
  32. au InsertEnter * setlocal nocursorline
  33. au InsertLeave * setlocal cursorline
  34. augroup END
  35. " 256 bit color support
  36. set t_Co=256
  37. " Set 'nocompatible' to ward off unexpected things that your distro might
  38. " have made, as well as sanely reset options when re-sourcing .vimrc
  39. set nocompatible
  40. " Code indentation
  41. filetype plugin indent on
  42. set tabstop=4
  43. set shiftwidth=4
  44. set expandtab
  45. " Better command-line completion
  46. set wildmenu
  47. " Highlight searches (use <C-L> to temporarily turn off highlighting; see the
  48. " mapping of <C-L> below)
  49. set hlsearch
  50. " Use case insensitive search, except when using capital letters
  51. set ignorecase
  52. set smartcase
  53. " Stop certain movements from always going to the first character of a line.
  54. " While this behaviour deviates from that of Vi, it does what most users
  55. " coming from other editors would expect.
  56. set nostartofline
  57. " Display the cursor position on the last line of the screen or in the status
  58. " line of a window
  59. set ruler
  60. " Instead of failing a command because of unsaved changes, instead raise a
  61. " dialogue asking if you wish to save changed files.
  62. set confirm