made some changes

This commit is contained in:
Dane Sabo 2025-03-04 23:48:22 -05:00
parent 24cff21d3d
commit 800ae4badd
7 changed files with 347 additions and 84 deletions

90
Session.vim Normal file
View File

@ -0,0 +1,90 @@
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd ~/.config/nvim
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
badd +111 lua/custom/plugins.lua
argglobal
%argdel
edit lua/custom/plugins.lua
let s:save_splitbelow = &splitbelow
let s:save_splitright = &splitright
set splitbelow splitright
wincmd _ | wincmd |
vsplit
1wincmd h
wincmd w
let &splitbelow = s:save_splitbelow
let &splitright = s:save_splitright
wincmd t
let s:save_winminheight = &winminheight
let s:save_winminwidth = &winminwidth
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe 'vert 1resize ' . ((&columns * 30 + 93) / 186)
exe 'vert 2resize ' . ((&columns * 155 + 93) / 186)
argglobal
enew
file NvimTree_1
balt lua/custom/plugins.lua
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal nofen
wincmd w
argglobal
balt lua/custom/plugins.lua
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 107 - ((58 * winheight(0) + 32) / 65)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 107
normal! 03|
wincmd w
exe 'vert 1resize ' . ((&columns * 30 + 93) / 186)
exe 'vert 2resize ' . ((&columns * 155 + 93) / 186)
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let &winminheight = s:save_winminheight
let &winminwidth = s:save_winminwidth
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :

View File

@ -1,33 +1,37 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"auto-session": { "branch": "main", "commit": "9c3f977aafb56bd73ba0d082c4dcbdba5666faf3" },
"base46": { "branch": "v2.0", "commit": "85de6cdb2d3c85d0aee53aea0569e73fdaf3df4e" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"crates.nvim": { "branch": "main", "commit": "1803c8b5516610ba7cdb759a4472a78414ee6cd4" },
"conform.nvim": { "branch": "master", "commit": "db8a4a9edb217067b1d7a2e0362c74bfe9cc944d" },
"crates.nvim": { "branch": "main", "commit": "6bf1b4ceb62f205c903590ccc62061aafc17024a" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" },
"indent-blankline.nvim": { "branch": "master", "commit": "b7aa0aed55887edfaece23f7b46ab22232fc8741" },
"lazy.nvim": { "branch": "main", "commit": "a8c6db5da7bd382094606340eed015d14fbb5654" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" },
"nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" },
"nvim-colorizer.lua": { "branch": "master", "commit": "943be69156b94fbc96064f4913d653f0c7fb299f" },
"nvim-dap": { "branch": "master", "commit": "6e0e8ab4d8ed520076971465a4388dfe54a91d83" },
"nvim-cmp": { "branch": "main", "commit": "c27370703e798666486e3064b64d59eaf4bdc6d5" },
"nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" },
"nvim-dap": { "branch": "master", "commit": "8228cb00ab0850e483f8d58cc39cc580c05738d6" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"nvim-lspconfig": { "branch": "master", "commit": "9e932edb0af4e20880685ddb96a231669fbe8091" },
"nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" },
"nvim-treesitter": { "branch": "master", "commit": "e6d02ec9efd396d294a7793f2066e2527b07b03a" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
"nvim-lspconfig": { "branch": "master", "commit": "84e0cd5a3c58e88ef706fdf4a1eed59ded1d3ce2" },
"nvim-tree.lua": { "branch": "master", "commit": "c09ff35de503a41fa62465c6b4ae72d96e7a7ce4" },
"nvim-treesitter": { "branch": "master", "commit": "2b0760dca2354fecf48ea35fdf1d753a232e3de2" },
"nvim-web-devicons": { "branch": "master", "commit": "ab4cfee554e501f497bce0856788d43cf2eb93d7" },
"nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" },
"telescope.nvim": { "branch": "master", "commit": "589910694bafe3975d0f025a750dcabc09824126" },
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" },
"tla.nvim": { "branch": "master", "commit": "1db3e7558066b89c391d20dbc99972023a176491" },
"ui": { "branch": "v2.0", "commit": "7b3225264af17a9e0aff0b4fd2a0fac90b73db53" },
"vim-tla": { "branch": "master", "commit": "220145ef791ac8d64d2c319eb2940b59da17d6ca" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

View File

@ -1,62 +1,80 @@
local config = require("plugins.configs.lspconfig")
local config = require "plugins.configs.lspconfig"
local on_attach = function(client, bufnr)
config.on_attach(client, bufnr)
-- Keybinding to show hover documentation
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>h', '<cmd>lua vim.lsp.buf.hover()<CR>', { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(
bufnr,
"n",
"<leader>h",
"<cmd>lua vim.lsp.buf.hover()<CR>",
{ noremap = true, silent = true }
)
-- Keybinding to show diagnostics
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<cmd>lua vim.diagnostic.open_float(nil, { focusable = false, close_events = {"BufLeave", "CursorMoved", "InsertEnter", "FocusLost"}, border = "rounded", source = "always", prefix = " ", scope = "cursor" })<CR>', { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(
bufnr,
"n",
"<leader>e",
'<cmd>lua vim.diagnostic.open_float(nil, { focusable = false, close_events = {"BufLeave", "CursorMoved", "InsertEnter", "FocusLost"}, border = "rounded", source = "always", prefix = " ", scope = "cursor" })<CR>',
{ noremap = true, silent = true }
)
-- Keybinding to show signature help
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>s', '<cmd>lua vim.lsp.buf.signature_help()<CR>', { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(
bufnr,
"n",
"<leader>s",
"<cmd>lua vim.lsp.buf.signature_help()<CR>",
{ noremap = true, silent = true }
)
end
local capabilities = config.capabilities
local lspconfig = require("lspconfig")
local lspconfig = require "lspconfig"
local servers = {
"pyright",
}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"python"},
filetypes = { "python" },
handlers = {
["textDocument/publishDiagnostics"] = function(_, result, ctx, config)
config = config or {}
config.virtual_text = false
vim.lsp.diagnostic.on_publish_diagnostics(_, result, ctx, config)
end,
["textDocument/signatureHelp"] = function() end -- Disable automatic signature help
}
})
["textDocument/signatureHelp"] = function() end, -- Disable automatic signature help
},
}
end
lspconfig.hls.setup{
lspconfig.hls.setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = {'haskell', 'lhaskell', 'cabal'}
filetypes = { "haskell", "lhaskell", "cabal" },
}
lspconfig.matlab_ls.setup{
lspconfig.matlab_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = {'matlab'}
filetypes = { "matlab" },
}
lspconfig.clangd.setup{
lspconfig.clangd.setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = {'c', 'cpp'}
filetypes = { "c", "cpp" },
}
lspconfig.lua_language_server.setup{
lspconfig.marksman.setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = {'lua'}
filetypes = { "markdown" },
}

