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) vim.g.mapleader = '\\' require("lazy").setup("plugins") vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true vim.filetype.add({ extension = { pl = 'prolog' } }) local colors = require("tokyonight.colors").setup() require("editorconfig").properties.trim_trailing_whitespace = false require('neoscroll').setup() require("mason").setup({ ui = { icons = { package_installed = "✓", package_pending = "➜", package_uninstalled = "✗" } } }) require("mason-lspconfig").setup() vim.api.nvim_set_keymap("", "", "", {}) vim.api.nvim_set_keymap("", "", "", {}) vim.api.nvim_set_keymap("", "", "", {}) vim.api.nvim_set_keymap("", "", "", {}) require('goto-preview').setup { width = 120, -- Width of the floating window height = 15, -- Height of the floating window border = {"↖", "─" ,"┐", "│", "┘", "─", "└", "│"}, -- Border characters of the floating window default_mappings = false, -- Bind default mappings debug = false, -- Print debug information opacity = nil, -- 0-100 opacity level of the floating window where 100 is fully transparent. resizing_mappings = true, -- Binds arrow keys to resizing the floating window. post_open_hook = nil, -- A function taking two arguments, a buffer and a window to be ran as a hook. post_close_hook = nil, -- A function taking two arguments, a buffer and a window to be ran as a hook. references = { -- Configure the telescope UI for slowing the references cycling window. provider = "telescope", -- telescope|fzf_lua|snacks|mini_pick|default telescope = require("telescope.themes").get_dropdown({ hide_preview = false }) }, -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. focus_on_open = true, -- Focus the floating window when opening it. dismiss_on_move = false, -- Dismiss the floating window when moving the cursor. force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden stack_floating_preview_windows = true, -- Whether to nest floating windows same_file_float_preview = true, -- Whether to open a new floating window for a reference within the current file preview_window_title = { enable = true, position = "left" }, -- Whether to set the preview window title as the filename zindex = 1, -- Starting zindex for the stack of floating windows vim_ui_input = true, -- Whether to override vim.ui.input with a goto-preview floating window } local has_words_before = function() unpack = unpack or table.unpack local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end local cmp = require("cmp") cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered() }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.confirm({ behaviour = cmp.ConfirmBehavior.Insert, select = true }) elseif vim.fn["vsnip#available"](1) == 1 then feedkey("(vsnip-expand-or-jump)", "") else fallback() end end, { "i", "s" }) }), sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "vsnip" }, }, { { name = "buffer" } }) }) local capabilities = require("cmp_nvim_lsp").default_capabilities() require("mason-lspconfig").setup_handlers { -- The first entry (without a key) will be the default handler -- and will be called for each installed server that doesn't have -- a dedicated handler. function (server_name) -- default handler (optional) require("lspconfig")[server_name].setup { capabilities = capabilities } end } require("nvim-tree").setup({ update_focused_file = { enable = true } }) require'nvim-treesitter.configs'.setup { ensure_installed = { "c", "go", "typescript" }, sync_install = false, auto_install = true, highlight = { enable = true } } require'treesitter-context' require("telescope").setup{ defaults = { file_ignore_patterns = { "node_modules" } }, pickers = { find_files = { theme = "ivy" }, live_grep = { theme = "ivy" } }, extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case", } } } require("telescope").load_extension("fzf") require("scrollbar").setup{ handle = { color = colors.bg_highlight, }, marks = { Search = { color = colors.orange }, Error = { color = colors.error }, Warn = { color = colors.warning }, Info = { color = colors.info }, Hint = { color = colors.hint }, Misc = { color = colors.purple }, } } require('lualine').setup { options = { icons_enabled = true, theme = 'auto', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = { statusline = {}, winbar = {}, }, ignore_focus = {}, always_divide_middle = true, globalstatus = false, refresh = { statusline = 1000, tabline = 1000, winbar = 1000, } }, sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = {'filename'}, lualine_x = {'location'}, lualine_y = {}, lualine_z = {} }, tabline = {}, winbar = {}, inactive_winbar = {}, extensions = {} } require("kanagawa").setup() vim.api.nvim_create_autocmd("TermClose", { callback = function() vim.cmd("close") end }) require("ibl").setup() vim.g.barbar_auto_setup = false require'barbar'.setup { letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP' } require("devcontainer").setup{}