Compare commits

..

No commits in common. "4aa0c54fc4eba43c5cae12da5e5df4ae9b49f724" and "4d6a5a431cfde2ac0de0d35268a403d2e325a5e4" have entirely different histories.

50 changed files with 1089 additions and 1271 deletions

View File

@ -12,32 +12,34 @@ end
-- Handy VSCode Shortcuts -- Handy VSCode Shortcuts
-- Move lines up and down -- 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-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-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-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-j>', '<Esc>:m .+1<CR>', { noremap = true, silent = true })
-- Move lines in insert mode -- 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-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-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-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-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
-- Copy lines up and down in normal mode -- 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-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-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-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-j>', ':t .<CR>', { noremap = true, silent = true })
-- Copy lines up and down in insert mode -- 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-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-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-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-j>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
-- Keep selection in visual mode when indenting -- 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 })
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) -- Save and quit (sudo and no sudo)
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file")) keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
@ -53,12 +55,12 @@ keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus")) keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
-- Key Mappings for LaTeX workflow -- Key Mappings for LaTeX workflow
keymap.set("n", "<leader>lc", ":VimtexCompile<CR>", opts("Compile latex document")) -- Compile LaTeX file 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>lv', ':VimtexView<CR>', opts("View compiled latex pdf")) -- View compiled PDF
keymap.set("n", "<leader>lq", ":VimtexStop<CR>", opts("Stop Compiling document")) -- Stop compilation keymap.set('n', '<leader>lq', ':VimtexStop<CR>', opts("Stop Compiling document")) -- Stop compilation
-- Markdown-Preview -- 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 -- window navigation
keymap.set("n", "<A-h>", "<C-w>h", opts()) keymap.set("n", "<A-h>", "<C-w>h", opts())
@ -85,18 +87,8 @@ 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")) keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
-- script setup -- script setup
keymap.set( keymap.set("n", "<leader>#", ":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>", opts("setup sh script"))
"n", 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"))
"<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 -- select all
keymap.set("n", "<leader>a", "ggVG", opts("select all")) keymap.set("n", "<leader>a", "ggVG", opts("select all"))
@ -111,23 +103,8 @@ 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-$>", "<End>", opts("Jump to EOL"))
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line")) keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
-- Spell checking -- open in neovide
function StopTextlsp() -- keymap.set("n", "<leader>n", ":!neovide --no-fork %:p<CR>", opts("open in neovide (wip)"))
local clients = vim.lsp.get_clients()
for client in clients do
if client.name == "textlsp" then
vim.lsp.stop_client(client.id)
end
end
end
keymap.set("n", "<leader>sr", ':lua vim.lsp.enable("textlsp")<CR>', opts("Start textlsp"))
keymap.set("n", "<leader>sq", StopTextlsp, opts("Stop textlsp"))
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> -- deleting doesn't yank except when used with <leader>
keymap.set({ "n", "v" }, "d", '"_d', opts()) keymap.set({ "n", "v" }, "d", '"_d', opts())
@ -150,9 +127,4 @@ keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipbo
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey")) keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
-- Toggle relative line numbers -- Toggle relative line numbers
keymap.set( keymap.set( 'n', '<leader>.', ':lua vim.wo.relativenumber = not vim.wo.relativenumber', opts( 'Toggle relative line numbers' ))
"n",
"<leader>.",
":lua vim.wo.relativenumber = not vim.wo.relativenumber",
opts("Toggle relative line numbers")
)

View File

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

View File

@ -16,8 +16,8 @@ vim.opt.breakindent = true
vim.opt.linebreak = true vim.opt.linebreak = true
-- folding -- folding
vim.wo.foldmethod = "expr" vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- line numbers -- line numbers
vim.wo.number = true vim.wo.number = true

View File

@ -1,25 +1,25 @@
return { return {
-- competion -- competion
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter", event = "InsertEnter",
dependencies = { dependencies = {
{ "hrsh7th/cmp-buffer" }, -- source for text in buffer { "hrsh7th/cmp-buffer" }, -- source for text in buffer
{ "hrsh7th/cmp-path" }, -- source for file system paths { "hrsh7th/cmp-path" }, -- source for file system paths
{ "L3MON4D3/LuaSnip" }, -- snippet engine { "L3MON4D3/LuaSnip" }, -- snippet engine
{ "saadparwaiz1/cmp_luasnip" }, -- for autocompletion { "saadparwaiz1/cmp_luasnip" }, -- for autocompletion
{ "rafamadriz/friendly-snippets" }, -- useful snippets { "rafamadriz/friendly-snippets" }, -- useful snippets
{ "onsails/lspkind.nvim" }, -- icons for cmp { "onsails/lspkind.nvim" }, -- icons for cmp
{ "hrsh7th/cmp-nvim-lsp-signature-help" }, -- signature help { "hrsh7th/cmp-nvim-lsp-signature-help" }, -- signature help
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
local lspkind = require("lspkind") local lspkind = require("lspkind")
local luasnip = require("luasnip") local luasnip = require("luasnip")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets) -- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } }) require("luasnip.loaders.from_vscode").load({paths = { "~/.config/nvim/snippets" }})
luasnip.setup({ luasnip.setup({
region_check_events = { "CursorMoved" }, region_check_events = { "CursorMoved" },
delete_check_events = { "TextChanged" }, delete_check_events = { "TextChanged" },
@ -27,32 +27,32 @@ return {
-- luasnip.filetype_extend("htmldjango", { "html" }) -- luasnip.filetype_extend("htmldjango", { "html" })
cmp.setup({ cmp.setup({
completion = { completion = {
completeopt = "menu,menuone,preview,noselect", completeopt = "menu,menuone,preview,noselect",
}, },
window = { window = {
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
completion = cmp.config.window.bordered({ completion = cmp.config.window.bordered({
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
}), }),
}, },
snippet = { -- configure how nvim-cmp interacts with snippet engine snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) luasnip.lsp_expand(args.body)
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.ConfirmBehavior.Select }), -- next suggestion ["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.ConfirmBehavior.Select }), -- next suggestion
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.ConfirmBehavior.Select }), -- prev suggestion ["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.ConfirmBehavior.Select }), -- prev suggestion
["<C-S-J>"] = cmp.mapping.scroll_docs(4, { behavior = cmp.ConfirmBehavior.Select }), -- docs forward ["<C-S-J>"] = cmp.mapping.scroll_docs(4, { behavior = cmp.ConfirmBehavior.Select }), -- docs forward
["<C-S-K>"] = cmp.mapping.scroll_docs(-4, { behavior = cmp.ConfirmBehavior.Select }), -- docs back ["<C-S-K>"] = cmp.mapping.scroll_docs(-4, { behavior = cmp.ConfirmBehavior.Select }), -- docs back
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-q>"] = cmp.mapping.abort(), -- close completion window ["<C-q>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }), -- autocomplete if selected ["<CR>"] = cmp.mapping.confirm({ select = false }), -- autocomplete if selected
-- Mapping for Tab key -- Mapping for Tab key
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
@ -86,46 +86,46 @@ return {
-- Otherwise, fallback (insert a tab character) -- Otherwise, fallback (insert a tab character)
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" })
}), }),
-- sources for autocompletion -- sources for autocompletion
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- lsp { name = "nvim_lsp" }, -- lsp
{ name = "luasnip" }, -- snippets { name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer { name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths { name = "path" }, -- file system paths
{ name = "nvim_lsp_signature_help" }, -- signature help { name = 'nvim_lsp_signature_help' }, -- signature help
}), }),
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = lspkind.cmp_format({ format = lspkind.cmp_format({
mode = "symbol", -- show only symbol annotations mode = "symbol", -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as -- can also be a function to dynamically calculate max width such as
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end, -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
ellipsis_char = "", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) ellipsis_char = "", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind -- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function(entry, vim_item) before = function(entry, vim_item)
return vim_item return vim_item
end, end,
}), }),
}, },
}) })
local opts = { silent = true } local opts = { silent = true }
opts.desc = "next snippet placeholder" opts.desc = "next snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-w>", function() vim.keymap.set({ "i", "s" }, "<C-w>", function()
luasnip.jump(1) luasnip.jump(1)
end, opts) end, opts)
opts.desc = "previous snippet placeholder" opts.desc = "previous snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-b>", function() vim.keymap.set({ "i", "s" }, "<C-b>", function()
luasnip.jump(-1) luasnip.jump(-1)
end, opts) end, opts)
end, end,
} }

