-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
191 lines (175 loc) · 6.64 KB
/
Copy path.vimrc
File metadata and controls
191 lines (175 loc) · 6.64 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
" --------------------------------------------------------
" See https://github.com/NewMexicoKid/vimrc for the source
" --------------------------------------------------------
"
set nocompatible " be iMproved, required
filetype off " required
set backspace=indent,eol,start " Allow backspace in insert mode
"set number " Line numbers
set hidden " Allow hidden buffers
filetype plugin indent on " Enable file type detection and do language-dependent indenting.
set history=100 " Default = 8
nnoremap ; :
set tabstop=4 " Default tabs are too big
" set wrap " Turn on word wrapping
set ai " autoindent
set linebreak " Only wrap at sensible places
set nolist " list disables linebreak
set textwidth=0 " prevent Vim from automatically inserting line breaks
set wrapmargin=0
set formatoptions-=t " Don't change wrapping on existing lines
set formatoptions+=l " Black magic
" to insert a real tab, use <Ctrl>-V <Tab>; this command expands tabs to spaces
set expandtab
" shiftwidth
set shiftwidth=4
let mapleader=","
set spell " Turn spelling on
" # Install Plugins
call plug#begin('~/.vim/plugged')
" plugin on GitHub repo
Plug 'tpope/vim-fugitive'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
" ## Themes
Plug 'chriskempson/vim-tomorrow-theme'
" Plug 'vim-airline/vim-airline-themes'
Plug 'mhartington/oceanic-next'
Plug 'alessandroyorba/despacio'
Plug 'flazz/vim-colorschemes'
Plug 'rafi/awesome-vim-colorschemes'
" https://github.com/morhetz/gruvbox/wiki/Installation
Plug 'morhetz/gruvbox'
Plug 'chuling/equinusocio-material.vim'
" ## Markdown
Plug 'nelstrom/vim-markdown-folding'
Plug 'tpope/vim-markdown'
" ## Other Tools
" Plug 'vim-airline/vim-airline' " Airline bar
Plug 'https://github.com/sirtaj/vim-openscad' " OpenSCAD syntax hilighting
Plug 'itchyny/lightline.vim' " from https://github.com/itchyny/lightline.vim
Plug 'scrooloose/syntastic' " syntax info
Plug 'Raimondi/delimitmate' " smart completion of delimiters
Plug 'vitalk/vim-simple-todo'
Plug 'vuciv/vim-bujo'
Plug 'reedes/vim-litecorrect' " autocorrect - https://github.com/reedes/vim-litecorrect
" Autosave taskpaper files
Plug 'vim-scripts/vim-auto-save'
Plug 'djoshea/vim-autoread'
" All of your Plugins must be added before the following line
call plug#end()
autocmd filetype taskpaper let g:auto_save = 1
autocmd filetype taskpaper :WatchForChanges!
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PlugList - lists configured plugins
" :PlugInstall - installs plugins; append `!` to update or just :PlugUpdate
" :PlugSearch foo - searches for foo; append `!` to refresh local cache
" :PlugClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" Put your non-Plugin stuff after this line
augroup litecorrect
autocmd!
autocmd FileType markdown,mkd,md call litecorrect#init()
augroup END
" # Plugin Settings
set laststatus=2 " Make airline status bar appear all the time
set foldenable " Enable markdown folding
" let g:airline#extensions#wordcount#enabled = 1 "Show word count
" Get rid of pointless Airline separators because I don't want to install a
" patched font to make them look right
" let g:airline_left_sep=''
" let g:airline_right_sep=''
" let g:airline#extensions#wordcount#enabled = 1
" Remove existing autocommands to avoid duplicates
:autocmd!
" Force Airline to refresh after setup so settings work
" ":autocmd VimEnter * :AirlineRefresh
" # Color Scheme
syntax on
syntax enable " I have no idea what this actually does
set background=dark
if !has('gui_running')
set t_Co=256 " 256 colors, terrible for most themes, but best for Tomorrow-Night
set guifont=Consolas:h12:cANSI
endif
let g:gruvbox_italic=1
let g:gruvbox_contrast_dark='hard'
" colorscheme gruvbox
set termguicolors
let g:equinusocio_material_style = 'pure'
let g:equinusocio_material_less = 50
colorscheme equinusocio_material
let g:airline_theme = 'equinusocio_material'
highlight Normal ctermbg=NONE guibg=NONE
highlight LineNr ctermbg=NONE guibg=NONE
highlight SignColumn ctermbg=NONE guibg=NONE
" colorscheme Tomorrow-Night-Bright
" colorscheme OceanicNext
" let g:despacio_Campfire = 1
" colorscheme despacio
" colorscheme minimalist
" lightline with wordcount - https://github.com/itchyny/lightline.vim/issues/295
let g:lightline = {
\ 'active': {
\ 'right': [ [ 'lineinfo' ], [ 'percent', 'wordcount' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'wordcount': 'WordCount',
\ },
\ }
" function MarkdownLevel()
" let h = matchstr(getline(v:lnum), '^#\+')
" if empty(h)
" return "="
" else
" return ">" . len(h)
" endif
" endfunction
" au BufEnter *.md setlocal foldexpr=MarkdownLevel()
" au BufEnter *.md setlocal foldmethod=expr
" I no longer remember why I need this:
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
" Needed for my chromebook crouton instance
" map <C-A-w> <C-w>
map <C-e> <C-w>
" Wordcount function from Pingouin (https://nanowrimo.org/participants/pingouin)
function! WordCount()
let s:old_status = v:statusmsg
let position = getpos(".")
exe ":silent normal g\<C-g>"
let stat = v:statusmsg
let s:word_count = 0
if stat != '--No lines in buffer--'
let s:word_count = str2nr(split(v:statusmsg)[11])
let v:statusmsg = s:old_status
end
call setpos('.', position)
return s:word_count
endfunction
" ---set statusline= " clear the statusline for when vimrc is reloaded
" ---set statusline+=%-3.3n\ " buffer number
" ---set statusline+=%f\ " file name
" ---set statusline+=%h%m%r%w " flags
" ---set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
" ---set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
" ---set statusline+=%{&fileformat}] " file format
" ---set statusline+=%10.10{WordCount()}w\ " wordcount
" ---set statusline+=%= " right align
" ---set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\ " highlight
"set statusline+=%b,0x%-8B\ "
"current char
"set statusline+=%-14.(%l,%c%V%)\ %<%P "
"offset
"set noruler "
"set laststatus=2 " show statusline
nmap <C-i> <Plug>BujoAddnormal
imap <C-i> <Plug>BujoAddinsert
nmap <C-j> <Plug>BujoChecknormal
imap <C-j> <Plug>BujoCheckinsert
let g:bujo#todo_file_path = $HOME . "/.cache/bujo"