Merge branch 'dev' into logos

This commit is contained in:
David JULIEN 2022-08-17 18:36:37 +02:00
commit 09faf18588
38 changed files with 1117 additions and 1047 deletions

View File

@ -38,13 +38,7 @@
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 0
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
# Turn on the progess bar
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
@ -237,16 +231,6 @@
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.

View File

@ -90,6 +90,7 @@ CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore david.julien@centrale-marseille.fr-local
Subfolders Verbatim
Path /home/swytch/.local/share/mail/david.julien@centrale-marseille.fr/
Inbox /home/swytch/.local/share/mail/david.julien@centrale-marseille.fr/INBOX
Channel david.julien@centrale-marseille.fr
Expunge Both

View File

@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/ens.signature"
unmacro index o
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@ens-lyon.fr"
mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=internship" "=fanfare"
mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=internship" "=MOVEP" "=QEST" "=fanfare"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
@ -46,3 +46,9 @@ macro index,pager Cf ";<copy-message>=fanfare<enter>" "copy mail to fanfare"
macro index,pager gI "<change-folder>=internship<enter>" "go to internship"
macro index,pager MI ";<save-message>=internship<enter>" "move mail to internship"
macro index,pager CI ";<copy-message>=internship<enter>" "copy mail to internship"
macro index,pager gm "<change-folder>=MOVEP<enter>" "go to MOVEP"
macro index,pager Mm ";<save-message>=MOVEP<enter>" "move mail to MOVEP"
macro index,pager Cm ";<copy-message>=MOVEP<enter>" "copy mail to MOVEP"
macro index,pager gq "<change-folder>=QEST<enter>" "go to QEST"
macro index,pager Mq ";<save-message>=QEST<enter>" "move mail to QEST"
macro index,pager Cq ";<copy-message>=QEST<enter>" "copy mail to QEST"

View File

@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/mailo.signature"
unmacro index o
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@mailo.com"
mailboxes "=sent" "=draftbox" "=trash" "=INBOX" "=farigoule" "=promo_fanfare"
mailboxes "=sent" "=draftbox" "=trash" "=INBOX" "=farigoule" "=promo_fanfare" "=mediapart" "=git" "=sosh"
set record = "+sent"
macro index,pager gs "<change-folder>=sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=sent<enter>" "move mail to sent"
@ -47,3 +47,12 @@ macro index,pager Cf ";<copy-message>=farigoule<enter>" "copy mail to farigoule"
macro index,pager gp "<change-folder>=promo_fanfare<enter>" "go to promo_fanfare"
macro index,pager Mp ";<save-message>=promo_fanfare<enter>" "move mail to promo_fanfare"
macro index,pager Cp ";<copy-message>=promo_fanfare<enter>" "copy mail to promo_fanfare"
macro index,pager gm "<change-folder>=mediapart<enter>" "go to mediapart"
macro index,pager Mm ";<save-message>=mediapart<enter>" "move mail to mediapart"
macro index,pager Cm ";<copy-message>=mediapart<enter>" "copy mail to mediapart"
macro index,pager gg "<change-folder>=git<enter>" "go to git"
macro index,pager Mg ";<save-message>=git<enter>" "move mail to git"
macro index,pager Cg ";<copy-message>=git<enter>" "copy mail to git"
macro index,pager gh "<change-folder>=sosh<enter>" "go to sosh"
macro index,pager Mh ";<save-message>=sosh<enter>" "move mail to sosh"
macro index,pager Ch ";<copy-message>=sosh<enter>" "copy mail to sosh"

View File

