From deecd96cc91a16b68ecbe9a88a9a5ee5651c9a8e Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 14 Aug 2021 17:53:14 -0700 Subject: [PATCH 1/2] extend hex alacritty hint --- .config/alacritty/alacritty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 249efc2..81e28d1 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -858,7 +858,7 @@ key_bindings: hints: alphabet: "jfkdls;ahgurieowpq" enabled: - - regex: "[a-f0-9]{40}" + - regex: "[a-f0-9]{7,}" action: Copy binding: key: H From 2a36ef6c0bffa579e5432bbb3f574203524005b9 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 17 Aug 2021 11:13:24 -0700 Subject: [PATCH 2/2] cfm formatter lsp --- .vim/nvim.lua | 16 ++++++++++++++++ .vimrc | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 42deba4..3f09002 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -9,6 +9,22 @@ end nvim_lsp.rust_analyzer.setup({ on_attach=on_attach }) nvim_lsp.gopls.setup({ on_attach=on_attach }) nvim_lsp.pyright.setup({ on_attach=on_attach }) +nvim_lsp.clangd.setup({ on_attach=on_attach }) + +nvim_lsp.efm.setup { + init_options = {documentFormatting = true}, + settings = { + rootMarkers = {".git/"}, + languages = { + lua = { + { formatCommand = "lua-format -i", formatStdin = true } + }, + python = { + { formatCommand = 'black --quiet -', formatStdin = true } + } + } + } +} -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( diff --git a/.vimrc b/.vimrc index f160c86..0ad1687 100644 --- a/.vimrc +++ b/.vimrc @@ -304,6 +304,10 @@ set updatetime=500 " Show diagnostic popup on cursor hold autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +" Autoformat on save +autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000) +autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 1000) + " Goto previous/next diagnostic warning/error nnoremap g[ lua vim.lsp.diagnostic.goto_prev() nnoremap g] lua vim.lsp.diagnostic.goto_next()