forked from testthedocs/The-Economist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
218 lines (181 loc) · 5.42 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
" Initialization Settings
" =======================
set shortmess+=I
" =======================
" UI and Display Settings
" =======================
set number
set relativenumber
set laststatus=2
set ignorecase
set smartcase
set incsearch
set conceallevel=2
set tags=./tags;,
set noerrorbells visualbell t_vb=
colorscheme habamax
" =======================
" Editor Behavior
" =======================
set backspace=indent,eol,start
set hidden
set clipboard=unnamedplus
set shiftwidth=4
set foldmethod=syntax
set foldnestmax=10
set foldenable
set foldlevel=2
let g:javaScript_fold = 1
set expandtab " Use spaces instead of tabs
set tabstop=2 " Number of spaces that a tab counts for
set shiftwidth=2 " Number of spaces to use for each step of (auto)indent
set softtabstop=2 " Number of spaces that a tab counts for while performing editing operations
" ===================
" vimwiki
" ==================
set nocompatible
syntax on
filetype plugin indent on
let g:vimwiki_global_ext = 0
" let g:vimwiki_list = [{'path': "~/code/chrislco/content",
" \ 'syntax': 'markdown', 'ext': '.md','index':"vw.md"}]
let wikiPath = getenv('VIMWIKI_PATH')
if wikiPath != ''
let g:vimwiki_list = [{'path': wikiPath,
\ 'syntax': 'markdown', 'ext': '.md', 'index': 'vw.md'}]
endif
" The following will open a QuickFix window with incomplete tasks,
" but only those which are in a hyphenated (-) list. This is a
" simple way to filter only on tasks which are ready to be performed.
function! VimwikiFindIncompleteTasks()
lvimgrep /- \[ \]/ %:p
lopen
endfunction
function! VimwikiFindAllIncompleteTasks()
ALEDisable
UnProse
VimwikiSearch /- \[ \]/
lopen
endfunction
nmap <Leader>wa :call VimwikiFindAllIncompleteTasks()<CR>
nmap <Leader>wx :call VimwikiFindIncompleteTasks()<CR>
" =======================
" Key Mappings
" =======================
nmap Q <Nop>
nnoremap <leader>b ciw**<C-R>"**<Esc>
nnoremap <leader>i ciw_<C-R>"_<Esc>
nnoremap <leader>q viws""<Esc>P
nnoremap ' :ALENext<CR>
nnoremap ; :ALEPrevious<CR>
nnoremap <silent> <C-f> :Files<CR>
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
inoremap <Left> <ESC>:echoe "Use h"<CR>
inoremap <Right> <ESC>:echoe "Use l"<CR>
inoremap <Up> <ESC>:echoe "Use k"<CR>
inoremap <Down> <ESC>:echoe "Use j"<CR>
nnoremap <leader>ad :ALEDisable<CR>
nnoremap <leader>ae :ALEEnable<CR>
nnoremap <leader>p :Prose<CR>
nnoremap <leader>up :UnProse<CR>
nnoremap <leader>a vip:EasyAlign<CR>*|
nnoremap go }j
nnoremap gp {k
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" =======================
" Plugins
" =======================
call plug#begin()
Plug 'dense-analysis/ale'
Plug 'reedes/vim-pencil'
Plug 'michaeljsmith/vim-indent-object'
Plug 'github/copilot.vim'
Plug 'tpope/vim-commentary'
Plug 'arcticicestudio/nord-vim'
Plug 'psf/black', { 'branch': 'stable' }
Plug 'junegunn/vim-easy-align'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'prettier/vim-prettier'
Plug 'vimwiki/vimwiki'
Plug 'michal-h21/vim-zettel'
Plug 'dhruvasagar/vim-table-mode'
call plug#end()
" =======================
" Linter and Language Tools
" =======================
let g:ale_virtualtext_cursor=0
let g:ale_linters = {'markdown':['vale'], 'python':['pylint','pylsp']}
let g:ale_python_pylint_options = '--disable=E0401'
let g:ale_set_balloons = 1
let g:ale_completion_enabled = 1
" Markdown conceal
autocmd FileType markdown syntax match MarkdownLink '\v\([^ ]+\)' containedin=ALL conceal cchar=✦
" =======================
" Custom Functions
" =======================
let w:ProseModeOn = 0
function! NoConsole()
%g/console\./norm I//
endfunction
function EnableProseMode()
" setlocal spell spelllang=en_us
Goyo 66
SoftPencil
echo "Prose Mode On"
endfu
function DisableProseMode()
Goyo!
NoPencil
setlocal nospell
echo "Prose Mode Off"
endfu
function ToggleProseMode()
if w:ProseModeOn == 0
call EnableProseMode()
let w:ProseModeOn = 1
else
call DisableProseMode()
let w:ProseModeOn = 0
endif
endfu
command Prose call EnableProseMode()
command UnProse call DisableProseMode()
command ToggleProse call ToggleProseMode()
command NoConsole call NoConsole()
function ScratchBufferize()
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
endfu
" =======================
" Limelight
" =======================
" Color name (:help cterm-colors) or ANSI code
" let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240
" Color name (:help gui-colors) or RGB color
" let g:limelight_conceal_guifg = 'DarkGray'
" let g:limelight_conceal_guifg = '#777777'
" Default: 0.5
let g:limelight_default_coefficient = 0.1
" Number of preceding/following paragraphs to include (default: 0)
" let g:limelight_paragraph_span = 1
" Beginning/end of paragraph
" When there's no empty line between the paragraphs
" and each paragraph starts with indentation
let g:limelight_bop = '\n' " so it doesn't highlight two paragraphs when I'm on the blank line in between
" let g:limelight_eop = '\ze\n^\s'
" Highlighting priority (default: 10)
" Set it to -1 not to overrule hlsearch
" let g:limelight_priority = -1
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!