Skip to content

Commit 50f4c65

Browse files
committedFeb 11, 2025
fix : optimize startup time
To shorter startuptime whether neovim is opened by 'nvim' or 'nvim <filename>', load optimization is completed as I think. Many plugins are use lazy load by keys or filetype. To control enable / disable plugins in one file(`lazy_manager.lua`), separate `import` fields with file units not folder now startup time through dashboard is under 400ms from 1000~1200ms, startup time for accessing file directly is under 600ms from 1800ms,
1 parent 43670b3 commit 50f4c65

32 files changed

+258
-58
lines changed
 

‎init.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ if vim.g.vscode then -- vscode config is separated
22
require('jaehak.core.keymaps')
33
require('jaehak.lazy_manager')
44
else
5-
require("jaehak.core")
5+
-- require("jaehak.core")
6+
require("jaehak.core.autocmds")
7+
require("jaehak.core.keymaps")
8+
require("jaehak.core.options")
9+
require("jaehak.core.paths")
10+
require("jaehak.core.utils")
611
require("jaehak.lazy_manager")
712
end
813

‎lua/jaehak/lazy_manager.lua

+51-10
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,57 @@ vim.opt.rtp:prepend(lazypath)
2121
-------------------------------------------------------------
2222
if vim.g.vscode == nil then
2323
require('lazy').setup({
24-
{import = 'jaehak.plugins'},
25-
{import = 'jaehak.plugins.lsp'}}, {
26-
change_detection = {
27-
-- enabled = false,
28-
notify = false,
29-
},
30-
rocks = { -- disable lazy.nvim's luarocks supports for fugit2
31-
enabled = false,
32-
}
33-
})
24+
{import = 'jaehak.plugins.colorscheme' , enabled = true},
25+
{import = 'jaehak.plugins.snacks' , enabled = true},
26+
{import = 'jaehak.plugins.dashboard' , enabled = true},
27+
{import = 'jaehak.plugins.yazi' , enabled = true},
28+
{import = 'jaehak.plugins.lsp.comment' , enabled = true},
29+
{import = 'jaehak.plugins.lsp.formatter' , enabled = true},
30+
{import = 'jaehak.plugins.lsp.vim-easy-align' , enabled = true},
31+
{import = 'jaehak.plugins.colorcode' , enabled = true},
32+
{import = 'jaehak.plugins.diffview' , enabled = true},
33+
{import = 'jaehak.plugins.dressing' , enabled = true},
34+
{import = 'jaehak.plugins.fidget' , enabled = true},
35+
{import = 'jaehak.plugins.flash' , enabled = true},
36+
{import = 'jaehak.plugins.gitsigns' , enabled = true},
37+
{import = 'jaehak.plugins.grapple' , enabled = true},
38+
{import = 'jaehak.plugins.grug-far' , enabled = true},
39+
{import = 'jaehak.plugins.hlchunk' , enabled = true},
40+
{import = 'jaehak.plugins.marks' , enabled = true},
41+
{import = 'jaehak.plugins.neogit' , enabled = true},
42+
{import = 'jaehak.plugins.neominimap' , enabled = true},
43+
{import = 'jaehak.plugins.nvim-context-vt' , enabled = true},
44+
{import = 'jaehak.plugins.nvim-hlslens' , enabled = true},
45+
{import = 'jaehak.plugins.obsidian' , enabled = true},
46+
{import = 'jaehak.plugins.spelunk' , enabled = false},
47+
{import = 'jaehak.plugins.split' , enabled = true},
48+
{import = 'jaehak.plugins.staline' , enabled = true},
49+
{import = 'jaehak.plugins.substitute' , enabled = true},
50+
{import = 'jaehak.plugins.telescope' , enabled = false},
51+
{import = 'jaehak.plugins.todo-comments' , enabled = true},
52+
{import = 'jaehak.plugins.translate' , enabled = true},
53+
{import = 'jaehak.plugins.vim-illuminate' , enabled = true},
54+
{import = 'jaehak.plugins.vim-visual-multi' , enabled = true},
55+
{import = 'jaehak.plugins.which-key' , enabled = true},
56+
{import = 'jaehak.plugins.yankbank' , enabled = true},
57+
{import = 'jaehak.plugins.lsp.autoclose' , enabled = true},
58+
{import = 'jaehak.plugins.lsp.comment' , enabled = true},
59+
{import = 'jaehak.plugins.lsp.nvim-treesitter', enabled = true},
60+
{import = 'jaehak.plugins.lsp.latex' , enabled = true},
61+
{import = 'jaehak.plugins.lsp.lspsaga' , enabled = true},
62+
{import = 'jaehak.plugins.lsp.luasnip' , enabled = true},
63+
{import = 'jaehak.plugins.lsp.markdown' , enabled = true},
64+
{import = 'jaehak.plugins.lsp.mason' , enabled = true},
65+
{import = 'jaehak.plugins.lsp.nvim-cmp' , enabled = true},
66+
{import = 'jaehak.plugins.lsp.nvim-lspconfig' , enabled = true},
67+
{import = 'jaehak.plugins.lsp.nvim-surround' , enabled = true},
68+
{import = 'jaehak.plugins.lsp.trouble' , enabled = true},
69+
-- {import = 'jaehak.plugins'},
70+
-- {import = 'jaehak.plugins.lsp'}
71+
}, {
72+
change_detection = { notify = false, },
73+
rocks = { enabled = false, } -- disable lazy.nvim's luarocks supports for fugit2
74+
})
3475
else -- for vscode
3576
require('lazy').setup({
3677
{import = 'jaehak.plugins.flash'},

‎lua/jaehak/plugins/colorcode.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ return {
33
"catgoose/nvim-colorizer.lua",
44
enabled = true,
55
branch = 'fix/141-quotes_and_doublequotes',
6-
event = "BufReadPre",
6+
keys = {
7+
{'<leader>cc'}
8+
},
79
config = function ()
810
local colorizer = require('colorizer')
911
colorizer.setup({

‎lua/jaehak/plugins/dashboard.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ return {
33
{
44
-- dashboard is faster a little?
55
'nvimdev/dashboard-nvim',
6-
-- enabled = false,
7-
event = 'VimEnter',
6+
cond = function()
7+
return vim.fn.argc() == 0 -- load dashboard when I open nvim using 'nvim' only (no argument)
8+
end,
9+
-- event = 'VimEnter',
810
init = function ()
911
-- vim.opt_local.modifiable = true
1012
vim.opt.modifiable = true

‎lua/jaehak/plugins/flash.lua

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
return {
22
'folke/flash.nvim',
3+
keys = {
4+
{'w'}
5+
},
36
config = function ()
47
local flash = require('flash')
58
flash.setup({

‎lua/jaehak/plugins/gitsigns.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
-- it is useful to show git diff sign / but staging and commit is not
33
'lewis6991/gitsigns.nvim',
4-
enabled = true,
4+
event = 'BufReadPost',
55
config = function ()
66
local gitsigns = require('gitsigns')
77

‎lua/jaehak/plugins/grapple.lua

+17-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ return {
44
-- list up important files (add list to nvim-data/grapple)
55
-- Caution!! : file path must not have white space. But it can accept with non-English directory
66
'cbochs/grapple.nvim',
7-
event = 'VimEnter',
7+
keys = {
8+
{'<leader>pa'},
9+
{'<leader>pf'},
10+
},
11+
ft = {'dashboard'},
812
dependencies = {
913
'nvim-tree/nvim-web-devicons',
1014
},
@@ -26,7 +30,10 @@ return {
2630
},
2731
{
2832
'natecraddock/sessions.nvim',
29-
lazy = false, -- for startup window
33+
keys = {
34+
{'<leader>ps'},
35+
},
36+
ft = 'dashboard',
3037
config = function ()
3138
local sessions = require('sessions')
3239
local saved_path = paths.session.saved
@@ -75,27 +82,27 @@ return {
7582
-- gnikdroy/projections.nvim : I cannot see any project in telescope extension... I don't know how to use this..
7683
-- coffebar/neovim-project : it needs to write project path in configuration file, not in nvim-data
7784
-- 'otavioschwanck/arrow.nvim' : why doesn't it work?
78-
-- 'natecraddock/workspaces.nvim' : it save cwd as workspace. Opening workspace means that change cd.
79-
-- it will be useful with hooks after load workspace like telescope find_files,
80-
-- now From combination of grapple, telescope and oil, it can be replaced to workspace's behavior
85+
-- 'natecraddock/workspaces.nvim' : it save cwd as workspace. Opening workspace means that change cd.
86+
-- it will be useful with hooks after load workspace like telescope find_files,
87+
-- now From combination of grapple, telescope and oil, it can be replaced to workspace's behavior
8188
-- 'Rics-Dev/project-explorer.nvim' : how to use? and no docs. default keymapping doesn't work
8289
--
8390

8491

8592
-- ///////// sessions plugins
86-
-- possession.nvim : it support saving session with specific name. it works well,
87-
-- but it cannot autosave current session when neovim is quit
93+
-- possession.nvim : it support saving session with specific name. it works well,
94+
-- but it cannot autosave current session when neovim is quit
8895
-- It has long load time >150ms
89-
-- neovim-session-manager : I don't know how to work. It works along to current directory.
96+
-- neovim-session-manager : I don't know how to work. It works along to current directory.
9097
-- save the session with current directory name. It cannot save the session except one file
9198
-- It has short load time < 20ms
9299
-- persisted.nvim : it has long load time
93100
-- it doesn't work.. it saves session as path and show blank buffer window when I load session
94-
-- folke/persistence.nvim : it works well. autosaving on quit.
101+
-- folke/persistence.nvim : it works well. autosaving on quit.
95102
-- it has fast load time <20ms. it supports only saving last session
96103
-- it save the session to file with cwd name
97104
-- it cannot save the session state. only list of buffers
98-
-- natecraddock/sessions.nvim : it is blazingly fast! (<5ms). I don't know what start_autosave() works but
105+
-- natecraddock/sessions.nvim : it is blazingly fast! (<5ms). I don't know what start_autosave() works but
99106
-- auto saving is implemented by autocmd. it save last session
100107
-- I can set the file name. so all session is saved to one file
101108
-- usually I will need the last session

‎lua/jaehak/plugins/lsp/autolcose.lua ‎lua/jaehak/plugins/lsp/autoclose.lua

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local paths = require('jaehak.core.paths')
12
return {
23
-- ultimate-autopair.nvim : it is too bulky and slow
34
-- m4xshen/autoclose.nvim : more simple, but it cannot ignore like the "'" in "'don't"
@@ -6,6 +7,19 @@ return {
67
-- more simple and smart / but it cannot support filetype
78
'echasnovski/mini.pairs',
89
version = false,
10+
keys = {
11+
{'(', mode = {'i'}},
12+
{'[', mode = {'i'}},
13+
{'{', mode = {'i'}},
14+
{'<', mode = {'i'}},
15+
{')', mode = {'i'}},
16+
{']', mode = {'i'}},
17+
{'}', mode = {'i'}},
18+
{'>', mode = {'i'}},
19+
{'"', mode = {'i'}},
20+
{"'", mode = {'i'}},
21+
{"`", mode = {'i'}},
22+
},
923
config = function ()
1024
require('mini.pairs').setup({
1125
modes = { insert = true, command = true, terminal = true },
@@ -33,7 +47,6 @@ return {
3347
-- if you use treesitter highlight, must use the rainbow plugins that use treesitter grammar, not regex
3448
-- I'll make matlab query some days
3549
'HiPhish/rainbow-delimiters.nvim',
36-
enabled = true,
3750
lazy = true, -- from nvim-treesitter
3851
config = function ()
3952
-- This module contains a number of default definitions
@@ -100,7 +113,8 @@ return {
100113
-- show matchparen of current region
101114
"utilyre/sentiment.nvim",
102115
version = "*",
103-
event = "VeryLazy", -- keep for lazy loading
116+
ft = paths.Filetypes.ForCode,
117+
-- event = "VeryLazy", -- keep for lazy loading
104118
opts = {
105119
pairs = {
106120
{ '(', ')' },

‎lua/jaehak/plugins/lsp/comment.lua

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
return {
22
{
33
'numToStr/Comment.nvim',
4+
keys = {
5+
{'gl', mode = {'n', 'v'}},
6+
{'gb', mode = {'n', 'v'}},
7+
{'gL'},
8+
},
49
config = function()
510
local ft = require('Comment.ft')
611
-- ft.set('matlab', {'%%s', '%{%s%}'})
@@ -28,6 +33,10 @@ return {
2833
-- make text object
2934
'chrisgrieser/nvim-various-textobjs',
3035
commit = '674b7c9', -- use multiCommentedLines until update nvim v.10
36+
keys = {
37+
{'vii'},
38+
{'vic'},
39+
},
3140
config = function ()
3241
local textobjs = require('various-textobjs')
3342
textobjs.setup({
@@ -46,6 +55,6 @@ return {
4655
},
4756
}
4857
-- 'nvim-treesitter/nvim-treesitter-textobjects' : it makes textobject with comment line only, not block
49-
-- 'danymat/neogen' : it is useful when I put description for functions even if cursor is in the function.
58+
-- 'danymat/neogen' : it is useful when I put description for functions even if cursor is in the function.
5059
-- it takes the cursor to top of the funciton rapidly. but the template is can be maed by luasnip
5160
-- I think it can be replaced by luasnip

‎lua/jaehak/plugins/lsp/formatter.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local paths = require('jaehak.core.paths')
22
return {
33
{
44
"stevearc/conform.nvim",
5-
enabled = true,
5+
lazy = true,
66
ft = paths.Filetypes.ForCode,
77
config = function()
88
-- configuration
@@ -57,6 +57,7 @@ return {
5757
},
5858
{
5959
'nmac427/guess-indent.nvim',
60+
lazy = true,
6061
config = function()
6162
require('guess-indent').setup {
6263
silent = true, -- don't notify about guess operation

‎lua/jaehak/plugins/lsp/lspsaga.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ return {
5959
-- show signature help when enter functions
6060
'ray-x/lsp_signature.nvim',
6161
enabled = true,
62-
event = 'LspAttach',
62+
event = 'InsertEnter',
6363
config = function ()
6464
local lsp_sig = require('lsp_signature')
6565
local cfg = {
@@ -83,7 +83,6 @@ return {
8383
{
8484
-- show code outline
8585
'hedyhli/outline.nvim',
86-
lazy = true,
8786
keys = {
8887
{'go', '<Cmd>Outline<CR>', desc = 'LSP - Toggle outline'}
8988
},

‎lua/jaehak/plugins/lsp/markdown.lua

+13-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ return {
33
{
44
-- more works better
55
'iamcco/markdown-preview.nvim',
6-
ft = {'markdown'},
6+
keys = {
7+
{'<leader>mp'}
8+
},
79
build = function() vim.fn["mkdp#util#install"]() end,
810
config = function ()
911
vim.g.mkdp_auto_start = 0 -- open preview automatically
@@ -353,7 +355,9 @@ return {
353355
{
354356
-- editing fenced code block using treesitter
355357
'AckslD/nvim-FeMaco.lua',
356-
ft = {'markdown'},
358+
keys = {
359+
{'<leader>mc'},
360+
},
357361
config = function ()
358362
local femaco = require('femaco')
359363
femaco.setup({ })
@@ -364,9 +368,9 @@ return {
364368
{
365369
'allaman/emoji.nvim',
366370
ft = 'markdown',
367-
dependencies = {
368-
'nvim-telescope/telescope.nvim'
369-
},
371+
-- dependencies = {
372+
-- 'nvim-telescope/telescope.nvim'
373+
-- },
370374
config = function ()
371375
require('emoji').setup({
372376
enable_cmp_integration = true, -- cmp integration requires 14MB RAM
@@ -378,7 +382,10 @@ return {
378382
},
379383
{
380384
'SCJangra/table-nvim',
381-
ft = 'markdown',
385+
keys = {
386+
{'<leader>mt'},
387+
{'<leader>mT'},
388+
},
382389
opts = {
383390
padd_column_separators = true, -- Insert a space around column separators.
384391
mappings = { -- next and prev work in Normal and Insert mode. All other mappings work in Normal mode.

‎lua/jaehak/plugins/lsp/mason.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ return {
88
lazy = true,
99
},
1010
{
11-
1211
-- 1) powershell (default in windows)
1312
-- 2) git for windows
1413
-- 3) tar (default in windows)
@@ -17,7 +16,8 @@ return {
1716
-- 6) npm (download)
1817
'williamboman/mason.nvim',
1918
enabled = true,
20-
lazy = false, -- lazy-loading is not recommended
19+
-- lazy = false, -- lazy-loading is not recommended
20+
event = 'BufReadPre', -- lazy-loading is not recommended
2121
config = function()
2222
local mason = require('mason')
2323
local mason_lspconfig = require('mason-lspconfig')

‎lua/jaehak/plugins/lsp/nvim-lspconfig.lua

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ return {
2121
{
2222
-- nvim-lspconfig must be loaded after than mason. If not, spawning server warning fired
2323
'neovim/nvim-lspconfig',
24+
event = 'BufReadPre',
2425
-- lazy = true,
2526
dependencies = {
2627
{

‎lua/jaehak/plugins/lsp/nvim-surround.lua

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ return {
33
-- quick add/delete/change surrounding pairs
44
'kylechui/nvim-surround',
55
version = '*',
6+
keys = {
7+
{'fa', mode = {'n', 'v'}},
8+
{'fA', mode = {'n', 'v'}},
9+
{'fb', mode = {'n', 'v'}},
10+
{'fB', mode = {'n', 'v'}},
11+
{'fd', mode = {'n', 'v'}},
12+
{'fr', mode = {'n', 'v'}},
13+
{'fR', mode = {'n', 'v'}},
14+
},
615
config = function ()
716
require('nvim-surround').setup({
817
keymaps = {
@@ -17,10 +26,10 @@ return {
1726
change = "fr", -- change pairs and remain the linewise
1827
change_line = "fR", -- change pairs and move to blockwise
1928

20-
-- all left ([<{ ==> add white space
21-
-- all right )}>] ==> not add white space
22-
-- difference pairs can apply in whole line wise condition, yssi/<CR>\
23-
-- ysst => for html tag
29+
-- all left ([<{ ==> add white space
30+
-- all right )}>] ==> not add white space
31+
-- difference pairs can apply in whole line wise condition, yssi/<CR>\
32+
-- ysst => for html tag
2433
-- 'b' to ')' 'B' to '}' 'r' to ']' in yss
2534
--
2635
},

‎lua/jaehak/plugins/lsp/nvim-treesitter.lua

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ return {
55
'nvim-treesitter/nvim-treesitter',
66
-- enabled = false,
77
lazy = true, -- by telescope
8+
ft = paths.Filetypes.ForCode,
89
dependencies = {
910
'HiPhish/rainbow-delimiters.nvim',
1011
'RRethy/nvim-treesitter-endwise', -- it requires neovim under v0.11

‎lua/jaehak/plugins/lsp/trouble.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
return {
22
'folke/trouble.nvim',
3-
event = 'LspAttach',
3+
lazy = true,
4+
keys = {
5+
{'<leader>xt'},
6+
{'<leader>xT'},
7+
},
48
dependencies = {'nvim-tree/nvim-web-devicons'},
59
config = function ()
610
local trouble = require('trouble')

‎lua/jaehak/plugins/lsp/vim-easy-align.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
return {
22
{
33
'junegunn/vim-easy-align',
4-
event = 'BufReadPost',
4+
keys = {
5+
{'<C-\\>', mode = {'n', 'v'}},
6+
{'<C-S-\\>', mode = {'n', 'v'}},
7+
},
58
config = function()
69
vim.g.easy_align_delimiters = {
710
[';'] = { -- add delimiters ';'
@@ -10,7 +13,7 @@ return {
1013
right_margin = 1,
1114
stick_to_left = 0,
1215
},
13-
-- alignment rule is identified by a single-character key. it needs to set ignore_group and \\+
16+
-- alignment rule is identified by a single-character key. it needs to set ignore_group and \\+
1417
['c'] = { -- add delimiters '--', lua comment
1518
pattern = '--\\+',
1619
left_margin = 1,

‎lua/jaehak/plugins/marks.lua

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
local paths = require('jaehak.core.paths')
12
return {
23
-- display marks in signcolumn
34
'chentoast/marks.nvim',
5+
ft = paths.Filetypes.ForCode,
46
config = function ()
57
require('marks').setup({
68
default_mappings = true,

‎lua/jaehak/plugins/neominimap.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ return {
22
-- show minimap
33
'Isrothy/neominimap.nvim',
44
version = 'v3.*.*',
5-
lazy = false,
5+
-- lazy = false,
6+
lazy = true,
7+
keys = {
8+
{'<leader>n'},
9+
},
610
init = function ()
711
vim.opt.wrap = false -- default false,
812

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
local paths = require('jaehak.core.paths')
12
return {
23
-- cannot recognize like "local foo = function()", but well work and customize
34
'andersevenrud/nvim_context_vt',
4-
enabled = true,
5-
event = 'VeryLazy',
5+
ft = paths.Filetypes.ForCode,
66
config = function ()
77
require('nvim_context_vt').setup({
88
prefix = ' [⌧⌦]',
@@ -11,5 +11,5 @@ return {
1111
})
1212
end
1313
}
14-
-- 'briangwaltney/paren-hint.nvim', -->>> it needs to move cursor on bracket, not cursor line
14+
-- 'briangwaltney/paren-hint.nvim', -->>> it needs to move cursor on bracket, not cursor line
1515
-- 'code-biscuits/nvim-biscuits', -->>> sometimes it dose not exact

‎lua/jaehak/plugins/nvim-hlslens.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
return {
22
'kevinhwang91/nvim-hlslens',
3-
event = 'CmdLineEnter',
3+
event = 'CmdLineLeave',
44
dependencies = {
55
'Isrothy/neominimap.nvim',
66
},

‎lua/jaehak/plugins/obsidian.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ return {
88
ft = 'markdown',
99
dependencies = {
1010
'nvim-lua/plenary.nvim',
11-
'nvim-telescope/telescope.nvim',
11+
-- 'nvim-telescope/telescope.nvim',
1212
},
1313
init = function ()
1414
-- vim.opt.conceallevel = 2 -- set conceallevel (but markdown.nvim will changes)

‎lua/jaehak/plugins/snacks.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ local picker_config = {
2121

2222
return {
2323
'folke/snacks.nvim',
24-
lazy = false,
24+
ft = {'dashboard'},
25+
lazy = true,
2526
opts = {
2627
bigfile = {enabled = false},
2728
dashboard = {enabled = false},

‎lua/jaehak/plugins/spelunk.lua

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
return {
22
-- persistent mark manager
33
'EvWilson/spelunk.nvim',
4-
enabled = false, -- add when I use it
54
dependencies = {
65
'nvim-lua/plenary.nvim', -- For window drawing utilities
76
'nvim-telescope/telescope.nvim', -- Optional: for fuzzy search capabilities

‎lua/jaehak/plugins/split.lua

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
return {
22
"wurli/split.nvim",
3+
keys = {
4+
{'gsf', mode = {'n', 'v'}},
5+
{'gsb', mode = {'n', 'v'}},
6+
{'gsF', mode = {'n', 'v'}},
7+
{'gsB', mode = {'n', 'v'}},
8+
},
39
opts = {
410
keymaps = {
511
-- interactive : after keymap input, dialog opens to get which character is criteria

‎lua/jaehak/plugins/substitute.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
return {
2-
-- substitute contents automatically from default register
2+
-- substitute contents automatically from default register
33
'gbprod/substitute.nvim',
4+
keys = {
5+
{'s', mode = {'n','x'}},
6+
{'ss'},
7+
{'S'},
8+
},
49
config = function ()
510
local sub = require('substitute')
611
sub.setup({

‎lua/jaehak/plugins/telescope.lua

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
return {
22
'nvim-telescope/telescope.nvim',
3-
enabled = false,
43
event = 'VeryLazy',
54
dependencies = {
65
'nvim-lua/plenary.nvim',

‎lua/jaehak/plugins/todo-comments.lua

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
local paths = require('jaehak.core.paths')
12
return {
23
'folke/todo-comments.nvim',
4+
ft = paths.Filetypes.ForCode,
35
dependencies = {
46
'nvim-lua/plenary.nvim'
57
},

‎lua/jaehak/plugins/yazi.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ return {
44
-- if current file name change, the change not apply to buffer name immediately
55
{
66
"mikavilpas/yazi.nvim",
7-
enabled = true,
8-
event = "VeryLazy",
7+
ft = {'dashboard'},
8+
keys = {
9+
{'<leader>ee'},
10+
{'<leader>ec'},
11+
{'<leader>ed'},
12+
{'<leader>en'},
13+
},
14+
-- event = "VeryLazy",
915
config = function ()
1016

1117
local yazi = require('yazi')

‎test/test.lua

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
lspconfig.ruff.setup({ -- use ruff as python linter
3+
on_attach = function (client, bufnr)
4+
-- lsp use ruff to formatter
5+
client.server_capabilities.documentFormattingProvider = false -- enable vim.lsp.buf.format()
6+
client.server_capabilities.documentRangeFormattingProvider = false -- formatting will be used by confirm.nvim
7+
client.server_capabilities.hoverProvider = false -- use pylsp
8+
end,
9+
-- cmp_nvim_lsp default_configuration add completionProvider. ruff_lsp don't use completion
10+
filetype = {'python'},
11+
root_dir = function (fname)
12+
return lsp_util.root_pattern('.git')(fname) or vim.fn.getcwd()
13+
end,
14+
single_file_support = true,
15+
init_options = {
16+
settings = {
17+
configuration = paths.lsp.ruff.config_path,
18+
logFile = paths.lsp.ruff.log_path,
19+
logLevel = 'warn',
20+
organizeImports = true, -- use code action for organizeImports
21+
showSyntaxErrors = true, -- show syntax error diagnostics
22+
codeAction = {
23+
disableRuleComment = { enable = false }, -- show code action about rule disabling
24+
fixViolation = { enable = false }, -- show code action for autofix violation
25+
},
26+
format = { -- use conform.nvim
27+
preview = false,
28+
},
29+
lint = { -- it links with ruff, but lint.args are different with ruff configuration
30+
enable = true,
31+
},
32+
}
33+
},
34+
handlers = {
35+
-- ['textDocument/publishDiagnostics'] = create_custom_handler(sign_priority.rank1)
36+
['textDocument/publishDiagnostics'] = vim.lsp.with(
37+
vim.lsp.diagnostic.on_publish_diagnostics, {
38+
virtual_text = false,
39+
}
40+
)
41+
}
42+
})

‎test/test.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
weijfiwejfweif
2+
3+
- tsetion procestsej
4+
- tise jti
5+
- it is just t[is just t[is just test](https://chatgpt.com/c/675198c4-f8ec-8013-a477](https://chatgpt.com/c/675198c4-f8ec-8013-a477-4b3e26ed2980)[is just test](https://chatgpt.com/c/675198c4-f8ec-8013-a477-4b3e26ed2980)est
6+
7+
- it is just[](https://www.perplexity.ai/search/you-are-my-neovim-and-lua-teac-_.C3_EloQ8WOntwXld4j1Q) test
8+
- it is just test
9+
10+
- it si sjsijejsekjfs
11+
Explanation of the Fix
12+
End-Inclusive Rows:
13+
end_row is inclusive, so you can pass it directly as is.
14+
End-Exclusive Columns:
15+
If the selection spans a single line, increment end_col by 1 to match the end-exclusive requirement of nvim_buf_get_text.
16+
Multi-Line Selections:
17+
The nvim_buf_get_text function handles multi-line selections correctly as long as you provide accurate s
18+
19+
:right
20+
:right
21+
:right
22+
➡️
23+
:right
24+
🗯️
25+
➡️
26+
:right

0 commit comments

Comments
 (0)
Please sign in to comment.