summaryrefslogtreecommitdiff
path: root/.config/nvim/lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-10-20 08:48:21 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-10-20 08:48:21 +0200
commit70301470abcc1a96a7c164dbf8901aa6f1e52c12 (patch)
treed1f4c4d3562dab74c1b2384399bb86598cfb8ced /.config/nvim/lua
parentf11eff223d021dd9553a7152278c00ca41b7ef37 (diff)
Update to colorscheme, ftplugin
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/bootstrap.lua1
-rw-r--r--.config/nvim/lua/core/dashboard.lua2
-rw-r--r--.config/nvim/lua/core/lualine/styles.lua2
-rw-r--r--.config/nvim/lua/core/which-key.lua2
-rw-r--r--.config/nvim/lua/dark/Treesitter.lua8
-rw-r--r--.config/nvim/lua/extra/json_schemas.lua102
-rw-r--r--.config/nvim/lua/lsp/config.lua2
-rw-r--r--.config/nvim/lua/lsp/init.lua29
-rw-r--r--.config/nvim/lua/lsp/null-ls/init.lua5
-rw-r--r--.config/nvim/lua/lsp/providers/sumneko_lua.lua4
10 files changed, 39 insertions, 118 deletions
diff --git a/.config/nvim/lua/bootstrap.lua b/.config/nvim/lua/bootstrap.lua
index 20cf26f..03256d7 100644
--- a/.config/nvim/lua/bootstrap.lua
+++ b/.config/nvim/lua/bootstrap.lua
@@ -6,7 +6,6 @@ local _, hooks = pcall(require, "utils.hooks")
---Join path segments that were passed as input
---@return string
function _G.join_paths(...)
- local uv = vim.loop
local path_sep = "/"
local result = table.concat({ ... }, path_sep)
return result
diff --git a/.config/nvim/lua/core/dashboard.lua b/.config/nvim/lua/core/dashboard.lua
index 8df581e..0f27ccf 100644
--- a/.config/nvim/lua/core/dashboard.lua
+++ b/.config/nvim/lua/core/dashboard.lua
@@ -68,7 +68,7 @@ M.setup = function()
vim.g.dashboard_session_directory = options.builtin.dashboard.session_directory
local num_plugins_loaded = #vim.fn.globpath(
- get_runtime_dir() .. "/site/pack/packer/start",
+ get_data_dir() .. "/site/pack/packer/start",
"*",
0,
1
diff --git a/.config/nvim/lua/core/lualine/styles.lua b/.config/nvim/lua/core/lualine/styles.lua
index eb71730..8caf349 100644
--- a/.config/nvim/lua/core/lualine/styles.lua
+++ b/.config/nvim/lua/core/lualine/styles.lua
@@ -9,7 +9,7 @@ local styles = {
}
styles.dark = {
- style = "lvim",
+ style = "dark",
options = {
icons_enabled = true,
component_separators = { left = "", right = "" },
diff --git a/.config/nvim/lua/core/which-key.lua b/.config/nvim/lua/core/which-key.lua
index ef95ce6..fe38358 100644
--- a/.config/nvim/lua/core/which-key.lua
+++ b/.config/nvim/lua/core/which-key.lua
@@ -225,8 +225,8 @@ M.config = function()
"<cmd>exe 'edit '.stdpath('cache').'/packer.nvim.log'<cr>",
"Open the Packer logfile",
},
- r = { "<cmd>lua require('utils').reload_config()<cr>", "Reload configurations" },
},
+ r = { "<cmd>lua require('utils').reload_config()<cr>", "Reload configurations" },
},
s = {
name = "Search",
diff --git a/.config/nvim/lua/dark/Treesitter.lua b/.config/nvim/lua/dark/Treesitter.lua
index e644b8b..3c2b294 100644
--- a/.config/nvim/lua/dark/Treesitter.lua
+++ b/.config/nvim/lua/dark/Treesitter.lua
@@ -1,6 +1,6 @@
local Treesitter = {
TSComment = { fg = C.gray },
- TSAnnotation = { fg = C.purple },
+ TSAnnotation = { fg = C.gray_blue },
TSAttribute = { fg = C.white },
TSConstructor = { fg = C.orange },
TSType = { fg = C.orange },
@@ -20,9 +20,9 @@ local Treesitter = {
TSBoolean = { fg = C.blue },
TSCharacter = { fg = C.light_green },
TSError = { fg = C.error_red },
- TSFunction = { fg = C.purple },
- TSFuncBuiltin = { fg = C.purple },
- TSMethod = { fg = C.purple },
+ TSFunction = { fg = C.gray_blue },
+ TSFuncBuiltin = { fg = C.gray_blue },
+ TSMethod = { fg = C.gray_blue },
TSConstMacro = { fg = C.orange },
TSFuncMacro = { fg = C.orange },
TSVariable = { fg = C.white },
diff --git a/.config/nvim/lua/extra/json_schemas.lua b/.config/nvim/lua/extra/json_schemas.lua
deleted file mode 100644
index d48d932..0000000
--- a/.config/nvim/lua/extra/json_schemas.lua
+++ /dev/null
@@ -1,102 +0,0 @@
--- -- https://www.schemastore.org/json/
--- local M = {}
-
--- M.setup = function()
--- local schemas = {
--- {
--- description = "Package JSON file",
--- fileMatch = { "package.json" },
--- url = "https://json.schemastore.org/package.json",
--- },
--- {
--- description = "TypeScript compiler configuration file",
--- fileMatch = { "tsconfig.json", "tsconfig.*.json" },
--- url = "http://json.schemastore.org/tsconfig",
--- },
--- {
--- description = "Lerna config",
--- fileMatch = { "lerna.json" },
--- url = "http://json.schemastore.org/lerna",
--- },
--- {
--- description = "Babel configuration",
--- fileMatch = { ".babelrc.json", ".babelrc", "babel.config.json" },
--- url = "http://json.schemastore.org/lerna",
--- },
--- {
--- description = "ESLint config",
--- fileMatch = { ".eslintrc.json", ".eslintrc" },
--- url = "http://json.schemastore.org/eslintrc",
--- },
--- {
--- description = "Bucklescript config",
--- fileMatch = { "bsconfig.json" },
--- url = "https://bucklescript.github.io/bucklescript/docson/build-schema.json",
--- },
--- {
--- description = "Prettier config",
--- fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" },
--- url = "http://json.schemastore.org/prettierrc",
--- },
--- {
--- description = "Vercel Now config",
--- fileMatch = { "now.json" },
--- url = "http://json.schemastore.org/now",
--- },
--- {
--- description = "Stylelint config",
--- fileMatch = { ".stylelintrc", ".stylelintrc.json", "stylelint.config.json" },
--- url = "http://json.schemastore.org/stylelintrc",
--- },
--- {
--- name = "Helm Chart.yaml",
--- description = "The Chart.lock file locks dependencies from Chart.yaml",
--- fileMatch = { "Chart.lock" },
--- url = "https://json.schemastore.org/chart-lock.json",
--- },
--- {
--- name = "CircleCI config.yml",
--- description = "Schema for CircleCI 2.0 config files",
--- fileMatch = { ".circleci/config.yml" },
--- url = "https://json.schemastore.org/circleciconfig.json",
--- },
--- {
--- name = "yamllint",
--- description = "yamllint uses a set of rules to check source files for problems",
--- fileMatch = { "**/.yamllint", "**/.yamllint.yaml", "**/.yamllint.yml" },
--- url = "https://json.schemastore.org/yamllint.json",
--- },
--- {
--- name = "Hadolint",
--- description = "A smarter Dockerfile linter that helps you build best practice Docker images.",
--- fileMatch = { ".hadolint.yaml", "hadolint.yaml", ".hadolint.yml", "hadolint.yml" },
--- url = "https://raw.githubusercontent.com/hadolint/hadolint/master/contrib/hadolint.json",
--- },
--- {
--- name = "kustomization.yaml",
--- description = "Kubernetes native configuration management",
--- fileMatch = { "kustomization.yaml", "kustomization.yml" },
--- url = "https://json.schemastore.org/kustomization.json",
--- },
--- }
-
--- local function extend(tab1, tab2)
--- for _, value in ipairs(tab2) do
--- table.insert(tab1, value)
--- end
--- return tab1
--- end
-
--- local extended_schemas = extend(
--- schemas,
--- require("nlspsettings.jsonls").get_default_schemas()
--- )
-
--- options.lang.json.lsp.setup.settings = {
--- json = {
--- schemas = extended_schemas,
--- },
--- }
--- end
-
--- return M
diff --git a/.config/nvim/lua/lsp/config.lua b/.config/nvim/lua/lsp/config.lua
index f13d965..9c25249 100644
--- a/.config/nvim/lua/lsp/config.lua
+++ b/.config/nvim/lua/lsp/config.lua
@@ -1,5 +1,5 @@
return {
- templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
+ templates_dir = join_paths(get_config_dir(), "ftplugin"),
diagnostics = {
signs = {
active = true,
diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua
index f421d99..42c2536 100644
--- a/.config/nvim/lua/lsp/init.lua
+++ b/.config/nvim/lua/lsp/init.lua
@@ -54,13 +54,22 @@ local function add_lsp_buffer_keybindings(bufnr)
return
end
for mode_name, mode_char in pairs(mappings) do
- wk.register(options.lsp.buffer_mappings[mode_name], { mode = mode_char, buffer = bufnr })
+ wk.register(
+ options.lsp.buffer_mappings[mode_name],
+ { mode = mode_char, buffer = bufnr }
+ )
end
else
-- Remap using nvim api
for mode_name, mode_char in pairs(mappings) do
for key, remap in pairs(options.lsp.buffer_mappings[mode_name]) do
- vim.api.nvim_buf_set_keymap(bufnr, mode_char, key, remap[1], { noremap = true, silent = true })
+ vim.api.nvim_buf_set_keymap(
+ bufnr,
+ mode_char,
+ key,
+ remap[1],
+ { noremap = true, silent = true }
+ )
end
end
end
@@ -94,8 +103,13 @@ local function select_default_formater(client)
Log:debug("Checking for formatter overriding for " .. client.name)
local client_filetypes = client.config.filetypes or {}
for _, filetype in ipairs(client_filetypes) do
- if options.lang[filetype] and #vim.tbl_keys(options.lang[filetype].formatters) > 0 then
- Log:debug("Formatter overriding detected. Disabling formatting capabilities for " .. client.name)
+ if
+ options.lang[filetype] and #vim.tbl_keys(options.lang[filetype].formatters) > 0
+ then
+ Log:debug(
+ "Formatter overriding detected. Disabling formatting capabilities for "
+ .. client.name
+ )
client.resolved_capabilities.document_formatting = false
client.resolved_capabilities.document_range_formatting = false
end
@@ -146,7 +160,10 @@ function M.setup()
end
for _, sign in ipairs(options.lsp.diagnostics.signs.values) do
- vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
+ vim.fn.sign_define(
+ sign.name,
+ { texthl = sign.name, text = sign.text, numhl = sign.name }
+ )
end
require("lsp.handlers").setup()
@@ -154,6 +171,8 @@ function M.setup()
require("lsp.templates").generate_templates()
end
+ Log:info(string.format("%s", options.lsp.templates_dir))
+
bootstrap_nlsp { config_home = utils.join_paths(get_config_dir(), "lsp-settings") }
require("lsp.null-ls").setup()
diff --git a/.config/nvim/lua/lsp/null-ls/init.lua b/.config/nvim/lua/lsp/null-ls/init.lua
index fde9fed..a18209b 100644
--- a/.config/nvim/lua/lsp/null-ls/init.lua
+++ b/.config/nvim/lua/lsp/null-ls/init.lua
@@ -12,6 +12,11 @@ function M:setup()
end
null_ls.config()
+ local default_opts = require("lsp").get_common_opts()
+
+ if vim.tbl_isempty(options.lsp.null_ls.setup or {}) then
+ options.lsp.null_ls.setup = default_opts
+ end
require("lspconfig")["null-ls"].setup(options.lsp.null_ls.setup)
for filetype, config in pairs(options.lang) do
if not vim.tbl_isempty(config.formatters) then
diff --git a/.config/nvim/lua/lsp/providers/sumneko_lua.lua b/.config/nvim/lua/lsp/providers/sumneko_lua.lua
index 4fee1fd..25693a9 100644
--- a/.config/nvim/lua/lsp/providers/sumneko_lua.lua
+++ b/.config/nvim/lua/lsp/providers/sumneko_lua.lua
@@ -2,11 +2,11 @@ local opts = {
settings = {
Lua = {
diagnostics = {
- globals = { "vim", "lvim" },
+ globals = { "vim", "nvim" },
},
workspace = {
library = {
- [require("utils").join_paths(get_runtime_dir(), "lvim", "lua")] = true,
+ [require("utils").join_paths(get_runtime_dir(), "lua")] = true,
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
},