Compare commits

...

92 Commits

Author SHA1 Message Date
1fbc072e4c [Telescope] Improve keybinds 2025-08-23 17:04:52 +02:00
82cb9c4673 [Keybinds] Remove conflicting binds 2025-08-23 17:04:44 +02:00
b6bb24d403 [Autopairs] Update keybind 2025-08-23 17:04:27 +02:00
01221c7803 [LSP] Fix misspelled ls 2025-06-20 15:19:42 +02:00
f4c7857613 [Mason] Add verible as ls to install 2025-06-20 10:42:48 +02:00
41a5b1d3b5 [Snippets] Remove tab chars 2025-06-07 08:46:40 +02:00
83c31fb13f [README] Add link to linter configs 2025-06-06 09:35:12 +02:00
6e53296a0b [LSP] Fix eslint formatting being overridden by vuels or tsls 2025-06-06 09:07:50 +02:00
408f84bb8f [Mason] Fix ls names 2025-06-05 19:59:54 +02:00
1a241a1241 [Mason] Install latexindent 2025-06-05 12:44:51 +02:00
aac415c3b5 [Spell] Remove textlsp, as it was annoying 2025-06-05 12:22:23 +02:00
620a5cd2d6 [Spell] Update binds, fix issue 2025-06-05 11:55:27 +02:00
ee9066213b [Spell] Auto-start textlsp for tex, md and more text files 2025-06-05 11:39:17 +02:00
4aa0c54fc4 Format config 2025-06-05 11:33:49 +02:00
5870ed5fc5 [Spell] Migrate to different spell checker 2025-06-05 11:33:37 +02:00
1805645694 [Mason] Add new language servers 2025-06-05 11:33:08 +02:00
d134abbfda [LSP] Separate all configs, add new LS 2025-06-05 11:32:54 +02:00
4d6a5a431c [LSP] Fix texlab config 2025-06-05 10:34:39 +02:00
68c12127c2 [LSP] Migrate to new config format 2025-06-04 15:30:13 +02:00
17b1d19a93 [Mason] Add asm-lsp to ensure_installed 2025-06-04 15:30:03 +02:00
ea0a0c68c6 [Mason] Update to new one, disable auto-enable 2025-06-04 14:58:14 +02:00
f989dadbd2 [LSP] Fix Vue 2025-06-04 14:52:28 +02:00
982b467cb0 [Snippets] Add new snippet 2025-06-04 08:32:02 +02:00
877b59d5c5 [LSP] Finish rust_analyzer setup 2025-06-03 09:09:59 +02:00
acb285c118 [Mason] Add rust_analyzer 2025-06-03 09:09:48 +02:00
37bc89fe35 [LSP] Add rust LS 2025-06-03 09:06:39 +02:00
c63aa24fa9 [Mason] Fix auto-install servers 2025-06-03 09:06:32 +02:00
1be9e1875e [Mason] Add some auto-install servers 2025-06-02 09:01:58 +02:00
d20ec7a2e7 [Treesitter] Enable folding, add parsers 2025-05-28 11:01:58 +02:00
ced6316866 [Mason] Fix invalid ls name 2025-05-27 11:39:07 +02:00
cee8c2b203 [Spell] Collect updated spell entries, add script to do so 2025-05-26 11:39:33 +02:00
52bfe295cb [LSP] Add extra comments 2025-05-23 11:33:28 +02:00
1d9cbabc87 [Mason] Fix ensure_installed 2025-05-22 10:14:25 +02:00
4cb32c09b2 [Keybinds] Remove save keybind C-s 2025-05-21 09:19:26 +02:00
9d5cc591da [Collect] Remove unnecessary script 2025-05-15 15:16:45 +02:00
51667cb7f1 [Nvim-COC] Remove 2025-05-15 15:16:30 +02:00
311fc8bb8f [Keybinds] Add window resize binds and doc them 2025-05-15 15:16:25 +02:00
08ca032751 [LSP] Extract options into separate file 2025-05-15 15:16:14 +02:00
37bf15d060 [LSP] Java setup rework 2025-05-15 15:16:00 +02:00
641511b845 [Neotest] Clean up 2025-05-15 15:15:35 +02:00
94dc7b06ff [Neotree] Remove unnecessary keybind 2025-05-15 15:15:23 +02:00
cd11696d75 [Java] Redo testing setup 2025-05-15 15:15:03 +02:00
051dca6a2a [Coloring] Add back colorizer, move ccc 2025-05-12 10:56:44 +02:00
f9cea1aa93 [Colours] Fix colour clash 2025-05-09 11:13:45 +02:00
d75370ec4f [None] Add asmfmt and proselint 2025-05-09 11:09:52 +02:00
109acc4cf5 Update README.md 2025-05-07 07:58:33 +00:00
177b91fc2d [None] try to address issues 2025-05-05 16:20:26 +02:00
354ef1fef7 [None] Complete eslint setup 2025-05-05 15:49:44 +02:00
f50c4b19fc [None] Add eslint for diagnostics 2025-05-05 14:47:20 +02:00
0eafcb26b2 [TS] Add asm parser 2025-05-02 07:50:55 +02:00
f7d3c8b24b [LSP] Format, add asm lsp 2025-05-02 07:49:33 +02:00
67363070e3 [None-LS] Improve formatting for JS/TS/etc 2025-04-27 10:01:33 +02:00
b18160a61b [Coloring] Fix color picker config 2025-04-26 20:39:25 +02:00
a4ce76b904 [Coloring] Add colour picker 2025-04-26 20:38:24 +02:00
2a0b4634ae [LSP] Improve looks of config 2025-04-25 11:18:56 +02:00
10e4d65827 [Trouble] Remove because never used 2025-04-25 06:56:51 +02:00
3a7a2fdcd9 [LSP] Fix vue + snippets 2025-04-17 18:48:28 +02:00
410c563e96 [LSP] Actually fix vue 2025-04-17 16:50:32 +02:00
68fc58a50a [LSP] Fix vue setup 2025-04-17 16:30:34 +02:00
d7b445365d [LSP] Improve TS, TSX, JS, JSX, Vue handling 2025-04-15 10:25:48 +02:00
3e6fae6379 [Neotree] Fix file watcher 2025-04-10 18:45:39 +02:00
c396441544 [Keybinds] Add to correct configs 2025-04-04 07:41:08 +02:00
4656f74fdd [Keybinds] Add toggle relative numbering 2025-04-03 14:07:50 +02:00
c736531a33 [Neotree] Add auto expand of empty dirs 2025-04-02 11:41:10 +02:00
e0c1fc4368 [Telescope] Fix notifications keybind 2025-04-01 13:21:07 +02:00
ae83467104 [Telescope] Move keybinds back to <leader> 2025-04-01 12:53:20 +02:00
07ba68b8ff [Resize] Fix direction 2025-04-01 12:40:47 +02:00
413023e903 [Keybinds] Remove Ctrl + Bckspc 2025-03-31 16:50:20 +02:00
2f511561d9 [NeoTree] Start git view in floating window 2025-03-31 16:28:17 +02:00
1112968c60 [NvimTree] Complete replacement 2025-03-31 16:24:55 +02:00
79d26ff6f8 [GitSigns] Add 2025-03-31 15:18:57 +02:00
d85ed3b970 [Telescope] Move keybind off <leader> 2025-03-31 15:18:49 +02:00
a65afcc808 [Nvim-Tree] Replace with Neotree 2025-03-31 15:18:25 +02:00
f5533f7693 [Bufremove] Fix 2025-03-31 10:43:25 +02:00
3138926e01 [Clean] Add a clean script
This little script helps solve issues caused by cache hits for lazy
(thus versioning breaking). Deletes the caches and install directories
for a full clean install
2025-03-31 10:24:15 +02:00
fa358c9843 [Bufdelete] Replace with bufremove, because bufdelete is deprecated 2025-03-31 10:04:07 +02:00
df72ebda9e [Noice] Improve notification size 2025-03-27 12:48:13 +01:00
0269979276 [Noice] Improve notification rendering 2025-03-27 11:34:25 +01:00
ad3afc0064 [Telescope] Add telescope notifications 2025-03-27 11:34:16 +01:00
b8e3cf84ad [Noice] Move search to popup from bottom 2025-03-27 10:19:57 +01:00
869fb9d069 [LSP] Add md ls 2025-03-26 16:26:33 +01:00
2fb3ad6968 [Trouble] Add one setting 2025-03-25 13:37:47 +01:00
fd0ebdf024 [Dressing] Add back 2025-03-25 10:14:03 +01:00
7d90560964 [Testing] Add trouble 2025-03-24 20:36:22 +01:00
98b3bb3763 [Style] Replace dressing with noice 2025-03-24 20:36:13 +01:00
a7469a678b Add jsonls 2025-03-23 11:08:48 +01:00
6332f7b770 [TypeScript] Enable all LSP functions 2025-03-21 18:06:08 +01:00
1ac43ff80c [Neogen] Add (Doc generation) 2025-03-21 16:35:07 +01:00
c780d574b8 [TS] Add new parsers 2025-03-20 15:52:59 +01:00
3444377f73 [Spell] Add new words 2025-03-18 13:47:26 +01:00
1e1b74f072 [Colors] Improve darkblue legibility 2025-03-18 13:47:16 +01:00
541fe69d57 [Telescope] Add tons more functionality. <leader>f to check it out 2025-03-18 13:47:05 +01:00
112 changed files with 1692 additions and 3094 deletions

View File

