forked from ryansully/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
165 lines (144 loc) · 4.51 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins {{{
if filereadable(expand("~/.vim/plugins.vim"))
source ~/.vim/plugins.vim
endif
" }}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors {{{
if $TERM_PROGRAM == 'vscode'
" Use matching color scheme for VS Code Integrated Terminal
colorscheme codedark
elseif filereadable(expand("~/.vimrc_background"))
let base16colorspace=256
source ~/.vimrc_background
endif
" enable syntax processing
syntax enable
" }}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Options
"
" The following sections match those found in option-window (:options)
" Full list of options: http://vimhelp.appspot.com/quickref.txt.html#option-list
" {{{ important
" don't behave Vi-compatible
" This must be first, because it changes other options as a side effect.
set nocompatible
" }}}
" {{{ moving around, searching and patterns
" show match for partly typed search command
set incsearch
" ignore case when using a search pattern
set ignorecase
" }}}
" {{{ displaying text
" number of screen lines to show around the cursor
set scrolloff=5
" long lines don't wrap and continue on the next line
set nowrap
" show <Tab> as ^I and end-of-line as $
"set list
" list of strings used for list mode
set listchars=tab:→\ ,trail:·,precedes:«,extends:»
" show the line number for each line
set number
" show the relative line number for each line
set relativenumber
" }}}
" {{{ syntax, highlighting, and spelling
" "dark" or "light"; the background color brightness
set background=dark
" highlight all matches for the last used search pattern
set hlsearch
" highlight the screen column of the cursor
"set cursorcolumn
" highlight the screen line of the cursor
set cursorline
" columns to highlight
set colorcolumn=81,121
" highlight text after column 120
highlight Right120 ctermbg=darkred ctermfg=white guibg=#592929
match Right120 /\%121v.\+/
" }}}
" {{{ messages and info
" show (partial) command keys in the status line
set showcmd
" show cursor position below for each window
set ruler
" use a visual bell instead of beeping
set visualbell
" }}}
" {{{ editing text
" specifies what <BS>, CTRL-W, etc. can do in Insert mode
set backspace=indent,eol,start
" }}}
" {{{ tabs and indenting
" number of spaces a <Tab> in the text stands for
set tabstop=2
" number of spaces used for each step of (auto)indent
set shiftwidth=2
" a <Tab> in an indent inserts 'shiftwidth' spaces
set smarttab
" expand <Tab> to spaces in Insert mode
set expandtab
" automatically set the indent of a new line
set autoindent
" }}}
" {{{ folding
" value for 'foldlevel' when starting to edit a file
set foldlevelstart=10
" folding type: "manual", "indent", "expr", "marker" or "syntax"
set foldmethod=indent
" }}}
" {{{ reading and writing files
" don't keep a backup after overwriting a file
set nobackup
" automatically read a file when it was modified outside of Vim
set autoread
" }}}
" {{{ the swap file
" don't use a swap file for a buffer
set noswapfile
" }}}
" {{{ command line editing
" how many command lines are remembered
set history=1000
" command-line completion shows a list of matches
set wildmenu
" }}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Powerline {{{
" https://github.com/vim/vim/issues/3117#issuecomment-402622616
if has('python3')
silent! python3 1
endif
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
set laststatus=2 " Always show statusline
set t_Co=256 " Use 256 colours
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide default mode text (e.g. -- INSERT -- below statusline)
" Powerline Escape Fix
" https://medium.com/usevim/powerline-escape-fix-e849fd07aad0
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
" }}}
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
endif
if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local
endif
" vim:foldmethod=marker:foldlevel=0