aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/lua/plugins/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'vim/lua/plugins/init.lua')
-rw-r--r--vim/lua/plugins/init.lua589
1 files changed, 302 insertions, 287 deletions
diff --git a/vim/lua/plugins/init.lua b/vim/lua/plugins/init.lua
index 393378a..7cff057 100644
--- a/vim/lua/plugins/init.lua
+++ b/vim/lua/plugins/init.lua
@@ -1,309 +1,324 @@
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 }, 97 config = function()
98 { 98 vim.keymap.del("n", "<leader>bd")
99 "epwalsh/obsidian.nvim", 99 end,
100 version = "*", -- recommended, use latest release instead of latest commit 100 },
101 lazy = true, 101 {
102 ft = "markdown", 102 "epwalsh/obsidian.nvim",
103 -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: 103 version = "*", -- recommended, use latest release instead of latest commit
104 -- event = { 104 lazy = true,
105 -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. 105 ft = "markdown",
106 -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md" 106 -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
107 -- "BufReadPre path/to/my-vault/**.md", 107 -- event = {
108 -- "BufNewFile path/to/my-vault/**.md", 108 -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
109 -- }, 109 -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
110 dependencies = { 110 -- "BufReadPre path/to/my-vault/**.md",
111 -- Required. 111 -- "BufNewFile path/to/my-vault/**.md",
112 "nvim-lua/plenary.nvim", 112 -- },
113 }, 113 dependencies = {
114 opts = { 114 -- Required.
115 workspaces = { 115 "nvim-lua/plenary.nvim",
116 { 116 },
117 name = "log", 117 opts = {
118 path = "~/log", 118 workspaces = {
119 }, 119 {
120 }, 120 name = "log",
121 completion = { 121 path = "~/log",
122 -- Set to false to disable completion. 122 },
123 nvim_cmp = true, 123 },
124 -- Trigger completion at 2 chars. 124 completion = {
125 min_chars = 2, 125 -- Set to false to disable completion.
126 }, 126 nvim_cmp = true,
127 mapping = { 127 -- Trigger completion at 2 chars.
128 -- Toggle check-boxes. 128 min_chars = 2,
129 ["<leader>oc"] = { 129 },
130 action = function() 130 mapping = {
131 return require("obsidian").util.toggle_checkbox() 131 -- Toggle check-boxes.
132 end, 132 ["<leader>oc"] = {
133 opts = { buffer = true }, 133 action = function()
134 }, 134 return require("obsidian").util.toggle_checkbox()
135 -- Smart action depending on context, either follow link or toggle checkbox. 135 end,
136 ["<cr>"] = { 136 opts = { buffer = true },
137 action = function() 137 },
138 return require("obsidian").util.smart_action() 138 -- Smart action depending on context, either follow link or toggle checkbox.
139 end, 139 ["<cr>"] = {
140 opts = { buffer = true, expr = true }, 140 action = function()
141 }, 141 return require("obsidian").util.smart_action()
142 }, 142 end,
143 -- see below for full list of options 👇 143 opts = { buffer = true, expr = true },
144 note_id_func = function(title) 144 },
145 return title 145 },
146 -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. 146 -- see below for full list of options 👇
147 -- In this case a note with the title 'My new note' will be given an ID that looks 147 note_id_func = function(title)
148 -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' 148 return title
149 -- local suffix = "" 149 -- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
150 -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() 150 -- In this case a note with the title 'My new note' will be given an ID that looks
151 -- if title ~= nil and title ~= "" then 151 -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
152 -- -- If title is given, transform it into valid file name. 152 -- local suffix = ""
153 -- suffix = "-" .. title 153 -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
154 -- else 154 -- if title ~= nil and title ~= "" then
155 -- -- If title is nil, just add 4 random uppercase letters to the suffix. 155 -- -- If title is given, transform it into valid file name.
156 -- for _ = 1, 4 do 156 -- suffix = "-" .. title
157 -- suffix = suffix .. string.char(math.random(65, 90)) 157 -- else
158 -- end 158 -- -- If title is nil, just add 4 random uppercase letters to the suffix.
159 -- suffix = "-" .. title 159 -- for _ = 1, 4 do
160 -- end 160 -- suffix = suffix .. string.char(math.random(65, 90))
161 -- return tostring(os.time()) .. suffix 161 -- end
162 end, 162 -- suffix = "-" .. title
163 -- Optional, for templates (see below). 163 -- end
164 templates = { 164 -- return tostring(os.time()) .. suffix
165 folder = "templates", 165 end,
166 date_format = "%Y-%m-%d", 166 -- Optional, for templates (see below).
167 time_format = "%H:%M", 167 templates = {
168 -- A map for custom variables, the key should be the variable and the value a function 168 folder = "templates",
169 substitutions = {}, 169 date_format = "%Y-%m-%d",
170 }, 170 time_format = "%H:%M",
171 }, 171 -- A map for custom variables, the key should be the variable and the value a function
172 config = function() 172 substitutions = {},
173 vim.keymap.set("n", "<leader>oo", ":Obsidian", { buffer = true }) 173 },
174 vim.keymap.set("n", "<leader>ot", ":ObsidianTags<CR>", { buffer = true }) 174 },
175 vim.keymap.set("n", "<leader>os", ":ObsidianSearch<CR>", { buffer = true }) 175 config = function()
176 vim.keymap.set("n", "<leader>oq", ":ObsidianQuickSwitch<CR>", { buffer = true }) 176 vim.keymap.set("n", "<leader>oo", ":Obsidian", { buffer = true })
177 vim.keymap.set("v", "<leader>on", ":ObsidianLinkNew<CR>", { buffer = true }) 177 vim.keymap.set("n", "<leader>ot", ":ObsidianTags<CR>", { buffer = true })
178 vim.keymap.set("n", "<leader>ol", ":ObsidianLinks<CR>", { buffer = true }) 178 vim.keymap.set("n", "<leader>os", ":ObsidianSearch<CR>", { buffer = true })
179 end, 179 vim.keymap.set("n", "<leader>oq", ":ObsidianQuickSwitch<CR>", { buffer = true })
180 }, 180 vim.keymap.set("v", "<leader>on", ":ObsidianLinkNew<CR>", { buffer = true })
181 vim.keymap.set("n", "<leader>ol", ":ObsidianLinks<CR>", { buffer = true })
182 end,
183 },
181 184
182 { 185 {
183 "iamcco/markdown-preview.nvim", 186 "iamcco/markdown-preview.nvim",
184 cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 187 cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
185 ft = { "markdown" }, 188 ft = { "markdown" },
186 build = function() 189 build = function()
187 vim.fn["mkdp#util#install"]() 190 vim.fn["mkdp#util#install"]()
188 end, 191 end,
189 init = function() 192 init = function()
190 vim.g.mkdp_preview_options = { 193 vim.g.mkdp_preview_options = {
191 mkit = {}, 194 mkit = {},
192 } 195 }
193 end, 196 end,
194 }, 197 },
195 198
196 { 199 {
197 "nvim-telescope/telescope.nvim", 200 "nvim-telescope/telescope.nvim",
198 opts = function() 201 opts = function()
199 return require("configs.telescope") 202 return require("configs.telescope")
200 end, 203 end,
201 }, 204 },
202 205
203 { 206 {
204 "nvim-telescope/telescope-fzf-native.nvim", 207 "nvim-telescope/telescope-fzf-native.nvim",
205 build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release", 208 build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
206 }, 209 },
207 210
208 { 211 {
209 "nvim-treesitter/nvim-treesitter", 212 "nvim-treesitter/nvim-treesitter",
210 dependencies = { 213 dependencies = {
211 "nvim-treesitter/nvim-treesitter-textobjects", 214 "nvim-treesitter/nvim-treesitter-textobjects",
212 }, 215 },
213 opts = function() 216 opts = function()
214 return require("configs.treesitter") 217 return require("configs.treesitter")
215 end, 218 end,
216 }, 219 },
217 220
218 { 221 {
219 "stevearc/aerial.nvim", 222 "stevearc/aerial.nvim",
220 opts = {}, 223 opts = {},
221 -- Optional dependencies 224 -- Optional dependencies
222 dependencies = { 225 dependencies = {
223 "nvim-treesitter/nvim-treesitter", 226 "nvim-treesitter/nvim-treesitter",
224 "nvim-tree/nvim-web-devicons", 227 "nvim-tree/nvim-web-devicons",
225 }, 228 },
226 }, 229 },
227 230
228 -- { 231 -- {
229 -- 'numToStr/Comment.nvim', 232 -- 'numToStr/Comment.nvim',
230 -- lazy = true, 233 -- lazy = true,
231 -- opts = { 234 -- opts = {
232 -- opleader = { 235 -- opleader = {
233 -- ---Line-comment keymap 236 -- ---Line-comment keymap
234 -- line = '<C-/>', 237 -- line = '<C-/>',
235 -- ---Block-comment keymap 238 -- ---Block-comment keymap
236 -- block = 'gb', 239 -- block = 'gb',
237 -- }, 240 -- },
238 -- } 241 -- }
239 -- }, 242 -- },
240 243
241 { 244 {
242 "neovim/nvim-lspconfig", 245 "neovim/nvim-lspconfig",
243 lazy = false, 246 lazy = false,
244 config = function() 247 config = function()
245 require("nvchad.configs.lspconfig").defaults() 248 require("nvchad.configs.lspconfig").defaults()
246 require("configs.lspconfig") 249 require("configs.lspconfig")
247 end, 250 end,
248 }, 251 },
249 -- 252 --
250 { 253 {
251 "williamboman/mason.nvim", 254 "williamboman/mason.nvim",
252 opts = { 255 opts = {
253 automatically_installation = true, 256 automatically_installation = true,
254 ensure_installed = { 257 ensure_installed = {
255 "vim-language-server", 258 "vim-language-server",
256 "lua-language-server", 259 "lua-language-server",
257 "css-lsp", 260 "css-lsp",
258 "html-lsp", 261 "html-lsp",
259 "prettier", 262 "prettier",
260 "stylua", 263 "stylua",
261 }, 264 },
262 }, 265 },
263 }, 266 },
264 267
265 { 268 {
266 "numToStr/Comment.nvim", 269 "numToStr/Comment.nvim",
267 lazy = false, 270 lazy = false,
268 opts = { 271 opts = {
269 toggler = { 272 toggler = {
270 line = "<C-/>", 273 line = "<C-/>",
271 block = "gb", 274 block = "gb",
272 }, 275 },
273 opleader = { 276 opleader = {
274 line = "<C-/>", 277 line = "<C-/>",
275 block = "gb", 278 block = "gb",
276 }, 279 },
277 }, 280 },
278 }, 281 },
279 282
280 { 283 {
281 "tpope/vim-surround", 284 "tpope/vim-surround",
282 lazy = false, 285 lazy = false,
283 }, 286 },
284 287
285 { 288 {
286 "nvim-tree/nvim-tree.lua", 289 "nvim-tree/nvim-tree.lua",
287 opts = function() 290 opts = function()
288 local opts = require("nvchad.configs.nvimtree") 291 local opts = require("nvchad.configs.nvimtree")
289 opts.on_attach = function(bufnr) 292 opts.on_attach = function(bufnr)
290 local api = require("nvim-tree.api") 293 local api = require("nvim-tree.api")
291 api.config.mappings.default_on_attach(bufnr) 294 api.config.mappings.default_on_attach(bufnr)
292 vim.keymap.set("n", "l", api.node.open.edit, { buffer = bufnr, nowait = true }) 295 vim.keymap.set("n", "l", api.node.open.edit, { buffer = bufnr, nowait = true })
293 vim.keymap.set("n", "h", api.tree.change_root_to_parent, { buffer = bufnr, nowait = true }) 296 vim.keymap.set("n", "h", api.tree.change_root_to_parent, { buffer = bufnr, nowait = true })
294 end 297 end
295 return opts 298 return opts
296 end, 299 end,
297 }, 300 },
298 -- {
299 -- 'junegunn/goyo.vim',
300 -- lazy = false,
301 -- },
302 301
303 -- { 302 {
304 -- 'akinsho/bufferline.nvim', 303 "folke/which-key.nvim",
305 -- lazy = false, 304 opts = {
306 -- version = "*", 305 presets = {
307 -- dependencies = 'nvim-tree/nvim-web-devicons' 306 windows = true, -- default bindings on <c-w>
308 -- } 307 nav = true, -- misc bindings to work with windows
308 z = true, -- bindings for folds, spelling and others prefixed with z
309 g = true, -- bindings for prefixed with g
310 },
311 },
312 },
313 -- {
314 -- 'junegunn/goyo.vim',
315 -- lazy = false,
316 -- },
317
318 -- {
319 -- 'akinsho/bufferline.nvim',
320 -- lazy = false,
321 -- version = "*",
322 -- dependencies = 'nvim-tree/nvim-web-devicons'
323 -- }
309} 324}