aboutsummaryrefslogtreecommitdiff
path: root/store/home/config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'store/home/config/nvim/lua')
-rw-r--r--store/home/config/nvim/lua/plugins.lua10
-rw-r--r--store/home/config/nvim/lua/setup/lsp.lua67
-rw-r--r--store/home/config/nvim/lua/setup/lsp/clangd.lua25
-rw-r--r--store/home/config/nvim/lua/setup/lsp/init.lua27
-rw-r--r--store/home/config/nvim/lua/setup/lsp/lua_ls.lua29
-rw-r--r--store/home/config/nvim/lua/setup/plugins/init.lua11
6 files changed, 80 insertions, 89 deletions
diff --git a/store/home/config/nvim/lua/plugins.lua b/store/home/config/nvim/lua/plugins.lua
index 841f659..480ea8f 100644
--- a/store/home/config/nvim/lua/plugins.lua
+++ b/store/home/config/nvim/lua/plugins.lua
@@ -11,11 +11,15 @@ return {
build = ":TSUpdate"
},
{
- "nvim-tree/nvim-tree.lua",
- lazy = false,
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
dependencies = {
- "nvim-tree/nvim-web-devicons",
+ "nvim-lua/plenary.nvim",
+ "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
+ "MunifTanjim/nui.nvim",
+ -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
+ lazy = false, -- neo-tree will lazily load itself
},
{
"nvim-lualine/lualine.nvim",
diff --git a/store/home/config/nvim/lua/setup/lsp.lua b/store/home/config/nvim/lua/setup/lsp.lua
new file mode 100644
index 0000000..15deacd
--- /dev/null
+++ b/store/home/config/nvim/lua/setup/lsp.lua
@@ -0,0 +1,67 @@
+-- spellchecker: words denols luals
+
+vim.lsp.config("*", {
+ capabilities = vim.tbl_extend("force",
+ vim.lsp.protocol.make_client_capabilities(),
+ require("cmp_nvim_lsp").default_capabilities()
+ )
+})
+
+local function setup_clangd()
+ local clangd = "clangd"
+ local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"
+
+ if vim.uv.fs_stat(brew_clangd_path) ~= nil then
+ clangd = brew_clangd_path
+ end
+
+ vim.lsp.config("clangd", {
+ cmd = { clangd }
+ })
+ local old_on_attach = vim.lsp.config.clangd.on_attach
+ vim.lsp.config.clangd.on_attach = function(client, bufnr)
+ if old_on_attach then old_on_attach(client, bufnr) end
+ vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
+ buffer = bufnr
+ })
+ end
+end
+
+local function setup_luals()
+ vim.lsp.config("lua_ls", {
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT"
+ },
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = {
+ [vim.fn.expand "$VIMRUNTIME/lua"] = true,
+ [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
+ [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
+ },
+ maxPreload = 100000,
+ preloadFileSize = 10000,
+ },
+ },
+ },
+ })
+end
+
+local function setup()
+ vim.lsp.enable('denols')
+ vim.lsp.enable('cmake')
+ vim.lsp.enable('bashls')
+ vim.lsp.enable('html')
+ vim.lsp.enable('cssls')
+ setup_clangd()
+ setup_luals()
+end
+
+
+return {
+ setup = setup
+}
diff --git a/store/home/config/nvim/lua/setup/lsp/clangd.lua b/store/home/config/nvim/lua/setup/lsp/clangd.lua
deleted file mode 100644
index 6080510..0000000
--- a/store/home/config/nvim/lua/setup/lsp/clangd.lua
+++ /dev/null
@@ -1,25 +0,0 @@
-local lspconfig = require("lspconfig")
-
-local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"
-
-local function setup()
- local clangd = "clangd"
-
- if vim.uv.fs_stat(brew_clangd_path) ~= nil then
- clangd = brew_clangd_path
- end
-
- -- setup lsp clangd
- lspconfig.clangd.setup {
- cmd = { clangd },
- on_attach = function(_, bufnr)
- vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
- buffer = bufnr
- })
- end
- }
-end
-
-return {
- setup = setup
-}
diff --git a/store/home/config/nvim/lua/setup/lsp/init.lua b/store/home/config/nvim/lua/setup/lsp/init.lua
deleted file mode 100644
index 313cf98..0000000
--- a/store/home/config/nvim/lua/setup/lsp/init.lua
+++ /dev/null
@@ -1,27 +0,0 @@
-local lspconfig = require("lspconfig")
-local cmp_nvim_lsp = require("cmp_nvim_lsp")
-local cmp_default_caps = cmp_nvim_lsp.default_capabilities()
-
-local lspconfig_default_caps = lspconfig.util.default_config.capabilities
-
-lspconfig.util.default_config = vim.tbl_extend(
- "force",
- lspconfig.util.default_config,
- {
- capabilities = vim.tbl_extend("force", lspconfig_default_caps, cmp_default_caps),
- autostart = false,
- })
-
-local function setup()
- lspconfig.cmake.setup {}
- lspconfig.bashls.setup {}
- lspconfig.html.setup {}
- lspconfig.cssls.setup {}
- require("setup.lsp.clangd").setup()
- require("setup.lsp.lua_ls").setup()
-end
-
-
-return {
- setup = setup
-}
diff --git a/store/home/config/nvim/lua/setup/lsp/lua_ls.lua b/store/home/config/nvim/lua/setup/lsp/lua_ls.lua
deleted file mode 100644
index 93aa503..0000000
--- a/store/home/config/nvim/lua/setup/lsp/lua_ls.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-local lspconfig = require("lspconfig")
-
-local function setup()
- lspconfig.lua_ls.setup {
- settings = {
- Lua = {
- runtime = {
- version = "LuaJIT"
- },
- diagnostics = {
- globals = { "vim" },
- },
- workspace = {
- library = {
- [vim.fn.expand "$VIMRUNTIME/lua"] = true,
- [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
- [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
- },
- maxPreload = 100000,
- preloadFileSize = 10000,
- },
- },
- },
- }
-end
-
-return {
- setup = setup
-}
diff --git a/store/home/config/nvim/lua/setup/plugins/init.lua b/store/home/config/nvim/lua/setup/plugins/init.lua
index 79ca3a8..5bcc219 100644
--- a/store/home/config/nvim/lua/setup/plugins/init.lua
+++ b/store/home/config/nvim/lua/setup/plugins/init.lua
@@ -1,12 +1,13 @@
local function setup()
- require("setup.plugins.lint").setup()
- require("setup.plugins.cmp").setup()
+ require("neo-tree").setup {}
+ require('lualine').setup {}
+
require("setup.plugins.telescope").setup()
require("setup.plugins.gitsigns").setup()
- require("setup.plugins.tree-sitter").setup()
- require('lualine').setup {}
- require("nvim-tree").setup {}
+ require("setup.plugins.tree-sitter").setup()
+ require("setup.plugins.lint").setup()
+ require("setup.plugins.cmp").setup()
require("nvim-autopairs").setup {}
end