Compare commits
103 Commits
637df70213
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 38709a3b71 | |||
| 391b30bd7a | |||
| 0af71243a3 | |||
| d0ea7c50a0 | |||
| 233275c160 | |||
| ccd0319364 | |||
| f11dae4fce | |||
| 09e50948e4 | |||
| d1167c2fe9 | |||
| 04f1abe4d1 | |||
| 821f9bee27 | |||
| fbcc0b8d61 | |||
| 6a326d7321 | |||
| 36bb19fc4e | |||
| 8850a7cc27 | |||
| 480e35d011 | |||
| 95d3e129ad | |||
| 2e55a01664 | |||
| a233f6e7f2 | |||
| 8f4d2e287e | |||
| a660f0c788 | |||
| f75def6081 | |||
| 71dac4d82f | |||
| 04e5478570 | |||
| 1cb0dab7ff | |||
| 9ac8c17116 | |||
| 37fb243950 | |||
| 4304241960 | |||
| 8d52d1ae69 | |||
| 25f82a9efb | |||
| dff46591c7 | |||
| 5f80a31736 | |||
| 3f6dd0b93f | |||
| 33487db7c3 | |||
| d45101d38d | |||
| 2ca16adfbf | |||
| a96e697ea3 | |||
| 20453f156d | |||
| 10c005be2d | |||
| a3269dbfc4 | |||
| dba36e227c | |||
| aacdd5e376 | |||
| cf8bac705a | |||
| 1f8fe4fa49 | |||
| 13eefe179a | |||
| 6d75099060 | |||
| f15662fa74 | |||
| aeb15189f2 | |||
| e48121945c | |||
| df5749ecd3 | |||
| 2754087154 | |||
| 9d28ec0082 | |||
| 5a8942b389 | |||
| 41993e4393 | |||
| 95a3a82346 | |||
| 3ed631bcc4 | |||
| c6a6648126 | |||
| e00b8ca9a9 | |||
| 0885e0e9b9 | |||
| 6c2df0572b | |||
| d27336e6df | |||
| f499e5c6ec | |||
| 4071b56ab0 | |||
| 5bdb7589c7 | |||
| 8ddb3ae17e | |||
| aff0a22908 | |||
| 6c886df0d5 | |||
| 6c352db191 | |||
| 4d525339f7 | |||
| a469b206fd | |||
| 66ffd49dd6 | |||
| 76c98ecc30 | |||
| 209e53ad84 | |||
| 7012179326 | |||
| b75503d8c9 | |||
| 30b0658600 | |||
| 3ee3256320 | |||
| 4007b903ed | |||
| 7d0b034585 | |||
| 1b8501a22c | |||
| a565f4683c | |||
| a5860c4237 | |||
| 4c760227c7 | |||
| e3f78c1801 | |||
| e8c47ee5e1 | |||
| 02d939d8a5 | |||
| 33baa8ab27 | |||
| 662960b1b1 | |||
| e5f3d8da23 | |||
| e438717557 | |||
| b8776f785e | |||
| 476eb2e86f | |||
| ec66c0d732 | |||
| d9c84c6e23 | |||
| 4ab0dddfd5 | |||
| 623345db67 | |||
| 725b4e75bd | |||
| 0e8cf26144 | |||
| 3b95214e8b | |||
| fbd0b7a3c8 | |||
| 9fe54bcc10 | |||
| b22133d2dd | |||
| 3b709033df |
@@ -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,7 +120,6 @@ require('lazy').setup({
|
|||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = false,
|
icons_enabled = false,
|
||||||
theme = 'onedark',
|
|
||||||
component_separators = '|',
|
component_separators = '|',
|
||||||
section_separators = '',
|
section_separators = '',
|
||||||
},
|
},
|
||||||
@@ -174,22 +127,13 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
-- Add indentation guides even on blank lines
|
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
|
||||||
-- See `:help indent_blankline.txt`
|
|
||||||
main = "ibl",
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- "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.
|
||||||
@@ -207,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',
|
||||||
|
|
||||||
@@ -296,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>n'] = '@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`
|
||||||
@@ -508,15 +287,20 @@ 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')
|
||||||
@@ -526,3 +310,8 @@ require('custom.keymaps')
|
|||||||
require('custom.harpoon')
|
require('custom.harpoon')
|
||||||
require('custom.mason')
|
require('custom.mason')
|
||||||
require('custom.bufferline')
|
require('custom.bufferline')
|
||||||
|
require('custom.kulala')
|
||||||
|
require('custom.rainbow')
|
||||||
|
require('custom.none-ls')
|
||||||
|
require('custom.gitsigns')
|
||||||
|
require('custom.colortheme')
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
}
|
||||||
+34
-9
@@ -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 current<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 current 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,18 +50,25 @@ 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
|
-- easymotion
|
||||||
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
|
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
|
||||||
keymap.set('n', '<leader>fs', '<Plug>(easymotion-overwin-f2)', { 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
|
-- Telescope history
|
||||||
keymap.set('n', '<leader>fh', '<cmd>Telescope file_history history<CR>', { silent = true })
|
keymap.set('n', '<leader>fh', '<cmd>Telescope file_history history<CR>', { silent = true })
|
||||||
@@ -80,3 +91,17 @@ end
|
|||||||
|
|
||||||
-- Map <leader>v to the custom function
|
-- Map <leader>v to the custom function
|
||||||
keymap.set('n', '<leader>v', [[:lua move_to_vertical_split()<CR>]], { noremap = true, silent = true })
|
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" })
|
||||||
|
|||||||
@@ -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 })
|
||||||
+167
-175
@@ -1,214 +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 >------------------------------
|
---------- border >------------------------------
|
||||||
local _border = "single"
|
do
|
||||||
require('lspconfig.ui.windows').default_options = {
|
local orig_floating_preview = vim.lsp.util.open_floating_preview
|
||||||
border = _border
|
vim.lsp.util.open_floating_preview = function(contents, syntax, opts, ...)
|
||||||
}
|
opts = opts or {}
|
||||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
opts.border = "rounded"
|
||||||
vim.lsp.handlers.hover, {
|
return orig_floating_preview(contents, syntax, opts, ...)
|
||||||
border = _border
|
end
|
||||||
}
|
end
|
||||||
)
|
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
|
||||||
vim.lsp.handlers.signature_help, {
|
|
||||||
border = _border
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.diagnostic.config {
|
|
||||||
float = { border = _border }
|
|
||||||
}
|
|
||||||
---------- </border ------------------------------
|
---------- </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("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts) -- show documentation for what is under cursor
|
|
||||||
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>Lspsaga outline<CR>", opts) -- see outline on right hand side
|
keymap.set("n", "<leader>ss", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts)
|
||||||
|
|
||||||
|
|
||||||
-- 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)
|
||||||
|
|||||||
@@ -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>",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -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
@@ -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
|
||||||
|
|||||||
+104
-29
@@ -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,29 +71,18 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"SmiteshP/nvim-navbuddy",
|
|
||||||
dependencies = {
|
|
||||||
"SmiteshP/nvim-navic",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
opts = { lsp = { auto_attach = true } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"easymotion/vim-easymotion",
|
"easymotion/vim-easymotion",
|
||||||
|
|
||||||
-- Markdown
|
-- Markdown
|
||||||
{
|
-- {
|
||||||
"iamcco/markdown-preview.nvim",
|
-- "iamcco/markdown-preview.nvim",
|
||||||
ft = "markdown",
|
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||||
build = function()
|
-- build = "cd app && yarn install",
|
||||||
vim.fn["mkdp#util#install"]()
|
-- init = function()
|
||||||
end,
|
-- vim.g.mkdp_filetypes = { "markdown" }
|
||||||
},
|
-- end,
|
||||||
|
-- ft = { "markdown" },
|
||||||
|
-- },
|
||||||
|
|
||||||
{
|
{
|
||||||
'akinsho/bufferline.nvim',
|
'akinsho/bufferline.nvim',
|
||||||
@@ -96,5 +96,80 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-telescope/telescope.nvim'
|
'nvim-telescope/telescope.nvim'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ '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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 })
|
||||||
@@ -5,4 +5,6 @@ if not setup then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- enable startup
|
-- enable startup
|
||||||
startup.setup()
|
startup.setup({
|
||||||
|
theme = "dashboard"
|
||||||
|
})
|
||||||
|
|||||||
@@ -19,14 +19,20 @@ 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 {
|
require('file_history').setup {
|
||||||
-- This is the location where it will create your file history repository
|
-- This is the location where it will create your file history repository
|
||||||
backup_dir = "~/.file-history-git",
|
backup_dir = "~/.file-history-git",
|
||||||
@@ -38,7 +44,25 @@ telescope.load_extension('file_history')
|
|||||||
|
|
||||||
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' })
|
||||||
|
|
||||||
|
|||||||
+9
-5
@@ -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,11 @@ 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>
|
||||||
|
|||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user