Updated a bunch of stuff in the lua config

This commit is contained in:
Jeremy Wall 2024-01-06 11:06:05 -05:00
parent f7370dffae
commit 234f291d3a
2 changed files with 197 additions and 198 deletions

View File

@ -91,13 +91,13 @@ cmp.setup({
sources = cmp.config.sources(
{
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
{ name = 'nvim_lsp_signature_help' }, -- display function signatures with current parameter emphasized
},
{
{ name = 'path' }, -- file paths
},
{
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'nvim_lua', keyword_length = 2 }, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
}),
@ -125,10 +125,10 @@ local caps = vim.tbl_deep_extend(
local lspconfig = require("lspconfig")
-- Terraform lsp setup
lspconfig.terraformls.setup{}
lspconfig.terraformls.setup {}
-- Nix language server support
lspconfig.nil_ls.setup{
lspconfig.nil_ls.setup {
--single_file_support = true,
--on_attach = function(client, bufnr)
-- -- disable the semanticTokens because it has issues.
@ -170,33 +170,33 @@ lspconfig.omnisharp.setup {
}
--ocaml
lspconfig.ocamllsp.setup{
lspconfig.ocamllsp.setup {
capabilities = caps
}
-- Java language server support
lspconfig.java_language_server.setup{
lspconfig.java_language_server.setup {
capabilities = caps
}
-- Typescript language server support
lspconfig.tsserver.setup{
lspconfig.tsserver.setup {
capabilities = caps
}
-- Rust language server support
lspconfig.rust_analyzer.setup{
lspconfig.rust_analyzer.setup {
capabilities = caps
}
-- lua language server setup.
lspconfig.lua_ls.setup{
lspconfig.lua_ls.setup {
settings = {
Lua = {
runtime = { version = 'LuaJIT', },
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
globals = { 'vim' },
},
workspace = {
-- Make the server aware of Neovim runtime files
@ -219,7 +219,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set("n", '<C-Space>', function()
vim.lsp.buf.hover()
end, opts)
vim.keymap.set({"n", "v"}, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set({ "n", "v" }, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, opts)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.codelens then
@ -228,7 +228,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
end,
})
vim.api.nvim_create_autocmd({'BufEnter', 'InsertLeave', 'CursorHold'}, {
vim.api.nvim_create_autocmd({ 'BufEnter', 'InsertLeave', 'CursorHold' }, {
callback = function(_)
local clients = vim.lsp.get_active_clients()
for cid = 1, #clients do
@ -249,10 +249,10 @@ local sign = function(opts)
})
end
sign({name = 'DiagnosticSignError', text = '🔥'})
sign({name = 'DiagnosticSignWarn', text = '⚠️'})
sign({name = 'DiagnosticSignHint', text = '➡️'})
sign({name = 'DiagnosticSignInfo', text = '🗒️'})
sign({ name = 'DiagnosticSignError', text = '🔥' })
sign({ name = 'DiagnosticSignWarn', text = '⚠️' })
sign({ name = 'DiagnosticSignHint', text = '➡️' })
sign({ name = 'DiagnosticSignInfo', text = '🗒️' })
vim.diagnostic.config({
virtual_text = false,
@ -280,10 +280,10 @@ autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
-- noselect: Do not select, force to select one from the menu
-- shortness: avoid showing extra messages when using completion
-- updatetime: set updatetime for CursorHold
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
vim.opt.shortmess = vim.opt.shortmess + { c = true}
vim.opt.completeopt = { 'menuone', 'noselect', 'noinsert' }
vim.opt.shortmess = vim.opt.shortmess + { c = true }
vim.api.nvim_set_option('updatetime', 300)
vim.opt.sessionoptions = {'buffers', 'curdir', 'skiprtp', 'localoptions', 'terminal', 'tabpages' }
vim.opt.sessionoptions = { 'buffers', 'curdir', 'skiprtp', 'localoptions', 'terminal', 'tabpages' }
-- Fixed column for diagnostics to appear
-- Show autodiagnostic popup on cursor hover_range
-- Goto previous / next diagnostic warning / error
@ -298,7 +298,7 @@ autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting=false,
additional_vim_regex_highlighting = false,
},
--indent = { enable = true },
rainbow = {
@ -333,10 +333,10 @@ require('nvim-treesitter.configs').setup {
--},
}
require'treesitter-context'.setup {
require 'treesitter-context'.setup {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
max_lines = 5, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 45, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
@ -355,7 +355,7 @@ vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
-- setup nvim-tree
require("nvim-tree").setup{
require("nvim-tree").setup {
hijack_unnamed_buffer_when_opening = true,
update_focused_file = {
enable = true,
@ -404,7 +404,7 @@ require("nvim-tree").setup{
},
}
require('trouble').setup{
require('trouble').setup {
icons = false,
signs = {
hint = "➡️",
@ -443,7 +443,7 @@ vim.keymap.set("n", "<Leader>mg", function()
vim.cmd("MagitOnly")
end)
require('possession').setup{
require('possession').setup {
commands = {
save = 'SSave',
load = 'SLoad',
@ -524,7 +524,7 @@ dap.adapters.lldb = {
dap.adapters.coreclr = {
type = 'executable',
command = '/run/current-system/sw/bin/netcoredbg',
args = {'--interpreter=vscode'}
args = { '--interpreter=vscode' }
}
dap.configurations.rust = {
@ -551,4 +551,3 @@ dap.configurations.cs = {
end,
},
}

6
nix/darwin/flake.lock generated
View File

@ -36,12 +36,12 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-cW76KH1n7bNW2wrMQCEg+7eH0lbcMNj+/JBVGG81HlU=",
"path": "/nix/store/5k2s8xq8c6rd1r4fwc3c1qlva0zns0ky-source/nix/base-system",
"narHash": "sha256-R0Q8QvXyxzRLuzBKW5ne9/FAFkv1QpMpqL6upo2dTFI=",
"path": "/nix/store/an6z19qb3z8nnlzdmnqldilbwdjcypxp-source/nix/base-system",
"type": "path"
},
"original": {
"path": "/nix/store/5k2s8xq8c6rd1r4fwc3c1qlva0zns0ky-source/nix/base-system",
"path": "/nix/store/an6z19qb3z8nnlzdmnqldilbwdjcypxp-source/nix/base-system",
"type": "path"
}
},