View File

@ -1,2 +1,3 @@
vim.g.dap_virtual_text = false
vim.g.tlaplus_mappings_enable = true
vim.env.PATH = vim.env.PATH .. ":/home/danesabo/.ghcup/bin"

View File

@ -5,26 +5,26 @@ M.dap = {
n = {
["<leader>db"] = { "<cmd> DapToggleBreakpoint <CR>" },
["<leader>dus"] = {
function ()
local widgets = require('dap.ui.widgets');
local sidebar = widgets.sidebar(widgets.scopes);
sidebar.open();
function()
local widgets = require "dap.ui.widgets"
local sidebar = widgets.sidebar(widgets.scopes)
sidebar.open()
end,
"Open debugging sidebar"
}
}
"Open debugging sidebar",
},
},
}
M.crates = {
plugin = true,
n = {
["<leader>rcu"] = {
function ()
require('crates').upgrade_all_crates()
function()
require("crates").upgrade_all_crates()
end,
"update crates"
}
}
"update crates",
},
},
}
-- Function to show diagnostics on hover
@ -33,18 +33,18 @@ vim.api.nvim_create_autocmd("CursorHold", {
local opts = {
focusable = false,
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
border = 'rounded',
source = 'always', -- show source in diagnostics popup window
prefix = ' ',
scope = 'cursor',
border = "rounded",
source = "always", -- show source in diagnostics popup window
prefix = " ",
scope = "cursor",
}
vim.diagnostic.open_float(nil, opts)
end
end,
})
-- Optional: keybinding to manually show diagnostics on hover
vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true, silent = true })
require("custom.language_specific_commands.matlab")
require "custom.language_specific_commands.matlab"
return M

View File

