-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kirk Paradis <[email protected]> Co-authored-by: Kai Löhnert <[email protected]>
- Loading branch information
1 parent
64b3c17
commit 0ac1d37
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Swift Language Pack | ||
|
||
## Note: xbase is a WIP plugin, and the experience provided by this plugin might be lackluster | ||
|
||
**Requirements:** | ||
|
||
1. Make sure you have [sourcekit-lsp](https://github.com/apple/sourcekit-lsp) installed on your machine. | ||
|
||
2. Install Xcode Device Simulators: | ||
To enable simulator functionality from within Neovim, you need to have Xcode Device Simulators installed on your machine. You can install these simulators from Xcode. | ||
|
||
3. Mappings: | ||
The default mappings for the xbase plugin overlap with AstroNvim's default. Therefore, you should set the mappings yourself. | ||
Refer to [xBase](https://github.com/kkharji/xbase#neovim-3) documentation for more options. | ||
|
||
```lua | ||
opts = { | ||
-- ... (other options) | ||
|
||
mappings = { | ||
enable = true, | ||
build_picker = "<leader>rb", -- Set to 0 to disable | ||
run_picker = "<leader>ra", -- Set to 0 to disable | ||
watch_picker = 0, -- Set to 0 to disable | ||
all_picker = 0, -- Set to 0 to disable | ||
toggle_split_log_buffer = 0, | ||
toggle_vsplit_log_buffer = "<leader>rs", | ||
}, | ||
|
||
-- ... (other options) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local utils = require "astronvim.utils" | ||
|
||
return { | ||
{ | ||
"xbase-lab/xbase", | ||
ft = { | ||
"swift", | ||
"objcpp", | ||
"objc", | ||
}, | ||
run = "make install", -- or "make install && make free_space" (not recommended, longer build time) | ||
dependencies = { | ||
"neovim/nvim-lspconfig", | ||
-- "nvim-telescope/telescope.nvim", -- optional | ||
-- "nvim-lua/plenary.nvim", -- optional/requirement of telescope.nvim | ||
-- "stevearc/dressing.nvim", -- optional (in case you don't use telescope but something else) | ||
}, | ||
init = function() require("astronvim.utils.lsp").setup "sourcekit-lsp" end, | ||
}, | ||
{ | ||
"jose-elias-alvarez/null-ls.nvim", | ||
opts = function(_, opts) | ||
local nls = require "null-ls" | ||
if type(opts.sources) == "table" then | ||
vim.list_extend(opts.sources, { | ||
nls.builtins.formatting.swift_format, | ||
}) | ||
end | ||
end, | ||
}, | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = function(_, opts) | ||
if opts.ensure_installed ~= "all" then | ||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "swift") | ||
end | ||
end, | ||
}, | ||
{ | ||
"jay-babu/mason-nvim-dap.nvim", | ||
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "codelldb") end, | ||
}, | ||
} |