View File

@ -1,17 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,28 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,17 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,17 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,45 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,32 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,17 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,17 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,24 +0,0 @@
-- ┌ ┐
-- │ 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

@ -1,36 +0,0 @@
-- ┌ ┐
-- │ 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,
})
-- ┌ ┐
-- │ Spell checking │
-- └ ┘
lsp.config("textlsp", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("marksman")
enable("texlab")

View File

@ -1,69 +0,0 @@
-- ┌ ┐
-- │ Web technology │
-- └ ┘
local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
-- ┌ ┐
-- │ 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,
filetypes = {
"vue",
},
})
-- ┌ ┐
-- │ TS, JS, TSX, JSX │
-- └ ┘
lsp.config("ts_ls", {
capabilities = capabilities,
on_attach = on_attach,
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("css")
enable("vue_ls")
enable("ts_ls")

View File

@ -1,16 +1,16 @@
return { return {
---------- for lsp diagnostic lines ---------- ---------- for lsp diagnostic lines ----------
"https://git.sr.ht/~whynothugo/lsp_lines.nvim", "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach", event = "LspAttach",
config = function() config = function()
require("lsp_lines").setup() require("lsp_lines").setup()
vim.diagnostic.config({ virtual_lines = false }) vim.diagnostic.config({ virtual_lines = false })
local lsplines = false local lsplines = false
vim.keymap.set("n", "<Leader>L", function() vim.keymap.set("n", "<Leader>L", function ()
lsplines = not lsplines lsplines = not lsplines
vim.diagnostic.config({ virtual_text = not lsplines }) vim.diagnostic.config({ virtual_text = not lsplines })
vim.diagnostic.config({ virtual_lines = lsplines }) vim.diagnostic.config({ virtual_lines = lsplines })
end, { desc = "Toggle lsp_lines" }) end, { desc = "Toggle lsp_lines" })
end, end,
} }

View File

@ -1,7 +1,3 @@
-- ───────────────────────────────────────────────────────────────────
-- ╭───────────────────────────────────────────────╮
-- │ LSP Configuration │
-- ╰───────────────────────────────────────────────╯
return { return {
-- lsp configuration -- lsp configuration
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -12,8 +8,12 @@ return {
"mfussenegger/nvim-jdtls", "mfussenegger/nvim-jdtls",
}, },
config = function() config = function()
local lsp = vim.lsp
local enable = vim.lsp.enable local enable = vim.lsp.enable
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
-- Change the Diagnostic symbols in the sign column (gutter) -- Change the Diagnostic symbols in the sign column (gutter)
local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶", Info = "󰋽 " } local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶", Info = "󰋽 " }
for type, icon in pairs(signs) do for type, icon in pairs(signs) do
@ -21,22 +21,189 @@ return {
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end end
-- ─────────────────────────────────────────────────────────────────── -- ┌ ┐
-- │ Bash │
-- └ ┘
lsp.config("bashls", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ C, Cpp, objc │
-- └ ┘
lsp.config("clangd", {
cmd = {
"clangd",
"--suggest-missing-includes",
"--clang-tidy",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ Rust │
-- └ ┘
lsp.config("rust_analyzer", {
settings = {
["rust-analyzer"] = {
diagnostics = {
enable = true,
},
},
},
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ 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,
})
-- ┌ ┐
-- │ LUA │
-- └ ┘
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,
},
},
},
},
})
-- ┌ ┐
-- │ Markdown │
-- └ ┘
lsp.config("marksman", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ Python │
-- └ ┘
lsp.config("pyright", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ Vue │
-- └ ┘
lsp.config("vue_ls", {
capabilities = capabilities,
on_attach = on_attach,
filetypes = {
"vue",
},
})
-- ┌ ┐
-- │ TS, JS, TSX, JSX │
-- └ ┘
lsp.config("ts_ls", {
capabilities = capabilities,
on_attach = on_attach,
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",
},
})
-- ┌ ┐
-- │ ASM │
-- └ ┘
lsp.config("asm_lsp", {
on_attach = on_attach,
capabilities = capabilities,
})
-- ┌ ┐
-- │ LaTeX │
-- └ ┘
lsp.config("texlab", {
capabilities = capabilities,
on_attach = on_attach,
})
-- ┌ ┐
-- │ 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,
})
-- ╭───────────────────────────────────────────────╮ -- ╭───────────────────────────────────────────────╮
-- │ Import configs from other files │ -- │ Enable the configs
-- ╰───────────────────────────────────────────────╯ -- ╰───────────────────────────────────────────────╯
require("plugins.lsp.ls.bashls") enable("bashls")
require("plugins.lsp.ls.c") enable("clangd")
require("plugins.lsp.ls.go") enable("rust_analyzer")
require("plugins.lsp.ls.hypr") enable("marksman")
require("plugins.lsp.ls.low-level") enable("vue_ls")
require("plugins.lsp.ls.luals") enable("ts_ls")
require("plugins.lsp.ls.pyright") enable("texlab")
require("plugins.lsp.ls.rust-analyzer") enable("asm_lsp")
require("plugins.lsp.ls.ruby") enable("jsonls")
require("plugins.lsp.ls.text") enable("cssls")
require("plugins.lsp.ls.web") enable("html")
-- ─────────────────────────────────────────────────────────────────── enable("lua_ls")
enable("pyright")
end, end,
} }
-- ───────────────────────────────────────────────────────────────────

