Merge branch 'dev' into logos
This commit is contained in:
commit
09faf18588
@ -38,13 +38,7 @@
|
|||||||
# Scale factor. It is auto-detected if value is 0.
|
# Scale factor. It is auto-detected if value is 0.
|
||||||
scale = 0
|
scale = 0
|
||||||
|
|
||||||
# Maximum number of notification (0 means no limit)
|
# Turn on the progess bar
|
||||||
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
|
|
||||||
progress_bar = true
|
progress_bar = true
|
||||||
|
|
||||||
# Set the progress bar height. This includes the frame, so make sure
|
# Set the progress bar height. This includes the frame, so make sure
|
||||||
@ -237,16 +231,6 @@
|
|||||||
# user defined timeout.
|
# user defined timeout.
|
||||||
ignore_dbusclose = false
|
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
|
### Legacy
|
||||||
|
|
||||||
# Use the Xinerama extension instead of RandR for multi-monitor support.
|
# Use the Xinerama extension instead of RandR for multi-monitor support.
|
||||||
|
@ -90,6 +90,7 @@ CertificateFile /etc/ssl/certs/ca-certificates.crt
|
|||||||
MaildirStore david.julien@centrale-marseille.fr-local
|
MaildirStore david.julien@centrale-marseille.fr-local
|
||||||
Subfolders Verbatim
|
Subfolders Verbatim
|
||||||
Path /home/swytch/.local/share/mail/david.julien@centrale-marseille.fr/
|
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
|
Channel david.julien@centrale-marseille.fr
|
||||||
Expunge Both
|
Expunge Both
|
||||||
|
@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/ens.signature"
|
|||||||
unmacro index o
|
unmacro index o
|
||||||
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@ens-lyon.fr"
|
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"
|
set record = "+Sent"
|
||||||
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
|
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
|
||||||
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail 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 gI "<change-folder>=internship<enter>" "go to internship"
|
||||||
macro index,pager MI ";<save-message>=internship<enter>" "move mail 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 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"
|
||||||
|
@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/mailo.signature"
|
|||||||
unmacro index o
|
unmacro index o
|
||||||
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@mailo.com"
|
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"
|
set record = "+sent"
|
||||||
macro index,pager gs "<change-folder>=sent<enter>" "go to sent"
|
macro index,pager gs "<change-folder>=sent<enter>" "go to sent"
|
||||||
macro index,pager Ms ";<save-message>=sent<enter>" "move mail 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 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 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 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"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# vim: filetype=neomuttrc
|
# vim: filetype=neomuttrc
|
||||||
# muttrc file for account david.julien@centrale-marseille.fr
|
# muttrc file for account david.julien@centrale-marseille.fr
|
||||||
set realname = "David JULIEN"
|
set realname = "Smecta"
|
||||||
set from = "david.julien@centrale-marseille.fr"
|
set from = "david.julien@centrale-marseille.fr"
|
||||||
set sendmail = "msmtp -a david.julien@centrale-marseille.fr"
|
set sendmail = "msmtp -a david.julien@centrale-marseille.fr"
|
||||||
alias me david.julien <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 message_cachedir = /home/swytch/.cache/mutt/david.julien@centrale-marseille.fr/bodies
|
||||||
set mbox_type = Maildir
|
set mbox_type = Maildir
|
||||||
|
|
||||||
set crypt_autosign = yes
|
set crypt_autosign = no
|
||||||
set pgp_sign_as = "0x9F46CD164AE1E813"
|
set pgp_sign_as = "0x9F46CD164AE1E813"
|
||||||
|
|
||||||
bind index,pager gg noop
|
bind index,pager gg noop
|
||||||
@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/centrale.signature"
|
|||||||
unmacro index o
|
unmacro index o
|
||||||
macro index o "<shell-escape>mailsync<enter>" "run mbsync to sync david.julien@centrale-marseille.fr"
|
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"
|
set record = "+Sent"
|
||||||
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
|
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
|
||||||
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail 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 Mt ";<save-message>=Trash<enter>" "move mail to trash"
|
||||||
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
|
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
|
||||||
set trash = "+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 gf "<change-folder>=Fanfare<enter>" "go to fanfare"
|
||||||
macro index,pager Mf ";<save-message>=Fanfare<enter>" "move mail 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"
|
macro index,pager Cf ";<copy-message>=Fanfare<enter>" "copy mail to fanfare"
|
||||||
|
@ -234,7 +234,7 @@ mpd_music_dir = ~/music
|
|||||||
song_list_format = "{$3[%l]$9} {$6%t$9}|{$6%30f$9} %n"
|
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_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_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
|
||||||
#
|
#
|
||||||
#song_library_format = {%n - }{%t}|{%f}
|
#song_library_format = {%n - }{%t}|{%f}
|
||||||
@ -313,7 +313,7 @@ song_status_format = $b {$3%a$9 - $7{%t}}|{%f} {(%b)}
|
|||||||
## available.
|
## 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}
|
#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
|
||||||
#
|
#
|
||||||
##### various settings #####
|
##### various settings #####
|
||||||
|
@ -20,8 +20,7 @@ local f = ls.function_node
|
|||||||
|
|
||||||
local copy = utils.copy
|
local copy = utils.copy
|
||||||
|
|
||||||
ls.snippets = {
|
ls.add_snippets( "c", {
|
||||||
c = {
|
|
||||||
s("main", {
|
s("main", {
|
||||||
t({ "int main(int argc, char* argv[])" }),
|
t({ "int main(int argc, char* argv[])" }),
|
||||||
t({ "", "{", "\t" }),
|
t({ "", "{", "\t" }),
|
||||||
@ -47,5 +46,6 @@ ls.snippets = {
|
|||||||
t({ "", "\treturn 0;"}),
|
t({ "", "\treturn 0;"}),
|
||||||
t({ "", "}"}),
|
t({ "", "}"}),
|
||||||
}),
|
}),
|
||||||
},
|
}, {
|
||||||
}
|
key = "c"
|
||||||
|
})
|
||||||
|
@ -7,3 +7,4 @@ local opt = vim.opt
|
|||||||
local g = vim.g
|
local g = vim.g
|
||||||
|
|
||||||
opt.formatoptions = "trq1jp"
|
opt.formatoptions = "trq1jp"
|
||||||
|
opt.tabstop = 4
|
||||||
|
@ -5,19 +5,18 @@
|
|||||||
|
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
local g = vim.g
|
|
||||||
|
|
||||||
opt.formatoptions = "trq1jp"
|
opt.formatoptions = "trq1jp"
|
||||||
opt.tabstop = 4
|
opt.tabstop = 4
|
||||||
|
|
||||||
-- Caps
|
-- Caps
|
||||||
utils.map("i", "AA", "À")
|
vim.keymap.set("i", "AA", "À")
|
||||||
utils.map("i", "CC", "Ç")
|
vim.keymap.set("i", "CC", "Ç")
|
||||||
utils.map("i", "EE", "É")
|
vim.keymap.set("i", "EE", "É")
|
||||||
|
|
||||||
-- Unbreakable spaces
|
-- Unbreakable spaces
|
||||||
utils.map("i", "<Space>etc", "\\,etc.")
|
vim.keymap.set("i", "<Space>etc", "\\,etc.")
|
||||||
utils.map("i", "<Space>:", "\\,:")
|
vim.keymap.set("i", "<Space>:", "\\,:")
|
||||||
|
|
||||||
-- Snippets
|
-- Snippets
|
||||||
local ls = require("luasnip")
|
local ls = require("luasnip")
|
||||||
@ -45,8 +44,7 @@ local function rec_ls()
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
ls.snippets = {
|
ls.add_snippets("tex", {
|
||||||
tex = {
|
|
||||||
-- rec_ls is self-referencing. That makes this snippet 'infinite' eg. have as many
|
-- rec_ls is self-referencing. That makes this snippet 'infinite' eg. have as many
|
||||||
-- \item as necessary by utilizing a choiceNode.
|
-- \item as necessary by utilizing a choiceNode.
|
||||||
s("ls", {
|
s("ls", {
|
||||||
@ -54,7 +52,7 @@ ls.snippets = {
|
|||||||
i(1),
|
i(1),
|
||||||
t({ "" }),
|
t({ "" }),
|
||||||
d(2, rec_ls, {}),
|
d(2, rec_ls, {}),
|
||||||
t({ "", "\\end{itemize}", "" }),
|
t({ "", "\\end{itemize}" }),
|
||||||
}),
|
}),
|
||||||
s("lsl", {
|
s("lsl", {
|
||||||
t({ "\\begin{itemize}[label=" }),
|
t({ "\\begin{itemize}[label=" }),
|
||||||
@ -63,7 +61,7 @@ ls.snippets = {
|
|||||||
i(2),
|
i(2),
|
||||||
t({ "" }),
|
t({ "" }),
|
||||||
d(3, rec_ls, {}),
|
d(3, rec_ls, {}),
|
||||||
t({ "", "\\end{itemize}", "" }),
|
t({ "", "\\end{itemize}" }),
|
||||||
}),
|
}),
|
||||||
s("frm", {
|
s("frm", {
|
||||||
t({ "\\begin{" }),
|
t({ "\\begin{" }),
|
||||||
@ -78,7 +76,7 @@ ls.snippets = {
|
|||||||
i(0),
|
i(0),
|
||||||
t({ "", "\\end{" }),
|
t({ "", "\\end{" }),
|
||||||
f(copy, 1),
|
f(copy, 1),
|
||||||
t({ "}", "" }),
|
t({ "}" }),
|
||||||
}),
|
}),
|
||||||
s("env", {
|
s("env", {
|
||||||
t({ "\\begin{" }),
|
t({ "\\begin{" }),
|
||||||
@ -87,7 +85,7 @@ ls.snippets = {
|
|||||||
i(2),
|
i(2),
|
||||||
t({ "", "\\end{" }),
|
t({ "", "\\end{" }),
|
||||||
f(copy,1),
|
f(copy,1),
|
||||||
t({ "}", "" }),
|
t({ "}"}),
|
||||||
}),
|
}),
|
||||||
s("tikz", {
|
s("tikz", {
|
||||||
t({ "\\begin{center}" }),
|
t({ "\\begin{center}" }),
|
||||||
@ -126,5 +124,6 @@ ls.snippets = {
|
|||||||
i(1),
|
i(1),
|
||||||
t({ "}"}),
|
t({ "}"}),
|
||||||
}),
|
}),
|
||||||
},
|
}, {
|
||||||
}
|
key = "tex"
|
||||||
|
})
|
||||||
|
@ -6,11 +6,9 @@
|
|||||||
local M = {} -- The module to export
|
local M = {} -- The module to export
|
||||||
|
|
||||||
M = {
|
M = {
|
||||||
lsp_path = vim.fn.stdpath("data").. "/lsp",
|
|
||||||
|
|
||||||
-- misc
|
-- misc
|
||||||
sign_error = "",
|
sign_error = "",
|
||||||
sign_warning = "",
|
sign_warn = "",
|
||||||
sign_hint = "",
|
sign_hint = "",
|
||||||
sign_info = "",
|
sign_info = "",
|
||||||
}
|
}
|
||||||
|
@ -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,
|
|
||||||
}
|
|
@ -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
|
|
@ -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,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -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" }
|
|
||||||
}
|
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,30 +3,31 @@
|
|||||||
-- License : GPLv3
|
-- License : GPLv3
|
||||||
-- Description : neovim mappings file
|
-- Description : neovim mappings file
|
||||||
|
|
||||||
utils.map("n", "<space>", "<leader>")
|
vim.keymap.set({ "n", "v" }, "<space>", "<Nop>", { silent = true })
|
||||||
utils.map("n", "<leader>y", "\"+y")
|
vim.g.mapleader = " "
|
||||||
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>")
|
|
||||||
|
|
||||||
-- LSP
|
-- Dealing with word wrap
|
||||||
utils.map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>")
|
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
|
||||||
utils.map("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>")
|
{ expr = true, silent = true })
|
||||||
utils.map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>")
|
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
|
||||||
utils.map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>")
|
{ expr = true, silent = true })
|
||||||
utils.map("n", "<leader>ln", "<cmd>lua vim.diagnostic.goto_next()<CR>")
|
|
||||||
utils.map("n", "<leader>lp", "<cmd>lua vim.diagnostic.goto_prev()<CR>")
|
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||||
utils.map("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>")
|
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
|
-- telescope
|
||||||
utils.map("n", "<leader>tf", "<cmd>Telescope find_files<CR>")
|
vim.keymap.set("n", "<leader>ff",
|
||||||
utils.map("n", "<leader>tb", "<cmd>Telescope file_browser<CR>")
|
function() require("telescope.builtin").find_files() end)
|
||||||
utils.map("n", "<leader>tl", "<cmd>Telescope live_grep<CR>")
|
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
|
-- 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
|
-- snippets
|
||||||
utils.map("i", "<C-E>", "<Plug>luasnip-next-choice", {})
|
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice")
|
||||||
utils.map("s", "<C-E>", "<Plug>luasnip-next-choice", {})
|
|
||||||
|
@ -7,7 +7,7 @@ local cmp = require("cmp")
|
|||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
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))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and
|
return col ~= 0 and
|
||||||
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:
|
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
|
-- If you want insert `(` after select function or method item
|
||||||
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
|
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 {
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
autocomplete = false
|
autocomplete = true
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
@ -33,6 +62,8 @@ cmp.setup {
|
|||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
|
vim_item.kind = string.format("%s %s", icons[vim_item.kind],
|
||||||
|
vim_item.kind)
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
nvim_lsp = "[lsp]",
|
nvim_lsp = "[lsp]",
|
||||||
nvim_lua = "[nvim]",
|
nvim_lua = "[nvim]",
|
||||||
@ -60,24 +91,37 @@ cmp.setup {
|
|||||||
select = true,
|
select = true,
|
||||||
}),
|
}),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if luasnip.expand_or_locally_jumpable() then
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif check_backspace() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if luasnip.jumpable(-1) then
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
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' }
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
23
.config/nvim/lua/plugin/lsp/clangd.lua
Normal file
23
.config/nvim/lua/plugin/lsp/clangd.lua
Normal 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
|
82
.config/nvim/lua/plugin/lsp/init.lua
Normal file
82
.config/nvim/lua/plugin/lsp/init.lua
Normal 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
|
47
.config/nvim/lua/plugin/lsp/sumneko_lua.lua
Normal file
47
.config/nvim/lua/plugin/lsp/sumneko_lua.lua
Normal 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
|
18
.config/nvim/lua/plugin/lsp/texlab.lua
Normal file
18
.config/nvim/lua/plugin/lsp/texlab.lua
Normal 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
|
||||||
|
|
@ -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)
|
|
@ -31,7 +31,26 @@ ls.config.set_config({
|
|||||||
ext_opts = {
|
ext_opts = {
|
||||||
[types.choiceNode] = {
|
[types.choiceNode] = {
|
||||||
active = {
|
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
|
-- Returns a snippet_node wrapped around an insert_node whose initial
|
||||||
-- text value is set to the current date in the desired format.
|
-- text value is set to the current date in the desired format.
|
||||||
local function date_input(fmt)
|
local function date_input(fmt)
|
||||||
local fmt = fmt or "%Y-%m-%d"
|
local format = fmt or "%Y-%m-%d"
|
||||||
return sn(nil, i(1, os.date(fmt)))
|
return sn(nil, i(1, os.date(format)))
|
||||||
end
|
end
|
||||||
|
|
||||||
ls.snippets = {
|
local copy = utils.copy
|
||||||
-- When trying to expand a snippet, luasnip first searches the tables for
|
|
||||||
-- each filetype specified in 'filetype' followed by 'all'.
|
-- snippets are added via ls.add_snippets(filetype, snippets[, opts]), where
|
||||||
-- If ie. the filetype is 'lua.c'
|
-- opts may specify the `type` of the snippets ("snippets" or "autosnippets",
|
||||||
-- - luasnip.lua
|
-- for snippets that should expand directly after the trigger is typed).
|
||||||
-- - luasnip.c
|
--
|
||||||
-- - luasnip.all
|
-- opts can also specify a key. By passing an unique key to each add_snippets, it's possible to reload snippets by
|
||||||
-- are searched in that order.
|
-- re-`:luafile`ing the file in which they are defined (eg. this one).
|
||||||
all = {
|
ls.add_snippets( "all", {
|
||||||
-- trigger is fn.
|
-- trigger is fn.
|
||||||
s("fn", {
|
s("fn", {
|
||||||
-- Simple static text.
|
-- Simple static text.
|
||||||
@ -321,8 +340,9 @@ ls.snippets = {
|
|||||||
"fmt6",
|
"fmt6",
|
||||||
fmt("use {} only", { t("this"), t("not this") }, { strict = false })
|
fmt("use {} only", { t("this"), t("not this") }, { strict = false })
|
||||||
),
|
),
|
||||||
},
|
}, {
|
||||||
}
|
key = "all",
|
||||||
|
})
|
||||||
|
|
||||||
-- autotriggered snippets have to be defined in a separate table, luasnip.autosnippets.
|
-- autotriggered snippets have to be defined in a separate table, luasnip.autosnippets.
|
||||||
ls.autosnippets = {
|
ls.autosnippets = {
|
||||||
|
@ -1,19 +1,38 @@
|
|||||||
-- Author : swytch
|
-- Author : swytch
|
||||||
-- Created : Friday Mar 12, 2021 22:28:34 CET
|
-- Created : Friday Mar 12, 2021 22:28:34 CET
|
||||||
-- License : GPLv3
|
-- License : GPLv3
|
||||||
-- Description : neovim plugins file
|
-- Description : neovim packer config file
|
||||||
|
|
||||||
|
|
||||||
local execute = vim.api.nvim_command
|
local packer = require("packer")
|
||||||
local fn = vim.fn
|
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
local install_path = fn.stdpath("data").."/site/pack/packer/start/packer.nvim"
|
print("Cloning packer...")
|
||||||
|
PACKER_BOOTSTRAP = vim.fn.system({
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
"git",
|
||||||
fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path})
|
"clone",
|
||||||
execute "packadd packer.nvim"
|
"--depth",
|
||||||
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
install_path,
|
||||||
|
})
|
||||||
|
vim.cmd([[packadd packer.nvim]])
|
||||||
|
print("Done.")
|
||||||
end
|
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()
|
return require("packer").startup(function()
|
||||||
-- packer manages itself
|
-- packer manages itself
|
||||||
use "wbthomason/packer.nvim"
|
use "wbthomason/packer.nvim"
|
||||||
@ -34,34 +53,24 @@ return require("packer").startup(function()
|
|||||||
-- fuzzy finder
|
-- fuzzy finder
|
||||||
use {
|
use {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
opt = true,
|
|
||||||
requires = {
|
requires = {
|
||||||
{
|
{
|
||||||
"nvim-lua/popup.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
opt = true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
opt = true
|
run = "make"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cmd = "Telescope"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
use {
|
|
||||||
"williamboman/nvim-lsp-installer",
|
|
||||||
cmd = {
|
|
||||||
"LspInstall",
|
|
||||||
"LspInstallInfo"
|
|
||||||
},
|
|
||||||
config = function() require("plugin.lsp_installer").setup() end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
ft = { "c", "cpp", "lua", "python", "tex"},
|
requires = {
|
||||||
config = function() require("lsp").setup() end
|
"williamboman/nvim-lsp-installer",
|
||||||
|
},
|
||||||
|
config = function() require("plugin.lsp") end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- auto completion
|
-- auto completion
|
||||||
@ -70,7 +79,8 @@ return require("packer").startup(function()
|
|||||||
requires = {
|
requires = {
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
config = function() require("plugin.luasnip") end
|
config = function()
|
||||||
|
require("plugin.luasnip") end
|
||||||
},
|
},
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
@ -93,19 +103,12 @@ return require("packer").startup(function()
|
|||||||
-- autopairs
|
-- autopairs
|
||||||
use {
|
use {
|
||||||
"windwp/nvim-autopairs",
|
"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
|
-- automatically setup the config after cloning
|
||||||
use {
|
if PACKER_BOOTSTRAP then
|
||||||
"whonore/Coqtail",
|
require("packer").sync()
|
||||||
ft = { "verilog" },
|
end
|
||||||
config = vim.cmd[[let g:coqtail_nomap = 1]]
|
|
||||||
}
|
|
||||||
end)
|
end)
|
||||||
|
@ -99,18 +99,18 @@ local function get_mode_color(m)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- from https://github.com/nvim-lua/lsp-status.nvim/blob/master/lua/lsp-status/diagnostics.lua
|
-- 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 result = {}
|
||||||
local levels = {
|
local levels = {
|
||||||
errors = "Error",
|
error = "Error",
|
||||||
warnings = "Warn",
|
warn = "Warn",
|
||||||
info = "Info",
|
info = "Info",
|
||||||
hints = "Hint"
|
hint = "Hint"
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, level in pairs(levels) do
|
for k, level in pairs(levels) do
|
||||||
local count = 0
|
local count = 0
|
||||||
local diags = vim.diagnostic.get(bufnr, { severity = level })
|
local diags = vim.diagnostic.get(0, { severity = level })
|
||||||
for _, _ in pairs(diags) do
|
for _, _ in pairs(diags) do
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
@ -152,12 +152,12 @@ local function statusline_focused()
|
|||||||
{
|
{
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
globals.sign_error .. " ",
|
globals.sign_error .. " ",
|
||||||
diagnostics.errors,
|
diagnostics.error,
|
||||||
"%#DiagnosticVirtualTextError#"
|
"%#DiagnosticVirtualTextError#"
|
||||||
),
|
),
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
globals.sign_warning .. " ",
|
globals.sign_warn .. " ",
|
||||||
diagnostics.warnings,
|
diagnostics.warn,
|
||||||
"%#DiagnosticVirtualTextWarn#"
|
"%#DiagnosticVirtualTextWarn#"
|
||||||
),
|
),
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
|
@ -22,12 +22,6 @@ function M.add_rtp(path)
|
|||||||
rtp = rtp .. "," .. path
|
rtp = rtp .. "," .. path
|
||||||
end
|
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
|
-- see if a file exists
|
||||||
function M.file_exists(file)
|
function M.file_exists(file)
|
||||||
local f = io.open(file, "rb")
|
local f = io.open(file, "rb")
|
||||||
|
@ -23,6 +23,9 @@ super + shift + s
|
|||||||
super + shift + r
|
super + shift + r
|
||||||
dmenuprompt "reboot?" "reboot"
|
dmenuprompt "reboot?" "reboot"
|
||||||
|
|
||||||
|
super + BackSpace
|
||||||
|
slock
|
||||||
|
|
||||||
super + shift + d
|
super + shift + d
|
||||||
displayselect
|
displayselect
|
||||||
|
|
||||||
@ -32,7 +35,7 @@ super + shift + o
|
|||||||
super + c
|
super + c
|
||||||
switch-colors
|
switch-colors
|
||||||
|
|
||||||
super + shift + c
|
super + alt + c
|
||||||
switch-colors -s
|
switch-colors -s
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
@ -48,6 +51,12 @@ super + d
|
|||||||
super + shift + o
|
super + shift + o
|
||||||
dmenuopen
|
dmenuopen
|
||||||
|
|
||||||
|
super + p
|
||||||
|
screenshot
|
||||||
|
|
||||||
|
super + alt + p
|
||||||
|
screenshot -w
|
||||||
|
|
||||||
super + shift + {w,z}
|
super + shift + {w,z}
|
||||||
$BROWSER
|
$BROWSER
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
set-option -g status-style bg=color0 # bg=bg1, fg=fg1
|
set-option -g status-style bg=color0 # bg=bg1, fg=fg1
|
||||||
|
|
||||||
set-option -g status-left "\
|
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 "\
|
set-option -g status-right "\
|
||||||
#[fg=color7, bg=color8] %b. %d \
|
#[fg=color7, bg=color8] %b. %d \
|
||||||
|
@ -11,5 +11,5 @@
|
|||||||
|
|
||||||
|
|
||||||
[ $1 = "" ] && 1="mv -i"
|
[ $1 = "" ] && 1="mv -i"
|
||||||
[ $1 = "sox" ] && flags="-C 320"
|
[ $1 = "sox" ] && flags="-C 6"
|
||||||
\ls | $EDITOR - -c ":%s/.*/$1 \"&\" $flags \"&\"/g"
|
\ls | $EDITOR - -c ":%s/.*/$1 \"&\" $flags \"&\"/g"
|
||||||
|
@ -31,15 +31,21 @@ shebangtest()
|
|||||||
}
|
}
|
||||||
|
|
||||||
texcompile() { \
|
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")"
|
bibliography="$(grep '\\bibliography' "$file")"
|
||||||
|
|
||||||
if [ -n "$bibliography" ]; then
|
if [ -n "$bibliography" ]; then
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
bibtex "$base" &&
|
bibtex "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base"
|
$cmd --output-directory="$dir" "$base"
|
||||||
else
|
else
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base"
|
$cmd --output-directory="$dir" "$base"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
.local/bin/screenshot
Executable file
23
.local/bin/screenshot
Executable 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
|
@ -41,6 +41,9 @@ do
|
|||||||
if [ "Full" = "$status" ]; then
|
if [ "Full" = "$status" ]; then
|
||||||
status=" " && capacity="FULL"
|
status=" " && capacity="FULL"
|
||||||
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
||||||
|
else
|
||||||
|
if [ 100 -lt $(expr $capacity) ]; then
|
||||||
|
status=""
|
||||||
else
|
else
|
||||||
if [ "$status" = "Charging" ]; then
|
if [ "$status" = "Charging" ]; then
|
||||||
status=""
|
status=""
|
||||||
@ -56,4 +59,5 @@ do
|
|||||||
fi
|
fi
|
||||||
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
eth="$(cat /sys/class/net/eno1/operstate)"
|
eth="$(cat /sys/class/net/eno1/operstate)"
|
||||||
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
|
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
|
||||||
state="$(wpa_cli status | grep -i ^wpa_state | 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
|
if [ "up" = "$eth" ]; then
|
||||||
str="$(printf "%s / " "$str")"
|
str="$(printf "%s / " "$str")"
|
||||||
fi
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d77e1cfe127418ab00c6d5fb076f89cdf9b49e94
|
Subproject commit 41edd2a8502cc6d3be9ad18387e8b3c67d2dd4c3
|
@ -1 +1 @@
|
|||||||
Subproject commit f8ad07e02878adfbdab1241869630d608566c5c0
|
Subproject commit 82003c8dad7b966ab65f339749fb4272eafb8f4b
|
Reference in New Issue
Block a user