local vim = vim vim.g.mapleader = " " vim.g.maplocalleader = " " vim.o.number = true vim.o.relativenumber = true vim.o.showmode = true vim.o.hlsearch = false vim.o.wrap = true vim.o.tabstop = 4 vim.g.have_nerd_font = true vim.o.scrolloff = 10 vim.g.border = "rounded" vim.o.termguicolors = true vim.o.cursorline = true vim.o.swapfile = false vim.o.mouse = 'a' vim.o.undofile = true -- diagnostic config vim.diagnostic.config({ virtual_text = false, float = { source = 'always', border = 'rounded' } }) -- Highlight On Yank vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() vim.hl.on_yank() end, }) -- unset space so it can be used as leader vim.keymap.set("n", " ", "", { silent = true, remap = false }) -- move around windows vim.keymap.set('n', '', '', { desc = 'focus to l window' }) vim.keymap.set('n', '', '', { desc = 'focus to r window' }) vim.keymap.set('n', '', '', { desc = 'focus to dwn window' }) vim.keymap.set('n', '', '', { desc = 'focus to up window' }) -- move lines up and down vim.keymap.set("n", "", ":m .+1==") vim.keymap.set("n", "", ":m .-2==") vim.keymap.set("v", "", ":m '>+1gv=gv") vim.keymap.set("v", "", ":m '<-2gv=gv") -- toggle nvim tree vim.keymap.set("n", "e", ":NvimTreeToggle") -- barbar vim.keymap.set("n", "x", ":BufferClose") -- (I need both options, one for windows, one for linux) vim.keymap.set("n", "", ":BufferPrevious") vim.keymap.set("n", "", ":BufferNext") vim.keymap.set("n", "", "BufferPrevious") vim.keymap.set("n", "", "BufferNext") -- diagnostics vim.keymap.set("n", "ds", ":lua vim.diagnostic.open_float()") vim.keymap.set("n", "dn", function() vim.diagnostic.jump({ count = 1 }) end) vim.keymap.set("n", "dp", function() vim.diagnostic.jump({ count = -1 }) end) -- VIM PACKS vim.pack.add({ -- theme { src = "https://github.com/neanias/everforest-nvim.git" }, -- lsp { src = 'https://github.com/neovim/nvim-lspconfig' }, { src = 'https://github.com/mason-org/mason.nvim' }, { src = 'https://github.com/mason-org/mason-lspconfig.nvim' }, { src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim' }, -- treesitter { src = 'https://github.com/nvim-treesitter/nvim-treesitter', branch = "main", build = ":TSUpdate", lazy = false}, -- bar and icons at the top { src = 'https://github.com/nvim-tree/nvim-web-devicons' }, { src = 'https://github.com/romgrk/barbar.nvim' }, -- file tree { src = 'https://github.com/nvim-tree/nvim-tree.lua' }, -- auto save { src = 'https://github.com/Pocco81/auto-save.nvim' }, -- completion { src = 'https://github.com/saghen/blink.cmp' }, -- lualine { src = 'https://github.com/nvim-lualine/lualine.nvim' }, -- surround { src = 'https://github.com/echasnovski/nvim-mini/mini.nvim' }, -- telescope { src = 'https://github.com/nvim-lua/plenary.nvim' }, { src = 'https://github.com/nvim-telescope/telescope.nvim' }, }) -- telescope (sadly these configs need to be after vimpack) local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) require('nvim-treesitter.configs').setup { ensure_installed = {}, modules = {}, sync_install = false, auto_install = true, ignore_install = {}, highlight = { enable = true, additional_vim_regex_highlighting = false, }, } vim.cmd("colorscheme everforest") require "barbar".setup() require "mini.ai".setup() require "mini.surround".setup() require "mini.pairs".setup() require "nvim-tree".setup() require "auto-save".setup() require "blink.cmp".setup({ keymap = { preset = "enter", [""] = { "select_and_accept", "fallback" }, }, }) require('lualine').setup { options = { icons_enabled = true, theme = 'everforest', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = { statusline = {}, winbar = {}, }, ignore_focus = {}, always_divide_middle = true, always_show_tabline = true, globalstatus = false, refresh = { statusline = 1000, tabline = 1000, winbar = 1000, refresh_time = 16, -- ~60fps events = { 'WinEnter', 'BufEnter', 'BufWritePost', 'SessionLoadPost', 'FileChangedShellPost', 'VimResized', 'Filetype', 'CursorMoved', 'CursorMovedI', 'ModeChanged', }, } }, 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('mason').setup() require('mason-lspconfig').setup() require('mason-tool-installer').setup({ ensure_installed = { "biome", "djlint", "emmet-language-server", "html-lsp", "lua-language-server", "lwc-language-server", "omnisharp", "prettier", "prettierd", "python-lsp-server", "roslyn", "ruff", "selene", "stylua", "typescript-language-server", } }) vim.lsp.config('lua_ls', { settings = { Lua = { runtime = { version = 'LuaJIT', }, diagnostics = { globals = { 'vim', 'require' }, }, workspace = { library = vim.api.nvim_get_runtime_file("", true), }, telemetry = { enable = false, }, }, }, })