-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
1867 lines (1795 loc) · 56 KB
/
init.lua
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
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- 2023.02.12 Lazy로 패키지 매니저를 바꾸고, dap설치
-- 2023.02.07 lionhairdino at gmail.com
-- 자동 완성 엔진을 Coq에서 nvim-cmp로 바꿨다.
--
-- 2022.10.31
--
-- Haskell Language Server + LSP Native + Coq
--
-- ※ Coq은 증명 언어를 얘기하는 게 아니라, 자동 완성 플러그인 이름이다.
-- Native가 아닌 Coc으로 설정할 때는 자동 완성이 따로 필요없지만,
-- Native로 할 때는 필요하다.
--
-- 2023.2.4
-- Coq에 알 수 없는 오류가 있어, mini.completion 쓸까도 했는데, 다른 많은 플러그인들이
-- 디폴트로 nvim-cmp 설정을 언급한다. 지금은 자동 완성 엔진으로 nvim-cmp를 쓴다.
--
-- :Hoogle 후글 검색
--
--vim.loader.enable()
local set = vim.opt
set.mouse = "ar"
set.number = true
set.ignorecase = true
set.smartcase = true
set.hlsearch = true
set.wrap = true
set.breakindent = true
set.tabstop = 2
set.shiftwidth = 2
set.expandtab = true
set.autoindent = true
set.smartindent = true
set.softtabstop = 2
set.hidden = true
--set.nocompatible = true -- nvim은 이 옵션은 무시한다.
set.splitbelow = true
set.splitright = true
set.clipboard = 'unnamedplus'
set.undodir = vim.fn.stdpath('cache') .. '/undodir/'
set.undofile = true
set.conceallevel = 2
-- v0.9로 올리고 나서 아래 프린터 설정은 모두 없는 것으로 나온다.
--set.printencoding = 'utf8'
--set.printmbcharset = 'ISO10646'
--set.printmbfont = 'r:D0CodingLigature,c:yes,a:yes'
--#set.printfont = 'D2CodingLigature:h10'
--set.printdevice = 'FUJI_XEROX_DocuPrint_CP225_228_w_'
--set.printdevice = 'HP-LaserJet-1200'
--set.timeoutlen = 300
set.termguicolors = true
--set.updatetime = 1200 -- nvim_create_autocmd에서 사용
------ Nvim-tree
-- 기본 탐색기 끄기
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- 디폴트 filetype.vim을 안쓰기
-- neovim 0.6이전만 아래를 추가하란다.
-- vim.g.did_load_filetypes = 1
vim.g['oceanic_next_terminal_bold'] = 1
vim.g['oceanic_next_terminal_italic'] = 1
vim.g['neoterm_size'] = 10
vim.g['neoterm_autoinsert'] = 1
vim.g['fzf_preview_window'] = { 'hidden,right,50%,<70(up,40%)', 'ctrl-/' }
-- [Buffers] 이미 윈도우가 존재하면, 그리로 점프한다.
vim.g['fzf_buffers_jump'] = 1
-- [[B]Commits] 'git log'가 쓰는 옵션 커스터마이징
vim.g['fzf_commits_log_options'] = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
-- [Tags] 태그 파일 생성 명령어
vim.g['fzf_tags_command'] = 'ctags -R'
-- [Commands] --expect expression for directly executing the command
vim.g['fzf_commands_expect'] = 'ctrl-enter,ctrl-x'
vim.g['mkdp_theme'] = 'light' -- markdown preview 플러그인 테마 설정
vim.g['mkdp_filetypes'] = { "markdown" }
-- 편집할 때 마크다운 태그를 일부 적용해서 보여준다.
-- **Bold** 는 **없이 Bold체로 보여준다.
-- :set conceallevel=2 와 같다.
vim.g['vim_markdown_conceal'] = 2
vim.g['vim_markdown_folding_disabled'] = 1
vim.g['vim_markdown_toc_autofit'] = 1
vim.g['vim_markdown_no_default_key_mappings'] = 1 -- 디폴트 키매핑 사용안함
--vim.cmd.colorscheme('OceanicNext')
--vim.g.material_style = "oceanic-next"
-- 터미널에 포커스가 가면 자동으로 입력모드
-- vim.api.nvim_create_autocmd(
-- { "BufWinEnter", "WinEnter" },
-- { pattern = "term://*",
-- command = "startinsert" }
-- )
-- vim.g['nvimhsPluginStarter']='nvimhs#stack#pluginistarter()' 디폴트 값이 이거다. 불필요
vim.diagnostic.config({ virtual_text = true })
-- 점프키와 충돌
vim.keymap.set({ 'n' }, '<Tab>', ':bn<CR>', { silent = true })
vim.keymap.set({ 'n' }, '<S-Tab>', ':bp<CR>', { silent = true })
vim.keymap.set({ 'n' }, 'k', 'gk', { silent = true })
vim.keymap.set({ 'n' }, 'j', 'gj', { silent = true })
-- Shift-BS는 작동하지 않고 있다. 이유는 아직 모른다.
-- GUI에서만 지정 가능한 키조합이라 한다.
--
--vim.keymap.set({ 'i' }, '<c-h>', '<Left>', { silent = true })
vim.keymap.set({ 'i' }, '<c-h>', '<bs>', { silent = true })
--vim.keymap.set({ 'i' }, '<c-j>', '<Down>', { silent = true })
vim.keymap.set({ 'i' }, '<c-k>', '<Up>', { silent = true })
vim.keymap.set({ 'i' }, '<c-l>', '<Right>', { silent = true })
vim.keymap.set({ 'i' }, '<c-j>', '<c-o>A<cr>', { silent = true })
--vim.keymap.set({ 'i' }, '<Shift-BS>', '<kDel>', { silent = true })
vim.keymap.set({ 'i', 'n', 'v' }, '<C-\\>', ':ToggleTerm<CR>', { silent = true })
vim.keymap.set('n', '<F3>', ':Neogit kind=split<CR>', { desc = 'Git' })
-- 윈도우 크기 조절
vim.keymap.set('n', '=', ':resize +5<CR>', { desc = 'incresing height', silent = true })
vim.keymap.set('n', '-', ':resize -5<CR>', { desc = 'incresing height', silent = true })
vim.keymap.set('n', '+', ':vertical resize +5<CR>', { desc = 'incresing width', silent = true })
vim.keymap.set('n', '_', ':vertical resize -5<CR>', { desc = 'incresing width', silent = true })
vim.keymap.set({ 'n', 'v' }, 'S', ':lua surround_with_text()<CR>', { desc = 'surround with text', silent = false })
vim.keymap.set({ 'v' }, '<c-j>', ':lua send_to_terminal()<CR>', { desc = 'send to terminal', silent = true })
vim.keymap.set({ 'i', 'n', 'v' }, '<Insert>',
'<Cmd>lua if vim.opt.background:get() == "dark" then vim.opt.background = "light" else vim.opt.background = "dark" end<CR>',
{ silent = false })
-- Yank하면 잠시 색깔 바꾸기
vim.api.nvim_exec([[
augroup VisualModeHighlight
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank({ timeout = 1000 })
augroup END
]], false)
vim.api.nvim_exec([[
augroup HoogleMaps
autocmd!
autocmd FileType haskell setlocal keywordprg=:Hoogle
augroup END
]], false)
vim.g['hoogle_fzf_window'] = { down = '50%' }
-- lua 파일일 경우 `k`단축키로 헬프 찾도록
vim.api.nvim_exec([[
augroup SetKeywordprgForLua
autocmd!
autocmd BufRead,BufNewFile *.lua setlocal keywordprg=:help
augroup END
]], false)
-- 터미널에 떠있는 ghci에게 멀티라인 코드 보내기
function send_to_terminal()
local term_win_id = vim.fn.bufwinid('#toggleterm#')
if term_win_id == -1 then
vim.fn.execute("ToggleTerm")
term_win_id = vim.fn.bufwinid('#toggleterm#')
vim.fn.execute("TermExec cmd=\"ghci\"")
end
vim.fn.execute("TermExec cmd=\":\\{\"")
--vim.fn.execute("'<,'>ToggleTermSendVisualSelection")
require("toggleterm").send_lines_to_terminal("visual_lines", false, { args = vim.v.count })
vim.fn.execute("TermExec cmd=\":\\}\"")
vim.api.nvim_set_current_win(term_win_id)
vim.fn.execute("normal! i")
end
function surround_with_text()
local t = vim.fn.input("wrap> ")
vim.fn.execute("normal! `>a<CR>" .. t)
vim.fn.execute("normal! `<i" .. t .. "<CR>")
end
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
function Gmarks()
local extmarks = vim.api.nvim_buf_get_extmarks(0, -1, 0, -1, { details = true })
-- 결과 출력
for _, extmark in ipairs(extmarks) do
vim.print(extmark)
end
end
--
--vim.g.mapleader = " " -- make sure to set `mapleader` before lazy so your mappings are correct
--<Leader> 키를 지정하는 것 같다.
local function lsp_on_attach_keysetup(_, bufnr)
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
local bufopts = { noremap = true, silent = false, buffer = bufnr }
--vim.keymap.set('n', 'K', ':lua vim.lsp.buf.hover()<CR>', bufopts)
-- 정의부가 이미 스플릿된 다른창에 있는 소스에 있으면, 현재 창에서 정의부로 점프하지 않고,
-- 열려 있는 창으로 포커싱이 이동되게 하려면 reuse 옵션을 쓴다.
-- 그런데, 문제는 돌아 올때다. 스플릿된 다른 창으로 갔다가 c-o를 누르면 원래 창으로
-- 돌아오지 못하고, 그 창에 버퍼를 바꿔버린다.
--vim.keymap.set('n', '<C-]>', ':lua vim.lsp.buf.definition{ reuse_win = true } <CR>', bufopts)
vim.keymap.set('n', '<C-]>', ':lua vim.lsp.buf.definition()<CR>', bufopts)
vim.keymap.set('n', 'gA', ':lua vim.lsp.buf.code_action()<CR>', bufopts)
vim.keymap.set('n', 'gh', ':lua vim.lsp.buf.hover()<CR>', bufopts)
vim.keymap.set('n', 'gd', ':lua vim.lsp.buf.definition()<CR>', bufopts)
vim.keymap.set('n', 'gD', ':lua vim.lsp.buf.type_definition()<CR>', bufopts)
vim.keymap.set('n', 'gw', ':lua vim.lsp.buf.workspace_symbol()<CR>', bufopts)
vim.keymap.set('n', 'go', ':lua vim.diagnostic.open_float()<CR>', bufopts)
vim.keymap.set('n', 'g[', ':lua vim.lsp.diagnostic.goto_prev()<CR>', bufopts)
vim.keymap.set('n', 'g]', ':lua vim.lsp.diagnostic.goto_next()<CR>', bufopts)
vim.keymap.set('n', 'gl', ':lua vim.diagnostic.setloclist()<CR>', bufopts)
vim.keymap.set('n', 'gr', ':lua vim.lsp.buf.references()<CR>', bufopts)
vim.keymap.set('n', 'gO', ':lua vim.lsp.buf.format{ async=true }<CR>', bufopts)
vim.keymap.set('n', 'gR', ':lua vim.lsp.buf.rename()<CR>', bufopts)
vim.keymap.set('n', 'gs', ':lua vim.lsp.codelens.refresh()<CR>', bufopts)
vim.keymap.set('n', 'ge', ':lua vim.lsp.codelens.run()<CR>', bufopts)
end
local function lsp_on_attach(client, bufnr)
lsp_on_attach_keysetup(client, bufnr);
-- 매핑이 제대로 동작하는지 nvim 안에서 :map gd 등을 입력해서 알 수 있다.
vim.opt_local.signcolumn = 'yes' -- 줄번호 왼쪽에 컬럼 하나를 둬서 W,H등을 표시하는 걸 말한다.
-- vim.api.nvim_create_autocmd(
-- { "BufEnter", "InsertLeave" },
-- { pattern = { "*" },
-- callback = function()
-- vim.lsp.codelens.refresh()
-- end
-- }
-- )
-- require "lsp_signature".on_attach({ -- signatureHelp 관련,
-- bind = true,
-- handler_opts = {
-- border = "rounded"
-- }
-- }, bufnr)
set.tagfunc = 'lua vim.lsp.tagfunc()'
-- 커서가 5초동안 가만히 있으면, 해당 키워드의 정보를 띄우려고 했는데,
-- 에러 창을 띄워 보고 있다가, 정보창이 뜨면 에러창이 사라진다.
-- CursorHold 이벤트는 주기적으로 계속 fire된다.
-- 일단 사용 보류
-- vim.api.nvim_create_autocmd(
-- { "CursorHold" },
-- { pattern = "*",
-- callback = vim.lsp.buf.hover,
-- --once = true,
-- }
-- )
end
local function Config_mason()
require 'mason'.setup({
ui = {
icons = {
package_installed = "✓",
package_pending = "➜",
package_uninstalled = "✗"
},
border = "single"
}
})
require("mason-lspconfig").setup {
ensure_installed = {},
exclude = { "hls" },
}
require("mason-lspconfig").setup_handlers {
-- 키 없이 첫 번째로 정의한 함수는, 지정 핸들러가 없을 경우 쓰이는
-- 디폴트 핸들러이다.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup { on_attach = lsp_on_attach }
end,
-- ["hls"] = function()
-- require 'lspconfig'.hls.setup({
-- --cmd = { "haskell-language-server-wrapper", "--lsp", "--debug" },
-- cmd = { "haskell-language-server-wrapper", "--lsp" },
-- filetypes = { "haskell", "lhaskell", "cabal" },
-- codeLens = { enabale = true },
-- on_attach = lsp_on_attach,
-- -- capabilities = lsp_capabilities,
-- settings = {
-- haskell = {
-- hlintOn = true,
-- formattingProvider = "stylish-haskell",
-- }
-- }
-- })
-- end,
--
["lua_ls"] = function()
-- sumneko_lua가 deprecated 인데,mason은 아직 반영 전이다.
-- 그래서 키는 그대로 sumneko_lua로 두고 setup은 lua_ls로 했다.
require 'lspconfig'.lua_ls.setup({
on_attach = lsp_on_attach,
settings = {
Lua = {
runtime = {
version = 'LuaJIT'
},
diagnostics = {
globals = { "vim" },
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
telemetry = {
enable = false,
},
completion = {
callSnippet = "Replace"
},
},
},
})
end,
}
end
-- :%는 1,$ 즉 전체 파일을 의미한다.
-- :h는 파일 이름에서 head부분을 의미한다.
--
vim.keymap.set({ 'n', 'i', 'v' }, '<F2>', ':cd %:h<CR>', { desc = 'Change Current Directory' })
-- 아래처럼 메뉴를 지정해도 된다.
--vim.keymap.set('n', '<Space>o',
-- function() require 'key-menu'.open_window('<leader>o') end, {desc='Orgmode'})
-- 이게 디폴트 설정인데, mark 관련 플러그인이 가져가나 보다.
-- <C-h>를 BS로 쓰려면 아래로 설정해야 한다.
-- Coq이 로딩할때 가져 가는 것으로 보인다.
-- vim.keymap.set({ 'i' }, '<C-h>', '<BS>', { silent = true, noremap = true })
-- 커서 이동키에 h를 바인딩했다.
-- mini.indentscope
-- set.completeopt = { 'menu', 'menuone', 'noselect' }
-- #1442를 보면 설정하지 말라도 되어 있다.
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
-- 찾기 모드에서도 자동 완성을 쓸 수 있다.
-- lua LSP서버가 글로벌 vim 변수가 없는 것으로 인식한다.
-- 이를 해결하기 위해 아래 globals를 추가
-- vim.wo.foldmethod = "expr"
-- vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
-- tree-sitter로 폴딩을 자동으로 만드는 것까진 좋은데, 디폴트로 모두 close 상태다.
-- 이를 처음 파일을 열면 열어두기 위해 아래 방법을 쓴다.
-- vim.api.nvim_create_autocmd(
-- { "BufReadPost", "FileReadPost" },
-- { pattern = "*",
-- command = "normal zR|cd %:h" -- 폴더 열고, Current 디렉토리 바꾸고
-- }
-- )
-- :lcd, :tcd 를 이용하도록 바꿨다.
-- vim.api.nvim_create_autocmd(
-- { "BufRead" },
-- { pattern = "*",
-- command = "cd %:h" -- 폴더 열고, Current 디렉토리 바꾸고
-- }
-- )
--
-- Lazy 플러그인 사용법
-- opts: 아래 config에서 쓸 옵션 테이블
-- config: 플러그인이 로드될 때 실행된다. 기본 구현은 require(Main).setup(opts)를 실행한다.
-- 사용자가 특별히 지정할 옵션이 없을 땐 config = true로 주면 require(Main).setup()을 실행한다.
-- init: 시작할 때 실행. 플러그인 시작인가? nvim 시작인가?
local plugins = {
{
'sainnhe/everforest',
lazy = false,
config = function()
vim.cmd.colorscheme('everforest')
end
},
{
'nvim-lualine/lualine.nvim',
lazy = false,
event = { 'VimEnter' },
dependencies = {
'nvim-tree/nvim-web-devicons',
'linrongbin16/lsp-progress.nvim'
},
config = function()
require "lualine".setup {
options = { theme = "everforest" },
sections = {
lualine_c = { "filename"
--, require('NeoComposer.ui').status_recording
, require "pomodoro".statusline
, require "lsp-progress".progress
},
},
}
end
},
{
'linrongbin16/lsp-progress.nvim',
event = { 'VimEnter' },
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lsp-progress').setup()
end
},
{
'junegunn/fzf',
lazy = true,
cmd = "FZF",
},
{
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("fzf-lua").setup({})
end
},
{
'j-hui/fidget.nvim',
-- tag = 'legacy',
lazy = true,
config = function()
require "fidget".setup {
-- tag = "legacy"
}
end
},
-- {
-- 'mrded/nvim-lsp-notify',
-- requires = { 'rcarriga/nvim-notify' },
-- config = function()
-- require('lsp-notify').setup({
-- notify = require('notify'),
-- })
-- end,
-- dependencies = { {"rcarriga/nvim-notify"}}
-- },
-- 아래 lspsaga와 기능이 겹친다. { "ii14/lsp-command" },
-- {
-- "glepnir/lspsaga.nvim",
-- lazy = true,
-- event = "BufRead",
-- config = function()
-- require("lspsaga").setup({
-- ui = {
-- lightbulb = {
-- enable = false,
-- }
-- }
-- })
-- end,
-- dependencies = { { "nvim-tree/nvim-web-devicons" } }
-- },
{
"folke/neoconf.nvim",
lazy = true,
priority = 100,
config = true,
},
{
"folke/neodev.nvim",
lazy = true,
config = true,
priority = 100,
dependencies = { "hrsh7th/nvim-cmp" }
},
{
'neovim/nvim-lspconfig',
priority = 50,
lazy = true,
},
-- 특정 기호등을 기준으로 정렬할 때 쓴다.
-- :Tabularize /= (이렇게 하면 =을 기준으로 정렬된다.)
{
'godlygeek/tabular',
cmd = "Tabularize",
lazy = true,
},
-- {
-- 'preservim/vim-markdown',
-- ft = { "md", "markdown" },
-- lazy = true,
-- dependencies = { 'godlygeek/tabular' },
-- },
-- { 'EdenEast/nightfox.nvim', branch = 'main' },
{
'ixru/nvim-markdown',
ft = { "md", "markdown" },
lazy = true,
config = function()
end
},
{
'marko-cerovac/material.nvim',
lazy = false,
},
{
'purescript-contrib/purescript-vim',
branch = 'main',
ft = "purescript",
lazy = true,
},
{
'vmchale/dhall-vim',
ft = { "dhall" },
lazy = true,
},
{
'iamcco/markdown-preview.nvim',
lazy = true, -- markdown 파일일 때 활성화가 안된다. 됐었는데, Lazy로 옮기고 안된다.
ft = { "markdown", "md" },
build = 'cd app && yarn install',
},
{
'MattesGroeger/vim-bookmarks',
lazy = true,
cmd = "BookmarkToggle",
keys = {
{
'mm',
mode = { "n", "v" },
':BookmarkToggle<CR>',
silent = true,
desc = "Bookmark"
},
},
},
{ 'akinsho/toggleterm.nvim', version = "*", config = true },
-- { 'kassio/neoterm',
-- cmd = 'Tnew',
-- lazy = true,
-- },
{
'nvim-tree/nvim-web-devicons',
config = function()
require 'nvim-web-devicons'.setup {
default = true,
}
end,
},
{
'akinsho/bufferline.nvim',
config = function()
require("bufferline").setup {
mode = tabs
}
end,
dependencies = 'nvim-tree/nvim-web-devicons',
},
-- { 'nvim-tree/nvim-tree.lua',
-- lazy = false,
-- config = function()
-- require("nvim-tree").setup {
-- tab = {
-- sync = {
-- open = true,
-- }
-- },
-- sync_root_with_cwd = true,
-- }
-- end,
-- keys = {
-- {
-- '<leader>t',
-- ':NvimTreeFindFileToggle!<CR>',
-- mode = { 'n', 'v' },
-- silent = true,
-- desc = "Nvim-Tree"
-- },
-- },
-- },
{ 'nvim-lua/plenary.nvim',
},
{ 'nvim-lua/popup.nvim' },
{
'numkil/ag.nvim',
lazy = true,
cmd = 'Ag'
},
{
'duane9/nvim-rg',
lazy = true,
branch = 'main',
cmd = "Rg",
},
{
"smartpde/telescope-recent-files",
lazy = true,
keys = {
{
'<space>r',
function()
return require('telescope').extensions.recent_files.pick()
end,
desc = 'Recent File',
},
},
config = function()
require("telescope").load_extension("recent_files")
end,
dependencies = {
'nvim-telescope/telescope.nvim',
},
},
-- { 'nvim-telescope/telescope-file-browser.nvim',
-- lazy = true,
-- keys = {
-- { '<space>f',
-- function()
-- return require('telescope').extensions.file_browser.file_browser()
-- end, desc = 'File Browser',
-- },
-- },
-- config = function()
-- require("telescope").load_extension("file_browser")
-- require("telescope").setup({
-- extensions = {
-- file_browser = {
-- theme = "ivy",
-- },
-- },
-- })
-- end,
-- dependencies = {
-- 'nvim-telescope/telescope.nvim',
-- },
-- },
{
'tom-anders/telescope-vim-bookmarks.nvim',
lazy = true,
keys = {
{
'<space>m',
function()
return require('telescope').extensions.vim_bookmarks.all()
end,
desc = 'Bookmarks',
},
},
config = function()
require("telescope").load_extension("vim_bookmarks")
end,
dependencies = {
'MattesGroeger/vim-bookmarks',
'nvim-telescope/telescope.nvim',
},
},
{
"debugloop/telescope-undo.nvim",
lazy = true,
keys = {
{ '<space>u', "<cmd>Telescope undo<cr>", desc = "Undo" },
},
config = function()
require("telescope").load_extension("undo")
require("telescope").setup({
extensions = {
undo = {
side_by_side = true,
layout_config = {
preview_height = 0.8,
},
},
},
})
end,
dependencies = {
'nvim-telescope/telescope.nvim',
},
},
{
'nvim-telescope/telescope.nvim',
tag = '0.1.5',
lazy = true,
cmd = "Telescope",
keys = {
{
'<space>g',
function()
return require('telescope.builtin').live_grep { search_dirs = { '.' } }
end,
desc = 'Live Grep',
},
{
'<space>b',
function()
return require('telescope.builtin').buffers()
end,
desc = 'Buffers',
},
{
'<space>c', "<cmd>Telescope resume<cr>", desc = "Resume"
},
},
config = function()
require("telescope").setup({
defaults = require "telescope.themes".get_ivy({}),
-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
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"
},
}
})
require('telescope').load_extension('fzf')
--require('telescope').load_extension('macros')
vim.keymap.set({ 'n' }, '<space>f', ':Telescope find_files<CR>', { silent = true })
end,
dependencies = {
"nvim-lua/plenary.nvim",
--"kkharji/sqlite.lua",
},
},
-- {
-- "ecthelionvi/NeoComposer.nvim",
-- dependencies = { "kkharji/sqlite.lua" },
-- opts = {}
-- },
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make'
},
{
'monkoose/fzf-hoogle.vim',
lazy = true,
cmd = "Hoogle",
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
{
'm-demare/hlargs.nvim',
config = function()
require('hlargs').setup()
end,
},
},
config = function()
require 'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
},
endwise = {
enable = true,
},
ensure_installed = { "haskell", "lua", "javascript", "typescript", "vim", "rust", "python", "graphql", "html",
"css", "json", "markdown", "http", "json" }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = { "" }, -- List of parsers to ignore installing
highlight = {
enable = true, -- false로 하면 모든 확장을 비활성화
-- disable = { "haskell" },
disable = { "" }, -- TS를 비활성화할 언어 목록
additional_vim_regex_highlighting = { 'org' }, -- Required for spellcheck, some LaTex highlights and code block highlights that do not have ts grammar
},
indent = { enable = true },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
-- 디폴트로 ip (inner paragraph), ap (a paragraph) 기능이 있다.
-- 아직은 제대로 동작하지 않을 때가 있는 것 같다.
-- lua 파일에서는 `function` 키워드를 찾아서 동작한다.
["af"] = { query = "@function.outer", desc = "Select function outer" }, -- v모드에서 af
["if"] = { query = "@function.inner", desc = "Select function inner" },
["ac"] = { query = "@comment.outer", desc = "Select comment outer" },
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
},
selection_modes = {
['@comment.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
['@class.outer'] = '<c-v>', -- blockwise
},
include_surrounding_whitespace = true,
},
lsp_interop = {
enable = true,
border = 'none',
peek_definition_code = {
["<leader>df"] = "@function.outer",
["<leader>dF"] = "@class.outer",
},
},
},
}
end
},
{
'nvim-treesitter/playground',
lazy = true,
cmd = "TSPlaygroundToggle",
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require("nvim-treesitter.configs").setup {
playground = {
enable = true,
}
}
end
},
-- { 'simrat39/symbols-outline.nvim',
-- lazy = true,
-- cmd = "SymbolsOutline",
-- config = function()
-- require "symbols-outline".setup({
-- keymaps = {
-- --close = { "<Esc>", "q" }, -- 자꾸 ESC를 눌러서 닫아 버린다.
-- close = { "q" },
-- goto_location = "<Cr>",
-- focus_location = "o",
-- hover_symbol = "<C-k>",
-- toggle_preview = "K",
-- rename_symbol = "r",
-- code_actions = "a",
-- fold = "h",
-- unfold = "l",
-- fold_all = "W",
-- unfold_all = "E",
-- fold_reset = "R",
-- },
-- })
-- end,
-- },
{
'stevearc/aerial.nvim',
opts = {},
-- Optional dependencies
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons"
},
},
{
'numToStr/Comment.nvim',
lazy = true,
keys = { { "gc", mode = { "v", "n" }, desc = "To Comment" }, { "gb", mode = "v" } },
config = function()
require('Comment').setup()
end,
},
-- { 'nvim-orgmode/orgmode',
-- keys = { { "<leader>oa", "<leader>oc" }, },
-- lazy = true,
-- config = function()
-- require('orgmode').setup_ts_grammar()
-- vim.opt.conceallevel = 0
-- vim.opt.concealcursor = 'nc'
-- require('orgmode').setup({
-- org_agenda_files = { '~/notes/*', '~/notes/**/*' },
-- org_default_notes_file = '~/notes/refile.org',
-- })
-- end,
-- dependencies = { 'nvim-treesitter/nvim-treesitter' }
-- },
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
--local wk = require("which-key")
end,
opts = { -- 디폴트값을 쓰고 싶지 않다면 여기다 설정
}
},
-- { 'linty-org/key-menu.nvim',
-- lazy = false,
-- config = function()
-- -- 팝업 keymap
-- -- 보통 아는 명령어면 연달아서 입력한다.
-- -- 600밀리초 지나도 다음 키가 안들어 오면 메뉴를 띄운다.
-- -- vim.o.timeoutlen = 1200
-- require 'key-menu'.set('n', '<leader>')
-- require 'key-menu'.set('n', '<Space>')
-- require 'key-menu'.set('n', 'g')
-- -- require 'key-menu'.set('n', 's')
-- require 'key-menu'.set('n', 't')
-- require 'key-menu'.set('n', 'm')
-- require 'key-menu'.set('v', 't')
-- require 'key-menu'.set('v', 'm')
-- vim.keymap.set({ 'n', 'i', 'v' }, '<F1>', function() require 'key-menu'.open_window('') end,
-- { desc = 'Key Binding' })
-- end
-- }, --팝업 메뉴
-- qickfix 윈도우에서 항목 위에 hover하면 미리보기 창 열기
-- { 'kevinhwang91/nvim-bqf',
-- lazy = true,
-- ft = 'qf',
-- },
-- { 'echasnovski/mini.indentscope',
-- version = '*',
-- lazy = false,
-- config = function()
-- require('mini.indentscope').setup(
-- -- No need to copy this inside `setup()`. Will be used automatically.
-- {
-- draw = {
-- delay = 100,
-- -- Animation rule for scope's first drawing. A function which, given
-- -- next and total step numbers, returns wait time (in ms). See
-- -- |MiniIndentscope.gen_animation()| for builtin options. To disable
-- -- animation, use `require('mini.indentscope').gen_animation('none')`.
-- animation = function(_, _)
-- return 20
-- end,
-- },
-- -- Module mappings. Use `''` (empty string) to disable one.
-- -- 괄호 안의 오브젝트를 골라내는데 treesitter-unit을 쓰고 있다.
-- -- 아래는 treesitter의 오브젝트 하일라이트 기능을 찾으면 삭제할 것
-- mappings = {
-- -- Textobjects
-- object_scope = 'ii',
-- object_scope_with_border = 'ai',
-- -- Motions (jump to respective border line; if not present - body line)
-- goto_top = '[i',
-- goto_bottom = ']i',
-- },
-- -- Options which control scope computation
-- options = {
-- -- Type of scope's border: which line(s) with smaller indent to
-- -- categorize as border. Can be one of: 'both', 'top', 'bottom', 'none'.
-- border = 'both',
-- -- Whether to use cursor column when computing reference indent.
-- -- Useful to see incremental scopes with horizontal cursor movements.
-- indent_at_cursor = true,
-- -- Whether to first check input line to be a border of adjacent scope.
-- -- Use it if you want to place cursor on function header to get scope of
-- -- its body.
-- try_as_border = true,
-- },
-- -- Which character to use for drawing scope indicator
-- symbol = '╎',
-- }
-- )
-- end
-- },
-- { 'echasnovski/mini.surround',
-- lazy = true,
-- keys = { { 'sa' }, { 'sd' }, { 'sf' }, { 'sF' }, { 'sh' }, { 'sr' }, { 'sn' } },
-- version = '*',
-- config = function()
-- require('mini.surround').setup {}
-- end
-- },
-- { 'jedrzejboczar/possession.nvim',
-- lazy = true,
-- keys = {
-- {
-- '<space>s',
-- function()
-- return require('telescope').extensions.possession.list()
-- end,
-- desc = 'Session',
-- },
-- },
-- config = function()
-- require("telescope").load_extension("possession")
-- require "possession".setup {
-- silent = false,
-- load_silent = true,
-- autosave = {
-- current = true,
-- tmp = true,
-- tmp_name = 'tmp',
-- on_load = true,
-- on_quit = true,
-- }
-- }
-- end,
-- cmd = { "PossessionSave", "PossessionLoad" },