-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·741 lines (662 loc) · 21.4 KB
/
.vimrc
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
" START plug ----------------------------
call plug#begin('~/.vim/plugged')
" " syntaxes
Plug 'kchmck/vim-coffee-script'
Plug 'pangloss/vim-javascript'
Plug 'jelera/vim-javascript-syntax'
Plug 'mxw/vim-jsx'
Plug 'cakebaker/scss-syntax.vim'
Plug 'vim-ruby/vim-ruby'
Plug 'mustache/vim-mustache-handlebars'
Plug 'othree/javascript-libraries-syntax.vim'
Plug 'briancollins/vim-jst'
Plug 'tmux-plugins/vim-tmux'
Plug 'chrisbra/csv.vim'
Plug 'elixir-editors/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'slim-template/vim-slim'
Plug 'fatih/vim-go'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
Plug 'jparise/vim-graphql'
" Plug 'posva/vim-vue'
Plug 'martinda/Jenkinsfile-vim-syntax'
Plug 'cappyzawa/starlark.vim'
Plug 'carvel-dev/ytt.vim'
Plug 'https://github.com/apple/pkl-neovim.git'
" " colorschemes
Plug 'shaunsingh/solarized.nvim'
Plug 'jtmkrueger/grb256'
Plug 'dracula/vim'
" Plug 'catppuccin/nvim', { 'as': 'catppuccin' }
" " tools
Plug 'dense-analysis/ale'
Plug 'ojroques/vim-oscyank', {'branch': 'main'}
Plug 'mattn/emmet-vim'
Plug 'jszakmeister/vim-togglecursor'
Plug 'Raimondi/delimitMate'
Plug 'elzr/vim-json'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'itchyny/vim-cursorword'
Plug 'levouh/tint.nvim'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'sotte/presenting.nvim'
Plug 'sbdchd/neoformat'
Plug 'zbirenbaum/copilot.lua'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-pack/nvim-spectre'
Plug 'CopilotC-Nvim/CopilotChat.nvim', { 'branch': 'canary' }
Plug 'MunifTanjim/nui.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-lualine/lualine.nvim'
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
Plug 'lewis6991/gitsigns.nvim'
Plug 'NeogitOrg/neogit'
Plug 'sindrets/diffview.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'zbirenbaum/copilot-cmp'
Plug 'onsails/lspkind.nvim'
" all that tpope!
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-endwise'
call plug#end()
" END plug ------------------------
filetype plugin on
syntax enable
set guifont=mononoki-Regular\ Nerd\ Font\ Complete:h11
set guioptions-=e
set ttyfast
" set lazyredraw
if system('echo $TERM_PROGRAM') =~ 'iTerm.app'
" iTerm has a special variable that tells us if it's in dark mode
if system('defaults read -g AppleInterfaceStyle') =~ 'Dark'
set background=dark
else
set background=light
endif
else
" For other terminals, we'll just default to dark mode
set background=dark
endif
colorscheme solarized
set pumblend=10
" highlight Normal ctermbg=NONE guibg=NONE
highlight Comment cterm=italic gui=italic
" tab styles
set showtabline=2 " always show tabs
set t_ZH=[3m
set t_ZR=[23m
set encoding=UTF-8
set fileencoding=utf-8
" set t_Co=256
set magic "for regular epressions turn magic on
set noerrorbells " no errorbells!
set vb t_vb= " seriously, no errorbells!!
set tabstop=2 softtabstop=2 shiftwidth=2
set expandtab " use spaces instead of tab characters
autocmd FileType go setlocal tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab
autocmd FileType mod setlocal tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab
set smarttab " start tabbed in
set backspace=start,eol,indent " always allow backspaces
set wildmenu " trick out command mode
set incsearch " highlight search pattern as it's typed
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set wrap " textwrap
" set to no show for speed
hi NonText cterm=NONE ctermfg=NONE
set linebreak " wrap lines at spaces
set wrapmargin=0 " wrap at last column
set autoindent
set autoread " automatically reads file in
set cmdheight=1
set smartindent
set textwidth=0 " disable auto line breaking on paste
set number " line numbers
" set laststatus=0 " no status line
" hi StatusLine ctermfg=gray ctermbg=16 gui=none term=none cterm=none
" hi StatusLineNC ctermfg=darkgray ctermbg=16 gui=none term=none cterm=none
" set statusline=%f
" just save when I change tabs or leave the vim
" set autowriteall
" autocmd TextChanged,TextChangedI,FocusLost,InsertLeave *
" \ if &buftype ==# '' || &buftype == 'acwrite' |
" \ update |
" \ endif
set scrolloff=5 " 5 line buffer below cursor when scrolling
set hlsearch " highlight search results
set cursorline " highlight line cursor is on
" set cursorcolumn " highlight the cursors current col
highlight link CursorColumn CursorLine " have them always be the same color
set clipboard=unnamed " copy to system register
set mouse=a " turn on all mouse functionality
set timeoutlen=300 " Time to wait after ESC (default causes an annoying delay)
set list
set listchars=tab:⬝➜
set conceallevel=0
set completeopt=menu,menuone,noselect,noinsert
" Normally, Vim messes with iskeyword when you open a shell file. This can
" leak out, polluting other file types even after a 'set ft=' change. This
" variable prevents the iskeyword change so it can't hurt anyone.
let g:sh_noisk=1
" " Resize splits when the window is resized
au VimResized * :wincmd =
" Store swap files in a central spot
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set nobackup
set nowritebackup
set shortmess+=c
" you can undo even when you close a buffer/VIM
try
set undodir=~/.vim_runtime/temp_dirs/undodir
set undofile
catch
endtry
" additional filetype detection
autocmd BufRead,BufNewFile *.axlsx set filetype=ruby
autocmd BufRead,BufNewFile *.inky set filetype=slim
" map leader to space
let mapleader = "\<Space>"
" neovim needs to be like vim
nnoremap Y Y
" leader mappings
nnoremap <leader>v :vs<space>
nnoremap <leader>s :sp<space>
nnoremap <leader>t :tabe<space>
" buffer navigation
nnoremap <leader>n :bnext<CR>
nnoremap <leader>b :bprevious<CR>
" open github copilot chat
nnoremap <leader>c :CopilotChatOpen<CR>
" Open new splits to the right/bottom
set splitright splitbelow
" I want my custom commands!
imap <C-t> <%= %><Left><Left><Left>
" up/down on wrapped lines
nnoremap j gj
nnoremap k gk
" Reselect visual block after indent
vnoremap < <gv
vnoremap > >gv
" make . work in visual mode
:vnoremap . :norm.<cr>
" clear search highlights with enter
nnoremap <CR> :nohlsearch<CR>/<BS>
" make resizing windows a bit easier
noremap <left> <C-w>>
noremap <right> <C-w><
noremap <up> <C-w>-
noremap <down> <C-w>+
" Keep search matches in the middle of the window.
nnoremap n nzzzv
nnoremap N Nzzzv
" Easier to type, and I never use the default behavior.
noremap H ^
noremap L $
vnoremap L g_
noremap <TAB> % " easer to hit
" neoformat
let g:neoformat_try_node_exe = 1
" prettier on save
autocmd BufWritePre *.js,*.css,*.vue Neoformat
" telescope
nnoremap <c-f> <cmd>Telescope find_files<cr>
nnoremap <c-a> <cmd>Telescope live_grep<cr>
" togglecursor
let g:togglecursor_force = 'xterm'
let g:togglecursor_default = 'blinking_block'
" vim-json
let g:vim_json_syntax_conceal = 0
" emmet expansions
let g:user_emmet_leader_key = '<c-e>'
" indentline
" let g:indentLine_setColors=1
" let g:indentLine_char = '│'
" let g:indentLine_concealcursor='nc'
" conditionally run EnableYtt if file type is yaml without attaching to paste buffer
autocmd FileType yaml EnableYtt
" Enable true color
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" vim ale
let g:ale_linters = {
\ 'ruby': ['reek', 'brakeman', 'rails_best_practices']
\}
" only lint ruby files
" turn off autocomplete for ale
let g:ale_completion_enabled = 0
" if (!has('nvim') && !has('clipboard_working'))
" In the event that the clipboard isn't working, it's quite likely that
" the + and * registers will not be distinct from the unnamed register. In
" this case, a:event.regname will always be '' (empty string). However, it
" can be the case that `has('clipboard_working')` is false, yet `+` is
" still distinct, so we want to check them all.
let s:VimOSCYankPostRegisters = ['', '+', '*']
function! s:VimOSCYankPostCallback(event)
if a:event.operator == 'y' && index(s:VimOSCYankPostRegisters, a:event.regname) != -1
call OSCYankRegister(a:event.regname)
endif
endfunction
augroup VimOSCYankPost
autocmd!
autocmd TextYankPost * call s:VimOSCYankPostCallback(v:event)
augroup END
" endif
lua << END
-- lsp custom diagnostics symbols
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
require('lualine').setup{
theme = "solarized",
sections = {
lualine_a = {
{
function()
local mode_map = {
['n'] = '',
['i'] = '',
['v'] = '',
['V'] = ' ',
[''] = ' ',
['c'] = '',
['s'] = '',
['S'] = ' ',
[''] = ' ',
['r'] = '',
['R'] = ' ',
['!'] = '',
['t'] = ''
}
local mode = vim.api.nvim_get_mode().mode
if mode_map[mode] == nil then return '?' end
return mode_map[mode]
end,
icon = nil,
},
},
lualine_b = {
{'filename', path = 1},
},
lualine_c = { 'diff' },
lualine_x = {'filetype'},
lualine_y = {{
'diagnostics',
sources = { 'nvim_lsp' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
always_visible = false,
}},
},
inactive_sections = {
lualine_c = {{'filename', path = 1}, { 'diff', colored = false}},
lualine_x = {'location'},
},
}
require("bufferline").setup{
highlights = {
fill = {
fg = '#dce0e8',
bg = '#dce0e8',
},
},
options = {
mode = "tabs",
diagnostics = "nvim_lsp",
indicator = {
style = "underline"
},
numbers = "none",
show_buffer_close_icons = false,
show_close_icon = false,
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and " "
or (e == "warning" and " " or "" )
s = s .. n .. sym
end
return s
end
}
}
require'nvim-treesitter.configs'.setup {
ensure_installed = "all",
}
require('gitsigns').setup {
current_line_blame = true,
}
local telescope = require("telescope")
local telescopeConfig = require("telescope.config")
-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
require('telescope').setup{
defaults = {
wrap_results = true,
vimgrep_arguments = vimgrep_arguments,
},
pickers = {
find_files = {
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
extensions = {
}
}
_timers = {}
local function setup_diagnostics(client, buffer)
if require("vim.lsp.diagnostic")._enable then
return
end
local diagnostic_handler = function()
local params = vim.lsp.util.make_text_document_params(buffer)
client.request("textDocument/diagnostic", { textDocument = params }, function(err, result)
if err then
local err_msg = string.format("diagnostics error - %s", vim.inspect(err))
vim.lsp.log.error(err_msg)
end
local diagnostic_items = {}
if result then
diagnostic_items = result.items
end
vim.lsp.diagnostic.on_publish_diagnostics(
nil,
vim.tbl_extend("keep", params, { diagnostics = diagnostic_items }),
{ client_id = client.id }
)
end)
end
diagnostic_handler() -- to request diagnostics on buffer when first attaching
vim.api.nvim_buf_attach(buffer, false, {
on_lines = function()
if _timers[buffer] then
vim.fn.timer_stop(_timers[buffer])
end
_timers[buffer] = vim.fn.timer_start(200, diagnostic_handler)
end,
on_detach = function()
if _timers[buffer] then
vim.fn.timer_stop(_timers[buffer])
end
end,
})
end
local hasConfigs, configs = pcall(require, "nvim-treesitter.configs")
if hasConfigs then
configs.setup {
ensure_installed = "pkl",
highlight = {
enable = true, -- false will disable the whole extension
},
indent = {
enable = true
}
}
end
vim.api.nvim_create_user_command('NN', function()
local timestamp = os.date('%Y%m%d-%H%M%S')
local bufferDir = vim.fn.expand('%:p:h')
local filename = vim.fn.input('Enter file name: ', timestamp .. '-')
local fullPath = bufferDir .. '/' .. filename .. '.md'
vim.api.nvim_command('edit ' .. fullPath)
end, {})
require("copilot").setup({
suggestion = {
auto_trigger = true,
keymap = {
accept = "<C-j>",
},
}
})
require("CopilotChat").setup {
debug = true, -- Enable debugging
show_help = false,
}
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
completion = {
completeopt = table.concat(vim.opt.completeopt:get(), ","),
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping.select_next_item({behavior=cmp.SelectBehavior.Insert}),
["<S-Tab>"] = cmp.mapping.select_prev_item({behavior=cmp.SelectBehavior.Insert}),
}),
formatting = {
format = function(entry, vim_item)
if vim.tbl_contains({ 'path' }, entry.source.name) then
local icon, hl_group = require('nvim-web-devicons').get_icon(entry:get_completion_item().label)
if icon then
vim_item.kind = icon
vim_item.kind_hl_group = hl_group
return vim_item
end
end
return require('lspkind').cmp_format({ with_text = false })(entry, vim_item)
end
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
}, {
{ name = 'buffer' },
})
})
-- Set up lspconfig. --------------------------------
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require('lspconfig')
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
local root_pattern = lspconfig.util.root_pattern('.git')
local function add_ruby_deps_command(client, bufnr)
vim.api.nvim_buf_create_user_command(bufnr, "ShowRubyDeps", function(opts)
local params = vim.lsp.util.make_text_document_params()
local showAll = opts.args == "all"
client.request("rubyLsp/workspace/dependencies", params, function(error, result)
if error then
print("Error showing deps: " .. error)
return
end
local qf_list = {}
for _, item in ipairs(result) do
if showAll or item.dependency then
table.insert(qf_list, {
text = string.format("%s (%s) - %s", item.name, item.version, item.dependency),
filename = item.path
})
end
end
vim.fn.setqflist(qf_list)
vim.cmd('copen')
end, bufnr)
end,
{nargs = "?", complete = function() return {"all"} end})
end
lspconfig.ruby_lsp.setup({
cmd = (function()
vim.lsp.log.warn("ruby_lsp setup----------------------------------------------")
local bufname = vim.api.nvim_buf_get_name(0)
-- Turned into a filename
local filename = lspconfig.util.path.is_absolute(bufname) and bufname or lspconfig.util.path.join(vim.loop.cwd(), bufname)
-- Then the directory of the project
local project_dirname = root_pattern(filename) or lspconfig.util.path.dirname(filename)
vim.lsp.log.warn('project_dirname: ' .. project_dirname)
local last_directory = vim.fn.fnamemodify(project_dirname, ':t')
vim.lsp.log.warn('last_directory: ' .. last_directory)
-- If the basename is in the list of afdc projects, prefix with afdc- and suffix with -1
local container_name = ''
if vim.tbl_contains({ 'sponge', 'stations', 'vehicles' }, last_directory) then
vim.lsp.log.warn(last_directory)
container_name = 'afdc-' .. last_directory .. '-1'
end
-- If the basename is epact, return epact-web-1
if vim.tbl_contains({ 'epact' }, last_directory) then
vim.lsp.log.warn('epact')
container_name = 'epact-web-1'
end
vim.lsp.log.warn('container_name: ' .. container_name)
if container_name == '' or container_name == 'epact-web-1' then
-- there's no container for this so start from current location
return {
'ruby-lsp',
'stdio'
}
else
return {
'ruby-lsp',
'stdio'
}
-- return {
-- 'docker',
-- 'exec',
-- '-i',
-- container_name,
-- 'ruby-lsp',
-- 'stdio'
-- }
end
end)(),
on_attach = function(client, buffer)
add_ruby_deps_command(client, buffer)
end,
-- I don't think this does what I want it to do.
-- I haven't found a way to get rewrite these paths, and I don't think it's possible.
before_init = function(initialize_params, config)
initialize_params.rootUri = initialize_params.rootUri:gsub('/app', '/Users/jkrueger/Code')
end,
})
-- lspconfig.solargraph.setup {
-- cmd = {
-- 'docker',
-- 'exec',
-- 'afdc-sponge-1',
-- 'solargraph',
-- 'stdio'
-- },
-- flags = {
-- allow_incremental_sync = true,
-- },
-- }
lspconfig.standardrb.setup {
flags = {
allow_incremental_sync = true,
debounce_text_changes = 150,
},
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = true,
}
),
},
}
lspconfig.tsserver.setup {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
languages = { 'vue' },
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
lspconfig.volar.setup {}
-- END lspconfig --------------------------------
-- alias gd to find definition of word under cursor in normal mode
function PeekDefinition()
local params = vim.lsp.util.make_position_params()
vim.lsp.buf_request(0, 'textDocument/definition', params, function(err, result)
if err or not result then return end
if vim.tbl_isempty(result) then print("No definition found") return end
local target = result[1]
if target == nil then return end
local filename = target.uri and vim.fn.fnamemodify(vim.uri_to_fname(target.uri), ":p:.") or ""
local opts = {
border = "single",
title = filename,
focusable = true,
focus = true,
}
local preview_win_id = vim.lsp.util.preview_location(target, opts)
vim.schedule(function()
local win_ids = vim.api.nvim_list_wins()
local preview_win_id = win_ids[#win_ids]
vim.api.nvim_set_current_win(preview_win_id)
end)
end)
end
vim.api.nvim_set_keymap('n', 'gp', '<cmd>lua PeekDefinition()<CR>', {noremap = true, silent = true})
local function on_list(options)
vim.fn.setqflist({}, ' ', options)
vim.cmd.cfirst()
end
vim.api.nvim_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition({ on_list = on_list })<CR>', {noremap = true, silent = true})
-- indentation
require("ibl").setup({
indent = { char = "│" },
})
-- neogit
local neogit = require('neogit')
neogit.setup {}
vim.api.nvim_set_keymap('n', '<C-d>', ':DiffviewOpen', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<C-g>', ':Neogit<CR>', {noremap = true, silent = true})
-- colorscheme
-- require("catppuccin").setup({
-- transparent_background = true,
-- dim_inactive = {
-- enabled = true,
-- shade = "dark",
-- percentage = 0.25,
-- },
-- integrations = {
-- native_lsp = {
-- enabled = true,
-- virtual_text = {
-- errors = { "italic" },
-- hints = { "italic" },
-- warnings = { "italic" },
-- information = { "italic" },
-- },
-- underlines = {
-- errors = { "undercurl" },
-- hints = { "undercurl" },
-- warnings = { "undercurl" },
-- information = { "undercurl" },
-- },
-- },
-- },
-- })
-- vim.cmd.colorscheme "solarized"
vim.keymap.set('n', '<leader>S', '<cmd>lua require("spectre").toggle()<CR>', {desc = "Toggle Spectre"})
END