@ -1,6 +1,6 @@
# vim: filetype=neomuttrc
# muttrc file for account david.julien@centrale-marseille.fr
set realname = "David JULIEN"
set realname = "Smecta"
set from = "david.julien@centrale-marseille.fr"
set sendmail = "msmtp -a david.julien@centrale-marseille.fr"
alias me david.julien <david.julien@centrale-marseille.fr>
@ -9,7 +9,7 @@ set header_cache = /home/swytch/.cache/mutt/david.julien@centrale-marseille.fr/h
set message_cachedir = /home/swytch/.cache/mutt/david.julien@centrale-marseille.fr/bodies
set mbox_type = Maildir
set crypt_autosign = yes
set crypt_autosign = no
set pgp_sign_as = "0x9F46CD164AE1E813"
bind index,pager gg noop
@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/centrale.signature"
unmacro index o
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@centrale-marseille.fr"
mailboxes "=Sent" "=Drafts" "=Trash" "=Fanfare"
mailboxes "=Sent" "=Drafts" "=INBOX" "=Trash" "=Fanfare"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
@ -36,6 +36,10 @@ macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
set trash = "+Trash"
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"
set spoolfile = "+INBOX"
macro index,pager gf "<change-folder>=Fanfare<enter>" "go to fanfare"
macro index,pager Mf ";<save-message>=Fanfare<enter>" "move mail to fanfare"
macro index,pager Cf ";<copy-message>=Fanfare<enter>" "copy mail to fanfare"

View File

@ -234,7 +234,7 @@ mpd_music_dir = ~/music
song_list_format = "{$3[%l]$9} {$6%t$9}|{$6%30f$9} %n"
#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3%l$9}
#
song_status_format = $b {$3%a$9 - $7{%t}}|{%f} {(%b)}
song_status_format = $b {$7%a$9 - $6{%t}}|{%f} {(%b)}
#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
#
#song_library_format = {%n - }{%t}|{%f}
@ -313,7 +313,7 @@ song_status_format = $b {$3%a$9 - $7{%t}}|{%f} {(%b)}
## available.
##
#
song_columns_list_format = (6f)[green]{NE} (30)[white]{t|f:Title} (7f)[green]{l} (30)[]{a} (30)[]{b}
song_columns_list_format = (6f)[]{NE} (30)[magenta]{t|f:Title} (7f)[green]{l} (30)[blue]{a} (30)[blue]{b}
#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
#
##### various settings #####

View File

