Compare commits

...

117 Commits

Author SHA1 Message Date
Mathias Rothenhaeusler 38709a3b71 remove markdown, not working 2026-06-10 08:10:14 +02:00
mathias 391b30bd7a updated new textobjects method 2026-05-24 14:29:08 +02:00
mathias 0af71243a3 remove old leader s from vimrc 2026-05-20 21:22:55 +02:00
mathias d0ea7c50a0 gl mapping 2026-05-06 19:53:03 +02:00
mathias 233275c160 added gl, easymotion in line 2026-05-05 19:31:44 +02:00
mathias ccd0319364 fix some paths, install rust-analyzer not in mason! 2026-05-05 19:22:04 +02:00
Mathias Rothenhaeusler f11dae4fce fix telescope preview 2026-04-22 16:58:18 +02:00
mathias 09e50948e4 treesitter for nvim 0.12 2026-04-19 13:01:12 +02:00
mathias d1167c2fe9 fix treesitter config, configs issue 2026-04-03 10:55:43 +02:00
Mathias Rothenhaeusler 04f1abe4d1 Merge branch 'main' of https://gitea.safemind.net/mathias/nvim-kickstart 2026-04-03 10:42:28 +02:00
mathias 821f9bee27 fix treesitter config 2026-04-03 10:35:50 +02:00
mathias fbcc0b8d61 fix error message intelephense license txt 2026-03-22 17:17:16 +01:00
Mathias Rothenhaeusler 6a326d7321 phpactor deactivation 2026-01-12 14:34:15 +01:00
Mathias Rothenhaeusler 36bb19fc4e phpactor deactivation 2026-01-12 14:32:15 +01:00
mathias 8850a7cc27 show diagnostics for buffer db 2025-12-30 19:48:36 +01:00
mathias 480e35d011 improve lsp 2025-12-29 12:49:47 +01:00
mathias 95d3e129ad improve nvim-cmp 2025-11-29 19:10:35 +01:00
mathias 2e55a01664 optimize keymaps diagnostics 2025-11-24 19:09:28 +01:00
mathias a233f6e7f2 added clippy for rust lsp setup 2025-11-24 18:53:57 +01:00
mathias 8f4d2e287e lsp fixes and tweaks 2025-11-23 12:17:56 +01:00
mathias a660f0c788 cleanup lspsaga 2025-11-22 12:55:21 +01:00
mathias f75def6081 cleanup lspsaga setup 2025-11-22 12:11:52 +01:00
mathias 71dac4d82f cleanup autoformat, telescope 2025-11-22 11:59:03 +01:00
mathias 04e5478570 lua optimization 2025-11-22 11:36:05 +01:00
mathias 1cb0dab7ff remove autoformat on save 2025-11-22 10:30:22 +01:00
mathias 9ac8c17116 diagnostics inline display changes 2025-11-15 16:42:36 +01:00
mathias 37fb243950 added params to rust debugging 2025-11-11 19:00:00 +01:00
mathias 4304241960 fix gd, and textobjects 2025-11-03 20:40:56 +01:00
Mathias Rothenhaeusler 8d52d1ae69 rainbowcsv keymaps 2025-10-15 11:16:24 +02:00
Mathias Rothenhaeusler 25f82a9efb rainbowcsv keymaps 2025-10-15 10:02:01 +02:00
mathias dff46591c7 fix new lsp vim 2025-09-21 17:10:04 +02:00
Mathias Rothenhaeusler 5f80a31736 kulala keymapping 2025-09-11 16:18:16 +02:00
mathias 3f6dd0b93f added env kulala 2025-09-10 19:06:57 +02:00
Mathias Rothenhaeusler 33487db7c3 copy filename shortcut 2025-08-25 16:32:44 +02:00
mathias d45101d38d colorscheme fixes 2025-08-09 09:36:56 +02:00
mathias 2ca16adfbf colorscheme fixes 2025-08-08 10:16:53 +02:00
mathias a96e697ea3 fix background color popups 2025-08-03 22:24:38 +02:00
mathias 20453f156d colortheme added 2025-07-29 16:02:03 +02:00
mathias 10c005be2d added gitsigns config 2025-07-29 13:40:41 +02:00
mathias a3269dbfc4 optimize null_ls 2025-07-25 21:40:59 +02:00
mathias dba36e227c go to definition 2025-07-25 16:20:25 +02:00
mathias aacdd5e376 added none-ls (null-ls) 2025-07-25 16:04:48 +02:00
mathias cf8bac705a added F11 close debug 2025-06-05 17:27:34 +02:00
Mathias Rothenhaeusler 1f8fe4fa49 remove setup handlers 2025-05-08 16:41:07 +02:00
mathias 13eefe179a remove K key 2025-04-13 13:15:31 +02:00
Mathias Rothenhaeusler 6d75099060 added phpstan executeable 2025-04-02 10:00:31 +02:00
Mathias Rothenhaeusler f15662fa74 activate phpactor 2025-04-02 09:15:53 +02:00
mathias aeb15189f2 upgrade init.lua 2025-03-31 20:13:12 +02:00
mathias e48121945c upgrade init.lua 2025-03-31 20:10:37 +02:00
mathias df5749ecd3 Lsp changes (deprecations etc) 2025-03-30 17:37:50 +02:00
mathias 2754087154 added keymap to move split pane 2025-03-28 16:07:03 +01:00
mathias 9d28ec0082 remove default mapping php debugging 2025-03-18 19:30:38 +01:00
mathias 5a8942b389 remove delve (go debugger) 2025-03-18 19:23:13 +01:00
mathias 41993e4393 added nvim debug autoload for project sepcific configs 2025-03-16 12:23:57 +01:00
mathias 95a3a82346 project/session shortcut add shift 2025-03-07 18:02:40 +01:00
mathias 3ed631bcc4 project/session shortcut add shift 2025-03-07 17:07:16 +01:00
Mathias Rothenhaeusler c6a6648126 floating neotree 2025-01-09 08:15:41 +01:00
Mathias Rothenhaeusler e00b8ca9a9 deactivate phpactor 2025-01-07 10:40:45 +01:00
mathias 0885e0e9b9 debugging, added mason pacakge for codelldb 2024-12-28 20:27:12 +01:00
mathias 6c2df0572b optimize session handling 2024-12-27 14:17:13 +01:00
mathias d27336e6df new session handling 2024-12-27 13:40:41 +01:00
mathias f499e5c6ec stopAtEntry DAP 2024-12-27 10:39:14 +01:00
mathias 4071b56ab0 added rust debugging 2024-12-25 18:27:44 +01:00
mathias 5bdb7589c7 debug shortcuts 2024-12-25 17:32:13 +01:00
mathias 8ddb3ae17e added php debug settings 2024-12-25 17:24:40 +01:00
mathias aff0a22908 breakpoint like storm 2024-12-25 16:56:33 +01:00
mathias 6c886df0d5 added session plugin 2024-12-23 12:27:35 +01:00
mathias 6c352db191 catppuccin: frappe to mocha 2024-11-09 13:46:37 +01:00
mathias 4d525339f7 added listchars plugin 2024-10-12 15:06:02 +02:00
Mathias Rothenhaeusler a469b206fd added diffview with keymap 2024-10-07 14:12:46 +02:00
Mathias Rothenhaeusler 66ffd49dd6 keymap to jump to next/previous function 2024-10-07 08:57:33 +02:00
Mathias Rothenhaeusler 76c98ecc30 easymotion 2024-09-30 08:58:36 +02:00
Mathias Rothenhaeusler 209e53ad84 acejump leader w 2024-09-30 08:49:52 +02:00
Mathias Rothenhaeusler 7012179326 rainbowcsv, default ; as delim 2024-09-24 09:42:23 +02:00
mathias b75503d8c9 added workspace symbols fs -> ss 2024-09-15 09:19:20 +02:00
mathias 30b0658600 added workspace symbols fs 2024-09-15 09:16:31 +02:00
mathias 3ee3256320 added shortcut neotree 2024-08-06 16:28:13 +02:00
mathias 4007b903ed deactivate startup plugin 2024-08-04 13:03:41 +02:00
mathias 7d0b034585 cycle prev and next buffer fix via buffer 2024-07-27 12:12:11 +02:00
mathias 1b8501a22c cycle prev and next buffer 2024-07-27 12:02:23 +02:00
mathias a565f4683c kulala shortcuts 2024-07-26 16:56:20 +02:00
mathias a5860c4237 added kulala 2024-07-26 16:06:34 +02:00
mathias 4c760227c7 added mini.icons 2024-07-26 09:43:07 +02:00
mathias e3f78c1801 reactivate bufferline 2024-06-30 12:10:42 +02:00
mathias e8c47ee5e1 restore F to search backwards 2024-06-14 16:26:54 +02:00
mathias 02d939d8a5 disbable indent-blankline plugin 2024-05-18 15:07:01 +02:00
Mathias Rothenhaeusler 33baa8ab27 remove bufferline 2024-04-29 16:03:38 +02:00
mathias 662960b1b1 offset for zz 2024-04-26 14:30:53 +02:00
mathias e5f3d8da23 change to telescope diagnostics 2024-03-29 22:27:31 +01:00
mathias e438717557 keymaps lsp 2024-03-27 11:56:49 +01:00
mathias b8776f785e changed some debugging hotkeys 2024-03-24 17:30:38 +01:00
mathias 476eb2e86f Lspsage finder 2024-03-22 17:52:17 +01:00
mathias ec66c0d732 fix dap dependencies 2024-03-19 21:22:11 +01:00
mathias d9c84c6e23 remove hardtime plugin 2024-03-08 17:39:03 +01:00
Mathias Rothenhaeusler 4ab0dddfd5 added rainbow csv 2024-02-29 15:21:21 +01:00
Mathias Rothenhaeusler 623345db67 leader y optimization 2024-02-15 08:09:15 +01:00
mathias 725b4e75bd added hardtime plugin 2024-01-15 19:03:38 +01:00
mathias 0e8cf26144 easymotion smart case 2024-01-02 19:16:30 +01:00
mathias 3b95214e8b changed keymap for easymotion search 2024-01-02 19:04:06 +01:00
mathias fbd0b7a3c8 remove sneak 2023-12-31 16:09:12 +01:00
Mathias Rothenhaeusler 9fe54bcc10 revert outline keymap 2023-12-05 06:16:48 +01:00
mathias b22133d2dd changed keymap vor outlin a-7 2023-12-04 19:19:56 +01:00
mathias 3b709033df added keymap to jump to next method 2023-12-03 15:35:38 +01:00
mathias 637df70213 Merge branch 'main' of https://gitea.safemind.net/mathias/nvim-kickstart 2023-11-13 18:09:03 +01:00
mathias 378ac47178 code action duplicate fix 2023-11-13 18:08:58 +01:00
Mathias Rothenhaeusler 52b7a639f8 added xml fold 2023-11-13 09:50:27 +01:00
mathias 28455d09ae remap leader a 2023-10-15 16:22:57 +02:00
mathias db1fa7dcd0 added leader v for split 2023-10-15 14:28:16 +02:00
mathias 739460cc1a added telescope history keymap 2023-10-03 17:45:44 +02:00
mathias df75c9f658 added telescope history 2023-10-03 17:28:21 +02:00
mathias 2e74a93297 new tab plugin 2023-10-02 10:54:29 +02:00
mathias 810c87381a added markdown and barbar 2023-10-01 16:23:14 +02:00
Mathias Rothenhaeusler 68488fe63c added easymotion 2023-09-21 12:24:43 +02:00
mathias 4a9331e23b added mason window border 2023-08-28 20:13:43 +02:00
mathias 0aad9059b6 frames around popups 2023-08-28 20:03:04 +02:00
mathias a579401524 neo tree current 2023-08-26 16:35:36 +02:00
mathias 861838f3a5 added harpoon 2023-08-26 11:51:55 +02:00
20 changed files with 898 additions and 683 deletions
+54 -263
View File
@@ -75,25 +75,12 @@ require('lazy').setup({
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth', 'tpope/vim-sleuth',
-- NOTE: This is where your plugins related to LSP can be installed. -- seems i need this regardless
-- The configuration is done below. Search for lspconfig to find it below.
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { {
-- Automatically install LSPs to stdpath for neovim 'williamboman/mason.nvim', config = true
{ 'williamboman/mason.nvim', config = true }, },
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
},
{ {
-- Autocompletion -- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
@@ -112,11 +99,10 @@ require('lazy').setup({
-- Useful plugin to show you pending keybinds. -- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} }, { 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes { -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
opts = { opts = {
-- See `:help gitsigns.txt`
signs = { signs = {
add = { text = '+' }, add = { text = '+' },
change = { text = '~' }, change = { text = '~' },
@@ -124,41 +110,9 @@ require('lazy').setup({
topdelete = { text = '' }, topdelete = { text = '' },
changedelete = { text = '~' }, changedelete = { text = '~' },
}, },
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
{ buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map("n", "<leader>gb", function()
gs.blame_line({ full = true })
end)
map("n", "<leader>tb", gs.toggle_current_line_blame)
map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function()
gs.diffthis("~")
end)
end,
}, },
}, },
{
-- Theme inspired by Atom
'navarasu/onedark.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
end,
},
{ {
-- Set lualine as statusline -- Set lualine as statusline
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
@@ -166,31 +120,20 @@ require('lazy').setup({
opts = { opts = {
options = { options = {
icons_enabled = false, icons_enabled = false,
theme = 'onedark',
component_separators = '|', component_separators = '|',
section_separators = '', section_separators = '',
}, },
}, },
}, },
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
opts = {
char = '',
show_trailing_blankline_indent = false,
},
},
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc) -- Fuzzy Finder (files, lsp, etc)
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim', version = '*',
branch = '0.1.x',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
-- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Fuzzy Finder Algorithm which requires local dependencies to be built.
@@ -208,19 +151,45 @@ require('lazy').setup({
}, },
}, },
{ { -- Highlight, edit, and navigate code
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
branch="main",
lazy = false,
build = ':TSUpdate',
-- config = function()
-- require('nvim-treesitter.configs').setup({
-- ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
-- auto_install = true,
-- highlight = {
-- enable = true,
-- additional_vim_regex_highlighting = { 'ruby' },
-- },
-- indent = { enable = true, disable = { 'ruby' } },
-- })
-- end,
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
branch="main"
}, },
build = ':TSUpdate', init = function()
local ensureInstalled = {
'lua', 'python', 'typescript',
-- ... your parsers
}
local alreadyInstalled = require('nvim-treesitter.config').get_installed()
local parsersToInstall = vim.iter(ensureInstalled)
:filter(function(parser)
return not vim.tbl_contains(alreadyInstalled, parser)
end)
:totable()
require('nvim-treesitter').install(parsersToInstall)
end,
}, },
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.autoformat',
require 'kickstart.plugins.debug', require 'kickstart.plugins.debug',
require 'kickstart.plugins.filetree', require 'kickstart.plugins.filetree',
@@ -297,210 +266,19 @@ vim.api.nvim_create_autocmd('TextYankPost', {
-- [[ Configure Telescope ]] -- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()` -- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
}
-- Enable telescope fzf native, if installed -- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'php' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
--
-- If you want to override the default filetypes that your language server will attach to you can
-- define the property 'filetypes' to the map in question.
local servers = {
-- clangd = {},
-- gopls = {},
pyright = {},
jsonls = {},
yamlls = {},
bashls = {},
rust_analyzer = {},
intelephense = {},
phpactor = {},
lemminx = {},
cssls = {},
-- tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Setup neovim lua configuration -- Setup neovim lua configuration
require('neodev').setup() -- require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end,
}
-- [[ Configure nvim-cmp ]] -- [[ Configure nvim-cmp ]]
-- See `:help cmp` -- See `:help cmp`
@@ -509,18 +287,31 @@ local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {} luasnip.config.setup {}
-- local nvim config (project level, debug mapping etc.)
local local_config = vim.fn.getcwd() .. "/.nvim.lua"
if vim.fn.filereadable(local_config) == 1 then
dofile(local_config)
end
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et
require('custom.catppuccin') require('custom.catppuccin')
require('custom.startup') -- require('custom.startup')
require('custom.lua-line') require('custom.lua-line')
require('custom.telescope') require('custom.telescope')
require('custom.lspconfig') require('custom.lspconfig')
require('custom.lspsaga')
require('custom.nvim-cmp') require('custom.nvim-cmp')
require('custom.toggleterm') require('custom.toggleterm')
require('custom.autopairs') require('custom.autopairs')
require('custom.colorizer') require('custom.colorizer')
require('custom.options') require('custom.options')
require('custom.keymaps') require('custom.keymaps')
require('custom.harpoon')
require('custom.mason')
require('custom.bufferline')
require('custom.kulala')
require('custom.rainbow')
require('custom.none-ls')
require('custom.gitsigns')
require('custom.colortheme')
+14
View File
@@ -0,0 +1,14 @@
vim.opt.termguicolors = true
local bufferline = require('bufferline')
bufferline.setup({
options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead
style_preset = bufferline.style_preset.minimal, -- or bufferline.style_preset.minimal,
separator_style = { "", "" }, --"thin", --| "slope" | "thick" | "thin" | { 'any', 'any' },
indicator = {
icon = '', -- this should be omitted if indicator style is not 'icon'
style = 'none',
},
}
})
+2 -2
View File
@@ -6,13 +6,13 @@
-- end -- end
require("catppuccin").setup({ require("catppuccin").setup({
flavour = "frappe", -- latte, frappe, macchiato, mocha flavour = "mocha", -- latte, frappe, macchiato, mocha
background = { -- :h background background = { -- :h background
light = "latte", light = "latte",
dark = "mocha", dark = "mocha",
}, },
transparent_background = true, transparent_background = true,
term_colors = false, term_colors = true,
dim_inactive = { dim_inactive = {
enabled = false, enabled = false,
shade = "dark", shade = "dark",
+28
View File
@@ -0,0 +1,28 @@
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "NONE", fg = "#cdd6f5" })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = "NONE", fg = "#3e4452" })
end
})
-- Detect dark or light theme saved in .colorscheme. defaults to dark
local background_mode
local f = io.open(os.getenv('HOME') .. '/.colorscheme', 'r')
if f ~= nil then
background_mode = f:read('*all')
background_mode = string.gsub(background_mode, "\n", '')
f:close()
else
background_mode = 'dark'
end
-- use ayu theme for dark mode, selenized for light mode
if background_mode == 'dark' then
vim.g.ayucolor = background_mode
vim.cmd("set background=" .. background_mode)
vim.cmd("colorscheme catppuccin-mocha")
else
vim.cmd("colorscheme zenbones")
vim.cmd("set background=" .. background_mode)
vim.cmd(
'highlight Normal ctermbg=NONE guibg=NONE | highlight StatusLine ctermbg=NONE guibg=NONE | highlight LineNr ctermbg=NONE guibg=NONE | highlight CursorLineNr ctermbg=NONE guibg=NONE | highlight TabLine ctermbg=NONE guibg=NONE | highlight Visual ctermbg=NONE guibg=NONE | highlight NormalNC ctermbg=NONE guibg=NONE')
end
+44
View File
@@ -0,0 +1,44 @@
require('gitsigns').setup {
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)
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal({ '[c', bang = true })
else
gitsigns.nav_hunk('prev')
end
end)
map('n', '<leader>gb', function()
gitsigns.blame({ full = true })
end)
map('n', '<leader>hd', gitsigns.diffthis)
map('n', '<leader>hD', function()
gitsigns.diffthis('~')
end)
map('n', '<leader>hQ', function() gitsigns.setqflist('all') end)
map('n', '<leader>hq', gitsigns.setqflist)
-- Text object
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
end
}
+60 -8
View File
@@ -10,10 +10,14 @@ keymap.set('n', '<leader>tx', ':tabclose<CR>', { silent = true }) -- close curre
keymap.set('n', '<leader>tn', ':tabn<CR>', { silent = true }) -- go to next tab keymap.set('n', '<leader>tn', ':tabn<CR>', { silent = true }) -- go to next tab
keymap.set('n', '<leader>tp', ':tabp<CR>', { silent = true }) -- go to previous tab keymap.set('n', '<leader>tp', ':tabp<CR>', { silent = true }) -- go to previous tab
-- buffers
keymap.set('n', 'gn', ':bn<CR>', { silent = true }) keymap.set('n', 'gn', ':bn<CR>', { silent = true })
keymap.set('n', 'gp', ':bp<CR>') keymap.set('n', 'gp', ':bp<CR>', { silent = true })
keymap.set('n', 'g[', ':b#<CR>', { silent = true })
-- copy filename in buffer
keymap.set('n', '<leader>cf', ':let @+ = expand("%:t")<CR>', { silent = true })
keymap.set('n', '<C-s>', ':w<CR>') -- keymap.set('n', '<C-s>', ':w<CR>')
keymap.set('n', '<leader>x', ':bd<CR>', { silent = true }) keymap.set('n', '<leader>x', ':bd<CR>', { silent = true })
-- primeagen -- primeagen
@@ -25,14 +29,14 @@ keymap.set('n', 'N', 'Nzzzh', { silent = true })
-- [copy/paste] -- [copy/paste]
keymap.set('x', '<leader>p', '"_dP') keymap.set('x', '<leader>p', '"_dP')
keymap.set('n', '<leader>y', '"+yy') keymap.set('n', '<leader>y', '"+yiw')
---------------------- ----------------------
-- Plugin Keybinds -- Plugin Keybinds
---------------------- ----------------------
-- neo-tree -- neo-tree
keymap.set('n', '<leader>e', ':Neotree toggle<CR>', { noremap = true, silent = true }) -- toggle file explorer keymap.set('n', '<leader>e', ':Neotree toggle current position=float<CR>', { noremap = true, silent = true }) -- toggle file explorer
keymap.set('n', '<leader>gt', ':Neotree toggle left reveal_force_cwd<CR>', { silent = true }) -- toggle file explorer keymap.set('n', '<leader>gt', ':Neotree toggle current reveal_force_cwd position=float<CR>', { silent = true }) -- toggle file explorer
-- telescope -- telescope
keymap.set('n', '<leader>sf', '<cmd>Telescope find_files<cr>', { silent = true }) -- find files within current working directory, respects .gitignore keymap.set('n', '<leader>sf', '<cmd>Telescope find_files<cr>', { silent = true }) -- find files within current working directory, respects .gitignore
@@ -46,10 +50,58 @@ keymap.set('n', '<leader>sk', '<cmd>Telescope keymaps<cr>', { silent = true })
keymap.set('n', '<leader>1', ':diffget LOCAL<CR>') keymap.set('n', '<leader>1', ':diffget LOCAL<CR>')
keymap.set('n', '<leader>2', ':diffget REMOTE<CR>') keymap.set('n', '<leader>2', ':diffget REMOTE<CR>')
-- git diff
keymap.set('n', '<leader>gh', ':DiffviewFileHistory %<CR>', { silent = true })
-- toggleterm -- toggleterm
keymap.set('n', '<M-1>', '<cmd>ToggleTerm direction=horizontal<cr>', { silent = true }) keymap.set('n', '<M-1>', '<cmd>ToggleTerm direction=horizontal<cr>', { silent = true })
-- vim-sneak -- vim-sneak
keymap.set('n', 'f', '<Plug>Sneak_s', { silent = true }) -- keymap.set('n', 'f', '<Plug>Sneak_s', { silent = true })
keymap.set('n', 'F', '<Plug>Sneak_S', { silent = true }) -- keymap.set('n', 'F', '<Plug>Sneak_S', { silent = true })
keymap.set('n', 's', 's', { silent = true }) -- keymap.set('n', 's', 's', { silent = true })
-- easymotion
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
keymap.set('n', '<leader>fs', '<Plug>(easymotion-sn)', { silent = true })
keymap.set('n', '<leader>w', '<Plug>(easymotion-overwin-f2)', { silent = true })
keymap.set('n', 'gl', '<Plug>(easymotion-sl)', { silent = true })
vim.g.EasyMotion_smartcase = 1
-- Telescope history
keymap.set('n', '<leader>fh', '<cmd>Telescope file_history history<CR>', { silent = true })
-- Define a custom function to move the current buffer to a vertical split with the previous buffer
function move_to_vertical_split()
local current_buffer = vim.fn.bufnr('%') -- Get the current buffer number
local last_buffer = vim.fn.bufnr('#') -- Get the previous buffer number
-- Check if last_buffer is set; if not, duplicate the current buffer
if last_buffer == -1 then
vim.cmd('vsplit')
vim.cmd('b ' .. current_buffer)
else
vim.cmd('vsplit')
vim.cmd('b ' .. last_buffer)
vim.cmd('wincmd w') -- Switch focus to the original (current) buffer
end
end
-- Map <leader>v to the custom function
keymap.set('n', '<leader>v', [[:lua move_to_vertical_split()<CR>]], { noremap = true, silent = true })
-- select a session to load
keymap.set("n", "<F2>", '<cmd>Telescope persisted<CR>', { silent = true })
keymap.set("n", "<leader>m", function()
local winid = vim.api.nvim_get_current_win()
local wininfo = vim.fn.getwininfo(winid)[1]
if wininfo and wininfo.wincol > vim.o.columns / 2 then
vim.cmd("wincmd H") -- Move to the left if currently on the right
else
vim.cmd("wincmd L") -- Move to the right if currently on the left
end
end, { desc = "Move buffer between left/right split" })
+48
View File
@@ -0,0 +1,48 @@
require("kulala").setup({
-- default_view, body or headers
default_view = "body",
-- dev, test, prod, can be anything
-- see: https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0#environment-files
default_env = "dev",
-- enable/disable debug mode
debug = false,
-- default formatters for different content types
formatters = {
json = { "jq", "." },
xml = { "xmllint", "--format", "-" },
html = { "xmllint", "--format", "--html", "-" },
},
-- default icons
icons = {
inlay = {
loading = "",
done = "",
error = "",
},
lualine = "🐼",
},
-- additional cURL options
-- see: https://curl.se/docs/manpage.html
additional_curl_options = {},
})
vim.filetype.add({
extension = {
['http'] = 'http',
},
})
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-l>", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-v>", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-e>", ":lua require('kulala').set_selected_env()<CR>",
-- { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rr", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rv", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>re", ":lua require('kulala').set_selected_env()<CR>",
{ noremap = true, silent = true })
+170 -156
View File
@@ -1,192 +1,206 @@
-- import lspconfig plugin safely -- lsp.lua (replace your current file with this)
local lspconfig_status, lspconfig = pcall(require, "lspconfig")
if not lspconfig_status then
return
end
-- import cmp-nvim-lsp plugin safely -- import cmp-nvim-lsp plugin safely
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -- local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not cmp_nvim_lsp_status then -- if not cmp_nvim_lsp_status then
return -- return
end -- end
local keymap = vim.keymap -- for conciseness local keymap = vim.keymap -- for conciseness
-- smart format with null-ls if available
local function smart_format()
vim.lsp.buf.format({
filter = function(client)
local ft = vim.bo.filetype
if ft == "rust" then
return client.name == "rust_analyzer"
end
-- Prefer null-ls for all non-Rust, otherwise allow anything
if vim.tbl_contains({ "null-ls", "lua_ls", "jsonls", "tsserver" }, client.name) then
return true
end
return false
end,
timeout_ms = 3000,
})
end
---------- border >------------------------------
do
local orig_floating_preview = vim.lsp.util.open_floating_preview
vim.lsp.util.open_floating_preview = function(contents, syntax, opts, ...)
opts = opts or {}
opts.border = "rounded"
return orig_floating_preview(contents, syntax, opts, ...)
end
end
---------- </border ------------------------------
vim.diagnostic.config({
virtual_text = false, -- Disable inline virtual text
float = {
border = "rounded", -- You can choose "single", "double", etc.
source = "always", -- Show the source of the diagnostic (set to 'if_many' for less clutter)
header = "", -- Optional: add a header to the float window
prefix = "", -- Optional: prefix for each diagnostic (leave empty for no prefix)
},
underline = true, -- Optional: underline the lines with errors
signs = true, -- Optional: show signs in the sign column
})
-- enable keybinds only for when lsp server available -- enable keybinds only for when lsp server available
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
-- keybind options
local opts = { noremap = true, silent = true, buffer = bufnr } local opts = { noremap = true, silent = true, buffer = bufnr }
keymap.set("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts) keymap.set("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
keymap.set("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts) -- got to declaration keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts) -- see definition and make edits in window -- keymap.set("n", "<leader>l", smart_format, opts)
keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation keymap.set("n", "<leader>l", function()
keymap.set("n", "<leader>l", "<cmd>lua vim.lsp.buf.format()<CR>", opts) -- format code vim.lsp.buf.format()
keymap.set("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts) -- format code end, { desc = "Format code function" })
keymap.set("n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts) -- see available code actions keymap.set("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
keymap.set("n", "<leader>ed", "<cmd>Telescope diagnostics<CR>", opts) -- jump to previous diagnostic in buffer
keymap.set( keymap.set(
"n", "n",
"<leader>cbf", "<leader>cbf",
":!phpcbf -w --standard=PSR12 %<CR>", ":!phpcbf -w --standard=PSR12 %<CR>",
{ noremap = true, silent = false, buffer = bufnr } { noremap = true, silent = false, buffer = bufnr }
) )
keymap.set("n", "<leader>o", "<cmd>Lspsaga outline<CR>", opts)
keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side keymap.set("n", "<leader>ss", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts)
keymap.set("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts) -- show documentation for what is under cursor
-- LSP Saga -- LSP Saga
keymap.set("n", "gsd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window keymap.set("n", "gsd", "<cmd>Lspsaga peek_definition<CR>", opts)
keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename keymap.set("n", "gr", "<cmd>Lspsaga finder<CR>", opts)
keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts)
keymap.set("n", "<leader>en", "<cmd>Lspsaga diagnostic_jump_next<CR>") -- jump to next diagnostic in buffer keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts)
keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor keymap.set("n", "ge", "<cmd>Lspsaga show_line_diagnostics<CR>", opts)
keymap.set("n", "<leader>eb", "<cmd>Lspsaga diagnostic_jump_prev<CR>") -- jump to previous diagnostic in buffer
keymap.set("n", "ge", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
keymap.set("n", "<leader>d", "<cmd>Lspsaga show_buf_diagnostics<CR>")
keymap.set("n", "<a-cr>", "<cmd>Lspsaga code_action<CR>", opts) keymap.set("n", "<a-cr>", "<cmd>Lspsaga code_action<CR>", opts)
-- keymap.set("n", "<leader>d", "<cmd>Telescope diagnostics<CR>", opts)
keymap.set("n", "<leader>da", "<cmd>Lspsaga show_workspace_diagnostics ++float<CR>", opts)
keymap.set("n", "<leader>db", "<cmd>Lspsaga show_buf_diagnostics ++float<CR>", opts)
keymap.set("n", "<leader>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>")
keymap.set("n", "<leader>dp", "<cmd>Lspsaga diagnostic_jump_prev<CR>")
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_next_start('@function.outer')<CR>",
opts)
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_previous_start('@function.outer')<CR>",
opts)
end end
-- used to enable autocompletion (assign to every lsp server config) -- capabilities
local capabilities = cmp_nvim_lsp.default_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
-- helper for registering server configs (lazy attach)
-- Change the Diagnostic symbols in the sign column (gutter) local function setup_server(name, config)
-- (not in youtube nvim video) local cfg = vim.tbl_deep_extend("force", {
local signs = { Error = "", Warn = "", Hint = "󰋽 ", Info = "" } capabilities = capabilities,
for type, icon in pairs(signs) do on_attach = on_attach,
local hl = "DiagnosticSign" .. type }, config or {})
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) -- register the config
-- use the function form so it works in latest nvim
vim.lsp.config(name, cfg)
end end
local lsp_flags = { -- servers
-- This is the default in Nvim 0.7+ setup_server("bashls", { filetypes = { "sh", "bin" } })
debounce_text_changes = 150, setup_server("lemminx", { filetypes = { "xml" } })
} setup_server("yamlls", { filetypes = { "yaml", "yml" } })
setup_server("jsonls", { filetypes = { "json" } })
lspconfig["bashls"].setup({ setup_server("pyright", { filetypes = { "py" } })
capabilities = capabilities, setup_server("html", { filetypes = { "html" } })
on_attach = on_attach, setup_server("cssls",
filetypes = { "sh", "bin" }, { filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" } })
}) setup_server("eslint", {
-- XML LSP
lspconfig["lemminx"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "xml" },
})
-- yaml LSP
lspconfig["yamlls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "yaml", "yml" },
})
-- json LSP
lspconfig["jsonls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "json" },
})
lspconfig["pyright"].setup({
on_attach = on_attach,
flags = lsp_flags,
filetypes = { "py" },
})
-- configure html server
lspconfig["html"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html" },
})
-- configure css server
lspconfig["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
}) })
setup_server("rust_analyzer", {
-- configure tailwindcss server
lspconfig["tailwindcss"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
-- configure emmet language server
lspconfig["emmet_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
lspconfig["eslint"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
-- rust
lspconfig["rust_analyzer"].setup({
on_attach = on_attach,
capabilities = capabilities,
flags = lsp_flags,
-- Server-specific settings...
settings = { settings = {
["rust-analyzer"] = { ["rust-analyzer"] = { checkOnSave = true, check = { command = "clippy" } },
-- enable clippy on save
checkOnSave = {
command = "clippy",
},
},
}, },
}) })
lspconfig["yamlls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "yml", "yaml" },
})
-- -- configure lua server (with special settings) -- PHP LSPs
lspconfig["lua_ls"].setup({ local util = vim.lsp.util
capabilities = capabilities, local root_dir = function(fname)
on_attach = on_attach, return util.root_pattern("composer.json", ".git")(fname)
settings = { -- custom settings for lua or util.path.dirname(fname)
Lua = { end
-- make the language server recognize "vim" global
diagnostics = { local fallback_root_dir = function(fname)
globals = { "vim" }, return util.root_pattern("composer.json", ".git")(fname) or util.path.dirname(fname)
}, end
workspace = {
-- make language server aware of runtime files -- start it manually :LspStart phpactor
library = { -- setup_server("phpactor", {
[vim.fn.expand("$VIMRUNTIME/lua")] = true, -- filetypes = { "php" },
[vim.fn.stdpath("config") .. "/lua"] = true, -- -- root_dir = fallback_root_dir,
}, -- init_options = {
}, -- ["language_server_phpstan.enabled"] = true,
}, -- ["language_server_psalm.enabled"] = false,
}, -- },
-- })
setup_server("lua_ls", {
filetypes = { "lua" }, filetypes = { "lua" },
settings = {
Lua = {
diagnostics = {
globals = { "vim" } },
format = { enable = true },
}
}
}) })
lspconfig["phpactor"].setup({ setup_server("intelephense", {
on_attach = on_attach, filetypes = { "php" },
capabilities = capabilities, -- root_dir = fallback_root_dir,
init_options = { init_options = {
["language_server_phpstan.enabled"] = true, licenceKey = (function()
["language_server_psalm.enabled"] = false, local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt")
if vim.fn.filereadable(license_path) == 1 then
return vim.fn.readfile(license_path)[1]
end
return nil
end)(),
},
settings = {
intelephense = {
telemetry = { enabled = false },
files = {
maxSize = 5000000,
associations = { "**/*.php" },
},
completion = {
fullyQualifyGlobalConstantsAndFunctions = false,
triggerParameterHints = true,
maxItems = 100,
},
phpdoc = { enabled = true },
diagnostics = { enable = true },
format = { enable = false },
},
}, },
filetypes = { "php" },
}) })
lspconfig["intelephense"].setup({ -- phpcs / phpstan configs
capabilities = capabilities, vim.g.nvim_phpcs_config_phpcs_path = 'phpcs'
on_attach = on_attach, vim.g.nvim_phpcs_config_phpcbf_path = 'phpcbf'
filetypes = { "php" }, vim.g.ale_php_phpstan_executable = '~/.config/composer/vendor/bin/phpstan'
})
local phpcs_config = "~/repos/configs/phpcs.xml"
local phpcs_config_new = "~/repos/dotfiles/phpcs.xml"
if vim.loop.fs_stat(phpcs_config_new) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new
elseif vim.loop.fs_stat(phpcs_config) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config
end
-- === ENABLE: tell Neovim to autostart these configs lazily (filetype + root_dir)
-- call this early in your init (so FileType autocommands are installed before opening files)
local enabled_servers = {
"bashls", "lemminx", "yamlls", "jsonls", "pyright", "html", "cssls",
"eslint", "rust_analyzer", "lua_ls",
"intelephense"
}
vim.lsp.enable(enabled_servers)
-24
View File
@@ -1,24 +0,0 @@
-- import lspsaga safely
-- local saga_status, saga = pcall(require, "lspsaga")
-- if not saga_status then
-- return
-- end
require("lazy").setup({
"glepnir/lspsaga.nvim",
event = "BufRead",
config = function()
require("lspsaga").setup({})
end,
dependencies = { { "nvim-tree/nvim-web-devicons" } },
-- keybinds for navigation in lspsaga window
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
-- use enter to open file with finder
finder_action_keys = {
open = "<CR>",
},
-- use enter to open file with definition preview
definition_action_keys = {
edit = "<CR>",
},
})
+5
View File
@@ -0,0 +1,5 @@
require("mason").setup({
ui = {
border = "single"
}
})
+42
View File
@@ -0,0 +1,42 @@
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.phpcbf.with({
command = "phpcbf", -- or full path if not in PATH
extra_args = { "--standard=PSR12", "--standard=phpcs.xml" },
}),
null_ls.builtins.diagnostics.phpstan.with({
command = "phpstan",
args = {
"analyse",
"--error-format", "raw",
"--no-progress",
"$FILENAME", -- or your project's entrypoint folder
},
method = null_ls.methods.DIAGNOSTICS_ON_SAVE, -- or ON_OPEN or BOTH
condition = function(utils)
return utils.root_has_file({ "phpstan.neon", "phpstan.neon.dist" })
end,
}),
null_ls.builtins.diagnostics.phpcs.with({
command = "phpcs", -- or "vendor/bin/phpcs" if local
args = {
"--standard=PSR12", -- or "phpcs.xml", "phpcs.xml.dist", etc.
"-s", -- show sniff codes
"-q", -- suppress warnings
"--report=emacs",
"--stdin-path", "$FILENAME",
"-"
},
condition = function(utils)
return utils.root_has_file({ "phpcs.xml", "phpcs.xml.dist" }) or true
end,
}),
null_ls.builtins.formatting.phpcsfixer.with({
command = "php-cs-fixer",
-- no extra_args needed if config file is correctly named and in root
}),
},
on_attach = on_attach,
})
+29 -4
View File
@@ -19,6 +19,11 @@ end
-- load vs-code like snippets from plugins (e.g. friendly-snippets) -- load vs-code like snippets from plugins (e.g. friendly-snippets)
require("luasnip/loaders/from_vscode").lazy_load() require("luasnip/loaders/from_vscode").lazy_load()
local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
vim.opt.completeopt = "menu,menuone,noselect" vim.opt.completeopt = "menu,menuone,noselect"
cmp.setup({ cmp.setup({
@@ -34,12 +39,32 @@ cmp.setup({
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion ["<C-k>"] = cmp.mapping(function(fallback)
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<C-j>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<C-b>"] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(), -- close completion window ["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), ["<CR>"] = cmp.mapping.confirm({ select = true }),
}), }),
-- sources for autocompletion -- sources for autocompletion
+114 -15
View File
@@ -8,7 +8,7 @@ return {
-- -- commenting with gc -- -- commenting with gc
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
"justinmk/vim-sneak", -- "justinmk/vim-sneak",
"arkav/lualine-lsp-progress", "arkav/lualine-lsp-progress",
-- tmux & split window navigation -- tmux & split window navigation
@@ -16,7 +16,7 @@ return {
"hrsh7th/cmp-buffer", -- source for text in buffer "hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths "hrsh7th/cmp-path", -- source for file system paths
"mechatroner/rainbow_csv",
"nvim-telescope/telescope-project.nvim", "nvim-telescope/telescope-project.nvim",
"ThePrimeagen/harpoon", "ThePrimeagen/harpoon",
@@ -27,15 +27,23 @@ return {
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, { "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
{ {
"glepnir/lspsaga.nvim", 'nvimdev/lspsaga.nvim',
event = "BufRead",
config = function() config = function()
require("lspsaga").setup({}) require('lspsaga').setup({})
end, end,
dependencies = { dependencies = {
{ "nvim-tree/nvim-web-devicons" }, 'nvim-treesitter/nvim-treesitter', -- optional
--Please make sure you install markdown and markdown_inline parser 'nvim-tree/nvim-web-devicons', -- optional
{ "nvim-treesitter/nvim-treesitter" }, },
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
-- use enter to open file with finder
finder_action_keys = {
open = "<CR>",
},
-- use enter to open file with definition preview
definition_action_keys = {
edit = "<CR>",
}, },
}, },
@@ -43,7 +51,10 @@ return {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
{ {
"rcarriga/nvim-dap-ui", "rcarriga/nvim-dap-ui",
dependencies = "mfussenegger/nvim-dap", dependencies = {
{ "mfussenegger/nvim-dap" },
{ "nvim-neotest/nvim-nio" }
},
}, },
{ {
"theHamsta/nvim-dap-virtual-text", "theHamsta/nvim-dap-virtual-text",
@@ -60,17 +71,105 @@ return {
}, },
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
"easymotion/vim-easymotion",
-- Markdown
-- {
-- "iamcco/markdown-preview.nvim",
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
-- build = "cd app && yarn install",
-- init = function()
-- vim.g.mkdp_filetypes = { "markdown" }
-- end,
-- ft = { "markdown" },
-- },
{ {
"neovim/nvim-lspconfig", 'akinsho/bufferline.nvim',
dependencies = { version = "*",
dependencies = 'nvim-tree/nvim-web-devicons'
},
-- local history
{ {
"SmiteshP/nvim-navbuddy", 'dawsers/telescope-file-history.nvim',
dependencies = { dependencies = {
"SmiteshP/nvim-navic", 'nvim-telescope/telescope.nvim'
"MunifTanjim/nui.nvim", }
}, },
opts = { lsp = { auto_attach = true } },
{ 'echasnovski/mini.icons', version = false },
{
-- HTTP REST-Client Interface
'mistweaverco/kulala.nvim',
}, },
--- diff view ---
"sindrets/diffview.nvim",
---- show listchars ----
{
"fraso-dev/nvim-listchars",
config = function()
require("nvim-listchars").setup({
save_state = false,
listchars = {
trail = "-",
eol = "",
tab = "» ",
}, },
exclude_filetypes = {},
lighten_step = 10,
})
end,
}, },
-- Lua sesion manager
{
"olimorris/persisted.nvim",
lazy = false,
opts = {
autoload = false,
autosave = true,
use_git_branch = true,
},
config = function(_, opts)
local persisted = require("persisted")
persisted.branch = function()
local branch = vim.fn.systemlist("git branch --show-current")[1]
return vim.v.shell_error == 0 and branch or nil
end
persisted.setup(opts)
end,
},
'nvimtools/none-ls.nvim',
-- {
-- "folke/persistence.nvim",
-- event = "BufReadPre", -- this will only start session saving when an actual file was opened
-- opts = {
-- -- add any custom options here
-- }
-- },
-- lazy.nvim Hardtime
-- {
-- "m4xshen/hardtime.nvim",
-- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
-- opts = {}
-- },
{
"zenbones-theme/zenbones.nvim",
-- Optionally install Lush. Allows for more configuration or extending the colorscheme
-- If you don't want to install lush, make sure to set g:zenbones_compat = 1
-- In Vim, compat mode is turned on as Lush only works in Neovim.
dependencies = "rktjmp/lush.nvim",
lazy = false,
priority = 1000,
-- you can set set configuration options here
-- config = function()
-- vim.g.zenbones_darken_comments = 45
-- vim.cmd.colorscheme('zenbones')
-- end
}
} }
+25
View File
@@ -0,0 +1,25 @@
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = "*.csv",
callback = function()
vim.bo.filetype = "csv_semicolon"
end
})
vim.keymap.set("n", "<leader>ra", ":RainbowAlign<CR>", { desc = "Rainbow CSV align", silent = true })
vim.keymap.set("n", "<leader>rd", ":RainbowDelim<CR>", { desc = "Rainbow CSV set delimiter under cursor", silent = true })
vim.keymap.set('n', '<C-Left>', function()
return vim.b.rbcsv == 1 and ':RainbowCellGoLeft<CR>' or '<C-Left>'
end, { expr = true, noremap = true })
vim.keymap.set('n', '<C-Right>', function()
return vim.b.rbcsv == 1 and ':RainbowCellGoRight<CR>' or '<C-Right>'
end, { expr = true, noremap = true })
vim.keymap.set('n', '<C-Up>', function()
return vim.b.rbcsv == 1 and ':RainbowCellGoUp<CR>' or '<C-Up>'
end, { expr = true, noremap = true })
vim.keymap.set('n', '<C-Down>', function()
return vim.b.rbcsv == 1 and ':RainbowCellGoDown<CR>' or '<C-Down>'
end, { expr = true, noremap = true })
+3 -1
View File
@@ -5,4 +5,6 @@ if not setup then
end end
-- enable startup -- enable startup
startup.setup() startup.setup({
theme = "dashboard"
})
+33 -2
View File
@@ -19,19 +19,50 @@ telescope.setup({
["<C-k>"] = actions.move_selection_previous, -- move to prev result ["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result ["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist
['<C-u>'] = false,
['<C-d>'] = false,
}, },
}, },
preview = {
treesitter = false,
},
}, },
}) })
telescope.load_extension("fzf") telescope.load_extension("fzf")
telescope.load_extension("project") telescope.load_extension("project")
telescope.load_extension('harpoon') telescope.load_extension("harpoon")
telescope.load_extension("persisted")
require('file_history').setup {
-- This is the location where it will create your file history repository
backup_dir = "~/.file-history-git",
-- command line to execute git
git_cmd = "git"
}
telescope.load_extension('file_history')
-- telescope.load_extension("dap") -- telescope.load_extension("dap")
vim.api.nvim_set_keymap( vim.api.nvim_set_keymap(
"n", "n",
"<C-p>", "<F3>",
":lua require'telescope'.extensions.project.project{}<CR>", ":lua require'telescope'.extensions.project.project{}<CR>",
{ noremap = true, silent = true } { noremap = true, silent = true }
) )
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
+14 -5
View File
@@ -13,6 +13,8 @@ set splitright splitbelow
set timeoutlen=1000 set timeoutlen=1000
set number set number
set relativenumber set relativenumber
set scrolloff=10
syntax on syntax on
filetype indent on filetype indent on
set smartindent set smartindent
@@ -36,13 +38,13 @@ vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv vnoremap <A-k> :m '<-2<CR>gv=gv
nnoremap <leader>a ggVG nnoremap <leader>a ggVG
" nnoremap <leader>b :Telescope buffers<CR> " nnoremap <leader>b :Telescope buffers<CR>
nnoremap ,b :Buffers<CR> nnoremap ,b :buffers<CR>
" nnoremap <leader>t :Explorer<CR> " nnoremap <leader>t :Explorer<CR>
" use leader e instead " use leader e instead
nnoremap <leader>y "+yy nnoremap <leader>y "+yy
vnoremap <leader>y "+y vnoremap <leader>y "+y
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>/ ":nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" xnoremap ("<leader>p", "\"_dP") " xnoremap ("<leader>p", "\"_dP")
" autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
@@ -54,9 +56,16 @@ nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L> nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H> nnoremap <C-H> <C-W><C-H>
nnoremap <C-d> <C-d>zz " nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz " nnoremap <C-u> <C-u>zz
tnoremap <Esc> <C-\><C-n>
" No clue what this does
" tnoremap <Esc> <C-\><C-n>
" nnoremap <C-F> :Rg<CR> " nnoremap <C-F> :Rg<CR>
" nnoremap <C-p> :Files<CR> " nnoremap <C-p> :Files<CR>
" XML
let g:xml_syntax_folding=1
au FileType xml setlocal foldmethod=syntax
-74
View File
@@ -1,74 +0,0 @@
-- autoformat.lua
--
-- Use your language server to automatically format your code on save.
-- Adds additional commands as well to manage the behavior
return {
'neovim/nvim-lspconfig',
config = function()
-- Switch for controlling whether you want autoformatting.
-- Use :KickstartFormatToggle to toggle autoformatting on or off
local format_is_enabled = true
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
format_is_enabled = not format_is_enabled
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
end, {})
-- Create an augroup that is used for managing our formatting autocmds.
-- We need one augroup per client to make sure that multiple clients
-- can attach to the same buffer without interfering with each other.
local _augroups = {}
local get_augroup = function(client)
if not _augroups[client.id] then
local group_name = 'kickstart-lsp-format-' .. client.name
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
_augroups[client.id] = id
end
return _augroups[client.id]
end
-- Whenever an LSP attaches to a buffer, we will run this function.
--
-- See `:help LspAttach` for more information about this autocmd event.
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
-- This is where we attach the autoformatting for reasonable clients
callback = function(args)
local client_id = args.data.client_id
local client = vim.lsp.get_client_by_id(client_id)
local bufnr = args.buf
-- Only attach to clients that support document formatting
if not client.server_capabilities.documentFormattingProvider then
return
end
-- Tsserver usually works poorly. Sorry you work with bad languages
-- You can remove this line if you know what you're doing :)
if client.name == 'tsserver' then
return
end
-- Create an autocmd that will run *before* we save the buffer.
-- Run the formatting command for the LSP that has just attached.
vim.api.nvim_create_autocmd('BufWritePre', {
group = get_augroup(client),
buffer = bufnr,
callback = function()
if not format_is_enabled then
return
end
vim.lsp.buf.format {
async = false,
filter = function(c)
return c.id == client.id
end,
}
end,
})
end,
})
end,
}
+83 -7
View File
@@ -6,6 +6,7 @@
-- be extended to other languages as well. That's why it's called -- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;) -- kickstart.nvim and not kitchen-sink.nvim ;)
return { return {
-- NOTE: Yes, you can install new plugins here! -- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
@@ -25,10 +26,14 @@ return {
local dap = require 'dap' local dap = require 'dap'
local dapui = require 'dapui' local dapui = require 'dapui'
require("nvim-dap-virtual-text").setup {
}
require('mason-nvim-dap').setup { require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with -- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations -- reasonable debug configurations
automatic_setup = true, automatic_setup = true,
automatic_installation = true,
-- You can provide additional configuration to the handlers, -- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information -- see mason-nvim-dap README for more information
@@ -38,19 +43,21 @@ return {
-- online, please don't ask me how to install them :) -- online, please don't ask me how to install them :)
ensure_installed = { ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want -- Update this to ensure that you have the debuggers for the langs you want
'delve', -- 'delve',
}, },
} }
-- Basic debugging keymaps, feel free to change to your liking! -- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' }) vim.keymap.set('n', '<F9>', dap.continue, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' }) vim.keymap.set('n', '<F7>', dap.step_into, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' }) vim.keymap.set('n', '<F8>', dap.step_over, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' }) vim.keymap.set('n', '<S-F8>', dap.step_out, { desc = 'Debug: Step Out' })
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) vim.keymap.set('n', '<leader>bp', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
vim.keymap.set('v', ',e', dapui.eval, { desc = 'Debug: Evaluate expression' })
vim.keymap.set('n', '<leader>B', function() vim.keymap.set('n', '<leader>B', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, { desc = 'Debug: Set Breakpoint' }) end, { desc = 'Debug: Set Breakpoint' })
vim.keymap.set("n", "<F11>", function() require("dapui").close() end, { desc = "Close all DAP UI frames" })
-- Dap UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
@@ -74,8 +81,77 @@ return {
}, },
} }
-- PHP
dap.adapters.php = {
type = "executable",
command = "node",
args = { "/home/mace/.local/share/nvim/mason/packages/php-debug-adapter/extension/out/phpDebug.js" }
}
dap.configurations.php = {
{
type = "php",
request = "launch",
name = "Listen for Xdebug",
port = 9003,
stopOnEntry = true,
-- pathMappings = {
-- ["/path/on/server"] = "/path/on/local/machine", -- Adjust to map your server paths to local paths
-- },
},
}
-- Rust
dap.adapters.lldb = {
type = "executable",
command = "codelldb",
name = "lldb",
-- args = { "--log", "--log-file=/tmp/codelldb.log" },
}
dap.configurations.rust = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = function()
-- Ask interactively for args
local args_string = vim.fn.input('Args: ')
return vim.fn.split(args_string, " ", true)
end,
-- Additional LLDB-specific settings
runInTerminal = false,
},
{
name = "Debug Test",
type = "lldb",
request = "launch",
program = function()
-- Prompt the user for the test binary
return vim.fn.input("Path to test binary: ", vim.fn.getcwd() .. "/target/debug/deps/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = function()
-- Prompt the user for the specific test function to run
local test_name = vim.fn.input("Test name (leave empty to run all tests): ")
if test_name ~= "" then
return { "--exact", test_name }
else
return {}
end
end,
runInTerminal = false,
},
}
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' }) vim.keymap.set('n', '<F10>', dapui.toggle, { desc = 'Debug: See last session result.' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
+9 -1
View File
@@ -10,6 +10,14 @@ return {
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim',
}, },
config = function() config = function()
require('neo-tree').setup {} require('neo-tree').setup({
filesystem = {
window = {
mappings = {
["l"] = "open", -- Map 'l' to open directories
},
},
},
})
end, end,
} }