TunaWorkforce

My vim config

Mar 10th, 2022 (edited)
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.96 KB | None | 0 0
  1. " An example for a vimrc file.
  2. "
  3. " Maintainer:   Bram Moolenaar <[email protected]>
  4. " Last change:  2019 Dec 17
  5. "
  6. " To use it, copy it to
  7. "          for Unix:  ~/.vimrc
  8. "         for Amiga:  s:.vimrc
  9. "    for MS-Windows:  $VIM\_vimrc
  10. "         for Haiku:  ~/config/settings/vim/vimrc
  11. "       for OpenVMS:  sys$login:.vimrc
  12.  
  13. " When started as "evim", evim.vim will already have done these settings, bail
  14. " out.
  15. if v:progname =~? "evim"
  16.   finish
  17. endif
  18.  
  19. " Get the defaults that most users want.
  20. source $VIMRUNTIME/defaults.vim
  21.  
  22. if has("vms")
  23.   set nobackup      " do not keep a backup file, use versions instead
  24. else
  25.   set backup        " keep a backup file (restore to previous version)
  26.   if has('persistent_undo')
  27.     set undofile    " keep an undo file (undo changes after closing)
  28.   endif
  29. endif
  30.  
  31. if &t_Co > 2 || has("gui_running")
  32.   " Switch on highlighting the last used search pattern.
  33.   set hlsearch
  34. endif
  35.  
  36. " Put these in an autocmd group, so that we can delete them easily.
  37. augroup vimrcEx
  38.   au!
  39.  
  40.   " For all text files set 'textwidth' to 78 characters.
  41.   autocmd FileType text setlocal textwidth=78
  42. augroup END
  43.  
  44. " Add optional packages.
  45. "
  46. " The matchit plugin makes the % command work better, but it is not backwards
  47. " compatible.
  48. " The ! means the package won't be loaded right away but when plugins are
  49. " loaded during initialization.
  50. if has('syntax') && has('eval')
  51.   packadd! matchit
  52. endif
  53.  
  54.  
  55. "
  56. " Custom Rules added by me
  57. "
  58.  
  59. " Enable syntax highlighting
  60. syntax on
  61.  
  62.  
  63. " Attempt to determine the type of a file based on its name and possibly its
  64. " contents. Use this to allow intelligent auto-indenting for each filetype,
  65. " and for plugins that are filetype specific.
  66. filetype indent plugin on
  67.  
  68. " Better command-line completion
  69. set wildmenu
  70.  
  71. " Show partial commands in the last line of the screen
  72. set showcmd
  73.  
  74. " Highlight searches (use <C-L> to temporarily turn off highlighting; see the
  75. " mapping of <C-L> below)
  76. set hlsearch
  77.  
  78. " When opening a new line and no filetype-specific indenting is enabled, keep
  79. " the same indent as the line you're currently on. Useful for READMEs, etc.
  80. set autoindent
  81.  
  82. " Display line numbers on the left
  83. set number
  84.  
  85. " Indentation settings for using 2 spaces instead of tabs.
  86. " Do not change 'tabstop' from its default value of 8 with this setup.
  87. set shiftwidth=4
  88. set softtabstop=4
  89. set expandtab
  90.  
  91. " Display a dark-gray ruler at column 78
  92. set colorcolumn=78                                                        
  93. hi ColorColumn ctermbg=darkgray guibg=darkgray
  94.  
  95. " When your cursor is moving away from matched strings, the highlight will
  96. " be turned off automatically if there is no matching.
  97. let g:incsearch#auto_nohlsearch = 1
  98.  
  99. " Use default system clipboard as clipboard
  100. " Can be: unnamed and unnamedplus
  101. set clipboard=unnamedplus
  102.  
  103. " I use F-keys to toggle visibility of things:
  104. nmap <F2> :set hlsearch!<CR>
  105. nmap <F3> :set number!<CR>
  106. nmap <F4> :set list!<CR>
  107. nmap <F5> :set cursorline!<CR>:set cursorcolumn!<CR>
  108.  
  109.  
Advertisement