Guest User

Untitled

a guest
Jul 20th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. call pathogen#runtime_append_all_bundles()
  2. call pathogen#helptags()
  3.  
  4. set nocompatible
  5.  
  6. colorscheme desert
  7.  
  8. tab all
  9. set mouse=a
  10.  
  11. set backspace=eol,indent,start
  12.  
  13. set hidden
  14. set autowrite
  15.  
  16. set ruler
  17. set number
  18. set showcmd
  19. set showmatch
  20.  
  21. set ts=4
  22. set sts=4
  23. set expandtab
  24. set shiftwidth=4
  25.  
  26. set autoindent
  27. set smartindent
  28. set smarttab
  29. set cindent
  30.  
  31. set incsearch
  32. set hlsearch
  33. set ignorecase
  34. set smartcase
  35.  
  36. syntax on
  37.  
  38. filetype plugin indent on
  39.  
  40. set completefunc=syntaxcomplete#Complete
  41.  
  42. " C Indentation
  43. set cinoptions=(4 " Indent 4 spaces after a line ending in (
  44. set cinoptions+=g0 " C++ public: and private: without indentation (fixes inline member function braces)
  45.  
  46. " Tab navigation with Control (+Shift) Tab
  47. nnoremap <C-S-Tab> :tabprevious<CR>
  48. nnoremap <C-Tab> :tabnext<CR>
  49. cnoremap <C-S-Tab> :tabprevious<CR>
  50. cnoremap <C-Tab> :tabnext<CR>
  51. inoremap <C-S-Tab> <C-o>:tabprevious<CR>
  52. inoremap <C-Tab> <C-o>:tabnext<CR>
  53.  
  54. " Indent/deindent with Tab/S-Tab
  55. nnoremap <Tab> >>
  56. nnoremap <S-Tab> <<
  57. inoremap <S-Tab> <C-d>
  58. vnoremap <Tab> >gv
  59. vnoremap <S-Tab> <gv
  60.  
  61. " - and _ for / and ? to mimic the US keyb layout on a Finnish keyboard
  62. noremap - /
  63. noremap _ ?
  64.  
  65. " ö and ä for go to tag and go back
  66. noremap ä <C-]>
  67. noremap ö <C-t>
  68.  
  69. " F5 = make and open quickfix
  70. noremap <silent> <F5> :make<CR>:botright cwindow<CR>
  71. inoremap <silent> <F5> <Esc>:make<CR>:botright cwindow<CR>
  72.  
  73. " F2 = previous error, F3 = current error, F4 = next error
  74. noremap <silent> <F2> :cprev<CR>
  75. noremap <silent> <F3> :cc!<CR>
  76. noremap <silent> <F4> :cnext<CR>
  77. inoremap <silent> <F2> <C-o>:cprev<CR>
  78. inoremap <silent> <F3> <C-o>:cc!<CR>
  79. inoremap <silent> <F4> <C-o>:cnext<CR>
  80.  
  81. " Home like VC++
  82. inoremap <silent> <Home> <c-o>@=<SID>HomeLikeVCpp()<cr>
  83. nnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>
  84. vnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>
  85.  
  86. nnoremap <silent> 0 @=<SID>HomeLikeVCpp()<cr>
  87. vnoremap <silent> 0 @=<SID>HomeLikeVCpp()<cr>
  88. nnoremap <silent> + @=<SID>EndLikeVCpp()<cr>
  89. vnoremap <silent> + @=<SID>EndLikeVCpp()<cr>
  90.  
  91. inoremap <silent> <End> <c-\><c-n>@=<SID>EndLikeVCpp()<cr>a
  92. nnoremap <silent> <End> @=<SID>EndLikeVCpp()<cr>
  93. vnoremap <silent> <End> @=<SID>EndLikeVCpp()<cr>
  94.  
  95. function! s:HomeLikeVCpp()
  96. let ll = strpart(getline('.'), -1, col('.'))
  97. if ll =~ '^\s\+$' | return '0'
  98. else | return '^'
  99. endif
  100. endfunction
  101.  
  102.  
  103. function! s:EndLikeVCpp()
  104. let l = strpart(getline('.'), col('.')-1)
  105. let ll = match(l, '^\S\s*$')
  106.  
  107. if getline('.') =~ '^\s*$'
  108. if col('.') + (mode()!='v') == col('$') | return 'g_'
  109. else | return '$'
  110. endif
  111. else
  112. if ll >= 0 | return '$'
  113. else | return 'g_'
  114. endif
  115. endif
  116. endfunction
Add Comment
Please, Sign In to add comment