Config File Collection
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.vimrc 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. "
  2. " General Options
  3. "
  4. " Disable compatibility mode
  5. set nocompatible
  6. "
  7. " File-Menu
  8. "
  9. " Enable plugin
  10. filetype plugin on
  11. " Search down into subfolders. Provides tab-completion for all file-related tasks
  12. set path+=**
  13. "
  14. " Tagging (^] go to tag source, ^t go back)
  15. "
  16. command! MakeTags !ctags -R .
  17. "
  18. " File Browsing
  19. "
  20. let g:netrw_banner=0 " disable annoying banner
  21. let g:netrw_browse_split=4 " open in prior window
  22. let g:netrw_altv=1 " open splits to the right
  23. let g:netrw_liststyle=3 " tree view
  24. let g:netrw_list_hide=netrw_gitignore#Hide()
  25. let g:netrw_list_hide.=',\(^}|\s\s)\zs\.\S\+'
  26. " Now WE CAN:
  27. " - edit a folder to open a file browser
  28. " - <CR>/v/t to open in an h-split/v-spli/tab
  29. " - check |netrw-browse-maps| for more mappings
  30. "
  31. " Snippets
  32. "
  33. nnoremap ,pyclass :-1read $HOME/.vim/skeletons/class.py<CR>6l
  34. "
  35. " Indent Options
  36. "
  37. " New lines inherit the indentation of previous lines.
  38. set autoindent
  39. " Convert tabs to spaces.
  40. set expandtab
  41. " Enable indentation rules that are file-type specific.
  42. "filetype indent on
  43. " When shifting lines, round the indentation to the nearest multiple of "shiftwidth."
  44. set shiftround
  45. " When shifting, indent using four spaces.
  46. set shiftwidth=4
  47. " Insert "tabstop" number of spaces when the "tab" key is pressed.
  48. "set smarttab
  49. " Indent using four spaces.
  50. set tabstop=4
  51. "
  52. " PEP8 rules
  53. "
  54. let g:autopep8_max_line_length=150
  55. let g:autopep8_on_save = 1
  56. "
  57. " Search Options
  58. "
  59. " Enable search highlighting.
  60. set hlsearch
  61. " Ignore case when searching.
  62. set ignorecase
  63. " Incremental search that shows partial matches.
  64. set incsearch
  65. " Automatically switch search to case-sensitive when search query contains an uppercase letter.
  66. set smartcase
  67. "
  68. " Performance Options
  69. "
  70. " Limit the files searched for auto-completes.
  71. "set complete-=i
  72. " Don't update screen during macro and script execution.
  73. "set lazyredraw
  74. "
  75. " Text Rendering Options
  76. "
  77. " Always try to show a paragraph's last line.
  78. "set display+=lastline
  79. " Use an encoding that supports unicode.
  80. set encoding=utf-8
  81. " Avoid wrapping a line in the middle of a word.
  82. set linebreak
  83. " The number of screen lines to keep above and below the cursor.
  84. set scrolloff=3
  85. " The number of screen columns to keep to the left and right of the cursor.
  86. set sidescrolloff=5
  87. " Enable syntax highlighting.
  88. syntax enable
  89. " Enable line wrapping.
  90. set wrap
  91. "
  92. " User Interface Options
  93. "
  94. colorscheme elflord
  95. " Always display the status bar.
  96. set laststatus=2
  97. " Statusline color
  98. highlight NormalColor ctermbg=11 ctermfg=0
  99. highlight InsertColor ctermbg=14 ctermfg=0
  100. highlight ReplaceColor ctermbg=13 ctermfg=0
  101. highlight VisualColor ctermbg=9 ctermfg=0
  102. highlight CommandColor ctermbg=15 ctermfg=0
  103. highlight FilenameColor ctermbg=10 ctermfg=0
  104. highlight RightColor ctermbg=8 ctermfg=15
  105. set statusline=
  106. set statusline+=%#NormalColor#%{(mode()=='n')?'\ \ NORMAL\ \ ':''}
  107. set statusline+=%#InsertColor#%{(mode()=='i')?'\ \ INSERT\ \ ':''}
  108. set statusline+=%#ReplaceColor#%{(mode()=='r')?'\ \ REPLACE\ ':''}
  109. set statusline+=%#VisualColor#%{(mode()=='v')?'\ \ VISUAL\ \ ':''}
  110. set statusline+=%#CommandColor#%{(mode()=='c')?'\ \ COMMAND\ ':''}
  111. set statusline+=%#FilenameColor# " Statusline format NormalColor
  112. set statusline+=\ %f " Filename
  113. set statusline+=\ %m " Modified token
  114. set statusline+=%= " Allign right
  115. set statusline+=%#RightColor# " Statusline format CursorColumn
  116. set statusline+=\ %y " file type
  117. set statusline+=\ %{&fileencoding?&fileencoding:&encoding} " encoding
  118. set statusline+=\[%{&fileformat}\] " file format
  119. set statusline+=\ %p%% " line percent
  120. set statusline+=\ %l:%c " line:column
  121. set statusline+=\ [0x%B]\ " ASCII hex code under cursor
  122. " Always show cursor position.
  123. "set ruler
  124. " Display command line's tab complete options as a menu.
  125. set wildmenu
  126. " Maximum number of tab pages that can be opened from the command line.
  127. "set tabpagemax=50
  128. " Change color scheme.
  129. "set colorscheme wombat256mod
  130. " Highlight the line currently under cursor.
  131. "set cursorline
  132. " Show line numbers on the sidebar.
  133. set number
  134. " Show line number on the current line and relative numbers on all other lines.
  135. set relativenumber
  136. " Disable beep on errors.
  137. set noerrorbells
  138. " Flash the screen instead of beeping on errors.
  139. set visualbell
  140. " Enable mouse for scrolling and resizing.
  141. "set mouse=a
  142. " Set the window's title, reflecting the file currently being edited.
  143. "set title
  144. " Use colors that suit a dark background.
  145. "set background=dark
  146. "
  147. " Code Folding Options
  148. "
  149. " Fold based on indention levels.
  150. "set foldmethod=indent
  151. " Only fold up to three nested levels.
  152. "set foldnestmax=3
  153. " Disable folding by default.
  154. "set nofoldenable
  155. "
  156. " Miscellaneous Options
  157. "
  158. " Automatically re-read files if unmodified inside Vim.
  159. "set autoread
  160. " Allow backspacing over indention, line breaks and insertion start.
  161. "set backspace=indent,eol,start
  162. " Directory to store backup files.
  163. set backupdir=~/.cache/vim
  164. " Display a confirmation dialog when closing an unsaved file.
  165. "set confirm
  166. " Directory to store swap files.
  167. set dir=~/.cache/vim
  168. " Delete comment characters when joining lines.
  169. "set formatoptions+=j
  170. " Hide files in the background instead of closing them.
  171. "set hidden
  172. " Increase the undo limit.
  173. set history=1000
  174. " Ignore file's mode lines; use vimrc configurations instead.
  175. "set nomodeline
  176. " Disable swap files.
  177. "set noswapfile
  178. " Interpret octal as decimal when incrementing numbers.
  179. "set nrformats-=octal
  180. " The shell used to execute commands.
  181. "set shell
  182. " Enable spellchecking.
  183. "set spell
  184. " Ignore files matching these patterns when opening files based on a glob pattern.
  185. set wildignore+=.pyc,.swp