From: Huck Boles Date: Mon, 1 Apr 2024 02:47:47 +0000 (-0700) Subject: merged from desktop X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=12c2e659f0ccd77ce7e86da7408943d060234ba3;p=nvim.git merged from desktop --- diff --git a/lua/huck/settings.lua b/lua/huck/settings.lua index aafaeab..4a911cd 100644 --- a/lua/huck/settings.lua +++ b/lua/huck/settings.lua @@ -52,11 +52,8 @@ vim.o.showcmd = true vim.o.cmdheight = 1 vim.o.cmdwinheight = 10 -vim.o.backupdir = '/home/huck/.local/state/nvim/backup' -vim.o.undodir = '/home/huck/.local/state/nvim/undo' - -vim.o.backup = true -vim.o.undofile = true +vim.o.backup = false +vim.o.undofile = false vim.o.swapfile = false vim.o.undolevels = 2000 vim.o.undoreload = 2000 diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua deleted file mode 100644 index 93ba93e..0000000 --- a/lua/plugins/lsp.lua +++ /dev/null @@ -1,190 +0,0 @@ -local border = { - { "┏", "FloatBorder" }, - { "━", "FloatBorder" }, - { "┓", "FloatBorder" }, - { "┃", "FloatBorder" }, - { "┛", "FloatBorder" }, - { "━", "FloatBorder" }, - { "┗", "FloatBorder" }, - { "┃", "FloatBorder" }, -} - -local keybinds = function() - vim.keymap.set('n', 'n', vim.diagnostic.goto_next) - vim.keymap.set('n', 'p', vim.diagnostic.goto_prev) - vim.keymap.set('n', 'r', vim.lsp.buf.rename) - vim.keymap.set('n', 'a', vim.lsp.buf.code_action) - vim.keymap.set('n', 'k', vim.lsp.buf.hover) - vim.keymap.set('n', 'K', vim.diagnostic.open_float) - vim.keymap.set('n', '', vim.lsp.buf.definition) - - -- toggle lsp diagnostics - vim.keymap.set('n', 'd', - function() - if vim.g.visible_diagnostics then - vim.diagnostic.disable() - vim.g.visible_diagnostics = false - else - vim.diagnostic.enable() - vim.g.visible_diagnostics = true - end - end - ) -end - -return { - { - "williamboman/mason-lspconfig", - dependencies = { - "nvim-treesitter", - { - "williamboman/mason.nvim", - build = ":MasonUpdate", - config = function() - require("mason").setup() - end, - }, - }, - version = "1.3.0", - config = function() - require("mason-lspconfig").setup({ - automatic_installation = false, - ensure_installed = { "clangd", "lua_ls", "solargraph" }, - }) - end, - }, - - { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - lazy = false, - dependencies = { - "mason-lspconfig", - "nvim-cmp", - "nvim-treesitter", - "Maan2003/lsp_lines.nvim", - }, - config = function() - -- servers to setup - local lsp = require("lspconfig") - - lsp.bashls.setup({ on_attach = keybinds }) - lsp.clangd.setup({ on_attach = keybinds }) - lsp.cssls.setup({ on_attach = keybinds }) - lsp.html.setup({ on_attach = keybinds }) - lsp.solargraph.setup({ on_attach = keybinds }) - lsp.julials.setup({ on_attach = keybinds }) - lsp.texlab.setup({ on_attach = keybinds }) - lsp.gopls.setup({ on_attach = keybinds }) - lsp.lua_ls.setup({ - on_attach = keybinds, - settings = { - Lua = { - diagnostics = { globals = "vim" } - } - } - }) - - -- diagnostic settings - vim.lsp.diagnostics = { - signs = true, - underline = true, - update_in_insert = false, - severity_sort = { reverse = false }, - } - - -- don't override treesitter colors - vim.highlight.priorities.semantic_tokens = 95 - - -- custom signs - local signs = { Error = ">>", Warn = "> ", Hint = "- ", Info = "* " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) - end - - local floating_preview = vim.lsp.util.open_floating_preview - function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) - opts = opts or {} - opts.border = opts.border or border - return floating_preview(contents, syntax, opts, ...) - end - - -- auto format code on save - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = { "*" }, - callback = function() - vim.lsp.buf.format() - end, - }) - end, - }, - - { - 'simrat39/rust-tools.nvim', - event = { "BufReadPost *.rs" }, - config = function() - local rust = require("rust-tools") - rust.setup( - { - tools = { - inlay_hints = { - only_current_line = true, - parameter_hints_prefix = "", - other_hints_prefix = "-> " - }, - hover_actions = { - border = border, - auto_focus = true, - max_width = nil, - max_height = nil, - } - }, - server = { - standalone = false, - settings = { - ['rust-analyzer'] = { - completion = { - callable = { snippets = "add_parentheses" } - }, - hover = { - actions = { - references = { enable = true }, - } - }, - imports = { - granularity = { enforce = true } - }, - inlay_hints = { - closureReturnTypeHints = { enable = 'with_block' }, - lifetimeElisionHints = { enable = 'skip_trivial' }, - } - } - }, - on_attach = function(_, bufnr) - keybinds() - vim.keymap.set('n', 'k', rust.hover_actions.hover_actions, { buffer = bufnr }) - vim.keymap.set('n', 'a', rust.code_action_group.code_action_group, { buffer = bufnr }) - vim.keymap.set('n', 'm', rust.expand_macro.expand_macro, { buffer = bufnr }) - vim.keymap.set('n', 'c', rust.open_cargo_toml.open_cargo_toml, { buffer = bufnr }) - vim.keymap.set('n', 'P', rust.parent_module.parent_module, { buffer = bufnr }) - end - } - } - ) - - -- auto format code on save - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = { "*" }, - callback = function() - vim.lsp.buf.format() - end, - }) - end - }, - - { - 'JuliaEditorSupport/julia-vim', - event = { "BufReadPost *.jl" } - }, -} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 1764063..442b3f8 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -4,11 +4,6 @@ return { lazy = false, dependencies = { 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = { - 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } - }, }, keys = { { '', 'Telescope current_buffer_fuzzy_find sorting_strategy=ascending' }, @@ -68,18 +63,8 @@ return { }, }, pickers = {}, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = 'smart_case', - } - }, } - require('telescope').load_extension('fzf') - -- live grep in git repo, or fall back to current directory vim.keymap.set('n', 'F', function()