Compare commits
4 Commits
d3c45857eb
...
4f0ea77e68
Author | SHA1 | Date |
---|---|---|
|
4f0ea77e68 | |
|
947508b8b2 | |
|
465540484d | |
|
923ff0b785 |
|
@ -1,3 +1,11 @@
|
||||||
|
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local default_setup = function(server)
|
||||||
|
require("lspconfig")[server].setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- enable mason and configure icons
|
-- enable mason and configure icons
|
||||||
require("mason").setup({
|
require("mason").setup({
|
||||||
ui = {
|
ui = {
|
||||||
|
@ -9,43 +17,75 @@ require("mason").setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason-tool-installer").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {},
|
||||||
"prettier", -- prettier formatter
|
handlers = {
|
||||||
-- "stylua", -- lua formatter
|
default_setup,
|
||||||
"isort", -- python formatter
|
-- lua_ls = function()
|
||||||
"black", -- python formatter
|
-- require("lspconfig").eslint.setup({
|
||||||
"pylint", -- python linter
|
-- capabilities = lsp_capabilities,
|
||||||
"eslint_d", -- js linter
|
-- args = {
|
||||||
|
-- "--no-warn-ignored", -- <-- this is the key argument
|
||||||
|
-- "--format",
|
||||||
|
-- "json",
|
||||||
|
-- "--stdin",
|
||||||
|
-- "--stdin-filename",
|
||||||
|
-- function()
|
||||||
|
-- return vim.api.nvim_buf_get_name(0)
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
--#################################################################################
|
|
||||||
--##### THESE ARE THE LANGUAGE SERVERS WE WANT
|
|
||||||
--#################################################################################
|
|
||||||
local lsps_for_install = { "eslint", "html", "cssls", "bashls", "grammarly" }
|
|
||||||
--make this table 2d to add configs
|
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
|
||||||
mason_lspconfig.setup {
|
|
||||||
ensure_installed = lsps_for_install
|
|
||||||
}
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local cmp = require("cmp")
|
||||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
for _, lsp in pairs(lsps_for_install) do
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
sources = {
|
||||||
lspconfig.lua_ls.setup {
|
{ name = "nvim_lsp" },
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
-- Enter key confirms completion item
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
-- Ctrl + space triggers completion menu
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- local lsps_for_install = { --[[ "eslint", ]]
|
||||||
|
-- "html",
|
||||||
|
-- "cssls",
|
||||||
|
-- "bashls",
|
||||||
|
-- "grammarly",
|
||||||
|
-- }
|
||||||
|
-- --make this table 2d to add configs
|
||||||
|
-- local mason_lspconfig = require("mason-lspconfig")
|
||||||
|
-- mason_lspconfig.setup({
|
||||||
|
-- ensure_installed = lsps_for_install,
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
-- local lspconfig = require("lspconfig")
|
||||||
|
-- local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
-- for _, lsp in pairs(lsps_for_install) do
|
||||||
|
-- lspconfig[lsp].setup({
|
||||||
|
-- capabilities = lsp_capabilities,
|
||||||
|
-- })
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- lspconfig.lua_ls.setup({
|
||||||
|
-- capabilities = lsp_capabilities,
|
||||||
|
-- settings = {
|
||||||
|
-- Lua = {
|
||||||
|
-- diagnostics = {
|
||||||
|
-- globals = { "vim" },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
|
|
@ -5,17 +5,42 @@ return {
|
||||||
"BufReadPre",
|
"BufReadPre",
|
||||||
"BufNewFile",
|
"BufNewFile",
|
||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
|
require("mason-tool-installer").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"prettier", -- prettier formatter
|
||||||
|
-- "stylua", -- lua formatter
|
||||||
|
"isort", -- python formatter
|
||||||
|
"black", -- python formatter
|
||||||
|
"pylint", -- python linter
|
||||||
|
"biome", -- js linter
|
||||||
|
},
|
||||||
|
})
|
||||||
local lint = require("lint")
|
local lint = require("lint")
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
javascript = { "eslint_d" },
|
javascript = { "biomejs" },
|
||||||
typescript = { "eslint_d" },
|
typescript = { "biomejs" },
|
||||||
javascriptreact = { "eslint_d" },
|
javascriptreact = { "biomejs" },
|
||||||
typescriptreact = { "eslint_d" },
|
typescriptreact = { "biomejs" },
|
||||||
svelte = { "eslint_d" },
|
svelte = { "biomejs" },
|
||||||
python = { "pylint" },
|
python = { "pylint" },
|
||||||
markdown = { "proselint" },
|
markdown = { "proselint" },
|
||||||
}
|
}
|
||||||
|
--###### ESLINT HACK ######
|
||||||
|
local eslint = lint.linters.eslint_d
|
||||||
|
|
||||||
|
eslint.args = {
|
||||||
|
"--no-warn-ignored", -- <-- this is the key argument
|
||||||
|
"--format",
|
||||||
|
"json",
|
||||||
|
"--stdin",
|
||||||
|
"--stdin-filename",
|
||||||
|
function()
|
||||||
|
return vim.api.nvim_buf_get_name(0)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
--##### END ESLINT HACK ######
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
|
||||||
|
@ -38,7 +63,7 @@ return {
|
||||||
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
|
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("toggle_lsp_diagnostics").init({
|
require("toggle_lsp_diagnostics").init({
|
||||||
start_on = false,
|
start_on = true,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
return {"nvim-neo-tree/neo-tree.nvim",
|
return {
|
||||||
branch = "v3.x",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
dependencies = {
|
branch = "v3.x",
|
||||||
"nvim-lua/plenary.nvim",
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
"nvim-lua/plenary.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
"MunifTanjim/nui.nvim",
|
||||||
}
|
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
}
|
},
|
||||||
|
config = function()
|
||||||
|
require("neo-tree").setup({
|
||||||
|
filesystem = {
|
||||||
|
filtered_items = {
|
||||||
|
visible = true, -- This is what you want: If you set this to `true`, all "hide" just mean "dimmed out"
|
||||||
|
hide_dotfiles = false,
|
||||||
|
hide_gitignored = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
//"env": {
|
||||||
|
// "browser": true,
|
||||||
|
// "commonjs": true,
|
||||||
|
// "es6": true
|
||||||
|
//},
|
||||||
|
"extends": ["standard", "standard-react"]
|
||||||
|
}
|
|
@ -1,5 +1,3 @@
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||||
<title>HTML 5 Boilerplate</title>
|
<title>HTML 5 Boilerplate</title>
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
function(){
|
function name() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue