diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 3924035..20985ad 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -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-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, - "go.nvim": { "branch": "master", "commit": "8efd0c89f2305a6840a99d7823c40cc3acea91d6" }, + "go.nvim": { "branch": "master", "commit": "43850d00feb887bc0195fe3331ff6fb76837f8e9" }, "guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, @@ -17,13 +19,17 @@ "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, "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-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" }, + "nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, "nvim-test": { "branch": "main", "commit": "e06f3d029ee161f3ead6193cf27354d1eb8723c3" }, - "nvim-treesitter": { "branch": "master", "commit": "c2a265156d5799adbd9f9e7d5385735fa5d21776" }, - "nvim-web-devicons": { "branch": "master", "commit": "69fb193abc547c77be089c3e392d5fd6fcd3625a" }, + "nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, diff --git a/nvim/lua/config/indent.lua b/nvim/lua/config/filetype.lua similarity index 76% rename from nvim/lua/config/indent.lua rename to nvim/lua/config/filetype.lua index 7b1ec4e..cd97afb 100644 --- a/nvim/lua/config/indent.lua +++ b/nvim/lua/config/filetype.lua @@ -1,12 +1,8 @@ +-- +-- Filetype settings +-- local autocmd = vim.api.nvim_create_autocmd 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 }) @@ -30,3 +26,9 @@ autocmd('Filetype', { pattern = { 'c', 'cpp' }, 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' +}) diff --git a/nvim/lua/config/icons.lua b/nvim/lua/config/icons.lua new file mode 100644 index 0000000..d4f27b3 --- /dev/null +++ b/nvim/lua/config/icons.lua @@ -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 = '', + } +} diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index df088b9..808df6f 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -1,3 +1,3 @@ require("config.settings") require("config.mappings") -require("config.indent") +require("config.filetype") diff --git a/nvim/lua/config/mappings.lua b/nvim/lua/config/mappings.lua index 6640a90..2f29fa3 100644 --- a/nvim/lua/config/mappings.lua +++ b/nvim/lua/config/mappings.lua @@ -1,21 +1,49 @@ +-- +-- Keymaps! Alot of stuff "borrowed" from thePrimeagen +-- local map = vim.keymap.set local cmd = vim.cmd vim.g.mapleader = " " --- Undo/Redo in insert mode -map("i", "", cmd.undo) -map("i", "", cmd.redo) +-- Make half page jumps stay in the center of screen +map("n", "", "zz", { silent = true, desc = "jump half a page up" }) +map("n", "", "zz", { silent = true, desc = "jump half a page down" }) +map("n", "", "zz", { silent = true, desc = "jump half a page up" }) +map("n", "", "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. -map("n", "", cmd.w) -map("i", "", cmd.w) +map({"n", "i"}, "", cmd.w, { desc = "save current buffer" }) --- Move Text -map("n", "", ":m+1") -map("n", "", ":m-2") +-- Move text +map("n", "", ":m -2v=", { silent = true, desc = "move current line one line up" }) +map("n", "", ":m +1v=", { silent = true, desc = "move current line one line down" }) +map("v", "", ":m '<-2gv=gv", { silent = true, desc = "move current selection one line up" }) +map("v", "", ":m '>+1gv=gv", { silent = true, desc = "move current selection one line down" }) + +-- copy/paste +map("x", "p", [["_dP]], { silent = true, desc = "Paste over selected text without losing content in \"-register" }) +map({"n", "v"}, "y", [["+y]], { desc = "Yank to system clipboard register" }) + +-- File operations +map("n", "fx", "!chmod +x %", { silent = true, desc = "Set execute flag on current file" }) + +-- buffers +map("n", "bn", cmd.bn, { silent = true, desc = "Move to next buffer"}) +map("n", "bb", cmd.bp, { silent = true, desc = "Move to previous buffer"}) +map("n", "bd", cmd.bd, { silent = true, desc = "Close current buffer"}) -- Indent +map('n', "", "v=") +map('x', "", "=", { desc = "auto indent selection" }) +map("i", "", "", { desc = "delete indent" }) --- Make Shift-Tab undo indent. -map("i", "", "") +-- Crazy search+replace +map("n", "rw", [[:%s/\<\>//gI]], { + desc = "search+replace word under cursor" +}) + +map("n", "Q", "") diff --git a/nvim/lua/config/settings.lua b/nvim/lua/config/settings.lua index 195b57a..52d09cd 100644 --- a/nvim/lua/config/settings.lua +++ b/nvim/lua/config/settings.lua @@ -1,25 +1,35 @@ --- +local set = vim.opt + -- 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 -- -vim.opt.scrolloff=20 +set.hlsearch = false +set.incsearch = true +set.laststatus = 3 +set.scrolloff=20 --vim.opt.sidescrolloff = 8 -vim.opt.cursorline = true +set.cursorline = true -- line numbers -vim.opt.number = true -vim.opt.relativenumber = true -vim.opt.numberwidth = 5 -vim.opt.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s ' +set.number = true +set.relativenumber = true +set.numberwidth = 5 +set.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s ' -- indent -vim.opt.smartindent = true +set.tabstop = 4 +set.softtabstop = 4 +set.shiftwidth = 4 +set.autoindent = true +set.smartindent = true -- Filetypes vim.filetype.add({ diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua index 7d21ad2..c71febc 100644 --- a/nvim/lua/config/telescope.lua +++ b/nvim/lua/config/telescope.lua @@ -1,8 +1,13 @@ return { { 'sf', 'Telescope find_files', desc = 'Search files' }, + { 'sa', 'Telescope live_grep', desc = 'Search in files' }, { 'sg', 'Telescope git_files', desc = 'Search Git files' }, - { 'sw', 'Telescope grep_string', desc = 'Search Word' }, + { 'sw', 'Telescope grep_string', desc = 'Search for word under cursor' }, -- LSP - --{ 'gd', 'Telescope lsp_definitions', desc = 'Goto definition' }, + { 'sr', 'Telescope lsp_references', desc = 'Search Reference' }, + { 'ss', 'Telescope lsp_document_symbols', desc = 'Search document symbols' }, + { 'sr', 'Telescope lsp_references', desc = 'Search Reference' }, + { 'sr', 'Telescope lsp_references', desc = 'Search Reference' }, + { 'gd', 'Telescope lsp_definitions', desc = 'Goto definition' }, } diff --git a/nvim/lua/plugins/barbar.lua b/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..ed3efee --- /dev/null +++ b/nvim/lua/plugins/barbar.lua @@ -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'}, + } + }, +} diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua index a4e0a86..0519857 100644 --- a/nvim/lua/plugins/colorscheme.lua +++ b/nvim/lua/plugins/colorscheme.lua @@ -52,5 +52,10 @@ return { local c = require('onedark') c.setup(opts) 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 } diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua index 78c4156..874727c 100644 --- a/nvim/lua/plugins/gitsigns.lua +++ b/nvim/lua/plugins/gitsigns.lua @@ -1,3 +1,5 @@ +local icons = require('config.icons').diff_gutter + return { 'lewis6991/gitsigns.nvim', lazy = false, @@ -7,10 +9,12 @@ return { }, opts = { signs = { - add = { text = '▌' }, - delete = { text = '' }, - change = { text = '▌' }, - untracked = { text = '+'} + add = { text = icons.add }, + delete = { text = icons.delete }, + change = { text = icons.change }, + untracked = { text = icons.untracked }, + topdelete = { text = icons.delete }, + changedelete = { text = icons.change }, }, }, } diff --git a/nvim/lua/plugins/go.lua b/nvim/lua/plugins/go.lua index 62854b8..d5bbd15 100644 --- a/nvim/lua/plugins/go.lua +++ b/nvim/lua/plugins/go.lua @@ -1,12 +1,13 @@ return { "ray-x/go.nvim", + main = "go", dependencies = { "ray-x/guihua.lua", "neovim/nvim-lspconfig", "nvim-treesitter/nvim-treesitter", }, - config = function() - require("go").setup() + config = function(opts) + require('go').setup(opts) end, event = {"CmdlineEnter"}, ft = {"go", 'gomod'}, diff --git a/nvim/lua/plugins/indent.lua b/nvim/lua/plugins/indent.lua index ca587a4..b759c06 100644 --- a/nvim/lua/plugins/indent.lua +++ b/nvim/lua/plugins/indent.lua @@ -1,4 +1,4 @@ -return { +return{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = { diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 39b612f..694bec2 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -21,6 +21,7 @@ require("lazy").setup({ { import = "plugins.indent" }, { import = "plugins.nvim-autopairs" }, { import = "plugins.mini-comment" }, + { import = "plugins.barbar" }, -- Filetree { import = "plugins.neo-tree" }, @@ -37,6 +38,8 @@ require("lazy").setup({ -- Treesitter { import = "plugins.treesitter" }, + { import = "plugins.neotest" }, + -- LSP { import = "plugins.lsp" }, { import = "plugins.nvim-cmp" }, diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 8911148..7708a0d 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -3,16 +3,25 @@ return { dependencies = { 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', + 'hrsh7th/cmp-nvim-lsp', }, config = function() -- Setup Mason to automatically install LSP servers require('mason').setup() require('mason-lspconfig').setup({ automatic_installation = true }) 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', 'rs', vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename symbol" }) + end -- php - phpactor lspconfig.phpactor.setup({ + on_attach = on_attach, + capabilities = capabilities, init_options = { ["language_server_phpstan.enabled"] = true, ["language_server_psalm.enabled"] = false, @@ -20,7 +29,10 @@ return { }) -- GO - lspconfig.gopls.setup({}) + lspconfig.gopls.setup({ + on_attach = on_attach, + capabilities = capabilities + }) -- Tailwind CSS --require('lspconfig').tailwindcss.setup({ capabilities = capabilities }) @@ -33,7 +45,9 @@ return { }) -- Typescript - lspconfig.tsserver.setup({}) + lspconfig.tsserver.setup({ + capabilities = capabilities + }) -- lua lspconfig.lua_ls.setup({ @@ -55,14 +69,16 @@ return { }) end return true - end + end, + capabilities = capabilities }) -- Config -- Sign configuration - vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' }) - vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' }) - vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' }) - vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) + local icons = require('config.icons').diagnostics + vim.fn.sign_define('DiagnosticSignError', { text = icons.error, texthl = 'DiagnosticSignError' }) + vim.fn.sign_define('DiagnosticSignWarn', { text = icons.warn, texthl = 'DiagnosticSignWarn' }) + vim.fn.sign_define('DiagnosticSignInfo', { text = icons.info, texthl = 'DiagnosticSignInfo' }) + vim.fn.sign_define('DiagnosticSignHint', { text = icons.hint, texthl = 'DiagnosticSignHint' }) end } diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 571e30b..31370f2 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -1,26 +1,61 @@ +local icons = require('config.icons') + return { 'nvim-lualine/lualine.nvim', event = "VeryLazy", dependencies = { 'arkav/lualine-lsp-progress', - 'kyazdani42/nvim-web-devicons', + 'nvim-tree/nvim-web-devicons', }, opts = { options = { component_separators = '', globalstatus = true, + disabled_filetypes = { + statusline = { + 'dashboard', + 'TelescopePrompt' + } + } }, sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, lualine_x = { { require("lazy.status").updates, cond = require("lazy.status").has_updates, 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 = { - 'encoding', 'fileformat', 'filetype' - } + 'encoding', + 'fileformat', + 'filetype', + 'location' + }, + lualine_z = {} }, + extensions = { + 'lazy', + 'neo-tree' + } } } diff --git a/nvim/lua/plugins/mini-comment.lua b/nvim/lua/plugins/mini-comment.lua index 5781c88..de19c9b 100644 --- a/nvim/lua/plugins/mini-comment.lua +++ b/nvim/lua/plugins/mini-comment.lua @@ -1,7 +1,9 @@ return { 'echasnovski/mini.comment', version = '*', - config = function() - require('mini.comment').setup({}) - end + opts = { + options = { + custom_commentstring = function() return vim.bo.commentstring end + } + } } diff --git a/nvim/lua/plugins/neo-tree.lua b/nvim/lua/plugins/neo-tree.lua index 8c8c0fd..2d31ccc 100644 --- a/nvim/lua/plugins/neo-tree.lua +++ b/nvim/lua/plugins/neo-tree.lua @@ -1,8 +1,10 @@ +local icons = require('config.icons') + return { 'nvim-neo-tree/neo-tree.nvim', cmd = 'Neotree', keys = { - { 'n', ':Neotree reveal toggle' }, + { 'fe', ':Neotree reveal toggle', desc = 'Toggle File Explorer'}, }, dependencies = { "MunifTanjim/nui.nvim", @@ -21,30 +23,24 @@ return { indent_marker = "│", last_indent_marker = "└", }, - icon = { - folder_closed = "", - folder_open = "", - folder_empty = "󰜌", - }, + icon = icons.filetree.basic, name = { - use_git_status_colors = true, + use_git_status_colors = false, }, git_status = { - symbols = { - -- Change type - added = "", - modified = "", - deleted = "✖", - renamed = "󰁕", - -- Status type - untracked = "", - ignored = "", - unstaged = "", - staged = "", - conflict = "", - } + symbols = icons.filetree.git }, }, + event_handlers = { + { + event = "neo_tree_buffer_enter", + handler = function() + if vim.bo.filetype == "neo-tree" then + vim.cmd("setlocal statuscolumn=") + end + end, + } + }, filesystem = { filtered_items = { visible = true, -- when true, they will just be displayed differently than normal items @@ -56,6 +52,9 @@ return { "vendor", }, }, + follow_current_file = { + enable = true + }, }, } } diff --git a/nvim/lua/plugins/neotest.lua b/nvim/lua/plugins/neotest.lua new file mode 100644 index 0000000..59fe0c0 --- /dev/null +++ b/nvim/lua/plugins/neotest.lua @@ -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 = { + {"tn", ":lua require('neotest').run.run()", desc = "test nearest"}, + {"tf", ":lua require('neotest').run.run(vim.fn.expand('%'))", desc = "test file"}, + {"ta", ":lua require('neotest').output_panel.open():lua require('neotest').run.run({suite = true})", desc = "test all"}, + {"ts", ":lua require('neotest').run.stop()", desc = "stop test"}, + {"tq", ":lua require('neotest').output_panel.close()", 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 +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 1132d42..cb32001 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,27 +1,37 @@ +local icons = require('config.icons') + return { - 'nvim-telescope/telescope.nvim', + 'nvim-telescope/telescope.nvim', tag = '0.1.4', - dependencies = { + main = 'telescope', + dependencies = { 'nvim-lua/plenary.nvim', - 'kyazdani42/nvim-web-devicons' + 'nvim-tree/nvim-web-devicons' }, keys = require('config.telescope'), - config = function() - require('telescope').setup({ + opts = function() + local actions = require("telescope.actions") + return { defaults = { path_display = { truncate = 1 }, - prompt_prefix = ' ', - selection_caret = ' ', - file_ignore_patterns = { + prompt_prefix = ' ' .. icons.prompt .. ' ', + selection_caret = icons.current .. ' ', + multi_icon = icons.selected .. ' ', + file_ignore_patterns = { ".git/", - "node_modules/" + "node_modules/" }, + mappings = { + i = { + [""] = actions.close + } + } }, pickers = { find_files = { hidden = true - }, - }, - }) - end + } + } + } + end, } diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index d14a2d5..b8ecc5a 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -4,6 +4,7 @@ return { require('nvim-treesitter.install').update({ with_sync = true }) end, dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/playground' }, opts = { @@ -55,9 +56,9 @@ return { additional_vim_regex_highlighting = false, }, - -- indent = { - -- enable = true - --} + indent = { + enable = true + } }, config = function(_, opts) local parser_config = require('nvim-treesitter.parsers').get_parser_configs() diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua index adf21b5..3c74157 100644 --- a/nvim/lua/plugins/which-key.lua +++ b/nvim/lua/plugins/which-key.lua @@ -10,12 +10,11 @@ return { local wk = require("which-key") wk.register({ - f = { - name = "file", -- optional group name - f = { "Telescope find_files", "Find File" }, -- create a binding with label - n = { "New File" }, -- just a label. don't create any mapping - e = "Edit File" -- same as above - }, + f = 'file', + b = 'buffers', + t = 'test', + g = 'git', + s = 'search' }, { prefix = "" }) end }