conf: format lua files

This commit is contained in:
2022-04-15 16:04:43 +08:00
parent c925ecee9f
commit c85dbc09a8
11 changed files with 49 additions and 41 deletions
-2
View File
@@ -41,5 +41,3 @@ vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<C
vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
-1
View File
@@ -26,4 +26,3 @@ vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.completeopt = 'menu,menuone,noinsert'
-1
View File
@@ -1,5 +1,4 @@
local present, autopairs = pcall(require, "nvim-autopairs")
if not present then
return
end
+1 -2
View File
@@ -1,10 +1,9 @@
local present, escape = pcall(require, 'better_escape')
if not present then
print "no escape"
return
end
escape.setup({
mapping = {'jk'},
mapping = { 'jk' },
})
+1 -1
View File
@@ -14,6 +14,6 @@ vim.api.nvim_set_keymap('n', '<S-h>', ':BufferLineCyclePrev<CR>', opts)
bufferline.setup({
offsets = {
{ filetype='NvimTree', text='File Explorer', text_align = 'center' },
{ filetype = 'NvimTree', text = 'File Explorer', text_align = 'center' },
}
})
+16 -16
View File
@@ -45,7 +45,7 @@ local kind_icons = {
TypeParameter = ""
}
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
cmp.setup({
snippet = {
@@ -59,7 +59,7 @@ cmp.setup({
end
},
formatting = {
fields = {'kind', 'abbr', 'menu'},
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
vim_item.abbr = string.format('%s', vim_item.abbr)
vim_item.kind = string.format('%s', kind_icons[vim_item.kind])
@@ -84,7 +84,7 @@ cmp.setup({
else
fallback()
end
end, {'i', 'c', 's'}),
end, { 'i', 'c', 's' }),
['<C-j>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item({
@@ -93,21 +93,21 @@ cmp.setup({
else
fallback()
end
end, {'i', 'c', 's'}),
end, { 'i', 'c', 's' }),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c', 's'}), -- d
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c', 's' }), -- d
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close()
}),
['<CR>'] = cmp.mapping(function (fallback)
['<CR>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm()
else
fallback()
end
end, {'i', 's'}),
end, { 'i', 's' }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm({
@@ -118,14 +118,14 @@ cmp.setup({
else
fallback()
end
end, {'i', 'c', 's'}),
end, { 'i', 'c', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {'i', 's'})
end, { 'i', 's' })
},
completion = {
-- Highlight first item
@@ -133,13 +133,13 @@ cmp.setup({
},
window = {
documentation = {
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
}
},
experimental = {
-- ghost_text = true
},
sources = {{
sources = { {
name = 'nvim_lsp'
}, {
name = 'luasnip'
@@ -149,17 +149,17 @@ cmp.setup({
name = 'path'
}, {
name = 'cmdline'
}}
} }
})
cmp.setup.cmdline(':', {
sources = {{
sources = { {
name = 'cmdline'
}}
} }
})
cmp.setup.cmdline('/', {
sources = {{
sources = { {
name = 'buffer'
}}
} }
})
-1
View File
@@ -1,5 +1,4 @@
local present, gitsigns = pcall(require, "gitsigns")
if not present then
print "no gitsigns"
return
-2
View File
@@ -1,5 +1,4 @@
local present, lsp_installer = pcall(require, 'nvim-lsp-installer')
if not present then
print 'no lsp installer'
return
@@ -69,4 +68,3 @@ lsp_installer.settings({
}
}
})
+11
View File
@@ -0,0 +1,11 @@
local present, null_ls = pcall(require, 'null-ls')
if not present then
vim.notify('no null-ls')
return
end
null_ls.setup({
sources = {
-- null_ls.builtins.formatting.stylua,
}
})
+1 -1
View File
@@ -9,7 +9,7 @@ nvimtree.setup({
open_on_setup = true,
open_on_setup_file = true,
open_on_tab = true,
ignore_ft_on_setup = {'alpha', 'dashboard'},
ignore_ft_on_setup = { 'alpha', 'dashboard' },
diagnostics = {
enable = true,
show_on_dirs = false,
+19 -14
View File
@@ -1,8 +1,8 @@
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
install_path})
packer_bootstrap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
install_path })
end
-- Only required if you have packer configured as `opt`
@@ -34,14 +34,14 @@ return packer.startup(function(use)
}
use {
'numToStr/Comment.nvim',
event = {'BufRead', 'BufNewFile'},
event = { 'BufRead', 'BufNewFile' },
config = function()
require('configs.plugins.comment')
end
}
use {
'lewis6991/gitsigns.nvim',
event = {'BufRead', 'BufNewFile'},
event = { 'BufRead', 'BufNewFile' },
config = function()
require('configs.plugins.gitsigns')
end
@@ -62,15 +62,15 @@ return packer.startup(function(use)
require('configs.plugins.cmp')
end
}
use {'hrsh7th/cmp-nvim-lsp'}
use {'hrsh7th/cmp-buffer'}
use {'hrsh7th/cmp-path'}
use {'hrsh7th/cmp-cmdline'}
use {'saadparwaiz1/cmp_luasnip'} -- Snippet compleetions
use { 'hrsh7th/cmp-nvim-lsp' }
use { 'hrsh7th/cmp-buffer' }
use { 'hrsh7th/cmp-path' }
use { 'hrsh7th/cmp-cmdline' }
use { 'saadparwaiz1/cmp_luasnip' } -- Snippet compleetions
-- Snippets
use {'L3MON4D3/LuaSnip'} -- Snippet engine
use {'rafamadriz/friendly-snippets'} -- Snippets collection
use { 'L3MON4D3/LuaSnip' } -- Snippet engine
use { 'rafamadriz/friendly-snippets' } -- Snippets collection
-- LSP
use {
@@ -85,12 +85,17 @@ return packer.startup(function(use)
require('configs.plugins.lsp_installer')
end
}
-- use { 'jose-elias-alvarez/null-ls.nvim',
-- config = function()
-- require('configs.plugins.null_ls')
-- end
-- }
-- UI Plugins
use {'kyazdani42/nvim-web-devicons'}
use { 'kyazdani42/nvim-web-devicons' }
use {
'kyazdani42/nvim-tree.lua',
requires = {'kyazdani42/nvim-web-devicons' -- optional, for file icon
requires = { 'kyazdani42/nvim-web-devicons' -- optional, for file icon
},
config = function()
require('configs.plugins.nvimtree')
@@ -99,7 +104,7 @@ return packer.startup(function(use)
use {
'nvim-telescope/telescope.nvim',
cmd = 'Telescope',
requires = {{'nvim-lua/plenary.nvim'}}
requires = { { 'nvim-lua/plenary.nvim' } }
}
use {
'akinsho/bufferline.nvim',