if vim == nil then vim = {} end -- Update function and call function Update_Sys() vim.cmd("Lazy sync") vim.cmd("TSUpdate") end vim.keymap.set("n", "", ":lua Update_Sys()") -- Bufstop vim.keymap.set("n", "", ":bdelete") vim.keymap.set("n", "", ":BufstopFast") -- UltiSnips Configuration vim.g.UltiSnipsExpandTrigger = "" vim.g.UltiSnipsJumpForwardTrigger = "" vim.g.UltiSnipsJumpBackwardTrigger = "" vim.g.UltiSnipsEditSplit = "vertical" vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" } -- NERDTree Config vim.g.NERDTreeShowHidden = 1 vim.keymap.set("n", "", ":NERDTreeToggle") -- Lexima vim.g.lexima_enable_basic_rules = 1 vim.g.lexima_enable_newline_rules = 1 -- Telescope snippet local builtin = require("telescope.builtin") vim.keymap.set("n", "ff", builtin.find_files, {}) vim.keymap.set("n", "fg", builtin.live_grep, {}) vim.keymap.set("n", "", builtin.current_buffer_fuzzy_find, {}) vim.keymap.set("n", "fh", builtin.help_tags, {}) vim.keymap.set("n", "fc", builtin.commands, {}) -- Telescope + Ultisnips require("telescope").load_extension("ultisnips") vim.keymap.set("n", "fs", require("telescope").extensions.ultisnips.ultisnips, {}) -- NERDTree Config vim.g.NERDTreeDirArrowExpandable = "" vim.g.NERDTreeDirArrowCollapsible = "" -- Git-Blame configuration vim.g.gitblame_message_template = " => " vim.g.gitblame_date_format = "%r" -- Code completion require("code-completion") -- Mason setup require("mason").setup(require("mason").setup({ ui = { icons = { package_installed = "✓", package_pending = "󰔟", package_uninstalled = "✗", }, }, })) require("mason-lspconfig").setup({ -- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" }, ensure_installed = { "clangd" }, }) require("mason-lspconfig").setup_handlers({ function(clangd) require("lspconfig")[clangd].setup({}) end, ["als"] = function() require("lspconfig").als.setup({ settings = { ada = { projectFile = "default.gpr", }, }, }) end, }) require("lspconfig").verible.setup({ cmd = { "verible-verilog-ls", "--rules_config_search" }, }) -- Floating terminal vim.keymap.set("n", "", ":FloatermNew --height=0.9 --width=0.9 --wintype=float --name=terminal ") -- Set default colorscheme vim.cmd("colo tokyonight-night") -- Formatter configuration vim.cmd([[ augroup FormatAutogroup autocmd! autocmd BufWritePost * FormatWrite augroup END autocmd BufWritePost *.v lua vim.lsp.buf.format({ async = false }) ]]) -- Ale configuration vim.g.ale_linters_explicit = 0 local linters = { python = { "pylint" }, vim = { "vint" }, cpp = { "clang" }, c = { "clang" }, markdown = { "languagetool" }, latex = { "languagetool" }, tex = { "languagetool" }, plaintex = { "languagetool" }, ada = { "gnat" }, } vim.g.ale_linters = linters vim.g.ale_fix_on_save = 0 vim.g.ale_ada_gpr_project_file = "default.gpr" vim.g.ale_fixers = { ada = { "gcc", "gnat" }, asm = { "gcc" }, bash = { "bashate" }, c = { "astyle" }, latex = { "texlab" }, lua = { "stylua" }, markdown = { "prettier", "pandoc" }, python = { "yapf" }, } vim.keymap.set("n", "lf", ":ALEFix") vim.keymap.set("n", "ld", ":ALEDetail")