@ -5,11 +5,18 @@ local plugins = {
"williamboman/mason.nvim",
opts = {
ensure_installed = {
--- lsp
"rust-analyzer",
"haskell-language-server",
"matlab-language-server",
"clangd",
"lua-language-server"
"marksman",
--- formatters
"stylua",
"black",
"clang-format",
"fourmolu",
},
},
},
@ -20,54 +27,43 @@ local plugins = {
require "custom.configs.lspconfig"
end,
},
-- {
-- "simrat39/rust-tools.nvim",
-- ft = "rust",
-- dependencies = "neovim/nvim-lspconfig",
-- opts = function ()
-- return require "custom.configs.rust-tools"
-- end,
-- config = function(_, opts)
-- require('rust-tools').setup(opts)
-- end
-- },
{
'mrcjkb/rustaceanvim',
version = '^4',
ft = {'rust'},
"mrcjkb/rustaceanvim",
version = "^4",
ft = { "rust" },
},
{
"mfussenegger/nvim-dap",
init = function()
require("core.utils").load_mappings("dap")
end
require("core.utils").load_mappings "dap"
end,
},
{
'saecki/crates.nvim',
ft = {"rust", "toml"},
"saecki/crates.nvim",
ft = { "rust", "toml" },
config = function(_, opts)
local crates = require('crates')
local crates = require "crates"
crates.setup(opts)
require('cmp').setup.buffer({
sources = { { name = "crates" }}
})
require("cmp").setup.buffer {
sources = { { name = "crates" } },
}
crates.show()
require("core.utils").load_mappings("crates")
require("core.utils").load_mappings "crates"
end,
},
{
"rust-lang/rust.vim",
ft = "rust",
init = function ()
init = function()
vim.g.rustfmt_autosave = 1
end
end,
},
{
"theHamsta/nvim-dap-virtual-text",
lazy = false,
config = function(_, opts)
require("nvim-dap-virtual-text").setup()
end
end,
},
{
"hrsh7th/nvim-cmp",
@ -78,19 +74,174 @@ local plugins = {
behavior = cmp.ConfirmBehavior.Insert,
select = false,
}
table.insert(M.sources, {name = "crates"})
table.insert(M.sources, { name = "crates" })
return M
end,
},
{
"susliko/tla.nvim",
ft = {'tla'},
config = function ()
require("tla").setup{
ft = { "tla" },
config = function()
require("tla").setup {
java_executable = "/usr/bin/java",
java_opts = {'-XX:+UseParallelGC'},
java_opts = { "-XX:+UseParallelGC" },
}
end
}
end,
},
{
"florentc/vim-tla",
ft = { "tla" },
-- Optional: specify events or commands for lazy loading
event = "BufRead",
cmd = { "TLAPlusCommand" },
},
{
"rmagatti/auto-session",
lazy = false,
keys = {
-- Will use Telescope if installed or a vim.ui.select picker otherwise
{ "<leader>fs", "<cmd>SessionSearch<CR>", desc = "Session search" },
{ "<leader>ws", "<cmd>SessionSave<CR>", desc = "Save session" },
{ "<leader>wa", "<cmd>SessionToggleAutoSave<CR>", desc = "Toggle autosave" },
},
---enables autocomplete for opts
---@module "auto-session"
---@type AutoSession.Config
opts = {
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
},
},
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
-- Customize or remove this keymap to your liking
"<leader>F",
function()
require("conform").format { async = true }
end,
mode = "",
desc = "Format buffer",
},
},
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
-- Define your formatters
formatters_by_ft = {
lua = { "stylua" },
python = { "black" },
rust = { "rustfmt" },
haskell = { "fourmolu" },
c = { "clang-format" },
},
-- Set default options
default_format_opts = {
lsp_format = "fallback",
},
-- Set up format-on-save
format_on_save = { timeout_ms = 500 },
-- Customize formatters
formatters = {
shfmt = {
prepend_args = { "-i", "2" },
},
},
},
init = function()
-- If you want the formatexpr, here is the place to set it
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
},
{
"goolord/alpha-nvim",
lazy = false,
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
local alpha = require "alpha"
local dashboard = require "alpha.themes.dashboard"
math.randomseed(os.time())
local function pick_color()
local colors = { "String", "Identifier", "Keyword", "Number" }
return colors[math.random(#colors)]
end
local function footer()
local datetime = os.date " %d-%m-%Y  %H:%M:%S"
local version = vim.version()
local nvim_version_info = "  v" .. version.major .. "." .. version.minor .. "." .. version.patch
return datetime .. nvim_version_info
end
local logo = {
[[ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
[[ %%%%===========================================%%%% ]],
[[ %%%%%=-------------------------------------------=#%%% ]],
[[ %%%%%=---------------------------------------------=#%%% ]],
[[ %%%%%=-----------------------------------------------=#%% ]],
[[ %%%%%====----------==========================---------+%% ]],
[[ %%%%%%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]],
[[ %%%%%%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]],
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]],
[[ %%%%#----------*%% %%%%%---------+%% ]],
[[ %%%%#----------*%% %%%%%---------+%% ]],
[[ %%%%#----------*%####################%%%%---------+%% ]],
[[ %%%%#----------+*************************---------+%% ]],
[[ %%%%#---------------------------------------------+%% ]],
[[ %%%%#--------------------------------------------+%%% ]],
[[ %%%%#------------------------------------------=#%%%% ]],
[[ %%%%#-----------------------------------------#%%%% ]],
[[ %%%%#----------=============================+%%%% ]],
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
[[ %%%%#----------*%% ]],
[[ %%%%#----------*%% %%%##**++++++*#%%%%%%% %%#***#%% ]],
[[%#+=% %%%%#----------*%% %%%#=--------==---------------------=%===+#%%##% ]],
[[%==% %%%%#----------*%%%%=+#=-----------+------------=+-------+==--=*=#=-==%% ]],
[[#-=% %%%%#---------=#*===**------------*=-----------++-------=%=----*=--=+=*%*# ]],
[[%*-#% %%%%#----==*#+--=+#%#----------=*+------------*=-------=+=----+#------+%=# ]],
[[ %*==#%%%%#*##*==-=**#%%%+=--------+*=+**----------*++=----+*#=---=*#%*+==-* % ]],
[[ %#+==--==+*#*+===*#*=--------=*+*%%%%%#+=-==----%#=---+#=---=#%%%%%% %*+% ]],
[[ %%%%#=-----**=----=+*#####% %%%%%%% %#*+=#=#==--++-=+#%%%%%%%*==%% ]],
[[ %%%%#-----+*==*#%% %#++==#% %%%%%%#=--=% %%#*=+#=-=+%% ]],
[[ %%%%#----+*-=%#%%% %+=-*% %% %#=-=# %%#==--=*#%%%% ]],
[[ %%%%%%%#----*=---=*#%%%% %+-===%#% %*=-==*#% %####==-+** ]],
[[ %%%%%=----------------#%% %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%]],
[[ %%%%%=----------------#%% %%-----------+%% %%=-------------------=%% %%--------------------=%%]],
[[ %%%%%=----------------#%% %%%%%%=---*%%%%% %%=----#%%*----%%%%=--=%% %%-----#%%+---=%%%%=--=%%]],
[[ %%%%%=----------------#%% %%=---*% %%%%%%%%%%*----%%%%%%%%%% %%%%%%%%%%+---=%%%%%%%%%%]],
[[ %%%%%=----------------#%% %%=---*% %*----%% %+---=%% ]],
[[ %%%%%##################%% %%%%%%=---*%%%%% %%%%%*----%%%%% %%%%%+---=%%%%%% ]],
[[ %%%%%%%%%%%%%%%%%%%%%%%%% %%-----------+%% %%=----------*%% %%=----------*%% ]],
[[ %%%%%%%%%%%%%%%%%%%%%%%%% %%############%% %%###########%%% %%############%% ]],
}
dashboard.section.header.val = logo
dashboard.section.header.opts.hl = pick_color()
dashboard.section.buttons.val = {
dashboard.button("<Leader>ff", " File Explorer"),
dashboard.button("<Leader>fo", " Find File"),
dashboard.button("<Leader>fw", " Find Word"),
dashboard.button("<Leader>fs", "󱝆 Find Session"),
dashboard.button("<Leader>ps", " Update plugins"),
dashboard.button("q", "󰩈 Quit", ":qa<cr>"),
}
dashboard.section.footer.val = footer()
dashboard.section.footer.opts.hl = "Constant"
alpha.setup(dashboard.opts)
vim.cmd [[ autocmd FileType alpha setlocal nofoldenable ]]
end,
},
}
return plugins

View File

@ -112,7 +112,6 @@ local default_plugins = {
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
end
end, {})
vim.g.mason_binaries_list = opts.ensure_installed
end,
},