-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
729 lines (608 loc) · 21.9 KB
/
init.vim
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
set nocompatible " vim, not vi
filetype off " Enable filetype detection
call plug#begin('~/.vim/plugged')
" configuration
" Plug 'editorconfig/editorconfig-vim'
"lsp"
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
" Plug 'mhanberg/output-panel.nvim'
" Plug 'alexaandru/nvim-lspupdate'
Plug 'nvim-lua/plenary.nvim'
" Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'j-hui/fidget.nvim'
"treesitter"
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update
" Functional/UI
Plug 'nvim-tree/nvim-web-devicons'
" Plug 'janko-m/vim-test'
" telescope
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.5' }
" tree
Plug 'nvim-tree/nvim-tree.lua'
" code action menu
Plug 'weilbith/nvim-code-action-menu'
Plug 'folke/lsp-trouble.nvim'
Plug 'folke/lsp-colors.nvim'
Plug 'akinsho/nvim-bufferline.lua'
" Plug 'romgrk/barbar.nvim'
Plug 'folke/which-key.nvim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'SmiteshP/nvim-navic'
Plug 'SmiteshP/nvim-navbuddy'
Plug 'utilyre/barbecue.nvim'
"completion"
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-nvim-lua'
Plug 'hrsh7th/cmp-nvim-lsp-signature-help'
Plug 'rcarriga/cmp-dap'
Plug 'hrsh7th/nvim-cmp'
"snippets"
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
Plug 'junegunn/vim-easy-align'
Plug 'lewis6991/gitsigns.nvim'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'mileszs/ack.vim'
Plug 'vim-scripts/visualrepeat'
Plug 'norcalli/nvim-colorizer.lua'
Plug 'windwp/nvim-autopairs'
Plug 'windwp/nvim-ts-autotag'
"Plug 'terrortylor/nvim-comment'
Plug 'numToStr/Comment.nvim'
Plug 'folke/todo-comments.nvim'
Plug 'simrat39/symbols-outline.nvim'
" Plug 'pechorin/any-jump.vim'
" Plug 'glepnir/lspsaga.nvim'
" Plug 'kevinhwang91/nvim-bqf'
" Plug 'ray-x/lsp_signature.nvim'
Plug 'Xuyuanp/scrollbar.nvim'
" Plug 'simrat39/symbols-outline.nvim'
" Plug 'rgroli/other.nvim'
" Plug 'kosayoda/nvim-lightbulb'
" Plug 'sindrets/diffview.nvim'
" Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
" Plug 'ellisonleao/glow.nvim'
" debug
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'theHamsta/nvim-dap-virtual-text'
Plug 'jay-babu/mason-nvim-dap.nvim'
" Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
" other
" Plug 'tikhomirov/vim-glsl'
Plug 'tpope/vim-abolish'
" Plug 'tpope/vim-bundler'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
" Plug 'tpope/vim-jdaddy'
Plug 'tpope/vim-projectionist'
" Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-repeat'
" Plug 'tpope/vim-sensible'
Plug 'tpope/vim-sleuth'
" Plug 'tpope/vim-surround'
" Plug 'tpope/vim-unimpaired'
" Plug 'tpope/vim-vinegar'
" Syntax
" Plug 'kamailio/vim-kamailio-syntax'
" Ruby
" Go
" Plug 'ray-x/go.nvim'
" typescript
" vue
" arduino
" Plug 'stevearc/vim-arduino'
" js
" Plug 'kchmck/vim-coffee-script'
"
" colors
" Plug 'neanias/everforest-nvim', { 'branch': 'main' }
Plug 'folke/tokyonight.nvim'
" Plug 'rebelot/kanagawa.nvim'
" Plug 'catppuccin/nvim', {'as': 'catppuccin'}
" Plug 'marko-cerovac/material.nvim'
call plug#end()
filetype plugin indent on " required`
syntax on
set encoding=UTF-8
set termguicolors
set background=dark
set autoindent
set smartindent
" set updatetime=500
" set t_Co=256
"
" let g:airline_theme='kanagawa'
" colorscheme kanagawa
colorscheme tokyonight-night
" colorscheme everforest
set number
set wildignore+=*.o,*.obj,.git,*.dynlib
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
" set mouse=ar
set nocursorline
set nobackup
set noswapfile
set hlsearch
" set clipboard+=unnamedplus
" set nomodeline
set textwidth=120
set hidden
set completeopt=menu,menuone
set laststatus=3
set cmdheight=2
" don't give |ins-completion-menu| messages.
" set shortmess+=c
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
" set updatetime=500
" always show signcolumns
set signcolumn=yes
" set showmatch
" set matchtime=3
" set nolist
set incsearch
set scrolloff=10
" set cursorline
nnoremap <CR> :nohlsearch<CR><CR>
let mapleader = ","
let g:mapleader = ","
function! FormatStack()
execute '%s/\\n/\r/g'
execute '%s/\\t/\t/g'
endfunction
" if has("gui_win32")
" set guifont=Consolas:h11:cANSI
" endif
"
autocmd BufNewFile,BufRead *.json set filetype=jsonc
nnoremap <leader>b <cmd>lua require('telescope.builtin').buffers()<cr>
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
nnoremap <leader>fs <cmd>lua require('telescope.builtin').live_grep()<cr>
nnoremap <leader>fq <cmd>lua require('telescope.builtin').quickfix()<cr>
nnoremap <leader>fd <cmd>lua require('telescope.builtin').diagnostics()<cr>
nnoremap <leader>fr <cmd>lua require('telescope.builtin').lsp_references()<cr>
" nnoremap <leader>v <cmd>CHADopen<cr>
" nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
" nnoremap <leader>ar <cmd>lua vim.lsp.buf.rename()<cr>
nnoremap <leader>f- <cmd>lua require('telescope.builtin').file_browser({cwd = vim.fn.expand('%:p:h')})<cr>
" nnoremap - <cmd>lua require('telescope.builtin').file_browser()<cr>
" nnoremap - <cmd>lua require('telescope.builtin').file_browser({cwd = vim.fn.expand('%:p:h')})<cr>
" nnoremap - <cmd>:Ex<cr>
nnoremap - <cmd>:NvimTreeFindFile<cr>
nnoremap <leader>v <cmd>:NvimTreeToggle<CR>
nnoremap <leader>aa <cmd>:CodeActionMenu<CR>
map <leader>o :SymbolsOutline<cr>
" projectionist alternate mapping
map <leader>ga :A<cr>
map <leader>m :Make<CR>
" replace selected text
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
nnoremap <C-n> :cn<CR>
nnoremap <C-p> :cp<CR>
" test runners
" nmap <silent> <leader>tn :TestNearest<CR>
" nmap <silent> <leader>tf :TestFile<CR>
" nmap <silent> <leader>ts :TestSuite<CR>
" nmap <silent> <leader>tl :TestLast<CR>
" nmap <silent> <leader>tg :TestVisit<CR>
" rules by filetype
" autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
" autocmd Filetype coffee setlocal ts=2 sts=2 sw=2
" autocmd Filetype html setlocal ts=2 sts=2 sw=2
" autocmd Filetype haml setlocal ts=2 sts=2 sw=2
" autocmd Filetype moon setlocal ts=2 sts=2 sw=2
" lazy close
nnoremap <leader>c :close<CR>
" nnoremap <C-l> :BufferNext<CR>
" nnoremap <C-h> :BufferPrev<CR>
nnoremap <C-l> :BufferLineCycleNext<CR>
nnoremap <C-h> :BufferLineCyclePrev<CR>
" au BufRead,BufNewFile *.as set filetype=cpp
au BufRead,BufNewFile *.as set syntax=cpp
au BufRead,BufNewFile *.qtpl set syntax=html
au BufRead,BufNewFile *.tpl set syntax=html
au BufRead,BufNewFile *.tmpl set syntax=html
" commentary
autocmd FileType moon set commentstring=--\ %s
autocmd FileType glsl set commentstring=\/\/\ %s
" autocmd Filetype c setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
" autocmd Filetype cpp setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
" 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)
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" augroup ScrollbarInit
" autocmd!
" autocmd CursorMoved,VimResized,QuitPre * silent! lua require('scrollbar').show()
" autocmd WinEnter,FocusGained * silent! lua require('scrollbar').show()
" autocmd WinLeave,BufLeave,BufWinLeave,FocusLost * silent! lua require('scrollbar').clear()
" augroup end
" vue
let g:vim_vue_plugin_load_full_syntax = 1
let g:vim_vue_plugin_use_pug = 1
let g:vim_vue_plugin_use_typescript = 1
let g:vim_vue_plugin_use_sass = 1
" nvim_tree"
" nnoremap <C-n> :NvimTreeToggle<CR>
" nnoremap <leader>r :NvimTreeRefresh<CR>
" nnoremap <leader>n :NvimTreeFindFile<CR>
" NvimTreeOpen, NvimTreeClose, NvimTreeFocus and NvimTreeResize are also available if you need them
" a list of groups can be found at `:help nvim_tree_highlight`
" highlight NvimTreeFolderIcon guibg=Blue
lua <<EOF
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"
-- Setup nvim-cmp.
-- vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics,{ update_in_insert = false })
require('nvim-ts-autotag').setup()
local npairs = require("nvim-autopairs")
local Rule = require('nvim-autopairs.rule')
npairs.setup({
check_ts = true,
})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
require("nvim-autopairs").setup {}
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
enabled = function ()
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt"
or require("cmp_dap").is_dap_buffer()
end,
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp_signature_help' },
{ name = 'nvim_lsp', priority = 8 },
{ name = 'nvim_lua' },
{ name = 'dap' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
-- lsp saga
-- nnoremap <silent> K <cmd>lua require('lspsaga.hover').render_hover_doc()<CR>
-- nnoremap <silent>K :Lspsaga hover_doc<CR>
require("lualine").setup{
options = {
theme = 'tokyonight'
}
}
require("symbols-outline").setup()
-- require "lsp_signature".setup({})
-- treesitter
--
require'nvim-treesitter.configs'.setup {
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
-- vim.api.nvim_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setqflist()<CR>', opts)
vim.api.nvim_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setqflist({ severity = { vim.diagnostic.severity.ERROR }})<CR>', opts)
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
local navic = require("nvim-navic")
local navbuddy = require("nvim-navbuddy")
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<leader>=', function()
vim.lsp.buf.format { async = true }
end, opts)
end,
})
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>=', '<cmd>lua vim.lsp.buf.format(nil, 20000)<CR>', opts)
local on_attach = function(client, bufnr)
-- require "lsp_signature".on_attach({
-- bind = true, -- This is mandatory, otherwise border config won't get registered.
-- handler_opts = {
-- border = "rounded"
-- }
-- }, bufnr)
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr)
end
navbuddy.attach(client, bufnr)
end
-- local servers = { 'bashls', 'cssls', 'dockerls', 'eslint', 'gopls', 'html', 'jsonls', 'tsserver', 'vimls', 'volar', 'vuels', 'yamlls' } --'sumneko_lua', 'solargraph','diagnosticls',
-- for _, lsp in ipairs(servers) do
-- require('lspconfig')[lsp].setup{
-- on_attach = on_attach,
-- capabilities = capabilities,
-- }
-- end
-- setup mason
require("mason").setup({
ui = {
icons = {
package_installed = "✓",
package_pending = "➜",
package_uninstalled = "✗"
}
}
})
--
require("mason-lspconfig").setup({
handlers = {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function (server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
-- on_attach = on_attach,
capabilities = capabilities,
flags = {
debounce_text_changes = 150,
},
}
end,
}
})
-- require("mason-nvim-dap").setup({
-- automatic_setup = true,
-- })
--
-- require'lspconfig'.jsonls.setup{
-- -- on_attach = on_attach,
-- capabilities = capabilities,
-- commands = {
-- Format = {
-- function()
-- vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0})
-- end
-- }
-- }
-- }
--
-- require'lspconfig'.stylelint_lsp.setup{
-- -- on_attach = on_attach,
-- capabilities = capabilities,
-- settings = {
-- stylelintplus = {
-- autoFixOnSave = true,
-- autoFixOnFormat = true,
-- }
-- },
-- }
-- require("null-ls").setup({
-- -- you can reuse a shared lspconfig on_attach callback here
-- sources = {
-- require("null-ls").builtins.formatting.gofumpt,
-- }
-- })
require("bufferline").setup{}
require("colorizer").setup{}
-- require("nvim_comment").setup{}
require("Comment").setup{}
-- colorize comment keywords
require("todo-comments").setup{}
-- which-key
require("which-key").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
require('gitsigns').setup{}
require("lsp-colors").setup({})
-- following options are the default
require'nvim-tree'.setup {
view = {
adaptive_size = true,
}
}
-- barbecue
-- triggers CursorHold event faster
vim.opt.updatetime = 200
require("barbecue").setup({
create_autocmd = false, -- prevent barbecue from updating itself automatically
theme = 'tokyonight',
})
vim.api.nvim_create_autocmd({
"WinScrolled", -- or WinResized on NVIM-v0.9 and higher
"BufWinEnter",
"CursorHold",
"InsertLeave",
-- include this if you have set `show_modified` to `true`
"BufModifiedSet",
}, {
group = vim.api.nvim_create_augroup("barbecue.updater", {}),
callback = function()
require("barbecue.ui").update()
end,
})
-- -- diff view
-- local actions = require("diffview.actions")
--
-- require("diffview").setup({
-- })
--
-- Setup debugger
--
-- require("dapui").setup({
-- icons = { expanded = "▾", collapsed = "▸" },
-- mappings = {
-- -- Use a table to apply multiple mappings
-- expand = { "<CR>", "<2-LeftMouse>" },
-- open = "o",
-- remove = "d",
-- edit = "e",
-- repl = "r",
-- toggle = "t",
-- },
-- -- Expand lines larger than the window
-- -- Requires >= 0.7
-- expand_lines = vim.fn.has("nvim-0.7"),
-- -- Layouts define sections of the screen to place windows.
-- -- The position can be "left", "right", "top" or "bottom".
-- -- The size specifies the height/width depending on position.
-- -- Elements are the elements shown in the layout (in order).
-- -- Layouts are opened in order so that earlier layouts take priority in window sizing.
-- layouts = {
-- {
-- elements = {
-- -- Elements can be strings or table with id and size keys.
-- { id = "scopes", size = 0.25 },
-- "breakpoints",
-- "stacks",
-- "watches",
-- },
-- size = 40,
-- position = "left",
-- },
-- {
-- elements = {
-- "repl",
-- "console",
-- },
-- size = 10,
-- position = "bottom",
-- },
-- },
-- floating = {
-- max_height = nil, -- These can be integers or a float between 0 and 1.
-- max_width = nil, -- Floats will be treated as percentage of your screen.
-- border = "single", -- Border style. Can be "single", "double" or "rounded"
-- mappings = {
-- close = { "q", "<Esc>" },
-- },
-- },
-- windows = { indent = 1 },
-- render = {
-- max_type_length = nil, -- Can be integer or nil.
-- }
-- })
-- require("nvim-dap-virtual-text").setup()
--
-- vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
-- vim.fn.sign_define('DapBreakpointRejected', {text='🟦', texthl='', linehl='', numhl=''})
-- vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
--
-- vim.keymap.set('n', '<leader>dh', function() require"dap".toggle_breakpoint() end)
-- vim.keymap.set('n', '<leader>dH', ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
-- vim.keymap.set('n', '<A-k>', function() require"dap".step_out() end)
-- vim.keymap.set('n', "<A-l>", function() require"dap".step_into() end)
-- vim.keymap.set('n', '<A-j>', function() require"dap".step_over() end)
-- vim.keymap.set('n', '<A-h>', function() require"dap".continue() end)
-- vim.keymap.set('n', '<A-e>', function() require"dapui".eval() end)
-- vim.keymap.set('n', '<leader>dd', function() require("dapui").toggle() end)
-- vim.keymap.set('n', '<leader>dn', function() require"dap".run_to_cursor() end)
-- vim.keymap.set('n', '<leader>dc', function() require"dap".terminate() end)
-- vim.keymap.set('n', '<leader>dR', function() require"dap".clear_breakpoints() end)
-- vim.keymap.set('n', '<leader>de', function() require"dap".set_exception_breakpoints({"all"}) end)
-- vim.keymap.set('n', '<leader>da', function() require"debugHelper".attach() end)
-- vim.keymap.set('n', '<leader>dA', function() require"debugHelper".attachToRemote() end)
-- vim.keymap.set('n', '<leader>di', function() require"dap.ui.widgets".hover() end)
-- vim.keymap.set('n', '<leader>d?', function() local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes) end)
-- vim.keymap.set('n', '<leader>dk', ':lua require"dap".up()<CR>zz')
-- vim.keymap.set('n', '<leader>dj', ':lua require"dap".down()<CR>zz')
-- vim.keymap.set('n', '<leader>dr', ':lua require"dap".repl.toggle({}, "vsplit")<CR><C-w>l')
--
-- local dap = require("dap")
--
-- Setup Golang
--
-- vim.api.nvim_exec([[ autocmd BufWritePre *.go :silent! lua require('go.format').gofmt() ]], false)
-- vim.api.nvim_exec([[ autocmd BufWritePre *.go :silent! lua require('go.format').goimport() ]], false)
-- vim.api.nvim_exec([[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]], false)
-- require('go').setup({})
require"fidget".setup{}
-- require("output_panel").setup()
require('telescope').setup({})
-- require("nvim-lightbulb").setup({
-- autocmd = { enabled = true }
-- })
require("ibl").setup()
EOF
set nofoldenable
set hidden
function FoldBuf()
write
edit
TSBufEnable highlight
endfunction