diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-03-01 19:11:19 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-03-01 19:12:16 +0530 |
commit | 1bc4074843eeba4b30d6ee2ed877afd74e1fc44e (patch) | |
tree | 6a498e69d47ecb174bd13989f948735faf8bf0a6 /lua/plugins/opts | |
parent | 32f76c11be0556da1263b83b295e0381e6ee45f0 (diff) |
fmt: init stylua
Diffstat (limited to 'lua/plugins/opts')
-rw-r--r-- | lua/plugins/opts/cmp.lua | 160 | ||||
-rw-r--r-- | lua/plugins/opts/lspconfig.lua | 48 | ||||
-rw-r--r-- | lua/plugins/opts/lualine.lua | 2 | ||||
-rw-r--r-- | lua/plugins/opts/misc.lua | 40 |
4 files changed, 125 insertions, 125 deletions
diff --git a/lua/plugins/opts/cmp.lua b/lua/plugins/opts/cmp.lua index c423a31..65e48b5 100644 --- a/lua/plugins/opts/cmp.lua +++ b/lua/plugins/opts/cmp.lua @@ -1,96 +1,96 @@ -local cmp = require "cmp" -local lspzero_cmp_act = require('lsp-zero').cmp_action() +local cmp = require("cmp") +local lspzero_cmp_act = require("lsp-zero").cmp_action() local function border(hl_name) - return { - { "╭", hl_name }, - { "─", hl_name }, - { "╮", hl_name }, - { "│", hl_name }, - { "╯", hl_name }, - { "─", hl_name }, - { "╰", hl_name }, - { "│", hl_name }, - } + return { + { "╭", hl_name }, + { "─", hl_name }, + { "╮", hl_name }, + { "│", hl_name }, + { "╯", hl_name }, + { "─", hl_name }, + { "╰", hl_name }, + { "│", hl_name }, + } end local options = { - completion = { - completeopt = "menu,menuone", - }, + completion = { + completeopt = "menu,menuone", + }, - window = { - completion = { - border = border "CmpBorder", - winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,CursorLine:PmenuSel", - scrollbar = false, - }, - documentation = { - border = border "CmpDocBorder", - winhighlight = "Normal:CmpDoc", - }, - }, + window = { + completion = { + border = border("CmpBorder"), + winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,CursorLine:PmenuSel", + scrollbar = false, + }, + documentation = { + border = border("CmpDocBorder"), + winhighlight = "Normal:CmpDoc", + }, + }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, - formatting = { - fields = { "abbr", "kind", "menu" }, + formatting = { + fields = { "abbr", "kind", "menu" }, - format = function(_, item) - local icons = { - Text = " ", - Method = " ", - Function = " ", - Constructor = " ", - Field = " ", - Variable = " ", - Class = " ", - Interface = " ", - Module = " ", - Property = " ", - Unit = " ", - Value = " ", - Enum = " ", - Keyword = " ", - Snippet = " ", - Color = " ", - File = " ", - Reference = " ", - Folder = " ", - EnumMember = " ", - Constant = " ", - Struct = " ", - Event = " ", - Operator = " ", - TypeParameter = " ", - } + format = function(_, item) + local icons = { + Text = " ", + Method = " ", + Function = " ", + Constructor = " ", + Field = " ", + Variable = " ", + Class = " ", + Interface = " ", + Module = " ", + Property = " ", + Unit = " ", + Value = " ", + Enum = " ", + Keyword = " ", + Snippet = " ", + Color = " ", + File = " ", + Reference = " ", + Folder = " ", + EnumMember = " ", + Constant = " ", + Struct = " ", + Event = " ", + Operator = " ", + TypeParameter = " ", + } - local icon = icons[item.kind] or "" - item.kind = string.format(" %s %s", icon, item.kind) + local icon = icons[item.kind] or "" + item.kind = string.format(" %s %s", icon, item.kind) - return item - end, - }, + return item + end, + }, - mapping = cmp.mapping.preset.insert({ - ['<C-Space>'] = cmp.mapping.complete(), - ['<C-u>'] = cmp.mapping.scroll_docs(-4), - ['<C-d>'] = cmp.mapping.scroll_docs(4), - ['<C-f>'] = lspzero_cmp_act.luasnip_jump_forward(), - ['<C-b>'] = lspzero_cmp_act.luasnip_jump_backward(), - }), + mapping = cmp.mapping.preset.insert({ + ["<C-Space>"] = cmp.mapping.complete(), + ["<C-u>"] = cmp.mapping.scroll_docs(-4), + ["<C-d>"] = cmp.mapping.scroll_docs(4), + ["<C-f>"] = lspzero_cmp_act.luasnip_jump_forward(), + ["<C-b>"] = lspzero_cmp_act.luasnip_jump_backward(), + }), - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" }, - }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "path" }, + }, } return options diff --git a/lua/plugins/opts/lspconfig.lua b/lua/plugins/opts/lspconfig.lua index 798e6c8..0a00fa7 100644 --- a/lua/plugins/opts/lspconfig.lua +++ b/lua/plugins/opts/lspconfig.lua @@ -1,35 +1,35 @@ -local lspconfig = require "lspconfig" -local lsp_zero = require "lsp-zero" +local lspconfig = require("lspconfig") +local lsp_zero = require("lsp-zero") lsp_zero.extend_lspconfig() lsp_zero.set_sign_icons({ - error = " ", - warn = " ", - info = " ", - hint = " " + error = " ", + warn = " ", + info = " ", + hint = " ", }) lsp_zero.on_attach(function(_, bufnr) - lsp_zero.default_keymaps({buffer = bufnr}) + lsp_zero.default_keymaps({ buffer = bufnr }) end) lspconfig.lua_ls.setup(lsp_zero.nvim_lua_ls({ - settings = { - Lua = { - diagnostics = { - globals = { 'mp' } -- mpv global - } - } - } + settings = { + Lua = { + diagnostics = { + globals = { "mp" }, -- mpv global + }, + }, + }, })) -lspconfig.ccls.setup { - init_options = { - cache = { - directory = vim.fn.stdpath('cache') .. '/ccls' - } - } -} +lspconfig.ccls.setup({ + init_options = { + cache = { + directory = vim.fn.stdpath("cache") .. "/ccls", + }, + }, +}) -lspconfig.bashls.setup {} -lspconfig.nil_ls.setup {} -lspconfig.pyright.setup {} +lspconfig.bashls.setup({}) +lspconfig.nil_ls.setup({}) +lspconfig.pyright.setup({}) diff --git a/lua/plugins/opts/lualine.lua b/lua/plugins/opts/lualine.lua index 456fa37..708a12b 100644 --- a/lua/plugins/opts/lualine.lua +++ b/lua/plugins/opts/lualine.lua @@ -2,7 +2,7 @@ return { sections = { lualine_a = { "mode" }, lualine_b = { "branch", "diff" }, - lualine_c = {{ "buffers", mode = 2 }}, + lualine_c = { { "buffers", mode = 2 } }, lualine_x = { "diagnostics" }, lualine_y = { "progress" }, diff --git a/lua/plugins/opts/misc.lua b/lua/plugins/opts/misc.lua index e228023..a7cbafa 100644 --- a/lua/plugins/opts/misc.lua +++ b/lua/plugins/opts/misc.lua @@ -1,30 +1,30 @@ local M = {} -local maps = require "plugins.maps" +local maps = require("plugins.maps") M.gitsigns = { - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "-" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, - untracked = { text = "│" }, - }, + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "-" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "│" }, + }, - on_attach = function(bufnr) - maps.load("gitsigns", { buffer = bufnr }) - end, + on_attach = function(bufnr) + maps.load("gitsigns", { buffer = bufnr }) + end, } -M.luasnip = function (opts) - require("luasnip").config.set_config(opts) +M.luasnip = function(opts) + require("luasnip").config.set_config(opts) - -- vscode format - require("luasnip.loaders.from_vscode").lazy_load() - -- snipmate format - require("luasnip.loaders.from_snipmate").lazy_load() - -- lua format - require("luasnip.loaders.from_lua").lazy_load() + -- vscode format + require("luasnip.loaders.from_vscode").lazy_load() + -- snipmate format + require("luasnip.loaders.from_snipmate").lazy_load() + -- lua format + require("luasnip.loaders.from_lua").lazy_load() end return M |