Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 15.36 KB | None | 0 0
  1. set nocompatible              " be iMproved, required
  2. filetype off                  " required
  3.  
  4. " set the runtime path to include Vundle and initialize
  5. set rtp+=~/.vim/bundle/Vundle.vim
  6. call vundle#begin()
  7. " alternatively, pass a path where Vundle should install plugins
  8. "call vundle#begin('~/some/path/here')
  9.  
  10. " let Vundle manage Vundle, required
  11. Plugin 'VundleVim/Vundle.vim'
  12.  
  13. " The following are examples of different formats supported.
  14. " Keep Plugin commands between vundle#begin/end.
  15. " plugin on GitHub repo
  16. Plugin 'tpope/vim-fugitive'
  17. " plugin from http://vim-scripts.org/vim/scripts.html
  18. " Plugin 'L9'
  19. " Git plugin not hosted on GitHub
  20.  
  21. " The sparkup vim script is in a subdirectory of this repo called vim.
  22. " Pass the path to set the runtimepath properly.
  23. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
  24. " Install L9 and avoid a Naming conflict if you've already installed a
  25. " different version somewhere else.
  26. " Plugin 'ascenator/L9', {'name': 'newL9'}
  27.  
  28. " All of your Plugins must be added before the following line
  29.  
  30. " To ignore plugin indent changes, instead use:
  31. "filetype plugin on
  32. "
  33. " Brief help
  34. " :PluginList       - lists configured plugins
  35. " :PlugiinInstall    - installs plugins; append `!` to update or just :PluginUpdate
  36. " :PluginSearch foo - searches for foo; append `!` to refresh local cache
  37. " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
  38. e
  39. " see :h vundle for more details or wiki for FAQ
  40. " Put your non-Plugin stuff after this line
  41.  
  42. filetype plugin indent on
  43. " show existing tab with 4 spaces width
  44. set tabstop=4
  45. " when indenting with '>', use 4 spaces width
  46. set shiftwidth=4
  47. " On pressing tab, insert 4 spaces
  48. set expandtab
  49.  
  50. " All Plugins
  51.  
  52. "Plugin 'aklt/plantuml-syntax'
  53. "Plugin 'vim-scripts/DoxyGen-Syntax.git'
  54.  
  55.  
  56. Plugin 'scrooloose/nerdtree'
  57. Plugin 'bfrg/vim-cpp-modern.git'
  58.  
  59. Plugin 'ctrlpvim/ctrlp.vim'
  60. "Plugin 'tacahiroy/ctrlp-funky.git'
  61. Plugin 'ivalkeen/vim-ctrlp-tjump'
  62.  
  63. "Plugin 'LucHermitte/lh-vim-lib'
  64. "Plugin 'LucHermitte/lh-tags'
  65.  
  66. "Autcompletion
  67. "Plugin 'lifepillar/vim-mucomplete'
  68.  
  69. "YouCompleteMe
  70. Plugin 'Valloric/YouCompleteMe'
  71. Plugin 'rdnetto/YCM-Generator'
  72. Plugin 'SirVer/ultisnips'
  73.  
  74. Plugin 'junegunn/vim-peekaboo'
  75. "Plugin 'vim-syntastic/syntastic.git'
  76. Plugin 'Shougo/unite.vim'
  77. Plugin 'Shougo/vimproc.vim'
  78. Plugin 'Shougo/vimfiler.vim'
  79. "Plugin 'codeape2/vim-multiple-monitors.git'
  80.  
  81. Plugin 'vim-scripts/a.vim'
  82.  
  83. Plugin 'andersbakken/rtags'
  84. "Plugin 'kshenoy/vim-signature.git'
  85. Plugin 'MattesGroeger/vim-bookmarks'
  86. Plugin 'vim-scripts/cscope.vim'
  87. "Plugin 'airblade/vim-gitgutter'
  88. "Plugin 'octol/vim-cpp-enhanced-highlight'
  89. Plugin 't9md/vim-choosewin'
  90. Plugin 'majutsushi/tagbar.git'
  91. Plugin 'vim-scripts/taglist.vim'
  92. "Plugin 'vim-scripts/FuzzyFinder'
  93. "Plugin 'Shougo/neoinclude.vim'
  94. "Plugin 'tsukkee/unite-tag'
  95. Plugin 'szw/vim-maximizer'
  96. Plugin 'Konfekt/FastFold'
  97. Plugin 'tenfyzhong/vim-gencode-cpp'
  98. "Plugin 'vim-scripts/h2cppx'
  99. "Plugin 'xuqix/h2cppx'
  100.  
  101. "Plugin 'LucHermitte/lh-vim-lib'
  102. "Plugin 'LucHermitte/lh-style'
  103. "Plugin 'LucHermitte/lh-tags'
  104. "Plugin 'LucHermitte/lh-dev'
  105. "Plugin 'LucHermitte/lh-brackets'
  106. "Plugin 'LucHermitte/searchInRuntime'
  107. "Plugin 'LucHermitte/mu-template'
  108. "Plugin 'tomtom/stakeholders_vim'
  109. "Plugin 'LucHermitte/alternate-lite'
  110. "Plugin 'LucHermitte/lh-cpp'
  111.  
  112. Plugin 'rafi/awesome-vim-colorschemes'
  113.  
  114.  
  115.  
  116. call vundle#end()            " required
  117. filetype plugin indent on    " required
  118.  
  119.  set mouse=10
  120.  map <ScrollWheelUp> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y>
  121.  map <ScrollWheelDown> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
  122.  
  123. " Highlight
  124.  
  125. " annyoing lh-cpp
  126. let g:usemarks = 1
  127.  
  128. "Syntastic
  129.  
  130. "let g:syntastic_cpp_no_default_include_dirs=1
  131. "let g:syntastic_cpp_include_dirs = [".", "../include", "../boost-include"]
  132. "let g:syntastic_cpp_compiler_options = "--std=c++14"
  133. "let g:syntastic_cpp_check_header = 1
  134. "let g:syntastic_aggregate_errors = 0
  135.  
  136. set laststatus=0
  137.  
  138. let g:deoplete#enable_at_startup = 1
  139.  
  140. let g:tagbar_ctags_bin = 'unctags'
  141.  
  142. " Functions
  143. " ----------------------------------------------------------------------
  144.  
  145. function! DisableYCMHightlight()
  146.     let g:ycm_show_diagnostics_ui = 0
  147. endfunction
  148.  
  149. function! EnableYCMHighlight()
  150.     let g:ycm_show_diagnostics_ui = 1
  151. endfunction
  152.  
  153. function! UpdateSnippets()
  154.     call UltiSnips#RefreshSnippets()
  155. endfunction
  156.  
  157. function! SwitchToHidden()
  158.     let g:directory_in="hidden"
  159. endfunction
  160.  
  161. function! SwitchToRevealed()
  162.     let g:directory_in="revealed"
  163. endfunction
  164.  
  165. function! GoToSRCDementedShooters()
  166.     let directory_in_local = get( g:, "directory_in", "revealed")
  167.  
  168.     if directory_in_local == "hidden"
  169.          execute "cd ~/Projekty/Hidden/src/"  
  170.     else
  171.         execute "cd ~/Projekty/Demented-Shooters/src/"
  172.     endif
  173. endfunction
  174.  
  175. function! GoToSRCDocDementedShooters()
  176.     let directory_in_local = get( g:, "directory_in", "revealed")
  177.  
  178.     if directory_in_local == "hidden"
  179.         execute "cd ~/Projekty/Hidden/src/doc/"
  180.     else
  181.         execute "cd ~/Projekty/Demented-Shooters/src/doc/"
  182.     endif
  183. endfunction
  184.  
  185. function! GoToIUMLSrcDementedShooters()
  186.     let directory_in_local = get( g:, "directory_in", "revealed")
  187.  
  188.     if directory_in_local == "hidden"
  189.         execute "cd ~/Projekty/Hidden/doc/iuml_src_docs/"
  190.     else
  191.         execute "cd ~/Projekty/Demented-Shooters/doc/iuml_src_docs/"
  192.     endif
  193. endfunction
  194.  
  195. function! GenFile(local_name)
  196.     let local_name_b = substitute(a:local_name, "\/", "\\\\/", "g")
  197.     let file_1="~/Projekty/Demented-Shooters/src/DementedShooters/".local_name_b.".h"
  198.     let file_2 = "~/Projekty/Demented-Shooters/src/DementedShooters/".local_name_b.".cpp"
  199.     let cmd1 = "edit " . file_1
  200.     let cmd2 = "edit " . file_2
  201.     execute cmd1
  202.     execute "vs"
  203.     execute cmd2
  204.     execute "vs"
  205.     execute "edit ~/Projekty/Demented-Shooters/src/CMakeLists.txt"
  206.     let cmd3="%s\/${HEADERS}\/${HEADERS}\r    ${CMAKE_CURRENT_SOURCE_DIR}\\\/DementedShooters\\\/".local_name_b.".h\/g"
  207.     let cmd4="%s\/${SOURCE}\/${SOURCE}\r    ${CMAKE_CURRENT_SOURCE_DIR}\\\/DementedShooters\\\/".local_name_b.".cpp\/g"
  208.     execute cmd3
  209.     execute cmd4
  210. endfunction
  211.  
  212.  
  213. function! GenerateSyntaxForCpp()
  214.     execute "syntax match CodedemensCodeLabel \"Member Data\""
  215.     execute "syntax match CodedemensCodeLabel \"Member API\""
  216.     execute "syntax match CodedemensCodeLabel \"Friends\""
  217.     execute "syntax match CodedemensCodeLabel \"Constructor & Destructor & Main functions\""
  218.     execute "syntax match CodedemensCodeLabel \"Subclasses (Nested Classes)\""
  219.     execute "syntax match CodedemensCodeLabel \"Forward Declarations\""
  220.     execute "syntax match CodedemensCodeLabel \"Globals\""
  221.  
  222.     execute "syntax match CodedemensCodeLabel \"Constants\""
  223.     execute "syntax match CodedemensCodeLabel \"Macros\""
  224.     execute "syntax match CodedemensCodeLabel \"Globals Typedefs\""
  225.     execute "syntax match CodedemensCodeLabel \"Local Typedefs\""
  226. endfunction
  227.  
  228. function! GenerateSyntaxForMastermind()
  229.     execute "syntax match CodedemensNormalLabel \"[a-zA-Z_][a-zA-Z_0-9]\""
  230.     execute "syntax match CodedemensPendingLabel \"PENDING\""
  231.     execute "syntax match CodedemensDoneLabel \"DONE\""
  232.     execute "syntax match CodedemensCTaskLabel \"<<< WORKING ON\""
  233.     execute "syntax match CodedemensPartlyLabel \"PARTLY\""
  234.     execute "syntax match CodedemensImplementLabel \"Implement\""
  235.     execute "syntax match CodedemensClassLabel \"Class\""
  236.     execute "syntax match CodedemensTODOLabel \"TODO\""
  237.     execute "syntax match CodedemensFixLabel \"Fix\""
  238.     execute "syntax match CodedemensInheritedLabel \"Inherits\""
  239.     execute "syntax match CodedemensReferenceLabel \"Ref\""
  240.     execute "syntax match CodedemensVariableLabel \"Var\""
  241. endfunction
  242.  
  243.  
  244.  
  245. function! GenerateCodedemensLayout()
  246.     execute "set number"
  247.     execute "wincmd j"
  248.     execute "resize 12"
  249.     execute "ea"
  250.     execute "wincmd k"
  251.     execute "vs"
  252.     execute "ea"
  253.     execute "vs"
  254.     execute "ea"
  255.     execute "vs"
  256.     execute "ea"
  257.     execute "edit Mastermind"
  258.     execute "vertical resize 45"
  259.     execute "syntax match CodedemensNormalLabel \"[a-zA-Z_][a-zA-Z_0-9]\""
  260.     execute "syntax match CodedemensPendingLabel \"PENDING\""
  261.     execute "syntax match CodedemensDoneLabel \"DONE\""
  262.     execute "syntax match CodedemensCTaskLabel \"<<< WORKING ON\""
  263.     execute "syntax match CodedemensPartlyLabel \"PARTLY\""
  264.     execute "syntax match CodedemensImplementLabel \"Implement\""
  265.     execute "syntax match CodedemensClassLabel \"Class\""
  266.     execute "syntax match CodedemensTODOLabel \"TODO\""
  267.     execute "syntax match CodedemensFixLabel \"Fix\""
  268.     execute "syntax match CodedemensInheritedLabel \"Inherits\""
  269.     execute "syntax match CodedemensReferenceLabel \"Ref\""
  270.     execute "syntax match CodedemensVariableLabel \"Var\""
  271.     execute "wincmd l"
  272.     execute "edit main.cpp"
  273.     execute "wincmd l"
  274.     execute "edit DementedShooters/Core.h"
  275.     execute "wincmd l"
  276.     execute "edit DementedShooters/Core.cpp"
  277.     execute "Tagbar"
  278.     execute "ea"
  279. endfunction
  280.  
  281.  
  282. :command! DateTime :put =strftime('%x %X (%Z)')
  283. :command! Time :put =strftime('%X (%Z)')
  284. :command! GoToIUMLDocs :cd ~/Projekty/Demented\ Shooters/github/doc/iuml_src_docs/
  285. :command! GoToSRC :cd ~/Projekty/Demented\ Shooters/github/src/
  286.  
  287. nnoremap tn :tn<CR>
  288. nnoremap tp :tp<CR>
  289.  
  290. " Generation of definition
  291. nnoremap <C-D> :GenDefinition<CR>
  292. vmap <C-D> :GenDefinition<CR>
  293.  
  294. "nucomplete
  295. set completeopt+=noselect
  296. set belloff+=ctrlg
  297. let g:mucomplete#enable_auto_at_startup = 1
  298.  
  299.  
  300. "set syntax=cpp
  301. set syntax=cpp.doxygen
  302.  
  303. let g:load_doxygen_syntax=1
  304.  
  305. "unmap <C-R>
  306.  
  307. "Other
  308. xnoremap p pgvy
  309. nnoremap <leader>d "_d
  310. xnoremap <leader>d "_d
  311.  
  312.  
  313. nnoremap <C-+> set guifont=Monospace\ Regular\
  314.  
  315. "nmap <C-D><C-D> da{
  316. vmap <C-H> :s///gc<Left><Left><Left><Left>
  317. nmap <C-H> :%s///gc<Left><Left><Left><Left>
  318. vmap <C-J> :s/;/ {\r\r}/g<CR>
  319. vmap <C-F> :vimgrep /<C-R><C-W>/ %<CR>
  320. nmap <C-F> :noautocmd vimgrep // %<Left><Left><Left>
  321. vmap <C-S-F> :vimgrep /<C-R><C-W>/ ** <CR>
  322. nmap <C-S-F> :noautocmd vimgrep // **<Left><Left><Left><Left>
  323. nnoremap <C-k6> :cn<CR>
  324. nnoremap <C-k9> :cp<CR>
  325. set wildignore+=tags
  326.  
  327. nmap <C-S><C-S> :call
  328.  
  329. nnoremap <C-W>g :tabnext<CR>
  330. nnoremap <C-W>G :tabnext<CR>
  331. nnoremap <C-W><C-G> :tabnext<CR>
  332.  
  333. nnoremap <C-D><C-O> :edit ~/Projekty/AceOfUniverse/github/doc/iuml_src_docs/.iuml<Left><Left><Left><Left><Left>
  334. nnoremap <C-D><C-I> :edit ~/Projekty/AceOfUniverse/github/src/
  335.  
  336. nnoremap <k0> :VimFilerCurrentDir<CR>
  337. nnoremap <k1> :call GoToSRCDementedShooters()<CR>
  338. nnoremap <k2> :call GoToSRCDocDementedShooters()<CR>
  339. nnoremap <k3> :call GoToIUMLSrcDementedShooters()<CR>
  340. nnoremap <k4> :BookmarkShowAll<CR>
  341. nnoremap <k5> :BookmarkToggle<CR>
  342. nnoremap <k6> :BookmarkNext<CR>
  343. nnoremap <k9> :BookmarkPrev<CR>
  344. nnoremap <C-k1> :edit ~/Projekty/TechDemo/github/src/DementedShooters/
  345. nnoremap <C-k2> :edit ~/Projekty/TechDemo/github/doc/iuml_src_docs/Doc_DS_.iuml<Left><Left><Left><Left><Left>
  346. nnoremap <C-k3> :edit ~/Projekty/TechDemo/github/doc/iuml_src_docs/Class_DS_.iuml<Left><Left><Left><Left><Left>
  347. "VimFiler
  348. let g:vimfiler_safe_mode_by_default = 0
  349.  
  350. "Comments
  351. vmap <C-c> :s/^/\/\//<CR>
  352. vmap <C-u> :s/^\/\///<CR>
  353.  
  354. "CTRLP
  355. let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:60,results:60'
  356. let g:ctrlp_map = ''
  357. let g:ctrlp_switch_buffer = 'Et'
  358.  
  359. nnoremap <C-p> :CtrlPtjump<CR>
  360. nnoremap <C-G><C-P> :CtrlPtjump
  361.  
  362. " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
  363. let g:UltiSnipsExpandTrigger="<tab>"
  364. let g:UltiSnipsJumpForwardTrigger="<tab>"
  365. let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
  366.  
  367. let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips/']
  368. "let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips', 'UltiSnips']
  369. "let g:UltiSnipsSnippetDirectories=['./UltiSnips']
  370.  
  371.  
  372. " If you want :UltiSnipsEdit to split your window.
  373. "let g:UltiSnipsEditSplit="vertical"
  374.  
  375.  
  376.  
  377. let g:unite_enable_start_insert = 1
  378.  
  379.  
  380. set nocursorcolumn
  381. set nocursorline
  382.  
  383. "bookmarks
  384. highlight BookmarkLineDefault guifg=NONE guibg=#333357
  385. let g:bookmark_sign = '♥'
  386. let g:bookmark_highlight_lines = 1
  387.  
  388. map <F7> :mksession! ~/ashynooks.vim<CR>
  389. map <C-F7> :source ~/ashynooks.vim<CR>
  390. map <C-G> :YcmCompleter FixIt<CR>
  391.  
  392. "YCM other
  393. "let g:ycm_max_diagnostics_to_display=0
  394. "let g:ycm_filepath_completion_use_working_dir = 1
  395. let g:ycm_goto_buffer_command = 'same-buffer'
  396. let g:ycm_autoclose_preview_window_after_completion = 0
  397.  
  398. " make YCM compatible with UltiSnips (using supertab)
  399. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
  400. let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
  401. let g:SuperTabDefaultCompletionType = '<C-n>'
  402. let g:ycm_keep_logfiles = 1
  403.  
  404. " Maximizer Toggle
  405. nnoremap <F3> :MaximizerToggle<CR>
  406.  
  407. " Doxygen & Make
  408. "nnoremap <F3> :cd ../ <CR>:!cmake -G"Unix Makefiles" -DGAME=1<CR>:cd src/ <CR>
  409. nnoremap <F4> :cd ../ <CR>:make -j3  \|redraw!\|cc<CR>:cd src/ <CR>
  410. nnoremap <F5> :cwindow <CR>
  411.  
  412. "TCommand
  413. "nnoremap <C-O> :CommandT<CR>
  414. "nnoremap <C-G><C-O> :CommandTTag<CR>
  415.  
  416. "Unite
  417. nnoremap <C-O> :Unite -force-redraw file_rec<CR>
  418. nnoremap <C-G><C-O> :YcmCompleter GoTo<CR>
  419. let g:unite_enable_split_vertically = 1
  420.  
  421. " Gen Function Definition
  422.  
  423. nnoremap <C-b> :g/.*\n^{/yank A<cr>:bn<cr>pkdd:%s/$/;/<cr>:g/::/d B<cr>A<cr><cr>class <cr>{<cr>};<esc>"BP:%s/[^ ]\+:://<cr>j%jyt(kk$p=ipjA<cr>public:<esc>
  424.  
  425. "YouCompleteMe
  426.  
  427. nnoremap <C-F2> :let g:ycm_auto_trigger=1<CR>
  428. nnoremap <C-F3> :let g:ycm_auto_trigger=0<CR>
  429. let g:ycm_show_diagnostics_ui = 1
  430.  
  431. "ctags
  432. map <F6> :!ctags -RB<CR>
  433.  
  434. "A
  435. nnoremap <C-A> :A<CR>
  436.  
  437. "Highlight
  438. let g:cpp_class_scope_highlight = 1
  439. let g:cpp_member_variable_highlight = 1
  440. set hlsearch
  441.  
  442. "ChooseWin
  443. map <F2> :ChooseWin<CR>
  444.  
  445. let g:choosewin_overlay_enable = 1
  446.  
  447.  
  448. "set nocursorcolumn
  449. "set nocursorline
  450.  
  451. augroup myBetterColors
  452.   au!
  453.   autocmd ColorScheme *  hi! Number ctermfg=200
  454. augroup END
  455.  
  456. colorscheme orbital
  457. set guifont=Monospace\ 6
  458.  
  459. "set autoindent
  460. "set smartindent
  461.  
  462. set foldmethod=syntax
  463. set foldlevel=99
  464.  
  465. if has("unix")
  466.     function! FontSizePlus ()
  467.       let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
  468.       let l:gf_size_whole = l:gf_size_whole + 1
  469.       let l:new_font_size = ' '.l:gf_size_whole
  470.       let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
  471.     endfunction
  472.  
  473.     function! FontSizeMinus ()
  474.       let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
  475.       let l:gf_size_whole = l:gf_size_whole - 1
  476.       let l:new_font_size = ' '.l:gf_size_whole
  477.       let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
  478.     endfunction
  479. else
  480.     function! FontSizePlus ()
  481.       let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
  482.       let l:gf_size_whole = l:gf_size_whole + 1
  483.       let l:new_font_size = ':h'.l:gf_size_whole
  484.       let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
  485.     endfunction
  486.  
  487.     function! FontSizeMinus ()
  488.       let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
  489.       let l:gf_size_whole = l:gf_size_whole - 1
  490.       let l:new_font_size = ':h'.l:gf_size_whole
  491.       let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
  492.     endfunction
  493. endif
  494.  
  495.  
  496. nnoremap <C-\>> call FontSizePlus()<CR>
  497. nnoremap <C-\<> call FontSizeMinus()<CR>
  498.  
  499. if has("gui_running")
  500.     nmap <C-F11> :call FontSizeMinus()<CR>
  501.     nmap <C-F12> :call FontSizePlus()<CR>
  502. endif
  503.  
  504. "YCM diagnostics
  505. "let g:ycm_show_diagnostics_ui = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement