aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'vim/lua')
-rw-r--r--vim/lua/plugins/init.lua620
1 files changed, 310 insertions, 310 deletions
diff --git a/vim/lua/plugins/init.lua b/vim/lua/plugins/init.lua
index 03a7d46..6f6e044 100644
--- a/vim/lua/plugins/init.lua
+++ b/vim/lua/plugins/init.lua
@@ -1,334 +1,334 @@
1return { 1return {
2 2
3 -- Detect tabstop and shiftwidth automatically 3 -- Detect tabstop and shiftwidth automatically
4 "tpope/vim-sleuth", 4 "tpope/vim-sleuth",
5 5
6 -- Use sudo in command mode 6 -- Use sudo in command mode
7 { 7 {
8 "lambdalisue/suda.vim", 8 "lambdalisue/suda.vim",
9 cmd = { "SudaWrite" }, 9 cmd = { "SudaWrite" },
10 }, 10 },
11 11
12 -- For focus mode 12 -- For focus mode
13 { 13 {
14 "Pocco81/true-zen.nvim", 14 "Pocco81/true-zen.nvim",
15 lazy = false, 15 lazy = false,
16 cmd = { "TZAtaraxis", "TZMinimalist" }, 16 cmd = { "TZAtaraxis", "TZMinimalist" },
17 }, 17 },
18 18
19 -- hop.nvim: For quick jump 19 -- hop.nvim: For quick jump
20 { 20 {
21 "smoka7/hop.nvim", 21 "smoka7/hop.nvim",
22 lazy = false, 22 lazy = false,
23 version = "*", 23 version = "*",
24 opts = { 24 opts = {
25 keys = "etovxqpdygfblzhckisuran", 25 keys = "etovxqpdygfblzhckisuran",
26 }, 26 },
27 config = function() 27 config = function()
28 require("hop").setup() 28 require("hop").setup()
29 end, 29 end,
30 }, 30 },
31 31
32 { 32 {
33 "stevearc/conform.nvim", 33 "stevearc/conform.nvim",
34 lazy = false, 34 lazy = false,
35 -- event = 'BufWritePre', -- uncomment for format on save 35 -- event = 'BufWritePre', -- uncomment for format on save
36 config = function() 36 config = function()
37 require("configs.conform") 37 require("configs.conform")
38 38
39 vim.keymap.set("n", "<leader>F", function() 39 vim.keymap.set("n", "<leader>F", function()
40 require("conform").format({ lsp_fallback = true }) 40 require("conform").format({ lsp_fallback = true })
41 end, { desc = "format files" }) 41 end, { desc = "format files" })
42 end, 42 end,
43 }, 43 },
44 44
45 { 45 {
46 -- Add indentation guides even on blank lines 46 -- Add indentation guides even on blank lines
47 "lukas-reineke/indent-blankline.nvim", 47 "lukas-reineke/indent-blankline.nvim",
48 -- See `:help ibl` 48 -- See `:help ibl`
49 enabled = true, 49 enabled = true,
50 main = "ibl", 50 main = "ibl",
51 opts = { 51 opts = {
52 indent = { char = "┊" }, 52 indent = { char = "┊" },
53 whitespace = { highlight = { "Whitespace", "NonText" } }, 53 whitespace = { highlight = { "Whitespace", "NonText" } },
54 }, 54 },
55 }, 55 },
56 56
57 { 57 {
58 "lewis6991/gitsigns.nvim", 58 "lewis6991/gitsigns.nvim",
59 opts = function() 59 opts = function()
60 return { 60 return {
61 -- See `:help gitsigns.txt` 61 -- See `:help gitsigns.txt`
62 signs = { 62 signs = {
63 add = { text = "+" }, 63 add = { text = "+" },
64 change = { text = "~" }, 64 change = { text = "~" },
65 delete = { text = "_" }, 65 delete = { text = "_" },
66 topdelete = { text = "‾" }, 66 topdelete = { text = "‾" },
67 changedelete = { text = "~" }, 67 changedelete = { text = "~" },
68 }, 68 },
69 on_attach = function(bufnr) 69 on_attach = function(bufnr)
70 local gs = require("gitsigns") 70 local gs = require("gitsigns")
71 vim.keymap.set( 71 vim.keymap.set(
72 "n", 72 "n",
73 "<leader>gp", 73 "<leader>gp",
74 gs.prev_hunk, 74 gs.prev_hunk,
75 { buffer = bufnr, desc = "[G]o to [P]revious Hunk" } 75 { buffer = bufnr, desc = "[G]o to [P]revious Hunk" }
76 ) 76 )
77 vim.keymap.set("n", "<leader>gn", gs.next_hunk, { buffer = bufnr, desc = "[G]o to [N]ext Hunk" }) 77 vim.keymap.set("n", "<leader>gn", gs.next_hunk, { buffer = bufnr, desc = "[G]o to [N]ext Hunk" })
78 vim.keymap.set("n", "<leader>hp", gs.preview_hunk, { buffer = bufnr, desc = "[P]review [H]unk" }) 78 vim.keymap.set("n", "<leader>hp", gs.preview_hunk, { buffer = bufnr, desc = "[P]review [H]unk" })
79 vim.keymap.set("n", "<leader>hd", gs.diffthis, { buffer = bufnr, desc = "[h]unk [d]iff" }) 79 vim.keymap.set("n", "<leader>hd", gs.diffthis, { buffer = bufnr, desc = "[h]unk [d]iff" })
80 vim.keymap.set("n", "<leader>hD", function() 80 vim.keymap.set("n", "<leader>hD", function()
81 gs.diffthis("~") 81 gs.diffthis("~")
82 end, { buffer = bufnr, desc = "[h]unk [d]iff for ~" }) 82 end, { buffer = bufnr, desc = "[h]unk [d]iff for ~" })
83 -- vim.keymap.set("n", "<leader>gb", gs.blame_line{full=true}, { desc = "Git Blame" }) 83 -- vim.keymap.set("n", "<leader>gb", gs.blame_line{full=true}, { desc = "Git Blame" })
84 vim.keymap.set("n", "<leader>gb", gs.toggle_current_line_blame, { desc = "Blame Line" }) 84 vim.keymap.set("n", "<leader>gb", gs.toggle_current_line_blame, { desc = "Blame Line" })
85 vim.keymap.set("v", "hr", gs.reset_hunk, { buffer = bufnr, desc = "[h]unk [r]eset" }) 85 vim.keymap.set("v", "hr", gs.reset_hunk, { buffer = bufnr, desc = "[h]unk [r]eset" })
86 end, 86 end,
87 } 87 }
88 end, 88 end,
89 }, 89 },
90 90
91 { 91 {
92 "iberianpig/tig-explorer.vim", 92 "iberianpig/tig-explorer.vim",
93 lazy = false, 93 lazy = false,
94 dependencies = { 94 dependencies = {
95 "rbgrouleff/bclose.vim", 95 "rbgrouleff/bclose.vim",
96 }, 96 },
97 config = function() 97 config = function()
98 vim.keymap.del("n", "<leader>bd") 98 vim.keymap.del("n", "<leader>bd")
99 end, 99 end,
100 }, 100 },
101 { 101 {
102 "epwalsh/obsidian.nvim", 102 "epwalsh/obsidian.nvim",
103 version = "*", -- recommended, use latest release instead of latest commit 103 version = "*", -- recommended, use latest release instead of latest commit
104 lazy = true, 104 lazy = true,
105 ft = "markdown", 105 ft = "markdown",
106 -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: 106 -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
107 -- event = { 107 -- event = {
108 -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. 108 -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
109 -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md" 109 -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
110 -- "BufReadPre path/to/my-vault/**.md", 110 -- "BufReadPre path/to/my-vault/**.md",
111 -- "BufNewFile path/to/my-vault/**.md", 111 -- "BufNewFile path/to/my-vault/**.md",
112 -- }, 112 -- },
113 dependencies = { 113 dependencies = {
114 -- Required. 114 -- Required.
115 "nvim-lua/plenary.nvim", 115 "nvim-lua/plenary.nvim",
116 }, 116 },
117 opts = { 117 opts = {
118 workspaces = { 118 workspaces = {
119 { 119 {
120 name = "log", 120 name = "log",
121 path = "~/log", 121 path = "~/log",
122 }, 122 },
123 }, 123 },
124 completion = { 124 completion = {
125 -- Set to false to disable completion. 125 -- Set to false to disable completion.
126 nvim_cmp = true, 126 nvim_cmp = true,
127 -- Trigger completion at 2 chars. 127 -- Trigger completion at 2 chars.
128 min_chars = 2, 128 min_chars = 2,
129 }, 129 },
130 mapping = { 130 mapping = {
131 -- Toggle check-boxes. 131 -- Toggle check-boxes.
132 ["<leader>oc"] = { 132 ["<leader>oc"] = {
133 action = function() 133 action = function()
134 return require("obsidian").util.toggle_checkbox() 134 return require("obsidian").util.toggle_checkbox()
135 end, 135 end,
136 opts = { buffer = true }, 136 opts = { buffer = true },
137 }, 137 },
138 -- Smart action depending on context, either follow link or toggle checkbox. 138 -- Smart action depending on context, either follow link or toggle checkbox.
139 ["<cr>"] = { 139 ["<cr>"] = {
140 action = function() 140 action = function()
141 return require("obsidian").util.smart_action() 141 return require("obsidian").util.smart_action()
142 end, 142 end,
143 opts = { buffer = true, expr = true }, 143 opts = { buffer = true, expr = true },
144 }, 144 },
145 }, 145 },
146 -- see below for full list of options 👇 146 -- see below for full list of options 👇
147 note_id_func = function(title) 147 note_id_func = function(title)
148 return title 148 return title
149 -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. 149 -- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
150 -- In this case a note with the title 'My new note' will be given an ID that looks 150 -- In this case a note with the title 'My new note' will be given an ID that looks
151 -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' 151 -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
152 -- local suffix = "" 152 -- local suffix = ""
153 -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() 153 -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
154 -- if title ~= nil and title ~= "" then 154 -- if title ~= nil and title ~= "" then
155 -- -- If title is given, transform it into valid file name. 155 -- -- If title is given, transform it into valid file name.
156 -- suffix = "-" .. title 156 -- suffix = "-" .. title
157 -- else 157 -- else
158 -- -- If title is nil, just add 4 random uppercase letters to the suffix. 158 -- -- If title is nil, just add 4 random uppercase letters to the suffix.
159 -- for _ = 1, 4 do 159 -- for _ = 1, 4 do
160 -- suffix = suffix .. string.char(math.random(65, 90)) 160 -- suffix = suffix .. string.char(math.random(65, 90))
161 -- end 161 -- end
162 -- suffix = "-" .. title 162 -- suffix = "-" .. title
163 -- end 163 -- end
164 -- return tostring(os.time()) .. suffix 164 -- return tostring(os.time()) .. suffix
165 end, 165 end,
166 -- Optional, for templates (see below). 166 -- Optional, for templates (see below).
167 templates = { 167 templates = {
168 folder = "templates", 168 folder = "templates",
169 date_format = "%Y-%m-%d", 169 date_format = "%Y-%m-%d",
170 time_format = "%H:%M", 170 time_format = "%H:%M",
171 -- A map for custom variables, the key should be the variable and the value a function 171 -- A map for custom variables, the key should be the variable and the value a function
172 substitutions = {}, 172 substitutions = {},
173 }, 173 },
174 }, 174 },
175 config = function() 175 config = function()
176 vim.keymap.set("n", "<leader>oo", ":Obsidian", { buffer = true }) 176 vim.keymap.set("n", "<leader>oo", ":Obsidian", { buffer = true })
177 vim.keymap.set("n", "<leader>ot", ":ObsidianTags<CR>", { buffer = true }) 177 vim.keymap.set("n", "<leader>ot", ":ObsidianTags<CR>", { buffer = true })
178 vim.keymap.set("n", "<leader>os", ":ObsidianSearch<CR>", { buffer = true }) 178 vim.keymap.set("n", "<leader>os", ":ObsidianSearch<CR>", { buffer = true })
179 vim.keymap.set("n", "<leader>oq", ":ObsidianQuickSwitch<CR>", { buffer = true }) 179 vim.keymap.set("n", "<leader>oq", ":ObsidianQuickSwitch<CR>", { buffer = true })
180 vim.keymap.set("v", "<leader>on", ":ObsidianLinkNew<CR>", { buffer = true }) 180 vim.keymap.set("v", "<leader>on", ":ObsidianLinkNew<CR>", { buffer = true })
181 vim.keymap.set("n", "<leader>ol", ":ObsidianLinks<CR>", { buffer = true }) 181 vim.keymap.set("n", "<leader>ol", ":ObsidianLinks<CR>", { buffer = true })
182 end, 182 end,
183 }, 183 },
184 184
185 { 185 {
186 "iamcco/markdown-preview.nvim", 186 "iamcco/markdown-preview.nvim",
187 cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 187 cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
188 ft = { "markdown" }, 188 ft = { "markdown" },
189 build = function() 189 build = function()
190 vim.fn["mkdp#util#install"]() 190 vim.fn["mkdp#util#install"]()
191 end, 191 end,
192 init = function() 192 init = function()
193 vim.g.mkdp_preview_options = { 193 vim.g.mkdp_preview_options = {
194 mkit = { breaks = true }, 194 mkit = { breaks = true },
195 toc = { 195 toc = {
196 containerClass = "toc", 196 containerClass = "toc",
197 format = "function format(x, htmlencode) { return `<span>${htmlencode(x)}</span>`; }", 197 format = "function format(x, htmlencode) { return `<span>${htmlencode(x)}</span>`; }",
198 callback = "console.log('foo')", 198 callback = "console.log('foo')",
199 }, 199 },
200 } 200 }
201 vim.cmd("let g:mkdp_browser = 'firefox'") 201 vim.cmd("let g:mkdp_browser = 'firefox'")
202 end, 202 end,
203 }, 203 },
204 204
205 { 205 {
206 "nvim-telescope/telescope.nvim", 206 "nvim-telescope/telescope.nvim",
207 opts = function() 207 opts = function()
208 return require("configs.telescope") 208 return require("configs.telescope")
209 end, 209 end,
210 }, 210 },
211 211
212 { 212 {
213 "nvim-telescope/telescope-fzf-native.nvim", 213 "nvim-telescope/telescope-fzf-native.nvim",
214 build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release", 214 build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
215 }, 215 },
216 216
217 { 217 {
218 "nvim-treesitter/nvim-treesitter", 218 "nvim-treesitter/nvim-treesitter",
219 dependencies = { 219 dependencies = {
220 "nvim-treesitter/nvim-treesitter-textobjects", 220 "nvim-treesitter/nvim-treesitter-textobjects",
221 }, 221 },
222 opts = function() 222 opts = function()
223 return require("configs.treesitter") 223 return require("configs.treesitter")
224 end, 224 end,
225 }, 225 },
226 226
227 { 227 {
228 "stevearc/aerial.nvim", 228 "stevearc/aerial.nvim",
229 opts = {}, 229 opts = {},
230 -- Optional dependencies 230 -- Optional dependencies
231 dependencies = { 231 dependencies = {
232 "nvim-treesitter/nvim-treesitter", 232 "nvim-treesitter/nvim-treesitter",
233 "nvim-tree/nvim-web-devicons", 233 "nvim-tree/nvim-web-devicons",
234 }, 234 },
235 }, 235 },
236 236
237 -- { 237 -- {
238 -- 'numToStr/Comment.nvim', 238 -- 'numToStr/Comment.nvim',
239 -- lazy = true, 239 -- lazy = true,
240 -- opts = { 240 -- opts = {
241 -- opleader = { 241 -- opleader = {
242 -- ---Line-comment keymap 242 -- ---Line-comment keymap
243 -- line = '<C-/>', 243 -- line = '<C-/>',
244 -- ---Block-comment keymap 244 -- ---Block-comment keymap
245 -- block = 'gb', 245 -- block = 'gb',
246 -- }, 246 -- },
247 -- } 247 -- }
248 -- }, 248 -- },
249 249
250 { 250 {
251 "neovim/nvim-lspconfig", 251 "neovim/nvim-lspconfig",
252 lazy = false, 252 lazy = false,
253 config = function() 253 config = function()
254 require("nvchad.configs.lspconfig").defaults() 254 require("nvchad.configs.lspconfig").defaults()
255 require("configs.lspconfig") 255 require("configs.lspconfig")
256 end, 256 end,
257 }, 257 },
258 -- 258 --
259 { 259 {
260 "williamboman/mason.nvim", 260 "williamboman/mason.nvim",
261 opts = { 261 opts = {
262 automatically_installation = true, 262 automatically_installation = true,
263 ensure_installed = { 263 ensure_installed = {
264 "vim-language-server", 264 "vim-language-server",
265 "lua-language-server", 265 "lua-language-server",
266 "css-lsp", 266 "css-lsp",
267 "html-lsp", 267 "html-lsp",
268 "prettier", 268 "prettier",
269 "stylua", 269 "stylua",
270 }, 270 },
271 }, 271 },
272 }, 272 },
273 273
274 { 274 {
275 "numToStr/Comment.nvim", 275 "numToStr/Comment.nvim",
276 lazy = false, 276 lazy = false,
277 opts = { 277 opts = {
278 toggler = { 278 toggler = {
279 line = "<C-/>", 279 line = "<C-/>",
280 block = "gb", 280 block = "gb",
281 }, 281 },
282 opleader = { 282 opleader = {
283 line = "<C-/>", 283 line = "<C-/>",
284 block = "gb", 284 block = "gb",
285 }, 285 },
286 }, 286 },
287 }, 287 },
288 288
289 { 289 {
290 "tpope/vim-surround", 290 "tpope/vim-surround",
291 lazy = false, 291 lazy = false,
292 config = function() 292 config = function()
293 vim.cmd("vmap s S") 293 vim.cmd("vmap s S")
294 end, 294 end,
295 }, 295 },
296 296
297 { 297 {
298 "nvim-tree/nvim-tree.lua", 298 "nvim-tree/nvim-tree.lua",
299 opts = function() 299 opts = function()
300 local opts = require("nvchad.configs.nvimtree") 300 local opts = require("nvchad.configs.nvimtree")
301 opts.on_attach = function(bufnr) 301 opts.on_attach = function(bufnr)
302 local api = require("nvim-tree.api") 302 local api = require("nvim-tree.api")
303 api.config.mappings.default_on_attach(bufnr) 303 api.config.mappings.default_on_attach(bufnr)
304 vim.keymap.set("n", "l", api.node.open.edit, { buffer = bufnr, nowait = true }) 304 vim.keymap.set("n", "l", api.node.open.edit, { buffer = bufnr, nowait = true })
305 vim.keymap.set("n", "h", api.tree.change_root_to_parent, { buffer = bufnr, nowait = true }) 305 vim.keymap.set("n", "h", api.tree.change_root_to_parent, { buffer = bufnr, nowait = true })
306 end 306 end
307 return opts 307 return opts
308 end, 308 end,
309 }, 309 },
310 310
311 { 311 {
312 "folke/which-key.nvim", 312 "folke/which-key.nvim",
313 lazy = false, 313 lazy = false,
314 opts = { 314 opts = {
315 presets = { 315 presets = {
316 windows = true, -- default bindings on <c-w> 316 windows = true, -- default bindings on <c-w>
317 nav = true, -- misc bindings to work with windows 317 nav = true, -- misc bindings to work with windows
318 z = true, -- bindings for folds, spelling and others prefixed with z 318 z = true, -- bindings for folds, spelling and others prefixed with z
319 g = true, -- bindings for prefixed with g 319 g = true, -- bindings for prefixed with g
320 }, 320 },
321 }, 321 },
322 }, 322 },
323 -- { 323 -- {
324 -- 'junegunn/goyo.vim', 324 -- 'junegunn/goyo.vim',
325 -- lazy = false, 325 -- lazy = false,
326 -- }, 326 -- },
327 327
328 -- { 328 -- {
329 -- 'akinsho/bufferline.nvim', 329 -- 'akinsho/bufferline.nvim',
330 -- lazy = false, 330 -- lazy = false,
331 -- version = "*", 331 -- version = "*",
332 -- dependencies = 'nvim-tree/nvim-web-devicons' 332 -- dependencies = 'nvim-tree/nvim-web-devicons'
333 -- } 333 -- }
334} 334}