aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2025-01-13 15:52:11 +0100
committerphilw <dscr@duck.com>2025-01-13 15:52:11 +0100
commitc233e93c2552940d228be7adb077da47ef42761f (patch)
tree241b20fa2f0cf2818bd6bdb06b4b99bfa7e90bcc
parent783a40f4f430b2daec157e5396e5bd4d3ea65657 (diff)
downloadneovim-c233e93c2552940d228be7adb077da47ef42761f.tar.gz
neovim-c233e93c2552940d228be7adb077da47ef42761f.zip
Update config
-rw-r--r--.gitignore1
-rw-r--r--demos/sc1.pngbin493238 -> 0 bytes
-rw-r--r--init.lua445
-rw-r--r--lazy-lock.json21
-rw-r--r--lua/config/editor.lua86
-rw-r--r--lua/config/keymap.lua0
-rw-r--r--lua/config/lsp.lua64
-rw-r--r--lua/config/plugins.lua0
8 files changed, 212 insertions, 405 deletions
diff --git a/.gitignore b/.gitignore
index d7ad043..ba687da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
1plugin/ 1plugin/
2pack/
diff --git a/demos/sc1.png b/demos/sc1.png
deleted file mode 100644
index be01afb..0000000
--- a/demos/sc1.png
+++ /dev/null
Binary files differ
diff --git a/init.lua b/init.lua
index b6a456b..d5e104d 100644
--- a/init.lua
+++ b/init.lua
@@ -4,8 +4,6 @@ local keymap = vim.keymap
4 4
5vim.loader.enable() 5vim.loader.enable()
6 6
7-- vim.g.loaded_netrw = 1
8-- vim.g.loaded_netrwPlugin = 1
9vim.g.netrw_banner = 0 7vim.g.netrw_banner = 0
10vim.g.netrw_liststyle = 3 8vim.g.netrw_liststyle = 3
11vim.g.netrw_altv = 0 9vim.g.netrw_altv = 0
@@ -35,265 +33,230 @@ option.clipboard = "unnamedplus"
35option.termguicolors = true 33option.termguicolors = true
36option.fillchars = 'eob: ' 34option.fillchars = 'eob: '
37option.autoindent = true 35option.autoindent = true
36option.lazyredraw = false
37option.updatetime = 300
38option.timeoutlen = 500
39
40
41vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]
38 42
39vim.cmd([[ 43vim.cmd([[
40augroup RunPfOnSave 44augroup RunPfOnSave
41autocmd! 45autocmd!
42autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % 46autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write %
43autocmd BufWritePost *.tex silent! :VimtexCompile 47autocmd BufWritePost *.tex silent! :VimtexCompile
44" autocmd BufWritePost *.php silent! !php-cs-fixer fix %
45augroup END 48augroup END
46]]) 49]])
47 50
48 51
49vim.cmd([[ 52vim.cmd([[
50augroup AutoDeleteNetrwHiddenBuffers 53augroup AutoDeleteNetrwHiddenBuffers
51 au! 54au!
52 au FileType netrw setlocal bufhidden=wipe 55au FileType netrw setlocal bufhidden=wipe
53augroup end 56augroup end
54]]) 57]])
55 58
56vim.cmd([[ 59vim.cmd([[
57function! ToggleVExplorer() 60function! ToggleVExplorer()
58 if exists("t:expl_buf_num") 61if exists("t:expl_buf_num")
59 let expl_win_num = bufwinnr(t:expl_buf_num) 62 let expl_win_num = bufwinnr(t:expl_buf_num)
60 if expl_win_num != -1 63 if expl_win_num != -1
61 let cur_win_id = win_getid() 64 let cur_win_id = win_getid()
62 exec expl_win_num . 'windo close' 65 exec expl_win_num . 'windo close'
63 let prev_win_num = win_id2win(cur_win_id) 66 let prev_win_num = win_id2win(cur_win_id)
64 if prev_win_num != 0 67 if prev_win_num != 0
65 exec prev_win_num . 'wincmd w' 68 exec prev_win_num . 'wincmd w'
66 endif 69 endif
67 endif 70 endif
68 unlet t:expl_buf_num 71 unlet t:expl_buf_num
69 else 72 else
70 exec '1wincmd w' 73 exec '1wincmd w'
71 Vexplore 74 Vexplore
72 let t:expl_buf_num = bufnr("%") 75 let t:expl_buf_num = bufnr("%")
73 endif 76 endif
74endfunction 77 endfunction
75]]) 78 ]])
76 79
77 80
78-- Gui options 81 -- Gui options
79-- vim.o.guifont = "Fira Code:h7" 82 vim.g.vimtex_view_method = "zathura"
80vim.g.vimtex_view_method = "zathura" 83 vim.g.vimtex_compiler_method = "latexmk"
81vim.g.vimtex_compiler_method = "latexmk" 84 vim.g.vimtex_quickfix_mode = 0
82vim.g.vimtex_quickfix_mode = 0 85 vim.g.tex_conceal = "abdmg"
83vim.g.tex_conceal = "abdmg" 86 vim.g.tex_flavor = "latex"
84vim.g.tex_flavor = "latex" 87 vim.g.gitgutter_set_sign_backgrounds = 1
85vim.g.gitgutter_set_sign_backgrounds = 1 88
86 89
87 90 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
88local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 91 if not vim.loop.fs_stat(lazypath) then
89if not vim.loop.fs_stat(lazypath) then 92 vim.fn.system({
90 vim.fn.system({ 93 "git",
91 "git", 94 "clone",
92 "clone", 95 "--filter=blob:none",
93 "--filter=blob:none", 96 "https://github.com/folke/lazy.nvim.git",
94 "https://github.com/folke/lazy.nvim.git", 97 "--branch=stable",
95 "--branch=stable", -- latest stable release 98 lazypath,
96 lazypath, 99 })
97 }) 100 end
98end 101
99 102 vim.opt.rtp:prepend(lazypath)
100vim.opt.rtp:prepend(lazypath) 103 require("lazy").setup({
101require("lazy").setup({ 104 "airblade/vim-gitgutter",
102 "nvim-lua/plenary.nvim", 105 {"lervag/vimtex", lazy = true},
103 -- { 106 "norcalli/nvim-colorizer.lua",
104 -- 'barrientosvctor/abyss.nvim', 107 "nvim-treesitter/nvim-treesitter",
105 -- lazy = false, 108 {
106 -- priority = 1000, 109 "neovim/nvim-lspconfig",
107 -- opts = {} 110 lazy = false,
108 -- }, 111 dependencies = {
109 -- 'ryanoasis/vim-devicons', 112 { "ms-jpq/coq_nvim", branch = "coq" },
110 "airblade/vim-gitgutter", 113 { "ms-jpq/coq.artifacts", branch = "artifacts" },
111 "lervag/vimtex", 114 { 'ms-jpq/coq.thirdparty', branch = "3p" },
112 -- "nvim-tree/nvim-tree.lua", 115 "williamboman/mason.nvim",
113 "norcalli/nvim-colorizer.lua", 116 "williamboman/mason-lspconfig.nvim",
114 "nvim-treesitter/nvim-treesitter", 117 },
115 "neovim/nvim-lspconfig", 118 init = function()
116 "williamboman/mason.nvim", 119 vim.g.coq_settings = {
117 -- "nvim-tree/nvim-web-devicons", 120 auto_start = 'shut-up'
118 "williamboman/mason-lspconfig.nvim", 121 }
119 -- "iamcco/markdown-preview.nvim", 122 end,
120 -- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 123 config = function()
121 -- build = "cd app && yarn install", 124 end,
122 -- init = function() 125 },
123 -- vim.g.mkdp_filetypes = { "markdown" } 126 'nvim-telescope/telescope.nvim',
124 -- end, 127 lazy = true,
125 -- ft = { "markdown" } 128 tag = '0.1.5',
126 -- , 129 dependencies = { 'nvim-lua/plenary.nvim' },
127 -- { 130 {
128 -- 'nvimdev/lspsaga.nvim', 131 'nvim-telescope/telescope-fzf-native.nvim',
129 -- config = function() 132 lazy = true,
130 -- require('lspsaga').setup({}) 133 build =
131 -- end 134 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
132 -- }, 135 keys = {
133 'nvim-telescope/telescope.nvim', 136 { "<leader>/", false },
134 tag = '0.1.5', 137 { "<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
135 dependencies = { 'nvim-lua/plenary.nvim' }, 138 { "<leader>g", "<cmd>Telescope live_grep<cr>", desc = "Grep" },
136 { 139 { "<leader>b", "<cmd>Telescope buffers<cr>", desc = "Grep" },
137 'nvim-telescope/telescope-fzf-native.nvim', 140 { "<leader>s", "<cmd>Telescope buffers<cr>", desc = "Grep" },
138 build = 141 }
139 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', 142 }},
140 keys = { 143 {
141 { "<leader>/", false }, 144 'windwp/nvim-autopairs',
142 { "<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, 145 event = "InsertEnter",
143 { "<leader>g", "<cmd>Telescope live_grep<cr>", desc = "Grep" }, 146 opts = {}
144 { "<leader>b", "<cmd>Telescope buffers<cr>", desc = "Grep" }, 147 }
145 { "<leader>s", "<cmd>Telescope buffers<cr>", desc = "Grep" }, 148)
146 } 149
147 }, 150 require("colorizer").setup()
148 { 151
149 'windwp/nvim-autopairs', 152 vim.api.nvim_create_autocmd("BufWritePre", {
150 event = "InsertEnter", 153 callback = function()
151 154 vim.lsp.buf.format()
152 opts = {} 155 end,
153 }, 156 })
154 { 157
155 'numToStr/Comment.nvim', 158 local lsp_servers = {
156 opts = {}, 159 rust_analyzer = {
157 lazy = false, 160 imports = {
158 }, 161 granularity = {
159 162 group = 'module',
160 'ms-jpq/coq_nvim', 163 },
161 { 'ms-jpq/coq.artifacts', branch = "artifacts" }, 164 prefix = 'self',
162}) 165 },
163 166 cargo = {
164require("colorizer").setup() 167 buildScripts = {
165vim.api.nvim_create_autocmd('InsertEnter', { 168 enable = true,
166 command = 'COQnow --shut-up' 169 },
167}) 170 },
168 171 procMacro = {
169vim.api.nvim_create_autocmd("BufWritePre", { 172 enable = true,
170 callback = function() 173 },
171 vim.lsp.buf.format() 174 },
172 end, 175 }
173}) 176
174 177 require("mason").setup({
175local lsp_servers = { 178 ui = {
176 -- rust_analyzer = { 179 icons = {
177 -- imports = { 180 package_installed = "✓",
178 -- granularity = { 181 package_pending = "➜",
179 -- group = 'module', 182 package_uninstalled = "✗"
180 -- }, 183 }
181 -- prefix = 'self', 184 }
182 -- }, 185 })
183 -- cargo = { 186
184 -- buildScripts = { 187 local server_maps = function(opts)
185 -- enable = true, 188 end
186 -- }, 189
187 -- }, 190 for lsp, settings in pairs(lsp_servers) do
188 -- procMacro = { 191 require("lspconfig")[lsp].setup(coq.lsp_ensure_capabilities({
189 -- enable = true, 192 on_attach = function(_, buffer)
190 -- }, 193 server_maps({ buffer = buffer })
191 -- }, 194 end,
192} 195 settings = settings,
193 196 }))
194 197 end
195require("mason").setup() 198
196require("mason-lspconfig").setup { 199 vim.cmd([[
197 ensure_installed = lsp_servers, 200 highlight GitGutterAdd ctermbg=none guibg=none
198 automatic_installation = true, 201 highlight GitGutterDelete guibg=none ctermbg=none
199} 202 highlight GitGutterChange guibg=none ctermbg=none
200 203 highlight GitGutterChangeAdd guibg=none ctermbg=none
201local server_maps = function(opts) 204 highlight GitGutterChangeDelete guibg=none ctermbg=none
202 vim.keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) -- goto def 205 highlight NonText guifg=none
203 vim.keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts) -- see docs 206 highlight EndOfBuffer ctermfg=none ctermbg=none
204end 207 highlight Normal ctermbg=none guibg=none
205 208 highlight signcolumn ctermbg=none guibg=none
206for lsp, settings in pairs(lsp_servers) do 209 highlight StatusLine ctermbg=none guibg=none
207 require("lspconfig")[lsp].setup(coq.lsp_ensure_capabilities({ 210 highlight DiagnosticError ctermbg=none guibg=none
208 on_attach = function(_, buffer) 211 highlight DiagnosticWarn ctermbg=none guibg=none
209 server_maps({ buffer = buffer }) 212 highlight DiagnosticInfo ctermbg=none guibg=none
210 end, 213 highlight DiagnosticHint ctermbg=none guibg=none
211 settings = settings, 214 highlight Pmenu ctermbg=none guibg=none
212 })) 215
213end 216 highlight DiagnosticVirtualError ctermbg=none guibg=none
214 217 highlight DiagnosticVirtualWarn ctermbg=none guibg=none
215-- require("nvim-tree").setup({ 218 highlight DiagnosticVirtualInfo ctermbg=none guibg=none
216-- sort = { 219 highlight DiagnosticVirtualHint ctermbg=none guibg=none
217-- sorter = "case_sensitive", 220
218-- }, 221 highlight LspFloatWinNormal ctermbg=none guibg=none
219-- view = { 222 highlight NormalFloat ctermbg=none guibg=none
220-- width = 30, 223
221-- }, 224 highlight LineNr ctermbg=none guibg=none
222-- renderer = { 225 highlight StatusLineNc ctermbg=none guibg=none
223-- group_empty = true, 226 highlight StatusLineNc ctermfg=none guifg=none
224-- }, 227 highlight StatusLine ctermbg=none guibg=none
225-- filters = { 228 highlight StatusLine ctermfg=none guifg=none
226-- dotfiles = true, 229
227-- }, 230 highlight NvimTreeWinSeparator ctermfg=none guifg=none
228-- }) 231 highlight CursorColumn ctermfg=none guifg=none
229 232 highlight CursorLine ctermbg=none guibg=none
230 233
231-- require('abyss').setup({ 234 highlight VertSplit ctermbg=none guibg=none
232-- italic_comments = true, 235
233-- italic = true, 236 highlight DiagnosticVirtualTextError ctermbg=none guibg=none
234-- bold = true, 237 highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none
235-- transparent_background = true, 238 highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none
236-- overrides = {} 239 highlight DiagnosticVirtualTextHint ctermbg=none guibg=none
237-- }) 240 ]])
238 241
239-- vim.cmd.colorscheme("abyss") 242
240vim.cmd([[ 243
241highlight GitGutterAdd ctermbg=none guibg=none 244 vim.g.mapleader = " "
242highlight GitGutterDelete guibg=none ctermbg=none 245 keymap.set("n", "<leader>e", "<cmd>:call ToggleVExplorer() <cr>")
243highlight GitGutterChange guibg=none ctermbg=none 246 keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
244highlight GitGutterChangeAdd guibg=none ctermbg=none 247 keymap.set("n", "<leader>a", "ggVG")
245highlight GitGutterChangeDelete guibg=none ctermbg=none 248 keymap.set("n", "<leader>y", "cc")
246highlight NonText guifg=none 249 keymap.set("n", "<C-c>", "yy")
247highlight EndOfBuffer ctermfg=none ctermbg=none 250 keymap.set("n", "<C-v>", "p")
248highlight Normal ctermbg=none guibg=none 251 keymap.set("n", "<C-z>", "u")
249highlight signcolumn ctermbg=none guibg=none 252 keymap.set("v", "J", ":m '>+1<CR>gv=gv")
250highlight StatusLine ctermbg=none guibg=none 253 keymap.set("n", "j", "5j")
251highlight DiagnosticError ctermbg=none guibg=none 254 keymap.set("n", "k", "5k")
252highlight DiagnosticWarn ctermbg=none guibg=none 255 keymap.set("v", "K", ":m '<-2<CR>gv=gv")
253highlight DiagnosticInfo ctermbg=none guibg=none 256 keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<cr>")
254highlight DiagnosticHint ctermbg=none guibg=none 257 keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>")
255highlight Pmenu ctermbg=none guibg=none 258 keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>")
256 259 keymap.set("n", "<leader>t", "<cmd>Lspsaga term_toggle <cr>")
257highlight DiagnosticVirtualError ctermbg=none guibg=none 260 keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) -- goto def
258highlight DiagnosticVirtualWarn ctermbg=none guibg=none 261 keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts)
259highlight DiagnosticVirtualInfo ctermbg=none guibg=none
260highlight DiagnosticVirtualHint ctermbg=none guibg=none
261
262highlight LspFloatWinNormal ctermbg=none guibg=none
263highlight NormalFloat ctermbg=none guibg=none
264
265highlight LineNr ctermbg=none guibg=none
266highlight StatusLineNc ctermbg=none guibg=none
267highlight StatusLineNc ctermfg=none guifg=none
268highlight StatusLine ctermbg=none guibg=none
269highlight StatusLine ctermfg=none guifg=none
270
271highlight NvimTreeWinSeparator ctermfg=none guifg=none
272highlight CursorColumn ctermfg=none guifg=none
273highlight CursorLine ctermbg=none guibg=none
274
275highlight VertSplit ctermbg=none guibg=none
276
277highlight DiagnosticVirtualTextError ctermbg=none guibg=none
278highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none
279highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none
280highlight DiagnosticVirtualTextHint ctermbg=none guibg=none
281]])
282 262
283--Keybinds
284vim.g.mapleader = " "
285keymap.set("n", "<leader>e", "<cmd>:call ToggleVExplorer() <cr>")
286keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
287keymap.set("n", "<leader>a", "ggVG")
288keymap.set("n", "<leader>y", "cc")
289keymap.set("n", "<C-c>", "yy")
290keymap.set("n", "<C-v>", "p")
291keymap.set("n", "<C-z>", "u")
292keymap.set("v", "J", ":m '>+1<CR>gv=gv")
293keymap.set("n", "j", "5j")
294keymap.set("n", "k", "5k")
295keymap.set("v", "K", ":m '<-2<CR>gv=gv")
296keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<cr>")
297keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>")
298keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>")
299keymap.set("n", "<leader>t", "<cmd>Lspsaga term_toggle <cr>")
diff --git a/lazy-lock.json b/lazy-lock.json
index 3f99bfe..b0eeb4e 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -1,23 +1,16 @@
1{ 1{
2 "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
3 "abyss.nvim": { "branch": "main", "commit": "ba2b8fd54dedcbd77d4b950a600004bf9686575b" },
4 "coq.artifacts": { "branch": "artifacts", "commit": "a1ffcee295905171d87b40ee456001d45b10329b" }, 2 "coq.artifacts": { "branch": "artifacts", "commit": "a1ffcee295905171d87b40ee456001d45b10329b" },
3 "coq.thirdparty": { "branch": "3p", "commit": "12ce499eddf83b524e0540f6fa2e49dcaec6060c" },
5 "coq_nvim": { "branch": "coq", "commit": "976012b0c13763a47edbd55492ba53b03b498cdd" }, 4 "coq_nvim": { "branch": "coq", "commit": "976012b0c13763a47edbd55492ba53b03b498cdd" },
6 "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 5 "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
7 "lspsaga.nvim": { "branch": "main", "commit": "5fce15331ac6c3a3ec3ac91ab0e85ed82f5cbba0" }, 6 "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },
8 "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
9 "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
10 "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 7 "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
11 "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
12 "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, 8 "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
13 "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, 9 "nvim-lspconfig": { "branch": "master", "commit": "88157521e890fe7fdf18bee22438875edd6300a6" },
14 "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, 10 "nvim-treesitter": { "branch": "master", "commit": "29f96aafe1ec99f464732b4586af53d2953345bb" },
15 "nvim-treesitter": { "branch": "master", "commit": "4b222913486ec0a5983efa82b0649a2ab87cf1f0" },
16 "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" },
17 "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 11 "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
18 "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, 12 "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
19 "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, 13 "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
20 "vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
21 "vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" }, 14 "vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" },
22 "vimtex": { "branch": "master", "commit": "b8bb79b5fb27e9030ade92e75cd9375416f2c666" } 15 "vimtex": { "branch": "master", "commit": "adce3d38349925a0a891857c74bd4e8d1b8f80ab" }
23} 16}
diff --git a/lua/config/editor.lua b/lua/config/editor.lua
index 0649006..e69de29 100644
--- a/lua/config/editor.lua
+++ b/lua/config/editor.lua
@@ -1,86 +0,0 @@
1local option = vim.opt
2local keymap = vim.keymap
3
4--Basic Editor Setup
5option.nu = true
6option.tabstop = 2
7option.softtabstop = 2
8option.shiftwidth = 2
9option.expandtab = true
10option.smartindent = true
11option.wrap = false
12option.swapfile = false
13option.hlsearch = false
14option.incsearch = true
15option.updatetime = 50
16option.laststatus = 0
17option.signcolumn = "number"
18option.autoindent = true
19option.clipboard = "unnamedplus"
20option.termguicolors = false
21option.fillchars = 'eob: '
22
23-- Setup Editor Theme
24vim.cmd([[
25highlight GitGutterAdd ctermbg=none
26highlight GitGutterAdd guibg=none
27highlight NonText guifg=none
28highlight EndOfBuffer ctermfg=none ctermbg=none
29highlight Normal ctermbg=none
30highlight Normal guibg=none
31highlight signcolumn ctermbg=none
32highlight signcolumn guibg=none
33highlight StatusLine ctermbg=none
34highlight StatusLine guibg=none
35highlight DiagnosticError ctermbg=none
36highlight DiagnosticError guibg=none
37highlight DiagnosticWarn ctermbg=none
38highlight DiagnosticWarn guibg=none
39highlight DiagnosticInfo ctermbg=none
40highlight DiagnosticInfo guibg=none
41highlight DiagnosticHint ctermbg=none
42highlight DiagnosticHint guibg=none
43
44highlight DiagnosticVirtualError ctermbg=none
45highlight DiagnosticVirtualError guibg=none
46highlight DiagnosticVirtualWarn ctermbg=none
47highlight DiagnosticVirtualWarn guibg=none
48highlight DiagnosticVirtualInfo ctermbg=none
49highlight DiagnosticVirtualInfo guibg=none
50highlight DiagnosticVirtualHint ctermbg=none
51highlight DiagnosticVirtualHint guibg=none
52
53highlight DiagnosticVirtualTextError ctermbg=none
54highlight DiagnosticVirtualTextError guibg=none
55highlight DiagnosticVirtualTextWarn ctermbg=none
56highlight DiagnosticVirtualTextWarn guibg=none
57highlight DiagnosticVirtualTextInfo ctermbg=none
58highlight DiagnosticVirtualTextInfo guibg=none
59highlight DiagnosticVirtualTextHint ctermbg=none
60highlight DiagnosticVirtualTextHint guibg=none
61]])
62
63-- run specific commands after different file extensions
64vim.cmd([[
65augroup RunPfOnSave
66autocmd!
67autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write %
68autocmd BufWritePost *.tex silent! :VimtexCompile
69autocmd BufWritePost *.md silent! :MarkdownPreview
70autocmd BufWritePost *.php silent! !php-cs-fixer fix %
71augroup END
72]])
73
74-- Gui options
75vim.o.guifont = "Fira Code:h7"
76vim.g.vimtex_view_method = "zathura"
77vim.g.vimtex_compiler_method = "latexrun"
78vim.g.gitgutter_set_sign_backgrounds = 1
79
80--Keybinds
81vim.g.mapleader = " "
82keymap.set("n", "<leader>e", vim.cmd.Ex)
83keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
84keymap.set("n", "<leader>a", "ggVG")
85keymap.set("v", "J", ":m '>+1<CR>gv=gv")
86keymap.set("v", "K", ":m '<-2<CR>gv=gv")
diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lua/config/keymap.lua
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index 7fd0ddb..e69de29 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -1,64 +0,0 @@
1-- local lsp = require('lsp-zero')
2
3--local lsp_zero = require("lsp-zero")
4--local cmp = require("cmp")
5--require("luasnip.loaders.from_vscode").lazy_load()
6
7--lsp_zero.preset("recommended")
8--lsp_zero.setup()
9--lsp_zero.on_attach(function(client_id, bufnr)
10-- lsp_zero.default_keymaps({ buffer = bufnr })
11--end)
12
13--require("mason").setup({})
14--require("mason-lspconfig").setup({
15-- ensure_installed = { "clangd", "rust_analyzer" },
16-- handlers = {
17-- lsp_zero.default_setup,
18-- },
19--})
20
21--cmp.setup({
22-- snippet = {
23-- expand = function(args)
24-- require("luasnip").lsp_expand(args.body)
25-- end,
26-- },
27-- window = {},
28-- mapping = cmp.mapping.preset.insert({
29-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
30-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
31-- ["<C-Space>"] = cmp.mapping.complete(),
32-- ["<C-e>"] = cmp.mapping.abort(),
33-- ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
34-- }),
35-- sources = cmp.config.sources({
36-- { name = "nvim_lsp" },
37-- { name = "luasnip" },
38-- }, {
39-- { name = "buffer" },
40-- }),
41--})
42
43--function PrintDiagnostics(opts, bufnr, line_nr, client_id)
44-- bufnr = bufnr or 0
45-- line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1)
46-- opts = opts or { ["lnum"] = line_nr }
47--
48-- local line_diagnostics = vim.diagnostic.get(bufnr, opts)
49-- if vim.tbl_isempty(line_diagnostics) then
50-- return
51-- end
52--
53-- local diagnostic_message = ""
54-- for i, diagnostic in ipairs(line_diagnostics) do
55-- diagnostic_message = diagnostic_message .. string.format("%d: %s", i, diagnostic.message or "")
56-- print(diagnostic_message)
57-- if i ~= #line_diagnostics then
58-- diagnostic_message = diagnostic_message .. "\n"
59-- end
60-- end
61-- vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {})
62--end
63
64--vim.cmd([[ autocmd! CursorHold * lua PrintDiagnostics() ]])
diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lua/config/plugins.lua