From c233e93c2552940d228be7adb077da47ef42761f Mon Sep 17 00:00:00 2001 From: philw Date: Mon, 13 Jan 2025 15:52:11 +0100 Subject: Update config --- .gitignore | 1 + demos/sc1.png | Bin 493238 -> 0 bytes init.lua | 445 +++++++++++++++++++++++-------------------------- lazy-lock.json | 21 +-- lua/config/editor.lua | 86 ---------- lua/config/keymap.lua | 0 lua/config/lsp.lua | 64 ------- lua/config/plugins.lua | 0 8 files changed, 212 insertions(+), 405 deletions(-) delete mode 100644 demos/sc1.png create mode 100644 lua/config/keymap.lua create mode 100644 lua/config/plugins.lua diff --git a/.gitignore b/.gitignore index d7ad043..ba687da 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ plugin/ +pack/ diff --git a/demos/sc1.png b/demos/sc1.png deleted file mode 100644 index be01afb..0000000 Binary files a/demos/sc1.png and /dev/null 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 vim.loader.enable() --- vim.g.loaded_netrw = 1 --- vim.g.loaded_netrwPlugin = 1 vim.g.netrw_banner = 0 vim.g.netrw_liststyle = 3 vim.g.netrw_altv = 0 @@ -35,265 +33,230 @@ option.clipboard = "unnamedplus" option.termguicolors = true option.fillchars = 'eob: ' option.autoindent = true +option.lazyredraw = false +option.updatetime = 300 +option.timeoutlen = 500 + + +vim.cmd [[autocmd BufWritePre lua vim.lsp.buf.format()]] vim.cmd([[ augroup RunPfOnSave autocmd! autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % autocmd BufWritePost *.tex silent! :VimtexCompile -" autocmd BufWritePost *.php silent! !php-cs-fixer fix % augroup END ]]) vim.cmd([[ augroup AutoDeleteNetrwHiddenBuffers - au! - au FileType netrw setlocal bufhidden=wipe +au! +au FileType netrw setlocal bufhidden=wipe augroup end ]]) vim.cmd([[ function! ToggleVExplorer() - if exists("t:expl_buf_num") - let expl_win_num = bufwinnr(t:expl_buf_num) - if expl_win_num != -1 - let cur_win_id = win_getid() - exec expl_win_num . 'windo close' - let prev_win_num = win_id2win(cur_win_id) - if prev_win_num != 0 - exec prev_win_num . 'wincmd w' - endif +if exists("t:expl_buf_num") + let expl_win_num = bufwinnr(t:expl_buf_num) + if expl_win_num != -1 + let cur_win_id = win_getid() + exec expl_win_num . 'windo close' + let prev_win_num = win_id2win(cur_win_id) + if prev_win_num != 0 + exec prev_win_num . 'wincmd w' + endif endif unlet t:expl_buf_num - else + else exec '1wincmd w' Vexplore let t:expl_buf_num = bufnr("%") - endif -endfunction -]]) - - --- Gui options --- vim.o.guifont = "Fira Code:h7" -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_compiler_method = "latexmk" -vim.g.vimtex_quickfix_mode = 0 -vim.g.tex_conceal = "abdmg" -vim.g.tex_flavor = "latex" -vim.g.gitgutter_set_sign_backgrounds = 1 - - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end - -vim.opt.rtp:prepend(lazypath) -require("lazy").setup({ - "nvim-lua/plenary.nvim", - -- { - -- 'barrientosvctor/abyss.nvim', - -- lazy = false, - -- priority = 1000, - -- opts = {} - -- }, - -- 'ryanoasis/vim-devicons', - "airblade/vim-gitgutter", - "lervag/vimtex", - -- "nvim-tree/nvim-tree.lua", - "norcalli/nvim-colorizer.lua", - "nvim-treesitter/nvim-treesitter", - "neovim/nvim-lspconfig", - "williamboman/mason.nvim", - -- "nvim-tree/nvim-web-devicons", - "williamboman/mason-lspconfig.nvim", - -- "iamcco/markdown-preview.nvim", - -- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - -- build = "cd app && yarn install", - -- init = function() - -- vim.g.mkdp_filetypes = { "markdown" } - -- end, - -- ft = { "markdown" } - -- , - -- { - -- 'nvimdev/lspsaga.nvim', - -- config = function() - -- require('lspsaga').setup({}) - -- end - -- }, - 'nvim-telescope/telescope.nvim', - tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' }, - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = - 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', - keys = { - { "/", false }, - { "f", "Telescope find_files", desc = "Find Files" }, - { "g", "Telescope live_grep", desc = "Grep" }, - { "b", "Telescope buffers", desc = "Grep" }, - { "s", "Telescope buffers", desc = "Grep" }, - } - }, - { - 'windwp/nvim-autopairs', - event = "InsertEnter", - - opts = {} - }, - { - 'numToStr/Comment.nvim', - opts = {}, - lazy = false, - }, - - 'ms-jpq/coq_nvim', - { 'ms-jpq/coq.artifacts', branch = "artifacts" }, -}) - -require("colorizer").setup() -vim.api.nvim_create_autocmd('InsertEnter', { - command = 'COQnow --shut-up' -}) - -vim.api.nvim_create_autocmd("BufWritePre", { - callback = function() - vim.lsp.buf.format() - end, -}) - -local lsp_servers = { - -- rust_analyzer = { - -- imports = { - -- granularity = { - -- group = 'module', - -- }, - -- prefix = 'self', - -- }, - -- cargo = { - -- buildScripts = { - -- enable = true, - -- }, - -- }, - -- procMacro = { - -- enable = true, - -- }, - -- }, -} - - -require("mason").setup() -require("mason-lspconfig").setup { - ensure_installed = lsp_servers, - automatic_installation = true, -} - -local server_maps = function(opts) - vim.keymap.set("n", "d", vim.lsp.buf.definition, opts) -- goto def - vim.keymap.set("n", "k", vim.lsp.buf.hover, opts) -- see docs -end - -for lsp, settings in pairs(lsp_servers) do - require("lspconfig")[lsp].setup(coq.lsp_ensure_capabilities({ - on_attach = function(_, buffer) - server_maps({ buffer = buffer }) - end, - settings = settings, - })) -end - --- require("nvim-tree").setup({ --- sort = { --- sorter = "case_sensitive", --- }, --- view = { --- width = 30, --- }, --- renderer = { --- group_empty = true, --- }, --- filters = { --- dotfiles = true, --- }, --- }) - - --- require('abyss').setup({ --- italic_comments = true, --- italic = true, --- bold = true, --- transparent_background = true, --- overrides = {} --- }) - --- vim.cmd.colorscheme("abyss") -vim.cmd([[ -highlight GitGutterAdd ctermbg=none guibg=none -highlight GitGutterDelete guibg=none ctermbg=none -highlight GitGutterChange guibg=none ctermbg=none -highlight GitGutterChangeAdd guibg=none ctermbg=none -highlight GitGutterChangeDelete guibg=none ctermbg=none -highlight NonText guifg=none -highlight EndOfBuffer ctermfg=none ctermbg=none -highlight Normal ctermbg=none guibg=none -highlight signcolumn ctermbg=none guibg=none -highlight StatusLine ctermbg=none guibg=none -highlight DiagnosticError ctermbg=none guibg=none -highlight DiagnosticWarn ctermbg=none guibg=none -highlight DiagnosticInfo ctermbg=none guibg=none -highlight DiagnosticHint ctermbg=none guibg=none -highlight Pmenu ctermbg=none guibg=none - -highlight DiagnosticVirtualError ctermbg=none guibg=none -highlight DiagnosticVirtualWarn ctermbg=none guibg=none -highlight DiagnosticVirtualInfo ctermbg=none guibg=none -highlight DiagnosticVirtualHint ctermbg=none guibg=none - -highlight LspFloatWinNormal ctermbg=none guibg=none -highlight NormalFloat ctermbg=none guibg=none - -highlight LineNr ctermbg=none guibg=none -highlight StatusLineNc ctermbg=none guibg=none -highlight StatusLineNc ctermfg=none guifg=none -highlight StatusLine ctermbg=none guibg=none -highlight StatusLine ctermfg=none guifg=none - -highlight NvimTreeWinSeparator ctermfg=none guifg=none -highlight CursorColumn ctermfg=none guifg=none -highlight CursorLine ctermbg=none guibg=none - -highlight VertSplit ctermbg=none guibg=none - -highlight DiagnosticVirtualTextError ctermbg=none guibg=none -highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none -highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none -highlight DiagnosticVirtualTextHint ctermbg=none guibg=none -]]) + endif + endfunction + ]]) + + + -- Gui options + vim.g.vimtex_view_method = "zathura" + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_quickfix_mode = 0 + vim.g.tex_conceal = "abdmg" + vim.g.tex_flavor = "latex" + vim.g.gitgutter_set_sign_backgrounds = 1 + + + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) + end + + vim.opt.rtp:prepend(lazypath) + require("lazy").setup({ + "airblade/vim-gitgutter", + {"lervag/vimtex", lazy = true}, + "norcalli/nvim-colorizer.lua", + "nvim-treesitter/nvim-treesitter", + { + "neovim/nvim-lspconfig", + lazy = false, + dependencies = { + { "ms-jpq/coq_nvim", branch = "coq" }, + { "ms-jpq/coq.artifacts", branch = "artifacts" }, + { 'ms-jpq/coq.thirdparty', branch = "3p" }, + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, + init = function() + vim.g.coq_settings = { + auto_start = 'shut-up' + } + end, + config = function() + end, + }, + 'nvim-telescope/telescope.nvim', + lazy = true, + tag = '0.1.5', + dependencies = { 'nvim-lua/plenary.nvim' }, + { + 'nvim-telescope/telescope-fzf-native.nvim', + lazy = true, + build = + 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', + keys = { + { "/", false }, + { "f", "Telescope find_files", desc = "Find Files" }, + { "g", "Telescope live_grep", desc = "Grep" }, + { "b", "Telescope buffers", desc = "Grep" }, + { "s", "Telescope buffers", desc = "Grep" }, + } + }}, + { + 'windwp/nvim-autopairs', + event = "InsertEnter", + opts = {} + } +) + + require("colorizer").setup() + + vim.api.nvim_create_autocmd("BufWritePre", { + callback = function() + vim.lsp.buf.format() + end, + }) + + local lsp_servers = { + rust_analyzer = { + imports = { + granularity = { + group = 'module', + }, + prefix = 'self', + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + }, + } + + require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } + }) + + local server_maps = function(opts) + end + + for lsp, settings in pairs(lsp_servers) do + require("lspconfig")[lsp].setup(coq.lsp_ensure_capabilities({ + on_attach = function(_, buffer) + server_maps({ buffer = buffer }) + end, + settings = settings, + })) + end + + vim.cmd([[ + highlight GitGutterAdd ctermbg=none guibg=none + highlight GitGutterDelete guibg=none ctermbg=none + highlight GitGutterChange guibg=none ctermbg=none + highlight GitGutterChangeAdd guibg=none ctermbg=none + highlight GitGutterChangeDelete guibg=none ctermbg=none + highlight NonText guifg=none + highlight EndOfBuffer ctermfg=none ctermbg=none + highlight Normal ctermbg=none guibg=none + highlight signcolumn ctermbg=none guibg=none + highlight StatusLine ctermbg=none guibg=none + highlight DiagnosticError ctermbg=none guibg=none + highlight DiagnosticWarn ctermbg=none guibg=none + highlight DiagnosticInfo ctermbg=none guibg=none + highlight DiagnosticHint ctermbg=none guibg=none + highlight Pmenu ctermbg=none guibg=none + + highlight DiagnosticVirtualError ctermbg=none guibg=none + highlight DiagnosticVirtualWarn ctermbg=none guibg=none + highlight DiagnosticVirtualInfo ctermbg=none guibg=none + highlight DiagnosticVirtualHint ctermbg=none guibg=none + + highlight LspFloatWinNormal ctermbg=none guibg=none + highlight NormalFloat ctermbg=none guibg=none + + highlight LineNr ctermbg=none guibg=none + highlight StatusLineNc ctermbg=none guibg=none + highlight StatusLineNc ctermfg=none guifg=none + highlight StatusLine ctermbg=none guibg=none + highlight StatusLine ctermfg=none guifg=none + + highlight NvimTreeWinSeparator ctermfg=none guifg=none + highlight CursorColumn ctermfg=none guifg=none + highlight CursorLine ctermbg=none guibg=none + + highlight VertSplit ctermbg=none guibg=none + + highlight DiagnosticVirtualTextError ctermbg=none guibg=none + highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none + highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none + highlight DiagnosticVirtualTextHint ctermbg=none guibg=none + ]]) + + + + vim.g.mapleader = " " + keymap.set("n", "e", ":call ToggleVExplorer() ") + keymap.set("n", "z", [[:%s/\<\>//gI]]) + keymap.set("n", "a", "ggVG") + keymap.set("n", "y", "cc") + keymap.set("n", "", "yy") + keymap.set("n", "", "p") + keymap.set("n", "", "u") + keymap.set("v", "J", ":m '>+1gv=gv") + keymap.set("n", "j", "5j") + keymap.set("n", "k", "5k") + keymap.set("v", "K", ":m '<-2gv=gv") + keymap.set("n", "ca", "Lspsaga code_action") + keymap.set("n", "f", "Telescope find_files") + keymap.set("n", "g", "Telescope live_grep") + keymap.set("n", "t", "Lspsaga term_toggle ") + keymap.set("n", "d", vim.lsp.buf.definition, opts) -- goto def + keymap.set("n", "k", vim.lsp.buf.hover, opts) ---Keybinds -vim.g.mapleader = " " -keymap.set("n", "e", ":call ToggleVExplorer() ") -keymap.set("n", "z", [[:%s/\<\>//gI]]) -keymap.set("n", "a", "ggVG") -keymap.set("n", "y", "cc") -keymap.set("n", "", "yy") -keymap.set("n", "", "p") -keymap.set("n", "", "u") -keymap.set("v", "J", ":m '>+1gv=gv") -keymap.set("n", "j", "5j") -keymap.set("n", "k", "5k") -keymap.set("v", "K", ":m '<-2gv=gv") -keymap.set("n", "ca", "Lspsaga code_action") -keymap.set("n", "f", "Telescope find_files") -keymap.set("n", "g", "Telescope live_grep") -keymap.set("n", "t", "Lspsaga term_toggle ") 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 @@ { - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "abyss.nvim": { "branch": "main", "commit": "ba2b8fd54dedcbd77d4b950a600004bf9686575b" }, "coq.artifacts": { "branch": "artifacts", "commit": "a1ffcee295905171d87b40ee456001d45b10329b" }, + "coq.thirdparty": { "branch": "3p", "commit": "12ce499eddf83b524e0540f6fa2e49dcaec6060c" }, "coq_nvim": { "branch": "coq", "commit": "976012b0c13763a47edbd55492ba53b03b498cdd" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lspsaga.nvim": { "branch": "main", "commit": "5fce15331ac6c3a3ec3ac91ab0e85ed82f5cbba0" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, - "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, - "nvim-treesitter": { "branch": "master", "commit": "4b222913486ec0a5983efa82b0649a2ab87cf1f0" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, + "nvim-lspconfig": { "branch": "master", "commit": "88157521e890fe7fdf18bee22438875edd6300a6" }, + "nvim-treesitter": { "branch": "master", "commit": "29f96aafe1ec99f464732b4586af53d2953345bb" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, - "vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" }, + "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, "vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" }, - "vimtex": { "branch": "master", "commit": "b8bb79b5fb27e9030ade92e75cd9375416f2c666" } + "vimtex": { "branch": "master", "commit": "adce3d38349925a0a891857c74bd4e8d1b8f80ab" } } 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 @@ -local option = vim.opt -local keymap = vim.keymap - ---Basic Editor Setup -option.nu = true -option.tabstop = 2 -option.softtabstop = 2 -option.shiftwidth = 2 -option.expandtab = true -option.smartindent = true -option.wrap = false -option.swapfile = false -option.hlsearch = false -option.incsearch = true -option.updatetime = 50 -option.laststatus = 0 -option.signcolumn = "number" -option.autoindent = true -option.clipboard = "unnamedplus" -option.termguicolors = false -option.fillchars = 'eob: ' - --- Setup Editor Theme -vim.cmd([[ -highlight GitGutterAdd ctermbg=none -highlight GitGutterAdd guibg=none -highlight NonText guifg=none -highlight EndOfBuffer ctermfg=none ctermbg=none -highlight Normal ctermbg=none -highlight Normal guibg=none -highlight signcolumn ctermbg=none -highlight signcolumn guibg=none -highlight StatusLine ctermbg=none -highlight StatusLine guibg=none -highlight DiagnosticError ctermbg=none -highlight DiagnosticError guibg=none -highlight DiagnosticWarn ctermbg=none -highlight DiagnosticWarn guibg=none -highlight DiagnosticInfo ctermbg=none -highlight DiagnosticInfo guibg=none -highlight DiagnosticHint ctermbg=none -highlight DiagnosticHint guibg=none - -highlight DiagnosticVirtualError ctermbg=none -highlight DiagnosticVirtualError guibg=none -highlight DiagnosticVirtualWarn ctermbg=none -highlight DiagnosticVirtualWarn guibg=none -highlight DiagnosticVirtualInfo ctermbg=none -highlight DiagnosticVirtualInfo guibg=none -highlight DiagnosticVirtualHint ctermbg=none -highlight DiagnosticVirtualHint guibg=none - -highlight DiagnosticVirtualTextError ctermbg=none -highlight DiagnosticVirtualTextError guibg=none -highlight DiagnosticVirtualTextWarn ctermbg=none -highlight DiagnosticVirtualTextWarn guibg=none -highlight DiagnosticVirtualTextInfo ctermbg=none -highlight DiagnosticVirtualTextInfo guibg=none -highlight DiagnosticVirtualTextHint ctermbg=none -highlight DiagnosticVirtualTextHint guibg=none -]]) - --- run specific commands after different file extensions -vim.cmd([[ -augroup RunPfOnSave -autocmd! -autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % -autocmd BufWritePost *.tex silent! :VimtexCompile -autocmd BufWritePost *.md silent! :MarkdownPreview -autocmd BufWritePost *.php silent! !php-cs-fixer fix % -augroup END -]]) - --- Gui options -vim.o.guifont = "Fira Code:h7" -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_compiler_method = "latexrun" -vim.g.gitgutter_set_sign_backgrounds = 1 - ---Keybinds -vim.g.mapleader = " " -keymap.set("n", "e", vim.cmd.Ex) -keymap.set("n", "s", [[:%s/\<\>//gI]]) -keymap.set("n", "a", "ggVG") -keymap.set("v", "J", ":m '>+1gv=gv") -keymap.set("v", "K", ":m '<-2gv=gv") diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua new file mode 100644 index 0000000..e69de29 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 @@ --- local lsp = require('lsp-zero') - ---local lsp_zero = require("lsp-zero") ---local cmp = require("cmp") ---require("luasnip.loaders.from_vscode").lazy_load() - ---lsp_zero.preset("recommended") ---lsp_zero.setup() ---lsp_zero.on_attach(function(client_id, bufnr) --- lsp_zero.default_keymaps({ buffer = bufnr }) ---end) - ---require("mason").setup({}) ---require("mason-lspconfig").setup({ --- ensure_installed = { "clangd", "rust_analyzer" }, --- handlers = { --- lsp_zero.default_setup, --- }, ---}) - ---cmp.setup({ --- snippet = { --- expand = function(args) --- require("luasnip").lsp_expand(args.body) --- end, --- }, --- window = {}, --- mapping = cmp.mapping.preset.insert({ --- [""] = cmp.mapping.scroll_docs(-4), --- [""] = cmp.mapping.scroll_docs(4), --- [""] = cmp.mapping.complete(), --- [""] = cmp.mapping.abort(), --- [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. --- }), --- sources = cmp.config.sources({ --- { name = "nvim_lsp" }, --- { name = "luasnip" }, --- }, { --- { name = "buffer" }, --- }), ---}) - ---function PrintDiagnostics(opts, bufnr, line_nr, client_id) --- bufnr = bufnr or 0 --- line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1) --- opts = opts or { ["lnum"] = line_nr } --- --- local line_diagnostics = vim.diagnostic.get(bufnr, opts) --- if vim.tbl_isempty(line_diagnostics) then --- return --- end --- --- local diagnostic_message = "" --- for i, diagnostic in ipairs(line_diagnostics) do --- diagnostic_message = diagnostic_message .. string.format("%d: %s", i, diagnostic.message or "") --- print(diagnostic_message) --- if i ~= #line_diagnostics then --- diagnostic_message = diagnostic_message .. "\n" --- end --- end --- vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {}) ---end - ---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 -- cgit v1.2.3