-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_vim.vim
685 lines (623 loc) · 21.7 KB
/
init_vim.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
" language en_US
set nocompatible " disable compatibility to old-time vi
set showmatch " show matching
set ignorecase " case insensitive
set hlsearch " highlight search
set incsearch " incremental search
set guicursor+=n-v-c:blinkon1
set tabstop=2 " number of columns occupied by a tab
set termguicolors
augroup highlight_yank
autocmd!
au TextYankPost * silent! lua vim.highlight.on_yank({higroup="IncSearch", timeout=700})
augroup END
set softtabstop=2 " see multiple spaces as tabstops so <BS> does the right thing
set shiftwidth=2 " width for autoindents
set expandtab
set smartindent
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmenu
"set cc=180 " set an 80 column border for good coding style
filetype plugin indent on "allow auto-indenting depending on file type
syntax on " syntax highlighting
set mouse=a " enable mouse click
" set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
autocmd VimEnter * hi CursorLine guibg=#403939
set ttyfast " Speed up scrolling in Vim
set smarttab
"
" mappings
"
nmap <F5> :terminal ./run.py<Enter>
" Ctrl-j/k deletes blank line below/above, and Alt-j/k inserts.
nmap <silent><C-j> m`:silent +g/\m^\s*$/d<CR>``:noh<CR>
nmap <silent><C-k> m`:silent -g/\m^\s*$/d<CR>``:noh<CR>
nmap <silent><A-j> :set paste<CR>m`o<Esc>``:set nopaste<CR>
nmap <silent><A-k> :set paste<CR>m`O<Esc>``:set nopaste<CR>
call plug#begin()
Plug 'SmiteshP/nvim-navic'
Plug 'nvim-treesitter/nvim-treesitter-context'
Plug 'https://github.com/romainl/vim-qf.git'
Plug 'theHamsta/nvim-dap-virtual-text'
Plug 'https://github.com/folke/tokyonight.nvim.git'
Plug 'junegunn/fzf'
Plug 'https://github.com/RRethy/vim-illuminate.git'
Plug 'https://github.com/p00f/nvim-ts-rainbow.git'
Plug 'rmagatti/goto-preview'
Plug 'Yagua/nebulous.nvim'
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
Plug 'EdenEast/nightfox.nvim' " Vim-Plug
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'liuchengxu/vista.vim'
Plug 'mhinz/vim-startify'
Plug 'https://github.com/romgrk/barbar.nvim.git'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/cmp-nvim-lsp-signature-help'
" Use release branch (recommend)
Plug 'https://github.com/dstein64/nvim-scrollview.git'
Plug 'numToStr/FTerm.nvim'
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'https://github.com/airblade/vim-gitgutter.git'
Plug 'https://git.sr.ht/~whynothugo/lsp_lines.nvim'
Plug 'j-hui/fidget.nvim'
Plug 'https://github.com/neovim/nvim-lspconfig.git'
" Plug 'puremourning/vimspector'
Plug 'https://github.com/mfussenegger/nvim-dap.git'
Plug 'https://github.com/kshenoy/vim-signature.git'
Plug 'nvim-lualine/lualine.nvim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'sheerun/vim-polyglot'
Plug 'kyazdani42/nvim-tree.lua'
" Plug 'https://github.com/ctrlpvim/ctrlp.vim.git'
Plug 'tpope/vim-fugitive'
Plug 'ryanoasis/vim-devicons'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
" Plug 'https://github.com/jacquesbh/vim-showmarks.git'
" Plug 'https://github.com/adi/vim-indent-rainbow.git'
" Vim Script
Plug 'kyazdani42/nvim-web-devicons'
Plug 'folke/trouble.nvim'
" Plug 'ray-x/lsp_signature.nvim'
" For vsnip users.
Plug 'https://github.com/m-pilia/vim-ccls.git'
" For luasnip users.
" Plug 'L3MON4D3/LuaSnip'
" Plug 'saadparwaiz1/cmp_luasnip'
call plug#end()
lua << EOF
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
require"fidget".setup{}
EOF
let b:usemarks = 0
" hi FgCocErrorFloatBgCocFloating guifg=#2e7c1d
" hi FgCocWarningFloatBgCocFloating guifg=#00ff7f
colorscheme tokyonight
let g:codeschool_contrast_dark = "hard"
set cin "включим отступы в стиле Си
set backupcopy=yes
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
lua << EOF
require('telescope').setup{ defaults = { file_ignore_patterns = {"build", "cmake"} } }
EOF
" Vim Script
nnoremap <leader>xx <cmd>TroubleToggle<cr>
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
" List contents of all registers (that typically contain pasteable text).
nnoremap <silent> "" :registers "0123456789abcdefghijklmnopqrstuvwxyz*+.<CR>
if has('persistent_undo') "check if your vim version supports it
set undofile "turn on the feature
set undodir=$HOME/.vim/undo "directory where the undo files will be stored
endif
set completeopt=menu,menuone,noselect,preview
" autocmd Filetype cpp setlocal omnifunc=v:lua.vim.lsp.omnifunc
" lua << EOF
" require("lspconfig").ccls.setup {}
" EOF
lua <<EOF
-- Setup nvim-cmp.
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,
},
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' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
{ name = "nvim_lsp_signature_help" },
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
local on_attach = function(client, bufnr)
-- Mappings.
-- 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', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
require 'illuminate'.on_attach(client)
vim.api.nvim_set_keymap('n', '<a-n>', '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', {noremap=true})
vim.api.nvim_set_keymap('n', '<a-p>', '<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>', {noremap=true})
-- if client.server_capabilities.documentHighlightProvider then
-- vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true })
-- vim.api.nvim_clear_autocmds { buffer = bufnr, group = "lsp_document_highlight" }
-- vim.api.nvim_create_autocmd("CursorHold", {
-- callback = vim.lsp.buf.document_highlight,
-- buffer = bufnr,
-- group = "lsp_document_highlight",
-- desc = "Document Highlight",
-- })
-- vim.api.nvim_create_autocmd("CursorMoved", {
-- callback = vim.lsp.buf.clear_references,
-- buffer = bufnr,
-- group = "lsp_document_highlight",
-- desc = "Clear All the References",
-- })
-- end
require"nvim-navic".attach(client, bufnr)
end
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require('lspconfig').clangd.setup {
capabilities = capabilities,
on_attach = on_attach
}
require('lspconfig').pyright.setup {
capabilities = capabilities,
on_attach = on_attach
}
EOF
lua << EOF
local dap = require('dap')
dap.adapters.cppdbg = {
id = 'cppdbg',
type = 'executable',
command = '/home/alex/.local/cpptools/extension/debugAdapters/bin/OpenDebugAD7',
}
local dap = require('dap')
dap.configurations.cpp = {
{
name = "Launch file",
type = "cppdbg",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
setupCommands = {
{
text = '-enable-pretty-printing',
description = 'enable pretty printing',
ignoreFailures = false
},
},
}
}
-- If you want to use this for Rust and C, add something like this:
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
EOF
lua << EOF
local dap = require('dap')
local api = vim.api
local keymap_restore = {}
dap.listeners.after['event_initialized']['me'] = function()
for _, buf in pairs(api.nvim_list_bufs()) do
local keymaps = api.nvim_buf_get_keymap(buf, 'n')
for _, keymap in pairs(keymaps) do
if keymap.lhs == "K" then
table.insert(keymap_restore, keymap)
api.nvim_buf_del_keymap(buf, 'n', 'K')
end
end
end
api.nvim_set_keymap(
'n', 'K', '<Cmd>lua require("dap.ui.widgets").hover()<CR>', { silent = true })
end
dap.listeners.after['event_terminated']['me'] = function()
for _, keymap in pairs(keymap_restore) do
api.nvim_buf_set_keymap(
keymap.buffer,
keymap.mode,
keymap.lhs,
keymap.rhs,
{ silent = keymap.silent == 1 }
)
end
keymap_restore = {}
end
EOF
set makeprg=./run.py
lua << EOF
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>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', '<space>q', vim.diagnostic.setloclist, opts)
EOF
lua << EOF
require("lsp_lines").register_lsp_virtual_lines()
vim.diagnostic.config({
virtual_text = false,
})
EOF
nnoremap <silent> <leader>gc <cmd>lua vim.lsp.buf.incoming_calls()<CR>
nnoremap <silent> <leader>gC <cmd>lua vim.lsp.buf.outgoing_calls()<CR>
highlight clear SignColumn
lua << EOF
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = { "cpp", "c", "python"},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = {
enable = true
},
indent = {
enable = true
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gs",
node_incremental = "gsi",
scope_incremental = "gss",
node_decremental = "gsd",
},
},
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings
}
}
EOF
lua << EOF
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.
}
})
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.disconnect["dapui_config"] = function()
dapui.close()
end
EOF
lua << EOF
vim.opt.list = true
vim.opt.listchars:append("space:⋅")
require("indent_blankline").setup {
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
}
EOF
lua << EOF
require'FTerm'.setup({
border = 'double',
dimensions = {
height = 0.9,
width = 0.9,
},
})
vim.keymap.set('n', '<A-i>', '<CMD>lua require("FTerm").toggle()<CR>')
vim.keymap.set('t', '<A-i>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>')
EOF
lua vim.keymap.set('n', '<A-o>', '<CMD>ClangdSwitchSourceHeader<CR>')
" Move to previous/next
nnoremap <silent> <A-,> <Cmd>BufferPrevious<CR>
nnoremap <silent> <A-.> <Cmd>BufferNext<CR>
" Re-order to previous/next
nnoremap <silent> <A-<> <Cmd>BufferMovePrevious<CR>
nnoremap <silent> <A->> <Cmd>BufferMoveNext<CR>
" Goto buffer in position...
nnoremap <silent> <A-1> <Cmd>BufferGoto 1<CR>
nnoremap <silent> <A-2> <Cmd>BufferGoto 2<CR>
nnoremap <silent> <A-3> <Cmd>BufferGoto 3<CR>
nnoremap <silent> <A-4> <Cmd>BufferGoto 4<CR>
nnoremap <silent> <A-5> <Cmd>BufferGoto 5<CR>
nnoremap <silent> <A-6> <Cmd>BufferGoto 6<CR>
nnoremap <silent> <A-7> <Cmd>BufferGoto 7<CR>
nnoremap <silent> <A-8> <Cmd>BufferGoto 8<CR>
nnoremap <silent> <A-9> <Cmd>BufferGoto 9<CR>
nnoremap <silent> <A-0> <Cmd>BufferLast<CR>
" Pin/unpin buffer
nnoremap <silent> <leader><A-p> <Cmd>BufferPin<CR>
" Close buffer
nnoremap <silent> <A-c> <Cmd>BufferClose<CR>
" Wipeout buffer
" :BufferWipeout
" Close commands
" :BufferCloseAllButCurrent
" :BufferCloseAllButPinned
" :BufferCloseAllButCurrentOrPinned
" :BufferCloseBuffersLeft
" :BufferCloseBuffersRight
" Magic buffer-picking mode
nnoremap <silent> <A-g> <Cmd>BufferPick<CR>
" Sort automatically by...
nnoremap <silent> <Space>bb <Cmd>BufferOrderByBufferNumber<CR>
nnoremap <silent> <Space>bd <Cmd>BufferOrderByDirectory<CR>
nnoremap <silent> <Space>bl <Cmd>BufferOrderByLanguage<CR>
nnoremap <silent> <Space>bw <Cmd>BufferOrderByWindowNumber<CR>
" Other:
" :BarbarEnable - enables barbar (enabled by default)
" :BarbarDisable - very bad command, should never be used
"
nnoremap <silent> <leader>gd <Cmd>CclsDerivedHierarchy<CR>
" How each level is indented and what to prepend.
" This could make the display more compact or more spacious.
" e.g., more compact: ["▸ ", ""]
" Note: this option only works for the kind renderer, not the tree renderer.
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]
" Executive used when opening vista sidebar without specifying it.
" See all the avaliable executives via `:echo g:vista#executives`.
let g:vista_default_executive = 'nvim_lsp'
" To enable fzf's preview window set g:vista_fzf_preview.
" The elements of g:vista_fzf_preview will be passed as arguments to fzf#vim#with_preview()
" For example:
let g:vista_fzf_preview = ['right:50%']
" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind.
let g:vista#renderer#enable_icon = 1
" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
let g:vista#renderer#icons = {
\ "function": "\uf794",
\ "variable": "\uf71b",
\ }
" autocmd BufReadPre,FileReadPre *.cpp,*.h,*.hpp Vista
" autocmd BufReadPre,FileReadPre * if &buftype == "nofile" | wincmd p | endif
let g:startify_bookmarks = [ {'c': '~/.config/nvim/init.vim'}, '~/.zshrc' ]
lua <<EOF
require'nvim-treesitter.configs'.setup {
textobjects = {
lsp_interop = {
enable = true,
border = 'none',
peek_definition_code = {
["<leader>df"] = "@function.outer",
["<leader>dF"] = "@class.outer",
},
},
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
},
}
EOF
" lua << EOF
" --Put this lines inside your vimrc to set the colorscheme
" require("nebulous").setup {
" variant = "midnight",
" disable = {
" background = true,
" endOfBuffer = false,
" terminal_colors = false,
" },
" italic = {
" comments = false,
" keywords = true,
" functions = false,
" variables = true,
" },
" custom_colors = { -- this table can hold any group of colors with their respective values
" LineNr = { fg = "#5BBBDA", bg = "NONE", style = "NONE" },
" CursorLineNr = { fg = "#E1CD6C", bg = "NONE", style = "NONE" },
" -- it is possible to specify only the element to be changed
" TelescopePreviewBorder = { fg = "#A13413" },
" LspDiagnosticsDefaultError = { bg = "#E11313" },
" TSTagDelimiter = { style = "bold,italic" },
" }
" }
" EOF
lua << EOF
require('goto-preview').setup {
default_mappings = true
}
EOF
lua << END
require('lualine').setup({
sections = {
lualine_c = {
{ require"nvim-navic".get_location, cond = require"nvim-navic".is_available },
}
}
})
END
lua << EOF
require("nvim-tree").setup()
EOF
nmap <A-t> :NvimTreeToggle<CR>
lua << EOF
require("nvim-dap-virtual-text").setup()
EOF
nmap <leader>b :lua require'dap'.toggle_breakpoint()<CR>
nmap <leader>c :lua require'dap'.continue()<CR>
nmap <leader>n :lua require'dap'.step_over()<CR>
nmap <leader>s :lua require'dap'.step_into()<CR>
nmap <leader>t :DapTerminate<CR>
nmap <Home> <Plug>(qf_qf_previous)
nmap <End> <Plug>(qf_qf_next)
nmap <F6> <Plug>(qf_qf_toggle)