summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/defaults.lua37
-rw-r--r--lua/config/init.lua170
-rw-r--r--lua/config/settings.lua76
3 files changed, 0 insertions, 283 deletions
diff --git a/lua/config/defaults.lua b/lua/config/defaults.lua
deleted file mode 100644
index f030234d..00000000
--- a/lua/config/defaults.lua
+++ /dev/null
@@ -1,37 +0,0 @@
-local home_dir = vim.loop.os_homedir()
-local utils = require "utils"
-
-lvim = {
- leader = "space",
- colorscheme = "onedarker",
- line_wrap_cursor_movement = true,
- transparent_window = false,
- format_on_save = true,
- vsnip_dir = utils.join_paths(home_dir, ".config", "snippets"),
- database = { save_location = utils.join_paths(home_dir, ".config", "lunarvim_db"), auto_execute = 1 },
- keys = {},
-
- builtin = {},
-
- log = {
- ---@usage can be { "trace", "debug", "info", "warn", "error", "fatal" },
- level = "warn",
- viewer = {
- ---@usage this will fallback on "less +F" if not found
- cmd = "lnav",
- layout_config = {
- ---@usage direction = 'vertical' | 'horizontal' | 'window' | 'float',
- direction = "horizontal",
- open_mapping = "",
- size = 40,
- float_opts = {},
- },
- },
- },
- plugins = {
- -- use config.lua for this not put here
- },
-
- autocommands = {},
- lang = {},
-}
diff --git a/lua/config/init.lua b/lua/config/init.lua
deleted file mode 100644
index 411f7a93..00000000
--- a/lua/config/init.lua
+++ /dev/null
@@ -1,170 +0,0 @@
-local M = {}
-
---- Initialize lvim default configuration
--- Define lvim global variable
-function M:init(opts)
- opts = opts or {}
- self.path = opts.path
- local utils = require "utils"
-
- require "config.defaults"
-
- -- Fallback config.lua to lv-config.lua
- if not utils.is_file(self.path) then
- local lv_config = self.path:gsub("config.lua$", "lv-config.lua")
- print(self.path, "not found, falling back to", lv_config)
-
- self.path = lv_config
- end
-
- local builtins = require "core.builtins"
- builtins.config(self)
-
- local settings = require "config.settings"
- settings.load_options()
-
- local lvim_lsp_config = require "lsp.config"
- lvim.lsp = vim.deepcopy(lvim_lsp_config)
-
- local supported_languages = {
- "asm",
- "bash",
- "beancount",
- "bibtex",
- "bicep",
- "c",
- "c_sharp",
- "clojure",
- "cmake",
- "comment",
- "commonlisp",
- "cpp",
- "crystal",
- "cs",
- "css",
- "cuda",
- "d",
- "dart",
- "dockerfile",
- "dot",
- "elixir",
- "elm",
- "emmet",
- "erlang",
- "fennel",
- "fish",
- "fortran",
- "gdscript",
- "glimmer",
- "go",
- "gomod",
- "graphql",
- "haskell",
- "hcl",
- "heex",
- "html",
- "java",
- "javascript",
- "javascriptreact",
- "jsdoc",
- "json",
- "json5",
- "jsonc",
- "julia",
- "kotlin",
- "latex",
- "ledger",
- "less",
- "lua",
- "markdown",
- "nginx",
- "nix",
- "ocaml",
- "ocaml_interface",
- "perl",
- "php",
- "pioasm",
- "ps1",
- "puppet",
- "python",
- "ql",
- "query",
- "r",
- "regex",
- "rst",
- "ruby",
- "rust",
- "scala",
- "scss",
- "sh",
- "solidity",
- "sparql",
- "sql",
- "supercollider",
- "surface",
- "svelte",
- "swift",
- "tailwindcss",
- "terraform",
- "tex",
- "tlaplus",
- "toml",
- "tsx",
- "turtle",
- "typescript",
- "typescriptreact",
- "verilog",
- "vim",
- "vue",
- "yaml",
- "yang",
- "zig",
- }
-
- require("lsp.manager").init_defaults(supported_languages)
-end
-
-local function deprecation_notice()
- local in_headless = #vim.api.nvim_list_uis() == 0
- if in_headless then
- return
- end
-
- for lang, entry in pairs(lvim.lang) do
- local deprecated_config = entry["lsp"] or {}
- if not vim.tbl_isempty(deprecated_config) then
- local msg = string.format(
- "Deprecation notice: [lvim.lang.%s.lsp] setting is no longer supported. See https://github.com/LunarVim/LunarVim#breaking-changes",
- lang
- )
- vim.schedule(function()
- vim.notify(msg, vim.log.levels.WARN)
- end)
- end
- end
-end
-
---- Override the configuration with a user provided one
--- @param config_path The path to the configuration overrides
-function M:load(config_path)
- local autocmds = require "core.autocmds"
-
- config_path = config_path or self.path
- local ok, err = pcall(vim.cmd, "luafile " .. config_path)
- if not ok then
- print("Invalid configuration", config_path)
- print(err)
- return
- end
-
- deprecation_notice()
-
- self.path = config_path
-
- autocmds.define_augroups(lvim.autocommands)
-
- local settings = require "config.settings"
- settings.load_commands()
-end
-
-return M
diff --git a/lua/config/settings.lua b/lua/config/settings.lua
deleted file mode 100644
index 90042c4f..00000000
--- a/lua/config/settings.lua
+++ /dev/null
@@ -1,76 +0,0 @@
-local M = {}
-local utils = require "utils"
-M.load_options = function()
- local default_options = {
- backup = false, -- creates a backup file
- clipboard = "unnamedplus", -- allows neovim to access the system clipboard
- cmdheight = 2, -- more space in the neovim command line for displaying messages
- colorcolumn = "99999", -- fixes indentline for now
- completeopt = { "menuone", "noselect" },
- conceallevel = 0, -- so that `` is visible in markdown files
- fileencoding = "utf-8", -- the encoding written to a file
- foldmethod = "manual", -- folding, set to "expr" for treesitter based folding
- foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding
- guifont = "monospace:h17", -- the font used in graphical neovim applications
- hidden = true, -- required to keep multiple buffers and open multiple buffers
- hlsearch = true, -- highlight all matches on previous search pattern
- ignorecase = true, -- ignore case in search patterns
- mouse = "a", -- allow the mouse to be used in neovim
- pumheight = 10, -- pop up menu height
- showmode = false, -- we don't need to see things like -- INSERT -- anymore
- showtabline = 2, -- always show tabs
- smartcase = true, -- smart case
- smartindent = true, -- make indenting smarter again
- splitbelow = true, -- force all horizontal splits to go below current window
- splitright = true, -- force all vertical splits to go to the right of current window
- swapfile = false, -- creates a swapfile
- termguicolors = true, -- set term gui colors (most terminals support this)
- timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
- title = true, -- set the title of window to the value of the titlestring
- -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
- undodir = utils.join_paths(get_cache_dir(), "undo"), -- set an undo directory
- undofile = true, -- enable persistent undo
- updatetime = 300, -- faster completion
- writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
- expandtab = true, -- convert tabs to spaces
- shiftwidth = 2, -- the number of spaces inserted for each indentation
- tabstop = 2, -- insert 2 spaces for a tab
- cursorline = true, -- highlight the current line
- number = true, -- set numbered lines
- relativenumber = false, -- set relative numbered lines
- numberwidth = 4, -- set number column width to 2 {default 4}
- signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
- wrap = false, -- display lines as one long line
- spell = false,
- spelllang = "en",
- scrolloff = 8, -- is one of my fav
- sidescrolloff = 8,
- }
-
- --- SETTINGS ---
-
- vim.opt.shortmess:append "c"
-
- for k, v in pairs(default_options) do
- vim.opt[k] = v
- end
-end
-
-M.load_commands = function()
- local cmd = vim.cmd
- if lvim.line_wrap_cursor_movement then
- cmd "set whichwrap+=<,>,[,],h,l"
- end
-
- if lvim.transparent_window then
- cmd "au ColorScheme * hi Normal ctermbg=none guibg=none"
- cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none"
- cmd "au ColorScheme * hi NormalNC ctermbg=none guibg=none"
- cmd "au ColorScheme * hi MsgArea ctermbg=none guibg=none"
- cmd "au ColorScheme * hi TelescopeBorder ctermbg=none guibg=none"
- cmd "au ColorScheme * hi NvimTreeNormal ctermbg=none guibg=none"
- cmd "let &fcs='eob: '"
- end
-end
-
-return M