View File

@ -1,3 +1,12 @@
return { return {
"L3MON4D3/LuaSnip", '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
} }

View File

@ -26,21 +26,15 @@ return {
-- list of servers for mason to install -- list of servers for mason to install
ensure_installed = { ensure_installed = {
"asm-lsp", "asm-lsp",
"bashls", -- "bashls",
"clangd", -- "clangd",
"cmake",
-- "cssls", -- "cssls",
"dartls",
"gopls",
"hyprls",
"jdtls", "jdtls",
"marksman", "marksman",
-- "lua_ls", -- "lua_ls",
-- "pyright", -- "pyright",
"rust_analyzer", "rust_analyzer",
"ruby_lsp", -- "tsserver",
-- "ts_ls",
"textlsp",
"vue_ls" "vue_ls"
}, },
-- auto-install configured servers (with lspconfig) -- auto-install configured servers (with lspconfig)

View File

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

View File

@ -1,30 +1,30 @@
return { return {
-- syntax highlighting -- syntax highlighting
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = { ensure_installed = {
"asm", "asm",
"bash", "bash",
"c", "c",
"cpp", "cpp",
"css", "css",
"html", "html",
"hyprlang", "hyprlang",
"java", "java",
"javadoc", "javadoc",
"javascript", "javascript",
"jsdoc", "jsdoc",
"json", "json",
"jsonc", "jsonc",
-- "latex", -- "latex",
"lua", "lua",
"markdown", "markdown",
"meson", "meson",
"nginx", "nginx",
"php", "php",
"python", "python",
"rasi", "rasi",
"requirements", "requirements",
"robots", "robots",
@ -35,20 +35,20 @@ return {
"svelte", "svelte",
"swift", "swift",
"toml", "toml",
"typescript", "typescript",
"tsx", "tsx",
"verilog", "verilog",
"vue", "vue",
"xml", "xml",
"yaml", "yaml",
"zathurarc", "zathurarc"
}, },
sync_install = false, sync_install = false,
highlight = { highlight = {
enable = true, enable = true,
disable = { "tex" }, disable = { "tex" }
}, },
}) })
end, end,
} }

View File

@ -1,15 +1,15 @@
return { return {
"lervag/vimtex", "lervag/vimtex",
config = function() config = function()
-- vimtex settings -- vimtex settings
-- vim.g.vimtex_view_method = 'zathura' -- PDF viewer (example: zathura, or use 'skim' for macOS) -- 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_compiler_method = 'latexmk' -- Use latexmk for compilation
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors 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
-- ── Key Mappings for LaTeX workflow ────────────────────────────── end
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 +1,7 @@
return { return {
"echasnovski/mini.bufremove", "echasnovski/mini.bufremove",
config = function() config = function ()
_G.MiniBufremove = require("mini.bufremove") _G.MiniBufremove = require( 'mini.bufremove' );
vim.keymap.set( vim.keymap.set( 'n', '<C-x>', ':lua MiniBufremove.delete()<CR>', { silent = true, noremap = true, desc = 'Remove buffer' } );
"n",
"<C-x>",
":lua MiniBufremove.delete()<CR>",
{ silent = true, noremap = true, desc = "Remove buffer" }
)
end, end,
} }

View File

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

View File

@ -82,7 +82,7 @@ return {
["h"] = actions.parent(), -- Move to left panel ["h"] = actions.parent(), -- Move to left panel
["l"] = actions.children(), -- Move to right panel ["l"] = actions.children(), -- Move to right panel
["0"] = actions.root(), -- Move to first panel ["0"] = actions.root(), -- Move to first panel
["<C-S-v>"] = actions.visual_name(), -- Visual selection of name ["<C-S-v>"] = actions.visual_name(), -- Visual selection of name
["<C-S-V>"] = actions.visual_scope(), -- Visual selection of scope ["<C-S-V>"] = actions.visual_scope(), -- Visual selection of scope
@ -141,6 +141,6 @@ return {
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
}) })
vim.keymap.set("n", "<leader><leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" }) vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
end, end,
} }

View File

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

View File