@@ -1,6 +1,11 @@
# NeoVim Configs
This repository contains my NeoVim configs, including some of my snippets.
It uses Lazy.nvim as the plugin manager, lspconfig for the language server configuration, none-ls for formatting, telescope, tree-sitter and many other plugins. Partially documented and fairly well organized
## Linter configs
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
# Issues with jdtls
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`

9
nvim-clean.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
git pull
rm -rf ~/.local/share/nvim/
rm -rf ~/.local/state/nvim/
rm -rf ~/.cache/nvim/
# Re-Install configs to clean out lazy-lock and all other residue
./nvim-install.sh

View File

@@ -1,27 +0,0 @@
{
"diagnostic.enable": true,
"diagnostic.virtualText": true,
"diagnostic.floatEnabled": true,
"python.pythonPath": "/usr/bin/python3",
"suggest.enable": true,
"suggest.autoTrigger": "always",
"suggest.minTriggerInputLength": 1,
"suggest.timeout": 500,
"suggest.noselect": false,
"suggest.border": "single",
"suggest.floatMaxHeight": 20,
"suggest.floatMaxWidth": 80,
"suggest.menuHeight": 10,
"suggest.padding": [0, 1],
"snippets.ultisnips.pythonPrompt": false,
"languageserver": {
"verilog": {
"command": "verible-verilog-ls",
"filetypes": ["verilog", "systemverilog"],
"rootPatterns": ["verible-verilog-ls"]
}
},
"coc.preferences.enablePostfixCompletions": true,
"coc.source.buffer.enable": true,
"coc.source.file.enable": true
}

View File

@@ -1,3 +0,0 @@
require("options")
require("keybinds")
require("lazy-conf")

View File

@@ -1,132 +0,0 @@
local opts = require("utils").opts
local keymap = vim.keymap
-- write to file (sudo if readonly)
if vim.g.vscode then
keymap.set("n", "W", ":Write<CR>", opts("write file (vscode)"))
else
keymap.set("n", "W", ":w!<CR>", opts("write file"))
keymap.set("n", "<leader>W", ":lua require('utils').sudo_write()<CR>", opts("sudo write file"))
end
-- Handy VSCode Shortcuts
-- Move lines up and down
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>', { noremap = true, silent = true })
-- Move lines in insert mode
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
-- Copy lines up and down in normal mode
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .<CR>', { noremap = true, silent = true })
-- Copy lines up and down in insert mode
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-Down>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-k>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-j>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
-- Keep selection in visual mode when indenting
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = true, silent = true })
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = true, silent = true })
-- Save shortcut
keymap.set("i", "<C-s>", "<Esc>:w<CR>a", opts("Save file (shortcut)"))
keymap.set("n", "<C-s>", ":w<CR>", opts("Save file (shortcut)"))
-- Save and quit (sudo and no sudo)
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
keymap.set("n", "<leader>E", ":lua require('utils').sudo_write()<CR>:q!<CR>", opts("sudo write and quit file"))
-- Quite file
keymap.set("n", "Q", ":q!<CR>", opts("quit file"))
-- Duplicate line
keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
-- Editor focus
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
-- Key Mappings for LaTeX workflow
keymap.set('n', '<leader>lc', ':VimtexCompile<CR>', opts("Compile latex document")) -- Compile LaTeX file
keymap.set('n', '<leader>lv', ':VimtexView<CR>', opts("View compiled latex pdf")) -- View compiled PDF
keymap.set('n', '<leader>lq', ':VimtexStop<CR>', opts("Stop Compiling document")) -- Stop compilation
-- Markdown-Preview
keymap.set('n', '<leader><leader>m', ':MarkdownPreview<CR>', opts("Preview Markdown document in browser")) -- Stop compilation
-- window navigation
keymap.set("n", "<A-h>", "<C-w>h", opts())
keymap.set("n", "<A-S-j>", "<C-w>j", opts())
keymap.set("n", "<A-S-k>", "<C-w>k", opts())
keymap.set("n", "<A-l>", "<C-w>l", opts())
-- window resize
keymap.set("n", "<A-C-h>", ":vertical resize -2<CR>", opts())
keymap.set("n", "<A-C-j>", ":resize -2<CR>", opts())
keymap.set("n", "<A-C-k>", ":resize +2<CR>", opts())
keymap.set("n", "<A-C-l>", ":vertical resize +2<CR>", opts())
-- nohlsearch
keymap.set("n", "<leader>h", ":nohlsearch<CR>", opts("remove search highlighting"))
-- run file
keymap.set("n", "<leader>r", ":!%:p<CR>", opts("run current file"))
keymap.set("n", "<leader><leader>r", ":!%:p", opts("run current file with arguments"))
-- chmod +x
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
-- script setup
keymap.set("n", "<leader>#", ":set syntax=sh<CR>:w<CR>:!chmod +x %:p<CR>:LspStart bashls<CR>i#!/bin/sh<CR><CR>", opts("setup sh script"))
keymap.set("n", "<leader><leader>#", ":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>", opts("setup python script"))
-- CTRL + Backspace
keymap.set("i", "<C-BackSpace>", "<C-w>", opts())
-- select all
keymap.set("n", "<leader>a", "ggVG", opts("select all"))
-- move cursor in insert mode
keymap.set("i", "<C-h>", "<Left>", opts())
keymap.set("i", "<C-j>", "<Down>", opts())
keymap.set("i", "<C-k>", "<Up>", opts())
keymap.set("i", "<C-l>", "<Right>", opts())
keymap.set("i", "<C-b>", "<C-Left>", opts("Jump back by word"))
keymap.set("i", "<C-e>", "<C-Right>", opts("Jump back by word"))
keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
-- open in neovide
-- keymap.set("n", "<leader>n", ":!neovide --no-fork %:p<CR>", opts("open in neovide (wip)"))
-- deleting doesn't yank except when used with <leader>
keymap.set({ "n", "v" }, "d", '"_d', opts())
keymap.set({ "n", "v" }, "D", '"_D', opts())
keymap.set({ "n", "v" }, "x", '"_x', opts())
keymap.set({ "n", "v" }, "X", '"_X', opts())
keymap.set({ "n", "v" }, "c", '"_c', opts())
keymap.set({ "n", "v" }, "C", '"_C', opts())
keymap.set({ "n", "v" }, "<leader>d", "d", opts("yank and delete"))
keymap.set({ "n", "v" }, "<leader>D", "D", opts("YANK and DELETE to end"))
-- <leader> + yank/paste/delete uses system clipboard
keymap.set({ "n", "v" }, "<leader>y", '"+y', opts("yank to system clipboard"))
keymap.set({ "n", "v" }, "<leader>Y", '"+y$', opts("YANK to system clipboard"))
keymap.set({ "n", "v" }, "<leader>p", '"+p', opts("paste from system clipboard"))
keymap.set({ "n", "v" }, "<leader>P", '"+P', opts("PASTE from system clipboard"))
keymap.set({ "n", "v" }, "<leader><leader>d", '"+d', opts("yank to system clipboard and delete"))
keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipboard and DELETE"))
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))

View File

@@ -1,26 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins.fm"},
{ import = "plugins.lsp" },
{ import = "plugins.style" },
{ import = "plugins.testing" },
{ import = "plugins.utility" }
},
change_detection = {
notify = false, -- dont notify when plugins are changed
}
})

View File

@@ -1,36 +0,0 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.opt.backspace = "2"
-- title
vim.opt.title = true
vim.opt.titlestring = "nvim - %f"
-- indentation
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.shiftround = true
vim.opt.expandtab = true
vim.opt.breakindent = true
vim.opt.linebreak = true
-- line numbers
vim.wo.number = true
vim.wo.cursorline = true
vim.wo.relativenumber = false
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
-- search options
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- swap and undo directories
vim.opt.undofile = true
vim.opt.undodir = vim.fn.expand("~/.cache/vim/undodir")
vim.opt.directory = vim.fn.expand("~/.cache/vim/swapfiles")
-- add hyprlang filetype
vim.filetype.add({
pattern = { [".*/hypr.*%.conf"] = "hyprlang" },
})

View File

@@ -1,24 +0,0 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup {
sort = {
folders_first = true,
sorter = "name"
},
filters = { custom = { "^.git$" } }
}
vim.keymap.set('n', '<leader>e', ":NvimTreeToggle<CR>", {silent = true, desc = "Open nvim-tree"})
vim.keymap.set('n', '<leader><leader>h', ":NvimTreeCollapseKeepBuffers<CR>", { silent = true, desc = "Collapse nvim-tree keeping open buffers" })
vim.keymap.set('n', '<leader><leader>e', ":NvimTreeFindFile<CR>", {silent = true, desc = "Go to currently open file in buffer or close"})
end,
}

View File

@@ -1,87 +0,0 @@
local actions = require('telescope.actions')
local action_state = require('telescope.actions.state')
-- Custom function for search and replace using Telescope
-- test
function _G.search_and_replace()
local current_file = vim.fn.expand('%:p')
local query = vim.fn.input('Enter search pattern: ')
-- Create the Telescope prompt with custom mappings
require('telescope.builtin').find_files({
prompt_title = 'Search and Replace',
cwd = vim.loop.cwd(),
hidden = true,
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
local selection = action_state.get_selected_entry()
-- Get the replace pattern from user
local replace_query = vim.fn.input('Replace with: ', '')
if not replace_query == '' then
local args = { query, replace_query }
-- Open a terminal buffer to run the search and replace command
require('telescope.builtin').terminal_job({
cmd = {
'sh', '-c',
string.format(
"grep -rl '%s' . | xargs sed -i 's/%s/%s/g'",
table.concat(args, "'"),
query,
replace_query
)
},
cwd = vim.fn.expand('%:p:h'),
})
end
return true
end)
return true
end
})
end
return {
-- fuzzy finder
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local builtin = require("telescope.builtin")
local actions = require("telescope.actions")
local opts = { silent = true }
require("telescope").setup({
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- TODO investigate
},
},
},
})
opts.desc = "telescope find files"
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
opts.desc = "telescope live grep"
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts)
opts.desc = "telescope buffers"
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
opts.desc = "telescope nvim functions"
vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts)
-- Search and replace
end,
}

View File

@@ -1,134 +0,0 @@
return {
"neoclide/coc.nvim",
branch = "release",
config = function()
-- Completion support and diagnostics
vim.cmd("set completeopt=menuone,noinsert,noselect")
-- Diagnostics settings
vim.cmd("set updatetime=300")
vim.cmd('autocmd CursorHold * silent! CocAction("diagnosticRefresh")')
-- Snippet support
vim.g.coc_user_snippets = vim.fn.expand("~/.config/nvim/snippets")
-- Signature help (popup)
vim.cmd('autocmd CursorHold,CursorHoldI * silent! CocAction("showSignatureHelp")')
-- Enable some coc extensions
vim.g.coc_global_extensions = {
"coc-snippets", -- Snippets support
"coc-pyright", -- Python LSP
"coc-tsserver", -- JavaScript/TypeScript LSP
"coc-json", -- JSON LSP
"coc-html", -- HTML LSP
"coc-css", -- CSS LSP
"coc-lua", -- Lua LSP
"coc-diagnostic", -- Diagnostics
"coc-syntax", -- Syntax highlighting
"coc-eslint", -- ESLint (null-ls replacement for JS/TS)
"coc-prettier", -- Prettier formatting
"coc-java",
}
--------------
-- KEYBINDS --
--------------
local keymap = vim.keymap
local opts = { noremap = true, silent = true, desc = "" }
vim.opt.signcolumn = 'yes'
-- LSP actions
opts.desc = "Jump to previous diagnostics"
keymap.set("n", "[d", "<Plug>(coc-diagnostic-prev)", opts)
opts.desc = "Jump to next diagnostics"
keymap.set("n", "]d", "<Plug>(coc-diagnostic-next)", opts)
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>CocAction('editor.action.showReferences')<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", ":CocCommand editor.action.goToDeclaration<CR>", opts)
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>CocAction('editor.action.goToDefinition')<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>CocAction('editor.action.goToImplementation')<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>CocAction('editor.action.goToTypeDefinition')<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", "<cmd>CocAction('editor.action.quickFix')<CR>", opts)
opts.desc = "Format current file"
keymap.set("n", "<leader>gf", "<cmd>CocCommand editor.action.formatDocument<CR>", opts)
opts.desc = "Smart rename"
keymap.set("n", "<leader>n", "<cmd>CocCommand editor.action.rename<CR>", opts)
opts.desc = "Show buffer diagnostics"
keymap.set("n", "ga", "<cmd>CocList diagnostics<CR>", opts)
opts.desc = "Show line diagnostics"
keymap.set("n", "gA", "<cmd>CocAction('diagnostic.showLineDiagnostics')<CR>", opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", "<cmd>CocAction('diagnostic.gotoPrev')<CR>", opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", "<cmd>CocAction('diagnostic.gotoNext')<CR>", opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "<leader>k", "<cmd>CocAction('editor.action.showHover')<CR>", opts)
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", "<cmd>CocRestart<CR>", opts)
-- CMP replacement
-- Mapping for next suggestion
opts.desc = "Next suggestion"
vim.keymap.set("i", "<C-j>", "<Cmd>coc#select_next()<CR>", opts)
-- Mapping for previous suggestion
opts.desc = "Previous suggestion"
vim.keymap.set("i", "<C-k>", "<Cmd>coc#select_prev()<CR>", opts)
-- Mapping for scrolling documentation forward
opts.desc = "Scroll docs forward"
vim.keymap.set("i", "<C-S-j>", "<Cmd>CocScrollFloat -4<CR>", opts)
-- Mapping for scrolling documentation backward
opts.desc = "Scroll docs back"
vim.keymap.set("i", "<C-S-k>", "<Cmd>CocScrollFloat 4<CR>", opts)
-- Mapping to show completion suggestions
opts.desc = "Show completion suggestions"
vim.keymap.set("i", "<C-Space>", "<C-r>=coc#refresh()<CR>", opts)
-- Mapping for Tab key (with snippet expansion and fallback)
opts.desc = "Complete or expand snippet"
keymap.set('i', '<TAB>', 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
-- Mapping for jumping to the next placeholder in snippets
opts.desc = "Jump to next placeholder in snippet"
vim.keymap.set("i", "<C-p>", function()
if vim.fn["coc#snippets#jumpable"]() == 1 then
vim.fnkeys(vim.api.nvim_replace_termcodes("<Tab>", true, true, true), "n")
end
end, opts)
-- Mapping for jumping to the previous placeholder in snippets
opts.desc = "Jump to previous placeholder in snippet"
vim.keymap.set("i", "<C-S-p>", function()
if vim.fn["coc#snippets#jumpable"]() == 1 then
vim.fn["coc#snippets#jump"](-1)
else
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-P>", true, true, true), "n")
end
end, opts)
end,
}

View File

@@ -1,14 +0,0 @@
return {
-- notifications && lsp progress msgs
"j-hui/fidget.nvim",
config = function()
require("fidget").setup({
notification = {
window = {
winblend = 0,
}
}
})
end
}

View File

@@ -1,29 +0,0 @@
return {
-- syntax highlighting
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"c",
"cpp",
"hyprlang",
"java",
"javascript",
"json",
"lua",
"python",
"rust",
"typescript",
"verilog"
},
sync_install = false,
highlight = {
enable = true,
disable = { "tex" }
},
})
end,
}

View File

@@ -1,64 +0,0 @@
return {
-- tab line
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
local bufferline = require("bufferline")
bufferline.setup({
options = {
mode = "buffers",
show_buffer_close_icons = false,
middle_mouse_command = "bdelete! %d",
indicator = { style = "underline" },
offsets = {
{
filetype = "NvimTree",
text = " ",
text_align = "center",
separator = true,
},
},
separator_style = { " ", " " },
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local icon = level:match("error") and "󰅚 " or "󰀪 "
return icon .. count
end,
},
})
local opts = { silent = true }
-- go to buffer
opts.desc = "go to buffer 1"
vim.keymap.set("n", "g1", "<Cmd>BufferLineGoToBuffer 1<CR>", opts)
opts.desc = "go to buffer 2"
vim.keymap.set("n", "g2", "<Cmd>BufferLineGoToBuffer 2<CR>", opts)
opts.desc = "go to buffer 3"
vim.keymap.set("n", "g3", "<Cmd>BufferLineGoToBuffer 3<CR>", opts)
opts.desc = "go to buffer 4"
vim.keymap.set("n", "g4", "<Cmd>BufferLineGoToBuffer 4<CR>", opts)
opts.desc = "go to buffer 5"
vim.keymap.set("n", "g5", "<Cmd>BufferLineGoToBuffer 5<CR>", opts)
opts.desc = "go to buffer 6"
vim.keymap.set("n", "g6", "<Cmd>BufferLineGoToBuffer 6<CR>", opts)
opts.desc = "go to buffer 7"
vim.keymap.set("n", "g7", "<Cmd>BufferLineGoToBuffer 7<CR>", opts)
opts.desc = "go to buffer 8"
vim.keymap.set("n", "g8", "<Cmd>BufferLineGoToBuffer 8<CR>", opts)
opts.desc = "go to buffer 9"
vim.keymap.set("n", "g9", "<Cmd>BufferLineGoToBuffer 9<CR>", opts)
opts.desc = "go to buffer 10"
vim.keymap.set("n", "g0", "<Cmd>BufferLineGoToBuffer 10<CR>", opts)
opts.desc = nil
-- cycle between buffers
vim.keymap.set("n", "J", "<cmd>BufferLineCyclePrev<CR>", opts)
vim.keymap.set("n", "K", "<cmd>BufferLineCycleNext<CR>", opts)
-- move buffers
vim.keymap.set("n", "<C-S-J>", "<cmd>BufferLineMovePrev<CR>", opts)
vim.keymap.set("n", "<C-S-K>", "<cmd>BufferLineMoveNext<CR>", opts)
-- go to previous buffer
vim.keymap.set({ "n", "i" }, "<C-Tab>", "<cmd>b#<CR>", opts)
end,
}

View File

@@ -1,34 +0,0 @@
return {
-- colorizes colors in code
'NvChad/nvim-colorizer.lua' ,
--cmd = 'ColorizerToggle',
config = function ()
require("colorizer").setup {
filetypes = { "*" },
user_default_options = {
RGB = true, -- #RGB hex codes - #FCE
RRGGBB = true, -- #RRGGBB hex codes - #F5C2E7
names = true, -- "Name" codes - lightpink
RRGGBBAA = true, -- #RRGGBBAA hex codes - #F5C2E7CC
AARRGGBB = true, -- 0xAARRGGBB hex codes - 0xCCF5C2E7
rgb_fn = true, -- CSS rgb() and rgba() functions - rgba(245,194,231,0.8)
hsl_fn = true, -- CSS hsl() and hsla() functions - hsl(0.88,0.72,0.86)
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
virtualtext = "",
-- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs
always_update = false
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
}
end,
}

View File

@@ -1,139 +0,0 @@
return {
-- color theme
"EdenEast/nightfox.nvim",
lazy = false,
priority = 1000,
config = function()
local Shade = require("nightfox.lib.shade")
require("nightfox").setup({
options = {
transparent = true,
styles = {
comments = "italic",
functions = "italic",
keywords = "italic",
types = "italic",
}
},
palettes = {
all = {
black = Shade.new("#404944", 0.15, -0.15),
gray = Shade.new("#505050", 0.15, -0.15),
white = Shade.new("#dee4df", 0.15, -0.15),
red = Shade.new("#ff6060", 0.15, -0.15),
darkred = Shade.new("#903030", 0.15, -0.15),
strongred = Shade.new("#bb0000", 0.15, -0.15),
orange = Shade.new("#ce8c14", 0.15, -0.15),
green = Shade.new("#a3d397", 0.10, -0.15),
darkgreen = Shade.new("#005602", 0.10, -0.15),
darkyellow = Shade.new("#dfd100", 0.10, -0.15),
yellow = Shade.new("#e3c46d", 0.15, -0.15),
darkblue = Shade.new("#1010aa", 0.15, -0.15),
blue = Shade.new("#7070dd", 0.15, -0.15),
magenta = Shade.new("#C02490", 0.30, -0.15),
pink = Shade.new("#ff82c2", 0.15, -0.15),
purple = Shade.new("#761464", 0.15, -0.15),
cyan = Shade.new("#7ac9ff", 0.15, -0.15),
lightblue = Shade.new("#5c77ff", 0.15, -0.15),
softblue = Shade.new("#10ddff", 0.15, -0.15),
brown = Shade.new("#553200", 0.15, -0.15),
bg0 = "#0f1512", -- Dark bg (status line and float)
bg1 = "#0f1512", -- Default bg
bg2 = "#1b211e", -- Lighter bg (colorcolm folds)
bg3 = "#252b28", -- Lighter bg (cursor line)
bg4 = "#303633", -- Conceal, border fg
fg0 = "#dee4df", -- Lighter fg
fg1 = "#dee4df", -- Default fg
fg2 = "#dee4df", -- Darker fg (status line)
fg3 = "#89938d", -- Darker fg (line numbers, fold colums)
sel0 = "#404944", -- Popup bg, visual selection
sel1 = "#00513b", -- Popup sel bg, search bg
comment = "#89938d",
},
},
specs = {
carbonfox = {
syntax = {
comment = "comment",
bracket = "darkyellow",
builtin0 = "softblue",
builtin1 = "sel0",
builtin2 = "sel1",
conditional = "darkblue",
const = "gray",
dep = "darkred",
field = "green",
func = "pink",
ident = "darkgreen",
keyword = "blue",
number = "yellow",
operator = "white",
preproc = "strongred",
regex = "purple",
statement = "magenta",
string = "cyan",
type = "red",
variable = "orange"
},
diag = {
error = "darkred",
warn = "yellow",
info = "lightblue",
hint = "fg3",
ok = "darkgreen",
},
diag_bg = {
error = "red",
warn = "#a16b00",
info = "cyan",
hint = "bg3",
ok = "green";
},
diff = {
add = "darkgreen",
delete = "darkred",
changed = "lightblue",
text = "fg0"
},
git = {
add = "darkgreen",
removed = "darkred",
changed = "lightblue",
conflict = "orange",
ignored = "gray"
}
}
},
groups = {
all = {
Cursor = { fg = "palette.white", bg = "palette.lightblue" }, -- character under the cursor
WinSeparator = { fg = "palette.bg2" }, -- the column separating vertically split windows
EndOfBuffer = { link = "WinSeparator" }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
CursorLine = { bg = "palette.bg1" },
CursorLineNr = { fg = "palette.cyan", style = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
Search = { fg = "palette.lightblue", bg = "#00513b" }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
IncSearch = { fg = "palette.lightblue", bg = "#1a6b51" }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
ModeMsg = { fg = "palette.fg3", style = "bold" }, -- 'showmode' message (e.g., "-- INSERT --")
NvimTreeRootFolder = { fg = "palette.lightblue", style = "bold" },
NvimTreeFolderName = { fg = "palette.lightblue" },
NvimTreeFolderIcon = { fg = "palette.lightblue" },
NvimTreeOpenedFolderName = { fg = "palette.lightblue" },
NvimTreeSymlinkFolderName = { fg = "palette.magenta" },
NvimTreeExecFile = { fg = "palette.red" },
NvimTreeImageFile = { fg = "palette.white" },
NvimTreeSpecialFile = { fg = "palette.yellow" },
NvimTreeSymlink = { fg = "palette.magenta" },
},
},
})
if not vim.g.vscode then
vim.cmd([[colorscheme carbonfox]])
end
end,
}

View File

@@ -1,5 +0,0 @@
return {
-- prettier prompts
'stevearc/dressing.nvim',
event = 'VeryLazy',
}

View File

@@ -1,55 +0,0 @@
return {
-- status line
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local function getWords()
local wc = vim.api.nvim_eval("wordcount()")
if wc["visual_words"] then
return wc["visual_words"]
else
return wc["words"]
end
end
require('lualine').setup {
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = { 'NvimTree' },
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = { { 'mode', separator = { left = '', right = '' }, } },
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = { getWords, 'encoding', 'fileformat', 'filetype'},
lualine_y = { { 'progress', left_padding=0 } },
lualine_z = { { 'location', separator = { left = '', right = '' }, padding=0} }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
end,
}

View File

@@ -1,77 +0,0 @@
return {
"startup-nvim/startup.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-file-browser.nvim",
},
config = function()
require("startup").setup({
title = {
type = "text",
align = "center",
content = {
[[]],
[[]],
[[]],
[[ ]],
[[ ██████ █████ █████ █████ ███ ]],
[[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]],
[[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]],
[[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]],
[[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]],
[[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]],
[[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]],
[[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]],
[[ ]],
},
highlight = "String",
default_color = "#010155"
},
quotes = {
type = "text",
align = "center",
content = function ()
local handle = io.popen("pwd")
if handle then
local cwd = handle:read("*l")
handle:close()
return {"Currently in " .. cwd}
else
return {"Error running command"}
end
end,
highlight = "String",
default_color = "#FFFFFF"
},
old = {
type = "oldfiles",
oldfiles_directory = true,
align = "center",
title = "Old files",
oldfiles_amount = 10,
highlight = "String",
default_color = "#FFFFFF",
content = "",
},
options = {
mapping_keys = false;
},
colors = {
background = "#000000",
folded_section = "#100000"
},
mappings = {
execute_command = "<C-r>",
open_file = "<CR>",
},
parts = {"title", "quotes", "old"}
})
end,
}

View File

@@ -1,103 +0,0 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
{ "nvim-neotest/nvim-nio" },
{ "rcarriga/nvim-dap-ui" },
{ "theHamsta/nvim-dap-virtual-text" },
{ "nvim-telescope/telescope-dap.nvim" },
},
-- stylua: ignore
keys = {
{ "<leader>bR", function() require("dap").run_to_cursor() end, desc = "Run to Cursor", },
{ "<leader>bE", function() require("dapui").eval(vim.fn.input "[Expression] > ") end, desc = "Evaluate Input", },
{ "<leader>bC", function() require("dap").set_breakpoint(vim.fn.input "[Condition] > ") end, desc = "Conditional Breakpoint", },
{ "<leader>bU", function() require("dapui").toggle() end, desc = "Toggle UI", },
{ "<leader>bb", function() require("dap").step_back() end, desc = "Step Back", },
{ "<leader>bc", function() require("dap").continue() end, desc = "Continue", },
{ "<leader>bd", function() require("dap").disconnect() end, desc = "Disconnect", },
{ "<leader>be", function() require("dapui").eval() end, desc = "Evaluate", },
{ "<leader>bg", function() require("dap").session() end, desc = "Get Session", },
{ "<leader>bh", function() require("dap.ui.widgets").hover() end, desc = "Hover Variables", },
{ "<leader>bS", function() require("dap.ui.widgets").scopes() end, desc = "Scopes", },
{ "<leader>bi", function() require("dap").step_into() end, desc = "Step Into", },
{ "<leader>bo", function() require("dap").step_over() end, desc = "Step Over", },
{ "<leader>bp", function() require("dap").pause.toggle() end, desc = "Pause", },
{ "<leader>bq", function() require("dap").close() end, desc = "Quit", },
{ "<leader>br", function() require("dap").repl.toggle() end, desc = "Toggle REPL", },
{ "<leader>bs", function() require("dap").continue() end, desc = "Start", },
{ "<leader>bt", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint", },
{ "<leader>bx", function() require("dap").terminate() end, desc = "Terminate", },
{ "<leader>bu", function() require("dap").step_out() end, desc = "Step Out", },
},
config = function()
require("nvim-dap-virtual-text").setup({
commented = true,
})
local dap, dapui = require("dap"), require("dapui")
dapui.setup({})
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = ""})
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = ""})
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}", -- This configuration will launch the current file if used.
pythonPath = function()
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
return cwd .. "/venv/bin/python"
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
return cwd .. "/.venv/bin/python"
else
return "/usr/bin/python"
end
end,
},
}
dap.adapters.python = function(cb, config)
if config.request == "attach" then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or "127.0.0.1"
cb({
type = "server",
port = assert(port, "`connect.port` is required for a python `attach` configuration"),
host = host,
options = {
source_filetype = "python",
},
})
else
cb({
type = "executable",
command = vim.fn.stdpath("data") .. '/mason/packages/debugpy/venv/bin/python',
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",
},
})
end
end
end,
}

View File

@@ -1,70 +0,0 @@
-- plugins/neotest_config.lua
return {
-- Load neotest
{
"nvim-neotest/neotest",
dependencies = {
-- For JavaScript, TypeScript (Vite)
"marilari88/neotest-vitest",
-- For Python
"nvim-neotest/neotest-python",
-- For C, C++, Rust
"orjangj/neotest-ctest",
"rouge8/neotest-rust",
},
config = function()
local neotest = require("neotest")
local keymap = vim.keymap.set
-- General setup for neotest
neotest.setup({
adapters = {
-- Vite Adapter for JavaScript/TypeScript
require("neotest-vitest"),
-- Python Adapter
require("neotest-python"),
-- C/C++ Adapter
require("neotest-ctest"),
-- Rust Adapter
require("neotest-rust"),
},
})
-- Keybinding Setup
local opts = { noremap = true, silent = true }
-- Run nearest test
opts.desc = "Run nearest test"
keymap("n", "<leader><leader>tr", '<cmd>lua require("neotest").run.run()<cr>', opts)
-- Run all tests in the current file
opts.desc = "Run all tests in current file"
keymap("n", "<leader><leader>tf", '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))', opts)
-- Run all tests in the entire project
opts.desc = "Run all tests in project"
keymap("n", "<leader><leader>ta", "<cmd>Neotest run<cr>", opts)
-- Stop running tests
opts.desc = "Stop tests"
keymap("n", "<leader><leader>ts", "<cmd>Neotest stop<cr>", opts)
opts.desc = "Jump to next test"
keymap("n", "<leader><leader>tn", "<cmd>Neotest jump next<cr>", opts)
opts.desc = "Jump to previous test"
keymap("n", "<leader><leader>tp", "<cmd>Neotest jump prev<cr>", opts)
-- Show test summary
opts.desc = "Show neotest test summary"
keymap("n", "<leader><leader>tv", "<cmd>Neotest summary<cr>", opts)
-- Toggle the Neotest panel
opts.desc = "Show neotest output"
keymap("n", "<leader><leader>to", "<cmd>Neotest output<cr>", opts)
opts.desc = "Show neotest output as panel"
keymap("n", "<leader><leader>tn", "<cmd>Neotest output-panel<cr>", opts)
end,
},
}

View File

@@ -1,65 +0,0 @@
return {
-- autoclose brackets and quotes
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({
fast_wrap = {
map = "<C-e>",
chars = { "{", "[", "(", '"', "'", "`" },
},
})
-- add spaces between parentheses
local npairs = require("nvim-autopairs")
local Rule = require("nvim-autopairs.rule")
local cond = require("nvim-autopairs.conds")
local brackets = { { "(", ")" }, { "[", "]" }, { "{", "}" } }
npairs.add_rules({
-- Rule for a pair with left-side ' ' and right side ' '
Rule(" ", " ")
-- Pair will only occur if the conditional function returns true
:with_pair(function(opts)
-- We are checking if we are inserting a space in (), [], or {}
local pair = opts.line:sub(opts.col - 1, opts.col)
return vim.tbl_contains({
brackets[1][1] .. brackets[1][2],
brackets[2][1] .. brackets[2][2],
brackets[3][1] .. brackets[3][2],
}, pair)
end)
:with_move(cond.none())
:with_cr(cond.none())
-- We only want to delete the pair of spaces when the cursor is as such: ( | )
:with_del(
function(opts)
local col = vim.api.nvim_win_get_cursor(0)[2]
local context = opts.line:sub(col - 1, col + 2)
return vim.tbl_contains({
brackets[1][1] .. " " .. brackets[1][2],
brackets[2][1] .. " " .. brackets[2][2],
brackets[3][1] .. " " .. brackets[3][2],
}, context)
end
),
})
-- For each pair of brackets we will add another rule
for _, bracket in pairs(brackets) do
npairs.add_rules({
-- Each of these rules is for a pair with left-side '( ' and right-side ' )' for each bracket type
Rule(bracket[1] .. " ", " " .. bracket[2])
:with_pair(cond.none())
:with_move(function(opts)
return opts.char == bracket[2]
end)
:with_del(cond.none())
:use_key(bracket[2])
-- Removes the trailing whitespace that can occur without this
:replace_map_cr(function(_)
return "<C-c>2xi<CR><C-c>O"
end),
})
end
end,
}

