feat: initial push with a fully separated and organized user configuration for AstroNvim v3
This commit is contained in:
		
							
								
								
									
										12
									
								
								lsp/config/yamlls.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lsp/config/yamlls.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
-- example for addings schemas to yamlls
 | 
			
		||||
return { -- override table for require("lspconfig").yamlls.setup({...})
 | 
			
		||||
  settings = {
 | 
			
		||||
    yaml = {
 | 
			
		||||
      schemas = {
 | 
			
		||||
        ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
 | 
			
		||||
        ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
 | 
			
		||||
        ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										20
									
								
								lsp/formatting.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								lsp/formatting.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
-- customize lsp formatting options
 | 
			
		||||
return {
 | 
			
		||||
  -- control auto formatting on save
 | 
			
		||||
  format_on_save = {
 | 
			
		||||
    enabled = true, -- enable or disable format on save globally
 | 
			
		||||
    allow_filetypes = { -- enable format on save for specified filetypes only
 | 
			
		||||
      -- "go",
 | 
			
		||||
    },
 | 
			
		||||
    ignore_filetypes = { -- disable format on save for specified filetypes
 | 
			
		||||
      -- "python",
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  disabled = { -- disable formatting capabilities for the listed language servers
 | 
			
		||||
    -- "sumneko_lua",
 | 
			
		||||
  },
 | 
			
		||||
  timeout_ms = 1000, -- default format timeout
 | 
			
		||||
  -- filter = function(client) -- fully override the default formatting function
 | 
			
		||||
  --   return true
 | 
			
		||||
  -- end
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								lsp/mappings.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								lsp/mappings.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
-- easily add or disable built in mappings added during LSP attaching
 | 
			
		||||
return {
 | 
			
		||||
  n = {
 | 
			
		||||
    -- ["<leader>lf"] = false -- disable formatting keymap
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								lsp/mason.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lsp/mason.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
-- customize mason plugins
 | 
			
		||||
return {
 | 
			
		||||
  -- use mason-lspconfig to configure LSP installations
 | 
			
		||||
  {
 | 
			
		||||
    "williamboman/mason-lspconfig.nvim",
 | 
			
		||||
    -- overrides `require("mason-lspconfig").setup(...)`
 | 
			
		||||
    opts = {
 | 
			
		||||
      -- ensure_installed = { "sumneko_lua" },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources
 | 
			
		||||
  {
 | 
			
		||||
    "jay-babu/mason-null-ls.nvim",
 | 
			
		||||
    -- overrides `require("mason-null-ls").setup(...)`
 | 
			
		||||
    opts = {
 | 
			
		||||
      -- ensure_installed = { "prettier", "stylua" },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    "jay-babu/mason-nvim-dap.nvim",
 | 
			
		||||
    -- overrides `require("mason-nvim-dap").setup(...)`
 | 
			
		||||
    opts = {
 | 
			
		||||
      -- ensure_installed = { "python" },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										4
									
								
								lsp/servers.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								lsp/servers.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
-- enable servers that you already have installed without mason
 | 
			
		||||
return {
 | 
			
		||||
  -- "pyright"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								lsp/setup_handlers.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								lsp/setup_handlers.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
-- override the LSP setup handler function based on server name
 | 
			
		||||
return {
 | 
			
		||||
  -- first function changes the default setup handler
 | 
			
		||||
  function(server, opts) require("lspconfig")[server].setup(opts) end,
 | 
			
		||||
  -- keys for a specific server name will be used for that LSP
 | 
			
		||||
  sumneko_lua = function(server, opts)
 | 
			
		||||
    -- custom sumneko_lua setup handler
 | 
			
		||||
    require("lspconfig")["sumneko_lua"].setup(opts)
 | 
			
		||||
  end,
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user