minimal
This commit is contained in:
1 parent
170ae42bea
commit
deb9bcea46
12 files changed
+227
No files matched your search
@@ -0,0 +1,28 @@
|
||||
vim.cmd("let mapleader = ' '")
|
||||
|
||||
require('preferences')
|
||||
require('keymaps')
|
||||
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
|
||||
{ out, 'WarningMsg' },
|
||||
{ '\nPress any key to exit...' },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup({
|
||||
spec = {
|
||||
{ import = 'plugins' },
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd('colorscheme onedark')
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" },
|
||||
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ff97d376b1d22b2eaf9274605531babf0cd0cf21" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "1420fb9e07b1d80cc6d87e7d90827fb2c1109cb3" }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
vim.keymap.set('n', '<C-n>', ':Neotree filesystem reveal left toggle<CR>')
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', ':Telescope find_files<CR>')
|
||||
vim.keymap.set('n', '<leader>tc', ':Telescope colorscheme<CR>')
|
||||
vim.keymap.set('n', '<leader>of', ':Telescope oldfiles<CR>')
|
||||
vim.keymap.set('n', '<leader>tl', ':Telescope live_grep<CR>')
|
||||
vim.keymap.set('n', '<leader>km', ':Telescope keymaps<CR>')
|
||||
|
||||
vim.keymap.set('n', '<leader>ft', vim.lsp.buf.format, {})
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
return {}
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
'altermo/ultimate-autopair.nvim',
|
||||
event = { 'InsertEnter', 'CmdlineEnter' },
|
||||
branch = 'v0.6', --recommended as each new version will have breaking changes
|
||||
opts = {
|
||||
--Config goes here
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
'navarasu/onedark.nvim',
|
||||
|
||||
config = function()
|
||||
require('onedark').setup({
|
||||
style = 'deep',
|
||||
transparent = true,
|
||||
term_colors = false,
|
||||
ending_tildes = false,
|
||||
cmp_itemkind_reverse = false,
|
||||
-- toggle_style_key = '<leader>ot',
|
||||
-- toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' },
|
||||
|
||||
-- Options are italic, bold, underline, none and combos 'italic,bold'
|
||||
code_style = {
|
||||
comments = 'italic',
|
||||
keywords = 'none',
|
||||
functions = 'none',
|
||||
strings = 'none',
|
||||
variables = 'none',
|
||||
},
|
||||
|
||||
lualine = { transparent = true },
|
||||
diagnostics = { darker = true, undercurl = true, background = false },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
return {
|
||||
{
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
|
||||
dependencies = {
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
'onsails/lspkind.nvim',
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol', -- show only symbol annotations
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
-- can also be a function to dynamically calculate max width such as
|
||||
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
|
||||
|
||||
-- The function below will be called before any actual modifications from lspkind
|
||||
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
|
||||
before = function(entry, vim_item)
|
||||
return vim_item
|
||||
end,
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
|
||||
config = function()
|
||||
require('mason').setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
|
||||
config = function()
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.8',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
|
||||
config = function()
|
||||
require('telescope').setup({
|
||||
pickers = {
|
||||
colorscheme = { enable_preview = true },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
vim.cmd([[autocmd FileType * set formatoptions-=ro]])
|
||||
|
||||
vim.cmd('set number')
|
||||
vim.cmd('set relativenumber')
|
||||
vim.cmd('set noexpandtab')
|
||||
vim.cmd('set tabstop=6')
|
||||
vim.cmd('set shiftwidth=6')
|
||||
vim.cmd('set nowrap')
|
||||
Reference in new issue
Block a user