My simple neovim config
at main 2.7 kB view raw
1local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2if not vim.loop.fs_stat(lazypath) then 3 vim.fn.system({ 4 "git", 5 "clone", 6 "--filter=blob:none", 7 "--single-branch", 8 "https://github.com/folke/lazy.nvim.git", 9 lazypath, 10 }) 11end 12vim.g.mapleader = "," 13vim.opt.runtimepath:prepend(lazypath) 14vim.opt.winborder = "rounded" 15vim.opt.relativenumber = true 16vim.opt.number = true 17vim.opt.spelllang = "en" 18-- Global options 19vim.opt.termguicolors = true 20vim.opt.hidden = true 21vim.opt.hlsearch = false 22vim.opt.incsearch = true 23vim.opt.scrolloff = 8 24vim.opt.splitright = true 25local tab_value = 4 26vim.opt.tabstop = tab_value 27vim.opt.softtabstop = tab_value 28vim.opt.shiftwidth = tab_value 29vim.opt.expandtab = true 30 31vim.opt.shell = "fish" 32vim.opt.bg = "dark" 33vim.opt.spell = false -- Enables treesitter comment spelling 34vim.opt.termguicolors = true 35vim.opt.signcolumn = "yes" 36vim.opt.filetype = "on" 37vim.o.swapfile = false 38vim.o.wrap = false 39vim.o.clipboard = "unnamedplus" 40 41-- Persistent undos 42vim.opt.undofile = true 43require("lazy").setup("plugins") 44require("mappings") 45require("lsp") 46 47-- Treesitter Consistent Syntax Highlighting and indent 48require("nvim-treesitter.configs").setup({ 49 ensure_installed = { 50 "bash", 51 "c", 52 "dockerfile", 53 "gitcommit", 54 "go", 55 "gomod", 56 "lua", 57 "python", 58 "query", 59 "rust", 60 "toml", 61 "yaml", 62 "just", 63 }, 64 highlight = { 65 enable = true, 66 }, 67 playground = { 68 enable = true, 69 }, 70 -- Potentially remove, this is not really in my roation yet 71 incremental_selection = { 72 enable = true, 73 keymaps = { 74 init_selection = "<c-space>", 75 node_incremental = "<c-space>", 76 scope_incremental = "<c-s>", 77 node_decremental = "<c-backspace>", 78 }, 79 }, 80 sync_install = false, 81 auto_install = false, 82 ignore_install = {}, 83 modules = {}, 84}) 85vim.filetype.add({ extension = { mdx = "mdx", service = "systemd" } }) 86vim.treesitter.language.register("markdown", "mdx") 87vim.treesitter.language.register("html", "superhtml") 88 89require("treesitter-context").setup() 90 91vim.api.nvim_create_autocmd({ "FileType" }, { 92 group = vim.api.nvim_create_augroup("edit_text", { clear = true }), 93 pattern = { "gitcommit", "markdown", "txt" }, 94 desc = "Enable spell checking and text wrapping for certain filetypes", 95 callback = function() 96 -- vim.opt_local.wrap = true 97 vim.opt_local.spell = true 98 end, 99}) 100vim.opt.spell = false 101 102vim.diagnostic.config({ 103 update_in_insert = false, 104 -- virtual_text = { current_line = true }, 105 virtual_lines = { current_line = true }, 106})