@ -1,68 +1,68 @@
return { return {
-- fuzzy finder -- fuzzy finder
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
}, },
config = function() config = function()
local builtin = require("telescope.builtin") local builtin = require("telescope.builtin")
local actions = require("telescope.actions") local actions = require("telescope.actions")
local opts = { silent = true } local opts = { silent = true }
require("telescope").setup({ require("telescope").setup({
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
["<C-j>"] = actions.move_selection_next, ["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- TODO investigate ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- TODO investigate
}, },
}, },
}, },
}) })
opts.desc = "telescope find files" opts.desc = "telescope find files"
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts) vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
opts.desc = "telescope live grep" opts.desc = "telescope live grep"
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts) vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts)
opts.desc = "telescope buffers" opts.desc = "telescope buffers"
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts) vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
opts.desc = "Show nvim functions" opts.desc = "Show nvim functions"
vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts) vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts)
-- Recent Commands -- Recent Commands
opts.desc = "Show recent commands" opts.desc = "Show recent commands"
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts) vim.keymap.set('n', '<leader>frc', ':Telescope command_history<CR>', opts)
-- Recent Searches -- Recent Searches
opts.desc = "Show recent searches" opts.desc = "Show recent searches"
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts) vim.keymap.set('n', '<leader>frs', ':Telescope search_history<CR>', opts)
-- Old Files -- Old Files
opts.desc = "Show recent files" opts.desc = "Show recent files"
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts) vim.keymap.set('n', '<leader>frf', ':Telescope oldfiles<CR>', opts)
-- Quickfix Items -- Quickfix Items
opts.desc = "Show quickfix items" opts.desc = "Show quickfix items"
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts) vim.keymap.set('n', '<leader>fq', ':Telescope quickfix<CR>', opts)
-- Spell Suggestions -- Spell Suggestions
opts.desc = "Show spell suggestions" opts.desc = "Show spell suggestions"
vim.keymap.set("n", "<leader>fs", ":Telescope spell_suggest<CR>", opts) vim.keymap.set('n', '<leader>fs', ':Telescope spell_suggest<CR>', opts)
-- Diagnostics -- Diagnostics
opts.desc = "Show diagnostics" opts.desc = "Show diagnostics"
vim.keymap.set("n", "<leader>fd", ":Telescope diagnostics<CR>", opts) vim.keymap.set('n', '<leader>fd', ':Telescope diagnostics<CR>', opts)
-- Notifications -- Notifications
opts.desc = "Show notifications" opts.desc = "Show notifications"
vim.keymap.set("n", "<leader>fn", ":Telescope notify<CR>", opts) vim.keymap.set('n', '<leader>fn', ':Telescope notify<CR>', opts)
-- Implementations -- Implementations
opts.desc = "Show implementations" opts.desc = "Show implementations"
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts) vim.keymap.set('n', '<leader>fi', ':Telescope lsp_implementations<CR>', opts)
end, end,
} }

View File

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

View File

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

View File

