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
|
return {
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
-- Use sudo in command mode
{
'lambdalisue/suda.vim',
cmd = { "SudaWrite" },
},
-- For focus mode
{
"Pocco81/true-zen.nvim",
lazy = false,
cmd = { "TZAtaraxis", "TZMinimalist" },
},
-- hop.nvim: For quick jump
{
'smoka7/hop.nvim',
lazy = false,
version = "*",
opts = {
keys = 'etovxqpdygfblzhckisuran'
},
config = function()
require("hop").setup()
end
},
{
"stevearc/conform.nvim",
lazy = false,
-- event = 'BufWritePre', -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- See `:help ibl`
enabled = true,
main = "ibl",
opts = {
indent = { char = "┊" },
whitespace = { highlight = { "Whitespace", "NonText" } },
},
},
{
'lewis6991/gitsigns.nvim',
opts = function()
return {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '‾' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
local gs = require('gitsigns')
vim.keymap.set('n', '<leader>gp', gs.prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', gs.next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>hp', gs.preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
vim.keymap.set('n', '<leader>hd', gs.diffthis, { buffer = bufnr, desc = '[h]unk [d]iff' })
vim.keymap.set('n', '<leader>hD', function() gs.diffthis('~') end,
{ buffer = bufnr, desc = '[h]unk [d]iff for ~' })
-- vim.keymap.set("n", "<leader>gb", gs.blame_line{full=true}, { desc = "Git Blame" })
vim.keymap.set("n", "<leader>gb", gs.toggle_current_line_blame, { desc = "Blame Line" })
vim.keymap.set('v', 'hr', gs.reset_hunk, { buffer = bufnr, desc = '[h]unk [r]eset' })
end
}
end,
},
{
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
-- "BufReadPre path/to/my-vault/**.md",
-- "BufNewFile path/to/my-vault/**.md",
-- },
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
},
opts = {
workspaces = {
{
name = "log",
path = "~/log",
},
},
completion = {
-- Set to false to disable completion.
nvim_cmp = true,
-- Trigger completion at 2 chars.
min_chars = 2,
},
mapping = {
-- Toggle check-boxes.
["<leader>oc"] = {
action = function()
return require("obsidian").util.toggle_checkbox()
end,
opts = { buffer = true },
},
-- Smart action depending on context, either follow link or toggle checkbox.
["<cr>"] = {
action = function()
return require("obsidian").util.smart_action()
end,
opts = { buffer = true, expr = true },
}
},
-- see below for full list of options 👇
note_id_func = function(title)
return title
-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
-- In this case a note with the title 'My new note' will be given an ID that looks
-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
-- local suffix = ""
-- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
-- if title ~= nil and title ~= "" then
-- -- If title is given, transform it into valid file name.
-- suffix = "-" .. title
-- else
-- -- If title is nil, just add 4 random uppercase letters to the suffix.
-- for _ = 1, 4 do
-- suffix = suffix .. string.char(math.random(65, 90))
-- end
-- suffix = "-" .. title
-- end
-- return tostring(os.time()) .. suffix
end,
-- Optional, for templates (see below).
templates = {
folder = "templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {},
},
},
},
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end,
init = function()
vim.g.mkdp_preview_options = {
mkit = {
}
}
end,
},
{
"nvim-telescope/telescope.nvim",
opts = function()
return require "configs.telescope"
end,
},
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release'
},
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
opts = function()
return require "configs.treesitter"
end,
},
{
'stevearc/aerial.nvim',
opts = {
},
-- Optional dependencies
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons"
},
},
-- {
-- 'numToStr/Comment.nvim',
-- lazy = true,
-- opts = {
-- opleader = {
-- ---Line-comment keymap
-- line = '<C-/>',
-- ---Block-comment keymap
-- block = 'gb',
-- },
-- }
-- },
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
--
{
"williamboman/mason.nvim",
opts = {
automatically_installation = true,
ensure_installed = {
"vim-language-server",
"lua-language-server",
"css-lsp",
"html-lsp",
"prettier",
"stylua",
},
},
},
{
'numToStr/Comment.nvim',
lazy = false,
opts = {
toggler = {
line = '<C-/>',
block = 'gb',
},
opleader = {
line = '<C-/>',
block = 'gb',
},
},
},
{
'tpope/vim-surround',
lazy = false,
},
{
"nvim-tree/nvim-tree.lua",
opts = function()
local opts = require "nvchad.configs.nvimtree"
opts.on_attach = function(bufnr)
local api = require("nvim-tree.api")
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set('n', 'l', api.node.open.edit, { buffer = bufnr, nowait = true })
vim.keymap.set('n', 'h', api.tree.change_root_to_parent, { buffer = bufnr, nowait = true })
end
return opts
end,
},
-- {
-- 'junegunn/goyo.vim',
-- lazy = false,
-- },
-- {
-- 'akinsho/bufferline.nvim',
-- lazy = false,
-- version = "*",
-- dependencies = 'nvim-tree/nvim-web-devicons'
-- }
}
|