vim.o.number = true vim.o.relativenumber = true vim.o.signcolumn = "yes" vim.o.wrap = false vim.o.tabstop = 2 vim.o.shiftwidth = 2 vim.o.softtabstop = 2 vim.o.expandtab = true vim.o.swapfile = false vim.g.mapleader = " " vim.o.clipboard = "unnamedplus" vim.o.undofile = true vim.o.cursorline = false vim.o.title = true -- packages vim.pack.add({ { src = "https://github.com/sainnhe/everforest" }, { src = "https://github.com/nvim-lualine/lualine.nvim" }, { src = "https://github.com/lewis6991/gitsigns.nvim" }, { src = "https://github.com/cappyzawa/trim.nvim" }, { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, { src = "https://github.com/lukas-reineke/indent-blankline.nvim" }, { src = "https://github.com/nvim-telescope/telescope.nvim" }, { src = "https://github.com/nvim-telescope/telescope-ui-select.nvim" }, { src = "https://github.com/nvim-lua/plenary.nvim" }, { src = "https://github.com/hrsh7th/cmp-nvim-lsp" }, { src = "https://github.com/hrsh7th/nvim-cmp" }, { src = "https://github.com/L3MON4D3/LuaSnip" }, { src = "https://github.com/saadparwaiz1/cmp_luasnip" }, { src = "https://github.com/rafamadriz/friendly-snippets" }, }) -- telescope local telescope = require("telescope") telescope.setup({ defaults = { preview = { treesitter = false }, color_devicons = true, sorting_strategy = "ascending", borderchars = { "─", -- top "│", -- right "─", -- bottom "│", -- left "┌", -- top-left "┐", -- top-right "┘", -- bottom-right "└", -- bottom-left }, path_displays = { "smart" }, layout_config = { height = 100, width = 400, prompt_position = "top", preview_cutoff = 40, } } }) telescope.load_extension("ui-select") local builtin = require("telescope.builtin") -- binds vim.keymap.set('n', 'lf', vim.lsp.buf.format) vim.api.nvim_set_keymap('n', ',c', ':w! | !compiler "%:p"', { noremap = true, silent = true }) vim.keymap.set({ "n" }, "f", builtin.find_files, { desc = "Telescope live grep" }) vim.keymap.set({ "n" }, "g", builtin.live_grep, { desc = "Telescope live grep" }) -- lsp vim.lsp.enable({ "lua_ls", "clangd", "rust_analyzer", "bashls", "html", "cssls", "jsonls", "yamlls" }) vim.diagnostic.config({ virtual_text = { prefix = '', spacing = 4, }, signs = { text = { [vim.diagnostic.severity.ERROR] = '', [vim.diagnostic.severity.WARN] = '', }, linehl = { [vim.diagnostic.severity.ERROR] = 'ErrorMsg', }, numhl = { [vim.diagnostic.severity.WARN] = 'WarningMsg', }, }, underline = true, update_in_insert = true, severity_sort = true, }) -- plugins require('lualine').setup({}) require("gitsigns").setup() require("trim").setup({}) require("nvim-treesitter.configs").setup({ ensure_installed = { "bash", "lua", "javascript", "c", "cpp", "json", "go", "markdown", "meson", "make", "cmake", "python", "rust", "yaml", "toml", "ron", }, highlight = { enable = true }, indent = { enable = true }, }) require("ibl").setup({}) local cmp = require 'cmp' cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(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.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, }, { { name = 'buffer' }, }) }) -- theme -- vim.g.everforest_enable_italic = true -- vim.g.everforest_transparent_background = true vim.cmd("colorscheme everforest")