current nvim-config
This commit is contained in:
85
init.lua
Normal file
85
init.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
vim.opt.tabstop = 8 -- Always 8 (see :h tabstop)
|
||||
vim.opt.softtabstop = 4 -- What you expecting
|
||||
vim.opt.shiftwidth = 4 -- What you expecting
|
||||
vim.cmd("set rnu")
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
|
||||
vim.keymap.set('n', '<leader>n', ':Neotree filesystem reveal left<CR>', {})
|
||||
|
||||
|
||||
|
||||
--NVIM ANGULAR LSPCONFIG
|
||||
--[[local project_library_path = "/usr/lib/node_modules/@angular/language-server/"
|
||||
local cmd = {
|
||||
"ngserver",
|
||||
"--stdio",
|
||||
"--tsProbeLocations",
|
||||
project_library_path,
|
||||
"--ngProbeLocations",
|
||||
project_library_path,
|
||||
"--19.2.1",
|
||||
""
|
||||
}
|
||||
local filetypes = {
|
||||
"typescript",
|
||||
"html",
|
||||
"ts"
|
||||
}
|
||||
local root_markers={
|
||||
"angular.json",
|
||||
"nx.json"
|
||||
}
|
||||
|
||||
vim.lsp.config('angularls', {
|
||||
cmd = cmd,
|
||||
filetypes = filetypes,
|
||||
root_markers = root_markers
|
||||
})
|
||||
vim.lsp.enable('angularls')
|
||||
]]--
|
||||
--NVIM-CMP
|
||||
config=function()
|
||||
local cmp = require'cmp'
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
--{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
end
|
||||
Reference in New Issue
Block a user