local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or 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(pluginTable) require("lazy").setup({ spec = { -- import your plugins { import = "plugins" }, }, -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. install = { colorscheme = { "catppuccin" } }, -- automatically check for plugin updates checker = { enabled = true }, }) if vim.fn.has('persistent_undo') then local target_path = vim.fn.stdpath('data') .. '/.nvimundodir' if not vim.fn.isdirectory(target_path) then vim.fn.mkpath(target_path, { mode = 0700 }) -- Use mkpath for parent creation end vim.opt.undodir = target_path vim.api.nvim_set_option('undofile', true) end vim.api.nvim_create_autocmd("StdinReadPre", { pattern = "*", command = "let s:std_in=1" }) --vim.api.nvim_create_autocmd("VimEnter", { -- pattern = "*", -- command = "if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | execute 'Neotree current' | execute 'cd '.argv()[0] | endif" --}) vim.g.airline_powerline_fonts = 1 --vim.g.coq_settings = {'clients.tabnine.enabled' = false} --filetype plugin on --vim.g.syntastic_python_python_exec = 'python3' --vim.g.syntastic_python_checkers = ['bandit', 'python'] --" Keybinds vim.keymap.set('n', '', ':Neotree toggle', { noremap = true }) vim.keymap.set('n', '', function() vim.lsp.buf.code_action() end, { noremap = true }) vim.keymap.set('n', '', ':ZenMode', { noremap = true }) vim.keymap.set('n', '', function() vim.lsp.buf.format() end, { noremap = true }) vim.keymap.set('n', '', ':MundoToggle', { noremap = true }) --nnoremap :CHADopen --nnoremap :lua vim.lsp.buf.code_action() --nnoremap :Goyo --nnoremap :MundoToggle --nnoremap :lua require("dapui").toggle() require("mason").setup() require("mason-lspconfig").setup() --require("mason-lspconfig").setup_handlers({ -- function (server_name) -- default handler (optional) -- require("lspconfig")[server_name].setup(require('coq').lsp_ensure_capabilities({})) -- end}) local lsp = require "lspconfig" local dap = require("dap") dap.adapters.gdb = { type = "executable", command = "gdb", args = { "-i", "dap" } } dap.configurations.cpp = { { name = "Launch", type = "gdb", request = "launch", program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') end, cwd = "${workspaceFolder}", stopAtBeginningOfMainSubprogram = false, }, } -- Mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) -- Enable completion triggered by vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = bufnr } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) vim.keymap.set('n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) end local lsp_flags = { -- This is the default in Nvim 0.7+ debounce_text_changes = 150, } --lsp..setup() -- before --lsp..setup(coq.lsp_ensure_capabilities()) -- after --lsp.pyright.setup(coq.lsp_ensure_capabilities({})) --lsp.ccls.setup(coq.lsp_ensure_capabilities({})) lsp.ltex.setup({ settings = { ltex = { language = "pl-PL" } } }) lsp.rust_analyzer.setup({ settings = { ["rust-analyzer"] = { imports = { granularity = { group = "module", }, prefix = "self", }, cargo = { buildScripts = { enable = true, }, }, procMacro = { enable = true }, } } }) require("dapui").setup() require("catppuccin").setup({ flavour = "macchiato" }) require('colorizer').setup() require("circles").setup() vim.cmd.colorscheme "catppuccin" -- committia_open_only_vim_starting vim.g.committia_open_only_vim_starting = 1 --autocmd VimEnter * execute 'COQnow -s'