1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

update nvim config

This commit is contained in:
Henrik Hautakoski 2024-03-06 18:32:18 +01:00
parent e3f9d23175
commit 1e68462bc1
21 changed files with 350 additions and 99 deletions

View file

@ -1,12 +1,14 @@
{ {
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
"barbar.nvim": { "branch": "master", "commit": "1d6b1386abe97d1d8cba47eb9afa8a9f2d1bbe66" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, "dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"go.nvim": { "branch": "master", "commit": "8efd0c89f2305a6840a99d7823c40cc3acea91d6" }, "go.nvim": { "branch": "master", "commit": "43850d00feb887bc0195fe3331ff6fb76837f8e9" },
"guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" }, "guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
@ -17,13 +19,17 @@
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
"neo-tree.nvim": { "branch": "main", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" }, "neo-tree.nvim": { "branch": "main", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" },
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" }, "neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
"neotest-phpunit": { "branch": "main", "commit": "2f01e83eedbcf6f0257934b32b5d4fda404a9f11" },
"nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" }, "nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" },
"nvim-test": { "branch": "main", "commit": "e06f3d029ee161f3ead6193cf27354d1eb8723c3" }, "nvim-test": { "branch": "main", "commit": "e06f3d029ee161f3ead6193cf27354d1eb8723c3" },
"nvim-treesitter": { "branch": "master", "commit": "c2a265156d5799adbd9f9e7d5385735fa5d21776" }, "nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" },
"nvim-web-devicons": { "branch": "master", "commit": "69fb193abc547c77be089c3e392d5fd6fcd3625a" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },

View file

@ -1,12 +1,8 @@
--
-- Filetype settings
--
local autocmd = vim.api.nvim_create_autocmd local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup local augroup = vim.api.nvim_create_augroup
local set = vim.opt
-- Default softtab (4)
set.tabstop = 4
set.softtabstop = 4
set.shiftwidth = 4
set.autoindent = true
augroup('indent', { clear = true }) augroup('indent', { clear = true })
@ -30,3 +26,9 @@ autocmd('Filetype', {
pattern = { 'c', 'cpp' }, pattern = { 'c', 'cpp' },
command = 'setlocal ts=8 sts=0 sw=8 noexpandtab' command = 'setlocal ts=8 sts=0 sw=8 noexpandtab'
}) })
-- Fix autocomment plugins to use line comments for php.
autocmd('Filetype', {
pattern = 'php',
command = 'setlocal commentstring=//\\%s'
})

52
nvim/lua/config/icons.lua Normal file
View file

@ -0,0 +1,52 @@
return {
prompt = '',
current = ' ',
selected = '',
close = '',
pinned = '',
diff = {
added = '',
modified = '',
removed = '',
},
filetree = {
basic = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
},
git = {
-- Change type
added = "",
modified = "",
deleted = "",
renamed = "󰁕",
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
},
},
diff_gutter = {
add = '',
change = '',
delete = '',
untracked = '+'
},
diagnostics = {
error = '',
warn = '',
info = '',
hint = ''
},
test = {
ok = '',
failed = '',
running = '',
skipped = '',
watch = '',
unknown = '',
}
}

View file

@ -1,3 +1,3 @@
require("config.settings") require("config.settings")
require("config.mappings") require("config.mappings")
require("config.indent") require("config.filetype")

View file

