PraeceptorXS

Untitled

Jan 18th, 2023 (edited)
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.43 KB | Help | 0 0
  1. "vimrc by Ben Sun. This is what I use, but feel free to modify
  2. "
  3. set runtimepath+=~/.vim_runtime "Where vim looks for plugins
  4. set nocp                        "Disables backward compatability with vi
  5. set nowrap                      "Disables text wrapping
  6. syntax enable                   "Enables syntax highlighting
  7. "Plugins
  8. se rtp+=~/.vim/bundle/Vundle.vim
  9. call vundle#begin()
  10. Plugin 'scrooloose/nerdtree'      "Vim file explorer
  11. Plugin 'VundleVim/Vundle.vim'     "Plugin manager
  12. Plugin '907th/vim-auto-save'      "Automatically saves file when ESC
  13. Plugin 'octol/vim-cpp-enhanced-highlight' "Syntax highlighting
  14. Plugin 'jiangmiao/auto-pairs'     "Automatically pairs parentheses
  15. Plugin 'NLKNguyen/papercolor-theme'       "My preferred vim theme
  16. Plugin 'danro/rename.vim'         "Allows you to rename files
  17. Plugin 'thaerkh/vim-indentguides' "Adds indent lines to each level
  18. Plugin 'CursorLineCurrentWindow'  "Puts cursor only on current window
  19. Plugin 'luochen1990/rainbow'      "Rainbow parentheses
  20. Plugin 'ervandew/supertab'        "Improved tabline
  21. Plugin 'vim-airline/vim-airline'  "More improved tabline
  22. Plugin 'vim-airline/vim-airline-themes'
  23. Plugin 'tc50cal/vim-terminal'     "Allows you to spawn a terminal
  24. Plugin 'vhda/verilog_systemverilog.vim'   "SV syntax highlighting
  25. call vundle#end()
  26. execute pathogen#infect()
  27.  
  28. let g:go_version_warning = 0
  29. let g:auto_save = 1 "Enables auto save. If annoying, change to 0
  30.  
  31. set mouse=a "Allows you to mouse around in the editor
  32.  
  33. set backspace=indent,eol,start
  34. set statusline+=%#warningmsg#
  35. set statusline+=%{SyntasticStatuslineFlag()}
  36. set statusline+=%*
  37.  
  38. "Linter, disable if causing issues
  39. let g:syntastic_always_populate_loc_list = 1
  40. let g:syntastic_auto_loc_list = 1
  41. let g:syntastic_check_on_open =1
  42. let g:syntastic_check_on_wq = 0
  43.  
  44. "Move around buffers using ctrl+O and ctrl+I
  45. set hidden
  46. nnoremap <C-O> :bnext<CR>
  47. nnoremap <C-I> :bprev<CR>
  48.  
  49. "Tabline configuration
  50. let g:airline#extensions#tabline#enabled = 1
  51. let g:airline#extensions#tabline#show_tabs = 1
  52. let g:airline_extensions#tabline#show_buffers = 1
  53. let g:airline_theme='angr'
  54.  
  55. "File explorer. Hit CTRL+N to toggle
  56. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  57. map <C-n> :NERDTreeToggle<CR>
  58.  
  59. set t_Co=256   "256 terminal colors
  60.  
  61. "Theming
  62. set background=dark
  63. colorscheme PaperColor
  64. set number
  65.  
  66. "Indentation level indicators
  67. let g:indentguides_spacechar = '|'
  68. let g:indentguides_tabchar = '|'
  69. let g:indentguides_firstlevel = get(g:, 'indentguides_firstlevel', 1)
  70.  
  71. set cursorline "Highlights cursor line
  72.  
  73. "More C/C++ syntax highlighting stuff
  74. let g:cpp_class_scope_highlight = 1
  75. let g:cpp_member_variable_highlight = 1
  76. let g:cpp_class_decl_highlight = 1
  77.  
  78. filetype plugin on
  79. filetype indent on
  80.  
  81. set autoread
  82.  
  83. set foldmethod=syntax
  84. set foldnestmax=10
  85. set foldlevel=99
  86. set foldcolumn=2
  87.  
  88. nmap <leader>w :w!<cr>
  89.  
  90. let g:rainbow_active = 1
  91.  
  92. set ai "Auto indent
  93. set si "Smart indent
  94.  
  95. highlight Folded ctermfg=white guifg=white
  96. highlight Folded guibg=gray ctermbg=blue
  97. highlight FoldColumn ctermfg=white
  98. set nocompatible  "Kill vi-compatibility
  99. set t_Co=256 "256 color
  100. set encoding=utf-8 "UTF-8 character encoding
  101.  
  102. "Indent 2 spaces
  103. set tabstop=2     "2 space tabs
  104. set shiftwidth=2  "2 space shift
  105. set softtabstop=2 "Tab spaces in no hard tab mode
  106. set expandtab     "Turns tabs into spaces
  107. set autoindent    "autoindent on new lines
  108.  
  109. set showmatch     "Highlight matching braces
  110.  
  111. set ruler         "Show bottom ruler
  112.  
  113. set equalalways   "Split windows equal size
  114.  
  115. set formatoptions=croq  "Enable comment line auto formatting
  116.  
  117. set title         "Set window title to file
  118. set hlsearch      "Highlight on search
  119. set ignorecase    "Search ignoring case
  120. set smartcase     "Search using smartcase
  121. set incsearch     "Start searching immediately
  122.  
  123. set scrolloff=5   "Never scroll off
  124. set wildmode=longest,list "Better unix-like tab completion
  125. set clipboard=unnamed     "Copy and paste from system clipboard
  126. set lazyredraw    "Don't redraw while running macros (faster)
  127. set wrap          "Visually wrap lines
  128. set linebreak     "Only wrap on 'good' characters for wrapping
  129. set backspace=indent,eol,start  "Better backspacing
  130. set linebreak     "Intelligently wrap long files
  131. set ttyfast       "Speed up vim
  132. set nostartofline "Vertical movement preserves horizontal position
  133.  
  134. "Strip whitespace from end of lines when writing file
  135. autocmd BufWritePre * :%s/\s\+$//e
Advertisement
Add Comment
Please, Sign In to add comment