diff --git a/init.lua b/init.lua index 496f45b8..c3a9877f 100644 --- a/init.lua +++ b/init.lua @@ -99,10 +99,18 @@ vim.g.have_nerd_font = false -- For more options, you can see `:help option-list` -- Make line numbers default -vim.opt.number = true +-- vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true + +-- custom stuff +vim.opt.expandtab = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.softtabstop = -1 +vim.opt.encoding = 'UTF-8' +vim.opt.ff = 'unix' -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -319,7 +327,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = true }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -565,6 +573,7 @@ require('lazy').setup({ }, }, }, + zls = {}, } -- Ensure the servers and tools above are installed @@ -598,43 +607,6 @@ require('lazy').setup({ end, }, - { -- Autoformat - 'stevearc/conform.nvim', - lazy = false, - keys = { - { - 'f', - function() - require('conform').format { async = true, lsp_fallback = true } - end, - mode = '', - desc = '[F]ormat buffer', - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, - }, - }, - }, - { -- Autocompletion 'hrsh7th/nvim-cmp', event = 'InsertEnter', @@ -683,7 +655,7 @@ require('lazy').setup({ luasnip.lsp_expand(args.body) end, }, - completion = { completeopt = 'menu,menuone,noinsert' }, + completion = { completeopt = 'menu,menuone,noselect,noinsert' }, -- For an understanding of why these mappings were -- chosen, you will need to read `:help ins-completion` @@ -691,9 +663,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -702,7 +674,7 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -745,16 +717,18 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + -- 'folke/tokyonight.nvim', + 'projekt0n/github-nvim-theme', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'github_dark' -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' + -- vim.cmd.hi 'Comment gui=none' + vim.cmd.hi 'Normal guibg=NONE ctermbg=NONE' end, }, @@ -802,7 +776,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'zig' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -848,6 +822,17 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- { import = 'custom.plugins' }, + { + 'nvim-tree/nvim-tree.lua', + config = function() + require('nvim-tree').setup() + vim.cmd 'NvimTreeOpen' + vim.cmd 'wincmd w' + end, + }, + { + 'ziglang/zig.vim', + }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the