moved to stow

This commit is contained in:
Belal Elsabbagh
2024-12-23 10:51:37 +02:00
parent ee043ddeec
commit 8b6f7c4467
73 changed files with 60 additions and 110 deletions

View File

@@ -0,0 +1,5 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

View File

@@ -0,0 +1,52 @@
--[[
--
-- This file is not required for your own configuration,
-- but helps people determine if their system is setup correctly.
--
--]]
local check_version = function()
local verstr = tostring(vim.version())
if not vim.version.ge then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end
if vim.version.ge(vim.version(), '0.10-dev') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
end
local check_external_reqs = function()
-- Basic utils: `git`, `make`, `unzip`
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
local is_executable = vim.fn.executable(exe) == 1
if is_executable then
vim.health.ok(string.format("Found executable: '%s'", exe))
else
vim.health.warn(string.format("Could not find executable: '%s'", exe))
end
end
return true
end
return {
check = function()
vim.health.start 'kickstart.nvim'
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
Fix only warnings for plugins and languages you intend to use.
Mason will give warnings for languages that are not installed.
You do not need to install, unless you want to use those languages!]]
local uv = vim.uv or vim.loop
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
check_version()
check_external_reqs()
end,
}

View File

@@ -0,0 +1,16 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('nvim-autopairs').setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp = require 'cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View File

@@ -0,0 +1,105 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
'leoluz/nvim-dap-go',
},
keys = function(_, keys)
local dap = require 'dap'
local dapui = require 'dapui'
return {
-- Basic debugging keymaps, feel free to change to your liking!
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
{
'<leader>B',
function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end,
desc = 'Debug: Set Breakpoint',
},
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
unpack(keys),
}
end,
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
},
}
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
},
},
}
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
},
}
end,
}

View File

@@ -0,0 +1,61 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
return {
{
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
end,
},
},
}

View File

@@ -0,0 +1,9 @@
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},
}

View File

@@ -0,0 +1,55 @@
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
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,
})
end,
},
}

View File

@@ -0,0 +1,25 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},
opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
},
},
},
}

View File

@@ -0,0 +1,51 @@
return {
'exafunction/codeium.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'hrsh7th/nvim-cmp',
},
config = function()
require('codeium').setup {
-- Optionally disable cmp source if using virtual text only
enable_cmp_source = false,
virtual_text = {
enabled = true,
-- These are the defaults
-- Set to true if you never want completions to be shown automatically.
manual = false,
-- A mapping of filetype to true or false, to enable virtual text.
filetypes = {},
-- Whether to enable virtual text of not for filetypes not specifically listed above.
default_filetype_enabled = true,
-- How long to wait (in ms) before requesting completions after typing stops.
idle_delay = 75,
-- Priority of the virtual text. This usually ensures that the completions appear on top of
-- other plugins that also add virtual text, such as LSP inlay hints, but can be modified if
-- desired.
virtual_text_priority = 65535,
-- Set to false to disable all key bindings for managing completions.
map_keys = true,
-- The key to press when hitting the accept keybinding but no completion is showing.
-- Defaults to \t normally or <c-n> when a popup is showing.
accept_fallback = nil,
-- Key bindings for managing completions in virtual text mode.
key_bindings = {
-- Accept the current completion.
accept = '<Tab>',
-- Accept the next word.
accept_word = false,
-- Accept the next line.
accept_line = false,
-- Clear the virtual text.
clear = false,
-- Cycle to the next completion.
next = '<M-]>',
-- Cycle to the previous completion.
prev = '<M-[>',
},
},
}
end,
}

View File

@@ -0,0 +1,102 @@
local js_based_languages = {
'typescript',
'javascript',
'typescriptreact',
'javascriptreact',
'vue',
}
return {
'mfussenegger/nvim-dap',
dependencies = {
'rcarriga/nvim-dap-ui',
'nvim-neotest/nvim-nio',
'theHamsta/nvim-dap-virtual-text',
},
keys = {
{
'<leader>db',
function()
require('dap').toggle_breakpoint()
end,
},
{
'<leader>dr',
function()
require('dap').continue()
end,
},
{
"<C-'>",
function()
require('dap').step_over()
end,
},
{
'<C-;>',
function()
require('dap').step_into()
end,
},
{
'<C-:>',
function()
require('dap').step_out()
end,
},
},
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
dap.adapters.firefox = {
type = 'executable',
command = 'node',
args = {
require('mason-registry').get_package('firefox-debug-adapter'):get_install_path() .. '/dist/adapter.bundle.js',
},
}
-- Configuration for JavaScript/TypeScript languages
for _, language in ipairs(js_based_languages) do
dap.configurations[language] = {
{
type = 'firefox',
request = 'launch',
name = 'Launch & Debug in Firefox',
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = 'Enter URL: ',
default = 'http://localhost:8080',
}, function(url)
if url == nil or url == '' then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
firefoxExecutable = '/usr/bin/firefox', -- Adjust if needed
},
}
end
-- Set up dap-ui
dapui.setup()
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open { reset = true }
end
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
require('nvim-dap-virtual-text').setup {
enabled = true,
enabled_commands = true,
highlight_changed_variables = true,
highlight_new_as_changed = false,
show_stop_reason = true,
commented = false,
}
end,
}