@ -1,9 +1,9 @@
return { return {
-- colorizes colors in code -- colorizes colors in code
"NvChad/nvim-colorizer.lua", 'NvChad/nvim-colorizer.lua' ,
--cmd = 'ColorizerToggle', --cmd = 'ColorizerToggle',
config = function() config = function ()
require("colorizer").setup({ require("colorizer").setup {
filetypes = { "*" }, filetypes = { "*" },
user_default_options = { user_default_options = {
RGB = true, -- #RGB hex codes - #FCE RGB = true, -- #RGB hex codes - #FCE
@ -19,16 +19,16 @@ return {
mode = "background", -- Set the display mode. mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both" -- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal -- True is same as normal
tailwind = false, -- Enable tailwind colors tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options| -- 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 = "", virtualtext = "",
-- update color values even if buffer is not focused -- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs -- example use: cmp_menu, cmp_docs
always_update = false, always_update = false
}, },
-- all the sub-options of filetypes apply to buftypes -- all the sub-options of filetypes apply to buftypes
buftypes = {}, buftypes = {},
}) }
end, end,
} }

View File

@ -13,44 +13,44 @@ return {
functions = "italic", functions = "italic",
keywords = "italic", keywords = "italic",
types = "italic", types = "italic",
}, }
}, },
palettes = { palettes = {
all = { all = {
black = Shade.new("#404944", 0.15, -0.15), black = Shade.new("#404944", 0.15, -0.15),
gray = Shade.new("#505050", 0.15, -0.15), gray = Shade.new("#505050", 0.15, -0.15),
white = Shade.new("#dee4df", 0.15, -0.15), white = Shade.new("#dee4df", 0.15, -0.15),
red = Shade.new("#ff6060", 0.15, -0.15), red = Shade.new("#ff6060", 0.15, -0.15),
darkred = Shade.new("#903030", 0.15, -0.15), darkred = Shade.new("#903030", 0.15, -0.15),
strongred = Shade.new("#bb0000", 0.15, -0.15), strongred = Shade.new("#bb0000", 0.15, -0.15),
orange = Shade.new("#ce8c14", 0.15, -0.15), orange = Shade.new("#ce8c14", 0.15, -0.15),
green = Shade.new("#a3d397", 0.10, -0.15), green = Shade.new("#a3d397", 0.10, -0.15),
darkgreen = Shade.new("#005602", 0.10, -0.15), darkgreen = Shade.new("#005602", 0.10, -0.15),
darkyellow = Shade.new("#dfd100", 0.10, -0.15), darkyellow = Shade.new("#dfd100", 0.10, -0.15),
yellow = Shade.new("#e3c46d", 0.15, -0.15), yellow = Shade.new("#e3c46d", 0.15, -0.15),
darkblue = Shade.new("#1010cc", 0.15, -0.15), darkblue = Shade.new("#1010cc", 0.15, -0.15),
blue = Shade.new("#7070dd", 0.15, -0.15), blue = Shade.new("#7070dd", 0.15, -0.15),
magenta = Shade.new("#C02490", 0.30, -0.15), magenta = Shade.new("#C02490", 0.30, -0.15),
pink = Shade.new("#ff82c2", 0.15, -0.15), pink = Shade.new("#ff82c2", 0.15, -0.15),
purple = Shade.new("#761464", 0.15, -0.15), purple = Shade.new("#761464", 0.15, -0.15),
cyan = Shade.new("#7ac9ff", 0.15, -0.15), cyan = Shade.new("#7ac9ff", 0.15, -0.15),
lightblue = Shade.new("#5c77ff", 0.15, -0.15), lightblue = Shade.new("#5c77ff", 0.15, -0.15),
softblue = Shade.new("#10ddff", 0.15, -0.15), softblue = Shade.new("#10ddff", 0.15, -0.15),
brown = Shade.new("#553200", 0.15, -0.15), brown = Shade.new("#553200", 0.15, -0.15),
bg0 = "#0f1512", -- Dark bg (status line and float) bg0 = "#0f1512", -- Dark bg (status line and float)
bg1 = "#0f1512", -- Default bg bg1 = "#0f1512", -- Default bg
bg2 = "#1b211e", -- Lighter bg (colorcolm folds) bg2 = "#1b211e", -- Lighter bg (colorcolm folds)
bg3 = "#252b28", -- Lighter bg (cursor line) bg3 = "#252b28", -- Lighter bg (cursor line)
bg4 = "#303633", -- Conceal, border fg bg4 = "#303633", -- Conceal, border fg
fg0 = "#dee4df", -- Lighter fg fg0 = "#dee4df", -- Lighter fg
fg1 = "#dee4df", -- Default fg fg1 = "#dee4df", -- Default fg
fg2 = "#dee4df", -- Darker fg (status line) fg2 = "#dee4df", -- Darker fg (status line)
fg3 = "#89938d", -- Darker fg (line numbers, fold colums) fg3 = "#89938d", -- Darker fg (line numbers, fold colums)
sel0 = "#404944", -- Popup bg, visual selection sel0 = "#404944", -- Popup bg, visual selection
sel1 = "#00513b", -- Popup sel bg, search bg sel1 = "#00513b", -- Popup sel bg, search bg
comment = "#89938d", comment = "#89938d",
}, },
@ -77,7 +77,7 @@ return {
statement = "magenta", statement = "magenta",
string = "cyan", string = "cyan",
type = "red", type = "red",
variable = "orange", variable = "orange"
}, },
diag = { diag = {
error = "darkred", error = "darkred",
@ -91,44 +91,44 @@ return {
warn = "#a16b00", warn = "#a16b00",
info = "cyan", info = "cyan",
hint = "bg3", hint = "bg3",
ok = "green", ok = "green";
}, },
diff = { diff = {
add = "darkgreen", add = "darkgreen",
delete = "darkred", delete = "darkred",
changed = "lightblue", changed = "lightblue",
text = "fg0", text = "fg0"
}, },
git = { git = {
add = "darkgreen", add = "darkgreen",
removed = "darkred", removed = "darkred",
changed = "lightblue", changed = "lightblue",
conflict = "orange", conflict = "orange",
ignored = "gray", ignored = "gray"
}, }
}, }
}, },
groups = { groups = {
all = { all = {
Cursor = { fg = "palette.white", bg = "palette.lightblue" }, -- character under the cursor Cursor = { fg = "palette.white", bg = "palette.lightblue" }, -- character under the cursor
WinSeparator = { fg = "palette.bg2" }, -- the column separating vertically split windows 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|. EndOfBuffer = { link = "WinSeparator" }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
CursorLine = { bg = "palette.bg1" }, CursorLine = { bg = "palette.bg1" },
CursorLineNr = { fg = "palette.cyan", style = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. 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. 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" 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 --") ModeMsg = { fg = "palette.fg3", style = "bold" }, -- 'showmode' message (e.g., "-- INSERT --")
NvimTreeRootFolder = { fg = "palette.lightblue", style = "bold" }, NvimTreeRootFolder = { fg = "palette.lightblue", style = "bold" },
NvimTreeFolderName = { fg = "palette.lightblue" }, NvimTreeFolderName = { fg = "palette.lightblue" },
NvimTreeFolderIcon = { fg = "palette.lightblue" }, NvimTreeFolderIcon = { fg = "palette.lightblue" },
NvimTreeOpenedFolderName = { fg = "palette.lightblue" }, NvimTreeOpenedFolderName = { fg = "palette.lightblue" },
NvimTreeSymlinkFolderName = { fg = "palette.magenta" }, NvimTreeSymlinkFolderName = { fg = "palette.magenta" },
NvimTreeExecFile = { fg = "palette.red" }, NvimTreeExecFile = { fg = "palette.red" },
NvimTreeImageFile = { fg = "palette.white" }, NvimTreeImageFile = { fg = "palette.white" },
NvimTreeSpecialFile = { fg = "palette.yellow" }, NvimTreeSpecialFile = { fg = "palette.yellow" },
NvimTreeSymlink = { fg = "palette.magenta" }, NvimTreeSymlink = { fg = "palette.magenta" },
}, },
}, },
}) })

