-- disable netrw at the very start of your init.lua (strongly advised) vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.wo.number = true vim.wo.signcolumn = "yes" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not 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({ { "ellisonleao/gruvbox.nvim", priority = 1000 }, { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }, { "nvim-telescope/telescope.nvim", tag = "0.1.1", dependencies = { "nvim-lua/plenary.nvim" } }, { "ojroques/nvim-osc52" }, { "nvim-tree/nvim-tree.lua" }, { "jeffkreeftmeijer/vim-numbertoggle" }, { "lukas-reineke/indent-blankline.nvim" }, { "mbbill/undotree" }, { "phaazon/hop.nvim" }, { "edluffy/hologram.nvim" }, { "echasnovski/mini.nvim", version = "*" }, { "williamboman/mason.nvim", build = ":MasonUpdate", -- :MasonUpdate updates registry contents }, { "folke/which-key.nvim", config = function() vim.o.timeout = true vim.o.timeoutlen = 300 require("which-key").setup({ -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below }) end, }, { "Wansmer/treesj", keys = { "m", "j", "s" }, dependencies = { "nvim-treesitter/nvim-treesitter" }, config = function() require("treesj").setup({--[[ your config ]] }) end, }, { "williamboman/mason-lspconfig.nvim" }, { "neovim/nvim-lspconfig" }, }) require("hop").setup() require("mini.ai").setup() require("mini.pairs").setup() require("mini.comment").setup() require("mini.starter").setup() require("mini.statusline").setup() require("mini.tabline").setup() require("mini.bracketed").setup() require("mini.surround").setup() require("mini.completion").setup() require('hologram').setup{ auto_display = true -- WIP automatic markdown image display, may be prone to breaking } require("mason").setup({ ui = { icons = { package_installed = "✓", package_pending = "➜", package_uninstalled = "✗", }, }, }) require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", "rust_analyzer" }, }) require("lspconfig").lua_ls.setup({ settings = { Lua = { runtime = { -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) version = "LuaJIT", }, diagnostics = { -- Get the language server to recognize the `vim` global globals = { "vim" }, }, workspace = { -- Make the server aware of Neovim runtime files library = vim.api.nvim_get_runtime_file("", true), checkThirdParty = false, }, -- Do not send telemetry data containing a randomized but unique identifier telemetry = { enable = false, }, }, }, }) require("osc52").setup({ max_length = 0, -- Maximum length of selection (0 for no limit) silent = false, -- Disable message on successful copy trim = false, -- Trim surrounding whitespaces before copy }) local hop = require("hop") local directions = require("hop.hint").HintDirection vim.keymap.set("n", "s", function() hop.hint_words() end, { remap = true }) vim.o.background = "dark" -- or "light" for light mode vim.cmd([[colorscheme gruvbox]]) vim.cmd([[set undofile]]) local builtin = require("telescope.builtin") vim.keymap.set("n", "fg", builtin.live_grep, {}) vim.keymap.set("n", "fb", builtin.buffers, {}) vim.keymap.set("n", "fh", builtin.help_tags, {}) --- set termguicolors to enable highlight groups vim.opt.termguicolors = true require("nvim-tree").setup({ sort_by = "case_insensitive", view = { width = 50, }, renderer = { group_empty = true, }, filters = { dotfiles = false, }, }) vim.api.nvim_set_keymap("n", "e", ":NvimTreeToggle", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "q", ":q", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "w", ":w", { noremap = true, silent = true }) vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) vim.cmd([[highlight IndentBlanklineIndent1 guifg=#443838 gui=nocombine]]) vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 vim.opt.list = true vim.opt.listchars:append("lead:⋅") vim.opt.listchars:append("tab:>⎯▷") require("indent_blankline").setup({ space_char_blankline = " ", char_highlight_list = { "IndentBlanklineIndent1", }, space_char_highlight_list = { "IndentBlanklineIndent1", }, }) vim.keymap.set("n", "c", require("osc52").copy_operator, { expr = true }) vim.keymap.set("n", "cc", "c_", { remap = true }) vim.keymap.set("v", "c", require("osc52").copy_visual)