View File

@@ -0,0 +1,50 @@
return {
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>cf',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = '[C]ode [F]ormat',
},
},
opts = {
notify_on_error = true,
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 1000,
},
formatters_by_ft = {
lua = { 'stylua' },
go = { 'gofmt' },
python = { 'ruff' },
javascript = { 'biome', 'prettier', stop_after_first = true },
typescript = { 'biome', 'prettier', stop_after_first = true },
yaml = { 'prettier' },
rust = { 'rustfmt', lsp_format = 'fallback' },
json = { 'biome', 'prettier', stop_after_first = true },
vue = { 'biome', 'prettier' },
php = { 'pint', 'intelephense', stop_after_first = true },
},
formatters = {
biome = {
meta = {
url = 'https://github.com/biomejs/biome',
description = 'A toolchain for web projects, aimed to provide functionalities to maintain them.',
},
command = 'biome',
stdin = true,
args = { 'format', '--stdin-file-path', '$FILENAME' },
},
intelephense = {
command = 'intelephense',
args = {},
},
},
},
}

View File

@@ -0,0 +1,19 @@
return {
'kdheepak/lazygit.nvim',
lazy = true,
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
dependencies = {
'nvim-lua/plenary.nvim',
},
keys = {
{ '<leader>gg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
},
}

View File

@@ -0,0 +1,61 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
return {
{
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
end,
},
},
}

View File

@@ -0,0 +1,10 @@
return {
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
}

View File

@@ -0,0 +1,83 @@
return {
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
{ 'williamboman/mason.nvim', config = true },
},
config = function()
local lint = require 'lint'
-- Define a custom biome linter
local mason_registry = require 'mason-registry'
local biome_path = mason_registry.get_package('biome'):get_install_path() .. '/node_modules/@biomejs/biome/bin/biome'
lint.linters.biome = {
name = 'biome',
cmd = biome_path, -- Command to run the linter
args = { 'lint' }, -- Arguments for the command
stdin = false, -- Send content via stdin
append_fname = true, -- Automatically add the current file name to the command arguments
stream = 'both', -- Result stream
ignore_exitcode = true, -- Treat exit code != 1 as an error
parser = function(output)
local diagnostics = {}
-- The diagnostic details we need are spread in the first 3 lines of
-- each error report. These variables are declared out of the FOR
-- loop because we need to carry their values to parse multiple lines.
local fetch_message = false
local lnum, col, code, message
-- When a lnum:col:code line is detected fetch_message is set to true.
-- While fetch_message is true we will search for the error message.
-- When a error message is detected, we will create the diagnostic and
-- set fetch_message to false to restart the process and get the next
-- diagnostic.
for _, line in ipairs(vim.fn.split(output, '\n')) do
if fetch_message then
_, _, message = string.find(line, '%s×(.+)')
if message then
message = (message):gsub('^%s+×%s*', '')
table.insert(diagnostics, {
source = 'biomejs',
lnum = tonumber(lnum) - 1,
col = tonumber(col),
message = message,
code = code,
})
fetch_message = false
end
else
_, _, lnum, col, code = string.find(line, '[^:]+:(%d+):(%d+)%s([%a%/]+)')
if lnum then
fetch_message = true
end
end
end
return diagnostics
end, -- Custom parser for output
}
-- Set up linters by filetype
lint.linters_by_ft = {
vue = { 'biome' }, -- Lint Vue files using the overridden biome command
javascript = { 'biome' },
json = { 'biome' },
typescript = { 'biome' },
javascriptreact = { 'biome' },
typescriptreact = { 'biome' },
python = { 'ruff', 'mypy' },
-- Add more filetypes as needed
}
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,
})
end,
}

View File

