-
Notifications
You must be signed in to change notification settings - Fork 127
/
config.vim
153 lines (140 loc) · 4.76 KB
/
config.vim
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
" ---------------------------------------------
" Regular Vim Configuration (No Plugins Needed)
" ---------------------------------------------
" ---------------
" Color
" ---------------
set background=dark
" Force 256 color mode if available
if $TERM =~ '-256color'
set t_Co=256
endif
" Enable true color
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" -----------------------------
" File Locations
" -----------------------------
" Double // causes backups to use full file path
exec 'set backupdir=' . g:vimdir . '/.backup//'
exec 'set directory=' . g:vimdir . '/.tmp//'
exec 'set spellfile=' . g:vimdir . '/spell/custom.en.utf-8.add'
" Persistent Undo
if has('persistent_undo')
set undofile
exec 'set undodir=' . g:vimdir . '/.undo'
endif
" ---------------
" UI
" ---------------
set ruler " Ruler on
set number " Line numbers on
set relativenumber " Relative numbers on
set nowrap " Line wrapping off
set laststatus=2 " Always show the statusline
set cmdheight=2 " Make the command area two lines high
set cursorline " Highlight current line
set encoding=utf-8
set noshowmode " Don't show the mode since status line shows it
set title " Set the title of the window in the terminal to the file
set updatetime=300 " Added based on guidance from coc.nvim
set signcolumn=yes " Ensures no flickering for coc-git
set shortmess+=c " don't give |ins-completion-menu| messages.
if exists('+colorcolumn')
set colorcolumn=80 " Color the 80th column differently as a wrapping guide.
endif
" Disable tooltips for hovering keywords in Vim
if exists('+ballooneval')
" This doesn't seem to stop tooltips for Ruby files
set noballooneval
" 100 second delay seems to be the only way to disable the tooltips
set balloondelay=100000
endif
" ---------------
" Behaviors
" ---------------
syntax enable
set nocompatible " be iMproved
filetype plugin indent on
set backup " Turn on backups
set autoread " Automatically reload changes if detected
set wildmenu " Turn on WiLd menu
" longest common part, then all.
set wildmode=longest,full
set hidden " Change buffer - without saving
set history=768 " Number of things to remember in history.
set confirm " Enable error files & error jumping.
set clipboard+=unnamed " Yanks go on clipboard instead.
set autowrite " Writes on make/shell commands
set timeoutlen=400 " Time to wait for a command (after leader for example).
set ttimeout
set ttimeoutlen=100 " Time to wait for a key sequence.
set nofoldenable " Disable folding entirely.
set foldlevelstart=99 " I really don't like folds.
set formatoptions=crql
set iskeyword+=\$,- " Add extra characters that are valid parts of variables
set nostartofline " Don't go to the start of the line after some commands
set scrolloff=3 " Keep three lines below the last line when scrolling
set gdefault " this makes search/replace global by default
set switchbuf=useopen " Switch to an existing buffer if one exists
" ---------------
" Text Format
" ---------------
set tabstop=2
set backspace=indent,eol,start " Delete everything with backspace
set shiftwidth=2 " Tabs under smart indent
set shiftround
set cindent
set autoindent
set smarttab
set expandtab
" ---------------
" Searching
" ---------------
set ignorecase " Case insensitive search
set smartcase " Non-case sensitive search
set incsearch " Incremental search
set hlsearch " Highlight search results
set wildignore+=*.o,*.obj,*.exe,*.so,*.dll,*.pyc,.svn,.hg,.bzr,.git,
\.sass-cache,*.class,*.scssc,*.cssc,sprockets%*,*.lessc,*/node_modules/*,
\rake-pipeline-*
set inccommand=nosplit " Preview replace as you type
" ---------------
" Visual
" ---------------
set showmatch " Show matching brackets.
set matchtime=2 " How many tenths of a second to blink
" Show invisible characters
set list
" Show trailing spaces as dots and carrots for extended lines.
" From Janus, http://git.io/PLbAlw
" Reset the listchars
set listchars=""
" make tabs visible
set listchars=tab:▸▸
" make non-breakable spaces visible
set listchars+=nbsp:¬
" show trailing spaces as dots
set listchars+=trail:•
" The character to show in the last column when wrap is off and the line
" continues beyond the right of the screen
set listchars+=extends:>
" The character to show in the last column when wrap is off and the line
" continues beyond the right of the screen
set listchars+=precedes:<
" ---------------
" Sounds
" ---------------
set noerrorbells
set novisualbell
set t_vb=
" ---------------
" Mouse
" ---------------
set mousehide " Hide mouse after chars typed
set mouse=a " Mouse in all modes
" Better complete options to speed it up
set complete=.,w,b,u,U