-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
136 lines (132 loc) · 4.17 KB
/
init.lua
File metadata and controls
136 lines (132 loc) · 4.17 KB
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
return {
-- Core Dependencies
{ 'nvim-lua/plenary.nvim' },
{ 'MunifTanjim/nui.nvim' },
{
'nvim-mini/mini.icons',
opts = {},
init = function()
package.preload['nvim-web-devicons'] = function()
require('mini.icons').mock_nvim_web_devicons()
return package.loaded['nvim-web-devicons']
end
end,
},
-- Utilities
{
'nmac427/guess-indent.nvim',
event = { 'BufReadPost', 'BufNewFile' },
config = true
},
{
'nvim-mini/mini.surround',
main = 'mini.surround',
event = 'VeryLazy',
config = true
},
{
'Wansmer/treesj',
dependencies = 'nvim-treesitter',
opts = {
use_default_keymaps = false,
},
keys = {
{ require('config.keymaps').treesj.toggle, '<Cmd>TSJToggle<CR>' },
}
},
{
'axkirillov/hbac.nvim',
opts = {
threshold = 20,
close_command = function(bufnr)
local force = vim.api.nvim_get_option_value('buftype', { buf = bufnr }) == 'terminal'
pcall(require('snacks').bufdelete.delete, { buf = bufnr, force = force })
end
},
keys = {
{ require('config.keymaps').hbac.toggle_pin, '<Cmd>Hbac toggle_pin<CR>' }
}
},
{
'saecki/live-rename.nvim',
opts = true,
keys = function()
local rename_keymap = require('config.keymaps').rename
return {
{ rename_keymap.rename, function() require('live-rename').rename({ insert = true }) end },
{ rename_keymap.rename_clean, function() require('live-rename').rename({ text = '', insert = true }) end },
}
end
},
-- Miscellaneous
{
'RaafatTurki/hex.nvim',
cmd = { 'HexToggle', 'HexDump', 'HexAssemble' },
config = true,
},
{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter', 'mini.icons' },
ft = { 'markdown', 'codecompanion' },
opts = {
anti_conceal = {
enabled = false,
},
code = {
position = 'right',
width = 'block',
border = 'thick',
left_pad = 2,
right_pad = 2,
},
pipe_table = {
preset = 'round'
},
overrides = {
filetype = {
codecompanion = {
render_modes = { 'n', 'c', 'v' },
},
},
},
}
},
{
'letieu/jot.lua',
dependencies = 'plenary.nvim',
config = function()
local win_width = math.floor(vim.o.columns * 0.8)
local win_height = math.floor(vim.o.lines * 0.8)
local function get_file_last_modified(file_path)
local stat = vim.uv.fs_stat(file_path)
if stat then
local last_modified = stat.mtime.sec
return ' Updated: ' .. os.date('%d-%b-%Y %H:%M', last_modified) .. ' '
else
return ''
end
end
require('jot').config = {
quit_key = 'q',
notes_dir = vim.fn.stdpath('data') .. '/jot',
win_opts = {
relative = 'editor',
width = win_width,
height = win_height,
row = math.floor((vim.o.lines - win_height) / 2) - 1,
col = math.floor((vim.o.columns - win_width) / 2) - 1,
border = 'solid',
title = ' Project Notes - ' .. vim.uv.cwd() .. ' ',
footer = get_file_last_modified(vim.fn.expand('%:p')),
footer_pos = 'right',
}
}
end,
keys = function()
local jot_keymap = require('config.keymaps').jot
return {
{ jot_keymap.toggle, function() require('jot').toggle() end }
}
end
}
}