aboutsummaryrefslogtreecommitdiffstats
path: root/after/plugin
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-10-09 21:25:58 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-10-09 21:25:58 +0200
commit091a31fd99a7ab35d1d76a1534927cf9fb378a94 (patch)
tree78ec7de6e142d873c67da3a035ca26969b833120 /after/plugin
parent954f8f5fa5f26dc4039116e92761c40e90f49f3e (diff)
downloadnvim-conf-091a31fd99a7ab35d1d76a1534927cf9fb378a94.tar.gz
nvim-conf-091a31fd99a7ab35d1d76a1534927cf9fb378a94.zip
color changes
Diffstat (limited to 'after/plugin')
-rw-r--r--after/plugin/lsp.lua218
-rw-r--r--after/plugin/lualine.lua58
-rw-r--r--after/plugin/mason.lua2
-rw-r--r--after/plugin/nightfox.lua5
-rw-r--r--after/plugin/tokio.lua10
5 files changed, 153 insertions, 140 deletions
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
index f6bd37a..7de2e6e 100644
--- a/after/plugin/lsp.lua
+++ b/after/plugin/lsp.lua
@@ -1,48 +1,48 @@
local telescope_mapper = require("alpha.telescope.mappings")
local lsp_formatting = function(bufnr, allowed_clientes)
- vim.lsp.buf.format({
- filter = function(client)
- for _, value in pairs(allowed_clientes) do
- if client.name == value then
- return true
- end
- end
-
- return false
- end,
- bufnr = bufnr,
- })
+ vim.lsp.buf.format({
+ filter = function(client)
+ for _, value in pairs(allowed_clientes) do
+ if client.name == value then
+ return true
+ end
+ end
+
+ return false
+ end,
+ bufnr = bufnr,
+ })
end
-- if you want to set up formatting on save, you can use this as a callback
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local format_on_save = function(allowed_clients)
- return function(client, bufnr)
- if client.supports_method("textDocument/formatting") then
- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
- vim.api.nvim_create_autocmd("BufWritePre", {
- group = augroup,
- buffer = bufnr,
- callback = function()
- lsp_formatting(bufnr, allowed_clients)
- end,
- })
- end
- end
+ return function(client, bufnr)
+ if client.supports_method("textDocument/formatting") then
+ vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
+ vim.api.nvim_create_autocmd("BufWritePre", {
+ group = augroup,
+ buffer = bufnr,
+ callback = function()
+ lsp_formatting(bufnr, allowed_clients)
+ end,
+ })
+ end
+ end
end
local filetype_attach = setmetatable({
- go = format_on_save({ "gopls" }),
- -- php = format_on_save,
- -- lua = format_on_save,
+ go = format_on_save({ "gopls" }),
+ -- php = format_on_save,
+ -- lua = format_on_save,
- gdscript = function(_) end,
+ gdscript = function(_) end,
}, {
- __index = function()
- return function() end
- end,
+ __index = function()
+ return function() end
+ end,
})
-- Since I use null os this allows to have the format and actions
@@ -50,60 +50,60 @@ local filetype_attach = setmetatable({
vim.keymap.set({ "n", "v" }, "<leader>vca", vim.lsp.buf.code_action, {})
vim.keymap.set("n", "<leader>vf", function()
- return vim.lsp.buf.format({ async = true })
+ return vim.lsp.buf.format({ async = true })
end, {})
vim.keymap.set("n", "<leader>vn", vim.diagnostic.goto_next, {})
vim.keymap.set("n", "<leader>vp", vim.diagnostic.goto_prev, {})
local function on_attach(client, bufnr)
- local filetype = vim.api.nvim_buf_get_option(0, "filetype")
- -- keymaps for lsp
- vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0 })
- vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, { buffer = 0 })
- vim.keymap.set("i", "<c-h>", vim.lsp.buf.signature_help, { buffer = 0 })
- vim.keymap.set("n", "<leader>vo", ":LspRestart<cr>", { noremap = true })
-
- telescope_mapper("gr", "lsp_references", nil, true)
- telescope_mapper("<leader>pv", "find_symbol", nil, true)
- telescope_mapper("<leader>pd", "lsp_document_symbols", nil, true)
- telescope_mapper("<c-]>", "lsp_definitions", nil, true)
-
- vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc"
-
- -- Attach any filetype specific options to the client
- filetype_attach[filetype](client, bufnr)
+ local filetype = vim.api.nvim_buf_get_option(0, "filetype")
+ -- keymaps for lsp
+ vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0 })
+ vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, { buffer = 0 })
+ vim.keymap.set("i", "<c-h>", vim.lsp.buf.signature_help, { buffer = 0 })
+ vim.keymap.set("n", "<leader>vo", ":LspRestart<cr>", { noremap = true })
+
+ telescope_mapper("gr", "lsp_references", nil, true)
+ telescope_mapper("<leader>pv", "find_symbol", nil, true)
+ telescope_mapper("<leader>pd", "lsp_document_symbols", nil, true)
+ telescope_mapper("<c-]>", "lsp_definitions", nil, true)
+
+ vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc"
+
+ -- Attach any filetype specific options to the client
+ filetype_attach[filetype](client, bufnr)
end
vim.diagnostic.config({
- virtual_text = false,
+ virtual_text = false,
})
local signs = { Error = "⛔", Warn = "⚠️", Hint = "💡", Info = "ℹ️" }
for type, icon in pairs(signs) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
+ local hl = "DiagnosticSign" .. type
+ vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- Actual configs
local lsp_flags = {
- debounce_text_changes = 150,
+ debounce_text_changes = 150,
}
-- Server configurations
require("lspconfig")["rust_analyzer"].setup({
- on_attach = on_attach,
- flags = lsp_flags,
- -- Server-specific settings...
- settings = {
- ["rust-analyzer"] = {},
- },
+ on_attach = on_attach,
+ flags = lsp_flags,
+ -- Server-specific settings...
+ settings = {
+ ["rust-analyzer"] = {},
+ },
})
require("lspconfig").dockerls.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
-- require("lspconfig")["intelephense"].setup({
@@ -112,47 +112,47 @@ require("lspconfig").dockerls.setup({
-- })
require("lspconfig")["phpactor"].setup({
- on_attach = on_attach,
- flags = lsp_flags,
- filetypes = { "php", "cucumber" },
+ on_attach = on_attach,
+ flags = lsp_flags,
+ filetypes = { "php", "cucumber" },
})
require("lspconfig").jsonls.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
require("lspconfig").html.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
require("lspconfig").html.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require("lspconfig").emmet_ls.setup({
- on_attach = on_attach,
- flags = lsp_flags,
- capabilities = capabilities,
- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
+ on_attach = on_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
})
require("lspconfig").gopls.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
require("lspconfig").gdscript.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
require("lspconfig").tsserver.setup({
- on_attach = on_attach,
- flags = lsp_flags,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
require("lspconfig").volar.setup({
@@ -161,43 +161,43 @@ require("lspconfig").volar.setup({
})
require("lspconfig")["sumneko_lua"].setup({
- on_attach = on_attach,
- flags = lsp_flags,
- settings = {
- Lua = {
- runtime = {
- version = "LuaJIT",
- },
- diagnostics = {
- globals = { "vim" },
- },
- workspace = {
- library = vim.api.nvim_get_runtime_file("", true),
- },
- telemetry = {
- enable = false,
- },
- },
- },
+ on_attach = on_attach,
+ flags = lsp_flags,
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT",
+ },
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
})
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")
configs.blade = {
- default_config = {
- cmd = { "laravel-dev-tools", "lsp" },
- filetypes = { "blade" },
- root_dir = function(fname)
- return lspconfig.util.find_git_ancestor(fname)
- end,
- settings = {},
- },
+ default_config = {
+ cmd = { "laravel-dev-tools", "lsp" },
+ filetypes = { "blade" },
+ root_dir = function(fname)
+ return lspconfig.util.find_git_ancestor(fname)
+ end,
+ settings = {},
+ },
}
-- Set it up
lspconfig.blade.setup({
- -- Capabilities is specific to my setup.
- capabilities = capabilities,
- on_attach = on_attach,
- flags = lsp_flags,
+ -- Capabilities is specific to my setup.
+ capabilities = capabilities,
+ on_attach = on_attach,
+ flags = lsp_flags,
})
diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua
index 2b3b810..12f276c 100644
--- a/after/plugin/lualine.lua
+++ b/after/plugin/lualine.lua
@@ -1,29 +1,37 @@
local ok, lualine = pcall(require, "lualine")
if not ok then
- return
+ return
end
-lualine.setup{
- options = {
- theme = 'nightfox',
- icons_enabled = true,
- globalstatus = true,
- },
- extensions = {'quickfix', 'fugitive'},
- sections = {
- lualine_a = { { 'mode', upper = true } },
- lualine_b = { { 'branch', icon = '' }, { 'db_ui#statusline' }, 'diff' },
- lualine_c = { { 'filename', file_status = true, path = 1 } },
- lualine_x = { { 'diagnostics', sources = { 'nvim_diagnostic' } },'encoding', 'fileformat', 'filetype' },
- lualine_y = { 'progress' },
- lualine_z = { 'location' },
- },
- inactive_sections = {
- lualine_a = { },
- lualine_b = { },
- lualine_c = { 'filename' },
- lualine_x = { 'location' },
- lualine_y = { },
- lualine_z = { },
- },
-}
+lualine.setup({
+ options = {
+ theme = "tokyonight",
+ icons_enabled = true,
+ globalstatus = true,
+ },
+ extensions = { "quickfix", "fugitive" },
+ sections = {
+ lualine_a = { { "mode", upper = true } },
+ lualine_b = { { "branch", icon = "" }, { "db_ui#statusline" }, "diff" },
+ lualine_c = { { "filename", file_status = true, path = 1 } },
+ lualine_x = { "diagnostics" },
+ lualine_y = { "encoding", "fileformat" },
+ lualine_z = { "filetype" },
+ },
+ winbar = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = { "filename" },
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {},
+ },
+ inactive_winbar = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = { "filename" },
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {},
+ },
+})
diff --git a/after/plugin/mason.lua b/after/plugin/mason.lua
index fd8ac4e..0596306 100644
--- a/after/plugin/mason.lua
+++ b/after/plugin/mason.lua
@@ -40,7 +40,7 @@ require('mason-tool-installer').setup {
"stylua",
"typescript-language-server",
"vue-language-server",
- "phpactor",
+ -- "phpactor",
"sql-formatter",
},
diff --git a/after/plugin/nightfox.lua b/after/plugin/nightfox.lua
index afc979a..ce31634 100644
--- a/after/plugin/nightfox.lua
+++ b/after/plugin/nightfox.lua
@@ -3,11 +3,6 @@ if not ok then
return
end
--- vim.cmd("set background=dark")
--- vim.cmd("hi Normal guibg=NONE ctermbg=NONE")
--- vim.cmd("hi EndOfBuffer guibg=NONE ctermbg=NONE")
-
-
local palettes = {
all = {
}
diff --git a/after/plugin/tokio.lua b/after/plugin/tokio.lua
new file mode 100644
index 0000000..464a68e
--- /dev/null
+++ b/after/plugin/tokio.lua
@@ -0,0 +1,10 @@
+local ok, tokionight = pcall(require, "tokyonight")
+if not ok then
+ return
+end
+
+tokionight.setup({
+ style="night"
+})
+
+vim.cmd[[colorscheme tokyonight]]