View File

@@ -1,9 +0,0 @@
return {
-- delete a buffer
'famiu/bufdelete.nvim',
config = function()
local map = vim.api.nvim_set_keymap
map('n', '<C-w>', '<cmd>Bdelete<CR>', { silent = true, desc = "close current buffer" })
end
}

View File

@@ -1,61 +0,0 @@
return {
"LudoPinelli/comment-box.nvim",
config = function()
-- add custom commentstring to plugin source, since configuration is not yet supported
local function insertlang(lang, commentstring)
local filename = os.getenv("HOME")
.. "/.local/share/nvim/lazy/comment-box.nvim/lua/comment-box/commentstrings.lua"
local file = io.open(filename, "r")
if not file then
return
end
local content = file:read("a")
if string.match(content, lang) then
return
end
local lines = {}
for line in content:gmatch("[^\r\n]+") do
table.insert(lines, line)
end
file:close()
table.insert(lines, 24, " " .. lang .. ' = { "' .. commentstring .. '", "" },')
file = io.open(filename, "w")
if not file then
return
end
file:write(table.concat(lines, "\n"))
file:close()
end
insertlang("hyprlang", "#%s")
require("comment-box").setup({
comment_style = "line",
doc_width = 70,
box_width = 50,
line_width = 70,
})
local opts = { silent = true }
opts.desc = "comment text box"
vim.keymap.set({"n", "v"}, "<leader>cb", ":CBccbox<CR>", opts)
opts.desc = "comment text line"
vim.keymap.set({"n", "v"}, "<leader>cl", ":CBllline<CR>", opts)
opts.desc = "comment line"
vim.keymap.set({"n", "v"}, "<leader>ce", ":CBline<CR>", opts)
opts.desc = "comment highlight"
vim.keymap.set({"n", "v"}, "<leader>ch", ":CBlcbox18<CR>", opts)
opts.desc = "delete comment box"
vim.keymap.set({"n", "v"}, "<leader>cd", ":CBd<CR>", opts)
opts.desc = "yank comment box contents"
vim.keymap.set({"n", "v"}, "<leader>cy", ":CBy<CR>", opts)
end,
}