@ -20,8 +20,7 @@ local f = ls.function_node
local copy = utils.copy
ls.snippets = {
c = {
ls.add_snippets( "c", {
s("main", {
t({ "int main(int argc, char* argv[])" }),
t({ "", "{", "\t" }),
@ -47,5 +46,6 @@ ls.snippets = {
t({ "", "\treturn 0;"}),
t({ "", "}"}),
}),
},
}
}, {
key = "c"
})

View File

@ -7,3 +7,4 @@ local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"
opt.tabstop = 4

View File

@ -5,19 +5,18 @@
local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"
opt.tabstop = 4
-- Caps
utils.map("i", "AA", "À")
utils.map("i", "CC", "Ç")
utils.map("i", "EE", "É")
vim.keymap.set("i", "AA", "À")
vim.keymap.set("i", "CC", "Ç")
vim.keymap.set("i", "EE", "É")
-- Unbreakable spaces
utils.map("i", "<Space>etc", "\\,etc.")
utils.map("i", "<Space>:", "\\,:")
vim.keymap.set("i", "<Space>etc", "\\,etc.")
vim.keymap.set("i", "<Space>:", "\\,:")
-- Snippets
local ls = require("luasnip")
@ -45,8 +44,7 @@ local function rec_ls()
)
end
ls.snippets = {
tex = {
ls.add_snippets("tex", {
-- rec_ls is self-referencing. That makes this snippet 'infinite' eg. have as many
-- \item as necessary by utilizing a choiceNode.
s("ls", {
@ -54,7 +52,7 @@ ls.snippets = {
i(1),
t({ "" }),
d(2, rec_ls, {}),
t({ "", "\\end{itemize}", "" }),
t({ "", "\\end{itemize}" }),
}),
s("lsl", {
t({ "\\begin{itemize}[label=" }),
@ -63,7 +61,7 @@ ls.snippets = {
i(2),
t({ "" }),
d(3, rec_ls, {}),
t({ "", "\\end{itemize}", "" }),
t({ "", "\\end{itemize}" }),
}),
s("frm", {
t({ "\\begin{" }),
@ -78,7 +76,7 @@ ls.snippets = {
i(0),
t({ "", "\\end{" }),
f(copy, 1),
t({ "}", "" }),
t({ "}" }),
}),
s("env", {
t({ "\\begin{" }),
@ -87,7 +85,7 @@ ls.snippets = {
i(2),
t({ "", "\\end{" }),
f(copy,1),
t({ "}", "" }),
t({ "}"}),
}),
s("tikz", {
t({ "\\begin{center}" }),
@ -126,5 +124,6 @@ ls.snippets = {
i(1),
t({ "}"}),
}),
},
}
}, {
key = "tex"
})

View File

@ -6,11 +6,9 @@
local M = {} -- The module to export
M = {
lsp_path = vim.fn.stdpath("data").. "/lsp",
-- misc
sign_error = "",
sign_warning = "",
sign_warn = "",
sign_hint = "",
sign_info = "",
}

View File

@ -1,20 +0,0 @@
-- Author : swytch
-- Created : Tuesday May 18, 2021 12:08:51 CET
-- License : GPLv3
-- Description : clangd config file for lsp
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
require("lspconfig").clangd.setup {
cmd = { "clangd",
"--background-index",
"--suggest-missing-includes",
"--clang-tidy",
"--header-insertion=iwyu"
},
-- The following example advertise capabilities to `clangd`.
capabilities = capabilities,
}

View File

@ -1,80 +0,0 @@
-- Author : swytch
-- Created : Tuesday May 18, 2021 12:08:51 CET
-- License : GPLv3
-- Description : neovim lsp config file
local M = {}
vim.fn.sign_define(
"DiagnosticSignError",
{
texthl = "DiagnosticVirtualTextError",
text = globals.sign_error,
numhl = "DiagnosticSignError"
}
)
vim.fn.sign_define(
"DiagnosticSignWarn",
{
texthl = "DiagnosticVirtualTextWarn",
text = globals.sign_warning,
numhl = "DiagnosticSignWarn"
}
)
vim.fn.sign_define(
"DiagnosticSignHint",
{
texthl = "DiagnosticVirtualTextHint",
text = globals.sign_hint,
numhl = "DiagnosticSignHint"
}
)
vim.fn.sign_define(
"DiagnosticSignInfo",
{
texthl = "DiagnosticVirtualTextInfo",
text = globals.sign_info,
numhl = "DiagnosticSignInfo"
}
)
M.icons = {
Class = "",
Color = "",
Constant = " µ ",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "",
Keyword = "",
Interface = "",
Method = "",
Module = "",
Operator = "",
Property = "",
Reference = "",
Snippet = "",
Struct = "",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "",
}
function M.setup()
local kinds = vim.lsp.protocol.CompletionItemKind
for i, kind in ipairs(kinds) do
kinds[i] = M.icons[kind] or kind
end
local ft = vim.bo.filetype
if ft == "cpp" then ft = "c" end
require("lsp." .. ft) -- ./<ft>.lua
end
return M

View File

@ -1,42 +0,0 @@
-- Author : swytch
-- Created : Tuesday May 18, 2021 12:08:51 CET
-- License : GPLv3
-- Description : sumneko (lua) config file for lsp
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 = vim.fn.stdpath("data") ..
"/lsp_servers/sumneko_lua/extension/server"
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
"/lua-language-server"
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {"vim", "use", "globals", "utils"},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}

View File

@ -1,8 +0,0 @@
-- Author : swytch
-- Created : Tuesday May 18, 2021 15:03:43 CET
-- License : GPLv3
-- Description : jedi (python) config file for lsp
require("lspconfig").jedi_language_server.setup{
cmd = { vim.fn.stdpath("data") .. "/lsp_servers/jedi_language_server/venv/bin/jedi-language-server" }
}

View File

@ -1,13 +0,0 @@
-- Author : swytch
-- Created : Saturday May 23, 2021 10:34:53 CET
-- License : GPLv3
-- Description : LaTeX config file for lsp
require("lspconfig").texlab.setup {
cmd = { vim.fn.stdpath("data") .. "/lsp_servers/latex/texlab" },
settings = {
build = {
executable = "pdflatex"
}
}
}

View File

@ -3,30 +3,31 @@
-- License : GPLv3
-- Description : neovim mappings file
utils.map("n", "<space>", "<leader>")
utils.map("n", "<leader>y", "\"+y")
utils.map("n", "<leader>p", "\"+P")
utils.map("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
utils.map("n", "<leader>u", "<cmd>PackerSync<CR>")
utils.map("n", "<leader>c", "<cmd>ColorizerToggle<CR>")
vim.keymap.set({ "n", "v" }, "<space>", "<Nop>", { silent = true })
vim.g.mapleader = " "
-- LSP
utils.map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>")
utils.map("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>")
utils.map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>")
utils.map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>")
utils.map("n", "<leader>ln", "<cmd>lua vim.diagnostic.goto_next()<CR>")
utils.map("n", "<leader>lp", "<cmd>lua vim.diagnostic.goto_prev()<CR>")
utils.map("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>")
-- Dealing with word wrap
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
{ expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
{ expr = true, silent = true })
vim.keymap.set("n", "<leader>y", "\"+y")
vim.keymap.set("n", "<leader>p", "\"+P")
vim.keymap.set("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
vim.keymap.set("n", "<leader>u", function() require("packer").sync() end)
-- telescope
utils.map("n", "<leader>tf", "<cmd>Telescope find_files<CR>")
utils.map("n", "<leader>tb", "<cmd>Telescope file_browser<CR>")
utils.map("n", "<leader>tl", "<cmd>Telescope live_grep<CR>")
vim.keymap.set("n", "<leader>ff",
function() require("telescope.builtin").find_files() end)
vim.keymap.set("n", "<leader>fb",
function() require("telescope.builtin").buffers() end)
vim.keymap.set("n", "<leader>fl",
function() require("telescope.builtin").live_grep() end)
-- colorscheme
utils.map("n", "<C-s>", "<cmd>lua require(\"astronomy\").toggle_variant()<CR>")
vim.keymap.set("n", "<C-s>",
function() require("astronomy").toggle_variant() end)
-- snippets
utils.map("i", "<C-E>", "<Plug>luasnip-next-choice", {})
utils.map("s", "<C-E>", "<Plug>luasnip-next-choice", {})
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice")

View File

@ -7,7 +7,7 @@ local cmp = require("cmp")
local luasnip = require("luasnip")
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local check_backspace = function()
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:
@ -17,9 +17,38 @@ end
-- If you want insert `(` after select function or method item
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
-- Custom item icons
local icons = {
Class = "",
Color = "",
Constant = "µ",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "",
Keyword = "",
Interface = "",
Method = "",
Module = "",
Operator = "",
Property = "",
Reference = "",
Snippet = "",
Struct = "",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "",
}
cmp.setup {
completion = {
autocomplete = false
autocomplete = true
},
sources = {
{ name = "path" },
@ -33,6 +62,8 @@ cmp.setup {
},
formatting = {
format = function(entry, vim_item)
vim_item.kind = string.format("%s %s", icons[vim_item.kind],
vim_item.kind)
vim_item.menu = ({
nvim_lsp = "[lsp]",
nvim_lua = "[nvim]",
@ -60,24 +91,37 @@ cmp.setup {
select = true,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}
["<C-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<C-p>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
},
view = {
entries = {name = 'custom', selection_order = 'near_cursor' }
},
}

View File

@ -0,0 +1,23 @@
-- Author : swytch
-- Created : Monday May 2, 2022 21:00:24 CET
-- License : GPLv3
-- Description : neovim lsp config file for clangd
local M = {}
local lsp_root_path = vim.fn.stdpath("data") .. "/lsp_servers/"
local clangd_binary = lsp_root_path .. "clangd/clangd/bin/clangd"
M.setup = function(opts)
opts.settings = {
cmd = { clangd_binary,
"--background-index",
"--suggest-missing-includes",
"--clang-tidy",
"--header-insertion=iwyu"
},
}
end
return M

View File

@ -0,0 +1,82 @@
-- Author : swytch
-- Created : Monday May 2, 2022 21:02:02 CET
-- License : GPLv3
-- Description : neovim global lsp config file
local lspconfig = require("lspconfig")
local lsp_installer = require("nvim-lsp-installer")
local globals = require("globals")
local signs = {
Error = globals.sign_error,
Warn = globals.sign_warn,
Hint = globals.sign_hint,
Info = globals.sign_info,
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {
text = icon,
texthl = hl,
numhl = hl
})
end
vim.diagnostic.config({
update_in_insert = true
})
local on_attach = function(_, bufnr)
local opts = { buffer = bufnr }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<leader>ln", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<leader>lp", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "<leader>lf", vim.lsp.buf.formatting, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<leader>wa",
vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<leader>wr",
vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<leader>wl", function()
vim.inspect(vim.lsp.buf.list_workspace_folders())
end, opts)
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<leader>so",
require("telescope.builtin").lsp_document_symbols, opts)
end
-- nvim-cmp supports additional completion capabilities
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
local servers = { "clangd", "sumneko_lua", "texlab" }
lsp_installer.setup {
ensure_installed = servers,
ui = {
icons = {
server_installed = "",
server_pending = "o",
server_uninstalled = ""
}
}
}
for _, server in ipairs(servers) do
local opts = {
on_attach = on_attach,
capabilities = capabilities,
}
local plugin = string.format("%s.%s", "plugin.lsp", server)
require(plugin).setup(opts)
lspconfig[server].setup(opts)
end

View File

@ -0,0 +1,47 @@
-- Author : swytch
-- Created : Monday May 2, 2022 21:00:07 CET
-- License : GPLv3
-- Description : neovim lsp config file for sumneko_lua
local M = {}
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
M.setup = function(opts)
opts.settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're
-- using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {
"vim",
"globals",
"utils"
},
},
workspace = {
-- Make the server aware of Neovim runtime files
library =
vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but
-- unique identifier
telemetry = {
enable = false,
},
},
}
end
return M

View File

@ -0,0 +1,18 @@
-- Author : swytch
-- Created : Monday May 17, 2022 16:29:18 CET
-- License : GPLv3
-- Description : neovim lsp config file for texlab
local M = {}
M.setup = function(opts)
opts.settings = {
build = {
executable = "pdflatex"
}
}
end
return M

View File

@ -1,47 +0,0 @@
-- 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)

View File

@ -31,7 +31,26 @@ ls.config.set_config({
ext_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
virt_text = { { "", "LuaSnipChoice" } },
},
inactive = {
virt_text = { { "", "LuaSnipInactive" } },
},
},
[types.functionNode] = {
active = {
virt_text = { { "", "LuaSnipFunction" } },
},
inactive = {
virt_text = { { "", "LuaSnipInactive" } },
},
},
[types.insertNode] = {
active = {
virt_text = { { "", "LuaSnipInsert" } },
},
inactive = {
virt_text = { { "", "LuaSnipInactive" } },
},
},
},
@ -55,19 +74,19 @@ end
-- Returns a snippet_node wrapped around an insert_node whose initial
-- text value is set to the current date in the desired format.
local function date_input(fmt)
local fmt = fmt or "%Y-%m-%d"
return sn(nil, i(1, os.date(fmt)))
local format = fmt or "%Y-%m-%d"
return sn(nil, i(1, os.date(format)))
end
ls.snippets = {
-- When trying to expand a snippet, luasnip first searches the tables for
-- each filetype specified in 'filetype' followed by 'all'.
-- If ie. the filetype is 'lua.c'
-- - luasnip.lua
-- - luasnip.c
-- - luasnip.all
-- are searched in that order.
all = {
local copy = utils.copy
-- snippets are added via ls.add_snippets(filetype, snippets[, opts]), where
-- opts may specify the `type` of the snippets ("snippets" or "autosnippets",
-- for snippets that should expand directly after the trigger is typed).
--
-- opts can also specify a key. By passing an unique key to each add_snippets, it's possible to reload snippets by
-- re-`:luafile`ing the file in which they are defined (eg. this one).
ls.add_snippets( "all", {
-- trigger is fn.
s("fn", {
-- Simple static text.
@ -321,8 +340,9 @@ ls.snippets = {
"fmt6",
fmt("use {} only", { t("this"), t("not this") }, { strict = false })
),
},
}
}, {
key = "all",
})
-- autotriggered snippets have to be defined in a separate table, luasnip.autosnippets.
ls.autosnippets = {

View File

@ -1,19 +1,38 @@
-- Author : swytch
-- Created : Friday Mar 12, 2021 22:28:34 CET
-- License : GPLv3
-- Description : neovim plugins file
-- Description : neovim packer config file
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath("data").."/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path})
execute "packadd packer.nvim"
local packer = require("packer")
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
print("Cloning packer...")
PACKER_BOOTSTRAP = vim.fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
vim.cmd([[packadd packer.nvim]])
print("Done.")
end
packer.init({
display = {
working_sym = 'o', -- The symbol for a plugin being installed/updated
error_sym = '', -- The symbol for a plugin with an error in installation/updating
done_sym = '', -- The symbol for a plugin which has completed installation/updating
removed_sym = '-', -- The symbol for an unused plugin which was removed
moved_sym = '', -- The symbol for a plugin which was moved (e.g. from opt to start)
header_sym = '', -- The symbol for the header line in packer's display
},
})
local use = packer.use
return require("packer").startup(function()
-- packer manages itself
use "wbthomason/packer.nvim"
@ -34,34 +53,24 @@ return require("packer").startup(function()
-- fuzzy finder
use {
"nvim-telescope/telescope.nvim",
opt = true,
requires = {
{
"nvim-lua/popup.nvim",
opt = true
"nvim-lua/plenary.nvim",
},
{
"nvim-lua/plenary.nvim",
opt = true
"nvim-telescope/telescope-fzf-native.nvim",
run = "make"
}
},
cmd = "Telescope"
}
-- 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"},
config = function() require("lsp").setup() end
requires = {
"williamboman/nvim-lsp-installer",
},
config = function() require("plugin.lsp") end
}
-- auto completion
@ -70,7 +79,8 @@ return require("packer").startup(function()
requires = {
{
"L3MON4D3/LuaSnip",
config = function() require("plugin.luasnip") end
config = function()
require("plugin.luasnip") end
},
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp",
@ -93,19 +103,12 @@ return require("packer").startup(function()
-- autopairs
use {
"windwp/nvim-autopairs",
config = function() require('nvim-autopairs').setup() end
config = function() require("nvim-autopairs").setup() end
}
-- display colors directly in editor
use {
"norcalli/nvim-colorizer.lua",
cmd = "ColorizerToggle"
}
-- ens
use {
"whonore/Coqtail",
ft = { "verilog" },
config = vim.cmd[[let g:coqtail_nomap = 1]]
}
-- automatically setup the config after cloning
if PACKER_BOOTSTRAP then
require("packer").sync()
end
end)

View File

@ -99,18 +99,18 @@ local function get_mode_color(m)
end
-- from https://github.com/nvim-lua/lsp-status.nvim/blob/master/lua/lsp-status/diagnostics.lua
local function get_lsp_diagnostics(bufnr)
local function get_lsp_diagnostics()
local result = {}
local levels = {
errors = "Error",
warnings = "Warn",
error = "Error",
warn = "Warn",
info = "Info",
hints = "Hint"
hint = "Hint"
}
for k, level in pairs(levels) do
local count = 0
local diags = vim.diagnostic.get(bufnr, { severity = level })
local diags = vim.diagnostic.get(0, { severity = level })
for _, _ in pairs(diags) do
count = count + 1
end
@ -152,12 +152,12 @@ local function statusline_focused()
{
process_diagnostics(
globals.sign_error .. " ",
diagnostics.errors,
diagnostics.error,
"%#DiagnosticVirtualTextError#"
),
process_diagnostics(
globals.sign_warning .. " ",
diagnostics.warnings,
globals.sign_warn .. " ",
diagnostics.warn,
"%#DiagnosticVirtualTextWarn#"
),
process_diagnostics(

View File

@ -22,12 +22,6 @@ function M.add_rtp(path)
rtp = rtp .. "," .. path
end
-- map a key with optional options
function M.map(mode, keys, action, options)
options = options or {}
vim.api.nvim_set_keymap(mode, keys, action, options)
end
-- see if a file exists
function M.file_exists(file)
local f = io.open(file, "rb")

View File

@ -23,6 +23,9 @@ super + shift + s
super + shift + r
dmenuprompt "reboot?" "reboot"
super + BackSpace
slock
super + shift + d
displayselect
@ -32,7 +35,7 @@ super + shift + o
super + c
switch-colors
super + shift + c
super + alt + c
switch-colors -s
# Others
@ -48,6 +51,12 @@ super + d
super + shift + o
dmenuopen
super + p
screenshot
super + alt + p
screenshot -w
super + shift + {w,z}
$BROWSER

View File

@ -10,7 +10,7 @@
set-option -g status-style bg=color0 # bg=bg1, fg=fg1
set-option -g status-left "\
#[fg=color8, bg=color7]#{?client_prefix,#[bg=color9],} #S "
#[fg=color8, bg=color7]#{?client_prefix,#[bg=color9],} #S "
set-option -g status-right "\
#[fg=color7, bg=color8] %b. %d \

View File

@ -11,5 +11,5 @@
[ $1 = "" ] && 1="mv -i"
[ $1 = "sox" ] && flags="-C 320"
[ $1 = "sox" ] && flags="-C 6"
\ls | $EDITOR - -c ":%s/.*/$1 \"&\" $flags \"&\"/g"

View File

@ -31,15 +31,21 @@ shebangtest()
}
texcompile() { \
[ "$base" != "notes" ] && [ -e "main.tex" ] && base="main" && file="$base.tex"
cmd="pdflatex"
case "$(head -n 1 $file)" in
*lua*) cmd="lualatex" ;;
esac
bibliography="$(grep '\\bibliography' "$file")"
if [ -n "$bibliography" ]; then
pdflatex --output-directory="$dir" "$base" &&
$cmd --output-directory="$dir" "$base" &&
bibtex "$base" &&
pdflatex --output-directory="$dir" "$base" &&
pdflatex --output-directory="$dir" "$base"
$cmd --output-directory="$dir" "$base" &&
$cmd --output-directory="$dir" "$base"
else
pdflatex --output-directory="$dir" "$base" &&
pdflatex --output-directory="$dir" "$base"
$cmd --output-directory="$dir" "$base" &&
$cmd --output-directory="$dir" "$base"
fi
}

23
.local/bin/screenshot Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env sh
######################################################################
# @author : swytch
# @file : screenshot
# @license : GPLv3
# @created : Wednesday May 20, 2020 17:52:58 CEST
#
# @description : grab a screenshot
# @deps : scrot xclip dunstify
######################################################################
sleep .1
if [ "-w" = "$1" ]; then
scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f'
else
if [ ! "" = "$1" ]; then
dunstify -u "normal" " Wrong parameter. No screenshot taken" && exit 1
else
scrot -s -e 'xclip -selection clipboard -t image/png -i $f && rm $f'
fi
fi

View File

@ -41,6 +41,9 @@ do
if [ "Full" = "$status" ]; then
status=" " && capacity="FULL"
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
else
if [ 100 -lt $(expr $capacity) ]; then
status=""
else
if [ "$status" = "Charging" ]; then
status=""
@ -56,4 +59,5 @@ do
fi
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
fi
fi
done

View File

@ -14,7 +14,11 @@
eth="$(cat /sys/class/net/eno1/operstate)"
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')"
[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")"
case "$state" in
COMPLETED) str="$(printf " %s" $ssid)" ;;
INTERFACE_DISABLED) str="WIFI DOWN" ;;
*) str="$(printf "NO WIFI")";;
esac
if [ "up" = "$eth" ]; then
str="$(printf "%s /  " "$str")"
fi

@ -1 +1 @@
Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94
Subproject commit 41edd2a8502cc6d3be9ad18387e8b3c67d2dd4c3

@ -1 +1 @@
Subproject commit f8ad07e02878adfbdab1241869630d608566c5c0
Subproject commit 82003c8dad7b966ab65f339749fb4272eafb8f4b