Config File Collection
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

.vimrc 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. "
  2. " General Options
  3. "
  4. " Disable compatibility mode
  5. "set nocp
  6. "
  7. " Indent Options
  8. "
  9. " New lines inherit the indentation of previous lines.
  10. set autoindent
  11. " Convert tabs to spaces.
  12. set expandtab
  13. " Enable indentation rules that are file-type specific.
  14. "set filetype indent on
  15. " When shifting lines, round the indentation to the nearest multiple of "shiftwidth."
  16. set shiftround
  17. " When shifting, indent using four spaces.
  18. set shiftwidth=4
  19. " Insert "tabstop" number of spaces when the "tab" key is pressed.
  20. set smarttab
  21. " Indent using four spaces.
  22. set tabstop=4
  23. "
  24. " Search Options
  25. "
  26. " Enable search highlighting.
  27. set hlsearch
  28. " Ignore case when searching.
  29. set ignorecase
  30. " Incremental search that shows partial matches.
  31. set incsearch
  32. " Automatically switch search to case-sensitive when search query contains an uppercase letter.
  33. set smartcase
  34. "
  35. " Performance Options
  36. "
  37. " Limit the files searched for auto-completes.
  38. "set complete-=i
  39. " Don't update screen during macro and script execution.
  40. "set lazyredraw
  41. "
  42. " Text Rendering Options
  43. "
  44. " Always try to show a paragraph's last line.
  45. "set display+=lastline
  46. " Use an encoding that supports unicode.
  47. set encoding=utf-8
  48. " Avoid wrapping a line in the middle of a word.
  49. set linebreak
  50. " The number of screen lines to keep above and below the cursor.
  51. set scrolloff=3
  52. " The number of screen columns to keep to the left and right of the cursor.
  53. set sidescrolloff=5
  54. " Enable syntax highlighting.
  55. syntax enable
  56. " Enable line wrapping.
  57. set wrap
  58. "
  59. " User Interface Options
  60. "
  61. " Always display the status bar.
  62. set laststatus=2
  63. " Statusline color
  64. " highlight mode color
  65. highlight NormalColor ctermbg=10 ctermfg=0
  66. highlight InsertColor ctermbg=14 ctermfg=0
  67. highlight VisualColor ctermbg=9 ctermfg=0
  68. highlight CommandColor ctermbg=15 ctermfg=0
  69. set statusline=
  70. set statusline+=%#NormalColor#%{(mode()=='n')?'\ \ NORMAL\ \ ':''}
  71. set statusline+=%#InsertColor#%{(mode()=='i')?'\ \ INSERT\ \ ':''}
  72. set statusline+=%#VisualColor#%{(mode()=='v')?'\ \ VISUAL\ \ ':''}
  73. set statusline+=%#CommandColor#%{(mode()=='c')?'\ \ COMMAND\ ':''}
  74. function! GitBranch()
  75. return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
  76. endfunction
  77. function! StatuslineGit()
  78. let l:branchname = GitBranch()
  79. return strlen(l:branchname) > 0?' '.l:branchname.' ':''
  80. endfunction
  81. set statusline+=%#PmenuSel# " Statusline format PmenuSel
  82. set statusline+=%{StatuslineGit()} " Git status
  83. set statusline+=%#NormalColor# " Statusline format NormalColor
  84. set statusline+=\ %f " Filename
  85. set statusline+=\ %m " Modified token
  86. set statusline+=%= " Allign right
  87. set statusline+=%#CursorColumn# " Statusline format CursorColumn
  88. set statusline+=\ %y " file type
  89. set statusline+=\ %{&fileencoding?&fileencoding:&encoding} " encoding
  90. set statusline+=\[%{&fileformat}\] " file format
  91. set statusline+=\ %p%% " line percent
  92. set statusline+=\ %l:%c " line:column
  93. set statusline+=\ [0x%B]\ " ASCII hex code under cursor
  94. " Always show cursor position.
  95. "set ruler
  96. " Display command line's tab complete options as a menu.
  97. "set wildmenu
  98. " Maximum number of tab pages that can be opened from the command line.
  99. "set tabpagemax=50
  100. " Change color scheme.
  101. "set colorscheme wombat256mod
  102. " Highlight the line currently under cursor.
  103. set cursorline
  104. " Show line numbers on the sidebar.
  105. set number
  106. " Show line number on the current line and relative numbers on all other lines.
  107. set relativenumber
  108. " Disable beep on errors.
  109. set noerrorbells
  110. " Flash the screen instead of beeping on errors.
  111. set visualbell
  112. " Enable mouse for scrolling and resizing.
  113. "set mouse=a
  114. " Set the window's title, reflecting the file currently being edited.
  115. "set title
  116. " Use colors that suit a dark background.
  117. "set background=dark
  118. "
  119. " Code Folding Options
  120. "
  121. " Fold based on indention levels.
  122. "set foldmethod=indent
  123. " Only fold up to three nested levels.
  124. "set foldnestmax=3
  125. " Disable folding by default.
  126. "set nofoldenable
  127. "
  128. " Miscellaneous Options
  129. "
  130. " Automatically re-read files if unmodified inside Vim.
  131. "set autoread
  132. " Allow backspacing over indention, line breaks and insertion start.
  133. "set backspace=indent,eol,start
  134. " Directory to store backup files.
  135. set backupdir=~/.cache/vim
  136. " Display a confirmation dialog when closing an unsaved file.
  137. "set confirm
  138. " Directory to store swap files.
  139. set dir=~/.cache/vim
  140. " Delete comment characters when joining lines.
  141. "set formatoptions+=j
  142. " Hide files in the background instead of closing them.
  143. "set hidden
  144. " Increase the undo limit.
  145. set history=1000
  146. " Ignore file's mode lines; use vimrc configurations instead.
  147. "set nomodeline
  148. " Disable swap files.
  149. "set noswapfile
  150. " Interpret octal as decimal when incrementing numbers.
  151. "set nrformats-=octal
  152. " The shell used to execute commands.
  153. "set shell
  154. " Enable spellchecking.
  155. "set spell
  156. " Ignore files matching these patterns when opening files based on a glob pattern.
  157. "set wildignore+=.pyc,.swp