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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
|
-- ┌─────────────────────────────────────┐
-- │ ▜ ▐ ▐ ▗ │
-- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│
-- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│
-- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │
-- └─────────────────────────────────────┘
local g = vim.g -- global for let options
local opt = vim.opt -- convenient :set
local cmd = vim.cmd -- vim commands
-- vimwiki {{{ --
g.vimwiki_list = {
{
path = '/home/yigit/nextcloud/personal_wiki/text',
path_html = '/home/yigit/nextcloud/personal_wiki/html',
auto_generate_tags = 1,
automatic_nested_syntaxes = 1,
template_path = '/home/yigit/nextcloud/personal_wiki/templates',
template_default = 'default_template',
template_ext = '.html',
auto_export = 1,
auto_tags = 1
}
}
g.vimwiki_global_ext = 0
g.vimwiki_hl_headers = 1
-- }}} vimwiki --
-- lualine {{{ --
local function lualine_spell()
if vim.wo.spell then
return "spell"
else
return
end
end
local conditions = {
spell_on = function ()
return vim.wo.spell
end,
filetype_is_tex = function()
return vim.bo.filetype == "tex"
end
}
-- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/
-- override 'encoding': don't display if encoding is utf-8.
local encoding = function()
local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "")
return ret
end
-- fileformat: don't display if &ff is unix.
local fileformat = function()
local ret, _ = vim.bo.fileformat.gsub("^unix$", "")
return ret
end
require'lualine'.setup {
options = {
icons_enabled = true,
theme = "catppuccin",
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
},
sections = {
lualine_a = {{'mode', fmt = string.lower}},
lualine_b = {'branch',
{
'diff',
diff_color= {
-- Same color values as the general color option can be used here.
added = { fg = 'LightGreen' },
modified = { fg = 'LightBlue' }, -- Changes the diff's modified color
removed = { fg = 'LightRed' }, -- Changes the diff's removed color you
}
},
{
lualine_spell,
cond = conditions.spell_on,
}},
lualine_c = {'filename'},
lualine_x = {encoding, fileformat, 'filetype'},
lualine_y = {'progress'},
lualine_z = {
'location', {
'diagnostics',
sources = {'nvim_diagnostic'},
sections = {'error', 'warn', 'info', 'hint'},
symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'}
}
}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {}
}
-- }}} lualine --
-- cutlass suite {{{ --
-- cutlass/yoink/subverse suite
g.yoinkIncludeDeleteOperations = 1
-- fix the Target STRING not available
g.clipboard = {
name = 'xsel_override',
copy = {
['+'] = 'xsel --input --clipboard',
['*'] = 'xsel --input --primary',
},
paste = {
['+'] = 'xsel --output --clipboard',
['*'] = 'xsel --output --primary',
},
cache_enabled = 1,
}
-- }}} cutlass suite --
-- UltiSnips {{{ --
g.UltiSnipsEditSplit = "vertical"
-- ctrl + l expands the snippet, c + j/k navigates placeholders
g.UltiSnipsExpandTrigger = "<tab>"
g.UltiSnipsEnableSnipMate = "1"
g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"}
-- }}} UltiSnips --
-- vimtex {{{ --
g.vimtex_view_method = 'zathura'
g.vimtex_quickfix_mode = 0
g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"}
g.vimtex_compiler_latexmk = {
options = {
"-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode'
}
}
-- }}} vimtex --
-- filetype.nvim {{{ --
require('filetype').setup({
overrides = {
literal = {
PKGBUILD = 'PKGBUILD',
},
}
})
-- }}} filetype.nvim --
-- ledger {{{ --
g.ledger_maxwidth = 80
g.ledger_fillstring = ' -'
-- }}} ledger --
-- devicons {{{ --
require'nvim-web-devicons'.setup {
override = {
wiki = {
icon = "",
color = "#D7827E",
name = "vimwiki"
},
rem = {
icon = "",
color = "#B4637A",
name = "remind"
},
mail = {
icon = "",
color = "#907AA9",
name = "mail"
},
};
default = true
}
-- }}} devicons --
-- vim-slime {{{ --
g.slime_target = "tmux"
g.slime_paste_file = "$HOME/.slime_paste"
g.slime_default_config = {socket_name = vim.call("get", vim.call("split", vim.env.TMUX, ','), "0"), target_pane = "{last}"}
-- }}} vim-slime --
-- gutentags {{{ --
g.gutentags_enabled = 1
g.gutentags_add_default_project_roots = 0
g.gutentags_project_root = {'Makefile', '.git'}
g.gutentags_exclude_filetypes = {'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'}
g.gutentags_generate_on_new = 1
g.gutentags_generate_on_missing = 1
g.gutentags_generate_on_write = 1
g.gutentags_generate_on_empty_buffer = 0
g.gutentags_ctags_exclude = {
'*.git', '*.svn', '*.hg',
'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components',
'*-lock.json', '*.lock',
'*.min.*',
'*.bak',
'*.zip',
'*.pyc',
'*.class',
'*.sln',
'*.csproj', '*.csproj.user',
'*.tmp',
'*.cache',
'*.vscode',
'*.pdb',
'*.exe', '*.dll', '*.bin',
'*.mp3', '*.ogg', '*.flac',
'*.swp', '*.swo',
'.DS_Store', '*.plist',
'*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg',
'*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2',
'*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls',
}
-- }}} gutentags --
-- telescope {{{ --
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
require('telescope').load_extension('fzf')
-- }}} telescope --
-- alpha-nvim {{{ --
local alpha = require ("alpha")
local startify = require ("alpha.themes.startify")
-- Set header
startify.section.header.val = {
" ▄ ▄███▄ ████▄ ▄ ▄█ █▀▄▀█ ",
" █ █▀ ▀ █ █ █ ██ █ █ █ ",
"██ █ ██▄▄ █ █ █ █ ██ █ ▄ █ ",
"█ █ █ █▄ ▄▀ ▀████ █ █ ▐█ █ █ ",
"█ █ █ ▀███▀ █ █ ▐ █ ",
"█ ██ █▐ ▀ ",
" ▐ ",
}
startify.section.footer = {
{ type = "text", val = "footer" },
}
-- Send config to alpha
alpha.setup(startify.opts)
-- }}} alpha-nvim --
-- treesitter {{{ --
require 'nvim-treesitter.configs'.setup {
ensure_installed = "all",
highlight = {
enable = true,
disable = { "latex" },
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
indent = {
enable = true
}
}
-- }}} treesitter --
-- nvim-cmp {{{ --
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["UltiSnips#Anon"](args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-c>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
['<C-l>'] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'ultisnips' },
}, {
{ name = 'buffer' },
{ name = 'path' },
})
})
-- }}} nvim-cmp --
-- nvim-lspconfig {{{ --
local nvim_lsp = require('lspconfig')
-- Mappings.
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)
local on_attach = function(client, bufnr)
-- enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- see `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<leader>fm', function() vim.lsp.buf.format { async = true } end, bufopts)
end
-- bring in cmp_nvim_lsp
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local servers = { 'jedi_language_server', 'texlab', 'clangd' }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = capabilities
}
end
nvim_lsp['efm'].setup {
on_attach = on_attach,
filetypes = { 'sh' },
capabilities = capabilities
}
nvim_lsp.ltex.setup {
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
require("ltex_extra").setup {
load_langs = { "en-GB" },
init_check = true,
path = "/home/yigit/.local/share/nvim/ltex",
log_level = "none",
}
end,
settings = {
ltex = {
-- my settings here
}
}
}
-- rust-tools {{{ --
-- Configure LSP through rust-tools.nvim plugin.
-- rust-tools will configure and enable certain LSP features for us.
-- See https://github.com/simrat39/rust-tools.nvim#configuration
local rust_opts = {
tools = {
runnables = {
use_telescope = true,
},
inlay_hints = {
auto = true,
show_parameter_hints = true,
parameter_hints_prefix = "↸ ",
other_hints_prefix = "❱ ",
},
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = {
-- on_attach is a callback called when the language server attachs to the buffer
on_attach = on_attach,
settings = {
-- to enable rust-analyzer settings visit:
-- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
["rust-analyzer"] = {
-- enable clippy on save
checkOnSave = {
command = "clippy",
},
},
},
},
}
require('rust-tools').setup(rust_opts)
-- }}} rust-tools --
-- }}} nvim-lsp --
-- vista {{{ --
g.vista_icon_indent = {"╰ ", "│ "}
-- }}} vista --
-- indent-blankline {{{ --
vim.opt.list = true
require("indent_blankline").setup {
show_current_context = true,
char = "┊",
buftype_exclude = {"terminal"},
filetype_exclude = {"alpha", "help", "ledger", "man"}
}
-- }}} indent-blankline --
-- nvim-autopairs {{{ --
require('nvim-autopairs').setup({
disable_filetype = { "TelescopePrompt" },
})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done())
local Rule = require('nvim-autopairs.rule')
local npairs = require('nvim-autopairs')
npairs.add_rule(Rule('%"','%"',"remind"))
npairs.add_rule(Rule('/*','*/',"c"))
-- }}} nvim-autopairs --
-- nvim-colorizer {{{ --
require 'colorizer'.setup()
-- }}} nvim-colorizer --
-- gitsigns.nvim {{{ --
require('gitsigns').setup {
signs = {
add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
keymaps = {
-- Default keymap options
noremap = true,
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns.actions\".next_hunk()<CR>'"},
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns.actions\".prev_hunk()<CR>'"},
['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
['v <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
['v <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
['n <leader>hR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line(true)<CR>',
['n <leader>hS'] = '<cmd>lua require"gitsigns".stage_buffer()<CR>',
['n <leader>hU'] = '<cmd>lua require"gitsigns".reset_buffer_index()<CR>',
-- Text objects
['o ih'] = ':<C-U>lua require"gitsigns.actions".select_hunk()<CR>',
['x ih'] = ':<C-U>lua require"gitsigns.actions".select_hunk()<CR>'
},
watch_gitdir = {
interval = 1000,
follow_files = true
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
},
current_line_blame_formatter_opts = {
relative_time = false
},
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000,
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
yadm = {
enable = true
},
}
-- }}} gitsigns.nvim --
-- Comment.nvim {{{ --
require('Comment').setup()
-- }}} Comment.nvim --
-- catppuccin {{{ --
require("catppuccin").setup({
flavour = "mocha", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "mocha",
},
transparent_background = false,
term_colors = false,
no_italic = true, -- force no italic
no_bold = false, -- force no bold
integrations = {
barbar = true,
cmp = true,
fidget = true,
gitsigns = true,
leap = true,
nvimtree = true,
telescope = true,
treesitter = true,
vimwiki = true,
which_key = true,
},
native_lsp = {
enabled = true,
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
})
-- setup must be called before loading
vim.cmd.colorscheme "catppuccin"
-- }}} catppuccin --
-- dial.nvim {{{ --
local augend = require("dial.augend")
require("dial.config").augends:register_group{
-- default augends used when no group name is specified
default = {
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
augend.date.alias["%Y-%m-%d"],
augend.semver.alias.semver,
augend.constant.new{
elements = {"and", "or"},
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and".
},
augend.constant.new{
elements = {"&&", "||"},
word = false,
cyclic = true,
},
},
}
-- }}} dial.nvim --
-- leap.nvim {{{ --
require('leap').setup {
case_insensitive = true,
substitute_chars = { ['\r'] = '¬' }
}
-- }}} leap.nvim --
-- fidget.nvim {{{ --
require("fidget").setup{
-- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md
text = {
spinner = "triangle"
}
}
-- }}} fidget.nvim --
-- nvim-tree {{{ --
require("nvim-tree").setup({
sort_by = "case_sensitive",
diagnostics = {
enable = false,
icons = {
hint = "❔",
info = "❕",
warning = "❗",
error = "❌",
}
},
view = {
adaptive_size = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
-- }}} nvim-tree --
-- barbar.nvim {{{ --
require'bufferline'.setup {
-- disable animations
animation = false,
-- auto-hide the tab bar when there is a single buffer
auto_hide = true,
-- enable current/total tabpages indicator (top right corner)
tabpages = true,
-- enable close button
closable = true,
-- disable clickable tabs
clickable = false,
-- Enables / disables diagnostic symbols
diagnostics = {
-- `vim.diagnostic.severity`
[vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'},
[vim.diagnostic.severity.WARN] = {enabled = false},
[vim.diagnostic.severity.INFO] = {enabled = false},
[vim.diagnostic.severity.HINT] = {enabled = true},
},
-- -- Excludes buffers from the tabline
-- exclude_ft = {'javascript'},
-- exclude_name = {'package.json'},
-- Hide inactive buffers and file extensions. Other options are `current` and `visible`
-- hide = {extensions = true, inactive = true},
-- Enable/disable icons
-- if set to 'numbers', will show buffer index in the tabline
-- if set to 'both', will show buffer index and icons in the tabline
icons = true,
-- If set, the icon color will follow its corresponding buffer
-- highlight group. By default, the Buffer*Icon group is linked to the
-- Buffer* group (see Highlighting below). Otherwise, it will take its
-- default value as defined by devicons.
icon_custom_colors = false,
-- Configure icons on the bufferline.
icon_separator_active = '▎',
icon_separator_inactive = '▎',
icon_close_tab = '',
icon_close_tab_modified = '•',
icon_pinned = '車',
-- If true, new buffers will be inserted at the start/end of the list.
-- Default is to insert after current buffer.
insert_at_end = false,
insert_at_start = false,
-- Sets the maximum padding width with which to surround each tab
maximum_padding = 1,
-- Sets the minimum padding width with which to surround each tab
minimum_padding = 1,
-- Sets the maximum buffer name length.
maximum_length = 30,
-- If set, the letters for each buffer in buffer-pick mode will be
-- assigned based on their name. Otherwise or in case all letters are
-- already assigned, the behavior is to assign letters in order of
-- usability (see order below)
semantic_letters = true,
-- New buffer letters are assigned in this order. This order is
-- optimal for the qwerty keyboard layout but might need adjustement
-- for other layouts.
-- letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM',
-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
-- where X is the buffer number. But only a static string is accepted here.
no_name_title = nil,
}
local nvim_tree_events = require('nvim-tree.events')
local bufferline_api = require('bufferline.api')
local function get_tree_size()
return require'nvim-tree.view'.View.width
end
nvim_tree_events.subscribe('TreeOpen', function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe('Resize', function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe('TreeClose', function()
bufferline_api.set_offset(0)
end)
-- }}} barbar.nvim --
|