View File

@ -45,17 +45,17 @@ return {
local opts = { silent = true } local opts = { silent = true }
opts.desc = "comment text box" opts.desc = "comment text box"
vim.keymap.set({ "n", "v" }, "<leader>cb", ":CBccbox<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>cb", ":CBccbox<CR>", opts)
opts.desc = "comment text line" opts.desc = "comment text line"
vim.keymap.set({ "n", "v" }, "<leader>cl", ":CBllline<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>cl", ":CBllline<CR>", opts)
opts.desc = "comment line" opts.desc = "comment line"
vim.keymap.set({ "n", "v" }, "<leader>ce", ":CBline<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>ce", ":CBline<CR>", opts)
opts.desc = "comment highlight" opts.desc = "comment highlight"
vim.keymap.set({ "n", "v" }, "<leader>ch", ":CBlcbox18<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>ch", ":CBlcbox18<CR>", opts)
opts.desc = "delete comment box" opts.desc = "delete comment box"
vim.keymap.set({ "n", "v" }, "<leader>cd", ":CBd<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>cd", ":CBd<CR>", opts)
opts.desc = "yank comment box contents" opts.desc = "yank comment box contents"
vim.keymap.set({ "n", "v" }, "<leader>cy", ":CBy<CR>", opts) vim.keymap.set({"n", "v"}, "<leader>cy", ":CBy<CR>", opts)
end, end,
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -11,39 +11,39 @@ return {
type = "text", type = "text",
align = "center", align = "center",
content = { content = {
[[]], [[]],
[[]], [[]],
[[]], [[]],
[[ ]], [[ ]],
[[ ██████ █████ █████ █████ ███ ]], [[ ██████ █████ █████ █████ ███ ]],
[[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]], [[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]],
[[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]], [[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]],
[[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]], [[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]],
[[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]], [[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]],
[[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]], [[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]],
[[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]], [[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]],
[[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]], [[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]],
[[ ]], [[ ]],
}, },
highlight = "String", highlight = "String",
default_color = "#010155", default_color = "#010155"
}, },
quotes = { quotes = {
type = "text", type = "text",
align = "center", align = "center",
content = function() content = function ()
local handle = io.popen("pwd") local handle = io.popen("pwd")
if handle then if handle then
local cwd = handle:read("*l") local cwd = handle:read("*l")
handle:close() handle:close()
return { "Currently in " .. cwd } return {"Currently in " .. cwd}
else else
return { "Error running command" } return {"Error running command"}
end end
end, end,
highlight = "String", highlight = "String",
default_color = "#FFFFFF", default_color = "#FFFFFF"
}, },
old = { old = {
@ -58,12 +58,12 @@ return {
}, },
options = { options = {
mapping_keys = false, mapping_keys = false;
}, },
colors = { colors = {
background = "#000000", background = "#000000",
folded_section = "#100000", folded_section = "#100000"
}, },
mappings = { mappings = {
@ -71,7 +71,7 @@ return {
open_file = "<CR>", open_file = "<CR>",
}, },
parts = { "title", "quotes", "old" }, parts = {"title", "quotes", "old"}
}) })
end, end,
} }

