diff options
-rw-r--r-- | .config/nvim/init.lua | 17 | ||||
-rwxr-xr-x | .config/nvim/init.vim | 607 | ||||
-rw-r--r-- | .config/nvim/lua/mappings.lua | 131 | ||||
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 126 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 136 | ||||
-rw-r--r-- | .config/nvim/lua/settings.lua | 103 |
6 files changed, 513 insertions, 607 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..417af8a --- /dev/null +++ b/.config/nvim/init.lua | |||
@@ -0,0 +1,17 @@ | |||
1 | -- ┌──────────────────┐ | ||
2 | -- │ ▗ │ | ||
3 | -- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│ | ||
4 | -- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ | ||
5 | -- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ | ||
6 | -- └──────────────────┘ | ||
7 | -- ┌────────┐ | ||
8 | -- │▜ │ | ||
9 | -- │▐ ▌ ▌▝▀▖│ | ||
10 | -- │▐ ▌ ▌▞▀▌│ | ||
11 | -- │ ▘▝▀▘▝▀▘│ | ||
12 | -- └────────┘ | ||
13 | |||
14 | require('settings') | ||
15 | require('mappings') | ||
16 | require('plugins') | ||
17 | require('plugin_settings') | ||
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100755 index 40fadf2..0000000 --- a/.config/nvim/init.vim +++ /dev/null | |||
@@ -1,607 +0,0 @@ | |||
1 | let g:polyglot_disabled=['latex', 'tex'] | ||
2 | |||
3 | "{{{ Plugs | ||
4 | call plug#begin('~/.local/share/nvim/plugged') | ||
5 | |||
6 | " latex " had to move vimtex to top to avoid a difficult error | ||
7 | Plug 'lervag/vimtex', { 'for': ['tex', 'latex', 'plaintex']} | ||
8 | autocmd User vimtex call deoplete#custom#var('omni', 'input_patterns', { | ||
9 | \ 'tex': g:vimtex#re#deoplete | ||
10 | \}) | ||
11 | |||
12 | " Vimscript debugger | ||
13 | " Plug 'vim-scripts/Decho' | ||
14 | |||
15 | " completion, 'lsp' and coding {{{ " | ||
16 | |||
17 | " completion framework | ||
18 | Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | ||
19 | Plug 'lionawurscht/deoplete-biblatex' | ||
20 | Plug 'deoplete-plugins/deoplete-jedi' | ||
21 | " rust code completion & navigation | ||
22 | Plug 'racer-rust/vim-racer' | ||
23 | " syntax checking | ||
24 | Plug 'dense-analysis/ale' | ||
25 | " manages tag files | ||
26 | Plug 'ludovicchabant/vim-gutentags' | ||
27 | " run tests (todo: write tests) | ||
28 | Plug 'janko/vim-test' | ||
29 | " type in file send to repl | ||
30 | Plug 'jpalardy/vim-slime' | ||
31 | " snippets to expand | ||
32 | Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' | ||
33 | " Highlight the yanked region | ||
34 | Plug 'machakann/vim-highlightedyank' | ||
35 | |||
36 | " auto pair plugin, people hate these | ||
37 | Plug 'tmsvg/pear-tree' | ||
38 | " language packs | ||
39 | Plug 'sheerun/vim-polyglot' | ||
40 | " i3 config syntax | ||
41 | Plug 'mboughaba/i3config.vim' | ||
42 | " git diff in the sign column | ||
43 | Plug 'airblade/vim-gitgutter' | ||
44 | " gitk apparently | ||
45 | Plug 'cohama/agit.vim' | ||
46 | " completion preview of floating window | ||
47 | Plug 'ncm2/float-preview.nvim' | ||
48 | " switch between single line and multiline | ||
49 | Plug 'AndrewRadev/splitjoin.vim' | ||
50 | |||
51 | " }}} completion, 'lsp' and such " | ||
52 | |||
53 | " heresy {{{ " | ||
54 | |||
55 | " Fuzzy finder with post-update hook | ||
56 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | ||
57 | Plug 'junegunn/fzf.vim' | ||
58 | |||
59 | " TODO let's try out fern.vim | ||
60 | Plug 'lambdalisue/fern.vim' | ||
61 | " TODO bug in neovim, so required for now | ||
62 | " https://github.com/lambdalisue/fern.vim/issues/120 | ||
63 | Plug 'antoinemadec/FixCursorHold.nvim' | ||
64 | |||
65 | " displays tags ordered by scope | ||
66 | Plug 'majutsushi/tagbar' | ||
67 | " status/tabline | ||
68 | Plug 'vim-airline/vim-airline' | ||
69 | Plug 'vim-airline/vim-airline-themes' | ||
70 | " undo tree visualizer | ||
71 | Plug 'mbbill/undotree' | ||
72 | " preview colours in source code | ||
73 | Plug 'ap/vim-css-color' | ||
74 | " kitty config filetype | ||
75 | Plug 'fladson/vim-kitty' | ||
76 | " }}} heresy " | ||
77 | |||
78 | " colour theme of $CURRENT_YEAR | ||
79 | Plug 'rose-pine/neovim' | ||
80 | |||
81 | " prose, note taking {{{ " | ||
82 | |||
83 | " Personal wiki | ||
84 | Plug 'vimwiki/vimwiki' | ||
85 | " centers the writing | ||
86 | Plug 'junegunn/goyo.vim' | ||
87 | " highlights the current paragraph | ||
88 | Plug 'junegunn/limelight.vim' | ||
89 | " thesaurus query & replacement | ||
90 | Plug 'ron89/thesaurus_query.vim' | ||
91 | " change ASCII text to Turkish text | ||
92 | Plug 'yigitsever/turkish-deasciifier.vim' | ||
93 | " }}} prose, note taking " | ||
94 | |||
95 | " movement, editing {{{ " | ||
96 | |||
97 | " text alignment \w :Tab | ||
98 | Plug 'godlygeek/tabular' | ||
99 | " move selections up and down with alt+[j,k] | ||
100 | Plug 'matze/vim-move' | ||
101 | " surround text objects; sa, sr and sd | ||
102 | Plug 'machakann/vim-sandwich' | ||
103 | " provide additional text objects | ||
104 | Plug 'wellle/targets.vim' | ||
105 | " indentation level text object, ia, ii | ||
106 | Plug 'michaeljsmith/vim-indent-object' | ||
107 | " visual feedback for substitute holy shit this is amazing | ||
108 | Plug 'markonm/traces.vim' | ||
109 | " see the contents of registers on "/<CTRL-R> | ||
110 | Plug 'junegunn/vim-peekaboo' | ||
111 | " use <leader>k to highlight multiple words | ||
112 | Plug 'lfv89/vim-interestingwords' | ||
113 | " swap delimited items using g>, g< | ||
114 | Plug 'machakann/vim-swap' | ||
115 | " jump to location by 2 characters, ` | ||
116 | Plug 'justinmk/vim-sneak' | ||
117 | " reopen files at your last edit position | ||
118 | Plug 'farmergreg/vim-lastplace' | ||
119 | " flash cursor on jump | ||
120 | Plug 'DanilaMihailov/beacon.nvim' | ||
121 | " ascii drawing plugin | ||
122 | Plug 'vim-scripts/DrawIt' | ||
123 | |||
124 | " }}} movement, editing " | ||
125 | |||
126 | " vim-easyclip suite {{{ " | ||
127 | |||
128 | " splits delete into cut and delete | ||
129 | Plug 'svermeulen/vim-cutlass' | ||
130 | " change text with yank | ||
131 | Plug 'svermeulen/vim-subversive' | ||
132 | " yank history | ||
133 | Plug 'svermeulen/vim-yoink' | ||
134 | |||
135 | " }}} vim-easyclip suite " | ||
136 | |||
137 | " tpope {{{ " | ||
138 | |||
139 | " enable repeating supported plugin maps with '.' | ||
140 | Plug 'tpope/vim-repeat' | ||
141 | " pairs of handy bracket mappings | ||
142 | Plug 'tpope/vim-unimpaired' | ||
143 | " git wrapper | ||
144 | Plug 'tpope/vim-fugitive' | ||
145 | " increment dates, times & more | ||
146 | Plug 'tpope/vim-speeddating' | ||
147 | " search, substitute and abbreviate | ||
148 | Plug 'tpope/vim-abolish' | ||
149 | " provides ga, show unicode stuff of char under cursor | ||
150 | Plug 'tpope/vim-characterize' | ||
151 | " comment helper | ||
152 | Plug 'tpope/vim-commentary' | ||
153 | " asynchronous build and test dispatcher | ||
154 | Plug 'tpope/vim-dispatch' | ||
155 | " }}} tpope " | ||
156 | |||
157 | " fancy start screen | ||
158 | Plug 'mhinz/vim-startify' | ||
159 | " asks to be placed last, sure | ||
160 | Plug 'ryanoasis/vim-devicons' | ||
161 | call plug#end() | ||
162 | |||
163 | "}}} | ||
164 | |||
165 | "{{{Auto Commands | ||
166 | " Remove any trailing whitespace that is in the file | ||
167 | autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif | ||
168 | |||
169 | " Close vim if the only window left open is a quickfix window | ||
170 | autocmd WinEnter * if winnr("$") == 1 && &buftype == "quickfix" | q | endif | ||
171 | " winnr("$") how many windows left? | ||
172 | |||
173 | " Resize all windows proportionally when the terminal is resized | ||
174 | " let terminal resize scale the internal windows | ||
175 | autocmd VimResized * :wincmd = | ||
176 | |||
177 | " Set spell for prose | ||
178 | autocmd FileType markdown,tex setlocal spell | ||
179 | |||
180 | " Dispatch.vim plugin to use cargo run for rust projects | ||
181 | autocmd FileType rust let b:dispatch = 'cargo run' | ||
182 | |||
183 | " these files are formatted not with textwidth but into sentences | ||
184 | autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences | ||
185 | |||
186 | " runs a script that cleans out tex build files whenever I close out of a .tex file. | ||
187 | autocmd VimLeave *.tex !texclear % | ||
188 | "}}} | ||
189 | |||
190 | " Functions {{{ | ||
191 | |||
192 | function! CreateNote() | ||
193 | py3 import uuid | ||
194 | exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/box/" . py3eval('str(uuid.uuid4())[:6]') . ".wiki") | ||
195 | let l:text="= up =\n\n= down =\n\n= keywords =\n\n" | ||
196 | put =l:text | ||
197 | norm gg | ||
198 | endfunction | ||
199 | |||
200 | function! CreatePaper(citekey) | ||
201 | exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/papers/" . a:citekey . ".wiki") | ||
202 | |||
203 | let l:timestap="%date " . strftime("%F") | ||
204 | let l:text="= Came From =\n\n= Takeaways =\n\n= Might Go To =\n\n" | ||
205 | |||
206 | put! =l:timestap | ||
207 | put =l:text | ||
208 | endfunction | ||
209 | |||
210 | function! CreateReference(citekey) | ||
211 | exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/reference/" . a:citekey . ".wiki") | ||
212 | |||
213 | let l:timestap="%date " . strftime("%F") | ||
214 | let l:text="= Literature Notes =\n\n= Citation =\n\n" | ||
215 | |||
216 | put! =l:timestap | ||
217 | put =l:text | ||
218 | endfunction | ||
219 | |||
220 | " }}} Function " | ||
221 | |||
222 | "{{{Settings | ||
223 | |||
224 | " fix the Target STRING not available | ||
225 | let g:clipboard = { | ||
226 | \ 'name': 'xsel_override', | ||
227 | \ 'copy': { | ||
228 | \ '+': 'xsel --input --clipboard', | ||
229 | \ '*': 'xsel --input --primary', | ||
230 | \ }, | ||
231 | \ 'paste': { | ||
232 | \ '+': 'xsel --output --clipboard', | ||
233 | \ '*': 'xsel --output --primary', | ||
234 | \ }, | ||
235 | \ 'cache_enabled': 1, | ||
236 | \ } | ||
237 | |||
238 | " Use deoplete. | ||
239 | let g:deoplete#enable_at_startup = 1 | ||
240 | let g:deoplete#sources#biblatex#bibfile = '~/.local/share/vim_biblatex.bib' | ||
241 | |||
242 | " interact with system clipboard | ||
243 | set clipboard+=unnamedplus | ||
244 | |||
245 | " required for yoink/cutlass/subversive interaction | ||
246 | let g:yoinkIncludeDeleteOperations = 1 | ||
247 | |||
248 | " Tab stuff | ||
249 | set autoindent | ||
250 | |||
251 | " :h tabstop, 2. point | ||
252 | " Use appropriate number of spaces to insert a <Tab> | ||
253 | set expandtab | ||
254 | set shiftwidth=4 | ||
255 | set softtabstop=4 | ||
256 | set tabstop=8 | ||
257 | |||
258 | " Use english for spellchecking, but don't spellcheck by default | ||
259 | set spell spelllang=en_gb | ||
260 | set nospell | ||
261 | |||
262 | " Tab completion, zsh style | ||
263 | set wildmode=full | ||
264 | set wildignore=*.o,*.obj,*.class,*.aux,*.lof,*.log,*.lot,*.fls,*.toc,*.fmt,*.fot,*.cb,*.cb2,.*.lb,.dvi,*.xdv,*.bbl,*.bcf,*.blg,*-blx.aux,*-blx.bib,*.run.xml,*.fdb_latexmk,*.synctex,*.synctex(busy),*.synctex.gz,*.synctex.gz(busy),*.pdfsync | ||
265 | |||
266 | " Put one space while joining (not two) | ||
267 | set nojoinspaces | ||
268 | |||
269 | " Keep n lines above/below cursor while scrolling | ||
270 | set scrolloff=4 | ||
271 | " line numbers | ||
272 | set number | ||
273 | " fold manually, when I place markers | ||
274 | set foldmethod=marker | ||
275 | " set terminal title | ||
276 | set title | ||
277 | " wrap using 'breakat' character | ||
278 | set linebreak | ||
279 | " new split panes will split to below and right | ||
280 | set splitbelow | ||
281 | set splitright | ||
282 | " highlight the current line, yoc undoes | ||
283 | set cursorline | ||
284 | " current line actual number, rest are relative | ||
285 | set relativenumber | ||
286 | " we are already using airline, don't clobber linter messages | ||
287 | set noshowmode | ||
288 | " jump to the matching bracket briefly | ||
289 | set showmatch | ||
290 | " move freely between buffers | ||
291 | set hidden | ||
292 | |||
293 | " persistent undo | ||
294 | set undodir=~/.vim/undodir | ||
295 | set undofile | ||
296 | |||
297 | " lower case searches ignore case, upper case searches do not | ||
298 | set ignorecase | ||
299 | set smartcase | ||
300 | |||
301 | " https://stackoverflow.com/a/3445040/ | ||
302 | " switch case labels | ||
303 | set cinoptions=l1 | ||
304 | |||
305 | " https://www.reddit.com/r/vim/comments/7bj837/favorite_console_tools_to_use_with_vim/ | ||
306 | if executable('rg') | ||
307 | set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case | ||
308 | endif | ||
309 | |||
310 | set diffopt=algorithm:patience | ||
311 | |||
312 | let g:float_preview#docked = 0 | ||
313 | set completeopt = "menu" | ||
314 | |||
315 | " }}} | ||
316 | |||
317 | "{{{Look and Feel | ||
318 | set termguicolors | ||
319 | colorscheme rose-pine | ||
320 | |||
321 | highlight HighlightedyankRegion cterm=reverse gui=reverse | ||
322 | let g:highlightedyank_highlight_duration = 200 | ||
323 | " }}} | ||
324 | |||
325 | "{{{ Mappings | ||
326 | |||
327 | " brute force deasciify everything | ||
328 | nnoremap <expr> <Leader>tc TurkishDeasciifyForce() | ||
329 | xnoremap <expr> <Leader>tc TurkishDeasciifyForce() | ||
330 | nnoremap <expr> <Leader>tctc TurkishDeasciifyForce() .. '_' | ||
331 | |||
332 | " use turkish-mode to selectively deasciify | ||
333 | nnoremap <expr> <Leader>tr TurkishDeasciify() | ||
334 | xnoremap <expr> <Leader>tr TurkishDeasciify() | ||
335 | nnoremap <expr> <Leader>trtr TurkishDeasciify() .. '_' | ||
336 | |||
337 | " ascii everything | ||
338 | nnoremap <expr> <Leader>rt TurkishAsciify() | ||
339 | xnoremap <expr> <Leader>rt TurkishAsciify() | ||
340 | nnoremap <expr> <Leader>rtrt TurkishAsciify() .. '_' | ||
341 | |||
342 | " https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump | ||
343 | nnoremap * :keepjumps normal! mi*`i<CR> | ||
344 | nnoremap # :keepjumps normal! mi#`i<CR> | ||
345 | |||
346 | " Save file as sudo on files that require root permission | ||
347 | cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! | ||
348 | |||
349 | " replace ex mode with gq | ||
350 | map Q gq | ||
351 | |||
352 | " set formatprg to sentences, for prose | ||
353 | map \fp :set formatprg=~/.local/bin/sentences<CR> | ||
354 | |||
355 | " Replace all is aliased to S. | ||
356 | nnoremap S :%s//g<Left><Left> | ||
357 | |||
358 | " use esc in :term as well | ||
359 | tnoremap <Esc> <C-\><C-n> | ||
360 | |||
361 | " call CreatePaper on word below cursor | ||
362 | nnoremap <leader>np gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand('<cword>'))<CR> | ||
363 | |||
364 | " link paper | ||
365 | nnoremap <leader>lp gewi[[/papers/<ESC>Ea]]<ESC> | ||
366 | |||
367 | " call CreateReference on word below cursor | ||
368 | nnoremap <leader>nr :call CreateReference(expand('<cword>'))<CR> | ||
369 | |||
370 | " create a new note | ||
371 | nnoremap <leader>nn :call CreateNote()<CR> | ||
372 | |||
373 | " If you like "Y" to work from the cursor to the end of line (which is more | ||
374 | " logical, but not Vi-compatible) | ||
375 | map Y y$ | ||
376 | |||
377 | " Open the TagBar Plugin <F3> | ||
378 | nnoremap <silent> <F3> :TagbarToggle<CR> | ||
379 | " Fix whole buffer via ALE | ||
380 | nmap <F9> <Plug>(ale_fix) | ||
381 | |||
382 | " vim-test bindings | ||
383 | nmap <silent> t<C-n> :TestNearest<CR> | ||
384 | nmap <silent> t<C-f> :TestFile<CR> | ||
385 | nmap <silent> t<C-s> :TestSuite<CR> | ||
386 | nmap <silent> t<C-l> :TestLast<CR> | ||
387 | nmap <silent> t<C-g> :TestVisit<CR> | ||
388 | |||
389 | " Edit vimrc \ev | ||
390 | nnoremap <silent> <leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> | ||
391 | " jump to buffer | ||
392 | nnoremap <leader>b :ls<cr>:b<space> | ||
393 | |||
394 | " Up and down are more logical with g.. | ||
395 | nnoremap <silent> k gk | ||
396 | nnoremap <silent> j gj | ||
397 | inoremap <silent> <Up> <Esc>gka | ||
398 | inoremap <silent> <Down> <Esc>gja | ||
399 | |||
400 | " Disable highlight when <leader><cr> is pressed | ||
401 | nnoremap <silent> <leader><cr> :noh<cr> | ||
402 | " Space used to toggle folds, now it's x (because x is d) | ||
403 | nnoremap <space> "_x | ||
404 | |||
405 | " checkmarks on vimwiki | ||
406 | nmap <leader>v <Plug>VimwikiToggleListItem | ||
407 | " add/increase header level | ||
408 | nmap <leader>a <Plug>VimwikiAddHeaderLevel | ||
409 | |||
410 | " sneak using grave, s is for sandwich | ||
411 | nmap ` <Plug>Sneak_s | ||
412 | nmap <leader>` <Plug>Sneak_S | ||
413 | nnoremap ' ` | ||
414 | |||
415 | " separate cut and delete | ||
416 | nnoremap x d | ||
417 | xnoremap x d | ||
418 | nnoremap xx dd | ||
419 | nnoremap X D | ||
420 | |||
421 | " use the special yoink paste | ||
422 | nmap p <plug>(YoinkPaste_p) | ||
423 | nmap P <plug>(YoinkPaste_P) | ||
424 | |||
425 | " substitute from yank | ||
426 | nmap <leader>ys <plug>(SubversiveSubstitute) | ||
427 | nmap <leader>yss <plug>(SubversiveSubstituteLine) | ||
428 | nmap <leader>yS <plug>(SubversiveSubstituteToEndOfLine) | ||
429 | |||
430 | " substitute over range | ||
431 | nmap <leader>s <plug>(SubversiveSubstituteRange) | ||
432 | xmap <leader>s <plug>(SubversiveSubstituteRange) | ||
433 | nmap <leader>ss <plug>(SubversiveSubstituteWordRange) | ||
434 | |||
435 | " subvert over range | ||
436 | nmap <leader><leader>s <plug>(SubversiveSubvertRange) | ||
437 | xmap <leader><leader>s <plug>(SubversiveSubvertRange) | ||
438 | nmap <leader><leader>ss <plug>(SubversiveSubvertWordRange) | ||
439 | |||
440 | " iterate over yank list | ||
441 | nmap <c-n> <plug>(YoinkPostPasteSwapBack) | ||
442 | nmap <c-p> <plug>(YoinkPostPasteSwapForward) | ||
443 | |||
444 | " change into pwd of current directory | ||
445 | nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> | ||
446 | inoremap <silent> <leader>fn <C-R>=expand("%:t:r")<CR> | ||
447 | nnoremap <silent> <leader>fn :put! =expand('%:t:r')<CR> | ||
448 | |||
449 | " press \g and start writing prose | ||
450 | map <leader>g :Goyo<CR> | ||
451 | "}}} | ||
452 | |||
453 | "{{{Tagbar | ||
454 | let g:tagbar_autofocus = 1 | ||
455 | let g:tagbar_compact = 1 | ||
456 | let g:tagbar_sort = 0 | ||
457 | let g:tagbar_width = 25 | ||
458 | "}}} | ||
459 | |||
460 | "{{{ Airline | ||
461 | let g:airline_powerline_fonts = 1 | ||
462 | let g:airline#extensions#tabline#formatter = 'unique_tail' | ||
463 | let g:airline#extensions#tabline#enabled = 1 | ||
464 | let g:airline_mode_map = {} | ||
465 | let g:airline_mode_map['ic'] = 'INSERT' | ||
466 | |||
467 | if !exists('g:airline_symbols') | ||
468 | let g:airline_symbols = {} | ||
469 | endif | ||
470 | |||
471 | let g:airline_left_sep = '' | ||
472 | let g:airline_left_alt_sep = '' | ||
473 | let g:airline_right_sep = '' | ||
474 | let g:airline_right_alt_sep = '' | ||
475 | |||
476 | "}}} | ||
477 | |||
478 | "{{{ Ale | ||
479 | let g:ale_sign_error = '✗' | ||
480 | let g:ale_sign_warning = '⚑' | ||
481 | let g:ale_lint_on_text_changed = 'insert' | ||
482 | let g:ale_lint_on_enter = 0 | ||
483 | let g:ale_pattern_options = {'\.wiki$': {'ale_enabled': 0}} | ||
484 | "}}} | ||
485 | |||
486 | "{{{ Ledger | ||
487 | let g:ledger_maxwidth = 48 | ||
488 | let g:ledger_fillstring = ' ~' | ||
489 | "}}} | ||
490 | |||
491 | "{{{ UltiSnips | ||
492 | set runtimepath+=~/.vim/my-snippets/ | ||
493 | let g:UltiSnipsEditSplit = "vertical" | ||
494 | let g:UltiSnipsSnippetsDir = $HOME.'/.vim/my-snippets/UltiSnips' | ||
495 | |||
496 | " ctrl + l expands the snippet, c + j/k navigates placeholders | ||
497 | let g:UltiSnipsExpandTrigger = "<C-l>" | ||
498 | let g:UltiSnipsEnableSnipMate = "1" | ||
499 | "}}} | ||
500 | |||
501 | "{{{ vim-startify | ||
502 | function! StartifyEntryFormat() | ||
503 | return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path' | ||
504 | endfunction | ||
505 | |||
506 | let entry_format = "' ['. index .']'. repeat(' ', (3 - strlen(index)))" | ||
507 | |||
508 | if exists('*WebDevIconsGetFileTypeSymbol') " support for vim-devicons | ||
509 | let entry_format .= ". WebDevIconsGetFileTypeSymbol(entry_path) .' '. entry_path" | ||
510 | else | ||
511 | let entry_format .= '. entry_path' | ||
512 | endif | ||
513 | |||
514 | let g:ascii = [ | ||
515 | \' | ', | ||
516 | \'\ \ \ / -_) | _| _ \ ` \ -_)', | ||
517 | \' \_/\_/\___|_|\__|\___/_|_|_|\___|', | ||
518 | \ '', | ||
519 | \] | ||
520 | |||
521 | let g:startify_custom_header = | ||
522 | \ 'map(g:ascii + startify#fortune#boxed(), "\" \".v:val")' | ||
523 | |||
524 | "}}} | ||
525 | |||
526 | "{{{ vimwiki | ||
527 | let g:vimwiki_list = [{'path': '/home/yigit/nextcloud/personal_wiki/text', | ||
528 | \ 'path_html': '/home/yigit/nextcloud/personal_wiki/html', | ||
529 | \ 'auto_generate_tags': 1, | ||
530 | \ 'automatic_nested_syntaxes': 1, | ||
531 | \ 'template_path': '/home/yigit/nextcloud/personal_wiki/templates', | ||
532 | \ 'template_default': 'default_template', | ||
533 | \ 'template_ext': '.html', | ||
534 | \ 'auto_export': 1, | ||
535 | \ 'auto_tags': 1}] | ||
536 | let g:vimwiki_global_ext = 0 | ||
537 | let g:vimwiki_hl_headers = 1 | ||
538 | "}}} | ||
539 | |||
540 | " {{{ vimtex | ||
541 | let g:vimtex_view_method='zathura' | ||
542 | let g:vimtex_quickfix_mode=0 | ||
543 | " }}} | ||
544 | |||
545 | " {{{ Gutentags | ||
546 | let g:gutentags_enabled = 1 | ||
547 | let g:gutentags_add_default_project_roots = 0 | ||
548 | let g:gutentags_project_root = ['Makefile', '.git'] | ||
549 | let g:gutentags_exclude_filetypes = ['gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'] | ||
550 | let g:gutentags_generate_on_new = 1 | ||
551 | let g:gutentags_generate_on_missing = 1 | ||
552 | let g:gutentags_generate_on_write = 1 | ||
553 | let g:gutentags_generate_on_empty_buffer = 0 | ||
554 | let g:gutentags_ctags_exclude = [ | ||
555 | \ '*.git', '*.svn', '*.hg', | ||
556 | \ 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components', | ||
557 | \ '*-lock.json', '*.lock', | ||
558 | \ '*.min.*', | ||
559 | \ '*.bak', | ||
560 | \ '*.zip', | ||
561 | \ '*.pyc', | ||
562 | \ '*.class', | ||
563 | \ '*.sln', | ||
564 | \ '*.csproj', '*.csproj.user', | ||
565 | \ '*.tmp', | ||
566 | \ '*.cache', | ||
567 | \ '*.vscode', | ||
568 | \ '*.pdb', | ||
569 | \ '*.exe', '*.dll', '*.bin', | ||
570 | \ '*.mp3', '*.ogg', '*.flac', | ||
571 | \ '*.swp', '*.swo', | ||
572 | \ '.DS_Store', '*.plist', | ||
573 | \ '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg', | ||
574 | \ '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2', | ||
575 | \ '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls', | ||
576 | \] | ||
577 | " }}} | ||
578 | |||
579 | " vim-slime {{{ | ||
580 | let g:slime_target = "tmux" | ||
581 | let g:slime_paste_file = "$HOME/.slime_paste" | ||
582 | let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": "{last}"} | ||
583 | " }}} Slime | ||
584 | |||
585 | " devicons {{{ " | ||
586 | let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols = {} " needed | ||
587 | let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['wiki'] = '📔' | ||
588 | " }}} devicons " | ||
589 | |||
590 | " beacon {{{ " | ||
591 | let g:beacon_size = 100 | ||
592 | let g:beacon_shrink = 0 | ||
593 | highlight Beacon guibg=red ctermbg=15 | ||
594 | " }}} beacon " | ||
595 | |||
596 | " thesaurus_query {{{ " | ||
597 | let g:tq_enabled_backends = ["mthesaur_txt"] | ||
598 | let g:tq_truncation_on_relavance = 0 | ||
599 | " }}} thesaurus_query " | ||
600 | |||
601 | " fzf.vim {{{ " | ||
602 | " Insert mode completion | ||
603 | imap <c-x><c-k> <plug>(fzf-complete-word) | ||
604 | imap <c-x><c-f> <plug>(fzf-complete-path) | ||
605 | imap <c-x><c-l> <plug>(fzf-complete-line) | ||
606 | " }}} fzf.vim " | ||
607 | |||
diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..fe59a99 --- /dev/null +++ b/.config/nvim/lua/mappings.lua | |||
@@ -0,0 +1,131 @@ | |||
1 | -- ┌──────────────────┐ | ||
2 | -- │ ▗ │ | ||
3 | -- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│ | ||
4 | -- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ | ||
5 | -- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ | ||
6 | -- └──────────────────┘ | ||
7 | -- ┌────────────────────────┐ | ||
8 | -- │ ▗ │ | ||
9 | -- │▛▚▀▖▝▀▖▛▀▖▛▀▖▄ ▛▀▖▞▀▌▞▀▘│ | ||
10 | -- │▌▐ ▌▞▀▌▙▄▘▙▄▘▐ ▌ ▌▚▄▌▝▀▖│ | ||
11 | -- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │ | ||
12 | -- └────────────────────────┘ | ||
13 | |||
14 | -- map helper | ||
15 | local function map(mode, lhs, rhs, opts) | ||
16 | local options = {noremap = true, silent = true} | ||
17 | if opts then options = vim.tbl_extend('force', options, opts) end | ||
18 | vim.api.nvim_set_keymap(mode, lhs, rhs, options) | ||
19 | end | ||
20 | |||
21 | -- local map = vim.api.nvim_set_keymap | ||
22 | local cmd = vim.cmd | ||
23 | local M = {} | ||
24 | |||
25 | -- brute force deasciify everything | ||
26 | map('n', '<Leader>tc', 'TurkishDeasciifyForce()', {expr = true}) | ||
27 | map('x', '<Leader>tc', 'TurkishDeasciifyForce()', {expr = true}) | ||
28 | map('n', '<Leader>tctc', "TurkishDeasciifyForce() .. '_'", {expr = true}) | ||
29 | |||
30 | -- use turkish-mode to selectively deasciify | ||
31 | map('n', '<Leader>tr', 'TurkishDeasciify()', {expr = true}) | ||
32 | map('x', '<Leader>tr', 'TurkishDeasciify()', {expr = true}) | ||
33 | map('n', '<Leader>trtr', "TurkishDeasciify() .. '_'", {expr = true}) | ||
34 | |||
35 | -- ascii everything | ||
36 | map('n', '<Leader>rt', 'TurkishAsciify()', {expr = true}) | ||
37 | map('x', '<Leader>rt', 'TurkishAsciify()', {expr = true}) | ||
38 | map('n', '<Leader>rtrt', "TurkishAsciify() .. '_'", {expr = true}) | ||
39 | |||
40 | -- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump | ||
41 | -- search & highlight but do not jump | ||
42 | map('n', '*', ':keepjumps normal! mi*`i<CR>') | ||
43 | map('n', '#', ':keepjumps normal! mi#`i<CR> ') | ||
44 | |||
45 | -- Save file as sudo on files that require root permission | ||
46 | map('c', 'w!!', 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!') | ||
47 | |||
48 | -- replace ex mode with gq (format lines) | ||
49 | map('n', 'Q', 'gq') | ||
50 | |||
51 | -- set formatprg to sentences, for prose | ||
52 | map('n', '<Leader>fp', ":set formatprg=~/.local/bin/sentences<CR>") | ||
53 | |||
54 | -- Replace all is aliased to S. | ||
55 | map('n', 'S', ':%s//g<Left><Left>') | ||
56 | |||
57 | -- If you like "Y" to work from the cursor to the end of line (which is more | ||
58 | -- logical, but not Vi-compatible) | ||
59 | map('n', 'Y', 'y$') | ||
60 | |||
61 | -- jump to buffer | ||
62 | map('n', '<Leader>b', ':ls<cr>:b<space>') | ||
63 | |||
64 | -- Up and down are more logical with g.. | ||
65 | map('n', 'k', 'gk') | ||
66 | map('n', 'j', 'gj') | ||
67 | map('i', '<Up>', '<Esc>gka') | ||
68 | map('i', '<Down>', '<Esc>gja') | ||
69 | |||
70 | -- Disable highlight when <leader><cr> is pressed | ||
71 | map('n', '<Leader><Cr>', ':noh<Cr>') | ||
72 | -- Space used to toggle folds, now it's x (because x is d) | ||
73 | map('n', '<Space>', '"_x') | ||
74 | |||
75 | -- separate cut and delete | ||
76 | map('n', 'x', 'd') | ||
77 | map('x', 'x', 'd') | ||
78 | map('n', 'xx', 'dd') | ||
79 | map('n', 'X', 'D') | ||
80 | |||
81 | -- change into pwd of current directory | ||
82 | map('n', '<Leader>cd', ':cd %:p:h<CR>:pwd<CR>') | ||
83 | |||
84 | -- press \g and start writing prose | ||
85 | map('n', '<Leader>g', ':Goyo<CR>') | ||
86 | |||
87 | -- plug mappings {{{1 -- | ||
88 | |||
89 | -- <Plug> mappings should not be noremap | ||
90 | -- https://www.reddit.com/r/vim/comments/78izt4/please_help_understand_how_to_use_plug_mapping/ | ||
91 | local function plugmap(mode, lhs, rhs, opts) | ||
92 | local options = {noremap = false, silent = true} | ||
93 | if opts then options = vim.tbl_extend('force', options, opts) end | ||
94 | vim.api.nvim_set_keymap(mode, lhs, rhs, options) | ||
95 | end | ||
96 | |||
97 | -- sneak using grave, s is for sandwich | ||
98 | plugmap('n', '`', '<Plug>Sneak_s') | ||
99 | plugmap('n', '`', '<Plug>Sneak_s') | ||
100 | plugmap('n', '<Leader>`', '<Plug>Sneak_S') | ||
101 | plugmap('n', "'", '`') | ||
102 | |||
103 | -- use the special yoink paste that rotates | ||
104 | plugmap('n', 'p', '<Plug>(YoinkPaste_p)') | ||
105 | plugmap('n', 'P', '<Plug>(YoinkPaste_P)') | ||
106 | |||
107 | -- substitute from yank | ||
108 | plugmap('n', '<Leader>ys', '<plug>(SubversiveSubstitute)') | ||
109 | plugmap('n', '<Leader>yss', '<plug>(SubversiveSubstituteLine)') | ||
110 | plugmap('n', '<Leader>yS', '<plug>(SubversiveSubstituteToEndOfLine)') | ||
111 | |||
112 | -- substitute over range | ||
113 | plugmap('n', '<Leader>s', '<plug>(SubversiveSubstituteRange)') | ||
114 | plugmap('x', '<Leader>s', '<plug>(SubversiveSubstituteRange)') | ||
115 | plugmap('n', '<Leader>ss', '<plug>(SubversiveSubstituteWordRange)') | ||
116 | |||
117 | -- subvert over range | ||
118 | plugmap('n', '<Leader><Leader>s', '<plug>(SubversiveSubvertRange)') | ||
119 | plugmap('x', '<Leader><Leader>s', '<plug>(SubversiveSubvertRange)') | ||
120 | plugmap('n', '<Leader><Leader>ss', '<plug>(SubversiveSubvertWordRange)') | ||
121 | |||
122 | -- iterate over yank list | ||
123 | plugmap('n', '<c-n>', '<Plug>(YoinkPostPasteSwapBack)') | ||
124 | plugmap('n', '<c-p>', '<Plug>(YoinkPostPasteSwapForward)') | ||
125 | |||
126 | -- insert mode completion | ||
127 | plugmap('i', '<c-x><c-k>', '<plug>(fzf-complete-word)') | ||
128 | plugmap('i', '<c-x><c-f>', '<plug>(fzf-complete-path)') | ||
129 | plugmap('i', '<c-x><c-l>', '<plug>(fzf-complete-line)') | ||
130 | |||
131 | -- 1}}} -- | ||
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua new file mode 100644 index 0000000..6de7ebd --- /dev/null +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -0,0 +1,126 @@ | |||
1 | -- ┌──────────────────┐ | ||
2 | -- │ ▗ │ | ||
3 | -- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│ | ||
4 | -- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ | ||
5 | -- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ | ||
6 | -- └──────────────────┘ | ||
7 | -- ┌─────────────────────────────────────┐ | ||
8 | -- │ ▜ ▐ ▐ ▗ │ | ||
9 | -- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ | ||
10 | -- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ | ||
11 | -- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ | ||
12 | -- └─────────────────────────────────────┘ | ||
13 | |||
14 | local g = vim.g -- global for let options | ||
15 | local opt = vim.opt -- convenient :set | ||
16 | local cmd = vim.cmd -- vim commands | ||
17 | |||
18 | -- vimwiki {{{ -- | ||
19 | g.vimwiki_list = { | ||
20 | { | ||
21 | path = '/home/yigit/nextcloud/personal_wiki/text', | ||
22 | path_html = '/home/yigit/nextcloud/personal_wiki/html', | ||
23 | auto_generate_tags = 1, | ||
24 | automatic_nested_syntaxes = 1, | ||
25 | template_path = '/home/yigit/nextcloud/personal_wiki/templates', | ||
26 | template_default = 'default_template', | ||
27 | template_ext = '.html', | ||
28 | auto_export = 1, | ||
29 | auto_tags = 1 | ||
30 | } | ||
31 | } | ||
32 | |||
33 | g.vimwiki_global_ext = 0 | ||
34 | g.vimwiki_hl_headers = 1 | ||
35 | -- }}} vimwiki -- | ||
36 | |||
37 | -- lualine {{{ -- | ||
38 | require'lualine'.setup { | ||
39 | options = { | ||
40 | lower = true, | ||
41 | icons_enabled = true, | ||
42 | theme = 'rose-pine', | ||
43 | section_separators = {'', ''}, | ||
44 | component_separators = {'', ''}, | ||
45 | disabled_filetypes = {} | ||
46 | }, | ||
47 | sections = { | ||
48 | lualine_a = {{'mode', lower = true}}, | ||
49 | lualine_b = {'branch', 'diff'}, | ||
50 | lualine_c = {'filename'}, | ||
51 | lualine_x = {'encoding', 'fileformat', 'filetype'}, | ||
52 | lualine_y = {'progress'}, | ||
53 | lualine_z = { | ||
54 | 'location', { | ||
55 | 'diagnostics', | ||
56 | sources = {'ale'}, | ||
57 | sections = {'error', 'warn', 'info', 'hint'}, | ||
58 | symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} | ||
59 | } | ||
60 | } | ||
61 | }, | ||
62 | inactive_sections = { | ||
63 | lualine_a = {}, | ||
64 | lualine_b = {}, | ||
65 | lualine_c = {'filename'}, | ||
66 | lualine_x = {}, | ||
67 | lualine_y = {}, | ||
68 | lualine_z = {} | ||
69 | }, | ||
70 | tabline = {}, | ||
71 | extensions = {} | ||
72 | } | ||
73 | -- }}} requi -- | ||
74 | |||
75 | -- Cutlass suite {{{1 -- | ||
76 | |||
77 | -- cutlass/yoink/subverse suite | ||
78 | g.yoinkIncludeDeleteOperations = 1 | ||
79 | |||
80 | -- fix the Target STRING not available | ||
81 | g.clipboard = { | ||
82 | name = 'xsel_override', | ||
83 | copy = { | ||
84 | ['+'] = 'xsel --input --clipboard', | ||
85 | ['*'] = 'xsel --input --primary', | ||
86 | }, | ||
87 | paste = { | ||
88 | ['+'] = 'xsel --output --clipboard', | ||
89 | ['*'] = 'xsel --output --primary', | ||
90 | }, | ||
91 | cache_enabled = 1, | ||
92 | } | ||
93 | |||
94 | -- 1}}} -- | ||
95 | |||
96 | -- UltiSnips {{{ -- | ||
97 | opt.runtimepath:append('/home/yigit/.vim/my-snippets/') | ||
98 | g.UltiSnipsEditSplit = "vertical" | ||
99 | -- ctrl + l expands the snippet, c + j/k navigates placeholders | ||
100 | g.UltiSnipsExpandTrigger = "<C-l>" | ||
101 | g.UltiSnipsEnableSnipMate = "1" | ||
102 | -- }}} UltiSnips -- | ||
103 | |||
104 | -- float preview | ||
105 | g["float_preview#docked"] = 0 | ||
106 | |||
107 | -- highlight on yank | ||
108 | cmd('highlight HighlightedyankRegion cterm=reverse gui=reverse') | ||
109 | g.highlightedyank_highlight_duration = 200 | ||
110 | |||
111 | -- beacon {{{ -- | ||
112 | g.beacon_size = 100 | ||
113 | g.beacon_shrink = 1 | ||
114 | cmd('highlight Beacon guibg=red ctermbg=15') | ||
115 | -- }}} beacon -- | ||
116 | |||
117 | -- vim-slime {{{ -- | ||
118 | g.slime_target = "tmux" | ||
119 | g.slime_paste_file = "/home/yigit/.slime_paste" | ||
120 | -- g.slime_default_config = {socket_name = get(split($TMUX, ","), 0), target_pane = "{last}"} | ||
121 | -- }}} vim-slime -- | ||
122 | |||
123 | -- vimtex {{{ -- | ||
124 | g.vimtex_view_method = 'zathura' | ||
125 | g.vimtex_quickfix_mode = 0 | ||
126 | -- }}} vimtex -- | ||
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..58cccbc --- /dev/null +++ b/.config/nvim/lua/plugins.lua | |||
@@ -0,0 +1,136 @@ | |||
1 | -- ┌───────────────────┐ | ||
2 | -- │ ▜ ▗ │ | ||
3 | -- │▛▀▖▐ ▌ ▌▞▀▌▄ ▛▀▖▞▀▘│ | ||
4 | -- │▙▄▘▐ ▌ ▌▚▄▌▐ ▌ ▌▝▀▖│ | ||
5 | -- │▌ ▘▝▀▘▗▄▘▀▘▘ ▘▀▀ │ | ||
6 | -- └───────────────────┘ | ||
7 | |||
8 | return require('packer').startup(function() | ||
9 | -- Packer can manage itself | ||
10 | use 'wbthomason/packer.nvim' | ||
11 | |||
12 | -- latex suite | ||
13 | use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}} | ||
14 | |||
15 | -- still here | ||
16 | use 'dense-analysis/ale' | ||
17 | -- manages tag files | ||
18 | use 'ludovicchabant/vim-gutentags' | ||
19 | -- run tests (todo: write tests) | ||
20 | use 'janko/vim-test' | ||
21 | -- type in file send to repl | ||
22 | use 'jpalardy/vim-slime' | ||
23 | -- snippets to expand | ||
24 | use {'SirVer/ultisnips', 'honza/vim-snippets'} | ||
25 | -- Highlight the yanked region | ||
26 | use 'machakann/vim-highlightedyank' | ||
27 | |||
28 | -- auto pair plugin, people hate these | ||
29 | use 'tmsvg/pear-tree' | ||
30 | -- git diff in the sign column | ||
31 | use 'airblade/vim-gitgutter' | ||
32 | -- completion preview of floating window | ||
33 | use 'ncm2/float-preview.nvim' | ||
34 | |||
35 | -- language packs | ||
36 | use 'sheerun/vim-polyglot' | ||
37 | -- i3 config syntax | ||
38 | use 'mboughaba/i3config.vim' | ||
39 | -- kitty config filetype | ||
40 | use 'fladson/vim-kitty' | ||
41 | |||
42 | use{'junegunn/fzf', dir = '~/.fzf'} | ||
43 | use 'junegunn/fzf.vim' | ||
44 | |||
45 | -- file explorer | ||
46 | use 'lambdalisue/fern.vim' | ||
47 | -- bug in neovim, so required for now | ||
48 | -- https://github.com/lambdalisue/fern.vim/issues/120 | ||
49 | use 'antoinemadec/FixCursorHold.nvim' | ||
50 | |||
51 | -- displays tags ordered by scope | ||
52 | use 'majutsushi/tagbar' | ||
53 | -- Undo tree | ||
54 | use { | ||
55 | 'mbbill/undotree', | ||
56 | cmd = 'UndotreeToggle', | ||
57 | config = [[vim.g.undotree_SetFocusWhenToggle = 1]], | ||
58 | } | ||
59 | -- Highlight colors | ||
60 | use { | ||
61 | 'norcalli/nvim-colorizer.lua', | ||
62 | ft = { 'css', 'javascript', 'vim', 'html' }, | ||
63 | config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]], | ||
64 | } | ||
65 | |||
66 | -- cutlass suite, x, d, \ys etc. | ||
67 | use { | ||
68 | 'svermeulen/vim-cutlass', | ||
69 | 'svermeulen/vim-subversive', | ||
70 | 'svermeulen/vim-yoink' | ||
71 | } | ||
72 | |||
73 | -- Personal wiki | ||
74 | use 'vimwiki/vimwiki' | ||
75 | -- centers the writing | ||
76 | use 'junegunn/goyo.vim' | ||
77 | -- highlights the current paragraph | ||
78 | use 'junegunn/limelight.vim' | ||
79 | -- change ASCII text to Turkish text | ||
80 | use 'yigitsever/turkish-deasciifier.vim' | ||
81 | |||
82 | -- text alignment \w :Tab | ||
83 | use 'godlygeek/tabular' | ||
84 | -- move selections up and down with alt+[j,k] | ||
85 | use 'matze/vim-move' | ||
86 | -- surround text objects; sa, sr and sd | ||
87 | use 'machakann/vim-sandwich' | ||
88 | -- provide additional text objects | ||
89 | use 'wellle/targets.vim' | ||
90 | -- indentation level text object, ia, ii | ||
91 | use 'michaeljsmith/vim-indent-object' | ||
92 | -- visual feedback for substitute holy shit this is amazing | ||
93 | use 'markonm/traces.vim' | ||
94 | -- see the contents of registers on "/<CTRL-R> | ||
95 | use 'junegunn/vim-peekaboo' | ||
96 | -- use <leader>k to highlight multiple words) | ||
97 | use 'lfv89/vim-interestingwords' | ||
98 | -- swap delimited items using g>, g< | ||
99 | use 'machakann/vim-swap' | ||
100 | -- jump to location by 2 characters, ` | ||
101 | use 'justinmk/vim-sneak' | ||
102 | -- reopen files at your last edit position | ||
103 | use 'farmergreg/vim-lastplace' | ||
104 | -- flash cursor on jump | ||
105 | use 'DanilaMihailov/beacon.nvim' | ||
106 | |||
107 | -- cursorline of the $CURRENT_YEAR | ||
108 | use { | ||
109 | 'hoob3rt/lualine.nvim', | ||
110 | requires = {'kyazdani42/nvim-web-devicons', opt = true} | ||
111 | } | ||
112 | -- colour theme of the $CURRENT_YEAR | ||
113 | use 'rose-pine/neovim' | ||
114 | |||
115 | -- enable repeating supported plugin maps with '.' | ||
116 | use 'tpope/vim-repeat' | ||
117 | -- pairs of handy bracket mappings | ||
118 | use 'tpope/vim-unimpaired' | ||
119 | -- git wrapper | ||
120 | use { | ||
121 | 'tpope/vim-fugitive', cmd = { 'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull' } | ||
122 | } | ||
123 | -- increment dates, times & more | ||
124 | use 'tpope/vim-speeddating' | ||
125 | -- search, substitute and abbreviate | ||
126 | use 'tpope/vim-abolish' | ||
127 | -- provides ga, show unicode stuff of char under cursor | ||
128 | use 'tpope/vim-characterize' | ||
129 | -- comment helper | ||
130 | use 'tpope/vim-commentary' | ||
131 | -- asynchronous build and test dispatcher | ||
132 | use {'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}} | ||
133 | |||
134 | -- fancy start screen | ||
135 | use 'mhinz/vim-startify' | ||
136 | end) | ||
diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua new file mode 100644 index 0000000..5996c51 --- /dev/null +++ b/.config/nvim/lua/settings.lua | |||
@@ -0,0 +1,103 @@ | |||
1 | -- ┌──────────────────┐ | ||
2 | -- │ ▗ │ | ||
3 | -- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│ | ||
4 | -- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ | ||
5 | -- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ | ||
6 | -- └──────────────────┘ | ||
7 | -- ┌───────────────────────┐ | ||
8 | -- │ ▐ ▐ ▗ │ | ||
9 | -- │▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ | ||
10 | -- │▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ | ||
11 | -- │▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ | ||
12 | -- └───────────────────────┘ | ||
13 | |||
14 | local o = vim.o -- gl[o]bal options | ||
15 | local wo = vim.wo -- [w]indow-local [o]ptions | ||
16 | local bo = vim.bo -- [b]uffer-local [o]ptions | ||
17 | local opt = vim.opt -- convenient :set | ||
18 | |||
19 | -- look & feel | ||
20 | o.termguicolors = true | ||
21 | vim.cmd('colorscheme rose-pine') | ||
22 | |||
23 | -- interact with system clipboard | ||
24 | opt.clipboard:append('unnamedplus') | ||
25 | |||
26 | -- copy indent on a new line | ||
27 | o.autoindent = true | ||
28 | |||
29 | -- :h tabstop, 2. point | ||
30 | -- use appropriate number of spaces to insert a <Tab> | ||
31 | o.expandtab = true | ||
32 | o.shiftwidth = 4 | ||
33 | o.softtabstop = 4 | ||
34 | o.tabstop = 8 | ||
35 | |||
36 | -- use english for spellchecking, but don't spellcheck by default | ||
37 | o.spell = true | ||
38 | o.spelllang = "en_gb" | ||
39 | o.spell = false | ||
40 | |||
41 | -- tab completion, zsh style | ||
42 | o.wildmode = "full" | ||
43 | opt.wildignore = { | ||
44 | '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls', | ||
45 | '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv', | ||
46 | '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml', | ||
47 | '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz', | ||
48 | '*.synctex.gz(busy)', '*.pdfsync' | ||
49 | } | ||
50 | |||
51 | -- put one space while joining (not two) | ||
52 | o.joinspaces = false | ||
53 | |||
54 | -- keep n lines above/below cursor while scrolling | ||
55 | o.scrolloff = 4 | ||
56 | -- line numbers | ||
57 | o.number = true | ||
58 | -- fold manually, when I place markers | ||
59 | o.foldmethod = "marker" | ||
60 | -- set the terminal title | ||
61 | o.title = true | ||
62 | -- wrap using 'breakat' character | ||
63 | o.linebreak = true | ||
64 | -- new split panes will split to below and right | ||
65 | o.splitbelow = true | ||
66 | o.splitright = true | ||
67 | -- highlight the current line, yoc undoes | ||
68 | o.cursorline = true | ||
69 | -- current line actual number, rest are relative | ||
70 | o.relativenumber = true | ||
71 | -- we are already using a cursorline, don't clobber linter messages | ||
72 | o.showmode = false | ||
73 | -- jump to the matching bracket briefly | ||
74 | o.showmatch = true | ||
75 | -- move freely between buffers | ||
76 | o.hidden = true | ||
77 | |||
78 | -- persistent undo | ||
79 | o.undodir = "/home/yigit/.vim/undodir" | ||
80 | o.undofile = true | ||
81 | |||
82 | -- lower case searches ignore case, upper case searches do not | ||
83 | o.ignorecase = true | ||
84 | o.smartcase = true | ||
85 | |||
86 | -- https://stackoverflow.com/a/3445040/ | ||
87 | -- switch case labels | ||
88 | o.cinoptions = "l1" | ||
89 | |||
90 | if vim.fn.executable("rg") then | ||
91 | o.grepprg = "rg --vimgrep --no-heading --smart-case" | ||
92 | end | ||
93 | |||
94 | -- iwhite: ignore changes in amount of white space. | ||
95 | -- vertical: start diff mode with vertical splits | ||
96 | -- filler: show filler lines, | ||
97 | opt.diffopt = { | ||
98 | "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic" | ||
99 | } | ||
100 | |||
101 | -- menu: use a popup menu to show the possible completions | ||
102 | -- preview: show extra information | ||
103 | opt.completeopt = {"menu", "preview"} | ||