@ -1,21 +1,49 @@
--
-- Keymaps! Alot of stuff "borrowed" from thePrimeagen
--
local map = vim.keymap.set local map = vim.keymap.set
local cmd = vim.cmd local cmd = vim.cmd
vim.g.mapleader = " " vim.g.mapleader = " "
-- Undo/Redo in insert mode -- Make half page jumps stay in the center of screen
map("i", "<C-z>", cmd.undo) map("n", "<C-u>", "<C-u>zz", { silent = true, desc = "jump half a page up" })
map("i", "<C-y>", cmd.redo) map("n", "<C-d>", "<C-d>zz", { silent = true, desc = "jump half a page down" })
map("n", "<S-PageUp>", "<C-u>zz", { silent = true, desc = "jump half a page up" })
map("n", "<S-PageDown>", "<C-d>zz", { silent = true, desc = "jump half a page down" })
-- Make jump to next search item stay in the center of screen.
map("n", "n", "nzzzv", { silent = true, desc = "jump to next search match" })
map("n", "N", "Nzzzv", { silent = true, desc = "jump to previous search match" })
-- Ctrl+s saves the current buffer in normal/insert mode. -- Ctrl+s saves the current buffer in normal/insert mode.
map("n", "<C-s>", cmd.w) map({"n", "i"}, "<C-s>", cmd.w, { desc = "save current buffer" })
map("i", "<C-s>", cmd.w)
-- Move Text -- Move text
map("n", "<S-a>", ":m+1<CR>") map("n", "<S-a>", ":m -2<CR>v=", { silent = true, desc = "move current line one line up" })
map("n", "<S-d>", ":m-2<CR>") map("n", "<S-d>", ":m +1<CR>v=", { silent = true, desc = "move current line one line down" })
map("v", "<S-a>", ":m '<-2<CR>gv=gv", { silent = true, desc = "move current selection one line up" })
map("v", "<S-d>", ":m '>+1<CR>gv=gv", { silent = true, desc = "move current selection one line down" })
-- copy/paste
map("x", "<leader>p", [["_dP]], { silent = true, desc = "Paste over selected text without losing content in \"-register" })
map({"n", "v"}, "<leader>y", [["+y]], { desc = "Yank to system clipboard register" })
-- File operations
map("n", "<leader>fx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Set execute flag on current file" })
-- buffers
map("n", "<leader>bn", cmd.bn, { silent = true, desc = "Move to next buffer"})
map("n", "<leader>bb", cmd.bp, { silent = true, desc = "Move to previous buffer"})
map("n", "<leader>bd", cmd.bd, { silent = true, desc = "Close current buffer"})
-- Indent -- Indent
map('n', "<Tab>", "v=")
map('x', "<Tab>", "=", { desc = "auto indent selection" })
map("i", "<S-Tab>", "<C-d>", { desc = "delete indent" })
-- Make Shift-Tab undo indent. -- Crazy search+replace
map("i", "<S-Tab>", "<C-d>") map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {
desc = "search+replace word under cursor"
})
map("n", "Q", "<nop>")

View file

@ -1,25 +1,35 @@
-- local set = vim.opt
-- General Settings -- General Settings
-- --
vim.opt.showmode = false -- disable mode in the command line, because i use lualine set.termguicolors = true
set.updatetime = 50
set.showmode = false -- disable mode in the command line, because i use lualine
-- --
-- Editor settings -- Editor settings
-- --
vim.opt.scrolloff=20 set.hlsearch = false
set.incsearch = true
set.laststatus = 3
set.scrolloff=20
--vim.opt.sidescrolloff = 8 --vim.opt.sidescrolloff = 8
vim.opt.cursorline = true set.cursorline = true
-- line numbers -- line numbers
vim.opt.number = true set.number = true
vim.opt.relativenumber = true set.relativenumber = true
vim.opt.numberwidth = 5 set.numberwidth = 5
vim.opt.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s ' set.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s '
-- indent -- indent
vim.opt.smartindent = true set.tabstop = 4
set.softtabstop = 4
set.shiftwidth = 4
set.autoindent = true
set.smartindent = true
-- Filetypes -- Filetypes
vim.filetype.add({ vim.filetype.add({

View file

@ -1,8 +1,13 @@
return { return {
{ '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' }, { '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' },
{ '<leader>sa', '<cmd>Telescope live_grep<cr>', desc = 'Search in files' },
{ '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' }, { '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' },
{ '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search Word' }, { '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search for word under cursor' },
-- LSP -- LSP
--{ 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' }, { '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ '<leader>ss', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Search document symbols' },
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' },
} }

View file

@ -0,0 +1,29 @@
local icons = require('config.icons')
return {
'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim',
'nvim-tree/nvim-web-devicons',
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
animation = false,
auto_hide = 0,
focus_on_close = 'previous',
button = icons.close,
highlight_inactive_file_icons = true,
icons = {
separator = {left = '', right = ''},
separator_at_end = false,
inactive = { button = '' },
modified = {button = icons.filetree.git.modified },
pinned = {button = '', filename = true},
},
maximum_padding = 2,
minimum_padding = 1,
sidebar_filetypes = {
['neo-tree'] = {event = 'BufWipeout'},
}
},
}

View file

@ -52,5 +52,10 @@ return {
local c = require('onedark') local c = require('onedark')
c.setup(opts) c.setup(opts)
c.load() c.load()
vim.cmd(string.format("highlight GitSignsAdd guifg='%s'", opts.colors.green))
vim.cmd(string.format("highlight GitSignsChange guifg='%s'", opts.colors.yellow))
vim.cmd(string.format("highlight GitSignsDelete guifg='%s'", opts.colors.red))
-- vim.api.nvim_command("highlight GitSign"
end end
} }

View file

@ -1,3 +1,5 @@
local icons = require('config.icons').diff_gutter
return { return {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
lazy = false, lazy = false,
@ -7,10 +9,12 @@ return {
}, },
opts = { opts = {
signs = { signs = {
add = { text = '' }, add = { text = icons.add },
delete = { text = '' }, delete = { text = icons.delete },
change = { text = '' }, change = { text = icons.change },
untracked = { text = '+'} untracked = { text = icons.untracked },
topdelete = { text = icons.delete },
changedelete = { text = icons.change },
}, },
}, },
} }

View file

@ -1,12 +1,13 @@
return { return {
"ray-x/go.nvim", "ray-x/go.nvim",
main = "go",
dependencies = { dependencies = {
"ray-x/guihua.lua", "ray-x/guihua.lua",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
}, },
config = function() config = function(opts)
require("go").setup() require('go').setup(opts)
end, end,
event = {"CmdlineEnter"}, event = {"CmdlineEnter"},
ft = {"go", 'gomod'}, ft = {"go", 'gomod'},

View file

@ -1,4 +1,4 @@
return { return{
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
main = "ibl", main = "ibl",
opts = { opts = {

View file

@ -21,6 +21,7 @@ require("lazy").setup({
{ import = "plugins.indent" }, { import = "plugins.indent" },
{ import = "plugins.nvim-autopairs" }, { import = "plugins.nvim-autopairs" },
{ import = "plugins.mini-comment" }, { import = "plugins.mini-comment" },
{ import = "plugins.barbar" },
-- Filetree -- Filetree
{ import = "plugins.neo-tree" }, { import = "plugins.neo-tree" },
@ -37,6 +38,8 @@ require("lazy").setup({
-- Treesitter -- Treesitter
{ import = "plugins.treesitter" }, { import = "plugins.treesitter" },
{ import = "plugins.neotest" },
-- LSP -- LSP
{ import = "plugins.lsp" }, { import = "plugins.lsp" },
{ import = "plugins.nvim-cmp" }, { import = "plugins.nvim-cmp" },

View file

@ -3,16 +3,25 @@ return {
dependencies = { dependencies = {
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
'hrsh7th/cmp-nvim-lsp',
}, },
config = function() config = function()
-- Setup Mason to automatically install LSP servers -- Setup Mason to automatically install LSP servers
require('mason').setup() require('mason').setup()
require('mason-lspconfig').setup({ automatic_installation = true }) require('mason-lspconfig').setup({ automatic_installation = true })
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
-- local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false
local on_attach = function(ev)
vim.keymap.set('n', '<leader>rs', vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename symbol" })
end
-- php - phpactor -- php - phpactor
lspconfig.phpactor.setup({ lspconfig.phpactor.setup({
on_attach = on_attach,
capabilities = capabilities,
init_options = { init_options = {
["language_server_phpstan.enabled"] = true, ["language_server_phpstan.enabled"] = true,
["language_server_psalm.enabled"] = false, ["language_server_psalm.enabled"] = false,
@ -20,7 +29,10 @@ return {
}) })
-- GO -- GO
lspconfig.gopls.setup({}) lspconfig.gopls.setup({
on_attach = on_attach,
capabilities = capabilities
})
-- Tailwind CSS -- Tailwind CSS
--require('lspconfig').tailwindcss.setup({ capabilities = capabilities }) --require('lspconfig').tailwindcss.setup({ capabilities = capabilities })
@ -33,7 +45,9 @@ return {
}) })
-- Typescript -- Typescript
lspconfig.tsserver.setup({}) lspconfig.tsserver.setup({
capabilities = capabilities
})
-- lua -- lua
lspconfig.lua_ls.setup({ lspconfig.lua_ls.setup({
@ -55,14 +69,16 @@ return {
}) })
end end
return true return true
end end,
capabilities = capabilities
}) })
-- Config -- Config
-- Sign configuration -- Sign configuration
vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' }) local icons = require('config.icons').diagnostics
vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' }) vim.fn.sign_define('DiagnosticSignError', { text = icons.error, texthl = 'DiagnosticSignError' })
vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' }) vim.fn.sign_define('DiagnosticSignWarn', { text = icons.warn, texthl = 'DiagnosticSignWarn' })
vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) vim.fn.sign_define('DiagnosticSignInfo', { text = icons.info, texthl = 'DiagnosticSignInfo' })
vim.fn.sign_define('DiagnosticSignHint', { text = icons.hint, texthl = 'DiagnosticSignHint' })
end end
} }

View file

@ -1,26 +1,61 @@
local icons = require('config.icons')
return { return {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
event = "VeryLazy", event = "VeryLazy",
dependencies = { dependencies = {
'arkav/lualine-lsp-progress', 'arkav/lualine-lsp-progress',
'kyazdani42/nvim-web-devicons', 'nvim-tree/nvim-web-devicons',
}, },
opts = { opts = {
options = { options = {
component_separators = '', component_separators = '',
globalstatus = true, globalstatus = true,
disabled_filetypes = {
statusline = {
'dashboard',
'TelescopePrompt'
}
}
}, },
sections = { sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_x = { lualine_x = {
{ {
require("lazy.status").updates, require("lazy.status").updates,
cond = require("lazy.status").has_updates, cond = require("lazy.status").has_updates,
color = { fg = "#ff9e64" }, color = { fg = "#ff9e64" },
} },
-- {
-- "diff",
-- symbols = {
-- added = icons.diff.added .. ' ',
-- modified = icons.diff.modified .. ' ',
-- removed = icons.diff.removed .. ' '
-- }
-- },
{
"diagnostics",
symbols = {
error = icons.diagnostics.error .. ' ',
warn = icons.diagnostics.warn .. ' ',
info = icons.diagnostics.info .. ' ',
hint = icons.diagnostics.hint .. ' ',
},
},
}, },
lualine_y = { lualine_y = {
'encoding', 'fileformat', 'filetype' 'encoding',
} 'fileformat',
'filetype',
'location'
},
lualine_z = {}
}, },
extensions = {
'lazy',
'neo-tree'
}
} }
} }

View file

@ -1,7 +1,9 @@
return { return {
'echasnovski/mini.comment', 'echasnovski/mini.comment',
version = '*', version = '*',
config = function() opts = {
require('mini.comment').setup({}) options = {
end custom_commentstring = function() return vim.bo.commentstring end
}
}
} }

View file

@ -1,8 +1,10 @@
local icons = require('config.icons')
return { return {
'nvim-neo-tree/neo-tree.nvim', 'nvim-neo-tree/neo-tree.nvim',
cmd = 'Neotree', cmd = 'Neotree',
keys = { keys = {
{ '<leader>n', ':Neotree reveal toggle<CR>' }, { '<leader>fe', ':Neotree reveal toggle<CR>', desc = 'Toggle File Explorer'},
}, },
dependencies = { dependencies = {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
@ -21,30 +23,24 @@ return {
indent_marker = "", indent_marker = "",
last_indent_marker = "", last_indent_marker = "",
}, },
icon = { icon = icons.filetree.basic,
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
},
name = { name = {
use_git_status_colors = true, use_git_status_colors = false,
}, },
git_status = { git_status = {
symbols = { symbols = icons.filetree.git
-- Change type
added = "",
modified = "",
deleted = "",
renamed = "󰁕",
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
}
}, },
}, },
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function()
if vim.bo.filetype == "neo-tree" then
vim.cmd("setlocal statuscolumn=")
end
end,
}
},
filesystem = { filesystem = {
filtered_items = { filtered_items = {
visible = true, -- when true, they will just be displayed differently than normal items visible = true, -- when true, they will just be displayed differently than normal items
@ -56,6 +52,9 @@ return {
"vendor", "vendor",
}, },
}, },
follow_current_file = {
enable = true
},
}, },
} }
} }

View file

@ -0,0 +1,44 @@
return {
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-go",
"olimorris/neotest-phpunit"
},
keys = {
{"<leader>tn", ":lua require('neotest').run.run()<cr>", desc = "test nearest"},
{"<leader>tf", ":lua require('neotest').run.run(vim.fn.expand('%'))<cr>", desc = "test file"},
{"<leader>ta", ":lua require('neotest').output_panel.open()<cr>:lua require('neotest').run.run({suite = true})<cr>", desc = "test all"},
{"<leader>ts", ":lua require('neotest').run.stop()<cr>", desc = "stop test"},
{"<leader>tq", ":lua require('neotest').output_panel.close()<cr>", desc = "close output window"},
},
opts = function()
local icons = require('config.icons').test
return {
adapters = {
require("neotest-go")({
recursive_run = true
}),
require("neotest-phpunit")
},
icons = {
child_indent = "",
child_prefix = "",
collapsed = "",
expanded = "",
failed = icons.failed,
final_child_indent = " ",
final_child_prefix = "",
non_collapsible = "",
passed = icons.ok,
running = icons.running,
skipped = icons.skipped,
unknown = icons.unknown,
watching = icons.watch
}
}
end
}

View file

@ -1,27 +1,37 @@
local icons = require('config.icons')
return { return {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
tag = '0.1.4', tag = '0.1.4',
dependencies = { main = 'telescope',
dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
'kyazdani42/nvim-web-devicons' 'nvim-tree/nvim-web-devicons'
}, },
keys = require('config.telescope'), keys = require('config.telescope'),
config = function() opts = function()
require('telescope').setup({ local actions = require("telescope.actions")
return {
defaults = { defaults = {
path_display = { truncate = 1 }, path_display = { truncate = 1 },
prompt_prefix = ' ', prompt_prefix = ' ' .. icons.prompt .. ' ',
selection_caret = ' ', selection_caret = icons.current .. ' ',
file_ignore_patterns = { multi_icon = icons.selected .. ' ',
file_ignore_patterns = {
".git/", ".git/",
"node_modules/" "node_modules/"
}, },
mappings = {
i = {
["<esc>"] = actions.close
}
}
}, },
pickers = { pickers = {
find_files = { find_files = {
hidden = true hidden = true
}, }
}, }
}) }
end end,
} }

View file

@ -4,6 +4,7 @@ return {
require('nvim-treesitter.install').update({ with_sync = true }) require('nvim-treesitter.install').update({ with_sync = true })
end, end,
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
'nvim-treesitter/playground' 'nvim-treesitter/playground'
}, },
opts = { opts = {
@ -55,9 +56,9 @@ return {
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
-- indent = { indent = {
-- enable = true enable = true
--} }
}, },
config = function(_, opts) config = function(_, opts)
local parser_config = require('nvim-treesitter.parsers').get_parser_configs() local parser_config = require('nvim-treesitter.parsers').get_parser_configs()

View file

@ -10,12 +10,11 @@ return {
local wk = require("which-key") local wk = require("which-key")
wk.register({ wk.register({
f = { f = 'file',
name = "file", -- optional group name b = 'buffers',
f = { "<cmd>Telescope find_files<cr>", "Find File" }, -- create a binding with label t = 'test',
n = { "New File" }, -- just a label. don't create any mapping g = 'git',
e = "Edit File" -- same as above s = 'search'
},
}, { prefix = "<leader>" }) }, { prefix = "<leader>" })
end end
} }