aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/nvim/lua/plugins/init.lua
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-06-24 16:45:18 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-06-24 16:45:18 +0800
commit11863aa710ab0626eb76648d101854a481664a34 (patch)
treeed7d8331ceafbf8c5cc14304d0cd12e031eb2593 /vim/nvim/lua/plugins/init.lua
parent76c665e2b3c797c1b77e90337f5db1e77bf60a23 (diff)
Update
Diffstat (limited to 'vim/nvim/lua/plugins/init.lua')
-rw-r--r--vim/nvim/lua/plugins/init.lua218
1 files changed, 0 insertions, 218 deletions
diff --git a/vim/nvim/lua/plugins/init.lua b/vim/nvim/lua/plugins/init.lua
deleted file mode 100644
index 132f1a2..0000000
--- a/vim/nvim/lua/plugins/init.lua
+++ /dev/null
@@ -1,218 +0,0 @@
1return {
2
3 -- Detect tabstop and shiftwidth automatically
4 'tpope/vim-sleuth',
5
6 -- Use sudo in command mode
7 {
8 'lambdalisue/suda.vim',
9 cmd = { "SudaWrite" },
10 },
11
12 -- For focus mode
13 {
14 "Pocco81/true-zen.nvim",
15 cmd = { "TZAtaraxis", "TZMinimalist" },
16 },
17
18 -- hop.nvim: For quick jump
19 {
20 'smoka7/hop.nvim',
21 lazy = false,
22 version = "*",
23 opts = {
24 keys = 'etovxqpdygfblzhckisuran'
25 },
26 config = function()
27 require("hop").setup()
28 end
29 },
30
31 {
32 "stevearc/conform.nvim",
33 -- event = 'BufWritePre', -- uncomment for format on save
34 config = function()
35 require "configs.conform"
36 end,
37 },
38
39 {
40 -- Add indentation guides even on blank lines
41 'lukas-reineke/indent-blankline.nvim',
42 -- See `:help ibl`
43 enabled = false,
44 main = "ibl",
45 opts = {
46 indent = { char = "┊" },
47 whitespace = { highlight = { "Whitespace", "NonText" } },
48 },
49 },
50
51 {
52 'lewis6991/gitsigns.nvim',
53 opts = {
54 -- See `:help gitsigns.txt`
55 signs = {
56 add = { text = '+' },
57 change = { text = '~' },
58 delete = { text = '_' },
59 topdelete = { text = '‾' },
60 changedelete = { text = '~' },
61 },
62 on_attach = function(bufnr)
63 vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
64 { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
65 vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
66 vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
67 vim.keymap.set('n', '<leader>hd', require('gitsigns').diffthis, { buffer = bufnr, desc = '[h]unk [d]iff' })
68 vim.keymap.set('n', '<leader>hD', function() require('gitsigns').diffthis('~') end,
69 { buffer = bufnr, desc = '[h]unk [d]iff for ~' })
70 vim.keymap.set('v', 'hr', ":Gitsigns reset_hunk<CR>", { buffer = bufnr, desc = '[h]unk [r]eset' })
71 end,
72 },
73 },
74
75 {
76 "epwalsh/obsidian.nvim",
77 version = "*", -- recommended, use latest release instead of latest commit
78 lazy = true,
79 ft = "markdown",
80 -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
81 -- event = {
82 -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
83 -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
84 -- "BufReadPre path/to/my-vault/**.md",
85 -- "BufNewFile path/to/my-vault/**.md",
86 -- },
87 dependencies = {
88 -- Required.
89 "nvim-lua/plenary.nvim",
90 },
91 opts = {
92 workspaces = {
93 {
94 name = "log",
95 path = "~/log",
96 },
97 },
98 completion = {
99 -- Set to false to disable completion.
100 nvim_cmp = true,
101 -- Trigger completion at 2 chars.
102 min_chars = 2,
103 },
104 mapping = {
105 -- Toggle check-boxes.
106 ["<leader>oc"] = {
107 action = function()
108 return require("obsidian").util.toggle_checkbox()
109 end,
110 opts = { buffer = true },
111 },
112 -- Smart action depending on context, either follow link or toggle checkbox.
113 ["<cr>"] = {
114 action = function()
115 return require("obsidian").util.smart_action()
116 end,
117 opts = { buffer = true, expr = true },
118 }
119 },
120 -- see below for full list of options 👇
121 note_id_func = function(title)
122 return title
123 -- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
124 -- In this case a note with the title 'My new note' will be given an ID that looks
125 -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
126 -- local suffix = ""
127 -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
128 -- if title ~= nil and title ~= "" then
129 -- -- If title is given, transform it into valid file name.
130 -- suffix = "-" .. title
131 -- else
132 -- -- If title is nil, just add 4 random uppercase letters to the suffix.
133 -- for _ = 1, 4 do
134 -- suffix = suffix .. string.char(math.random(65, 90))
135 -- end
136 -- suffix = "-" .. title
137 -- end
138 -- return tostring(os.time()) .. suffix
139 end,
140 },
141 },
142
143 {
144 "iamcco/markdown-preview.nvim",
145 cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
146 ft = { "markdown" },
147 build = function() vim.fn["mkdp#util#install"]() end,
148 },
149
150 {
151 "nvim-telescope/telescope.nvim",
152 opts = function()
153 return require "configs.telescope"
154 end,
155 },
156
157 {
158 "nvim-treesitter/nvim-treesitter",
159 dependencies = {
160 'nvim-treesitter/nvim-treesitter-textobjects',
161 },
162 opts = function()
163 return require "configs.treesitter"
164 end,
165 },
166
167 {
168 'stevearc/aerial.nvim',
169 lazy = false,
170 event = { "BufReadPost", "BufWritePost", "BufNewFile" },
171 opts = {
172 on_attach = function(bufnr)
173 -- Jump forwards/backwards with '{' and '}'
174 vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
175 vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
176 vim.keymap.set("n", "<leader><leader>a", "<cmd>Telescope aerial<CR>")
177 vim.keymap.set("n", "<leader><leader>A", "<cmd>AerialToggle!left<CR>")
178 end,
179 },
180 -- Optional dependencies
181 dependencies = {
182 "nvim-treesitter/nvim-treesitter",
183 "nvim-tree/nvim-web-devicons"
184 },
185 },
186
187 -- {
188 -- 'numToStr/Comment.nvim',
189 -- lazy = true,
190 -- opts = {
191 -- opleader = {
192 -- ---Line-comment keymap
193 -- line = '<C-/>',
194 -- ---Block-comment keymap
195 -- block = 'gb',
196 -- },
197 -- }
198 -- },
199
200 -- These are some examples, uncomment them if you want to see them work!
201 -- {
202 -- "neovim/nvim-lspconfig",
203 -- config = function()
204 -- require("nvchad.configs.lspconfig").defaults()
205 -- require "configs.lspconfig"
206 -- end,
207 -- },
208 --
209 -- {
210 -- "williamboman/mason.nvim",
211 -- opts = {
212 -- ensure_installed = {
213 -- "lua-language-server", "stylua",
214 -- "html-lsp", "css-lsp" , "prettier"
215 -- },
216 -- },
217 -- },
218}