diff options
| author | philw <dscr@duck.com> | 2025-01-13 15:52:11 +0100 |
|---|---|---|
| committer | philw <dscr@duck.com> | 2025-01-13 15:52:11 +0100 |
| commit | c233e93c2552940d228be7adb077da47ef42761f (patch) | |
| tree | 241b20fa2f0cf2818bd6bdb06b4b99bfa7e90bcc | |
| parent | 783a40f4f430b2daec157e5396e5bd4d3ea65657 (diff) | |
| download | neovim-c233e93c2552940d228be7adb077da47ef42761f.tar.gz neovim-c233e93c2552940d228be7adb077da47ef42761f.zip | |
Update config
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | demos/sc1.png | bin | 493238 -> 0 bytes | |||
| -rw-r--r-- | init.lua | 445 | ||||
| -rw-r--r-- | lazy-lock.json | 21 | ||||
| -rw-r--r-- | lua/config/editor.lua | 86 | ||||
| -rw-r--r-- | lua/config/keymap.lua | 0 | ||||
| -rw-r--r-- | lua/config/lsp.lua | 64 | ||||
| -rw-r--r-- | lua/config/plugins.lua | 0 |
8 files changed, 212 insertions, 405 deletions
| @@ -1 +1,2 @@ | |||
| 1 | plugin/ | 1 | plugin/ |
| 2 | pack/ | ||
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 | |||
| @@ -4,8 +4,6 @@ local keymap = vim.keymap | |||
| 4 | 4 | ||
| 5 | vim.loader.enable() | 5 | vim.loader.enable() |
| 6 | 6 | ||
| 7 | -- vim.g.loaded_netrw = 1 | ||
| 8 | -- vim.g.loaded_netrwPlugin = 1 | ||
| 9 | vim.g.netrw_banner = 0 | 7 | vim.g.netrw_banner = 0 |
| 10 | vim.g.netrw_liststyle = 3 | 8 | vim.g.netrw_liststyle = 3 |
| 11 | vim.g.netrw_altv = 0 | 9 | vim.g.netrw_altv = 0 |
| @@ -35,265 +33,230 @@ option.clipboard = "unnamedplus" | |||
| 35 | option.termguicolors = true | 33 | option.termguicolors = true |
| 36 | option.fillchars = 'eob: ' | 34 | option.fillchars = 'eob: ' |
| 37 | option.autoindent = true | 35 | option.autoindent = true |
| 36 | option.lazyredraw = false | ||
| 37 | option.updatetime = 300 | ||
| 38 | option.timeoutlen = 500 | ||
| 39 | |||
| 40 | |||
| 41 | vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]] | ||
| 38 | 42 | ||
| 39 | vim.cmd([[ | 43 | vim.cmd([[ |
| 40 | augroup RunPfOnSave | 44 | augroup RunPfOnSave |
| 41 | autocmd! | 45 | autocmd! |
| 42 | autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % | 46 | autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % |
| 43 | autocmd BufWritePost *.tex silent! :VimtexCompile | 47 | autocmd BufWritePost *.tex silent! :VimtexCompile |
| 44 | " autocmd BufWritePost *.php silent! !php-cs-fixer fix % | ||
| 45 | augroup END | 48 | augroup END |
| 46 | ]]) | 49 | ]]) |
| 47 | 50 | ||
| 48 | 51 | ||
| 49 | vim.cmd([[ | 52 | vim.cmd([[ |
| 50 | augroup AutoDeleteNetrwHiddenBuffers | 53 | augroup AutoDeleteNetrwHiddenBuffers |
| 51 | au! | 54 | au! |
| 52 | au FileType netrw setlocal bufhidden=wipe | 55 | au FileType netrw setlocal bufhidden=wipe |
| 53 | augroup end | 56 | augroup end |
| 54 | ]]) | 57 | ]]) |
| 55 | 58 | ||
| 56 | vim.cmd([[ | 59 | vim.cmd([[ |
| 57 | function! ToggleVExplorer() | 60 | function! ToggleVExplorer() |
| 58 | if exists("t:expl_buf_num") | 61 | if 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 |
| 74 | endfunction | 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" |
| 80 | vim.g.vimtex_view_method = "zathura" | 83 | vim.g.vimtex_compiler_method = "latexmk" |
| 81 | vim.g.vimtex_compiler_method = "latexmk" | 84 | vim.g.vimtex_quickfix_mode = 0 |
| 82 | vim.g.vimtex_quickfix_mode = 0 | 85 | vim.g.tex_conceal = "abdmg" |
| 83 | vim.g.tex_conceal = "abdmg" | 86 | vim.g.tex_flavor = "latex" |
| 84 | vim.g.tex_flavor = "latex" | 87 | vim.g.gitgutter_set_sign_backgrounds = 1 |
| 85 | vim.g.gitgutter_set_sign_backgrounds = 1 | 88 | |
| 86 | 89 | ||
| 87 | 90 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
| 88 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | 91 | if not vim.loop.fs_stat(lazypath) then |
| 89 | if 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 |
| 98 | end | 101 | |
| 99 | 102 | vim.opt.rtp:prepend(lazypath) | |
| 100 | vim.opt.rtp:prepend(lazypath) | 103 | require("lazy").setup({ |
| 101 | require("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 = { | |
| 164 | require("colorizer").setup() | 167 | buildScripts = { |
| 165 | vim.api.nvim_create_autocmd('InsertEnter', { | 168 | enable = true, |
| 166 | command = 'COQnow --shut-up' | 169 | }, |
| 167 | }) | 170 | }, |
| 168 | 171 | procMacro = { | |
| 169 | vim.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({ | |
| 175 | local 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 | |
| 195 | require("mason").setup() | 198 | |
| 196 | require("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 | |
| 201 | local 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 |
| 204 | end | 207 | highlight Normal ctermbg=none guibg=none |
| 205 | 208 | highlight signcolumn ctermbg=none guibg=none | |
| 206 | for 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 | |
| 213 | end | 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 | |
| 240 | vim.cmd([[ | 243 | |
| 241 | highlight GitGutterAdd ctermbg=none guibg=none | 244 | vim.g.mapleader = " " |
| 242 | highlight GitGutterDelete guibg=none ctermbg=none | 245 | keymap.set("n", "<leader>e", "<cmd>:call ToggleVExplorer() <cr>") |
| 243 | highlight GitGutterChange guibg=none ctermbg=none | 246 | keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) |
| 244 | highlight GitGutterChangeAdd guibg=none ctermbg=none | 247 | keymap.set("n", "<leader>a", "ggVG") |
| 245 | highlight GitGutterChangeDelete guibg=none ctermbg=none | 248 | keymap.set("n", "<leader>y", "cc") |
| 246 | highlight NonText guifg=none | 249 | keymap.set("n", "<C-c>", "yy") |
| 247 | highlight EndOfBuffer ctermfg=none ctermbg=none | 250 | keymap.set("n", "<C-v>", "p") |
| 248 | highlight Normal ctermbg=none guibg=none | 251 | keymap.set("n", "<C-z>", "u") |
| 249 | highlight signcolumn ctermbg=none guibg=none | 252 | keymap.set("v", "J", ":m '>+1<CR>gv=gv") |
| 250 | highlight StatusLine ctermbg=none guibg=none | 253 | keymap.set("n", "j", "5j") |
| 251 | highlight DiagnosticError ctermbg=none guibg=none | 254 | keymap.set("n", "k", "5k") |
| 252 | highlight DiagnosticWarn ctermbg=none guibg=none | 255 | keymap.set("v", "K", ":m '<-2<CR>gv=gv") |
| 253 | highlight DiagnosticInfo ctermbg=none guibg=none | 256 | keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<cr>") |
| 254 | highlight DiagnosticHint ctermbg=none guibg=none | 257 | keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>") |
| 255 | highlight 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>") | |
| 257 | highlight DiagnosticVirtualError ctermbg=none guibg=none | 260 | keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) -- goto def |
| 258 | highlight DiagnosticVirtualWarn ctermbg=none guibg=none | 261 | keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts) |
| 259 | highlight DiagnosticVirtualInfo ctermbg=none guibg=none | ||
| 260 | highlight DiagnosticVirtualHint ctermbg=none guibg=none | ||
| 261 | |||
| 262 | highlight LspFloatWinNormal ctermbg=none guibg=none | ||
| 263 | highlight NormalFloat ctermbg=none guibg=none | ||
| 264 | |||
| 265 | highlight LineNr ctermbg=none guibg=none | ||
| 266 | highlight StatusLineNc ctermbg=none guibg=none | ||
| 267 | highlight StatusLineNc ctermfg=none guifg=none | ||
| 268 | highlight StatusLine ctermbg=none guibg=none | ||
| 269 | highlight StatusLine ctermfg=none guifg=none | ||
| 270 | |||
| 271 | highlight NvimTreeWinSeparator ctermfg=none guifg=none | ||
| 272 | highlight CursorColumn ctermfg=none guifg=none | ||
| 273 | highlight CursorLine ctermbg=none guibg=none | ||
| 274 | |||
| 275 | highlight VertSplit ctermbg=none guibg=none | ||
| 276 | |||
| 277 | highlight DiagnosticVirtualTextError ctermbg=none guibg=none | ||
| 278 | highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none | ||
| 279 | highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none | ||
| 280 | highlight DiagnosticVirtualTextHint ctermbg=none guibg=none | ||
| 281 | ]]) | ||
| 282 | 262 | ||
| 283 | --Keybinds | ||
| 284 | vim.g.mapleader = " " | ||
| 285 | keymap.set("n", "<leader>e", "<cmd>:call ToggleVExplorer() <cr>") | ||
| 286 | keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | ||
| 287 | keymap.set("n", "<leader>a", "ggVG") | ||
| 288 | keymap.set("n", "<leader>y", "cc") | ||
| 289 | keymap.set("n", "<C-c>", "yy") | ||
| 290 | keymap.set("n", "<C-v>", "p") | ||
| 291 | keymap.set("n", "<C-z>", "u") | ||
| 292 | keymap.set("v", "J", ":m '>+1<CR>gv=gv") | ||
| 293 | keymap.set("n", "j", "5j") | ||
| 294 | keymap.set("n", "k", "5k") | ||
| 295 | keymap.set("v", "K", ":m '<-2<CR>gv=gv") | ||
| 296 | keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<cr>") | ||
| 297 | keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>") | ||
| 298 | keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>") | ||
| 299 | keymap.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 @@ | |||
| 1 | local option = vim.opt | ||
| 2 | local keymap = vim.keymap | ||
| 3 | |||
| 4 | --Basic Editor Setup | ||
| 5 | option.nu = true | ||
| 6 | option.tabstop = 2 | ||
| 7 | option.softtabstop = 2 | ||
| 8 | option.shiftwidth = 2 | ||
| 9 | option.expandtab = true | ||
| 10 | option.smartindent = true | ||
| 11 | option.wrap = false | ||
| 12 | option.swapfile = false | ||
| 13 | option.hlsearch = false | ||
| 14 | option.incsearch = true | ||
| 15 | option.updatetime = 50 | ||
| 16 | option.laststatus = 0 | ||
| 17 | option.signcolumn = "number" | ||
| 18 | option.autoindent = true | ||
| 19 | option.clipboard = "unnamedplus" | ||
| 20 | option.termguicolors = false | ||
| 21 | option.fillchars = 'eob: ' | ||
| 22 | |||
| 23 | -- Setup Editor Theme | ||
| 24 | vim.cmd([[ | ||
| 25 | highlight GitGutterAdd ctermbg=none | ||
| 26 | highlight GitGutterAdd guibg=none | ||
| 27 | highlight NonText guifg=none | ||
| 28 | highlight EndOfBuffer ctermfg=none ctermbg=none | ||
| 29 | highlight Normal ctermbg=none | ||
| 30 | highlight Normal guibg=none | ||
| 31 | highlight signcolumn ctermbg=none | ||
| 32 | highlight signcolumn guibg=none | ||
| 33 | highlight StatusLine ctermbg=none | ||
| 34 | highlight StatusLine guibg=none | ||
| 35 | highlight DiagnosticError ctermbg=none | ||
| 36 | highlight DiagnosticError guibg=none | ||
| 37 | highlight DiagnosticWarn ctermbg=none | ||
| 38 | highlight DiagnosticWarn guibg=none | ||
| 39 | highlight DiagnosticInfo ctermbg=none | ||
| 40 | highlight DiagnosticInfo guibg=none | ||
| 41 | highlight DiagnosticHint ctermbg=none | ||
| 42 | highlight DiagnosticHint guibg=none | ||
| 43 | |||
| 44 | highlight DiagnosticVirtualError ctermbg=none | ||
| 45 | highlight DiagnosticVirtualError guibg=none | ||
| 46 | highlight DiagnosticVirtualWarn ctermbg=none | ||
| 47 | highlight DiagnosticVirtualWarn guibg=none | ||
| 48 | highlight DiagnosticVirtualInfo ctermbg=none | ||
| 49 | highlight DiagnosticVirtualInfo guibg=none | ||
| 50 | highlight DiagnosticVirtualHint ctermbg=none | ||
| 51 | highlight DiagnosticVirtualHint guibg=none | ||
| 52 | |||
| 53 | highlight DiagnosticVirtualTextError ctermbg=none | ||
| 54 | highlight DiagnosticVirtualTextError guibg=none | ||
| 55 | highlight DiagnosticVirtualTextWarn ctermbg=none | ||
| 56 | highlight DiagnosticVirtualTextWarn guibg=none | ||
| 57 | highlight DiagnosticVirtualTextInfo ctermbg=none | ||
| 58 | highlight DiagnosticVirtualTextInfo guibg=none | ||
| 59 | highlight DiagnosticVirtualTextHint ctermbg=none | ||
| 60 | highlight DiagnosticVirtualTextHint guibg=none | ||
| 61 | ]]) | ||
| 62 | |||
| 63 | -- run specific commands after different file extensions | ||
| 64 | vim.cmd([[ | ||
| 65 | augroup RunPfOnSave | ||
| 66 | autocmd! | ||
| 67 | autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % | ||
| 68 | autocmd BufWritePost *.tex silent! :VimtexCompile | ||
| 69 | autocmd BufWritePost *.md silent! :MarkdownPreview | ||
| 70 | autocmd BufWritePost *.php silent! !php-cs-fixer fix % | ||
| 71 | augroup END | ||
| 72 | ]]) | ||
| 73 | |||
| 74 | -- Gui options | ||
| 75 | vim.o.guifont = "Fira Code:h7" | ||
| 76 | vim.g.vimtex_view_method = "zathura" | ||
| 77 | vim.g.vimtex_compiler_method = "latexrun" | ||
| 78 | vim.g.gitgutter_set_sign_backgrounds = 1 | ||
| 79 | |||
| 80 | --Keybinds | ||
| 81 | vim.g.mapleader = " " | ||
| 82 | keymap.set("n", "<leader>e", vim.cmd.Ex) | ||
| 83 | keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | ||
| 84 | keymap.set("n", "<leader>a", "ggVG") | ||
| 85 | keymap.set("v", "J", ":m '>+1<CR>gv=gv") | ||
| 86 | keymap.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 | |||
