First attempt at a minimal configuration

This commit is contained in:
Administrator 2024-04-03 14:08:46 +01:00
parent d4ec787b0d
commit b96c092078
9 changed files with 61 additions and 449 deletions

View File

@ -1,17 +0,0 @@
CIFAR
MNIST
LeNet
MUL
BCNN
Grangegorman
Cueto
Mendoza
Maynooth
Frobenius
Neuromorphic
neuromorphic
NN
pytorch
Pytorch
SOTA

View File

@ -1,238 +0,0 @@
local lsp = require('lsp-zero')
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
lsp.preset("recommended")
if (MY_OS == 'Linux')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'clangd',
'dockerls',
'julials',
'lua_ls',
'ltex',
'pylsp',
'rust_analyzer',
'texlab',
'zls'
})
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'dockerls',
'pylsp'
})
else
print('Should never be here')
end
local cmp = require("cmp")
local cmp_select = { behavior = cmp.SelectBehavior.Select }
local cmp_mappings = lsp.defaults.cmp_mappings({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
})
lsp.setup_nvim_cmp({
mapping = cmp_mappings
})
lsp.on_attach(function(client, bufnr)
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts, { desc = "LSP Goto Reference" })
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts, { desc = "LSP Goto Definition" })
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts, { desc = "LSP Hover" })
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts,
{ desc = "LSP Workspace Symbol" })
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.setloclist() end, opts, { desc = "LSP Show Diagnostics" })
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts, { desc = "Next Diagnostic" })
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts, { desc = "Previous Diagnostic" })
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts, { desc = "LSP Code Action" })
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts, { desc = "LSP References" })
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts, { desc = "LSP Rename" })
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts, { desc = "LSP Signature Help" })
end)
if (MY_OS == 'Linux')
then
-- Installed for Linux
require('lspconfig').bashls.setup({})
require('lspconfig').clangd.setup({})
--require('lspconfig').gopls.setup({})
require('lspconfig').julials.setup({})
--require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
require('lspconfig').lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
neededFileStatus = {
["codestyle-check"] = "Any",
},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
format = {
enable = true,
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "4",
}
},
},
},
})
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {}
for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
require('lspconfig').ltex.setup({
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
},
},
})
require('lspconfig').rust_analyzer.setup({
settings = {
["rust-analyzer"] = {
diagnostics = {
enable = false;
}
}
}
})
require('lspconfig').texlab.setup({})
require('lspconfig').zls.setup({})
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
-- Installed for BSD
require('lspconfig').bashls.setup({})
require('lspconfig').clangd.setup({})
--local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
--local words = {}
--for word in io.open(path, "r"):lines() do
-- table.insert(words, word)
--end
--require('lspconfig').ltex.setup({
-- settings = {
-- ltex = {
-- language = "en-GB",
-- dictionary = {
-- ["en-GB"] = words,
-- },
-- },
-- },
--})
require('lspconfig').rust_analyzer.setup({
settings = {
["rust-analyzer"] = {
diagnostics = {
enable = false;
}
}
}
})
require('lspconfig').texlab.setup({})
require('lspconfig').zls.setup({})
else
print('Should never be here')
end
lsp.setup()
local cmp_action = require('lsp-zero').cmp_action()
require('luasnip.loaders.from_vscode').lazy_load()
-- `/` cmdline setup.
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- `:` cmdline setup.
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip', keyword_length = 2 },
{ name = 'buffer', keyword_length = 3 },
{ name = 'path' },
},
mapping = {
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
['<Tab>'] = cmp_action.luasnip_supertab(),
['<S-Tab>'] = cmp_action.luasnip_shift_supertab(),
},
})

View File

@ -1,17 +0,0 @@
vim.keymap.set("n", "<leader>l", '<cmd>lua vim.lsp.buf.format()<CR>')
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
--null_ls.builtins.diagnostics.eslint,
null_ls.builtins.completion.spell,
null_ls.builtins.code_actions.eslint,
--null_ls.builtins.diagnostics.jsonlint,
null_ls.builtins.diagnostics.ktlint,
null_ls.builtins.diagnostics.markdownlint,
--null_ls.builtins.diagnostics.protoc_gen_lint,
},
})

