Laptop #2
|
@ -1,14 +1,7 @@
|
||||||
require('plugins')
|
|
||||||
require('settings')
|
require('settings')
|
||||||
require('color_scheme')
|
require('lazy_config')
|
||||||
require('lsp_config')
|
|
||||||
require('telescope_config')
|
|
||||||
require('treesitter_config')
|
|
||||||
require('lualine_config')
|
|
||||||
require('mappings')
|
require('mappings')
|
||||||
require('nvim_tree_config')
|
|
||||||
require('teaching')
|
require('teaching')
|
||||||
require('wiki_utils')
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", { pattern = "make", command = [[set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab]] })
|
vim.api.nvim_create_autocmd("FileType", { pattern = "make", command = [[set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab]] })
|
||||||
vim.api.nvim_create_autocmd("FileType", { pattern = "vimwiki", command = [[setlocal shiftwidth=2 softtabstop=2 expandtab]] })
|
vim.api.nvim_create_autocmd("FileType", { pattern = "vimwiki", command = [[setlocal shiftwidth=2 softtabstop=2 expandtab]] })
|
||||||
|
|
|
@ -12,17 +12,17 @@
|
||||||
"formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" },
|
"formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
|
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
|
||||||
"neogit": { "branch": "master", "commit": "bd69620be5a2f50fe0ef39236f8c0009d16e4993" },
|
"neogit": { "branch": "master", "commit": "38dd297a905ec6869f4c20ea9184a3e514316e3b" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
|
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "e47ccfae775f0d572ef0f3a7d245f043b259dafc" },
|
"nvim-lspconfig": { "branch": "master", "commit": "7eed8b2150192e5ad05e1886fdf133493ddf2928" },
|
||||||
"nvim-snippy": { "branch": "master", "commit": "7c8f18e90cad4f56c4e22a49101668735639f286" },
|
"nvim-snippy": { "branch": "master", "commit": "8e4e39a4bf5f8939fcf4898d1fba48d1d1f72303" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "59e65d88db177ad1e6a8cffaafd4738420ad20b6" },
|
"nvim-tree.lua": { "branch": "master", "commit": "59e65d88db177ad1e6a8cffaafd4738420ad20b6" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
|
"nvim-treesitter": { "branch": "master", "commit": "07c8c3d84f67b1530f636dcad31971f569a3df5f" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "584038666b0d8124d452a2e8ea9e38e6d6e56490" },
|
"nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "c4cc8240f1c71defcb67c45da96e44b968d29e5f" },
|
"oil.nvim": { "branch": "master", "commit": "dd432e76d01eda08b8658415588d011009478469" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||||
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
|
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
"vim-bracketed-paste": { "branch": "master", "commit": "45411da73cc159e4fc2138d930553d247bbfbcdc" },
|
"vim-bracketed-paste": { "branch": "master", "commit": "45411da73cc159e4fc2138d930553d247bbfbcdc" },
|
||||||
"vim-hypr-nav": { "branch": "main", "commit": "6ab4865a7eb5aad35305298815a4563c9d48556a" },
|
"vim-hypr-nav": { "branch": "main", "commit": "6ab4865a7eb5aad35305298815a4563c9d48556a" },
|
||||||
"vim-rooter": { "branch": "master", "commit": "1353fa47ee3a81083c284e28ff4f7d92655d7c9e" },
|
"vim-rooter": { "branch": "master", "commit": "1353fa47ee3a81083c284e28ff4f7d92655d7c9e" },
|
||||||
"vim-snippets": { "branch": "master", "commit": "ba72b08e04e184ecd0a2a1b8012a81ddb040dbc3" },
|
"vim-snippets": { "branch": "master", "commit": "75cd3fd2a22b8d6eefd553f386e0705e7d2cd4a6" },
|
||||||
"vimtex": { "branch": "master", "commit": "8352d7380a0ea26f9f2ad09e57ccf90b4bd1c746" },
|
"vimtex": { "branch": "master", "commit": "5af72cfa813640848a76a41044829d9cb0e2e3db" },
|
||||||
"vimwiki": { "branch": "dev", "commit": "0bb1b4945bb205a076a35b66174e5d66be8eaafe" }
|
"vimwiki": { "branch": "dev", "commit": "0bb1b4945bb205a076a35b66174e5d66be8eaafe" }
|
||||||
}
|
}
|
|
@ -1,47 +0,0 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
local hascatppuccin, catppuccin = pcall(require, "catppuccin")
|
|
||||||
|
|
||||||
if not hascatppuccin then
|
|
||||||
return M
|
|
||||||
end
|
|
||||||
|
|
||||||
catppuccin.setup({
|
|
||||||
flavour = "mocha",
|
|
||||||
integrations = {
|
|
||||||
mason = true,
|
|
||||||
lsp_trouble = true,
|
|
||||||
vimwiki = true
|
|
||||||
},
|
|
||||||
custom_highlights = function(colors)
|
|
||||||
return {
|
|
||||||
TelescopeNormal = { bg = "#191926"},
|
|
||||||
TelescopeBorder = { bg = "#191926", fg = "#191926" },
|
|
||||||
TelescopePromptBorder = { bg = "#191926", fg = "#191926" },
|
|
||||||
TelescopeTitle = { fg = colors.blue },
|
|
||||||
WinSeparator = { fg = "#191926" }
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
color_overrides = {
|
|
||||||
mocha = {
|
|
||||||
-- this 16 colors are changed to onedark
|
|
||||||
base = "#11121D",
|
|
||||||
text = "#abb2bf",
|
|
||||||
rosewater = "#b6bdca",
|
|
||||||
lavender = "#ed8897",
|
|
||||||
red = "#e06c75",
|
|
||||||
peach = "#d19a66",
|
|
||||||
yellow = "#e5c07b",
|
|
||||||
green = "#98c379",
|
|
||||||
teal = "#56b6c2",
|
|
||||||
blue = "#61afef",
|
|
||||||
mauve = "#c678dd",
|
|
||||||
flamingo = "#be5046",
|
|
||||||
pink="#ef9f76"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.cmd("colorscheme catppuccin")
|
|
||||||
|
|
||||||
return M
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
-- Install Lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
require("lazy").setup("plugins")
|
|
@ -1,300 +0,0 @@
|
||||||
-- Setup nvim-cmp.lsp
|
|
||||||
local hascmp, cmp = pcall(require, "cmp")
|
|
||||||
if not hascmp then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local select_next = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
if require'snippy'.can_expand_or_advance() then
|
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
|
||||||
else
|
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
|
|
||||||
end
|
|
||||||
elseif require'snippy'.can_expand_or_advance() then
|
|
||||||
require'snippy'.expand_or_advance()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local select_previous = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
if require'snippy'.can_expand_or_advance() then
|
|
||||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
|
||||||
else
|
|
||||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert })
|
|
||||||
end
|
|
||||||
elseif require'snippy'.can_jump(-1) then
|
|
||||||
require'snippy'.previous()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
-- REQUIRED - you must specify a snippet engine
|
|
||||||
expand = function(args)
|
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
||||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<Tab>"] = cmp.mapping(select_next, { "i", "s" }),
|
|
||||||
["<C-J>"] = cmp.mapping(select_next, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(select_previous, { "i", "s" }),
|
|
||||||
["<C-K>"] = cmp.mapping(select_previous, { "i", "s" }),
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'path' },
|
|
||||||
-- { name = 'vsnip' }, -- For vsnip users.
|
|
||||||
-- { name = 'luasnip' }, -- For luasnip users.
|
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
|
||||||
{ name = 'snippy' }, -- For snippy users.
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
require('snippy').setup({
|
|
||||||
mappings = {
|
|
||||||
is = {
|
|
||||||
['<leader><Tab>'] = 'expand_or_advance',
|
|
||||||
['<leader><S-Tab>'] = 'previous',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Set configuration for specific filetype.
|
|
||||||
cmp.setup.filetype('gitcommit', {
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
|
||||||
cmp.setup.cmdline('/', {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = {
|
|
||||||
{ name = 'buffer' }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
|
||||||
cmp.setup.cmdline(':', {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'path' }
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
local cmp_completion = require('nvim-autopairs.completion.cmp')
|
|
||||||
cmp.event:on('confirm_done',cmp_completion.on_confirm_done())
|
|
||||||
|
|
||||||
-- Setup lspconfig.
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
|
|
||||||
require("mason").setup {
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
package_installed = "✓"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
require("mason-lspconfig").setup {
|
|
||||||
ensure_installed = { "pyright", "texlab", "clangd", "bashls", "cmake", "jsonls", "tsserver", "vuels", "dockerls", "vimls", "html", "yamlls", "cssls", "lua_ls", "ltex", "gopls", "rust_analyzer", "jdtls", "emmet_ls", "ruff_lsp" },
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').pyright.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
python = {
|
|
||||||
analysis = {
|
|
||||||
typeCheckingMode = "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').texlab.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').clangd.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
-- root_dir = function()
|
|
||||||
-- return require('lspconfig').util.root_pattern({'.clang-format', 'build/', 'compile_flags.txt'})
|
|
||||||
-- end,
|
|
||||||
cmd = {
|
|
||||||
"clangd",
|
|
||||||
"--background-index",
|
|
||||||
"--clang-tidy",
|
|
||||||
"-j=8",
|
|
||||||
"--clang-tidy-checks=*",
|
|
||||||
"--all-scopes-completion",
|
|
||||||
"--completion-style=bundled",
|
|
||||||
"--cross-file-rename",
|
|
||||||
"--completion-style=detailed",
|
|
||||||
"--header-insertion-decorators",
|
|
||||||
"--header-insertion=iwyu",
|
|
||||||
"--pch-storage=memory"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').bashls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').cmake.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').jsonls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').tsserver.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').kotlin_language_server.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').vuels.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').dockerls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').vimls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').html.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').emmet_ls.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
|
|
||||||
init_options = {
|
|
||||||
html = {
|
|
||||||
options = {
|
|
||||||
["bem.enabled"] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require('lspconfig').yamlls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').cssls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').jdtls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').rust_analyzer.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').gopls.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').ruff_lsp.setup {
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').lua_ls.setup {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
runtime = {
|
|
||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
|
||||||
version = 'LuaJIT',
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
-- Get the language server to recognize the `vim` global
|
|
||||||
globals = {'vim', 'use', 'awesome', 'client', 'root'},
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
-- Make the server aware of Neovim runtime files
|
|
||||||
library = {
|
|
||||||
['/usr/share/nvim/runtime/lua'] = true,
|
|
||||||
['/usr/share/nvim/runtime/lua/lsp'] = true,
|
|
||||||
['/usr/share/awesome/lib'] = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
|
||||||
telemetry = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lspconfig').ltex.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = function(_, _)
|
|
||||||
require("ltex_extra").setup{
|
|
||||||
load_langs = {"nl-BE", "en-GB"},
|
|
||||||
init_check = true,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
settings = {
|
|
||||||
ltex = {
|
|
||||||
enabled = true,
|
|
||||||
language = "en-GB"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = false
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
|
||||||
require("formatter").setup {
|
|
||||||
filetype = {
|
|
||||||
lua = {
|
|
||||||
require("formatter.filetypes.lua").stylua,
|
|
||||||
},
|
|
||||||
python = {
|
|
||||||
require("formatter.filetypes.python").black,
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Show line diagnostics automatically in hover window
|
|
||||||
vim.o.updatetime = 250
|
|
||||||
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>n", vim.diagnostic.goto_next, { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader>p", vim.diagnostic.goto_prev, { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.code_action, { silent = true })
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { silent = true })
|
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, { silent = true })
|
|
||||||
vim.keymap.set("n", "<space>", vim.lsp.buf.hover, { noremap = true, silent = true })
|
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { noremap = true, silent = true })
|
|
|
@ -1,31 +0,0 @@
|
||||||
local haslualine, lualine = pcall(require, "lualine")
|
|
||||||
if not haslualine then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local function getWords()
|
|
||||||
return tostring(vim.fn.wordcount().words) .. " Words"
|
|
||||||
end
|
|
||||||
|
|
||||||
lualine.setup({
|
|
||||||
options = {
|
|
||||||
theme = 'nightfly',
|
|
||||||
globalstatus = true
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {'mode'},
|
|
||||||
lualine_b = {'diff', 'diagnostics'},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
|
||||||
lualine_y = {'filesize', getWords},
|
|
||||||
lualine_z = {'branch'},
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {'mode'},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {},
|
|
||||||
lualine_y = {'filesize'},
|
|
||||||
lualine_z = {'branch'},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,27 +0,0 @@
|
||||||
local hastree, tree = pcall(require, "nvim-tree")
|
|
||||||
if not hastree then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
tree.setup({
|
|
||||||
sort_by = "case_sensitive",
|
|
||||||
sync_root_with_cwd = true,
|
|
||||||
update_focused_file = {
|
|
||||||
update_root = true,
|
|
||||||
},
|
|
||||||
view = {
|
|
||||||
adaptive_size = true,
|
|
||||||
mappings = {
|
|
||||||
list = {
|
|
||||||
{key = "cd", action = "cd"},
|
|
||||||
{key = "<backspace>", action = "close"},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
group_empty = true,
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
dotfiles = true,
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,63 +0,0 @@
|
||||||
-- Install Lazy.nvim
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git",
|
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable", -- latest stable release
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require('lazy').setup({
|
|
||||||
'ConradIrwin/vim-bracketed-paste',
|
|
||||||
'airblade/vim-rooter',
|
|
||||||
'nuchs/vim-hypr-nav',
|
|
||||||
'luckasRanarison/tree-sitter-hypr',
|
|
||||||
'debugloop/telescope-undo.nvim',
|
|
||||||
'mhartington/formatter.nvim',
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin"},
|
|
||||||
{'vimwiki/vimwiki', init = function ()
|
|
||||||
vim.g.vimwiki_list = {{path = '~/Workspace/DnD/Lumentis Campaign Setting/', syntax = 'markdown', ext = '.md'}}
|
|
||||||
vim.g.vimwiki_key_mappings = { table_mappings = 0 }
|
|
||||||
vim.g.vimwiki_markdown_link_ext = 1
|
|
||||||
vim.g.vimwiki_global_ext = 0
|
|
||||||
end},
|
|
||||||
{'stevearc/oil.nvim', opts = {
|
|
||||||
keymaps = {
|
|
||||||
["g?"] = "actions.show_help",
|
|
||||||
["<CR>"] = "actions.select",
|
|
||||||
["<leader>v"] = "actions.select_vsplit",
|
|
||||||
["<leader>s"] = "actions.select_split",
|
|
||||||
["<leader>p"] = "actions.preview",
|
|
||||||
["<backspace>"] = "actions.close",
|
|
||||||
["<leader>r"] = "actions.refresh",
|
|
||||||
["-"] = "actions.parent",
|
|
||||||
["_"] = "actions.open_cwd",
|
|
||||||
["`"] = "actions.cd",
|
|
||||||
["~"] = "actions.tcd",
|
|
||||||
["g."] = "actions.toggle_hidden",
|
|
||||||
},
|
|
||||||
-- Set to false to disable all of the above keymaps
|
|
||||||
use_default_keymaps = false,
|
|
||||||
}, dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true},
|
|
||||||
{'windwp/nvim-autopairs', event = "InsertEnter", opts = {}},
|
|
||||||
{"folke/flash.nvim", event = "VeryLazy", opts = {highlight = {backdrop=false}, modes = {char = {highlight = {backdrop = false}}, search = {enabled = false}}, prompt = {enabled = false}}, keys = {{"s", mode = {"n","x","o"}, function() require("flash").jump() end}}},
|
|
||||||
{'NeogitOrg/neogit', dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "sindrets/diffview.nvim"}, config = true, lazy = true},
|
|
||||||
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'},
|
|
||||||
{'cappyzawa/trim.nvim', config = function () require("trim").setup({ ft_blocklist= {"markdown", "vimwiki"}, patterns = { [[%s/\s\+$//e]], [[%s/\($\n\s*\)\+\%$//]], [[%s/\%^\n\+//]], }, }) end},
|
|
||||||
{'folke/trouble.nvim', dependencies = {"nvim-tree/nvim-web-devicons"}, config = function () require('trouble').setup() end, lazy = true},
|
|
||||||
{'hrsh7th/nvim-cmp', dependencies = {'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'dcampos/nvim-snippy', 'honza/vim-snippets','dcampos/cmp-snippy' }},
|
|
||||||
{'lervag/vimtex', ft='latex'},
|
|
||||||
{'numToStr/Comment.nvim', config = function () require('Comment').setup() end},
|
|
||||||
{'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons', opt = true }},
|
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' },
|
|
||||||
{'nvim-telescope/telescope.nvim', dependencies = {'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-fzy-native.nvim'}},
|
|
||||||
{'nvim-tree/nvim-tree.lua', dependencies = {'nvim-tree/nvim-web-devicons'}, tag = 'nightly'},
|
|
||||||
{'nvim-treesitter/nvim-treesitter', build = ":TSUpdate"},
|
|
||||||
{'williamboman/mason-lspconfig.nvim', dependencies = {'williamboman/mason.nvim', 'neovim/nvim-lspconfig'}},
|
|
||||||
-- {dir = '~/.config/nvim/colorschemes/material', dependencies= {"rktjmp/lush.nvim"}},
|
|
||||||
})
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
opts = {
|
||||||
|
flavour = "mocha",
|
||||||
|
integrations = {
|
||||||
|
mason = true,
|
||||||
|
lsp_trouble = true,
|
||||||
|
vimwiki = true
|
||||||
|
},
|
||||||
|
custom_highlights = function(colors)
|
||||||
|
return {
|
||||||
|
TelescopeNormal = { bg = "#191926"},
|
||||||
|
TelescopeBorder = { bg = "#191926", fg = "#191926" },
|
||||||
|
TelescopePromptBorder = { bg = "#191926", fg = "#191926" },
|
||||||
|
TelescopeTitle = { fg = colors.blue },
|
||||||
|
WinSeparator = { fg = "#191926" }
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
color_overrides = {
|
||||||
|
mocha = {
|
||||||
|
-- this 16 colors are changed to onedark
|
||||||
|
base = "#11121D",
|
||||||
|
text = "#abb2bf",
|
||||||
|
rosewater = "#b6bdca",
|
||||||
|
lavender = "#ed8897",
|
||||||
|
red = "#e06c75",
|
||||||
|
peach = "#d19a66",
|
||||||
|
yellow = "#e5c07b",
|
||||||
|
green = "#98c379",
|
||||||
|
teal = "#56b6c2",
|
||||||
|
blue = "#61afef",
|
||||||
|
mauve = "#c678dd",
|
||||||
|
flamingo = "#be5046",
|
||||||
|
pink="#ef9f76"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
config = function (_, opts)
|
||||||
|
require("catppuccin").setup(opts)
|
||||||
|
vim.cmd("colorscheme catppuccin")
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
return {
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
highlight = {backdrop=false},
|
||||||
|
modes = {char = {highlight = {backdrop = false}}, search = {enabled = false}},
|
||||||
|
prompt = {enabled = false}
|
||||||
|
},
|
||||||
|
keys = {{"s", mode = {"n","x","o"}, function() require("flash").jump() end}}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
'mhartington/formatter.nvim',
|
||||||
|
config = function ()
|
||||||
|
require("formatter").setup({
|
||||||
|
filetype = {
|
||||||
|
lua = {
|
||||||
|
require("formatter.filetypes.lua").stylua,
|
||||||
|
},
|
||||||
|
python = {
|
||||||
|
require("formatter.filetypes.python").black,
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
'ConradIrwin/vim-bracketed-paste',
|
||||||
|
'airblade/vim-rooter',
|
||||||
|
'nuchs/vim-hypr-nav',
|
||||||
|
'luckasRanarison/tree-sitter-hypr',
|
||||||
|
'debugloop/telescope-undo.nvim',
|
||||||
|
{'windwp/nvim-autopairs', event = "InsertEnter", opts = {}},
|
||||||
|
{'NeogitOrg/neogit', dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "sindrets/diffview.nvim"}, config = true, lazy = true},
|
||||||
|
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'},
|
||||||
|
{'folke/trouble.nvim', dependencies = {"nvim-tree/nvim-web-devicons"}, config = function () require('trouble').setup() end, lazy = true},
|
||||||
|
{'lervag/vimtex', ft='latex'},
|
||||||
|
{'numToStr/Comment.nvim', config = function () require('Comment').setup() end},
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
local function getWords()
|
||||||
|
return tostring(vim.fn.wordcount().words) .. " Words"
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
theme = 'nightfly',
|
||||||
|
globalstatus = true
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {'diff', 'diagnostics'},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_y = {'filesize', getWords},
|
||||||
|
lualine_z = {'branch'},
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {},
|
||||||
|
lualine_y = {'filesize'},
|
||||||
|
lualine_z = {'branch'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
dependencies = {
|
||||||
|
{'williamboman/mason.nvim', opts = {
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "pyright", "texlab", "clangd", "bashls", "cmake", "jsonls", "tsserver", "vuels", "dockerls", "vimls", "html", "yamlls", "cssls", "lua_ls", "ltex", "gopls", "rust_analyzer", "jdtls", "emmet_ls", "ruff_lsp" },
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,268 @@
|
||||||
|
local function select_next(fallback)
|
||||||
|
if require("cmp").visible() then
|
||||||
|
if require'snippy'.can_expand_or_advance() then
|
||||||
|
require("cmp").select_next_item({ behavior = require("cmp").SelectBehavior.Select })
|
||||||
|
else
|
||||||
|
require("cmp").select_next_item({ behavior = require("cmp").SelectBehavior.Insert })
|
||||||
|
end
|
||||||
|
elseif require'snippy'.can_expand_or_advance() then
|
||||||
|
require'snippy'.expand_or_advance()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function select_previous(fallback)
|
||||||
|
if require("cmp").visible() then
|
||||||
|
if require'snippy'.can_expand_or_advance() then
|
||||||
|
require("cmp").select_prev_item({ behavior = require("cmp").SelectBehavior.Select })
|
||||||
|
else
|
||||||
|
require("cmp").select_prev_item({ behavior = require("cmp").SelectBehavior.Insert })
|
||||||
|
end
|
||||||
|
elseif require'snippy'.can_jump(-1) then
|
||||||
|
require'snippy'.previous()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'honza/vim-snippets',
|
||||||
|
'dcampos/cmp-snippy',
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
{'dcampos/nvim-snippy', opts = {
|
||||||
|
mappings = {
|
||||||
|
is = {
|
||||||
|
['<leader><Tab>'] = 'expand_or_advance',
|
||||||
|
['<leader><S-Tab>'] = 'previous',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{"<leader>n", vim.diagnostic.goto_next},
|
||||||
|
{"<leader>p", vim.diagnostic.goto_prev},
|
||||||
|
{"<leader>f", vim.lsp.buf.code_action},
|
||||||
|
{"gd", vim.lsp.buf.definition},
|
||||||
|
{"gr", vim.lsp.buf.references},
|
||||||
|
{"<space>", vim.lsp.buf.hover},
|
||||||
|
{"<leader>rn", vim.lsp.buf.rename},
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
config = function ()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.setup({
|
||||||
|
snippet = { expand = function(args) require('snippy').expand_snippet(args.body) end },
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<Tab>"] = cmp.mapping(select_next, { "i", "s" }),
|
||||||
|
["<C-J>"] = cmp.mapping(select_next, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(select_previous, { "i", "s" }),
|
||||||
|
["<C-K>"] = cmp.mapping(select_previous, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'path' }, { name = 'snippy' }, }, { { name = 'buffer' } })
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set configuration for specific filetype.
|
||||||
|
cmp.setup.filetype('gitcommit', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
local cmp_completion = require('nvim-autopairs.completion.cmp')
|
||||||
|
cmp.event:on('confirm_done',cmp_completion.on_confirm_done())
|
||||||
|
|
||||||
|
-- Setup lspconfig.
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
|
require('lspconfig').pyright.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').texlab.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').clangd.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
-- root_dir = function()
|
||||||
|
-- return require('lspconfig').util.root_pattern({'.clang-format', 'build/', 'compile_flags.txt'})
|
||||||
|
-- end,
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--background-index",
|
||||||
|
"--clang-tidy",
|
||||||
|
"-j=8",
|
||||||
|
"--clang-tidy-checks=*",
|
||||||
|
"--all-scopes-completion",
|
||||||
|
"--completion-style=bundled",
|
||||||
|
"--cross-file-rename",
|
||||||
|
"--completion-style=detailed",
|
||||||
|
"--header-insertion-decorators",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
|
"--pch-storage=memory"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').bashls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').cmake.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').jsonls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').tsserver.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').kotlin_language_server.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').vuels.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').dockerls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').vimls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').html.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').emmet_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
|
||||||
|
init_options = {
|
||||||
|
html = {
|
||||||
|
options = {
|
||||||
|
["bem.enabled"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
require('lspconfig').yamlls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').cssls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').jdtls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').rust_analyzer.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').gopls.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').ruff_lsp.setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').lua_ls.setup {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = {'vim', 'use', 'awesome', 'client', 'root'},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = {
|
||||||
|
['/usr/share/nvim/runtime/lua'] = true,
|
||||||
|
['/usr/share/nvim/runtime/lua/lsp'] = true,
|
||||||
|
['/usr/share/awesome/lib'] = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lspconfig').ltex.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = function(_, _)
|
||||||
|
require("ltex_extra").setup{
|
||||||
|
load_langs = {"nl-BE", "en-GB"},
|
||||||
|
init_check = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
enabled = true,
|
||||||
|
language = "en-GB"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Show line diagnostics automatically in hover window
|
||||||
|
vim.cmd("autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})")
|
||||||
|
end,
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
return {
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
dependencies = {'nvim-tree/nvim-web-devicons'},
|
||||||
|
tag = 'nightly',
|
||||||
|
opts = {
|
||||||
|
sort_by = "case_sensitive",
|
||||||
|
sync_root_with_cwd = true,
|
||||||
|
update_focused_file = {
|
||||||
|
update_root = true,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
adaptive_size = true,
|
||||||
|
mappings = {
|
||||||
|
list = {
|
||||||
|
{key = "cd", action = "cd"},
|
||||||
|
{key = "<backspace>", action = "close"},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
group_empty = true,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
return {
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true,
|
||||||
|
opts = {
|
||||||
|
keymaps = {
|
||||||
|
["g?"] = "actions.show_help",
|
||||||
|
["<CR>"] = "actions.select",
|
||||||
|
["<leader>v"] = "actions.select_vsplit",
|
||||||
|
["<leader>s"] = "actions.select_split",
|
||||||
|
["<leader>p"] = "actions.preview",
|
||||||
|
["<backspace>"] = "actions.close",
|
||||||
|
["<leader>r"] = "actions.refresh",
|
||||||
|
["-"] = "actions.parent",
|
||||||
|
["_"] = "actions.open_cwd",
|
||||||
|
["`"] = "actions.cd",
|
||||||
|
["~"] = "actions.tcd",
|
||||||
|
["g."] = "actions.toggle_hidden",
|
||||||
|
},
|
||||||
|
-- Set to false to disable all of the above keymaps
|
||||||
|
use_default_keymaps = false,
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,92 @@
|
||||||
|
return {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-telescope/telescope-fzy-native.nvim',
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = {
|
||||||
|
".cache/.*",
|
||||||
|
"node_modules/.*",
|
||||||
|
".git/.*",
|
||||||
|
"Venv/.*",
|
||||||
|
"venv/.*",
|
||||||
|
"wandb/.*",
|
||||||
|
"Resources/.*",
|
||||||
|
"build/.*"
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["jj"] = require("telescope.actions").close,
|
||||||
|
["<C-j>"] = require("telescope.actions").move_selection_next,
|
||||||
|
["<C-k>"] = require("telescope.actions").move_selection_previous,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file_sorter = require'telescope.sorters'.get_fzy_sorter,
|
||||||
|
generic_sorter = require'telescope.sorters'.get_fzy_sorter,
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
undo = {
|
||||||
|
side_by_side = false,
|
||||||
|
layout_strategy = "vertical",
|
||||||
|
use_delta = true,
|
||||||
|
layout_config = {
|
||||||
|
preview_height = 0.5,
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<cr>"] = require("telescope-undo.actions").restore,
|
||||||
|
["<S-y>"] = require("telescope-undo.actions").yank_additions,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fzy_native = {
|
||||||
|
override_generic_sorter = false,
|
||||||
|
override_file_sorter = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>u", require("telescope").extensions.undo.undo},
|
||||||
|
{ "<C-Space>", require("telescope.builtin").oldfiles},
|
||||||
|
{ "<C-p>", function () -- git files
|
||||||
|
local opts = require('telescope.themes').get_ivy({})
|
||||||
|
opts["show_untracked"] = true
|
||||||
|
opts["layout_config"] = {height=0.2}
|
||||||
|
if not pcall(require"telescope.builtin".git_files, opts) then
|
||||||
|
require"telescope.builtin".find_files(opts)
|
||||||
|
end
|
||||||
|
end},
|
||||||
|
{ "<C-o>", function () -- project files
|
||||||
|
local opts = require('telescope.themes').get_ivy({})
|
||||||
|
opts["layout_config"] = {height=0.2}
|
||||||
|
require"telescope.builtin".find_files(opts)
|
||||||
|
end},
|
||||||
|
{ "<C-S-o>", function () -- buffer files
|
||||||
|
local opts = require('telescope.themes').get_ivy({})
|
||||||
|
opts["layout_config"] = {height=0.2}
|
||||||
|
require"telescope.builtin".buffers(opts)
|
||||||
|
end},
|
||||||
|
{ "<C-f>", function () -- fuzzy search
|
||||||
|
require"telescope.builtin".grep_string({
|
||||||
|
path_display = { 'smart' },
|
||||||
|
only_sort_text = true,
|
||||||
|
word_match = "-w",
|
||||||
|
search = '',
|
||||||
|
})
|
||||||
|
end},
|
||||||
|
},
|
||||||
|
config = function (_, opts)
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup(opts)
|
||||||
|
telescope.load_extension("undo")
|
||||||
|
telescope.load_extension('fzf')
|
||||||
|
telescope.load_extension('fzy_native')
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
return {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ":TSUpdate",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml" },
|
||||||
|
auto_install = true,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
disable = function(lang, buf) -- Disable if file size is too big
|
||||||
|
if lang == "ini" or lang == "markdown" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
local max_filesize = 2000 * 1024 -- 2MB
|
||||||
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||||
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function (_, opts)
|
||||||
|
require("nvim-treesitter").setup(opts)
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
parser_config.hypr = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/luckasRanarison/tree-sitter-hypr",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
branch = "master",
|
||||||
|
},
|
||||||
|
filetype = "hypr",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
'cappyzawa/trim.nvim',
|
||||||
|
opts = { ft_blocklist= {"markdown", "vimwiki"}, patterns = { [[%s/\s\+$//e]], [[%s/\($\n\s*\)\+\%$//]], [[%s/\%^\n\+//]], },}
|
||||||
|
}
|
|
@ -1,12 +1,10 @@
|
||||||
local pickers = require("telescope.pickers")
|
local pickers = require("telescope.pickers")
|
||||||
local actions = require "telescope.actions"
|
local actions = require "telescope.actions"
|
||||||
local action_state = require "telescope.actions.state"
|
local action_state = require("telescope.actions.state")
|
||||||
local finders = require("telescope.finders")
|
local finders = require("telescope.finders")
|
||||||
local conf = require("telescope.config").values
|
local conf = require("telescope.config").values
|
||||||
|
|
||||||
local wiki_utils = {}
|
local root_path = '/home/user/Workspace/DnD/Lumentis Campaign Setting'
|
||||||
|
|
||||||
local root_path = '/home/server/Workspace/DnD/Lumentis Campaign Setting'
|
|
||||||
|
|
||||||
local function get_title(file)
|
local function get_title(file)
|
||||||
for line in io.lines(file) do
|
for line in io.lines(file) do
|
||||||
|
@ -17,8 +15,7 @@ local function get_title(file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- our picker function: colors
|
local function choose_link(opts, titles, links)
|
||||||
local choose_link = function(opts, titles, links)
|
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
pickers.new(opts, {
|
pickers.new(opts, {
|
||||||
prompt_title = "Choose a file",
|
prompt_title = "Choose a file",
|
||||||
|
@ -37,7 +34,7 @@ local choose_link = function(opts, titles, links)
|
||||||
}):find()
|
}):find()
|
||||||
end
|
end
|
||||||
|
|
||||||
function wiki_utils.insert_link()
|
local function insert_link()
|
||||||
local scan = require("plenary.scandir").scan_dir(root_path)
|
local scan = require("plenary.scandir").scan_dir(root_path)
|
||||||
local titles = {}
|
local titles = {}
|
||||||
local links = {}
|
local links = {}
|
||||||
|
@ -55,8 +52,18 @@ function wiki_utils.insert_link()
|
||||||
choose_link(require("telescope.themes").get_dropdown{}, titles, links)
|
choose_link(require("telescope.themes").get_dropdown{}, titles, links)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("InsertWikiLink", wiki_utils.insert_link, {})
|
return {
|
||||||
vim.keymap.set("n", "<leader>l", wiki_utils.insert_link, { noremap = true, silent = true })
|
'vimwiki/vimwiki',
|
||||||
vim.keymap.set("i", "<leader>l", wiki_utils.insert_link, { noremap = true, silent = true })
|
dependencies = {'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim'},
|
||||||
|
init = function ()
|
||||||
return wiki_utils
|
vim.g.vimwiki_list = {{path = '~/Workspace/DnD/Lumentis Campaign Setting/', syntax = 'markdown', ext = '.md'}}
|
||||||
|
vim.g.vimwiki_key_mappings = { table_mappings = 0 }
|
||||||
|
vim.g.vimwiki_markdown_link_ext = 1
|
||||||
|
vim.g.vimwiki_global_ext = 0
|
||||||
|
end,
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{"<leader>l", insert_link},
|
||||||
|
{"<leader>l", insert_link, mode="i"}
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,6 +37,7 @@ vim.wo.relativenumber = true
|
||||||
vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/", "meson.build"}
|
vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/", "meson.build"}
|
||||||
vim.g.rooter_silent_chdir = 1
|
vim.g.rooter_silent_chdir = 1
|
||||||
vim.opt.shada = "!,'2000,f1,<50,s10,h"
|
vim.opt.shada = "!,'2000,f1,<50,s10,h"
|
||||||
|
vim.o.updatetime = 250
|
||||||
|
|
||||||
-- Vimtex
|
-- Vimtex
|
||||||
vim.g.tex_flavor = 'latex'
|
vim.g.tex_flavor = 'latex'
|
||||||
|
|
|
@ -1,97 +0,0 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
local hastelescope, telescope= pcall(require, "telescope")
|
|
||||||
|
|
||||||
if not hastelescope then
|
|
||||||
return M
|
|
||||||
end
|
|
||||||
|
|
||||||
M.git_files = function()
|
|
||||||
local opts = require('telescope.themes').get_ivy({})
|
|
||||||
opts["show_untracked"] = true
|
|
||||||
opts["layout_config"] = {height=0.2}
|
|
||||||
if not pcall(require"telescope.builtin".git_files, opts) then
|
|
||||||
require"telescope.builtin".find_files(opts)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
M.project_files = function()
|
|
||||||
local opts = require('telescope.themes').get_ivy({})
|
|
||||||
opts["layout_config"] = {height=0.2}
|
|
||||||
require"telescope.builtin".find_files(opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
M.buffers = function()
|
|
||||||
local opts = require('telescope.themes').get_ivy({})
|
|
||||||
opts["layout_config"] = {height=0.2}
|
|
||||||
require"telescope.builtin".buffers(opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
M.fuzzyFindFiles = function()
|
|
||||||
require"telescope.builtin".grep_string({
|
|
||||||
path_display = { 'smart' },
|
|
||||||
only_sort_text = true,
|
|
||||||
word_match = "-w",
|
|
||||||
search = '',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local actions = require("telescope.actions")
|
|
||||||
require("telescope").setup{
|
|
||||||
defaults = {
|
|
||||||
file_ignore_patterns = {
|
|
||||||
".cache/.*",
|
|
||||||
"node_modules/.*",
|
|
||||||
".git/.*",
|
|
||||||
"Venv/.*",
|
|
||||||
"venv/.*",
|
|
||||||
"wandb/.*",
|
|
||||||
"Resources/.*",
|
|
||||||
"build/.*"
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["jj"] = actions.close,
|
|
||||||
["<C-j>"] = actions.move_selection_next,
|
|
||||||
["<C-k>"] = actions.move_selection_previous,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
file_sorter = require'telescope.sorters'.get_fzy_sorter,
|
|
||||||
generic_sorter = require'telescope.sorters'.get_fzy_sorter,
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
undo = {
|
|
||||||
side_by_side = false,
|
|
||||||
layout_strategy = "vertical",
|
|
||||||
use_delta = true,
|
|
||||||
layout_config = {
|
|
||||||
preview_height = 0.5,
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<cr>"] = require("telescope-undo.actions").restore,
|
|
||||||
["<S-y>"] = require("telescope-undo.actions").yank_additions,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fzy_native = {
|
|
||||||
override_generic_sorter = false,
|
|
||||||
override_file_sorter = true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
telescope.load_extension("undo")
|
|
||||||
telescope.load_extension('fzf')
|
|
||||||
telescope.load_extension('fzy_native')
|
|
||||||
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>u", function() require("telescope").extensions.undo.undo() end, {noremap = true, silent = true})
|
|
||||||
vim.keymap.set("n", "<C-p>", function() require('telescope_config').git_files() end, {noremap = true, silent = true})
|
|
||||||
vim.keymap.set("n", "<C-O>", function() require('telescope_config').project_files() end, { silent = true, noremap = true })
|
|
||||||
vim.keymap.set("n", "<C-Space>", function() require('telescope.builtin').oldfiles() end, { silent = true, noremap = true })
|
|
||||||
-- vim.keymap.set("n", "<C-f>", function() require('telescope.builtin').live_grep{ cwd = vim.fn.systemlist("git rev-parse --show-toplevel 2> /dev/null || pwd")[1] } end, { silent = true, noremap = true })
|
|
||||||
vim.keymap.set("n", "<C-f>", function() require('telescope_config').fuzzyFindFiles() end, { silent = true, noremap = true })
|
|
||||||
|
|
||||||
return M
|
|
|
@ -1,36 +0,0 @@
|
||||||
local hastreesitter, treesitter = pcall(require, "nvim-treesitter.configs")
|
|
||||||
if not hastreesitter then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
treesitter.setup({
|
|
||||||
ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml" },
|
|
||||||
auto_install = true,
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
disable = function(lang, buf) -- Disable if file size is too big
|
|
||||||
if lang == "ini" or lang == "markdown" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local max_filesize = 2000 * 1024 -- 2MB
|
|
||||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
||||||
if ok and stats and stats.size > max_filesize then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
|
||||||
parser_config.hypr = {
|
|
||||||
install_info = {
|
|
||||||
url = "https://github.com/luckasRanarison/tree-sitter-hypr",
|
|
||||||
files = { "src/parser.c" },
|
|
||||||
branch = "master",
|
|
||||||
},
|
|
||||||
filetype = "hypr",
|
|
||||||
}
|
|
Loading…
Reference in New Issue