View File

@@ -1,10 +0,0 @@
return {
-- add comment keybinds
'numToStr/Comment.nvim',
opts = {},
lazy = false,
config = function()
require('Comment').setup()
require('Comment.ft').set('hyprlang', '#%s')
end
}

View File

@@ -1,4 +0,0 @@
return {
-- similar to sticky scroll in vscode
"nvim-treesitter/nvim-treesitter-context",
}

View File

@@ -1,12 +0,0 @@
return {
"kikofmas/grammarous.nvim",
config = function ()
local keymap = vim.keymap
local opts = require('utils').opts
keymap.set('n', '<leader>sl', ':GrammarousCheck<CR>', opts('LanguageTool Spell Checker'))
keymap.set('n', '<leader>sc', ':GrammarousCheck --comments-only<CR>', opts('LanguageTool Spell Checker, only comments'))
keymap.set('n', '<leader>ss', ':set spell<CR>', opts('Start built-in spell checker'))
keymap.set('n', '<leader>sn', ':set nospell<CR>', opts('Stop spell checker'))
end
}

View File

@@ -1,9 +0,0 @@
return {
-- indent lines
'lukas-reineke/indent-blankline.nvim',
opts = {},
main = 'ibl',
config = function()
require('ibl').setup()
end
}

View File

@@ -1,7 +0,0 @@
return {
-- open file at previous position
'ethanholz/nvim-lastplace',
config = function()
require('nvim-lastplace').setup{}
end,
}

View File

@@ -1,17 +0,0 @@
return {
-- literally the name, previews md in browser
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable "npx" then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd [[Lazy load markdown-preview.nvim]]
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
end,
}

View File

@@ -1,17 +0,0 @@
return {
"smoka7/multicursors.nvim",
event = "VeryLazy",
dependencies = {
'nvimtools/hydra.nvim',
},
opts = {},
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
keys = {
{
mode = { 'v', 'n' },
'<leader><leader>c',
'<cmd>MCstart<cr>',
desc = 'Create a selection for selected text or word under the cursor',
},
},
}

View File

@@ -1,146 +0,0 @@
return {
"SmiteshP/nvim-navbuddy",
dependencies = {
"SmiteshP/nvim-navic",
"MunifTanjim/nui.nvim",
},
opts = { lsp = { auto_attach = true } },
config = function()
local actions = require("nvim-navbuddy.actions")
require("nvim-navbuddy").setup({
window = {
border = "rounded", -- "rounded", "double", "solid", "none"
-- or an array with eight chars building up the border in a clockwise fashion
-- starting with the top-left corner. eg: { "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" }.
size = "60%", -- Or table format example: { height = "40%", width = "100%"}
position = "50%", -- Or table format example: { row = "100%", col = "0%"}
scrolloff = nil, -- scrolloff value within navbuddy window
sections = {
left = {
size = "20%",
border = nil, -- You can set border style for each section individually as well.
},
mid = {
size = "40%",
border = nil,
},
right = {
-- No size option for right most section. It fills to
-- remaining area.
border = nil,
preview = "leaf", -- Right section can show previews too.
-- Options: "leaf", "always" or "never"
},
},
},
node_markers = {
enabled = true,
icons = {
leaf = " ",
leaf_selected = "",
branch = "",
},
},
icons = {
File = "󰈙 ",
Module = "",
Namespace = "󰌗 ",
Package = "",
Class = "󰌗 ",
Method = "󰆧 ",
Property = "",
Field = "",
Constructor = "",
Enum = "󰕘",
Interface = "󰕘",
Function = "󰊕 ",
Variable = "󰆧 ",
Constant = "󰏿 ",
String = "",
Number = "󰎠 ",
Boolean = "",
Array = "󰅪 ",
Object = "󰅩 ",
Key = "󰌋 ",
Null = "󰟢 ",
EnumMember = "",
Struct = "󰌗 ",
Event = "",
Operator = "󰆕 ",
TypeParameter = "󰊄 ",
},
use_default_mappings = true, -- If set to false, only mappings set
-- by user are set. Else default
-- mappings are used for keys
-- that are not set by user
mappings = {
["<esc>"] = actions.close(), -- Close and cursor to original location
["q"] = actions.close(),
["j"] = actions.next_sibling(), -- down
["k"] = actions.previous_sibling(), -- up
["h"] = actions.parent(), -- Move to left panel
["l"] = actions.children(), -- Move to right panel
["0"] = actions.root(), -- Move to first panel
["<C-S-v>"] = actions.visual_name(), -- Visual selection of name
["<C-S-V>"] = actions.visual_scope(), -- Visual selection of scope
["y"] = actions.yank_name(), -- Yank the name to system clipboard "+
["Y"] = actions.yank_scope(), -- Yank the scope to system clipboard "+
["i"] = actions.insert_name(), -- Insert at start of name
["I"] = actions.insert_scope(), -- Insert at start of scope
["a"] = actions.append_name(), -- Insert at end of name
["A"] = actions.append_scope(), -- Insert at end of scope
["r"] = actions.rename(), -- Rename currently focused symbol
["d"] = actions.delete(), -- Delete scope
["f"] = actions.fold_create(), -- Create fold of current scope
["F"] = actions.fold_delete(), -- Delete fold of current scope
["c"] = actions.comment(), -- Comment out current scope
["<enter>"] = actions.select(), -- Goto selected symbol
["o"] = actions.select(),
["J"] = actions.move_down(), -- Move focused node down
["K"] = actions.move_up(), -- Move focused node up
["s"] = actions.toggle_preview(), -- Show preview of current node
["<C-v>"] = actions.vsplit(), -- Open selected node in a vertical split
["<C-s>"] = actions.hsplit(), -- Open selected node in a horizontal split
["t"] = actions.telescope({ -- Fuzzy finder at current level.
layout_config = { -- All options that can be
height = 0.60, -- passed to telescope.nvim's
width = 0.60, -- default can be passed here.
prompt_position = "top",
preview_width = 0.50,
},
layout_strategy = "horizontal",
}),
["g?"] = actions.help(), -- Open mappings help window
},
lsp = {
auto_attach = true, -- If set to true, you don't need to manually use attach function
preference = nil, -- list of lsp server names in order of preference
},
source_buffer = {
follow_node = true, -- Keep the current node in focus on the source buffer
highlight = true, -- Highlight the currently focused node
reorient = "smart", -- "smart", "top", "mid" or "none"
scrolloff = nil, -- scrolloff value when navbuddy is open
},
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
})
vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
end,
}

View File

@@ -1,8 +0,0 @@
return {
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
config = function()
require("nvim-surround").setup()
end
}

View File

@@ -1,17 +0,0 @@
return {
-- literally the name, quick term toggle
"akinsho/toggleterm.nvim",
version = "*",
config = function()
require("toggleterm").setup({
insert_mappings = false,
terminal_mappings = false,
open_mapping = "<leader>t",
direction = "float",
float_opts = {
border = "curved",
},
})
vim.keymap.set("t", "<S-Esc>", [[<cmd>ToggleTerm<CR>]], {}) -- close terminal wih esc
end,
}

View File

@@ -1,15 +0,0 @@
return {
"lervag/vimtex",
config = function()
-- vimtex settings
-- vim.g.vimtex_view_method = 'startup' -- PDF viewer (example: zathura, or use 'skim' for macOS)
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for compilation
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
-- Key Mappings for LaTeX workflow
vim.api.nvim_set_keymap('n', '<leader>lc', ':VimtexCompile<CR>', {}) -- Compile LaTeX file
vim.api.nvim_set_keymap('n', '<leader>lv', ':VimtexView<CR>', {}) -- View compiled PDF
vim.api.nvim_set_keymap('n', '<leader>lq', ':VimtexStop<CR>', {}) -- Stop compilation
end
}

View File

@@ -1,12 +0,0 @@
return {
-- keybinds popup
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {
}
}

View File

@@ -1,14 +0,0 @@
return {
-- view buffer w/o distractions
"folke/zen-mode.nvim",
config = function()
require("zen-mode").setup({
window = {
width = 1,
height = 1,
},
})
vim.keymap.set("n", "<leader>z", ":ZenMode<CR>", { silent = true, desc = "open current buffer in zen mode" })
end,
}

View File

@@ -1,55 +0,0 @@
-- taken from https://github.com/ibhagwan/nvim-lua
local M = {}
M.opts = function(desc)
if desc then
return { silent = true, desc = desc}
else
return { silent = true }
end
end
M.sudo_exec = function(cmd, print_output)
vim.fn.inputsave()
local password = vim.fn.inputsecret("Password: ")
vim.fn.inputrestore()
if not password or #password == 0 then
print("Invalid password, sudo aborted")
return false
end
local out = vim.fn.system(string.format("sudo -p '' -S %s", cmd), password)
if vim.v.shell_error ~= 0 then
print("\r\n")
print(out)
return false
end
if print_output then print("\r\n", out) end
return true
end
M.sudo_write = function(tmpfile, filepath)
if not tmpfile then tmpfile = vim.fn.tempname() end
if not filepath then filepath = vim.fn.expand("%") end
if not filepath or #filepath == 0 then
print("E32: No file name")
return
end
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd
-- Both `bs=1M` and `bs=1m` are non-POSIX
local cmd = string.format("dd if=%s of=%s bs=1048576",
vim.fn.shellescape(tmpfile),
vim.fn.shellescape(filepath))
-- no need to check error as this fails the entire function
vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
if M.sudo_exec(cmd) then
-- refreshes the buffer and prints the "written" message
vim.cmd.checktime()
-- exit command mode
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(
"<Esc>", true, false, true), "n", true)
end
vim.fn.delete(tmpfile)
end
return M

View File

@@ -1,30 +0,0 @@
{
"name": "janishutz-snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": "all",
"path": "./snippets/docSetup.json"
},
{
"language": "tex",
"path": "./snippets/tex.json"
},
{
"language": "javascript",
"path": "./snippets/javascript.json"
},
{
"language": "typescript",
"path": "./snippets/typescript.json"
},
{
"language": "vue",
"path": "./snippets/vue.json"
}
]
}
}

View File

@@ -1,6 +0,0 @@
{
"docTitle": {
"prefix": "prepareDoc",
"body": "$BLOCK_COMMENT_START\n*\t\t\t\t$WORKSPACE_NAME - $TM_FILENAME\n*\n*\tCreated by Janis Hutz $CURRENT_MONTH/$CURRENT_DATE/$CURRENT_YEAR, Licensed under ${1|the GPL V3,the MIT,a proprietary,the BSD,the LGPL V3,the Apache|} License\n*\t\t\thttps://janishutz.com, development@janishutz.com\n*\n*\n$BLOCK_COMMENT_END"
}
}

View File

@@ -1,45 +0,0 @@
{
"impress": {
"prefix": "impress",
"body": [
"<!DOCTYPE html>",
"<html>",
"\t<head>\n\t\t<title>$1</title>\n\t\t<link rel=\"stylesheet\" href=\"style.css\">\n\t</head>",
"\t<body class=\"impress-not-supported\">",
"\t\t<div class=\"fallback-message\">\n\t\t\t<p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>\n\t\t\t<p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>\n\t\t</div>",
"\t\t<div id=\"impress\" data-width=\"1920\" data-height=\"1080\">",
"\t\t\t<div id=\"title\" class=\"step\">\n\t\t\t\t<div class=\"content\">",
"\t\t\t\t\t<h1>$2</h1>\n\t\t\t\t</div>",
"\t\t\t</div>\n\t\t</div>",
"\n\t\t<script src=\"https://cdn.jsdelivr.net/gh/impress/impress.js@2.0.0/js/impress.js\">\n\t\t</script><script>impress().init()</script>\n\t</body>",
"</html>"
]
},
"impress-step": {
"prefix": "impressStep",
"body": [
"\n<div id=\"$1\" class=\"step\">",
"\t<div class=\"content\">",
"\t\t<h2>$2</h2>\n\t</div>",
"</div>\n"
]
},
"html-basic": {
"prefix": "basic",
"body": [
"<!DOCTYPE html>",
"<html>",
"\t<head>\n\t\t<title>$1</title>\n\t\t<link rel=\"stylesheet\" href=\"/css/style.css\">\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"description\" content=\"$2\">\n\t</head>",
"\t<body>\n\t\t<h1>$3</h1>",
"\t</body>\n</html>"
]
},
"impress-notes": {
"prefix": "impressNotes",
"body": "<div class=\"notes\">\n\t$1\n</div>"
},
"impress-substep": {
"prefix": "impressSubstep",
"body": "<div class=\"substep\">\n\t$1\n</div>"
}
}

View File

