My dotfiles. Period.

vimrc 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. execute pathogen#infect()
  2. " ###############################################################################
  3. " ## from vimrc_example.vim
  4. " ###############################################################################
  5. " allow backspacing over everything in insert mode
  6. set backspace=indent,eol,start
  7. set history=500 " keep 50 lines of command line history
  8. set ruler " show the cursor position all the time
  9. set showcmd " display incomplete commands
  10. set incsearch " do incremental searching
  11. " In many terminal emulators the mouse works just fine, thus enable it.
  12. if has('mouse')
  13. set mouse=a
  14. endif
  15. " Switch syntax highlighting on, when the terminal has colors
  16. " Also switch on highlighting the last used search pattern.
  17. if &t_Co > 2 || has("gui_running")
  18. syntax on
  19. set hlsearch
  20. endif
  21. " Only do this part when compiled with support for autocommands.
  22. if has("autocmd")
  23. " Enable file type detection.
  24. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  25. " 'cindent' is on in C files, etc.
  26. " Also load indent files, to automatically do language-dependent indenting.
  27. filetype plugin indent on
  28. " Put these in an autocmd group, so that we can delete them easily.
  29. augroup vimrcEx
  30. au!
  31. " For all text files set 'textwidth' to 78 characters.
  32. autocmd FileType text setlocal textwidth=78
  33. " When editing a file, always jump to the last known cursor position.
  34. " Don't do it when the position is invalid or when inside an event handler
  35. " (happens when dropping a file on gvim).
  36. " Also don't do it when the mark is in the first line, that is the default
  37. " position when opening a file.
  38. autocmd BufReadPost *
  39. \ if line("'\"") > 1 && line("'\"") <= line("$") |
  40. \ exe "normal! g`\"" |
  41. \ endif
  42. augroup END
  43. else
  44. set autoindent " always set autoindenting on
  45. endif " has("autocmd")
  46. " Convenient command to see the difference between the current buffer and the
  47. " file it was loaded from, thus the changes you made.
  48. " Only define it when not defined already.
  49. if !exists(":DiffOrig")
  50. command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  51. \ | wincmd p | diffthis
  52. endif
  53. " ###############################################################################
  54. " ## from me or anywhere
  55. " ###############################################################################
  56. set encoding=utf-8
  57. set list listchars=tab:→\ ,trail:·,precedes:←
  58. set list
  59. noremap <F2> :set list!<CR>
  60. " my favorite indent style
  61. set tabstop=4
  62. set shiftwidth=4
  63. set expandtab
  64. let g:local_vimrc=".vimrc_local.vim"
  65. " for gvim
  66. colorscheme torte
  67. set gfn=Droid\ Sans\ Mono\ 9
  68. set fileencodings=ucs-bom,utf-8,cp1250,latin1
  69. let python_highlight_all = 1
  70. set number
  71. highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
  72. set autoindent
  73. set pastetoggle=<F4>
  74. nmap <F3> :set invnumber<CR>
  75. " ###############################################################################
  76. " ## from http://stackoverflow.com/a/9528322/835945
  77. " ###############################################################################
  78. " Save your swp files to a less annoying place than the current directory.
  79. " If you have .vim-swap in the current directory, it'll use that.
  80. " Otherwise it saves it to ~/.vim/swap, ~/tmp or .
  81. if isdirectory($HOME . '/.local/share/vim') == 0
  82. :silent !mkdir -p ~/.vim/swap >/dev/null 2>&1
  83. endif
  84. set directory=./.vim-swap//
  85. set directory+=~/.local/share/vim/swap//
  86. set directory+=~/tmp//
  87. set directory+=.
  88. " ###############################################################################
  89. " ## from https://github.com/plasticboy/vim-markdown
  90. " ###############################################################################
  91. let g:vim_markdown_folding_disabled=1