View File

@ -1,13 +0,0 @@
vim.o.foldcolumn = '1' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "Open all folds"})
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "Close all folds"})
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return {'treesitter', 'indent'}
end
})

View File

@ -1,3 +1,25 @@
require('eddie.lazy')
require('eddie.remaps')
require('eddie.options')
--[[
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
if (MY_OS == 'Linux')
then
print('Should be here if on Linux')
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
print('Should be here if on BSD')
else
print('Should never be here')
end
]]--

View File

@ -1,4 +1,4 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local lazypath= vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
@ -15,57 +15,23 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
local plugins = {
{
'pwntester/octo.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'nvim-tree/nvim-web-devicons',
},
config = function()
require "octo".setup()
end
},
{
'nvim-telescope/telescope.nvim',
tag = '0.1.5',
dependencies = { { 'nvim-lua/plenary.nvim' } }
},
{
"windwp/nvim-ts-autotag",
dependencies = "nvim-treesitter/nvim-treesitter",
config = function()
require('nvim-ts-autotag').setup({})
end,
lazy = true,
event = "VeryLazy"
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = {
"bash",
"c",
"dockerfile",
"json",
"julia",
"latex",
"lua",
"vim",
"vimdoc",
"zig",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
},
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' },
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{
"aaronhallaert/advanced-git-search.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-fugitive",
'tpope/vim-rhubarb',
},
},
'nvim-telescope/telescope-ui-select.nvim',
'debugloop/telescope-undo.nvim',
{
"folke/tokyonight.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
@ -75,7 +41,7 @@ local plugins = {
vim.cmd('colorscheme tokyonight-night')
end,
},
'nvim-treesitter/playground',
'ThePrimeagen/harpoon',
{
'mbbill/undotree',
@ -102,6 +68,15 @@ local plugins = {
require("nvim-autopairs").setup()
end
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end
},
{ 'vimwiki/vimwiki' },
{ "nvim-tree/nvim-tree.lua" },
{
@ -115,28 +90,13 @@ local plugins = {
})
end
},
{
'lervag/vimtex'
},
{
'bronson/vim-trailing-whitespace'
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end
},
{
'junegunn/fzf',
build = ":call fzf#install()"
},
'nanotee/zoxide.vim',
'nvim-telescope/telescope-ui-select.nvim',
'debugloop/telescope-undo.nvim',
{
"AckslD/nvim-neoclip.lua",
dependencies = {
@ -168,45 +128,10 @@ local plugins = {
},
'airblade/vim-gitgutter',
'mg979/vim-visual-multi',
'tpope/vim-rails',
{
'kevinhwang91/nvim-ufo',
dependencies = 'kevinhwang91/promise-async'
},
{
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
-- LSP Support
{ 'neovim/nvim-lspconfig' }, -- Required
{ -- Optional
'williamboman/mason.nvim',
build = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
-- Autocompletion
{ 'hrsh7th/nvim-cmp' }, -- Required
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
{ 'L3MON4D3/LuaSnip' }, -- Required
{ "rafamadriz/friendly-snippets" },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-cmdline' },
{ 'saadparwaiz1/cmp_luasnip' },
}
},
{
'nvimtools/none-ls.nvim',
config = function()
require('null-ls').setup({
})
end,
dependencies = { 'nvim-lua/plenary.nvim' },
},
{
'folke/which-key.nvim',
event = "VeryLazy",
@ -216,15 +141,6 @@ local plugins = {
end,
opts = {}
},
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{
"aaronhallaert/advanced-git-search.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-fugitive",
'tpope/vim-rhubarb',
},
},
}
require('lazy').setup(plugins, {

View File

@ -36,37 +36,7 @@ vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
--vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})

View File

@ -53,31 +53,6 @@ vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true, desc =
-- Jump to plugin management file
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/exosyphon/lazy.lua<CR>", { desc = "Jump to lazy.lua" })
-- Run Tests
vim.keymap.set("n", "<leader>t", "<cmd>lua require('neotest').run.run()<CR>", { desc = "Run Test" })
vim.keymap.set("n", "<leader>tf", "<cmd>lua require('neotest').run.run(vim.fn.expand('%'))<CR>", { desc = "Run Test File" } )
vim.keymap.set("n", "<leader>td", "<cmd>lua require('neotest').run.run(vim.fn.getcwd())<CR>", { desc = "Run Current Test Directory" })
vim.keymap.set("n", "<leader>tp", "<cmd>lua require('neotest').output_panel.toggle()<CR>", { desc = "Toggle Test Output Panel" })
vim.keymap.set("n", "<leader>tl", "<cmd>lua require('neotest').run.run_last()<CR>", { desc = "Run Last Test" })
vim.keymap.set("n", "<leader>ts", "<cmd>lua require('neotest').summary.toggle()<CR>", { desc = "Toggle Test Summary" })
-- Debug Tests
vim.keymap.set("n", "<leader>dt", "<cmd>DapContinue<CR>", { desc = "Start Debugging" })
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<CR>", { desc = "Start Debugging" })
vim.keymap.set("n", "<leader>dso", "<cmd>DapStepOver<CR>", { desc = "Step Over" })
vim.keymap.set("n", "<leader>dsi", "<cmd>DapStepInto<CR>", { desc = "Step Into" })
vim.keymap.set("n", "<leader>dsu", "<cmd>DapStepOut<CR>", { desc = "Step Out" })
vim.keymap.set("n", "<leader>dst", "<cmd>DapStepTerminate<CR>", { desc = "Stop Debugger" })
vim.keymap.set("n", "<leader>b", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Toggle Breakpoint" })
vim.keymap.set("n", "<leader>B", "<cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>", { desc = "Toggle Breakpoint Condition" })
vim.keymap.set("n", "<leader>E", "<cmd>lua require'dap'.set_exception_breakpoints()<CR>", { desc = "Toggle Exception Breakpoint" })
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dapui'.float_element('repl', { width = 100, height = 40, enter = true })<CR>", { desc = "Show DAP REPL" })
vim.keymap.set("n", "<leader>ds", "<cmd>lua require'dapui'.float_element('scopes', { width = 150, height = 50, enter = true })<CR>", { desc = "Show DAP Scopes" })
vim.keymap.set("n", "<leader>df", "<cmd>lua require'dapui'.float_element('stacks', { width = 150, height = 50, enter = true })<CR>", { desc = "Show DAP Stacks" })
vim.keymap.set("n", "<leader>db", "<cmd>lua require'dapui'.float_element('breakpoints', { enter = true })<CR>", { desc = "Show DAP breakpoints" })
vim.keymap.set("n", "<leader>do", "<cmd>lua require'dapui'.toggle()<CR>", { desc = "Toggle DAP UI" })
vim.keymap.set("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<CR>", { desc = "Debug Last Test" })
-- Git revert at current cursor location
vim.keymap.set("n", "<leader>U", "<cmd>GitGutterUndoHunk<CR>", { desc = "Revert Git Hunk" })
@ -89,9 +64,6 @@ vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end, { desc = "Source current file" })
-- Open Zoxide telescope extension
vim.keymap.set("n", "<leader>Z", "<cmd>Zi<CR>", { desc = "Open Zoxide" })
-- Resize with arrows
vim.keymap.set("n", "<C-S-Down>", ":resize +2<CR>", { desc = "Resize Horizontal Split Down" })
vim.keymap.set("n", "<C-S-Up>", ":resize -2<CR>", { desc = "Resize Horizontal Split Up" })

View File

@ -1,3 +1,20 @@
hyperparameter
hyperparameters
NVIDIA
CIFAR
MNIST
LeNet
MUL
BCNN
Grangegorman
Cueto
Mendoza
Maynooth
Frobenius
Neuromorphic
neuromorphic
NN
pytorch
Pytorch
SOTA