stylua stuff

master
Drake 2 years ago
parent 9b2b0fb3b5
commit 545f37d6c8

@ -1,5 +1,5 @@
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
vim.g.mapleader = " " vim.g.mapleader = ' '
map('n', '<leader>a', 'ggVG', { noremap = true, silent = true }) map('n', '<leader>a', 'ggVG', { noremap = true, silent = true })
map('i', '<C-a>', '<Esc>ggVG', { noremap = true, silent = true }) map('i', '<C-a>', '<Esc>ggVG', { noremap = true, silent = true })
map('v', '<leader>c', 'y', { noremap = true, silent = true }) map('v', '<leader>c', 'y', { noremap = true, silent = true })

@ -53,13 +53,15 @@ require('cokeline').setup({
fg = get_hex('Comment', 'fg'), fg = get_hex('Comment', 'fg'),
bg = get_hex('Background', 'bg'), bg = get_hex('Background', 'bg'),
},--]] },--]]
fg = function (buffer) fg = function(buffer)
if buffer.is_focused then if buffer.is_focused then
return get_hex('Normal', 'fg') return get_hex('Normal', 'fg')
end end
return get_hex('Comment', 'fg') return get_hex('Comment', 'fg')
end, end,
bg = function(_) return get_hex('Background', 'bg') end bg = function(_)
return get_hex('Background', 'bg')
end,
}, },
components = { components = {

@ -1,8 +1,8 @@
--INFO: Setup various LSP servers, and completion engines --INFO: Setup various LSP servers, and completion engines
--TODO: use nvim-lsp-installer? --TODO: use nvim-lsp-installer?
local cmp = require('cmp') local cmp = require('cmp')
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs') local configs = require('lspconfig.configs')
cmp.setup({ cmp.setup({
snippet = { snippet = {
@ -33,24 +33,24 @@ local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protoco
if not configs.astrols then if not configs.astrols then
configs.astrols = { configs.astrols = {
default_config = { default_config = {
cmd = {'astro-ls', '--stdio'}, cmd = { 'astro-ls', '--stdio' },
filetypes = {'astro'}, filetypes = { 'astro' },
root_dir = function(fname) root_dir = function(fname)
return lspconfig.util.find_node_modules_ancestor(fname) return lspconfig.util.find_node_modules_ancestor(fname)
end, end,
init_options = { init_options = {
astro = { astro = {
enabled = true, enabled = true,
diagnostics = {enabled = true}, diagnostics = { enabled = true },
rename = {enabled = true}, rename = { enabled = true },
format = {enabled = true}, format = { enabled = true },
completions = {enabled = true}, completions = { enabled = true },
hover = {enabled = true}, hover = { enabled = true },
codeActions = {enabled = true}, codeActions = { enabled = true },
selectionRange = {enabled = true}, selectionRange = { enabled = true },
} },
}, },
} },
} }
end end
@ -81,23 +81,23 @@ require('lspconfig').zls.setup({
}) })
local function arrayHasVal(tab, val) local function arrayHasVal(tab, val)
for index, value in ipairs(tab) do for index, value in ipairs(tab) do
if value == val then if value == val then
return true return true
end end
end end
return false return false
end end
local checkTsDiagnosticsCodes = function(_, _, params, client_id, _, config) local checkTsDiagnosticsCodes = function(_, _, params, client_id, _, config)
local codesToIgnore = {8010, 8011} local codesToIgnore = { 8010, 8011 }
if params.diagnostics ~= nil then if params.diagnostics ~= nil then
local idx = 1 local idx = 1
while idx <= #params.diagnostics do while idx <= #params.diagnostics do
if arrayHasVal(codesToIgnore, params.diagnostics[idx].code) then if arrayHasVal(codesToIgnore, params.diagnostics[idx].code) then
table.remove(params.diagnostics, idx) table.remove(params.diagnostics, idx)
else else
idx = idx+1 idx = idx + 1
end end
end end
vim.lsp.diagnostic.on_publish_diagnostics(_, _, params, client_id, _, config) vim.lsp.diagnostic.on_publish_diagnostics(_, _, params, client_id, _, config)
@ -108,7 +108,7 @@ end
--}) --})
require('lspconfig').flow.setup({ require('lspconfig').flow.setup({
cmd = {"flow", "lsp"}, cmd = { 'flow', 'lsp' },
capabilities = capabilities, capabilities = capabilities,
}) })

@ -2,7 +2,7 @@ require('filetype').setup({
overrides = { overrides = {
extensions = { extensions = {
v = 'vlang', v = 'vlang',
astro = 'astro' astro = 'astro',
}, },
}, },
}) })

Loading…
Cancel
Save