New Neovim configuration style and packages (future will reduce the package number)

This commit is contained in:
Eduardo Cueto-Mendoza 2025-01-03 13:41:55 +00:00
parent 1c134f50b3
commit b9a56d0075
Signed by: TastyPancakes
GPG Key ID: 941DF56C7242C3F1
63 changed files with 1603 additions and 1117 deletions

2
.config/nvim/LICENSE → .config/LICENSE Executable file → Normal file
View File

@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2023, Eduardo Cueto Mendoza
Copyright (c) 2023, Eduardo Cueto-Mendoza
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -0,0 +1,131 @@
#
# AUTO GENERATED BY 'fish-lsp'
#
# * Any command should generate the completions file
#
# >_ fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish
# >_ fish-lsp complete --fish > ~/.config/fish/completions/fish-lsp.fish
# >_ yarn install # from inside the 'fish-lsp'
#
# * You can test the completions by editing:
#
# ~/.config/fish/completions/fish-lsp.fish
#
# or by using the command:
#
# >_ fish-lsp complete
#
# to visually check what is wrong
#
# * For more info, try editing the generated output inside:
#
# ~/...install_path.../fish-lsp/src/utils/get-lsp-completions.ts
#
# Returns exit code of 0 if any command (argv[1..-1]) appears once, ignores flags.
function __fish_lsp_using_command
set -l commands $argv
set -l cmd (commandline -opc)
if test (count $cmd) -gt 1
set -l command_seen_once 1
for c in $cmd[2..-1]
switch $c
case '-*'
continue
case $commands
# If the command is seen more than once then return 1
if test $command_seen_once -eq 1
set command_seen_once 0
else
return 1
end
case '*'
if test $command_seen_once -eq 0
return 0
else
return 1
end
end
end
return $command_seen_once
end
return 1
end
# disable file completions
complete -c fish-lsp -f
complete -c fish-lsp -n "__fish_use_subcommand" -a "
start\t'subcmd to start the lsp using stdin/stdout'
logger\t'test the logger by displaying it'
info\t'show the build info of fish-lsp'
url\t'show a helpful url related to the fish-lsp'
complete\t'generate completions file for ~/.config/fish/completions'
env\t'generate fish shell env variables to be used by lsp'"
set __fish_lsp_subcommands start
# fish_lsp [start] --<TAB>
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -a "
--dump\t'dump output and stop server'
--enable\t'enable feature'
--disable\t'disable feature'"
# fish-lsp url --<TAB>
complete -c fish-lsp -n "__fish_seen_subcommand_from url" -a "
--repo 'show git url'
--git 'show git url'
--npm 'show npm url'
--homepage 'show homepage url'
--contributions 'show git contributions url'
--wiki 'show git wiki url'
--issues 'show git issues url'
--report 'show git issues url'
--discussions 'show git discussions url'
--clients-repo 'show git clients-repo url'
--sources 'show useful list of sources'"
# fish-lsp complete <TAB>
complete -c fish-lsp -n __fish_use_subcommand -a complete -d 'completion utils for fish-lsp cli'
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt features' -l features -d 'show features'
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt fish' -l fish -d 'show completion/fish-lsp.fish'
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt names' -l names -d 'show feature names of completions'
complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt toggle' -l toggle -d 'show feature names of completions'
# fish-lsp info --<TAB>
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt bin' -l bin -d 'show the binary path'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt repo' -l repo -d 'show the repo path'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt time' -l time -d 'show the build-time'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt env' -l env -d 'show the env-variables used'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt lsp-version' -l lsp-version -d 'show the npm package for the lsp-version'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt capabilities' -l capabilities -d 'show the lsp capabilities implemented'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt man-file' -l man-file -d 'show man file path'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt logs-file' -l logs-file -d 'show logs.txt file path'
complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt more' -l more -d 'show more info'
# fish-lsp logger --<TAB>
complete -c fish-lsp -n __fish_use_subcommand -x -a logger -d 'logger utilities'
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s s show' -s s -l show -d 'show the "logs.txt" file'
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s c clear' -s c -l clear -d 'clear the "logs.txt" file'
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s q quiet' -s q -l quiet -d 'only write to "logs.txt" file'
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s d date' -s d -l date -d 'write date to "logs.txt" file'
complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt config' -l config -d 'show the logger config'
# print all $fish_lsp_submcommands
function _fish_lsp_get_features
printf %b\n complete hover rename reference formatting codeAction codeLens folding signature executeCommand inlayHint highlight diagnostic
end
# fish-lsp env --<TAB>
complete -c fish-lsp -n __fish_use_subcommand -x -a env -d 'generate fish shell env variables to be used by lsp'
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s s show; and not __fish_contains_opt -s c create' -s s -l show -d 'show the current fish-lsp env variables'
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s c create; and not __fish_contains_opt -s s show' -s c -l create -d 'build initial fish-lsp env variables'
complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt no-comments' -l no-comments -d 'skip outputting comments'
# COMPLETION: fish-lsp subcmd <option> [VALUE] (`fish-lsp start --enable ...`)
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -l enable -xa '(_fish_lsp_get_features)'
complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -l disable -xa '(_fish_lsp_get_features)'
# built by the command:
# fish-lsp complete ~/.config/fish/completions/fish-lsp.fish

View File

@ -2,8 +2,9 @@ font-family = Terminess Nerd Font
font-size = 18
font-thicken = false
theme = Homebrew
#theme = Apple Classic
## background = #282c34
#background = #000000
#background = #444445
#foreground = #ffffff
#minimum-contrast = 1
## Black
@ -20,7 +21,7 @@ theme = Homebrew
#palette = 11=#e5e500
## Blue
##palette = 4=#0000b2
palette = 4=#053de6
#palette = 4=#053de6
#palette = 12=#0000ff
## Purple
#palette = 5=#b200b2

1
.config/nvim/.gitignore vendored Executable file → Normal file
View File

