diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-09-09 17:33:36 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-09-09 17:33:36 +0200 |
commit | 249c4c38565933e8020326f439cc63f2d686492d (patch) | |
tree | 6b9be9905112516fb613913615967331e29e6c37 | |
parent | 2f569a703d95b8fe5d18d05d9fb9374b73e87568 (diff) |
Update configs
-rw-r--r-- | .config/.alacritty.toml | 24 | ||||
-rw-r--r-- | .config/.alacritty.yml | 45 | ||||
-rw-r--r-- | .config/nvim/init.vim | 3 | ||||
-rw-r--r-- | .config/nvim/lua/git.lua | 3 | ||||
-rw-r--r-- | .config/nvim/lua/lsp_conf.lua | 62 | ||||
-rwxr-xr-x[-rw-r--r--] | git/.gitconfig | 4 |
6 files changed, 49 insertions, 92 deletions
diff --git a/.config/.alacritty.toml b/.config/.alacritty.toml index 2bdb437..2ab9d7f 100644 --- a/.config/.alacritty.toml +++ b/.config/.alacritty.toml @@ -26,6 +26,30 @@ yellow = "#f1c40f" background = "#000000" foreground = "#c1c1c1" +# [colors.primary] +# background= "#ffffff" +# foreground= "#1F2328" +# +# [colors.normal] +# black= "#24292f" +# red= "#cf222e" +# green= "#116329" +# yellow= "#4d2d00" +# blue= "#0969da" +# magenta= "#8250df" +# cyan= "#1b7c83" +# white= "#6e7781" +# +# [colors.bright] +# black= "#57606a" +# red= "#a40e26" +# green= "#1a7f37" +# yellow= "#633c01" +# blue= "#218bff" +# magenta= "#8250df" +# cyan= "#1b7c83" +# white= "#6e7781" + [font] size = 11.5 diff --git a/.config/.alacritty.yml b/.config/.alacritty.yml deleted file mode 100644 index 06d0eff..0000000 --- a/.config/.alacritty.yml +++ /dev/null @@ -1,45 +0,0 @@ -shell: - program: /usr/bin/tmux - args: - - new - - -font: - size: 11.5 - normal: - # family: FiraMono - # style: Normal - # family: DejaVuSansMono - # family: UbuntuMono - # style: Nerd - family: GitLabMono - style: Regular - -colors: - primary: - background: "#000000" - foreground: "#c1c1c1" - - cursor: - text: "#424242" - cursor: "#808080" - - normal: - black: "#000000" - red: "#af005f" - green: "#5faf00" - yellow: "#f1c40f" - blue: "#5fafd7" - magenta: "#808080" - cyan: "#2ecc71" - white: "#f2f2f2" - - bright: - black: "#6a6a6a" - red: "#e74c3c" - green: "#afd700" - yellow: "#f1c40f" - blue: "#ffaf00" - magenta: "#ffaf00" - cyan: "#00afaf" - white: "#5f8787" diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 9756ea5..7c4845b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -104,9 +104,6 @@ set noswapfile set termguicolors set background=dark -" copy with `y` to clipboard -set clipboard+=unnamedplus - if has('nvim') let base16colorspace=256 "colorscheme base16-irblack diff --git a/.config/nvim/lua/git.lua b/.config/nvim/lua/git.lua index 84fd079..da6bbdd 100644 --- a/.config/nvim/lua/git.lua +++ b/.config/nvim/lua/git.lua @@ -35,9 +35,6 @@ require('gitsigns').setup { row = 0, col = 1 }, - yadm = { - enable = false - }, on_attach = function(bufnr) local gs = package.loaded.gitsigns local function map(mode, l, r, opts) diff --git a/.config/nvim/lua/lsp_conf.lua b/.config/nvim/lua/lsp_conf.lua index 9ec2c35..036f331 100644 --- a/.config/nvim/lua/lsp_conf.lua +++ b/.config/nvim/lua/lsp_conf.lua @@ -1,65 +1,42 @@ local nvim_lsp = require('lspconfig') --- local coq = require('coq') --- +local trouble = require("trouble") local capabilities = require("cmp_nvim_lsp").default_capabilities() -local null_ls = require("null-ls") -local trouble = require("trouble") --- Redefine sign. +-- Redefine LSP diagnostic signs local signs = { Error = 'E', Warning = 'W', Hint = 'H', Information = 'I' } for type, icon in pairs(signs) do - local hl = 'LspDiagnosticsSign' .. type + local hl = 'DiagnosticSign' .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' }) end ---local function vim.keymap.set(...) vim.api.nvim_vim.keymap.set(bufnr, ...) end local opts = { noremap=true, silent=true } -null_ls.setup({ - debug = false, - sources = { - -- Python - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, - null_ls.builtins.diagnostics.ruff, - -- null_ls.builtins.diagnostics.flake8, - -- Rust - null_ls.builtins.formatting.rustfmt, - -- C - null_ls.builtins.formatting.clang_format, - -- JS/TS - null_ls.builtins.formatting.prettier, - }, - on_attach = common_on_attach -}) - --- Setup lspconfig. - +-- Setup lsp_signature for function signature help require "lsp_signature".setup() ---- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches - +-- Common on_attach function to handle keymaps and settings for all LSPs local common_on_attach = function(client, bufnr) - -- Mappings. + -- Key mappings vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "ga", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts) + -- Use vim.diagnostic.open_float for showing line diagnostics (replacing deprecated call) + vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts) vim.keymap.set('n', '<A-f>', '<cmd>lua vim.lsp.buf.format {async = true}<cr>', opts) - vim.cmd "autocmd BufWritePre <buffer> lua vim.lsp.buf.format {async = true}" - - -- lsp_status.on_attach(client) + + -- Autoformat on save + vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.format {async = true}") end +-- LSP servers setup +local servers = { 'pyright', 'rust_analyzer', 'clangd', 'gopls', 'ocamllsp', 'jdtls' } -local servers = { 'pyright', 'rust_analyzer', 'tsserver', 'clangd', 'gopls', 'ocamllsp' } --- local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.offsetEncoding = { "utf-16" } + for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, @@ -70,14 +47,21 @@ for _, lsp in ipairs(servers) do } end +nvim_lsp.ts_ls.setup { + capabilities = capabilities, + on_attach = common_on_attach, + filetypes = { "typescript", "typescriptreact", "typescript.tsx" }, + cmd = { "typescript-language-server", "--stdio" } +} + +-- Trouble setup trouble.setup({ use_diagnostic_signs = true, auto_close = true, auto_open = false }) - --- nvim-cmp setup +-- nvim-cmp setup for autocompletion local luasnip = require 'luasnip' local cmp = require 'cmp' cmp.setup { diff --git a/git/.gitconfig b/git/.gitconfig index 662b90a..2863ba2 100644..100755 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -15,8 +15,8 @@ [credential] helper = store [core] - editor = nvim --clean - ; pager = bat -l diff + editor = nvim -u ~/.config/nvim/init_clean.vim + ; pager = bat -n --style=plain ; pager = delta excludesFile = ~/.gitignore [init] |