Merge branch 'dev' into mercury

system:: fix external mode for displayselect
nvim: fix lsp installation dir variable
        fix lspconfig require formatting
        format nvim lsp server list
        add rust LSP + config files
git: fetch submodules on-demand
sxhkd: do not open a tmux session for neomutt
This commit is contained in:
David JULIEN 2022-12-11 21:54:28 +01:00
commit 1be08834b9
Signed by: swytch
GPG Key ID: 498590A3AA82A06F
8 changed files with 45 additions and 12 deletions

View File

@ -10,10 +10,9 @@
submodulesummary = 1
[fetch]
prune = true
recurseSubmodules = on-demand
[pull]
rebase = false
[submodule]
recurse = true
[push]
recurseSubmodules = check
[alias]

View File

@ -0,0 +1,13 @@
-- Author : swytch
-- Created : Thursday Dec. 01, 2022 11:41:26 CET
-- License : GPLv3
-- Description : rust settings file
local format_sync_grp = vim.api.nvim_create_augroup("Format", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.rs",
callback = function()
vim.lsp.buf.format({ timeout_ms = 200 })
end,
group = format_sync_grp,
})

View File

@ -6,8 +6,7 @@
local M = {}
local lsp_root_path = vim.fn.stdpath("data") .. "/lsp_servers/"
local clangd_binary = lsp_root_path .. "clangd/clangd/bin/clangd"
local clangd_binary = _G.lsp_root_dir .. "clangd/clangd/bin/clangd"
M.setup = function(opts)
opts.settings = {

View File

@ -58,7 +58,12 @@ end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
local servers = { "clangd", "sumneko_lua", "texlab" }
local servers = {
"clangd",
"rust_analyzer",
"sumneko_lua",
"texlab",
}
mason.setup({
ui = {
@ -70,6 +75,8 @@ mason.setup({
}
})
_G.lsp_root_dir = vim.fn.stdpath("data") .. "/mason/bin"
mason_lspconfig.setup({
ensure_installed = servers,
})
@ -81,7 +88,7 @@ for _, server in ipairs(servers) do
capabilities = capabilities,
}
local plugin = string.format("%s.%s", "plugin.lsp", server)
local plugin = string.format("plugin.lsp.%s", server)
require(plugin).setup(opts)
lspconfig[server].setup(opts)

View File

@ -0,0 +1,16 @@
-- Author : swytch
-- Created : Wednesday Nov. 30, 2022 16:35:43 CET
-- License : GPLv3
-- Description : neovim lsp config file for rust_analyzer
local M = {}
local rust_analayzer_binary = _G.lsp_root_dir .. "rust_analyzer/rust_analyzer"
M.setup = function(opts)
opts.settings = {}
end
return M

View File

@ -4,7 +4,7 @@
-- Description : treesitter config file
require("nvim-treesitter.configs").setup {
ensure_installed = { "c", "lua", "python", "bash" },
ensure_installed = { "c", "lua", "python", "rust", "bash" },
ignore_install = { "javascript" },
highlight = {
enable = true,

View File

@ -70,7 +70,7 @@ super + shift + m
$TERMINAL -g 128x32 -c "floating" -e $MUSIC_CLIENT
super + shift + n
$TERMINAL -g 128x32 -c "floating" -e tsession "mail" "$MAIL_CLIENT"
$TERMINAL -g 128x32 -c "floating" -e "$MAIL_CLIENT"
super + shift + i
$TERMINAL -g 128x32 -c "floating" -e tsession "irc" "$IRC_CLIENT"

View File

@ -44,10 +44,11 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
}
default() {
primary=$(echo "$allposs" | grep -w "connected primary" | awk '{ print $1 }')
[ -z "$primary" ] && primary=$(echo "$allposs" | grep -w "connected primary" | awk '{ print $1 }')
secondary=$(echo "$screens" | grep -v -w "$primary")
direction="left"
rotation="normal"
setup
}
@ -55,9 +56,7 @@ external() {
internal=$(echo "$screens" | dmenu -i -p "Select internal display:")
screens=$(echo "$screens" | grep -v -w "eDP-1")
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
xrandr --output $primary --primary
default
xrandr --output $primary --primary && default
}
setup() {