@@ -1,93 +0,0 @@
{
"JS-Class": {
"prefix": "jsSetupClass",
"body": "class $1 { \n\tconstructor () {} \n\n \t$2 () {\n\t$3\n\t}\n}",
"description": "Setup the basic structure of a class in JS"
},
"ExpressJS": {
"prefix": "jsExpressSetup",
"body": [
"const express = require( 'express' );",
"let app = express();",
"const path = require( 'path' );",
"const expressSession = require( 'express-session' );",
"const fs = require( 'fs' );",
"const bodyParser = require( 'body-parser' );",
"const cookieParser = require( 'cookie-parser' )",
"const favicon = require( 'serve-favicon' );",
"\napp.use( expressSession ( {\n\tsecret: $1,\n\tresave: true,\n\tsaveUninitialized: true\n} ) );",
"app.use( bodyParser.urlencoded( { extended: false } ) );",
"app.use( bodyParser.json() );",
"app.use( cookieParser() );",
"app.use( favicon( path.join( __dirname + '$2' ) ) );\n",
"app.use( ( request, response, next ) => {\n\tresponse.sendFile( path.join( __dirname + '$3' ) ) \n} );",
"\n\napp.get( '/', ( request, response ) => {\n$4\n} );",
"\n\nconst PORT = process.env.PORT || 8080;",
"http.createServer( app ).listen( PORT );"
]
},
"ExpressJS-Route": {
"prefix": "jsEjsRoute",
"body": "\n\napp.get( '$1', ( request, response ) => {\n$4\n} );"
},
"JSAsync": {
"prefix": "jsAsync",
"body": "(async () => {\n$1\n} ) ();"
},
"JSpromiseReturnFunc": {
"prefix": "jsPromise",
"body": "function $1 () {\n\treturn new Promise( ( resolve, reject ) => {\n\t$2\n\t} );\n}"
},
"fetch from other url": {
"prefix": "remoteURL",
"body": [
"localStorage.getItem( 'url' ) + '/$1'"
],
"description": "remote URL fetching (get from base address from local storage)"
},
"fetch post": {
"prefix": "fetchPost",
"body": [
"const fetchOptions = {",
"\tmethod: 'post',",
"\tbody: JSON.stringify( $1 ),",
"\tcredentials: 'include',",
"\theaders: {",
"\t\t'Content-Type': 'application/json',",
"\t\t'charset': 'utf-8'",
"\t}",
"};",
"fetch( $2, fetchOptions ).then( res => {",
"\tif ( res.status === 200 ) {",
"\t\tres.json().then( json => {",
"\t\t\t$3",
"\t\t} );",
"\t}",
"} );",
"$4"
],
"description": "POST request using fetch"
},
"fetch get": {
"prefix": "fetchGet",
"body": [
"fetch( $2, { credentials: 'include' } ).then( res => {",
"\tif ( res.status === 200 ) {",
"\t\tres.json().then( json => {",
"\t\t\t$3",
"\t\t} );",
"\t}",
"} );",
"$4"
],
"description": "POST request using fetch"
},
"promise": {
"prefix": "promise",
"body": [
"return new Promise( ( resolve, reject ) => {",
"\t",
"} );"
]
}
}

View File

@@ -1,420 +0,0 @@
{
"prepare LaTeX Document": {
"prefix": "latex-prepare",
"body": [
"\\documentclass{article}\n",
"\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{recommended}\n",
"\\setup{$1}\n",
"\\begin{document}",
"\\startDocument",
"\\usetcolorboxes",
"$2\n\n",
"\\end{document}"
],
"description": "Prepares a full LaTeX Document for use and compiling"
},
"Fancy table": {
"prefix": "table",
"body": [
"\\begin{tables}{$1}{$2}\n",
"\t$3\\\\",
"\\end{tables}"
],
"description": "Insert a table (without environment)"
},
"Formula": {
"prefix": "formula",
"body": [
"\\begin{formula}[]{$1}",
"\t$2",
"\\end{formula}"
],
"description": "Inserts a tcolorbox to provide a formula (red)"
},
"Definition": {
"prefix": "definition",
"body": [
"\\begin{definition}[]{$1}",
"\t$2",
"\\end{definition}"
],
"description": "Inserts a tcolorbox to provide a definition (blue)"
},
"Recall": {
"prefix": "recall",
"body": [
"\\begin{recall}[]{$1}",
"\t$2",
"\\end{recall}"
],
"description": "Inserts a tcolorbox to provide a recall / revision of previous knowledge (yellow)"
},
"Important Remarks": {
"prefix": "remarks",
"body": [
"\\begin{remarks}[]{$1}",
"\t$2",
"\\end{remarks}"
],
"description": "Inserts a tcolorbox to provide remarks (green)"
},
"Guides": {
"prefix": "guides",
"body": [
"\\begin{guides}[]{$1}{${2:Usage}}",
"\t$2",
"\\end{guides}"
],
"description": "Inserts a tcolorbox to provide guides / instructions on how to use (red)"
},
"Properties": {
"prefix": "properties",
"body": [
"\\begin{properties}[]{$1}",
"\t$2",
"\\end{properties}"
],
"description": "Inserts a tcolorbox to inform about properties"
},
"Restrictions": {
"prefix": "restrictions",
"body": [
"\\begin{restrictions}[]{$1}",
"\t$2",
"\\end{restrictions}"
],
"description": "Inserts a tcolorbox to inform about restrictions"
},
"Limitations": {
"prefix": "limitations",
"body": [
"\\begin{limitations}[]{$1}",
"\t$2",
"\\end{limitations}"
],
"description": "Inserts a tcolorbox to inform about limitations"
},
"Theorem": {
"prefix": "theorem",
"body": [
"\\begin{theorem}[]{$1}",
"\t$2",
"\\end{theorem}"
],
"description": "Inserts a tcolorbox to inform about theorems"
},
"Lemma": {
"prefix": "lemma",
"body": [
"\\begin{lemma}[]{$1}",
"\t$2",
"\\end{lemma}"
],
"description": "Inserts a tcolorbox to inform about lemmas"
},
"Corollary": {
"prefix": "corollary",
"body": [
"\\begin{corollary}[]{$1}",
"\t$2",
"\\end{corollary}"
],
"description": "Inserts a tcolorbox to inform about corollaries"
},
"Proposition": {
"prefix": "proposition",
"body": [
"\\begin{proposition}[]{$1}",
"\t$2",
"\\end{proposition}"
],
"description": "Inserts a tcolorbox to inform about propositions"
},
"Fact": {
"prefix": "fact",
"body": [
"\\begin{fact}[]{$1}",
"\t$2",
"\\end{fact}"
],
"description": "Inserts a tcolorbox to inform about facts"
},
"Terms": {
"prefix": "terms",
"body": [
"\\begin{terms}[]{$1}",
"\t$2",
"\\end{terms}"
],
"description": "Inserts a tcolorbox to inform about terms"
},
"Proof": {
"prefix": "proof",
"body": [
"\\begin{proof}[]{$1}",
"\t$2",
"\\end{proof}"
],
"description": "Inserts a tcolorbox to show a proof"
},
"Axiom": {
"prefix": "axiom",
"body": [
"\\begin{axiom}[]{$1}",
"\t$2",
"\\end{axiom}"
],
"description": "Inserts a tcolorbox to show an axiom"
},
"Notation": {
"prefix": "notation",
"body": [
"\\begin{notation}[]{$1}",
"\t$2",
"\\end{notation}"
],
"description": "Inserts a tcolorbox to show notation"
},
"Example": {
"prefix": "example",
"body": [
"\\begin{example}[]{$1}",
"\t$2",
"\\end{example}"
],
"description": "Inserts a tcolorbox to show example"
},
"Task": {
"prefix": "task",
"body": [
"\\begin{task}[]{$1}",
"\t$2",
"\\end{task}"
],
"description": "Inserts a tcolorbox to show example"
},
"Usage": {
"prefix": "usage",
"body": [
"\\begin{usage}[]{$1}",
"\t$2",
"\\end{usage}"
],
"description": "Inserts a tcolorbox to inform about usage"
},
"Conjugation": {
"prefix": "conjugation",
"body": [
"\\begin{conjugation}[]{$1}",
"\t$2",
"\\end{conjugation}"
],
"description": "Inserts a tcolorbox to inform about conjugation"
},
"Forms": {
"prefix": "forms",
"body": [
"\\begin{forms}[]{$1}",
"\t$2",
"\\end{forms}"
],
"description": "Inserts a tcolorbox to inform about forms of e.g. grammatical structures"
},
"General-Tcolorbox": {
"prefix": "general-tcb",
"body": [
"\\begin{general}[]{${1:title}}{${2:second title}}{${3|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}}",
"\t$4",
"\\end{general}"
],
"description": "Inserts a tcolorbox for general purposes. First bracket is title, second one is second title, third one colour"
},
"Derivative": {
"prefix": "derivative",
"body": [
"\\frac{\\mbox{d}}{\\mbox{d}x}$1"
]
},
"Example (inline)": {
"prefix": "example-inline",
"body": [
"\\inlineex"
]
},
"Example (short)": {
"prefix": "example-short",
"body": [
"\\shortex"
]
},
"Definition (inline)": {
"prefix": "definition-inline",
"body": [
"\\inlinedef"
]
},
"Definition (short)": {
"prefix": "definition-short",
"body": [
"\\shortdef"
]
},
"Theorem (inline)": {
"prefix": "theorem-inline",
"body": [
"\\inlinetheorem"
]
},
"Theorem (short)": {
"prefix": "theorem-short",
"body": [
"\\shorttheorem"
]
},
"Lemma (inline)": {
"prefix": "lemma-inline",
"body": [
"\\inlinelemma"
]
},
"Lemma (short)": {
"prefix": "lemma-short",
"body": [
"\\shortlemma"
]
},
"Corollary (inline)": {
"prefix": "corollary-inline",
"body": [
"\\inlinecorollary"
]
},
"Corollary (short)": {
"prefix": "corollary-short",
"body": [
"\\shortcorollary"
]
},
"Proposition (inline)": {
"prefix": "proposition-inline",
"body": [
"\\inlineproposition"
]
},
"Proposition (short)": {
"prefix": "proposition-short",
"body": [
"\\shortproposition"
]
},
"Fact (inline)": {
"prefix": "fact-inline",
"body": [
"\\inlinefact"
]
},
"Fact (short)": {
"prefix": "fact-short",
"body": [
"\\shortfact"
]
},
"Axiom (inline)": {
"prefix": "axiom-inline",
"body": [
"\\inlineaxiom"
]
},
"Axiom (short)": {
"prefix": "axiom-short",
"body": [
"\\shortaxiom"
]
},
"Proof (inline)": {
"prefix": "proof-inline",
"body": [
"\\inlineproof"
]
},
"Proof (short)": {
"prefix": "proof-short",
"body": [
"\\shortproof"
]
},
"bold": {
"prefix": "#bold",
"body": [
"\\textbf{$1}"
]
},
"italic": {
"prefix": "#i",
"body": [
"\\textit{$1}"
]
},
"bolditalic": {
"prefix": "#bi",
"body": [
"\\textbf{\\textit{$1}}"
]
},
"underlinie": {
"prefix": "#u",
"body": [
"\\underbar{$1}"
]
},
"algebra": {
"prefix": "algebra",
"body": [
"\\langle $1 \\rangle"
]
},
"fill-width": {
"prefix": "#fill",
"body": [
"\\hspace{\\fill}$1"
]
},
"Latex-Colour": {
"prefix": "colour",
"body": [
"${1|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}"
]
},
"Latex-Text-Colour": {
"prefix": "colour-text",
"body": [
"\\color{${1|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}}"
]
},
"Set Language": {
"prefix": "setLang",
"body": [
"\\setLang{$1}"
]
},
"Letter": {
"prefix": "latex-letter",
"body": [
"\\documentclass[12pt,a4paper]{scrlttr2}\n",
"\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{letter}\n",
"% Subject",
"\\setkomavar{subject}{$1}",
"\\begin{document}\\raggedright",
"\t\\begin{letter}{Company \\\\\\ Name \\\\\\ Address \\\\\\ CH-Place}",
"\t\t\\opening{Intro}\n",
"\t\t$2\n",
"\t\t\\closing{Kind regards}",
"\t\\end{letter}",
"\\end{document}"
]
}
}

View File

@@ -1,93 +0,0 @@
{
"JS-Class": {
"prefix": "jsSetupClass",
"body": "class $1 { \n\tconstructor () {} \n\n \t$2 () {\n\t$3\n\t}\n}",
"description": "Setup the basic structure of a class in JS"
},
"ExpressJS": {
"prefix": "jsExpressSetup",
"body": [
"const express = require( 'express' );",
"let app = express();",
"const path = require( 'path' );",
"const expressSession = require( 'express-session' );",
"const fs = require( 'fs' );",
"const bodyParser = require( 'body-parser' );",
"const cookieParser = require( 'cookie-parser' )",
"const favicon = require( 'serve-favicon' );",
"\napp.use( expressSession ( {\n\tsecret: $1,\n\tresave: true,\n\tsaveUninitialized: true\n} ) );",
"app.use( bodyParser.urlencoded( { extended: false } ) );",
"app.use( bodyParser.json() );",
"app.use( cookieParser() );",
"app.use( favicon( path.join( __dirname + '$2' ) ) );\n",
"app.use( ( request, response, next ) => {\n\tresponse.sendFile( path.join( __dirname + '$3' ) ) \n} );",
"\n\napp.get( '/', ( request, response ) => {\n$4\n} );",
"\n\nconst PORT = process.env.PORT || 8080;",
"http.createServer( app ).listen( PORT );"
]
},
"ExpressJS-Route": {
"prefix": "jsEjsRoute",
"body": "\n\napp.get( '$1', ( request: express.Request, response: express.Response ) => {\n$4\n} );"
},
"JSAsync": {
"prefix": "jsAsync",
"body": "(async () => {\n$1\n} ) ();"
},
"JSpromiseReturnFunc": {
"prefix": "jsPromise",
"body": "function $1 () {\n\treturn new Promise( ( resolve, reject ) => {\n\t$2\n\t} );\n}"
},
"fetch from other url": {
"prefix": "remoteURL",
"body": [
"localStorage.getItem( 'url' ) + '/$1'",
],
"description": "remote URL fetching (get from base address from local storage)"
},
"fetch post": {
"prefix": "fetchPost",
"body": [
"const fetchOptions = {",
"\tmethod: 'post',",
"\tbody: JSON.stringify( $1 ),",
"\tcredentials: 'include',",
"\theaders: {",
"\t\t'Content-Type': 'application/json',",
"\t\t'charset': 'utf-8'",
"\t}",
"};",
"fetch( $2, fetchOptions ).then( res => {",
"\tif ( res.status === 200 ) {",
"\t\tres.json().then( json => {",
"\t\t\t$3",
"\t\t} );",
"\t}",
"} );",
"$4"
],
"description": "POST request using fetch"
},
"fetch get": {
"prefix": "fetchGet",
"body": [
"fetch( $2, { credentials: 'include' } ).then( res => {",
"\tif ( res.status === 200 ) {",
"\t\tres.json().then( json => {",
"\t\t\t$3",
"\t\t} );",
"\t}",
"} );",
"$4"
],
"description": "POST request using fetch"
},
"promise": {
"prefix": "promise",
"body": [
"return new Promise( ( resolve, reject ) => {",
"\t",
"} );"
]
}
}

View File

@@ -1,11 +0,0 @@
{
"script:setup": {
"prefix": "script:setup",
"body": [
"<script setup lang=\"ts\">",
"\t$1",
"</script>"
],
"description": "Setup the basic structure of a class in JS"
}
}

View File

@@ -1,4 +0,0 @@
NeoVim
config
Supremum
Infimum

Binary file not shown.

View File

