From 73abbedbe872cf4db8263f0d6ecf49855ddd9da7 Mon Sep 17 00:00:00 2001 From: zman27 Date: Sun, 29 Jan 2023 11:25:00 -0500 Subject: [PATCH] a --- config.lua | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 config.lua diff --git a/config.lua b/config.lua new file mode 100644 index 0000000..ea4acf7 --- /dev/null +++ b/config.lua @@ -0,0 +1,132 @@ +--[[ + THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT + `lvim` is the global options object +]] + +-- vim options +vim.opt.shiftwidth = 2 +vim.opt.tabstop = 2 +vim.opt.relativenumber = true + +-- general +lvim.log.level = "info" +lvim.format_on_save = { + enabled = true, + pattern = "*.lua", + timeout = 1000, +} +-- to disable icons and use a minimalist setup, uncomment the following +-- lvim.use_icons = false + +-- keymappings +lvim.leader = "space" +-- add your own keymapping +lvim.keys.normal_mode[""] = ":w" + +-- lvim.keys.normal_mode[""] = ":BufferLineCycleNext" +-- lvim.keys.normal_mode[""] = ":BufferLineCyclePrev" + +-- -- Use which-key to add extra bindings with the leader-key prefix +-- lvim.builtin.which_key.mappings["W"] = { "noautocmd w", "Save without formatting" } +-- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } + +-- -- Change theme settings +-- lvim.colorscheme = "lunar" + +lvim.builtin.alpha.active = true +lvim.builtin.alpha.mode = "dashboard" +lvim.builtin.terminal.active = true +lvim.builtin.nvimtree.setup.view.side = "left" +lvim.builtin.nvimtree.setup.renderer.icons.show.git = false + +-- Automatically install missing parsers when entering buffer +lvim.builtin.treesitter.auto_install = true + +-- lvim.builtin.treesitter.ignore_install = { "haskell" } + +-- -- generic LSP settings + +-- --- disable automatic installation of servers +-- lvim.lsp.installer.setup.automatic_installation = false + +-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect +-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers` +-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) +-- local opts = {} -- check the lspconfig documentation for a list of all possible options +-- require("lvim.lsp.manager").setup("pyright", opts) + +-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect +-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype +-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) +-- return server ~= "emmet_ls" +-- end, lvim.lsp.automatic_configuration.skipped_servers) + +-- -- you can set a custom on_attach function that will be used for all the language servers +-- -- See +-- lvim.lsp.on_attach_callback = function(client, bufnr) +-- local function buf_set_option(...) +-- vim.api.nvim_buf_set_option(bufnr, ...) +-- end +-- --Enable completion triggered by +-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") +-- end + +-- -- linters and formatters +-- local formatters = require "lvim.lsp.null-ls.formatters" +-- formatters.setup { +-- { command = "stylua" }, +-- { +-- command = "prettier", +-- extra_args = { "--print-width", "100" }, +-- filetypes = { "typescript", "typescriptreact" }, +-- }, +-- } +-- local linters = require "lvim.lsp.null-ls.linters" +-- linters.setup { +-- { command = "flake8", filetypes = { "python" } }, +-- { +-- command = "shellcheck", +-- args = { "--severity", "warning" }, +-- }, +-- } + +-- -- Additional Plugins +lvim.plugins = { + { + "zbirenbaum/copilot.lua", + -- event = { "VimEnter" }, + config = function() + vim.defer_fn(function() + require("copilot").setup { + plugin_manager_path = os.getenv "LUNARVIM_RUNTIME_DIR" .. "/site/pack/packer", + suggestion = { enabled = true, auto_trigger = true }, + } + end, 100) + end, + }, + { + "zbirenbaum/copilot-cmp", + after = { "copilot.lua" }, + config = function() + require("copilot_cmp").setup { + formatters = { + insert_text = require("copilot_cmp.format").remove_existing, + }, + } + end, + }, +} + +vim.g.copilot_no_tab_map = true +vim.g.copilot_assume_mapped = true + +lvim.keys.insert_mode[""] = "lua require('copilot.suggestion').accept()" + +-- -- Autocommands (`:help autocmd`) +-- vim.api.nvim_create_autocmd("FileType", { +-- pattern = "zsh", +-- callback = function() +-- -- let treesitter use bash highlight for zsh files as well +-- require("nvim-treesitter.highlight").attach(0, "bash") +-- end, +-- })