View File

@ -47,16 +47,10 @@ return {
dapui.close() dapui.close()
end end
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = ""})
vim.fn.sign_define( vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
"DapBreakpointCondition", vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = ""})
{ text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = "" } vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
)
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 = { dap.configurations.python = {
{ {
@ -97,7 +91,7 @@ return {
else else
cb({ cb({
type = "executable", 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" }, args = { "-m", "debugpy.adapter" },
options = { options = {
source_filetype = "python", source_filetype = "python",

View File

@ -1,19 +1,19 @@
return { return {
"aznhe21/actions-preview.nvim", "aznhe21/actions-preview.nvim",
config = function() config = function()
-- Configure actions-preview.nvim -- Configure actions-preview.nvim
require("actions-preview").setup({ require("actions-preview").setup({
-- Floating window configuration (optional) -- Floating window configuration (optional)
max_width = 80, -- Max width of the preview window max_width = 80, -- Max width of the preview window
max_height = 12, -- Max height of the preview window max_height = 12, -- Max height of the preview window
min_width = 20, -- Minimum width for the preview window min_width = 20, -- Minimum width for the preview window
min_height = 4, -- Minimum height for the preview window min_height = 4, -- Minimum height for the preview window
-- Keymaps (optional) -- Keymaps (optional)
keymaps = { keymaps = {
-- Trigger code action preview with a keybinding (example using <leader>a) -- Trigger code action preview with a keybinding (example using <leader>a)
{ "n", "<leader>ca", vim.lsp.buf.code_action }, { "n", "<leader>ca", vim.lsp.buf.code_action },
}, },
}) })
end, end,
} }

View File

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

View File

@ -1,13 +1,13 @@
return { return {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
config = function() config = function ()
require("nvim-ts-autotag").setup({ require('nvim-ts-autotag').setup({
opts = { opts = {
-- Defaults -- Defaults
enable_close = true, -- Auto close tags enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of 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

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

View File

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

View File

@ -0,0 +1,15 @@
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 { return {
-- indent lines -- indent lines
"lukas-reineke/indent-blankline.nvim", 'lukas-reineke/indent-blankline.nvim',
opts = {}, opts = {},
main = "ibl", main = 'ibl',
config = function() config = function()
require("ibl").setup() require('ibl').setup()
end, end
} }

View File

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

View File

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

View File

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

View File

@ -4,5 +4,5 @@ return {
event = "VeryLazy", event = "VeryLazy",
config = function() config = function()
require("nvim-surround").setup() require("nvim-surround").setup()
end, end
} }

View File

@ -4,7 +4,7 @@ local M = {}
M.opts = function(desc) M.opts = function(desc)
if desc then if desc then
return { silent = true, desc = desc } return { silent = true, desc = desc}
else else
return { silent = true } return { silent = true }
end end
@ -24,33 +24,30 @@ M.sudo_exec = function(cmd, print_output)
print(out) print(out)
return false return false
end end
if print_output then if print_output then print("\r\n", out) end
print("\r\n", out)
end
return true return true
end end
M.sudo_write = function(tmpfile, filepath) M.sudo_write = function(tmpfile, filepath)
if not tmpfile then if not tmpfile then tmpfile = vim.fn.tempname() end
tmpfile = vim.fn.tempname() if not filepath then filepath = vim.fn.expand("%") end
end
if not filepath then
filepath = vim.fn.expand("%")
end
if not filepath or #filepath == 0 then if not filepath or #filepath == 0 then
print("E32: No file name") print("E32: No file name")
return return
end end
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd -- `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 -- 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)) 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 -- no need to check error as this fails the entire function
vim.api.nvim_exec(string.format("write! %s", tmpfile), true) vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
if M.sudo_exec(cmd) then if M.sudo_exec(cmd) then
-- refreshes the buffer and prints the "written" message -- refreshes the buffer and prints the "written" message
vim.cmd.checktime() vim.cmd.checktime()
-- exit command mode -- exit command mode
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(
"<Esc>", true, false, true), "n", true)
end end
vim.fn.delete(tmpfile) vim.fn.delete(tmpfile)
end end