stylua stuff

master
Drake 2 years ago
parent 9b2b0fb3b5
commit 545f37d6c8

@ -1,5 +1,5 @@
local map = vim.api.nvim_set_keymap
vim.g.mapleader = " "
vim.g.mapleader = ' '
map('n', '<leader>a', 'ggVG', { noremap = true, silent = true })
map('i', '<C-a>', '<Esc>ggVG', { 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'),
bg = get_hex('Background', 'bg'),
},--]]
fg = function (buffer)
fg = function(buffer)
if buffer.is_focused then
return get_hex('Normal', 'fg')
end
return get_hex('Comment', 'fg')
end,
bg = function(_) return get_hex('Background', 'bg') end
bg = function(_)
return get_hex('Background', 'bg')
end,
},
components = {

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

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

Loading…
Cancel
Save