@@ -1,2 +0,0 @@
cp -r ~/.config/nvim/* ./nvim
rm ./nvim/lazy-lock.json

1
nvim-get-spell.sh Executable file
View File

@@ -0,0 +1 @@
cp ~/.config/nvim/spell/* ./nvim/spell/

96
nvim/ftplugin/java.lua Normal file
View File

@@ -0,0 +1,96 @@
local home = os.getenv("HOME")
local jdtls_path = home .. "/.local/share/nvim/mason/packages/jdtls"
local workspace_dir = home .. "/.cache/jdtls/" .. vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local equinox_path = vim.fn.glob(jdtls_path .. "/plugins/org.eclipse.equinox.launcher_*.jar")
local on_attach = require('lsp-options').on_attach
local capabilities = require('lsp-options').capabilities
local keymap = vim.keymap
local opts = { silent = true }
-- ┌ ┐
-- │ Java │
-- └ ┘
local java_on_attach = function(client, bufnr)
on_attach(client, bufnr)
opts.desc = "Organize Imports"
keymap.set("n", "<leader>jo", "<cmd>lua require('jdtls').organize_imports()<CR>", opts)
opts.desc = "Extract variable"
keymap.set("n", "<leader>je", "<cmd>lua require('jdtls').extract_variable()<CR>", opts)
opts.desc = "Extract constant"
keymap.set("n", "<leader>je", "<cmd>lua require('jdtls').extract_constant()<CR>", opts)
opts.desc = "Test current method"
keymap.set("n", "<leader>jtm", "<cmd>lua require('jdtls').test_nearest_method()<CR>", opts)
opts.desc = "Test current class"
keymap.set("n", "<leader>jtc", "<cmd>lua require('jdtls').test_class()<CR>", opts)
end
require("jdtls").start_or_attach({
cmd = {
-- 💀
"java", -- or '/path/to/java21_or_newer/bin/java'
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-Xmx1g",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
-- 💀
"-jar",
equinox_path,
-- 💀
"-configuration",
jdtls_path .. "/config_linux",
-- 💀
-- See `data directory configuration` section in the README
"-data",
workspace_dir,
},
-- 💀
-- This is the default if not provided, you can remove it. Or adjust as needed.
-- One dedicated LSP server & client will be started per unique root_dir
--
-- vim.fs.root requires Neovim 0.10.
-- If you're using an earlier version, use: require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}),
root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew", "build.xml" }),
-- Here you can configure eclipse.jdt.ls specific settings
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- for a list of options
settings = {
java = {},
},
-- Language server `initializationOptions`
-- You need to extend the `bundles` with paths to jar files
-- if you want to use additional eclipse.jdt.ls plugins.
--
-- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
--
-- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
init_options = {
bundles = vim.split(
vim.fn.glob("$HOME/.local/share/nvim/mason/packages/java-*/extension/server/*.jar", true),
"\n"
),
},
on_attach = java_on_attach,
capabilities = capabilities,
})

View File

@@ -12,71 +12,66 @@ end
-- Handy VSCode Shortcuts
-- Move lines up and down
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-Up>", ":m .-2<CR>==", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-Down>", ":m .+1<CR>==", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-k>", "<Esc>:m .-2<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-j>", "<Esc>:m .+1<CR>", { noremap = true, silent = true })
-- Move lines in insert mode
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-Up>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-Down>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
-- Copy lines up and down in normal mode
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-Up>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-Down>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-k>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-j>", ":t .<CR>", { noremap = true, silent = true })
-- Copy lines up and down in insert mode
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-Down>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-k>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-A-S-j>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-Up>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-Down>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-k>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-j>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
-- Keep selection in visual mode when indenting
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = true, silent = true })
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = true, silent = true })
-- Save shortcut
keymap.set("i", "<C-s>", "<Esc>:w<CR>a", opts("Save file (shortcut)"))
keymap.set("n", "<C-s>", ":w<CR>", opts("Save file (shortcut)"))
vim.api.nvim_set_keymap("v", "<", "<gv", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", ">", ">gv", { noremap = true, silent = true })
-- Save and quit (sudo and no sudo)
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
keymap.set("n", "<leader>E", ":lua require('utils').sudo_write()<CR>:q!<CR>", opts("sudo write and quit file"))
-- Quite file
-- Quit file
keymap.set("n", "Q", ":q!<CR>", opts("quit file"))
-- Duplicate line
keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
-- Editor focus
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
-- Key Mappings for LaTeX workflow
keymap.set('n', '<leader>lc', ':VimtexCompile<CR>', opts("Compile latex document")) -- Compile LaTeX file
keymap.set('n', '<leader>lv', ':VimtexView<CR>', opts("View compiled latex pdf")) -- View compiled PDF
keymap.set('n', '<leader>lq', ':VimtexStop<CR>', opts("Stop Compiling document")) -- Stop compilation
-- LaTeX mappings
keymap.set("n", "<leader>lc", ":VimtexCompile<CR>", opts("Compile latex document")) -- Compile LaTeX file
keymap.set("n", "<leader>lv", ":VimtexView<CR>", opts("View compiled latex pdf")) -- View compiled PDF
keymap.set("n", "<leader>lq", ":VimtexStop<CR>", opts("Stop Compiling document")) -- Stop compilation
-- Markdown-Preview
keymap.set('n', '<leader><leader>m', ':MarkdownPreview<CR>', opts("Preview Markdown document in browser")) -- Stop compilation
keymap.set("n", "<leader><leader>m", ":MarkdownPreview<CR>", opts("Preview Markdown document in browser")) -- Stop compilation
-- window navigation
keymap.set("n", "<A-h>", "<C-w>h", opts())
keymap.set("n", "<A-S-j>", "<C-w>j", opts())
keymap.set("n", "<A-S-k>", "<C-w>k", opts())
keymap.set("n", "<A-l>", "<C-w>l", opts())
keymap.set("n", "<C-k>", "<C-w>w", opts())
-- window resize
keymap.set("n", "<A-C-h>", ":vertical resize -2<CR>", opts())
keymap.set("n", "<A-C-j>", ":resize -2<CR>", opts())
keymap.set("n", "<A-C-k>", ":resize +2<CR>", opts())
keymap.set("n", "<A-C-l>", ":vertical resize +2<CR>", opts())
keymap.set("n", "<A-C-h>", ":vertical resize +2<CR>", opts("Resize horizontally right"))
keymap.set("n", "<A-C-j>", ":resize -2<CR>", opts("Resize horizontally down"))
keymap.set("n", "<A-C-k>", ":resize +2<CR>", opts("Resize horizontally up"))
keymap.set("n", "<A-C-l>", ":vertical resize -2<CR>", opts("Resize Vertically to left"))
keymap.set("n", "<leader><leader>e", ":vertical resize 40<CR>", opts("Reset sizing to default"))
-- nohlsearch
keymap.set("n", "<leader>h", ":nohlsearch<CR>", opts("remove search highlighting"))
@@ -89,11 +84,18 @@ keymap.set("n", "<leader><leader>r", ":!%:p", opts("run current file with argume
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
-- script setup
keymap.set("n", "<leader>#", ":set syntax=sh<CR>:w<CR>:!chmod +x %:p<CR>:LspStart bashls<CR>i#!/bin/sh<CR><CR>", opts("setup sh script"))
keymap.set("n", "<leader><leader>#", ":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>", opts("setup python script"))
-- CTRL + Backspace
keymap.set("i", "<C-BackSpace>", "<C-w>", opts())
keymap.set(
"n",
"<leader>#",
":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>",
opts("setup sh script")
)
keymap.set(
"n",
"<leader><leader>#",
":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>",
opts("setup python script")
)
-- select all
keymap.set("n", "<leader>a", "ggVG", opts("select all"))
@@ -108,8 +110,12 @@ keymap.set("i", "<C-e>", "<C-Right>", opts("Jump back by word"))
keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
-- open in neovide
-- keymap.set("n", "<leader>n", ":!neovide --no-fork %:p<CR>", opts("open in neovide (wip)"))
-- Spell checking
keymap.set("n", "<leader>ss", ":set spell<CR>", opts("Start built-in spell checker"))
keymap.set("n", "<leader>sn", ":set nospell<CR>", opts("Stop spell checker"))
keymap.set("n", "<leader>slu", ":set spelllang=en_us<CR>", opts("Set spell checker lang to en_US"))
keymap.set("n", "<leader>sle", ":set spelllang=en_gb<CR>", opts("Set spell checker lang to en_GB"))
keymap.set("n", "<leader>slc", ":set spelllang=de_ch<CR>", opts("Set spell checker lang to de_CH"))
-- deleting doesn't yank except when used with <leader>
keymap.set({ "n", "v" }, "d", '"_d', opts())
@@ -121,7 +127,7 @@ keymap.set({ "n", "v" }, "C", '"_C', opts())
keymap.set({ "n", "v" }, "<leader>d", "d", opts("yank and delete"))
keymap.set({ "n", "v" }, "<leader>D", "D", opts("YANK and DELETE to end"))
-- <leader> + yank/paste/delete uses system clipboard
-- <leader> + yank/paste/delete with system clipboard
keymap.set({ "n", "v" }, "<leader>y", '"+y', opts("yank to system clipboard"))
keymap.set({ "n", "v" }, "<leader>Y", '"+y$', opts("YANK to system clipboard"))
keymap.set({ "n", "v" }, "<leader>p", '"+p', opts("paste from system clipboard"))
@@ -130,3 +136,11 @@ keymap.set({ "n", "v" }, "<leader><leader>d", '"+d', opts("yank to system clipbo
keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipboard and DELETE"))
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
-- Toggle relative line numbers
keymap.set(
"n",
"<leader>.",
":lua vim.wo.relativenumber = not vim.wo.relativenumber",
opts("Toggle relative line numbers")
)

View File

@@ -11,16 +11,15 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins.nav" },
{ import = "plugins.lsp" },
{ import = "plugins.style" },
{ import = "plugins.util" },
{ import = "plugins.testing" }
{ import = "plugins.testing" },
},
change_detection = {
notify = false, -- dont notify when plugins are changed
}
},
})

68
nvim/lua/lsp-options.lua Normal file
View File

@@ -0,0 +1,68 @@
local M = {}
local keymap = vim.keymap
local opts = { silent = true }
M.on_attach = function(client, bufnr)
opts.buffer = bufnr
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", ":lua vim.lsp.buf.declaration", opts)
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Format current file"
keymap.set("n", "<leader>gf", vim.lsp.buf.format, opts)
opts.desc = "Smart rename"
keymap.set("n", "<leader>n", vim.lsp.buf.rename, opts)
opts.desc = "Show buffer diagnostics"
keymap.set("n", "ga", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show line diagnostics"
keymap.set("n", "gA", ":lua vim.diagnostic.open_float()<CR>", opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts)
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
end
M.on_attach_no_formatting = function(client, bufnr)
M.on_attach(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end
-- used to enable autocompletion (assign to every lsp server config)
-- local capabilities = cmp_nvim_lsp.default_capabilities()
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
return M

View File

@@ -15,10 +15,14 @@ vim.opt.expandtab = true
vim.opt.breakindent = true
vim.opt.linebreak = true
-- folding
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- line numbers
vim.wo.number = true
vim.wo.cursorline = true
vim.wo.relativenumber = true
vim.wo.relativenumber = false
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
-- search options

View File

@@ -86,7 +86,7 @@ return {
-- Otherwise, fallback (insert a tab character)
fallback()
end
end, { "i", "s" })
end, { "i", "s" }),
}),
-- sources for autocompletion
@@ -95,7 +95,7 @@ return {
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = 'nvim_lsp_signature_help' }, -- signature help
{ name = "nvim_lsp_signature_help" }, -- signature help
}),
formatting = {

View File

@@ -0,0 +1,17 @@
-- ┌ ┐
-- │ Bash │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("bashls", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("bashls")

View File

@@ -0,0 +1,28 @@
-- ┌ ┐
-- │ C, Cpp, objc │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("clangd", {
cmd = {
"clangd",
"--suggest-missing-includes",
"--clang-tidy",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
capabilities = capabilities,
on_attach = on_attach,
})
lsp.config("cmake", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("clangd")
enable("cmake")

View File

@@ -0,0 +1,17 @@
-- ┌ ┐
-- │ GO │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("gopls", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("gopls")

View File

@@ -0,0 +1,17 @@
-- ┌ ┐
-- │ Hyprland │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("hyprls", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("hyprls")

View File

@@ -0,0 +1,45 @@
-- ┌ ┐
-- │ Low-level (HDL and ASM) │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
-- ┌ ┐
-- │ ASM │
-- └ ┘
lsp.config("asm_lsp", {
on_attach = on_attach,
capabilities = capabilities,
})
-- ┌ ┐
-- │ Verilog │
-- └ ┘
local lspconfutil = require("lspconfig/util")
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
local verilog_root_dir = function()
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
return root_pattern(filename) or lspconfutil.path.dirname(filename)
end
lsp.config("veridian", {
capabilities = capabilities,
on_attach = on_attach,
root_dir = verilog_root_dir,
})
lsp.config("verible", {
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
cmd = { "verible-verilog-ls", "--rules=-no-trailing-spaces", "" },
capabilities = capabilities,
on_attach = on_attach,
root_dir = verilog_root_dir,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("veridian")
enable("verible")
enable("asm_lsp")

View File

@@ -0,0 +1,32 @@
-- ┌ ┐
-- │ LUA │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("lua_ls", {
capabilities = capabilities,
on_attach = on_attach,
settings = {
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("lua_ls")

View File

@@ -0,0 +1,17 @@
-- ┌ ┐
-- │ Python │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("pyright", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("pyright")

View File

@@ -0,0 +1,17 @@
-- ┌ ┐
-- │ Ruby │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("ruby_lsp", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("ruby_lsp")

View File

@@ -0,0 +1,24 @@
-- ┌ ┐
-- │ Rust │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("rust_analyzer", {
settings = {
["rust-analyzer"] = {
diagnostics = {
enable = true,
},
},
},
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("rust_analyzer")

View File

@@ -0,0 +1,28 @@
-- ┌ ┐
-- │ Text languages (TeX and MD) │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
-- ┌ ┐
-- │ Markdown │
-- └ ┘
lsp.config("marksman", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ LaTeX │
-- └ ┘
lsp.config("texlab", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("marksman")
enable("texlab")

View File

@@ -0,0 +1,70 @@
-- ┌ ┐
-- │ Web technology │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
local on_attach_no_formatting = require("lsp-options").on_attach_no_formatting
-- ┌ ┐
-- │ HTML, CSS, JSON │
-- └ ┘
lsp.config("cssls", {
capabilities = capabilities,
on_attach = on_attach,
})
lsp.config("html", {
capabilities = capabilities,
on_attach = on_attach,
})
lsp.config("jsonls", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ Vue │
-- └ ┘
lsp.config("vue_ls", {
capabilities = capabilities,
on_attach = on_attach_no_formatting,
filetypes = {
"vue",
},
})
-- ┌ ┐
-- │ TS, JS, TSX, JSX │
-- └ ┘
lsp.config("ts_ls", {
capabilities = capabilities,
on_attach = on_attach_no_formatting,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = "/usr/lib/node_modules/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue" },
},
},
},
filetypes = {
"javascript",
"typescript",
"typescriptreact",
"javascriptreact",
"vue",
},
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("jsonls")
enable("html")
enable("cssls")
enable("vue_ls")
enable("ts_ls")

View File

@@ -1,3 +1,7 @@
-- ───────────────────────────────────────────────────────────────────
-- ╭───────────────────────────────────────────────╮
-- │ LSP Configuration │
-- ╰───────────────────────────────────────────────╯
return {
-- lsp configuration
"neovim/nvim-lspconfig",
@@ -5,74 +9,10 @@ return {
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "antosha417/nvim-lsp-file-operations", config = true },
-- "mfussenegger/nvim-jdtls",
"nvim-java/nvim-java"
"mfussenegger/nvim-jdtls",
},
config = function()
require('java').setup()
-- import lspconfig plugin
local lspconfig = require("lspconfig")
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap
local opts = { silent = true }
local on_attach = function(client, bufnr)
opts.buffer = bufnr
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", ":lua vim.lsp.buf.declaration", opts)
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Format current file"
keymap.set("n", "<leader>gf", vim.lsp.buf.format, opts)
opts.desc = "Smart rename"
keymap.set("n", "<leader>n", vim.lsp.buf.rename, opts)
opts.desc = "Show buffer diagnostics"
keymap.set("n", "ga", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show line diagnostics"
keymap.set("n", "gA", ":lua vim.diagnostic.open_float()<CR>", opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts)
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
end
-- used to enable autocompletion (assign to every lsp server config)
-- local capabilities = cmp_nvim_lsp.default_capabilities()
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
local enable = vim.lsp.enable
-- Change the Diagnostic symbols in the sign column (gutter)
local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶", Info = "󰋽 " }
@@ -81,129 +21,22 @@ return {
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
lspconfig.bashls.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.clangd.setup({
cmd = {
"clangd",
"--suggest-missing-includes",
"--clang-tidy",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.cssls.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.html.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
})
lspconfig.pyright.setup({
capabilities = capabilities,
on_attach = on_attach,
})
local java_on_attach = function(client, bufnr)
on_attach(client, bufnr)
opts.buffer = bufnr
-- Keybinds for testing, refactoring, java specific
opts.desc = "Java profiling"
keymap.set("n", "<leader>jp", ":JavaProfile<CR>", opts)
opts.desc = "Java Refactor: Extract Variable (create variable from cursor)"
keymap.set("n", "<leader>jev", ":JavaExtractVariable<CR>", opts)
opts.desc = "Java Refactor: Extract Variable all occurrences (create variable from cursor)"
keymap.set("n", "<leader>jea", ":JavaExtractVariableAllOccurrence<CR>", opts)
opts.desc = "Java Refactor: Extract Const (create const from cursor)"
keymap.set("n", "<leader>jec", ":JavaExtractConst<CR>", opts)
opts.desc = "Java Refactor: Extract Method (create method from cursor)"
keymap.set("n", "<leader>jev", ":JavaExtractMethod<CR>", opts)
opts.desc = "Java Refactor: Extract Field (create field from cursor)"
keymap.set("n", "<leader>jev", ":JavaExtractField<CR>", opts)
-- Java testing, Debugging
opts.desc = "Java Testing: Run test class in buffer"
keymap.set("n", "<leader>jtc", ":JavaTestRunCurrentClass<CR>", opts)
opts.desc = "Java Testing: Debug test class in buffer"
keymap.set("n", "<leader>jdc", ":JavaTestDebugCurrentClass<CR>", opts)
opts.desc = "Java Testing: Run current method in buffer"
keymap.set("n", "<leader>jtm", ":JavaTestRunCurrentMethod<CR>", opts)
opts.desc = "Java Testing: Debug current method in buffer"
keymap.set("n", "<leader>jdm", ":JavaTestDebugCurrentMethod<CR>", opts)
opts.desc = "Java Testing: View last report"
keymap.set("n", "<leader>jtv", ":JavaTestViewLastReport<CR>", opts)
end
lspconfig.jdtls.setup({
capabilities = capabilities,
on_attach = java_on_attach,
})
lspconfig.texlab.setup{
cmd = { "texlab" },
filetypes = { "tex", "latex", "bib" },
root_dir = function(fname)
return vim.loop.cwd()
end,
}
local lspconfutil = require 'lspconfig/util'
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
local verilog_root_dir = function ()
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
return root_pattern(filename) or lspconfutil.path.dirname(filename)
end
lspconfig.veridian.setup {
capabilities = capabilities,
on_attach = on_attach,
root_dir = verilog_root_dir
}
lspconfig.verible.setup( {
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
cmd = { 'verible-verilog-ls', '--rules=-no-trailing-spaces', '' },
capabilities = capabilities,
on_attach = on_attach,
root_dir = verilog_root_dir
} )
-- ───────────────────────────────────────────────────────────────────
-- ╭───────────────────────────────────────────────╮
-- │ Import configs from other files │
-- ╰───────────────────────────────────────────────╯
require("plugins.lsp.ls.bashls")
require("plugins.lsp.ls.c")
require("plugins.lsp.ls.go")
require("plugins.lsp.ls.hypr")
require("plugins.lsp.ls.low-level")
require("plugins.lsp.ls.luals")
require("plugins.lsp.ls.pyright")
require("plugins.lsp.ls.rust-analyzer")
require("plugins.lsp.ls.ruby")
require("plugins.lsp.ls.text")
require("plugins.lsp.ls.web")
-- ───────────────────────────────────────────────────────────────────
end,
}
-- ───────────────────────────────────────────────────────────────────

View File

@@ -1,12 +1,3 @@
return {
'L3MON4D3/LuaSnip',
-- config = function()
-- local luasnip = require('luasnip')
-- -- luasnip.setup({
-- -- region_check_events = "CursorMoved",
-- -- delete_check_events = "TextChanged",
-- -- })
--
-- require("luasnip.loaders.from_vscode").load({paths = "~/.config/nvim/my_snippets"})
-- end
"L3MON4D3/LuaSnip",
}

View File

@@ -1,8 +1,8 @@
return {
-- lsp package manager
"williamboman/mason.nvim",
"mason-org/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"mason-org/mason-lspconfig.nvim",
},
config = function()
-- import mason
@@ -25,17 +25,26 @@ return {
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
-- "bashls",
-- "clangd",
"asm_lsp",
"bashls",
"clangd",
"cmake",
-- "cssls",
-- "jdtls",
"gopls",
"hyprls",
"jdtls",
"latexindent",
"marksman",
-- "lua_ls",
-- "pyright",
-- "tsserver",
"volar"
"rust_analyzer",
"ruby_lsp",
-- "ts_ls",
"vue_ls",
"verible",
},
-- auto-install configured servers (with lspconfig)
automatic_installation = true,
automatic_enable = false
})
end,
}

View File

@@ -1,13 +1,57 @@
-- ┌ ┐
-- │ Formatting, diagnostics │
-- └ ┘
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.prettier.with({
filetypes = {
"css",
"scss",
"less",
"html",
"json",
"yaml",
"markdown",
"graphql",
},
extra_args = {
"--print-width",
"120",
"--tab-width",
"4",
"--bracket-spacing",
"true",
"--arrow-parens",
"avoid",
"--jsx-single-quote",
"true",
"--trailing-comma",
"es5",
"--no-semi",
"false",
"--single-quote",
"true",
"--bracket-same-line",
"true",
"--vue-indent-script-and-style",
"true",
},
}),
null_ls.builtins.formatting.shfmt,
null_ls.builtins.formatting.asmfmt,
null_ls.builtins.code_actions.proselint,
require("none-ls.diagnostics.eslint_d"),
require("none-ls.code_actions.eslint_d"),
require("none-ls.formatting.eslint_d"),
null_ls.builtins.formatting.black,
},
})

View File

@@ -5,22 +5,49 @@ return {
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"asm",
"bash",
"c",
"cpp",
"css",
"html",
"hyprlang",
"java",
"javadoc",
"javascript",
"jsdoc",
"json",
"jsonc",
-- "latex",
"lua",
"markdown",
"meson",
"nginx",
"php",
"python",
"rasi",
"requirements",
"robots",
"ruby",
"rust",
"scss",
"sql",
"svelte",
"swift",
"toml",
"typescript",
"verilog"
"tsx",
"verilog",
"vue",
"xml",
"yaml",
"zathurarc",
},
sync_install = false,
highlight = {
enable = true,
disable = { "tex" }
disable = { "tex" },
},
})
end,

View File

@@ -1,30 +0,0 @@
return {
'pmizio/typescript-tools.nvim',
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
opts = {},
ft = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' },
config = function()
require('typescript-tools').setup {
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
'vue',
},
settings = {
tsserver_plugins = {
'@vue/typescript-plugin',
},
jsx_close_tag = {
enable = true,
filetypes = { 'javascriptreact', 'typescriptreact' },
},
},
}
end,
}

View File

@@ -2,14 +2,14 @@ return {
"lervag/vimtex",
config = function()
-- vimtex settings
-- vim.g.vimtex_view_method = 'startup' -- PDF viewer (example: zathura, or use 'skim' for macOS)
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for compilation
-- vim.g.vimtex_view_method = 'zathura' -- PDF viewer (example: zathura, or use 'skim' for macOS)
vim.g.vimtex_compiler_method = "latexmk" -- Use latexmk for compilation
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
-- Key Mappings for LaTeX workflow
vim.api.nvim_set_keymap('n', '<leader>lc', ':VimtexCompile<CR>', {}) -- Compile LaTeX file
vim.api.nvim_set_keymap('n', '<leader>lv', ':VimtexView<CR>', {}) -- View compiled PDF
vim.api.nvim_set_keymap('n', '<leader>lq', ':VimtexStop<CR>', {}) -- Stop compilation
end
-- ── Key Mappings for LaTeX workflow ──────────────────────────────
vim.api.nvim_set_keymap("n", "<leader>lc", ":VimtexCompile<CR>", {}) -- Compile LaTeX file
vim.api.nvim_set_keymap("n", "<leader>lv", ":VimtexView<CR>", {}) -- View compiled PDF
vim.api.nvim_set_keymap("n", "<leader>lq", ":VimtexStop<CR>", {}) -- Stop compilation
end,
}

View File

@@ -1,9 +0,0 @@
return {
-- delete a buffer
'famiu/bufdelete.nvim',
config = function()
local map = vim.api.nvim_set_keymap
map('n', '<C-w>', '<cmd>Bdelete<CR>', { silent = true, desc = "close current buffer" })
end
}

View File

@@ -13,7 +13,7 @@ return {
indicator = { style = "underline" },
offsets = {
{
filetype = "NvimTree",
filetype = "neo-tree",
text = " ",
text_align = "center",
separator = true,

View File

@@ -0,0 +1,12 @@
return {
"echasnovski/mini.bufremove",
config = function()
_G.MiniBufremove = require("mini.bufremove")
vim.keymap.set(
"n",
"<C-x>",
":lua MiniBufremove.delete()<CR>",
{ silent = true, noremap = true, desc = "Remove buffer" }
)
end,
}

View File

@@ -0,0 +1,18 @@
return {
-- git buffer integration
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
count_chars = { "¹", "²", "³", "", "", "", "", "", "", ["+"] = "" },
signs = {
add = { show_count = true },
change = { show_count = true },
delete = { show_count = true },
topdelete = { show_count = true },
changedelete = { show_count = true },
untracked = { show_count = true },
},
numhl = true,
})
end,
}

View File

@@ -1,7 +1,7 @@
return {
-- open file at previous position
'ethanholz/nvim-lastplace',
"ethanholz/nvim-lastplace",
config = function()
require('nvim-lastplace').setup{}
require("nvim-lastplace").setup({})
end,
}

View File

@@ -141,6 +141,6 @@ return {
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
})
vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
vim.keymap.set("n", "<leader><leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
end,
}

336
nvim/lua/plugins/nav/neotree.lua Executable file
View File

@@ -0,0 +1,336 @@
return {
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
lazy = false, -- neo-tree will lazily load itself
config = function()
-- Automatically open up
require("neo-tree").setup({
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
use_default_mappings = false,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
open_files_using_relative_paths = false,
sort_case_insensitive = false, -- used when sorting files and directories in the tree
-- sort_function = nil, -- use a custom function for sorting files and directories in the tree
sort_function = function(a, b) -- natural sort
if a.type == b.type then
local ap = a.path:lower()
local bp = b.path:lower()
if ap == bp then
return false
end
for i = 1, math.max(string.len(ap), string.len(bp)), 1 do
local l = string.sub(ap, i, -1)
local r = string.sub(bp, i, -1)
if
type(tonumber(string.sub(l, 1, 1))) == "number"
and type(tonumber(string.sub(r, 1, 1))) == "number"
then
local l_number = tonumber(string.match(l, "^[0-9]+"))
local r_number = tonumber(string.match(r, "^[0-9]+"))
if l_number ~= r_number then
return l_number < r_number
end
elseif string.sub(l, 1, 1) ~= string.sub(r, 1, 1) then
return l < r
end
end
else
return a.type < b.type
end
end,
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
if node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
local name = node.type == "terminal" and "terminal" or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon.text = devicon or icon.text
icon.highlight = hl or icon.highlight
end
end
end,
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon",
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = true,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
width = 12, -- width of the column
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
width = 10, -- width of the column
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
width = 20, -- width of the column
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
width = 20, -- width of the column
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["o"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } },
-- Read `# Preview Mode` for more information
["l"] = "focus_preview",
["S"] = "open_split",
["v"] = "open_vsplit",
["t"] = "open_tabnew",
["w"] = "open_with_window_picker",
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
["i"] = "show_file_details",
},
},
nesting_rules = {},
filesystem = {
scan_mode = "deep",
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
always_show_by_pattern = { -- uses glob style patterns
--".env*",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
},
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["b"] = "rename_basename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sg"] = { "order_by_git_status", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
-- ['<key>'] = function(state) ... end,
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-n>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-p>"] = "move_cursor_up",
["<esc>"] = "close",
-- ['<key>'] = function(state, scroll_padding) ... end,
},
},
commands = {}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["d"] = "buffer_delete",
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
},
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["u"] = "git_unstage_file",
["a"] = "git_add_file",
["r"] = "git_revert_file",
["c"] = "git_commit",
["p"] = "git_push",
["g"] = "git_commit_and_push",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
},
},
},
})
vim.keymap.set("n", "<leader>e", "<Cmd>Neotree<CR>", { silent = true, desc = "Open Neotree" })
vim.keymap.set(
"n",
"<leader><leader>g",
"<Cmd>Neotree source=git_status position=float<CR>",
{ silent = true, desc = "Open git view" }
)
end,
}

View File

@@ -1,24 +0,0 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup {
sort = {
folders_first = true,
sorter = "name"
},
filters = { custom = { "^.git$" } }
}
vim.keymap.set('n', '<leader>e', ":NvimTreeToggle<CR>", {silent = true, desc = "Open nvim-tree"})
vim.keymap.set('n', '<leader><leader>h', ":NvimTreeCollapseKeepBuffers<CR>", { silent = true, desc = "Collapse nvim-tree keeping open buffers" })
vim.keymap.set('n', '<leader><leader>e', ":NvimTreeFindFile<CR>", {silent = true, desc = "Go to currently open file in buffer or close"})
end,
}

View File

@@ -1,50 +1,3 @@
local actions = require('telescope.actions')
local action_state = require('telescope.actions.state')
-- Custom function for search and replace using Telescope
-- test
function _G.search_and_replace()
local current_file = vim.fn.expand('%:p')
local query = vim.fn.input('Enter search pattern: ')
-- Create the Telescope prompt with custom mappings
require('telescope.builtin').find_files({
prompt_title = 'Search and Replace',
cwd = vim.loop.cwd(),
hidden = true,
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
local selection = action_state.get_selected_entry()
-- Get the replace pattern from user
local replace_query = vim.fn.input('Replace with: ', '')
if not replace_query == '' then
local args = { query, replace_query }
-- Open a terminal buffer to run the search and replace command
require('telescope.builtin').terminal_job({
cmd = {
'sh', '-c',
string.format(
"grep -rl '%s' . | xargs sed -i 's/%s/%s/g'",
table.concat(args, "'"),
query,
replace_query
)
},
cwd = vim.fn.expand('%:p:h'),
})
end
return true
end)
return true
end
})
end
return {
-- fuzzy finder
"nvim-telescope/telescope.nvim",
@@ -62,7 +15,8 @@ return {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- TODO investigate
["<C-q>"] = actions.smart_add_selected_to_qflist,
["<C-A-q>"] = actions.smart_send_selected_to_qflist,
},
},
},
@@ -77,11 +31,43 @@ return {
opts.desc = "telescope buffers"
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
opts.desc = "telescope nvim functions"
opts.desc = "Show nvim functions"
vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts)
-- Recent Commands
opts.desc = "Show recent commands"
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts)
-- Search and replace
-- Recent Searches
opts.desc = "Show recent searches"
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts)
-- Old Files
opts.desc = "Show recent files"
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts)
-- Quickfix Items
opts.desc = "Show quickfix items"
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
-- Spell Suggestions
opts.desc = "Show spell suggestions"
vim.keymap.set("n", "<leader>fs", ":Telescope spell_suggest<CR>", opts)
-- Diagnostics
opts.desc = "Show diagnostics"
vim.keymap.set("n", "<leader>fd", ":Telescope diagnostics<CR>", opts)
-- Notifications
opts.desc = "Show notifications"
vim.keymap.set("n", "<leader>fn", ":Telescope notify<CR>", opts)
-- Implementations
opts.desc = "Show implementations"
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts)
-- quickfix
opts.desc = "Show quickfix list"
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
end,
}

View File

@@ -6,7 +6,5 @@ return {
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {
}
opts = {},
}

View File

@@ -1,9 +1,9 @@
return {
-- colorizes colors in code
'NvChad/nvim-colorizer.lua' ,
"NvChad/nvim-colorizer.lua",
--cmd = 'ColorizerToggle',
config = function()
require("colorizer").setup {
require("colorizer").setup({
filetypes = { "*" },
user_default_options = {
RGB = true, -- #RGB hex codes - #FCE
@@ -21,14 +21,14 @@ return {
-- True is same as normal
tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
virtualtext = "",
-- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs
always_update = false
always_update = false,
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
}
})
end,
}

View File

@@ -13,7 +13,7 @@ return {
functions = "italic",
keywords = "italic",
types = "italic",
}
},
},
palettes = {
all = {
@@ -28,7 +28,7 @@ return {
darkgreen = Shade.new("#005602", 0.10, -0.15),
darkyellow = Shade.new("#dfd100", 0.10, -0.15),
yellow = Shade.new("#e3c46d", 0.15, -0.15),
darkblue = Shade.new("#1010aa", 0.15, -0.15),
darkblue = Shade.new("#1010cc", 0.15, -0.15),
blue = Shade.new("#7070dd", 0.15, -0.15),
magenta = Shade.new("#C02490", 0.30, -0.15),
pink = Shade.new("#ff82c2", 0.15, -0.15),
@@ -61,7 +61,7 @@ return {
comment = "comment",
bracket = "darkyellow",
builtin0 = "softblue",
builtin1 = "sel0",
builtin1 = "brown",
builtin2 = "sel1",
conditional = "darkblue",
const = "gray",
@@ -77,7 +77,7 @@ return {
statement = "magenta",
string = "cyan",
type = "red",
variable = "orange"
variable = "orange",
},
diag = {
error = "darkred",
@@ -91,22 +91,22 @@ return {
warn = "#a16b00",
info = "cyan",
hint = "bg3",
ok = "green";
ok = "green",
},
diff = {
add = "darkgreen",
delete = "darkred",
changed = "lightblue",
text = "fg0"
text = "fg0",
},
git = {
add = "darkgreen",
removed = "darkred",
changed = "lightblue",
conflict = "orange",
ignored = "gray"
}
}
ignored = "gray",
},
},
},
groups = {
all = {

View File

@@ -1,10 +1,10 @@
return {
-- add comment keybinds
'numToStr/Comment.nvim',
"numToStr/Comment.nvim",
opts = {},
lazy = false,
config = function()
require('Comment').setup()
require('Comment.ft').set('hyprlang', '#%s')
end
require("Comment").setup()
require("Comment.ft").set("hyprlang", "#%s")
end,
}

View File

@@ -1,5 +1,5 @@
return {
-- prettier prompts
'stevearc/dressing.nvim',
event = 'VeryLazy',
"stevearc/dressing.nvim",
event = "VeryLazy",
}

View File

@@ -1,7 +1,7 @@
return {
-- status line
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local function getWords()
local wc = vim.api.nvim_eval("wordcount()")
@@ -11,45 +11,45 @@ return {
return wc["words"]
end
end
require('lualine').setup {
require("lualine").setup({
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = { 'NvimTree' },
ignore_focus = { "neo-tree" },
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
},
sections = {
lualine_a = { { 'mode', separator = { left = '', right = '' }, } },
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = { getWords, 'encoding', 'fileformat', 'filetype'},
lualine_y = { { 'progress', left_padding=0 } },
lualine_z = { { 'location', separator = { left = '', right = '' }, padding=0} }
lualine_a = { { "mode", separator = { left = "", right = "" } } },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { getWords, "encoding", "fileformat", "filetype" },
lualine_y = { { "progress", left_padding = 0 } },
lualine_z = { { "location", separator = { left = "", right = "" }, padding = 0 } },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {}
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
extensions = {},
})
end,
}

View File

@@ -0,0 +1,38 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
-- add any options here
},
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
config = function()
require("notify").setup({
max_width = 80,
minimum_width = 30,
render = "wrapped-default", -- default, minimal, simple, compact, wrapped-compact or wrapped-default
stages = "slide", -- fade_in_slide_out, fade, slide, static
})
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})
end,
}

View File

@@ -26,7 +26,7 @@ return {
[[ ]],
},
highlight = "String",
default_color = "#010155"
default_color = "#010155",
},
quotes = {
@@ -43,7 +43,7 @@ return {
end
end,
highlight = "String",
default_color = "#FFFFFF"
default_color = "#FFFFFF",
},
old = {
@@ -58,12 +58,12 @@ return {
},
options = {
mapping_keys = false;
mapping_keys = false,
},
colors = {
background = "#000000",
folded_section = "#100000"
folded_section = "#100000",
},
mappings = {
@@ -71,7 +71,7 @@ return {
open_file = "<CR>",
},
parts = {"title", "quotes", "old"}
parts = { "title", "quotes", "old" },
})
end,
}

View File

@@ -48,9 +48,15 @@ return {
end
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
vim.fn.sign_define(
"DapBreakpointCondition",
{ text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }
)
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = "" })
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
vim.fn.sign_define(
"DapStopped",
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
)
dap.configurations.python = {
{
@@ -91,7 +97,7 @@ return {
else
cb({
type = "executable",
command = vim.fn.stdpath("data") .. '/mason/packages/debugpy/venv/bin/python',
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",

View File

@@ -1,7 +1,4 @@
-- plugins/neotest_config.lua
return {
-- Load neotest
{
"nvim-neotest/neotest",
dependencies = {
-- For JavaScript, TypeScript (Vite)
@@ -27,6 +24,8 @@ return {
require("neotest-ctest"),
-- Rust Adapter
require("neotest-rust"),
-- Java Adapter
-- require("neotest-java")
},
})
@@ -39,15 +38,14 @@ return {
-- Run all tests in the current file
opts.desc = "Run all tests in current file"
keymap("n", "<leader><leader>tf", '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))', opts)
-- Run all tests in the entire project
opts.desc = "Run all tests in project"
keymap("n", "<leader><leader>ta", "<cmd>Neotest run<cr>", opts)
keymap("n", "<leader><leader>tf", '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))<cr>', opts)
-- Stop running tests
opts.desc = "Stop tests"
keymap("n", "<leader><leader>ts", "<cmd>Neotest stop<cr>", opts)
keymap("n", "<leader><leader>ts", '<cmd>lua require("neotest").run.stop()<cr>', opts)
opts.desc = "Attach to nearest test"
keymap("n", "<leader><leader>ta", '<cmd>lua require("neotest").run.attach()<cr>', opts)
opts.desc = "Jump to next test"
keymap("n", "<leader><leader>tn", "<cmd>Neotest jump next<cr>", opts)
@@ -66,5 +64,4 @@ return {
opts.desc = "Show neotest output as panel"
keymap("n", "<leader><leader>tn", "<cmd>Neotest output-panel<cr>", opts)
end,
},
}

View File

@@ -5,7 +5,7 @@ return {
config = function()
require("nvim-autopairs").setup({
fast_wrap = {
map = "<C-e>",
map = "<leader>wa",
chars = { "{", "[", "(", '"', "'", "`" },
},
})

View File

@@ -1,13 +1,13 @@
return {
"windwp/nvim-ts-autotag",
config = function()
require('nvim-ts-autotag').setup({
require("nvim-ts-autotag").setup({
opts = {
-- Defaults
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = true -- Auto close on trailing </
enable_close_on_slash = true, -- Auto close on trailing </
},
})
end
end,
}

View File

@@ -0,0 +1,21 @@
return {
"uga-rosa/ccc.nvim",
config = function()
local ccc = require("ccc")
vim.opt.termguicolors = true
ccc.setup({
highlighter = {
auto_enable = false,
lsp = true,
},
})
local keymap = vim.keymap
keymap.set(
"n",
"<leader>cp",
"<cmd>CccPick<CR>",
{ noremap = true, silent = true, desc = "Toggle colour picker" }
)
end,
}

View File

@@ -6,9 +6,8 @@ return {
notification = {
window = {
winblend = 0,
}
}
},
},
})
end
end,
}

View File

@@ -1,15 +0,0 @@
return {
"kikofmas/grammarous.nvim",
config = function ()
local keymap = vim.keymap
local opts = require('utils').opts
keymap.set('n', '<leader>sr', ':GrammarousCheck<CR>', opts('LanguageTool Spell Checker'))
keymap.set('n', '<leader>sc', ':GrammarousCheck --comments-only<CR>', opts('LanguageTool Spell Checker, only comments'))
keymap.set('n', '<leader>ss', ':set spell<CR>', opts('Start built-in spell checker'))
keymap.set('n', '<leader>sn', ':set nospell<CR>', opts('Stop spell checker'))
keymap.set('n', '<leader>slu', ':set spelllang=en_us<CR>', opts('Set spell checker lang to en_US'))
keymap.set('n', '<leader>sle', ':set spelllang=en_gb<CR>', opts('Set spell checker lang to en_GB'))
keymap.set('n', '<leader>slc', ':set spelllang=de_ch<CR>', opts('Set spell checker lang to de_CH'))
end
}

View File

@@ -1,9 +1,9 @@
return {
-- indent lines
'lukas-reineke/indent-blankline.nvim',
"lukas-reineke/indent-blankline.nvim",
opts = {},
main = 'ibl',
main = "ibl",
config = function()
require('ibl').setup()
end
require("ibl").setup()
end,
}

View File

@@ -4,14 +4,16 @@ return {
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable "npx" then
if vim.fn.executable("npx") then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd [[Lazy load markdown-preview.nvim]]
vim.cmd([[Lazy load markdown-preview.nvim]])
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
if vim.fn.executable("npx") then
vim.g.mkdp_filetypes = { "markdown" }
end
end,
}

View File

@@ -2,16 +2,16 @@ return {
"smoka7/multicursors.nvim",
event = "VeryLazy",
dependencies = {
'nvimtools/hydra.nvim',
"nvimtools/hydra.nvim",
},
opts = {},
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
keys = {
{
mode = { 'v', 'n' },
'<leader><leader>c',
'<cmd>MCstart<cr>',
desc = 'Create a selection for selected text or word under the cursor',
mode = { "v", "n" },
"<leader><leader>c",
"<cmd>MCstart<cr>",
desc = "Create a selection for selected text or word under the cursor",
},
},
}

View File

@@ -0,0 +1,10 @@
return {
"danymat/neogen",
config = function()
local opts = { noremap = true, silent = true, desc = "Generate docs" }
vim.api.nvim_set_keymap("n", "<leader>gd", ":lua require('neogen').generate()<CR>", opts)
require("neogen").setup({
snippet_engine = "luasnip",
})
end,
}

Some files were not shown because too many files have changed in this diff Show More