mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(nvim): Build another nvim from scratch
* Neovim: Backup original LazyVim setup to .config/nvim.lazy.d * Neovim: Currently done with basic completions and LSP * Git: Always use ssh to connect github remote * Zsh: Add more antidots config
This commit is contained in:
parent
74f2883139
commit
eeb3387112
53 changed files with 1617 additions and 682 deletions
71
.config/nvim/lua/plugins/mod/nvim-cmp.lua
Normal file
71
.config/nvim/lua/plugins/mod/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
--- Available LSP goes here
|
||||
--- Check https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
--- for available server and name
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabitilies = require("cmp_nvim_lsp").default_capabilities()
|
||||
local servers = require("config.servers")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
sources = cmp.config.sources(
|
||||
-- This order defines the priority of sources.
|
||||
{
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
},
|
||||
{
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}
|
||||
),
|
||||
})
|
||||
local keymaps = require("config.keymaps")
|
||||
local keymaps_cmp = keymaps.cmp_nvim_keymaps(cmp.mapping)
|
||||
|
||||
local function set_keymaps()
|
||||
local mappings = {}
|
||||
for _, map in ipairs(keymaps_cmp) do
|
||||
mappings[map.keys] = map.cmd
|
||||
end
|
||||
return mappings
|
||||
end
|
||||
cmp.setup.mapping = cmp.mapping.preset.insert(set_keymaps())
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "cmdline" },
|
||||
-- Use `path` is slow under WSL since WSL loads Windows paths
|
||||
-- https://github.com/zsh-users/zsh-syntax-highlighting/issues/790
|
||||
-- { name = "path" },
|
||||
}
|
||||
})
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
lspconfig[server].setup({
|
||||
capabilities = capabitilies,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue