this repo has no description
1" vi: foldmethod=marker foldlevel=0
2scriptencoding utf-8
3
4" Plugins {{{
5command! -bar PackUpdate call plugins#reload() | call minpac#update()
6command! -bar PackClean call plugins#reload() | call minpac#clean()
7
8set runtimepath^=/usr/local/opt/fzf/
9set packpath^=~/.local/share/nvim
10" }}}
11" Identation {{{
12set shiftwidth=4 expandtab
13
14set textwidth=80
15set nowrap linebreak formatoptions+=l
16" }}}
17" User interface {{{
18set lazyredraw
19
20set title
21
22" Ignore case. If your code uses different casing to differentiate files, then
23" you need mental help
24set wildignorecase fileignorecase
25set wildmode=full
26" Colors {{{
27set termguicolors
28" set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
29colorscheme blame
30" }}}
31" Ignore all automatic files and folders {{{
32set wildignore+=*.o,*~,**/.git/**,**/tmp/**,**/node_modules/**,**/_build/**,**/deps/**,**/target/**,**/uploads/**
33" }}}
34" Display tabs and trailing spaces visually {{{
35set fillchars=vert:┃,fold:·
36set list listchars=tab:→\ ,trail:·,nbsp:␣,extends:↦,precedes:↤
37set conceallevel=2
38" }}}
39" Do not show current mode down the bottom {{{
40set noshowmode
41" }}}
42" Autowrite files when possible {{{
43set nohidden autowriteall
44" }}}
45" Keep cursor in the middle {{{
46set scrolloff=9999
47" }}}
48" Enable mouse suport {{{
49set mouse=a
50" }}}
51" Hypen is part of the keyword, if you want to substract then add spaces {{{
52set iskeyword+=-
53" }}}
54" Show 80 column {{{
55set colorcolumn=+1
56" }}}
57" Split in CORRECT places {{{
58set splitright splitbelow
59" }}}
60" }}}
61" Search {{{
62" Smart case searches
63set ignorecase smartcase
64
65if has('inccommand')
66 set inccommand=nosplit
67end
68" }}}
69" Permanent undo {{{
70set undofile
71" }}}
72" Custom configurations {{{
73" Fuzzy file search {{{
74nnoremap <Space><Space> :<C-u>FZF<CR>
75
76set path=,,
77" }}}
78" Git shortcuts {{{
79nnoremap U <nop>
80nnoremap Up :<C-u>Gpush<CR>
81nnoremap Us :<C-u>Gstatus<CR>
82nnoremap Ud :<C-u>Gdiff<CR>
83nnoremap Ub :<C-u>MerginalToggle<CR>
84nnoremap UB :<C-u>Gblame<CR>
85nnoremap Uc :<C-u>Gcommit<CR>
86nnoremap Uu :<C-u>Gpull<CR>
87nnoremap Ug :<C-u>Glog<CR>
88nmap UU Uu
89
90cabbrev G Git
91cabbrev G! Git!
92" }}}
93" Asynchronous commands {{{
94command! -bang -nargs=* Make call asyncdo#run(<bang>0, &makeprg, <f-args>)
95command! -bang -nargs=* Grep call asyncdo#run(<bang>0, { 'job': &grepprg, 'errorformat': &grepformat }, <f-args>)
96command! -bang -nargs=* LMake call asyncdo#lrun(<bang>0, &makeprg, <f-args>)
97command! -bang -nargs=* LGrep call asyncdo#lrun(<bang>0, { 'job': &grepprg, 'errorformat': &grepformat }, <f-args>)
98" }}}
99" Expand abbreviations on enter {{{
100inoremap <CR> <C-]><CR>
101" }}}
102" Smart `0` {{{
103" `0` goes to the beginning of the text on first press and to the beginning
104" of the line on second press. It alternates afterwards.
105nnoremap <expr> 0 virtcol('.') - 1 <= indent('.') && col('.') > 1 ? '0' : '_'
106" }}}
107" File closing {{{
108nnoremap ZS :wa<CR>
109nnoremap ZA :qa<CR>
110nnoremap ZX :cq<CR>
111" }}}
112" Simplify switching to Command mode {{{
113nnoremap ; :
114vnoremap ; :
115nnoremap : ;
116vnoremap : ;
117nnoremap q; q:
118" }}}
119" Fix idiotic vim defaults {{{
120nnoremap Y y$
121" }}}
122" Folding {{{
123set foldmethod=syntax
124set foldlevel=999
125
126nnoremap <expr> <CR> foldlevel('.') ? 'za' : "\<CR>"
127" }}}
128" Scratchpad {{{
129command! Scratchify setlocal nobuflisted noswapfile buftype=nofile bufhidden=delete
130command! Scratch enew |Scratchify
131command! SScratch new +Scratchify
132command! VScratch vnew +Scratchify
133command! TScratch tabnew +Scratchify
134" }}}
135" Format {{{
136nnoremap g= gg=Gg``
137noremap Q gq
138nnoremap gQ gggqG``
139
140command! Clean keeppatterns %s/\s\+$//e | set nohlsearch
141" }}}
142" Search {{{
143if executable('rg')
144 set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case
145 set grepformat=%f:%l:%c:%m,%f:%l%m,%f\ \ %l%m
146elseif executable('ag')
147 set grepprg=ag\ --nogroup\ --nocolor\ --vimgrep
148 set grepformat^=%f:%l:%c:%m
149endif
150
151" Quickly disable highligh
152nnoremap <Space>, :nohlsearch<CR>
153" }}}
154" Tabs {{{
155nnoremap ]w gt
156nnoremap [w gT
157" }}}
158" Terminal {{{
159nnoremap <C-q> <Nop>
160nnoremap <C-q>c :<C-u>term<CR>
161nnoremap <C-q>s :<C-u>split +term<CR>
162nnoremap <C-q>v :<C-u>vsplit +term<CR>
163nnoremap <C-q>t :<C-u>tabnew +term<CR>
164
165tnoremap <C-q> <C-\><C-n>
166inoremap <C-q> <ESC>
167
168if executable('nvr')
169 let $EDITOR = 'nvr -cc split -c "set bufhidden=delete" --remote-wait'
170endif
171" }}}
172" Split management {{{
173augroup align_windows
174 au!
175 au VimResized * wincmd =
176augroup END
177
178nmap <C-w>q <plug>(choosewin)
179nmap <C-_> <plug>(choosewin)
180" }}}
181" Startify {{{
182let g:startify_list_order = ['sessions', 'dir']
183let g:startify_session_dir = '~/.local/share/nvim/sessions/'
184let g:startify_session_autoload = 1
185let g:startify_session_persistence = 1
186
187let g:startify_change_to_dir = 0
188let g:startify_change_to_vcs_root = 1
189" }}}
190" HighlihtedYank {{{
191let g:highlightedyank_highlight_duration = 200
192" }}}
193" Snipe f/F/t/T {{{
194let g:snipe_jump_tokens = 'fhghdjskal'
195
196nmap F <Plug>(snipe-F)
197nmap f <Plug>(snipe-f)
198nmap T <Plug>(snipe-T)
199nmap t <Plug>(snipe-t)
200" }}}
201" }}}
202" Completions {{{
203set complete=.,w,b,t,k,kspell
204set completeopt=menuone,noselect,noinsert
205
206let g:lsp_async_completion = v:true
207let g:echodoc_enable_at_startup = v:true
208
209let g:usnip_dirs = ['~/.config/nvim/snips']
210
211augroup lsp_servers_setup
212 au!
213 au User lsp_setup call completion#lsp()
214augroup END
215" }}}
216
217let g:pivotaltracker_name = 'hauleth'
218let g:peekaboo_delay = 1000
219
220augroup autoreload_config
221 autocmd!
222 autocmd BufWritePost $MYVIMRC source $MYVIMRC
223augroup END