@@ -0,0 +1,156 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
{ 'j-hui/fidget.nvim', opts = {} },
'hrsh7th/cmp-nvim-lsp',
},
config = function()
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event)
local map = function(keys, func, desc, mode)
mode = mode or 'n'
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
end
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
end,
})
end
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints')
end
end,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
local mason_registry = require 'mason-registry'
local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() .. '/node_modules/@vue/language-server'
local servers = {
rust_analyzer = {
filetypes = { 'rust' },
capabilities = capabilities,
},
ts_ls = {
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = vue_language_server_path,
languages = { 'javascript', 'typescript', 'vue' },
configNamespace = 'javascript',
enableForWorkspaceTypeScriptVersions = true,
},
},
},
settings = {
implicitProjectConfiguration = {
checkJs = true,
strictNullChecks = true,
},
},
},
biome = {
capabilities = capabilities,
},
phpactor = {
filetypes = { 'php' },
capabilities = capabilities,
},
volar = {
filetypes = { 'vue' },
capabilities = capabilities,
init_options = {
vue = {
hybridMode = true,
},
},
},
pyright = {
settings = {
pyright = {
disableOrganizeImports = true, -- Using Ruff
},
python = {
analysis = {
ignore = { '*' }, -- Using Ruff
typeCheckingMode = 'off', -- Using mypy
},
},
},
},
gopls = {
capabilities = capabilities,
},
lua_ls = {
settings = {
Lua = {
completion = {
callSnippet = 'Replace',
},
},
},
},
}
require('mason').setup()
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua',
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
require('mason-lspconfig').setup {
handlers = {
function(server_name)
local server = servers[server_name] or {}
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
},
}
end,
}

View File

@@ -0,0 +1,22 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
section_separators = { left = '', right = '' },
component_separators = { left = '|', right = '|' },
theme = vim.g.colors_name,
refresh = {
statusline = 1000,
},
},
sections = {
lualine_c = {
{
'filename',
path = 1,
},
},
},
},
}

View File

@@ -0,0 +1 @@
return { 'Bilal2453/luvit-meta', lazy = true }

View File

@@ -0,0 +1,9 @@
return {
'williamboman/mason.nvim',
opts = {
ensure_installed = {
'typescript-language-server',
'biome',
},
},
}

View File

@@ -0,0 +1,10 @@
return {
'echasnovski/mini.nvim',
config = function()
require('mini.ai').setup { n_lines = 500 }
require('mini.surround').setup()
require('mini.pairs').setup()
require('mini.pick').setup()
require('mini.icons').setup()
end,
}

View File

@@ -0,0 +1,59 @@
return {
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
dependencies = {
{
'L3MON4D3/LuaSnip',
build = (function()
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {},
},
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
},
config = function()
local cmp = require 'cmp'
local luasnip = require 'luasnip'
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = 'menu,menuone,noinsert' },
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-y>'] = cmp.mapping.confirm { select = true },
['<C-Space>'] = cmp.mapping.complete {},
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
},
sources = {
{ name = 'lazydev', priority = 1001 },
{ name = 'nvim_lsp', priority = 1000 },
{ name = 'luasnip', priority = 750 },
{ name = 'buffer', priority = 500 },
{ name = 'path', priority = 250 },
},
}
end,
}

View File

@@ -0,0 +1,14 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
main = 'nvim-treesitter.configs',
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'javascript', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'vue' },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
}

View File

@@ -0,0 +1,7 @@
return {
'stevearc/oil.nvim',
---@module 'oil'
---@type oil.SetupOpts
opts = {},
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
}

View File

@@ -0,0 +1,7 @@
return {
'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',
}

View File

@@ -0,0 +1,63 @@
return {
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
{ 'nvim-telescope/telescope-ui-select.nvim' },
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
},
config = function()
require('telescope').setup {
extensions = {
['ui-select'] = {
require('telescope.themes').get_dropdown(),
},
},
}
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select')
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader><leader>', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>/', builtin.live_grep, { desc = '[/] Fuzzy Search the cwd' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader>b', builtin.buffers, { desc = 'Find existing [B]uffers' })
vim.keymap.set('n', '<leader>sg', function()
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
end,
}

View File

@@ -0,0 +1,10 @@
return {
'Mofiqul/dracula.nvim',
lazy = false,
priority = 1000,
config = function()
local dracula = require 'dracula'
vim.cmd.colorscheme 'dracula'
end,
}

View File

@@ -0,0 +1,3 @@
return {
'tpope/vim-sleuth',
}

View File

@@ -0,0 +1,51 @@
return {
'folke/which-key.nvim',
event = 'VimEnter',
opts = {
icons = {
mappings = vim.g.have_nerd_font,
keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ',
Down = '<Down> ',
Left = '<Left> ',
Right = '<Right> ',
C = '<C-…> ',
M = '<M-…> ',
D = '<D-…> ',
S = '<S-…> ',
CR = '<CR> ',
Esc = '<Esc> ',
ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ',
NL = '<NL> ',
BS = '<BS> ',
Space = '<Space> ',
Tab = '<Tab> ',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
spec = {
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' },
{ '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
},
},
}