@ -1,2 +1 @@
*.json
config/*

View File

@ -0,0 +1,2 @@
indent_type = "Spaces"
indent_width = 4

View File

@ -1,2 +0,0 @@
# nvim
my neovim configuration

View File

@ -1,6 +0,0 @@
# TODO
- [ ] config
- [ ] better git integration
- [ ] renew LaTeX configuration for Lazy
- [ ] set better key maps and options

View File

@ -1,28 +0,0 @@
local theme = 'rose'
if theme == 'tokyo' then
require("tokyonight").setup {
transparent = false,
styles = {
sidebars = "transparent",
floats = "transparent",
}
}
vim.cmd [[colorscheme tokyonight-night]]
elseif theme == 'rose' then
local pine = require('rose-pine.palette')
vim.cmd.colorscheme('rose-pine')
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
vim.api.nvim_set_hl(0, 'String', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Number', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Float', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Constant', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Character', { fg = pine.rose })
vim.cmd [[colorscheme rose-pine]]
else
vim.cmd [[set notermguicolors]]
end
vim.cmd [[hi Normal guibg=none]]

View File

@ -1,56 +0,0 @@
local configs = require("nvim-treesitter.configs")
configs.setup {
-- {{{1 A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = {
"bash",
"c",
"lua",
"query",
"markdown",
"markdown_inline",
"rust",
"vim",
"vimdoc",
},
-- }}}
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (or "all")
ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
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,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
incremental_selection = { enable = true },
textobjects = { enable = true },
}

View File

@ -1,11 +0,0 @@
local mason = require("mason")
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})

View File

@ -1,114 +0,0 @@
local lspconfig = require 'lspconfig'
-- local on_attach = function(client)
-- require 'completion'.on_attach(client)
-- end
vim.lsp.inlay_hint.enable(true)
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- BASH
lspconfig.bashls.setup({})
-- CLANG
lspconfig.clangd.setup({})
-- CMAKE
lspconfig.cmake.setup({})
-- LATEX
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {}
for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
lspconfig.ltex.setup({
filetypes = { "bib", "gitcommit", "markdown", "org", "norg", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "html", "xhtml", "mail", "text" },
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
enabled = { "bibtex", "gitcommit", "markdown", "org", "norg", "tex", "restructuredtext", "rsweave", "latex", "quarto", "rmd", "context", "html", "xhtml", "mail", "plaintext" },
},
},
})
-- LUA
lspconfig.lua_ls.setup {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
},
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
-- library = vim.api.nvim_get_runtime_file("", true)
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim', 'require', 'select_opts' },
},
format = {
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "4",
}
},
})
end,
settings = {
Lua = {}
}
}
-- PYTHON
lspconfig.pylsp.setup {
settings = {
pylsp = {
plugins = {
-- formatter options
black = { enabled = true },
autopep8 = { enabled = false },
yapf = { enabled = false },
-- linter options
pylint = { enabled = false, executable = "pylint" },
pyflakes = { enabled = false },
pycodestyle = { enabled = true, maxLineLength = 110 },
-- type checker
pylsp_mypy = { enabled = true },
-- auto-completion options
jedi_completion = { fuzzy = true },
-- import sorting
pyls_isort = { enabled = true },
},
},
},
flags = {
debounce_text_changes = 200,
},
}

View File

@ -1,107 +0,0 @@
-- Set up nvim-cmp.
local cmp = require 'cmp'
-- Lua Snip
require("luasnip.loaders.from_vscode").lazy_load()
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.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Allows selection with tab and shift-tab
['<S-Tab>'] = cmp.mapping.select_prev_item(select_opts),
['<Tab>'] = cmp.mapping.select_next_item(select_opts),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
-- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
-- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
{ name = 'path' },
})
})
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
-- Set configuration for specific filetype.
--[[ cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' },
}, {
{ name = 'buffer' },
})
})
require("cmp_git").setup() ]]--
-- Use buffer source for `/` and `?` (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' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
-- BASH
require('lspconfig')['bashls'].setup {
capabilities = capabilities
}
-- CLANG
require('lspconfig')['clangd'].setup {
capabilities = capabilities
}
-- CMAKE
require('lspconfig')['cmake'].setup {
capabilities = capabilities
}
-- LUA
require('lspconfig')['lua_ls'].setup {
capabilities = capabilities
}
-- LaTeX
require('lspconfig')['ltex'].setup {
capabilities = capabilities
}
-- PYTHON
require('lspconfig')['pylsp'].setup {
capabilities = capabilities
}

View File

@ -1,13 +0,0 @@
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup {
ensure_installed = {
'bashls',
'clangd',
'cmake',
'lua_ls',
'ltex',
'pylsp',
'rust_analyzer',
},
}

View File

@ -1,18 +0,0 @@
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set(
"n",
"<leader>a",
function()
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
-- or vim.lsp.buf.codeAction() if you don't want grouping.
end,
{ silent = true, buffer = bufnr }
)
vim.keymap.set(
"n",
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
function()
vim.cmd.RustLsp({'hover', 'actions'})
end,
{ silent = true, buffer = bufnr }
)

View File

@ -1,10 +0,0 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file, { desc = "Harpoon: Mark File"})
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu, { desc = "Toggle Harpoon Menu"})
vim.keymap.set("n", "<C-t>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-s>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-b>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-g>", function() ui.nav_file(4) end)

View File

@ -1,78 +0,0 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find Files" })
vim.keymap.set('n', '<leader>fg', "<cmd>lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", { desc = "Live Grep" })
vim.keymap.set('n', '<leader>fc', '<cmd>lua require("telescope.builtin").live_grep({ glob_pattern = "!{spec,test}"})<CR>', { desc = "Live Grep Code" })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Find Buffers" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Find Help Tags" })
vim.keymap.set('n', '<leader>fs', builtin.lsp_document_symbols, { desc = "Find Symbols" })
vim.keymap.set('n', '<leader>fi', '<cmd>AdvancedGitSearch<CR>', { desc = "AdvancedGitSearch" })
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, { desc = "Find Old Files" })
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = "Find Word under Cursor" })
local telescope = require("telescope")
local telescopeConfig = require("telescope.config")
-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
local actions = require "telescope.actions"
telescope.setup({
defaults = {
-- `hidden = true` is not supported in text grep commands.
vimgrep_arguments = vimgrep_arguments,
path_display = { "truncate" },
mappings = {
n = {
["<C-w>"] = actions.send_selected_to_qflist + actions.open_qflist,
},
i = {
["<C-j>"] = actions.cycle_history_next,
["<C-k>"] = actions.cycle_history_prev,
["<C-w>"] = actions.send_selected_to_qflist + actions.open_qflist,
}
},
},
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
extensions = {
undo = {
use_delta = true,
use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" }
side_by_side = false,
vim_diff_opts = { ctxlen = 0 },
entry_format = "state #$ID, $STAT, $TIME",
mappings = {
i = {
["<C-cr>"] = require("telescope-undo.actions").yank_additions,
["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
["<cr>"] = require("telescope-undo.actions").restore,
},
},
},
}
})
require("telescope").load_extension "neoclip"
require('telescope').load_extension('fzf')
require('telescope').load_extension('ui-select')
vim.g.zoxide_use_select = true
require("telescope").load_extension("undo")
require("telescope").load_extension("advanced_git_search")
require("telescope").load_extension("live_grep_args")

View File

@ -1,59 +0,0 @@
require('neoclip').setup({
history = 1000,
enable_persistent_history = false,
length_limit = 1048576,
continuous_sync = false,
db_path = vim.fn.stdpath("data") .. "/databases/neoclip.sqlite3",
filter = nil,
preview = true,
prompt = nil,
default_register = '"',
default_register_macros = 'q',
enable_macro_history = true,
content_spec_column = false,
disable_keycodes_parsing = false,
on_select = {
move_to_front = false,
close_telescope = true,
},
on_paste = {
set_reg = false,
move_to_front = false,
close_telescope = true,
},
on_replay = {
set_reg = false,
move_to_front = false,
close_telescope = true,
},
on_custom_action = {
close_telescope = true,
},
keys = {
telescope = {
i = {
select = '<cr>',
paste = '<c-j>',
paste_behind = '<c-k>',
replay = '<c-q>', -- replay a macro
delete = '<c-d>', -- delete an entry
edit = '<c-e>', -- edit an entry
custom = {},
},
n = {
select = '<cr>',
paste = 'p',
--- It is possible to map to more than one key.
-- paste = { 'p', '<c-p>' },
paste_behind = 'P',
replay = 'q',
delete = 'd',
edit = 'e',
custom = {},
},
},
},
})
vim.keymap.set("n", "<leader>o", "<cmd>Telescope neoclip<CR>", { desc = "Telescope Neoclip"})

View File

@ -1,18 +0,0 @@
-- empty setup using defaults
-- require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})

View File

@ -1,25 +0,0 @@
require("autoclose").setup({
keys = {
["("] = { escape = false, close = true, pair = "()" },
["["] = { escape = false, close = true, pair = "[]" },
["{"] = { escape = false, close = true, pair = "{}" },
[">"] = { escape = true, close = false, pair = "<>" },
[")"] = { escape = true, close = false, pair = "()" },
["]"] = { escape = true, close = false, pair = "[]" },
["}"] = { escape = true, close = false, pair = "{}" },
['"'] = { escape = true, close = true, pair = '""' },
["'"] = { escape = true, close = true, pair = "''" },
["`"] = { escape = true, close = true, pair = "``" },
["$"] = { escape = true, close = true, pair = "$$", disabled_filetypes = {} },
},
options = {
disabled_filetypes = { "text" },
disable_when_touch = false,
touch_regex = "[%w(%[{]",
pair_spaces = true,
auto_indent = true,
disable_command_mode = false,
},
})

View File

@ -1,8 +0,0 @@
--local builtin = require('vim-floaterm.builtin')
vim.keymap.set("n", "<leader>TS",
"<cmd>:FloatermNew --height=0.3 --width=0.8 --wintype=float --name=floaterm1 --position=center --autoclose=2<CR>", { desc = "Open FloatTerm" })
vim.keymap.set("n", "<leader>TT",
"<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })
vim.keymap.set("t", "<leader>TT",
"<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })

View File

@ -0,0 +1,5 @@
; extends
(object
(pair
key: (_) @property.lhs
value: (_) @property.inner @property.rhs) @property.outer)

5
.config/nvim/init.lua Executable file → Normal file
View File

@ -1,3 +1,2 @@
require('eddie.lazy')
require('eddie.remaps')
require('eddie.options')
require("user.core.init")
require("user.lazy")

View File

@ -1,254 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
local plugins = {
-- Code highlighting
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
-- Language server configuration
{ 'neovim/nvim-lspconfig' },
{
'williamboman/mason.nvim',
build = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{ 'williamboman/mason-lspconfig.nvim' },
-- Autocompletion
{ 'hrsh7th/nvim-cmp' },
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-cmdline' },
-- Rust cmp & lsp
{
'mrcjkb/rustaceanvim',
version = '^5', -- Recommended
lazy = false, -- This plugin is already lazy
},
-- -- For luasnip users
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ 'saadparwaiz1/cmp_luasnip' },
-- Helper package for cmp
{
'nvim-lua/plenary.nvim',
},
{ 'echasnovski/mini.nvim', version = '*' },
-- vim auxiliary packages
{
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
},
-- Lua auxiliary packages
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
-- Minimal
{
'nvim-telescope/telescope.nvim',
tag = '0.1.5',
dependencies = { { 'nvim-lua/plenary.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' },
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{
"aaronhallaert/advanced-git-search.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-fugitive",
'tpope/vim-rhubarb',
},
},
'nvim-telescope/telescope-ui-select.nvim',
'debugloop/telescope-undo.nvim',
'ThePrimeagen/harpoon',
{
'mbbill/undotree',
config = function()
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<CR>", { desc = "Telescope Undo" })
end
},
{
'tpope/vim-fugitive',
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Open Fugitive Panel" })
end
},
{ 'tpope/vim-repeat' },
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
},
-- Colorschemes
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {},
},
{
'rose-pine/neovim',
name = 'rose-pine',
lazy = false,
priority = 1000,
opts = {
disable_background = true,
},
},
-- Autoclose parenthesis
{ 'm4xshen/autoclose.nvim' },
--{
-- 'tummetott/unimpaired.nvim',
-- config = function()
-- require('unimpaired').setup()
-- end
--},
-- tree navigator
{ "nvim-tree/nvim-tree.lua" },
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
theme = 'palenight'
}
})
end
},
{
'bronson/vim-trailing-whitespace'
},
{
'junegunn/fzf',
build = ":call fzf#install()"
},
{
"AckslD/nvim-neoclip.lua",
dependencies = {
{ 'nvim-telescope/telescope.nvim' },
},
},
{ 'jinh0/eyeliner.nvim' },
{
"anuvyklack/windows.nvim",
dependencies = {
"anuvyklack/middleclass",
"anuvyklack/animation.nvim"
},
config = function()
vim.o.winwidth = 10
vim.o.winminwidth = 10
vim.o.equalalways = false
require('windows').setup()
end
},
-- Terminal
{
'voldikss/vim-floaterm',
},
-- Neorg
{
"nvim-neorg/neorg",
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
version = "*", -- Pin Neorg to the latest stable release
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
phd = "~/Work/Organization/2025-1st-Quatrimester/",
regular = "~/Documents/Notes",
},
default_workspace = "phd",
},
},
},
}
end,
},
-- Git signs
{ 'airblade/vim-gitgutter' },
{ 'mg979/vim-visual-multi' },
{
'kevinhwang91/nvim-ufo',
dependencies = 'kevinhwang91/promise-async'
},
{
'folke/which-key.nvim',
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {}
},
-- C/C++ debbuging
{
'sakhnik/nvim-gdb',
},
-- Rust debug
{ 'mfussenegger/nvim-dap' },
-- Compiler
{ -- This plugin
"Zeioth/compiler.nvim",
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
dependencies = { "stevearc/overseer.nvim", "nvim-telescope/telescope.nvim" },
opts = {},
},
{ -- The task runner we use
"stevearc/overseer.nvim",
commit = "6271cab7ccc4ca840faa93f54440ffae3a3918bd",
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
opts = {
task_list = {
direction = "bottom",
min_height = 25,
max_height = 25,
default_detail = 1
},
},
},
}
require('lazy').setup(plugins, {
change_detection = {
notify = false,
}
})

View File

@ -1,268 +0,0 @@
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
if (MY_OS == 'Linux')
then
-- on Linux
vim.opt.guicursor = ""
--vim.opt.spelllang = 'en_gb'
--vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "110"
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "/usr/share/pyenv/shims/python"
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
-- on BSD
vim.opt.guicursor = ""
vim.opt.spelllang = 'en_gb'
vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "110"
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
elseif (MY_OS == 'Darwin')
then
-- on MacOS
vim.opt.guicursor = ""
-- vim.opt.spelllang = 'en_gb'
-- vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
-- Undo
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
-- vim.opt.termguicolors = true
-- Folds
vim.opt.foldmethod = "marker"
--vim.opt.foldmethod = "expr"
--vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
--vim.opt.foldcolumn = "0"
--vim.opt.foldtext = ""
--vim.opt.foldlevel = 99
--vim.opt.foldlevelstart = 1
--vim.opt.foldnestmax = 4
-- Providers (Not necesary)
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_node_provider = 0
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "110"
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
vim.g.vimtex_view_method = "sioyek"
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g.vimtex_indent_enabled = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "$HOME/.pyenv/shims/python"
else
print('Should never be here LSP')
end

View File

@ -0,0 +1,2 @@
require("user.core.options")
require("user.core.keymaps")

View File

@ -1,3 +1,28 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local keymap = vim.keymap -- for conciseness
keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })
-- increment/decrement numbers
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
-- window management
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
keymap.set("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" }) -- make split windows equal width & height
keymap.set("n", "<leader>sx", "<cmd>close<CR>", { desc = "Close current split" }) -- close current split window
keymap.set("n", "<leader>to", "<cmd>tabnew<CR>", { desc = "Open new tab" }) -- open new tab
keymap.set("n", "<leader>tx", "<cmd>tabclose<CR>", { desc = "Close current tab" }) -- close current tab
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "Go to next tab" }) -- go to next tab
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "Go to previous tab" }) -- go to previous tab
keymap.set("n", "<leader>tf", "<cmd>tabnew %<CR>", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab
-- Open Ex as buffer
-- vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "Open Ex" })
vim.keymap.set("n", "<leader>pv", ":NvimTreeToggle<CR>", { desc = "Open Ex" })
@ -19,13 +44,13 @@ vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set("v", "p", '"_dP')
-- Copy text to " register
vim.keymap.set("n", "<leader>y", "\"+y", { desc = "Yank into \" register" })
vim.keymap.set("v", "<leader>y", "\"+y", { desc = "Yank into \" register" })
vim.keymap.set("n", "<leader>Y", "\"+Y", { desc = "Yank into \" register" })
vim.keymap.set("n", "<leader>y", '"+y', { desc = 'Yank into " register' })
vim.keymap.set("v", "<leader>y", '"+y', { desc = 'Yank into " register' })
vim.keymap.set("n", "<leader>Y", '"+Y', { desc = 'Yank into " register' })
-- Delete text to " register
vim.keymap.set("n", "<leader>d", "\"_d", { desc = "Delete into \" register" })
vim.keymap.set("v", "<leader>d", "\"_d", { desc = "Delete into \" register" })
vim.keymap.set("n", "<leader>d", '"_d', { desc = 'Delete into " register' })
vim.keymap.set("v", "<leader>d", '"_d', { desc = 'Delete into " register' })
-- Get out Q
vim.keymap.set("n", "Q", "<nop>")
@ -45,7 +70,12 @@ vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", { desc = "Forward location
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", { desc = "Backward location list" })
-- Replace word under cursor across entire buffer
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = "Replace word under cursor" })
vim.keymap.set(
"n",
"<leader>s",
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
{ desc = "Replace word under cursor" }
)
-- Make current file executable
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Make current file executable" })
@ -57,8 +87,8 @@ vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/exosyphon/lazy.lua
vim.keymap.set("n", "<leader>U", "<cmd>GitGutterUndoHunk<CR>", { desc = "Revert Git Hunk" })
-- Copy file paths
vim.keymap.set("n", "<leader>cf", "<cmd>let @+ = expand(\"%\")<CR>", { desc = "Copy File Name" })
vim.keymap.set("n", "<leader>cp", "<cmd>let @+ = expand(\"%:p\")<CR>", { desc = "Copy File Path" })
vim.keymap.set("n", "<leader>cf", '<cmd>let @+ = expand("%")<CR>', { desc = "Copy File Name" })
vim.keymap.set("n", "<leader>cp", '<cmd>let @+ = expand("%:p")<CR>', { desc = "Copy File Path" })
vim.keymap.set("n", "<leader>so", function()
vim.cmd("so")
@ -71,16 +101,19 @@ vim.keymap.set("n", "<C-Left>", ":vertical resize -2<CR>", { desc = "Resize Vert
vim.keymap.set("n", "<C-Right>", ":vertical resize +2<CR>", { desc = "Resize Vertical Split Up" })
-- Open compiler
vim.api.nvim_set_keymap('n', '<leader><leader>', "<cmd>CompilerOpen<cr>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader><leader>", "<cmd>CompilerOpen<cr>", { noremap = true, silent = true })
-- Redo last selected option
vim.api.nvim_set_keymap('n', '<leader><leader><leader>',
vim.api.nvim_set_keymap(
"n",
"<leader><leader><leader>",
"<cmd>CompilerStop<cr>" -- (Optional, to dispose all tasks before redo)
.. "<cmd>CompilerRedo<cr>",
{ noremap = true, silent = true })
.. "<cmd>CompilerRedo<cr>",
{ noremap = true, silent = true }
)
-- Toggle compiler results
vim.api.nvim_set_keymap('n', '<leader><leader>t', "<cmd>CompilerToggleResults<cr>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader><leader>t", "<cmd>CompilerToggleResults<cr>", { noremap = true, silent = true })
-- Visual --
-- Stay in indent mode

View File

@ -0,0 +1,86 @@
-- NeoVim OPTIONS
vim.opt.guicursor = ""
-- vim.opt.spelllang = 'en_gb'
-- vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
-- Undo
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- optionally enable 24-bit colour
-- vim.opt.termguicolors = true
-- Folds
vim.opt.foldmethod = "marker"
--vim.opt.foldmethod = "expr"
--vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
--vim.opt.foldcolumn = "0"
--vim.opt.foldtext = ""
--vim.opt.foldlevel = 99
--vim.opt.foldlevelstart = 1
--vim.opt.foldnestmax = 4
-- Providers (Not necesary)
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_node_provider = 0
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "110"
-- LSP options
vim.diagnostic.config({
virtual_text = false,
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd([[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]])
local f = io.popen("uname -s")
if f ~= nil then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
if MY_OS == "Linux" then
-- on Linux
-- Python provider
vim.g.python3_host_prog = "/usr/share/pyenv/shims/python"
elseif (MY_OS == "FreeBSD") or (MY_OS == "OpenBSD") then
-- on BSD
-- Python provider
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
elseif MY_OS == "Darwin" then
-- on MacOS
-- Python provider
vim.g.python3_host_prog = "$HOME/.pyenv/shims/python"
else
print("Should never be here LSP")
end

View File

@ -0,0 +1,22 @@
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({ { import = "user.plugins" }, { import = "user.plugins.lsp" } }, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})

View File

@ -0,0 +1,45 @@
return {
"folke/tokyonight.nvim",
priority = 1000,
config = function()
local transparent = false -- set to true if you would like to enable transparency
local bg = "#011628"
local bg_dark = "#011423"
local bg_highlight = "#143652"
local bg_search = "#0A64AC"
local bg_visual = "#275378"
local fg = "#CBE0F0"
local fg_dark = "#B4D0E9"
local fg_gutter = "#627E97"
local border = "#547998"
require("tokyonight").setup({
style = "night",
transparent = transparent,
styles = {
sidebars = transparent and "transparent" or "dark",
floats = transparent and "transparent" or "dark",
},
on_colors = function(colors)
colors.bg = bg
colors.bg_dark = transparent and colors.none or bg_dark
colors.bg_float = transparent and colors.none or bg_dark
colors.bg_highlight = bg_highlight
colors.bg_popup = bg_dark
colors.bg_search = bg_search
colors.bg_sidebar = transparent and colors.none or bg_dark
colors.bg_statusline = transparent and colors.none or bg_dark
colors.bg_visual = bg_visual
colors.border = border
colors.fg = fg
colors.fg_dark = fg_dark
colors.fg_float = fg
colors.fg_gutter = fg_gutter
colors.fg_sidebar = fg_dark
end,
})
vim.cmd("colorscheme tokyonight")
end,
}

View File

@ -0,0 +1,47 @@
return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"windwp/nvim-ts-autotag",
},
config = function()
-- import nvim-treesitter plugin
local treesitter = require("nvim-treesitter.configs")
-- configure treesitter
treesitter.setup({ -- enable syntax highlighting
highlight = {
enable = true,
},
-- enable indentation
indent = { enable = true },
-- enable autotagging (w/ nvim-ts-autotag plugin)
autotag = {
enable = true,
},
-- ensure these language parsers are installed
ensure_installed = {
"yaml",
"markdown",
"markdown_inline",
"bash",
"lua",
"vim",
"gitignore",
"query",
"vimdoc",
"c",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
})
end,
}

View File

@ -0,0 +1,116 @@
return {
"nvim-treesitter/nvim-treesitter-textobjects",
lazy = true,
config = function()
require("nvim-treesitter.configs").setup({
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
-- works for javascript/typescript files (custom capture I created in after/queries/ecma/textobjects.scm)
["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" },
["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" },
["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" },
["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" },
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
["am"] = {
query = "@function.outer",
desc = "Select outer part of a method/function definition",
},
["im"] = {
query = "@function.inner",
desc = "Select inner part of a method/function definition",
},
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
},
},
swap = {
enable = true,
swap_next = {
["<leader>na"] = "@parameter.inner", -- swap parameters/argument with next
["<leader>n:"] = "@property.outer", -- swap object property with next
["<leader>nm"] = "@function.outer", -- swap function with next
},
swap_previous = {
["<leader>pa"] = "@parameter.inner", -- swap parameters/argument with prev
["<leader>p:"] = "@property.outer", -- swap object property with prev
["<leader>pm"] = "@function.outer", -- swap function with previous
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]f"] = { query = "@call.outer", desc = "Next function call start" },
["]m"] = { query = "@function.outer", desc = "Next method/function def start" },
["]c"] = { query = "@class.outer", desc = "Next class start" },
["]i"] = { query = "@conditional.outer", desc = "Next conditional start" },
["]l"] = { query = "@loop.outer", desc = "Next loop start" },
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
},
goto_next_end = {
["]F"] = { query = "@call.outer", desc = "Next function call end" },
["]M"] = { query = "@function.outer", desc = "Next method/function def end" },
["]C"] = { query = "@class.outer", desc = "Next class end" },
["]I"] = { query = "@conditional.outer", desc = "Next conditional end" },
["]L"] = { query = "@loop.outer", desc = "Next loop end" },
},
goto_previous_start = {
["[f"] = { query = "@call.outer", desc = "Prev function call start" },
["[m"] = { query = "@function.outer", desc = "Prev method/function def start" },
["[c"] = { query = "@class.outer", desc = "Prev class start" },
["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" },
["[l"] = { query = "@loop.outer", desc = "Prev loop start" },
},
goto_previous_end = {
["[F"] = { query = "@call.outer", desc = "Prev function call end" },
["[M"] = { query = "@function.outer", desc = "Prev method/function def end" },
["[C"] = { query = "@class.outer", desc = "Prev class end" },
["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" },
["[L"] = { query = "@loop.outer", desc = "Prev loop end" },
},
},
},
})
local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move")
-- vim way: ; goes to the direction you were moving.
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f)
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F)
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
end,
}

View File

@ -0,0 +1,120 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
-- Allows selection with tab and shift-tab
["<S-Tab>"] = cmp.mapping.select_prev_item(select_opts),
["<Tab>"] = cmp.mapping.select_next_item(select_opts),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
-- Use buffer source for `/` and `?` (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" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
-- Set up lspconfig.
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
-- BASH
require("lspconfig")["bashls"].setup({
capabilities = capabilities,
})
-- CLANG
require("lspconfig")["clangd"].setup({
capabilities = capabilities,
})
-- CMAKE
require("lspconfig")["cmake"].setup({
capabilities = capabilities,
})
-- LUA
require("lspconfig")["lua_ls"].setup({
capabilities = capabilities,
})
-- LaTeX
require("lspconfig")["ltex"].setup({
capabilities = capabilities,
})
-- PYTHON
require("lspconfig")["pylsp"].setup({
capabilities = capabilities,
})
end,
}

View File

@ -0,0 +1,24 @@
return {
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
config = function()
local lint = require("lint")
lint.linters_by_ft = {
python = { "pylint" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
vim.keymap.set("n", "<leader>l", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })
end,
}

View File

@ -0,0 +1,27 @@
return {
{ -- This plugin
"Zeioth/compiler.nvim",
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
dependencies = { "stevearc/overseer.nvim", "nvim-telescope/telescope.nvim" },
opts = {},
},
{ -- The task runner we use
"stevearc/overseer.nvim",
commit = "6271cab7ccc4ca840faa93f54440ffae3a3918bd",
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
opts = {
task_list = {
direction = "bottom",
min_height = 25,
max_height = 25,
default_detail = 1,
},
},
},
-- C/C++ debbuging
{
"sakhnik/nvim-gdb",
},
-- Rust debug
{ "mfussenegger/nvim-dap" },
}

View File

@ -0,0 +1,20 @@
return {
"mrcjkb/rustaceanvim",
version = "^5", -- Recommended
lazy = false, -- This plugin is already lazy
config = function()
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set("n", "<leader>a", function()
vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping
-- or vim.lsp.buf.codeAction() if you don't want grouping.
end, { silent = true, buffer = bufnr })
vim.keymap.set(
"n",
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
function()
vim.cmd.RustLsp({ "hover", "actions" })
end,
{ silent = true, buffer = bufnr }
)
end,
}

View File

@ -0,0 +1,88 @@
return {
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
init = function()
local f = io.popen("uname -s")
if f ~= nil then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
if MY_OS == "Linux" then
-- on Linux
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
elseif (MY_OS == "FreeBSD") or (MY_OS == "OpenBSD") then
-- on BSD
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
elseif MY_OS == "Darwin" then
-- on MacOS
-- Vimtex options:
vim.g.vimtex_view_method = "sioyek"
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g.vimtex_indent_enabled = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
else
print("Should never be here")
end
end,
}

View File

@ -0,0 +1,6 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Open Fugitive Panel" })
end,
}

View File

@ -0,0 +1,17 @@
return {
{ "airblade/vim-gitgutter" },
{ "mg979/vim-visual-multi" },
{
"kevinhwang91/nvim-ufo",
dependencies = "kevinhwang91/promise-async",
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {},
},
}

View File

@ -0,0 +1,21 @@
return {
"folke/todo-comments.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local todo_comments = require("todo-comments")
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "]t", function()
todo_comments.jump_next()
end, { desc = "Next todo comment" })
keymap.set("n", "[t", function()
todo_comments.jump_prev()
end, { desc = "Previous todo comment" })
todo_comments.setup()
end,
}

View File

@ -0,0 +1,57 @@
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-tree/nvim-web-devicons",
"folke/todo-comments.nvim",
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local transform_mod = require("telescope.actions.mt").transform_mod
local trouble = require("trouble")
local trouble_telescope = require("trouble.sources.telescope")
-- or create your custom action
local custom_actions = transform_mod({
open_trouble_qflist = function(prompt_bufnr)
trouble.toggle("quickfix")
end,
})
telescope.setup({
defaults = {
path_display = { "smart" },
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
["<C-t>"] = trouble_telescope.open,
},
},
},
})
telescope.load_extension("fzf")
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Find string under cursor in cwd" })
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "Find todos" })
keymap.set("n", "<leader>fb", "<cmd>Telescope buffers", { desc = "Find Buffers" })
keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags", { desc = "Find Help Tags" })
keymap.set("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols", { desc = "Find Symbols" })
keymap.set("n", "<leader>fi", "<cmd>AdvancedGitSearch<CR>", { desc = "AdvancedGitSearch" })
keymap.set("n", "<leader>fo", "<cmd>Telescope oldfiles", { desc = "Find Old Files" })
keymap.set("n", "<leader>fw", "<cmd>Telescope grep_string", { desc = "Find Word under Cursor" })
end,
}

View File

@ -0,0 +1,22 @@
return {
"nvim-neorg/neorg",
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
version = "*", -- Pin Neorg to the latest stable release
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
phd = "~/Work/Organization/2025-1st-Quatrimester/",
regular = "~/Documents/Notes",
},
default_workspace = "phd",
},
},
},
})
end,
}

View File

@ -0,0 +1,13 @@
return {
"voldikss/vim-floaterm",
config = function()
vim.keymap.set(
"n",
"<leader>TS",
"<cmd>:FloatermNew --height=0.3 --width=0.8 --wintype=float --name=floaterm1 --position=center --autoclose=2<CR>",
{ desc = "Open FloatTerm" }
)
vim.keymap.set("n", "<leader>TT", "<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })
vim.keymap.set("t", "<leader>TT", "<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm" })
end,
}

View File

@ -0,0 +1,6 @@
return {
"szw/vim-maximizer",
keys = {
{ "<leader>sm", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
},
}

View File

@ -0,0 +1,30 @@
return {
"windwp/nvim-autopairs",
event = { "InsertEnter" },
dependencies = {
"hrsh7th/nvim-cmp",
},
config = function()
-- import nvim-autopairs
local autopairs = require("nvim-autopairs")
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})
-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
}

View File

@ -0,0 +1,6 @@
return {
"kylechui/nvim-surround",
event = { "BufReadPre", "BufNewFile" },
version = "*", -- Use for stability; omit to use `main` branch for the latest features
config = true,
}

View File

@ -0,0 +1,13 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
}

View File

@ -0,0 +1,62 @@
return {
"nvim-tree/nvim-tree.lua",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
local nvimtree = require("nvim-tree")
-- recommended settings from nvim-tree documentation
vim.g.netrw_liststyle = 3
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
nvimtree.setup({
view = {
width = 35,
relativenumber = true,
},
-- change folder arrow icons
renderer = {
indent_markers = {
enable = true,
},
icons = {
glyphs = {
folder = {
arrow_closed = "", -- arrow when folder is closed
arrow_open = "", -- arrow when folder is open
},
},
},
},
-- disable window_picker for
-- explorer to work well with
-- window splits
actions = {
open_file = {
window_picker = {
enable = true,
},
},
},
filters = {
custom = { ".DS_Store" },
},
git = {
ignore = false,
},
})
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" }) -- toggle file explorer
keymap.set(
"n",
"<leader>ef",
"<cmd>NvimTreeFindFileToggle<CR>",
{ desc = "Toggle file explorer on current file" }
) -- toggle file explorer on current file
keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" }) -- collapse file explorer
keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" }) -- refresh file explorer
end,
}

View File

@ -0,0 +1,15 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
opts = {
focus = true,
},
cmd = "Trouble",
keys = {
{ "<leader>xw", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open trouble workspace diagnostics" },
{ "<leader>xd", "<cmd>Trouble diagnostics toggle filter.buf=0<CR>", desc = "Open trouble document diagnostics" },
{ "<leader>xq", "<cmd>Trouble quickfix toggle<CR>", desc = "Open trouble quickfix list" },
{ "<leader>xl", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list" },
{ "<leader>xt", "<cmd>Trouble todo toggle<CR>", desc = "Open todos in trouble" },
},
}

View File

@ -0,0 +1,17 @@
return {
"gbprod/substitute.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local substitute = require("substitute")
substitute.setup()
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" })
keymap.set("n", "ss", substitute.line, { desc = "Substitute line" })
keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" })
keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" })
end,
}

View File

@ -0,0 +1,71 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local lualine = require("lualine")
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
local colors = {
blue = "#65D1FF",
green = "#3EFFDC",
violet = "#FF61EF",
yellow = "#FFDA7B",
red = "#FF4A4A",
fg = "#c3ccdc",
bg = "#112638",
inactive_bg = "#2c3043",
}
local my_lualine_theme = {
normal = {
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
visual = {
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
command = {
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
inactive = {
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
},
}
-- configure lualine with modified theme
lualine.setup({
options = {
theme = my_lualine_theme,
},
sections = {
lualine_x = {
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
{ "encoding" },
{ "fileformat" },
{ "filetype" },
},
},
})
end,
}

View File

@ -0,0 +1,39 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
liquid = { "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
},
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
}

View File

@ -0,0 +1,8 @@
return {
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPre", "BufNewFile" },
main = "ibl",
opts = {
indent = { char = "" },
},
}

View File

@ -0,0 +1,36 @@
return {
"goolord/alpha-nvim",
event = "VimEnter",
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- Set header
dashboard.section.header.val = {
" ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" ",
}
-- Set menu
dashboard.section.buttons.val = {
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
dashboard.button("SPC ff", "󰱼 > Find File", "<cmd>Telescope find_files<CR>"),
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
}
-- Send config to alpha
alpha.setup(dashboard.opts)
-- Disable folding on alpha buffer
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
end,
}

View File

@ -0,0 +1,16 @@
return {
"rmagatti/auto-session",
config = function()
local auto_session = require("auto-session")
auto_session.setup({
auto_restore_enabled = false,
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
})
local keymap = vim.keymap
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory
end,
}

View File

@ -0,0 +1,4 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
}

View File

@ -0,0 +1,19 @@
return {
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- import comment plugin safely
local comment = require("Comment")
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
-- enable comment
comment.setup({
-- for commenting tsx, jsx, svelte, html files
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}

View File

@ -0,0 +1,10 @@
return {
"akinsho/bufferline.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
version = "*",
opts = {
options = {
mode = "tabs",
},
},
}

View File

@ -0,0 +1,5 @@
return {
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
--"christoomey/vim-tmux-navigator", -- tmux & split window navigation
"bronson/vim-trailing-whitespace",
}

View File

@ -0,0 +1,46 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
config = function()
-- import mason
local mason = require("mason")
-- import mason-lspconfig
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
-- enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
"lua_ls",
"pyright",
},
})
mason_tool_installer.setup({
ensure_installed = {
"prettier", -- prettier formatter
"stylua", -- lua formatter
"isort", -- python formatter
"black", -- python formatter
"pylint",
"eslint_d",
},
})
end,
}

View File

@ -0,0 +1,277 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/neodev.nvim", opts = {} },
},
config = function()
-- Local word dictionary
local path = vim.fn.stdpath("config") .. "/after/plugins/dictionary-gb.txt"
print(path)
local words = {}
for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
-- import lspconfig plugin
local lspconfig = require("lspconfig")
-- import mason_lspconfig plugin
local mason_lspconfig = require("mason-lspconfig")
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true }
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end,
})
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
-- Change the Diagnostic symbols in the sign column (gutter)
-- (not in youtube nvim video)
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
mason_lspconfig.setup_handlers({
-- default handler for installed servers
--function(server_name)
-- lspconfig[server_name].setup({
-- capabilities = capabilities,
-- })
--end,
["bashls"] = function()
lspconfig["bashls"].setup({
capabilities = capabilities,
})
end,
["clangd"] = function()
lspconfig["clangd"].setup({
capabilities = capabilities,
})
end,
["cmake"] = function()
lspconfig["cmake"].setup({
capabilities = capabilities,
})
end,
--["fish_lsp"] = function()
-- lspconfig["fish_lsp"].setup({
-- capabilities = capabilities,
-- })
--end,
["ltex"] = function()
lspconfig["ltex"].setup({
capabilities = capabilities,
filetypes = {
"bib",
"gitcommit",
"markdown",
"org",
"norg",
"plaintex",
"rst",
"rnoweb",
"tex",
"pandoc",
"quarto",
"rmd",
"context",
"html",
"xhtml",
"mail",
"text",
},
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
enabled = {
"bibtex",
"gitcommit",
"markdown",
"org",
"tex",
"restructuredtext",
"rsweave",
"latex",
"quarto",
"rmd",
"context",
"html",
"xhtml",
"mail",
"plaintext",
},
},
},
})
end,
--["svelte"] = function()
-- -- configure svelte server
-- lspconfig["svelte"].setup({
-- capabilities = capabilities,
-- on_attach = function(client, bufnr)
-- vim.api.nvim_create_autocmd("BufWritePost", {
-- pattern = { "*.js", "*.ts" },
-- callback = function(ctx)
-- -- Here use ctx.match instead of ctx.file
-- client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
-- end,
-- })
-- end,
-- })
--end,
--["graphql"] = function()
-- -- configure graphql language server
-- lspconfig["graphql"].setup({
-- capabilities = capabilities,
-- filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
-- })
--end,
--["emmet_ls"] = function()
-- -- configure emmet language server
-- lspconfig["emmet_ls"].setup({
-- capabilities = capabilities,
-- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
-- })
--end,
["lua_ls"] = function()
-- configure lua server (with special settings)
lspconfig["lua_ls"].setup({
capabilities = capabilities,
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc")
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
},
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
-- library = vim.api.nvim_get_runtime_file("", true)
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim", "require", "select_opts" },
},
format = {
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "4",
},
},
})
end,
settings = {
Lua = {},
},
})
end,
["pylsp"] = function()
-- configure graphql language server
lspconfig["pylsp"].setup({
capabilities = capabilities,
settings = {
pylsp = {
plugins = {
-- formatter options
black = { enabled = true },
autopep8 = { enabled = false },
yapf = { enabled = false },
-- linter options
pylint = { enabled = false, executable = "pylint" },
pyflakes = { enabled = false },
pycodestyle = { enabled = true, maxLineLength = 110 },
-- type checker
pylsp_mypy = { enabled = true },
-- auto-completion options
jedi_completion = { fuzzy = true },
-- import sorting
pyls_isort = { enabled = true },
},
},
},
flags = {
debounce_text_changes = 200,
},
})
end,
})
end,
}

View File

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

Binary file not shown.