Merge branch 'dev' into logos
nvim: show cursorline Commentplugin keymaps !!!BREAKING : remove sumneko_lua !!!BREAKING : now manage lsp servers through nvim plugin
This commit is contained in:
commit
567da89a39
@ -11,12 +11,3 @@ require("maps") -- ./lua/maps.lua
|
||||
require("statusline") -- ./lua/statusline.lua
|
||||
|
||||
require("polyjuice") -- ~/.local/src/polyjuice/lua/polyjuice.lua
|
||||
|
||||
-- auto complete
|
||||
require("plugin.cmp") -- ./lua/plugin/cmp.lua
|
||||
|
||||
-- treesitter
|
||||
require("plugin.treesitter") -- ./lua/plugin/treesitter.lua
|
||||
|
||||
-- commenting, done right
|
||||
require("plugin.comment") -- ./lua/plugin/comment.lua
|
||||
|
@ -6,8 +6,10 @@
|
||||
local system_name = "Linux"
|
||||
|
||||
-- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use
|
||||
local sumneko_root_path = globals.lsp_path .. "/sumneko_lua"
|
||||
local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server"
|
||||
local sumneko_root_path = vim.fn.stdpath("data") ..
|
||||
"/lsp_servers/sumneko_lua/extension/server"
|
||||
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
|
||||
"/lua-language-server"
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
|
||||
|
@ -4,6 +4,7 @@
|
||||
-- Description : LaTeX config file for lsp
|
||||
|
||||
require("lspconfig").texlab.setup {
|
||||
cmd = { vim.fn.stdpath("data") .. "/lsp_servers/latex/texlab" },
|
||||
settings = {
|
||||
build = {
|
||||
executable = "pdflatex"
|
||||
|
@ -20,27 +20,30 @@ require("Comment").setup {
|
||||
---operator-pending mapping
|
||||
---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}`
|
||||
basic = true,
|
||||
---extra mapping
|
||||
---Includes `gco`, `gcO`, `gcA`
|
||||
extra = true,
|
||||
---extended mapping
|
||||
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
|
||||
extra = false,
|
||||
extended = false,
|
||||
},
|
||||
|
||||
---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
|
||||
---@type table
|
||||
toggler = {
|
||||
---line-comment toggle
|
||||
line = 'gcc',
|
||||
line = "<leader><Space>",
|
||||
---block-comment toggle
|
||||
block = 'gbc',
|
||||
block = "<leader>bb",
|
||||
},
|
||||
|
||||
---LHS of line and block comment operator-mode mapping in NORMAL/VISUAL mode
|
||||
---@type table
|
||||
opleader = {
|
||||
---line-comment opfunc mapping
|
||||
line = 'gc',
|
||||
line = "<leader>c",
|
||||
---block-comment opfunc mapping
|
||||
block = 'gb',
|
||||
block = "<leader>b",
|
||||
},
|
||||
|
||||
---Pre-hook, called before commenting the line
|
||||
|
47
.config/nvim/lua/plugin/lsp_installer.lua
Normal file
47
.config/nvim/lua/plugin/lsp_installer.lua
Normal file
@ -0,0 +1,47 @@
|
||||
-- Author : swytch
|
||||
-- Created : Saturday Sept. 11, 2021 22:12:33 CET
|
||||
-- License : GPLv3
|
||||
-- Description : nvim-lsp-installer plugin config file
|
||||
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
|
||||
lsp_installer.settings {
|
||||
ui = {
|
||||
icons = {
|
||||
server_installed = "✓",
|
||||
server_pending = "➜",
|
||||
server_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local servers = {
|
||||
"bashls",
|
||||
"jedi_language_server",
|
||||
"texlab",
|
||||
"sumneko_lua",
|
||||
}
|
||||
|
||||
for _, name in pairs(servers) do
|
||||
local ok, server = lsp_installer.get_server(name)
|
||||
-- Check that the server is supported in nvim-lsp-installer
|
||||
if ok then
|
||||
if not server:is_installed() then
|
||||
print("Installing " .. name)
|
||||
server:install()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {}
|
||||
|
||||
-- (optional) Customize the options passed to the server
|
||||
-- if server.name == "tsserver" then
|
||||
-- opts.root_dir = function() ... end
|
||||
-- end
|
||||
|
||||
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
|
||||
server:setup(opts)
|
||||
vim.cmd [[ do User LspAttachBuffers ]]
|
||||
end)
|
@ -27,7 +27,8 @@ return require("packer").startup(function()
|
||||
-- tree-sitter
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate"
|
||||
run = ":TSUpdate",
|
||||
config = function() require("plugin.treesitter") end
|
||||
}
|
||||
|
||||
-- fuzzy finder
|
||||
@ -48,6 +49,15 @@ return require("packer").startup(function()
|
||||
}
|
||||
|
||||
-- LSP
|
||||
use {
|
||||
"williamboman/nvim-lsp-installer",
|
||||
cmd = {
|
||||
"LspInstall",
|
||||
"LspInstallInfo"
|
||||
},
|
||||
config = function() require("plugin.lsp_installer").setup() end
|
||||
}
|
||||
|
||||
use {
|
||||
"neovim/nvim-lspconfig",
|
||||
ft = { "c", "cpp", "lua", "python", "tex"},
|
||||
@ -66,11 +76,15 @@ return require("packer").startup(function()
|
||||
"hrsh7th/cmp-calc",
|
||||
"ray-x/cmp-treesitter",
|
||||
"f3fora/cmp-spell"
|
||||
}
|
||||
},
|
||||
config = function() require("plugin.cmp") end
|
||||
}
|
||||
|
||||
-- commenting, simplified
|
||||
use "numToStr/Comment.nvim"
|
||||
use {
|
||||
"numToStr/Comment.nvim",
|
||||
config = function() require("plugin.comment") end
|
||||
}
|
||||
|
||||
-- display colors directly in editor
|
||||
use {
|
||||
|
@ -25,6 +25,7 @@ opt.splitbelow = true
|
||||
opt.scrolloff = 4
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
opt.cursorline = true
|
||||
opt.shortmess = opt.shortmess:append { c = true }
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -16,6 +16,3 @@
|
||||
[submodule ".local/src/slock"]
|
||||
path = .local/src/slock
|
||||
url = git@github.com:swy7ch/slock.git
|
||||
[submodule ".local/share/nvim/lsp/sumneko_lua"]
|
||||
path = .local/share/nvim/lsp/sumneko_lua
|
||||
url = git@github.com:sumneko/lua-language-server.git
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit db515753ac0c9811199453d3e4ce72a1c72f5e2e
|
Reference in New Issue
Block a user