@@ -16,7 +16,7 @@ require'packer'.startup {function (use)
16
16
-- @return string
17
17
-- https://github.com/aspeddro/dotfiles/blob/main/.config/nvim/lua/user/packages.lua
18
18
local here = function (path )
19
- return vim .fn .expand ' ~/dev /' .. path
19
+ return vim .fn .expand ' ~/src /' .. path
20
20
end
21
21
22
22
--- packer {{{
@@ -56,7 +56,7 @@ require'packer'.startup {function (use)
56
56
}
57
57
--- }}}
58
58
59
- --- tree {{{
59
+ --- nnn {{{
60
60
use {
61
61
' gzagatti/nnn.nvim' ,
62
62
branch = ' tweaks' ,
@@ -99,9 +99,8 @@ require'packer'.startup {function (use)
99
99
" " ,
100
100
" <f8>" ,
101
101
" :execute 'NnnExplorer' (expand('%:p') ==? expand('%:.') ? '%:p:h' : '')<cr>" ,
102
- { noremap = true }
102
+ { noremap = true , silent = true }
103
103
)
104
- vim .api .nvim_set_keymap (" " , " [telescope]/" , " <cmd>NnnPicker %:p:h<cr>" , { noremap = true })
105
104
vim .cmd [[
106
105
augroup nnn
107
106
autocmd FileType * if &ft ==# "nnn" |:tnoremap <buffer> <f8> q| endif
@@ -215,10 +214,12 @@ require'packer'.startup {function (use)
215
214
use {
216
215
' Yggdroot/indentLine' ,
217
216
config = function ()
218
- vim .g . indentLine_defaultGroup = ' LineNr '
219
- vim .g [' indentLine_concealcursor' ] = ' nc '
220
- vim .g [' indentLine_conceallevel' ] = 2
217
+ vim .g [ ' indentLine_defaultGroup' ] = ' IndentLine '
218
+ vim .g [' indentLine_concealcursor' ] = ' c '
219
+ vim .g [' indentLine_conceallevel' ] = 0
221
220
vim .cmd [[
221
+ autocmd ColorScheme leuven highlight IndentLine guifg='#dadad7' ctermfg=253'
222
+ autocmd ColorScheme dracula highlight IndentLine guifg='#2f3751' ctermfg=253'
222
223
autocmd TermOpen * IndentLinesDisable
223
224
autocmd Filetype * if &ft ==# "help" | :IndentLinesDisable | endif
224
225
autocmd Filetype * if &ft ==# "NeogitStatus" | :IndentLinesDisable | endif
@@ -247,12 +248,12 @@ require'packer'.startup {function (use)
247
248
use {
248
249
' gzagatti/vim-pencil' ,
249
250
config = function ()
250
- vim .g [' pencil#conceallevel' ] = 2
251
- vim .g [' pencil#concealcursor' ] = ' nc '
251
+ vim .g [' pencil#conceallevel' ] = 0
252
+ vim .g [' pencil#concealcursor' ] = ' c '
252
253
vim .cmd [[
253
254
augroup pencil
254
255
autocmd!
255
- autocmd FileType tex call pencil#init({'wrap': 'soft'})
256
+ autocmd FileType tex,org call pencil#init({'wrap': 'soft'})
256
257
augroup END
257
258
]]
258
259
end
@@ -264,21 +265,28 @@ require'packer'.startup {function (use)
264
265
use {
265
266
' junegunn/goyo.vim' ,
266
267
config = function ()
268
+ vim .g .goyo_width = " 120"
269
+ vim .g .goyo_height = " 90%"
270
+ vim .api .nvim_set_keymap (' n' , ' <leader>go' , ' <cmd>Goyo<cr>' , { noremap = true })
267
271
vim .cmd [[
268
272
function! s:GoyoEnter()
269
- silent !tmux set -w status off
270
- silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
271
- nnoremap <f8> :NvimTreeToggle<cr>:Goyo x<cr>
273
+ if executable('tmux') && strlen($TMUX)
274
+ silent !tmux set -w status off
275
+ silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
276
+ endif
277
+ lua require('lualine').hide()
272
278
autocmd VimResized * exe "normal \<c-w>="
273
279
set noshowmode
274
280
set noshowcmd
275
281
endfunction
276
282
277
283
278
284
function! s:GoyoLeave()
279
- silent !tmux set -w status on
280
- silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
281
- nnoremap <f8> :NvimTreeToggle<cr>
285
+ if executable('tmux') && strlen($TMUX)
286
+ silent !tmux set -w status on
287
+ silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
288
+ endif
289
+ lua require('lualine').hide({unhide=true})
282
290
set showmode
283
291
set showcmd
284
292
endfunction
@@ -290,6 +298,11 @@ require'packer'.startup {function (use)
290
298
}
291
299
--- }}}
292
300
301
+ --- easy align {{{
302
+ -- vim alignment
303
+ use { ' junegunn/vim-easy-align' }
304
+ --- }}}
305
+
293
306
--- telescope {{{
294
307
-- find, filter, preview, pick
295
308
use {
@@ -310,6 +323,7 @@ require'packer'.startup {function (use)
310
323
}
311
324
vim .api .nvim_set_keymap (' n' , ' [telescope]' , ' ' , { noremap = true })
312
325
vim .api .nvim_set_keymap (' n' , ' <space>' , ' [telescope]' , {})
326
+ vim .api .nvim_set_keymap (' n' , ' [telescope]/' , ' <cmd>Telescope find_files theme=get_ivy<cr>' , { noremap = true })
313
327
vim .api .nvim_set_keymap (' n' , ' [telescope]f' , ' <cmd>Telescope live_grep theme=get_ivy<cr>' , { noremap = true })
314
328
vim .api .nvim_set_keymap (' n' , ' [telescope]y' , ' <cmd>Telescope registers theme=get_ivy<cr>' , { noremap = true })
315
329
vim .api .nvim_set_keymap (' n' , ' [telescope]b' , ' <cmd>Telescope buffers theme=get_ivy<cr>' , { noremap = true })
@@ -334,32 +348,23 @@ require'packer'.startup {function (use)
334
348
org_do_demote = ' >h' ,
335
349
},
336
350
},
337
- org_agenda_files = { vim .env .HOME .. ' /dev/bstorm/**/*' },
338
- org_default_notes_file = vim .env .HOME .. ' /dev/bstorm/inbox.org' ,
351
+ org_agenda_files = {
352
+ vim .env .HOME .. ' /org/**/*' ,
353
+ },
354
+ org_default_notes_file = vim .env .HOME .. ' /org/inbox.orgbundle/text.org' ,
339
355
org_todo_keywords = {
340
356
' TODO(t)' , ' |' , ' POSTPONED(p)' , ' CANCELLED(c)' , ' DONE(d)'
341
357
}
342
358
}
343
359
end ,
344
360
}
361
+ --- }}}
345
362
346
- use {
347
- ' akinsho/org-bullets.nvim' ,
348
- requires = { ' nvim-orgmode/orgmode' },
349
- config = function ()
350
- require (" org-bullets" ).setup {
351
- concealcursor = true ,
352
- symbols = {
353
- headlines = { " ◉" , " ○" , " ✸" , " ✿" },
354
- checkboxes = {
355
- half = {" -" , " Normal" },
356
- done = { " x" , " Normal" },
357
- todo = {" " , " Normal" },
358
- },
359
- },
360
- }
361
- end ,
362
- }
363
+ --- org-goodies{{{
364
+ use {
365
+ here ' org-goodies.nvim' ,
366
+ requires = { ' nvim-orgmode/orgmode' },
367
+ }
363
368
--- }}}
364
369
365
370
--- tablemode {{{
@@ -375,15 +380,14 @@ require'packer'.startup {function (use)
375
380
' hrsh7th/nvim-cmp' ,
376
381
requires = {
377
382
' hrsh7th/cmp-nvim-lsp' ,
378
- ' hrsh7th/cmp-buffer' ,
383
+ -- 'hrsh7th/cmp-buffer',
379
384
' hrsh7th/cmp-path' ,
380
385
' hrsh7th/cmp-cmdline' ,
381
386
' hrsh7th/vim-vsnip' ,
382
387
' hrsh7th/cmp-vsnip' ,
383
388
' kdheepak/cmp-latex-symbols' ,
384
389
' hrsh7th/cmp-nvim-lua' ,
385
390
' ray-x/cmp-treesitter' ,
386
- ' ray-x/lsp_signature.nvim' ,
387
391
},
388
392
config = function ()
389
393
@@ -435,7 +439,7 @@ require'packer'.startup {function (use)
435
439
{ name = ' nvim_lsp' },
436
440
{ name = ' vsnip' },
437
441
{ name = ' latex_symbols' },
438
- { name = ' buffer' },
442
+ -- { name = 'buffer' },
439
443
{ name = ' path' },
440
444
{ name = ' orgmode' },
441
445
{ name = ' nvim_lua' },
@@ -640,9 +644,6 @@ require'packer'.startup {function (use)
640
644
641
645
print (" Attaching " , client .name , " LSP in buffer " , bufnr , " ..." )
642
646
643
- local ok , lsp_signature = pcall (require , " lsp_signature" )
644
- if ok then lsp_signature .on_attach () end
645
-
646
647
-- diagnostic
647
648
vim .api .nvim_buf_set_keymap (bufnr , ' n' , ' [telescope]l' ,
648
649
' <cmd>Telescope diagnostics theme=get_ivy<cr>' , opts )
@@ -867,6 +868,65 @@ require'packer'.startup {function (use)
867
868
}
868
869
--- }}}
869
870
871
+ --- hologram {{{
872
+ -- image viewer for Neovim
873
+ use {
874
+ here ' hologram.nvim' ,
875
+ config = function ()
876
+ require ' hologram' .setup ()
877
+ end ,
878
+ }
879
+ --- }}}
880
+
881
+ --- clipboard image {{{
882
+ -- paste image from clipboard
883
+ use {
884
+ here ' clipboard-image.nvim' ,
885
+ config = function ()
886
+ require ' clipboard-image' .setup {
887
+ default = {
888
+ img_dir = {" %:p:h" },
889
+ img_dir_txt = " ." ,
890
+ },
891
+ org = {
892
+ img_dir = {" %:p:h" , " assets" },
893
+ img_dir_txt = " ./assets" ,
894
+ img_name = function ()
895
+ local img_dir = vim .fn .expand (" %:p:h" ) .. " /assets"
896
+ img_dir = io.popen (' ls "' .. img_dir .. ' " 2>/dev/null' )
897
+ local files = {}
898
+ if img_dir ~= nil then
899
+ for filename in img_dir :lines () do
900
+ filename = filename :match (" (.+)%..+$" )
901
+ if filename ~= nil then files [filename ] = true end
902
+ end
903
+ img_dir .close ()
904
+ end
905
+ repeat
906
+ uuid = vim .fn .call (" system" , {" uuidgen" }):sub (10 , 13 )
907
+ until files [uuid ] == nil
908
+ return uuid
909
+ end ,
910
+ affix = " [[%s]]" ,
911
+ img_size = " 600x400" ,
912
+ }
913
+ }
914
+ end ,
915
+ }
916
+ -- }}}
917
+
918
+ --- nabla {{{
919
+ -- equation rendering
920
+ -- TODO support LaTex equations
921
+ -- TODO support visual selection
922
+ -- use {
923
+ -- 'jbyuki/nabla.nvim',
924
+ -- config = function()
925
+ -- vim.api.nvim_set_keymap('n', '<leader>gE', "<cmd>lua require'nabla'.popup()<cr>", { noremap=true })
926
+ -- end,
927
+ -- }
928
+ -- }}}
929
+
870
930
--- theme: dracula {{{
871
931
use {
872
932
' dracula/vim' ,
@@ -913,6 +973,11 @@ vim.opt.encoding = 'utf-8'
913
973
vim .opt .lazyredraw = true
914
974
--- }}}
915
975
976
+ --- colors {{{
977
+ vim .opt .termguicolors = true
978
+ vim .opt .guicursor = ' a:blinkon0-Cursor,i-ci:ver100'
979
+ --- }}}
980
+
916
981
--- leaders {{{
917
982
vim .g .mapleader = ' ;'
918
983
vim .g .maplocalleader = ' \\ '
@@ -1048,11 +1113,6 @@ vim.g['loaded_ruby_provider'] = 0
1048
1113
vim .g [' loaded_perl_provider' ] = 0
1049
1114
--- }}}
1050
1115
1051
- --- colors {{{
1052
- vim .opt .termguicolors = true
1053
- vim .opt .guicursor = ' a:blinkon0-Cursor,i-ci:ver100'
1054
- --- }}}
1055
-
1056
1116
--- terminal {{{
1057
1117
vim .api .nvim_set_keymap (' t' , ' <c-h>' , ' <C-\\ ><C-N><C-w>h' , { noremap = true })
1058
1118
vim .api .nvim_set_keymap (' t' , ' <c-j>' , ' <C-\\ ><C-N><C-w>j' , { noremap = true })
@@ -1167,11 +1227,11 @@ vim.cmd [[
1167
1227
1168
1228
nnoremap <expr> <silent> <buffer> l <SID>ForwardSkipConceal(v:count1)
1169
1229
nnoremap <expr> <silent> <buffer> h <SID>BackwardSkipConceal(v:count1)
1170
- nnoremap <expr> <leader>h <SID>ToggleConceal()
1230
+ nnoremap <expr> <leader>hc <SID>ToggleConceal()
1171
1231
]]
1172
1232
1173
- vim .opt .conceallevel = 2
1174
- vim .opt .concealcursor = ' nc '
1233
+ vim .opt .conceallevel = 0
1234
+ vim .opt .concealcursor = ' c '
1175
1235
--- }}}
1176
1236
1177
1237
--- copy/paste mode toggle and shortcuts {{{
0 commit comments