Advertisement
Guest User

vimrc

a guest
Aug 24th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.58 KB | None | 0 0
  1. execute pathogen#infect()
  2.  
  3. call plug#begin('~/.vim/plugged')
  4.  
  5. " Add this line for UltiSnips
  6. Plug 'SirVer/ultisnips'
  7. Plug 'honza/vim-snippets'
  8. " Use <Tab> for triggering snippets
  9. " NOTE: You may need to adjust the mapping if you're using other plugins that use <Tab>
  10. let g:UltiSnipsExpandTrigger="<tab>"
  11. let g:UltiSnipsJumpForwardTrigger="<c-j>"
  12. let g:UltiSnipsJumpBackwardTrigger="<c-k>"
  13.  
  14. " Specify the directory where your snippets will be stored
  15. let g:UltiSnipsSnippetDirectories=['UltiSnips']
  16.  
  17.  
  18. call plug#end()
  19.  
  20.  
  21.  
  22. " Initialize plugin system
  23. call plug#begin('~/.vim/plugged')
  24.  
  25. " Pathogen: Vim plugin runtime management
  26. Plug 'tpope/vim-pathogen'
  27.  
  28. " Vim-Airline: A status/tabline plugin
  29. Plug 'vim-airline/vim-airline'
  30. Plug 'vim-airline/vim-airline-themes'
  31.  
  32. " Badwolf colorscheme
  33. Plug 'sjl/badwolf'
  34.  
  35. " YouCompleteMe: Code-completion engine
  36. Plug 'ycm-core/YouCompleteMe'
  37.  
  38. " Add more plugins here as needed
  39.  
  40. call plug#end()
  41.  
  42. set background=dark
  43. syntax on
  44.  
  45. set ts=4
  46. set sts=4
  47. set sw=4
  48. set laststatus=2
  49. set smartindent
  50. set autoindent
  51. set number
  52. set smartcase
  53. set whichwrap+=<,>,[,]
  54.  
  55. let c_no_curly_error=1
  56. let g:badwolf_darkgutter = 1
  57. let g:badwolf_tabline = 2
  58.  
  59. colorscheme badwolf
  60.  
  61. set cursorline
  62. hi CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
  63. hi CursorLineNR cterm=bold
  64.  
  65. nmap <F1> <nop>
  66. imap <F1> <nop>
  67.  
  68. map <F2> <ESC>:w <CR>
  69. imap <F2> <ESC>:w <CR>
  70. map <C-O> :tabnew <bar> :e . <CR>
  71. map <C-W> :q <CR>
  72. imap <C-W> :q <CR>
  73. map <C-T> :tabnew <CR>
  74. noremap <F1> <ESC>:tabprev <CR>
  75. vnoremap <F1> <ESC>:tabprev <CR>
  76. inoremap <F1> <ESC>
  77. autocmd Filetype cpp           map <F9> <ESC>:w <bar> !g++ -std=gnu++17 -O3 -o %:r % && ./%:r <CR>
  78. autocmd Filetype cpp           imap <F9> <ESC>:w <bar> !g++ -std=gnu++17 -O3 -o %:r % && ./%:r <CR>
  79. autocmd Filetype cpp           map <F10> <ESC>:w <bar> !./%:r <CR>
  80. autocmd Filetype cpp           imap <F10> <ESC>:w <bar> !./%:r <CR>
  81.  
  82. autocmd Filetype python        map <F9> <ESC>:w <bar> !python3 % <CR>
  83. autocmd Filetype python        imap <F9> <ESC>:w <bar> !python3 % <CR>
  84.  
  85. autocmd Filetype scala         map <F9> <ESC>:w <bar> !scala -classpath .:/Users/rado/University/ConcurrentProgramming/cp % <CR>
  86. autocmd Filetype scala         imap <F9> <ESC>:w <bar> !scala -classpath .:/Users/rado/University/ConcurrentProgramming/cp % <CR>
  87.  
  88. autocmd Filetype java         map <F9> <ESC>:w <bar> !javac % && java %:r<CR>
  89. autocmd Filetype java         imap <F9> <ESC>:w <bar> !javac % && java %:r<CR>
  90.  
  91. autocmd Filetype haskell       map <F9> <ESC>:w <bar> !ghc % <CR>
  92. autocmd Filetype haskell       imap <F9> <ESC>:w <bar> !ghc % <CR>
  93. autocmd Filetype haskell       map <F8> <ESC>:w <bar> !ghci % <CR>
  94. autocmd Filetype haskell       imap <F8> <ESC>:w <bar> !ghci % <CR>
  95. autocmd Filetype lhaskell       map <F8> <ESC>:w <bar> !ghci % <CR>
  96. autocmd Filetype lhaskell       imap <F8> <ESC>:w <bar> !ghci % <CR>
  97.  
  98. autocmd FileType python        setlocal expandtab
  99. autocmd Filetype cpp           nmap <Tab> mtgg=G't
  100. autocmd Filetype c             nmap <Tab> mtgg=G't
  101.  
  102. set completeopt-=preview
  103. let g:ycm_confirm_extra_conf = 0
  104. let g:ycm_show_diagnostics_ui = 0
  105.  
  106. hi StatusLine ctermbg=black ctermfg=white
  107.  
  108. "vim-airline
  109. let g:airline_theme='raven'
  110. let g:airline_powerline_fonts = 1
  111. let g:airline#extensions#tabline#enabled = 1
  112. let g:airline#extensions#tabline#show_close_button = 0
  113. let g:airline#extensions#tabline#show_tab_type = 0
  114. let g:airline#extensions#tabline#show_tab_nr = 0
  115. let airline#extensions#tabline#tabs_label = ''
  116. let airline#extensions#tabline#show_splits = 0
  117. let airline#extensions#tabline#show_buffers = 0
  118. "au User AirlineAfterInit  :let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%', 'maxlinenr', ' :%3v'])
  119. "au User AirlineAfterInit  :let g:airline_section_z = airline#section#create(['%3p%% %L:%3v'])
  120. au User AirlineAfterInit  :let g:airline_section_z = airline#section#create(['%p%%%#__accent_bold#%{g:airline_symbols.linenr}%l%#__restore__#%#__accent_bold#/%L%#__accent_bold# C:%v%#__restore__#'])
  121.  
  122. "Hide default mode
  123. set noshowmode
  124.  
  125. "Different cursor depending on mode
  126. let &t_SI = "\<Esc>]50;CursorShape=1\x7"       "Vertical bar in insert mode
  127. let &t_EI = "\<Esc>]50;CursorShape=0\x7"       "Block in normal mode
  128.  
  129. " Ensure Backspace works as expected in Insert mode
  130. set backspace=indent,eol,start
  131.  
  132. " General terminal mode settings (usually not needed to modify)
  133. " You can add any additional settings or customizations here
  134.  
  135. " Example: Use a colorscheme that works well in terminal
  136. colorscheme desert
  137.  
  138. " Example: Enable line numbers if needed
  139. set number
  140. set relativenumber
  141.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement